import{S as q,$ as N,a0 as j,a1 as B,l as E,a2 as S,a3 as k,a4 as V,c as W,r as D,W as I,a5 as L}from"./er2hcepb.js";import{k as T,b as C,l as x,r as P,x as M,n as O,w as b,G as R,S as U,Q as n,M as u,$ as y,u as A,a7 as F,U as r,a6 as w,a5 as $,a0 as G}from"./vendor/json-editor-vue-gv8v06ez.js";import{_ as Q}from"./launch-page.vue-f4th9x6r.js";import"./vendor/unocss-f0kk6o39.js";import"./vendor/shiki-ml6g43ls.js";import"./nmarkdown.vue-ew01nvcn.js";import"./client-my5lks1i.js";const h=new Map,X=T({__name:"IframeView",props:{tab:{}},setup(f){const m=f,c=q(),d=C(),s=x(()=>m.tab.name),e=C(),t=P(N(d));M(()=>{const o=m.tab.view,l=o.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=o.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),O(p)}setTimeout(i,100)}),b(p),b(i),b(v),R(()=>{e.value&&(e.value.style.visibility="hidden")});function i(){if(!(!e.value||!e.value.contentWindow))try{const o=e.value.contentWindow.document.querySelector("html");o?.classList.toggle("dark",c.value==="dark"),o?.classList.toggle("light",c.value==="dark"),new MutationObserver(()=>{c.value=e.value?.contentWindow?.document.querySelector("html")?.classList.contains("dark")?"dark":"light"}).observe(o,{attributes:!0,attributeFilter:["class"]})}catch{}}const a=j();function v(){if(!(!e.value||!e.value.contentWindow))try{e.value.contentWindow.__NUXT_DEVTOOLS__=a.value}catch{}}function p(){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(o,l)=>(n(),U("div",{ref_key:"anchor",ref:d,"h-full":"","w-full":""},null,512))}}),z={flex:"~ col gap2",mxa:"","items-center":""},H={"text-xl":""},J={"text-rose":""},ne=T({__name:"custom-[name]",props:{name:{}},setup(f){const m=f,c=B(),d=E(),s=x(()=>m.name??c.params.name),e=S(),t=x(()=>e.value.find(i=>i.name===s.value));return M(()=>{t.value?t.value.requireAuth&&!k.value&&V():setTimeout(()=>{t.value||d.push("/modules/overview")},2e3)}),(i,a)=>{const v=W,p=L,o=X,l=Q,_=I;return t.value?t.value.requireAuth&&!A(k)?(n(),u(p,{key:1})):t.value.view.type==="iframe"?(n(),u(o,{key:2,tab:t.value},null,8,["tab"])):t.value.view.type==="vnode"?(n(),u(F(t.value.view.vnode),{key:3})):t.value.view.type==="launch"?(n(),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=>A(D).customTabAction(t.value.name,g))},null,8,["name","icon","title","description","actions"])):(n(),u(v,{key:5},{default:y(()=>[G(_,{flex:"~ col","h-full":"","items-center":"","justify-center":""},{default:y(()=>[w(" Unknown tab type "+$(t.value.view),1)]),_:1})]),_:1})):(n(),u(v,{key:0},{default:y(()=>[r("div",z,[a[3]||(a[3]=r("div",{"i-carbon-queued":"",mb2:"","text-5xl":"",op50:""},null,-1)),r("p",H,[a[1]||(a[1]=w(" Tab ")),r("code",J,$(s.value),1),a[2]||(a[2]=w(" not found "))]),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{ne as default};
