import{aJ as L,aK as M,aL as R,b as s,aq as m,as as T,m as z,p as E,_ as H}from"./app-QjDgb7aF.js";import{X as N}from"./MkWindow-DgYYPaiE.js";import{p as W}from"./popout-k81uBT4r.js";import{b as D,a as r,j as u,g,i as v,q as f,u as a,t as F,p as b,x as K,H as w,D as S,F as V,f as p,B as i}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";import"./contains-OYmYIG20.js";const X=D({__name:"MkPageWindow",props:{initialPath:{}},emits:["closed"],setup(k,{expose:y}){const C=k,e=new L(M,C.initialPath);let n=r(),l=r();const o=r([{path:e.getCurrentPath(),key:e.getCurrentKey()}]),_=p(()=>{const t=[];return o.value.length>1&&t.push({icon:"ph-caret-left ph-bold ph-lg",onClick:B}),t}),x=p(()=>[{icon:"ph-arrow-clockwise ph-bold ph-lg",title:s.ts.reload,onClick:q},{icon:"ph-arrows-out-simple ph-bold ph-lg",title:s.ts.showInPage,onClick:h}]);let c=r(0);e.addListener("push",t=>{o.value.push({path:t.path,key:t.key})}),i("router",e),E(t=>{n.value=t}),i("shouldOmitHeaderTitle",!0),i("shouldBackButton",!1),i("shouldHeaderThin",!0);const P=p(()=>[{icon:"ph-arrows-out-simple ph-bold ph-lg",text:s.ts.showInPage,action:h},{icon:"ph-arrow-square-out ph-bold ph-lg",text:s.ts.popout,action:I},{icon:"ph-arrow-square-out ph-bold ph-lg",text:s.ts.openInNewTab,action:()=>{window.open(m+e.getCurrentPath(),"_blank"),l.value.close()}},{icon:"ph-link-simple ph-bold ph-lg",text:s.ts.copyLink,action:async()=>{await T(m+e.getCurrentPath())}}]);function B(){o.value.pop(),e.replace(o.value[o.value.length-1].path,o.value[o.value.length-1].key)}function q(){c.value++}function $(){l.value.close()}function h(){z.push(e.getCurrentPath(),"forcePage"),l.value.close()}function I(){W(e.getCurrentPath(),l.value.$el),l.value.close()}return y({close:$}),(t,d)=>(u(),g(N,{ref_key:"windowEl",ref:l,"initial-width":500,"initial-height":500,"can-resize":!0,"close-button":!0,"buttons-left":_.value,"buttons-right":x.value,contextmenu:P.value,onClosed:d[0]||(d[0]=j=>t.$emit("closed")),class:"page-window"},{header:v(()=>[a(n)?.value?(u(),b(V,{key:0},[a(n).value.icon?(u(),b("i",{key:0,class:K(["icon",a(n).value.icon]),style:{"margin-right":"0.5em"}},null,2)):w("",!0),f("span",null,S(a(n).value.title),1)],64)):w("",!0)]),default:v(()=>[f("div",{class:"yrolvcoq",style:F({background:a(n)?.value?.bg})},[(u(),g(R,{key:a(c),router:a(e)},null,8,["router"]))],4)]),_:1},8,["buttons-left","buttons-right","contextmenu"]))}}),Z=H(X,[["__scopeId","data-v-106c8e94"]]);export{Z as default};
//# sourceMappingURL=MkPageWindow-Dua498J6.js.map
