import{z as e,y as n}from"./index.8821dc9f.1766672520393.js";import{b as i}from"./app.66ee061b.1766672520393.js";const t={"tab://setting":()=>{e.emit("openController")},"tab://addSearchEngine":(n={})=>{n.size={width:window.innerWidth<500?"calc(100% - 15px)":"800px",height:window.innerWidth>500?"400px":window.innerHeight-200+"px",top:window.innerHeight>700?"260px":"15vh",closeBtn:!1},n.component="addSearchEngine",e.emit("openPlugin",n)},"tab://addicon":(n={})=>{e.emit("openApp",{...i.addIcon,data:n})},"tab://editAll":(e={})=>{setTimeout((()=>{n.state.editStatus=!0}),100)},"tab://background":(n={})=>{e.emit("openApp",i.wallpaper)},"tab://bookmark":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"1000px",height:window.innerWidth>500?"550px":window.innerHeight-200+"px"},n.component="bookmark",e.emit("openPlugin",n)},"tab://tip":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"600px",height:"450px",closeBtn:!0},n.component="tip",e.emit("openPlugin",n)}};window.openCard=function(n){let{width:i=null,height:t=null,minHeight:o=null,minWidth:d=null,custom:p={},origin:r={},id:a=""}=n;p||(p={});const{width:l=(window.innerWidth<1200?window.innerWidth<900?window.innerWidth:900:1200),height:w=(window.innerHeight<700?window.innerHeight:700)}=p;e.emit("openApp",{width:null==i?l:i,height:null==t?w:t,title:n.name,src:n.src,url:n.url,minHeight:o,minWidth:d,custom:p,origin:r,id:a})};const o=e=>{n.state.moveStatus=!1,window.openCard({name:e.name,src:e.src,url:e.window})},d=(i,t=!1)=>{const o=n.getters.find(i);if(o){const{app:n=0,custom:i={}}=o;if(1===n){if(/^http/.test(o.url),o.url,"/noteApp"===o.url)return void e.emit("openApp",{...o,name_en:"noteApp"});window.openCard({...o,origin:o})}else r(o.url,t)}},p=e=>{let n=document.createElement("a");n.href=e,n.target="_blank",n.click(),n.remove()},r=(e,i=!1)=>{if(t[e])t[e]();else if(i)p(e);else if(n.state.config.openType.linkOpen)p(e);else{let n=document.createElement("a");n.href=e,n.click(),n.remove()}};e.on("openCard",(e=>{window.openCard(e)}));export{t as C,d as a,o as b,p as o,r};
