"use strict";const{contextBridge,ipcRenderer,webFrame}=require("electron");contextBridge.exposeInIsolatedWorld(25,"UP",{UA:(...e)=>ipcRenderer.send("ua",...e),ExtraWindow:(...e)=>ipcRenderer.send("extra-window",...e),Eval:async e=>webFrame.executeJavaScriptInIsolatedWorld(25,[{code:e}]).then(()=>!0,()=>!1),Script:async e=>webFrame.executeJavaScript(e).then(()=>!0,()=>!1),SharedSet:(...e)=>ipcRenderer.send("shared-set",...e),SharedGet:async(...e)=>ipcRenderer.invoke("shared-get",...e),Cookies:async(...e)=>ipcRenderer.invoke("cookies",...e),Request:async(...e)=>ipcRenderer.invoke("request",...e),OnRequest:e=>ipcRenderer.on("request",(r,...n)=>e(...n)),Reply:(...e)=>ipcRenderer.send("reply",...e),Message:(...e)=>ipcRenderer.send("message",...e),OnMessage:e=>ipcRenderer.on("message",(r,...n)=>e(...n))}),webFrame.executeJavaScript('(w=>{w.alert=text=>UP.Message("alert",text);w.prompt=(...a)=>(console.warn(...a),null);w.confirm=(...a)=>(console.log(a),true);})(window);'),contextBridge.exposeInMainWorld("UP",{Message:(...e)=>ipcRenderer.send("message",...e)}),ipcRenderer.on("eval",(e,r,n)=>webFrame.executeJavaScriptInIsolatedWorld(25,[{code:r}]).then(()=>!0,()=>!1).then(e=>ipcRenderer.send("eval-result",n,e))),ipcRenderer.on("script",(e,r,n)=>webFrame.executeJavaScript(r).then(()=>!0,()=>!1).then(e=>ipcRenderer.send("script-result",n,e))),webFrame.setIsolatedWorldInfo(25,{csp:"",name:"sender.services"});
