studiograph 1.3.23 → 1.3.25

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