@nuxt/devtools 1.0.0-beta.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -28
- package/dist/chunks/module-main.mjs +12 -13
- package/dist/client/200.html +17 -17
- package/dist/client/404.html +17 -17
- package/dist/client/__blank/index.html +17 -17
- package/dist/client/_nuxt/{CodeDiff.vue.4fcef1e4.js → CodeDiff.vue.72250861.js} +1 -1
- package/dist/client/_nuxt/{ComposableItem.vue.b4d03c6d.js → ComposableItem.vue.5fcac467.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.18fef0d4.js → DataSchemaButton.vue.b4fc42f9.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.714650a4.js → DataSchemaDrawer.ecd92b92.js} +5 -4
- package/dist/client/_nuxt/{DurationDisplay.vue.dd0f91f1.js → DurationDisplay.vue.7b02ae9f.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.a1b71b8d.js → FilepathItem.vue.6cdabcd4.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.f0924b60.js → HelpFab.vue.31b87f2a.js} +1 -1
- package/dist/client/_nuxt/LaunchPage.vue.06fcb257.js +1 -0
- package/dist/client/_nuxt/{NBadge.ff27dca2.js → NBadge.681f2fb6.js} +1 -1
- package/dist/client/_nuxt/NCheckbox.vue.23790c32.js +1 -0
- package/dist/client/_nuxt/NCodeBlock.vue.7cb5f01d.js +2 -0
- package/dist/client/_nuxt/NDrawer.vue.15b4d748.js +1 -0
- package/dist/client/_nuxt/NDropdown.vue.54157271.js +1 -0
- package/dist/client/_nuxt/{NIconTitle.vue.7b846ffe.js → NIconTitle.vue.2d1e44fb.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.9859bf11.js → NLink.vue.e913f358.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.79860402.js → NMarkdown.vue.20899182.js} +1 -1
- package/dist/client/_nuxt/NNavbar.vue.c506a970.js +1 -0
- package/dist/client/_nuxt/{NSectionBlock.acf7c6ed.js → NSectionBlock.d66bb8c4.js} +1 -1
- package/dist/client/_nuxt/{NSelect.vue.04805728.js → NSelect.vue.9e5ebac9.js} +1 -1
- package/dist/client/_nuxt/NSelectTabs.vue.9bf6517b.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.2e265fe1.js +1 -0
- package/dist/client/_nuxt/{NTip.vue.c98a31a2.js → NTip.vue.51a4b91d.js} +1 -1
- package/dist/client/_nuxt/StateEditor.vue.420289e1.js +1 -0
- package/dist/client/_nuxt/{__blank.eaeade3a.js → __blank.95ba7574.js} +1 -1
- package/dist/client/_nuxt/{analyze-build.92ac65df.js → analyze-build.5b09c13b.js} +1 -1
- package/dist/client/_nuxt/assets.f0ad2218.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -0
- package/dist/client/_nuxt/builds/meta/10bb1edc-fde3-4c52-91c9-404c411ae86d.json +1 -0
- package/dist/client/_nuxt/client.b2473ec3.js +1 -0
- package/dist/client/_nuxt/components.dcc368d1.js +98 -0
- package/dist/client/_nuxt/{custom-_name_.b17c1362.js → custom-_name_.129bf0b8.js} +1 -1
- package/dist/client/_nuxt/{default.201686e7.js → default.b857d80c.js} +1 -1
- package/dist/client/_nuxt/entry.7cb87d02.js +27 -0
- package/dist/client/_nuxt/{entry.aac067b6.css → entry.aa8c94e8.css} +1 -1
- package/dist/client/_nuxt/{error-404.18967c67.js → error-404.6518563d.js} +1 -1
- package/dist/client/_nuxt/{error-500.dcd91098.js → error-500.94c551da.js} +1 -1
- package/dist/client/_nuxt/{full.a9db422e.js → full.169e4977.js} +1 -1
- package/dist/client/_nuxt/{hooks.ad5f725f.js → hooks.f1018405.js} +1 -1
- package/dist/client/_nuxt/{imports.468b0281.js → imports.dda10442.js} +1 -1
- package/dist/client/_nuxt/{index.dacd63c3.js → index.02ce2a44.js} +1 -1
- package/dist/client/_nuxt/{index.86b321d0.js → index.05d4e5a2.js} +1 -1
- package/dist/client/_nuxt/json-editor-vue.b5b3ad21.js +129 -0
- package/dist/client/_nuxt/modules.25c79d85.js +2 -0
- package/dist/client/_nuxt/{none.37b64ac4.js → none.cebdb11e.js} +1 -1
- package/dist/client/_nuxt/{open-graph.03011848.js → open-graph.4871f819.js} +1 -1
- package/dist/client/_nuxt/overview.a8b5c91e.js +1 -0
- package/dist/client/_nuxt/pages.b6c85de5.js +1 -0
- package/dist/client/_nuxt/{payload.b7f38f74.js → payload.5d97df2d.js} +1 -1
- package/dist/client/_nuxt/{plugins.59bd86e7.js → plugins.f3bd0c25.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.aaa20729.js → runtime-configs.92408de9.js} +1 -1
- package/dist/client/_nuxt/server-routes.90d653e7.js +9 -0
- package/dist/client/_nuxt/{settings.12ae4ad7.js → settings.9790bb1a.js} +1 -1
- package/dist/client/_nuxt/{state-components.a78445e5.js → state-components.ca15f9b7.js} +1 -1
- package/dist/client/_nuxt/{state-modules.199ca5da.js → state-modules.c1654bb7.js} +1 -1
- package/dist/client/_nuxt/{storage-options.aeaf572e.js → storage-options.035e7403.js} +1 -1
- package/dist/client/_nuxt/{storage.f2e2d671.js → storage.c7339fe7.js} +1 -1
- package/dist/client/_nuxt/{terminals.091a556d.js → terminals.41bf8c60.js} +1 -1
- package/dist/client/_nuxt/timeline.ed636d87.js +29 -0
- package/dist/client/_nuxt/unocss-runtime.16c4cc56.js +2 -0
- package/dist/client/_nuxt/virtual-files.7d0bcad0.js +1 -0
- package/dist/client/index.html +17 -17
- package/dist/client/modules/analyze-build/index.html +17 -17
- package/dist/client/modules/assets/index.html +17 -17
- package/dist/client/modules/components/index.html +17 -17
- package/dist/client/modules/hooks/index.html +17 -17
- package/dist/client/modules/imports/index.html +17 -17
- package/dist/client/modules/modules/index.html +17 -17
- package/dist/client/modules/open-graph/index.html +17 -17
- package/dist/client/modules/overview/index.html +17 -17
- package/dist/client/modules/pages/index.html +17 -17
- package/dist/client/modules/payload/index.html +17 -17
- package/dist/client/modules/plugins/index.html +17 -17
- package/dist/client/modules/runtime-configs/index.html +17 -17
- package/dist/client/modules/server-routes/index.html +17 -17
- package/dist/client/modules/storage/index.html +17 -17
- package/dist/client/modules/terminals/index.html +17 -17
- package/dist/client/modules/timeline/index.html +17 -17
- package/dist/client/modules/virtual-files/index.html +17 -17
- package/dist/client/settings/index.html +17 -17
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/devtools.server.mjs +1 -2
- package/dist/runtime/plugins/view/FrameBox.vue +3 -0
- package/dist/runtime/plugins/view/Main.vue +21 -17
- package/dist/runtime/plugins/view/utils.d.ts +14 -0
- package/dist/runtime/plugins/view/utils.mjs +71 -1
- package/package.json +43 -39
- package/dist/client/_nuxt/LaunchPage.vue.c617b6d5.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.b56304c9.js +0 -1
- package/dist/client/_nuxt/NCodeBlock.vue.9ce69690.js +0 -2
- package/dist/client/_nuxt/NDrawer.vue.2b176b54.js +0 -1
- package/dist/client/_nuxt/NDropdown.vue.e90fcd0b.js +0 -1
- package/dist/client/_nuxt/NNavbar.vue.737ef1b1.js +0 -1
- package/dist/client/_nuxt/NSelectTabs.vue.626ecbdd.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.ff927669.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.1c34496c.js +0 -1
- package/dist/client/_nuxt/assets.c6f47fab.js +0 -16
- package/dist/client/_nuxt/client.17f79a3c.js +0 -1
- package/dist/client/_nuxt/components.80a04311.js +0 -98
- package/dist/client/_nuxt/entry.909ad6c7.js +0 -27
- package/dist/client/_nuxt/json-editor-vue.8a771ed0.js +0 -129
- package/dist/client/_nuxt/modules.dc1dbdef.js +0 -2
- package/dist/client/_nuxt/overview.acf4105d.js +0 -1
- package/dist/client/_nuxt/pages.061895e9.js +0 -1
- package/dist/client/_nuxt/server-routes.c8d34f99.js +0 -9
- package/dist/client/_nuxt/timeline.1210bb98.js +0 -29
- package/dist/client/_nuxt/unocss-runtime.c55f86fd.js +0 -2
- package/dist/client/_nuxt/virtual-files.7767a81f.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as Ce}from"./FilepathItem.vue.a1b71b8d.js";import{d as F,a as B,a9 as _e,o as m,h as O,j as v,k as s,a8 as R,f as d,v as z,t as T,m as x,G as H,p as S,i as h,F as L,n as D,x as ie,a4 as ve,am as ge,Q as ye,aK as Te,K as ce,L as de,U as Oe,aL as be,aM as xe,_ as X,y as Ne,z as Ve,aw as $e,aN as Ae,aO as Pe,aP as Be,an as Le,a0 as je,I as Re,at as ue,ar as Ee,aQ as De,a7 as He,r as W,af as Fe,l as Ue,aa as qe,X as Ke,R as We,aR as me}from"./entry.909ad6c7.js";import{_ as Ye,u as we,a as Ge}from"./state-modules.199ca5da.js";import{_ as Xe}from"./NSectionBlock.acf7c6ed.js";import{_ as Qe}from"./NIconTitle.vue.7b846ffe.js";import{_ as ke}from"./NDropdown.vue.e90fcd0b.js";import{_ as Je}from"./NNavbar.vue.737ef1b1.js";import{_ as Ze}from"./NBadge.ff27dca2.js";import{_ as et}from"./NCodeBlock.vue.9ce69690.js";import{_ as tt}from"./NLink.vue.9859bf11.js";import{_ as nt}from"./CodeDiff.vue.4fcef1e4.js";import{_ as it}from"./NTip.vue.c98a31a2.js";import{_ as ot}from"./HelpFab.vue.f0924b60.js";import"./NCheckbox.vue.b56304c9.js";import"./client.17f79a3c.js";const st={flex:"~ col gap2","flex-auto":"","of-hidden":"",px1:""},rt={"gap-1t":"",flex:"","items-center":"","text-ellipsis":"","ws-nowrap":"","text-lg":""},lt={key:2},at=s("div",{"flex-auto":""},null,-1),ct={key:1,flex:"~ gap-2",title:"Documentation"},dt=s("span",{"i-carbon-link":"","text-lg":"",op50:""},null,-1),ut={key:2,flex:"~ gap-2"},mt=s("span",{"i-carbon-logo-github":"","text-lg":"",op50:""},null,-1),ft={key:0,flex:"~ gap-4 items-center"},pt={flex:"~ gap-1 items-center",op50:""},ht={flex:"~ gap-1 items-center",op50:""},_t={flex:"~ col","items-end":""},vt={key:0,"h-20":"","w-20":"",flex:"","flex-none":"",rounded:"","bg-gray:3":"",p4:""},gt=["src","alt"],yt=s("div",{"i-carbon-cube":"",ma:"","text-4xl":"",op30:""},null,-1),bt={key:1,flex:"~",mt2:"","flex-auto":"","items-end":"","justify-end":""},xt=["src"],$t=s("div",{"flex-auto":""},null,-1),wt={flex:"","justify-end":""},kt="https://api.nuxtjs.org/api/ipx/s_80,f_webp/gh/nuxt/modules/main/icons/",It="https://api.nuxtjs.org/api/ipx/s_44,f_webp/gh_avatar/",St="https://github.com/",zt="https://www.npmjs.com/package/",oe=F({__name:"ModuleItemBase",props:{mod:{},info:{},compact:{type:Boolean},maintainers:{type:Boolean,default:!0}},setup(e){const t=e,n=B(()=>({...t.mod?.meta,...t.mod,...t.info})),o=_e();return(i,r)=>{const u=ie,c=ve,l=ge;return m(),O(l,{p4:"",flex:"~ gap2"},{default:v(()=>[s("div",st,[R(i.$slots,"main",{},()=>[s("div",rt,[i.mod.isPackageModule?(m(),O(u,{key:0,to:zt+(d(n).npm||d(n).name),target:"_blank",hover:"underline text-primary"},{default:v(()=>[z(T(d(n).name),1)]),_:1},8,["to"])):i.mod.entryPath?(m(),x("button",{key:1,role:"button",hover:"underline text-primary",onClick:r[0]||(r[0]=a=>d(o)(i.mod.entryPath))},T(d(n).name),1)):(m(),x("span",lt,T(d(n).name),1)),R(i.$slots,"badge")]),d(n).description?(m(),x("div",{key:0,class:H(i.compact?"ws-nowrap of-hidden truncate":"line-clamp-2"),"mt--1":"","text-sm":"",op50:""},T(d(n).description),3)):S("",!0),at,d(n).website?(m(),x("div",ct,[dt,h(u,{to:d(n).website,target:"_blank","of-hidden":"",truncate:"","ws-nowrap":"","text-sm":"",op50:"",hover:"op100 underline text-primary"},{default:v(()=>[z(T(d(n).website.replace(/^https?:\/\//,"")),1)]),_:1},8,["to"])])):S("",!0),d(n).github?(m(),x("div",ut,[mt,h(u,{to:d(n).github,target:"_blank","of-hidden":"",truncate:"","ws-nowrap":"","text-sm":"",op50:"",hover:"op100 underline text-primary"},{default:v(()=>[z(T(d(n).github.replace(/^https?:\/\/github.com\//,"")),1)]),_:1},8,["to"])])):S("",!0)]),R(i.$slots,"items"),d(n).stats?(m(),x("div",ft,[s("div",pt,[h(c,{icon:"carbon-star","text-lg":""}),s("span",null,T(d(n).stats.stars),1)]),s("div",ht,[h(c,{icon:"carbon-download","text-lg":""}),s("span",null,T(d(n).stats.downloads),1)])])):S("",!0)]),s("div",_t,[d(n).icon||i.mod.isPackageModule?(m(),x("div",vt,[d(n).icon?(m(),x("img",{key:0,src:kt+d(n).icon,alt:i.mod.name,ma:""},null,8,gt)):S("",!0),yt])):S("",!0),d(n).maintainers?.length&&i.maintainers?(m(),x("div",bt,[(m(!0),x(L,null,D(d(n).maintainers,a=>(m(),O(u,{key:a.name,target:"_blank",to:St+a.github,title:a.name},{default:v(()=>[s("img",{src:It+a.github,"h-6":"","w-6":"","rounded-full":""},null,8,xt)]),_:2},1032,["to","title"]))),128))])):S("",!0),i.$slots.actions?(m(),x(L,{key:2},[$t,s("div",wt,[R(i.$slots,"actions")])],64)):S("",!0)])]),_:3})}}}),Mt={key:0,flex:"~ gap-2",title:"Open on filesystem"},Ct=s("span",{"i-carbon-folder-move-to":"","text-lg":"",op50:""},null,-1),Tt=s("span",{"i-carbon-circle-dash":"","animate-spin":"","text-lg":"",op50:""},null,-1),Ot=s("code",{"text-sm":"",op50:""},"Upgrading...",-1),Nt={key:1,"mx--2":""},Vt=["onClick"],At=s("span",{"i-carbon-intent-request-active":"","text-lg":"","text-primary":""},null,-1),Pt=s("code",{"text-xs":""},"Update installed, click to restart",-1),Bt=[At,Pt],Lt={key:2,"mx--2":""},jt=["onClick"],Rt=s("span",{"i-carbon-intent-request-upgrade":"","text-lg":"",op50:""},null,-1),Et={op50:""},Dt=s("div",{"i-carbon-arrow-right":"",op50:""},null,-1),Ht={"text-green":""},Ft={key:3,flex:"~ gap-2","items-center":"",title:"NPM"},Ut=s("span",{"i-carbon-cube":"","text-lg":"",op50:""},null,-1),qt={"text-sm":"",op50:""},Kt=F({__name:"ModuleItem",props:{mod:{}},setup(e){const t=e,n=B(()=>t.mod.info),o=B(()=>({...t.mod?.meta,...t.mod,...n.value})),i=ye();return(r,u)=>{const c=Ce,l=ie,a=Ye,g=oe;return m(),O(g,{mod:r.mod,info:d(n)},{items:v(()=>[r.mod.entryPath?(m(),x("div",Mt,[Ct,h(c,{filepath:r.mod.entryPath,"text-sm":"",op50:"",hover:"text-primary op100"},null,8,["filepath"])])):S("",!0),d(o).npm?(m(),O(a,{key:d(o).npm,"package-name":d(o).npm,options:{dev:!0}},{default:v(({info:f,update:p,state:M,id:k,restart:b})=>[M==="running"?(m(),O(l,{key:0,flex:"~ gap-2","animate-pulse":"","items-center":"",to:k?"/modules/terminals":void 0,onClick:$=>k?i.value=k:void 0},{default:v(()=>[Tt,Ot]),_:2},1032,["to","onClick"])):M==="updated"?(m(),x("div",Nt,[s("button",{flex:"~ gap-2",hover:"bg-primary/20","items-center":"",rounded:"","bg-primary:10":"",px2:"","text-sm":"","text-primary":"",onClick:b},Bt,8,Vt)])):f?.needsUpdate?(m(),x("div",Lt,[s("button",{flex:"~ gap-2",title:"Click to upgrade","items-center":"",rounded:"",px2:"","text-sm":"",hover:"bg-active",onClick:$=>p()},[Rt,s("code",Et,"v"+T(f.current),1),Dt,s("code",Ht,"v"+T(f.latest),1)],8,jt)])):f?.latest?(m(),x("div",Ft,[Ut,s("code",qt,"v"+T(f.current),1)])):S("",!0)]),_:1},8,["package-name"])):S("",!0)]),_:1},8,["mod","info"])}}}),Wt=F({__name:"ModuleItemInstall",props:{item:{}},emits:["start"],setup(e,{emit:t}){const n=e,o=we(),i=B(()=>o.value.find(a=>a.name===n.item.npm)),r=B(()=>i.value&&i.value.isPackageModule),u=B(()=>i.value&&i.value.isPackageModule&&i.value.isUninstallable);async function c(a,g){const f=g==="install"?ce.installNuxtModule:ce.uninstallNuxtModule,p=await f(await de(),a.npm,!0);Oe(`modules:${g}`,{moduleName:a.npm}),p.commands&&await be.start(a,p,g)&&(xe.value.push({name:a.npm,info:a,processId:p.processId}),t("start"),await f(await de(),a.npm,!1))}const l={};return(a,g)=>{const f=Ze,p=X,M=ke,k=oe;return m(),O(k,{mod:l,role:d(r)?"":"button",info:a.item,mb2:"","h-full":"",class:H(d(r)?"border-dashed op75":"hover:bg-active!"),compact:!0,onClick:g[1]||(g[1]=b=>d(r)?null:c(a.item,"install"))},Te({_:2},[d(r)?{name:"badge",fn:v(()=>[h(f,{n:"green",textContent:"Installed"}),d(u)?(m(),O(M,{key:0,n:"sm green"},{trigger:v(({click:b})=>[h(p,{icon:"carbon-overflow-menu-vertical",border:!1,onClick:$=>b()},null,8,["onClick"])]),default:v(()=>[h(p,{icon:"carbon-trash-can",n:"red",onClick:g[0]||(g[0]=b=>c(a.item,"uninstall"))},{default:v(()=>[z(" Uninstall ")]),_:1})]),_:1})):S("",!0)]),key:"0"}:void 0]),1032,["role","info","class"])}}});function Yt(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var i=e.indexOf("Edge/");return i>0?parseInt(e.substring(i+5,e.indexOf(".",i)),10):-1}let Y;function Z(){Z.init||(Z.init=!0,Y=Yt()!==-1)}var Q={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Z(),$e(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",Y&&this.$el.appendChild(e),e.data="about:blank",Y||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Y&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Gt=Ae();Ne("data-v-b329ee4c");const Xt={class:"resize-observer",tabindex:"-1"};Ve();const Qt=Gt((e,t,n,o,i,r)=>(m(),O("div",Xt)));Q.render=Qt;Q.__scopeId="data-v-b329ee4c";Q.__file="src/components/ResizeObserver.vue";function G(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(t){return typeof t}:G=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function Jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Zt(e,t,n){return t&&fe(e.prototype,t),n&&fe(e,n),e}function pe(e){return en(e)||tn(e)||nn(e)||on()}function en(e){if(Array.isArray(e))return ee(e)}function tn(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function nn(e,t){if(e){if(typeof e=="string")return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ee(e,t)}}function ee(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function on(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sn(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function rn(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,i,r,u=function(l){for(var a=arguments.length,g=new Array(a>1?a-1:0),f=1;f<a;f++)g[f-1]=arguments[f];if(r=g,!(o&&l===i)){var p=n.leading;typeof p=="function"&&(p=p(l,i)),(!o||l!==i)&&p&&e.apply(void 0,[l].concat(pe(r))),i=l,clearTimeout(o),o=setTimeout(function(){e.apply(void 0,[l].concat(pe(r))),o=0},t)}};return u._clear=function(){clearTimeout(o),o=null},u}function Ie(e,t){if(e===t)return!0;if(G(e)==="object"){for(var n in e)if(!Ie(e[n],t[n]))return!1;return!0}return!1}var ln=function(){function e(t,n,o){Jt(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,o)}return Zt(e,[{key:"createObserver",value:function(n,o){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=sn(n),this.callback=function(c,l){i.options.callback(c,l),c&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var r=this.options.throttleOptions||{},u=r.leading;this.callback=rn(this.callback,this.options.throttle,{leading:function(l){return u==="both"||u==="visible"&&l||u==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var l=c[0];if(c.length>1){var a=c.find(function(f){return f.isIntersecting});a&&(l=a)}if(i.callback){var g=l.isIntersecting&&l.intersectionRatio>=i.threshold;if(g===i.oldResult)return;i.oldResult=g,i.callback(g,l)}},this.options.intersection),$e(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function Se(e,t,n){var o=t.value;if(o)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new ln(e,o,n);e._vue_visibilityState=i}}function an(e,t,n){var o=t.value,i=t.oldValue;if(!Ie(o,i)){var r=e._vue_visibilityState;if(!o){ze(e);return}r?r.createObserver(o,n):Se(e,{value:o},n)}}function ze(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var cn={beforeMount:Se,updated:an,unmounted:ze},dn={itemsLimit:1e3},un=/(auto|scroll)/;function Me(e,t){return e.parentNode===null?t:Me(e.parentNode,t.concat([e]))}var J=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},mn=function(t){return J(t,"overflow")+J(t,"overflow-y")+J(t,"overflow-x")},fn=function(t){return un.test(mn(t))};function he(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Me(e.parentNode,[]),n=0;n<t.length;n+=1)if(fn(t[n]))return t[n];return document.scrollingElement||document.documentElement}}function te(e){"@babel/helpers - typeof";return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(e)}var pn={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function hn(){return this.items.length&&te(this.items[0])!=="object"}var ne=!1;if(typeof window<"u"){ne=!1;try{var _n=Object.defineProperty({},"passive",{get:function(){ne=!0}});window.addEventListener("test",null,_n)}catch{}}let vn=0;var se={name:"RecycleScroller",components:{ResizeObserver:Q},directives:{ObserveVisibility:cn},props:{...pn,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,n=this.sizeField,o=this.minItemSize;let i=1e4,r=0,u;for(let c=0,l=t.length;c<l;c++)u=t[c][n]||o,u<i&&(i=u),r+=u,e[c]={accumulator:r,size:u};return this.$_computedMinItemSize=i,e}return[]},simpleArray:hn,itemIndexByKey(){const{keyField:e,items:t}=this,n={};for(let o=0,i=t.length;o<i;o++)n[t[o][e]]=o;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,o,i){const r=Pe({id:vn++,index:t,used:!0,key:o,type:i}),u=Be({item:n,position:0,nr:r});return e.push(u),u},unuseView(e,t=!1){const n=this.$_unusedViews,o=e.nr.type;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,o=this.gridItems||1,i=this.itemSecondarySize||n,r=this.$_computedMinItemSize,u=this.typeField,c=this.simpleArray?null:this.keyField,l=this.items,a=l.length,g=this.sizes,f=this.$_views,p=this.$_unusedViews,M=this.pool,k=this.itemIndexByKey;let b,$,w,V,I;if(!a)b=$=V=I=w=0;else if(this.$_prerender)b=V=0,$=I=Math.min(this.prerender,l.length),w=null;else{const y=this.getScroll();if(t){let N=y.start-this.$_lastUpdateScrollPosition;if(N<0&&(N=-N),n===null&&N<r||N<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=y.start;const A=this.buffer;y.start-=A,y.end+=A;let C=0;if(this.$refs.before&&(C=this.$refs.before.scrollHeight,y.start-=C),this.$refs.after){const N=this.$refs.after.scrollHeight;y.end+=N}if(n===null){let N,U=0,le=a-1,P=~~(a/2),ae;do ae=P,N=g[P].accumulator,N<y.start?U=P:P<a-1&&g[P+1].accumulator>y.start&&(le=P),P=~~((U+le)/2);while(P!==ae);for(P<0&&(P=0),b=P,w=g[a-1].accumulator,$=P;$<a&&g[$].accumulator<y.end;$++);for($===-1?$=l.length-1:($++,$>a&&($=a)),V=b;V<a&&C+g[V].accumulator<y.start;V++);for(I=V;I<a&&C+g[I].accumulator<y.end;I++);}else{b=~~(y.start/n*o);const N=b%o;b-=N,$=Math.ceil(y.end/n*o),V=Math.max(0,Math.floor((y.start-C)/n*o)),I=Math.floor((y.end-C)/n*o),b<0&&(b=0),$>a&&($=a),V<0&&(V=0),I>a&&(I=a),w=Math.ceil(a/o)*n}}$-b>dn.itemsLimit&&this.itemsLimitError(),this.totalSize=w;let _;const q=b<=this.$_endIndex&&$>=this.$_startIndex;if(q)for(let y=0,A=M.length;y<A;y++)_=M[y],_.nr.used&&(e&&(_.nr.index=k[_.item[c]]),(_.nr.index==null||_.nr.index<b||_.nr.index>=$)&&this.unuseView(_));const re=q?null:new Map;let E,j,K;for(let y=b;y<$;y++){E=l[y];const A=c?E[c]:E;if(A==null)throw new Error(`Key is ${A} on item (keyField is '${c}')`);if(_=f.get(A),!n&&!g[y].size){_&&this.unuseView(_);continue}j=E[u];let C=p.get(j),N=!1;if(!_)q?C&&C.length?_=C.pop():_=this.addView(M,y,E,A,j):(K=re.get(j)||0,(!C||K>=C.length)&&(_=this.addView(M,y,E,A,j),this.unuseView(_,!0),C=p.get(j)),_=C[K],re.set(j,K+1)),f.delete(_.nr.key),_.nr.used=!0,_.nr.index=y,_.nr.key=A,_.nr.type=j,f.set(A,_),N=!0;else if(!_.nr.used&&(_.nr.used=!0,N=!0,C)){const U=C.indexOf(_);U!==-1&&C.splice(U,1)}_.item=E,N&&(y===l.length-1&&this.$emit("scroll-end"),y===0&&this.$emit("scroll-start")),n===null?(_.position=g[y-1].accumulator,_.offset=0):(_.position=Math.floor(y/o)*n,_.offset=y%o*i)}return this.$_startIndex=b,this.$_endIndex=$,this.emitUpdate&&this.$emit("update",b,$,V,I),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:q}},getListenerTarget(){let e=he(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let o;if(this.pageMode){const i=e.getBoundingClientRect(),r=n?i.height:i.width;let u=-(n?i.top:i.left),c=n?window.innerHeight:window.innerWidth;u<0&&(c+=u,u=0),u+c>r&&(c=r-u),o={start:u,end:u+c}}else n?o={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:o={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return o},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,ne?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,o,i;if(this.pageMode){const r=he(this.$el),u=r.tagName==="HTML"?0:r[t.scroll],c=r.getBoundingClientRect(),a=this.$el.getBoundingClientRect()[t.start]-c[t.start];n=r,o=t.scroll,i=e+u+a}else n=this.$el,o=t.scroll,i=e;n[o]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const gn={key:0,ref:"before",class:"vue-recycle-scroller__slot"},yn={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function bn(e,t,n,o,i,r){const u=Le("ResizeObserver"),c=je("observe-visibility");return Re((m(),x("div",{class:H(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...l)=>r.handleScroll&&r.handleScroll(...l))},[e.$slots.before?(m(),x("div",gn,[R(e.$slots,"before")],512)):S("v-if",!0),(m(),O(ue(n.listTag),{ref:"wrapper",style:He({[e.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:H(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:v(()=>[(m(!0),x(L,null,D(i.pool,l=>(m(),O(ue(n.itemTag),Ee({key:l.nr.id,style:i.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${l.position}px) translate${e.direction==="vertical"?"X":"Y"}(${l.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===l.nr.key}]]},De(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=l.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:v(()=>[R(e.$slots,"default",{item:l.item,index:l.nr.index,active:l.nr.used})]),_:2},1040,["style","class"]))),128)),R(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(m(),x("div",yn,[R(e.$slots,"after")],512)):S("v-if",!0),h(u,{onNotify:r.handleResize},null,8,["onNotify"])],34)),[[c,r.handleVisibilityChange]])}se.render=bn;se.__file="src/components/RecycleScroller.vue";const xn={"h-full":"",flex:"~ col gap-4"},$n={flex:"~ items-center"},wn={flex:"~ col","w-30":"","of-auto":""},kn={flex:"~ justify-between","w-full":"","text-xs":"",capitalize:"",op75:""},In={"flex-auto":"","of-auto":"",flex:"~ col gap-2",pl6:"",pr4:""},Sn=F({__name:"ModuleInstallList",emits:["close"],setup(e,{emit:t}){const n=Ge(),o=["downloads","stars","updated","created"],i=W(!1),r=W(o[0]),u={downloads:(f,p)=>f.stats.downloads-p.stats.downloads,stars:(f,p)=>f.stats.stars-p.stats.stars,created:(f,p)=>f.stats.createdAt-p.stats.createdAt,updated:(f,p)=>f.stats.publishedAt-p.stats.publishedAt},c=B(()=>n.value?.slice().sort((f,p)=>u[r.value](f,p)*(i.value?1:-1))),l=W(""),a=B(()=>new Fe(c.value||[],{keys:["name","description","npm","category"]})),g=B(()=>l.value?a.value.search(l.value).map(f=>f.item):c.value);return(f,p)=>{const M=Qe,k=X,b=ve,$=ke,w=Je,V=Wt;return m(),x("div",xn,[h(M,{mx6:"",mt6:"","text-xl":"",op75:"",icon:"i-carbon-intent-request-create",text:"Install Module"}),h(w,{search:d(l),"onUpdate:search":p[1]||(p[1]=I=>Ue(l)?l.value=I:null),"no-padding":"","px-6":"","pb-5":"","pt-2":""},{actions:v(()=>[h($,{direction:"end",n:"sm primary"},{trigger:v(({click:I})=>[s("div",$n,[h(k,{icon:d(i)?"tabler:sort-ascending":"tabler:sort-descending","h-full":"","rounded-r-none":"",onClick:p[0]||(p[0]=_=>i.value=!d(i))},null,8,["icon"]),h(k,{flex:"~ justify-between","min-w-30":"","border-l-0":"","rounded-l-none":"","px-2":"",capitalize:"",hover:"border-l-1",onClick:_=>I()},{default:v(()=>[z(T(d(r))+" ",1),h(b,{icon:"carbon:chevron-down"})]),_:2},1032,["onClick"])])]),default:v(()=>[s("div",wn,[(m(),x(L,null,D(o,I=>h(k,{key:I,border:!1,p2:"",hover:"n-checkbox-hover text-green",onClick:_=>r.value=I},{default:v(()=>[s("span",kn,[z(T(I)+" ",1),d(r)===I?(m(),O(b,{key:0,icon:"carbon:checkmark"})):S("",!0)])]),_:2},1032,["onClick"])),64))])]),_:1})]),_:1},8,["search"]),s("div",In,[h(d(se),{class:"scroller",items:d(g),"item-size":200,"key-field":"name"},{default:v(({item:I})=>[h(V,{item:I,onStart:p[2]||(p[2]=_=>t("close"))},null,8,["item"])]),_:1},8,["items"])])])}}}),zn={flex:"~ col gap-2","w-150":"",p4:"",border:"t base"},Mn={capitalize:""},Cn=s("p",{op50:""}," Following command will be executed in your terminal: ",-1),Tn={op50:""},On=s("p",null,[s("span",{op50:""},"After that, Nuxt will "),s("span",{"text-orange":""},"restart automatically"),z(". ")],-1),Nn={flex:"~ gap-3",mt2:"","justify-end":""},Vn=F({__name:"ModuleActionDialog",setup(e){const t=qe(),n=_e(),o={};return(i,r)=>{const u=oe,c=et,l=tt,a=nt,g=it,f=X,p=Ke;return m(),O(d(be),null,{default:v(({resolve:M,args:k})=>[h(p,{"model-value":!0,onClose:b=>M(!1)},{default:v(()=>[h(u,{mod:o,info:k[0],border:"none","w-150":"","n-panel-grids":""},null,8,["info"]),s("div",zn,[s("h2",{"text-xl":"",class:H(k[2]==="install"?"text-primary":"text-red")},[s("span",Mn,T(k[2]),1),z(),s("code",null,T(k[0].name),1),z("? ")],2),Cn,h(c,{code:k[1].commands.join(" "),lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),s("p",Tn,[z(" Then your "),h(l,{role:"button",n:"primary",underline:"",onClick:r[0]||(r[0]=b=>d(n)(d(t)?._nuxtConfigFile)),textContent:"Nuxt config"}),z(" will be updated as: ")]),h(a,{from:k[1].configOriginal,to:k[1].configGenerated,"max-h-80":"","of-auto":"",py2:"",border:"~ base rounded",lang:"ts"},null,8,["from","to"]),On,s("div",Nn,[h(g,{n:"sm amber","flex-auto":"",icon:"i-carbon-data-backup"},{default:v(()=>[z(" Please make sure to backup your project first. ")]),_:1}),h(f,{onClick:b=>M(!1)},{default:v(()=>[z(" Cancel ")]),_:2},1032,["onClick"]),h(f,{n:"solid",capitalize:"",class:H(k[2]==="install"?"n-primary":"n-red"),onClick:b=>M(!0)},{default:v(()=>[z(T(k[2]),1)]),_:2},1032,["class","onClick"])])])]),_:2},1032,["onClose"])]),_:1})}}}),An={class:"markdown-body"},Pn=s("h1",null,"Modules",-1),Bn=s("p",null,[z("Nuxt provides a module system to extend the framework core and simplify integrations. You don’t need to develop everything from scratch or maintain boilerplate if there is already a Nuxt module for it. Adding Nuxt modules is possible using "),s("code",null,"nuxt.config"),z(".")],-1),Ln=s("p",null,[z("You can explore the list of modules on "),s("a",{href:"https://nuxt.com/modules",target:"_blank",rel:"noopener"},"nuxt.com/modules"),z(" or install them directly inside the DevTools.")],-1),jn=s("p",null,[s("a",{href:"https://nuxt.com/docs/guide/concepts/modules",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Rn=[Pn,Bn,Ln,jn],En={__name:"modules",setup(e,{expose:t}){return t({frontmatter:{}}),(o,i)=>(m(),x("div",An,Rn))}},Dn={"h-full":"","w-full":"","of-auto":""},Hn={relative:"","h-20":"","w-20":"",flex:"","flex-none":"",rounded:"","bg-gray:3":"",p3:""},Fn=["src","alt"],Un=s("div",{"i-carbon-cube":"",ma:"","text-4xl":"",op30:""},null,-1),qn={"text-lg":"","group-hover":"text-primary",transition:"",flex:"~ gap-2 items-center"},Kn=s("div",{"i-carbon-circle-dash":"","animate-spin":"","text-xl":"",op75:""},null,-1),Wn={op75:""},Yn=s("div",{"i-carbon-intent-request-create":"","text-4xl":"",op40:"","group-hover":"op75 text-primary",transition:""},null,-1),Gn=s("div",{"text-lg":"",op40:"","group-hover":"op75 text-primary",transition:""}," Install New Module ",-1),Xn={key:0,border:"l base",pos:"fixed bottom-0 right-0 top-0","z-200":"","w-150":"","bg-base":""},Qn="https://api.nuxtjs.org/api/ipx/s_80,f_webp/gh/nuxt/modules/main/icons/",fi=F({__name:"modules",setup(e){const t=W(!1),n=we(),o=ye(),i=B(()=>n.value.filter(u=>u.isPackageModule)),r=B(()=>n.value.filter(u=>!u.isPackageModule));return We(()=>[{id:"action:modules:install",title:"Install a new module",icon:"i-carbon-intent-request-create ",action:()=>{t.value=!0}}]),(u,c)=>{const l=Kt,a=ge,g=ie,f=Xe,p=X,M=Sn,k=Vn,b=En,$=ot;return m(),x(L,null,[s("div",Dn,[h(f,{icon:"carbon-3d-mpr-toggle",text:"Installed Modules","container-class":"grid grid-cols-minmax-400px gap3 px4",padding:!1,description:`Total modules: ${d(i).length}`},{default:v(()=>[(m(!0),x(L,null,D(d(i),w=>(m(),O(l,{key:w.name,mod:w},null,8,["mod"]))),128)),(m(!0),x(L,null,D("processInstallingModules"in u?u.processInstallingModules:d(xe),w=>(m(),O(g,{key:w.processId,block:"","min-h-30":"",to:"/modules/terminals",onClick:V=>o.value=w.processId},{default:v(()=>[h(a,{border:"1.5 dashed","h-full":"","animate-pulse":"",p4:"",transition:"",hover:"border-primary",flex:"~ col gap-1 items-center justify-center",role:"button",class:"group"},{default:v(()=>[s("div",Hn,[s("img",{src:Qn+w.info.icon,alt:w.info.name,ma:""},null,8,Fn),Un]),s("div",qn,[Kn,s("span",Wn,"Installing "+T(w.name)+"...",1)])]),_:2},1024)]),_:2},1032,["onClick"]))),128)),h(a,{border:"1.5 dashed","min-h-30":"",p4:"",transition:"",hover:"border-primary",flex:"~ col gap-2 items-center justify-center",role:"button",class:"group",onClick:c[0]||(c[0]=w=>t.value=!0)},{default:v(()=>[Yn,Gn]),_:1})]),_:1},8,["description"]),d(r).length?(m(),O(f,{key:0,icon:"carbon-3d-mpr-toggle",text:"User Modules","container-class":"grid grid-cols-minmax-400px gap3 px4",padding:!1,description:`Total modules: ${d(r).length}`},{default:v(()=>[(m(!0),x(L,null,D(d(r),w=>(m(),x(L,{key:w.meta?.name||w.entryPath},[w.meta?.name||w.entryPath?(m(),O(l,{key:0,mod:w},null,8,["mod"])):S("",!0)],64))),128))]),_:1},8,["description"])):S("",!0),h(me,{name:"fade-in"},{default:v(()=>[d(t)?(m(),x("div",{key:0,class:"fixed bottom-0 left-0 right-0 top-0 z-100","bg-black:20":"","backdrop-blur-2":"",onClick:c[1]||(c[1]=w=>t.value=!1)})):S("",!0)]),_:1}),h(me,{name:"slide-in"},{default:v(()=>[d(t)?(m(),x("div",Xn,[h(p,{icon:"carbon-close",pos:"absolute top-3 right-3 z-10","rounded-full":"","text-xl":"",border:!1,onClick:c[2]||(c[2]=w=>t.value=!1)}),h(M,{onClose:c[3]||(c[3]=w=>t.value=!1)})])):S("",!0)]),_:1}),h(k)]),h($,null,{default:v(()=>[h(b)]),_:1})],64)}}});export{fi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as L,as as V,aa as R,aH as T,b3 as M,b4 as O,O as E,a as w,h as m,j as n,A as P,o as s,f as e,m as c,k as t,i,t as r,p as l,F as h,b5 as f,b6 as x,b7 as $,v as a,aC as F,D as H,L as W,E as G,x as K,_ as U}from"./entry.909ad6c7.js";import{u as q,_ as J}from"./state-modules.199ca5da.js";import{_ as Q}from"./NTip.vue.c98a31a2.js";import{u as X}from"./state-components.a78445e5.js";import"./NBadge.ff27dca2.js";import"./NCodeBlock.vue.9ce69690.js";import"./client.17f79a3c.js";import"./NCheckbox.vue.b56304c9.js";const Y="1.0.0-beta.3",Z={key:0},tt={key:1,flex:"~ col gap2",ma:"","h-full":"","max-w-300":"","w-full":"",p5:"",px5:"","md:px20":""},et=t("div",{"flex-auto":""},null,-1),ot={flex:"~ col","mt-5":"","items-center":"","md:mt-20":""},nt=t("span",{op40:""}," Nuxt DevTools ",-1),st={op40:""},at={flex:"~ gap2 wrap"},it=t("div",{"logos-nuxt-icon":"","text-3xl":""},null,-1),lt=t("div",{"logos-vue":"","text-3xl":""},null,-1),ut=t("div",{"carbon-tree-view-alt":"","text-3xl":""},null,-1),rt=t("div",{"i-carbon-assembly-cluster":"","text-3xl":""},null,-1),dt=t("div",{"carbon-function":"","text-3xl":""},null,-1),ct=t("div",{"carbon-3d-mpr-toggle":"","text-3xl":""},null,-1),pt=t("div",{"carbon-plug":"","text-3xl":""},null,-1),_t={key:5,"pointer-events-none":"","min-w-40":"",p4:"","theme-card-lime":"",flex:"~ auto gap-6"},mt=t("div",{"i-carbon-time-plot":"","flex-none":"","text-3xl":""},null,-1),ht={grid:"~ cols-[auto_auto] gap-x-5 items-center"},ft=t("div",{"text-sm":""}," SSR to full load ",-1),xt={"text-right":""},vt=t("div",{"text-sm":""}," Page load ",-1),gt={"text-right":""},bt=t("div",{"text-sm":""}," Navigation ",-1),kt={"text-right":""},yt=t("div",{"text-sm":""}," HMR ",-1),Ct={"text-right":""},wt={flex:"~ col gap2"},Dt={flex:"~ gap-6 wrap","mt-5":"","items-center":"","justify-center":""},Bt=t("a",{href:"https://github.com/nuxt/devtools",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-blue",transition:""},[t("div",{"i-carbon-star":""}),a(" Star on GitHub ")],-1),St=t("a",{href:"https://github.com/nuxt/devtools/discussions/29",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-yellow",transition:""},[t("div",{"i-carbon-data-enrichment":""}),a(" Ideas & Suggestions ")],-1),zt=t("a",{href:"https://github.com/nuxt/devtools/discussions/31",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-lime",transition:""},[t("div",{"i-carbon-plan":""}),a(" Project Roadmap ")],-1),Nt=t("a",{href:"https://github.com/nuxt/devtools/issues",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-rose",transition:""},[t("div",{"i-carbon-debug":""}),a(" Bug Reports ")],-1),At=t("div",{"i-carbon-settings-adjust":""},null,-1),jt=t("div",{"flex-auto":""},null,-1),It={flex:"col gap-2",mxa:"",hidden:"","w-100":"","text-sm":"",op50:"","md:flex":""},Lt={flex:"~ gap-1","items-center":""},Vt=t("span",null,"+",-1),Rt=t("span",null,"+",-1),Tt=t("div",{"flex-auto":""},null,-1),Mt={flex:"~ gap-1","items-center":""},Ot=t("span",null,"+",-1),Et=t("span",null,"+",-1),Pt=t("span",null,"+",-1),$t=t("span",null,"+",-1),Ft=t("div",{"flex-auto":""},null,-1),Ht=t("div",null,"Toggle DevTools",-1),te=L({__name:"overview",setup(Wt){const v=V(),p=R(),D=X(),g=T(),B=q(),S=M(),b=O(),z=E();function N(){H.value=!0,z.push("/")}const k=w(()=>v.value?.nuxt.vueApp.version),u=w(()=>v.value?.metrics.loading());function A(){W()}return(o,Gt)=>{const j=G,_=K,y=J,C=Q,d=U,I=P;return s(),m(I,{"h-screen":"","w-full":"",flex:""},{default:n(()=>[e(p)?(s(),c("div",tt,[et,t("div",ot,[i(_,{flex:"~","mt--10":"","items-center":"","justify-center":"",to:"https://devtools.nuxt.com/",target:"_blank"},{default:n(()=>[i(j,{"h-10":""})]),_:1}),t("button",{mb6:"",mt3:"","text-center":"","text-sm":"",flex:"~ gap-1 wrap",onClick:N},[nt,t("code",st,"v"+r(e(Y)),1),i(y,{"package-name":"@nuxt/devtools",options:{dev:!0},"show-version":!1})])]),t("div",at,[i(_,{to:"https://nuxt.com",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[it,i(y,{"package-name":"nuxt",options:{dev:!0}})]),_:1}),e(k)?(s(),m(_,{key:0,to:"https://vuejs.org",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[lt,t("code",null,"v"+r(e(k)),1)]),_:1})):l("",!0),e(p)?(s(),c(h,{key:1},[e(p)&&e(p).pages&&e(v)?(s(),m(_,{key:0,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/pages"},{default:n(()=>[ut,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(S).length,"page")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:1,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/components"},{default:n(()=>[rt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(D).length,"component")),1)]),_:1})):l("",!0),e(p)&&e(g)?(s(),m(_,{key:2,"min-w-40":"",p4:"","theme-card-yellow":"",flex:"~ col auto",to:"/modules/imports"},{default:n(()=>[dt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(g).imports.length,"import")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:3,"min-w-40":"",p4:"","theme-card-purple":"",flex:"~ col auto",to:"/modules/modules"},{default:n(()=>[ct,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(B).length,"module")),1)]),_:1})):l("",!0),e(p)?(s(),m(_,{key:4,"min-w-40":"",p4:"","theme-card-teal":"",flex:"~ col auto",to:"/modules/plugins"},{default:n(()=>[pt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(p).plugins.length,"plugin")),1)]),_:1})):l("",!0),e(u)?(s(),c("div",_t,[mt,t("div",ht,[e(u).ssrStart?(s(),c(h,{key:0},[ft,t("div",xt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).appLoad-e(u).ssrStart)),1)],64)):l("",!0),vt,t("div",gt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).appLoad-e(u).appInit)),1),bt,t("div",kt,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).pageEnd-e(u).pageStart)),1),e(u).hmrStart?(s(),c(h,{key:1},[yt,t("div",Ct,r(("formatDuration"in o?o.formatDuration:e(x))(e(u).hmrEnd-e(u).hmrStart)),1)],64)):l("",!0)])])):l("",!0)],64)):l("",!0)]),t("div",wt,[("showConnectionWarning"in o?o.showConnectionWarning:e($))?(s(),m(C,{key:0,n:"yellow5",icon:"carbon-unlink","justify-center":""},{default:n(()=>[a(" Not connected to the client app, showing server-side data only. Use the embedded mode for full features. ")]),_:1})):l("",!0),t("button",{title:"Authorize",onClick:A},[("isDevAuthed"in o?o.isDevAuthed:e(F))?l("",!0):(s(),m(C,{key:0,n:"orange5",icon:"i-carbon-locked","justify-center":""},{default:n(()=>[a(" Access from an untrusted browser, some features are limited. Click to authorize now. ")]),_:1}))])]),t("div",Dt,[Bt,St,zt,Nt,i(_,{to:"/settings",flex:"~ gap1","inline-block":"","items-center":"",op50:"","hover:op80":""},{default:n(()=>[At,a(" Settings ")]),_:1})]),jt,t("div",It,[t("div",Lt,[e(b)?(s(),c(h,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⌘ Cmd ")]),_:1}),Vt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" K ")]),_:1})],64)):(s(),c(h,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Ctrl ")]),_:1}),Rt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" K ")]),_:1})],64)),Tt,a(" Open Command Palette ")]),t("div",Mt,[e(b)?(s(),c(h,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⇧ Shift ")]),_:1}),Ot,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" ⌥ Option ")]),_:1}),Et,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" D ")]),_:1})],64)):(s(),c(h,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Shift ")]),_:1}),Pt,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" Alt ")]),_:1}),$t,i(d,{n:"xs",class:"px2"},{default:n(()=>[a(" D ")]),_:1})],64)),Ft,Ht])])])):(s(),c("div",Z," Loading... "))]),_:1})}}});export{te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as E,r as B,a as x,an as O,f as t,o,m as s,k as e,t as k,h as y,j as b,bd as G,F as m,n as L,p as N,i as _,v as V,G as M,W as A,_ as H,a9 as q,be as D,a$ as J,b0 as Q,aa as X,ak as Y,b1 as Z,al as ee,l as te,ac as oe,K as ne,L as ae}from"./entry.909ad6c7.js";import{_ as j}from"./NBadge.ff27dca2.js";import{_ as F}from"./FilepathItem.vue.a1b71b8d.js";import{_ as se}from"./NSectionBlock.acf7c6ed.js";import{_ as re}from"./LaunchPage.vue.c617b6d5.js";import{_ as le}from"./HelpFab.vue.f0924b60.js";import"./NIconTitle.vue.7b846ffe.js";import"./NMarkdown.vue.79860402.js";import"./client.17f79a3c.js";const ie={block:"","cursor-pointer":""},ue={p2:""},ce=["onSubmit"],de=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1),pe={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},_e={key:1},he=E({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(R,{emit:u}){const p=R,h=B([]),f=x(()=>{const c=g(p.route.path);return h.value=Array.from({length:c.length},()=>""),c});function g(c){return c.split(/(:\w+[\?\*]?(?:\(\))?)/).filter(Boolean).map(d=>d[0]===":"?d.replace(/\(\)$/,"?"):d)}const $=x(()=>f.value.map((c,d)=>c[0]===":"?h.value[d]:c).join("").replace(/\/+/g,"/")),r=x(()=>p.route.path.includes(":"));function n(){u("navigate",$.value)}return(c,d)=>{const C=A,a=H,i=O("VDropdown");return t(r)?(o(),y(i,{key:1},{popper:b(({hide:l})=>[e("div",ue,[e("form",{flex:"~ col",onSubmit:G(()=>{n(),l()},["prevent"])},[t(r)?(o(),s(m,{key:0},[de,e("div",pe,[(o(!0),s(m,null,L(t(f),(v,P)=>(o(),s(m,{key:P},[v[0]===":"?(o(),y(C,{key:0,modelValue:t(h)[P],"onUpdate:modelValue":I=>t(h)[P]=I,"w-20":"","n-sm":"",placeholder:v.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(o(),s("span",_e,k(v),1))],64))),128))])],64)):N("",!0),_(a,{block:"",n:"primary"},{default:b(()=>[V(" Navigate ")]),_:1})],40,ce)])]),default:b(()=>[e("code",ie,[(o(!0),s(m,null,L(t(f),(l,v)=>(o(),s("span",{key:v,class:M(l[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},k(l[0]===":"?l.slice(1):l),3))),128))])]),_:1})):(o(),s("button",{key:0,onClick:n},[e("code",null,k(c.route.path),1)]))}}}),me={"w-full":""},fe=e("thead",{border:"b base"},[e("tr",null,[e("th",{"text-left":""}),e("th",{"text-left":""}," Route Path "),e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Middleware "),e("th",null," Layout ")])],-1),ge={"w-20":"","pr-1":""},ve={flex:"","items-center":"","justify-end":""},ye={"text-sm":""},be={flex:"inline gap3","items-center":""},xe={op0:"","group-hover:op100":"",flex:"~ gap1"},ke=["onClick"],$e=e("div",{"i-carbon-script-reference":""},null,-1),we=[$e],Ne={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},Re={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},Ce={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},Pe={key:0},Ve=["onClick"],Ie=E({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(R){const u=R,p=q(),h=D(),f=x(()=>[...u.pages].sort((r,n)=>r.path.localeCompare(n.path)));function g(r){const n=u.layouts.find(c=>c.name===r);n&&p(n.file)}function $(r){if(typeof r=="string")return h.value?.middleware.find(n=>n.name===r)?.path}return(r,n)=>{const c=j,d=he,C=F;return o(),s("div",null,[e("table",me,[fe,e("tbody",null,[(o(!0),s(m,null,L(t(f),a=>(o(),s("tr",{key:a.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",ge,[e("div",ve,[r.matched.find(i=>i.name===a.name)?(o(),y(c,{key:0,n:"green",title:"active",textContent:"active"})):r.matchedPending.find(i=>i.name===a.name)?(o(),y(c,{key:1,n:"teal",title:"next",textContent:"next"})):N("",!0)])]),e("td",ye,[e("div",be,[_(d,{route:a,class:M(r.matched.find(i=>i.name===a.name)?"text-primary":r.matchedPending.find(i=>i.name===a.name)?"text-teal":""),onNavigate:n[0]||(n[0]=i=>r.$emit("navigate",i))},null,8,["route","class"]),e("div",xe,[a.file||a.meta?.file?(o(),s("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:i=>t(p)(a.file||a.meta?.file)},we,8,ke)):N("",!0)])])]),e("td",Ne,k(a.name),1),e("td",Re,[_(C,{filepath:$(a.meta.middleware),override:`${a.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",Ce,[a.meta.layout===!1?(o(),s("span",Pe,"-")):a.meta.layout?(o(),s("button",{key:1,onClick:i=>g(a.meta.layout)},k(a.meta.layout),9,Ve)):(o(),s("button",{key:2,"text-sm":"",op15:"",onClick:n[1]||(n[1]=i=>g("default"))}," (default) "))])]))),128))])])])}}}),Le={class:"markdown-body"},Te=e("h1",null,"Pages",-1),Be=e("p",null,[V("Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood. Pages are Vue components and can have any valid extension that Nuxt supports (by default .vue, .js, .jsx, .mjs, .ts or .tsx). Nuxt will automatically create a route for every page in your "),e("code",null,"~/pages/"),V(" directory.")],-1),Ee=e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Me=e("hr",null,null,-1),Ae=e("h1",null,"Middlewares",-1),De=e("p",null,"Nuxt provides a customizable route middleware framework that can be used throughout the application. This is ideal for extracting code that needs to run before navigating to a particular route.",-1),je=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Fe=[Te,Be,Ee,Me,Ae,De,je],Se={__name:"pages",setup(R,{expose:u}){return u({frontmatter:{}}),(h,f)=>(o(),s("div",Le,Fe))}},ze={key:0,"h-full":"","of-auto":""},Ke={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},Ue=e("span",{op50:""},"Navigate from ",-1),We={"font-mono":""},Oe=e("span",{op50:""}," to ",-1),Ge={key:1,op50:""},He=e("span",null,[V("Press "),e("b",{"font-bold":""},"Enter"),V(" to navigate")],-1),qe={key:0,"text-orange":"",op75:""},Je={key:1,op50:""},Qe={"min-h-14":""},Xe={key:1,class:"py-4 text-center"},Ye=e("span",{op50:""},"No routes matched",-1),Ze=[Ye],et={"w-full":""},tt=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1),ot={mr1:""},pt=E({__name:"pages",setup(R){const u=J(),p=Q(),h=X(),f=D(),g=Y(),$=Z(),r=x(()=>f.value?.middleware||[]),n=B(""),c=B(0),d=x(()=>(r.value,n.value,g.value,c.value,u.value?.currentRoute?.value?.path));ee(()=>{p.value&&(n.value=u.value?.currentRoute?.value?.path),u.value?.beforeEach(l=>{n.value=l.fullPath}),u.value?.afterEach(l=>{n.value=l.fullPath})});async function C(){n.value!==u.value?.currentRoute?.value?.path&&u.value.push(n.value||"/")}const a=x(()=>u.value.resolve(n.value||"/").matched);function i(l){u.value.push(l),n.value=l}return(l,v)=>{const P=A,I=Ie,T=se,S=j,z=F,K=re,U=Se,W=le;return o(),s(m,null,[t(h)?.pages&&t(u)?(o(),s("div",ze,[e("div",Ke,[e("div",null,[t(d)!==t(n)?(o(),s(m,{key:0},[Ue,e("span",We,k(t(d)),1),Oe],64)):(o(),s("span",Ge,"Current route"))]),_(P,{modelValue:t(n),"onUpdate:modelValue":v[0]||(v[0]=w=>te(n)?n.value=w:null),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:M(t(d)===t(n)?"":t(a).length?"text-green":"text-orange"),onKeydown:oe(C,["enter"])},null,8,["modelValue","class","onKeydown"]),e("div",null,[t(d)!==t(n)?(o(),s(m,{key:0},[He,t(a).length?N("",!0):(o(),s("span",qe," (no match)"))],64)):(o(),s("span",Je,"Edit path above to navigate"))])]),_(T,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:b(()=>[e("div",Qe,[t(a).length?(o(),y(I,{key:0,pages:t(a),layouts:t(g)||[],matched:t(p).matched,"matched-pending":t(a),onNavigate:i},null,8,["pages","layouts","matched","matched-pending"])):(o(),s("div",Xe,Ze))])]),_:1}),_(T,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${t($).length} routes registered in your application`,padding:"pr5"},{default:b(()=>[_(I,{pages:t($),layouts:t(g)||[],matched:t(p).matched,"matched-pending":t(a),onNavigate:i},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),t(r).length?(o(),y(T,{key:0,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${t(r).length} middleware registered in your application`,padding:"px13"},{default:b(()=>[e("table",et,[tt,(o(!0),s(m,null,L(t(r),w=>(o(),s("tr",{key:w.path,"h-7":""},[e("td",null,[e("span",ot,k(w.name),1),w.global?(o(),y(S,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"global"})):N("",!0)]),e("td",null,[_(z,{filepath:w.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):N("",!0)])):(o(),y(K,{key:1,icon:"carbon-tree-view-alt",name:"wizard-pages",title:"Nuxt Routing",description:"Create `./pages/index.vue` to enable routing",actions:[{label:"Learn more",src:"https://nuxt.com/docs/getting-started/routing",attrs:{n:"primary"}},{label:"Enable Routing",async handle(){return("rpc"in l?l.rpc:t(ne)).runWizard(await("ensureDevAuthToken"in l?l.ensureDevAuthToken:t(ae))(),"enablePages")}}]},null,8,["actions"])),_(W,null,{default:b(()=>[_(U)]),_:1})],64)}}});export{pt as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as P,bk as Fe,ay as ze,aw as He,w as xe,bl as We,bm as Ge,d as ae,bn as we,o as t,m as v,k as d,G as j,h as k,f as e,bo as se,t as E,p as U,v as H,a7 as Je,a8 as ee,F as N,n as A,a4 as ce,Y as Ke,a as V,i as m,j as x,W as $e,_ as fe,bp as Qe,aa as Ye,as as Xe,au as pe,a9 as Ze,ax as et,e as tt,a0 as Se,l as X,I as le,ar as ot,U as nt,A as Ve,bq as st,br as lt,af as at,S as rt,bs as it,am as ut}from"./entry.909ad6c7.js";import{_ as dt}from"./NNavbar.vue.737ef1b1.js";import{_ as Te}from"./NBadge.ff27dca2.js";import{_ as Re}from"./NSelect.vue.04805728.js";import{_ as pt}from"./NCheckbox.vue.b56304c9.js";import{u as Ue,_ as ct}from"./storage-options.aeaf572e.js";import{_ as ft}from"./DataSchemaButton.vue.18fef0d4.js";import{_ as mt}from"./NCodeBlock.vue.9ce69690.js";import{C as ke,S as Ne}from"./constants.2cc6e981.js";import{U as vt}from"./json-editor-vue.8a771ed0.js";import{_ as ht}from"./NSectionBlock.acf7c6ed.js";import{_ as yt}from"./NDrawer.vue.2b176b54.js";import"./client.17f79a3c.js";import"./NIconTitle.vue.7b846ffe.js";const ne=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function _t(u,y){if(typeof u!="string")throw new TypeError("argument str must be a string");const h={},$=(y||{}).decode||kt;let g=0;for(;g<u.length;){const c=u.indexOf("=",g);if(c===-1)break;let s=u.indexOf(";",g);if(s===-1)s=u.length;else if(s<c){g=u.lastIndexOf(";",c-1)+1;continue}const i=u.slice(g,c).trim();if(h[i]===void 0){let r=u.slice(c+1,s).trim();r.codePointAt(0)===34&&(r=r.slice(1,-1)),h[i]=bt(r,$)}g=s+1}return h}function Ce(u,y,h){const o=h||{},$=o.encode||Ct;if(typeof $!="function")throw new TypeError("option encode is invalid");if(!ne.test(u))throw new TypeError("argument name is invalid");const g=$(y);if(g&&!ne.test(g))throw new TypeError("argument val is invalid");let c=u+"="+g;if(o.maxAge!==void 0&&o.maxAge!==null){const s=o.maxAge-0;if(Number.isNaN(s)||!Number.isFinite(s))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(s)}if(o.domain){if(!ne.test(o.domain))throw new TypeError("option domain is invalid");c+="; Domain="+o.domain}if(o.path){if(!ne.test(o.path))throw new TypeError("option path is invalid");c+="; Path="+o.path}if(o.expires){if(!gt(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");c+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(c+="; HttpOnly"),o.secure&&(c+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c}function gt(u){return Object.prototype.toString.call(u)==="[object Date]"||u instanceof Date}function bt(u,y){try{return y(u)}catch{return u}}function kt(u){return u.includes("%")?decodeURIComponent(u):u}function Ct(u){return encodeURIComponent(u)}const xt={path:"/",watch:!0,decode:u=>We(decodeURIComponent(u)),encode:u=>encodeURIComponent(typeof u=="string"?u:JSON.stringify(u))};function wt(u,y){const h={...xt,...y},o=$t(h)||{},$=P(o[u]??h.default?.());{const g=typeof BroadcastChannel>"u"?null:new BroadcastChannel(`nuxt:cookies:${u}`);Fe()&&ze(()=>{g?.close()});const c=()=>{Vt(u,$.value,h),g?.postMessage(Ge($.value))};let s=!1;g&&(g.onmessage=i=>{s=!0,$.value=i.data,He(()=>{s=!1})}),h.watch?xe($,()=>{s||c()},{deep:h.watch!=="shallow"}):c()}return $}function $t(u={}){return _t(document.cookie,u)}function St(u,y,h={}){return y==null?Ce(u,y,{...h,maxAge:-1}):Ce(u,y,h)}function Vt(u,y,h={}){document.cookie=St(u,y,h)}const Tt=d("div",{"x-divider":""},null,-1),Ie=ae({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(u){const y=P(!0),h=we();return(o,$)=>{const g=ce,c=Te,s=Ie;return t(),v("div",null,[d("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:j([{"bg-active":e(h)===o.item.filepath}]),style:Je({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:$[0]||($[0]=i=>{y.value=!e(y),h.value=o.item.filepath})},[d("div",{class:j({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(t(),k(g,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":e(y)?90:0,transition:""},null,8,["transform-rotate"])):(t(),k(c,{key:1,class:j(("getRequestMethodClass"in o?o.getRequestMethodClass:e(se))(o.item.method||"*")),textContent:E((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),d("span",{class:j({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(t(),k(g,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):U("",!0),H(" "+E(o.item.route),1)],2)],6),Tt,e(y)?ee(o.$slots,"default",{key:0},()=>[(t(!0),v(N,null,A(o.item.routes,i=>(t(),k(s,{key:i.filepath,item:i,index:o.index+1},null,8,["item","index"]))),128))]):U("",!0)])}}}),Rt={p4:"",flex:"~ col gap-4"},Ut={key:1,ml2:"",flex:""},Nt=["value"],It={key:0,flex:"","gap-4":""},Dt=d("div",{"flex-auto":""},null,-1),De=ae({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(u,{emit:y}){const h=u,o=Ke(h,"modelValue",y,{passive:!0}),$=V(()=>[...h.keys,"active","key","value","type"]),g=V(()=>{const i={};for(const r of $.value)i[r]=h.default[r]||"";return i}),c=["string","number","boolean","file","date","time","datetime-local"];function s(i,r){const I=r.target;if(I.files&&I.files[0]){const M=I.files[0],z=new FileReader;z.readAsDataURL(M),z.onload=()=>{o.value[i].value=z.result}}}return xe(()=>o,i=>{i.value.forEach(r=>{if(r.type==="number"&&typeof r.value!="number"){const I=Number.parseFloat(r.value);r.value=Number.isNaN(I)?0:I}else r.type==="boolean"&&typeof r.value!="boolean"?r.value=!0:r.type==="file"&&typeof r.value!="object"?r.value="":r.type==="date"&&typeof r.value=="string"&&!r.value.match(/^\d{4}-\d{2}-\d{2}$/)?r.value=new Date().toISOString().slice(0,10):r.type==="time"&&typeof r.value=="string"&&!r.value.match(/^\d{2}:\d{2}$/)?r.value=new Date().toISOString().slice(11,16):r.type==="datetime-local"&&typeof r.value=="string"&&!r.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?r.value=new Date().toISOString().slice(0,16):r.type==="string"&&(r.value=r.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(i,r)=>{const I=pt,M=$e,z=Re,J=ce,C=fe;return t(),v("div",Rt,[(t(!0),v(N,null,A(e(o),(l,S)=>(t(),v("div",{key:S,flex:"~ gap-2","justify-around":""},[ee(i.$slots,"input",{item:l}),(t(!0),v(N,null,A(e($),b=>(t(),v(N,{key:b},[l.type!==null&&b==="active"?(t(),k(I,{key:0,modelValue:l[b],"onUpdate:modelValue":_=>l[b]=_,n:"sm primary",disabled:i.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):U("",!0),l.type!==null&&b==="key"?(t(),k(M,{key:1,modelValue:l[b],"onUpdate:modelValue":_=>l[b]=_,placeholder:b,"flex-1":"","font-mono":"",n:"sm primary",disabled:i.disabled,class:j(i.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):b==="value"?(t(),v(N,{key:2},[l.type==="file"?(t(),k(M,{key:0,type:"file",disabled:i.disabled,class:j(i.disabled?"op75":""),onChange:_=>s(S,_)},null,8,["disabled","class","onChange"])):l.type==="boolean"?(t(),v("div",Ut,[m(I,{modelValue:l.value,"onUpdate:modelValue":_=>l.value=_,placeholder:"Value",n:"green lg",disabled:i.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(t(),k(M,{key:2,modelValue:l.value,"onUpdate:modelValue":_=>l.value=_,type:l.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:i.disabled,class:j(i.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):b==="type"?(t(),k(z,{key:3,modelValue:l.type,"onUpdate:modelValue":_=>l.type=_,n:"sm green",class:j(i.disabled?"op75":""),disabled:i.disabled},{default:x(()=>[(t(),v(N,null,A(c,_=>d("option",{key:_,value:_},E(_),9,Nt)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):U("",!0)],64))),128)),ee(i.$slots,"input-actions",{},()=>[m(C,{n:"red",disabled:i.disabled,class:j(i.disabled?"op0!":""),onClick:b=>e(o).splice(S,1)},{default:x(()=>[m(J,{icon:"carbon:trash-can"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),i.disabled?U("",!0):(t(),v("div",It,[ee(i.$slots,"actions",{params:e(o)},()=>[m(C,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:r[0]||(r[0]=l=>e(o).push({...e(g)}))},{default:x(()=>[H(" Add ")]),_:1}),Dt,e(o).length?(t(),k(C,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:r[1]||(r[1]=l=>o.value=[])},{default:x(()=>[H(" Remove All ")]),_:1})):U("",!0)])])),ee(i.$slots,"default")])}}}),Et={"h-full":"","w-full":"",flex:"~ col"},jt={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Ot={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},qt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt=d("div",{"flex-auto":""},null,-1),At=d("div",{"text-xs":"",op50:""}," Send from ",-1),Mt=d("option",{value:"app"}," App ",-1),Ft=d("option",{value:"devtools"}," DevTools ",-1),zt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Ht={"text-right":"","font-mono":""},Wt={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Gt={flex:"~ gap-4"},Jt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Kt=d("div",{"w-5":"","x-divider":""},null,-1),Qt=d("div",{"flex-none":""}," Default Inputs ",-1),Yt=d("div",{"x-divider":""},null,-1),Xt={key:2},Zt={key:3,border:"b base",relative:"","n-code-block":""},eo={flex:"~ wrap","w-full":""},to=["onClick"],oo=d("div",{border:"b base","flex-auto":""},null,-1),no={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},so=d("div",null,"Response",-1),lo={key:1,"text-xs":"",op50:""},ao=d("div",{"flex-auto":""},null,-1),ro=d("div",{op50:""}," Request finished in ",-1),io={key:0,"flex-auto":"","overflow-auto":""},uo={border:"~ base","h-full":"","w-full":"",rounded:""},po=["data"],co={key:2,"flex-auto":"","overflow-auto":"",p4:""},fo={border:"~ base",rounded:""},mo=["src"],vo={key:1,controls:"",rounded:""},ho=["src"],yo=ae({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(u,{emit:y}){const h=u,[o,$]=Qe(),g=Ye(),c=Xe(),s=pe({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),i=V(()=>s.contentType.includes("application/json")?"json":s.contentType.includes("text/html")?"html":s.contentType.includes("text/css")?"css":s.contentType.includes("text/javascript")?"javascript":s.contentType.includes("image")||s.contentType.includes("video")?"media":s.contentType.includes("text/xml")||s.contentType.includes("application/xml")?"xml":s.contentType.includes("application/pdf")?"pdf":"text"),r=V(()=>{if(i.value==="json")return JSON.stringify(s.data,null,2);if(i.value==="media"||i.value==="pdf"){const n=new Blob([s.data],{type:s.contentType});return URL.createObjectURL(n)}return s.data}),I=P(!1),M=P(!1),z=Ze(),J=V(()=>h.route.route?.split(/((?:\*\*)?:[\w_]+)/g)),C=V(()=>J.value?.filter(n=>n.startsWith(":")||n.startsWith("**:"))||[]),l=P(h.route.method||"GET"),S=P({}),b=pe({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),_=P({}),{inputDefaults:T,sendFrom:q}=Ue("serverRoutes"),O=V(()=>c?.value?.app?.$fetch?q.value:"devtools"),B=["GET","POST","PUT","PATCH","DELETE","HEAD"],re=["PATCH","POST","PUT","DELETE"],te=V(()=>re.includes(l.value.toUpperCase())),L=P(C.value.length?"params":"query"),Z=["input","json"],w=P(Z[0]),K=V({get:()=>b[L.value],set:n=>{b[L.value]=n}}),me=V(()=>({...G(T.value.query),...G(b.query)})),ve=V(()=>({...G(T.value.headers),...G(b.headers)})),ie=V(()=>te.value?w.value==="json"?{...G(T.value.body),..._.value}:{...G(T.value.body),...G(b.body)}:void 0),Ee=V(()=>{let n=window?.location.origin;return n.charAt(n.length-1)==="/"&&(n=n.slice(0,-1)),n}),oe=V(()=>{let n=new URLSearchParams(me.value).toString();n&&(n=`?${n}`);const p=(J.value?.map(D=>(D.startsWith(":")||D.startsWith("**:"))&&S.value[D]||D).join("")||"")+n;let f=g.value?.app.baseURL||"";return(f==="./"||f===".")&&(f=""),f.endsWith("/")&&(f=f.slice(0,-1)),f+p}),he=V(()=>Ee.value+oe.value);function G(n){const p=Object.fromEntries(n.filter(({active:f,key:D,value:R})=>f&&D&&R!==void 0).map(({key:f,value:D})=>[f,D]));return Object.entries(p).length?p:void 0}async function ye(){M.value=!0,I.value=!0;const n=Date.now(),p=O.value==="app"?c.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:l.value,sendFrom:O.value});try{s.data=await p(he.value,{method:l.value.toUpperCase(),headers:ve.value,query:me.value,body:ie.value,onResponse({response:f}){s.contentType=(f.headers.get("content-type")||"").toString().toLowerCase().trim(),s.statusCode=f.status,s.error=void 0},onResponseError(f){s.error=f.response._data,s.data=f.response._data}})}catch{}I.value=!1,s.fetchTime=Date.now()-n}const _e=V(()=>{const n=[],p=[],f=Object.entries(ve.value).filter(([R,F])=>R&&F&&!(R==="Content-Type"&&F==="application/json")).map(([R,F])=>` '${R}': '${F}'`).join(`,
|
|
2
|
-
`);l.value.toUpperCase()!=="GET"&&p.push(`method: '${l.value.toUpperCase()}'`),f&&p.push(`headers: {
|
|
3
|
-
${f}
|
|
4
|
-
}`),ie.value&&p.push(`body: ${JSON.stringify(ie.value,null,2)}`);const D=p.length?`, {
|
|
5
|
-
${p.join(`,
|
|
6
|
-
`).split(`
|
|
7
|
-
`).map(R=>` ${R}`).join(`
|
|
8
|
-
`)}
|
|
9
|
-
}`:"";return n.push({name:"useFetch",lang:"javascript",docs:ke.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${D})`}),n.push({name:"$fetch",lang:"javascript",docs:ke.nuxt.$fetch,code:`await $fetch('${oe.value}'${D})`}),n}),Q=P(Oe()),W=pe({key:"",value:""}),je=V(()=>{const n=[];return C.value.length&&n.push({name:"Params",slug:"params",length:C.value.length}),n.push({name:"Query",slug:"query",length:b.query.length}),te.value&&n.push({name:"Body",slug:"body",length:b.body.length}),n.push({name:"Headers",slug:"headers",length:b.headers.length}),n.push({name:"Cookies",slug:"cookies",length:Q.value.length}),n.push({name:"Snippets",slug:"snippet"}),n});function Oe(){return document.cookie.split("; ").map(n=>{const[p,f]=n.split("=");return{key:p,value:f}}).filter(n=>n.key)}function ue(n,p){if(!n)return;const f=Q.value.find(R=>R.key===n),D=wt(n);f!==void 0?p===void 0&&(Q.value=Q.value.filter(R=>R.key!==n)):(Q.value.push({key:n,value:p}),W.key="",W.value=""),D.value=p}et(()=>{w.value==="json"&&typeof _.value=="string"&&(_.value=JSON.parse(_.value))});const Le=tt();return(n,p)=>{const f=fe,D=Re,R=$e,F=ce,ge=De,Pe=ct,qe=Ve,Be=st,de=Te,Ae=ft,Me=mt,be=Se("tooltip");return t(),v("div",Et,[d("div",jt,[d("div",Ot,[n.route.method?(t(),k(f,{key:0,class:j(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(l))]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:x(()=>[H(E(e(l).toUpperCase()),1)]),_:1},8,["class"])):(t(),k(D,{key:1,modelValue:e(l),"onUpdate:modelValue":p[0]||(p[0]=a=>X(l)?l.value=a:null),class:j(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(l))])},{default:x(()=>[(t(),v(N,null,A(B,a=>d("option",{key:a,class:j(("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(a))},E(a.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),d("div",Lt,[m(R,{"model-value":e(oe),readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),d("div",Pt,[le(m(f,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:p[1]||(p[1]=a=>e(Le)(e(he),"server-route-url"))},null,512),[[be,"Copy URL"]]),le(m(f,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:p[2]||(p[2]=a=>e(z)(n.route.filepath))},null,512),[[be,"Open in Editor"]])])]),m(f,{"h-full":"",n:"primary solid",onClick:ye},{default:x(()=>[m(F,{icon:"carbon:send"})]),_:1})])]),d("div",qt,[(t(!0),v(N,null,A(e(je),a=>(t(),k(f,{key:a.slug,class:j(e(L)===a.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Y=>L.value=a.slug},{default:x(()=>[m(F,{icon:("ServerRouteTabIcons"in n?n.ServerRouteTabIcons:e(Ne))[a.slug]},null,8,["icon"]),H(" "+E(a.name)+" "+E(a?.length?`(${a.length})`:"")+" ",1),d("span",null,E(e(T)[a.slug]?.length?`(${e(T)[a.slug].length})`:""),1)]),_:2},1032,["class","onClick"]))),128)),Bt,At,m(D,{modelValue:e(O),"onUpdate:modelValue":p[3]||(p[3]=a=>X(O)?O.value=a:null),class:"n-xs",disabled:!e(c)?.app?.$fetch},{default:x(()=>[Mt,Ft]),_:1},8,["modelValue","disabled"])]),e(L)==="params"?(t(),v("div",zt,[(t(!0),v(N,null,A(e(C),a=>(t(),v(N,{key:a},[d("div",Ht,E(a),1),m(R,{modelValue:e(S)[a],"onUpdate:modelValue":Y=>e(S)[a]=Y,placeholder:a,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):U("",!0),e(L)==="cookies"?(t(),v("div",Wt,[(t(!0),v(N,null,A(e(Q),a=>(t(),v("div",{key:a.key,flex:"~ gap-4 items-center"},[m(R,{placeholder:"Key...","model-value":a.key,disabled:"","op-70":""},null,8,["model-value"]),m(R,{placeholder:"Value...","model-value":a.value,"flex-1":"",n:"primary",onInput:Y=>ue(a.key,Y.target?.value)},null,8,["model-value","onInput"]),m(f,{title:"Delete",n:"red",onClick:Y=>ue(a.key,void 0)},{default:x(()=>[m(F,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),d("div",Gt,[m(R,{modelValue:e(W).key,"onUpdate:modelValue":p[4]||(p[4]=a=>e(W).key=a),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),m(R,{modelValue:e(W).value,"onUpdate:modelValue":p[5]||(p[5]=a=>e(W).value=a),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),m(f,{title:"Add",n:"primary",onClick:p[6]||(p[6]=a=>ue(e(W).key,e(W).value))},{default:x(()=>[m(F,{icon:"i-carbon-save"})]),_:1})])])):U("",!0),m(e(o),null,{default:x(()=>[m(ge,{modelValue:e(K),"onUpdate:modelValue":p[9]||(p[9]=a=>X(K)?K.value=a:null),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:x(()=>[e(T)[e(L)]?.length?(t(),v(N,{key:0},[d("div",Jt,[Kt,Qt,m(f,{icon:"i-carbon-edit",border:!1,onClick:p[7]||(p[7]=a=>y("open-default-input"))}),Yt]),m(ge,{modelValue:e(T)[e(L)],"onUpdate:modelValue":p[8]||(p[8]=a=>e(T)[e(L)]=a),disabled:"",p0:""},null,8,["modelValue"])],64)):U("",!0)]),_:1},8,["modelValue"])]),_:1}),e(L)==="snippet"?(t(),v("div",Xt,[e(_e).length?(t(),k(Pe,{key:0,"code-snippets":e(_e)},null,8,["code-snippets"])):U("",!0)])):e(K)?(t(),v("div",Zt,[e(L)==="body"?(t(),v(N,{key:0},[d("div",eo,[(t(),v(N,null,A(Z,a=>d("button",{key:a,px4:"",py2:"",border:"r base",hover:"bg-active",class:j({"border-b":a!==e(w)}),onClick:Y=>w.value=a},[d("div",{class:j({op30:a!==e(w)}),"font-mono":""},E(a),3)],10,to)),64)),oo]),e(w)==="input"?(t(),k(e($),{key:0})):e(w)==="json"?(t(),k(e(vt),ot({key:1,modelValue:e(_),"onUpdate:modelValue":p[10]||(p[10]=a=>X(_)?_.value=a:null),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):U("",!0)],64)):(t(),k(e($),{key:1}))])):U("",!0),e(M)?e(I)?(t(),k(Be,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:x(()=>[H(" Fetching... ")]),_:1})):(t(),v(N,{key:6},[d("div",no,[so,e(s).error?(t(),k(de,{key:0,n:"red"},{default:x(()=>[H(" Error ")]),_:1})):U("",!0),m(de,{n:e(s).error?"orange":"green",textContent:E(e(s).statusCode)},null,8,["n","textContent"]),e(s).contentType?(t(),v("code",lo,E(e(s).contentType),1)):U("",!0),e(s).contentType==="application/json"?(t(),k(Ae,{key:2,getter:()=>({input:e(r)})},null,8,["getter"])):U("",!0),ao,ro,m(de,{n:"green"},{default:x(()=>[H(E(e(s).fetchTime)+" ms ",1)]),_:1})]),e(i)==="pdf"?(t(),v("div",io,[d("div",uo,[d("object",{data:e(r),type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,po)])])):e(i)!=="media"?(t(),k(Me,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:e(r),lang:e(i)},null,8,["code","lang"])):(t(),v("div",co,[d("div",fo,[e(s).contentType.includes("image")?(t(),v("img",{key:0,rounded:"",src:e(r)},null,8,mo)):(t(),v("video",vo,[d("source",{src:e(r),type:"video/mp4"},null,8,ho)]))])]))],64)):(t(),k(qe,{key:4},{default:x(()=>[m(f,{n:"primary",onClick:ye},{default:x(()=>[m(F,{icon:"carbon:send"}),H(" Send request ")]),_:1})]),_:1}))])}}}),_o={flex:"~ gap1","text-sm":""},go={key:0,op50:""},bo={op50:""},ko=d("span",{op75:""},"Select a route to start",-1),Co=d("div",{p4:"",border:"b base"},[d("span",{"text-lg":""},"Default Inputs"),d("br"),d("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1),Lo=ae({__name:"server-routes",setup(u){const y=P(!1),h=lt(),o=we(),{selectedRoute:$,view:g,inputDefaults:c}=Ue("serverRoutes"),s=V(()=>{!o.value&&$.value&&(o.value=$.value.filepath);const C=h.value?.find(l=>l.filepath===o.value);return o.value!==$.value?.filepath&&C&&($.value=C),C}),i=P(""),r=V(()=>new at(h.value||[],{keys:["method","route"],shouldSort:!0})),I=V(()=>h.value?i.value?r.value.search(i.value).map(l=>l.item):h.value:[]),M=V(()=>{const C=[],l=(S,b)=>{S.routes=S.routes||[],S.routes.push(b)};return I.value.forEach(S=>{const b=S.filepath.split("/"),_=b.slice(b.indexOf("server")+1);_.length>0&&_[_.length-1].includes(".")&&_.pop();let T=null;if(_.forEach(q=>{const O=T?T.routes?.find(B=>B.route===q):C.find(B=>B.route===q);if(O)T=O;else{const B={route:q,filepath:q.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};T?l(T,B):C.push(B),T=B}}),S.type==="runtime"){const q=C.find(O=>O.route==="runtime");if(q)l(q,S);else{const O={route:"runtime",filepath:"runtime",type:"collection",routes:[S]};C.push(O)}}else T?l(T,S):C.push(S)}),C});function z(){g.value=g.value==="tree"?"list":"tree"}function J(C){return C.charAt(0).toUpperCase()+C.slice(1)}return(C,l)=>{const S=fe,b=dt,_=Ie,T=yo,q=ut,O=Ve,B=rt,re=De,te=ht,L=yt,Z=Se("tooltip");return t(),v(N,null,[m(B,{"storage-key":"tab-server-routes"},{left:x(()=>[m(b,{search:e(i),"onUpdate:search":l[1]||(l[1]=w=>X(i)?i.value=w:null),pb2:""},{actions:x(()=>[le(m(S,{"text-lg":"",icon:e(g)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:z},null,8,["icon"]),[[Z,"Toggle View"]]),le(m(S,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:l[0]||(l[0]=w=>y.value=!e(y))},null,512),[[Z,"Default Inputs"]])]),default:x(()=>[d("div",_o,[e(i)?(t(),v("span",go,E(e(I).length)+" matched · ",1)):U("",!0),d("span",bo,E(e(h)?.length)+" routes in total",1)])]),_:1},8,["search"]),(t(!0),v(N,null,A(e(g)==="tree"?e(M):e(I),w=>(t(),k(_,{key:w.filepath,item:w},null,8,["item"]))),128))]),right:x(()=>[(t(),k(it,{max:10},[e(s)?(t(),k(T,{key:e(s).filepath,route:e(s),onOpenDefaultInput:l[2]||(l[2]=w=>y.value=!0)},null,8,["route"])):U("",!0)],1024)),e(s)?U("",!0):(t(),k(O,{key:0},{default:x(()=>[m(q,{px6:"",py2:""},{default:x(()=>[ko]),_:1})]),_:1}))]),_:1}),m(L,{modelValue:e(y),"onUpdate:modelValue":l[3]||(l[3]=w=>X(y)?y.value=w:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:l[4]||(l[4]=w=>y.value=!1)},{default:x(()=>[d("div",null,[Co,(t(!0),v(N,null,A(Object.keys(e(c)),w=>(t(),k(te,{key:w,text:`${J(w)} ${e(c)[w].length?`(${e(c)[w].length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in C?C.ServerRouteTabIcons:e(Ne))[w]},{default:x(()=>[m(re,{modelValue:e(c)[w],"onUpdate:modelValue":K=>e(c)[w]=K,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Lo as default};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{d as w,a as T,aF as W,o as n,m as i,k as s,a7 as N,f as a,t as k,ab as j,F as h,n as E,h as b,r as B,w as U,aw as Y,Z as V,bA as Z,p as x,i as m,G as O,q,e as K,an as R,j as g,ar as X,v as F,_ as z,aa as H,aH as Q,as as ee,aZ as se,bB as te,M as ne,a9 as oe,A as ae,K as G,a3 as le,X as ie}from"./entry.909ad6c7.js";import{_ as M}from"./DurationDisplay.vue.dd0f91f1.js";import{_ as P}from"./NBadge.ff27dca2.js";import{_ as re}from"./ComposableItem.vue.b4d03c6d.js";import{U as ce}from"./json-editor-vue.8a771ed0.js";import{_ as pe}from"./FilepathItem.vue.a1b71b8d.js";import{_ as de}from"./NDrawer.vue.2b176b54.js";import{_ as ue}from"./LaunchPage.vue.c617b6d5.js";import{_ as me}from"./NLink.vue.9859bf11.js";import{_ as ke}from"./CodeDiff.vue.4fcef1e4.js";import{_ as _e}from"./HelpFab.vue.f0924b60.js";import"./NMarkdown.vue.79860402.js";import"./client.17f79a3c.js";import"./constants.2cc6e981.js";import"./NCodeBlock.vue.9ce69690.js";const he=w({__name:"TimelineItemFunction",props:{item:{}},setup(_){const p=_,c=T(()=>W(p.item.name,50,60,"_op_")),e=T(()=>c.value.replace(/_op_/,"1")),o=T(()=>W(p.item.name,50,40)),r=T(()=>c.value.replace(/_op_/,"0.2"));return(u,t)=>(n(),i("button",{class:"group",style:N({color:a(e),borderLeft:`2px solid ${a(e)}`}),relative:"","text-sm":"",transition:"","hover:z-1000":"","bg-base":""},[s("div",{style:N({backgroundColor:a(r)}),absolute:"","bottom-0":"","left--1px":"","top-0":"","w-full":"","text-sm":"","transition-all":"","duration-300":""},null,4),s("div",{style:N({color:a(o),"--c":a(e)}),border:"r-2 t-2 y-2 transparent","min-w-max":"",px1:"","text-left":"","group-hover":"border-$c"},k(u.item.name),5)],4))}}),fe={relative:"","h-full":""},ye={absolute:"","left-2":"","top-2.3em":"","text-xs":"",op50:""},ve=w({__name:"TimelineSegment",props:{segment:{}},emits:["select"],setup(_,{emit:p}){const c=_,e=j(()=>c.segment.start,{updateInterval:1e3,showSecond:!0,messages:{justNow:"",past:o=>o,future:o=>o,invalid:"-",second:o=>o?`${o}s`:"",minute:o=>`${o}m`,hour:o=>`${o}h`,week:o=>`${o}w`,day:o=>`${o}d`,month:o=>`${o}mo`,year:o=>`${o}y`}});return(o,r)=>{const u=he;return n(),i("div",fe,[s("button",{absolute:"","left-0":"","right-0":"","top-0":"","bg-green:5":"",px2:"",py1:"","text-left":"","text-xs":"","font-mono":"","text-green6":"",onClick:r[0]||(r[0]=t=>o.segment.route?p("select",o.segment.route):void 0)},k(o.segment.route?.event.to),1),s("div",ye,k(a(e))+" ago ",1),s("div",null,[(n(!0),i(h,null,E(o.segment.functions,(t,l)=>(n(),b(u,{key:l,item:t.event,style:N({position:"absolute",minWidth:`${t.relativeWidth*100}%`,maxWidth:`${t.relativeWidth*100}%`,top:`${4+t.layer*1.6}em`,left:`${t.relativeStart*100}%`}),onClick:d=>p("select",t)},null,8,["item","style","onClick"]))),128))])])}}}),be=3e3,ge=50;function xe(_){const p=[];let c={start:0,end:0,events:[],functions:[],duration:0};for(const e of _){const o=e.end||e.start;(e.start-c.end>be||e.type==="route")&&(c={start:e.start,end:o,events:[],functions:[],duration:0},p.push(c)),c.events.push(e),c.end=o+ge}return p.forEach((e,o)=>{const r=e.end-e.start,u=[];e.duration=r,e.previousGap=o>0?e.start-p[o-1].end:0,e.events.forEach(t=>{const l=t.end||t.start;let d=0;t.type!=="route"&&(d=u.findIndex($=>$<=t.start),d===-1?(d=u.length,u.push(l+1e3)):u[d]=l+1e3);const f={event:t,segment:e,relativeStart:(t.start-e.start)/r,relativeWidth:(l-t.start)/r,layer:d};t.type==="function"?e.functions.push(f):e.route=f})}),p}const $e={relative:""},Ae={key:0,border:"x base","h-full":"","flex-inline":"","bg-true-gray-1":"",py15:"","text-xs":"","write-vertical-left":"",op50:"","dark:bg-true-gray-9":""},De=w({__name:"TimelineTable",props:{data:{}},emits:["select"],setup(_,{emit:p}){const c=_,e=B(),o=B(),r=B(),u=B(),t=B(!0),l=B(1.5),d=T(()=>xe(c.data.events)),f=T(()=>(c.data.events.length,e.value?.scrollWidth||window.innerWidth));function $(){u.value&&(u.value.style.width=`${f.value}px`)}function I(){t.value&&e.value&&(e.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}),r.value.scrollTo({left:e.value.scrollWidth-e.value.clientWidth,behavior:"smooth"}))}return U(()=>c.data.events.length,async()=>{await Y(),$(),I()},{flush:"post"}),V(e,"scroll",()=>{r.value.scrollLeft!==e.value.scrollLeft&&($(),r.value.scrollLeft=e.value.scrollLeft,t.value=e.value.scrollLeft>=e.value.scrollWidth-e.value.clientWidth)}),V(r,"scroll",()=>{r.value.scrollLeft!==e.value.scrollLeft&&($(),e.value.scrollLeft=r.value.scrollLeft)}),V(e,"wheel",A=>{A.altKey?(l.value=Z(l.value+A.deltaY/200,.5,3),$()):e.value.scrollLeft+=A.deltaY}),(A,S)=>{const D=M,y=ve;return n(),i(h,null,[s("div",$e,[s("div",{ref_key:"minimap",ref:o,border:"t b base",relative:"","h-50px":"","ws-nowrap":"","border-base":""},[(n(!0),i(h,null,E(a(d),(v,L)=>(n(),i("div",{key:L,relative:"","h-full":"","flex-inline":"",style:N({width:`${Math.max(100,v.duration/10)/a(f)*100}%`})},[(n(!0),i(h,null,E(v.functions,(C,J)=>(n(),i("div",{key:J,"h-3px":"",rounded:"",style:N({width:`max(${C.relativeWidth*100}%, 10px)`,position:"absolute",top:`${C.layer*4}px`,left:`${C.relativeStart*100}%`,backgroundColor:("getHashColorFromString"in A?A.getHashColorFromString:a(W))(C.event.name,50,60)})},null,4))),128)),v.route?(n(),i("div",{key:0,absolute:"","top-0":"","h-full":"","w-px":"","border-l":"","border-green6":"",op10:"",style:N({left:`${v.route.relativeStart*100}%`})},null,4)):x("",!0)],4))),128))],512),s("div",{ref_key:"minimapScroller",ref:r,class:"timeline-scroller",absolute:"","inset-0":"","h-full":"","w-full":"","of-x-scroll":""},[s("div",{ref_key:"minimapScrollerInner",ref:u,"h-1px":""},null,512)],512)]),s("div",{ref_key:"scroller",ref:e,relative:"","h-full":"","w-full":"","of-x-scroll":"","of-y-hidden":"","ws-nowrap":"","n-panel-grids":""},[(n(!0),i(h,null,E(a(d),(v,L)=>(n(),i(h,{key:L},[v.previousGap&&v.previousGap>=200?(n(),i("div",Ae,[m(D,{op50:"",duration:v.previousGap,color:!1},null,8,["duration"])])):x("",!0),m(y,{"flex-inline":"","of-x-hidden":"","hover:of-x-visible":"","bg-base":"",class:O(L===a(d).length-1?"border-r border-base":""),segment:v,style:N({width:`${Math.max(50,v.duration/10)*a(l)}px`}),onSelect:S[0]||(S[0]=C=>p("select",C))},null,8,["class","segment","style"])],64))),128))],512)],64)}}});const Ce=q(De,[["__scopeId","data-v-a2c475c0"]]),Be={border:"t base",flex:"~ col","h-full":"","of-y-auto":"","text-sm":""},we=["onClick"],Te=s("div",{"i-carbon-function":"",op50:""},null,-1),Ne={flex:"~","ml--1":"","font-mono":""},Se=s("div",{op30:""}," ( ",-1),Fe={key:0,mr2:"",op30:""},Ee={op75:""},Ie=s("div",{op30:""}," ) ",-1),Le=s("div",{"mr-1":"","h-7":"","w-7":"",flex:"","rounded-lg":"","bg-primary:5":"",p1:"","text-green6":""},[s("div",{"i-carbon-direction-rotary-right":"",ma:"","text-lg":""})],-1),We={flex:"~ col items-start"},Me={"text-xs":"","font-mono":"",op30:""},Ve={"font-bold":"","font-mono":"","text-green":""},je=s("div",{"flex-auto":""},null,-1),Oe=s("div",{"min-h-100":""},null,-1),ze=w({__name:"TimelineList",props:{data:{}},emits:["select"],setup(_,{emit:p}){return(c,e)=>{const o=M;return n(),i("div",Be,[(n(!0),i(h,null,E(c.data.events,(r,u)=>(n(),i("button",{key:u,border:"b base",px3:"",py2:"",flex:"~ items-center gap-2",hover:"bg-active",onClick:t=>p("select",r)},[r.type==="function"?(n(),i(h,{key:0},[Te,s("div",{"font-mono":"",style:N({color:r.type==="function"?("getHashColorFromString"in c?c.getHashColorFromString:a(W))(r.name,50,60):""})},k(r.name),5),s("div",Ne,[Se,(n(!0),i(h,null,E(r.args,(t,l)=>(n(),i(h,{key:l},[l?(n(),i("div",Fe," , ")):x("",!0),s("div",Ee,k(t===null?"null":t===void 0?"undefined":typeof t=="function"?"[function]":Array.isArray(t)?"[Array]":typeof t=="object"?"[object]":JSON.stringify(t)),1)],64))),128)),Ie])],64)):(n(),i(h,{key:1},[Le,s("div",We,[s("div",Me,k(r.from),1),s("div",Ve,k(r.to),1)])],64)),je,r.end?(n(),b(o,{key:2,duration:r.end-r.start,color:r.type==="function"},null,8,["duration","color"])):x("",!0)],8,we))),128)),Oe])}}}),Ge={key:0,"text-blue":""},Re={key:1,"text-purple":""},He={key:2,"text-green":""},Pe={key:3,"text-gray":""},Je={key:4,"text-gray":""},Ue={key:5,"text-gray":""},Ye={key:0,"bg-red:10":"",px2:"",py1:"","text-red":""},Ze={key:1},qe={p2:"","text-sm":"",border:"t base"},Ke=w({__name:"TimelineArgumentView",props:{value:{}},setup(_){const p=_,c=B(),e=B();function o(){try{c.value=JSON.parse(JSON.stringify(p.value))}catch(t){console.error(t),e.value=t}}const r=w({emits:["setup"],setup(t,{emit:l}){return l("setup"),()=>null}}),u=K();return(t,l)=>{const d=z,f=R("VMenu");return typeof t.value=="string"?(n(),i("div",Ge,k(JSON.stringify(t.value)),1)):typeof t.value=="number"?(n(),i("div",Re,k(t.value),1)):typeof t.value=="boolean"?(n(),i("div",He,k(t.value),1)):typeof t.value>"u"?(n(),i("div",Pe," undefined ")):typeof t.value=="function"?(n(),i("div",Je," [Function"+k(t.value.name?`: ${t.value.name}`:"")+"] ",1)):t.value===null?(n(),i("div",Ue," null ")):(n(),b(f,{key:6,placement:"top"},{popper:g(()=>[m(a(r),{onSetup:o}),a(e)?(n(),i("div",Ye," Failed to display object: "+k(a(e)),1)):a(c)?(n(),i("div",Ze,[m(a(ce),X({"model-value":a(c)},t.$attrs,{class:["json-editor-vue",[t.$colorMode.value==="dark"?"jse-theme-dark":""]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":!0,indentation:2,"tab-size":2}),null,16,["model-value","class"]),s("div",qe,[m(d,{title:"Copy to clipboard",icon:"carbon-copy",onClick:l[0]||(l[0]=$=>a(u)(JSON.stringify(a(c),null,2),"timeline-argument"))},{default:g(()=>[F(" Copy ")]),_:1})])])):x("",!0)]),default:g(()=>[s("span",{"rounded-sm":"",px1:"","py0.5":"","text-sm":"",class:O([Array.isArray(t.value)?"text-amber bg-amber:10":"text-orange bg-orange:10"])},k(Array.isArray(t.value)?`[Array(${t.value.length})]`:"[Object]"),3)]),_:1}))}}}),Xe={key:0,"p-4":"",flex:"~ col gap-2","text-base":""},Qe={"mx--1":""},es={flex:"~ gap-1","font-mono":""},ss={key:1},ts=s("span",{ml1:"",op30:""},"(",-1),ns={key:0,op30:""},os=s("span",{op30:""},")",-1),as={flex:"~ gap-1","text-sm":""},ls=s("span",{mx1:"",op50:""},"·",-1),is={class:"text-sm text-gray-400"},rs={key:0,class:"text-xs text-gray-400",mt2:"",grid:"~ cols-[max-content_1fr] gap-x-4","font-mono":""},cs={"text-right":""},ps={"ws-nowrap":""},ds=w({__name:"TimelineDetailsFunction",props:{record:{}},setup(_){const p=_,c=H(),e=j(()=>p.record.start,{showSecond:!0});function o(l){let d=new URL(l).pathname;return d.startsWith("/_nuxt/")&&(d=d.slice(6)),d.startsWith("/@id/virtual:nuxt:")?`#build/${d.split("/.nuxt/")[1]}`.replace(/\.m?js$/,""):d.includes("/@fs/")?`/${d.split("/@fs/")[1]}`:(c.value?.rootDir||"")+d}const r=Q(),u=T(()=>r.value?.metadata),t=T(()=>r.value?.imports.find(l=>l.as===p.record.name));return(l,d)=>{const f=P,$=re,I=Ke,A=M,S=pe;return l.record?(n(),i("div",Xe,[s("div",Qe,[m(f,{n:"yellow",textContent:"Function call"})]),s("div",es,[a(t)?(n(),b($,{key:0,item:a(t),metadata:a(u),counter:!1,classes:"px2 py1","mx--2":""},null,8,["item","metadata"])):(n(),i("span",ss,k(l.record.name),1)),ts,(n(!0),i(h,null,E(l.record.args,(D,y)=>(n(),i(h,{key:y},[y?(n(),i("span",ns,", ")):x("",!0),m(I,{value:D},null,8,["value"])],64))),128)),os]),s("div",as,[l.record.end?(n(),b(A,{key:0,duration:l.record.end-l.record.start},null,8,["duration"])):x("",!0),ls,s("div",is,k(a(e)),1)]),l.record.stacktrace?(n(),i("div",rs,[(n(!0),i(h,null,E(l.record.stacktrace,(D,y)=>(n(),i(h,{key:y},[s("div",cs,k(D.functionName||"(anonymous)"),1),s("div",ps,[D.fileName?(n(),b(S,{key:0,filepath:`${o(D.fileName)}:${D.lineNumber}:${D.columnNumber}`,subpath:""},null,8,["filepath"])):x("",!0)])],64))),128))])):x("",!0)])):x("",!0)}}}),us={key:0,"p-4":"",flex:"~ col gap-2"},ms={"mx--1":""},ks={flex:"~ gap-1 items-center","font-mono":""},_s={op50:""},hs=s("span",{"i-carbon-arrow-right":"",op50:""},null,-1),fs={flex:"~ gap-1","text-sm":""},ys=s("span",{mx1:"",op50:""},"·",-1),vs={class:"text-sm text-gray-400"},bs=w({__name:"TimelineDetailsRoute",props:{record:{}},setup(_){const p=_,c=j(()=>p.record.start,{showSecond:!0});return(e,o)=>{const r=P,u=M;return e.record?(n(),i("div",us,[s("div",ms,[m(r,{n:"green",textContent:"Route Change"})]),s("div",ks,[s("span",_s,k(e.record.from),1),hs,s("span",null,k(e.record.to),1)]),s("div",fs,[e.record.end?(n(),b(u,{key:0,duration:e.record.end-e.record.start},null,8,["duration"])):x("",!0),ys,s("div",vs,k(a(c)),1)])])):x("",!0)}}}),gs={key:0,"h-screen":"","of-hidden":""},xs={"h-screen":"","w-full":"",flex:"","flex-col":""},$s={"h-10":"",flex:"~ gap-2 items-center justify-end",p2:"",px3:""},As={"text-sm":""},Ds=s("div",{"flex-auto":""},null,-1),Cs={"min-h-50":"",px3:"",py2:""},Bs=w({__name:"TimelineView",setup(_){const p=ee(),c=B("table"),e=B(),o=T(()=>p.value?.metrics.clientTimeline());function r(){o.value&&(o.value.events=[])}function u(){c.value=c.value==="table"?"list":"table"}return(t,l)=>{const d=R("VTooltip"),f=z,$=Ce,I=ze,A=ds,S=bs,D=de;return a(o)?(n(),i("div",gs,[s("div",xs,[s("div",$s,[m(d,{flex:""},{popper:g(()=>[s("div",As,k(a(o).options.enabled?"Recording...":"Paused"),1)]),default:g(()=>[s("div",{"text-lg":"",class:O(a(o).options.enabled?"i-carbon-radio-button-checked text-primary animate-pulse":"i-carbon-pause-outline op30")},null,2)]),_:1}),a(o).options.enabled?(n(),b(f,{key:1,size:"small",ml1:"","text-sm":"",n:"orange",icon:"i-carbon-stop",onClick:l[1]||(l[1]=y=>a(o).options.enabled=!1)},{default:g(()=>[F(" Stop Tracking ")]),_:1})):(n(),b(f,{key:0,size:"small",ml1:"","text-sm":"",n:"primary",icon:"i-carbon-play",onClick:l[0]||(l[0]=y=>a(o).options.enabled=!0)},{default:g(()=>[F(" Start Tracking ")]),_:1})),Ds,m(f,{icon:a(c)==="table"?"i-carbon-roadmap":"i-carbon-list",class:"ml-2",title:"Toggle View",border:!1,onClick:u},null,8,["icon"]),m(f,{icon:"i-carbon-trash-can","hover-text-red":"",class:"ml-2",border:!1,onClick:r})]),a(c)==="table"?(n(),b($,{key:0,data:{...a(o)},onSelect:l[2]||(l[2]=y=>e.value=y.event)},null,8,["data"])):(n(),b(I,{key:1,data:{...a(o)},onSelect:l[3]||(l[3]=y=>e.value=y)},null,8,["data"]))]),m(D,{"model-value":!!a(e),"auto-close":"",transition:"bottom",left:"#nuxt-devtools-side-nav",onClose:l[4]||(l[4]=y=>e.value=void 0)},{default:g(()=>[s("div",Cs,[a(e)?.type==="function"?(n(),b(A,{key:0,record:a(e)},null,8,["record"])):a(e)?.type==="route"?(n(),b(S,{key:1,record:a(e)},null,8,["record"])):x("",!0)])]),_:1},8,["model-value"])])):x("",!0)}}}),ws={class:"markdown-body"},Ts=s("h1",null,"Timeline",-1),Ns=s("p",null,[s("blockquote",{"text-orange":"","bg-orange:10":"",py1:""}," This is an experimental feature ")],-1),Ss=se(`<p>Timeline tracks your route navigations and functions calls in your Nuxt application. It can be used to debug performance issues and to understand how your application works.</p><h2>Function calls</h2><p>Nuxt DevTools tracks function calls by wrapping them in the build time. It works for functions referenced by auto-imports, or explicit imports through <code>import {} from '#imports'</code>.</p><pre class="shiki shiki-themes vitesse-light vitesse-dark" style="background-color:#ffffff;--shiki-dark-bg:#121212;color:#393a34;--shiki-dark:#dbd7caee;" tabindex="0"><code><span class="line"><span style="color:#999999;--shiki-dark:#666666;"><</span><span style="color:#1E754F;--shiki-dark:#4D9375;">script</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> setup</span><span style="color:#999999;--shiki-dark:#666666;">></span></span>
|
|
2
|
-
<span class="line"><span style="color:#1E754F;--shiki-dark:#4D9375;">import</span><span style="color:#999999;--shiki-dark:#666666;"> {</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> useNuxtApp</span><span style="color:#999999;--shiki-dark:#666666;"> }</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">#imports</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span></span>
|
|
3
|
-
<span class="line"><span style="color:#1E754F;--shiki-dark:#4D9375;">import</span><span style="color:#999999;--shiki-dark:#666666;"> {</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> useMouse</span><span style="color:#999999;--shiki-dark:#666666;"> }</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> from</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">@vueuse/core</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span></span>
|
|
4
|
-
<span class="line"></span>
|
|
5
|
-
<span class="line"><span style="color:#AB5959;--shiki-dark:#CB7676;">const</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> route</span><span style="color:#999999;--shiki-dark:#666666;"> =</span><span style="color:#59873A;--shiki-dark:#80A665;"> useRoute</span><span style="color:#999999;--shiki-dark:#666666;">()</span><span style="color:#A0ADA0;--shiki-dark:#758575DD;"> // tracked</span></span>
|
|
6
|
-
<span class="line"><span style="color:#AB5959;--shiki-dark:#CB7676;">const</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> app</span><span style="color:#999999;--shiki-dark:#666666;"> =</span><span style="color:#59873A;--shiki-dark:#80A665;"> useNuxtApp</span><span style="color:#999999;--shiki-dark:#666666;">()</span><span style="color:#A0ADA0;--shiki-dark:#758575DD;"> // tracked</span></span>
|
|
7
|
-
<span class="line"></span>
|
|
8
|
-
<span class="line"><span style="color:#A0ADA0;--shiki-dark:#758575DD;">// NOT tracked because it's directly imported</span></span>
|
|
9
|
-
<span class="line"><span style="color:#AB5959;--shiki-dark:#CB7676;">const</span><span style="color:#B07D48;--shiki-dark:#BD976A;"> mouse</span><span style="color:#999999;--shiki-dark:#666666;"> =</span><span style="color:#59873A;--shiki-dark:#80A665;"> useMouse</span><span style="color:#999999;--shiki-dark:#666666;">()</span><span style="color:#393A34;--shiki-dark:#DBD7CAEE;"> </span></span>
|
|
10
|
-
<span class="line"></span></code></pre><p>By default, it tracks Nuxt provided composables as well as user defined functions. You can include/exclude functions by using the <code>include</code> and <code>exclude</code> options in the <code>nuxt.config.js</code> file.</p><pre class="shiki shiki-themes vitesse-light vitesse-dark" style="background-color:#ffffff;--shiki-dark-bg:#121212;color:#393a34;--shiki-dark:#dbd7caee;" tabindex="0"><code><span class="line"><span style="color:#1E754F;--shiki-dark:#4D9375;">export</span><span style="color:#1E754F;--shiki-dark:#4D9375;"> default</span><span style="color:#59873A;--shiki-dark:#80A665;"> defineNuxtConfig</span><span style="color:#999999;--shiki-dark:#666666;">({</span></span>
|
|
11
|
-
<span class="line"><span style="color:#998418;--shiki-dark:#B8A965;"> devtools</span><span style="color:#999999;--shiki-dark:#666666;">:</span><span style="color:#999999;--shiki-dark:#666666;"> {</span></span>
|
|
12
|
-
<span class="line"><span style="color:#998418;--shiki-dark:#B8A965;"> timeline</span><span style="color:#999999;--shiki-dark:#666666;">:</span><span style="color:#999999;--shiki-dark:#666666;"> {</span></span>
|
|
13
|
-
<span class="line"><span style="color:#998418;--shiki-dark:#B8A965;"> functions</span><span style="color:#999999;--shiki-dark:#666666;">:</span><span style="color:#999999;--shiki-dark:#666666;"> {</span></span>
|
|
14
|
-
<span class="line"><span style="color:#998418;--shiki-dark:#B8A965;"> include</span><span style="color:#999999;--shiki-dark:#666666;">:</span><span style="color:#999999;--shiki-dark:#666666;"> [</span></span>
|
|
15
|
-
<span class="line"><span style="color:#A0ADA0;--shiki-dark:#758575DD;"> // track \`useMouse\`</span></span>
|
|
16
|
-
<span class="line"><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">useMouse</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span><span style="color:#999999;--shiki-dark:#666666;">,</span></span>
|
|
17
|
-
<span class="line"><span style="color:#A0ADA0;--shiki-dark:#758575DD;"> // track all functions starting with \`use\`</span></span>
|
|
18
|
-
<span class="line"><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> /</span><span style="color:#1E754F;--shiki-dark:#4D9375;">^</span><span style="color:#AB5E3F;--shiki-dark:#C4704F;">use</span><span style="color:#999999;--shiki-dark:#666666;">[</span><span style="color:#A65E2B;--shiki-dark:#C99076;">A-Z</span><span style="color:#999999;--shiki-dark:#666666;">]</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">/</span><span style="color:#999999;--shiki-dark:#666666;">,</span></span>
|
|
19
|
-
<span class="line"><span style="color:#A0ADA0;--shiki-dark:#758575DD;"> // track all functions from @vueuse/core</span></span>
|
|
20
|
-
<span class="line"><span style="color:#B07D48;--shiki-dark:#BD976A;"> entry</span><span style="color:#999999;--shiki-dark:#666666;"> =></span><span style="color:#B07D48;--shiki-dark:#BD976A;"> entry</span><span style="color:#999999;--shiki-dark:#666666;">.</span><span style="color:#B07D48;--shiki-dark:#BD976A;">from</span><span style="color:#AB5959;--shiki-dark:#CB7676;"> ===</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">@vueuse/core</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span><span style="color:#999999;--shiki-dark:#666666;">,</span></span>
|
|
21
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;"> ],</span></span>
|
|
22
|
-
<span class="line"><span style="color:#998418;--shiki-dark:#B8A965;"> exclude</span><span style="color:#999999;--shiki-dark:#666666;">:</span><span style="color:#999999;--shiki-dark:#666666;"> [</span></span>
|
|
23
|
-
<span class="line"><span style="color:#B5695999;--shiki-dark:#C98A7D99;"> '</span><span style="color:#B56959;--shiki-dark:#C98A7D;">useRouter</span><span style="color:#B5695999;--shiki-dark:#C98A7D99;">'</span></span>
|
|
24
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;"> ]</span></span>
|
|
25
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;"> }</span></span>
|
|
26
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;"> }</span></span>
|
|
27
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;"> }</span></span>
|
|
28
|
-
<span class="line"><span style="color:#999999;--shiki-dark:#666666;">})</span></span>
|
|
29
|
-
<span class="line"></span></code></pre>`,6),Fs=[Ts,Ns,Ss],Es={__name:"timeline",setup(_,{expose:p}){return p({frontmatter:{}}),(e,o)=>(n(),i("div",ws,Fs))}},Is={flex:"~ col gap-2","w-150":"",p4:"",border:"t base"},Ls=s("h2",{"text-xl":""},[s("span",{capitalize:""},"Enable Timeline?")],-1),Ws={op50:""},Ms=s("p",null,[s("span",{op50:""},"Then Nuxt will "),s("span",{"text-orange":""},"restart automatically"),F(". ")],-1),Vs={flex:"~ gap-3",mt2:"","justify-end":""},et=w({__name:"timeline",setup(_){const p=te(),c=H(),e=ne(),o=oe();async function r(){try{const[u,t]=await G.enableTimeline(!0);if(!await e.start(u,t))return;await G.enableTimeline(!1)}catch{le({message:"Failed to enable timeline automatically. Check the terminal for more details.",icon:"i-carbon-warning",classes:"text-red"})}}return(u,t)=>{const l=Bs,d=ue,f=ae,$=me,I=ke,A=z,S=ie,D=Es,y=_e;return n(),i(h,null,[a(p)?.timeline?.enabled?(n(),b(l,{key:0})):(n(),i(h,{key:1},[m(f,null,{default:g(()=>[m(d,{icon:"i-carbon-roadmap",name:"feature-timeline",title:"Timeline",description:"Timeline enables the inspection of when composable being executed and the route changes.",actions:[{label:"Enable"}],onAction:r})]),_:1}),m(a(e),null,{default:g(({resolve:v,args:L})=>[m(S,{"model-value":!0,onClose:C=>v(!1)},{default:g(()=>[s("div",Is,[Ls,s("p",Ws,[F(" Your "),m($,{role:"button",n:"primary",underline:"",onClick:t[0]||(t[0]=C=>a(o)(a(c)?._nuxtConfigFile)),textContent:"Nuxt config"}),F(" will be updated as: ")]),m(I,{from:L[0],to:L[1],"max-h-80":"","of-auto":"",py2:"",border:"~ base rounded",lang:"ts"},null,8,["from","to"]),Ms,s("div",Vs,[m(A,{onClick:C=>v(!1)},{default:g(()=>[F(" Cancel ")]),_:2},1032,["onClick"]),m(A,{n:"solid primary",capitalize:"",onClick:C=>v(!0)},{default:g(()=>[F(" Enable ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1})],64)),m(y,null,{default:g(()=>[m(D)]),_:1})],64)}}});export{et as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as Se}from"./entry.909ad6c7.js";const xe=Object.freeze({left:0,top:0,width:16,height:16}),U=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ue=Object.freeze({...xe,...U}),$e=Object.freeze({...ue,body:"",hidden:!1}),_e=Object.freeze({width:null,height:null}),he=Object.freeze({..._e,...U});function Ce(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const s=((t.rotate||0)+(e.rotate||0))%4;return s&&(n.rotate=s),n}function J(t,e){const n=Ce(t,e);for(const s in $e)s in U?s in t&&!(s in n)&&(n[s]=U[s]):s in e?n[s]=e[s]:s in t&&(n[s]=t[s]);return n}function Ae(t,e){const n=t.icons,s=t.aliases||Object.create(null),r=Object.create(null);function i(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const c=s[o]&&s[o].parent,f=c&&i(c);f&&(r[o]=[c].concat(f))}return r[o]}return(e||Object.keys(n).concat(Object.keys(s))).forEach(i),r}function Q(t,e,n){const s=t.icons,r=t.aliases||Object.create(null);let i={};function o(c){i=J(s[c]||r[c],i)}return o(e),n.forEach(o),J(t,i)}function Oe(t,e){if(t.icons[e])return Q(t,e,[]);const n=Ae(t,[e])[e];return n?Q(t,e,n):null}const Me=/(-?[0-9.]*[0-9]+[0-9.]*)/g,je=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ee(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const s=t.split(Me);if(s===null||!s.length)return t;const r=[];let i=s.shift(),o=je.test(i);for(;;){if(o){const c=parseFloat(i);isNaN(c)?r.push(i):r.push(Math.ceil(c*e*n)/n)}else r.push(i);if(i=s.shift(),i===void 0)return r.join("");o=!o}}function Ee(t){let e="";const n=t.indexOf("<defs");for(;n>=0;){const s=t.indexOf(">",n),r=t.indexOf("</defs");if(s===-1||r===-1)break;const i=t.indexOf(">",r);if(i===-1)break;e+=t.slice(s+1,r).trim(),t=t.slice(0,n).trim()+t.slice(i+1)}return{defs:e,content:t}}function ke(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Pe(t,e,n){const s=Ee(t);return ke(s.defs,e+s.content+n)}const Z=t=>t==="unset"||t==="undefined"||t==="none";function Le(t,e){const n={...ue,...t},s={...he,...e},r={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,s].forEach(p=>{const d=[],x=p.hFlip,w=p.vFlip;let S=p.rotate;x?w?S+=2:(d.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),d.push("scale(-1 1)"),r.top=r.left=0):w&&(d.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),d.push("scale(1 -1)"),r.top=r.left=0);let l;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:l=r.height/2+r.top,d.unshift("rotate(90 "+l.toString()+" "+l.toString()+")");break;case 2:d.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:l=r.width/2+r.left,d.unshift("rotate(-90 "+l.toString()+" "+l.toString()+")");break}S%2===1&&(r.left!==r.top&&(l=r.left,r.left=r.top,r.top=l),r.width!==r.height&&(l=r.width,r.width=r.height,r.height=l)),d.length&&(i=Pe(i,'<g transform="'+d.join(" ")+'">',"</g>"))});const o=s.width,c=s.height,f=r.width,u=r.height;let a,h;o===null?(h=c===null?"1em":c==="auto"?u:c,a=ee(h,f/u)):(a=o==="auto"?f:o,h=c===null?ee(a,u/f):c==="auto"?u:c);const m={},g=(p,d)=>{Z(d)||(m[p]=d.toString())};g("width",a),g("height",h);const _=[r.left,r.top,f,u];return m.viewBox=_.join(" "),{attributes:m,viewBox:_,body:i}}function ze(t){return t.replace(/(['"])\s*\n\s*([^>\\/\s])/g,"$1 $2").replace(/(["';{}><])\s*\n\s*/g,"$1").replace(/\s*\n\s*/g," ").replace(/\s+"/g,'"').replace(/="\s+/g,'="').trim()}const Te=/\swidth\s*=\s*["'](\w+)["']/,Ie=/\sheight\s*=\s*["'](\w+)["']/,G=/<svg\s+/;function Fe(t,e,n){const s=t.slice(0,t.indexOf(">")),r=(i,o)=>{const c=o.exec(s),f=c!=null,u=e[i];return!u&&!Z(u)&&(typeof n=="number"?n>0&&(e[i]=`${n}em`):c&&(e[i]=c[1])),f};return[r("width",Te),r("height",Ie)]}async function de(t,e,n,s,r,i){const{scale:o,addXmlNs:c=!1}=s??{},{additionalProps:f={},iconCustomizer:u}=s?.customizations??{},a=await r?.()??{};await u?.(e,n,a),Object.keys(f).forEach(p=>{const d=f[p];d!=null&&(a[p]=d)}),i?.(a);const[h,m]=Fe(t,a,o);c&&(!t.includes("xmlns=")&&!a.xmlns&&(a.xmlns="http://www.w3.org/2000/svg"),!t.includes("xmlns:xlink=")&&t.includes("xlink:")&&!a["xmlns:xlink"]&&(a["xmlns:xlink"]="http://www.w3.org/1999/xlink"));const g=Object.keys(a).map(p=>p==="width"&&h||p==="height"&&m?null:`${p}="${a[p]}"`).filter(p=>p!=null);if(g.length&&(t=t.replace(G,`<svg ${g.join(" ")} `)),s){const{defaultStyle:p,defaultClass:d}=s;d&&!t.includes("class=")&&(t=t.replace(G,`<svg class="${d}" `)),p&&!t.includes("style=")&&(t=t.replace(G,`<svg style="${p}" `))}const _=s?.usedProps;return _&&(Object.keys(f).forEach(p=>{const d=a[p];d!=null&&(_[p]=d)}),typeof a.width<"u"&&a.width!==null&&(_.width=a.width),typeof a.height<"u"&&a.height!==null&&(_.height=a.height)),t}async function te(t,e,n,s){let r;try{if(typeof t=="function")r=await t(n);else{const i=t[n];r=typeof i=="function"?await i():i}}catch(i){console.warn(`Failed to load custom icon "${n}" in "${e}":`,i);return}if(r){const i=r.indexOf("<svg");i>0&&(r=r.slice(i));const{transform:o}=s?.customizations??{};return r=typeof o=="function"?await o(r,e,n):r,r.startsWith("<svg")?await de(s?.customizations?.trimCustomSvg===!0?ze(r):r,e,n,s,void 0):(console.warn(`Custom icon "${n}" in "${e}" is not a valid SVG`),r)}}async function pe(t,e,n,s){let r;const{customize:i}=s?.customizations??{};for(const o of n)if(r=Oe(t,o),r){let c={...he};typeof i=="function"&&(c=i(c));const{attributes:{width:f,height:u,...a},body:h}=Le(r,c),m=s?.scale;return await de(`<svg >${h}</svg>`,e,o,s,()=>({...a}),g=>{const _=(p,d)=>{const x=g[p];let w;if(!Z(x)){if(x)return;typeof m=="number"?m&&(w=`${m}em`):w=d}w?g[p]=w:delete g[p]};_("width",f),_("height",u)})}}const me=async(t,e,n)=>{const s=n?.customCollections?.[t];if(s)if(typeof s=="function"){let r;try{r=await s(e)}catch(i){console.warn(`Failed to load custom icon "${e}" in "${t}":`,i);return}if(r){if(typeof r=="string")return await te(()=>r,t,e,n);if("icons"in r){const i=[e,e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.replace(/([a-z])(\d+)/g,"$1-$2")];return await pe(r,t,i,n)}}}else return await te(s,t,e,n)};function Re(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ne=["academicons","akar-icons","ant-design","arcticons","basil","bi","bpmn","brandico","bx","bxl","bxs","bytesize","carbon","charm","ci","cib","cif","cil","circle-flags","circum","clarity","codicon","covid","cryptocurrency-color","cryptocurrency","dashicons","devicon-line","devicon-original","devicon-plain","devicon","ei","el","emblemicons","emojione-monotone","emojione-v1","emojione","entypo-social","entypo","eos-icons","ep","et","eva","fa-brands","fa-regular","fa-solid","fa","fa6-brands","fa6-regular","fa6-solid","fad","fe","feather","file-icons","flag","flagpack","flat-color-icons","flat-ui","fluent-emoji-flat","fluent-emoji-high-contrast","fluent-emoji","fluent-mdl2","fluent","fontelico","fontisto","formkit","foundation","fxemoji","gala","game-icons","geo","gg","gis","gridicons","grommet-icons","guidance","healthicons","heroicons-outline","heroicons-solid","heroicons","humbleicons","ic","icomoon-free","icon-park-outline","icon-park-solid","icon-park-twotone","icon-park","iconamoon","iconoir","icons8","il","ion","iwwa","jam","la","line-md","logos","ls","lucide","majesticons","maki","map","material-symbols","mdi-light","mdi","medical-icon","memory","mi","mingcute","mono-icons","nimbus","nonicons","noto-v1","noto","octicon","oi","ooui","openmoji","pajamas","pepicons-pencil","pepicons-pop","pepicons-print","pepicons","ph","pixelarticons","prime","ps","quill","radix-icons","raphael","ri","si-glyph","simple-icons","simple-line-icons","skill-icons","solar","streamline-emojis","streamline","subway","svg-spinners","system-uicons","tabler","tdesign","teenyicons","topcoat","twemoji","typcn","uil","uim","uis","uit","uiw","vaadin","vs","vscode-icons","websymbol","whh","wi","wpf","zmdi","zondicons"];const Ve=Re(Ne);function De(t){const e=new Map;function n(s){if(Ve.includes(s))return e.has(s)||e.set(s,Se(`${t}@iconify-json/${s}/icons.json`)),e.get(s)}return async(s,r,i)=>{let o=await me(s,r,i);if(o)return o;const c=await n(s);if(c){const f=[r,r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r.replace(/([a-z])(\d+)/g,"$1-$2")];o=await pe(c,s,f,i)}return o}}function Be(t){const e=t.length;let n=-1,s,r="";const i=t.charCodeAt(0);for(;++n<e;){if(s=t.charCodeAt(n),s===0){r+="�";continue}if(s===37){r+="\\%";continue}if(s===44){r+="\\,";continue}if(s>=1&&s<=31||s===127||n===0&&s>=48&&s<=57||n===1&&s>=48&&s<=57&&i===45){r+=`\\${s.toString(16)} `;continue}if(n===0&&e===1&&s===45){r+=`\\${t.charAt(n)}`;continue}if(s>=128||s===45||s===95||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122){r+=t.charAt(n);continue}r+=`\\${t.charAt(n)}`}return r}const W=Be;function k(t=[]){return Array.isArray(t)?t:[t]}function H(t){return Array.from(new Set(t))}function Ue(t,e){return t.reduce((n,s)=>(n.findIndex(i=>e(s,i))===-1&&n.push(s),n),[])}function O(t){return typeof t=="string"}function R(t){return O(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function He(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>R(e)):[t]:[R(t)]}function Ge(t){return t.filter(([e,n],s)=>{if(e.startsWith("$$"))return!1;for(let r=s-1;r>=0;r--)if(t[r][0]===e&&t[r][1]===n)return!1;return!0})}function Y(t){return t==null?"":Ge(t).map(([e,n])=>n!=null?`${e}:${n};`:void 0).filter(Boolean).join("")}function V(t){return t&&typeof t=="object"&&!Array.isArray(t)}function ge(t,e,n=!1){const s=t,r=e;if(Array.isArray(r))return n&&Array.isArray(r)?[...s,...r]:[...r];const i={...s};return V(s)&&V(r)&&Object.keys(r).forEach(o=>{V(s[o])&&V(r[o])||Array.isArray(s[o])&&Array.isArray(r[o])?i[o]=ge(s[o],r[o],n):Object.assign(i,{[o]:r[o]})}),i}function B(t){let e,n,s;if(Array.isArray(t)){for(n=Array(e=t.length);e--;)n[e]=(s=t[e])&&typeof s=="object"?B(s):s;return n}if(Object.prototype.toString.call(t)==="[object Object]"){n={};for(e in t)e==="__proto__"?Object.defineProperty(n,e,{value:B(t[e]),configurable:!0,enumerable:!0,writable:!0}):n[e]=(s=t[e])&&typeof s=="object"?B(s):s;return n}return t}function We(t){return O(t[0])}function Ye(t){return O(t[0])}const ne="$$shortcut-no-merge";function qe(t){return typeof t=="function"?{match:t}:t}function re(t){return t.length===3}function Ke(t){return t!=null}function Xe(){}var Ze=Object.defineProperty,Je=(t,e,n)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qe=(t,e,n)=>(Je(t,typeof e!="symbol"?e+"":e,n),n);class et{constructor(){Qe(this,"_map",new Map)}get(e,n){const s=this._map.get(e);if(s)return s.get(n)}getFallback(e,n,s){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.has(n)||r.set(n,s),r.get(n)}set(e,n,s){let r=this._map.get(e);return r||(r=new Map,this._map.set(e,r)),r.set(n,s),this}has(e,n){return this._map.get(e)?.has(n)}delete(e,n){return this._map.get(e)?.delete(n)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([n,s])=>Array.from(s.entries()).map(([r,i])=>e(i,n,r)))}}var tt=Object.defineProperty,nt=(t,e,n)=>e in t?tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rt=(t,e,n)=>(nt(t,typeof e!="symbol"?e+"":e,n),n);class ye extends Set{constructor(e){super(e),rt(this,"_map"),this._map??(this._map=new Map)}add(e){return this._map??(this._map=new Map),this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.delete(e),super.delete(e)}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,n){return this._map.set(e,n),super.add(e)}}function q(t){return t instanceof ye}const D={};function st(t=["-",":"]){const e=t.join("|");return D[e]||(D[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),D[e].lastIndex=0,D[e]}function it(t,e=["-",":"],n=5){const s=st(e);let r,i=t.toString();const o=new Set,c=new Map;do r=!1,i=i.replace(s,(u,a,h,m,g)=>{if(!e.includes(h))return u;r=!0,o.add(a+h);const _=g+a.length+h.length+1,p={length:u.length,items:[]};c.set(g,p);for(const d of[...m.matchAll(/\S+/g)]){const x=_+d.index;let w=c.get(x)?.items;w?c.delete(x):w=[{offset:x,length:d[0].length,className:d[0]}];for(const S of w)S.className=S.className==="~"?a:S.className.replace(/^(!?)(.*)/,`$1${a}${h}$2`),p.items.push(S)}return"$".repeat(u.length)}),n-=1;while(r&&n);let f;if(typeof t=="string"){f="";let u=0;for(const[a,h]of c)f+=t.slice(u,a),f+=h.items.map(m=>m.className).join(" "),u=a+h.length;f+=t.slice(u)}else{f=t;for(const[u,a]of c)f.overwrite(u,u+a.length,a.items.map(h=>h.className).join(" "))}return{prefixes:Array.from(o),hasChanged:r,groupsByOffset:c,get expanded(){return f.toString()}}}function ot(t,e=["-",":"],n=5){const s=it(t,e,n);return typeof t=="string"?s.expanded:t}const se=new Set;function we(t){se.has(t)||(console.warn("[unocss]",t),se.add(t))}const at=/[\\:]?[\s'"`;{}]+/g;function ct(t){return t.split(at)}const lt={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return ct(t)}};function ft(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(n=>n(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(n=>n!==e)}}}const K="default",X="preflights",ut="shortcuts",ht="imports",dt={[ht]:-200,[X]:-100,[ut]:-10,[K]:0};function ve(t){return k(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}const ie="_uno_resolved";function pt(t){let e=typeof t=="function"?t():t;if(ie in e)return e;e={...e},Object.defineProperty(e,ie,{value:!0,enumerable:!1});const n=e.shortcuts?ve(e.shortcuts):void 0;if(e.shortcuts=n,e.prefix||e.layer){const s=r=>{r[2]||(r[2]={});const i=r[2];i.prefix==null&&e.prefix&&(i.prefix=k(e.prefix)),i.layer==null&&e.layer&&(i.layer=e.layer)};n?.forEach(s),e.rules?.forEach(s)}return e}function be(t){const e=pt(t);if(!e.presets)return[e];const n=(e.presets||[]).flatMap(k).flatMap(be);return[e,...n]}function oe(t={},e={}){const n=Object.assign({},e,t),s=Ue((n.presets||[]).flatMap(k).flatMap(be),(l,v)=>l.name===v.name),r=[...s.filter(l=>l.enforce==="pre"),...s.filter(l=>!l.enforce),...s.filter(l=>l.enforce==="post")],i=[...r,n],o=[...i].reverse(),c=Object.assign({},dt,...i.map(l=>l.layers));function f(l){return H(i.flatMap(v=>k(v[l]||[])))}const u=f("extractors");let a=o.find(l=>l.extractorDefault!==void 0)?.extractorDefault;a===void 0&&(a=lt),a&&!u.includes(a)&&u.unshift(a),u.sort((l,v)=>(l.order||0)-(v.order||0));const h=f("rules"),m={},g=h.length,_=h.map((l,v)=>{if(We(l)){k(l[2]?.prefix||"").forEach(A=>{m[A+l[0]]=[v,l[1],l[2],l]});return}return[v,...l]}).filter(Boolean).reverse();let p=mt(i.map(l=>l.theme));const d=f("extendTheme");for(const l of d)p=l(p)||p;const x={templates:H(i.flatMap(l=>k(l.autocomplete?.templates))),extractors:i.flatMap(l=>k(l.autocomplete?.extractors)).sort((l,v)=>(l.order||0)-(v.order||0)),shorthands:gt(i.map(l=>l.autocomplete?.shorthands||{}))};let w=f("separators");w.length||(w=[":","-"]);const S={mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:l=>l,...n,presets:r,envMode:n.envMode||"build",shortcutsLayer:n.shortcutsLayer||"shortcuts",layers:c,theme:p,rulesSize:g,rulesDynamic:_,rulesStaticMap:m,preprocess:f("preprocess"),postprocess:f("postprocess"),preflights:f("preflights"),autocomplete:x,variants:f("variants").map(qe).sort((l,v)=>(l.order||0)-(v.order||0)),shortcuts:ve(f("shortcuts")).reverse(),extractors:u,safelist:f("safelist"),separators:w,details:n.details??n.envMode==="dev"};for(const l of i)l?.configResolved?.(S);return S}function mt(t){return t.map(e=>e?B(e):{}).reduce((e,n)=>ge(e,n),{})}function gt(t){return t.reduce((e,n)=>{const s={};for(const r in n){const i=n[r];Array.isArray(i)?s[r]=`(${i.join("|")})`:s[r]=i}return{...e,...s}},{})}const yt="0.56.5";var wt=Object.defineProperty,vt=(t,e,n)=>e in t?wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F=(t,e,n)=>(vt(t,typeof e!="symbol"?e+"":e,n),n);class bt{constructor(e={},n={}){this.userConfig=e,this.defaults=n,F(this,"version",yt),F(this,"_cache",new Map),F(this,"config"),F(this,"blocked",new Set),F(this,"parentOrders",new Map),F(this,"events",ft()),this.config=oe(e,n),this.events.emit("config",this.config)}setConfig(e,n){e&&(n&&(this.defaults=n),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=oe(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,n,s=new Set){const r={original:e,code:e,id:n,extracted:s,envMode:this.config.envMode};for(const i of this.config.extractors){const o=await i.extract?.(r);if(o)if(q(o)&&q(s))for(const c of o)s.setCount(c,s.getCount(c)+o.getCount(c));else for(const c of o)s.add(c)}return s}makeContext(e,n){const s={rawSelector:e,currentSelector:n[1],theme:this.config.theme,generator:this,variantHandlers:n[2],constructCSS:(...r)=>this.constructCustomCSS(s,...r),variantMatch:n};return s}async parseToken(e,n){if(this.blocked.has(e))return;const s=`${e}${n?` ${n}`:""}`;if(this._cache.has(s))return this._cache.get(s);let r=e;for(const u of this.config.preprocess)r=u(e);if(this.isBlocked(r)){this.blocked.add(e),this._cache.set(s,null);return}const i=await this.matchVariants(e,r);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(s,null);return}const o=this.makeContext(e,[n||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);const c=await this.expandShortcut(o.currentSelector,o),f=c?await this.stringifyShortcuts(o.variantMatch,o,c[0],c[1]):(await this.parseUtil(o.variantMatch,o))?.map(u=>this.stringifyUtil(u,o)).filter(Ke);if(f?.length)return this._cache.set(s,f),f;this._cache.set(s,null)}async generate(e,n={}){const{id:s,scope:r,preflights:i=!0,safelist:o=!0,minify:c=!1,extendedInfo:f=!1}=n,u=O(e)?await this.applyExtractors(e,s,f?new ye:new Set):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(l=>{u.has(l)||u.add(l)});const a=c?"":`
|
|
2
|
-
`,h=new Set([K]),m=f?new Map:new Set,g=new Map;let _={};const p=Array.from(u).map(async l=>{if(m.has(l))return;const v=await this.parseToken(l);if(v!=null){m instanceof Map?m.set(l,{data:v,count:q(u)?u.getCount(l):-1}):m.add(l);for(const C of v){const A=C[3]||"",j=C[4]?.layer;g.has(A)||g.set(A,[]),g.get(A).push(C),j&&h.add(j)}}});await Promise.all(p),await(async()=>{if(!i)return;const l={generator:this,theme:this.config.theme},v=new Set([]);this.config.preflights.forEach(({layer:C=X})=>{h.add(C),v.add(C)}),_=Object.fromEntries(await Promise.all(Array.from(v).map(async C=>{const j=(await Promise.all(this.config.preflights.filter(L=>(L.layer||X)===C).map(async L=>await L.getCSS(l)))).filter(Boolean).join(a);return[C,j]})))})();const d=this.config.sortLayers(Array.from(h).sort((l,v)=>(this.config.layers[l]??0)-(this.config.layers[v]??0)||l.localeCompare(v))),x={},w=l=>{if(x[l])return x[l];let v=Array.from(g).sort((A,j)=>(this.parentOrders.get(A[0])??0)-(this.parentOrders.get(j[0])??0)||A[0]?.localeCompare(j[0]||"")||0).map(([A,j])=>{const L=j.length,I=j.filter(y=>(y[4]?.layer||K)===l).sort((y,$)=>y[0]-$[0]||(y[4]?.sort||0)-($[4]?.sort||0)||y[5]?.currentSelector?.localeCompare($[5]?.currentSelector??"")||y[1]?.localeCompare($[1]||"")||y[2]?.localeCompare($[2]||"")||0).map(([,y,$,,M,,E])=>[[[(y&&_t(y,r))??"",M?.sort??0]],$,!!(E??M?.noMerge)]);if(!I.length)return;const N=I.reverse().map(([y,$,M],E)=>{if(!M&&this.config.mergeSelectors)for(let T=E+1;T<L;T++){const P=I[T];if(P&&!P[2]&&(y&&P[0]||y==null&&P[0]==null)&&P[1]===$)return y&&P[0]&&P[0].push(...y),null}const z=y?H(y.sort((T,P)=>T[1]-P[1]||T[0]?.localeCompare(P[0]||"")||0).map(T=>T[0]).filter(Boolean)):[];return z.length?`${z.join(`,${a}`)}{${$}}`:$}).filter(Boolean).reverse().join(a);if(!A)return N;const b=A.split(" $$ ");return`${b.join("{")}{${a}${N}${a}${"}".repeat(b.length)}`}).filter(Boolean).join(a);i&&(v=[_[l],v].filter(Boolean).join(a));const C=c?"":`/* layer: ${l} */${a}`;return x[l]=v?C+v:""},S=(l=d,v)=>l.filter(C=>!v?.includes(C)).map(C=>w(C)||"").filter(Boolean).join(a);return{get css(){return S()},layers:d,matched:m,getLayers:S,getLayer:w}}async matchVariants(e,n){const s=new Set,r=[];let i=n||e,o=!0;const c={rawSelector:e,theme:this.config.theme,generator:this};for(;o;){o=!1;for(const f of this.config.variants){if(!f.multiPass&&s.has(f))continue;let u=await f.match(i,c);if(u){if(O(u)){if(u===i)continue;u={matcher:u}}i=u.matcher,r.unshift(u),s.add(f),o=!0;break}}if(!o)break;if(r.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,r,s]}applyVariants(e,n=e[4],s=e[1]){const i=n.slice().sort((u,a)=>(u.order||0)-(a.order||0)).reduceRight((u,a)=>h=>{const m=a.body?.(h.entries)||h.entries,g=Array.isArray(a.parent)?a.parent:[a.parent,void 0];return(a.handle??At)({...h,entries:m,selector:a.selector?.(h.selector,m)||h.selector,parent:g[0]||h.parent,parentOrder:g[1]||h.parentOrder,layer:a.layer||h.layer,sort:a.sort||h.sort},u)},u=>u)({prefix:"",selector:Ct(s),pseudo:"",entries:e[2]}),{parent:o,parentOrder:c}=i;o!=null&&c!=null&&this.parentOrders.set(o,c);const f={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(const u of this.config.postprocess)u(f);return f}constructCustomCSS(e,n,s){const r=R(n);if(O(r))return r;const{selector:i,entries:o,parent:c}=this.applyVariants([0,s||e.rawSelector,r,void 0,e.variantHandlers]),f=`${i}{${Y(o)}}`;return c?`${c}{${f}}`:f}async parseUtil(e,n,s=!1,r){const[i,o,c]=O(e)?await this.matchVariants(e):e;this.config.details&&(n.rules=n.rules??[]);const f=this.config.rulesStaticMap[o];if(f&&f[1]&&(s||!f[2]?.internal)){this.config.details&&n.rules.push(f[3]);const a=f[0],h=R(f[1]),m=f[2];return O(h)?[[a,h,m]]:[[a,i,h,m,c]]}n.variantHandlers=c;const{rulesDynamic:u}=this.config;for(const[a,h,m,g]of u){if(g?.internal&&!s)continue;let _=o;if(g?.prefix){const w=k(g.prefix);if(r){const S=k(r);if(!w.some(l=>S.includes(l)))continue}else{const S=w.find(l=>o.startsWith(l));if(S==null)continue;_=o.slice(S.length)}}const p=_.match(h);if(!p)continue;const d=await m(p,n);if(!d)continue;this.config.details&&n.rules.push([h,m,g]);const x=He(d).filter(w=>w.length);if(x.length)return x.map(w=>O(w)?[a,w,g]:[a,i,w,g,c])}}stringifyUtil(e,n){if(!e)return;if(re(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?n:void 0,void 0];const{selector:s,entries:r,parent:i,layer:o,sort:c,noMerge:f}=this.applyVariants(e),u=Y(r);if(!u)return;const{layer:a,sort:h,...m}=e[3]??{},g={...m,layer:o??a,sort:c??h};return[e[0],s,u,i,g,this.config.details?n:void 0,f]}async expandShortcut(e,n,s=5){if(s===0)return;const r=this.config.details?c=>{n.shortcuts=n.shortcuts??[],n.shortcuts.push(c)}:Xe;let i,o;for(const c of this.config.shortcuts){let f=e;if(c[2]?.prefix){const a=k(c[2].prefix).find(h=>e.startsWith(h));if(a==null)continue;f=e.slice(a.length)}if(Ye(c)){if(c[0]===f){i=i||c[2],o=c[1],r(c);break}}else{const u=f.match(c[0]);if(u&&(o=c[1](u,n)),o){i=i||c[2],r(c);break}}}if(O(o)&&(o=ot(o.trim()).split(/\s+/g)),!o){const[c,f]=O(e)?await this.matchVariants(e):e;if(c!==f){const u=await this.expandShortcut(f,n,s-1);u&&(o=u[0].map(a=>O(a)?c.replace(f,a):a))}}if(o)return[(await Promise.all(o.map(async c=>(O(c)?(await this.expandShortcut(c,n,s-1))?.[0]:void 0)||[c]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,n,s,r={layer:this.config.shortcutsLayer}){const i=new et,o=(await Promise.all(H(s).map(async a=>{const h=O(a)?await this.parseUtil(a,n,!0,r.prefix):[[Number.POSITIVE_INFINITY,"{inline}",R(a),void 0,[]]];return!h&&this.config.warn&&we(`unmatched utility "${a}" in shortcut "${e[1]}"`),h||[]}))).flat(1).filter(Boolean).sort((a,h)=>a[0]-h[0]),[c,,f]=e,u=[];for(const a of o){if(re(a)){u.push([a[0],void 0,a[1],void 0,a[2],n,void 0]);continue}const{selector:h,entries:m,parent:g,sort:_,noMerge:p}=this.applyVariants(a,[...a[4],...f],c);i.getFallback(h,g,[[],a[0]])[0].push([m,!!(p??a[3]?.noMerge),_??0])}return u.concat(i.map(([a,h],m,g)=>{const _=(d,x,w)=>{const S=Math.max(...w.map(v=>v[1])),l=w.map(v=>v[0]);return(d?[l.flat(1)]:l).map(v=>{const C=Y(v);if(C)return[h,m,C,g,{...r,noMerge:x,sort:S},n,void 0]})};return[[a.filter(([,d])=>d).map(([d,,x])=>[d,x]),!0],[a.filter(([,d])=>!d).map(([d,,x])=>[d,x]),!1]].map(([d,x])=>[..._(!1,x,d.filter(([w])=>w.some(S=>S[0]===ne))),..._(!0,x,d.filter(([w])=>w.every(S=>S[0]!==ne)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(n=>typeof n=="function"?n(e):O(n)?n===e:n.test(e))}}function St(t,e){return new bt(t,e)}const xt=/\s\$\$\s+/g;function $t(t){return t.match(/\s\$\$\s/)}function _t(t,e){return $t(t)?t.replace(xt,e?` ${e} `:" "):e?`${e} ${t}`:t}const ae=/^\[(.+?)(~?=)"(.*)"\]$/;function Ct(t){return ae.test(t)?t.replace(ae,(e,n,s,r)=>`[${W(n)}${s}"${W(r)}"]`):`.${W(t)}`}function At(t,e){return e(t)}function Ot(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Mt(t){let e=t.startsWith("<svg>")?t.replace("<svg>","<svg >"):t;return!e.includes(" xmlns:xlink=")&&e.includes(" xlink:")&&(e=e.replace("<svg ",'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')),e.includes(" xmlns=")||(e=e.replace("<svg ",'<svg xmlns="http://www.w3.org/2000/svg" ')),Ot(e)}const jt=3;function Et(t){return(e={})=>{const{scale:n=1,mode:s="auto",prefix:r="i-",warn:i=!1,collections:o,extraProperties:c={},customizations:f={},autoInstall:u=!1,layer:a="icons",unit:h}=e,m={addXmlNs:!0,scale:n,customCollections:o,autoInstall:u,warn:void 0,customizations:{...f,additionalProps:{...c},trimCustomSvg:!0,async iconCustomizer(_,p,d){await f.iconCustomizer?.(_,p,d),h&&(d.width||(d.width=`${n}${h}`),d.height||(d.height=`${n}${h}`))}}};let g;return{name:"@unocss/preset-icons",enforce:"pre",options:e,layers:{icons:-30},rules:[[/^([a-z0-9:_-]+)(?:\?(mask|bg|auto))?$/,async([_,p,d=s])=>{let x="",w="",S;g=g||await t(e);const l={};if(p.includes(":"))[x,w]=p.split(":"),S=await g(x,w,{...m,usedProps:l});else{const C=p.split(/-/g);for(let A=jt;A>=1&&(x=C.slice(0,A).join("-"),w=C.slice(A).join("-"),S=await g(x,w,{...m,usedProps:l}),!S);A--);}if(!S){i&&we(`failed to load icon "${_}"`);return}const v=`url("data:image/svg+xml;utf8,${Mt(S)}")`;return d==="auto"&&(d=S.includes("currentColor")?"mask":"bg"),d==="mask"?{"--un-icon":v,"-webkit-mask":"var(--un-icon) no-repeat",mask:"var(--un-icon) no-repeat","-webkit-mask-size":"100% 100%","mask-size":"100% 100%","background-color":"currentColor",color:"inherit",...l}:{background:`${v} no-repeat`,"background-size":"100% 100%","background-color":"transparent",...l}},{layer:a,prefix:r}]]}}}const kt=Et(async t=>{const{cdn:e}=t;return e?De(e):me});function Pt(t){return t.replace(/-(\w)/g,(e,n)=>n?n.toUpperCase():"")}function ce(t){return t.charAt(0).toUpperCase()+t.slice(1)}function le(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var fe=["Webkit","Moz","ms"];function Lt(t){const e={};function n(s){const r=e[s];if(r)return r;let i=Pt(s);if(i!=="filter"&&i in t)return e[s]=le(i);i=ce(i);for(let o=0;o<fe.length;o++){const c=`${fe[o]}${i}`;if(c in t)return e[s]=le(ce(c))}return s}return({entries:s})=>s.forEach(r=>{r[0].startsWith("--")||(r[0]=n(r[0]))})}function zt(t){return t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}function Tt(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}const e=window,n=window.document,s=()=>n.documentElement,r=e.__unocss||{},i=Object.assign({},t,r.runtime),o=i.defaults||{},c=i.cloakAttribute??"un-cloak";i.autoPrefix&&(o.postprocess=k(o.postprocess)).unshift(Lt(n.createElement("div").style)),i.configResolved?.(r,o);const f=St(r,o),u=b=>i.inject?i.inject(b):s().prepend(b),a=new Map;let h=!0,m=new Set,g,_,p=[];const d=()=>new Promise(b=>{p.push(b),_!=null&&clearTimeout(_),_=setTimeout(()=>S().then(()=>{const y=p;p=[],y.forEach($=>$())}),0)});function x(b){if(b.nodeType!==1)return;const y=b;y.hasAttribute(c)&&y.removeAttribute(c),y.querySelectorAll(`[${c}]`).forEach($=>{$.removeAttribute(c)})}function w(b,y){let $=a.get(b);if(!$)if($=n.createElement("style"),$.setAttribute("data-unocss-runtime-layer",b),a.set(b,$),y==null)u($);else{const M=w(y),E=M.parentNode;E?E.insertBefore($,M.nextSibling):u($)}return $}async function S(){const b=await f.generate(m);return b.layers.reduce((y,$)=>(w($,y).innerHTML=b.getLayer($)??"",$),void 0),m=b.matched,{...b,getStyleElement:y=>a.get(y),getStyleElements:()=>a}}async function l(b){const y=m.size;await f.applyExtractors(b,void 0,m),y!==m.size&&await d()}async function v(){const b=n.body,y=b&&b.outerHTML;y&&(await l(`${y} ${zt(y)}`),x(s()),x(b))}const C=new MutationObserver(b=>{h||b.forEach(async y=>{if(y.target.nodeType!==1)return;const $=y.target;for(const M of a)if($===M[1])return;if(y.type==="childList")y.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;const E=M;g&&!g(E)||(await l(E.outerHTML),x(E))});else{if(g&&!g($))return;if(y.attributeName!==c){const M=Array.from($.attributes).map(z=>z.value?`${z.name}="${z.value}"`:z.name).join(" "),E=`<${$.tagName.toLowerCase()} ${M}>`;await l(E)}$.hasAttribute(c)&&$.removeAttribute(c)}})});let A=!1;function j(){if(A)return;const b=i.observer?.target?i.observer.target():s()||n.body;b&&(C.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.observer?.attributeFilter}),A=!0)}function L(){i.bypassDefined&&It(f.blocked),v(),j()}function I(){n.readyState==="loading"?e.addEventListener("DOMContentLoaded",L):L()}const N=e.__unocss_runtime=e.__unocss_runtime={version:f.version,uno:f,async extract(b){O(b)||(b.forEach(y=>m.add(y)),b=""),await l(b)},extractAll:v,inspect(b){g=b},toggleObserver(b){b===void 0?h=!h:h=!!b,!A&&!h&&I()},update:S};i.ready?.(N)!==!1&&(h=!1,I())}function It(t=new Set){for(let e=0;e<document.styleSheets.length;e++){const n=document.styleSheets[e];let s;try{if(s=n.cssRules||n.rules,!s)continue;Array.from(s).flatMap(r=>r.selectorText?.split(/,/g)||[]).forEach(r=>{r&&(r=r.trim(),r.startsWith(".")&&(r=r.slice(1)),t.add(r))})}catch{continue}}return t}Tt({defaults:{presets:[kt({prefix:["i-",""],collections:{},cdn:"https://esm.sh/",scale:1.2,extraProperties:{display:"inline-block","vertical-align":"middle"}})]},bypassDefined:!0});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as D}from"./NNavbar.vue.737ef1b1.js";import{_ as S}from"./NCodeBlock.vue.9ce69690.js";import{o as c,m as _,k as s,d as B,r as v,bG as j,bH as G,ax as P,a as p,af as E,i as l,j as u,F as f,S as H,f as i,l as I,n as R,t as h,G as U,h as W,am as z,A}from"./entry.909ad6c7.js";import{_ as L}from"./HelpFab.vue.f0924b60.js";import"./client.17f79a3c.js";const q={class:"markdown-body"},J=s("h1",null,"Virtual Files",-1),K=s("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1),M=[J,K],O={__name:"virtual-files",setup(x,{expose:n}){return n({frontmatter:{}}),(d,a)=>(c(),_("div",q,M))}},Q=["onClick"],T=s("div",{"x-divider":""},null,-1),X={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Y={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},Z=s("span",{op75:""},"Select a file to start",-1),re=B({__name:"virtual-files",setup(x){const n=v(""),o=j(),d=G(),a=v();P(()=>{if(!d.value)return;const e=`/_vfs.json/${encodeURIComponent(d.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>a.value=t.current)});function y(e){if(o.value?.rootDir)return e.startsWith(o.value?.rootDir)?e.slice(o.value.rootDir.length):e}const m=p(()=>o.value?o.value.entries.filter(e=>!e.id.startsWith(`${o.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),k=p(()=>new E(m.value,{keys:["id","path"]})),b=p(()=>n.value?k.value.search(n.value).map(e=>e.item):m.value);return(e,t)=>{const g=D,$=S,C=z,F=A,N=H,V=O,w=L;return c(),_(f,null,[l(N,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(g,{search:i(n),"onUpdate:search":t[0]||(t[0]=r=>I(n)?n.value=r:null),"no-padding":"",p3:""},null,8,["search"]),(c(!0),_(f,null,R(i(b),r=>(c(),_(f,{key:r.id},[s("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:U(r.id===i(a)?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:ee=>d.value=r.id},h(y(r.id)),11,Q),T],64))),128))]),right:u(()=>[i(a)?.content?(c(),_("div",X,[s("div",Y,[s("code",null,h(i(a).id),1)]),l($,{"h-full":"","of-auto":"","text-sm":"",code:i(a).content,lang:"typescript"},null,8,["code"])])):(c(),W(F,{key:1},{default:u(()=>[l(C,{px6:"",py2:""},{default:u(()=>[Z]),_:1})]),_:1}))]),_:1}),l(w,null,{default:u(()=>[l(V)]),_:1})],64)}}});export{re as default};
|