studiograph 1.3.43 → 1.3.44-next.0
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/core/graph.d.ts +5 -0
- package/dist/core/graph.js +93 -2
- package/dist/core/graph.js.map +1 -1
- package/dist/core/validation.d.ts +189 -119
- package/dist/core/validation.js +16 -26
- package/dist/core/validation.js.map +1 -1
- package/dist/server/routes/graph-api.js +41 -0
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/web/_app/immutable/assets/2.DNpjFx0k.css +1 -0
- package/dist/web/_app/immutable/assets/4.CjSyz-ka.css +1 -0
- package/dist/web/_app/immutable/chunks/{CP30HKCf.js → 3ONneP0Z.js} +1 -1
- package/dist/web/_app/immutable/chunks/8aEH9o48.js +1 -0
- package/dist/web/_app/immutable/chunks/B3cbqYdb.js +1 -0
- package/dist/web/_app/immutable/chunks/BBDMeJL4.js +1 -0
- package/dist/web/_app/immutable/chunks/{DNfruFPs.js → BMrbs3EC.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B3OdLZwd.js → BQZlAX3A.js} +1 -1
- package/dist/web/_app/immutable/chunks/BmP3yl81.js +1 -0
- package/dist/web/_app/immutable/chunks/{Cbba0X2k.js → Bt7P6UBm.js} +1 -1
- package/dist/web/_app/immutable/chunks/C8IfoK2g.js +1 -0
- package/dist/web/_app/immutable/chunks/{BlYD-5Z_.js → C8t_lVji.js} +1 -1
- package/dist/web/_app/immutable/chunks/CClliU_-.js +4 -0
- package/dist/web/_app/immutable/chunks/{CvT005bt.js → CDs3H3KT.js} +1 -1
- package/dist/web/_app/immutable/chunks/{9TVbAwoF.js → CRbsz2jz.js} +1 -1
- package/dist/web/_app/immutable/chunks/{D-Er8WL_.js → CWmHQEyb.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B3cgneCL.js → CpAdcarq.js} +1 -1
- package/dist/web/_app/immutable/chunks/CpXgbTWt.js +1 -0
- package/dist/web/_app/immutable/chunks/{DVpZtGWL.js → DYpjUIN_.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BpQkNqbd.js → Ddpk8P2X.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BbsQ7LcO.js → Dtbtl5su.js} +1 -1
- package/dist/web/_app/immutable/chunks/DvqvTNdq.js +1 -0
- package/dist/web/_app/immutable/chunks/{Dw9UPwc-.js → Dx6YFABE.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CHyNkE69.js → Iwcm6r7d.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CIgxv4dO.js → QOJagAiA.js} +1 -1
- package/dist/web/_app/immutable/chunks/Zf7H0ZZc.js +5 -0
- package/dist/web/_app/immutable/chunks/{C39N6y-4.js → qvfhHbjx.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DY21hM66.js → yEDUbZbk.js} +2 -2
- package/dist/web/_app/immutable/entry/app.oDy7ig5b.js +2 -0
- package/dist/web/_app/immutable/entry/start.Cz7A2G8_.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.BZ4775L8.js → 0.BuWS-_Tw.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.Bsi4xvt_.js → 1.ClV7Vf9J.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.Dg3m027a.js +84 -0
- package/dist/web/_app/immutable/nodes/{3.BnPkMEuM.js → 3.9iNkY9mM.js} +1 -1
- package/dist/web/_app/immutable/nodes/4.UG11YFmx.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.jC5vBcjM.js → 5.BZZysw6z.js} +2 -2
- package/dist/web/_app/immutable/nodes/6.LCPXZT0S.js +2 -0
- package/dist/web/_app/immutable/nodes/{7.DhmNA9F-.js → 7.kgjplPpk.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.D4qXhOtf.js → 8.CZ7vB_Pl.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.B9Hbxu54.js → 9.DlSjDUl0.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/assets/2.C8WqLKVH.css +0 -1
- package/dist/web/_app/immutable/assets/4.C3fKtWtl.css +0 -1
- package/dist/web/_app/immutable/chunks/3kn731Pp.js +0 -1
- package/dist/web/_app/immutable/chunks/B-46Slz_.js +0 -4
- package/dist/web/_app/immutable/chunks/BOcEeypC.js +0 -1
- package/dist/web/_app/immutable/chunks/BRjGNUzV.js +0 -5
- package/dist/web/_app/immutable/chunks/Bo0CMKlC.js +0 -1
- package/dist/web/_app/immutable/chunks/BwiF2fxX.js +0 -1
- package/dist/web/_app/immutable/chunks/ByGNDrbC.js +0 -1
- package/dist/web/_app/immutable/chunks/CA7sXyoK.js +0 -1
- package/dist/web/_app/immutable/chunks/CdoeTcKU.js +0 -1
- package/dist/web/_app/immutable/chunks/D5GOt_JW.js +0 -1
- package/dist/web/_app/immutable/entry/app.EJEuMPYz.js +0 -2
- package/dist/web/_app/immutable/entry/start.BOMbKPKA.js +0 -1
- package/dist/web/_app/immutable/nodes/2.Dtg7XjMw.js +0 -84
- package/dist/web/_app/immutable/nodes/4.B8xw3uIV.js +0 -11
- package/dist/web/_app/immutable/nodes/6.BrJWdUaW.js +0 -2
|
@@ -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/QOJagAiA.js","../chunks/CLFba8FK.js","../chunks/CRbsz2jz.js","../chunks/BBDMeJL4.js","../chunks/BmP3yl81.js","../chunks/C8IfoK2g.js","../chunks/B3cbqYdb.js","../chunks/Bt7P6UBm.js","../chunks/C8t_lVji.js","../chunks/Dx6YFABE.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as Aa,w as zt,c as Ra}from"../chunks/B3cbqYdb.js";import{_ as Xe}from"../chunks/PPVm8Dsz.js";import{d as na,c as Ge,e as _t,a as p,g as Be,t as pt,s as ce,b as I,f as ut}from"../chunks/yEDUbZbk.js";import{aE as Da,a1 as ma,p as nt,Y as De,ag as gt,a8 as ht,a0 as Ta,c as w,a5 as N,r as h,g as e,s as _,b as rt,a4 as Ce,n as Ne,t as ue,ae as ze,l as it,d as Ze,a as Ft,m as ot,bq as ya,aA as Ot,aC as Oa,aG as za,aH as wa}from"../chunks/BBDMeJL4.js";import{i as xe,b as Yt}from"../chunks/Dtbtl5su.js";import{e as Ve,i as Ye}from"../chunks/CpAdcarq.js";import{c as Ue}from"../chunks/CDs3H3KT.js";import{s as Ct,c as La}from"../chunks/Bt7P6UBm.js";import{p as qe,l as lt,a as Fa,b as Ma}from"../chunks/CpXgbTWt.js";import{s as Ia,g as Ut,i as ja}from"../chunks/BmP3yl81.js";import{V as Ka}from"../chunks/BQZlAX3A.js";import{r as Lt,a as Mt,c as et,d as aa,b as Ua}from"../chunks/BMrbs3EC.js";import{b as ba}from"../chunks/3ONneP0Z.js";import{e as $t,f as xt,A as Va,c as Na}from"../chunks/CClliU_-.js";import{B as Je}from"../chunks/DYpjUIN_.js";import{T as sa,P as ia,C as oa,I as ea,S as qa,a as Vt,R as la,b as ua,p as ca,c as Ha}from"../chunks/DvqvTNdq.js";import{i as It}from"../chunks/Ddpk8P2X.js";import{z as Wa,C as da,B as Ba,G as Bt,A as Ya,k as Ja,l as Za,o as Ga,p as Qa,q as Xa,s as $a,H as en,I as tn}from"../chunks/Zf7H0ZZc.js";import{g as an}from"../chunks/CqkleIqs.js";import{n as ta}from"../chunks/Dx6YFABE.js";import{e as We,r as nn}from"../chunks/CRbsz2jz.js";import{I as fa}from"../chunks/Iwcm6r7d.js";import{a as va}from"../chunks/C8t_lVji.js";function rn(K,t,l){Da(()=>{var s=ma(()=>t(K,l?.())||{});if(s?.destroy)return()=>s.destroy()})}const sn=()=>{const K=Ia;return{page:{subscribe:K.page.subscribe},navigating:{subscribe:K.navigating.subscribe},updated:K.updated}},on={subscribe(K){return sn().page.subscribe(K)}},ln=async({params:K,fetch:t})=>{const{repo:l,type:s,id:d}=K,S=await Aa(l,s,d);return{repo:l,type:s,id:d,entity:S}},hs=Object.freeze(Object.defineProperty({__proto__:null,load:ln},Symbol.toStringTag,{value:"Module"}));var un=I('<span class="chip svelte-84vb17"> <!></span>'),cn=I('<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>'),dn=I('<div class="dropdown svelte-84vb17"></div>'),fn=I('<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 vn(K,t){nt(t,!0);let l=qe(t,"multi",3,!1),s=De(""),d=De(0),S;const R=ze(()=>zt.repos.flatMap(x=>x.entities.map(b=>({id:b.id,title:b.title,entityType:b.entityType,repo:x.name})))),m=ze(()=>()=>{const x=e(s).toLowerCase().trim();return x?e(R).filter(b=>b.title.toLowerCase().includes(x)||b.id.toLowerCase().includes(x)).slice(0,20):e(R).slice(0,20)}),k=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=De(gt(k));ht(()=>{Ta().then(()=>S?.focus())});function z(x){l()?(e(u).includes(x)||_(u,[...e(u),x],!0),_(s,""),_(d,0),S?.focus()):t.onselect(x)}function H(x){_(u,e(u).filter(b=>b!==x),!0)}function D(){e(u).length===k.length&&e(u).every((b,a)=>b===k[a])?t.oncancel():t.onselect(e(u))}function U(x){const b=e(m)();x.key==="ArrowDown"?(x.preventDefault(),_(d,Math.min(e(d)+1,b.length-1),!0)):x.key==="ArrowUp"?(x.preventDefault(),_(d,Math.max(e(d)-1,0),!0)):x.key==="Enter"?(x.preventDefault(),b.length>0?z(b[e(d)].id):l()&&D()):x.key==="Escape"?l()&&e(u).length>0?D():t.oncancel():x.key==="Backspace"&&!e(s)&&l()&&e(u).length>0&&_(u,e(u).slice(0,-1),!0)}var Pe=fn(),L=w(Pe),fe=w(L);{var Re=x=>{var b=Be(),a=Ce(b);Ve(a,17,()=>e(u),Ye,(n,o)=>{var y=un(),C=w(y),q=N(C);Je(q,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>H(e(o)),children:(be,Te)=>{Ne();var E=pt("×");p(be,E)},$$slots:{default:!0}}),h(y),ue(()=>ce(C,`${e(o)??""} `)),p(n,y)}),p(x,b)};xe(fe,x=>{l()&&x(Re)})}var G=N(fe,2);Lt(G),Yt(G,x=>S=x,()=>S),h(L);var W=N(L,2);{var Ee=x=>{var b=dn();Ve(b,21,()=>e(m)(),Ye,(a,n,o)=>{var y=cn();let C;var q=w(y),be=w(q,!0);h(q);var Te=N(q,2),E=w(Te),f=w(E,!0);h(E);var v=N(E,2),O=w(v,!0);h(v),h(Te),h(y),ue(()=>{C=Ct(y,1,"dropdown-item svelte-84vb17",null,C,{highlighted:o===e(d)}),ce(be,e(n).title),ce(f,e(n).entityType),ce(O,e(n).repo)}),Ge("mousedown",y,ne=>{ne.preventDefault(),z(e(n).id)}),_t("mouseenter",y,()=>_(d,o,!0)),p(a,y)}),h(b),p(x,b)},le=ze(()=>e(m)().length>0);xe(W,x=>{e(le)&&x(Ee)})}h(Pe),Ge("keydown",G,U),_t("blur",G,()=>{setTimeout(()=>{l()&&e(u).length>0?D():l()||t.oncancel()},150)}),ba(G,()=>e(s),x=>_(s,x)),p(K,Pe),rt()}na(["keydown","mousedown"]);var hn=ut("<title> </title>"),pn=ut('<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 Nt(K,t){const l=lt(t,["children","$$slots","$$events","$$legacy"]),s=lt(l,["size","title"]);nt(t,!1);const d=ot(),S=ot();let R=qe(t,"size",8,16),m=qe(t,"title",8,void 0);it(()=>(Ze(l),Ze(m())),()=>{_(d,l["aria-label"]||l["aria-labelledby"]||m())}),it(()=>(e(d),Ze(l)),()=>{_(S,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ft(),It();var k=pn();Mt(k,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(S),...s}));var u=w(k);{var z=H=>{var D=hn(),U=w(D,!0);h(D),ue(()=>ce(U,m())),p(H,D)};xe(u,H=>{m()&&H(z)})}Ne(),h(k),p(K,k),rt()}var _n=ut("<title> </title>"),gn=ut('<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 qt(K,t){const l=lt(t,["children","$$slots","$$events","$$legacy"]),s=lt(l,["size","title"]);nt(t,!1);const d=ot(),S=ot();let R=qe(t,"size",8,16),m=qe(t,"title",8,void 0);it(()=>(Ze(l),Ze(m())),()=>{_(d,l["aria-label"]||l["aria-labelledby"]||m())}),it(()=>(e(d),Ze(l)),()=>{_(S,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ft(),It();var k=gn();Mt(k,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(S),...s}));var u=w(k);{var z=H=>{var D=_n(),U=w(D,!0);h(D),ue(()=>ce(U,m())),p(H,D)};xe(u,H=>{m()&&H(z)})}Ne(2),h(k),p(K,k),rt()}var mn=ut("<title> </title>"),yn=ut('<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 Ht(K,t){const l=lt(t,["children","$$slots","$$events","$$legacy"]),s=lt(l,["size","title"]);nt(t,!1);const d=ot(),S=ot();let R=qe(t,"size",8,16),m=qe(t,"title",8,void 0);it(()=>(Ze(l),Ze(m())),()=>{_(d,l["aria-label"]||l["aria-labelledby"]||m())}),it(()=>(e(d),Ze(l)),()=>{_(S,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ft(),It();var k=yn();Mt(k,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(S),...s}));var u=w(k);{var z=H=>{var D=mn(),U=w(D,!0);h(D),ue(()=>ce(U,m())),p(H,D)};xe(u,H=>{m()&&H(z)})}Ne(2),h(k),p(K,k),rt()}var wn=ut("<title> </title>"),bn=ut('<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 ka(K,t){const l=lt(t,["children","$$slots","$$events","$$legacy"]),s=lt(l,["size","title"]);nt(t,!1);const d=ot(),S=ot();let R=qe(t,"size",8,16),m=qe(t,"title",8,void 0);it(()=>(Ze(l),Ze(m())),()=>{_(d,l["aria-label"]||l["aria-labelledby"]||m())}),it(()=>(e(d),Ze(l)),()=>{_(S,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ft(),It();var k=bn();Mt(k,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(S),...s}));var u=w(k);{var z=H=>{var D=wn(),U=w(D,!0);h(D),ue(()=>ce(U,m())),p(H,D)};xe(u,H=>{m()&&H(z)})}Ne(2),h(k),p(K,k),rt()}var kn=ut("<title> </title>"),xn=ut('<svg><!><path d="M10 16 20 6 21.4 7.4 12.8 16 21.4 24.6 20 26z"></path></svg>');function Cn(K,t){const l=lt(t,["children","$$slots","$$events","$$legacy"]),s=lt(l,["size","title"]);nt(t,!1);const d=ot(),S=ot();let R=qe(t,"size",8,16),m=qe(t,"title",8,void 0);it(()=>(Ze(l),Ze(m())),()=>{_(d,l["aria-label"]||l["aria-labelledby"]||m())}),it(()=>(e(d),Ze(l)),()=>{_(S,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),Ft(),It();var k=xn();Mt(k,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:R(),height:R(),...e(S),...s}));var u=w(k);{var z=H=>{var D=kn(),U=w(D,!0);h(D),ue(()=>ce(U,m())),p(H,D)};xe(u,H=>{m()&&H(z)})}Ne(),h(k),p(K,k),rt()}var En=I('<span class="ip-type-dot svelte-x7sio8"></span>'),Sn=I('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Pn=I('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),An=I('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Rn=I("<!> <!> <!>",1),Dn=I("<!> <!>",1),Tn=I('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),On=I('<span class="ip-status-dot svelte-x7sio8"></span> ',1),zn=I('<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>'),Ln=I('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Fn=I('<div class="ip-cal-week svelte-x7sio8"></div>'),Mn=I('<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>'),In=I('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span>',1),jn=I('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Kn=I('<span class="ip-type-dot svelte-x7sio8"></span> <span> </span> <!>',1),Un=I("<!> <!>",1),Vn=I('<span class="ip-etype-display svelte-x7sio8"> </span>'),Nn=I('<span class="ip-badge svelte-x7sio8"> </span>'),qn=I('<div class="ip-wikilink-group svelte-x7sio8"></div>'),Hn=I('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),Wn=I('<span class="ip-date-text svelte-x7sio8"> </span>'),Bn=I('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),Yn=I('<span class="ip-text-value svelte-x7sio8"> </span>'),Jn=I('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),Zn=I('<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="Field name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),Gn=I("<!> <span>Add field</span>",1),Qn=I('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function Xn(K,t){nt(t,!0);let l=qe(t,"editable",3,!1),s=qe(t,"autofocusKey",3,null),d=qe(t,"protectedKeys",19,()=>new Set);const S=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],R=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let m=De(null),k=De(!1),u=De(!1);ht(()=>{s()&&!e(u)&&t.properties.some(c=>c.key===s())&&(_(u,!0),requestAnimationFrame(()=>{_(m,s())})),s()||_(u,!1)});let z=De(""),H=De(void 0);function D(c){return c.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function U(c){switch(c.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 Pe(c){for(const r of zt.repos){const T=r.entities.find(se=>se.id===c);if(T){Ut(`/${r.name}/${T.entityType}/${T.id}`);return}}}function L(c){return typeof c.value=="string"?c.value:c.value[0]}function fe(c){return/^https?:\/\//.test(c)}function Re(c){try{return new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return c}}let G=De(gt(new Date().getFullYear())),W=De(gt(new Date().getMonth()));const Ee=["Su","Mo","Tu","We","Th","Fr","Sa"],le=["January","February","March","April","May","June","July","August","September","October","November","December"];function x(c,r){const T=new Date(c,r,1).getDay(),se=new Date(c,r+1,0).getDate(),P=new Date(c,r,0).getDate(),ee=[];let X=[];for(let $=T-1;$>=0;$--){const pe=P-$,ae=r===0?11:r-1,Ie=r===0?c-1:c;X.push({day:pe,month:ae,year:Ie,outside:!0})}for(let $=1;$<=se;$++)X.push({day:$,month:r,year:c,outside:!1}),X.length===7&&(ee.push(X),X=[]);if(X.length>0){const $=r===11?0:r+1,pe=r===11?c+1:c;let ae=1;for(;X.length<7;)X.push({day:ae++,month:$,year:pe,outside:!0});ee.push(X)}return ee}function b(c){const r=new Date;return c.day===r.getDate()&&c.month===r.getMonth()&&c.year===r.getFullYear()}function a(c,r){const T=r.slice(0,10).split("-");return c.year===+T[0]&&c.month===+T[1]-1&&c.day===+T[2]}function n(){e(W)===0?(_(W,11),Ot(G,-1)):Ot(W,-1)}function o(){e(W)===11?(_(W,0),Ot(G)):Ot(W)}function y(c){try{const r=c.slice(0,10).split("-");_(G,+r[0]),_(W,+r[1]-1)}catch{const r=new Date;_(G,r.getFullYear(),!0),_(W,r.getMonth(),!0)}}function C(c){requestAnimationFrame(()=>{c.focus(),c.select()})}function q(c){!l()||c.type==="badge"||c.type==="entity-type"||(c.type==="date"&&y(L(c)),_(m,c.key,!0))}function be(c,r){t.onedit&&t.onedit(c,r),_(m,null)}function Te(c,r){const T=`${r.year}-${String(r.month+1).padStart(2,"0")}-${String(r.day).padStart(2,"0")}`;t.onedit&&t.onedit(c,T),_(m,null)}function E(c,r){t.ontypechange&&t.ontypechange(c,r)}function f(c){_(m,null),t.onremove&&t.onremove(c)}function v(){_(k,!0),_(z,""),requestAnimationFrame(()=>e(H)?.focus())}function O(){const c=e(z).trim();c&&t.onadd&&t.onadd(c,""),_(k,!1),_(z,"")}function ne(){_(k,!1),_(z,"")}function V(c){c.key==="Enter"?(c.preventDefault(),O()):c.key==="Escape"&&ne()}var B=Qn();_t("click",ya,()=>{_(m,null)});var g=w(B);Ve(g,17,()=>t.properties,c=>c.key,(c,r)=>{const T=ze(()=>e(m)===e(r).key);var se=Jn();let P;var ee=w(se),X=w(ee);{var $=F=>{var Z=En();let M;ue(_e=>M=et(Z,"",M,_e),[()=>({background:$t(L(e(r)))})]),p(F,Z)},pe=F=>{var Z=Be(),M=Ce(Z);Ue(M,()=>la,(_e,Se)=>{Se(_e,{children:(he,Ae)=>{var Le=Dn(),ye=Ce(Le);Ue(ye,()=>sa,(Me,He)=>{He(Me,{class:"ip-icon-trigger",children:(te,Q)=>{var ge=Be(),ke=Ce(ge);{var Oe=je=>{Nt(je,{size:14})},$e=je=>{qt(je,{size:14})},tt=je=>{Ht(je,{size:14})},ct=je=>{Vt(je,{size:14})};xe(ke,je=>{e(r).type==="date"?je(Oe):e(r).type==="status"?je($e,1):e(r).type==="wikilink"?je(tt,2):je(ct,!1)})}p(te,ge)},$$slots:{default:!0}})});var Fe=N(ye,2);Ue(Fe,()=>ia,(Me,He)=>{He(Me,{children:(te,Q)=>{var ge=Be(),ke=Ce(ge);Ue(ke,()=>oa,(Oe,$e)=>{$e(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(tt,ct)=>{var je=Rn(),Et=Ce(je);Ve(Et,17,()=>S,Ye,(at,Qe)=>{var st=Be(),mt=Ce(st);Ue(mt,()=>ea,(ft,vt)=>{vt(ft,{class:"ip-menu-item",onSelect:()=>E(e(r).key,e(Qe).type),children:(yt,Jt)=>{var wt=Pn(),Pt=Ce(wt),Zt=w(Pt);{var bt=Ke=>{Vt(Ke,{size:13})},jt=Ke=>{Nt(Ke,{size:13})},Gt=Ke=>{qt(Ke,{size:13})},Qt=Ke=>{Ht(Ke,{size:13})};xe(Zt,Ke=>{e(Qe).type==="text"?Ke(bt):e(Qe).type==="date"?Ke(jt,1):e(Qe).type==="status"?Ke(Gt,2):e(Qe).type==="wikilink"&&Ke(Qt,3)})}h(Pt);var At=N(Pt,2),Xt=w(At,!0);h(At);var ra=N(At,2);{var Kt=Ke=>{var kt=Sn(),Rt=w(kt);da(Rt,{size:12}),h(kt),p(Ke,kt)};xe(ra,Ke=>{e(r).type===e(Qe).type&&Ke(Kt)})}ue(()=>ce(Xt,e(Qe).label)),p(yt,wt)},$$slots:{default:!0}})}),p(at,st)});var dt=N(Et,2);Ue(dt,()=>qa,(at,Qe)=>{Qe(at,{class:"ip-menu-sep"})});var St=N(dt,2);Ue(St,()=>ea,(at,Qe)=>{Qe(at,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>f(e(r).key),children:(st,mt)=>{var ft=An(),vt=Ce(ft),yt=w(vt);Wa(yt,{size:13}),h(vt),Ne(2),p(st,ft)},$$slots:{default:!0}})}),p(tt,je)},$$slots:{default:!0}})}),p(te,ge)},$$slots:{default:!0}})}),p(he,Le)},$$slots:{default:!0}})}),p(F,Z)},ae=ze(()=>l()&&e(r).type!=="badge"&&!d().has(e(r).key)),Ie=F=>{var Z=Be(),M=Ce(Z);{var _e=ye=>{Nt(ye,{size:14})},Se=ye=>{qt(ye,{size:14})},he=ye=>{Ht(ye,{size:14})},Ae=ye=>{ka(ye,{size:14})},Le=ye=>{Vt(ye,{size:14})};xe(M,ye=>{e(r).type==="date"?ye(_e):e(r).type==="status"?ye(Se,1):e(r).type==="wikilink"?ye(he,2):e(r).type==="badge"?ye(Ae,3):ye(Le,!1)})}p(F,Z)};xe(X,F=>{e(r).type==="entity-type"?F($):e(ae)?F(pe,1):e(r).type!=="entity-type"&&F(Ie,2)})}h(ee);var i=N(ee,2),A=w(i,!0);h(i);var ie=N(i,2),J=w(ie);{var me=F=>{var Z=Tn();Lt(Z),rn(Z,M=>C?.(M)),ue(M=>aa(Z,M),[()=>L(e(r))]),_t("blur",Z,M=>{const _e=M.currentTarget.value;_e!==L(e(r))&&t.onedit?.(e(r).key,_e),_(m,null)}),Ge("keydown",Z,M=>{if(M.key==="Enter"){const _e=M.currentTarget.value;_e!==L(e(r))&&t.onedit?.(e(r).key,_e);const Se=s()===e(r).key;_(m,null),M.preventDefault(),Se&&t.onfocuseditor?.()}else M.key==="Escape"&&(M.currentTarget.value=L(e(r)),_(m,null))}),p(F,Z)},we=F=>{var Z=zn(),M=w(Z),_e=w(M);let Se;var he=N(_e,2),Ae=w(he,!0);h(he),h(M);var Le=N(M,2);Ve(Le,21,()=>R,Ye,(ye,Fe)=>{{let Me=ze(()=>L(e(r))===e(Fe)?"selected":"");Je(ye,{variant:"ghost",get class(){return`ip-status-option ${e(Me)??""}`},onclick:()=>be(e(r).key,e(Fe)),children:(He,te)=>{var Q=On(),ge=Ce(Q);let ke;var Oe=N(ge);ue($e=>{ke=et(ge,"",ke,$e),ce(Oe,` ${e(Fe)??""}`)},[()=>({background:U(e(Fe))})]),p(He,Q)},$$slots:{default:!0}})}}),h(Le),h(Z),ue((ye,Fe)=>{Se=et(_e,"",Se,ye),ce(Ae,Fe)},[()=>({background:U(L(e(r)))}),()=>L(e(r))]),Ge("click",Z,ye=>ye.stopPropagation()),p(F,Z)},de=F=>{var Z=Mn(),M=w(Z),_e=w(M,!0);h(M);var Se=N(M,2),he=w(Se),Ae=w(he);Je(Ae,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:n,children:(te,Q)=>{Cn(te,{size:14})},$$slots:{default:!0}});var Le=N(Ae,2),ye=w(Le);h(Le);var Fe=N(Le,2);Je(Fe,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:o,children:(te,Q)=>{Ba(te,{size:14})},$$slots:{default:!0}}),h(he);var Me=N(he,2);Ve(Me,21,()=>Ee,Ye,(te,Q)=>{var ge=Ln(),ke=w(ge,!0);h(ge),ue(()=>ce(ke,e(Q))),p(te,ge)}),h(Me);var He=N(Me,2);Ve(He,17,()=>x(e(G),e(W)),Ye,(te,Q)=>{var ge=Fn();Ve(ge,21,()=>e(Q),Ye,(ke,Oe)=>{{let $e=ze(()=>e(Oe).outside?"outside":""),tt=ze(()=>b(e(Oe))?"today":""),ct=ze(()=>a(e(Oe),L(e(r)))?"selected":"");Je(ke,{variant:"ghost",get class(){return`ip-cal-day ${e($e)??""} ${e(tt)??""} ${e(ct)??""}`},onclick:()=>Te(e(r).key,e(Oe)),children:(je,Et)=>{Ne();var dt=pt();ue(()=>ce(dt,e(Oe).day)),p(je,dt)},$$slots:{default:!0}})}}),h(ge),p(te,ge)}),h(Se),h(Z),ue(te=>{ce(_e,te),ce(ye,`${le[e(W)]??""} ${e(G)??""}`)},[()=>Re(L(e(r)))]),Ge("click",Z,te=>te.stopPropagation()),p(F,Z)},re=F=>{{let Z=ze(()=>Array.isArray(e(r).value));vn(F,{get value(){return e(r).value},get multi(){return e(Z)},onselect:M=>{t.onedit?.(e(r).key,M),_(m,null)},oncancel:()=>{_(m,null)}})}},oe=F=>{var Z=Be(),M=Ce(Z);{var _e=te=>{var Q=Be(),ge=Ce(Q);Ue(ge,()=>la,(ke,Oe)=>{Oe(ke,{children:($e,tt)=>{var ct=Un(),je=Ce(ct);Ue(je,()=>sa,(dt,St)=>{St(dt,{class:"ip-etype-trigger",onclick:at=>at.stopPropagation(),children:(at,Qe)=>{var st=In(),mt=Ce(st);let ft;var vt=N(mt,2),yt=w(vt,!0);h(vt),ue((Jt,wt)=>{ft=et(mt,"",ft,Jt),ce(yt,wt)},[()=>({background:$t(L(e(r)))}),()=>xt(L(e(r)))]),p(at,st)},$$slots:{default:!0}})});var Et=N(je,2);Ue(Et,()=>ia,(dt,St)=>{St(dt,{children:(at,Qe)=>{var st=Be(),mt=Ce(st);Ue(mt,()=>oa,(ft,vt)=>{vt(ft,{class:"ip-menu-content ip-etype-content",sideOffset:4,align:"start",children:(yt,Jt)=>{var wt=Be(),Pt=Ce(wt);Ve(Pt,17,()=>Va,Ye,(Zt,bt)=>{var jt=Be(),Gt=Ce(jt);Ue(Gt,()=>ea,(Qt,At)=>{At(Qt,{class:"ip-menu-item",onSelect:()=>{e(bt)!==L(e(r))&&t.onentitytypechange?.(e(bt))},children:(Xt,ra)=>{var Kt=Kn(),Ke=Ce(Kt);let kt;var Rt=N(Ke,2),xa=w(Rt,!0);h(Rt);var Ca=N(Rt,2);{var Ea=Dt=>{var Tt=jn(),Pa=w(Tt);da(Pa,{size:12}),h(Tt),p(Dt,Tt)},Sa=ze(()=>L(e(r))===e(bt));xe(Ca,Dt=>{e(Sa)&&Dt(Ea)})}ue((Dt,Tt)=>{kt=et(Ke,"",kt,Dt),ce(xa,Tt)},[()=>({background:$t(e(bt))}),()=>xt(e(bt))]),p(Xt,Kt)},$$slots:{default:!0}})}),p(Zt,jt)}),p(yt,wt)},$$slots:{default:!0}})}),p(at,st)},$$slots:{default:!0}})}),p($e,ct)},$$slots:{default:!0}})}),p(te,Q)},Se=te=>{var Q=Vn(),ge=w(Q,!0);h(Q),ue(ke=>ce(ge,ke),[()=>xt(L(e(r)))]),p(te,Q)},he=te=>{var Q=Nn(),ge=w(Q,!0);h(Q),ue(ke=>ce(ge,ke),[()=>L(e(r))]),p(te,Q)},Ae=te=>{var Q=qn();Ve(Q,21,()=>Array.isArray(e(r).value)?e(r).value:[e(r).value],Ye,(ge,ke)=>{Je(ge,{variant:"ghost",class:"ip-wikilink-chip",onclick:Oe=>{Oe.stopPropagation(),Pe(e(ke))},children:(Oe,$e)=>{Ne();var tt=pt();ue(()=>ce(tt,e(ke))),p(Oe,tt)},$$slots:{default:!0}})}),h(Q),p(te,Q)},Le=te=>{var Q=Hn(),ge=w(Q);let ke;var Oe=N(ge,2),$e=w(Oe,!0);h(Oe),h(Q),ue((tt,ct)=>{ke=et(ge,"",ke,tt),ce($e,ct)},[()=>({background:U(L(e(r)))}),()=>L(e(r))]),p(te,Q)},ye=te=>{var Q=Wn(),ge=w(Q,!0);h(Q),ue(ke=>ce(ge,ke),[()=>Re(L(e(r)))]),p(te,Q)},Fe=te=>{var Q=Bn(),ge=w(Q,!0);h(Q),ue((ke,Oe)=>{Ua(Q,"href",ke),ce(ge,Oe)},[()=>L(e(r)),()=>L(e(r))]),Ge("click",Q,ke=>ke.stopPropagation()),p(te,Q)},Me=ze(()=>fe(L(e(r)))),He=te=>{var Q=Yn(),ge=w(Q,!0);h(Q),ue(ke=>ce(ge,ke),[()=>L(e(r))]),p(te,Q)};xe(M,te=>{e(r).type==="entity-type"&&l()?te(_e):e(r).type==="entity-type"?te(Se,1):e(r).type==="badge"?te(he,2):e(r).type==="wikilink"?te(Ae,3):e(r).type==="status"?te(Le,4):e(r).type==="date"?te(ye,5):e(Me)?te(Fe,6):te(He,!1)})}p(F,Z)};xe(J,F=>{e(T)&&e(r).type==="text"?F(me):e(T)&&e(r).type==="status"?F(we,1):e(T)&&e(r).type==="date"?F(de,2):e(T)&&e(r).type==="wikilink"?F(re,3):F(oe,!1)})}h(ie),h(se),ue(F=>{P=Ct(se,1,"ip-row svelte-x7sio8",null,P,{"ip-focused":e(T)}),ce(A,F)},[()=>D(e(r).key)]),Ge("click",ee,F=>F.stopPropagation()),Ge("click",ie,F=>{F.stopPropagation(),q(e(r))}),p(c,se)});var j=N(g,2);{var ve=c=>{var r=Zn(),T=w(r),se=w(T);Bt(se,{size:14}),h(T);var P=N(T,2),ee=w(P);Lt(ee),Yt(ee,X=>_(H,X),()=>e(H)),h(P),Ne(2),h(r),Ge("keydown",ee,V),_t("blur",ee,ne),ba(ee,()=>e(z),X=>_(z,X)),p(c,r)},Y=c=>{Je(c,{variant:"ghost",class:"ip-add-btn",onclick:r=>{r.stopPropagation(),v()},children:(r,T)=>{var se=Gn(),P=Ce(se);Bt(P,{size:14}),Ne(2),p(r,se)},$$slots:{default:!0}})};xe(j,c=>{e(k)?c(ve):l()&&c(Y,1)})}h(B),p(K,B),rt()}na(["click","keydown"]);var $n=I('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),er=I('<div class="cursor-overlay svelte-ok7wy5"></div>'),tr=I('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function ar(K,t){nt(t,!0);let l=qe(t,"readonly",3,!0),s=qe(t,"resetKey",3,0);const d=Oa("theme");let S,R=null,m=null,k=De(""),u=null,z=De(gt([])),H=null,D=t.content;function U(W,Ee){return W.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:Ee?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:Ee?"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:Ee})}async function Pe(){R&&(R.destroy(),R=null),m&&(m.destroy(),m=null),_(z,[],!0);const{EditorState:W,Transaction:Ee}=await Xe(async()=>{const{EditorState:g,Transaction:j}=await import("../chunks/CX_61fY8.js");return{EditorState:g,Transaction:j}},[],import.meta.url);u=Ee;const{EditorView:le,keymap:x,ViewPlugin:b}=await Xe(async()=>{const{EditorView:g,keymap:j,ViewPlugin:ve}=await import("../chunks/DnL9f0lc.js").then(Y=>Y.i);return{EditorView:g,keymap:j,ViewPlugin:ve}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await Xe(async()=>{const{markdown:g}=await import("../chunks/CscoF-YL.js");return{markdown:g}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:n,HighlightStyle:o}=await Xe(async()=>{const{syntaxHighlighting:g,HighlightStyle:j}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:g,HighlightStyle:j}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:y,defaultKeymap:C,historyKeymap:q}=await Xe(async()=>{const{history:g,defaultKeymap:j,historyKeymap:ve}=await import("../chunks/CWQRQXxy.js");return{history:g,defaultKeymap:j,historyKeymap:ve}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:be}=await Xe(async()=>{const{tags:g}=await import("../chunks/C7VoTosa.js").then(j=>j.i);return{tags:g}},[],import.meta.url),{livePreviewPlugin:Te,livePreviewTheme:E}=await Xe(async()=>{const{livePreviewPlugin:g,livePreviewTheme:j}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:g,livePreviewTheme:j}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),f=d.current==="dark",v=U(le,f),O=o.define([{tag:be.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),ne=[a(),v,n(O),Te,E,le.lineWrapping];l()&&ne.push(W.readOnly.of(!0));let V=!1;if(t.cursorDocName&&!l())try{let i=function(){if(!R||!P){_(z,[],!0);return}const J=P.awareness,me=P.ytext,we=me.doc;if(!we){_(z,[],!0);return}const de=[],re=R.dom.getBoundingClientRect();J.getStates().forEach((oe,F)=>{if(F===Ie)return;const Z=oe.cursor;if(!Z?.head)return;const{name:M="Anonymous",color:_e="#e05050"}=oe.user||{};let Se;try{Se=T.createRelativePositionFromJSON(Z.head)}catch{return}const he=T.createAbsolutePositionFromRelativePosition(Se,we);if(!he||he.type!==me)return;const Ae=R.coordsAtPos(Math.min(he.index,R.state.doc.length));Ae&&de.push({id:F,name:M,color:_e,top:Ae.top-re.top,left:Ae.left-re.left,height:Ae.bottom-Ae.top})}),_(z,de,!0)},A=function(){H&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,i()})},ie=function({added:J,updated:me,removed:we}){[...J,...me,...we].some(re=>re!==Ie)&&A()};const{createCollabSession:g}=await Xe(async()=>{const{createCollabSession:J}=await import("../chunks/QOJagAiA.js");return{createCollabSession:J}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17]),import.meta.url),{ySync:j,ySyncFacet:ve,YSyncConfig:Y,yUndoManagerKeymap:c}=await Xe(async()=>{const{ySync:J,ySyncFacet:me,YSyncConfig:we,yUndoManagerKeymap:de}=await import("../chunks/i9c_RUF6.js");return{ySync:J,ySyncFacet:me,YSyncConfig:we,yUndoManagerKeymap:de}},__vite__mapDeps([18,9,0,1]),import.meta.url),{auth:r}=await Xe(async()=>{const{auth:J}=await import("../chunks/C8t_lVji.js").then(me=>me.b);return{auth:J}},__vite__mapDeps([16,11,15]),import.meta.url),T=await Xe(()=>import("../chunks/CLFba8FK.js").then(J=>J.A),[],import.meta.url),se=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",P=g(t.cursorDocName,{name:r.user?.displayName??"Anonymous",color:se,colorLight:se+"33"}),ee=new T.UndoManager(P.ytext,{captureTimeout:500}),{yUndoManagerFacet:X,yUndoManager:$,YUndoManagerConfig:pe}=await Xe(async()=>{const{yUndoManagerFacet:J,yUndoManager:me,YUndoManagerConfig:we}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:J,yUndoManager:me,YUndoManagerConfig:we}},__vite__mapDeps([18,9,0,1]),import.meta.url),ae=new Y(P.ytext,P.awareness);ne.push(ve.of(ae),j,X.of(new pe(ee)),$,x.of(c)),ne.push(b.define(J=>{function me(){const we=J.state.selection.main,de=P.ytext,re=T.createRelativePositionFromTypeIndex(de,we.anchor),oe=T.createRelativePositionFromTypeIndex(de,we.head);P.awareness.setLocalStateField("cursor",{anchor:T.relativePositionToJSON(re),head:T.relativePositionToJSON(oe)})}return me(),{update(we){(we.selectionSet||we.docChanged)&&me()}}}));const Ie=P.ydoc.clientID;P.awareness.on("change",ie),ne.push(b.define(()=>({update(J){(J.docChanged||J.geometryChanged||J.viewportChanged)&&A()},destroy(){P.awareness.off("change",ie)}}))),m=P,V=!0}catch(g){console.warn("Yjs collab setup failed, falling back to solo editing:",g)}if(!l()&&!V?(ne.push(y({newGroupDelay:500})),ne.push(x.of([...C,...q]))):!l()&&V&&ne.push(x.of(C)),t.onchange)if(V){const g=Date.now();ne.push(le.updateListener.of(j=>{if(j.docChanged&&Date.now()-g>1e3&&j.transactions.some(Y=>Y.isUserEvent("input")||Y.isUserEvent("delete")||Y.isUserEvent("move")||Y.isUserEvent("undo")||Y.isUserEvent("redo"))){const Y=j.state.doc.toString();D=Y,t.onchange(Y)}}))}else ne.push(le.updateListener.of(g=>{if(g.docChanged){const j=g.state.doc.toString();D=j,t.onchange(j)}}));ne.push(le.domEventHandlers({click(g){const j=g.target;if(t.onwikilinkclick){const Y=j.closest(".cm-live-wikilink");if(Y){g.preventDefault();const c=Y.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return c&&t.onwikilinkclick(c),!0}}const ve=j.closest(".cm-live-link");if(ve){const Y=ve.getAttribute("data-href");if(Y)return g.preventDefault(),window.open(Y,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&ne.push(x.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const B=W.create({doc:V?"":t.content,extensions:ne});R=new le({state:B,parent:S}),D=V?"":t.content,_(k,t.cursorDocName??"",!0)}za(()=>{Pe()}),ht(()=>{t.cursorDocName&&e(k)&&t.cursorDocName!==e(k)&&Pe()}),ht(()=>{if(s(),R&&!m&&t.content!==D){D=t.content;const W=S.closest(".document-scroll"),Ee=W?.scrollTop??0;R.dispatch({changes:{from:0,to:R.state.doc.length,insert:t.content},...u?{annotations:u.addToHistory.of(!1)}:{}}),W&&requestAnimationFrame(()=>{W.scrollTop=Ee})}}),wa(()=>{H&&cancelAnimationFrame(H),m?.destroy(),m=null,R?.destroy()});var L=tr(),fe=w(L);Yt(fe,W=>S=W,()=>S);var Re=N(fe,2);{var G=W=>{var Ee=er();Ve(Ee,21,()=>e(z),le=>le.id,(le,x)=>{var b=$n(),a=w(b),n=w(a,!0);h(a),h(b),ue(()=>{et(b,`top: ${e(x).top??""}px; left: ${e(x).left??""}px; height: ${e(x).height??""}px; --cursor-color: ${e(x).color??""};`),et(a,`background-color: ${e(x).color??""};`),ce(n,e(x).name)}),p(le,b)}),h(Ee),p(W,Ee)};xe(Re,W=>{e(z).length>0&&W(G)})}h(L),p(K,L),rt()}var Wt={exports:{}};var nr=Wt.exports,ha;function rr(){return ha||(ha=1,(function(K,t){((l,s)=>{K.exports=s()})(nr,function l(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},d,S=!s.document&&!!s.postMessage,R=s.IS_PAPA_WORKER||!1,m={},k=0,u={};function z(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(n){var o=le(n);o.chunkSize=parseInt(o.chunkSize),n.step||n.chunk||(o.chunkSize=null),this._handle=new L(o),(this._handle.streamer=this)._config=o}).call(this,a),this.parseChunk=function(n,o){var y=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<y){let q=this._config.newline;q||(C=this._config.quoteChar||'"',q=this._handle.guessLineEndings(n,C)),n=[...n.split(q).slice(y)].join(q)}this.isFirstChunk&&b(this._config.beforeFirstChunk)&&(C=this._config.beforeFirstChunk(n))!==void 0&&(n=C),this.isFirstChunk=!1,this._halted=!1;var y=this._partialLine+n,C=(this._partialLine="",this._handle.parse(y,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=C.meta.cursor,y=(this._finished||(this._partialLine=y.substring(n-this._baseIndex),this._baseIndex=n),C&&C.data&&(this._rowCount+=C.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),R)s.postMessage({results:C,workerId:u.WORKER_ID,finished:y});else if(b(this._config.chunk)&&!o){if(this._config.chunk(C,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=C=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(C.data),this._completeResults.errors=this._completeResults.errors.concat(C.errors),this._completeResults.meta=C.meta),this._completed||!y||!b(this._config.complete)||C&&C.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),y||C&&C.meta.paused||this._nextChunk(),C}this._halted=!0},this._sendError=function(n){b(this._config.error)?this._config.error(n):R&&this._config.error&&s.postMessage({workerId:u.WORKER_ID,error:n,finished:!1})}}function H(a){var n;(a=a||{}).chunkSize||(a.chunkSize=u.RemoteChunkSize),z.call(this,a),this._nextChunk=S?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),S||(n.onload=x(this._chunkLoaded,this),n.onerror=x(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!S),this._config.downloadRequestHeaders){var o,y=this._config.downloadRequestHeaders;for(o in y)n.setRequestHeader(o,y[o])}var C;this._config.chunkSize&&(C=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+C));try{n.send(this._config.downloadRequestBody)}catch(q){this._chunkError(q.message)}S&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(o){o=n.statusText||o,this._sendError(new Error(o))}}function D(a){(a=a||{}).chunkSize||(a.chunkSize=u.LocalChunkSize),z.call(this,a);var n,o,y=typeof FileReader<"u";this.stream=function(C){this._input=C,o=C.slice||C.webkitSlice||C.mozSlice,y?((n=new FileReader).onload=x(this._chunkLoaded,this),n.onerror=x(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var C=this._input,q=(this._config.chunkSize&&(q=Math.min(this._start+this._config.chunkSize,this._input.size),C=o.call(C,this._start,q)),n.readAsText(C,this._config.encoding));y||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(C){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(C.target.result)},this._chunkError=function(){this._sendError(n.error)}}function U(a){var n;z.call(this,a=a||{}),this.stream=function(o){return n=o,this._nextChunk()},this._nextChunk=function(){var o,y;if(!this._finished)return o=this._config.chunkSize,n=o?(y=n.substring(0,o),n.substring(o)):(y=n,""),this._finished=!n,this.parseChunk(y)}}function Pe(a){z.call(this,a=a||{});var n=[],o=!0,y=!1;this.pause=function(){z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(C){this._input=C,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){y&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):o=!0},this._streamData=x(function(C){try{n.push(typeof C=="string"?C:C.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(q){this._streamError(q)}},this),this._streamError=x(function(C){this._streamCleanUp(),this._sendError(C)},this),this._streamEnd=x(function(){this._streamCleanUp(),y=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function L(a){var n,o,y,C,q=Math.pow(2,53),be=-q,Te=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,E=/^((\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,O=0,ne=!1,V=!1,B=[],g={data:[],errors:[],meta:{}};function j(r){return a.skipEmptyLines==="greedy"?r.join("").trim()==="":r.length===1&&r[0].length===0}function ve(){if(g&&y&&(c("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),y=!1),a.skipEmptyLines&&(g.data=g.data.filter(function(P){return!j(P)})),Y()){let P=function(ee,X){b(a.transformHeader)&&(ee=a.transformHeader(ee,X)),B.push(ee)};if(g)if(Array.isArray(g.data[0])){for(var r=0;Y()&&r<g.data.length;r++)g.data[r].forEach(P);g.data.splice(0,1)}else g.data.forEach(P)}function T(P,ee){for(var X=a.header?{}:[],$=0;$<P.length;$++){var pe=$,ae=P[$],ae=((Ie,i)=>(A=>(a.dynamicTypingFunction&&a.dynamicTyping[A]===void 0&&(a.dynamicTyping[A]=a.dynamicTypingFunction(A)),(a.dynamicTyping[A]||a.dynamicTyping)===!0))(Ie)?i==="true"||i==="TRUE"||i!=="false"&&i!=="FALSE"&&((A=>{if(Te.test(A)&&(A=parseFloat(A),be<A&&A<q))return 1})(i)?parseFloat(i):E.test(i)?new Date(i):i===""?null:i):i)(pe=a.header?$>=B.length?"__parsed_extra":B[$]:pe,ae=a.transform?a.transform(ae,pe):ae);pe==="__parsed_extra"?(X[pe]=X[pe]||[],X[pe].push(ae)):X[pe]=ae}return a.header&&($>B.length?c("FieldMismatch","TooManyFields","Too many fields: expected "+B.length+" fields but parsed "+$,O+ee):$<B.length&&c("FieldMismatch","TooFewFields","Too few fields: expected "+B.length+" fields but parsed "+$,O+ee)),X}var se;g&&(a.header||a.dynamicTyping||a.transform)&&(se=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(T),se=g.data.length):g.data=T(g.data,0),a.header&&g.meta&&(g.meta.fields=B),O+=se)}function Y(){return a.header&&B.length===0}function c(r,T,se,P){r={type:r,code:T,message:se},P!==void 0&&(r.row=P),g.errors.push(r)}b(a.step)&&(C=a.step,a.step=function(r){g=r,Y()?ve():(ve(),g.data.length!==0&&(v+=r.data.length,a.preview&&v>a.preview?o.abort():(g.data=g.data[0],C(g,f))))}),this.parse=function(r,T,se){var P=a.quoteChar||'"',P=(a.newline||(a.newline=this.guessLineEndings(r,P)),y=!1,a.delimiter?b(a.delimiter)&&(a.delimiter=a.delimiter(r),g.meta.delimiter=a.delimiter):((P=((ee,X,$,pe,ae)=>{var Ie,i,A,ie;ae=ae||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var J=0;J<ae.length;J++){for(var me,we=ae[J],de=0,re=0,oe=0,F=(A=void 0,new Re({comments:pe,delimiter:we,newline:X,preview:10}).parse(ee)),Z=0;Z<F.data.length;Z++)$&&j(F.data[Z])?oe++:(me=F.data[Z].length,re+=me,A===void 0?A=me:0<me&&(de+=Math.abs(me-A),A=me));0<F.data.length&&(re/=F.data.length-oe),(i===void 0||de<=i)&&(ie===void 0||ie<re)&&1.99<re&&(i=de,Ie=we,ie=re)}return{successful:!!(a.delimiter=Ie),bestDelimiter:Ie}})(r,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=P.bestDelimiter:(y=!0,a.delimiter=u.DefaultDelimiter),g.meta.delimiter=a.delimiter),le(a));return a.preview&&a.header&&P.preview++,n=r,o=new Re(P),g=o.parse(n,T,se),ve(),ne?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return ne},this.pause=function(){ne=!0,o.abort(),n=b(a.chunk)?"":n.substring(o.getCharIndex())},this.resume=function(){f.streamer._halted?(ne=!1,f.streamer.parseChunk(n,!0)):setTimeout(f.resume,3)},this.aborted=function(){return V},this.abort=function(){V=!0,o.abort(),g.meta.aborted=!0,b(a.complete)&&a.complete(g),n=""},this.guessLineEndings=function(ee,P){ee=ee.substring(0,1048576);var P=new RegExp(fe(P)+"([^]*?)"+fe(P),"gm"),se=(ee=ee.replace(P,"")).split("\r"),P=ee.split(`
|
|
3
|
+
`),ee=1<P.length&&P[0].length<se[0].length;if(se.length===1||ee)return`
|
|
4
|
+
`;for(var X=0,$=0;$<se.length;$++)se[$][0]===`
|
|
5
|
+
`&&X++;return X>=se.length/2?`\r
|
|
6
|
+
`:"\r"}}function fe(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Re(a){var n=(a=a||{}).delimiter,o=a.newline,y=a.comments,C=a.step,q=a.preview,be=a.fastMode,Te=null,E=!1,f=a.quoteChar==null?'"':a.quoteChar,v=f;if(a.escapeChar!==void 0&&(v=a.escapeChar),(typeof n!="string"||-1<u.BAD_DELIMITERS.indexOf(n))&&(n=","),y===n)throw new Error("Comment character same as delimiter");y===!0?y="#":(typeof y!="string"||-1<u.BAD_DELIMITERS.indexOf(y))&&(y=!1),o!==`
|
|
7
|
+
`&&o!=="\r"&&o!==`\r
|
|
8
|
+
`&&(o=`
|
|
9
|
+
`);var O=0,ne=!1;this.parse=function(V,B,g){if(typeof V!="string")throw new Error("Input must be a string");var j=V.length,ve=n.length,Y=o.length,c=y.length,r=b(C),T=[],se=[],P=[],ee=O=0;if(!V)return de();if(be||be!==!1&&V.indexOf(f)===-1){for(var X=V.split(o),$=0;$<X.length;$++){if(P=X[$],O+=P.length,$!==X.length-1)O+=o.length;else if(g)return de();if(!y||P.substring(0,c)!==y){if(r){if(T=[],ie(P.split(n)),re(),ne)return de()}else ie(P.split(n));if(q&&q<=$)return T=T.slice(0,q),de(!0)}}return de()}for(var pe=V.indexOf(n,O),ae=V.indexOf(o,O),Ie=new RegExp(fe(v)+fe(f),"g"),i=V.indexOf(f,O);;)if(V[O]===f)for(i=O,O++;;){if((i=V.indexOf(f,i+1))===-1)return g||se.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:T.length,index:O}),me();if(i===j-1)return me(V.substring(O,i).replace(Ie,f));if(f===v&&V[i+1]===v)i++;else if(f===v||i===0||V[i-1]!==v){pe!==-1&&pe<i+1&&(pe=V.indexOf(n,i+1));var A=J((ae=ae!==-1&&ae<i+1?V.indexOf(o,i+1):ae)===-1?pe:Math.min(pe,ae));if(V.substr(i+1+A,ve)===n){P.push(V.substring(O,i).replace(Ie,f)),V[O=i+1+A+ve]!==f&&(i=V.indexOf(f,O)),pe=V.indexOf(n,O),ae=V.indexOf(o,O);break}if(A=J(ae),V.substring(i+1+A,i+1+A+Y)===o){if(P.push(V.substring(O,i).replace(Ie,f)),we(i+1+A+Y),pe=V.indexOf(n,O),i=V.indexOf(f,O),r&&(re(),ne))return de();if(q&&T.length>=q)return de(!0);break}se.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:T.length,index:O}),i++}}else if(y&&P.length===0&&V.substring(O,O+c)===y){if(ae===-1)return de();O=ae+Y,ae=V.indexOf(o,O),pe=V.indexOf(n,O)}else if(pe!==-1&&(pe<ae||ae===-1))P.push(V.substring(O,pe)),O=pe+ve,pe=V.indexOf(n,O);else{if(ae===-1)break;if(P.push(V.substring(O,ae)),we(ae+Y),r&&(re(),ne))return de();if(q&&T.length>=q)return de(!0)}return me();function ie(oe){T.push(oe),ee=O}function J(oe){var F=0;return F=oe!==-1&&(oe=V.substring(i+1,oe))&&oe.trim()===""?oe.length:F}function me(oe){return g||(oe===void 0&&(oe=V.substring(O)),P.push(oe),O=j,ie(P),r&&re()),de()}function we(oe){O=oe,ie(P),P=[],ae=V.indexOf(o,O)}function de(oe){if(a.header&&!B&&T.length&&!E){var F=T[0],Z=Object.create(null),M=new Set(F);let _e=!1;for(let Se=0;Se<F.length;Se++){let he=F[Se];if(Z[he=b(a.transformHeader)?a.transformHeader(he,Se):he]){let Ae,Le=Z[he];for(;Ae=he+"_"+Le,Le++,M.has(Ae););M.add(Ae),F[Se]=Ae,Z[he]++,_e=!0,(Te=Te===null?{}:Te)[Ae]=he}else Z[he]=1,F[Se]=he;M.add(he)}_e&&console.warn("Duplicate headers found and renamed."),E=!0}return{data:T,errors:se,meta:{delimiter:n,linebreak:o,aborted:ne,truncated:!!oe,cursor:ee+(B||0),renamedHeaders:Te}}}function re(){C(de()),T=[],se=[]}},this.abort=function(){ne=!0},this.getCharIndex=function(){return O}}function G(a){var n=a.data,o=m[n.workerId],y=!1;if(n.error)o.userError(n.error,n.file);else if(n.results&&n.results.data){var C={abort:function(){y=!0,W(n.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Ee,resume:Ee};if(b(o.userStep)){for(var q=0;q<n.results.data.length&&(o.userStep({data:n.results.data[q],errors:n.results.errors,meta:n.results.meta},C),!y);q++);delete n.results}else b(o.userChunk)&&(o.userChunk(n.results,C,n.file),delete n.results)}n.finished&&!y&&W(n.workerId,n.results)}function W(a,n){var o=m[a];b(o.userComplete)&&o.userComplete(n),o.terminate(),delete m[a]}function Ee(){throw new Error("Not implemented.")}function le(a){if(typeof a!="object"||a===null)return a;var n,o=Array.isArray(a)?[]:{};for(n in a)o[n]=le(a[n]);return o}function x(a,n){return function(){a.apply(n,arguments)}}function b(a){return typeof a=="function"}return u.parse=function(a,n){var o=(n=n||{}).dynamicTyping||!1;if(b(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!b(n.transform)&&n.transform,!n.worker||!u.WORKERS_SUPPORTED)return o=null,u.NODE_STREAM_INPUT,typeof a=="string"?(a=(y=>y.charCodeAt(0)!==65279?y:y.slice(1))(a),o=new(n.download?H:U)(n)):a.readable===!0&&b(a.read)&&b(a.on)?o=new Pe(n):(s.File&&a instanceof File||a instanceof Object)&&(o=new D(n)),o.stream(a);(o=(()=>{var y;return!!u.WORKERS_SUPPORTED&&(y=(()=>{var C=s.URL||s.webkitURL||null,q=l.toString();return u.BLOB_URL||(u.BLOB_URL=C.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"})))})(),(y=new s.Worker(y)).onmessage=G,y.id=k++,m[y.id]=y)})()).userStep=n.step,o.userChunk=n.chunk,o.userComplete=n.complete,o.userError=n.error,n.step=b(n.step),n.chunk=b(n.chunk),n.complete=b(n.complete),n.error=b(n.error),delete n.worker,o.postMessage({input:a,config:n,workerId:o.id})},u.unparse=function(a,n){var o=!1,y=!0,C=",",q=`\r
|
|
10
|
+
`,be='"',Te=be+be,E=!1,f=null,v=!1,O=((()=>{if(typeof n=="object"){if(typeof n.delimiter!="string"||u.BAD_DELIMITERS.filter(function(B){return n.delimiter.indexOf(B)!==-1}).length||(C=n.delimiter),typeof n.quotes!="boolean"&&typeof n.quotes!="function"&&!Array.isArray(n.quotes)||(o=n.quotes),typeof n.skipEmptyLines!="boolean"&&typeof n.skipEmptyLines!="string"||(E=n.skipEmptyLines),typeof n.newline=="string"&&(q=n.newline),typeof n.quoteChar=="string"&&(be=n.quoteChar),typeof n.header=="boolean"&&(y=n.header),Array.isArray(n.columns)){if(n.columns.length===0)throw new Error("Option columns is empty");f=n.columns}n.escapeChar!==void 0&&(Te=n.escapeChar+be),n.escapeFormulae instanceof RegExp?v=n.escapeFormulae:typeof n.escapeFormulae=="boolean"&&n.escapeFormulae&&(v=/^[=+\-@\t\r].*$/)}})(),new RegExp(fe(be),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return ne(null,a,E);if(typeof a[0]=="object")return ne(f||Object.keys(a[0]),a,E)}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])),ne(a.fields||[],a.data||[],E);throw new Error("Unable to serialize unrecognized input");function ne(B,g,j){var ve="",Y=(typeof B=="string"&&(B=JSON.parse(B)),typeof g=="string"&&(g=JSON.parse(g)),Array.isArray(B)&&0<B.length),c=!Array.isArray(g[0]);if(Y&&y){for(var r=0;r<B.length;r++)0<r&&(ve+=C),ve+=V(B[r],r);0<g.length&&(ve+=q)}for(var T=0;T<g.length;T++){var se=(Y?B:g[T]).length,P=!1,ee=Y?Object.keys(g[T]).length===0:g[T].length===0;if(j&&!Y&&(P=j==="greedy"?g[T].join("").trim()==="":g[T].length===1&&g[T][0].length===0),j==="greedy"&&Y){for(var X=[],$=0;$<se;$++){var pe=c?B[$]:$;X.push(g[T][pe])}P=X.join("").trim()===""}if(!P){for(var ae=0;ae<se;ae++){0<ae&&!ee&&(ve+=C);var Ie=Y&&c?B[ae]:ae;ve+=V(g[T][Ie],ae)}T<g.length-1&&(!j||0<se&&!ee)&&(ve+=q)}}return ve}function V(B,g){var j,ve;return B==null?"":B.constructor===Date?JSON.stringify(B).slice(1,25):(ve=!1,v&&typeof B=="string"&&v.test(B)&&(B="'"+B,ve=!0),j=B.toString().replace(O,Te),(ve=ve||o===!0||typeof o=="function"&&o(B,g)||Array.isArray(o)&&o[g]||((Y,c)=>{for(var r=0;r<c.length;r++)if(-1<Y.indexOf(c[r]))return!0;return!1})(j,u.BAD_DELIMITERS)||-1<j.indexOf(C)||j.charAt(0)===" "||j.charAt(j.length-1)===" ")?be+j+be:j)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
11
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!S&&!!s.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=Re,u.ParserHandle=L,u.NetworkStreamer=H,u.FileStreamer=D,u.StringStreamer=U,u.ReadableStreamStreamer=Pe,s.jQuery&&((d=s.jQuery).fn.parse=function(a){var n=a.config||{},o=[];return this.each(function(q){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var be=0;be<this.files.length;be++)o.push({file:this.files[be],inputElem:this,instanceConfig:d.extend({},n)})}),y(),this;function y(){if(o.length===0)b(a.complete)&&a.complete();else{var q,be,Te,E,f=o[0];if(b(a.before)){var v=a.before(f.file,f.inputElem);if(typeof v=="object"){if(v.action==="abort")return q="AbortError",be=f.file,Te=f.inputElem,E=v.reason,void(b(a.error)&&a.error({name:q},be,Te,E));if(v.action==="skip")return void C();typeof v.config=="object"&&(f.instanceConfig=d.extend(f.instanceConfig,v.config))}else if(v==="skip")return void C()}var O=f.instanceConfig.complete;f.instanceConfig.complete=function(ne){b(O)&&O(ne,f.file,f.inputElem),C()},u.parse(f.file,f.instanceConfig)}}function C(){o.splice(0,1),y()}}),R&&(s.onmessage=function(a){a=a.data,u.WORKER_ID===void 0&&a&&(u.WORKER_ID=a.workerId),typeof a.input=="string"?s.postMessage({workerId:u.WORKER_ID,results:u.parse(a.input,a.config),finished:!0}):(s.File&&a.input instanceof File||a.input instanceof Object)&&(a=u.parse(a.input,a.config))&&s.postMessage({workerId:u.WORKER_ID,results:a,finished:!0})}),(H.prototype=Object.create(z.prototype)).constructor=H,(D.prototype=Object.create(z.prototype)).constructor=D,(U.prototype=Object.create(U.prototype)).constructor=U,(Pe.prototype=Object.create(z.prototype)).constructor=Pe,u})})(Wt)),Wt.exports}var sr=rr();const pa=an(sr);var ir=I('<span class="remote-cell-label svelte-63hltt"> </span>'),or=I('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),lr=I('<span class="remote-cell-label svelte-63hltt"> </span>'),ur=I('<td><!> <input class="cell-input svelte-63hltt"/></td>'),cr=I('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),dr=I("<!> <span>Add row</span>",1),fr=I('<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 vr(K,t){nt(t,!0);let l=qe(t,"remoteCursors",19,()=>[]),s=De(gt([])),d=De(gt([])),S=De(void 0);function R(E){const f=pa.parse(E.trim(),{header:!1,skipEmptyLines:!0});f.data.length>0?(_(s,f.data[0],!0),_(d,f.data.slice(1),!0)):(_(s,[],!0),_(d,[],!0))}R(t.content),ht(()=>{R(t.content)});function m(){return pa.unparse([e(s),...e(d)])}function k(){const E=m();t.onchange?.(E)}function u(E,f,v){e(d)[E][f]=v,_(d,[...e(d)],!0),k()}function z(E,f){e(s)[E]=f,_(s,[...e(s)],!0),k()}function H(){_(d,[...e(d),e(s).map(()=>"")],!0),k(),L(e(d).length-1,0)}function D(E){_(d,e(d).filter((f,v)=>v!==E),!0),k()}function U(){const E=`col${e(s).length+1}`;_(s,[...e(s),E],!0),_(d,e(d).map(f=>[...f,""]),!0),k(),requestAnimationFrame(()=>{const f=e(S)?.querySelector(`thead th:nth-child(${e(s).length+1}) input`);f&&(f.focus(),f.select())})}function Pe(E){e(s).length<=1||(_(s,e(s).filter((f,v)=>v!==E),!0),_(d,e(d).map(f=>f.filter((v,O)=>O!==E)),!0),k())}function L(E,f){requestAnimationFrame(()=>{if(!e(S))return;let v=null;E<0?v=e(S).querySelector(`thead th:nth-child(${f+2}) input`):v=e(S).querySelector(`tbody tr:nth-child(${E+1}) td:nth-child(${f+2}) input`),v&&(v.focus(),v.select())})}function fe(E,f,v){if(E.key==="Tab"){E.preventDefault(),E.shiftKey?v>0?L(f,v-1):f>0?L(f-1,e(s).length-1):f===0&&L(-1,e(s).length-1):v<e(s).length-1?L(f,v+1):f<e(d).length-1?L(f+1,0):f===e(d).length-1&&H();return}if(E.key==="Enter"){E.preventDefault(),E.shiftKey?f>0?L(f-1,v):L(-1,v):f<e(d).length-1?L(f+1,v):H();return}if(E.key==="Escape"){E.target.blur();return}}function Re(E,f){if(E.key==="Tab"){E.preventDefault(),E.shiftKey?f>0&&L(-1,f-1):f<e(s).length-1?L(-1,f+1):e(d).length>0&&L(0,0);return}if(E.key==="Enter"){E.preventDefault(),e(d).length>0?L(0,f):H();return}if(E.key==="Escape"){E.target.blur();return}}function G(E,f){return l().find(v=>v.row===E&&v.col===f)}function W(E,f){t.oncellselect?.(E,f)}function Ee(E){(E.metaKey||E.ctrlKey)&&E.key==="s"&&(E.preventDefault(),t.onsave?.())}var le=fr(),x=w(le),b=w(x),a=w(b),n=w(a),o=N(w(n));Ve(o,17,()=>e(s),Ye,(E,f,v)=>{const O=ze(()=>G(-1,v));var ne=or();let V;var B=w(ne);{var g=c=>{var r=ir(),T=w(r,!0);h(r),ue(()=>{et(r,`background-color: ${e(O).color??""}`),ce(T,e(O).name)}),p(c,r)};xe(B,c=>{e(O)&&c(g)})}var j=N(B,2);Lt(j);var ve=N(j,2);{var Y=c=>{Je(c,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>Pe(v),children:(r,T)=>{ua(r,{size:12})},$$slots:{default:!0}})};xe(ve,c=>{e(s).length>1&&c(Y)})}h(ne),ue(()=>{et(ne,e(O)?`--rc-color: ${e(O).color}`:""),V=Ct(ne,1,"svelte-63hltt",null,V,{"remote-active":!!e(O)}),aa(j,e(f))}),Ge("input",j,c=>z(v,c.currentTarget.value)),Ge("keydown",j,c=>Re(c,v)),_t("focus",j,()=>W(-1,v)),p(E,ne)});var y=N(o),C=w(y);Je(C,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:U,children:(E,f)=>{Bt(E,{size:14})},$$slots:{default:!0}}),h(y),h(n),h(a);var q=N(a);Ve(q,21,()=>e(d),Ye,(E,f,v)=>{var O=cr(),ne=w(O);ne.textContent=v+1;var V=N(ne);Ve(V,17,()=>e(f),Ye,(j,ve,Y)=>{const c=ze(()=>G(v,Y));var r=ur();let T;var se=w(r);{var P=X=>{var $=lr(),pe=w($,!0);h($),ue(()=>{et($,`background-color: ${e(c).color??""}`),ce(pe,e(c).name)}),p(X,$)};xe(se,X=>{e(c)&&X(P)})}var ee=N(se,2);Lt(ee),h(r),ue(()=>{et(r,e(c)?`--rc-color: ${e(c).color}`:""),T=Ct(r,1,"svelte-63hltt",null,T,{"remote-active":!!e(c)}),aa(ee,e(ve))}),Ge("input",ee,X=>u(v,Y,X.currentTarget.value)),Ge("keydown",ee,X=>fe(X,v,Y)),_t("focus",ee,()=>W(v,Y)),p(j,r)});var B=N(V),g=w(B);Je(g,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>D(v),children:(j,ve)=>{ua(j,{size:12})},$$slots:{default:!0}}),h(B),h(O),p(E,O)}),h(q),h(b),Yt(b,E=>_(S,E),()=>e(S)),h(x);var be=N(x,2),Te=w(be);Je(Te,{variant:"ghost",class:"add-row-btn",onclick:H,children:(E,f)=>{var v=dr(),O=Ce(v);Bt(O,{size:14}),Ne(2),p(E,v)},$$slots:{default:!0}}),h(be),h(le),Ge("keydown",le,Ee),p(K,le),rt()}na(["keydown","input"]);const hr=/^\d{4}-\d{2}-\d{2}/,pr=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),_r=new Set(["format"]),gr=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function mr(K,t){const l=[];for(const[d,S]of Object.entries(K)){if(gr.has(d)||S==null)continue;const R=yr(d,S);R&&l.push(R)}const s=["entity_type","name","date"];return l.sort((d,S)=>{const R=s.indexOf(d.key),m=s.indexOf(S.key);return R!==-1&&m!==-1?R-m:R!==-1?-1:m!==-1?1:d.key.localeCompare(S.key)}),l}function yr(K,t){if(K==="entity_type")return{key:K,value:String(t),type:"entity-type"};if(_r.has(K))return{key:K,value:String(t).toUpperCase(),type:"badge"};if(K==="status")return{key:K,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const m=t.map(k=>Object.entries(k).map(([z,H])=>`${z}: ${H}`).join(", "));return{key:K,value:m.join(" | "),type:"text"}}const d=t.map(String),S=d.some(m=>/^\[\[.+?\]\]$/.test(m)),R=d.map(m=>{const k=m.match(/^\[\[(.+?)\]\]$/);return k?k[1]:m});return S||R.every(m=>_a(m))?{key:K,value:R,type:"wikilink"}:{key:K,value:d.join(", "),type:"text"}}const l=String(t),s=l.match(/^\[\[(.+?)\]\]$/);return s?{key:K,value:s[1],type:"wikilink"}:hr.test(l)?{key:K,value:l,type:"date"}:pr.has(l.toLowerCase())?{key:K,value:l,type:"status"}:_a(l)&&!l.includes(" ")?{key:K,value:l,type:"wikilink"}:{key:K,value:l,type:"text"}}function _a(K){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(K)&&K.includes("-")}class wr{diff(t,l,s={}){let d;typeof s=="function"?(d=s,s={}):"callback"in s&&(d=s.callback);const S=this.castInput(t,s),R=this.castInput(l,s),m=this.removeEmpty(this.tokenize(S,s)),k=this.removeEmpty(this.tokenize(R,s));return this.diffWithOptionsObj(m,k,s,d)}diffWithOptionsObj(t,l,s,d){var S;const R=G=>{if(G=this.postProcess(G,s),d){setTimeout(function(){d(G)},0);return}else return G},m=l.length,k=t.length;let u=1,z=m+k;s.maxEditLength!=null&&(z=Math.min(z,s.maxEditLength));const H=(S=s.timeout)!==null&&S!==void 0?S:1/0,D=Date.now()+H,U=[{oldPos:-1,lastComponent:void 0}];let Pe=this.extractCommon(U[0],l,t,0,s);if(U[0].oldPos+1>=k&&Pe+1>=m)return R(this.buildValues(U[0].lastComponent,l,t));let L=-1/0,fe=1/0;const Re=()=>{for(let G=Math.max(L,-u);G<=Math.min(fe,u);G+=2){let W;const Ee=U[G-1],le=U[G+1];Ee&&(U[G-1]=void 0);let x=!1;if(le){const a=le.oldPos-G;x=le&&0<=a&&a<m}const b=Ee&&Ee.oldPos+1<k;if(!x&&!b){U[G]=void 0;continue}if(!b||x&&Ee.oldPos<le.oldPos?W=this.addToPath(le,!0,!1,0,s):W=this.addToPath(Ee,!1,!0,1,s),Pe=this.extractCommon(W,l,t,G,s),W.oldPos+1>=k&&Pe+1>=m)return R(this.buildValues(W.lastComponent,l,t))||!0;U[G]=W,W.oldPos+1>=k&&(fe=Math.min(fe,G-1)),Pe+1>=m&&(L=Math.max(L,G+1))}u++};if(d)(function G(){setTimeout(function(){if(u>z||Date.now()>D)return d(void 0);Re()||G()},0)})();else for(;u<=z&&Date.now()<=D;){const G=Re();if(G)return G}}addToPath(t,l,s,d,S){const R=t.lastComponent;return R&&!S.oneChangePerToken&&R.added===l&&R.removed===s?{oldPos:t.oldPos+d,lastComponent:{count:R.count+1,added:l,removed:s,previousComponent:R.previousComponent}}:{oldPos:t.oldPos+d,lastComponent:{count:1,added:l,removed:s,previousComponent:R}}}extractCommon(t,l,s,d,S){const R=l.length,m=s.length;let k=t.oldPos,u=k-d,z=0;for(;u+1<R&&k+1<m&&this.equals(s[k+1],l[u+1],S);)u++,k++,z++,S.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return z&&!S.oneChangePerToken&&(t.lastComponent={count:z,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=k,u}equals(t,l,s){return s.comparator?s.comparator(t,l):t===l||!!s.ignoreCase&&t.toLowerCase()===l.toLowerCase()}removeEmpty(t){const l=[];for(let s=0;s<t.length;s++)t[s]&&l.push(t[s]);return l}castInput(t,l){return t}tokenize(t,l){return Array.from(t)}join(t){return t.join("")}postProcess(t,l){return t}get useLongestToken(){return!1}buildValues(t,l,s){const d=[];let S;for(;t;)d.push(t),S=t.previousComponent,delete t.previousComponent,t=S;d.reverse();const R=d.length;let m=0,k=0,u=0;for(;m<R;m++){const z=d[m];if(z.removed)z.value=this.join(s.slice(u,u+z.count)),u+=z.count;else{if(!z.added&&this.useLongestToken){let H=l.slice(k,k+z.count);H=H.map(function(D,U){const Pe=s[u+U];return Pe.length>D.length?Pe:D}),z.value=this.join(H)}else z.value=this.join(l.slice(k,k+z.count));k+=z.count,z.added||(u+=z.count)}}return d}}const ga="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 br extends wr{tokenize(t){const l=new RegExp(`(\\r?\\n)|[${ga}]+|[^\\S\\n\\r]+|[^${ga}]`,"ug");return t.match(l)||[]}}const kr=new br;function xr(K,t,l){return kr.diff(K,t,l)}var Cr=I('<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>'),Er=I('<div class="diff-properties svelte-1g4tvol"></div>'),Sr=I('<span class="db-added"> </span>'),Pr=I('<span class="db-removed"> </span>'),Ar=I("<span> </span>"),Rr=I("<span> </span>"),Dr=I('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function Tr(K,t){nt(t,!0);function l(D){if(D==null)return"";if(typeof D!="object")return String(D);const U=D;return String(U.name??U.title??U.label??U.id??JSON.stringify(U))}function s(D){return D==null?"":Array.isArray(D)?D.map(l).join(", "):typeof D=="object"?l(D):String(D)}const d=ze(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?xr(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var S=Dr(),R=w(S);{var m=D=>{var U=Er();Ve(U,21,()=>t.refreshResult.diffs,Ye,(Pe,L)=>{const fe=ze(()=>t.properties.find(v=>v.key===e(L).field));var Re=Cr(),G=w(Re),W=w(G);{var Ee=v=>{Nt(v,{size:14})},le=v=>{qt(v,{size:14})},x=v=>{Ht(v,{size:14})},b=v=>{ka(v,{size:14})},a=v=>{Vt(v,{size:14})};xe(W,v=>{e(fe)?.type==="date"?v(Ee):e(fe)?.type==="status"?v(le,1):e(fe)?.type==="wikilink"?v(x,2):e(fe)?.type==="badge"?v(b,3):v(a,!1)})}h(G);var n=N(G,2),o=w(n,!0);h(n);var y=N(n,2),C=w(y),q=w(C),be=w(q,!0);h(q),h(C);var Te=N(C,2),E=w(Te),f=w(E,!0);h(E),h(Te),h(y),h(Re),ue((v,O)=>{ce(o,e(L).field),ce(be,v),ce(f,O)},[()=>s(e(L).old_value),()=>s(e(L).new_value)]),p(Pe,Re)}),h(U),p(D,U)};xe(R,D=>{t.refreshResult.diffs.length>0&&D(m)})}var k=N(R,2),u=w(k);{var z=D=>{var U=Be(),Pe=Ce(U);Ve(Pe,17,()=>e(d),Ye,(L,fe)=>{var Re=Be(),G=Ce(Re);{var W=x=>{var b=Sr(),a=w(b,!0);h(b),ue(()=>ce(a,e(fe).value)),p(x,b)},Ee=x=>{var b=Pr(),a=w(b,!0);h(b),ue(()=>ce(a,e(fe).value)),p(x,b)},le=x=>{var b=Ar(),a=w(b,!0);h(b),ue(()=>ce(a,e(fe).value)),p(x,b)};xe(G,x=>{e(fe).added?x(W):e(fe).removed?x(Ee,1):x(le,!1)})}p(L,Re)}),p(D,U)},H=D=>{var U=Rr(),Pe=w(U,!0);h(U),ue(()=>ce(Pe,t.bodyContent)),p(D,U)};xe(u,D=>{e(d)?D(z):D(H,!1)})}h(k),h(S),p(K,S),rt()}var Or=I("<!> ",1),zr=I('<span class="diff-action-title svelte-udj3er">Changes from source</span> <div class="diff-action-buttons svelte-udj3er"><!> <!></div>',1),Lr=I('<span class="bc-sep svelte-udj3er">/</span>'),Fr=I("<!><span> </span>",1),Mr=I('<span class="status-text saving svelte-udj3er">Saving...</span>'),Ir=I('<span class="status-text error svelte-udj3er"> </span>'),jr=I("<!> ",1),Kr=I('<div class="breadcrumb-path svelte-udj3er"></div> <div class="editor-actions svelte-udj3er"><!> <!> <!></div>',1),Ur=I('<div class="refresh-panel svelte-udj3er"><div class="refresh-uptodate svelte-udj3er">Entity is up to date with source.</div></div>'),Vr=I('<div class="document-scroll svelte-udj3er"><div class="document-well svelte-udj3er"><!> <!></div></div>'),Nr=I("<!> <!>",1),qr=I("<!> <!>",1),Hr=I("<!> <div><!></div> <!> <!> <!> <!>",1);function ps(K,t){nt(t,!0);const l=()=>Fa(on,"$page",s),[s,d]=Ma(),S=ze(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),R=ze(()=>zt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),m=ze(()=>()=>{const i=t.data.entity.path;if(i){const A=i.lastIndexOf(`/${t.data.repo}/`);if(A>=0)return i.substring(A+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let k=De(""),u=De(gt({})),z=De(0);const H=ze(()=>mr(e(u))),D=new Set(["name","date"]);let U=De(null);ht(()=>{if(l().url.searchParams.has("new")){_(U,"name");const i=new URL(l().url);i.searchParams.delete("new"),history.replaceState({},"",i.pathname)}else _(U,null)});const Pe=ze(()=>!!t.data.entity.data?.source_ref);let L=De(!1),fe=De(null),Re=De(null);async function G(){if(!e(L)){_(L,!0),_(fe,null),_(Re,null);try{const{result:i}=await tn(t.data.repo,t.data.type,t.data.id);_(fe,i,!0)}catch(i){_(Re,i.message||"Refresh failed",!0)}finally{_(L,!1)}}}let W=De(!1);async function Ee(){if(!e(W)){_(W,!0);try{await en(t.data.repo,t.data.type,t.data.id),_(fe,null),await ja()}catch(i){_(Re,i.message||"Apply changes failed",!0)}finally{_(W,!1)}}}let le=null,x=De(""),b=!1,a=De(gt([]));function n(i){o(),Xe(async()=>{const{createCollabSession:A}=await import("../chunks/QOJagAiA.js");return{createCollabSession:A}},__vite__mapDeps([8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(({createCollabSession:A})=>{const ie=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",J=A(i,{name:va.user?.displayName??"Anonymous",color:ie,colorLight:ie+"33"});J.ytext.observe(()=>{const de=J.ytext.toString();de!==e(k)&&(b=!0,_(k,de,!0),requestAnimationFrame(()=>{b=!1}))});const me=J.ydoc.clientID;function we(){const de=[];J.awareness.getStates().forEach((re,oe)=>{if(oe===me)return;const F=re.cell;if(F==null||F.row==null||F.col==null)return;const{name:Z="Anonymous",color:M="#e05050"}=re.user||{};de.push({row:F.row,col:F.col,name:Z,color:M})}),_(a,de,!0)}J.awareness.on("change",we),le=J,_(x,i,!0)})}function o(){le&&(le.destroy(),le=null,_(x,""),_(a,[],!0))}wa(()=>o());let y=De(""),C=De(0);ht(()=>{const i=`${t.data.repo}/${t.data.type}/${t.data.id}`,A=Na.mutationCount;if(i!==e(y)||A!==e(C)){e(y)&&i!==e(y)&&We.flush(),_(y,i),_(C,A,!0),_(k,t.data.entity.document?.content??"",!0),_(u,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),Ot(z),We.reset();const ie=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(S)&&ie!==e(x)?n(ie):e(S)||o()}}),ht(()=>{const i=t.data.repo,A=t.data.type,ie=t.data.id;ma(()=>{ta.select(i,A,ie),ta.showEntity()})});function q(i){if(!b){if(_(k,i,!0),le){const A=le.ytext,ie=A.toString();i!==ie&&le.ydoc.transact(()=>{A.delete(0,A.length),A.insert(0,i)})}We.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:i})}}function be(i,A){_(u,{...e(u),[i]:A},!0),We.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function Te(i){const{[i]:A,...ie}=e(u);_(u,ie,!0),We.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function E(i,A){_(u,{...e(u),[i]:A},!0),We.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}function f(i,A){We.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(u)})}let v=De(null);function O(i){i!==t.data.type&&_(v,i,!0)}async function ne(){const i=e(v);if(_(v,null),!!i){We.reset();try{await Ra(t.data.repo,t.data.type,t.data.id,i),await zt.refreshEntities(t.data.repo),await Ut(`/${t.data.repo}/${i}/${t.data.id}`,{invalidateAll:!0})}catch(A){console.error("Failed to change entity type:",A)}}}function V(i){for(const A of zt.repos){const ie=A.entities.find(J=>J.id===i);if(ie){Ut(`/${A.name}/${ie.entityType}/${ie.id}`);return}}nn.showToast(`"${i}" is in a collection you don't have access to`)}ht(()=>(ca.enter(t.data.repo,t.data.type,t.data.id),()=>ca.leave()));const B=ze(()=>e(fe)!==null&&(e(fe).diffs.length>0||e(fe).body_changed));function g(i){(i.metaKey||i.ctrlKey)&&i.key==="s"&&(i.preventDefault(),We.flush()),i.key==="Escape"&&!(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)&&(We.flush(),ta.deselect(),Ut("/"))}var j=Hr();_t("keydown",ya,g);var ve=Ce(j);Ka(ve,{activeView:"entity"});var Y=N(ve,2);let c;var r=w(Y);{var T=i=>{var A=zr(),ie=N(Ce(A),2),J=w(ie);Je(J,{variant:"outline",size:"default",onclick:()=>_(fe,null),get disabled(){return e(W)},children:(we,de)=>{Ne();var re=pt("Dismiss");p(we,re)},$$slots:{default:!0}});var me=N(J,2);Je(me,{variant:"accent",size:"default",onclick:Ee,get disabled(){return e(W)},children:(we,de)=>{var re=Or(),oe=Ce(re);{var F=M=>{fa(M,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};xe(oe,M=>{e(W)&&M(F)})}var Z=N(oe,1,!0);ue(()=>ce(Z,e(W)?"Applying...":"Apply changes")),p(we,re)},$$slots:{default:!0}}),h(ie),p(i,A)},se=i=>{var A=Kr(),ie=Ce(A);Ve(ie,21,()=>e(m)(),Ye,(M,_e,Se)=>{var he=Fr(),Ae=Ce(he);{var Le=Me=>{var He=Lr();p(Me,He)};xe(Ae,Me=>{Se>0&&Me(Le)})}var ye=N(Ae),Fe=w(ye,!0);h(ye),ue(Me=>{Ct(ye,1,Me,"svelte-udj3er"),ce(Fe,e(_e))},[()=>La(Se===e(m)().length-1?"bc-current":"bc-segment")]),p(M,he)}),h(ie);var J=N(ie,2),me=w(J);{var we=M=>{var _e=Mr();p(M,_e)},de=M=>{var _e=Ir(),Se=w(_e,!0);h(_e),ue(()=>ce(Se,We.error)),p(M,_e)};xe(me,M=>{We.saving?M(we):We.error&&M(de,1)})}var re=N(me,2);{var oe=M=>{Je(M,{variant:"outline",size:"sm",class:"refresh-btn",onclick:G,get disabled(){return e(L)},children:(_e,Se)=>{var he=jr(),Ae=Ce(he);{var Le=Fe=>{fa(Fe,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};xe(Ae,Fe=>{e(L)&&Fe(Le)})}var ye=N(Ae,1,!0);ue(()=>ce(ye,e(L)?"Refreshing...":"Refresh from source")),p(_e,he)},$$slots:{default:!0}})};xe(re,M=>{e(Pe)&&va.user?.role==="admin"&&M(oe)})}var F=N(re,2);{var Z=M=>{Je(M,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(_e,Se)=>{Ne();var he=pt();ue(()=>ce(he,`Open in ${e(R).name??""} →`)),p(_e,he)},$$slots:{default:!0}})};xe(F,M=>{e(R)&&M(Z)})}h(J),p(i,A)};xe(r,i=>{e(B)?i(T):i(se,!1)})}h(Y);var P=N(Y,2);{var ee=i=>{var A=Ur();p(i,A)};xe(P,i=>{e(fe)&&!e(B)&&i(ee)})}var X=N(P,2);{var $=i=>{Tr(i,{get properties(){return e(H)},get refreshResult(){return e(fe)},get bodyContent(){return e(k)}})},pe=i=>{var A=Vr(),ie=w(A),J=w(ie);Xn(J,{get properties(){return e(H)},editable:!0,get autofocusKey(){return e(U)},get protectedKeys(){return D},onedit:be,onremove:Te,onadd:E,ontypechange:f,onentitytypechange:O,onfocuseditor:()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>{const re=document.querySelector(".cm-content");if(re){re.focus();const oe=window.getSelection();oe&&re.firstChild?oe.collapse(re.firstChild,0):oe&&oe.collapse(re,0)}}))}});var me=N(J,2);{var we=re=>{vr(re,{get content(){return e(k)},onchange:q,onsave:()=>We.flush(),oncellselect:(oe,F)=>{le?.awareness.setLocalStateField("cell",{row:oe,col:F})},get remoteCursors(){return e(a)}})},de=re=>{{let oe=ze(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);ar(re,{get content(){return e(k)},readonly:!1,onchange:q,onsave:()=>We.flush(),onwikilinkclick:V,get resetKey(){return e(z)},get cursorDocName(){return e(oe)}})}};xe(me,re=>{e(S)?re(we):re(de,!1)})}h(ie),h(A),p(i,A)};xe(X,i=>{e(B)?i($):i(pe,!1)})}var ae=N(X,2);{let i=ze(()=>!!e(Re));Ue(ae,()=>$a,(A,ie)=>{ie(A,{get open(){return e(i)},onOpenChange:J=>{J||_(Re,null)},children:(J,me)=>{var we=Be(),de=Ce(we);Ue(de,()=>Ya,(re,oe)=>{oe(re,{children:(F,Z)=>{var M=qr(),_e=Ce(M);Ue(_e,()=>Ja,(he,Ae)=>{Ae(he,{children:(Le,ye)=>{var Fe=Nr(),Me=Ce(Fe);Ue(Me,()=>Za,(te,Q)=>{Q(te,{children:(ge,ke)=>{Ne();var Oe=pt("Refresh failed");p(ge,Oe)},$$slots:{default:!0}})});var He=N(Me,2);Ue(He,()=>Ga,(te,Q)=>{Q(te,{children:(ge,ke)=>{Ne();var Oe=pt();ue(()=>ce(Oe,e(Re))),p(ge,Oe)},$$slots:{default:!0}})}),p(Le,Fe)},$$slots:{default:!0}})});var Se=N(_e,2);Ue(Se,()=>Qa,(he,Ae)=>{Ae(he,{children:(Le,ye)=>{var Fe=Be(),Me=Ce(Fe);Ue(Me,()=>Xa,(He,te)=>{te(He,{children:(Q,ge)=>{Ne();var ke=pt("OK");p(Q,ke)},$$slots:{default:!0}})}),p(Le,Fe)},$$slots:{default:!0}})}),p(F,M)},$$slots:{default:!0}})}),p(J,we)},$$slots:{default:!0}})})}var Ie=N(ae,2);{let i=ze(()=>e(v)!==null),A=ze(()=>`Change this entity from ${xt(t.data.type)} to ${xt(e(v)??"")}? Fields specific to ${xt(t.data.type)} will be removed.`);Ha(Ie,{get open(){return e(i)},title:"Change entity type",get message(){return e(A)},confirmLabel:"Change type",onconfirm:ne,oncancel:()=>{_(v,null)}})}ue(()=>c=Ct(Y,1,"editor-bar svelte-udj3er",null,c,{"editor-bar-diff":e(B)})),p(K,j),rt(),d()}export{ps as component,hs 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/B3cbqYdb.js";import{a as S,s as Z,b as M,g as ft}from"../chunks/yEDUbZbk.js";import{p as $,a8 as tt,aG 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,aH as ht,a4 as vt,ae as yt}from"../chunks/BBDMeJL4.js";import{b as Q,i as F}from"../chunks/Dtbtl5su.js";import{s as X}from"../chunks/Bt7P6UBm.js";import{g as pt}from"../chunks/BmP3yl81.js";import{n as E}from"../chunks/Dx6YFABE.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
|
-
`,document.head.appendChild(p);const
|
|
4
|
+
`,document.head.appendChild(p);const C=H.body;for(const t of Array.from(C.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(C.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=C.querySelectorAll("script"),G=[],K=[];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}`),G.push(a)}else t.textContent&&K.push(t.textContent);t.remove()}s.innerHTML=C.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 N=Y=>{Y.preventDefault(),Y.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",N,!0),w={el:a,handler:N}}}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 G){if(e!==_)return;await ot(t+dt)}for(const t of K){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 A=_t();let V;var W=I(A);Q(W,e=>l=e,()=>l);var D=T(W,2);{var nt=e=>{var i=gt();S(e,i)};F(D,e=>{m(u)&&e(nt)})}var U=T(D,2);{var rt=e=>{var i=wt(),r=I(i,!0);O(i),j(()=>Z(r,m(h))),S(e,i)};F(U,e=>{m(h)&&e(rt)})}var R=T(U,2);let z;Q(R,e=>s=e,()=>s),O(A),j(()=>{V=X(A,1,"editor-frame svelte-1fltv0h",null,V,{loading:m(u)}),z=X(R,1,"editor-container svelte-1fltv0h",null,z,{hidden:m(u)||!!m(h)})}),S(b,A),et()}var St=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=St(),g=I(v);O(v),j(()=>Z(g,`No app editor available for entity type "${o.data.type??""}"`)),S(d,v)};F(u,d=>{m(l)?d(h):d(y,!1)})}S(b,s),et()}export{It as component,Tt as universal};
|
|
@@ -0,0 +1,2 @@
|
|
|
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/yEDUbZbk.js";import{p as Bt,aC as Je,a8 as St,g,ae as nt,aG as Ne,aH 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,br as $e}from"../chunks/BBDMeJL4.js";import{V as tn}from"../chunks/BQZlAX3A.js";import{_ as en}from"../chunks/PPVm8Dsz.js";import{e as ce,i as fe}from"../chunks/CpAdcarq.js";import{s as nn}from"../chunks/Bt7P6UBm.js";import{c as kt,a as Pe}from"../chunks/BMrbs3EC.js";import{b as Ee,i as Kt}from"../chunks/Dtbtl5su.js";import{p as mt,l as Qt}from"../chunks/CpXgbTWt.js";import{g as rn}from"../chunks/BmP3yl81.js";import{e as Mt,c as on}from"../chunks/CClliU_-.js";import{B as an}from"../chunks/DYpjUIN_.js";import{i as Re}from"../chunks/Ddpk8P2X.js";import{n as se}from"../chunks/Dx6YFABE.js";import{w as Wt}from"../chunks/B3cbqYdb.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 Hn(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,H=Math.sqrt(Y),B=y.nodes.map(T=>{const O=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:O,x:dt?.x??(Math.random()-.5)*H,y:dt?.y??(Math.random()-.5)*H,vx:0,vy:0,r:At(O)}}),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 O=L.get(T);O&&(R.removeChild(O),O.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 O=T.getContext("2d");O.beginPath(),O.arc(50,50,48,0,Math.PI*2),O.fillStyle="#ffffff",O.fill(),X=tt.Texture.from(T)}for(const T of B){let O=L.get(T.id);O||(O=new tt.Sprite(X),O.anchor.set(.5),R.addChild(O),L.set(T.id,O)),O.tint=Ht(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,H=w-P.y,B=(P.r*1.5+4)/m;if(Y*Y+H*H<=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 H=d.clientWidth,B=d.clientHeight,Z=w-y,rt=P-_;if(Z===0||rt===0)return;const ut=(60+Y)*2;m=Math.min((H-ut)/Z,(B-ut)/rt,3),x=H/2-(y+w)/2*m,D=B/2-(_+P)/2*m,et()}function et(){s=!0,h=0}function Ht(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)),H=(y&255)+_*((w&255)-(y&255));return Math.round(P)<<16|Math.round(Y)<<8|Math.round(H)}function He(){if(!tt||!k||!j)return;k.clear(),j.clear();const w=N!==null,_=I,P=g(wt),Y=a(),H=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,O=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||H!==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,O),J.stroke()}}function Oe(){if(!tt)return;const y=N,w=y!==null,_=I,P=g(wt),Y=a(),H=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 O=V.x*m+x,dt=V.y*m+D;T.position.set(O,dt),T.scale.set(V.r/50),T.alpha=1;const z=Ht(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(H!==null){const ae=H.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=Ht(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 Ot=!1;function Ge(y){if(y.button!==0)return;Ot=!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){Ot=!0;const w=ee(y.clientX,y.clientY);S.fx=w.x,S.fy=w.y,et()}else if(g(W))Ot=!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=Ot;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 H=Mt(P);H===Nt?_+=Y:w.push({name:P,color:H,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 H=Y.getContext("2d");H.beginPath(),H.arc(50,50,48,0,Math.PI*2),H.fillStyle="#ffffff",H.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=Ht(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 O=0;A.ticker.add(()=>{const z=performance.now(),J=O?Math.min((z-O)/1e3,.05):.016;O=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)&&(He(),Oe(),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 H;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}),H=kt(Y,"",H,{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 On=$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=On(),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");an(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 pi(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);Hn(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 on.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{pi as component};
|