import{_ as T}from"./filepath-item.vue-n2otfocd.js";import{_ as w}from"./nbadge-fn7hrj12.js";import{_ as k}from"./duration-display.vue-h9fie5qa.js";import{H as D,ax as B,D as V,_ as H,ay as F,Q as I}from"./er2hcepb.js";import{k as v,l as h,Q as o,S as _,U as n,a5 as C,a0 as c,M as p,W as d,R as W,V as P,$ as g,a6 as x,F as b,ab as E,Y as M}from"./vendor/json-editor-vue-gv8v06ez.js";import{_ as L}from"./nsection-block-f8z83agf.js";import{_ as Q}from"./help-fab.vue-d5mgp1hs.js";import"./vendor/unocss-f0kk6o39.js";import"./vendor/shiki-ml6g43ls.js";import"./nicon-title.vue-lmnsr02i.js";const R={flex:"~ gap2","items-center":""},Y={w8:"","text-right":"","text-sm":"",op25:""},j={key:0,"flex-auto":"","text-right":""},z=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,a=D(),l=h(()=>B(e.plugin.src,a.value?.rootDir||"").path);return(t,u)=>{const r=T,s=w,i=k;return o(),_("div",R,[n("div",Y,C(t.index),1),c(r,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),n("div",null,[l.value.startsWith("#")?(o(),p(s,{key:0,n:"rose",textContent:"virtual"})):l.value.startsWith(".")?d("",!0):(o(),p(s,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(o(),p(s,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(o(),p(s,{key:3,n:"orange",textContent:"client"})):d("",!0)]),t.plugin.metric?.duration!=null?(o(),_("div",j,[c(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),A={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},U={flex:"~ items-center gap-1","font-bold":""},q=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,a)=>{const l=V,t=W("ContentSlot");return o(),_("div",A,[n("div",U,[e.icon?(o(),p(l,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),n("div",null,C(e.title),1)]),n("div",null,[P(e.$slots,"default",{},()=>[c(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),G={};function J(m,e){const a=q;return o(),p(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[P(m.$slots,"default")]),_:3})}const K=H(G,[["render",J]]),O={class:"markdown-body"},X={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(l,t)=>{const u=K;return o(),_("div",O,[t[1]||(t[1]=n("h1",null,"Plugins",-1)),t[2]||(t[2]=n("p",null,[x("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),n("code",null,"plugins/"),x(" directory and they will be automatically imported and registered.")],-1)),c(u,null,{default:g(()=>t[0]||(t[0]=[x(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ")])),_:1}),t[3]||(t[3]=n("p",null,[n("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1))])}}},Z={pt4:""},tt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},pt=v({__name:"plugins",setup(m){const e=F(),a=I(),l=h(()=>{const u=e.value?.plugins||[],r=a.value?.metrics.clientPlugins()||[];return u.map(s=>{const i=typeof s=="string"?{src:s}:s;return{...i,metric:r.find(f=>f.src===i.src||f.src.startsWith(i.src))}})}),t=h(()=>{const u=a.value?.metrics.clientPlugins()||[],r=Math.min(...u.map(i=>i.start));return Math.max(...u.map(i=>i.end))-r});return(u,r)=>{const s=z,i=k,f=L,N=X,S=Q;return o(),_(b,null,[c(f,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${l.value.length}`},{default:g(()=>[n("div",Z,[(o(!0),_(b,null,E(l.value,(y,$)=>(o(),p(s,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:M($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",tt,[r[0]||(r[0]=n("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),r[1]||(r[1]=n("span",{op50:""},"Total execution time:",-1)),c(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),c(S,null,{default:g(()=>[c(N)]),_:1})],64)}}});export{pt as default};
