import{_ as w}from"./nnavbar.vue-b7eqg6ig.js";import{_ as D}from"./ncode-block.vue-bazndqbc.js";import{bl as B,bm as S,N as U,q as j,U as P,d as E}from"./h48l6b7a.js";import{R as i,U as c,V as a,l as I,c as f,w as R,m as d,a1 as l,a0 as u,F as _,ac as W,a6 as v,Z as q,N as z}from"./vendor/json-editor-vue-hrh84odz.js";import{_ as G}from"./help-fab.vue-fjxqso9x.js";import"./client-bvu6p7m4.js";import"./vendor/unocss-cbkcukyd.js";import"./vendor/shiki-nyzr6cds.js";const H={class:"markdown-body"},L={__name:"virtual-files",setup(h,{expose:r}){return r({frontmatter:{}}),(p,o)=>(i(),c("div",H,o[0]||(o[0]=[a("h1",null,"Virtual Files",-1),a("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1)])))}},Z=["onClick"],A={key:0,"h-full":"","of-hidden":"",flex:"~ col"},J={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},oe=I({__name:"virtual-files",setup(h){const r=f(""),n=B(),p=S(),o=f();R(()=>{if(!p.value)return;const e=`/_vfs.json/${encodeURIComponent(p.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>o.value=t.current)});function x(e){if(n.value?.rootDir)return e.startsWith(n.value?.rootDir)?e.slice(n.value.rootDir.length):e}const m=d(()=>n.value?n.value.entries.filter(e=>!e.id.startsWith(`${n.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),b=d(()=>new U(m.value,{keys:["id","path"]})),k=d(()=>r.value?b.value.search(r.value).map(e=>e.item):m.value);return(e,t)=>{const y=w,g=D,C=P,N=E,F=j,$=L,V=G;return i(),c(_,null,[l(F,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(y,{search:r.value,"onUpdate:search":t[0]||(t[0]=s=>r.value=s),"no-padding":"",p3:""},null,8,["search"]),(i(!0),c(_,null,W(k.value,s=>(i(),c(_,{key:s.id},[a("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:q(s.id===o.value?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:K=>p.value=s.id},v(x(s.id)),11,Z),t[1]||(t[1]=a("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[o.value?.content?(i(),c("div",A,[a("div",J,[a("code",null,v(o.value.id),1)]),l(g,{"h-full":"","of-auto":"","text-sm":"",code:o.value.content,lang:"typescript"},null,8,["code"])])):(i(),z(N,{key:1},{default:u(()=>[l(C,{px6:"",py2:""},{default:u(()=>t[2]||(t[2]=[a("span",{op75:""},"Select a file to start",-1)])),_:1})]),_:1}))]),_:1}),l(V,null,{default:u(()=>[l($)]),_:1})],64)}}});export{oe as default};
