import{a8 as B,Z as A,a9 as F,H as z,M as T,Y as E,D as j}from"./er2hcepb.js";import{_ as L}from"./nselect-tabs.vue-fducs2m0.js";import{_ as P}from"./nnavbar.vue-hzjn49l3.js";import{_ as U}from"./filepath-item.vue-n2otfocd.js";import{_ as Y}from"./composable-item.vue-ec65e9jn.js";import{k as N,Q as a,S as l,F as y,ab as M,a0 as i,U as d,M as x,u as _,W as b,l as g,a5 as Q,b as S,$ as h}from"./vendor/json-editor-vue-gv8v06ez.js";import{_ as W}from"./nsection-block-f8z83agf.js";import{_ as X}from"./help-fab.vue-d5mgp1hs.js";import{D}from"./constants-b32h69zq.js";import"./vendor/unocss-f0kk6o39.js";import"./vendor/shiki-ml6g43ls.js";import"./nmarkdown.vue-ew01nvcn.js";import"./client-my5lks1i.js";import"./nicon-title.vue-lmnsr02i.js";const Z={flex:"~ wrap gap2",p2:"",pl4:""},q=N({__name:"ComposableTree",props:{map:{},root:{},metadata:{}},setup($){return(n,p)=>{const s=U,e=Y;return a(),l("div",null,[(a(!0),l(y,null,M(n.map.entries(),([o,v])=>(a(),l("div",{key:o},[i(s,{filepath:o,op50:"","hover:underline":""},null,8,["filepath"]),d("div",Z,[(a(!0),l(y,null,M(v,w=>(a(),x(e,{key:w.as,item:w,metadata:n.metadata,filepath:o.match(/^[\w@]/)?void 0:o},null,8,["item","metadata","filepath"]))),128))])]))),128))])}}}),G={key:0,flex:"~ col gap-2 items-start"},J=N({__name:"HelpImportsDirs",setup($){const n=B();return(p,s)=>{const e=U;return _(n)?.dirs?(a(),l("div",G,[(a(!0),l(y,null,M(_(n).dirs,o=>(a(),x(e,{key:o,filepath:o,"text-primary":""},null,8,["filepath"]))),128))])):b("",!0)}}}),K={flex:"~ gap-2 wrap",mb6:""},O=N({__name:"HelpImportsModules",setup($){const n=B(),p=g(()=>[...new Set(n.value?.imports.map(s=>A(s.from)).filter(s=>!!s&&!F(s)))]);return(s,e)=>(a(),l("div",K,[(a(!0),l(y,null,M(p.value,o=>(a(),l("code",{key:o,rounded:"","bg-primary:5":"",p:"x2 y0.5","text-primary":""},Q(o),1))),128))]))}}),R={class:"markdown-body"},ee={__name:"imports",setup($,{expose:n}){return n({frontmatter:{}}),(s,e)=>{const o=J,v=O;return a(),l("div",R,[e[0]||(e[0]=d("h1",null,"Auto imports",-1)),e[1]||(e[1]=d("p",null,"Nuxt auto-imports helper functions, composables and Vue APIs to be used across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. Components, composables or plugins can use these functions.",-1)),e[2]||(e[2]=d("hr",null,null,-1)),e[3]||(e[3]=d("p",null,"According to your config, exports of files under the following folders will be registed as auto-imports entry:",-1)),i(o),e[4]||(e[4]=d("p",null,"Meanwhile, modules could also provide auto-imports for their own components. You have auto-imports from the following modules as well:",-1)),i(v),e[5]||(e[5]=d("hr",null,null,-1)),e[6]||(e[6]=d("p",null,[d("a",{href:"https://nuxt.com/docs/guide/concepts/auto-imports",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1))])}}},oe={key:0,relative:"","h-full":"","of-auto":""},te={key:0,flex:"~ gap-2 items-center"},be=N({__name:"imports",setup($){const n=z(),p=S("all"),s=S(""),e=B(),o=g(()=>e.value?.metadata),v=g(()=>e.value?.imports.filter(m=>m.as||m.name).sort((m,u)=>(m.as||m.name).localeCompare(u.as||u.name))||[]),w=g(()=>new T(v.value,{keys:["from","as","name"]})),r=g(()=>{const m=new Map,u=new Map,k=new Map;let f=s.value?w.value.search(s.value).map(t=>t.item):v.value;p.value==="using"&&o.value?f=f.filter(t=>(t.as||t.name)in o.value.injectionUsage):p.value==="not-used"&&o.value&&(f=f.filter(t=>!((t.as||t.name)in o.value.injectionUsage)));const I={user:0,lib:0,builtin:0};return f.forEach(t=>{const c=E(t.from)?F(A(t.from))?k:u:m;c.has(t.from)||c.set(t.from,[]),c.get(t.from).push(t),I[c===m?"user":c===u?"lib":"builtin"]++}),{user:m,lib:u,builtin:k,count:I}});return(m,u)=>{const k=j,f=L,I=P,t=q,c=W,V=ee,H=X;return a(),l(y,null,[_(n)?(a(),l("div",oe,[i(I,{search:s.value,"onUpdate:search":u[1]||(u[1]=C=>s.value=C),pb3:""},{default:h(()=>[o.value?(a(),l("div",te,[i(k,{icon:"carbon-filter",op50:""}),i(f,{modelValue:p.value,"onUpdate:modelValue":u[0]||(u[0]=C=>p.value=C),n:"primary sm",options:[{label:"All",value:"all"},{label:"Using",value:"using"},{label:"Not used",value:"not-used"}]},null,8,["modelValue"])])):b("",!0)]),_:1},8,["search"]),r.value.user.size?(a(),x(c,{key:0,open:r.value.count.user<=_(D),icon:"carbon-function",text:"User composables",description:`${r.value.count.user} composables from ${r.value.user.size} modules`},{default:h(()=>[i(t,{map:r.value.user,root:_(n).rootDir,metadata:o.value},null,8,["map","root","metadata"])]),_:1},8,["open","description"])):b("",!0),r.value.builtin.size?(a(),x(c,{key:1,open:r.value.count.builtin<=_(D),icon:"simple-icons-nuxtdotjs",text:"Built-in composables",description:`${r.value.count.builtin} composables`},{default:h(()=>[i(t,{map:r.value.builtin,root:_(n).rootDir,metadata:o.value},null,8,["map","root","metadata"])]),_:1},8,["open","description"])):b("",!0),r.value.lib.size?(a(),x(c,{key:2,open:r.value.count.lib<=_(D),icon:"carbon-3d-mpr-toggle",text:"Composables from libraries",description:`${r.value.count.lib} composables from ${r.value.lib.size} packages`},{default:h(()=>[i(t,{map:r.value.lib,root:_(n).rootDir,metadata:o.value},null,8,["map","root","metadata"])]),_:1},8,["open","description"])):b("",!0)])):b("",!0),i(H,null,{default:h(()=>[i(V)]),_:1})],64)}}});export{be as default};