@vitejs/devtools-vite 0.0.0-alpha.13 → 0.0.0-alpha.14
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/dist/nitro.json +1 -1
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/{BSR6S2_V.js → 3WaMGJ3H.js} +1 -1
- package/dist/public/_nuxt/{D0XiwC-h.js → Ar1wOxvv.js} +1 -1
- package/dist/public/_nuxt/{DHRJYaU2.js → BGNXffQn.js} +1 -1
- package/dist/public/_nuxt/{CtHwuXTq.js → BHDQl9sm.js} +1 -1
- package/dist/public/_nuxt/{C-jE5b1g.js → BV5XWpFM.js} +1 -1
- package/dist/public/_nuxt/{CuJkRDWW.js → BsAtFXkB.js} +1 -1
- package/dist/public/_nuxt/{0-Bl3cVH.js → C1B7Lb_i.js} +1 -1
- package/dist/public/_nuxt/{B5-VM92c.js → C4x1Rf0J.js} +1 -1
- package/dist/public/_nuxt/{Di2_bjXy.js → C5uSI1no.js} +1 -1
- package/dist/public/_nuxt/{BAlGH8ya.js → CPuYr29B.js} +1 -1
- package/dist/public/_nuxt/{B4ZZgoB1.js → CRMDyaSt.js} +1 -1
- package/dist/public/_nuxt/{Ba21-vnu.js → CS8yIZOI.js} +1 -1
- package/dist/public/_nuxt/{DB1sxaHK.js → Cf0Ulfyt.js} +1 -1
- package/dist/public/_nuxt/{On0L_g3U.js → CkP2VQQ5.js} +1 -1
- package/dist/public/_nuxt/{BLkMEE7A.js → CoZKVL3r.js} +1 -1
- package/dist/public/_nuxt/{Cp1s5jAa.js → D-16ZB3R.js} +1 -1
- package/dist/public/_nuxt/{PHNvB2PA.js → DBzHDCAH.js} +1 -1
- package/dist/public/_nuxt/{GX3Och7B.js → DEpkwN8C.js} +1 -1
- package/dist/public/_nuxt/{B_s5359_.js → DO0Faz7t.js} +1 -1
- package/dist/public/_nuxt/{CIKRkll0.js → DQcokXty.js} +1 -1
- package/dist/public/_nuxt/{oyXGDuE-.js → DRSBujEZ.js} +1 -1
- package/dist/public/_nuxt/{BMyEoXFt.js → Db5DS6RJ.js} +1 -1
- package/dist/public/_nuxt/{BFzxvwx4.js → DllKqWLf.js} +1 -1
- package/dist/public/_nuxt/{CQz25EDr.js → DoatHFDF.js} +1 -1
- package/dist/public/_nuxt/{Ct91oOwP.js → Dt9_rxzk.js} +1 -1
- package/dist/public/_nuxt/{DvZ2GXVF.js → DtEEoUTs.js} +1 -1
- package/dist/public/_nuxt/{BhCeI3NC.js → Dw84mysi.js} +1 -1
- package/dist/public/_nuxt/{BWfTzkt4.js → DwpaAMLk.js} +1 -1
- package/dist/public/_nuxt/{0q-eInnz.js → S09qVi2A.js} +1 -1
- package/dist/public/_nuxt/{DhtFIhLO.js → axTMqr-M.js} +3 -3
- package/dist/public/_nuxt/{yrqgJObY.js → bnZrYLT3.js} +1 -1
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/50731c7d-b8b6-4a10-81d8-8ebf715a1d47.json +1 -0
- package/dist/public/_nuxt/{entry.BndLQ4jF.css → entry.Dl9mWyLy.css} +1 -1
- package/dist/public/_nuxt/{C260IERh.js → h9JT8fy9.js} +1 -1
- package/dist/public/_nuxt/{DRAtdgrN.js → jnbX5wk_.js} +1 -1
- package/dist/public/_nuxt/{BhOPgiwp.js → k3tsOkpc.js} +1 -1
- package/dist/public/_nuxt/{CmALwHBX.js → l2P7b8gw.js} +1 -1
- package/dist/public/index.html +1 -1
- package/package.json +3 -3
- package/dist/public/_nuxt/builds/meta/8a9327db-c0f3-49d6-9192-9310df6282fd.json +0 -1
package/dist/nitro.json
CHANGED
package/dist/public/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.Dl9mWyLy.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/.devtools-vite/_nuxt/axTMqr-M.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><script type="module" src="/.devtools-vite/_nuxt/axTMqr-M.js" crossorigin></script><script id="unhead:payload" type="application/json">{"title":"Vite DevTools"}</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1762548408727,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/.devtools-vite/",buildId:"50731c7d-b8b6-4a10-81d8-8ebf715a1d47",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/public/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite DevTools</title><link rel="stylesheet" href="/.devtools-vite/_nuxt/entry.Dl9mWyLy.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/.devtools-vite/_nuxt/axTMqr-M.js"><meta name="description" content="DevTools for Vite"><meta property="og:title" content="Vite DevTools"><meta property="og:description" content="DevTools for Vite"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><script type="module" src="/.devtools-vite/_nuxt/axTMqr-M.js" crossorigin></script><script id="unhead:payload" type="application/json">{"title":"Vite DevTools"}</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1762548408727,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/.devtools-vite/",buildId:"50731c7d-b8b6-4a10-81d8-8ebf715a1d47",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Tt as t,Vt as n,ct as r,in as i,mt as a,ot as o,st as s,tn as c,ut as l}from"./
|
|
1
|
+
import{At as e,Tt as t,Vt as n,ct as r,in as i,mt as a,ot as o,st as s,tn as c,ut as l}from"./axTMqr-M.js";import{n as u}from"./DQtLZa7C.js";var d={"ml-0.4":``,"text-xs":``,op75:``},f=a({__name:`NumberWithUnit`,props:{number:{},unit:{}},setup(n){return(r,a)=>(t(),l(`div`,null,[e(r.$slots,`default`),s(`span`,null,i(n.number),1),s(`span`,d,i(n.unit),1)]))}}),p=Object.assign(f,{__name:`DisplayNumberWithUnit`}),m=a({__name:`Duration`,props:{duration:{},factor:{default:1},unit:{default:`ms`},color:{type:Boolean,default:!0}},setup(i){let a=i,s=o(()=>{if(a.duration!=null)return a.unit===`ns`?a.duration/1e3:a.duration});function l(e){return!a.color||e==null?``:(e*=a.factor,e<1?`op50`:e>1e4?`color-scale-critical`:e>1e3?`color-scale-high`:e>500?`color-scale-medium`:e>200?`color-scale-low`:`color-scale-neutral`)}let d=o(()=>u(s.value));return(i,a)=>{let o=p;return t(),r(o,{class:c(l(s.value)),number:d.value[0],unit:d.value[1]},{default:n(()=>[e(i.$slots,`default`)]),_:3},8,[`class`,`number`,`unit`])}}}),h=Object.assign(m,{__name:`DisplayDuration`});export{h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tt as e,Vt as t,ct as n,en as r,ft as i,in as a,it as o,kt as s,lt as c,mt as l,ot as u,pt as d,st as f,tn as p,ut as m}from"./
|
|
1
|
+
import{Tt as e,Vt as t,ct as n,en as r,ft as i,in as a,it as o,kt as s,lt as c,mt as l,ot as u,pt as d,st as f,tn as p,ut as m}from"./axTMqr-M.js";import{t as h}from"./CkP2VQQ5.js";import"./DQtLZa7C.js";import"./Db5DS6RJ.js";import"./DQcokXty.js";import{r as g,t as _}from"./h9JT8fy9.js";import{t as v}from"./l2P7b8gw.js";import{t as y}from"./3WaMGJ3H.js";import{t as b}from"./D-16ZB3R.js";var x={flex:`~ col gap-2`,p6:``},S={flex:`~ gap-2`},C={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_160px_2fr] gap-2 items-center`},w={"font-mono":``},T=[`datetime`],E={key:4},D={border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_1fr] gap-2 items-center`},O={flex:`~ gap-2`},k=l({__name:`index`,props:{session:{}},setup(l){let k=l,A=u(()=>[{title:`Build ID`,value:k.session.id,icon:`i-ph-hash-duotone`},{title:`Created At`,value:new Date(k.session.meta.timestamp),icon:`i-ph-clock-duotone`},{title:`Build Duration`,value:k.session.buildDuration,icon:`i-ph-timer-duotone`,type:`duration`},{title:`Directory`,value:k.session.meta.cwd,icon:`i-ph-folder-duotone`},{title:`Total Modules`,value:k.session.modulesList.length,icon:`i-ph-files-duotone`},{title:`Plugins`,value:k.session.meta.plugins.length,icon:`i-ph-plugs-duotone`},{title:`Platform`,value:k.session.meta.platform,icon:`i-ph-cpu-duotone`,type:`badge`},{title:`Format`,value:k.session.meta.format,icon:`i-ph-file-duotone`,type:`badge`}]);return(u,j)=>{let M=h,N=g,P=y,F=b,I=_;return e(),m(`div`,x,[f(`div`,S,[d(M,{"btn-action":``,to:{path:`/`}},{default:t(()=>[...j[0]||=[f(`div`,{"i-ph-arrow-bend-up-left-duotone":``},null,-1),i(` Re-select Session `,-1)]]),_:1})]),j[1]||=f(`div`,{op50:``,"mt-10":``},` Meta Info `,-1),f(`div`,C,[(e(!0),m(o,null,s(A.value,t=>(e(),m(o,{key:t.title},[f(`div`,{class:p(t.icon)},null,2),f(`div`,null,a(t.title),1),f(`div`,w,[t.value instanceof Date?(e(),m(`time`,{key:0,datetime:t.value.toISOString()},a(t.value.toLocaleString()),9,T)):t.type===`badge`?(e(),n(N,{key:1,text:String(t.value),py1:``},null,8,[`text`])):t.type===`duration`?(e(),n(P,{key:2,duration:+t.value},null,8,[`duration`])):typeof t.value==`number`?(e(),n(F,{key:3,number:t.value,py1:``,"rounded-full":``,"inline-block":``,"text-sm":``},null,8,[`number`])):(e(),m(`span`,E,a(t.value),1))])],64))),128))]),j[2]||=f(`div`,{op50:``,"mt-4":``},` Build Entries `,-1),f(`div`,D,[(e(!0),m(o,null,s(k.session.meta.inputs,t=>(e(),m(o,{key:t},[d(N,{text:t.name||``},null,8,[`text`]),d(I,{id:t.filename||``,session:l.session,link:!0},null,8,[`id`,`session`])],64))),128))]),j[3]||=f(`div`,{op50:``,"mt-4":``},` Views `,-1),f(`div`,O,[(e(!0),m(o,null,s(r(v),r=>(e(),m(o,{key:r.to},[r.category===`session`?(e(),n(M,{key:0,"btn-action":``,to:{path:r.to},flex:`~ col`,"min-w-40":``,p4:``},{default:t(()=>[f(`div`,{class:p(r.icon),"text-2xl":``},null,2),i(` `+a(r.title),1)]),_:2},1032,[`to`])):c(``,!0)],64))),128))])])}}});export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bt as e,Jt as t,Nt as n,S as r,Tt as i,Vt as a,ct as o,en as s,ft as c,in as l,it as u,kt as d,lt as f,mt as p,ot as m,pt as h,st as g,tn as _,ut as v,y}from"./
|
|
1
|
+
import{Bt as e,Jt as t,Nt as n,S as r,Tt as i,Vt as a,ct as o,en as s,ft as c,in as l,it as u,kt as d,lt as f,mt as p,ot as m,pt as h,st as g,tn as _,ut as v,y}from"./axTMqr-M.js";import{t as b}from"./CkP2VQQ5.js";import{t as x}from"./CS8yIZOI.js";import"./Db5DS6RJ.js";import"./DQcokXty.js";import{r as S,t as C}from"./h9JT8fy9.js";import{t as w}from"./CPuYr29B.js";import"./DnpfwSMy.js";import{t as T}from"./C5uSI1no.js";var E={flex:`~ col gap-2`},D={flex:`~ gap-1 items-center`,"font-mono":``,op50:``,"text-sm":``},O={"font-mono":``,"font-sm":``},k={key:0,flex:`~ gap-1 items-center`},A={key:0,op50:``,"text-xs":``,border:`~ base rounded-md`,px1:``,"font-mono":``},j=p({__name:`SessionSelector`,props:{sessionMode:{},sessions:{},selectedSessionIds:{},selectedSessions:{}},emits:[`select`],setup(e,{emit:t}){let r=e,p=t;function y(e){return T(e.meta.inputs[0]?.filename??``,e.meta.cwd).path}let x=m(()=>{let e=r.selectedSessions?.[0];return e?y(e):``});function j(e){return x.value&&x.value!==y(e)}function M(e){r.sessionMode===`compare`&&!j(e)&&p(`select`,e)}return(t,r)=>{let p=C,m=S,y=w;return i(),v(`div`,E,[(i(!0),v(u,null,d(e.sessions,t=>(i(),v(`div`,{key:t.id,flex:`~ row gap-2`,relative:``},[(i(),o(n(e.sessionMode===`list`?s(b):`div`),{to:`/session/${t.id}`,border:`~ rounded-md`,class:_(e.sessionMode===`list`?[`hover:bg-active`,`border-base`]:[e.selectedSessionIds.includes(t.id)?`border-active`:`border-base`,j(t)||e.selectedSessions.length===2&&!e.selectedSessionIds.includes(t.id)?`op50`:`hover:bg-active`]),flex:`~ col gap-1`,px4:``,py3:``,"w-full":``,onClick:e=>M(t)},{default:a(()=>[g(`div`,D,[r[0]||=g(`div`,{"i-ph-hash-duotone":``},null,-1),c(` `+l(t.id),1)]),g(`div`,O,l(t.meta.cwd),1),t.meta.inputs[0]?(i(),v(`div`,k,[h(p,{id:t.meta.inputs[0].filename,cwd:t.meta.cwd},null,8,[`id`,`cwd`]),h(m,{text:t.meta.inputs[0].name||`entry`},null,8,[`text`]),t.meta.inputs.length>1?(i(),v(`span`,A,` +`+l(t.meta.inputs.length-1),1)):f(``,!0)])):f(``,!0),h(y,{timestamp:t.timestamp,pt2:``,"text-sm":``,op50:``},null,8,[`timestamp`])]),_:2},1032,[`to`,`class`,`onClick`]))]))),128))])}}}),M=Object.assign(j,{__name:`PanelSessionSelector`}),N={p4:``,flex:`~ col gap-4`,"items-center":``,"justify-center":``,relative:``},P={op50:``},F={relative:``,flex:`~ col gap3 items-center`},I={fixed:``,"top-5":``,"right-5":``,flex:`~ col gap2`},L={flex:`~ row justify-around`,w20:``,h8:``,border:`~ base rounded-8`,"of-hidden":``},R=[`title`,`onClick`],z={key:0,fixed:``,"bottom-5":``,"right-5":``,border:`~ base rounded-2`,w100:``,"max-lg:w85":``,"bg-glass":``,"z-panel-content":``},B={flex:`~ justify-center`,p2:``},V={key:1,op80:``,"text-sm":``},H=p({__name:`index`,async setup(n){let p,S,C=t(`list`),w=[{label:`Session List`,icon:`i-ph-list-bullets-duotone`,value:`list`},{label:`Session Compare`,icon:`i-ph-git-diff-duotone`,value:`compare`}],T=t([]),E=m(()=>T.value.map(e=>e.id).sort()),D=m(()=>[...T.value].sort((e,t)=>e.timestamp-t.timestamp).map((e,t)=>({...e,createdAt:new Date(e.timestamp),title:t===0?`Session A`:`Session B`}))),O=y(),k=([p,S]=e(()=>O.value[`vite:rolldown:list-sessions`]()),p=await p,S(),p);function A(e){E.value.includes(e.id)?T.value=T.value.filter(t=>t.id!==e.id):T.value=[...T.value,e]}return(e,t)=>{let n=r,p=M,m=x,y=b;return i(),v(`div`,N,[h(n),g(`p`,P,l(C.value===`list`?`Select a build session to get started:`:`Select 2 build sessions to compare:`),1),g(`div`,F,[h(p,{"session-mode":C.value,sessions:s(k),"selected-session-ids":E.value,"selected-sessions":T.value,onSelect:A},null,8,[`session-mode`,`sessions`,`selected-session-ids`,`selected-sessions`])]),g(`div`,I,[g(`div`,L,[(i(),v(u,null,d(w,e=>g(`button`,{key:e.value,title:e.label,"flex-1":``,op50:``,flex:`~ items-center justify-center`,class:_({"bg-active text-base op100!":C.value===e.value}),hover:`bg-active text-base op100!`,onClick:t=>C.value=e.value},[g(`span`,{class:_([e.icon,`text-sm`])},null,2)],10,R)),64))])]),T.value.length>0&&C.value===`compare`?(i(),v(`div`,z,[h(m,{sessions:D.value,class:`flex-col gap0 [&>div]:border-none! [&>first-child]:border-b!`},null,8,[`sessions`]),g(`div`,B,[T.value.length===2?(i(),o(y,{key:0,tag:`button`,to:`/compare/${E.value.join(`,`)}`,"btn-action":``,"rounded-8":``,"text-3":``,flex:`~ justify-center`,w30:``,h8:``},{default:a(()=>[...t[0]||=[c(` Compare `,-1)]]),_:1},8,[`to`])):(i(),v(`div`,V,` Select one more session to compare. `))])])):f(``,!0)])}}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,Jt as t,Tt as n,Vt as r,W as i,_ as a,en as o,g as s,in as c,mt as l,ot as u,pt as d,st as f,ut as p}from"./
|
|
1
|
+
import{G as e,Jt as t,Tt as n,Vt as r,W as i,_ as a,en as o,g as s,in as c,mt as l,ot as u,pt as d,st as f,ut as p}from"./axTMqr-M.js";import{t as m}from"./CkP2VQQ5.js";import{i as h,l as g,o as _}from"./Db5DS6RJ.js";import{t as v}from"./BsAtFXkB.js";import{t as y}from"./DO0Faz7t.js";import{t as b}from"./DRSBujEZ.js";import{t as x}from"./CEQkJ3Wx.js";import{n as S,t as C}from"./DJHNY-5T.js";var w={flex:`~ col gap-2`,p4:``},T={flex:``,pb2:``},E={"w-8":``,"text-right":``,"text-xs":``,op50:``},D={"overflow-hidden":``,"text-ellipsis":``,"break-all":``,"line-clamp-2":``},O=l({__name:`FlatList`,props:{plugins:{}},setup(e){let t=i();return(i,a)=>{let s=v,l=m,u=b;return n(),p(`div`,w,[d(u,{items:e.plugins,"key-prop":`plugin_id`},{default:r(({item:e})=>[f(`div`,T,[d(l,{to:{path:o(t).path,query:{plugin:e.plugin_id}},"font-mono":``,border:`~ rounded base`,"w-full":``,px2:``,py1:``,"text-sm":``,hover:`bg-active`,flex:`~ gap-4 items-center`},{default:r(()=>[f(`div`,E,` #`+c(e.plugin_id),1),f(`span`,D,[d(s,{name:e.name},null,8,[`name`])])]),_:2},1032,[`to`])])]),_:1},8,[`items`])])}}}),k=Object.assign(O,{__name:`PluginsFlatList`}),A={relative:``,"max-h-screen":``,"of-hidden":``},j={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},M={"of-auto":``,"h-screen":``,flex:`~ col gap-2`,pt32:``},N={absolute:``,"bottom-4":``,"py-1":``,"px-2":``,"bg-glass":``,left:`1/2`,"translate-x":`-1/2`,border:`~ base rounded-full`,text:`center xs`},P={op50:``},F=l({__name:`plugins`,props:{session:{}},setup(r){let o=r,l=i(),m=e(),v=t({search:l.query.search||``,selected:l.query.plugin_types?S(l.query.plugin_types):null}),b=u(()=>[..._.filter(e=>o.session?.meta?.plugins?.some(t=>e.match.test(t.name))),h]),w=u(()=>{let e=o.session?.meta?.plugins;return v.value.selected&&(e=e.filter(e=>{let t=g(e.name);return v.value.selected.includes(t.name)})),e}),T=s(()=>w.value,()=>new x(w.value,{includeScore:!0,keys:[`name`],ignoreLocation:!0,threshold:.4})),E=u(()=>v.value.search?T.value.search(v.value.search).map(e=>e.item):w.value);return a(v.value,e=>{let t={...l.query,search:e.search||void 0,plugin_types:e.selected||void 0};m.replace({query:C(t)})},{debounce:500}),(e,t)=>{let i=y,a=k;return n(),p(`div`,A,[f(`div`,j,[d(i,{modelValue:v.value,"onUpdate:modelValue":t[0]||=e=>v.value=e,rules:b.value},null,8,[`modelValue`,`rules`])]),f(`div`,M,[d(a,{plugins:E.value??[]},null,8,[`plugins`]),f(`div`,N,[f(`span`,P,c(E.value.length)+` of `+c(r.session?.meta?.plugins?.length||0),1)])])])}}});export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ft as e,Nt as t,Tt as n,Vt as r,W as i,ct as a,en as o,it as s,kt as c,lt as l,mt as u,pt as d,rn as f,st as p,tn as m,ut as h,yt as g}from"./
|
|
1
|
+
import{Ft as e,Nt as t,Tt as n,Vt as r,W as i,ct as a,en as o,it as s,kt as c,lt as l,mt as u,pt as d,rn as f,st as p,tn as m,ut as h,yt as g}from"./axTMqr-M.js";import{t as _}from"./CkP2VQQ5.js";import{n as v,t as y}from"./DQcokXty.js";var b=[`open`],x={"font-mono":``},S={"font-mono":``},C=u({__name:`TreeNode`,props:g({node:{},icon:{default:`i-catppuccin:folder icon-catppuccin`},iconOpen:{default:`i-catppuccin:folder-open icon-catppuccin`},link:{type:[String,Boolean]},linkQueryKey:{default:`module`},padding:{default:0},open:{type:Boolean}},{open:{type:Boolean,required:!1,default:!0},openModifiers:{}}),emits:g([`select`],[`update:open`]),setup(u,{emit:g}){let C=u,T=g,E=e(u,`open`),D=i(),O=window.location;function k(e){C.link||T(`select`,e)}return(e,i)=>{let g=y,C=w,T=v;return n(),h(`details`,{open:E.value,onToggle:i[0]||=e=>E.value=e.target?.open},[p(`summary`,{"cursor-default":``,"select-none":``,"text-sm":``,truncate:``,style:f({paddingLeft:`${u.padding+.5}rem`}),flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active `},[p(`div`,{class:m([`i-ph-caret-right-duotone transition op50`,E.value?`rotate-90`:``])},null,2),p(`div`,{class:m(E.value&&u.iconOpen||u.icon),"inline-block":``,"vertical-text-bottom":``},null,2),p(`div`,x,[d(g,{path:u.node.name||``},null,8,[`path`])])],4),E.value?(n(),h(s,{key:0},[(n(!0),h(s,null,c(Object.entries(u.node.children),e=>(n(),a(C,{key:e[0],node:e[1],link:u.link,padding:u.padding+1,"link-query-key":u.linkQueryKey,onSelect:k},null,8,[`node`,`link`,`padding`,`link-query-key`]))),128)),(n(!0),h(s,null,c(u.node.items,e=>(n(),a(t(u.link?o(_):`div`),{key:e.full,to:u.link?typeof u.link==`string`?u.link:{path:o(D).path,query:{...o(D).query,[u.linkQueryKey]:e.full},hash:o(O).hash}:void 0,"text-sm":``,"ws-nowrap":``,flex:`~ gap-1`,px2:``,py1:``,rounded:``,hover:`bg-active`,style:f({paddingLeft:`${u.padding+2.7}rem`}),onClick:t=>k(e)},{default:r(()=>[d(T,{filename:e.full},null,8,[`filename`]),p(`div`,S,[d(g,{path:e.path.split(`/`).pop()||``},null,8,[`path`])])]),_:2},1032,[`to`,`style`,`onClick`]))),128))],64)):l(``,!0)],40,b)}}}),w=Object.assign(C,{__name:`DisplayTreeNode`});export{w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Nt as e,Tt as t,_t as n,ct as r,mt as i}from"./
|
|
1
|
+
import{Nt as e,Tt as t,_t as n,ct as r,mt as i}from"./axTMqr-M.js";import{r as a}from"./Db5DS6RJ.js";var o=i({__name:`PluginName`,props:{name:{},compact:{type:Boolean},colored:{type:Boolean},hide:{type:Boolean}},setup(i){let o=i,s=[`__load__`,`vite-plugin-`,`vite-`,`rollup-plugin-`,`rollup-`,`unplugin-`],c=[...s,`vite:`];function l(){let e=o.compact?c:s;for(let t of e)if(o.name.startsWith(t))return o.compact?n(`span`,o.name.slice(t.length)):n(`span`,[n(`span`,{class:`op50`},t),n(`span`,o.name.slice(t.length))]);let t=o.name.split(`:`);return t.length>1?n(`span`,[n(`span`,{style:{color:a(t[0])}},`${t[0]}:`),n(`span`,t.slice(1).join(`:`))]):n(`span`,o.name)}return(n,i)=>(t(),r(e(l)))}}),s=Object.assign(o,{__name:`DisplayPluginName`});export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,At as t,D as n,F as r,Jt as i,Lt as a,M as o,N as s,O as c,P as l,Qt as u,Rt as d,Tt as f,Xt as p,at as m,ct as h,en as g,in as _,it as v,j as y,k as b,kt as ee,lt as te,mt as ne,ot as x,rn as re,st as S,t as C,ut as w,wt as ie,xt as ae}from"./DhtFIhLO.js";import{t as T}from"./DQtLZa7C.js";import{t as oe}from"./BhOPgiwp.js";function E(){return typeof window<`u`}function D(e){return se(e)?(e.nodeName||``).toLowerCase():`#document`}function O(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k(e){return((se(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function se(e){return E()?e instanceof Node||e instanceof O(e).Node:!1}function A(e){return E()?e instanceof Element||e instanceof O(e).Element:!1}function j(e){return E()?e instanceof HTMLElement||e instanceof O(e).HTMLElement:!1}function ce(e){return!E()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O(e).ShadowRoot}var le=new Set([`inline`,`contents`]);function M(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!le.has(i)}var ue=new Set([`table`,`td`,`th`]);function de(e){return ue.has(D(e))}var fe=[`:popover-open`,`:modal`];function N(e){return fe.some(t=>{try{return e.matches(t)}catch{return!1}})}var pe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],me=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],he=[`paint`,`layout`,`strict`,`content`];function ge(e){let t=P(),n=A(e)?I(e):e;return pe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||me.some(e=>(n.willChange||``).includes(e))||he.some(e=>(n.contain||``).includes(e))}function _e(e){let t=R(e);for(;j(t)&&!F(t);){if(ge(t))return t;if(N(t))return null;t=R(t)}return null}function P(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var ve=new Set([`html`,`body`,`#document`]);function F(e){return ve.has(D(e))}function I(e){return O(e).getComputedStyle(e)}function L(e){return A(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R(e){if(D(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ce(e)&&e.host||k(e);return ce(t)?t.host:t}function ye(e){let t=R(e);return F(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&M(t)?t:ye(t)}function be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ye(e),i=r===e.ownerDocument?.body,a=O(r);if(i){let e=xe(a);return t.concat(a,a.visualViewport||[],M(r)?r:[],e&&n?be(e):[])}return t.concat(r,be(r,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Se(e){let t=I(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=j(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:i,c=r(n)!==o||r(i)!==s;return c&&(n=o,i=s),{width:n,height:i,$:c}}function Ce(e){return A(e)?e:e.contextElement}function z(e){let t=Ce(e);if(!j(t))return y(1);let n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Se(t),s=(o?r(n.width):n.width)/i,c=(o?r(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var we=y(0);function Te(e){let t=O(e);return!P()||!t.visualViewport?we:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O(e)?!1:t}function B(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ce(e),o=y(1);t&&(r?A(r)&&(o=z(r)):o=z(e));let s=Ee(a,n,r)?Te(a):y(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=O(a),t=r&&A(r)?O(r):r,n=e,i=xe(n);for(;i&&r&&t!==n;){let e=z(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=O(i),i=xe(n)}}return l({width:d,height:f,x:c,y:u})}function V(e,t){let n=L(e).scrollLeft;return t?t.left+n:B(k(e)).left+n}function De(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-V(e,n),y:n.top+t.scrollTop}}function Oe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?N(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=j(r);if((d||!d&&!a)&&((D(r)!==`body`||M(o))&&(c=L(r)),j(r))){let e=B(r);l=z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?De(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ke(e){return Array.from(e.getClientRects())}function Ae(e){let t=k(e),n=L(e),r=e.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+V(e),c=-n.scrollTop;return I(r).direction===`rtl`&&(s+=o(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:c}}var je=25;function Me(e,t){let n=O(e),r=k(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=V(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=je&&(a-=o)}else l<=je&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ne=new Set([`absolute`,`fixed`]);function Pe(e,t){let n=B(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=j(e)?z(e):y(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fe(e,t,n){let r;if(t===`viewport`)r=Me(e,n);else if(t===`document`)r=Ae(k(e));else if(A(t))r=Pe(t,n);else{let n=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return l(r)}function Ie(e,t){let n=R(e);return n===t||!A(n)||F(n)?!1:I(n).position===`fixed`||Ie(n,t)}function Le(e,t){let n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>A(e)&&D(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?R(e):e;for(;A(o)&&!F(o);){let t=I(o),n=ge(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ne.has(i.position)||M(o)&&!n&&Ie(e,o))?r=r.filter(e=>e!==o):i=t,o=R(o)}return t.set(e,r),r}function Re(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?N(t)?[]:Le(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((e,n)=>{let r=Fe(t,n,i);return e.top=o(r.top,e.top),e.right=s(r.right,e.right),e.bottom=s(r.bottom,e.bottom),e.left=o(r.left,e.left),e},Fe(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ze(e){let{width:t,height:n}=Se(e);return{width:t,height:n}}function Be(e,t,n){let r=j(t),i=k(t),a=n===`fixed`,o=B(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);function l(){c.x=V(i)}if(r||!r&&!a)if((D(t)!==`body`||M(i))&&(s=L(t)),r){let e=B(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?De(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ve(e){return I(e).position===`static`}function He(e,t){if(!j(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Ue(e,t){let n=O(e);if(N(e))return n;if(!j(e)){let t=R(e);for(;t&&!F(t);){if(A(t)&&!Ve(t))return t;t=R(t)}return n}let r=He(e,t);for(;r&&de(r)&&Ve(r);)r=He(r,t);return r&&F(r)&&Ve(r)&&!ge(r)?n:r||_e(e)||n}var We=async function(e){let t=this.getOffsetParent||Ue,n=this.getDimensions,r=await n(e.floating);return{reference:Be(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ge(e){return I(e).direction===`rtl`}var Ke={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:k,getClippingRect:Re,getOffsetParent:Ue,getElementRects:We,getClientRects:ke,getDimensions:ze,getScale:z,isElement:A,isRTL:Ge},qe=b,Je=e,Ye=c,Xe=(e,t,r)=>{let i=new Map,a={platform:Ke,...r},o={...a.platform,_c:i};return n(e,t,{...a,platform:o})},Ze=ne({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:n,hoverY:r}=u(e),o=a(`hoverElement`),s=i(0),c=i(0);return d([n,r],([e,t])=>{Xe({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},o.value,{placement:`right-start`,middleware:[Ye(),Je(),qe({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{s.value=e,c.value=t})}),(e,n)=>(f(),h(m,{to:`body`},[S(`div`,{ref_key:`hoverElement`,ref:o,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:re({left:`${s.value}px`,top:`${c.value}px`})},[t(e.$slots,`default`)],4)]))}}),Qe=Object.assign(Ze,{__name:`DisplayGraphHoverView`});function $e(e,t=1,n=1){let r=(.6+.4*Math.max(0,Math.cos(e)))*t,i=(.5+.2*Math.max(0,Math.cos(e+Math.PI*2/3)))*n;return`hsl(${e*180/Math.PI}deg, ${Math.round(100*r)}%, ${Math.round(100*i)}%)`}var et,tt,nt,H,U,W=1,rt;function it(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(et!==t||tt!==a||nt!==i){let n=Math.round(64*a)/64;W=i,W=Math.log2(W),W-=Math.floor(W);let r=W,o=Math.min(1,8*r);W=2**W;let s=8*Math.SQRT2/W;et=t,tt=a,nt=i,H||=document.createElement(`canvas`),U||=H.getContext(`2d`),H.width=H.height=Math.round(64*n),U.scale(n,n),U.fillStyle=e[0],U.fillRect(0,0,64,64),U.globalAlpha=.25,U.fillStyle=e[1],U.fillRect(0,0,64,64),U.globalAlpha=.67,U.strokeStyle=e[1],U.beginPath();for(let e=0;e<=64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);if(U.lineWidth=s*(1-(o-r)/2),U.stroke(),o+r>0){U.beginPath();for(let e=8;e<64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);U.lineWidth=s*(o+r)/2,U.stroke()}rt=t.createPattern(H,`repeat`),W/=n}return n/=64*W*a,n-=Math.floor(n),n*=64*W*a,rt.setTransform(new DOMMatrix([W,0,0,W,n,r])),rt}function at(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function ot(e){return t=>t.id&&e[t.id]||t.color}function st(e,t=1,n=1){let r={};return ct(r,e,0,Math.PI*2,t,n),ot(r)}function ct(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=$e(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;ct(e,s,n,t,i,a),n+=t}}var lt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ut(e=16,t=lt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function dt(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=ut(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>dt(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function ft(e){return e.children.length===0?1:Math.max(...e.children.map(e=>ft(e)))+1}var pt=/\bFirefox\//.test(navigator.userAgent),mt;function ht(e){return mt?mt.format(e):`${e}`}function G(){return(window.performance||Date).now()}function gt(e){let t=e.toFixed(1).split(`.`,2);return`${ht(+t[0])}.${t[1]}`}function _t(e){return e===1?`1 byte`:e<1024?`${ht(e)} bytes`:e<1024*1024?`${gt(e/1024)} kb`:e<1024*1024*1024?`${gt(e/(1024*1024))} mb`:`${gt(e/(1024*1024*1024))} gb`}function vt(e,t,n,r,i,a){if(pt){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function yt(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function bt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{mt=new Intl.NumberFormat}catch{}var xt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),K={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},St={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},Ct=46,wt=`14px sans-serif`,Tt=`bold ${wt}`,Et=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...K,...t};let{getColor:n=st(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...St,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=ft(e),this.disposables=[],this.events=xt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(wt),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(Ct)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},q=24,Dt=5,Ot=.01,kt=1e3,At=class extends Et{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(yt(e=>{let t=e.deltaX,n=e.deltaY,r=G(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??K.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*Ot),r=Math.min(this.totalBytes,r+e.size*Ot),this.setViewport(n,r,t)}}select(e,t=this.options.animate??K.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*q+1,this.zoomedOutMin=this.width-kt>>1,this.zoomedOutWidth=this.zoomedOutMin+kt,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+Dt,d=t+q/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=it(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,q,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(Tt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,q),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,q),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(wt),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+q,n,y,i&-2),n+=r.size;return i&1||vt(this.c,this.palette.stroke,o+.5,t+.5,l,q),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+q&&e.id)return e;if(r>=t+q)for(let r of e.children){let e=a(r,t+q,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=G():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function jt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function J(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;J(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Mt={};function Nt(e){return Mt[e]||(Mt[e]=400*Math.log(1+Math.log(1+e/8))),Mt[e]}var Y=-Math.PI/2,Pt=class extends Et{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=Y;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.disposables.push(yt(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Nt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(Tt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??_t(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=it(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Nt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=G()),jt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};J(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(jt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:Y,sweepAngle_:Math.PI*2};J(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},X=4,Z=20,Ft=2*X,Q=Z+X;function $(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>Ft&&y>Q?$(t.children,g+X,_+Z,v-Ft,y-Q):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var It=class extends Et{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(yt(e=>this.updateHover(e))),this.disposables.push(bt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=o*(30*e),this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=$([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=(r===this.hoveredNode?1:0)|(e===this.animationTarget?2:0);if(t===1)for(let e of n){if(!e)continue;let[n,r,c,l]=e.box;if(i>=n&&a>=r&&i+o<=n+c&&a+s<=r+l){t=2;break}}for(let r of e.children)c|=yield*this.iterateNodeToDraw(r,t,n);return t!==2&&(yield e),c}drawHoverHighlight(e){let t=this.iterateNodeToDraw(e,0,[]),n=this.c.globalCompositeOperation;for(;;){let e=t.next();if(e.done){this.c.globalCompositeOperation=n;return}let r=e.value.node;if(this.hoveredNode===r){this.c.globalCompositeOperation=`overlay`;let[t,n,r,i]=e.value.box;this.c.fillStyle=this.palette.hover,this.c.fillRect(t,n,r,i)}}}drawNodeBackground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return e.value;let[t,n,i,a]=e.value.box;this.c.fillStyle=it(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Z),this.c.fillRect(t,n+a-X,i,X),this.c.fillRect(t,n+Z,X,a-Q),this.c.fillRect(t+i-X,n+Z,X,a-Q)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(vt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Z){this.c.fillStyle=this.palette.text;let e=a-Ft,r=i+Math.round(Q/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>Q+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Z:Z/2+X;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-Q)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=$([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=G(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Lt={flex:`~ gap-1 items-center wrap`},Rt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},zt=[`onClick`],Bt=ne({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=x(()=>{let e=[],t=n.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,t)=>(f(),w(`div`,Lt,[(f(!0),w(v,null,ee(i.value,(e,t)=>(f(),w(v,{key:e.id},[t>0?(f(),w(`div`,Rt)):te(``,!0),S(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>r(`select`,e)},[S(`span`,null,_(e.text||e.id),1)],8,zt)],64))),128))]))}}),Vt=Object.assign(Bt,{__name:`ChartNavBreadcrumb`});function Ht(e){let{data:t,nameKey:n,sizeKey:r,rootText:a,nodeType:o,graphOptions:s,onUpdate:c}=e,l=p(void 0),u=p(void 0),f=i(void 0),m=p(void 0),h,_=x(()=>{if(e.tree)return e.tree.value;let i=g(t),s=new Map,c=0,l={id:`~root`,text:a,size:0,sizeSelf:0,children:[]};if(!i?.length)return{map:s,root:l,maxDepth:c};let u=[];u.unshift(()=>{l.size+=l.children.reduce((e,t)=>e+t.size,0),l.subtext=T(l.size).join(` `),l.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function d(e,t,n,r,i){if(s.has(t))return s.get(t);i>c&&(c=i);let a={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:r};return s.set(t,a),r.children.push(a),u.unshift(()=>{let t=a.sizeSelf;a.size+=a.children.reduce((e,t)=>e+t.size,0),a.subtext=T(a.size).join(` `),a.children.length&&t/a.size>.1&&a.children.push({id:`${a.id}-self`,text:``,size:t,sizeSelf:t,subtext:T(t).join(` `),children:[],meta:{...e,path:``,type:o},parent:a}),a.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),a}function f(e){let t=e[n].split(`/`).filter(Boolean),i=l,a=``,c=0;t.forEach((l,u)=>{if(a+=(a?`/`:``)+l,c++,u===t.length-1){let t={id:e[n],text:l,size:e[r],sizeSelf:e[r],subtext:T(e[r]).join(` `),children:[],meta:{...e,path:l,type:o}};i.children.push(t),s.set(e[n],t)}else i=d(e,a,l,i,c)})}return i.forEach(f),u.forEach(e=>e()),{map:s,root:l,maxDepth:c}}),v=x(()=>({animate:oe.value.chartAnimation,palette:{stroke:C.value?`#222`:`#555`,fg:C.value?`#fff`:`#000`,bg:C.value?`#111`:`#fff`},getColor:st(_.value.root,C.value?.8:.9,C.value?1:1.1),getSubtext:e=>e.subtext,...s}));function y(e,t){f.value=e?.meta,e?.children.length||(e=e?.parent),m.value?.select(e,t)}function b(){h?.(),u.value=_.value.root,c?.(),ae(()=>{let e=f.value&&_.value.map.get(f.value[n])||null;e&&y(e,!1)}),h=()=>{m.value?.dispose(),m.value=void 0,f.value=void 0}}return ae(()=>{d(()=>[_.value,v.value],()=>{b()},{deep:!0,immediate:!1}),b()}),ie(()=>{h?.()}),{tree:_,graph:m,chartOptions:v,nodeHover:l,nodeSelected:u,selectedNode:f,selectNode:y,buildGraph:b}}export{It as a,Qe as c,Pt as i,Vt as n,at as o,At as r,dt as s,Ht as t};
|
|
1
|
+
import{A as e,At as t,D as n,F as r,Jt as i,Lt as a,M as o,N as s,O as c,P as l,Qt as u,Rt as d,Tt as f,Xt as p,at as m,ct as h,en as g,in as _,it as v,j as y,k as b,kt as ee,lt as te,mt as ne,ot as x,rn as re,st as S,t as C,ut as w,wt as ie,xt as ae}from"./axTMqr-M.js";import{t as T}from"./DQtLZa7C.js";import{t as oe}from"./k3tsOkpc.js";function E(){return typeof window<`u`}function D(e){return se(e)?(e.nodeName||``).toLowerCase():`#document`}function O(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k(e){return((se(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function se(e){return E()?e instanceof Node||e instanceof O(e).Node:!1}function A(e){return E()?e instanceof Element||e instanceof O(e).Element:!1}function j(e){return E()?e instanceof HTMLElement||e instanceof O(e).HTMLElement:!1}function ce(e){return!E()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O(e).ShadowRoot}var le=new Set([`inline`,`contents`]);function M(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!le.has(i)}var ue=new Set([`table`,`td`,`th`]);function de(e){return ue.has(D(e))}var fe=[`:popover-open`,`:modal`];function N(e){return fe.some(t=>{try{return e.matches(t)}catch{return!1}})}var pe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],me=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],he=[`paint`,`layout`,`strict`,`content`];function ge(e){let t=P(),n=A(e)?I(e):e;return pe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||me.some(e=>(n.willChange||``).includes(e))||he.some(e=>(n.contain||``).includes(e))}function _e(e){let t=R(e);for(;j(t)&&!F(t);){if(ge(t))return t;if(N(t))return null;t=R(t)}return null}function P(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var ve=new Set([`html`,`body`,`#document`]);function F(e){return ve.has(D(e))}function I(e){return O(e).getComputedStyle(e)}function L(e){return A(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function R(e){if(D(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ce(e)&&e.host||k(e);return ce(t)?t.host:t}function ye(e){let t=R(e);return F(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&M(t)?t:ye(t)}function be(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ye(e),i=r===e.ownerDocument?.body,a=O(r);if(i){let e=xe(a);return t.concat(a,a.visualViewport||[],M(r)?r:[],e&&n?be(e):[])}return t.concat(r,be(r,[],n))}function xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Se(e){let t=I(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=j(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:i,c=r(n)!==o||r(i)!==s;return c&&(n=o,i=s),{width:n,height:i,$:c}}function Ce(e){return A(e)?e:e.contextElement}function z(e){let t=Ce(e);if(!j(t))return y(1);let n=t.getBoundingClientRect(),{width:i,height:a,$:o}=Se(t),s=(o?r(n.width):n.width)/i,c=(o?r(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var we=y(0);function Te(e){let t=O(e);return!P()||!t.visualViewport?we:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O(e)?!1:t}function B(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ce(e),o=y(1);t&&(r?A(r)&&(o=z(r)):o=z(e));let s=Ee(a,n,r)?Te(a):y(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a){let e=O(a),t=r&&A(r)?O(r):r,n=e,i=xe(n);for(;i&&r&&t!==n;){let e=z(i),t=i.getBoundingClientRect(),r=I(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=O(i),i=xe(n)}}return l({width:d,height:f,x:c,y:u})}function V(e,t){let n=L(e).scrollLeft;return t?t.left+n:B(k(e)).left+n}function De(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-V(e,n),y:n.top+t.scrollTop}}function Oe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?N(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=y(1),u=y(0),d=j(r);if((d||!d&&!a)&&((D(r)!==`body`||M(o))&&(c=L(r)),j(r))){let e=B(r);l=z(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?De(o,c):y(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ke(e){return Array.from(e.getClientRects())}function Ae(e){let t=k(e),n=L(e),r=e.ownerDocument.body,i=o(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+V(e),c=-n.scrollTop;return I(r).direction===`rtl`&&(s+=o(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:c}}var je=25;function Me(e,t){let n=O(e),r=k(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=P();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=V(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=je&&(a-=o)}else l<=je&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ne=new Set([`absolute`,`fixed`]);function Pe(e,t){let n=B(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=j(e)?z(e):y(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fe(e,t,n){let r;if(t===`viewport`)r=Me(e,n);else if(t===`document`)r=Ae(k(e));else if(A(t))r=Pe(t,n);else{let n=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return l(r)}function Ie(e,t){let n=R(e);return n===t||!A(n)||F(n)?!1:I(n).position===`fixed`||Ie(n,t)}function Le(e,t){let n=t.get(e);if(n)return n;let r=be(e,[],!1).filter(e=>A(e)&&D(e)!==`body`),i=null,a=I(e).position===`fixed`,o=a?R(e):e;for(;A(o)&&!F(o);){let t=I(o),n=ge(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ne.has(i.position)||M(o)&&!n&&Ie(e,o))?r=r.filter(e=>e!==o):i=t,o=R(o)}return t.set(e,r),r}function Re(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?N(t)?[]:Le(t,this._c):[].concat(n),r],c=a[0],l=a.reduce((e,n)=>{let r=Fe(t,n,i);return e.top=o(r.top,e.top),e.right=s(r.right,e.right),e.bottom=s(r.bottom,e.bottom),e.left=o(r.left,e.left),e},Fe(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ze(e){let{width:t,height:n}=Se(e);return{width:t,height:n}}function Be(e,t,n){let r=j(t),i=k(t),a=n===`fixed`,o=B(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=y(0);function l(){c.x=V(i)}if(r||!r&&!a)if((D(t)!==`body`||M(i))&&(s=L(t)),r){let e=B(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?De(i,s):y(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ve(e){return I(e).position===`static`}function He(e,t){if(!j(e)||I(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Ue(e,t){let n=O(e);if(N(e))return n;if(!j(e)){let t=R(e);for(;t&&!F(t);){if(A(t)&&!Ve(t))return t;t=R(t)}return n}let r=He(e,t);for(;r&&de(r)&&Ve(r);)r=He(r,t);return r&&F(r)&&Ve(r)&&!ge(r)?n:r||_e(e)||n}var We=async function(e){let t=this.getOffsetParent||Ue,n=this.getDimensions,r=await n(e.floating);return{reference:Be(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ge(e){return I(e).direction===`rtl`}var Ke={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:k,getClippingRect:Re,getOffsetParent:Ue,getElementRects:We,getClientRects:ke,getDimensions:ze,getScale:z,isElement:A,isRTL:Ge},qe=b,Je=e,Ye=c,Xe=(e,t,r)=>{let i=new Map,a={platform:Ke,...r},o={...a.platform,_c:i};return n(e,t,{...a,platform:o})},Ze=ne({__name:`GraphHoverView`,props:{hoverX:{},hoverY:{}},setup(e){let{hoverX:n,hoverY:r}=u(e),o=a(`hoverElement`),s=i(0),c=i(0);return d([n,r],([e,t])=>{Xe({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e,right:e,top:t,bottom:t}}},o.value,{placement:`right-start`,middleware:[Ye(),Je(),qe({mainAxis:8,alignmentAxis:8})]}).then(({x:e,y:t})=>{s.value=e,c.value=t})}),(e,n)=>(f(),h(m,{to:`body`},[S(`div`,{ref_key:`hoverElement`,ref:o,fixed:``,"z-panel-content":``,"pointer-events-none":``,style:re({left:`${s.value}px`,top:`${c.value}px`})},[t(e.$slots,`default`)],4)]))}}),Qe=Object.assign(Ze,{__name:`DisplayGraphHoverView`});function $e(e,t=1,n=1){let r=(.6+.4*Math.max(0,Math.cos(e)))*t,i=(.5+.2*Math.max(0,Math.cos(e+Math.PI*2/3)))*n;return`hsl(${e*180/Math.PI}deg, ${Math.round(100*r)}%, ${Math.round(100*i)}%)`}var et,tt,nt,H,U,W=1,rt;function it(e,t,n,r,i){if(!Array.isArray(e))return e;let a=window.devicePixelRatio||1;if(et!==t||tt!==a||nt!==i){let n=Math.round(64*a)/64;W=i,W=Math.log2(W),W-=Math.floor(W);let r=W,o=Math.min(1,8*r);W=2**W;let s=8*Math.SQRT2/W;et=t,tt=a,nt=i,H||=document.createElement(`canvas`),U||=H.getContext(`2d`),H.width=H.height=Math.round(64*n),U.scale(n,n),U.fillStyle=e[0],U.fillRect(0,0,64,64),U.globalAlpha=.25,U.fillStyle=e[1],U.fillRect(0,0,64,64),U.globalAlpha=.67,U.strokeStyle=e[1],U.beginPath();for(let e=0;e<=64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);if(U.lineWidth=s*(1-(o-r)/2),U.stroke(),o+r>0){U.beginPath();for(let e=8;e<64;e+=16)U.moveTo(e-32,e+32),U.lineTo(e+32,e-32);U.lineWidth=s*(o+r)/2,U.stroke()}rt=t.createPattern(H,`repeat`),W/=n}return n/=64*W*a,n-=Math.floor(n),n*=64*W*a,rt.setTransform(new DOMMatrix([W,0,0,W,n,r])),rt}function at(e){return Array.isArray(e)?`url('data:image/svg+xml,<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="26" fill="${e[0]}"/><rect width="26" height="26" fill="${e[1]}" fill-opacity="25%"/><path d="M22.5 -3.5L-3.5 22.5M35.5 9.5L9.5 35.5" stroke="${e[1]}" stroke-opacity="67%" stroke-width="9.19239"/></svg>')`:e}function ot(e){return t=>t.id&&e[t.id]||t.color}function st(e,t=1,n=1){let r={};return ct(r,e,0,Math.PI*2,t,n),ot(r)}function ct(e,t,n,r,i=1,a=1){let o=t.size;e[t.id]=$e(n+r/2,i,a);for(let s of t.children){let t=s.size/o*r;ct(e,s,n,t,i,a),n+=t}}var lt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function ut(e=16,t=lt){let n=``,r=e,i=t.length;for(;r--;)n+=t[Math.random()*i|0];return n}function dt(e,t,n=(e,t)=>t.size-e.size){if(e.__nanovis)return e;let r={...e};return r.id||=ut(),r.parent||=t,r.children||=[],r.sizeSelf==null&&r.size!=null&&r.children.length===0?r.sizeSelf=r.size:r.sizeSelf||=0,r.children=(r.children||[]).map(e=>dt(e,r,n)),r.size||=r.children.reduce((e,t)=>e+t.size,0)+r.sizeSelf,n&&r.children.sort(n),Object.defineProperty(r,`__nanovis`,{enumerable:!1,value:!0}),r}function ft(e){return e.children.length===0?1:Math.max(...e.children.map(e=>ft(e)))+1}var pt=/\bFirefox\//.test(navigator.userAgent),mt;function ht(e){return mt?mt.format(e):`${e}`}function G(){return(window.performance||Date).now()}function gt(e){let t=e.toFixed(1).split(`.`,2);return`${ht(+t[0])}.${t[1]}`}function _t(e){return e===1?`1 byte`:e<1024?`${ht(e)} bytes`:e<1024*1024?`${gt(e/1024)} kb`:e<1024*1024*1024?`${gt(e/(1024*1024))} mb`:`${gt(e/(1024*1024*1024))} gb`}function vt(e,t,n,r,i,a){if(pt){let o=e.lineWidth,s=o/2;e.fillStyle=t,e.fillRect(n-s,r-s,i+o,o),e.fillRect(n-s,r+s,o,a-o),e.fillRect(n-s,r+a-s,i+o,o),e.fillRect(n+i-s,r+s,o,a-o);return}e.strokeStyle=t,e.strokeRect(n,r,i,a)}function yt(e){return window.addEventListener(`wheel`,e,{passive:!1}),()=>window.removeEventListener(`wheel`,e)}function bt(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}try{mt=new Intl.NumberFormat}catch{}var xt=()=>({emit(e,...t){for(let n=this.events[e]||[],r=0,i=n.length;r<i;r++)n[r](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter(e=>t!==e)}}}),K={getText:e=>e.text,getSubtext:e=>e.subtext,animate:!0,animateDuration:350},St={fallback:`#CCC`,stroke:`#0008`,text:`#222`,hover:`#fff5`,shadow:`#0008`,fg:`#fff`,bg:`#222`},Ct=46,wt=`14px sans-serif`,Tt=`bold ${wt}`,Et=class{el;canvas;c;width=0;height=0;ratio=1;root;maxDepth;events;options;palette;disposables;getColor;getText;getSubtext;_animationFrame=null;constructor(e,t){this.options={...K,...t};let{getColor:n=st(e),getText:r=()=>void 0,getSubtext:i=()=>void 0}=this.options;this.palette={...St,...t.palette},this.el=document.createElement(`div`),this.canvas=document.createElement(`canvas`),this.c=this.canvas.getContext(`2d`),this.root=e,this.maxDepth=ft(e),this.disposables=[],this.events=xt(),this.getColor=n,this.getText=r,this.getSubtext=i,this.setFont(wt),t.onClick&&this.events.on(`click`,t.onClick),t.onHover&&this.events.on(`hover`,t.onHover),t.onLeave&&this.events.on(`leave`,t.onLeave),t.onSelect&&this.events.on(`select`,t.onSelect),this.el.addEventListener(`mouseleave`,()=>{this.events.emit(`leave`)})}invalidate(){this._animationFrame===null&&(this._animationFrame=requestAnimationFrame(()=>{this._animationFrame=null,this.tick()}))}tick(){this.draw()}draw(){}resize(){this.ratio=window.devicePixelRatio||1,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`,this.canvas.width=Math.round(this.width*this.ratio),this.canvas.height=Math.round(this.height*this.ratio),this.c.scale(this.ratio,this.ratio),this.draw()}select(e,t){this.events.emit(`select`,e)}dispose(){this.disposables.forEach(e=>e()),this.disposables.length=0,this.el.remove()}[Symbol.dispose](){this.dispose()}_font=`14px sans-serif`;_fontWidthCache=new Map;ellipsisWidth=0;getFontCache(){return this._fontWidthCache.has(this._font)||this._fontWidthCache.set(this._font,{}),this._fontWidthCache.get(this._font)}setFont(e){this._font=e,this.c.font=e,this.c.textBaseline=`middle`,this.ellipsisWidth=3*this.charCodeWidth(Ct)}charCodeWidth(e){let t=this.getFontCache(),n=t[e];return n===void 0&&(n=this.c.measureText(String.fromCharCode(e)).width,t[e]=n),n}textOverflowEllipsis(e,t){if(t<this.ellipsisWidth)return[``,0];let n=0,r=e.length,i=0;for(;i<r;){let r=this.charCodeWidth(e.charCodeAt(i));if(t<n+this.ellipsisWidth+r)return[`${e.slice(0,i)}...`,n+this.ellipsisWidth];n+=r,i++}return[e,n]}},q=24,Dt=5,Ot=.01,kt=1e3,At=class extends Et{mainEl=document.createElement(`div`);totalBytes;viewportMin;viewportMax;zoomedOutMin=0;zoomedOutWidth=0;prevWheelTime=0;prevWheelWasZoom=!1;stripeScaleAdjust=1;hoveredNode=null;selectedNode=null;nodeStartBytes=new Map;animationFromMin=0;animationFromMax=0;animationToMin=0;animationToMax=0;animationStart=0;constructor(e,t={}){super(e,t),this.totalBytes=e.size,this.viewportMin=this.animationFromMin=this.animationToMin=0,this.viewportMax=this.animationFromMax=this.animationToMax=this.totalBytes,Object.assign(this.mainEl.style,{position:`relative`}),Object.assign(this.canvas.style,{position:`absolute`,left:`0`,top:`0`});let n=!1;this.canvas.onmousedown=e=>{if(n=!1,e.button!==2){let t=e.pageX,r=e=>{let r=e.pageX-t;!n&&Math.abs(r)<3||(n=!0,this.modifyViewport(-r,0,null),t=e.pageX)},i=()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};e.preventDefault(),document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},this.canvas.onmousemove=e=>{this.updateHover(e)},this.canvas.onmouseout=()=>{this.changeHoveredNode(null)},this.canvas.onclick=e=>{if(n)return;let t=this.hitTestNode(e);this.changeHoveredNode(t),this.changeSelectedNode(t),t&&this.events.emit(`click`,t,e)},this.disposables.push(yt(e=>{let t=e.deltaX,n=e.deltaY,r=G(),i=r-this.prevWheelTime<50?this.prevWheelWasZoom:e.ctrlKey||e.metaKey;this.prevWheelTime=r,this.prevWheelWasZoom=i,(i||Math.abs(t)>=Math.abs(n))&&e.preventDefault(),this.modifyViewport(t,n,i?e.pageX:null),this.updateHover(e)})),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.mainEl.append(this.canvas),this.el.append(this.mainEl)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.viewportMin=this.animationToMin,this.viewportMax=this.animationToMax):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.viewportMin=this.animationFromMin+(this.animationToMin-this.animationFromMin)*e,this.viewportMax=this.animationFromMax+(this.animationToMax-this.animationFromMax)*e,this.invalidate()),this.draw()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.root,0,0,-1/0,1)}changeSelectedNode(e,t=this.options.animate??K.animate){if(this.selectedNode!==e&&(this.selectedNode=e,this.events.emit(`select`,e),e&&this.nodeStartBytes.has(e.id))){let n=this.nodeStartBytes.get(e.id),r=n+e.size;n=Math.max(0,n-e.size*Ot),r=Math.min(this.totalBytes,r+e.size*Ot),this.setViewport(n,r,t)}}select(e,t=this.options.animate??K.animate){this.changeSelectedNode(e,t)}resize(){this.width=this.el.clientWidth,this.height=this.maxDepth*q+1,this.zoomedOutMin=this.width-kt>>1,this.zoomedOutWidth=this.zoomedOutMin+kt,this.zoomedOutMin<0&&(this.zoomedOutMin=0),this.zoomedOutWidth>this.width&&(this.zoomedOutWidth=this.width),this.zoomedOutWidth-=this.zoomedOutMin,this.stripeScaleAdjust=this.totalBytes/this.zoomedOutWidth,this.mainEl.style.height=`${this.height}px`,super.resize()}drawNode(e,t,n,r,i){this.nodeStartBytes.set(e.id,n);let a=this.zoomedOutWidth/(this.viewportMax-this.viewportMin),o=this.zoomedOutMin+(n-this.viewportMin)*a,s=e.size*a,c=o+s;if(c<r+1.5)return r;if(o+s<0||o>this.width)return c;let l=s<2?2:s,u=(o>0?o:0)+Dt,d=t+q/2,f=this.getText(e)||``,p=this.getSubtext(e)||``,m,h=0,g=s+o-u,_=it(this.getColor(e)||this.palette.fallback,this.c,this.zoomedOutMin-this.viewportMin*a,q,a*this.stripeScaleAdjust),v=this.palette.text,y=-1/0;i&1?(v=this.palette.fg,this.setFont(Tt)):(this.c.fillStyle=_,this.c.fillRect(o,t,l,q),(i&2||this.hoveredNode&&e.id===this.hoveredNode.id)&&(this.c.fillStyle=this.palette.hover,this.c.fillRect(o,t,l,q),i|=2)),this.ellipsisWidth<g&&(m=this.c.measureText(f).width,m<=g?h+=m:(f=this.textOverflowEllipsis(f,g)[0],h=g),this.c.fillStyle=v,this.c.fillText(f,u,d)),i&1&&this.setFont(wt),h+this.ellipsisWidth<g&&(p&&f&&(p=` - ${p}`),m=this.c.measureText(p).width,h+m>g&&(p=this.textOverflowEllipsis(p,g-h)[0]),this.c.globalAlpha=.5,this.c.fillText(p,u+h,d),this.c.globalAlpha=1);for(let r of e.children)y=this.drawNode(r,t+q,n,y,i&-2),n+=r.size;return i&1||vt(this.c,this.palette.stroke,o+.5,t+.5,l,q),c}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.viewportMin+(this.viewportMax-this.viewportMin)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=(e,t,n)=>{if(i>=n&&i<n+e.size){if(r>=t&&r<t+q&&e.id)return e;if(r>=t+q)for(let r of e.children){let e=a(r,t+q,n);if(e)return e;n+=r.size}}return null};return a(this.root,0,0)}modifyViewport(e,t,n){let r=this.viewportMin,i=this.viewportMax,a=0;if(n!==null){let e=r+(i-r)/this.zoomedOutWidth*(n-this.zoomedOutMin),a=1.01**t;r=e+(r-e)*a,i=e+(i-e)*a}else a=e*(i-r)/this.zoomedOutWidth;r+a<0?a=-r:i+a>this.totalBytes&&(a=this.totalBytes-i),r+=a,i+=a,r<0&&(r=0),i>this.totalBytes&&(i=this.totalBytes),this.setViewport(r,i,!1)}setViewport(e,t,n){this.animationFromMin=this.viewportMin,this.animationFromMax=this.viewportMax,this.animationToMin=e,this.animationToMax=t,n?this.animationStart=G():this.animationStart=0,this.invalidate()}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),this.events.emit(`hover`,t,e)}};function jt(e,t){for(;t;){if(t===e)return!0;t=t.parent}return!1}function J(e,t,n){if(e===t)return;let r=t.parent,i=r.size||1,a=0;J(e,r,n);for(let e of r.children){if(e===t){n.startAngle_+=n.sweepAngle_*a/i,n.sweepAngle_=e.size/i*n.sweepAngle_;break}a+=e.size}n.depth_+=1}var Mt={};function Nt(e){return Mt[e]||(Mt[e]=400*Math.log(1+Math.log(1+e/8))),Mt[e]}var Y=-Math.PI/2,Pt=class extends Et{currentNode;hoveredNode;centerX=0;centerY=0;animationStart=0;radiusScale=1;sourceDepth=0;sourceStartAngle=Y;sourceSweepAngle=Math.PI*2;targetNode;targetDepth=this.sourceDepth;targetStartAngle=this.sourceStartAngle;targetSweepAngle=this.sourceSweepAngle;animatedNode;animatedDepth=this.sourceDepth;animatedStartAngle=this.sourceStartAngle;animatedSweepAngle=this.sourceSweepAngle;previousHoveredNode;historyStack=[];constructor(e,t={}){for(;e.children.length===1;)e=e.children[0];super(e,t),this.currentNode=e,this.targetNode=this.currentNode,this.animatedNode=this.currentNode,this.canvas.onmousemove=e=>{this.handleMouseMove(e)},this.canvas.onmouseout=e=>{this.changeHoveredNode(void 0),this.events.emit(`hover`,null,e)},this.canvas.onclick=e=>{let t=this.hitTestNode(e);if(!t)return;this.events.emit(`click`,t,e);let n=[];t===this.animatedNode.parent?this.historyStack.length>0&&(t=this.historyStack.pop(),n=this.historyStack.slice()):n=this.historyStack.concat(this.currentNode),this.events.emit(`click`,t,e),t.children.length>0?(this.select(t),this.historyStack=n):e.preventDefault()},this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(bt(()=>this.resize())),this.disposables.push(yt(e=>this.handleMouseMove(e)))}select(e,t){(this.currentNode!==e||this.root)&&(this.currentNode=e||this.root,this.updateSunburst(t),this.events.emit(`select`,e))}resize(){this.width=this.el.clientWidth,this.height=this.width,this.centerX=this.width>>1,this.centerY=this.height>>1;let e=2*Math.ceil(Nt(this.maxDepth));this.radiusScale=this.width/e,super.resize()}draw(){this.c.clearRect(0,0,this.width,this.height),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,3,-1/0),this.c.strokeStyle=this.palette.stroke,this.c.beginPath(),this.drawNode(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle,1,-1/0),this.c.stroke(),this.animatedDepth===0&&(this.c.fillStyle=this.palette.stroke,this.setFont(Tt),this.c.textAlign=`center`,this.c.fillText(this.getSubtext(this.targetNode)??_t(this.targetNode.size),this.centerX,this.centerY))}drawNode(e,t,n,r,i,a,o){let s=this.computeRadius(t+1);if(s>this.centerY)return o;e===this.hoveredNode&&(a|=8);let c=(n+s)/2,l=r+i;if(l-o<1.5/c)return o;let u=2/c;if(i>u&&(u=i),a&2)this.c.fillStyle=it(this.getColor(e)||this.palette.fallback,this.c,this.centerX,this.centerY,1),this.c.beginPath(),this.c.arc(this.centerX,this.centerY,n,r,r+u,!1),this.c.arc(this.centerX,this.centerY,s,r+u,r,!0),this.c.fill(),this.hoveredNode&&(a&8||e.parent===this.hoveredNode)&&(this.c.fillStyle=this.palette.hover,this.c.fill());else{let e=u===Math.PI*2,t=a&4||e?s:n;a&1&&n>0&&this.c.arc(this.centerX,this.centerY,n,r+u,r,!0),this.c.moveTo(this.centerX+t*Math.cos(r),this.centerY+t*Math.sin(r)),this.c.arc(this.centerX,this.centerY,s,r,r+u,!1),e||this.c.lineTo(this.centerX+n*Math.cos(r+u),this.centerY+n*Math.sin(r+u))}let d=e.size,f=a&10,p=0,m=-1/0;for(let n of e.children)m=this.drawNode(n,t+1,s,r+i*p/d,n.size/d*i,f,m),p+=n.size,f|=4;return l}changeHoveredNode(e,t){this.hoveredNode!==e&&(this.hoveredNode=e,this.updateSunburst(t))}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left-this.centerX,r=e.clientY-t.top-this.centerY,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n),o=(e,t,n,r,s)=>{let c=this.computeRadius(t+1);if(c>this.centerY)return;if(i>=n&&i<c){let t=a-r;if(t/=Math.PI*2,t-=Math.floor(t),t*=Math.PI*2,t<s)return e===this.animatedNode?e.parent:e}let l=e.size,u=0;for(let n of e.children){let e=o(n,t+1,c,r+s*u/l,n.size/l*s);if(e)return e;u+=n.size}};return o(this.animatedNode,this.animatedDepth,this.computeRadius(this.animatedDepth),this.animatedStartAngle,this.animatedSweepAngle)}tick(){let e=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration);e<0||e>1?(e=1,this.animatedNode=this.targetNode,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2):(e<.5?e*=4*e*e:(e=1-e,e*=4*e*e,e=1-e),this.invalidate()),this.animatedDepth=this.sourceDepth+(this.targetDepth-this.sourceDepth)*e,this.animatedStartAngle=this.sourceStartAngle+(this.targetStartAngle-this.sourceStartAngle)*e,this.animatedSweepAngle=this.sourceSweepAngle+(this.targetSweepAngle-this.sourceSweepAngle)*e,this.draw()}handleMouseMove(e){let t=this.hitTestNode(e);this.changeHoveredNode(t),t&&t!==this.animatedNode.parent?(this.events.emit(`hover`,t,e),this.canvas.style.cursor=`pointer`):this.events.emit(`hover`,null,e)}computeRadius(e){return Nt(e)*this.radiusScale}updateSunburst(e=this.options.animate??!0){if(this.previousHoveredNode!==this.hoveredNode&&(this.previousHoveredNode=this.hoveredNode,this.hoveredNode||(this.canvas.style.cursor=`auto`,this.events.emit(`hover`,null)),this.invalidate()),this.targetNode!==this.currentNode){if(this.historyStack.length=0,this.invalidate(),e&&(this.animationStart=G()),jt(this.animatedNode,this.currentNode)){let e={depth_:this.animatedDepth,startAngle_:this.animatedStartAngle,sweepAngle_:this.animatedSweepAngle};J(this.animatedNode,this.currentNode,e),this.animatedDepth=e.depth_,this.animatedStartAngle=e.startAngle_,this.animatedSweepAngle=e.sweepAngle_,this.targetDepth=0,this.targetStartAngle=Y,this.targetSweepAngle=Math.PI*2,this.animatedNode=this.currentNode}else if(jt(this.currentNode,this.animatedNode)){let e={depth_:0,startAngle_:Y,sweepAngle_:Math.PI*2};J(this.currentNode,this.animatedNode,e),this.targetDepth=e.depth_,this.targetStartAngle=e.startAngle_,this.targetSweepAngle=e.sweepAngle_}else this.animationStart=-1/0,this.animatedNode=this.currentNode;this.sourceDepth=this.animatedDepth,this.sourceStartAngle=this.animatedStartAngle,this.sourceSweepAngle=this.animatedSweepAngle,this.targetNode=this.currentNode,this.events.emit(`select`,this.currentNode)}}},X=4,Z=20,Ft=2*X,Q=Z+X;function $(e,t,n,r,i){let a=[],o=(t,n,r,i,a)=>{let o=e[t].size*a,s=e[n].size*a;return Math.max(r*r*o/(i*i),i*i/(r*r*s))};return((t,n,r,i,s)=>{for(;t<e.length;){let c=0;for(let n=t;n<e.length;n++)c+=e[n].size;let l=Math.min(i,s),u=i*s/c,d=t,f=0,p=0;for(;d<e.length;){let n=e[d].size*u,r=o(t,d,l,f+n,u);if(d>t&&p<r)break;f+=n,p=r,d++}let m=Math.round(f/l),h=0;for(let o=t;o<d;o++){let t=e[o],c=t.size*u,d=Math.round(l*h/f),p=Math.round(l*(h+c)/f),[g,_,v,y]=i>=s?[n,r+d,m,p-d]:[n+d,r,p-d,m];a.push({node:t,box:[g,_,v,y],children:v>Ft&&y>Q?$(t.children,g+X,_+Z,v-Ft,y-Q):[]}),h+=c}t=d,i>=s?(n+=m,i-=m):(r+=m,s-=m)}})(0,t,n,r,i),a}var It=class extends Et{hoveredNode=null;currentNode=null;bgOriginX=0;bgOriginY=0;layers={base:null};baseLayoutCache;currentOriginX=0;currentOriginY=0;animationStart=0;animationBlend=1;animationSource=null;animationTarget=null;constructor(e,t={}){super(e,t),this.canvas.addEventListener(`mousemove`,e=>{this.updateHover(e)}),this.canvas.addEventListener(`mouseout`,e=>{this.changeHoveredNode(null),this.events.emit(`hover`,null,e)}),this.el.addEventListener(`click`,e=>{let t=this.hitTestNode(e);if(t){let n=t.node;this.events.emit(`click`,n,e),n.children.length?t===this.layers.current?this.updateHover(e):(this.changeCurrentLayout(t),this.changeHoveredNode(null)):this.updateHover(e)}else this.currentNode&&(this.changeCurrentLayout(null),this.updateHover(e))}),this.el.append(this.canvas),this.resize(),Promise.resolve().then(()=>this.resize()),this.disposables.push(yt(e=>this.updateHover(e))),this.disposables.push(bt(()=>this.resize()))}select(e,t){let n=null;e===this.root&&(e=null),n=e?this.searchFor([this.layers.current,this.layers.base],e):null,this.changeCurrentLayout(n,t)}drawBaseLayout(){!this.width||!this.height||(this.c.clearRect(0,0,this.width,this.height),this.bgOriginX=this.bgOriginY=0,this.baseLayoutCache?this.c.putImageData(this.baseLayoutCache,0,0):(this.drawLayout(this.layers.base,0,[]),this.baseLayoutCache=this.c.getImageData(0,0,this.width*this.ratio,this.height*this.ratio)))}draw(){this.drawBaseLayout(),this.layers.current||this.drawHoverHighlight(this.layers.base);let e=this.layers.current?this.animationSource?this.animationTarget?1:1-this.animationBlend:this.animationBlend:0;if(this.layers.current){let[t,n,r,i]=this.layers.base.box;this.c.globalAlpha=.6*(!this.layers.current||!this.animationSource?1:e),this.c.fillStyle=this.palette.bg,this.c.fillRect(t,n,r,i),this.c.globalAlpha=1}if(this.layers.previous&&this.drawLayout(this.layers.previous,1,[this.layers.current]),this.layers.current){let[t,n,r,i]=this.layers.current.box,a=this.c.getTransform(),o=Math.sqrt(a.a*a.d);this.c.save(),this.c.shadowColor=this.palette.shadow,this.c.shadowBlur=o*(30*e),this.c.shadowOffsetX=o*(2*this.width),this.c.shadowOffsetY=o*(2*this.height+15*e),this.c.fillRect(t-2*this.width,n-2*this.height,r,i),this.c.restore(),this.bgOriginX=this.currentOriginX,this.bgOriginY=this.currentOriginY,this.drawLayout(this.layers.current,0,[]),this.drawHoverHighlight(this.layers.current)}}tick(){let e=this.animationBlend,t=this.currentNode;this.animationBlend=(G()-this.animationStart)/(this.options.animateDuration??K.animateDuration),this.animationBlend<0||this.animationBlend>1?(this.currentNode=this.animationTarget,this.layers.previous=void 0,this.animationBlend=1):(this.animationBlend=1-this.animationBlend,this.animationBlend*=this.animationBlend*this.animationBlend,this.animationBlend=1-this.animationBlend,this.invalidate()),(this.animationBlend!==e||this.currentNode!==t)&&this.updateCurrentLayout(),this.draw()}resize(){this.baseLayoutCache=void 0;let e=this.width,t=this.height;this.width=Math.min(this.el.clientWidth,1600),this.height=Math.max(Math.round(this.width/2),innerHeight-200),(this.width!==e||this.height!==t||!this.layers.base)&&(this.layers.base=$([this.root],0,0,this.width-1,this.height-1)[0],this.updateCurrentLayout()),super.resize()}*iterateNodeToDraw(e,t,n){let r=e.node,[i,a,o,s]=e.box,c=(r===this.hoveredNode?1:0)|(e===this.animationTarget?2:0);if(t===1)for(let e of n){if(!e)continue;let[n,r,c,l]=e.box;if(i>=n&&a>=r&&i+o<=n+c&&a+s<=r+l){t=2;break}}for(let r of e.children)c|=yield*this.iterateNodeToDraw(r,t,n);return t!==2&&(yield e),c}drawHoverHighlight(e){let t=this.iterateNodeToDraw(e,0,[]),n=this.c.globalCompositeOperation;for(;;){let e=t.next();if(e.done){this.c.globalCompositeOperation=n;return}let r=e.value.node;if(this.hoveredNode===r){this.c.globalCompositeOperation=`overlay`;let[t,n,r,i]=e.value.box;this.c.fillStyle=this.palette.hover,this.c.fillRect(t,n,r,i)}}}drawNodeBackground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return e.value;let[t,n,i,a]=e.value.box;this.c.fillStyle=it(this.getColor(e.value.node)||this.palette.fallback,this.c,this.bgOriginX,this.bgOriginY,1),e.value.children.length?(this.c.fillRect(t,n,i,Z),this.c.fillRect(t,n+a-X,i,X),this.c.fillRect(t,n+Z,X,a-Q),this.c.fillRect(t+i-X,n+Z,X,a-Q)):this.c.fillRect(t,n,i,a)}}drawLayout(e,t,n){this.drawNodeBackground(e,t,n),this.drawNodeForeground(e,t,n)}drawNodeForeground(e,t,n){let r=this.iterateNodeToDraw(e,t,n);for(;;){let e=r.next();if(e.done)return;let t=e.value.node,[n,i,a,o]=e.value.box;if(vt(this.c,this.palette.stroke,n+.5,i+.5,a,o),o>=Z){this.c.fillStyle=this.palette.text;let e=a-Ft,r=i+Math.round(Q/2),[s,c]=this.textOverflowEllipsis(this.getText(t)||``,e),l=n+Math.round((a-c)/2),u=this.getText(t),d=this.getSubtext(t);if(s===u&&t.children.length){let t=d||``;t&&u&&(t=` - ${t}`);let[i,o]=this.textOverflowEllipsis(t,e-c);l=n+Math.round((a-c-o)/2),this.c.globalAlpha=.5,this.c.fillText(i,l+c,r),this.c.globalAlpha=1}if(this.c.fillText(s,l,r),o>Q+16&&!t.children.length){let[t,r]=this.textOverflowEllipsis(d||``,e);this.c.globalAlpha=.5;let s=u?Z:Z/2+X;this.c.fillText(t,n+Math.round((a-r)/2),i+s+Math.round(o-Q)/2),this.c.globalAlpha=1}}}}updateCurrentLayout(){let e=this.options.selectedPaddingRatio??.2;if(this.currentNode){let[t,n,r,i]=this.currentNode.box,a=t+r,o=n+i,s=Math.round(this.width*e/2),c=Math.round(this.height*e/2),l=this.width-s-1,u=this.height-c-1,d=this.animationTarget?this.animationBlend:1-this.animationBlend,f=Math.round(t+(s-t)*d),p=Math.round(n+(c-n)*d),m=Math.round(a+(l-a)*d),h=Math.round(o+(u-o)*d),g=e=>e-Math.floor(e/64-.5)*64;this.layers.current=$([this.currentNode.node],f,p,m-f,h-p)[0],this.currentOriginX=g(-(t+a)/2)*(1-d)+(f+m)/2,this.currentOriginY=g(-(n+o)/2)*(1-d)+(p+h)/2}else this.layers.current=void 0,this.currentOriginX=0,this.currentOriginY=0}hitTestNode(e){let t=this.canvas.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=(e,t)=>{for(let a of e){let[e,o,s,c]=a.box;if(n>=e&&r>=o&&n<e+s&&r<o+c)return i(a.children,!1)||(t?null:a)}return null};return this.layers.current?i([this.layers.current],!1):i([this.layers.base],!0)}updateHover(e){let t=this.hitTestNode(e);this.changeHoveredNode(t&&t.node),this.events.emit(`hover`,t?.node||null,e)}changeHoveredNode(e){this.hoveredNode!==e&&(this.hoveredNode=e,this.canvas.style.cursor=e&&!e.children.length?`pointer`:`auto`,this.invalidate())}searchFor(e,t){for(let n of e){if(!n)continue;let e=n.node===t?n:this.searchFor(n.children,t);if(e)return e}return null}changeCurrentLayout(e,t=this.options.animate){this.animationTarget!==e&&(this.events.emit(`select`,e?.node||null),this.layers.previous=e?this.layers.current:void 0,t&&(this.animationBlend=0,this.animationStart=G(),this.animationSource=this.currentNode),this.animationTarget=e,this.currentNode=e||this.searchFor([this.layers.base],this.currentNode.node),this.updateCurrentLayout(),this.invalidate())}},Lt={flex:`~ gap-1 items-center wrap`},Rt={key:0,"i-ph-arrow-right-bold":``,"text-sm":``,"op-fade":``},zt=[`onClick`],Bt=ne({__name:`NavBreadcrumb`,props:{selected:{},options:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=x(()=>{let e=[],t=n.selected;for(;t;)e.unshift(t),t=t.parent;return e});return(e,t)=>(f(),w(`div`,Lt,[(f(!0),w(v,null,ee(i.value,(e,t)=>(f(),w(v,{key:e.id},[t>0?(f(),w(`div`,Rt)):te(``,!0),S(`button`,{hover:`bg-active`,rounded:``,px1:``,onClick:t=>r(`select`,e)},[S(`span`,null,_(e.text||e.id),1)],8,zt)],64))),128))]))}}),Vt=Object.assign(Bt,{__name:`ChartNavBreadcrumb`});function Ht(e){let{data:t,nameKey:n,sizeKey:r,rootText:a,nodeType:o,graphOptions:s,onUpdate:c}=e,l=p(void 0),u=p(void 0),f=i(void 0),m=p(void 0),h,_=x(()=>{if(e.tree)return e.tree.value;let i=g(t),s=new Map,c=0,l={id:`~root`,text:a,size:0,sizeSelf:0,children:[]};if(!i?.length)return{map:s,root:l,maxDepth:c};let u=[];u.unshift(()=>{l.size+=l.children.reduce((e,t)=>e+t.size,0),l.subtext=T(l.size).join(` `),l.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))});function d(e,t,n,r,i){if(s.has(t))return s.get(t);i>c&&(c=i);let a={id:t,text:n,size:0,sizeSelf:0,children:[],meta:{...e,path:n,type:`folder`},parent:r};return s.set(t,a),r.children.push(a),u.unshift(()=>{let t=a.sizeSelf;a.size+=a.children.reduce((e,t)=>e+t.size,0),a.subtext=T(a.size).join(` `),a.children.length&&t/a.size>.1&&a.children.push({id:`${a.id}-self`,text:``,size:t,sizeSelf:t,subtext:T(t).join(` `),children:[],meta:{...e,path:``,type:o},parent:a}),a.children.sort((e,t)=>t.size-e.size||e.id.localeCompare(t.id))}),a}function f(e){let t=e[n].split(`/`).filter(Boolean),i=l,a=``,c=0;t.forEach((l,u)=>{if(a+=(a?`/`:``)+l,c++,u===t.length-1){let t={id:e[n],text:l,size:e[r],sizeSelf:e[r],subtext:T(e[r]).join(` `),children:[],meta:{...e,path:l,type:o}};i.children.push(t),s.set(e[n],t)}else i=d(e,a,l,i,c)})}return i.forEach(f),u.forEach(e=>e()),{map:s,root:l,maxDepth:c}}),v=x(()=>({animate:oe.value.chartAnimation,palette:{stroke:C.value?`#222`:`#555`,fg:C.value?`#fff`:`#000`,bg:C.value?`#111`:`#fff`},getColor:st(_.value.root,C.value?.8:.9,C.value?1:1.1),getSubtext:e=>e.subtext,...s}));function y(e,t){f.value=e?.meta,e?.children.length||(e=e?.parent),m.value?.select(e,t)}function b(){h?.(),u.value=_.value.root,c?.(),ae(()=>{let e=f.value&&_.value.map.get(f.value[n])||null;e&&y(e,!1)}),h=()=>{m.value?.dispose(),m.value=void 0,f.value=void 0}}return ae(()=>{d(()=>[_.value,v.value],()=>{b()},{deep:!0,immediate:!1}),b()}),ie(()=>{h?.()}),{tree:_,graph:m,chartOptions:v,nodeHover:l,nodeSelected:u,selectedNode:f,selectNode:y,buildGraph:b}}export{It as a,Qe as c,Pt as i,Vt as n,at as o,At as r,dt as s,Ht as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as e,Dt as t,Jt as n,Xt as r,Yt as i,en as a,f as o,ot as s,s as c,u as l,vt as u,xt as d}from"./DhtFIhLO.js";function f(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function p(){return this.eachAfter(f)}function m(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function h(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function g(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function _(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function v(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function y(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function b(e){for(var t=this,n=x(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function x(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function S(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function C(){return Array.from(this)}function w(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function T(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*ee(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function E(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=k)):t===void 0&&(t=O);for(var n=new j(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new j(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(A)}function D(){return E(this).eachBefore(te)}function O(e){return e.children}function k(e){return Array.isArray(e)?e[1]:null}function te(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function A(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=E.prototype={constructor:j,count:p,each:m,eachAfter:g,eachBefore:h,find:_,sum:v,sort:y,path:b,ancestors:S,descendants:C,leaves:w,links:T,copy:D,[Symbol.iterator]:ee};function M(e,t){return e.parent===t.parent?1:2}function N(e){var t=e.children;return t?t[0]:e.t}function P(e){var t=e.children;return t?t[t.length-1]:e.t}function F(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ne(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function re(e,t,n){return e.a.parent===t.parent?e.a:n}function I(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}I.prototype=Object.create(j.prototype);function ie(e){for(var t=new I(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new I(a[o],o)),i.parent=n;return(t.parent=new I(null,0)).children=[t],t}function ae(){var e=M,t=1,n=1,r=null;function i(i){var s=ie(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){ne(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=P(o),i=N(i),o&&i;)s=N(s),a=P(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(F(re(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!P(a)&&(a.t=o,a.m+=u-l),i&&!N(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}function L(e){return function(){return e}}var R=Math.PI,z=2*R,B=1e-6,V=z-B;function H(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function U(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return H;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var W=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?H:U(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>B)if(!(Math.abs(u*s-c*l)>B)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((R-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>B&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>B||Math.abs(this._y1-l)>B)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%z+z),d>V?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>B&&this._append`A${n},${n},0,${+(d>=R)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function G(){return new W}G.prototype=W.prototype;function K(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new W(t)}var q=Array.prototype.slice;function oe(e){return e[0]}function se(e){return e[1]}var J=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function ce(e){return new J(e,!0)}function le(e){return new J(e,!1)}function ue(e){return e.source}function de(e){return e.target}function Y(e){let t=ue,n=de,r=oe,i=se,a=null,o=null,s=K(c);function c(){let c,l=q.call(arguments),u=t.apply(this,l),d=n.apply(this,l);if(a??(o=e(c=s())),o.lineStart(),l[0]=u,o.point(+r.apply(this,l),+i.apply(this,l)),l[0]=d,o.point(+r.apply(this,l),+i.apply(this,l)),o.lineEnd(),c)return o=null,c+``||null}return c.source=function(e){return arguments.length?(t=e,c):t},c.target=function(e){return arguments.length?(n=e,c):n},c.x=function(e){return arguments.length?(r=typeof e==`function`?e:L(+e),c):r},c.y=function(e){return arguments.length?(i=typeof e==`function`?e:L(+e),c):i},c.context=function(t){return arguments.length?(t==null?a=o=null:o=e(a=t),c):a},c}function fe(){return Y(ce)}function pe(){return Y(le)}function me(t,{wheel:r=!0,minScale:i=.5,maxScale:a=2}={}){let o=n(1);function s(n,r,s){let c=e(t);if(!c)return;let{left:l,top:u,width:d,height:f}=c.getBoundingClientRect(),p=r??l+d/2,m=s??u+f/2,h=p-l,g=m-u,_=o.value;o.value=Math.max(i,Math.min(a,_+n));let v=o.value/_;c.scrollLeft=(c.scrollLeft+h)*v-h,c.scrollTop=(c.scrollTop+g)*v-g}function c(t){if(e(r)){t.preventDefault();let e=.2;s(t.deltaY<0?e:e*-1,t.clientX,t.clientY)}else t.ctrlKey&&(t.preventDefault(),s(t.deltaY*.004*-1,t.clientX,t.clientY))}function u(e=.2){s(e)}function d(e=.2){s(e*-1)}return l(t,`wheel`,c),{scale:o,zoom:s,zoomIn:u,zoomOut:d}}var X=Symbol.for(`ViteDevToolsModuleGraphState`);const Z=fe().x(e=>e[0]).y(e=>e[1]),Q=pe().x(e=>e[0]).y(e=>e[1]);function $(e,t){return t?e.target.x<=e.source.x?Q({source:[e.source.x+a(t.width)/2-a(t.linkOffset),e.source.y],target:[e.target.x-a(t.width)/2+a(t.linkOffset),e.target.y]}):Z({source:[e.source.x+a(t.width)/2-a(t.linkOffset),e.source.y],target:[e.target.x-a(t.width)/2+a(t.linkOffset),e.target.y]}):e.target.x<=e.source.x?Q({source:[e.source.x,e.source.y],target:[e.target.x,e.target.y]}):Z({source:[e.source.x,e.source.y],target:[e.target.x,e.target.y]})}function he(e){return`stroke-#8885`}function ge(e){let a=.4,c=n(),l=n(window.innerWidth),u=n(window.innerHeight),d=i(new Map),f=i(new Set),p=n(!0),m=i(new Map),h=r([]),g=r([]),_=i(new Map),v=i(new Map),y=s(()=>{let t=new Map;for(let n of e.modules.value)t.set(n.id,n);return t}),{control:b}=o(),{scale:x,zoomIn:S,zoomOut:C}=me(c,{wheel:b,minScale:a,maxScale:2});function w(e,t=!0){d.get(e)?.scrollIntoView({block:`center`,inline:`center`,behavior:t?`smooth`:`instant`})}let T=e.generateGraph({isFirstCalculateGraph:p,hierarchy:E,tree:ae,nodesRefMap:d,container:c,modulesMap:y,nodes:h,links:g,scale:x,nodesMap:_,linksMap:v,width:l,height:u,childToParentMap:m,focusOn:w,collapsedNodes:f,spacing:e.spacing});t(X,{spacing:e.spacing,calculateGraph:T,isFirstCalculateGraph:p,container:c,width:l,height:u,scale:x,nodes:h,links:g,nodesRefMap:d,collapsedNodes:f,childToParentMap:m,ZOOM_MIN:a,ZOOM_MAX:2,zoomIn:S,zoomOut:C})}function _e(){return u(X)}function ve(e){let{nodesRefMap:t,container:r,calculateGraph:i,collapsedNodes:o}=u(X),s=n(!1);function c(e,n){d(()=>{d(()=>{let i=t.get(e);if(i&&n&&r.value){let e=r.value.getBoundingClientRect(),t=i.getBoundingClientRect(),a=t.left-e.left-n.x,o=t.top-e.top-n.y;r.value.scrollLeft+=a,r.value.scrollTop+=o}})})}function l(e){if(s.value)return;s.value=!0;let n=t.get(e),a=null;if(n&&r.value){let e=r.value.getBoundingClientRect(),t=n.getBoundingClientRect();a={x:t.left-e.left,y:t.top-e.top}}o.has(e)?o.delete(e):o.add(e),i(),a&&c(e,a),s.value=!1}function f(){s.value||(s.value=!0,o.clear(),i(),setTimeout(()=>{s.value=!1},300))}function p(){s.value||(s.value=!0,a(e.modules).forEach(e=>{e.imports.length>0&&o.add(e.id)}),i(),setTimeout(()=>{s.value=!1},300))}return{isGraphNodeToggling:s,toggleNode:l,expandAll:f,collapseAll:p}}function ye(){let{scale:e,zoomIn:t,zoomOut:n,ZOOM_MIN:r,ZOOM_MAX:i}=u(X);return c([`-`,`_`],e=>{e.ctrlKey&&n()}),c([`=`,`+`],e=>{e.ctrlKey&&t()}),{ZOOM_MIN:r,ZOOM_MAX:i,scale:e,zoomIn:t,zoomOut:n}}function be(){let{container:e}=u(X),t=n(!1),r=0,i=0;function a(){l(e,`mousedown`,n=>{let a=e.value.getBoundingClientRect(),o=a.right-n.clientX,s=a.bottom-n.clientY;o<=20||s<=20||(t.value=!0,r=e.value.scrollLeft+n.pageX,i=e.value.scrollTop+n.pageY)}),l(e,`contextmenu`,e=>e.preventDefault()),l(`mouseleave`,()=>t.value=!1),l(`mouseup`,()=>t.value=!1),l(`mousemove`,n=>{t.value&&(n.preventDefault(),e.value.scrollLeft=r-n.pageX,e.value.scrollTop=i-n.pageY)})}return{init:a,isGrabbing:t}}export{ye as a,be as i,$ as n,_e as o,he as r,ve as s,ge as t};
|
|
1
|
+
import{$t as e,Dt as t,Jt as n,Xt as r,Yt as i,en as a,f as o,ot as s,s as c,u as l,vt as u,xt as d}from"./axTMqr-M.js";function f(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function p(){return this.eachAfter(f)}function m(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function h(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function g(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function _(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function v(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function y(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function b(e){for(var t=this,n=x(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function x(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function S(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function C(){return Array.from(this)}function w(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function T(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*ee(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function E(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=k)):t===void 0&&(t=O);for(var n=new j(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new j(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(A)}function D(){return E(this).eachBefore(te)}function O(e){return e.children}function k(e){return Array.isArray(e)?e[1]:null}function te(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function A(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=E.prototype={constructor:j,count:p,each:m,eachAfter:g,eachBefore:h,find:_,sum:v,sort:y,path:b,ancestors:S,descendants:C,leaves:w,links:T,copy:D,[Symbol.iterator]:ee};function M(e,t){return e.parent===t.parent?1:2}function N(e){var t=e.children;return t?t[0]:e.t}function P(e){var t=e.children;return t?t[t.length-1]:e.t}function F(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ne(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function re(e,t,n){return e.a.parent===t.parent?e.a:n}function I(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}I.prototype=Object.create(j.prototype);function ie(e){for(var t=new I(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new I(a[o],o)),i.parent=n;return(t.parent=new I(null,0)).children=[t],t}function ae(){var e=M,t=1,n=1,r=null;function i(i){var s=ie(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){ne(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=P(o),i=N(i),o&&i;)s=N(s),a=P(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(F(re(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!P(a)&&(a.t=o,a.m+=u-l),i&&!N(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}function L(e){return function(){return e}}var R=Math.PI,z=2*R,B=1e-6,V=z-B;function H(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function U(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return H;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var W=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?H:U(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>B)if(!(Math.abs(u*s-c*l)>B)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((R-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>B&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>B||Math.abs(this._y1-l)>B)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%z+z),d>V?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>B&&this._append`A${n},${n},0,${+(d>=R)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function G(){return new W}G.prototype=W.prototype;function K(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new W(t)}var q=Array.prototype.slice;function oe(e){return e[0]}function se(e){return e[1]}var J=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function ce(e){return new J(e,!0)}function le(e){return new J(e,!1)}function ue(e){return e.source}function de(e){return e.target}function Y(e){let t=ue,n=de,r=oe,i=se,a=null,o=null,s=K(c);function c(){let c,l=q.call(arguments),u=t.apply(this,l),d=n.apply(this,l);if(a??(o=e(c=s())),o.lineStart(),l[0]=u,o.point(+r.apply(this,l),+i.apply(this,l)),l[0]=d,o.point(+r.apply(this,l),+i.apply(this,l)),o.lineEnd(),c)return o=null,c+``||null}return c.source=function(e){return arguments.length?(t=e,c):t},c.target=function(e){return arguments.length?(n=e,c):n},c.x=function(e){return arguments.length?(r=typeof e==`function`?e:L(+e),c):r},c.y=function(e){return arguments.length?(i=typeof e==`function`?e:L(+e),c):i},c.context=function(t){return arguments.length?(t==null?a=o=null:o=e(a=t),c):a},c}function fe(){return Y(ce)}function pe(){return Y(le)}function me(t,{wheel:r=!0,minScale:i=.5,maxScale:a=2}={}){let o=n(1);function s(n,r,s){let c=e(t);if(!c)return;let{left:l,top:u,width:d,height:f}=c.getBoundingClientRect(),p=r??l+d/2,m=s??u+f/2,h=p-l,g=m-u,_=o.value;o.value=Math.max(i,Math.min(a,_+n));let v=o.value/_;c.scrollLeft=(c.scrollLeft+h)*v-h,c.scrollTop=(c.scrollTop+g)*v-g}function c(t){if(e(r)){t.preventDefault();let e=.2;s(t.deltaY<0?e:e*-1,t.clientX,t.clientY)}else t.ctrlKey&&(t.preventDefault(),s(t.deltaY*.004*-1,t.clientX,t.clientY))}function u(e=.2){s(e)}function d(e=.2){s(e*-1)}return l(t,`wheel`,c),{scale:o,zoom:s,zoomIn:u,zoomOut:d}}var X=Symbol.for(`ViteDevToolsModuleGraphState`);const Z=fe().x(e=>e[0]).y(e=>e[1]),Q=pe().x(e=>e[0]).y(e=>e[1]);function $(e,t){return t?e.target.x<=e.source.x?Q({source:[e.source.x+a(t.width)/2-a(t.linkOffset),e.source.y],target:[e.target.x-a(t.width)/2+a(t.linkOffset),e.target.y]}):Z({source:[e.source.x+a(t.width)/2-a(t.linkOffset),e.source.y],target:[e.target.x-a(t.width)/2+a(t.linkOffset),e.target.y]}):e.target.x<=e.source.x?Q({source:[e.source.x,e.source.y],target:[e.target.x,e.target.y]}):Z({source:[e.source.x,e.source.y],target:[e.target.x,e.target.y]})}function he(e){return`stroke-#8885`}function ge(e){let a=.4,c=n(),l=n(window.innerWidth),u=n(window.innerHeight),d=i(new Map),f=i(new Set),p=n(!0),m=i(new Map),h=r([]),g=r([]),_=i(new Map),v=i(new Map),y=s(()=>{let t=new Map;for(let n of e.modules.value)t.set(n.id,n);return t}),{control:b}=o(),{scale:x,zoomIn:S,zoomOut:C}=me(c,{wheel:b,minScale:a,maxScale:2});function w(e,t=!0){d.get(e)?.scrollIntoView({block:`center`,inline:`center`,behavior:t?`smooth`:`instant`})}let T=e.generateGraph({isFirstCalculateGraph:p,hierarchy:E,tree:ae,nodesRefMap:d,container:c,modulesMap:y,nodes:h,links:g,scale:x,nodesMap:_,linksMap:v,width:l,height:u,childToParentMap:m,focusOn:w,collapsedNodes:f,spacing:e.spacing});t(X,{spacing:e.spacing,calculateGraph:T,isFirstCalculateGraph:p,container:c,width:l,height:u,scale:x,nodes:h,links:g,nodesRefMap:d,collapsedNodes:f,childToParentMap:m,ZOOM_MIN:a,ZOOM_MAX:2,zoomIn:S,zoomOut:C})}function _e(){return u(X)}function ve(e){let{nodesRefMap:t,container:r,calculateGraph:i,collapsedNodes:o}=u(X),s=n(!1);function c(e,n){d(()=>{d(()=>{let i=t.get(e);if(i&&n&&r.value){let e=r.value.getBoundingClientRect(),t=i.getBoundingClientRect(),a=t.left-e.left-n.x,o=t.top-e.top-n.y;r.value.scrollLeft+=a,r.value.scrollTop+=o}})})}function l(e){if(s.value)return;s.value=!0;let n=t.get(e),a=null;if(n&&r.value){let e=r.value.getBoundingClientRect(),t=n.getBoundingClientRect();a={x:t.left-e.left,y:t.top-e.top}}o.has(e)?o.delete(e):o.add(e),i(),a&&c(e,a),s.value=!1}function f(){s.value||(s.value=!0,o.clear(),i(),setTimeout(()=>{s.value=!1},300))}function p(){s.value||(s.value=!0,a(e.modules).forEach(e=>{e.imports.length>0&&o.add(e.id)}),i(),setTimeout(()=>{s.value=!1},300))}return{isGraphNodeToggling:s,toggleNode:l,expandAll:f,collapseAll:p}}function ye(){let{scale:e,zoomIn:t,zoomOut:n,ZOOM_MIN:r,ZOOM_MAX:i}=u(X);return c([`-`,`_`],e=>{e.ctrlKey&&n()}),c([`=`,`+`],e=>{e.ctrlKey&&t()}),{ZOOM_MIN:r,ZOOM_MAX:i,scale:e,zoomIn:t,zoomOut:n}}function be(){let{container:e}=u(X),t=n(!1),r=0,i=0;function a(){l(e,`mousedown`,n=>{let a=e.value.getBoundingClientRect(),o=a.right-n.clientX,s=a.bottom-n.clientY;o<=20||s<=20||(t.value=!0,r=e.value.scrollLeft+n.pageX,i=e.value.scrollTop+n.pageY)}),l(e,`contextmenu`,e=>e.preventDefault()),l(`mouseleave`,()=>t.value=!1),l(`mouseup`,()=>t.value=!1),l(`mousemove`,n=>{t.value&&(n.preventDefault(),e.value.scrollLeft=r-n.pageX,e.value.scrollTop=i-n.pageY)})}return{init:a,isGrabbing:t}}export{ye as a,be as i,$ as n,_e as o,he as r,ve as s,ge as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./
|
|
1
|
+
import{u as e}from"./Db5DS6RJ.js";import{n as t}from"./h9JT8fy9.js";import{n,t as r}from"./DnpfwSMy.js";function i(e){let t=e.match(/.*\/node_modules\/(.*)$/)?.[1];if(t)return t}const a=e((e,a)=>{let o=e.replace(/%2F/g,`/`).replace(/\\/g,`/`);if(n(o)||o.match(/^\w+:/)&&!e.match(/^[a-z]:\\/i))return{moduleName:o,path:o};let s=r(o),c=i(o);if(s&&c)return{moduleName:s,path:c};try{let e=t(a,o);return!e.startsWith(`./`)&&!e.startsWith(`../`)&&(e=`./${e}`),e.startsWith(`./.nuxt/`)&&(e=`#build${e.slice(7)}`),{path:e}}catch{return{path:o}}});export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tt as e,en as t,i as n,in as r,lt as i,mt as a,ut as o}from"./
|
|
1
|
+
import{Tt as e,en as t,i as n,in as r,lt as i,mt as a,ut as o}from"./axTMqr-M.js";var s={key:0,"font-mono":``},c=a({__name:`Timestamp`,props:{timestamp:{}},setup(a){let c=a;return(l,u)=>a.timestamp?(e(),o(`span`,s,r(t(n)(new Date(c.timestamp))),1)):i(``,!0)}}),l=Object.assign(c,{__name:`DisplayTimestamp`});export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ct as e,Jt as t,Tt as n,Vt as r,W as i,bt as a,ct as o,ft as s,in as c,it as l,kt as u,mt as d,ot as f,pt as p,st as m,tn as h,ut as g,x as _,y as v}from"./
|
|
1
|
+
import{Ct as e,Jt as t,Tt as n,Vt as r,W as i,bt as a,ct as o,ft as s,in as c,it as l,kt as u,mt as d,ot as f,pt as p,st as m,tn as h,ut as g,x as _,y as v}from"./axTMqr-M.js";import{t as y}from"./CkP2VQQ5.js";import{t as b}from"./CS8yIZOI.js";import{t as x}from"./DQtLZa7C.js";var S=d({__name:`ComparisonMetric`,props:{current:{},previous:{}},setup(e){let t=e,r=f(()=>t.previous===t.current),i=f(()=>Math.abs((t.current-t.previous)/t.previous*100).toFixed(r.value?0:2)),a=f(()=>r.value?``:t.current>t.previous?`+`:`-`),o=f(()=>r.value?`text-gray-500`:t.current>t.previous?`text-green-500`:`text-red-500`);return(e,t)=>(n(),g(`span`,{"text-4":``,"mt-1":``,"font-mono":``,class:h(o.value)},c(a.value)+c(i.value)+`% `,3))}}),C=Object.assign(S,{__name:`DisplayComparisonMetric`}),w=[`title`],T={flex:`~ gap-2`,"items-center":``},E={key:0},D={"font-semibold":``,"text-5":``,"font-mono":``},O={"font-semibold":``,"text-4":``,"font-mono":``},k={key:1},A={"font-semibold":``,"text-5":``,"font-mono":``},j=d({__name:`MetricCard`,props:{name:{},description:{},icon:{},current:{},previous:{},format:{}},setup(e){let t=e,r=f(()=>t.format===`bytes`?x(t.current):t.current);return(t,i)=>{let a=C;return n(),g(l,null,[m(`div`,{"font-500":``,op50:``,"text-4":``,flex:`~ items-center gap-2`,title:e.description},[m(`div`,{class:h([e.icon,`text-xl`])},null,2),s(` `+c(e.name),1)],8,w),m(`div`,T,[e.format===`bytes`?(n(),g(`div`,E,[m(`span`,D,c(r.value[0]),1),m(`span`,O,c(r.value[1]),1)])):(n(),g(`div`,k,[m(`span`,A,c(r.value),1)])),p(a,{current:e.current,previous:e.previous},null,8,[`current`,`previous`])])],64)}}}),M=Object.assign(j,{__name:`CompareMetricCard`}),N={key:1,"h-screen":``,"w-screen":``,"max-w-screen":``,"max-h-screen":``,"of-hidden":``,p6:``,flex:`~ col gap-2`},P={flex:`~ gap-2`},F={flex:`~ col`,border:`~ base rounded-lg`,p3:``,mt10:``},I={grid:`~ cols-4 gap5`,"w-full":``,pt3:``},L=d({__name:`index`,setup(c){let d=t(!1),x=i().params,S=v(),C=t([]);e(async()=>{d.value=!0,C.value=await S.value[`vite:rolldown:get-session-compare-summary`]({sessions:x.sessions.split(`,`)}),d.value=!1});let w=f(()=>C.value.map((e,t)=>({...e,createdAt:new Date(e.meta?.timestamp??0),title:t===0?`Session A`:`Session B`}))),T=f(()=>{let[e,t]=w.value;return[{name:`Bundle Size`,description:`Total file size of the assets`,icon:`i-ph-package-duotone`,current:t?.bundle_size??0,previous:e?.bundle_size??0,format:`bytes`},{name:`Initial JS`,description:`Total file size of the initial JS chunks`,icon:`i-ph-file-js-duotone`,current:t?.initial_js??0,previous:e?.initial_js??0,format:`bytes`},{name:`Modules`,description:`Total number of modules`,icon:`i-ph-graph-duotone`,current:t?.modules??0,previous:e?.modules??0},{name:`Plugins`,description:`Total number of plugins`,icon:`i-ph-plugs-duotone`,current:t?.meta?.plugins.length??0,previous:e?.meta?.plugins.length??0},{name:`Chunks`,description:`Total number of chunks`,icon:`i-ph-shapes-duotone`,current:t?.chunks??0,previous:e?.chunks??0},{name:`Assets`,description:`Total number of assets`,icon:`i-ph-package-duotone`,current:t?.assets??0,previous:e?.assets??0}]});return(e,t)=>{let i=_,c=y,f=b,v=M;return d.value?(n(),o(i,{key:0})):(n(),g(`div`,N,[m(`div`,P,[p(c,{"btn-action":``,to:{path:`/`}},{default:r(()=>[...t[0]||=[m(`div`,{"i-ph-arrow-bend-up-left-duotone":``},null,-1),s(` Re-select Session `,-1)]]),_:1})]),m(`div`,F,[t[1]||=m(`div`,{py3:``,"indent-2":``},` Compare Overview `,-1),p(f,{sessions:w.value},null,8,[`sessions`]),m(`div`,I,[(n(!0),g(l,null,u(T.value,(e,t)=>(n(),g(`div`,{key:e.name,class:h(t<2?`col-span-2`:`col-span-1`),border:`~ base rounded`,p4:``,flex:`~ col`,gap2:``},[p(v,a({ref_for:!0},e),null,16)],2))),128))])])]))}}});export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tt as e,in as t,it as n,kt as r,mt as i,st as a,ut as o}from"./
|
|
1
|
+
import{Tt as e,in as t,it as n,kt as r,mt as i,st as a,ut as o}from"./axTMqr-M.js";var s={flex:`~ gap5`,"w-full":``,border:`b base`,pb3:``},c={"font-mono":``},l={"font-mono":``},u=[`datetime`],d=i({__name:`SessionMeta`,props:{sessions:{}},setup(i){return(d,f)=>(e(),o(`div`,s,[(e(!0),o(n,null,r(i.sessions,n=>(e(),o(`div`,{key:n.id,"flex-1":``,border:`~ base rounded`,p4:``,grid:`~ cols-[max-content_140px_2fr] max-lg:cols-[max-content_80px_2fr] gap-2 items-center`},[f[0]||=a(`div`,{class:`i-ph-hash-duotone`},null,-1),a(`div`,null,t(n.title),1),a(`div`,c,[a(`span`,null,t(n.id),1)]),f[1]||=a(`div`,{class:`i-ph-clock-duotone`},null,-1),f[2]||=a(`div`,null,` Created At `,-1),a(`div`,l,[a(`time`,{datetime:n.createdAt.toISOString()},t(n.createdAt.toLocaleString()),9,u)])]))),128))]))}}),f=Object.assign(d,{__name:`CompareSessionMeta`});export{f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tt as e,Vt as t,W as n,c as r,ct as i,en as a,ft as o,in as s,it as c,kt as l,lt as u,mt as d,ot as f,pt as p,st as m,tn as h,ut as g,x as _,xt as v,y}from"./
|
|
1
|
+
import{Tt as e,Vt as t,W as n,c as r,ct as i,en as a,ft as o,in as s,it as c,kt as l,lt as u,mt as d,ot as f,pt as p,st as m,tn as h,ut as g,x as _,xt as v,y}from"./axTMqr-M.js";import{t as b}from"./CkP2VQQ5.js";import"./DQtLZa7C.js";import"./Db5DS6RJ.js";import"./DQcokXty.js";import{r as x}from"./h9JT8fy9.js";import{t as S}from"./k3tsOkpc.js";import{r as C,t as w}from"./DtEEoUTs.js";import"./D-16ZB3R.js";import{t as T}from"./C4x1Rf0J.js";import{t as E}from"./DRSBujEZ.js";import{t as D}from"./DllKqWLf.js";var O={flex:``,pb2:``},k=d({__name:`FlatList`,props:{chunks:{},session:{}},setup(n){return(r,a)=>{let o=x,s=C,c=E;return e(),i(c,{items:n.chunks,"key-prop":`chunk_id`},{default:t(({item:n})=>[m(`div`,O,[p(s,{chunk:n,link:``,"w-full":``,"font-mono":``,border:`~ rounded base`,px2:``,py1:``,"text-sm":``,hover:`bg-active`,flex:`~ gap-4 items-center`},{"left-after":t(()=>[n.is_initial?(e(),i(o,{key:0,text:`initial`})):u(``,!0)]),_:2},1032,[`chunk`])])]),_:1},8,[`items`])}}}),A=Object.assign(k,{__name:`ChunksFlatList`}),j={op50:``,"font-mono":``,w12:``},M=[`title`],N={flex:`~ gap-1 items-center`},P=d({__name:`Graph`,props:{session:{},chunks:{}},setup(r){let c=r,l=f(()=>c.chunks),d=n();return T({modules:l,spacing:{width:450,height:55,linkOffset:15,margin:120,gap:150},generateGraph:e=>{let{isFirstCalculateGraph:t,scale:n,spacing:r,tree:i,hierarchy:o,collapsedNodes:s,container:c,modulesMap:u,nodes:d,links:f,nodesMap:p,linksMap:m,width:h,height:g,childToParentMap:_}=e;return()=>{h.value=window.innerWidth,g.value=window.innerHeight;let e=l.value.filter(e=>e.reason===`entry`),y=new Set,b=o({module:{id:`~root`}},n=>`${n.module?.id}`==`~root`?(e.forEach(e=>{y.add(e),t.value&&_.set(e.id,`~root`)}),e.map(e=>({module:e,expanded:!s.has(e.id),hasChildren:!1}))):s.has(`${n.module?.id}`)?[]:n.module.imports?.map(e=>{let r=u.value.get(`${e.chunk_id}`);if(!(!r||y.has(r)))return t.value&&_.set(r.id,n.module.id),y.add(r),{module:r,expanded:!s.has(r.id),hasChildren:!1}}).filter(e=>e!==void 0));t.value&&=!1,i().nodeSize([a(r.height),a(r.width)+a(r.gap)])(b);let x=b.descendants();for(let e of x)[e.x,e.y]=[e.y-a(r.width),e.x];let S=Math.min(...x.map(e=>e.x)),C=Math.min(...x.map(e=>e.y));if(S<a(r.margin))for(let e of x)e.x+=Math.abs(S)+a(r.margin);if(C<a(r.margin))for(let e of x)e.y+=Math.abs(C)+a(r.margin);d.value=x,p.clear();for(let e of x)p.set(`${e.data.module.id}`,e);let w=b.links().filter(e=>`${e.source.data.module.id}`!=`~root`).map(e=>({...e,id:`${e.source.data.module.id}|${e.target.data.module.id}`})),T=l.value.flatMap(e=>e.imports.filter(t=>!w.find(n=>n.id===`${e.chunk_id}|${t.chunk_id}`)).map(t=>({source:p.get(`${e.chunk_id}`),target:p.get(`${t.chunk_id}`),id:`${e.chunk_id}|${t.chunk_id}`}))),E=[...w,...T];m.clear();for(let e of E)m.set(e.id,e);f.value=E,v(()=>{h.value=c.value.scrollWidth/n.value+a(r.margin),g.value=c.value.scrollHeight/n.value+a(r.margin)})}}}),(n,c)=>{let f=x,h=b,g=D;return e(),i(g,{session:r.session,modules:l.value,"expand-controls":!1},{default:t(({node:n})=>[p(h,{class:`flex items-center`,to:{path:a(d).path,query:{chunk:n.data.module.chunk_id}}},{default:t(()=>[m(`span`,j,`#`+s(n.data.module.id),1),m(`div`,{flex:`~ gap-2 items-center`,title:`Chunk #${n.data.module.id}`},[m(`div`,null,s(n.data.module.name||`[unnamed]`),1),p(f,{text:n.data.module.reason},null,8,[`text`]),n.data.module.is_initial?(e(),i(f,{key:0,text:`initial`})):u(``,!0)],8,M),c[1]||=m(`div`,{"flex-auto":``},null,-1),m(`div`,N,[c[0]||=m(`div`,{"i-ph-package-duotone":``},null,-1),o(` `+s(n.data.module.modules.length),1)])]),_:2},1032,[`to`])]),_:1},8,[`session`,`modules`])}}}),F=Object.assign(P,{__name:`ChunksGraph`}),I={key:1,relative:``,"max-h-screen":``,"of-hidden":``},L={absolute:``,"left-4":``,"top-4":``,"z-panel-nav":``},R={flex:`~ gap-2 items-center`,p2:``,border:`~ base rounded-xl`,"bg-glass":``},z=[`onClick`],B={key:0,class:`px5 pt24 of-auto h-screen`,flex:`~ col gap-4`},V={key:1,class:`px5 pt24 of-auto h-screen`,flex:`~ col gap-4`},H=d({__name:`chunks`,props:{session:{}},setup(t){let n=t,d=[{label:`List`,value:`list`,icon:`i-ph-list-bullets-duotone`},{label:`Detailed List`,value:`detailed-list`,icon:`i-ph-list-magnifying-glass-duotone`},{label:`Graph`,value:`graph`,icon:`i-ph-graph-duotone`}],v=y(),{state:b,isLoading:x}=r(async()=>await v.value[`vite:rolldown:get-chunks-graph`]?.({session:n.session.id}),null),C=f(()=>b.value?.map(e=>({...e,id:`${e.chunk_id}`}))??[]);function T(e){S.value.chunkViewType=e}return(n,r)=>{let f=_,v=A,y=w,E=F;return a(x)?(e(),i(f,{key:0})):(e(),g(`div`,I,[m(`div`,L,[m(`div`,R,[r[0]||=m(`span`,{op50:``,pl2:``,"text-sm":``},`View as`,-1),(e(),g(c,null,l(d,e=>m(`button`,{key:e.value,"btn-action":``,class:h(a(S).chunkViewType===e.value?`bg-active`:`grayscale op50`),onClick:t=>T(e.value)},[m(`div`,{class:h(e.icon)},null,2),o(` `+s(e.label),1)],10,z)),64))])]),a(S).chunkViewType===`list`?(e(),g(`div`,B,[p(v,{session:t.session,chunks:C.value},null,8,[`session`,`chunks`])])):u(``,!0),a(S).chunkViewType===`detailed-list`?(e(),g(`div`,V,[(e(!0),g(c,null,l(a(b),n=>(e(),i(y,{key:n.id,border:`~ base rounded-lg`,p3:``,chunk:n,chunks:a(b),session:t.session},null,8,[`chunk`,`chunks`,`session`]))),128))])):a(S).chunkViewType===`graph`?(e(),i(E,{key:2,session:t.session,chunks:C.value},null,8,[`session`,`chunks`])):u(``,!0)]))}}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,B as t,Ct as n,G as r,H as i,I as a,J as o,Jt as s,K as c,L as l,Q as u,R as d,St as f,U as p,X as m,Xt as h,Y as g,Z as _,_t as v,jt as y,mt as b,ot as x,q as S,z as C}from"./
|
|
1
|
+
import{$ as e,B as t,Ct as n,G as r,H as i,I as a,J as o,Jt as s,K as c,L as l,Q as u,R as d,St as f,U as p,X as m,Xt as h,Y as g,Z as _,_t as v,jt as y,mt as b,ot as x,q as S,z as C}from"./axTMqr-M.js";var w=(...e)=>e.find(e=>e!==void 0);function T(e){let t=e.componentName||`NuxtLink`;function o(e){return typeof e==`string`&&e.startsWith(`#`)}function u(t,n,r){let i=r??e.trailingSlash;if(!t||i!==`append`&&i!==`remove`)return t;if(typeof t==`string`)return D(t,i);let a=`path`in t&&t.path!==void 0?t.path:n(t).path;return{...t,name:void 0,path:D(a,i)}}function T(t){let n=r(),a=S(),s=x(()=>!!t.target&&t.target!==`_self`),c=x(()=>{let e=t.to||t.href||``;return typeof e==`string`&&g(e,{acceptRelative:!0})}),l=y(`RouterLink`),d=l&&typeof l!=`string`?l.useLink:void 0,f=x(()=>{if(t.external)return!0;let e=t.to||t.href||``;return typeof e==`object`?!1:e===``||c.value}),h=x(()=>{let e=t.to||t.href||``;return f.value?e:u(e,n.resolve,t.trailingSlash)}),_=f.value?void 0:d?.({...t,to:h}),v=x(()=>{let r=t.trailingSlash??e.trailingSlash;if(!h.value||c.value||o(h.value))return h.value;if(f.value){let e=typeof h.value==`object`&&`path`in h.value?p(h.value):h.value;return D(typeof e==`object`?n.resolve(e).href:e,r)}return typeof h.value==`object`?n.resolve(h.value)?.href??null:D(m(a.app.baseURL,h.value),r)});return{to:h,hasTarget:s,isAbsoluteUrl:c,isExternal:f,href:v,isActive:_?.isActive??x(()=>h.value===n.currentRoute.value.path),isExactActive:_?.isExactActive??x(()=>h.value===n.currentRoute.value.path),route:_?.route??x(()=>n.resolve(h.value)),async navigate(e){await i(v.value,{replace:t.replace,external:f.value||s.value})}}}return b({name:t,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:T,setup(t,{slots:i}){let u=r(),{to:m,href:g,navigate:b,isExternal:x,hasTarget:S,isAbsoluteUrl:E}=T(t),D=h(!1),k=s(null),j=e=>{k.value=t.custom?e?.$el?.nextElementSibling:e?.$el};function M(n){return!D.value&&(typeof t.prefetchOn==`string`?t.prefetchOn===n:t.prefetchOn?.[n]??e.prefetchOn?.[n])&&(t.prefetch??e.prefetch)!==!1&&t.noPrefetch!==!0&&t.target!==`_blank`&&!A()}async function N(e=c()){if(D.value)return;D.value=!0;let t=typeof m.value==`string`?m.value:x.value?p(m.value):u.resolve(m.value).fullPath,n=x.value?new URL(t,window.location.href).href:t;await Promise.all([e.hooks.callHook(`link:prefetch`,n).catch(()=>{}),!x.value&&!S.value&&a(m.value,u).catch(()=>{})])}if(M(`visibility`)){let e=c(),t,r=null;n(()=>{let n=O();l(()=>{t=C(()=>{k?.value?.tagName&&(r=n.observe(k.value,async()=>{r?.(),r=null,await N(e)}))})})}),f(()=>{t&&d(t),r?.(),r=null})}return()=>{if(!x.value&&!S.value&&!o(m.value)){let n={ref:j,to:m.value,activeClass:t.activeClass||e.activeClass,exactActiveClass:t.exactActiveClass||e.exactActiveClass,replace:t.replace,ariaCurrentValue:t.ariaCurrentValue,custom:t.custom};return t.custom||(M(`interaction`)&&(n.onPointerenter=N.bind(null,void 0),n.onFocus=N.bind(null,void 0)),D.value&&(n.class=t.prefetchedClass||e.prefetchedClass),n.rel=t.rel||void 0),v(y(`RouterLink`),n,i.default)}let n=t.target||null,r=w(t.noRel?``:t.rel,e.externalRelAttribute,E.value||S.value?`noopener noreferrer`:``)||null;return t.custom?i.default?i.default({href:g.value,navigate:b,prefetch:N,get route(){if(!g.value)return;let e=new URL(g.value,window.location.href);return{path:e.pathname,fullPath:e.pathname,get query(){return _(e.search)},hash:e.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:g.value}},rel:r,target:n,isExternal:x.value||S.value,isActive:!1,isExactActive:!1}):null:v(`a`,{ref:k,href:g.value||null,rel:r,target:n,onClick:e=>{if(!(x.value||S.value))return e.preventDefault(),t.replace?u.replace(g.value):u.push(g.value)}},i.default?.())}}})}var E=T(o);function D(t,n){let r=n===`append`?u:e;return g(t)&&!t.startsWith(`http`)?t:r(t,!0)}function O(){let e=c();if(e._observer)return e._observer;let t=null,n=new Map;return e._observer={observe:(e,r)=>(t||=new IntersectionObserver(e=>{for(let t of e){let e=n.get(t.target);(t.isIntersecting||t.intersectionRatio>0)&&e&&e()}}),n.set(e,r),t.observe(e),()=>{n.delete(e),t?.unobserve(e),n.size===0&&(t?.disconnect(),t=null)})}}var k=/2g/;function A(){let e=navigator.connection;return!!(e&&(e.saveData||k.test(e.effectiveType)))}export{E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,Tt as t,Vt as n,W as r,c as i,ct as a,en as o,in as s,it as c,kt as l,lt as u,mt as d,pt as f,st as p,ut as m,x as h,y as g}from"./
|
|
1
|
+
import{E as e,Tt as t,Vt as n,W as r,c as i,ct as a,en as o,in as s,it as c,kt as l,lt as u,mt as d,pt as f,st as p,ut as m,x as h,y as g}from"./axTMqr-M.js";import"./CkP2VQQ5.js";import"./Db5DS6RJ.js";import"./DQcokXty.js";import{r as _,t as v}from"./h9JT8fy9.js";import{t as y}from"./CPuYr29B.js";import{t as b}from"./BsAtFXkB.js";var x={key:0},S={key:2},C={op50:``},w={key:3},T=[`textContent`],E=[`textContent`],D=d({__name:`RawEventsTable`,props:{events:{},fields:{default:()=>[`event_id`,`action`,`module_id`,`plugin_name`,`timestamp`,`content`,`*`]},session:{}},setup(r){let i=r;function d(e,t){let n=new Set(t);return n.has(`content`)&&n.add(`content`),n.has(`plugin_name`)&&n.add(`plugin_index`),Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e)))}function h(e){return e.action===`HookLoadCallEnd`||e.action===`HookTransformCallStart`||e.action===`HookTransformCallEnd`?e.content:null}return(g,D)=>{let O=v,k=_,A=b,j=y;return t(),m(c,null,[r.events.length?u(``,!0):(t(),m(`div`,x,[...D[0]||=[p(`div`,{p5:``,italic:``},` No events found `,-1)]])),p(`table`,null,[p(`tbody`,null,[(t(!0),m(c,null,l(i.events,g=>(t(),m(`tr`,{key:g.event_id},[(t(!0),m(c,null,l(i.fields,i=>(t(),m(`td`,{key:i,px2:``},[i===`module_id`?(t(),a(O,{key:0,id:`module_id`in g?g.module_id:``,session:r.session},null,8,[`id`,`session`])):i===`action`?(t(),a(k,{key:1,text:g.action},null,8,[`text`])):i===`plugin_name`&&`plugin_name`in g?(t(),m(`div`,S,[f(A,{"font-mono":``,name:g.plugin_name},null,8,[`name`]),p(`code`,C,`#`+s(g.plugin_id),1)])):i===`event_id`?(t(),m(`div`,w,s(g.event_id),1)):i===`content`&&h(g)?(t(),a(o(e),{key:4},{popper:n(()=>[p(`pre`,{p1:``,"text-sm":``,textContent:s(h(g))},null,8,T)]),default:n(()=>[D[1]||=p(`div`,{"i-ph-code":``},null,-1)]),_:2},1024)):i===`timestamp`&&`timestamp`in g?(t(),a(j,{key:5,"text-sm":``,timestamp:g.timestamp},null,8,[`timestamp`])):i===`*`?(t(),m(`pre`,{key:6,"text-sm":``,textContent:s(d(g,r.fields))},null,8,E)):u(``,!0)]))),128))]))),128))])])],64)}}}),O=Object.assign(D,{__name:`DataRawEventsTable`}),k={key:1},A=d({__name:`raw`,props:{session:{}},setup(e){let n=e,s=g(),l=r().query,d=i(async()=>await s.value[`vite:rolldown:get-module-raw-events`]?.({session:n.session.id,module:l.module}),{events:[]});return(n,r)=>{let i=h,s=O;return t(),m(c,null,[o(d).isLoading?(t(),a(i,{key:0})):u(``,!0),p(`div`,null,[o(d).isReady?(t(),a(s,{key:0,events:o(d).state.value.events,session:e.session},null,8,[`events`,`session`])):(t(),m(`div`,k,[f(i)]))])],64)}}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Tt as t,ft as n,in as r,lt as i,mt as a,ot as o,tn as s,ut as c}from"./
|
|
1
|
+
import{At as e,Tt as t,ft as n,in as r,lt as i,mt as a,ot as o,tn as s,ut as c}from"./axTMqr-M.js";var l=a({__name:`NumberBadge`,props:{number:{},color:{default:`badge-color-gray op75`},icon:{},prefix:{},suffix:{},format:{default:`locale`}},setup(a){let l=a,u=o(()=>l.format===`percent`?Number(l.number).toLocaleString(void 0,{style:`percent`,minimumFractionDigits:2,maximumFractionDigits:2}):Number(l.number).toLocaleString());return(o,l)=>(t(),c(`div`,{class:s([a.color,`px-0.4em py-0.2em font-mono line-height-none flex items-center`])},[a.icon?(t(),c(`div`,{key:0,class:s([a.icon,`mr-1`])},null,2)):i(``,!0),n(` `+r(a.prefix||``)+r(u.value)+r(a.suffix||``)+` `,1),e(o.$slots,`after`)],2))}}),u=Object.assign(l,{__name:`DisplayNumberBadge`});export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Lt as t,Tt as n,mt as r,st as i,ut as a,zt as o}from"./
|
|
1
|
+
import{At as e,Lt as t,Tt as n,mt as r,st as i,ut as a,zt as o}from"./axTMqr-M.js";var s={class:`px4`,flex:`~ col gap2`},c=r({__name:`Treemap`,props:{graph:{},selected:{}},emits:[`select`],setup(r,{emit:c}){let l=r,u=c,d=t(`el`);return o(()=>d.value?.append(l.graph.el)),(t,o)=>(n(),a(`div`,s,[e(t.$slots,`default`,{selected:r.selected,options:r.graph.options,onSelect:o[0]||=e=>u(`select`,e)},()=>[o[1]||=i(`div`,{border:`b base`,py2:``,"min-h-10":``},null,-1)]),i(`div`,{ref_key:`el`,ref:d},null,512)]))}}),l=Object.assign(c,{__name:`ChartTreemap`});export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,Tt as t,V as n,Vt as r,ft as i,in as a,pt as o,st as s,ut as c}from"./
|
|
1
|
+
import{C as e,Tt as t,V as n,Vt as r,ft as i,in as a,pt as o,st as s,ut as c}from"./axTMqr-M.js";import{t as l}from"./CkP2VQQ5.js";var u={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},d={class:`max-w-520px text-center`},f=[`textContent`],p=[`textContent`],m=[`textContent`],h={class:`flex items-center justify-center w-full`},g=e({__name:`error-404`,props:{appName:{type:String,default:`Nuxt`},statusCode:{type:Number,default:404},statusMessage:{type:String,default:`Page not found`},description:{type:String,default:`Sorry, the page you are looking for could not be found.`},backHome:{type:String,default:`Go back home`}},setup(e){let g=e;return n({title:`${g.statusCode} - ${g.statusMessage} | ${g.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(n,g)=>{let _=l;return t(),c(`div`,u,[s(`div`,d,[s(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:a(e.statusCode)},null,8,f),s(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:a(e.statusMessage)},null,8,p),s(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:a(e.description)},null,8,m),s(`div`,h,[o(_,{to:`/`,class:`font-medium hover:text-[#00DC82] text-sm underline underline-offset-3`},{default:r(()=>[i(a(e.backHome),1)]),_:1})])])])}}},[[`__scopeId`,`data-v-163e3310`]]);export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,Ht as t,Tt as n,en as r,h as i,in as a,it as o,kt as s,lt as c,mt as l,st as u,tn as d,tt as f,ut as p}from"./
|
|
1
|
+
import{At as e,Ht as t,Tt as n,en as r,h as i,in as a,it as o,kt as s,lt as c,mt as l,st as u,tn as d,tt as f,ut as p}from"./axTMqr-M.js";var m={flex:`col gap-2`,"max-w-90vw":``,"min-w-30vw":``,border:`~ base rounded-xl`,"bg-glass":``},h={key:0},g=[`title`],_=[`checked`,`onChange`],v={"text-sm":``},y=[`title`],b={key:0,op75:``,"i-ph-selection-slash-duotone":``},x={key:1,op75:``,"i-ph-selection-plus-duotone":``},S=l({__name:`SearchPanel`,props:{rules:{},modelValue:{default:()=>({search:``,selected:null})},selectedContainerClass:{default:``}},emits:[`update:modelValue`],setup(l,{emit:S}){let C=l,w=i(C,`modelValue`,S);function T(e){let{modelValue:t}=C;return t?.selected?t.selected.includes(e.name):!0}function E(e){let{rules:t}=C;w?.value?.selected||(w.value.selected=t.map(e=>e.name)),w.value.selected.includes(e.name)?w.value.selected=w.value.selected.filter(t=>t!==e.name):w.value.selected.push(e.name),w?.value?.selected.length===C.rules.length&&(w.value.selected=null)}function D(){w?.value?.selected?.length===C.rules.length?w.value.selected=null:w?.value?.selected==null?w.value.selected=[]:w.value.selected=C.rules.map(e=>e.name).filter(e=>!w.value.selected?.includes(e))}function O(){w?.value?.selected?.length===0?w.value.selected=null:w.value.selected=[]}return(i,S)=>(n(),p(`div`,m,[l.modelValue.search===!1?c(``,!0):(n(),p(`div`,h,[t(u(`input`,{"onUpdate:modelValue":S[0]||=e=>r(w).search=e,p2:``,px4:``,"w-full":``,style:{outline:`none`},placeholder:`Search`},null,512),[[f,r(w).search]])])),l.rules.length?(n(),p(`div`,{key:1,class:d(l.selectedContainerClass),flex:`~ gap-2 wrap`,p2:``,border:`t base`},[(n(!0),p(o,null,s(l.rules,e=>(n(),p(`label`,{key:e.name,border:`~ base rounded-md`,px2:``,py1:``,flex:`~ items-center gap-1`,"select-none":``,title:e.description,class:d(T(e)?`bg-active`:`grayscale op50`)},[u(`input`,{type:`checkbox`,mr1:``,checked:T(e),onChange:t=>E(e)},null,40,_),u(`div`,{class:d(e.icon),"icon-catppuccin":``},null,2),u(`div`,v,a(e.description||e.name),1)],10,g))),128)),u(`button`,{"rounded-md":``,p1:``,flex:`~ items-center gap-1`,"select-none":``,hover:`bg-active`,title:`Reverse Selection`,onClick:D},[...S[1]||=[u(`div`,{op75:``,"i-ph-selection-background-duotone":``},null,-1)]]),u(`button`,{"rounded-md":``,p1:``,flex:`~ items-center gap-1`,"select-none":``,hover:`bg-active`,title:r(w).selected?.length===0?`Select All`:`Unselect All`,onClick:O},[r(w).selected?.length===0?(n(),p(`div`,b)):(n(),p(`div`,x))],8,y)],2)):c(``,!0),e(i.$slots,`default`)]))}}),C=Object.assign(S,{__name:`DataSearchPanel`});export{C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Tt as e,_t as t,mt as n,ot as r,tn as i,ut as a}from"./
|
|
1
|
+
import{Tt as e,_t as t,mt as n,ot as r,tn as i,ut as a}from"./axTMqr-M.js";import{r as o,s}from"./Db5DS6RJ.js";var c=[`title`],l=n({__name:`FileIcon`,props:{filename:{}},setup(t){let n=t,o=r(()=>s(n.filename));return(t,n)=>(e(),a(`div`,{"flex-none":``,"icon-catppuccin":``,title:o.value.description||o.value.name,class:i([o.value.icon])},null,10,c))}}),u=Object.assign(l,{__name:`DisplayFileIcon`}),d=n({name:`HighlightedPath`,props:{path:{type:String,required:!0},minimal:{type:Boolean,default:!1}},setup(e){return()=>{let n=e.path.split(/([?/&:=])/g),r=`path`,i=n.map(()=>[]),a=n.map(()=>[]),s=n.map(e=>t(`span`,{class:``},e)),c=new Set;return n.forEach((t,l)=>{if(t===`?`&&(r=`query`),r===`path`){if(t.match(/^\.+$/)||t===`/`?i[l]?.push(`op50`):(t===`node_modules`||t===`dist`||t===`lib`||t.match(/^\.\w/))&&i[l]?.push(`op60`),t===`node_modules`&&e.minimal)for(let e=0;e<l+2;e++)c.add(e);if(t===`.pnpm`&&(s[l]&&(s[l].children=`~`,i[l]?.push(`op25!`),i[l-1]?.push(`op25!`)),c.add(l+1),c.add(l+2),i[l+3]?.push(`op25!`),s[l+4]?.children===`node_modules`&&(c.add(l+3),c.add(l+4),i[l+5]?.push(`op25!`))),t===`:`&&(s[l-1]&&a[l-1]?.push(`color: ${o(n[l-1])}`),i[l]?.push(`op50`)),n[l-2]===`node_modules`&&!t.startsWith(`.`)){let e=`color: ${o(n[l])}`;a[l]?.push(e),t.startsWith(`@`)&&(a[l+1]?.push(e),a[l+2]?.push(e))}}r===`query`&&(t===`?`?i[l]?.push(`text-red-500 dark:text-red-400`):t===`&`&&i[l]?.push(`text-orange-500 dark:text-orange-400`),t===`=`?i[l]?.push(`text-orange-900 dark:text-orange-200 op50`):n[l+1]===`=`?i[l]?.push(`text-amber-900 dark:text-amber-200`):i[l]?.push(`text-orange-900 dark:text-orange-200`))}),s.forEach((e,t)=>{e.props&&(e.props.class=i[t]?.join(` `)??``,e.props.style=a[t]?.join(`;`)??``)}),Array.from(c).sort((e,t)=>t-e).forEach(e=>{s.splice(e,1)}),s}}});export{u as n,d as t};
|