studiograph 1.3.42 → 1.3.43
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/web/_app/immutable/assets/{2.DtDUN2Ae.css → 2.C8WqLKVH.css} +1 -1
- package/dist/web/_app/immutable/chunks/{qeyyXhHO.js → 3kn731Pp.js} +1 -1
- package/dist/web/_app/immutable/chunks/{FmR2V1-h.js → 9TVbAwoF.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Dty7t9WP.js → B-46Slz_.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DD0eH0_A.js → B3OdLZwd.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D9BdHkd3.js → B3cgneCL.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CgcfyvoD.js → BOcEeypC.js} +1 -1
- package/dist/web/_app/immutable/chunks/BRjGNUzV.js +5 -0
- package/dist/web/_app/immutable/chunks/{DSZYl5ah.js → BbsQ7LcO.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DlkslpnI.js → BlYD-5Z_.js} +1 -1
- package/dist/web/_app/immutable/chunks/{yMbbhP0p.js → Bo0CMKlC.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Dr5ZUnae.js → BpQkNqbd.js} +1 -1
- package/dist/web/_app/immutable/chunks/BwiF2fxX.js +1 -0
- package/dist/web/_app/immutable/chunks/{B2LOVFFz.js → ByGNDrbC.js} +1 -1
- package/dist/web/_app/immutable/chunks/{HzJbEnio.js → C39N6y-4.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DmLcKvmV.js → CHyNkE69.js} +1 -1
- package/dist/web/_app/immutable/chunks/{rcG0Y_x7.js → CIgxv4dO.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BnPh5q8z.js → CP30HKCf.js} +1 -1
- package/dist/web/_app/immutable/chunks/{1vztr6_A.js → Cbba0X2k.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DVyuW48M.js → CdoeTcKU.js} +1 -1
- package/dist/web/_app/immutable/chunks/{KCOVknl_.js → CvT005bt.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CYMV9O2_.js → D-Er8WL_.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D91YXE6T.js → D5GOt_JW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{l5w7mUkV.js → DNfruFPs.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Brxs8A3C.js → DVpZtGWL.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DfwW1gF2.js → DY21hM66.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BUMhcVI4.js → Dw9UPwc-.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.CUfCyEld.js → app.EJEuMPYz.js} +2 -2
- package/dist/web/_app/immutable/entry/start.BOMbKPKA.js +1 -0
- package/dist/web/_app/immutable/nodes/0.BZ4775L8.js +2 -0
- package/dist/web/_app/immutable/nodes/{1.CUZf-oFi.js → 1.Bsi4xvt_.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.Dtg7XjMw.js +84 -0
- package/dist/web/_app/immutable/nodes/{3.CywCCe9F.js → 3.BnPkMEuM.js} +1 -1
- package/dist/web/_app/immutable/nodes/4.B8xw3uIV.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.BG_fz1Pc.js → 5.jC5vBcjM.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.s5GRZINE.js → 6.BrJWdUaW.js} +1 -1
- package/dist/web/_app/immutable/nodes/7.DhmNA9F-.js +2 -0
- package/dist/web/_app/immutable/nodes/{8.B2uOoOa7.js → 8.D4qXhOtf.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.jU4WCAQj.js → 9.B9Hbxu54.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +12 -12
- package/package.json +1 -1
- package/dist/web/_app/immutable/chunks/BKAD6OjK.js +0 -1
- package/dist/web/_app/immutable/chunks/SAMwKg4j.js +0 -5
- package/dist/web/_app/immutable/chunks/Y2eppfkg.js +0 -1
- package/dist/web/_app/immutable/entry/start.aufF8xaf.js +0 -1
- package/dist/web/_app/immutable/nodes/0.C-CmG3eF.js +0 -2
- package/dist/web/_app/immutable/nodes/2.BuPKoNE3.js +0 -84
- package/dist/web/_app/immutable/nodes/4.BXLn5nFI.js +0 -11
- package/dist/web/_app/immutable/nodes/7.C24TRVUy.js +0 -2
- /package/dist/web/_app/immutable/assets/{dialog-close.FS8bdfxr.css → Copy.FS8bdfxr.css} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/B340SUKR.js","../chunks/CIgxv4dO.js","../chunks/CLFba8FK.js","../chunks/9TVbAwoF.js","../chunks/Bo0CMKlC.js","../chunks/D5GOt_JW.js","../chunks/ByGNDrbC.js","../chunks/BOcEeypC.js","../chunks/Cbba0X2k.js","../chunks/BlYD-5Z_.js","../chunks/Dw9UPwc-.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as oa,w as xt}from"../chunks/BOcEeypC.js";import{_ as We}from"../chunks/PPVm8Dsz.js";import{d as Lt,c as Ve,e as at,a as g,g as Be,t as tt,s as ve,b as W,f as Xe}from"../chunks/DY21hM66.js";import{az as la,a1 as Bt,p as Ye,Y as Pe,a6 as rt,aa as nt,a0 as ua,c as x,a5 as Y,r as p,g as e,s as _,b as Je,a4 as Ce,n as ze,t as he,ag as De,l as Ze,d as Ie,a as ct,m as Qe,bo as Yt,a7 as ut,ax as da,aC as ca,aD as Jt}from"../chunks/Bo0CMKlC.js";import{i as be,b as Ct}from"../chunks/BbsQ7LcO.js";import{e as Me,i as Ne}from"../chunks/B3cgneCL.js";import{c as Ke}from"../chunks/CvT005bt.js";import{s as it,c as fa}from"../chunks/Cbba0X2k.js";import{g as zt,i as va}from"../chunks/D5GOt_JW.js";import{V as ha}from"../chunks/B3OdLZwd.js";import{r as dt,a as ft,d as Ot,c as et,b as pa}from"../chunks/DNfruFPs.js";import{b as Zt}from"../chunks/CP30HKCf.js";import{p as je,l as Ge}from"../chunks/CdoeTcKU.js";import{B as Fe}from"../chunks/DVpZtGWL.js";import{T as _a,P as ga,C as ma,I as It,S as ya,a as mt,R as wa,b as jt,p as Ut}from"../chunks/3kn731Pp.js";import{i as vt}from"../chunks/BpQkNqbd.js";import{t as ba,C as ka,u as xa,A as Et,v as Ea,w as Ca,x as Sa,y as Aa,z as Pa,B as Ra,G as Da,H as Ta,I as za}from"../chunks/BRjGNUzV.js";import{g as Oa}from"../chunks/CqkleIqs.js";import{n as Tt}from"../chunks/Dw9UPwc-.js";import{e as Ue,r as La}from"../chunks/9TVbAwoF.js";import{c as Ma}from"../chunks/B-46Slz_.js";import{I as Vt}from"../chunks/CHyNkE69.js";import{a as Kt}from"../chunks/BlYD-5Z_.js";function Fa(Z,t,u){la(()=>{var o=Bt(()=>t(Z,u?.())||{});if(o?.destroy)return()=>o.destroy()})}const Ia=async({params:Z,fetch:t})=>{const{repo:u,type:o,id:d}=Z,w=await oa(u,o,d);return{repo:u,type:o,id:d,entity:w}},Un=Object.freeze(Object.defineProperty({__proto__:null,load:Ia},Symbol.toStringTag,{value:"Module"}));var ja=W('<span class="chip svelte-84vb17"> <!></span>'),Ua=W('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),Va=W('<div class="dropdown svelte-84vb17"></div>'),Ka=W('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Na(Z,t){Ye(t,!0);let u=je(t,"multi",3,!1),o=Pe(""),d=Pe(0),w;const A=De(()=>xt.repos.flatMap(b=>b.entities.map(k=>({id:k.id,title:k.title,entityType:k.entityType,repo:b.name})))),S=De(()=>()=>{const b=e(o).toLowerCase().trim();return b?e(A).filter(k=>k.title.toLowerCase().includes(b)||k.id.toLowerCase().includes(b)).slice(0,20):e(A).slice(0,20)}),P=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let c=Pe(rt(P));nt(()=>{ua().then(()=>w?.focus())});function L(b){u()?(e(c).includes(b)||_(c,[...e(c),b],!0),_(o,""),_(d,0),w?.focus()):t.onselect(b)}function R(b){_(c,e(c).filter(k=>k!==b),!0)}function D(){e(c).length===P.length&&e(c).every((k,a)=>k===P[a])?t.oncancel():t.onselect(e(c))}function H(b){const k=e(S)();b.key==="ArrowDown"?(b.preventDefault(),_(d,Math.min(e(d)+1,k.length-1),!0)):b.key==="ArrowUp"?(b.preventDefault(),_(d,Math.max(e(d)-1,0),!0)):b.key==="Enter"?(b.preventDefault(),k.length>0?L(k[e(d)].id):u()&&D()):b.key==="Escape"?u()&&e(c).length>0?D():t.oncancel():b.key==="Backspace"&&!e(o)&&u()&&e(c).length>0&&_(c,e(c).slice(0,-1),!0)}var oe=Ka(),G=x(oe),de=x(G);{var Se=b=>{var k=Be(),a=Ce(k);Me(a,17,()=>e(c),Ne,(r,l)=>{var m=ja(),E=x(m),q=Y(E);Fe(q,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>R(e(l)),children:(_e,Ee)=>{ze();var y=tt("×");g(_e,y)},$$slots:{default:!0}}),p(m),he(()=>ve(E,`${e(l)??""} `)),g(r,m)}),g(b,k)};be(de,b=>{u()&&b(Se)})}var ee=Y(de,2);dt(ee),Ct(ee,b=>w=b,()=>w),p(G);var le=Y(G,2);{var ke=b=>{var k=Va();Me(k,21,()=>e(S)(),Ne,(a,r,l)=>{var m=Ua();let E;var q=x(m),_e=x(q,!0);p(q);var Ee=Y(q,2),y=x(Ee),f=x(y,!0);p(y);var v=Y(y,2),T=x(v,!0);p(v),p(Ee),p(m),he(()=>{E=it(m,1,"dropdown-item svelte-84vb17",null,E,{highlighted:l===e(d)}),ve(_e,e(r).title),ve(f,e(r).entityType),ve(T,e(r).repo)}),Ve("mousedown",m,re=>{re.preventDefault(),L(e(r).id)}),at("mouseenter",m,()=>_(d,l,!0)),g(a,m)}),p(k),g(b,k)},pe=De(()=>e(S)().length>0);be(le,b=>{e(pe)&&b(ke)})}p(oe),Ve("keydown",ee,H),at("blur",ee,()=>{setTimeout(()=>{u()&&e(c).length>0?D():u()||t.oncancel()},150)}),Zt(ee,()=>e(o),b=>_(o,b)),g(Z,oe),Je()}Lt(["keydown","mousedown"]);var qa=Xe("<title> </title>"),Wa=Xe('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function yt(Z,t){const u=Ge(t,["children","$$slots","$$events","$$legacy"]),o=Ge(u,["size","title"]);Ye(t,!1);const d=Qe(),w=Qe();let A=je(t,"size",8,16),S=je(t,"title",8,void 0);Ze(()=>(Ie(u),Ie(S())),()=>{_(d,u["aria-label"]||u["aria-labelledby"]||S())}),Ze(()=>(e(d),Ie(u)),()=>{_(w,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(u.tabindex)===0?!0:void 0})}),ct(),vt();var P=Wa();ft(P,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:A(),height:A(),...e(w),...o}));var c=x(P);{var L=R=>{var D=qa(),H=x(D,!0);p(D),he(()=>ve(H,S())),g(R,D)};be(c,R=>{S()&&R(L)})}ze(),p(P),g(Z,P),Je()}var Ha=Xe("<title> </title>"),Ba=Xe('<svg><!><circle cx="16" cy="16" r="10"></circle><path d="M16,30A14,14,0,1,1,30,16,14.0158,14.0158,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12.0137,12.0137,0,0,0,16,4Z"></path></svg>');function wt(Z,t){const u=Ge(t,["children","$$slots","$$events","$$legacy"]),o=Ge(u,["size","title"]);Ye(t,!1);const d=Qe(),w=Qe();let A=je(t,"size",8,16),S=je(t,"title",8,void 0);Ze(()=>(Ie(u),Ie(S())),()=>{_(d,u["aria-label"]||u["aria-labelledby"]||S())}),Ze(()=>(e(d),Ie(u)),()=>{_(w,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(u.tabindex)===0?!0:void 0})}),ct(),vt();var P=Ba();ft(P,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:A(),height:A(),...e(w),...o}));var c=x(P);{var L=R=>{var D=Ha(),H=x(D,!0);p(D),he(()=>ve(H,S())),g(R,D)};be(c,R=>{S()&&R(L)})}ze(2),p(P),g(Z,P),Je()}var Ya=Xe("<title> </title>"),Ja=Xe('<svg><!><path d="M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"></path><path d="M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"></path></svg>');function bt(Z,t){const u=Ge(t,["children","$$slots","$$events","$$legacy"]),o=Ge(u,["size","title"]);Ye(t,!1);const d=Qe(),w=Qe();let A=je(t,"size",8,16),S=je(t,"title",8,void 0);Ze(()=>(Ie(u),Ie(S())),()=>{_(d,u["aria-label"]||u["aria-labelledby"]||S())}),Ze(()=>(e(d),Ie(u)),()=>{_(w,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(u.tabindex)===0?!0:void 0})}),ct(),vt();var P=Ja();ft(P,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:A(),height:A(),...e(w),...o}));var c=x(P);{var L=R=>{var D=Ya(),H=x(D,!0);p(D),he(()=>ve(H,S())),g(R,D)};be(c,R=>{S()&&R(L)})}ze(2),p(P),g(Z,P),Je()}var Za=Xe("<title> </title>"),Qa=Xe('<svg><!><path d="M10,14a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,10,14Zm0-6a2,2,0,1,0,1.998,2.0044A2.002,2.002,0,0,0,10,8Z"></path><path d="M16.6436,29.4145,2.5858,15.3555A2,2,0,0,1,2,13.9414V4A2,2,0,0,1,4,2h9.9413a2,2,0,0,1,1.4142.5858L29.4144,16.6436a2.0005,2.0005,0,0,1,0,2.8285l-9.9424,9.9425a2.0008,2.0008,0,0,1-2.8285,0ZM4,4v9.9417L18.0578,28,28,18.0579,13.9416,4Z"></path></svg>');function Qt(Z,t){const u=Ge(t,["children","$$slots","$$events","$$legacy"]),o=Ge(u,["size","title"]);Ye(t,!1);const d=Qe(),w=Qe();let A=je(t,"size",8,16),S=je(t,"title",8,void 0);Ze(()=>(Ie(u),Ie(S())),()=>{_(d,u["aria-label"]||u["aria-labelledby"]||S())}),Ze(()=>(e(d),Ie(u)),()=>{_(w,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(u.tabindex)===0?!0:void 0})}),ct(),vt();var P=Qa();ft(P,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:A(),height:A(),...e(w),...o}));var c=x(P);{var L=R=>{var D=Za(),H=x(D,!0);p(D),he(()=>ve(H,S())),g(R,D)};be(c,R=>{S()&&R(L)})}ze(2),p(P),g(Z,P),Je()}var Ga=Xe("<title> </title>"),Xa=Xe('<svg><!><path d="M10 16 20 6 21.4 7.4 12.8 16 21.4 24.6 20 26z"></path></svg>');function $a(Z,t){const u=Ge(t,["children","$$slots","$$events","$$legacy"]),o=Ge(u,["size","title"]);Ye(t,!1);const d=Qe(),w=Qe();let A=je(t,"size",8,16),S=je(t,"title",8,void 0);Ze(()=>(Ie(u),Ie(S())),()=>{_(d,u["aria-label"]||u["aria-labelledby"]||S())}),Ze(()=>(e(d),Ie(u)),()=>{_(w,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(u.tabindex)===0?!0:void 0})}),ct(),vt();var P=Xa();ft(P,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:A(),height:A(),...e(w),...o}));var c=x(P);{var L=R=>{var D=Ga(),H=x(D,!0);p(D),he(()=>ve(H,S())),g(R,D)};be(c,R=>{S()&&R(L)})}ze(),p(P),g(Z,P),Je()}var er=W('<span class="ip-menu-check svelte-x7sio8"><!></span>'),tr=W('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),ar=W('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),rr=W("<!> <!> <!>",1),nr=W("<!> <!>",1),ir=W('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),sr=W('<span class="ip-status-dot svelte-x7sio8"></span> ',1),or=W('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),lr=W('<span class="ip-cal-wd svelte-x7sio8"> </span>'),ur=W('<div class="ip-cal-week svelte-x7sio8"></div>'),dr=W('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><!> <span class="ip-cal-title svelte-x7sio8"> </span> <!></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),cr=W('<span class="ip-badge svelte-x7sio8"> </span>'),fr=W('<div class="ip-wikilink-group svelte-x7sio8"></div>'),vr=W('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),hr=W('<span class="ip-date-text svelte-x7sio8"> </span>'),pr=W('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),_r=W('<span class="ip-text-value svelte-x7sio8"> </span>'),gr=W('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),mr=W('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),yr=W("<!> <span>Add property</span>",1),wr=W('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function br(Z,t){Ye(t,!0);let u=je(t,"editable",3,!1);const o=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],d=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let w=Pe(null),A=Pe(!1),S=Pe(""),P=Pe(void 0);function c(n){switch(n.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function L(n){for(const i of xt.repos){const M=i.entities.find(U=>U.id===n);if(M){zt(`/${i.name}/${M.entityType}/${M.id}`);return}}}function R(n){return typeof n.value=="string"?n.value:n.value[0]}function D(n){return/^https?:\/\//.test(n)}function H(n){try{return new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return n}}let oe=Pe(rt(new Date().getFullYear())),G=Pe(rt(new Date().getMonth()));const de=["Su","Mo","Tu","We","Th","Fr","Sa"],Se=["January","February","March","April","May","June","July","August","September","October","November","December"];function ee(n,i){const M=new Date(n,i,1).getDay(),U=new Date(n,i+1,0).getDate(),X=new Date(n,i,0).getDate(),O=[];let s=[];for(let C=M-1;C>=0;C--){const h=X-C,I=i===0?11:i-1,se=i===0?n-1:n;s.push({day:h,month:I,year:se,outside:!0})}for(let C=1;C<=U;C++)s.push({day:C,month:i,year:n,outside:!1}),s.length===7&&(O.push(s),s=[]);if(s.length>0){const C=i===11?0:i+1,h=i===11?n+1:n;let I=1;for(;s.length<7;)s.push({day:I++,month:C,year:h,outside:!0});O.push(s)}return O}function le(n){const i=new Date;return n.day===i.getDate()&&n.month===i.getMonth()&&n.year===i.getFullYear()}function ke(n,i){const M=i.slice(0,10).split("-");return n.year===+M[0]&&n.month===+M[1]-1&&n.day===+M[2]}function pe(){e(G)===0?(_(G,11),ut(oe,-1)):ut(G,-1)}function b(){e(G)===11?(_(G,0),ut(oe)):ut(G)}function k(n){try{const i=n.slice(0,10).split("-");_(oe,+i[0]),_(G,+i[1]-1)}catch{const i=new Date;_(oe,i.getFullYear(),!0),_(G,i.getMonth(),!0)}}function a(n){requestAnimationFrame(()=>{n.focus(),n.select()})}function r(n){!u()||n.type==="badge"||(n.type==="date"&&k(R(n)),_(w,n.key,!0))}function l(n,i){t.onedit&&t.onedit(n,i),_(w,null)}function m(n,i){const M=`${i.year}-${String(i.month+1).padStart(2,"0")}-${String(i.day).padStart(2,"0")}`;t.onedit&&t.onedit(n,M),_(w,null)}function E(n,i){t.ontypechange&&t.ontypechange(n,i)}function q(n){_(w,null),t.onremove&&t.onremove(n)}function _e(){_(A,!0),_(S,""),requestAnimationFrame(()=>e(P)?.focus())}function Ee(){const n=e(S).trim();n&&t.onadd&&t.onadd(n,""),_(A,!1),_(S,"")}function y(){_(A,!1),_(S,"")}function f(n){n.key==="Enter"?(n.preventDefault(),Ee()):n.key==="Escape"&&y()}var v=wr();at("click",Yt,()=>{_(w,null)});var T=x(v);Me(T,17,()=>t.properties,n=>n.key,(n,i)=>{const M=De(()=>e(w)===e(i).key);var U=gr();let X;var O=x(U),s=x(O);{var C=z=>{var F=Be(),j=Ce(F);Ke(j,()=>wa,(Q,ge)=>{ge(Q,{children:(ne,fe)=>{var me=nr(),ue=Ce(me);Ke(ue,()=>_a,(ie,B)=>{B(ie,{class:"ip-icon-trigger",children:(ae,we)=>{var Ae=Be(),qe=Ce(Ae);{var Oe=Te=>{yt(Te,{size:14})},$e=Te=>{wt(Te,{size:14})},st=Te=>{bt(Te,{size:14})},ht=Te=>{mt(Te,{size:14})};be(qe,Te=>{e(i).type==="date"?Te(Oe):e(i).type==="status"?Te($e,1):e(i).type==="wikilink"?Te(st,2):Te(ht,!1)})}g(ae,Ae)},$$slots:{default:!0}})});var Re=Y(ue,2);Ke(Re,()=>ga,(ie,B)=>{B(ie,{children:(ae,we)=>{var Ae=Be(),qe=Ce(Ae);Ke(qe,()=>ma,(Oe,$e)=>{$e(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(st,ht)=>{var Te=rr(),St=Ce(Te);Me(St,17,()=>o,Ne,(lt,He)=>{var pt=Be(),Mt=Ce(pt);Ke(Mt,()=>It,(_t,gt)=>{gt(_t,{class:"ip-menu-item",onSelect:()=>E(e(i).key,e(He).type),children:(At,pn)=>{var Ft=tr(),Pt=Ce(Ft),Xt=x(Pt);{var $t=Le=>{mt(Le,{size:13})},ea=Le=>{yt(Le,{size:13})},ta=Le=>{wt(Le,{size:13})},aa=Le=>{bt(Le,{size:13})};be(Xt,Le=>{e(He).type==="text"?Le($t):e(He).type==="date"?Le(ea,1):e(He).type==="status"?Le(ta,2):e(He).type==="wikilink"&&Le(aa,3)})}p(Pt);var Rt=Y(Pt,2),ra=x(Rt,!0);p(Rt);var na=Y(Rt,2);{var ia=Le=>{var Dt=er(),sa=x(Dt);ka(sa,{size:12}),p(Dt),g(Le,Dt)};be(na,Le=>{e(i).type===e(He).type&&Le(ia)})}he(()=>ve(ra,e(He).label)),g(At,Ft)},$$slots:{default:!0}})}),g(lt,pt)});var ot=Y(St,2);Ke(ot,()=>ya,(lt,He)=>{He(lt,{class:"ip-menu-sep"})});var Gt=Y(ot,2);Ke(Gt,()=>It,(lt,He)=>{He(lt,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>q(e(i).key),children:(pt,Mt)=>{var _t=ar(),gt=Ce(_t),At=x(gt);ba(At,{size:13}),p(gt),ze(2),g(pt,_t)},$$slots:{default:!0}})}),g(st,Te)},$$slots:{default:!0}})}),g(ae,Ae)},$$slots:{default:!0}})}),g(ne,me)},$$slots:{default:!0}})}),g(z,F)},h=z=>{var F=Be(),j=Ce(F);{var Q=ue=>{yt(ue,{size:14})},ge=ue=>{wt(ue,{size:14})},ne=ue=>{bt(ue,{size:14})},fe=ue=>{Qt(ue,{size:14})},me=ue=>{mt(ue,{size:14})};be(j,ue=>{e(i).type==="date"?ue(Q):e(i).type==="status"?ue(ge,1):e(i).type==="wikilink"?ue(ne,2):e(i).type==="badge"?ue(fe,3):ue(me,!1)})}g(z,F)};be(s,z=>{u()&&e(i).type!=="badge"?z(C):z(h,!1)})}p(O);var I=Y(O,2),se=x(I,!0);p(I);var J=Y(I,2),te=x(J);{var V=z=>{var F=ir();dt(F),Fa(F,j=>a?.(j)),he(j=>Ot(F,j),[()=>R(e(i))]),at("blur",F,j=>{const Q=j.currentTarget.value;Q!==R(e(i))&&t.onedit?.(e(i).key,Q),_(w,null)}),Ve("keydown",F,j=>{j.key==="Enter"?j.currentTarget.blur():j.key==="Escape"&&(j.currentTarget.value=R(e(i)),_(w,null))}),g(z,F)},xe=z=>{var F=or(),j=x(F),Q=x(j);let ge;var ne=Y(Q,2),fe=x(ne,!0);p(ne),p(j);var me=Y(j,2);Me(me,21,()=>d,Ne,(ue,Re)=>{{let ie=De(()=>R(e(i))===e(Re)?"selected":"");Fe(ue,{variant:"ghost",get class(){return`ip-status-option ${e(ie)??""}`},onclick:()=>l(e(i).key,e(Re)),children:(B,ae)=>{var we=sr(),Ae=Ce(we);let qe;var Oe=Y(Ae);he($e=>{qe=et(Ae,"",qe,$e),ve(Oe,` ${e(Re)??""}`)},[()=>({background:c(e(Re))})]),g(B,we)},$$slots:{default:!0}})}}),p(me),p(F),he((ue,Re)=>{ge=et(Q,"",ge,ue),ve(fe,Re)},[()=>({background:c(R(e(i)))}),()=>R(e(i))]),Ve("click",F,ue=>ue.stopPropagation()),g(z,F)},K=z=>{var F=dr(),j=x(F),Q=x(j,!0);p(j);var ge=Y(j,2),ne=x(ge),fe=x(ne);Fe(fe,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:pe,children:(ae,we)=>{$a(ae,{size:14})},$$slots:{default:!0}});var me=Y(fe,2),ue=x(me);p(me);var Re=Y(me,2);Fe(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:b,children:(ae,we)=>{xa(ae,{size:14})},$$slots:{default:!0}}),p(ne);var ie=Y(ne,2);Me(ie,21,()=>de,Ne,(ae,we)=>{var Ae=lr(),qe=x(Ae,!0);p(Ae),he(()=>ve(qe,e(we))),g(ae,Ae)}),p(ie);var B=Y(ie,2);Me(B,17,()=>ee(e(oe),e(G)),Ne,(ae,we)=>{var Ae=ur();Me(Ae,21,()=>e(we),Ne,(qe,Oe)=>{{let $e=De(()=>e(Oe).outside?"outside":""),st=De(()=>le(e(Oe))?"today":""),ht=De(()=>ke(e(Oe),R(e(i)))?"selected":"");Fe(qe,{variant:"ghost",get class(){return`ip-cal-day ${e($e)??""} ${e(st)??""} ${e(ht)??""}`},onclick:()=>m(e(i).key,e(Oe)),children:(Te,St)=>{ze();var ot=tt();he(()=>ve(ot,e(Oe).day)),g(Te,ot)},$$slots:{default:!0}})}}),p(Ae),g(ae,Ae)}),p(ge),p(F),he(ae=>{ve(Q,ae),ve(ue,`${Se[e(G)]??""} ${e(oe)??""}`)},[()=>H(R(e(i)))]),Ve("click",F,ae=>ae.stopPropagation()),g(z,F)},ye=z=>{{let F=De(()=>Array.isArray(e(i).value));Na(z,{get value(){return e(i).value},get multi(){return e(F)},onselect:j=>{t.onedit?.(e(i).key,j),_(w,null)},oncancel:()=>{_(w,null)}})}},ce=z=>{var F=Be(),j=Ce(F);{var Q=ie=>{var B=cr(),ae=x(B,!0);p(B),he(we=>ve(ae,we),[()=>R(e(i))]),g(ie,B)},ge=ie=>{var B=fr();Me(B,21,()=>Array.isArray(e(i).value)?e(i).value:[e(i).value],Ne,(ae,we)=>{Fe(ae,{variant:"ghost",class:"ip-wikilink-chip",onclick:Ae=>{Ae.stopPropagation(),L(e(we))},children:(Ae,qe)=>{ze();var Oe=tt();he(()=>ve(Oe,e(we))),g(Ae,Oe)},$$slots:{default:!0}})}),p(B),g(ie,B)},ne=ie=>{var B=vr(),ae=x(B);let we;var Ae=Y(ae,2),qe=x(Ae,!0);p(Ae),p(B),he((Oe,$e)=>{we=et(ae,"",we,Oe),ve(qe,$e)},[()=>({background:c(R(e(i)))}),()=>R(e(i))]),g(ie,B)},fe=ie=>{var B=hr(),ae=x(B,!0);p(B),he(we=>ve(ae,we),[()=>H(R(e(i)))]),g(ie,B)},me=ie=>{var B=pr(),ae=x(B,!0);p(B),he((we,Ae)=>{pa(B,"href",we),ve(ae,Ae)},[()=>R(e(i)),()=>R(e(i))]),Ve("click",B,we=>we.stopPropagation()),g(ie,B)},ue=De(()=>D(R(e(i)))),Re=ie=>{var B=_r(),ae=x(B,!0);p(B),he(we=>ve(ae,we),[()=>R(e(i))]),g(ie,B)};be(j,ie=>{e(i).type==="badge"?ie(Q):e(i).type==="wikilink"?ie(ge,1):e(i).type==="status"?ie(ne,2):e(i).type==="date"?ie(fe,3):e(ue)?ie(me,4):ie(Re,!1)})}g(z,F)};be(te,z=>{e(M)&&e(i).type==="text"?z(V):e(M)&&e(i).type==="status"?z(xe,1):e(M)&&e(i).type==="date"?z(K,2):e(M)&&e(i).type==="wikilink"?z(ye,3):z(ce,!1)})}p(J),p(U),he(()=>{X=it(U,1,"ip-row svelte-x7sio8",null,X,{"ip-focused":e(M)}),ve(se,e(i).key)}),Ve("click",O,z=>z.stopPropagation()),Ve("click",J,z=>{z.stopPropagation(),r(e(i))}),g(n,U)});var re=Y(T,2);{var N=n=>{var i=mr(),M=x(i),U=x(M);Et(U,{size:14}),p(M);var X=Y(M,2),O=x(X);dt(O),Ct(O,s=>_(P,s),()=>e(P)),p(X),ze(2),p(i),Ve("keydown",O,f),at("blur",O,y),Zt(O,()=>e(S),s=>_(S,s)),g(n,i)},$=n=>{Fe(n,{variant:"ghost",class:"ip-add-btn",onclick:i=>{i.stopPropagation(),_e()},children:(i,M)=>{var U=yr(),X=Ce(U);Et(X,{size:14}),ze(2),g(i,U)},$$slots:{default:!0}})};be(re,n=>{e(A)?n(N):u()&&n($,1)})}p(v),g(Z,v),Je()}Lt(["click","keydown"]);var kr=W('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),xr=W('<div class="cursor-overlay svelte-ok7wy5"></div>'),Er=W('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function Cr(Z,t){Ye(t,!0);let u=je(t,"readonly",3,!0),o=je(t,"resetKey",3,0);const d=da("theme");let w,A=null,S=null,P=Pe(""),c=null,L=Pe(rt([])),R=null,D=t.content;function H(le,ke){return le.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:ke?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:ke?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:ke})}async function oe(){A&&(A.destroy(),A=null),S&&(S.destroy(),S=null),_(L,[],!0);const{EditorState:le,Transaction:ke}=await We(async()=>{const{EditorState:n,Transaction:i}=await import("../chunks/CX_61fY8.js");return{EditorState:n,Transaction:i}},[],import.meta.url);c=ke;const{EditorView:pe,keymap:b,ViewPlugin:k}=await We(async()=>{const{EditorView:n,keymap:i,ViewPlugin:M}=await import("../chunks/DnL9f0lc.js").then(U=>U.i);return{EditorView:n,keymap:i,ViewPlugin:M}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await We(async()=>{const{markdown:n}=await import("../chunks/CscoF-YL.js");return{markdown:n}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:r,HighlightStyle:l}=await We(async()=>{const{syntaxHighlighting:n,HighlightStyle:i}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:n,HighlightStyle:i}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:m,defaultKeymap:E,historyKeymap:q}=await We(async()=>{const{history:n,defaultKeymap:i,historyKeymap:M}=await import("../chunks/CWQRQXxy.js");return{history:n,defaultKeymap:i,historyKeymap:M}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:_e}=await We(async()=>{const{tags:n}=await import("../chunks/C7VoTosa.js").then(i=>i.i);return{tags:n}},[],import.meta.url),{livePreviewPlugin:Ee,livePreviewTheme:y}=await We(async()=>{const{livePreviewPlugin:n,livePreviewTheme:i}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:n,livePreviewTheme:i}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),f=d.current==="dark",v=H(pe,f),T=l.define([{tag:_e.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),re=[a(),v,r(T),Ee,y,pe.lineWrapping];u()&&re.push(le.readOnly.of(!0));let N=!1;if(t.cursorDocName&&!u())try{let K=function(){if(!A||!h){_(L,[],!0);return}const z=h.awareness,F=h.ytext,j=F.doc;if(!j){_(L,[],!0);return}const Q=[],ge=A.dom.getBoundingClientRect();z.getStates().forEach((ne,fe)=>{if(fe===xe)return;const me=ne.cursor;if(!me?.head)return;const{name:ue="Anonymous",color:Re="#e05050"}=ne.user||{};let ie;try{ie=s.createRelativePositionFromJSON(me.head)}catch{return}const B=s.createAbsolutePositionFromRelativePosition(ie,j);if(!B||B.type!==F)return;const ae=A.coordsAtPos(Math.min(B.index,A.state.doc.length));ae&&Q.push({id:fe,name:ue,color:Re,top:ae.top-ge.top,left:ae.left-ge.left,height:ae.bottom-ae.top})}),_(L,Q,!0)},ye=function(){R&&cancelAnimationFrame(R),R=requestAnimationFrame(()=>{R=null,K()})},ce=function({added:z,updated:F,removed:j}){[...z,...F,...j].some(ge=>ge!==xe)&&ye()};const{createCollabSession:n}=await We(async()=>{const{createCollabSession:z}=await import("../chunks/CIgxv4dO.js");return{createCollabSession:z}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17]),import.meta.url),{ySync:i,ySyncFacet:M,YSyncConfig:U,yUndoManagerKeymap:X}=await We(async()=>{const{ySync:z,ySyncFacet:F,YSyncConfig:j,yUndoManagerKeymap:Q}=await import("../chunks/i9c_RUF6.js");return{ySync:z,ySyncFacet:F,YSyncConfig:j,yUndoManagerKeymap:Q}},__vite__mapDeps([18,9,0,1]),import.meta.url),{auth:O}=await We(async()=>{const{auth:z}=await import("../chunks/BlYD-5Z_.js").then(F=>F.b);return{auth:z}},__vite__mapDeps([16,11,15]),import.meta.url),s=await We(()=>import("../chunks/CLFba8FK.js").then(z=>z.A),[],import.meta.url),C=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",h=n(t.cursorDocName,{name:O.user?.displayName??"Anonymous",color:C,colorLight:C+"33"}),I=new s.UndoManager(h.ytext,{captureTimeout:500}),{yUndoManagerFacet:se,yUndoManager:J,YUndoManagerConfig:te}=await We(async()=>{const{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:j}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:j}},__vite__mapDeps([18,9,0,1]),import.meta.url),V=new U(h.ytext,h.awareness);re.push(M.of(V),i,se.of(new te(I)),J,b.of(X)),re.push(k.define(z=>{function F(){const j=z.state.selection.main,Q=h.ytext,ge=s.createRelativePositionFromTypeIndex(Q,j.anchor),ne=s.createRelativePositionFromTypeIndex(Q,j.head);h.awareness.setLocalStateField("cursor",{anchor:s.relativePositionToJSON(ge),head:s.relativePositionToJSON(ne)})}return F(),{update(j){(j.selectionSet||j.docChanged)&&F()}}}));const xe=h.ydoc.clientID;h.awareness.on("change",ce),re.push(k.define(()=>({update(z){(z.docChanged||z.geometryChanged||z.viewportChanged)&&ye()},destroy(){h.awareness.off("change",ce)}}))),S=h,N=!0}catch(n){console.warn("Yjs collab setup failed, falling back to solo editing:",n)}if(!u()&&!N?(re.push(m({newGroupDelay:500})),re.push(b.of([...E,...q]))):!u()&&N&&re.push(b.of(E)),t.onchange)if(N){const n=Date.now();re.push(pe.updateListener.of(i=>{if(i.docChanged&&Date.now()-n>1e3&&i.transactions.some(U=>U.isUserEvent("input")||U.isUserEvent("delete")||U.isUserEvent("move")||U.isUserEvent("undo")||U.isUserEvent("redo"))){const U=i.state.doc.toString();D=U,t.onchange(U)}}))}else re.push(pe.updateListener.of(n=>{if(n.docChanged){const i=n.state.doc.toString();D=i,t.onchange(i)}}));re.push(pe.domEventHandlers({click(n){const i=n.target;if(t.onwikilinkclick){const U=i.closest(".cm-live-wikilink");if(U){n.preventDefault();const X=U.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return X&&t.onwikilinkclick(X),!0}}const M=i.closest(".cm-live-link");if(M){const U=M.getAttribute("data-href");if(U)return n.preventDefault(),window.open(U,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&re.push(b.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const $=le.create({doc:N?"":t.content,extensions:re});A=new pe({state:$,parent:w}),D=N?"":t.content,_(P,t.cursorDocName??"",!0)}ca(()=>{oe()}),nt(()=>{t.cursorDocName&&e(P)&&t.cursorDocName!==e(P)&&oe()}),nt(()=>{if(o(),A&&!S&&t.content!==D){D=t.content;const le=w.closest(".document-scroll"),ke=le?.scrollTop??0;A.dispatch({changes:{from:0,to:A.state.doc.length,insert:t.content},...c?{annotations:c.addToHistory.of(!1)}:{}}),le&&requestAnimationFrame(()=>{le.scrollTop=ke})}}),Jt(()=>{R&&cancelAnimationFrame(R),S?.destroy(),S=null,A?.destroy()});var G=Er(),de=x(G);Ct(de,le=>w=le,()=>w);var Se=Y(de,2);{var ee=le=>{var ke=xr();Me(ke,21,()=>e(L),pe=>pe.id,(pe,b)=>{var k=kr(),a=x(k),r=x(a,!0);p(a),p(k),he(()=>{et(k,`top: ${e(b).top??""}px; left: ${e(b).left??""}px; height: ${e(b).height??""}px; --cursor-color: ${e(b).color??""};`),et(a,`background-color: ${e(b).color??""};`),ve(r,e(b).name)}),g(pe,k)}),p(ke),g(le,ke)};be(Se,le=>{e(L).length>0&&le(ee)})}p(G),g(Z,G),Je()}var kt={exports:{}};var Sr=kt.exports,Nt;function Ar(){return Nt||(Nt=1,(function(Z,t){((u,o)=>{Z.exports=o()})(Sr,function u(){var o=typeof self<"u"?self:typeof window<"u"?window:o!==void 0?o:{},d,w=!o.document&&!!o.postMessage,A=o.IS_PAPA_WORKER||!1,S={},P=0,c={};function L(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(r){var l=pe(r);l.chunkSize=parseInt(l.chunkSize),r.step||r.chunk||(l.chunkSize=null),this._handle=new G(l),(this._handle.streamer=this)._config=l}).call(this,a),this.parseChunk=function(r,l){var m=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<m){let q=this._config.newline;q||(E=this._config.quoteChar||'"',q=this._handle.guessLineEndings(r,E)),r=[...r.split(q).slice(m)].join(q)}this.isFirstChunk&&k(this._config.beforeFirstChunk)&&(E=this._config.beforeFirstChunk(r))!==void 0&&(r=E),this.isFirstChunk=!1,this._halted=!1;var m=this._partialLine+r,E=(this._partialLine="",this._handle.parse(m,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(r=E.meta.cursor,m=(this._finished||(this._partialLine=m.substring(r-this._baseIndex),this._baseIndex=r),E&&E.data&&(this._rowCount+=E.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),A)o.postMessage({results:E,workerId:c.WORKER_ID,finished:m});else if(k(this._config.chunk)&&!l){if(this._config.chunk(E,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=E=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(E.data),this._completeResults.errors=this._completeResults.errors.concat(E.errors),this._completeResults.meta=E.meta),this._completed||!m||!k(this._config.complete)||E&&E.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),m||E&&E.meta.paused||this._nextChunk(),E}this._halted=!0},this._sendError=function(r){k(this._config.error)?this._config.error(r):A&&this._config.error&&o.postMessage({workerId:c.WORKER_ID,error:r,finished:!1})}}function R(a){var r;(a=a||{}).chunkSize||(a.chunkSize=c.RemoteChunkSize),L.call(this,a),this._nextChunk=w?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(l){this._input=l,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),w||(r.onload=b(this._chunkLoaded,this),r.onerror=b(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!w),this._config.downloadRequestHeaders){var l,m=this._config.downloadRequestHeaders;for(l in m)r.setRequestHeader(l,m[l])}var E;this._config.chunkSize&&(E=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+E));try{r.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}w&&r.status===0&&this._chunkError()}},this._chunkLoaded=function(){r.readyState===4&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(l=>(l=l.getResponseHeader("Content-Range"))!==null?parseInt(l.substring(l.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)))},this._chunkError=function(l){l=r.statusText||l,this._sendError(new Error(l))}}function D(a){(a=a||{}).chunkSize||(a.chunkSize=c.LocalChunkSize),L.call(this,a);var r,l,m=typeof FileReader<"u";this.stream=function(E){this._input=E,l=E.slice||E.webkitSlice||E.mozSlice,m?((r=new FileReader).onload=b(this._chunkLoaded,this),r.onerror=b(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var E=this._input,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),E=l.call(E,this._start,q)),r.readAsText(E,this._config.encoding));m||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(E){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(E.target.result)},this._chunkError=function(){this._sendError(r.error)}}function H(a){var r;L.call(this,a=a||{}),this.stream=function(l){return r=l,this._nextChunk()},this._nextChunk=function(){var l,m;if(!this._finished)return l=this._config.chunkSize,r=l?(m=r.substring(0,l),r.substring(l)):(m=r,""),this._finished=!r,this.parseChunk(m)}}function oe(a){L.call(this,a=a||{});var r=[],l=!0,m=!1;this.pause=function(){L.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){L.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(E){this._input=E,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){m&&r.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):l=!0},this._streamData=b(function(E){try{r.push(typeof E=="string"?E:E.toString(this._config.encoding)),l&&(l=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(q){this._streamError(q)}},this),this._streamError=b(function(E){this._streamCleanUp(),this._sendError(E)},this),this._streamEnd=b(function(){this._streamCleanUp(),m=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function G(a){var r,l,m,E,q=Math.pow(2,53),_e=-q,Ee=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,y=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,f=this,v=0,T=0,re=!1,N=!1,$=[],n={data:[],errors:[],meta:{}};function i(O){return a.skipEmptyLines==="greedy"?O.join("").trim()==="":O.length===1&&O[0].length===0}function M(){if(n&&m&&(X("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),m=!1),a.skipEmptyLines&&(n.data=n.data.filter(function(h){return!i(h)})),U()){let h=function(I,se){k(a.transformHeader)&&(I=a.transformHeader(I,se)),$.push(I)};if(n)if(Array.isArray(n.data[0])){for(var O=0;U()&&O<n.data.length;O++)n.data[O].forEach(h);n.data.splice(0,1)}else n.data.forEach(h)}function s(h,I){for(var se=a.header?{}:[],J=0;J<h.length;J++){var te=J,V=h[J],V=((xe,K)=>(ye=>(a.dynamicTypingFunction&&a.dynamicTyping[ye]===void 0&&(a.dynamicTyping[ye]=a.dynamicTypingFunction(ye)),(a.dynamicTyping[ye]||a.dynamicTyping)===!0))(xe)?K==="true"||K==="TRUE"||K!=="false"&&K!=="FALSE"&&((ye=>{if(Ee.test(ye)&&(ye=parseFloat(ye),_e<ye&&ye<q))return 1})(K)?parseFloat(K):y.test(K)?new Date(K):K===""?null:K):K)(te=a.header?J>=$.length?"__parsed_extra":$[J]:te,V=a.transform?a.transform(V,te):V);te==="__parsed_extra"?(se[te]=se[te]||[],se[te].push(V)):se[te]=V}return a.header&&(J>$.length?X("FieldMismatch","TooManyFields","Too many fields: expected "+$.length+" fields but parsed "+J,T+I):J<$.length&&X("FieldMismatch","TooFewFields","Too few fields: expected "+$.length+" fields but parsed "+J,T+I)),se}var C;n&&(a.header||a.dynamicTyping||a.transform)&&(C=1,!n.data.length||Array.isArray(n.data[0])?(n.data=n.data.map(s),C=n.data.length):n.data=s(n.data,0),a.header&&n.meta&&(n.meta.fields=$),T+=C)}function U(){return a.header&&$.length===0}function X(O,s,C,h){O={type:O,code:s,message:C},h!==void 0&&(O.row=h),n.errors.push(O)}k(a.step)&&(E=a.step,a.step=function(O){n=O,U()?M():(M(),n.data.length!==0&&(v+=O.data.length,a.preview&&v>a.preview?l.abort():(n.data=n.data[0],E(n,f))))}),this.parse=function(O,s,C){var h=a.quoteChar||'"',h=(a.newline||(a.newline=this.guessLineEndings(O,h)),m=!1,a.delimiter?k(a.delimiter)&&(a.delimiter=a.delimiter(O),n.meta.delimiter=a.delimiter):((h=((I,se,J,te,V)=>{var xe,K,ye,ce;V=V||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var z=0;z<V.length;z++){for(var F,j=V[z],Q=0,ge=0,ne=0,fe=(ye=void 0,new Se({comments:te,delimiter:j,newline:se,preview:10}).parse(I)),me=0;me<fe.data.length;me++)J&&i(fe.data[me])?ne++:(F=fe.data[me].length,ge+=F,ye===void 0?ye=F:0<F&&(Q+=Math.abs(F-ye),ye=F));0<fe.data.length&&(ge/=fe.data.length-ne),(K===void 0||Q<=K)&&(ce===void 0||ce<ge)&&1.99<ge&&(K=Q,xe=j,ce=ge)}return{successful:!!(a.delimiter=xe),bestDelimiter:xe}})(O,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=h.bestDelimiter:(m=!0,a.delimiter=c.DefaultDelimiter),n.meta.delimiter=a.delimiter),pe(a));return a.preview&&a.header&&h.preview++,r=O,l=new Se(h),n=l.parse(r,s,C),M(),re?{meta:{paused:!0}}:n||{meta:{paused:!1}}},this.paused=function(){return re},this.pause=function(){re=!0,l.abort(),r=k(a.chunk)?"":r.substring(l.getCharIndex())},this.resume=function(){f.streamer._halted?(re=!1,f.streamer.parseChunk(r,!0)):setTimeout(f.resume,3)},this.aborted=function(){return N},this.abort=function(){N=!0,l.abort(),n.meta.aborted=!0,k(a.complete)&&a.complete(n),r=""},this.guessLineEndings=function(I,h){I=I.substring(0,1048576);var h=new RegExp(de(h)+"([^]*?)"+de(h),"gm"),C=(I=I.replace(h,"")).split("\r"),h=I.split(`
|
|
3
|
+
`),I=1<h.length&&h[0].length<C[0].length;if(C.length===1||I)return`
|
|
4
|
+
`;for(var se=0,J=0;J<C.length;J++)C[J][0]===`
|
|
5
|
+
`&&se++;return se>=C.length/2?`\r
|
|
6
|
+
`:"\r"}}function de(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(a){var r=(a=a||{}).delimiter,l=a.newline,m=a.comments,E=a.step,q=a.preview,_e=a.fastMode,Ee=null,y=!1,f=a.quoteChar==null?'"':a.quoteChar,v=f;if(a.escapeChar!==void 0&&(v=a.escapeChar),(typeof r!="string"||-1<c.BAD_DELIMITERS.indexOf(r))&&(r=","),m===r)throw new Error("Comment character same as delimiter");m===!0?m="#":(typeof m!="string"||-1<c.BAD_DELIMITERS.indexOf(m))&&(m=!1),l!==`
|
|
7
|
+
`&&l!=="\r"&&l!==`\r
|
|
8
|
+
`&&(l=`
|
|
9
|
+
`);var T=0,re=!1;this.parse=function(N,$,n){if(typeof N!="string")throw new Error("Input must be a string");var i=N.length,M=r.length,U=l.length,X=m.length,O=k(E),s=[],C=[],h=[],I=T=0;if(!N)return Q();if(_e||_e!==!1&&N.indexOf(f)===-1){for(var se=N.split(l),J=0;J<se.length;J++){if(h=se[J],T+=h.length,J!==se.length-1)T+=l.length;else if(n)return Q();if(!m||h.substring(0,X)!==m){if(O){if(s=[],ce(h.split(r)),ge(),re)return Q()}else ce(h.split(r));if(q&&q<=J)return s=s.slice(0,q),Q(!0)}}return Q()}for(var te=N.indexOf(r,T),V=N.indexOf(l,T),xe=new RegExp(de(v)+de(f),"g"),K=N.indexOf(f,T);;)if(N[T]===f)for(K=T,T++;;){if((K=N.indexOf(f,K+1))===-1)return n||C.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:s.length,index:T}),F();if(K===i-1)return F(N.substring(T,K).replace(xe,f));if(f===v&&N[K+1]===v)K++;else if(f===v||K===0||N[K-1]!==v){te!==-1&&te<K+1&&(te=N.indexOf(r,K+1));var ye=z((V=V!==-1&&V<K+1?N.indexOf(l,K+1):V)===-1?te:Math.min(te,V));if(N.substr(K+1+ye,M)===r){h.push(N.substring(T,K).replace(xe,f)),N[T=K+1+ye+M]!==f&&(K=N.indexOf(f,T)),te=N.indexOf(r,T),V=N.indexOf(l,T);break}if(ye=z(V),N.substring(K+1+ye,K+1+ye+U)===l){if(h.push(N.substring(T,K).replace(xe,f)),j(K+1+ye+U),te=N.indexOf(r,T),K=N.indexOf(f,T),O&&(ge(),re))return Q();if(q&&s.length>=q)return Q(!0);break}C.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:s.length,index:T}),K++}}else if(m&&h.length===0&&N.substring(T,T+X)===m){if(V===-1)return Q();T=V+U,V=N.indexOf(l,T),te=N.indexOf(r,T)}else if(te!==-1&&(te<V||V===-1))h.push(N.substring(T,te)),T=te+M,te=N.indexOf(r,T);else{if(V===-1)break;if(h.push(N.substring(T,V)),j(V+U),O&&(ge(),re))return Q();if(q&&s.length>=q)return Q(!0)}return F();function ce(ne){s.push(ne),I=T}function z(ne){var fe=0;return fe=ne!==-1&&(ne=N.substring(K+1,ne))&&ne.trim()===""?ne.length:fe}function F(ne){return n||(ne===void 0&&(ne=N.substring(T)),h.push(ne),T=i,ce(h),O&&ge()),Q()}function j(ne){T=ne,ce(h),h=[],V=N.indexOf(l,T)}function Q(ne){if(a.header&&!$&&s.length&&!y){var fe=s[0],me=Object.create(null),ue=new Set(fe);let Re=!1;for(let ie=0;ie<fe.length;ie++){let B=fe[ie];if(me[B=k(a.transformHeader)?a.transformHeader(B,ie):B]){let ae,we=me[B];for(;ae=B+"_"+we,we++,ue.has(ae););ue.add(ae),fe[ie]=ae,me[B]++,Re=!0,(Ee=Ee===null?{}:Ee)[ae]=B}else me[B]=1,fe[ie]=B;ue.add(B)}Re&&console.warn("Duplicate headers found and renamed."),y=!0}return{data:s,errors:C,meta:{delimiter:r,linebreak:l,aborted:re,truncated:!!ne,cursor:I+($||0),renamedHeaders:Ee}}}function ge(){E(Q()),s=[],C=[]}},this.abort=function(){re=!0},this.getCharIndex=function(){return T}}function ee(a){var r=a.data,l=S[r.workerId],m=!1;if(r.error)l.userError(r.error,r.file);else if(r.results&&r.results.data){var E={abort:function(){m=!0,le(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:ke,resume:ke};if(k(l.userStep)){for(var q=0;q<r.results.data.length&&(l.userStep({data:r.results.data[q],errors:r.results.errors,meta:r.results.meta},E),!m);q++);delete r.results}else k(l.userChunk)&&(l.userChunk(r.results,E,r.file),delete r.results)}r.finished&&!m&&le(r.workerId,r.results)}function le(a,r){var l=S[a];k(l.userComplete)&&l.userComplete(r),l.terminate(),delete S[a]}function ke(){throw new Error("Not implemented.")}function pe(a){if(typeof a!="object"||a===null)return a;var r,l=Array.isArray(a)?[]:{};for(r in a)l[r]=pe(a[r]);return l}function b(a,r){return function(){a.apply(r,arguments)}}function k(a){return typeof a=="function"}return c.parse=function(a,r){var l=(r=r||{}).dynamicTyping||!1;if(k(l)&&(r.dynamicTypingFunction=l,l={}),r.dynamicTyping=l,r.transform=!!k(r.transform)&&r.transform,!r.worker||!c.WORKERS_SUPPORTED)return l=null,c.NODE_STREAM_INPUT,typeof a=="string"?(a=(m=>m.charCodeAt(0)!==65279?m:m.slice(1))(a),l=new(r.download?R:H)(r)):a.readable===!0&&k(a.read)&&k(a.on)?l=new oe(r):(o.File&&a instanceof File||a instanceof Object)&&(l=new D(r)),l.stream(a);(l=(()=>{var m;return!!c.WORKERS_SUPPORTED&&(m=(()=>{var E=o.URL||o.webkitURL||null,q=u.toString();return c.BLOB_URL||(c.BLOB_URL=E.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",q,")();"],{type:"text/javascript"})))})(),(m=new o.Worker(m)).onmessage=ee,m.id=P++,S[m.id]=m)})()).userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=k(r.step),r.chunk=k(r.chunk),r.complete=k(r.complete),r.error=k(r.error),delete r.worker,l.postMessage({input:a,config:r,workerId:l.id})},c.unparse=function(a,r){var l=!1,m=!0,E=",",q=`\r
|
|
10
|
+
`,_e='"',Ee=_e+_e,y=!1,f=null,v=!1,T=((()=>{if(typeof r=="object"){if(typeof r.delimiter!="string"||c.BAD_DELIMITERS.filter(function($){return r.delimiter.indexOf($)!==-1}).length||(E=r.delimiter),typeof r.quotes!="boolean"&&typeof r.quotes!="function"&&!Array.isArray(r.quotes)||(l=r.quotes),typeof r.skipEmptyLines!="boolean"&&typeof r.skipEmptyLines!="string"||(y=r.skipEmptyLines),typeof r.newline=="string"&&(q=r.newline),typeof r.quoteChar=="string"&&(_e=r.quoteChar),typeof r.header=="boolean"&&(m=r.header),Array.isArray(r.columns)){if(r.columns.length===0)throw new Error("Option columns is empty");f=r.columns}r.escapeChar!==void 0&&(Ee=r.escapeChar+_e),r.escapeFormulae instanceof RegExp?v=r.escapeFormulae:typeof r.escapeFormulae=="boolean"&&r.escapeFormulae&&(v=/^[=+\-@\t\r].*$/)}})(),new RegExp(de(_e),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return re(null,a,y);if(typeof a[0]=="object")return re(f||Object.keys(a[0]),a,y)}else if(typeof a=="object")return typeof a.data=="string"&&(a.data=JSON.parse(a.data)),Array.isArray(a.data)&&(a.fields||(a.fields=a.meta&&a.meta.fields||f),a.fields||(a.fields=Array.isArray(a.data[0])?a.fields:typeof a.data[0]=="object"?Object.keys(a.data[0]):[]),Array.isArray(a.data[0])||typeof a.data[0]=="object"||(a.data=[a.data])),re(a.fields||[],a.data||[],y);throw new Error("Unable to serialize unrecognized input");function re($,n,i){var M="",U=(typeof $=="string"&&($=JSON.parse($)),typeof n=="string"&&(n=JSON.parse(n)),Array.isArray($)&&0<$.length),X=!Array.isArray(n[0]);if(U&&m){for(var O=0;O<$.length;O++)0<O&&(M+=E),M+=N($[O],O);0<n.length&&(M+=q)}for(var s=0;s<n.length;s++){var C=(U?$:n[s]).length,h=!1,I=U?Object.keys(n[s]).length===0:n[s].length===0;if(i&&!U&&(h=i==="greedy"?n[s].join("").trim()==="":n[s].length===1&&n[s][0].length===0),i==="greedy"&&U){for(var se=[],J=0;J<C;J++){var te=X?$[J]:J;se.push(n[s][te])}h=se.join("").trim()===""}if(!h){for(var V=0;V<C;V++){0<V&&!I&&(M+=E);var xe=U&&X?$[V]:V;M+=N(n[s][xe],V)}s<n.length-1&&(!i||0<C&&!I)&&(M+=q)}}return M}function N($,n){var i,M;return $==null?"":$.constructor===Date?JSON.stringify($).slice(1,25):(M=!1,v&&typeof $=="string"&&v.test($)&&($="'"+$,M=!0),i=$.toString().replace(T,Ee),(M=M||l===!0||typeof l=="function"&&l($,n)||Array.isArray(l)&&l[n]||((U,X)=>{for(var O=0;O<X.length;O++)if(-1<U.indexOf(X[O]))return!0;return!1})(i,c.BAD_DELIMITERS)||-1<i.indexOf(E)||i.charAt(0)===" "||i.charAt(i.length-1)===" ")?_e+i+_e:i)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
11
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!w&&!!o.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=Se,c.ParserHandle=G,c.NetworkStreamer=R,c.FileStreamer=D,c.StringStreamer=H,c.ReadableStreamStreamer=oe,o.jQuery&&((d=o.jQuery).fn.parse=function(a){var r=a.config||{},l=[];return this.each(function(q){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&o.FileReader)||!this.files||this.files.length===0)return!0;for(var _e=0;_e<this.files.length;_e++)l.push({file:this.files[_e],inputElem:this,instanceConfig:d.extend({},r)})}),m(),this;function m(){if(l.length===0)k(a.complete)&&a.complete();else{var q,_e,Ee,y,f=l[0];if(k(a.before)){var v=a.before(f.file,f.inputElem);if(typeof v=="object"){if(v.action==="abort")return q="AbortError",_e=f.file,Ee=f.inputElem,y=v.reason,void(k(a.error)&&a.error({name:q},_e,Ee,y));if(v.action==="skip")return void E();typeof v.config=="object"&&(f.instanceConfig=d.extend(f.instanceConfig,v.config))}else if(v==="skip")return void E()}var T=f.instanceConfig.complete;f.instanceConfig.complete=function(re){k(T)&&T(re,f.file,f.inputElem),E()},c.parse(f.file,f.instanceConfig)}}function E(){l.splice(0,1),m()}}),A&&(o.onmessage=function(a){a=a.data,c.WORKER_ID===void 0&&a&&(c.WORKER_ID=a.workerId),typeof a.input=="string"?o.postMessage({workerId:c.WORKER_ID,results:c.parse(a.input,a.config),finished:!0}):(o.File&&a.input instanceof File||a.input instanceof Object)&&(a=c.parse(a.input,a.config))&&o.postMessage({workerId:c.WORKER_ID,results:a,finished:!0})}),(R.prototype=Object.create(L.prototype)).constructor=R,(D.prototype=Object.create(L.prototype)).constructor=D,(H.prototype=Object.create(H.prototype)).constructor=H,(oe.prototype=Object.create(L.prototype)).constructor=oe,c})})(kt)),kt.exports}var Pr=Ar();const qt=Oa(Pr);var Rr=W('<span class="remote-cell-label svelte-63hltt"> </span>'),Dr=W('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),Tr=W('<span class="remote-cell-label svelte-63hltt"> </span>'),zr=W('<td><!> <input class="cell-input svelte-63hltt"/></td>'),Or=W('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),Lr=W("<!> <span>Add row</span>",1),Mr=W('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Fr(Z,t){Ye(t,!0);let u=je(t,"remoteCursors",19,()=>[]),o=Pe(rt([])),d=Pe(rt([])),w=Pe(void 0);function A(y){const f=qt.parse(y.trim(),{header:!1,skipEmptyLines:!0});f.data.length>0?(_(o,f.data[0],!0),_(d,f.data.slice(1),!0)):(_(o,[],!0),_(d,[],!0))}A(t.content),nt(()=>{A(t.content)});function S(){return qt.unparse([e(o),...e(d)])}function P(){const y=S();t.onchange?.(y)}function c(y,f,v){e(d)[y][f]=v,_(d,[...e(d)],!0),P()}function L(y,f){e(o)[y]=f,_(o,[...e(o)],!0),P()}function R(){_(d,[...e(d),e(o).map(()=>"")],!0),P(),G(e(d).length-1,0)}function D(y){_(d,e(d).filter((f,v)=>v!==y),!0),P()}function H(){const y=`col${e(o).length+1}`;_(o,[...e(o),y],!0),_(d,e(d).map(f=>[...f,""]),!0),P(),requestAnimationFrame(()=>{const f=e(w)?.querySelector(`thead th:nth-child(${e(o).length+1}) input`);f&&(f.focus(),f.select())})}function oe(y){e(o).length<=1||(_(o,e(o).filter((f,v)=>v!==y),!0),_(d,e(d).map(f=>f.filter((v,T)=>T!==y)),!0),P())}function G(y,f){requestAnimationFrame(()=>{if(!e(w))return;let v=null;y<0?v=e(w).querySelector(`thead th:nth-child(${f+2}) input`):v=e(w).querySelector(`tbody tr:nth-child(${y+1}) td:nth-child(${f+2}) input`),v&&(v.focus(),v.select())})}function de(y,f,v){if(y.key==="Tab"){y.preventDefault(),y.shiftKey?v>0?G(f,v-1):f>0?G(f-1,e(o).length-1):f===0&&G(-1,e(o).length-1):v<e(o).length-1?G(f,v+1):f<e(d).length-1?G(f+1,0):f===e(d).length-1&&R();return}if(y.key==="Enter"){y.preventDefault(),y.shiftKey?f>0?G(f-1,v):G(-1,v):f<e(d).length-1?G(f+1,v):R();return}if(y.key==="Escape"){y.target.blur();return}}function Se(y,f){if(y.key==="Tab"){y.preventDefault(),y.shiftKey?f>0&&G(-1,f-1):f<e(o).length-1?G(-1,f+1):e(d).length>0&&G(0,0);return}if(y.key==="Enter"){y.preventDefault(),e(d).length>0?G(0,f):R();return}if(y.key==="Escape"){y.target.blur();return}}function ee(y,f){return u().find(v=>v.row===y&&v.col===f)}function le(y,f){t.oncellselect?.(y,f)}function ke(y){(y.metaKey||y.ctrlKey)&&y.key==="s"&&(y.preventDefault(),t.onsave?.())}var pe=Mr(),b=x(pe),k=x(b),a=x(k),r=x(a),l=Y(x(r));Me(l,17,()=>e(o),Ne,(y,f,v)=>{const T=De(()=>ee(-1,v));var re=Dr();let N;var $=x(re);{var n=X=>{var O=Rr(),s=x(O,!0);p(O),he(()=>{et(O,`background-color: ${e(T).color??""}`),ve(s,e(T).name)}),g(X,O)};be($,X=>{e(T)&&X(n)})}var i=Y($,2);dt(i);var M=Y(i,2);{var U=X=>{Fe(X,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>oe(v),children:(O,s)=>{jt(O,{size:12})},$$slots:{default:!0}})};be(M,X=>{e(o).length>1&&X(U)})}p(re),he(()=>{et(re,e(T)?`--rc-color: ${e(T).color}`:""),N=it(re,1,"svelte-63hltt",null,N,{"remote-active":!!e(T)}),Ot(i,e(f))}),Ve("input",i,X=>L(v,X.currentTarget.value)),Ve("keydown",i,X=>Se(X,v)),at("focus",i,()=>le(-1,v)),g(y,re)});var m=Y(l),E=x(m);Fe(E,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:H,children:(y,f)=>{Et(y,{size:14})},$$slots:{default:!0}}),p(m),p(r),p(a);var q=Y(a);Me(q,21,()=>e(d),Ne,(y,f,v)=>{var T=Or(),re=x(T);re.textContent=v+1;var N=Y(re);Me(N,17,()=>e(f),Ne,(i,M,U)=>{const X=De(()=>ee(v,U));var O=zr();let s;var C=x(O);{var h=se=>{var J=Tr(),te=x(J,!0);p(J),he(()=>{et(J,`background-color: ${e(X).color??""}`),ve(te,e(X).name)}),g(se,J)};be(C,se=>{e(X)&&se(h)})}var I=Y(C,2);dt(I),p(O),he(()=>{et(O,e(X)?`--rc-color: ${e(X).color}`:""),s=it(O,1,"svelte-63hltt",null,s,{"remote-active":!!e(X)}),Ot(I,e(M))}),Ve("input",I,se=>c(v,U,se.currentTarget.value)),Ve("keydown",I,se=>de(se,v,U)),at("focus",I,()=>le(v,U)),g(i,O)});var $=Y(N),n=x($);Fe(n,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>D(v),children:(i,M)=>{jt(i,{size:12})},$$slots:{default:!0}}),p($),p(T),g(y,T)}),p(q),p(k),Ct(k,y=>_(w,y),()=>e(w)),p(b);var _e=Y(b,2),Ee=x(_e);Fe(Ee,{variant:"ghost",class:"add-row-btn",onclick:R,children:(y,f)=>{var v=Lr(),T=Ce(v);Et(T,{size:14}),ze(2),g(y,v)},$$slots:{default:!0}}),p(_e),p(pe),Ve("keydown",pe,ke),g(Z,pe),Je()}Lt(["keydown","input"]);const Ir=/^\d{4}-\d{2}-\d{2}/,jr=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),Ur=new Set(["entity_type","format"]),Vr=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Kr(Z,t){const u=[];for(const[o,d]of Object.entries(Z)){if(Vr.has(o)||d==null)continue;const w=Nr(o,d);w&&u.push(w)}return u}function Nr(Z,t){if(Ur.has(Z))return{key:Z,value:String(t).toUpperCase(),type:"badge"};if(Z==="status")return{key:Z,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const S=t.map(P=>Object.entries(P).map(([L,R])=>`${L}: ${R}`).join(", "));return{key:Z,value:S.join(" | "),type:"text"}}const d=t.map(String),w=d.some(S=>/^\[\[.+?\]\]$/.test(S)),A=d.map(S=>{const P=S.match(/^\[\[(.+?)\]\]$/);return P?P[1]:S});return w||A.every(S=>Wt(S))?{key:Z,value:A,type:"wikilink"}:{key:Z,value:d.join(", "),type:"text"}}const u=String(t),o=u.match(/^\[\[(.+?)\]\]$/);return o?{key:Z,value:o[1],type:"wikilink"}:Ir.test(u)?{key:Z,value:u,type:"date"}:jr.has(u.toLowerCase())?{key:Z,value:u,type:"status"}:Wt(u)&&!u.includes(" ")?{key:Z,value:u,type:"wikilink"}:{key:Z,value:u,type:"text"}}function Wt(Z){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(Z)&&Z.includes("-")}class qr{diff(t,u,o={}){let d;typeof o=="function"?(d=o,o={}):"callback"in o&&(d=o.callback);const w=this.castInput(t,o),A=this.castInput(u,o),S=this.removeEmpty(this.tokenize(w,o)),P=this.removeEmpty(this.tokenize(A,o));return this.diffWithOptionsObj(S,P,o,d)}diffWithOptionsObj(t,u,o,d){var w;const A=ee=>{if(ee=this.postProcess(ee,o),d){setTimeout(function(){d(ee)},0);return}else return ee},S=u.length,P=t.length;let c=1,L=S+P;o.maxEditLength!=null&&(L=Math.min(L,o.maxEditLength));const R=(w=o.timeout)!==null&&w!==void 0?w:1/0,D=Date.now()+R,H=[{oldPos:-1,lastComponent:void 0}];let oe=this.extractCommon(H[0],u,t,0,o);if(H[0].oldPos+1>=P&&oe+1>=S)return A(this.buildValues(H[0].lastComponent,u,t));let G=-1/0,de=1/0;const Se=()=>{for(let ee=Math.max(G,-c);ee<=Math.min(de,c);ee+=2){let le;const ke=H[ee-1],pe=H[ee+1];ke&&(H[ee-1]=void 0);let b=!1;if(pe){const a=pe.oldPos-ee;b=pe&&0<=a&&a<S}const k=ke&&ke.oldPos+1<P;if(!b&&!k){H[ee]=void 0;continue}if(!k||b&&ke.oldPos<pe.oldPos?le=this.addToPath(pe,!0,!1,0,o):le=this.addToPath(ke,!1,!0,1,o),oe=this.extractCommon(le,u,t,ee,o),le.oldPos+1>=P&&oe+1>=S)return A(this.buildValues(le.lastComponent,u,t))||!0;H[ee]=le,le.oldPos+1>=P&&(de=Math.min(de,ee-1)),oe+1>=S&&(G=Math.max(G,ee+1))}c++};if(d)(function ee(){setTimeout(function(){if(c>L||Date.now()>D)return d(void 0);Se()||ee()},0)})();else for(;c<=L&&Date.now()<=D;){const ee=Se();if(ee)return ee}}addToPath(t,u,o,d,w){const A=t.lastComponent;return A&&!w.oneChangePerToken&&A.added===u&&A.removed===o?{oldPos:t.oldPos+d,lastComponent:{count:A.count+1,added:u,removed:o,previousComponent:A.previousComponent}}:{oldPos:t.oldPos+d,lastComponent:{count:1,added:u,removed:o,previousComponent:A}}}extractCommon(t,u,o,d,w){const A=u.length,S=o.length;let P=t.oldPos,c=P-d,L=0;for(;c+1<A&&P+1<S&&this.equals(o[P+1],u[c+1],w);)c++,P++,L++,w.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return L&&!w.oneChangePerToken&&(t.lastComponent={count:L,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=P,c}equals(t,u,o){return o.comparator?o.comparator(t,u):t===u||!!o.ignoreCase&&t.toLowerCase()===u.toLowerCase()}removeEmpty(t){const u=[];for(let o=0;o<t.length;o++)t[o]&&u.push(t[o]);return u}castInput(t,u){return t}tokenize(t,u){return Array.from(t)}join(t){return t.join("")}postProcess(t,u){return t}get useLongestToken(){return!1}buildValues(t,u,o){const d=[];let w;for(;t;)d.push(t),w=t.previousComponent,delete t.previousComponent,t=w;d.reverse();const A=d.length;let S=0,P=0,c=0;for(;S<A;S++){const L=d[S];if(L.removed)L.value=this.join(o.slice(c,c+L.count)),c+=L.count;else{if(!L.added&&this.useLongestToken){let R=u.slice(P,P+L.count);R=R.map(function(D,H){const oe=o[c+H];return oe.length>D.length?oe:D}),L.value=this.join(R)}else L.value=this.join(u.slice(P,P+L.count));P+=L.count,L.added||(c+=L.count)}}return d}}const Ht="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Wr extends qr{tokenize(t){const u=new RegExp(`(\\r?\\n)|[${Ht}]+|[^\\S\\n\\r]+|[^${Ht}]`,"ug");return t.match(u)||[]}}const Hr=new Wr;function Br(Z,t,u){return Hr.diff(Z,t,u)}var Yr=W('<div class="dp-row svelte-1g4tvol"><div class="dp-icon svelte-1g4tvol"><!></div> <div class="dp-key svelte-1g4tvol"> </div> <div class="dp-value svelte-1g4tvol"><div class="dp-diff-old svelte-1g4tvol"><span> </span></div> <div class="dp-diff-new svelte-1g4tvol"><span> </span></div></div></div>'),Jr=W('<div class="diff-properties svelte-1g4tvol"></div>'),Zr=W('<span class="db-added"> </span>'),Qr=W('<span class="db-removed"> </span>'),Gr=W("<span> </span>"),Xr=W("<span> </span>"),$r=W('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function en(Z,t){Ye(t,!0);function u(D){if(D==null)return"";if(typeof D!="object")return String(D);const H=D;return String(H.name??H.title??H.label??H.id??JSON.stringify(H))}function o(D){return D==null?"":Array.isArray(D)?D.map(u).join(", "):typeof D=="object"?u(D):String(D)}const d=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Br(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var w=$r(),A=x(w);{var S=D=>{var H=Jr();Me(H,21,()=>t.refreshResult.diffs,Ne,(oe,G)=>{const de=De(()=>t.properties.find(v=>v.key===e(G).field));var Se=Yr(),ee=x(Se),le=x(ee);{var ke=v=>{yt(v,{size:14})},pe=v=>{wt(v,{size:14})},b=v=>{bt(v,{size:14})},k=v=>{Qt(v,{size:14})},a=v=>{mt(v,{size:14})};be(le,v=>{e(de)?.type==="date"?v(ke):e(de)?.type==="status"?v(pe,1):e(de)?.type==="wikilink"?v(b,2):e(de)?.type==="badge"?v(k,3):v(a,!1)})}p(ee);var r=Y(ee,2),l=x(r,!0);p(r);var m=Y(r,2),E=x(m),q=x(E),_e=x(q,!0);p(q),p(E);var Ee=Y(E,2),y=x(Ee),f=x(y,!0);p(y),p(Ee),p(m),p(Se),he((v,T)=>{ve(l,e(G).field),ve(_e,v),ve(f,T)},[()=>o(e(G).old_value),()=>o(e(G).new_value)]),g(oe,Se)}),p(H),g(D,H)};be(A,D=>{t.refreshResult.diffs.length>0&&D(S)})}var P=Y(A,2),c=x(P);{var L=D=>{var H=Be(),oe=Ce(H);Me(oe,17,()=>e(d),Ne,(G,de)=>{var Se=Be(),ee=Ce(Se);{var le=b=>{var k=Zr(),a=x(k,!0);p(k),he(()=>ve(a,e(de).value)),g(b,k)},ke=b=>{var k=Qr(),a=x(k,!0);p(k),he(()=>ve(a,e(de).value)),g(b,k)},pe=b=>{var k=Gr(),a=x(k,!0);p(k),he(()=>ve(a,e(de).value)),g(b,k)};be(ee,b=>{e(de).added?b(le):e(de).removed?b(ke,1):b(pe,!1)})}g(G,Se)}),g(D,H)},R=D=>{var H=Xr(),oe=x(H,!0);p(H),he(()=>ve(oe,t.bodyContent)),g(D,H)};be(c,D=>{e(d)?D(L):D(R,!1)})}p(P),p(w),g(Z,w),Je()}var tn=W("<!> ",1),an=W('<span class="diff-action-title svelte-udj3er">Changes from source</span> <div class="diff-action-buttons svelte-udj3er"><!> <!></div>',1),rn=W('<span class="bc-sep svelte-udj3er">/</span>'),nn=W("<!><span> </span>",1),sn=W('<span class="status-text saving svelte-udj3er">Saving...</span>'),on=W('<span class="status-text error svelte-udj3er"> </span>'),ln=W("<!> ",1),un=W('<div class="breadcrumb-path svelte-udj3er"></div> <div class="editor-actions svelte-udj3er"><!> <!> <!></div>',1),dn=W('<div class="refresh-panel svelte-udj3er"><div class="refresh-uptodate svelte-udj3er">Entity is up to date with source.</div></div>'),cn=W('<div class="document-scroll svelte-udj3er"><div class="document-well svelte-udj3er"><!> <!></div></div>'),fn=W("<!> <!>",1),vn=W("<!> <!>",1),hn=W("<!> <div><!></div> <!> <!> <!>",1);function Vn(Z,t){Ye(t,!0);const u=De(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),o=De(()=>xt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),d=De(()=>()=>{const s=t.data.entity.path;if(s){const C=s.lastIndexOf(`/${t.data.repo}/`);if(C>=0)return s.substring(C+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let w=Pe(""),A=Pe(rt({})),S=Pe(0);const P=De(()=>Kr(e(A))),c=De(()=>!!t.data.entity.data?.source_ref);let L=Pe(!1),R=Pe(null),D=Pe(null);async function H(){if(!e(L)){_(L,!0),_(R,null),_(D,null);try{const{result:s}=await za(t.data.repo,t.data.type,t.data.id);_(R,s,!0)}catch(s){_(D,s.message||"Refresh failed",!0)}finally{_(L,!1)}}}let oe=Pe(!1);async function G(){if(!e(oe)){_(oe,!0);try{await Ta(t.data.repo,t.data.type,t.data.id),_(R,null),await va()}catch(s){_(D,s.message||"Apply changes failed",!0)}finally{_(oe,!1)}}}let de=null,Se=Pe(""),ee=!1,le=Pe(rt([]));function ke(s){pe(),We(async()=>{const{createCollabSession:C}=await import("../chunks/CIgxv4dO.js");return{createCollabSession:C}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(({createCollabSession:C})=>{const h=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",I=C(s,{name:Kt.user?.displayName??"Anonymous",color:h,colorLight:h+"33"});I.ytext.observe(()=>{const te=I.ytext.toString();te!==e(w)&&(ee=!0,_(w,te,!0),requestAnimationFrame(()=>{ee=!1}))});const se=I.ydoc.clientID;function J(){const te=[];I.awareness.getStates().forEach((V,xe)=>{if(xe===se)return;const K=V.cell;if(K==null||K.row==null||K.col==null)return;const{name:ye="Anonymous",color:ce="#e05050"}=V.user||{};te.push({row:K.row,col:K.col,name:ye,color:ce})}),_(le,te,!0)}I.awareness.on("change",J),de=I,_(Se,s,!0)})}function pe(){de&&(de.destroy(),de=null,_(Se,""),_(le,[],!0))}Jt(()=>pe());let b=Pe(""),k=Pe(0);nt(()=>{const s=`${t.data.repo}/${t.data.type}/${t.data.id}`,C=Ma.mutationCount;if(s!==e(b)||C!==e(k)){e(b)&&s!==e(b)&&Ue.flush(),_(b,s),_(k,C,!0),_(w,t.data.entity.document?.content??"",!0),_(A,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ut(S),Ue.reset();const h=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(u)&&h!==e(Se)?ke(h):e(u)||pe()}}),nt(()=>{const s=t.data.repo,C=t.data.type,h=t.data.id;Bt(()=>{Tt.select(s,C,h),Tt.showEntity()})});function a(s){if(!ee){if(_(w,s,!0),de){const C=de.ytext,h=C.toString();s!==h&&de.ydoc.transact(()=>{C.delete(0,C.length),C.insert(0,s)})}Ue.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:s})}}function r(s,C){_(A,{...e(A),[s]:C},!0),Ue.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(A)})}function l(s){const{[s]:C,...h}=e(A);_(A,h,!0),Ue.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(A)})}function m(s,C){_(A,{...e(A),[s]:C},!0),Ue.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(A)})}function E(s,C){Ue.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(A)})}function q(s){for(const C of xt.repos){const h=C.entities.find(I=>I.id===s);if(h){zt(`/${C.name}/${h.entityType}/${h.id}`);return}}La.showToast(`"${s}" is in a collection you don't have access to`)}nt(()=>(Ut.enter(t.data.repo,t.data.type,t.data.id),()=>Ut.leave()));const _e=De(()=>e(R)!==null&&(e(R).diffs.length>0||e(R).body_changed));function Ee(s){(s.metaKey||s.ctrlKey)&&s.key==="s"&&(s.preventDefault(),Ue.flush()),s.key==="Escape"&&!(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement)&&(Ue.flush(),Tt.deselect(),zt("/"))}var y=hn();at("keydown",Yt,Ee);var f=Ce(y);ha(f,{activeView:"entity"});var v=Y(f,2);let T;var re=x(v);{var N=s=>{var C=an(),h=Y(Ce(C),2),I=x(h);Fe(I,{variant:"outline",size:"default",onclick:()=>_(R,null),get disabled(){return e(oe)},children:(J,te)=>{ze();var V=tt("Dismiss");g(J,V)},$$slots:{default:!0}});var se=Y(I,2);Fe(se,{variant:"accent",size:"default",onclick:G,get disabled(){return e(oe)},children:(J,te)=>{var V=tn(),xe=Ce(V);{var K=ce=>{Vt(ce,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};be(xe,ce=>{e(oe)&&ce(K)})}var ye=Y(xe,1,!0);he(()=>ve(ye,e(oe)?"Applying...":"Apply changes")),g(J,V)},$$slots:{default:!0}}),p(h),g(s,C)},$=s=>{var C=un(),h=Ce(C);Me(h,21,()=>e(d)(),Ne,(ce,z,F)=>{var j=nn(),Q=Ce(j);{var ge=me=>{var ue=rn();g(me,ue)};be(Q,me=>{F>0&&me(ge)})}var ne=Y(Q),fe=x(ne,!0);p(ne),he(me=>{it(ne,1,me,"svelte-udj3er"),ve(fe,e(z))},[()=>fa(F===e(d)().length-1?"bc-current":"bc-segment")]),g(ce,j)}),p(h);var I=Y(h,2),se=x(I);{var J=ce=>{var z=sn();g(ce,z)},te=ce=>{var z=on(),F=x(z,!0);p(z),he(()=>ve(F,Ue.error)),g(ce,z)};be(se,ce=>{Ue.saving?ce(J):Ue.error&&ce(te,1)})}var V=Y(se,2);{var xe=ce=>{Fe(ce,{variant:"outline",size:"sm",class:"refresh-btn",onclick:H,get disabled(){return e(L)},children:(z,F)=>{var j=ln(),Q=Ce(j);{var ge=fe=>{Vt(fe,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};be(Q,fe=>{e(L)&&fe(ge)})}var ne=Y(Q,1,!0);he(()=>ve(ne,e(L)?"Refreshing...":"Refresh from source")),g(z,j)},$$slots:{default:!0}})};be(V,ce=>{e(c)&&Kt.user?.role==="admin"&&ce(xe)})}var K=Y(V,2);{var ye=ce=>{Fe(ce,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(z,F)=>{ze();var j=tt();he(()=>ve(j,`Open in ${e(o).name??""} →`)),g(z,j)},$$slots:{default:!0}})};be(K,ce=>{e(o)&&ce(ye)})}p(I),g(s,C)};be(re,s=>{e(_e)?s(N):s($,!1)})}p(v);var n=Y(v,2);{var i=s=>{var C=dn();g(s,C)};be(n,s=>{e(R)&&!e(_e)&&s(i)})}var M=Y(n,2);{var U=s=>{en(s,{get properties(){return e(P)},get refreshResult(){return e(R)},get bodyContent(){return e(w)}})},X=s=>{var C=cn(),h=x(C),I=x(h);br(I,{get properties(){return e(P)},editable:!0,onedit:r,onremove:l,onadd:m,ontypechange:E});var se=Y(I,2);{var J=V=>{Fr(V,{get content(){return e(w)},onchange:a,onsave:()=>Ue.flush(),oncellselect:(xe,K)=>{de?.awareness.setLocalStateField("cell",{row:xe,col:K})},get remoteCursors(){return e(le)}})},te=V=>{{let xe=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);Cr(V,{get content(){return e(w)},readonly:!1,onchange:a,onsave:()=>Ue.flush(),onwikilinkclick:q,get resetKey(){return e(S)},get cursorDocName(){return e(xe)}})}};be(se,V=>{e(u)?V(J):V(te,!1)})}p(h),p(C),g(s,C)};be(M,s=>{e(_e)?s(U):s(X,!1)})}var O=Y(M,2);{let s=De(()=>!!e(D));Ke(O,()=>Da,(C,h)=>{h(C,{get open(){return e(s)},onOpenChange:I=>{I||_(D,null)},children:(I,se)=>{var J=Be(),te=Ce(J);Ke(te,()=>Ea,(V,xe)=>{xe(V,{children:(K,ye)=>{var ce=vn(),z=Ce(ce);Ke(z,()=>Ca,(j,Q)=>{Q(j,{children:(ge,ne)=>{var fe=fn(),me=Ce(fe);Ke(me,()=>Sa,(Re,ie)=>{ie(Re,{children:(B,ae)=>{ze();var we=tt("Refresh failed");g(B,we)},$$slots:{default:!0}})});var ue=Y(me,2);Ke(ue,()=>Aa,(Re,ie)=>{ie(Re,{children:(B,ae)=>{ze();var we=tt();he(()=>ve(we,e(D))),g(B,we)},$$slots:{default:!0}})}),g(ge,fe)},$$slots:{default:!0}})});var F=Y(z,2);Ke(F,()=>Pa,(j,Q)=>{Q(j,{children:(ge,ne)=>{var fe=Be(),me=Ce(fe);Ke(me,()=>Ra,(ue,Re)=>{Re(ue,{children:(ie,B)=>{ze();var ae=tt("OK");g(ie,ae)},$$slots:{default:!0}})}),g(ge,fe)},$$slots:{default:!0}})}),g(K,ce)},$$slots:{default:!0}})}),g(I,J)},$$slots:{default:!0}})})}he(()=>T=it(v,1,"editor-bar svelte-udj3er",null,T,{"editor-bar-diff":e(_e)})),g(Z,y),Je()}export{Vn as component,Un as universal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as lt,w as ut}from"../chunks/
|
|
1
|
+
import{a as lt,w as ut}from"../chunks/BOcEeypC.js";import{a as C,s as Z,b as M,g as ft}from"../chunks/DY21hM66.js";import{p as $,aa as tt,aC as mt,c as I,a5 as T,g as m,r as O,t as j,b as et,Y as J,s as k,aD as ht,a4 as vt,ag as yt}from"../chunks/Bo0CMKlC.js";import{b as Q,i as F}from"../chunks/BbsQ7LcO.js";import{s as X}from"../chunks/Cbba0X2k.js";import{g as pt}from"../chunks/D5GOt_JW.js";import{n as E}from"../chunks/Dw9UPwc-.js";const bt=async({params:b})=>{const{repo:o,type:l,id:s}=b,u=await lt(o,l,s);return{repo:o,type:l,id:s,entity:u}},Tt=Object.freeze(Object.defineProperty({__proto__:null,load:bt},Symbol.toStringTag,{value:"Module"}));var gt=M('<div class="loading-indicator svelte-1fltv0h">Loading editor...</div>'),wt=M('<div class="error-indicator svelte-1fltv0h"> </div>'),_t=M('<div><div class="header-mount svelte-1fltv0h"></div> <!> <!> <div></div></div>');function kt(b,o){$(o,!0);let l,s,u=J(!0),h=J(null),y=[],d=[],v=[],g={},x=[],p=null,w=null,_=0;function q(){const e=window.StudioChrome,i=document.querySelector(".sg-chrome-overflow-menu");if(i&&(i.innerHTML=""),e&&(e.clearViewAction(),e.clearSaveHandlers()),w&&(w.el.removeEventListener("click",w.handler,!0),w=null),e){e.unmountHeader();for(const{event:r,fn:c}of v)e.off(r,c)}v=[];for(const r of y)r.remove();y=[];for(const r of d)r.remove();d=[],p&&(p.remove(),p=null);for(const[r,c]of Object.entries(g))c===void 0?document.body.removeAttribute(r):document.body.setAttribute(r,c);g={};for(const r of x)document.body.classList.remove(r);x=[],s&&(s.innerHTML="")}async function B(){const e=++_;k(u,!0),k(h,null),q();try{const i=`${o.appMountPath}/edit/${encodeURIComponent(o.repo)}/${encodeURIComponent(o.entityId)}`,r=await fetch(i);if(!r.ok)throw new Error(`Failed to load editor: ${r.status}`);if(e!==_)return;const c=await r.text(),H=new DOMParser().parseFromString(c,"text/html"),at=H.querySelectorAll('link[rel="stylesheet"]');for(const t of at){if(t.href.includes("chrome.css"))continue;let n=t.getAttribute("href")||"";n&&!n.startsWith("http")&&!n.startsWith("/")&&(n=`${o.appMountPath}/${n}`);const a=document.createElement("link");a.rel="stylesheet",a.href=n,document.head.appendChild(a),y.push(a)}const it=H.querySelectorAll("head style");for(const t of it){const n=document.createElement("style");n.textContent=t.textContent,document.head.appendChild(n),y.push(n)}p=document.createElement("style"),p.textContent=`
|
|
2
2
|
body.sg-chrome-active { height: auto !important; }
|
|
3
3
|
body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
|
|
4
4
|
`,document.head.appendChild(p);const A=H.body;for(const t of Array.from(A.attributes))t.name.startsWith("data-")&&(g[t.name]=document.body.getAttribute(t.name)??void 0,document.body.setAttribute(t.name,t.value));const st=Array.from(A.classList);for(const t of st)t!=="sg-chrome-active"&&(document.body.classList.contains(t)||(document.body.classList.add(t),x.push(t)));const ct=A.querySelectorAll("script"),K=[],N=[];for(const t of ct){if(t.src){const n=t.getAttribute("src")||"";if(n.includes("chrome.js"))continue;let a=n;a&&!a.startsWith("http")&&!a.startsWith("/")&&(a=`${o.appMountPath}/${a}`),K.push(a)}else t.textContent&&N.push(t.textContent);t.remove()}s.innerHTML=A.innerHTML;const f=window.StudioChrome;if(f){f.updateBreadcrumb(o.repo,o.entityId),f.mountHeader(l);const t=document.body.dataset.sgViewUrl,n=document.body.dataset.sgViewLabel;t?f.setViewAction(t,n):f.clearViewAction();const a=l.querySelector(".sg-chrome-back");if(a){const Y=G=>{G.preventDefault(),G.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",Y,!0),w={el:a,handler:Y}}}let L=null;f&&(L=f.on,f.on=function(t,n){v.push({event:t,fn:n}),L.call(this,t,n)});const dt=`?_v=${Date.now()}`;for(const t of K){if(e!==_)return;await ot(t+dt)}for(const t of N){if(e!==_)return;const n=document.createElement("script");n.textContent=t,document.body.appendChild(n),d.push(n)}f&&L&&(f.on=L),k(u,!1)}catch(i){if(e!==_)return;k(h,i.message||"Failed to load editor",!0),k(u,!1)}}function ot(e){return new Promise((i,r)=>{const c=document.createElement("script");c.src=e,c.onload=()=>i(),c.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.body.appendChild(c),d.push(c)})}let P="";tt(()=>{const e=`${o.appMountPath}|${o.repo}|${o.entityId}`;P&&P!==e&&s&&B(),P=e}),mt(()=>(B(),q));var S=_t();let D;var V=I(S);Q(V,e=>l=e,()=>l);var W=T(V,2);{var nt=e=>{var i=gt();C(e,i)};F(W,e=>{m(u)&&e(nt)})}var U=T(W,2);{var rt=e=>{var i=wt(),r=I(i,!0);O(i),j(()=>Z(r,m(h))),C(e,i)};F(U,e=>{m(h)&&e(rt)})}var R=T(U,2);let z;Q(R,e=>s=e,()=>s),O(S),j(()=>{D=X(S,1,"editor-frame svelte-1fltv0h",null,D,{loading:m(u)}),z=X(R,1,"editor-container svelte-1fltv0h",null,z,{hidden:m(u)||!!m(h)})}),C(b,S),et()}var Ct=M('<div class="no-editor svelte-1406f3k"> </div>');function It(b,o){$(o,!0);const l=yt(()=>ut.getAppForEntityType(o.data.type));tt(()=>{E.select(o.data.repo,o.data.type,o.data.id),E.showEntity(),E.hideSidebar=!0}),ht(()=>{E.hideSidebar=!1});var s=ft(),u=vt(s);{var h=d=>{kt(d,{get appMountPath(){return m(l).mountPath},get repo(){return o.data.repo},get entityId(){return o.data.id},get entityType(){return o.data.type}})},y=d=>{var v=Ct(),g=I(v);O(v),j(()=>Z(g,`No app editor available for entity type "${o.data.type??""}"`)),C(d,v)};F(u,d=>{m(l)?d(h):d(y,!1)})}C(b,s),et()}export{It as component,Tt as universal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as Ae,c as Tt,a as ht,b as Dt,s as It,e as le,f as $t,g as Qe}from"../chunks/DfwW1gF2.js";import{p as Bt,ax as Je,aa as St,g,ag as nt,aC as Ne,aD as qe,t as yt,b as Ft,s as q,c as at,Y as pt,r as it,a5 as gt,l as Ut,d as Pt,a as ze,n as Se,m as Zt,a4 as ke,bp as $e}from"../chunks/yMbbhP0p.js";import{V as tn}from"../chunks/DD0eH0_A.js";import{_ as en}from"../chunks/PPVm8Dsz.js";import{e as ce,i as fe}from"../chunks/D9BdHkd3.js";import{s as nn}from"../chunks/1vztr6_A.js";import{c as kt,a as Pe}from"../chunks/l5w7mUkV.js";import{b as Ee,i as Kt}from"../chunks/DSZYl5ah.js";import{p as mt,l as Qt}from"../chunks/DVyuW48M.js";import{g as rn}from"../chunks/D91YXE6T.js";import{e as Mt}from"../chunks/CA7sXyoK.js";import{B as on}from"../chunks/Brxs8A3C.js";import{i as Re}from"../chunks/Dr5ZUnae.js";import{n as se}from"../chunks/BUMhcVI4.js";import{w as Wt}from"../chunks/CgcfyvoD.js";import{c as an}from"../chunks/Dty7t9WP.js";function sn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Le(this.cover(e,n),e,n,t)}function Le(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,c={data:i},o=t._x0,u=t._y0,l=t._x1,f=t._y1,C,d,v,b,p,s,h,x;if(!a)return t._root=c,t;for(;a.length;)if((p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d,r=a,!(a=a[h=s<<1|p]))return r[h]=c,t;if(v=+t._x.call(null,a.data),b=+t._y.call(null,a.data),e===v&&n===b)return c.next=a,r?r[h]=c:t._root=c,t;do r=r?r[h]=new Array(4):t._root=new Array(4),(p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d;while((h=s<<1|p)===(x=(b>=d)<<1|v>=C));return r[x]=a,r[h]=c,t}function ln(t){var e,n,i=t.length,r,a,c=new Array(i),o=new Array(i),u=1/0,l=1/0,f=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(c[n]=r,o[n]=a,r<u&&(u=r),r>f&&(f=r),a<l&&(l=a),a>C&&(C=a));if(u>f||l>C)return this;for(this.cover(u,l).cover(f,C),n=0;n<i;++n)Le(this,c[n],o[n],t[n]);return this}function cn(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,u,l;n>t||t>=r||i>e||e>=a;)switch(l=(e<i)<<1|t<n,u=new Array(4),u[l]=o,o=u,c*=2,l){case 0:r=n+c,a=i+c;break;case 1:n=r-c,a=i+c;break;case 2:r=n+c,i=a-c;break;case 3:n=r-c,i=a-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function fn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function un(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function st(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function hn(t,e,n){var i,r=this._x0,a=this._y0,c,o,u,l,f=this._x1,C=this._y1,d=[],v=this._root,b,p;for(v&&d.push(new st(v,r,a,f,C)),n==null?n=1/0:(r=t-n,a=e-n,f=t+n,C=e+n,n*=n);b=d.pop();)if(!(!(v=b.node)||(c=b.x0)>f||(o=b.y0)>C||(u=b.x1)<r||(l=b.y1)<a))if(v.length){var s=(c+u)/2,h=(o+l)/2;d.push(new st(v[3],s,h,u,l),new st(v[2],c,h,s,l),new st(v[1],s,o,u,h),new st(v[0],c,o,s,h)),(p=(e>=h)<<1|t>=s)&&(b=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=b)}else{var x=t-+this._x.call(null,v.data),D=e-+this._y.call(null,v.data),m=x*x+D*D;if(m<n){var N=Math.sqrt(n=m);r=t-N,a=e-N,f=t+N,C=e+N,i=v.data}}return i}function dn(t){if(isNaN(f=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,c=this._x0,o=this._y0,u=this._x1,l=this._y1,f,C,d,v,b,p,s,h;if(!n)return this;if(n.length)for(;;){if((b=f>=(d=(c+u)/2))?c=d:u=d,(p=C>=(v=(o+l)/2))?o=v:l=v,e=n,!(n=n[s=p<<1|b]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(i=e,h=s)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[s]=a:delete e[s],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[h]=n:this._root=n),this):(this._root=a,this)}function gn(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function vn(){return this._root}function pn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function yn(t){var e=[],n,i=this._root,r,a,c,o,u;for(i&&e.push(new st(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,a=n.x0,c=n.y0,o=n.x1,u=n.y1)&&i.length){var l=(a+o)/2,f=(c+u)/2;(r=i[3])&&e.push(new st(r,l,f,o,u)),(r=i[2])&&e.push(new st(r,a,f,l,u)),(r=i[1])&&e.push(new st(r,l,c,o,f)),(r=i[0])&&e.push(new st(r,a,c,l,f))}return this}function mn(t){var e=[],n=[],i;for(this._root&&e.push(new st(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var a,c=i.x0,o=i.y0,u=i.x1,l=i.y1,f=(c+u)/2,C=(o+l)/2;(a=r[0])&&e.push(new st(a,c,o,f,C)),(a=r[1])&&e.push(new st(a,f,o,u,C)),(a=r[2])&&e.push(new st(a,c,C,f,l)),(a=r[3])&&e.push(new st(a,f,C,u,l))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function xn(t){return t[0]}function wn(t){return arguments.length?(this._x=t,this):this._x}function _n(t){return t[1]}function bn(t){return arguments.length?(this._y=t,this):this._y}function de(t,e,n){var i=new ge(e??xn,n??_n,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ge(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function ye(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ct=de.prototype=ge.prototype;ct.copy=function(){var t=new ge(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ye(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ye(i));return t};ct.add=sn;ct.addAll=ln;ct.cover=cn;ct.data=fn;ct.extent=un;ct.find=hn;ct.remove=dn;ct.removeAll=gn;ct.root=vn;ct.size=pn;ct.visit=yn;ct.visitAfter=mn;ct.x=wn;ct.y=bn;function lt(t){return function(){return t}}function xt(t){return(t()-.5)*1e-6}function Mn(t){return t.x+t.vx}function Tn(t){return t.y+t.vy}function me(t){var e,n,i,r=1,a=1;typeof t!="function"&&(t=lt(t==null?1:+t));function c(){for(var l,f=e.length,C,d,v,b,p,s,h=0;h<a;++h)for(C=de(e,Mn,Tn).visitAfter(o),l=0;l<f;++l)d=e[l],p=n[d.index],s=p*p,v=d.x+d.vx,b=d.y+d.vy,C.visit(x);function x(D,m,N,S,W){var F=D.data,$=D.r,G=p+$;if(F){if(F.index>d.index){var ft=v-F.x-F.vx,Q=b-F.y-F.vy,ot=ft*ft+Q*Q;ot<G*G&&(ft===0&&(ft=xt(i),ot+=ft*ft),Q===0&&(Q=xt(i),ot+=Q*Q),ot=(G-(ot=Math.sqrt(ot)))/ot*r,d.vx+=(ft*=ot)*(G=($*=$)/(s+$)),d.vy+=(Q*=ot)*G,F.vx-=ft*(G=1-G),F.vy-=Q*G)}return}return m>v+G||S<v-G||N>b+G||W<b-G}}function o(l){if(l.data)return l.r=n[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(e){var l,f=e.length,C;for(n=new Array(f),l=0;l<f;++l)C=e[l],n[C.index]=+t(C,l,e)}}return c.initialize=function(l,f){e=l,i=f,u()},c.iterations=function(l){return arguments.length?(a=+l,c):a},c.strength=function(l){return arguments.length?(r=+l,c):r},c.radius=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),u(),c):t},c}function In(t){return t.index}function xe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function we(t){var e=In,n=C,i,r=lt(30),a,c,o,u,l,f=1;t==null&&(t=[]);function C(s){return 1/Math.min(o[s.source.index],o[s.target.index])}function d(s){for(var h=0,x=t.length;h<f;++h)for(var D=0,m,N,S,W,F,$,G;D<x;++D)m=t[D],N=m.source,S=m.target,W=S.x+S.vx-N.x-N.vx||xt(l),F=S.y+S.vy-N.y-N.vy||xt(l),$=Math.sqrt(W*W+F*F),$=($-a[D])/$*s*i[D],W*=$,F*=$,S.vx-=W*(G=u[D]),S.vy-=F*G,N.vx+=W*(G=1-G),N.vy+=F*G}function v(){if(c){var s,h=c.length,x=t.length,D=new Map(c.map((N,S)=>[e(N,S,c),N])),m;for(s=0,o=new Array(h);s<x;++s)m=t[s],m.index=s,typeof m.source!="object"&&(m.source=xe(D,m.source)),typeof m.target!="object"&&(m.target=xe(D,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(s=0,u=new Array(x);s<x;++s)m=t[s],u[s]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(x),b(),a=new Array(x),p()}}function b(){if(c)for(var s=0,h=t.length;s<h;++s)i[s]=+n(t[s],s,t)}function p(){if(c)for(var s=0,h=t.length;s<h;++s)a[s]=+r(t[s],s,t)}return d.initialize=function(s,h){c=s,l=h,v()},d.links=function(s){return arguments.length?(t=s,v(),d):t},d.id=function(s){return arguments.length?(e=s,d):e},d.iterations=function(s){return arguments.length?(f=+s,d):f},d.strength=function(s){return arguments.length?(n=typeof s=="function"?s:lt(+s),b(),d):n},d.distance=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),p(),d):r},d}var Cn={value:()=>{}};function Ve(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new jt(n)}function jt(t){this._=t}function Dn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}jt.prototype=Ve.prototype={constructor:jt,on:function(t,e){var n=this._,i=Dn(t+"",n),r,a=-1,c=i.length;if(arguments.length<2){for(;++a<c;)if((r=(t=i[a]).type)&&(r=An(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<c;)if(r=(t=i[a]).type)n[r]=_e(n[r],t.name,e);else if(e==null)for(r in n)n[r]=_e(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function An(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function _e(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Et=0,Lt=0,Rt=0,Xe=1e3,Jt,Vt,qt=0,Ct=0,te=0,Xt=typeof performance=="object"&&performance.now?performance:Date,Be=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Fe(){return Ct||(Be(Nn),Ct=Xt.now()+te)}function Nn(){Ct=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Ye.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Fe():+n)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:Jt=this,Vt=this),this._call=t,this._time=n,he()},stop:function(){this._call&&(this._call=null,this._time=1/0,he())}};function Ye(t,e,n){var i=new ue;return i.restart(t,e,n),i}function zn(){Fe(),++Et;for(var t=Jt,e;t;)(e=Ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Et}function be(){Ct=(qt=Xt.now())+te,Et=Lt=0;try{zn()}finally{Et=0,kn(),Ct=0}}function Sn(){var t=Xt.now(),e=t-qt;e>Xe&&(te-=e,qt=t)}function kn(){for(var t,e=Jt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);Vt=t,he(i)}function he(t){if(!Et){Lt&&(Lt=clearTimeout(Lt));var e=t-Ct;e>24?(t<1/0&&(Lt=setTimeout(be,t-Xt.now()-te)),Rt&&(Rt=clearInterval(Rt))):(Rt||(qt=Xt.now(),Rt=setInterval(Sn,Xe)),Et=1,Be(be))}}const Pn=1664525,En=1013904223,Me=4294967296;function Rn(){let t=1;return()=>(t=(Pn*t+En)%Me)/Me}function Ln(t){return t.x}function Vn(t){return t.y}var Xn=10,Bn=Math.PI*(3-Math.sqrt(5));function Te(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,c=.6,o=new Map,u=Ye(C),l=Ve("tick","end"),f=Rn();t==null&&(t=[]);function C(){d(),l.call("tick",e),n<i&&(u.stop(),l.call("end",e))}function d(p){var s,h=t.length,x;p===void 0&&(p=1);for(var D=0;D<p;++D)for(n+=(a-n)*r,o.forEach(function(m){m(n)}),s=0;s<h;++s)x=t[s],x.fx==null?x.x+=x.vx*=c:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=c:(x.y=x.fy,x.vy=0);return e}function v(){for(var p=0,s=t.length,h;p<s;++p){if(h=t[p],h.index=p,h.fx!=null&&(h.x=h.fx),h.fy!=null&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var x=Xn*Math.sqrt(.5+p),D=p*Bn;h.x=x*Math.cos(D),h.y=x*Math.sin(D)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function b(p){return p.initialize&&p.initialize(t,f),p}return v(),e={tick:d,restart:function(){return u.restart(C),e},stop:function(){return u.stop(),e},nodes:function(p){return arguments.length?(t=p,v(),o.forEach(b),e):t},alpha:function(p){return arguments.length?(n=+p,e):n},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(r=+p,e):+r},alphaTarget:function(p){return arguments.length?(a=+p,e):a},velocityDecay:function(p){return arguments.length?(c=1-p,e):1-c},randomSource:function(p){return arguments.length?(f=p,o.forEach(b),e):f},force:function(p,s){return arguments.length>1?(s==null?o.delete(p):o.set(p,b(s)),e):o.get(p)},find:function(p,s,h){var x=0,D=t.length,m,N,S,W,F;for(h==null?h=1/0:h*=h,x=0;x<D;++x)W=t[x],m=p-W.x,N=s-W.y,S=m*m+N*N,S<h&&(F=W,h=S);return F},on:function(p,s){return arguments.length>1?(l.on(p,s),e):l.on(p)}}}function Ie(){var t,e,n,i,r=lt(-30),a,c=1,o=1/0,u=.81;function l(v){var b,p=t.length,s=de(t,Ln,Vn).visitAfter(C);for(i=v,b=0;b<p;++b)e=t[b],s.visit(d)}function f(){if(t){var v,b=t.length,p;for(a=new Array(b),v=0;v<b;++v)p=t[v],a[p.index]=+r(p,v,t)}}function C(v){var b=0,p,s,h=0,x,D,m;if(v.length){for(x=D=m=0;m<4;++m)(p=v[m])&&(s=Math.abs(p.value))&&(b+=p.value,h+=s,x+=s*p.x,D+=s*p.y);v.x=x/h,v.y=D/h}else{p=v,p.x=p.data.x,p.y=p.data.y;do b+=a[p.data.index];while(p=p.next)}v.value=b}function d(v,b,p,s){if(!v.value)return!0;var h=v.x-e.x,x=v.y-e.y,D=s-b,m=h*h+x*x;if(D*D/u<m)return m<o&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)),e.vx+=h*v.value*i/m,e.vy+=x*v.value*i/m),!0;if(v.length||m>=o)return;(v.data!==e||v.next)&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)));do v.data!==e&&(D=a[v.data.index]*i/m,e.vx+=h*D,e.vy+=x*D);while(v=v.next)}return l.initialize=function(v,b){t=v,n=b,f()},l.strength=function(v){return arguments.length?(r=typeof v=="function"?v:lt(+v),f(),l):r},l.distanceMin=function(v){return arguments.length?(c=v*v,l):Math.sqrt(c)},l.distanceMax=function(v){return arguments.length?(o=v*v,l):Math.sqrt(o)},l.theta=function(v){return arguments.length?(u=v*v,l):Math.sqrt(u)},l}function Ce(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vx+=(r[u]-f.x)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.x=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}function De(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vy+=(r[u]-f.y)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.y=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}var Fn=Dt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),Yn=Dt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function On(t,e){Bt(e,!0);let n=mt(e,"selectedEntityId",3,null),i=mt(e,"filteredIds",3,null),r=mt(e,"sidebarHoveredId",3,null),a=mt(e,"highlightedIds",3,null);function c(y){return e.nameMap?.get(y)??y.replace(/-/g," ").replace(/\b\w/g,w=>w.toUpperCase())}const o=Je("theme"),u=nt(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),l=nt(()=>o.current==="light"?16316666:592139),f=.75;St(()=>{o.current,K&&(K.style.fill=g(u).labelText);const y=g(Gt);for(const w of b)Mt(w.type)===Nt&&(w.color=y);et()}),St(()=>{i(),et()}),St(()=>{a(),et()}),St(()=>{n(),et()});let C=!1;St(()=>{const y=e.graphData;if(!tt||!A||!R)return;if(!C){C=!0;return}const w=new Map;for(const T of y.edges)w.set(T.source,(w.get(T.source)??0)+1),w.set(T.target,(w.get(T.target)??0)+1);const _=new Map;for(const T of b)_.set(T.id,{x:T.x,y:T.y});const Y=3600*y.nodes.length,O=Math.sqrt(Y),B=y.nodes.map(T=>{const H=w.get(T.id)??0,dt=_.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:Mt(T.type)===Nt?g(Gt):Mt(T.type),weight:H,x:dt?.x??(Math.random()-.5)*O,y:dt?.y??(Math.random()-.5)*O,vx:0,vy:0,r:At(H)}}),Z=new Map;for(const T of B)Z.set(T.id,T);const rt=new Set(L.keys()),ut=new Set(y.nodes.map(T=>T.id));for(const T of rt)if(!ut.has(T)){const H=L.get(T);H&&(R.removeChild(H),H.destroy()),L.delete(T)}let X=null;if(L.size>0&&(X=L.values().next().value?.texture),!X){const T=document.createElement("canvas");T.width=100,T.height=100;const H=T.getContext("2d");H.beginPath(),H.arc(50,50,48,0,Math.PI*2),H.fillStyle="#ffffff",H.fill(),X=tt.Texture.from(T)}for(const T of B){let H=L.get(T.id);H||(H=new tt.Sprite(X),H.anchor.set(.5),R.addChild(H),L.set(T.id,H)),H.tint=Ot(T.color)}b=B,v?.stop();const vt=y.edges.map(T=>({source:T.source,target:T.target})),V=we(vt).id(T=>T.id).distance(250);v=Te(b).force("link",V).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{ot||ne(),et()}),p=V.links(),N=null,Yt(),et()}),St(()=>{const y=r();if(y){const w=b.find(_=>_.id===y)??null;N=w,Yt(),M=w?1:0}else S||(M=0);et()});let d,v=null,b=[],p=[],s=!1,h=0,x=0,D=0,m=1,N=null,S=null,W=pt(!1),F=0,$=0,G=0,ft=0,Q=new Set,ot=!1,wt=pt(null),I=0,M=0;const E=4;let A=null,k=null,j=null,R=null,L=new Map,U=null,K=null,tt=null;function At(y){return Math.max(3,Math.min(Math.sqrt(y+1)+2,10))}function ee(y,w){const _=d.getBoundingClientRect();return{x:(y-_.left-x)/m,y:(w-_.top-D)/m}}function ve(y,w){for(let _=b.length-1;_>=0;_--){const P=b[_],Y=y-P.x,O=w-P.y,B=(P.r*1.5+4)/m;if(Y*Y+O*O<=B*B)return P}return null}function Yt(){const y=N??null;if(Q.clear(),!!y){Q.add(y.id);for(const w of p)w.source.id===y.id&&Q.add(w.target.id),w.target.id===y.id&&Q.add(w.source.id);if(R){const w=L.get(y.id);w&&R.setChildIndex(w,R.children.length-1)}}}function ne(){if(b.length===0||!d)return;let y=1/0,w=-1/0,_=1/0,P=-1/0,Y=0;for(const X of b)X.x<y&&(y=X.x),X.x>w&&(w=X.x),X.y<_&&(_=X.y),X.y>P&&(P=X.y),X.r>Y&&(Y=X.r);const O=d.clientWidth,B=d.clientHeight,Z=w-y,rt=P-_;if(Z===0||rt===0)return;const ut=(60+Y)*2;m=Math.min((O-ut)/Z,(B-ut)/rt,3),x=O/2-(y+w)/2*m,D=B/2-(_+P)/2*m,et()}function et(){s=!0,h=0}function Ot(y){return parseInt(y.replace("#",""),16)}function _t(y,w,_){const P=(y>>16&255)+_*((w>>16&255)-(y>>16&255)),Y=(y>>8&255)+_*((w>>8&255)-(y>>8&255)),O=(y&255)+_*((w&255)-(y&255));return Math.round(P)<<16|Math.round(Y)<<8|Math.round(O)}function Oe(){if(!tt||!k||!j)return;k.clear(),j.clear();const w=N!==null,_=I,P=g(wt),Y=a(),O=i(),B=g(u).default,Z=g(u).dim,rt=g(u).conn;for(let ut=0;ut<p.length;ut++){const X=p[ut],vt=X.source.x*m+x,V=X.source.y*m+D,T=X.target.x*m+x,H=X.target.y*m+D,dt=w&&_>.01&&Q.has(X.source.id)&&Q.has(X.target.id);let z=B;w&&_>.01?z=dt?_t(B,rt,_):_t(B,Z,_):(P!==null||Y!==null||O!==null)&&(z=Z);const J=dt?j:k,zt=dt?1:.2;J.setStrokeStyle({width:1,color:z,alpha:zt}),J.moveTo(vt,V),J.lineTo(T,H),J.stroke()}}function He(){if(!tt)return;const y=N,w=y!==null,_=I,P=g(wt),Y=a(),O=i(),B=!y&&n()?b.find(V=>V.id===n())??null:null,Z=new Set;if(B){Z.add(B.id);for(const V of p)V.source.id===B.id&&Z.add(V.target.id),V.target.id===B.id&&Z.add(V.source.id)}for(const V of b){const T=L.get(V.id);if(!T)continue;const H=V.x*m+x,dt=V.y*m+D;T.position.set(H,dt),T.scale.set(V.r/50),T.alpha=1;const z=Ot(V.color);if(B&&!y){const J=Z.has(V.id);T.tint=J?z:_t(z,g(l),f)}else{const J=V===y,zt=w&&Q.has(V.id),Ze=P!==null&&(P==="other"?Mt(V.type)===Nt:V.type===P);if(J&&_>.01)T.tint=z,T.scale.set(V.r*(1+_*.4)/50);else if(zt)T.tint=z;else if(P!==null)T.tint=Ze?z:_t(z,g(l),f);else if(Y!==null){const ae=Y.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else if(O!==null){const ae=O.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else T.tint=_t(z,g(l),_*f)}}const rt=y??B,ut=y?_>.01:!!B;if(rt&&ut&&U){U.visible=!0;const V=rt.x*m+x,T=rt.y*m+D;U.position.set(V,T),U.scale.set(rt.r*5/64),U.alpha=y?_*.25:.25,U.tint=Ot(rt.color)}else U&&(U.visible=!1);const X=y??B,vt=y?_>.01:!!B;if(X&&vt&&K){const V=X.x*m+x,T=X.y*m+D;K.text=c(X.id),K.style.fontSize=12,K.position.set(V,T+X.r+8),K.alpha=y?_:1,K.visible=!0}else K&&(K.visible=!1)}let Ht=!1;function Ge(y){if(y.button!==0)return;Ht=!1;const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?(S=_,ot=!0,_.fx=_.x,_.fy=_.y,v?.alphaTarget(.3).restart(),et()):(q(W,!0),F=y.clientX,$=y.clientY,G=x,ft=D),d.setPointerCapture(y.pointerId),window.addEventListener("pointerup",ie,{once:!0})}function We(y){if(S){Ht=!0;const w=ee(y.clientX,y.clientY);S.fx=w.x,S.fy=w.y,et()}else if(g(W))Ht=!0,x=G+(y.clientX-F),D=ft+(y.clientY-$),et();else{const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?_!==N?(N&&(I=.15),N=_,Yt(),M=1,d.style.cursor="pointer",et()):M!==1&&(M=1,d.style.cursor="pointer",et()):M!==0&&(M=0,d.style.cursor="grab",et())}}function ie(y){if(!S&&!g(W))return;window.removeEventListener("pointerup",ie);const w=Ht;if(S){const _=S;S.fx=null,S.fy=null,v?.alphaTarget(0),S=null,M=0,et(),w||rn(`/${_.repo}/${_.type}/${_.id}`)}else g(W)&&q(W,!1);try{d.releasePointerCapture(y.pointerId)}catch{}}const Nt="#5c5c66",je="#b0b0b8",Gt=nt(()=>o.current==="light"?je:Nt),Ue=nt(()=>{const y=new Map;for(const P of e.graphData.nodes)y.set(P.type,(y.get(P.type)??0)+1);const w=[];let _=0;for(const[P,Y]of y){const O=Mt(P);O===Nt?_+=Y:w.push({name:P,color:O,count:Y})}return w.sort((P,Y)=>Y.count-P.count),_>0&&w.push({name:"other",color:g(Gt),count:_}),w});Ne(async()=>{tt=await en(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),A=new tt.Application,await A.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:d}),d.insertBefore(A.canvas,d.firstChild),A.canvas.style.position="absolute",A.canvas.style.inset="0",k=new tt.Graphics,A.stage.addChild(k),j=new tt.Graphics,A.stage.addChild(j),R=new tt.Container,A.stage.addChild(R);const y=document.createElement("canvas");y.width=128,y.height=128;const w=y.getContext("2d"),_=w.createRadialGradient(64,64,0,64,64,64);_.addColorStop(0,"rgba(255,255,255,0.5)"),_.addColorStop(1,"rgba(255,255,255,0)"),w.fillStyle=_,w.fillRect(0,0,128,128);const P=tt.Texture.from(y);U=new tt.Sprite(P),U.anchor.set(.5),U.visible=!1,A.stage.addChild(U);const Y=document.createElement("canvas");Y.width=100,Y.height=100;const O=Y.getContext("2d");O.beginPath(),O.arc(50,50,48,0,Math.PI*2),O.fillStyle="#ffffff",O.fill();const B=tt.Texture.from(Y),Z=new Map;for(const z of e.graphData.edges)Z.set(z.source,(Z.get(z.source)??0)+1),Z.set(z.target,(Z.get(z.target)??0)+1);const rt=new Map,X=3600*e.graphData.nodes.length,vt=Math.sqrt(X);b=e.graphData.nodes.map(z=>{const J=Z.get(z.id)??0,zt={id:z.id,type:z.type,repo:z.repo,color:Mt(z.type)===Nt?g(Gt):Mt(z.type),weight:J,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:At(J)};return rt.set(z.id,zt),zt});for(const z of b){const J=new tt.Sprite(B);J.anchor.set(.5),J.tint=Ot(z.color),R.addChild(J),L.set(z.id,J)}K=new tt.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:g(u).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,A.stage.addChild(K);const V=e.graphData.edges.map(z=>({source:z.source,target:z.target})),T=we(V).id(z=>z.id).distance(250);v=Te(b).force("link",T).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{ot||ne(),et()}),p=T.links();let H=0;A.ticker.add(()=>{const z=performance.now(),J=H?Math.min((z-H)/1e3,.05):.016;H=z,I<M?(I=Math.min(M,I+E*J),s=!0):I>M&&(I=Math.max(M,I-E*J),s=!0),I===0&&M===0&&N&&!S&&(N=null,Yt(),s=!0),(s||h<120)&&(Oe(),He(),s=!1,h++)});const dt=new ResizeObserver(()=>{A.renderer.resize(d.clientWidth,d.clientHeight),ne()});return dt.observe(d),()=>{dt.disconnect()}}),qe(()=>{v?.stop(),A&&(A.destroy(!0,{children:!0}),A=null)});var re=Yn(),bt=at(re);let pe;var oe=at(bt);ce(oe,21,()=>g(Ue),fe,(y,w)=>{var _=Fn();let P;var Y=at(_);let O;var B=gt(Y,2),Z=at(B,!0);it(B);var rt=gt(B,2),ut=at(rt,!0);it(rt),it(_),yt(()=>{P=nn(_,1,"legend-item svelte-1i33fky",null,P,{"legend-item-active":g(wt)===g(w).name}),O=kt(Y,"",O,{background:g(w).color}),It(Z,g(w).name),It(ut,g(w).count)}),le("mouseenter",_,()=>{q(wt,g(w).name,!0),et()}),le("mouseleave",_,()=>{q(wt,null),et()}),ht(y,_)}),it(oe),it(bt),Ee(bt,y=>d=y,()=>d),it(re),yt(()=>pe=kt(bt,"",pe,{cursor:g(W)?"grabbing":"grab"})),Tt("pointerdown",bt,Ge),Tt("pointermove",bt,We),Tt("pointerup",bt,ie),Tt("pointerdown",oe,y=>y.stopPropagation()),ht(t,re),Ft()}Ae(["pointerdown","pointermove","pointerup"]);var Hn=$t("<title> </title>"),Gn=$t('<svg><!><path d="M7,28a1,1,0,0,1-1-1V5a1,1,0,0,1,1.4819-.8763l20,11a1,1,0,0,1,0,1.7525l-20,11A1.0005,1.0005,0,0,1,7,28ZM8,6.6909V25.3088L24.9248,16Z"></path></svg>');function Wn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Bt(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Gn();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=Hn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(),it(u),ht(t,u),Ft()}var jn=$t("<title> </title>"),Un=$t('<svg><!><path d="M12,8V24H8V8h4m0-2H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path><path d="M24,8V24H20V8h4m0-2H20a2,2,0,0,0-2,2V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Zn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Bt(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Un();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=jn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(2),it(u),ht(t,u),Ft()}var Kn=Dt('<div class="density-bar svelte-lzvab"></div>'),Qn=Dt('<span class="date-label svelte-lzvab"> </span>'),Jn=Dt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),qn=Dt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function $n(t,e){Bt(e,!0);let n=pt(null),i=pt(0),r=pt(!1),a=pt(!1),c=pt(null),o=null;const u=nt(()=>{let I=1/0,M=-1/0;for(const E of e.entities){const A=E.createdAt?new Date(E.createdAt).getTime():0;A>0&&A<I&&(I=A),A>M&&(M=A)}return I===1/0&&(I=Date.now()),M===-1/0&&(M=Date.now()),{min:I,max:M}}),l=nt(()=>{let{min:I,max:M}=g(u);return M-I<864e5&&(I-=864e5*15,M+=864e5*15),{min:new Date(I),max:new Date(M)}}),f=nt(()=>{const M=g(l).min.getTime(),E=g(l).max.getTime(),A=new Map;for(const k of e.entities){const j=k.createdAt?new Date(k.createdAt).getTime():0;if(j<=0)continue;const R=Math.floor((j-M)/864e5),L=M+R*864e5,U=A.get(L)??[];U.push(k),A.set(L,U)}return{map:A,minTime:M,maxTime:E,dayMs:864e5}}),C=nt(()=>{let I=0;for(const M of g(f).map.values())M.length>I&&(I=M.length);return Math.max(1,I)}),d=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I,A=[],k=Math.max(4,Math.min(8,Math.floor(g(i)/100))),j=E/k;for(let R=0;R<=k;R++){const L=I+R*j,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});A.push({label:K,x:R/k})}return A}),v=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I;if(E<=0)return .5;const A=e.currentDate?e.currentDate.getTime():g(u).max,k=Math.max(g(u).min,Math.min(g(u).max,A));return Math.max(0,Math.min(1,(k-I)/E))});function b(I){if(!g(n))return new Date;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=Math.max(0,Math.min(1,(I-M.left-E)/k)),{minTime:R,maxTime:L}=g(f),U=R+j*(L-R);return new Date(Math.max(g(u).min,Math.min(g(u).max,U)))}function p(I){q(r,!0),N();const M=b(I.clientX);e.onDateChange(M),I.target.setPointerCapture(I.pointerId)}function s(I){if(g(r)&&e.onDateChange(b(I.clientX)),!g(n))return;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=(I.clientX-M.left-E)/k;if(j<0||j>1){q(c,null);return}const{minTime:R,dayMs:L,map:U}=g(f),K=R+j*(g(f).maxTime-R),tt=R+Math.floor((K-R)/L)*L,At=U.get(tt);At&&At.length>0?q(c,{date:new Date(tt),count:At.length,x:I.clientX-M.left},!0):q(c,null)}function h(){q(r,!1)}function x(){q(c,null)}function D(){g(a)?N():m()}function m(){q(a,!0);const{min:I,max:M}=g(u),A=(M-I)/200;let k=e.currentDate?.getTime()??I;k>=M&&(k=I),o=setInterval(()=>{if(k+=A,k>=M){e.onDateChange(null),N();return}e.onDateChange(new Date(k))},50)}function N(){q(a,!1),o&&(clearInterval(o),o=null)}Ne(()=>{if(g(n)){const I=new ResizeObserver(M=>{q(i,M[0]?.contentRect.width??0,!0)});return I.observe(g(n)),()=>I.disconnect()}});var S=qn(),W=at(S);{let I=nt(()=>g(a)?"Pause":"Play");on(W,{variant:"ghost",size:"icon",class:"play-btn",onclick:D,get title(){return g(I)},children:(M,E)=>{var A=Qe(),k=ke(A);{var j=L=>{Zn(L,{size:14})},R=L=>{Wn(L,{size:14})};Kt(k,L=>{g(a)?L(j):L(R,!1)})}ht(M,A)},$$slots:{default:!0}})}var F=gt(W,2),$=gt(at(F),2);ce($,21,()=>Array.from(g(f).map.entries()),fe,(I,M)=>{var E=nt(()=>$e(g(M),2));let A=()=>g(E)[0],k=()=>g(E)[1];const j=nt(()=>(A()-g(f).minTime)/(g(f).maxTime-g(f).minTime)),R=nt(()=>k().length/g(C)),L=nt(()=>.05+.95*g(R)*g(R));var U=Kn();let K;yt(()=>K=kt(U,"",K,{left:`${g(j)*100}%`,opacity:g(L)})),ht(I,U)}),it($);var G=gt($,2);let ft;var Q=gt(G,2);ce(Q,21,()=>g(d),fe,(I,M)=>{var E=Qn();let A;var k=at(E,!0);it(E),yt(()=>{A=kt(E,"",A,{left:`${g(M).x*100}%`}),It(k,g(M).label)}),ht(I,E)}),it(Q);var ot=gt(Q,2);{var wt=I=>{var M=Jn();let E;var A=at(M),k=at(A,!0);it(A);var j=gt(A,2),R=at(j);it(j),it(M),yt(L=>{E=kt(M,"",E,{left:`${g(c).x??""}px`}),It(k,L),It(R,`${g(c).count??""} ${g(c).count===1?"entity":"entities"}`)},[()=>g(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),ht(I,M)};Kt(ot,I=>{g(c)&&!g(r)&&I(wt)})}it(F),it(S),Ee(S,I=>q(n,I),()=>g(n)),yt(()=>ft=kt(G,"",ft,{left:`${g(v)*100}%`})),Tt("pointerdown",F,p),Tt("pointermove",F,s),Tt("pointerup",F,h),le("pointerleave",F,x),ht(t,S),Ft()}Ae(["pointerdown","pointermove","pointerup"]);var ti=Dt("<!> <!> <!>",1);function yi(t,e){Bt(e,!0),se.showGraph();let n=pt(null);const i=nt(()=>{const f=new Map;for(const C of Wt.repos)for(const d of C.entities)f.set(d.id,d.title);return f}),r=nt(()=>{const f=[];for(const C of Wt.repos)for(const d of C.entities)d.id.toLowerCase().startsWith("readme")||f.push(d);return f}),a=nt(()=>{const f=[],C=[],d=new Set,v=new Set,b=g(n)?.getTime()??1/0;for(const s of Wt.repos)for(const h of s.entities){if(h.id.toLowerCase().startsWith("readme")||d.has(h.id)||(h.createdAt?new Date(h.createdAt).getTime():0)>b)continue;d.add(h.id),f.push({id:h.id,type:h.entityType,repo:s.name});const D=h.wikilinks??[];for(const m of D){const N=h.id<m?`${h.id}|${m}`:`${m}|${h.id}`;!v.has(N)&&h.id!==m&&(v.add(N),C.push({source:h.id,target:m}))}}const p=C.filter(s=>d.has(s.source)&&d.has(s.target));return{nodes:f,edges:p}});var c=ti(),o=ke(c);tn(o,{activeView:"graph"});var u=gt(o,2);On(u,{get graphData(){return g(a)},get selectedEntityId(){return se.selectedId},get nameMap(){return g(i)},get filteredIds(){return Wt.filteredIds},get sidebarHoveredId(){return se.hoveredEntityId},get highlightedIds(){return an.highlightedIds}});var l=gt(u,2);$n(l,{get entities(){return g(r)},get currentDate(){return g(n)},onDateChange:f=>{q(n,f,!0)}}),ht(t,c),Ft()}export{yi as component};
|
|
2
|
+
import{d as Ae,c as Tt,a as ht,b as Dt,s as It,e as le,f as $t,g as Qe}from"../chunks/DY21hM66.js";import{p as Bt,ax as Je,aa as St,g,ag as nt,aC as Ne,aD as qe,t as yt,b as Ft,s as q,c as at,Y as pt,r as it,a5 as gt,l as Ut,d as Pt,a as ze,n as Se,m as Zt,a4 as ke,bp as $e}from"../chunks/Bo0CMKlC.js";import{V as tn}from"../chunks/B3OdLZwd.js";import{_ as en}from"../chunks/PPVm8Dsz.js";import{e as ce,i as fe}from"../chunks/B3cgneCL.js";import{s as nn}from"../chunks/Cbba0X2k.js";import{c as kt,a as Pe}from"../chunks/DNfruFPs.js";import{b as Ee,i as Kt}from"../chunks/BbsQ7LcO.js";import{p as mt,l as Qt}from"../chunks/CdoeTcKU.js";import{g as rn}from"../chunks/D5GOt_JW.js";import{e as Mt}from"../chunks/CA7sXyoK.js";import{B as on}from"../chunks/DVpZtGWL.js";import{i as Re}from"../chunks/BpQkNqbd.js";import{n as se}from"../chunks/Dw9UPwc-.js";import{w as Wt}from"../chunks/BOcEeypC.js";import{c as an}from"../chunks/B-46Slz_.js";function sn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Le(this.cover(e,n),e,n,t)}function Le(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a=t._root,c={data:i},o=t._x0,u=t._y0,l=t._x1,f=t._y1,C,d,v,b,p,s,h,x;if(!a)return t._root=c,t;for(;a.length;)if((p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d,r=a,!(a=a[h=s<<1|p]))return r[h]=c,t;if(v=+t._x.call(null,a.data),b=+t._y.call(null,a.data),e===v&&n===b)return c.next=a,r?r[h]=c:t._root=c,t;do r=r?r[h]=new Array(4):t._root=new Array(4),(p=e>=(C=(o+l)/2))?o=C:l=C,(s=n>=(d=(u+f)/2))?u=d:f=d;while((h=s<<1|p)===(x=(b>=d)<<1|v>=C));return r[x]=a,r[h]=c,t}function ln(t){var e,n,i=t.length,r,a,c=new Array(i),o=new Array(i),u=1/0,l=1/0,f=-1/0,C=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(c[n]=r,o[n]=a,r<u&&(u=r),r>f&&(f=r),a<l&&(l=a),a>C&&(C=a));if(u>f||l>C)return this;for(this.cover(u,l).cover(f,C),n=0;n<i;++n)Le(this,c[n],o[n],t[n]);return this}function cn(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var c=r-n||1,o=this._root,u,l;n>t||t>=r||i>e||e>=a;)switch(l=(e<i)<<1|t<n,u=new Array(4),u[l]=o,o=u,c*=2,l){case 0:r=n+c,a=i+c;break;case 1:n=r-c,a=i+c;break;case 2:r=n+c,i=a-c;break;case 3:n=r-c,i=a-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function fn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function un(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function st(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function hn(t,e,n){var i,r=this._x0,a=this._y0,c,o,u,l,f=this._x1,C=this._y1,d=[],v=this._root,b,p;for(v&&d.push(new st(v,r,a,f,C)),n==null?n=1/0:(r=t-n,a=e-n,f=t+n,C=e+n,n*=n);b=d.pop();)if(!(!(v=b.node)||(c=b.x0)>f||(o=b.y0)>C||(u=b.x1)<r||(l=b.y1)<a))if(v.length){var s=(c+u)/2,h=(o+l)/2;d.push(new st(v[3],s,h,u,l),new st(v[2],c,h,s,l),new st(v[1],s,o,u,h),new st(v[0],c,o,s,h)),(p=(e>=h)<<1|t>=s)&&(b=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=b)}else{var x=t-+this._x.call(null,v.data),D=e-+this._y.call(null,v.data),m=x*x+D*D;if(m<n){var N=Math.sqrt(n=m);r=t-N,a=e-N,f=t+N,C=e+N,i=v.data}}return i}function dn(t){if(isNaN(f=+this._x.call(null,t))||isNaN(C=+this._y.call(null,t)))return this;var e,n=this._root,i,r,a,c=this._x0,o=this._y0,u=this._x1,l=this._y1,f,C,d,v,b,p,s,h;if(!n)return this;if(n.length)for(;;){if((b=f>=(d=(c+u)/2))?c=d:u=d,(p=C>=(v=(o+l)/2))?o=v:l=v,e=n,!(n=n[s=p<<1|b]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(i=e,h=s)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):e?(a?e[s]=a:delete e[s],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[h]=n:this._root=n),this):(this._root=a,this)}function gn(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function vn(){return this._root}function pn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function yn(t){var e=[],n,i=this._root,r,a,c,o,u;for(i&&e.push(new st(i,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(i=n.node,a=n.x0,c=n.y0,o=n.x1,u=n.y1)&&i.length){var l=(a+o)/2,f=(c+u)/2;(r=i[3])&&e.push(new st(r,l,f,o,u)),(r=i[2])&&e.push(new st(r,a,f,l,u)),(r=i[1])&&e.push(new st(r,l,c,o,f)),(r=i[0])&&e.push(new st(r,a,c,l,f))}return this}function mn(t){var e=[],n=[],i;for(this._root&&e.push(new st(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var r=i.node;if(r.length){var a,c=i.x0,o=i.y0,u=i.x1,l=i.y1,f=(c+u)/2,C=(o+l)/2;(a=r[0])&&e.push(new st(a,c,o,f,C)),(a=r[1])&&e.push(new st(a,f,o,u,C)),(a=r[2])&&e.push(new st(a,c,C,f,l)),(a=r[3])&&e.push(new st(a,f,C,u,l))}n.push(i)}for(;i=n.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function xn(t){return t[0]}function wn(t){return arguments.length?(this._x=t,this):this._x}function _n(t){return t[1]}function bn(t){return arguments.length?(this._y=t,this):this._y}function de(t,e,n){var i=new ge(e??xn,n??_n,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function ge(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function ye(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var ct=de.prototype=ge.prototype;ct.copy=function(){var t=new ge(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,i;if(!e)return t;if(!e.length)return t._root=ye(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(i=e.source[r])&&(i.length?n.push({source:i,target:e.target[r]=new Array(4)}):e.target[r]=ye(i));return t};ct.add=sn;ct.addAll=ln;ct.cover=cn;ct.data=fn;ct.extent=un;ct.find=hn;ct.remove=dn;ct.removeAll=gn;ct.root=vn;ct.size=pn;ct.visit=yn;ct.visitAfter=mn;ct.x=wn;ct.y=bn;function lt(t){return function(){return t}}function xt(t){return(t()-.5)*1e-6}function Mn(t){return t.x+t.vx}function Tn(t){return t.y+t.vy}function me(t){var e,n,i,r=1,a=1;typeof t!="function"&&(t=lt(t==null?1:+t));function c(){for(var l,f=e.length,C,d,v,b,p,s,h=0;h<a;++h)for(C=de(e,Mn,Tn).visitAfter(o),l=0;l<f;++l)d=e[l],p=n[d.index],s=p*p,v=d.x+d.vx,b=d.y+d.vy,C.visit(x);function x(D,m,N,S,W){var F=D.data,$=D.r,G=p+$;if(F){if(F.index>d.index){var ft=v-F.x-F.vx,Q=b-F.y-F.vy,ot=ft*ft+Q*Q;ot<G*G&&(ft===0&&(ft=xt(i),ot+=ft*ft),Q===0&&(Q=xt(i),ot+=Q*Q),ot=(G-(ot=Math.sqrt(ot)))/ot*r,d.vx+=(ft*=ot)*(G=($*=$)/(s+$)),d.vy+=(Q*=ot)*G,F.vx-=ft*(G=1-G),F.vy-=Q*G)}return}return m>v+G||S<v-G||N>b+G||W<b-G}}function o(l){if(l.data)return l.r=n[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(e){var l,f=e.length,C;for(n=new Array(f),l=0;l<f;++l)C=e[l],n[C.index]=+t(C,l,e)}}return c.initialize=function(l,f){e=l,i=f,u()},c.iterations=function(l){return arguments.length?(a=+l,c):a},c.strength=function(l){return arguments.length?(r=+l,c):r},c.radius=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),u(),c):t},c}function In(t){return t.index}function xe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function we(t){var e=In,n=C,i,r=lt(30),a,c,o,u,l,f=1;t==null&&(t=[]);function C(s){return 1/Math.min(o[s.source.index],o[s.target.index])}function d(s){for(var h=0,x=t.length;h<f;++h)for(var D=0,m,N,S,W,F,$,G;D<x;++D)m=t[D],N=m.source,S=m.target,W=S.x+S.vx-N.x-N.vx||xt(l),F=S.y+S.vy-N.y-N.vy||xt(l),$=Math.sqrt(W*W+F*F),$=($-a[D])/$*s*i[D],W*=$,F*=$,S.vx-=W*(G=u[D]),S.vy-=F*G,N.vx+=W*(G=1-G),N.vy+=F*G}function v(){if(c){var s,h=c.length,x=t.length,D=new Map(c.map((N,S)=>[e(N,S,c),N])),m;for(s=0,o=new Array(h);s<x;++s)m=t[s],m.index=s,typeof m.source!="object"&&(m.source=xe(D,m.source)),typeof m.target!="object"&&(m.target=xe(D,m.target)),o[m.source.index]=(o[m.source.index]||0)+1,o[m.target.index]=(o[m.target.index]||0)+1;for(s=0,u=new Array(x);s<x;++s)m=t[s],u[s]=o[m.source.index]/(o[m.source.index]+o[m.target.index]);i=new Array(x),b(),a=new Array(x),p()}}function b(){if(c)for(var s=0,h=t.length;s<h;++s)i[s]=+n(t[s],s,t)}function p(){if(c)for(var s=0,h=t.length;s<h;++s)a[s]=+r(t[s],s,t)}return d.initialize=function(s,h){c=s,l=h,v()},d.links=function(s){return arguments.length?(t=s,v(),d):t},d.id=function(s){return arguments.length?(e=s,d):e},d.iterations=function(s){return arguments.length?(f=+s,d):f},d.strength=function(s){return arguments.length?(n=typeof s=="function"?s:lt(+s),b(),d):n},d.distance=function(s){return arguments.length?(r=typeof s=="function"?s:lt(+s),p(),d):r},d}var Cn={value:()=>{}};function Ve(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new jt(n)}function jt(t){this._=t}function Dn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}jt.prototype=Ve.prototype={constructor:jt,on:function(t,e){var n=this._,i=Dn(t+"",n),r,a=-1,c=i.length;if(arguments.length<2){for(;++a<c;)if((r=(t=i[a]).type)&&(r=An(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<c;)if(r=(t=i[a]).type)n[r]=_e(n[r],t.name,e);else if(e==null)for(r in n)n[r]=_e(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function An(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function _e(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Et=0,Lt=0,Rt=0,Xe=1e3,Jt,Vt,qt=0,Ct=0,te=0,Xt=typeof performance=="object"&&performance.now?performance:Date,Be=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Fe(){return Ct||(Be(Nn),Ct=Xt.now()+te)}function Nn(){Ct=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Ye.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Fe():+n)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:Jt=this,Vt=this),this._call=t,this._time=n,he()},stop:function(){this._call&&(this._call=null,this._time=1/0,he())}};function Ye(t,e,n){var i=new ue;return i.restart(t,e,n),i}function zn(){Fe(),++Et;for(var t=Jt,e;t;)(e=Ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Et}function be(){Ct=(qt=Xt.now())+te,Et=Lt=0;try{zn()}finally{Et=0,kn(),Ct=0}}function Sn(){var t=Xt.now(),e=t-qt;e>Xe&&(te-=e,qt=t)}function kn(){for(var t,e=Jt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);Vt=t,he(i)}function he(t){if(!Et){Lt&&(Lt=clearTimeout(Lt));var e=t-Ct;e>24?(t<1/0&&(Lt=setTimeout(be,t-Xt.now()-te)),Rt&&(Rt=clearInterval(Rt))):(Rt||(qt=Xt.now(),Rt=setInterval(Sn,Xe)),Et=1,Be(be))}}const Pn=1664525,En=1013904223,Me=4294967296;function Rn(){let t=1;return()=>(t=(Pn*t+En)%Me)/Me}function Ln(t){return t.x}function Vn(t){return t.y}var Xn=10,Bn=Math.PI*(3-Math.sqrt(5));function Te(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,c=.6,o=new Map,u=Ye(C),l=Ve("tick","end"),f=Rn();t==null&&(t=[]);function C(){d(),l.call("tick",e),n<i&&(u.stop(),l.call("end",e))}function d(p){var s,h=t.length,x;p===void 0&&(p=1);for(var D=0;D<p;++D)for(n+=(a-n)*r,o.forEach(function(m){m(n)}),s=0;s<h;++s)x=t[s],x.fx==null?x.x+=x.vx*=c:(x.x=x.fx,x.vx=0),x.fy==null?x.y+=x.vy*=c:(x.y=x.fy,x.vy=0);return e}function v(){for(var p=0,s=t.length,h;p<s;++p){if(h=t[p],h.index=p,h.fx!=null&&(h.x=h.fx),h.fy!=null&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var x=Xn*Math.sqrt(.5+p),D=p*Bn;h.x=x*Math.cos(D),h.y=x*Math.sin(D)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function b(p){return p.initialize&&p.initialize(t,f),p}return v(),e={tick:d,restart:function(){return u.restart(C),e},stop:function(){return u.stop(),e},nodes:function(p){return arguments.length?(t=p,v(),o.forEach(b),e):t},alpha:function(p){return arguments.length?(n=+p,e):n},alphaMin:function(p){return arguments.length?(i=+p,e):i},alphaDecay:function(p){return arguments.length?(r=+p,e):+r},alphaTarget:function(p){return arguments.length?(a=+p,e):a},velocityDecay:function(p){return arguments.length?(c=1-p,e):1-c},randomSource:function(p){return arguments.length?(f=p,o.forEach(b),e):f},force:function(p,s){return arguments.length>1?(s==null?o.delete(p):o.set(p,b(s)),e):o.get(p)},find:function(p,s,h){var x=0,D=t.length,m,N,S,W,F;for(h==null?h=1/0:h*=h,x=0;x<D;++x)W=t[x],m=p-W.x,N=s-W.y,S=m*m+N*N,S<h&&(F=W,h=S);return F},on:function(p,s){return arguments.length>1?(l.on(p,s),e):l.on(p)}}}function Ie(){var t,e,n,i,r=lt(-30),a,c=1,o=1/0,u=.81;function l(v){var b,p=t.length,s=de(t,Ln,Vn).visitAfter(C);for(i=v,b=0;b<p;++b)e=t[b],s.visit(d)}function f(){if(t){var v,b=t.length,p;for(a=new Array(b),v=0;v<b;++v)p=t[v],a[p.index]=+r(p,v,t)}}function C(v){var b=0,p,s,h=0,x,D,m;if(v.length){for(x=D=m=0;m<4;++m)(p=v[m])&&(s=Math.abs(p.value))&&(b+=p.value,h+=s,x+=s*p.x,D+=s*p.y);v.x=x/h,v.y=D/h}else{p=v,p.x=p.data.x,p.y=p.data.y;do b+=a[p.data.index];while(p=p.next)}v.value=b}function d(v,b,p,s){if(!v.value)return!0;var h=v.x-e.x,x=v.y-e.y,D=s-b,m=h*h+x*x;if(D*D/u<m)return m<o&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)),e.vx+=h*v.value*i/m,e.vy+=x*v.value*i/m),!0;if(v.length||m>=o)return;(v.data!==e||v.next)&&(h===0&&(h=xt(n),m+=h*h),x===0&&(x=xt(n),m+=x*x),m<c&&(m=Math.sqrt(c*m)));do v.data!==e&&(D=a[v.data.index]*i/m,e.vx+=h*D,e.vy+=x*D);while(v=v.next)}return l.initialize=function(v,b){t=v,n=b,f()},l.strength=function(v){return arguments.length?(r=typeof v=="function"?v:lt(+v),f(),l):r},l.distanceMin=function(v){return arguments.length?(c=v*v,l):Math.sqrt(c)},l.distanceMax=function(v){return arguments.length?(o=v*v,l):Math.sqrt(o)},l.theta=function(v){return arguments.length?(u=v*v,l):Math.sqrt(u)},l}function Ce(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vx+=(r[u]-f.x)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.x=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}function De(t){var e=lt(.1),n,i,r;typeof t!="function"&&(t=lt(t==null?0:+t));function a(o){for(var u=0,l=n.length,f;u<l;++u)f=n[u],f.vy+=(r[u]-f.y)*i[u]*o}function c(){if(n){var o,u=n.length;for(i=new Array(u),r=new Array(u),o=0;o<u;++o)i[o]=isNaN(r[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:lt(+o),c(),a):e},a.y=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),c(),a):t},a}var Fn=Dt('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),Yn=Dt('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><div class="legend-panel svelte-1i33fky"></div></div></div>');function On(t,e){Bt(e,!0);let n=mt(e,"selectedEntityId",3,null),i=mt(e,"filteredIds",3,null),r=mt(e,"sidebarHoveredId",3,null),a=mt(e,"highlightedIds",3,null);function c(y){return e.nameMap?.get(y)??y.replace(/-/g," ").replace(/\b\w/g,w=>w.toUpperCase())}const o=Je("theme"),u=nt(()=>o.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),l=nt(()=>o.current==="light"?16316666:592139),f=.75;St(()=>{o.current,K&&(K.style.fill=g(u).labelText);const y=g(Gt);for(const w of b)Mt(w.type)===Nt&&(w.color=y);et()}),St(()=>{i(),et()}),St(()=>{a(),et()}),St(()=>{n(),et()});let C=!1;St(()=>{const y=e.graphData;if(!tt||!A||!R)return;if(!C){C=!0;return}const w=new Map;for(const T of y.edges)w.set(T.source,(w.get(T.source)??0)+1),w.set(T.target,(w.get(T.target)??0)+1);const _=new Map;for(const T of b)_.set(T.id,{x:T.x,y:T.y});const Y=3600*y.nodes.length,O=Math.sqrt(Y),B=y.nodes.map(T=>{const H=w.get(T.id)??0,dt=_.get(T.id);return{id:T.id,type:T.type,repo:T.repo,color:Mt(T.type)===Nt?g(Gt):Mt(T.type),weight:H,x:dt?.x??(Math.random()-.5)*O,y:dt?.y??(Math.random()-.5)*O,vx:0,vy:0,r:At(H)}}),Z=new Map;for(const T of B)Z.set(T.id,T);const rt=new Set(L.keys()),ut=new Set(y.nodes.map(T=>T.id));for(const T of rt)if(!ut.has(T)){const H=L.get(T);H&&(R.removeChild(H),H.destroy()),L.delete(T)}let X=null;if(L.size>0&&(X=L.values().next().value?.texture),!X){const T=document.createElement("canvas");T.width=100,T.height=100;const H=T.getContext("2d");H.beginPath(),H.arc(50,50,48,0,Math.PI*2),H.fillStyle="#ffffff",H.fill(),X=tt.Texture.from(T)}for(const T of B){let H=L.get(T.id);H||(H=new tt.Sprite(X),H.anchor.set(.5),R.addChild(H),L.set(T.id,H)),H.tint=Ot(T.color)}b=B,v?.stop();const vt=y.edges.map(T=>({source:T.source,target:T.target})),V=we(vt).id(T=>T.id).distance(250);v=Te(b).force("link",V).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(.3).on("tick",()=>{ot||ne(),et()}),p=V.links(),N=null,Yt(),et()}),St(()=>{const y=r();if(y){const w=b.find(_=>_.id===y)??null;N=w,Yt(),M=w?1:0}else S||(M=0);et()});let d,v=null,b=[],p=[],s=!1,h=0,x=0,D=0,m=1,N=null,S=null,W=pt(!1),F=0,$=0,G=0,ft=0,Q=new Set,ot=!1,wt=pt(null),I=0,M=0;const E=4;let A=null,k=null,j=null,R=null,L=new Map,U=null,K=null,tt=null;function At(y){return Math.max(3,Math.min(Math.sqrt(y+1)+2,10))}function ee(y,w){const _=d.getBoundingClientRect();return{x:(y-_.left-x)/m,y:(w-_.top-D)/m}}function ve(y,w){for(let _=b.length-1;_>=0;_--){const P=b[_],Y=y-P.x,O=w-P.y,B=(P.r*1.5+4)/m;if(Y*Y+O*O<=B*B)return P}return null}function Yt(){const y=N??null;if(Q.clear(),!!y){Q.add(y.id);for(const w of p)w.source.id===y.id&&Q.add(w.target.id),w.target.id===y.id&&Q.add(w.source.id);if(R){const w=L.get(y.id);w&&R.setChildIndex(w,R.children.length-1)}}}function ne(){if(b.length===0||!d)return;let y=1/0,w=-1/0,_=1/0,P=-1/0,Y=0;for(const X of b)X.x<y&&(y=X.x),X.x>w&&(w=X.x),X.y<_&&(_=X.y),X.y>P&&(P=X.y),X.r>Y&&(Y=X.r);const O=d.clientWidth,B=d.clientHeight,Z=w-y,rt=P-_;if(Z===0||rt===0)return;const ut=(60+Y)*2;m=Math.min((O-ut)/Z,(B-ut)/rt,3),x=O/2-(y+w)/2*m,D=B/2-(_+P)/2*m,et()}function et(){s=!0,h=0}function Ot(y){return parseInt(y.replace("#",""),16)}function _t(y,w,_){const P=(y>>16&255)+_*((w>>16&255)-(y>>16&255)),Y=(y>>8&255)+_*((w>>8&255)-(y>>8&255)),O=(y&255)+_*((w&255)-(y&255));return Math.round(P)<<16|Math.round(Y)<<8|Math.round(O)}function Oe(){if(!tt||!k||!j)return;k.clear(),j.clear();const w=N!==null,_=I,P=g(wt),Y=a(),O=i(),B=g(u).default,Z=g(u).dim,rt=g(u).conn;for(let ut=0;ut<p.length;ut++){const X=p[ut],vt=X.source.x*m+x,V=X.source.y*m+D,T=X.target.x*m+x,H=X.target.y*m+D,dt=w&&_>.01&&Q.has(X.source.id)&&Q.has(X.target.id);let z=B;w&&_>.01?z=dt?_t(B,rt,_):_t(B,Z,_):(P!==null||Y!==null||O!==null)&&(z=Z);const J=dt?j:k,zt=dt?1:.2;J.setStrokeStyle({width:1,color:z,alpha:zt}),J.moveTo(vt,V),J.lineTo(T,H),J.stroke()}}function He(){if(!tt)return;const y=N,w=y!==null,_=I,P=g(wt),Y=a(),O=i(),B=!y&&n()?b.find(V=>V.id===n())??null:null,Z=new Set;if(B){Z.add(B.id);for(const V of p)V.source.id===B.id&&Z.add(V.target.id),V.target.id===B.id&&Z.add(V.source.id)}for(const V of b){const T=L.get(V.id);if(!T)continue;const H=V.x*m+x,dt=V.y*m+D;T.position.set(H,dt),T.scale.set(V.r/50),T.alpha=1;const z=Ot(V.color);if(B&&!y){const J=Z.has(V.id);T.tint=J?z:_t(z,g(l),f)}else{const J=V===y,zt=w&&Q.has(V.id),Ze=P!==null&&(P==="other"?Mt(V.type)===Nt:V.type===P);if(J&&_>.01)T.tint=z,T.scale.set(V.r*(1+_*.4)/50);else if(zt)T.tint=z;else if(P!==null)T.tint=Ze?z:_t(z,g(l),f);else if(Y!==null){const ae=Y.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else if(O!==null){const ae=O.has(V.id)?_*f:f;T.tint=_t(z,g(l),ae)}else T.tint=_t(z,g(l),_*f)}}const rt=y??B,ut=y?_>.01:!!B;if(rt&&ut&&U){U.visible=!0;const V=rt.x*m+x,T=rt.y*m+D;U.position.set(V,T),U.scale.set(rt.r*5/64),U.alpha=y?_*.25:.25,U.tint=Ot(rt.color)}else U&&(U.visible=!1);const X=y??B,vt=y?_>.01:!!B;if(X&&vt&&K){const V=X.x*m+x,T=X.y*m+D;K.text=c(X.id),K.style.fontSize=12,K.position.set(V,T+X.r+8),K.alpha=y?_:1,K.visible=!0}else K&&(K.visible=!1)}let Ht=!1;function Ge(y){if(y.button!==0)return;Ht=!1;const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?(S=_,ot=!0,_.fx=_.x,_.fy=_.y,v?.alphaTarget(.3).restart(),et()):(q(W,!0),F=y.clientX,$=y.clientY,G=x,ft=D),d.setPointerCapture(y.pointerId),window.addEventListener("pointerup",ie,{once:!0})}function We(y){if(S){Ht=!0;const w=ee(y.clientX,y.clientY);S.fx=w.x,S.fy=w.y,et()}else if(g(W))Ht=!0,x=G+(y.clientX-F),D=ft+(y.clientY-$),et();else{const w=ee(y.clientX,y.clientY),_=ve(w.x,w.y);_?_!==N?(N&&(I=.15),N=_,Yt(),M=1,d.style.cursor="pointer",et()):M!==1&&(M=1,d.style.cursor="pointer",et()):M!==0&&(M=0,d.style.cursor="grab",et())}}function ie(y){if(!S&&!g(W))return;window.removeEventListener("pointerup",ie);const w=Ht;if(S){const _=S;S.fx=null,S.fy=null,v?.alphaTarget(0),S=null,M=0,et(),w||rn(`/${_.repo}/${_.type}/${_.id}`)}else g(W)&&q(W,!1);try{d.releasePointerCapture(y.pointerId)}catch{}}const Nt="#5c5c66",je="#b0b0b8",Gt=nt(()=>o.current==="light"?je:Nt),Ue=nt(()=>{const y=new Map;for(const P of e.graphData.nodes)y.set(P.type,(y.get(P.type)??0)+1);const w=[];let _=0;for(const[P,Y]of y){const O=Mt(P);O===Nt?_+=Y:w.push({name:P,color:O,count:Y})}return w.sort((P,Y)=>Y.count-P.count),_>0&&w.push({name:"other",color:g(Gt),count:_}),w});Ne(async()=>{tt=await en(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),A=new tt.Application,await A.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:d}),d.insertBefore(A.canvas,d.firstChild),A.canvas.style.position="absolute",A.canvas.style.inset="0",k=new tt.Graphics,A.stage.addChild(k),j=new tt.Graphics,A.stage.addChild(j),R=new tt.Container,A.stage.addChild(R);const y=document.createElement("canvas");y.width=128,y.height=128;const w=y.getContext("2d"),_=w.createRadialGradient(64,64,0,64,64,64);_.addColorStop(0,"rgba(255,255,255,0.5)"),_.addColorStop(1,"rgba(255,255,255,0)"),w.fillStyle=_,w.fillRect(0,0,128,128);const P=tt.Texture.from(y);U=new tt.Sprite(P),U.anchor.set(.5),U.visible=!1,A.stage.addChild(U);const Y=document.createElement("canvas");Y.width=100,Y.height=100;const O=Y.getContext("2d");O.beginPath(),O.arc(50,50,48,0,Math.PI*2),O.fillStyle="#ffffff",O.fill();const B=tt.Texture.from(Y),Z=new Map;for(const z of e.graphData.edges)Z.set(z.source,(Z.get(z.source)??0)+1),Z.set(z.target,(Z.get(z.target)??0)+1);const rt=new Map,X=3600*e.graphData.nodes.length,vt=Math.sqrt(X);b=e.graphData.nodes.map(z=>{const J=Z.get(z.id)??0,zt={id:z.id,type:z.type,repo:z.repo,color:Mt(z.type)===Nt?g(Gt):Mt(z.type),weight:J,x:(Math.random()-.5)*vt,y:(Math.random()-.5)*vt,vx:0,vy:0,r:At(J)};return rt.set(z.id,zt),zt});for(const z of b){const J=new tt.Sprite(B);J.anchor.set(.5),J.tint=Ot(z.color),R.addChild(J),L.set(z.id,J)}K=new tt.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:g(u).labelText,align:"center"}}),K.anchor.set(.5,0),K.visible=!1,A.stage.addChild(K);const V=e.graphData.edges.map(z=>({source:z.source,target:z.target})),T=we(V).id(z=>z.id).distance(250);v=Te(b).force("link",T).force("charge",Ie().strength(-1e3).distanceMin(30)).force("x",Ce(0).strength(.1)).force("y",De(0).strength(.1)).force("collide",me().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{ot||ne(),et()}),p=T.links();let H=0;A.ticker.add(()=>{const z=performance.now(),J=H?Math.min((z-H)/1e3,.05):.016;H=z,I<M?(I=Math.min(M,I+E*J),s=!0):I>M&&(I=Math.max(M,I-E*J),s=!0),I===0&&M===0&&N&&!S&&(N=null,Yt(),s=!0),(s||h<120)&&(Oe(),He(),s=!1,h++)});const dt=new ResizeObserver(()=>{A.renderer.resize(d.clientWidth,d.clientHeight),ne()});return dt.observe(d),()=>{dt.disconnect()}}),qe(()=>{v?.stop(),A&&(A.destroy(!0,{children:!0}),A=null)});var re=Yn(),bt=at(re);let pe;var oe=at(bt);ce(oe,21,()=>g(Ue),fe,(y,w)=>{var _=Fn();let P;var Y=at(_);let O;var B=gt(Y,2),Z=at(B,!0);it(B);var rt=gt(B,2),ut=at(rt,!0);it(rt),it(_),yt(()=>{P=nn(_,1,"legend-item svelte-1i33fky",null,P,{"legend-item-active":g(wt)===g(w).name}),O=kt(Y,"",O,{background:g(w).color}),It(Z,g(w).name),It(ut,g(w).count)}),le("mouseenter",_,()=>{q(wt,g(w).name,!0),et()}),le("mouseleave",_,()=>{q(wt,null),et()}),ht(y,_)}),it(oe),it(bt),Ee(bt,y=>d=y,()=>d),it(re),yt(()=>pe=kt(bt,"",pe,{cursor:g(W)?"grabbing":"grab"})),Tt("pointerdown",bt,Ge),Tt("pointermove",bt,We),Tt("pointerup",bt,ie),Tt("pointerdown",oe,y=>y.stopPropagation()),ht(t,re),Ft()}Ae(["pointerdown","pointermove","pointerup"]);var Hn=$t("<title> </title>"),Gn=$t('<svg><!><path d="M7,28a1,1,0,0,1-1-1V5a1,1,0,0,1,1.4819-.8763l20,11a1,1,0,0,1,0,1.7525l-20,11A1.0005,1.0005,0,0,1,7,28ZM8,6.6909V25.3088L24.9248,16Z"></path></svg>');function Wn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Bt(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Gn();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=Hn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(),it(u),ht(t,u),Ft()}var jn=$t("<title> </title>"),Un=$t('<svg><!><path d="M12,8V24H8V8h4m0-2H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path><path d="M24,8V24H20V8h4m0-2H20a2,2,0,0,0-2,2V24a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Zn(t,e){const n=Qt(e,["children","$$slots","$$events","$$legacy"]),i=Qt(n,["size","title"]);Bt(e,!1);const r=Zt(),a=Zt();let c=mt(e,"size",8,16),o=mt(e,"title",8,void 0);Ut(()=>(Pt(n),Pt(o())),()=>{q(r,n["aria-label"]||n["aria-labelledby"]||o())}),Ut(()=>(g(r),Pt(n)),()=>{q(a,{"aria-hidden":g(r)?void 0:!0,role:g(r)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),ze(),Re();var u=Un();Pe(u,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:c(),height:c(),...g(a),...i}));var l=at(u);{var f=C=>{var d=jn(),v=at(d,!0);it(d),yt(()=>It(v,o())),ht(C,d)};Kt(l,C=>{o()&&C(f)})}Se(2),it(u),ht(t,u),Ft()}var Kn=Dt('<div class="density-bar svelte-lzvab"></div>'),Qn=Dt('<span class="date-label svelte-lzvab"> </span>'),Jn=Dt('<div class="timeline-tooltip svelte-lzvab"><div class="tooltip-date svelte-lzvab"> </div> <div class="tooltip-count svelte-lzvab"> </div></div>'),qn=Dt('<div class="timeline-bar svelte-lzvab"><!> <div class="timeline-track svelte-lzvab"><div class="track-line svelte-lzvab"></div> <div class="density-bars svelte-lzvab"></div> <div class="playhead svelte-lzvab"></div> <div class="date-labels svelte-lzvab"></div> <!></div></div>');function $n(t,e){Bt(e,!0);let n=pt(null),i=pt(0),r=pt(!1),a=pt(!1),c=pt(null),o=null;const u=nt(()=>{let I=1/0,M=-1/0;for(const E of e.entities){const A=E.createdAt?new Date(E.createdAt).getTime():0;A>0&&A<I&&(I=A),A>M&&(M=A)}return I===1/0&&(I=Date.now()),M===-1/0&&(M=Date.now()),{min:I,max:M}}),l=nt(()=>{let{min:I,max:M}=g(u);return M-I<864e5&&(I-=864e5*15,M+=864e5*15),{min:new Date(I),max:new Date(M)}}),f=nt(()=>{const M=g(l).min.getTime(),E=g(l).max.getTime(),A=new Map;for(const k of e.entities){const j=k.createdAt?new Date(k.createdAt).getTime():0;if(j<=0)continue;const R=Math.floor((j-M)/864e5),L=M+R*864e5,U=A.get(L)??[];U.push(k),A.set(L,U)}return{map:A,minTime:M,maxTime:E,dayMs:864e5}}),C=nt(()=>{let I=0;for(const M of g(f).map.values())M.length>I&&(I=M.length);return Math.max(1,I)}),d=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I,A=[],k=Math.max(4,Math.min(8,Math.floor(g(i)/100))),j=E/k;for(let R=0;R<=k;R++){const L=I+R*j,K=new Date(L).toLocaleDateString("en-US",{month:"short",day:"numeric"});A.push({label:K,x:R/k})}return A}),v=nt(()=>{const{minTime:I,maxTime:M}=g(f),E=M-I;if(E<=0)return .5;const A=e.currentDate?e.currentDate.getTime():g(u).max,k=Math.max(g(u).min,Math.min(g(u).max,A));return Math.max(0,Math.min(1,(k-I)/E))});function b(I){if(!g(n))return new Date;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=Math.max(0,Math.min(1,(I-M.left-E)/k)),{minTime:R,maxTime:L}=g(f),U=R+j*(L-R);return new Date(Math.max(g(u).min,Math.min(g(u).max,U)))}function p(I){q(r,!0),N();const M=b(I.clientX);e.onDateChange(M),I.target.setPointerCapture(I.pointerId)}function s(I){if(g(r)&&e.onDateChange(b(I.clientX)),!g(n))return;const M=g(n).getBoundingClientRect(),E=40,k=M.width-E-12,j=(I.clientX-M.left-E)/k;if(j<0||j>1){q(c,null);return}const{minTime:R,dayMs:L,map:U}=g(f),K=R+j*(g(f).maxTime-R),tt=R+Math.floor((K-R)/L)*L,At=U.get(tt);At&&At.length>0?q(c,{date:new Date(tt),count:At.length,x:I.clientX-M.left},!0):q(c,null)}function h(){q(r,!1)}function x(){q(c,null)}function D(){g(a)?N():m()}function m(){q(a,!0);const{min:I,max:M}=g(u),A=(M-I)/200;let k=e.currentDate?.getTime()??I;k>=M&&(k=I),o=setInterval(()=>{if(k+=A,k>=M){e.onDateChange(null),N();return}e.onDateChange(new Date(k))},50)}function N(){q(a,!1),o&&(clearInterval(o),o=null)}Ne(()=>{if(g(n)){const I=new ResizeObserver(M=>{q(i,M[0]?.contentRect.width??0,!0)});return I.observe(g(n)),()=>I.disconnect()}});var S=qn(),W=at(S);{let I=nt(()=>g(a)?"Pause":"Play");on(W,{variant:"ghost",size:"icon",class:"play-btn",onclick:D,get title(){return g(I)},children:(M,E)=>{var A=Qe(),k=ke(A);{var j=L=>{Zn(L,{size:14})},R=L=>{Wn(L,{size:14})};Kt(k,L=>{g(a)?L(j):L(R,!1)})}ht(M,A)},$$slots:{default:!0}})}var F=gt(W,2),$=gt(at(F),2);ce($,21,()=>Array.from(g(f).map.entries()),fe,(I,M)=>{var E=nt(()=>$e(g(M),2));let A=()=>g(E)[0],k=()=>g(E)[1];const j=nt(()=>(A()-g(f).minTime)/(g(f).maxTime-g(f).minTime)),R=nt(()=>k().length/g(C)),L=nt(()=>.05+.95*g(R)*g(R));var U=Kn();let K;yt(()=>K=kt(U,"",K,{left:`${g(j)*100}%`,opacity:g(L)})),ht(I,U)}),it($);var G=gt($,2);let ft;var Q=gt(G,2);ce(Q,21,()=>g(d),fe,(I,M)=>{var E=Qn();let A;var k=at(E,!0);it(E),yt(()=>{A=kt(E,"",A,{left:`${g(M).x*100}%`}),It(k,g(M).label)}),ht(I,E)}),it(Q);var ot=gt(Q,2);{var wt=I=>{var M=Jn();let E;var A=at(M),k=at(A,!0);it(A);var j=gt(A,2),R=at(j);it(j),it(M),yt(L=>{E=kt(M,"",E,{left:`${g(c).x??""}px`}),It(k,L),It(R,`${g(c).count??""} ${g(c).count===1?"entity":"entities"}`)},[()=>g(c).date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]),ht(I,M)};Kt(ot,I=>{g(c)&&!g(r)&&I(wt)})}it(F),it(S),Ee(S,I=>q(n,I),()=>g(n)),yt(()=>ft=kt(G,"",ft,{left:`${g(v)*100}%`})),Tt("pointerdown",F,p),Tt("pointermove",F,s),Tt("pointerup",F,h),le("pointerleave",F,x),ht(t,S),Ft()}Ae(["pointerdown","pointermove","pointerup"]);var ti=Dt("<!> <!> <!>",1);function yi(t,e){Bt(e,!0),se.showGraph();let n=pt(null);const i=nt(()=>{const f=new Map;for(const C of Wt.repos)for(const d of C.entities)f.set(d.id,d.title);return f}),r=nt(()=>{const f=[];for(const C of Wt.repos)for(const d of C.entities)d.id.toLowerCase().startsWith("readme")||f.push(d);return f}),a=nt(()=>{const f=[],C=[],d=new Set,v=new Set,b=g(n)?.getTime()??1/0;for(const s of Wt.repos)for(const h of s.entities){if(h.id.toLowerCase().startsWith("readme")||d.has(h.id)||(h.createdAt?new Date(h.createdAt).getTime():0)>b)continue;d.add(h.id),f.push({id:h.id,type:h.entityType,repo:s.name});const D=h.wikilinks??[];for(const m of D){const N=h.id<m?`${h.id}|${m}`:`${m}|${h.id}`;!v.has(N)&&h.id!==m&&(v.add(N),C.push({source:h.id,target:m}))}}const p=C.filter(s=>d.has(s.source)&&d.has(s.target));return{nodes:f,edges:p}});var c=ti(),o=ke(c);tn(o,{activeView:"graph"});var u=gt(o,2);On(u,{get graphData(){return g(a)},get selectedEntityId(){return se.selectedId},get nameMap(){return g(i)},get filteredIds(){return Wt.filteredIds},get sidebarHoveredId(){return se.hoveredEntityId},get highlightedIds(){return an.highlightedIds}});var l=gt(u,2);$n(l,{get entities(){return g(r)},get currentDate(){return g(n)},onDateChange:f=>{q(n,f,!0)}}),ht(t,c),Ft()}export{yi as component};
|