var c=Object.create;var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var b=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f(t))!u.call(e,a)&&a!==o&&s(e,a,{get:()=>t[a],enumerable:!(n=g(t,a))||n.enumerable});return e};var h=(e,t,o)=>(o=e!=null?c(w(e)):{},b(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e));var r=require("electron/renderer"),i=require("electron/common"),d=require("../modules/api"),l=require("../../common/global"),m=require("../../common/modules/client"),p=h(require("../../common/modules/l10n"));if(window.location.protocol==="file:")window.addEventListener("load",()=>{const e=document.getElementById("logo");e instanceof HTMLImageElement&&(e.src=m.appInfo.icons.app.toDataURL())}),r.contextBridge.exposeInMainWorld("webcord",{l10n:new p.default().web});else{const e=(0,d.generateSafeKey)();r.ipcRenderer.send("api-exposed",e),window.addEventListener("load",()=>window.localStorage.setItem("hideNag","true"));{let t=!0;document.addEventListener("paste",o=>{const n=i.clipboard.availableFormats();if(n.length===2&&n[0]?.startsWith("image/")&&n[1]==="text/html"&&t){console.debug("[WebCord] Applying clipboard workaround to the image\u2026"),t=!1,i.clipboard.write({image:i.clipboard.readImage(),html:i.clipboard.readHTML()}),o.stopImmediatePropagation(),r.ipcRenderer.send("paste-workaround",e);return}t=!0},!0)}r.ipcRenderer.on("navigate",(t,o)=>{(0,d.navigate)(o)})}(0,l.wLog)("Everything has been preloaded successfully!");
