import{a4 as M,bc as j,bd as N,be as V,a6 as B,l as D,ag as k,bf as E,i as I,aa as L,r as O,n as P}from"#entry";import{p as $,k as C,q as x,r as W,D as q,z as R,w as b,M as S,J as U,Y as o,X as u,$ as w,a3 as r,ac as y,ab as A,u as T,ag as F,a1 as X}from"./vendor/json-editor-vue-ikjc812x.js";import{_ as z}from"./launch-page-l87i7ewv.js";import"./vendor/shiki-hpfujfi3.js";import"./vendor/unocss-hczpatch.js";import"./nmarkdown-n6zsr15e.js";import"./client-miiq4qin.js";const h=new Map,G=$({__name:"IframeView",props:{tab:{}},setup(f){const m=f,c=M(),p=C(),s=x(()=>m.tab.name),e=C(),t=W(j(p));q(()=>{const n=m.tab.view,l=n.persistent!==!1,_=["clipboard-write","clipboard-read"];if(h.get(s.value)&&l)e.value=h.get(s.value),e.value.style.visibility="visible";else{e.value=document.createElement("iframe"),e.value.setAttribute("allow",_.join("; ")),e.value.setAttribute("aria-label","Nuxt Devtools"),l&&h.set(s.value,e.value),e.value.src=n.src;try{e.value.style.opacity="0.01",e.value.onload=()=>{v(),i(),e.value.style.opacity="1"}}catch{e.value.style.opacity="1"}document.body.appendChild(e.value),R(d)}setTimeout(i,100)}),b(d),b(i),b(v),S(()=>{e.value&&(e.value.style.visibility="hidden")});function i(){if(!(!e.value||!e.value.contentWindow))try{const n=e.value.contentWindow.document.querySelector("html");n?.classList.toggle("dark",c.value==="dark"),n?.classList.toggle("light",c.value==="dark"),new MutationObserver(()=>{c.value=e.value?.contentWindow?.document.querySelector("html")?.classList.contains("dark")?"dark":"light"}).observe(n,{attributes:!0,attributeFilter:["class"]})}catch{}}const a=N();function v(){if(!(!e.value||!e.value.contentWindow))try{e.value.contentWindow.__NUXT_DEVTOOLS__=a.value}catch{}}function d(){e.value&&Object.assign(e.value.style,{position:"fixed",left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,outline:"none"})}return(n,l)=>(o(),U("div",{ref_key:"anchor",ref:p,"h-full":"","w-full":""},null,512))}}),J=Object.assign(G,{__name:"IframeView"}),Y={flex:"~ col gap2",mxa:"","items-center":""},H={"text-xl":""},K={"text-rose":""},se=$({__name:"custom-[name]",props:{name:{}},setup(f){const m=f,c=V(),p=B(),s=x(()=>m.name??c.params.name),e=D(),t=x(()=>e.value.find(i=>i.name===s.value));return q(()=>{t.value?t.value.requireAuth&&!k.value&&E():setTimeout(()=>{t.value||p.push("/modules/overview")},2e3)}),(i,a)=>{const v=I,d=L,n=J,l=z,_=P;return t.value?t.value.requireAuth&&!T(k)?(o(),u(d,{key:1})):t.value.view.type==="iframe"?(o(),u(n,{key:2,tab:t.value},null,8,["tab"])):t.value.view.type==="vnode"?(o(),u(F(t.value.view.vnode),{key:3})):t.value.view.type==="launch"?(o(),u(l,{key:4,name:`custom-${t.value.name}`,icon:t.value.view.icon||t.value.icon,title:t.value.view.title||t.value.title,description:t.value.view.description,actions:t.value.view.actions,onAction:a[0]||(a[0]=g=>T(O).customTabAction(t.value.name,g))},null,8,["name","icon","title","description","actions"])):(o(),u(v,{key:5},{default:w(()=>[X(_,{flex:"~ col","h-full":"","items-center":"","justify-center":""},{default:w(()=>[y(" Unknown tab type "+A(t.value.view),1)]),_:1})]),_:1})):(o(),u(v,{key:0},{default:w(()=>[r("div",Y,[a[3]||(a[3]=r("div",{"i-carbon-queued":"",mb2:"","text-5xl":"",op50:""},null,-1)),r("p",H,[a[1]||(a[1]=y(" Tab ",-1)),r("code",K,A(s.value),1),a[2]||(a[2]=y(" not found ",-1))]),a[4]||(a[4]=r("p",{op50:""}," It might because the module contributing this tab is not installed or enabled ",-1)),a[5]||(a[5]=r("p",{mt8:"","animate-pulse":""}," Redirecting to overview page... ",-1))])]),_:1}))}}});export{se as default};
