import{_ as T}from"./nbadge-nvi0g272.js";import{_ as w}from"./filepath-item.vue-e483vj70.js";import{_ as k}from"./duration-display.vue-hy8s2ai6.js";import{A as D,a3 as B,I,b as V,x as F,f as H}from"./h93r34au.js";import{p as v,q as h,P as _,a1 as s,Q as e,a3 as c,R as d,a8 as C,a2 as f,S as p,Y as E,U as P,a9 as x,F as b,ae as W,X as A}from"./vendor/json-editor-vue-exjsfanq.js";import{_ as L}from"./nsection-block-mww8rvdp.js";import{_ as M}from"./help-fab.vue-iy7sqfnz.js";import"./vendor/unocss-n30bmhn8.js";import"./vendor/shiki-hjrnbayr.js";import"./nicon-title.vue-m2ftlsrz.js";const R={flex:"~ gap2","items-center":""},Y={w8:"","text-right":"","text-sm":"",op25:""},j={key:0,"flex-auto":"","text-right":""},q=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const n=m,r=D(),a=h(()=>B(n.plugin.src,r.value?.rootDir||"").path);return(t,l)=>{const o=T,u=w,i=k;return s(),_("div",R,[e("div",Y,C(t.index),1),c(u,{filepath:n.plugin.src,subpath:!0},{default:f(()=>[e("div",null,[a.value.startsWith("#")?(s(),p(o,{key:0,n:"rose",textContent:"virtual"})):a.value.startsWith(".")?d("",!0):(s(),p(o,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(s(),p(o,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(s(),p(o,{key:3,n:"orange",textContent:"client"})):d("",!0)])]),_:1},8,["filepath"]),t.plugin.metric?.duration!=null?(s(),_("div",j,[c(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),z={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},Q={flex:"~ items-center gap-1","font-bold":""},U=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(n,r)=>{const a=I,t=E("ContentSlot");return s(),_("div",z,[e("div",Q,[n.icon?(s(),p(a,{key:0,icon:n.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),e("div",null,C(n.title),1)]),e("div",null,[P(n.$slots,"default",{},()=>[c(t,{use:n.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),X={};function G(m,n){const r=U;return s(),p(r,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:f(()=>[P(m.$slots,"default")]),_:3})}const J=V(X,[["render",G]]),K={class:"markdown-body"},O={__name:"plugins",setup(m,{expose:n}){return n({frontmatter:{}}),(a,t)=>{const l=J;return s(),_("div",K,[t[1]||(t[1]=e("h1",null,"Plugins",-1)),t[2]||(t[2]=e("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 "),e("code",null,"plugins/"),x(" directory and they will be automatically imported and registered.")],-1)),c(l,null,{default:f(()=>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]=e("p",null,[e("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 n=F(),r=H(),a=h(()=>{const l=n.value?.plugins||[],o=r.value?.metrics.clientPlugins()||[];return l.map(u=>{const i=typeof u=="string"?{src:u}:u;return{...i,metric:o.find(g=>g.src===i.src||g.src.startsWith(i.src))}})}),t=h(()=>{const l=r.value?.metrics.clientPlugins()||[],o=Math.min(...l.map(i=>i.start));return Math.max(...l.map(i=>i.end))-o});return(l,o)=>{const u=q,i=k,g=L,N=O,S=M;return s(),_(b,null,[c(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${a.value.length}`},{default:f(()=>[e("div",Z,[(s(!0),_(b,null,W(a.value,(y,$)=>(s(),p(u,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:A($?"border-t":"")},null,8,["plugin","index","class"]))),128)),e("div",tt,[o[0]||(o[0]=e("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),o[1]||(o[1]=e("span",{op50:""},"Total execution time:",-1)),c(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),c(S,null,{default:f(()=>[c(N)]),_:1})],64)}}});export{pt as default};
