import{_ as T}from"./filepath-item.vue-oo6zkdxa.js";import{_ as w}from"./nbadge-h340m924.js";import{_ as k}from"./duration-display.vue-ntmie59a.js";import{H as D,ax as B,D as V,_ as H,ay as F,Q as I}from"./howhlbef.js";import{k as v,l as h,R as o,U as _,V as n,a6 as C,a1 as u,N as p,X as d,S as W,W as P,a0 as g,a7 as x,F as b,ac as E,Z as L}from"./vendor/json-editor-vue-gplv2x2n.js";import{_ as M}from"./nsection-block-k1t09ceo.js";import{_ as R}from"./help-fab.vue-fg8ssgz8.js";import"./vendor/unocss-fbcdcfn2.js";import"./vendor/shiki-enrzjv18.js";import"./nicon-title.vue-eldi1nlv.js";const j={flex:"~ gap2","items-center":""},z={w8:"","text-right":"","text-sm":"",op25:""},A={key:0,"flex-auto":"","text-right":""},Q=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,c)=>{const r=T,s=w,i=k;return o(),_("div",j,[n("div",z,C(t.index),1),u(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",A,[u(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),U={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},X={flex:"~ items-center gap-1","font-bold":""},Y=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,a)=>{const l=V,t=W("ContentSlot");return o(),_("div",U,[n("div",X,[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",{},()=>[u(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),Z={};function q(m,e){const a=Y;return o(),p(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[P(m.$slots,"default")]),_:3})}const G=H(Z,[["render",q]]),J={class:"markdown-body"},K={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(l,t)=>{const c=G;return o(),_("div",J,[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)),u(c,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))])}}},O={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 c=e.value?.plugins||[],r=a.value?.metrics.clientPlugins()||[];return c.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 c=a.value?.metrics.clientPlugins()||[],r=Math.min(...c.map(i=>i.start));return Math.max(...c.map(i=>i.end))-r});return(c,r)=>{const s=Q,i=k,f=M,N=K,S=R;return o(),_(b,null,[u(f,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${l.value.length}`},{default:g(()=>[n("div",O,[(o(!0),_(b,null,E(l.value,(y,$)=>(o(),p(s,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"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)),u(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),u(S,null,{default:g(()=>[u(N)]),_:1})],64)}}});export{pt as default};
