import{_ as T}from"./nbadge-hx8q1ml8.js";import{_ as S}from"./filepath-item.vue-ci7z8yh9.js";import{_ as k}from"./duration-display.vue-dzttyi5n.js";import{K as D,aw as B,H as V,b as H,ax as F,f as I}from"./ebt3cj6n.js";import{p as v,q as h,U as s,W as _,X as e,a8 as C,a3 as c,a2 as f,P as p,Z as d,V as W,Y as P,a9 as x,F as b,ae as E,a0 as L}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as M}from"./nsection-block-h1gauc17.js";import{_ as Y}from"./help-fab.vue-jfmsun8j.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-bpva4tco.js";import"./nicon-title.vue-hzhi6u0u.js";const j={flex:"~ gap2","items-center":""},q={w8:"","text-right":"","text-sm":"",op25:""},z={key:0,"flex-auto":"","text-right":""},A=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=S,i=k;return s(),_("div",j,[e("div",q,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",z,[c(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),K={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},R={flex:"~ items-center gap-1","font-bold":""},U=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(n,r)=>{const a=V,t=W("ContentSlot");return s(),_("div",K,[e("div",R,[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 Z(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 G=H(X,[["render",Z]]),J={class:"markdown-body"},O={__name:"plugins",setup(m,{expose:n}){return n({frontmatter:{}}),(a,t)=>{const l=G;return s(),_("div",J,[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))])}}},Q={pt4:""},tt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},pt=v({__name:"plugins",setup(m){const n=F(),r=I(),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=A,i=k,g=M,w=O,N=Y;return s(),_(b,null,[c(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${a.value.length}`},{default:f(()=>[e("div",Q,[(s(!0),_(b,null,E(a.value,(y,$)=>(s(),p(u,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"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(N,null,{default:f(()=>[c(w)]),_:1})],64)}}});export{pt as default};
