studiograph 1.3.18 → 1.3.20

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 (75) hide show
  1. package/dist/core/types.d.ts +3 -0
  2. package/dist/core/types.js +1 -0
  3. package/dist/core/types.js.map +1 -1
  4. package/dist/server/chrome/chrome.css +4 -8
  5. package/dist/server/index.js +15 -2
  6. package/dist/server/index.js.map +1 -1
  7. package/dist/web/_app/immutable/assets/0.D8EoqqcB.css +1 -0
  8. package/dist/web/_app/immutable/assets/2.DRZ4qWy8.css +1 -0
  9. package/dist/web/_app/immutable/assets/{3.C-bIa9M8.css → 3.Bxy1xbfc.css} +1 -1
  10. package/dist/web/_app/immutable/assets/{4.BhKgiXd2.css → 4.aFSdMTV2.css} +1 -1
  11. package/dist/web/_app/immutable/assets/{5.CydFyZSu.css → 5.CquhUpOu.css} +1 -1
  12. package/dist/web/_app/immutable/assets/{6.kqeOo0OW.css → 6.CT4xL4K3.css} +1 -1
  13. package/dist/web/_app/immutable/assets/{7.CseIx7qQ.css → 7.BMfme7ZM.css} +1 -1
  14. package/dist/web/_app/immutable/assets/{8.BYpFDZHK.css → 8.BUrHkYry.css} +1 -1
  15. package/dist/web/_app/immutable/assets/AppShell.DVyh4lcT.css +1 -0
  16. package/dist/web/_app/immutable/assets/ViewToolbar.39HnhXNY.css +1 -0
  17. package/dist/web/_app/immutable/chunks/{BpUdqMox.js → 1YZNbPuF.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{DKQjBKyp.js → B340SUKR.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{BVmVTxxa.js → BAoPZe8v.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/BBKhbmnU.js +1 -0
  21. package/dist/web/_app/immutable/chunks/BWbpPmKt.js +1 -0
  22. package/dist/web/_app/immutable/chunks/{BaUG0bh_.js → BXo5rIdU.js} +2 -2
  23. package/dist/web/_app/immutable/chunks/C5Jg9_3k.js +1 -0
  24. package/dist/web/_app/immutable/chunks/CGoS23Dn.js +1 -0
  25. package/dist/web/_app/immutable/chunks/Cd2AAfar.js +1 -0
  26. package/dist/web/_app/immutable/chunks/CkwRiDze.js +1 -0
  27. package/dist/web/_app/immutable/chunks/DDuM5_bq.js +1 -0
  28. package/dist/web/_app/immutable/chunks/DJumtN6X.js +2 -0
  29. package/dist/web/_app/immutable/chunks/DP5Y1V5j.js +1 -0
  30. package/dist/web/_app/immutable/chunks/DZ7uBozP.js +91 -0
  31. package/dist/web/_app/immutable/chunks/{buWG8Dmo.js → DZnk0U6X.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/{BUSlXG5Y.js → DbczE2vm.js} +1 -1
  33. package/dist/web/_app/immutable/chunks/{DJKRyj_1.js → SzjCv9g2.js} +1 -1
  34. package/dist/web/_app/immutable/chunks/VEgGCdut.js +2 -0
  35. package/dist/web/_app/immutable/chunks/wnPynj2h.js +1 -0
  36. package/dist/web/_app/immutable/entry/app.CYqJAlgF.js +2 -0
  37. package/dist/web/_app/immutable/entry/start.B54V0Wim.js +1 -0
  38. package/dist/web/_app/immutable/nodes/0.Co4P2A7g.js +10 -0
  39. package/dist/web/_app/immutable/nodes/1.Bc1MepEl.js +1 -0
  40. package/dist/web/_app/immutable/nodes/2.Dr5HuxKS.js +1 -0
  41. package/dist/web/_app/immutable/nodes/3.BsRqdsFZ.js +11 -0
  42. package/dist/web/_app/immutable/nodes/{4.0CDHy-v0.js → 4.DMp14d8b.js} +2 -2
  43. package/dist/web/_app/immutable/nodes/5.DG8tGegE.js +2 -0
  44. package/dist/web/_app/immutable/nodes/6.C_Uuh3Y1.js +1 -0
  45. package/dist/web/_app/immutable/nodes/7.D6ZnjxHd.js +2 -0
  46. package/dist/web/_app/immutable/nodes/8.CXi6tI0R.js +1 -0
  47. package/dist/web/_app/version.json +1 -1
  48. package/dist/web/index.html +11 -11
  49. package/package.json +1 -1
  50. package/dist/web/_app/immutable/assets/0.CupILLQs.css +0 -1
  51. package/dist/web/_app/immutable/assets/2.DRHi7ABa.css +0 -1
  52. package/dist/web/_app/immutable/assets/AppShell.D3hRAjzT.css +0 -1
  53. package/dist/web/_app/immutable/assets/ChatPanel.CP-_8txt.css +0 -1
  54. package/dist/web/_app/immutable/chunks/0x0awhVy.js +0 -2
  55. package/dist/web/_app/immutable/chunks/8FUQuwgM.js +0 -1
  56. package/dist/web/_app/immutable/chunks/BeqErRmy.js +0 -1
  57. package/dist/web/_app/immutable/chunks/Bl1mtM70.js +0 -1
  58. package/dist/web/_app/immutable/chunks/BnR489ON.js +0 -1
  59. package/dist/web/_app/immutable/chunks/C7R6dA2m.js +0 -1
  60. package/dist/web/_app/immutable/chunks/CSTvkpxy.js +0 -64
  61. package/dist/web/_app/immutable/chunks/CbJfRYJV.js +0 -1
  62. package/dist/web/_app/immutable/chunks/Co733CqR.js +0 -1
  63. package/dist/web/_app/immutable/chunks/DPUtMAph.js +0 -28
  64. package/dist/web/_app/immutable/chunks/DxxhVGi2.js +0 -1
  65. package/dist/web/_app/immutable/chunks/EDLlAC9C.js +0 -2
  66. package/dist/web/_app/immutable/entry/app.C2utD9VR.js +0 -2
  67. package/dist/web/_app/immutable/entry/start.CxneN6NR.js +0 -1
  68. package/dist/web/_app/immutable/nodes/0.DuPJX0GV.js +0 -10
  69. package/dist/web/_app/immutable/nodes/1.Dt07KQlA.js +0 -1
  70. package/dist/web/_app/immutable/nodes/2.Bnr_OdSr.js +0 -1
  71. package/dist/web/_app/immutable/nodes/3.BykUKLNZ.js +0 -11
  72. package/dist/web/_app/immutable/nodes/5.BKd9g3uI.js +0 -2
  73. package/dist/web/_app/immutable/nodes/6.DMZp6xfS.js +0 -1
  74. package/dist/web/_app/immutable/nodes/7.B9Bv_Jv7.js +0 -2
  75. package/dist/web/_app/immutable/nodes/8.CbGhzI30.js +0 -1
@@ -1 +1 @@
1
- import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./Co733CqR.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
1
+ import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./CkwRiDze.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
@@ -1 +1 @@
1
- import{extensions as i,AccessibilitySystem as t,Container as e,accessibilityTarget as n,EventSystem as s,FederatedContainer as a}from"./BaUG0bh_.js";import"./BpUdqMox.js";i.add(t);i.mixin(e,n);i.add(s);i.mixin(e,a);
1
+ import{extensions as i,AccessibilitySystem as t,Container as e,accessibilityTarget as n,EventSystem as s,FederatedContainer as a}from"./BXo5rIdU.js";import"./1YZNbPuF.js";i.add(t);i.mixin(e,n);i.add(s);i.mixin(e,a);
@@ -1 +1 @@
1
- import{k as E,l as y,G as g,I as k,J as w,K as P,n as S,s as _,L as R,o as T}from"./8FUQuwgM.js";import{B as b}from"./CbJfRYJV.js";function C(f,c,a){var l;y&&(l=T,g());var i=new b(f);E(()=>{var n=c()??null;if(y){var r=w(l),t=r===R,h=n!==null;if(t!==h){var m=P();S(m),i.anchor=m,_(!1),i.ensure(n,n&&(e=>a(e,n))),_(!0);return}}i.ensure(n,n&&(e=>a(e,n)))},k)}const A="modulepreload",N=function(f,c){return new URL(f,c).href},p={},B=function(c,a,l){let i=Promise.resolve();if(a&&a.length>0){let m=function(e){return Promise.all(e.map(o=>Promise.resolve(o).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const r=document.getElementsByTagName("link"),t=document.querySelector("meta[property=csp-nonce]"),h=t?.nonce||t?.getAttribute("nonce");i=m(a.map(e=>{if(e=N(e,l),e in p)return;p[e]=!0;const o=e.endsWith(".css"),u=o?'[rel="stylesheet"]':"";if(l)for(let d=r.length-1;d>=0;d--){const v=r[d];if(v.href===e&&(!o||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${u}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":A,o||(s.as="script"),s.crossOrigin="",s.href=e,h&&s.setAttribute("nonce",h),document.head.appendChild(s),o)return new Promise((d,v)=>{s.addEventListener("load",d),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${e}`)))})}))}function n(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return i.then(r=>{for(const t of r||[])t.status==="rejected"&&n(t.reason);return c().catch(n)})};export{B as _,C as c};
1
+ import{f as E,h as y,z as g,A as k,B as w,D as P,k as S,j as _,F as A,o as R}from"./Cd2AAfar.js";import{B as T}from"./BBKhbmnU.js";function C(f,c,a){var l;y&&(l=R,g());var i=new T(f);E(()=>{var n=c()??null;if(y){var r=w(l),t=r===A,h=n!==null;if(t!==h){var m=P();S(m),i.anchor=m,_(!1),i.ensure(n,n&&(e=>a(e,n))),_(!0);return}}i.ensure(n,n&&(e=>a(e,n)))},k)}const b="modulepreload",N=function(f,c){return new URL(f,c).href},p={},L=function(c,a,l){let i=Promise.resolve();if(a&&a.length>0){let m=function(e){return Promise.all(e.map(o=>Promise.resolve(o).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const r=document.getElementsByTagName("link"),t=document.querySelector("meta[property=csp-nonce]"),h=t?.nonce||t?.getAttribute("nonce");i=m(a.map(e=>{if(e=N(e,l),e in p)return;p[e]=!0;const o=e.endsWith(".css"),u=o?'[rel="stylesheet"]':"";if(l)for(let d=r.length-1;d>=0;d--){const v=r[d];if(v.href===e&&(!o||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${u}`))return;const s=document.createElement("link");if(s.rel=o?"stylesheet":b,o||(s.as="script"),s.crossOrigin="",s.href=e,h&&s.setAttribute("nonce",h),document.head.appendChild(s),o)return new Promise((d,v)=>{s.addEventListener("load",d),s.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${e}`)))})}))}function n(r){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=r,window.dispatchEvent(t),!t.defaultPrevented)throw r}return i.then(r=>{for(const t of r||[])t.status==="rejected"&&n(t.reason);return c().catch(n)})};export{L as _,C as c};
@@ -0,0 +1,2 @@
1
+ import{f as $t,A as Lt,b7 as ct,X as x,Z as ft,P as dt,h as U,as as kt,b8 as Pt,b9 as Mt,aW as Rt,ba as Ut,bb as Nt,bc as jt,g as s,bd as Ft,be as Jt,bf as H,j as rt,bg as Gt,bh as Wt,a4 as Bt,bi as Dt,bj as Ht,y as A,a9 as J,s as l,V as Vt}from"./Cd2AAfar.js";import{B as Kt}from"./BBKhbmnU.js";import{i as qt,d as zt,g as Qt,j as Yt,n as Xt,k as Zt}from"./DJumtN6X.js";function Ne(t,e,...r){var n=new Kt(t);$t(()=>{const a=e()??null;n.ensure(a,a&&(f=>a(f,...r)))},Lt)}function xt(t,e){var r=void 0,n;ct(()=>{r!==(r=e())&&(n&&(x(n),n=null),r&&(n=ft(()=>{dt(()=>r(t))})))})}function pt(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=pt(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function te(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=pt(t))&&(n&&(n+=" "),n+=e);return n}function ee(t){return typeof t=="object"?te(t):t??""}const nt=[...`
2
+ \r\f \v\uFEFF`];function re(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var a of Object.keys(r))if(r[a])n=n?n+" "+a:a;else if(n.length)for(var f=a.length,d=0;(d=n.indexOf(a,d))>=0;){var S=d+f;(d===0||nt.includes(n[d-1]))&&(S===n.length||nt.includes(n[S]))?n=(d===0?"":n.substring(0,d))+n.substring(S+1):d=S}}return n===""?null:n}function ot(t,e=!1){var r=e?" !important;":";",n="";for(var a of Object.keys(t)){var f=t[a];f!=null&&f!==""&&(n+=" "+a+": "+f+r)}return n}function X(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ne(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var f=!1,d=0,S=!1,E=[];n&&E.push(...Object.keys(n).map(X)),a&&E.push(...Object.keys(a).map(X));var g=0,T=-1;const O=t.length;for(var C=0;C<O;C++){var p=t[C];if(S?p==="/"&&t[C-1]==="*"&&(S=!1):f?f===p&&(f=!1):p==="/"&&t[C+1]==="*"?S=!0:p==='"'||p==="'"?f=p:p==="("?d++:p===")"&&d--,!S&&f===!1&&d===0){if(p===":"&&T===-1)T=C;else if(p===";"||C===O-1){if(T!==-1){var k=X(t.substring(g,T).trim());if(!E.includes(k)){p!==";"&&C++;var L=t.substring(g,C).trim();r+=" "+L+";"}}g=C+1,T=-1}}}}return n&&(r+=ot(n)),a&&(r+=ot(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function oe(t,e,r,n,a,f){var d=t.__className;if(U||d!==r||d===void 0){var S=re(r,n,f);(!U||S!==t.getAttribute("class"))&&(S==null?t.removeAttribute("class"):e?t.className=S:t.setAttribute("class",S)),t.__className=r}else if(f&&a!==f)for(var E in f){var g=!!f[E];(a==null||g!==!!a[E])&&t.classList.toggle(E,g)}return f}function Z(t,e={},r,n){for(var a in r){var f=r[a];e[a]!==f&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,f,n))}}function ae(t,e,r,n){var a=t.__style;if(U||a!==e){var f=ne(e,n);(!U||f!==t.getAttribute("style"))&&(f==null?t.removeAttribute("style"):t.style.cssText=f),t.__style=e}else n&&(Array.isArray(n)?(Z(t,r?.[0],n[0]),Z(t,r?.[1],n[1],"important")):Z(t,r,n));return n}function tt(t,e,r=!1){if(t.multiple){if(e==null)return;if(!kt(e))return Pt();for(var n of t.options)n.selected=e.includes(at(n));return}for(n of t.options){var a=at(n);if(Mt(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function se(t){var e=new MutationObserver(()=>{tt(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Rt(()=>{e.disconnect()})}function at(t){return"__value"in t?t.__value:t.value}const B=Symbol("class"),D=Symbol("style"),gt=Symbol("is custom element"),ht=Symbol("is html"),ie=H?"link":"LINK",ue=H?"input":"INPUT",le=H?"option":"OPTION",ce=H?"select":"SELECT",fe=H?"progress":"PROGRESS";function de(t){if(U){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;Q(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var a=t.checked;Q(t,"checked",null),t.checked=a}}};t.__on_r=r,Bt(r),Dt()}}function je(t,e){var r=et(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==fe)||(t.value=e??"")}function pe(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Q(t,e,r,n){var a=et(t);U&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===ie)||a[e]!==(a[e]=r)&&(e==="loading"&&(t[Ht]=r),r==null?t.removeAttribute(e):typeof r!="string"&&yt(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function ge(t,e,r,n,a=!1,f=!1){if(U&&a&&t.nodeName===ue){var d=t,S=d.type==="checkbox"?"defaultChecked":"defaultValue";S in r||de(d)}var E=et(t),g=E[gt],T=!E[ht];let C=U&&g;C&&rt(!1);var p=e||{},k=t.nodeName===le;for(var L in e)L in r||(r[L]=null);r.class?r.class=ee(r.class):(n||r[B])&&(r.class=null),r[D]&&(r.style??=null);var O=yt(t);for(const y in r){let b=r[y];if(k&&y==="value"&&b==null){t.value=t.__value="",p[y]=b;continue}if(y==="class"){var P=t.namespaceURI==="http://www.w3.org/1999/xhtml";oe(t,P,b,n,e?.[B],r[B]),p[y]=b,p[B]=r[B];continue}if(y==="style"){ae(t,b,e?.[D],r[D]),p[y]=b,p[D]=r[D];continue}var m=p[y];if(!(b===m&&!(b===void 0&&t.hasAttribute(y)))){p[y]=b;var M=y[0]+y[1];if(M!=="$$")if(M==="on"){const w={},R="$$"+y;let I=y.slice(2);var W=Zt(I);if(qt(I)&&(I=I.slice(0,-7),w.capture=!0),!W&&m){if(b!=null)continue;t.removeEventListener(I,p[R],w),p[R]=null}if(W)zt(I,t,b),Qt([I]);else if(b!=null){let F=function(Y){p[y].call(this,Y)};p[R]=Yt(I,t,F,w)}}else if(y==="style")Q(t,y,b);else if(y==="autofocus")Gt(t,!!b);else if(!g&&(y==="__value"||y==="value"&&b!=null))t.value=t.__value=b;else if(y==="selected"&&k)pe(t,b);else{var _=y;T||(_=Xt(_));var V=_==="defaultValue"||_==="defaultChecked";if(b==null&&!g&&!V)if(E[y]=null,_==="value"||_==="checked"){let w=t;const R=e===void 0;if(_==="value"){let I=w.defaultValue;w.removeAttribute(_),w.defaultValue=I,w.value=w.__value=R?I:null}else{let I=w.defaultChecked;w.removeAttribute(_),w.defaultChecked=I,w.checked=R?I:!1}}else t.removeAttribute(y);else V||O.includes(_)&&(g||typeof b!="string")?(t[_]=b,_ in E&&(E[_]=Wt)):typeof b!="function"&&Q(t,_,b)}}}return C&&rt(!0),p}function Fe(t,e,r=[],n=[],a=[],f,d=!1,S=!1){Ut(a,r,n,E=>{var g=void 0,T={},C=t.nodeName===ce,p=!1;if(ct(()=>{var L=e(...E.map(s)),O=ge(t,g,L,f,d,S);p&&C&&"value"in L&&tt(t,L.value);for(let m of Object.getOwnPropertySymbols(T))L[m]||x(T[m]);for(let m of Object.getOwnPropertySymbols(L)){var P=L[m];m.description===Ft&&(!g||P!==g[m])&&(T[m]&&x(T[m]),T[m]=ft(()=>xt(t,()=>P))),O[m]=P}g=O}),C){var k=t;dt(()=>{tt(k,g.value,!0),se(k)})}p=!0})}function et(t){return t.__attributes??={[gt]:t.nodeName.includes("-"),[ht]:t.namespaceURI===Nt}}var st=new Map;function yt(t){var e=t.getAttribute("is")||t.nodeName,r=st.get(e);if(r)return r;st.set(e,r=[]);for(var n,a=t,f=Element.prototype;f!==a;){n=Jt(a);for(var d in n)n[d].set&&r.push(d);a=jt(a)}return r}const he="";class bt extends Error{constructor(e,r){super(r),this.status=e,this.name="ApiError"}}async function v(t,e){const r={...e?.headers};e?.body&&(r["Content-Type"]=r["Content-Type"]??"application/json");const n=await fetch(`${he}${t}`,{...e,headers:r});if(!n.ok){const a=await n.json().catch(()=>({error:n.statusText}));throw n.status===401&&typeof window<"u"&&!t.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new bt(n.status,a.error??n.statusText)}return n.json()}const Je=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bt,apiFetch:v},Symbol.toStringTag,{value:"Module"}));function ye(){return v("/api/workspace")}function be(t){return v("/api/workspace",{method:"PUT",body:JSON.stringify(t)})}function Ge(){return v("/api/workspace/mcp-config")}function it(){return v("/api/repos")}function ve(t,e,r){return v("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,description:e,...r?{private:!0}:{}})})}function Se(t,e){return v(`/api/repos/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})}function Ce(t){return v(`/api/repos/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ee(){return v("/api/apps")}function me(t){return v(`/api/repos/${encodeURIComponent(t)}/entities?summary=true`)}function We(t,e,r){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`)}function Be(t,e,r,n,a){return v(`/api/repos/${encodeURIComponent(t)}/entities`,{method:"POST",body:JSON.stringify({entityType:e,entityId:r,data:n,content:a})})}function De(t,e,r){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`,{method:"DELETE"})}function He(t,e,r,n){return v(`/api/repos/${encodeURIComponent(t)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify(n)})}function Ve(t){return v(`/api/repos/${encodeURIComponent(t)}/commit`,{method:"POST"})}function we(t){return t.replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}const Ae="#e05050";function ut(t){if(typeof document>"u")return;const e=t||Ae,r=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16),f=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const d of f)d.style.setProperty("--color-accent",e),d.style.setProperty("--color-accent-hover",Te(e,15)),d.style.setProperty("--color-accent-muted",`rgba(${r}, ${n}, ${a}, 0.08)`),d.style.setProperty("--color-link",lt(e,15)),d.style.setProperty("--color-badge-bg",`rgba(${r}, ${n}, ${a}, 0.1)`),d.style.setProperty("--color-badge-text",lt(e,20))}function Te(t,e){const r=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e/100))),n=Math.max(0,Math.round(parseInt(t.slice(3,5),16)*(1-e/100))),a=Math.max(0,Math.round(parseInt(t.slice(5,7),16)*(1-e/100)));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`}function lt(t,e){const r=Math.min(255,Math.round(parseInt(t.slice(1,3),16)+(255-parseInt(t.slice(1,3),16))*e/100)),n=Math.min(255,Math.round(parseInt(t.slice(3,5),16)+(255-parseInt(t.slice(3,5),16))*e/100)),a=Math.min(255,Math.round(parseInt(t.slice(5,7),16)+(255-parseInt(t.slice(5,7),16))*e/100));return`#${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}`}function _e(){let t=A(""),e=A(null),r=A(null),n=A(!1),a=A(J([]));const f={};let d=A(J([])),S=A(!1),E=A(null),g=A(J({})),T=J({}),C=J({}),p=J({}),k=A(0),L=A(null),O=A(""),P=null,m=A(0),M=A(0),W=A("alpha");async function _(){l(S,!0),l(E,null),l(m,0),l(M,0);try{const[o,i,u]=await Promise.all([it(),Ee().catch(()=>[]),ye().catch(()=>({name:""}))]);l(d,i,!0),l(t,u.name,!0),l(e,u.about??null,!0),l(r,u.accent_color??null,!0),l(n,!0),ut(s(r)),l(a,o.map(c=>({name:c.name,type:c.type,private:c.private,sync:c.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(s(a).map(c=>w(c.name)))}catch(o){l(E,o.message,!0)}finally{l(S,!1)}}function V(o,i,u){const c=s(a).find(h=>h.name===o);c&&(c.entities=c.entities.filter(h=>!(h.id===u&&h.entityType===i)),c.count=c.entities.length)}async function y(o){s(a).find(u=>u.name===o)&&await w(o,!0)}async function b(){l(m,0),l(M,0),await Promise.all(s(a).map(o=>w(o.name,!0)))}async function w(o,i=!1){const u=s(a).find(h=>h.name===o);if(!u||u.loading||!i&&u.loaded)return;const c=(f[o]??0)+1;f[o]=c,i||(u.loading=!0);try{const h=await me(o);if(f[o]!==c)return;let N=0,K=0;for(const $ of h)N+=$.document?.wikilinks?.length??0,K+=$.subContentCount??0;l(m,s(m)+N),l(M,s(M)+K),u.entities=h.filter($=>!$.id.toLowerCase().startsWith("readme")).map($=>({id:$.id,title:$.data?.name??we($.id),entityType:$.entityType,repo:o,hasSubContent:!!$.hasSubContent,wikilinks:$.document?.wikilinks??[],createdAt:$.data?.created_at??null,updatedAt:$.data?.updated_at??null})).sort(($,Ot)=>$.title.localeCompare(Ot.title)),u.count=u.entities.length,u.loaded=!0}catch(h){console.error(`Failed to load entities for ${o}:`,h)}finally{u.loading=!1}}function R(o){s(g)[o]=!s(g)[o]}function I(o){return s(g)[o]??!1}function F(o,i,u){return`${o}/${i}/${u}`}function Y(o,i,u){const c=F(o,i,u),h=T[c]??!1;T[c]=!h,!h&&!C[c]?.loaded&&Ct(o,i,u)}function vt(o,i,u){return T[F(o,i,u)]??!1}function St(o,i,u){return C[F(o,i,u)]??{entries:[],loading:!1,loaded:!1}}async function Ct(o,i,u){const c=F(o,i,u);C[c]={entries:[],loading:!1,loaded:!0}}function Et(o){const i=s(O).trim().toLowerCase();if(!i)return o;const u=[];for(const c of o){const h=c.entities.filter(N=>N.title.toLowerCase().includes(i)||N.id.toLowerCase().includes(i));h.length>0&&u.push({...c,entities:h,count:h.length})}return u}function mt(o){if(o&&!s(O)?P={...s(g)}:!o&&s(O)&&P&&(l(g,P,!0),P=null),l(O,o,!0),o){const i=o.trim().toLowerCase();for(const u of s(a)){const c=u.entities.some(h=>h.title.toLowerCase().includes(i)||h.id.toLowerCase().includes(i));s(g)[u.name]=c}}}function wt(o){const i=o.startsWith("type:");p[o]=!(p[o]??i)}function At(o){return p[o]??!1}function Tt(o){return p[o]===!1}const _t=Vt(()=>s(a).reduce((o,i)=>o+(i.count??0),0));function It(o){return s(d).find(i=>i.entityTypes.includes(o))}return{get name(){return s(t)},get about(){return s(e)},get accentColor(){return s(r)},get nameLoaded(){return s(n)},async updateWorkspace(o){o.accent_color!==void 0&&(l(r,o.accent_color,!0),ut(o.accent_color)),await be(o),o.name?.trim()&&l(t,o.name.trim(),!0),typeof o.about=="string"&&l(e,o.about,!0)},get repos(){return s(a)},get apps(){return s(d)},get loading(){return s(S)},get error(){return s(E)},get totalEntities(){return s(_t)},get totalLinks(){return s(m)},get totalFiles(){return s(M)},get sortedRepos(){const o=[...s(a)].sort((i,u)=>i.name.localeCompare(u.name));return Et(o)},get filteredIds(){const o=s(O).trim().toLowerCase();if(!o)return null;const i=new Set;for(const u of s(a))for(const c of u.entities)(c.title.toLowerCase().includes(o)||c.id.toLowerCase().includes(o))&&i.add(c.id);return i},get filterQuery(){return s(O)},setFilterQuery:mt,get sortMode(){return s(W)},set sortMode(o){l(W,o,!0)},get recentEntities(){const o=s(O).trim().toLowerCase();let i=[];for(const u of s(a))for(const c of u.entities)o&&!c.title.toLowerCase().includes(o)&&!c.id.toLowerCase().includes(o)||i.push(c);return i.sort((u,c)=>{const h=u.updatedAt??"";return(c.updatedAt??"").localeCompare(h)})},get sidebarScrollTop(){return s(k)},set sidebarScrollTop(o){l(k,o,!0)},get lastAutoExpandedFor(){return s(L)},set lastAutoExpandedFor(o){l(L,o,!0)},load:_,loadEntities:w,removeEntity:V,refreshEntities:y,refreshAll:b,toggleRepo:R,isExpanded:I,toggleEntity:Y,isEntityExpanded:vt,getEntityContents:St,toggleFolder:wt,isFolderExpanded:At,isFolderCollapsed:Tt,getAppForEntityType:It,async renameCollectionTo(o,i){await Se(o,i);const u=s(a).find(c=>c.name===o);u&&(u.name=i,s(g)[o]&&(s(g)[i]=!0,delete s(g)[o]))},async removeCollection(o){await Ce(o),l(a,s(a).filter(i=>i.name!==o),!0),delete s(g)[o]},async addCollection(o,i,u){await ve(o,i,u);const c=await it();l(a,c.map(h=>s(a).find(K=>K.name===h.name)??{name:h.name,type:h.type,private:h.private,count:null,entities:[],loading:!1,loaded:!1}),!0),s(g)[o]=!0,await w(o)}}}const Ke=_e();function Ie(){return v("/api/auth/status")}function Oe(){return v("/api/auth/me")}function $e(t,e){return v("/api/auth/login",{method:"POST",body:JSON.stringify({email:t,password:e})})}function Le(){return v("/api/auth/logout",{method:"POST"})}function ke(t,e,r){return v("/api/auth/setup",{method:"POST",body:JSON.stringify({email:t,password:e,displayName:r})})}function qe(){return v("/api/auth/users")}function ze(t,e,r,n){return v("/api/auth/users",{method:"POST",body:JSON.stringify({email:t,password:e,displayName:r,role:n})})}function Qe(t){return v(`/api/auth/users/${t}`,{method:"DELETE"})}function Ye(t,e){return v(`/api/auth/users/${t}/password`,{method:"PATCH",body:JSON.stringify({password:e})})}let G=A(null),q=A(!1),z=A(!1),j=A(!0);const Pe={get user(){return s(G)},get authEnabled(){return s(q)},get needsSetup(){return s(z)},get loading(){return s(j)},async checkAuth(){l(j,!0);try{const t=await Ie();if(l(q,t.authEnabled,!0),l(z,t.userCount===0),s(z))return l(j,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!t.authEnabled)return l(j,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:e}=await Oe();return l(G,e,!0),l(j,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return l(G,null),l(j,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return l(j,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(t,e){const{user:r}=await $e(t,e);return l(G,r,!0),l(q,!0),r},async setup(t,e,r){const{user:n}=await ke(t,e,r);return l(G,n,!0),l(q,!0),l(z,!1),n},async logout(){await Le(),l(G,null)}},Xe=Object.freeze(Object.defineProperty({__proto__:null,auth:Pe},Symbol.toStringTag,{value:"Module"}));export{D as S,Fe as a,Ne as b,Pe as c,oe as d,Ve as e,We as f,te as g,je as h,ae as i,ee as j,v as k,qe as l,Ge as m,Qe as n,Ye as o,ze as p,De as q,de as r,Q as s,Be as t,He as u,Je as v,Ke as w,Xe as x};
@@ -0,0 +1 @@
1
+ import{a as p,s as k,f as h}from"./DJumtN6X.js";import{i as C}from"./BWbpPmKt.js";import{p as M,l as c,s as m,d as n,g as i,a as A,c as _,n as B,r as u,b as N,m as v,t as P}from"./Cd2AAfar.js";import{l as g,p as b,i as R}from"./BBKhbmnU.js";import{a as Y}from"./VEgGCdut.js";var j=h("<title> </title>"),q=h('<svg><!><path d="M13 24 4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"></path></svg>');function I(x,t){const e=g(t,["children","$$slots","$$events","$$legacy"]),w=g(e,["size","title"]);M(t,!1);const a=v(),d=v();let f=b(t,"size",8,16),s=b(t,"title",8,void 0);c(()=>(n(e),n(s())),()=>{m(a,e["aria-label"]||e["aria-labelledby"]||s())}),c(()=>(i(a),n(e)),()=>{m(d,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),A(),C();var r=q();Y(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...w}));var y=_(r);{var z=l=>{var o=j(),$=_(o,!0);u(o),P(()=>k($,s())),p(l,o)};R(y,l=>{s()&&l(z)})}B(),u(r),p(x,r),N()}export{I as C};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Co4P2A7g.js","../chunks/SzjCv9g2.js","../chunks/Cd2AAfar.js","../chunks/BBKhbmnU.js","../chunks/DJumtN6X.js","../chunks/VEgGCdut.js","../chunks/DP5Y1V5j.js","../chunks/CGoS23Dn.js","../chunks/CkwRiDze.js","../chunks/BWbpPmKt.js","../chunks/DDuM5_bq.js","../assets/0.D8EoqqcB.css","../nodes/1.Bc1MepEl.js","../nodes/2.Dr5HuxKS.js","../chunks/DZ7uBozP.js","../chunks/BAoPZe8v.js","../assets/AppShell.DVyh4lcT.css","../chunks/C5Jg9_3k.js","../assets/ViewToolbar.39HnhXNY.css","../assets/2.DRZ4qWy8.css","../nodes/3.BsRqdsFZ.js","../chunks/wnPynj2h.js","../chunks/CqkleIqs.js","../assets/3.Bxy1xbfc.css","../nodes/4.DMp14d8b.js","../assets/4.aFSdMTV2.css","../nodes/5.DG8tGegE.js","../assets/5.CquhUpOu.css","../nodes/6.C_Uuh3Y1.js","../assets/6.CT4xL4K3.css","../nodes/7.D6ZnjxHd.js","../assets/7.BMfme7ZM.css","../nodes/8.CXi6tI0R.js","../assets/8.BUrHkYry.css"])))=>i.map(i=>d[i]);
2
+ import{c as b,_ as u}from"../chunks/SzjCv9g2.js";import{s as y,Q as U,g as m,R as Y,S as q,m as z,p as B,I as F,K as H,T as J,U as N,u as E,v as W,b as X,y as p,c as Z,r as $,V as P,t as tt}from"../chunks/Cd2AAfar.js";import{h as et,m as rt,u as st,a as h,c as O,b as V,t as at,s as ot}from"../chunks/DJumtN6X.js";import{p as R,i as x,b as A}from"../chunks/BBKhbmnU.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=z(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===U?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Y(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ut=V("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);F(()=>t.stores.page.set(t.page)),H(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);J(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(y(r,!0),N().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const j=P(()=>t.constructors[1]);var I=ut(),L=E(I);{var w=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var T=O(),M=E(T);b(M,()=>m(j),(G,K)=>{A(K(G,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),Q=>s()[1]=Q,()=>s()?.[1])}),h(g,T)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(L,o=>{t.constructors[1]?o(w):o(k,!1)})}var C=W(L,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,I),X()}const Et=nt(mt),yt=[()=>u(()=>import("../nodes/0.Co4P2A7g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),()=>u(()=>import("../nodes/1.Bc1MepEl.js"),__vite__mapDeps([12,4,2,9,7]),import.meta.url),()=>u(()=>import("../nodes/2.Dr5HuxKS.js"),__vite__mapDeps([13,4,2,9,3,14,5,1,8,7,15,16,17,18,19]),import.meta.url),()=>u(()=>import("../nodes/3.BsRqdsFZ.js"),__vite__mapDeps([20,5,2,3,4,1,8,7,14,9,15,16,17,18,21,22,10,23]),import.meta.url),()=>u(()=>import("../nodes/4.DMp14d8b.js"),__vite__mapDeps([24,5,2,3,4,14,1,8,7,9,15,16,25]),import.meta.url),()=>u(()=>import("../nodes/5.DG8tGegE.js"),__vite__mapDeps([26,4,2,14,3,5,1,8,7,9,15,16,17,18,27]),import.meta.url),()=>u(()=>import("../nodes/6.C_Uuh3Y1.js"),__vite__mapDeps([28,4,2,3,6,7,5,15,29]),import.meta.url),()=>u(()=>import("../nodes/7.D6ZnjxHd.js"),__vite__mapDeps([30,4,2,9,14,3,5,1,8,7,15,16,21,31]),import.meta.url),()=>u(()=>import("../nodes/8.CXi6tI0R.js"),__vite__mapDeps([32,4,2,3,6,7,5,15,33]),import.meta.url)],bt=[],pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},D={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(D.transport).map(([a,t])=>[a,t.decode])),Pt=Object.fromEntries(Object.entries(D.transport).map(([a,t])=>[a,t.encode])),Ot=!1,Rt=(a,t)=>_t[a](t);export{Rt as decode,_t as decoders,pt as dictionary,Pt as encoders,Ot as hash,D as hooks,gt as matchers,yt as nodes,Et as root,bt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/CGoS23Dn.js";export{o as load_css,r as start};
@@ -0,0 +1,10 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BXo5rIdU.js","../chunks/SzjCv9g2.js","../chunks/Cd2AAfar.js","../chunks/BBKhbmnU.js","../chunks/CqkleIqs.js","../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js"])))=>i.map(i=>d[i]);
2
+ import{c as Nt,_ as Ut}from"../chunks/SzjCv9g2.js";import{a as s,b as it,l as $t,o as yt,d as Yt,e as fn,c as B,g as hn,t as We,s as kt,f as at}from"../chunks/DJumtN6X.js";import{p as Mt,c as W,r as R,t as Y,b as At,bn as mn,w as Ze,bo as Le,y as k,a9 as Vt,K as lt,s as r,g as e,L as Qt,T as He,v as pt,V as g,aD as _t,u as A,I as tn,bp as Re,l as zt,a as fe,n as he,m as Dt,d as ct,x as gn,$ as vn}from"../chunks/Cd2AAfar.js";import{j as wt,d as bt,s as C,i as Pe,b as st,a as te,S as wn,c as se,w as je}from"../chunks/VEgGCdut.js";import{h as bn}from"../chunks/DP5Y1V5j.js";import{g as Ce}from"../chunks/CGoS23Dn.js";import{e as Oe,t as G,c as vt,S as _n,n as yn,r as Ue}from"../chunks/CkwRiDze.js";import{p as S,i as z,b as en,s as de,r as nn,l as Lt}from"../chunks/BBKhbmnU.js";import{i as me}from"../chunks/BWbpPmKt.js";import{I as xn}from"../chunks/DDuM5_bq.js";const In=Array(12).fill(0);var Tn=it('<div class="sonner-loading-bar"></div>'),En=it('<div><div class="sonner-spinner"></div></div>');function Sn(o,t){Mt(t,!0);var n=En(),i=W(n);Oe(i,23,()=>In,(a,l)=>`spinner-bar-${l}`,(a,l)=>{var u=Tn();s(a,u)}),R(i),R(n),Y(a=>{bt(n,1,a),C(n,"data-visible",t.visible)},[()=>wt(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(o,n),At()}const Mn=typeof window<"u"?window:void 0;function An(o){let t=o.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Bn{#e;#t;constructor(t,n){this.#e=t,this.#t=$t(n)}get current(){return this.#t(),this.#e()}}const Pn=/\(.+\)/,Cn=new Set(["all","print","screen","and","or","not","only"]);class kn extends Bn{constructor(t,n){let i=Pn.test(t)||t.split(/[\s,]+/).some(l=>Cn.has(l.trim()))?t:`(${t})`;const a=window.matchMedia(i);super(()=>a.matches,l=>yt(a,"change",l))}}let zn=class{#e;#t;constructor(t={}){const{window:n=Mn,document:i=n?.document}=t;n!==void 0&&(this.#e=i,this.#t=$t(a=>{const l=yt(n,"focusin",a),u=yt(n,"focusout",a);return()=>{l(),u()}}))}get current(){return this.#t?.(),this.#e?An(this.#e):null}};new zn;class Dn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return mn(this.#t)}get(){const t=Ze(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const n=Ze(this.#t);return n===void 0?t:n}set(t){return Le(this.#t,t)}}const Ln=new Dn("<Toaster/>");function le(o){return o.label!==void 0}function On(){let o=k(Vt(typeof document<"u"?document.hidden:!1));return lt(()=>yt(document,"visibilitychange",()=>{r(o,document.hidden,!0)})),{get current(){return e(o)}}}const Ye=4e3,Hn=14,Rn=45,Fn=200,Nn=.05,pn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Vn(o){const[t,n]=o.split("-"),i=[];return t&&i.push(t),n&&i.push(n),i}function qe(o){return 1/(1.5+Math.abs(o)/20)}var Wn=it("<div><!></div>"),Zn=it('<button data-close-button=""><!></button>'),jn=it('<div data-icon=""><!> <!></div>'),Un=it('<div data-description=""><!></div>'),Yn=it('<button data-button="" data-cancel=""> </button>'),qn=it('<button data-button=""> </button>'),Kn=it('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Xn=it('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Gn(o,t){Mt(t,!0);const n=m=>{var w=B(),T=A(w);{var L=M=>{var K=Wn(),Ft=W(K);st(Ft,()=>t.loadingIcon),R(K),Y(Xt=>{bt(K,1,Xt),C(K,"data-visible",e(F)==="loading")},[()=>wt(vt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(M,K)},O=M=>{{let K=g(()=>vt(e(ot)?.loader,t.toast.classes?.loader)),Ft=g(()=>e(F)==="loading");Sn(M,{get class(){return e(K)},get visible(){return e(Ft)}})}};z(T,M=>{t.loadingIcon?M(L):M(O,!1)})}s(m,w)};let i=S(t,"cancelButtonStyle",3,""),a=S(t,"actionButtonStyle",3,""),l=S(t,"descriptionClass",3,""),u=S(t,"unstyled",3,!1),v=S(t,"defaultRichColors",3,!1);const d={...pn};let _=k(!1),P=k(!1),D=k(!1),I=k(!1),q=k(!1),U=k(0),rt=k(0),Bt=t.toast.duration||t.duration||Ye,et=k(void 0),Q=k(null),qt=k(null);const ve=g(()=>t.index===0),we=g(()=>t.index+1<=t.visibleToasts),F=g(()=>t.toast.type),nt=g(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=g(()=>t.toast.class||""),Ot=g(()=>t.toast.descriptionClass||""),xt=g(()=>G.heights.findIndex(m=>m.toastId===t.toast.id)||0),It=g(()=>t.toast.closeButton??t.closeButton),Ht=g(()=>t.toast.duration??t.duration??Ye);let Pt=null;const ee=g(()=>t.position.split("-")),be=g(()=>G.heights.reduce((m,w,T)=>T>=e(xt)?m:m+w.height,0)),_e=On(),ye=g(()=>t.toast.invert||t.invert),Kt=g(()=>e(F)==="loading"),ot=g(()=>({...d,...t.classes})),xe=g(()=>t.toast.title),Ie=g(()=>t.toast.description);let Tt=k(0),ne=k(0);const Zt=g(()=>Math.round(e(xt)*Hn+e(be)));lt(()=>{e(xe),e(Ie);let m;t.expanded||t.expandByDefault?m=1:m=1-t.index*Nn;const w=Qt(()=>e(et));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,L=w.getBoundingClientRect().height,O=Math.round(L/m+Number.EPSILON&100)/100;w.style.removeProperty("height");let M;Math.abs(O-T)<1?M=O:M=T,r(rt,M,!0),G.setHeight({toastId:t.toast.id,height:M})});function c(){r(P,!0),r(U,e(Zt),!0),G.removeHeight(t.toast.id),setTimeout(()=>{G.remove(t.toast.id)},Fn)}let p;const ht=g(()=>t.toast.promise&&e(F)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function mt(){r(Tt,new Date().getTime(),!0),p=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),c()},Bt)}function Rt(){if(e(ne)<e(Tt)){const m=new Date().getTime()-e(Tt);Bt=Bt-m}r(ne,new Date().getTime(),!0)}lt(()=>{t.toast.updated&&(clearTimeout(p),Bt=e(Ht),mt())}),lt(()=>(e(ht)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&_e.current?Rt():mt()),()=>clearTimeout(p))),He(()=>{r(_,!0);const m=e(et)?.getBoundingClientRect().height;return r(rt,m,!0),G.setHeight({toastId:t.toast.id,height:m}),()=>{G.removeHeight(t.toast.id)}}),lt(()=>{t.toast.delete&&Qt(()=>{c(),t.toast.onDismiss?.(t.toast)})});const Te=m=>{if(e(Kt))return;r(U,e(Zt),!0);const w=m.target;w.setPointerCapture(m.pointerId),w.tagName!=="BUTTON"&&(r(D,!0),Pt={x:m.clientX,y:m.clientY})},pe=()=>{if(e(I)||!e(nt))return;Pt=null;const m=Number(e(et)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(et)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,L=e(Q)==="x"?m:w,O=Math.abs(L)/T;if(Math.abs(L)>=Rn||O>.11){r(U,e(Zt),!0),t.toast.onDismiss?.(t.toast),e(Q)==="x"?r(qt,m>0?"right":"left",!0):r(qt,w>0?"down":"up",!0),c(),r(I,!0);return}else e(et)?.style.setProperty("--swipe-amount-x","0px"),e(et)?.style.setProperty("--swipe-amount-y","0px");r(q,!1),r(D,!1),r(Q,null)},oe=m=>{if(!Pt||!e(nt)||(window.getSelection()?.toString().length??-1)>0)return;const T=m.clientY-Pt.y,L=m.clientX-Pt.x,O=t.swipeDirections??Vn(t.position);!e(Q)&&(Math.abs(L)>1||Math.abs(T)>1)&&r(Q,Math.abs(L)>Math.abs(T)?"x":"y",!0);let M={x:0,y:0};if(e(Q)==="y"){if(O.includes("top")||O.includes("bottom"))if(O.includes("top")&&T<0||O.includes("bottom")&&T>0)M.y=T;else{const K=T*qe(T);M.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(Q)==="x"&&(O.includes("left")||O.includes("right")))if(O.includes("left")&&L<0||O.includes("right")&&L>0)M.x=L;else{const K=L*qe(L);M.x=Math.abs(K)<Math.abs(L)?K:L}(Math.abs(M.x)>0||Math.abs(M.y)>0)&&r(q,!0),e(et)?.style.setProperty("--swipe-amount-x",`${M.x}px`),e(et)?.style.setProperty("--swipe-amount-y",`${M.y}px`)},gt=()=>{r(D,!1),r(Q,null),Pt=null},Et=g(()=>t.toast.icon?t.toast.icon:e(F)==="success"?t.successIcon:e(F)==="error"?t.errorIcon:e(F)==="warning"?t.warningIcon:e(F)==="info"?t.infoIcon:e(F)==="loading"?t.loadingIcon:null);var h=Xn();C(h,"tabindex",0);let jt;var ie=W(h);{var Ve=m=>{var w=Zn(),T=W(w);st(T,()=>t.closeIcon??_t),R(w),Y(L=>{C(w,"aria-label",t.closeButtonAriaLabel),C(w,"data-disabled",e(Kt)),bt(w,1,L)},[()=>wt(vt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),Yt("click",w,()=>{e(Kt)||!e(nt)||(c(),t.toast.onDismiss?.(t.toast))}),s(m,w)};z(ie,m=>{e(It)&&!t.toast.component&&e(F)!=="loading"&&t.closeIcon!==null&&m(Ve)})}var Ee=pt(ie,2);{var Se=m=>{const w=g(()=>t.toast.component);var T=B(),L=A(T);Nt(L,()=>e(w),(O,M)=>{M(O,de(()=>t.toast.componentProps,{closeToast:c}))}),s(m,T)},Me=m=>{var w=Kn(),T=A(w);{var L=y=>{var E=jn(),f=W(E);{var H=b=>{var x=B(),tt=A(x);{var V=Ct=>{var re=B(),Be=A(re);Nt(Be,()=>t.toast.icon,(X,$)=>{$(X,{})}),s(Ct,re)},ft=Ct=>{n(Ct)};z(tt,Ct=>{t.toast.icon?Ct(V):Ct(ft,!1)})}s(b,x)};z(f,b=>{(t.toast.promise||e(F)==="loading")&&b(H)})}var j=pt(f,2);{var N=b=>{var x=B(),tt=A(x);{var V=X=>{var $=B(),St=A($);Nt(St,()=>t.toast.icon,(un,dn)=>{dn(un,{})}),s(X,$)},ft=X=>{var $=B(),St=A($);st(St,()=>t.successIcon??_t),s(X,$)},Ct=X=>{var $=B(),St=A($);st(St,()=>t.errorIcon??_t),s(X,$)},re=X=>{var $=B(),St=A($);st(St,()=>t.warningIcon??_t),s(X,$)},Be=X=>{var $=B(),St=A($);st(St,()=>t.infoIcon??_t),s(X,$)};z(tt,X=>{t.toast.icon?X(V):e(F)==="success"?X(ft,1):e(F)==="error"?X(Ct,2):e(F)==="warning"?X(re,3):e(F)==="info"&&X(Be,4)})}s(b,x)};z(j,b=>{t.toast.type!=="loading"&&b(N)})}R(E),Y(b=>bt(E,1,b),[()=>wt(vt(e(ot)?.icon,t.toast?.classes?.icon))]),s(y,E)};z(T,y=>{(e(F)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&y(L)})}var O=pt(T,2),M=W(O),K=W(M);{var Ft=y=>{var E=B(),f=A(E);{var H=N=>{const b=g(()=>t.toast.title);var x=B(),tt=A(x);Nt(tt,()=>e(b),(V,ft)=>{ft(V,de(()=>t.toast.componentProps))}),s(N,x)},j=N=>{var b=We();Y(()=>kt(b,t.toast.title)),s(N,b)};z(f,N=>{typeof t.toast.title!="string"?N(H):N(j,!1)})}s(y,E)};z(K,y=>{t.toast.title&&y(Ft)})}R(M);var Xt=pt(M,2);{var Ae=y=>{var E=Un(),f=W(E);{var H=N=>{const b=g(()=>t.toast.description);var x=B(),tt=A(x);Nt(tt,()=>e(b),(V,ft)=>{ft(V,de(()=>t.toast.componentProps))}),s(N,x)},j=N=>{var b=We();Y(()=>kt(b,t.toast.description)),s(N,b)};z(f,N=>{typeof t.toast.description!="string"?N(H):N(j,!1)})}R(E),Y(N=>bt(E,1,N),[()=>wt(vt(l(),e(Ot),e(ot)?.description,t.toast.classes?.description))]),s(y,E)};z(Xt,y=>{t.toast.description&&y(Ae)})}R(O);var ae=pt(O,2);{var ut=y=>{var E=B(),f=A(E);{var H=b=>{var x=B(),tt=A(x);Nt(tt,()=>t.toast.cancel,(V,ft)=>{ft(V,{})}),s(b,x)},j=b=>{var x=Yn(),tt=W(x,!0);R(x),Y(V=>{Pe(x,t.toast.cancelButtonStyle??i()),bt(x,1,V),kt(tt,t.toast.cancel.label)},[()=>wt(vt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),Yt("click",x,V=>{le(t.toast.cancel)&&e(nt)&&(t.toast.cancel?.onClick?.(V),c())}),s(b,x)},N=g(()=>le(t.toast.cancel));z(f,b=>{typeof t.toast.cancel=="function"?b(H):e(N)&&b(j,1)})}s(y,E)};z(ae,y=>{t.toast.cancel&&y(ut)})}var J=pt(ae,2);{var dt=y=>{var E=B(),f=A(E);{var H=b=>{var x=B(),tt=A(x);Nt(tt,()=>t.toast.action,(V,ft)=>{ft(V,{})}),s(b,x)},j=b=>{var x=qn(),tt=W(x,!0);R(x),Y(V=>{Pe(x,t.toast.actionButtonStyle??a()),bt(x,1,V),kt(tt,t.toast.action.label)},[()=>wt(vt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),Yt("click",x,V=>{le(t.toast.action)&&(t.toast.action?.onClick(V),!V.defaultPrevented&&c())}),s(b,x)},N=g(()=>le(t.toast.action));z(f,b=>{typeof t.toast.action=="function"?b(H):e(N)&&b(j,1)})}s(y,E)};z(J,y=>{t.toast.action&&y(dt)})}Y((y,E)=>{bt(O,1,y),bt(M,1,E)},[()=>wt(vt(e(ot)?.content,t.toast?.classes?.content)),()=>wt(vt(e(ot)?.title,t.toast?.classes?.title))]),s(m,w)};z(Ee,m=>{t.toast.component?m(Se):m(Me,!1)})}R(h),en(h,m=>r(et,m),()=>e(et)),Y((m,w,T)=>{bt(h,1,m),C(h,"aria-live",t.toast.important?"assertive":"polite"),C(h,"data-rich-colors",t.toast.richColors??v()),C(h,"data-styled",!(t.toast.component||t.toast.unstyled||u())),C(h,"data-mounted",e(_)),C(h,"data-promise",w),C(h,"data-swiped",e(q)),C(h,"data-removed",e(P)),C(h,"data-visible",e(we)),C(h,"data-y-position",e(ee)[0]),C(h,"data-x-position",e(ee)[1]),C(h,"data-index",t.index),C(h,"data-front",e(ve)),C(h,"data-swiping",e(D)),C(h,"data-dismissible",e(nt)),C(h,"data-type",e(F)),C(h,"data-invert",e(ye)),C(h,"data-swipe-out",e(I)),C(h,"data-swipe-direction",e(qt)),C(h,"data-expanded",T),jt=Pe(h,`${t.style} ${t.toast.style}`,jt,{"--index":t.index,"--toasts-before":t.index,"--z-index":G.toasts.length-t.index,"--offset":`${e(P)?e(U):e(Zt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(rt)}px`})},[()=>wt(vt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(F)],t.toast?.classes?.[e(F)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(_))]),Yt("pointermove",h,oe),Yt("pointerup",h,pe),Yt("pointerdown",h,Te),fn("dragend",h,gt),s(o,h),At()}hn(["pointermove","pointerup","pointerdown","click"]);var Qn=at('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Jn(o){var t=Qn();s(o,t)}var $n=at('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function to(o){var t=$n();s(o,t)}var eo=at('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function no(o){var t=eo();s(o,t)}var oo=at('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function io(o){var t=oo();s(o,t)}var ao=at('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function ro(o){var t=ao();s(o,t)}const so=3,on="24px",an="16px",lo=4e3,co=356,uo=14,ke="dark",ce="light";function fo(o,t){const n={};return[o,t].forEach((i,a)=>{const l=a===1,u=l?"--mobile-offset":"--offset",v=l?an:on;function d(_){["top","right","bottom","left"].forEach(P=>{n[`${u}-${P}`]=typeof _=="number"?`${_}px`:_})}typeof i=="number"||typeof i=="string"?d(i):typeof i=="object"?["top","right","bottom","left"].forEach(_=>{const P=i[_];P===void 0?n[`${u}-${_}`]=v:n[`${u}-${_}`]=typeof P=="number"?`${P}px`:P}):d(v)}),n}var ho=it("<ol></ol>"),mo=it('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function go(o,t){Mt(t,!0);function n(c){return c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ke:ce}let i=S(t,"invert",3,!1),a=S(t,"position",3,"bottom-right"),l=S(t,"hotkey",19,()=>["altKey","KeyT"]),u=S(t,"expand",3,!1),v=S(t,"closeButton",3,!1),d=S(t,"offset",3,on),_=S(t,"mobileOffset",3,an),P=S(t,"theme",3,"light"),D=S(t,"richColors",3,!1),I=S(t,"duration",3,lo),q=S(t,"visibleToasts",3,so),U=S(t,"toastOptions",19,()=>({})),rt=S(t,"dir",7,"auto"),Bt=S(t,"gap",3,uo),et=S(t,"pauseWhenPageIsHidden",3,!1),Q=S(t,"containerAriaLabel",3,"Notifications"),qt=S(t,"closeButtonAriaLabel",3,"Close toast"),ve=nn(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function we(){if(rt()!=="auto")return rt();if(typeof window>"u"||typeof document>"u")return"ltr";const c=document.documentElement.getAttribute("dir");return c==="auto"||!c?(Qt(()=>rt(window.getComputedStyle(document.documentElement).direction??"ltr")),rt()):(Qt(()=>rt(c)),c)}const F=g(()=>Array.from(new Set([a(),...G.toasts.filter(c=>c.position).map(c=>c.position)].filter(Boolean))));let nt=k(!1),Wt=k(!1),Ot=k(Vt(n(P()))),xt=k(void 0),It=k(null),Ht=k(!1);const Pt=g(()=>l().join("+").replace(/Key/g,"").replace(/Digit/g,""));lt(()=>{G.toasts.length<=1&&r(nt,!1)}),lt(()=>{const c=G.toasts.filter(p=>p.dismiss&&!p.delete);if(c.length>0){const p=G.toasts.map(ht=>c.find(Rt=>Rt.id===ht.id)?{...ht,delete:!0}:ht);G.toasts=p}}),lt(()=>()=>{e(xt)&&e(It)&&(e(It).focus({preventScroll:!0}),r(It,null),r(Ht,!1))}),He(()=>(G.reset(),yt(document,"keydown",p=>{l().every(mt=>p[mt]||p.code===mt)&&(r(nt,!0),e(xt)?.focus()),p.code==="Escape"&&(document.activeElement===e(xt)||e(xt)?.contains(document.activeElement))&&r(nt,!1)}))),lt(()=>{if(P()!=="system"&&r(Ot,P()),typeof window<"u"){P()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(Ot,ke):r(Ot,ce));const c=window.matchMedia("(prefers-color-scheme: dark)"),p=({matches:ht})=>{P()==="system"&&r(Ot,ht?ke:ce,!0)};"addEventListener"in c?c.addEventListener("change",p):c.addListener(p)}});const ee=c=>{t.onblur?.(c),e(Ht)&&!c.currentTarget.contains(c.relatedTarget)&&(r(Ht,!1),e(It)&&(e(It).focus({preventScroll:!0}),r(It,null)))},be=c=>{t.onfocus?.(c),!(c.target instanceof HTMLElement&&c.target.dataset.dismissible==="false")&&(e(Ht)||(r(Ht,!0),r(It,c.relatedTarget,!0)))},_e=c=>{t.onpointerdown?.(c),!(c.target instanceof HTMLElement&&c.target.dataset.dismissible==="false")&&r(Wt,!0)},ye=c=>{t.onmouseenter?.(c),r(nt,!0)},Kt=c=>{t.onmouseleave?.(c),e(Wt)||r(nt,!1)},ot=c=>{t.onmousemove?.(c),r(nt,!0)},xe=c=>{t.ondragend?.(c),r(nt,!1)},Ie=c=>{t.onpointerup?.(c),r(Wt,!1)};Ln.set(new _n);var Tt=mo();C(Tt,"tabindex",-1);var ne=W(Tt);{var Zt=c=>{var p=B(),ht=A(p);Oe(ht,18,()=>e(F),mt=>mt,(mt,Rt,Te,pe)=>{const oe=g(()=>{const[h,jt]=Rt.split("-");return{y:h,x:jt}}),gt=g(()=>fo(d(),_()));var Et=ho();te(Et,h=>({tabindex:-1,dir:h,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Ot),"data-y-position":e(oe).y,"data-x-position":e(oe).x,style:t.style,onblur:ee,onfocus:be,onmouseenter:ye,onmousemove:ot,onmouseleave:Kt,ondragend:xe,onpointerdown:_e,onpointerup:Ie,...ve,[wn]:{"--front-toast-height":`${G.heights[0]?.height}px`,"--width":`${co}px`,"--gap":`${Bt()}px`,"--offset-top":e(gt)["--offset-top"],"--offset-right":e(gt)["--offset-right"],"--offset-bottom":e(gt)["--offset-bottom"],"--offset-left":e(gt)["--offset-left"],"--mobile-offset-top":e(gt)["--mobile-offset-top"],"--mobile-offset-right":e(gt)["--mobile-offset-right"],"--mobile-offset-bottom":e(gt)["--mobile-offset-bottom"],"--mobile-offset-left":e(gt)["--mobile-offset-left"]}}),[we],void 0,void 0,"svelte-nbs0zk"),Oe(Et,23,()=>G.toasts.filter(h=>!h.position&&e(Te)===0||h.position===Rt),h=>h.id,(h,jt,ie,Ve)=>{{const Ee=ut=>{var J=B(),dt=A(J);{var y=f=>{var H=B(),j=A(H);st(j,()=>t.successIcon??_t),s(f,H)},E=f=>{Jn(f)};z(dt,f=>{t.successIcon?f(y):t.successIcon!==null&&f(E,1)})}s(ut,J)},Se=ut=>{var J=B(),dt=A(J);{var y=f=>{var H=B(),j=A(H);st(j,()=>t.errorIcon??_t),s(f,H)},E=f=>{to(f)};z(dt,f=>{t.errorIcon?f(y):t.errorIcon!==null&&f(E,1)})}s(ut,J)},Me=ut=>{var J=B(),dt=A(J);{var y=f=>{var H=B(),j=A(H);st(j,()=>t.warningIcon??_t),s(f,H)},E=f=>{no(f)};z(dt,f=>{t.warningIcon?f(y):t.warningIcon!==null&&f(E,1)})}s(ut,J)},m=ut=>{var J=B(),dt=A(J);{var y=f=>{var H=B(),j=A(H);st(j,()=>t.infoIcon??_t),s(f,H)},E=f=>{io(f)};z(dt,f=>{t.infoIcon?f(y):t.infoIcon!==null&&f(E,1)})}s(ut,J)},w=ut=>{var J=B(),dt=A(J);{var y=f=>{var H=B(),j=A(H);st(j,()=>t.closeIcon??_t),s(f,H)},E=f=>{ro(f)};z(dt,f=>{t.closeIcon?f(y):t.closeIcon!==null&&f(E,1)})}s(ut,J)};let T=g(()=>U()?.duration??I()),L=g(()=>U()?.class??""),O=g(()=>U()?.descriptionClass||""),M=g(()=>U()?.style??""),K=g(()=>U().classes||{}),Ft=g(()=>U().unstyled??!1),Xt=g(()=>U()?.cancelButtonStyle??""),Ae=g(()=>U()?.actionButtonStyle??""),ae=g(()=>U()?.closeButtonAriaLabel??qt());Gn(h,{get index(){return e(ie)},get toast(){return e(jt)},get defaultRichColors(){return D()},get duration(){return e(T)},get class(){return e(L)},get descriptionClass(){return e(O)},get invert(){return i()},get visibleToasts(){return q()},get closeButton(){return v()},get interacting(){return e(Wt)},get position(){return Rt},get style(){return e(M)},get classes(){return e(K)},get unstyled(){return e(Ft)},get cancelButtonStyle(){return e(Xt)},get actionButtonStyle(){return e(Ae)},get closeButtonAriaLabel(){return e(ae)},get expandByDefault(){return u()},get expanded(){return e(nt)},get pauseWhenPageIsHidden(){return et()},get loadingIcon(){return t.loadingIcon},successIcon:Ee,errorIcon:Se,warningIcon:Me,infoIcon:m,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),R(Et),en(Et,h=>r(xt,h),()=>e(xt)),Y(()=>Et.dir=Et.dir),s(mt,Et)}),s(c,p)};z(ne,c=>{G.toasts.length>0&&c(Zt)})}R(Tt),Y(()=>C(Tt,"aria-label",`${Q()??""} ${e(Pt)??""}`)),s(o,Tt),At()}const rn=typeof window<"u"?window:void 0;function vo(o){let t=o.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}let wo=class{#e;#t;constructor(t={}){const{window:n=rn,document:i=n?.document}=t;n!==void 0&&(this.#e=i,this.#t=$t(a=>{const l=yt(n,"focusin",a),u=yt(n,"focusout",a);return()=>{l(),u()}}))}get current(){return this.#t?.(),this.#e?vo(this.#e):null}};new wo;function bo(o,t){switch(o){case"post":lt(t);break;case"pre":tn(t);break}}function sn(o,t,n,i={}){const{lazy:a=!1}=i;let l=!a,u=Array.isArray(o)?[]:void 0;bo(t,()=>{const v=Array.isArray(o)?o.map(_=>_()):o();if(!l){l=!0,u=v;return}const d=Qt(()=>n(v,u));return u=v,d})}function Fe(o,t,n){sn(o,"post",t,n)}function _o(o,t,n){sn(o,"pre",t,n)}Fe.pre=_o;function yo(o,t){switch(o){case"local":return t.localStorage;case"session":return t.sessionStorage}}class ln{#e;#t;#o;#n;#a;#i=k(0);constructor(t,n,i={}){const{storage:a="local",serializer:l={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:u=!0,window:v=rn}=i;if(this.#e=n,this.#t=t,this.#o=l,v===void 0)return;const d=yo(a,v);this.#n=d;const _=d.getItem(t);_!==null?this.#e=this.#r(_):this.#s(n),u&&a==="local"&&(this.#a=$t(()=>yt(v,"storage",this.#l)))}get current(){this.#a?.(),e(this.#i);const t=this.#r(this.#n?.getItem(this.#t))??this.#e,n=new WeakMap,i=a=>{if(a===null||a?.constructor.name==="Date"||typeof a!="object")return a;let l=n.get(a);return l||(l=new Proxy(a,{get:(u,v)=>(e(this.#i),i(Reflect.get(u,v))),set:(u,v,d)=>(r(this.#i,e(this.#i)+1),Reflect.set(u,v,d),this.#s(t),!0)}),n.set(a,l)),l};return i(t)}set current(t){this.#s(t),r(this.#i,e(this.#i)+1)}#l=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#r(t.newValue),r(this.#i,e(this.#i)+1))};#r(t){try{return this.#o.deserialize(t)}catch(n){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,n);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(n){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,n)}}}function Ke(o){return o.filter(t=>t.length>0)}const cn={getItem:o=>null,setItem:(o,t)=>{}},ge=typeof document<"u";function xo(o){return typeof o=="function"}function Io(o){return o!==null&&typeof o=="object"}const Jt=Symbol("box"),Ne=Symbol("is-writable");function To(o){return Io(o)&&Jt in o}function Eo(o){return Z.isBox(o)&&Ne in o}function Z(o){let t=k(Vt(o));return{[Jt]:!0,[Ne]:!0,get current(){return e(t)},set current(n){r(t,n,!0)}}}function So(o,t){const n=g(o);return t?{[Jt]:!0,[Ne]:!0,get current(){return e(n)},set current(i){t(i)}}:{[Jt]:!0,get current(){return o()}}}function Mo(o){return Z.isBox(o)?o:xo(o)?Z.with(o):Z(o)}function Ao(o){return Object.entries(o).reduce((t,[n,i])=>Z.isBox(i)?(Z.isWritableBox(i)?Object.defineProperty(t,n,{get(){return i.current},set(a){i.current=a}}):Object.defineProperty(t,n,{get(){return i.current}}),t):Object.assign(t,{[n]:i}),{})}function Bo(o){return Z.isWritableBox(o)?{[Jt]:!0,get current(){return o.current}}:o}Z.from=Mo;Z.with=So;Z.flatten=Ao;Z.readonly=Bo;Z.isBox=To;Z.isWritableBox=Eo;function Po(o,t){const n=RegExp(o,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(n)?i.replace(n,t):i}}const Co=Po(/[A-Z]/,o=>`-${o.toLowerCase()}`);function ko(o){if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError(`expected an argument of type object, but got ${typeof o}`);return Object.keys(o).map(t=>`${Co(t)}: ${o[t]};`).join(`
3
+ `)}function zo(o={}){return ko(o).replace(`
4
+ `," ")}const Do={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};zo(Do);const Lo=typeof window<"u"?window:void 0;function Oo(o){let t=o.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Ho{#e;#t;constructor(t={}){const{window:n=Lo,document:i=n?.document}=t;n!==void 0&&(this.#e=i,this.#t=$t(a=>{const l=yt(n,"focusin",a),u=yt(n,"focusout",a);return()=>{l(),u()}}))}get current(){return this.#t?.(),this.#e?Oo(this.#e):null}}new Ho;const ze=Z("mode-watcher-mode"),De=Z("mode-watcher-theme"),Ro=["dark","light","system"];function Xe(o){return typeof o!="string"?!1:Ro.includes(o)}class Fo{#e="system";#t=ge?localStorage:cn;#o=this.#t.getItem(ze.current);#n=Xe(this.#o)?this.#o:this.#e;#a=k(Vt(this.#i()));#i(t=this.#n){return new ln(ze.current,t,{serializer:{serialize:n=>n,deserialize:n=>Xe(n)?n:this.#e}})}constructor(){Re(()=>Fe.pre(()=>ze.current,(t,n)=>{const i=e(this.#a).current;r(this.#a,this.#i(i),!0),n&&localStorage.removeItem(n)}))}get current(){return e(this.#a).current}set current(t){e(this.#a).current=t}}class No{#e=void 0;#t=!0;#o=k(Vt(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kn("prefers-color-scheme: light"):{current:!1};query(){ge&&r(this.#o,this.#n.current?"light":"dark",!0)}tracking(t){this.#t=t}constructor(){Re(()=>{tn(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return e(this.#o)}}const Ge=new Fo,po=new No;class Vo{#e=ge?localStorage:cn;#t=this.#e.getItem(De.current);#o=this.#t===null||this.#t===void 0?"":this.#t;#n=k(Vt(this.#a()));#a(t=this.#o){return new ln(De.current,t,{serializer:{serialize:n=>typeof n!="string"?"":n,deserialize:n=>n}})}constructor(){Re(()=>Fe.pre(()=>De.current,(t,n)=>{const i=e(this.#n).current;r(this.#n,this.#a(i),!0),n&&localStorage.removeItem(n)}))}get current(){return e(this.#n).current}set current(t){e(this.#n).current=t}}new Vo;let Qe,Je,$e=!1,Gt=null;function Wo(){return Gt||(Gt=document.createElement("style"),Gt.appendChild(document.createTextNode(`* {
5
+ -webkit-transition: none !important;
6
+ -moz-transition: none !important;
7
+ -o-transition: none !important;
8
+ -ms-transition: none !important;
9
+ transition: none !important;
10
+ }`)),Gt)}function Zo(o,t=!1){if(typeof document>"u")return;if(!$e){$e=!0,o();return}if(typeof window<"u"&&window.__vitest_worker__){o();return}clearTimeout(Qe),clearTimeout(Je);const i=Wo(),a=()=>document.head.appendChild(i),l=()=>{i.parentNode&&document.head.removeChild(i)};function u(){o(),window.requestAnimationFrame(l)}if(typeof window.requestAnimationFrame<"u"){a(),t?u():window.requestAnimationFrame(()=>{u()});return}a(),Qe=window.setTimeout(()=>{o(),Je=window.setTimeout(l,16)},16)}const ue=Z(void 0),jo=Z(!0),Uo=Z(!1),Yo=Z([]),qo=Z([]);function Ko(){const o=g(()=>{if(!ge)return;const t=Ge.current==="system"?po.current:Ge.current,n=Ke(Yo.current),i=Ke(qo.current);function a(){const l=document.documentElement,u=document.querySelector('meta[name="theme-color"]');t==="light"?(n.length&&l.classList.remove(...n),i.length&&l.classList.add(...i),l.style.colorScheme="light",u&&ue.current&&u.setAttribute("content",ue.current.light)):(i.length&&l.classList.remove(...i),n.length&&l.classList.add(...n),l.style.colorScheme="dark",u&&ue.current&&u.setAttribute("content",ue.current.dark))}return jo.current?Zo(a,Uo.current):a(),t});return{get current(){return e(o)}}}const Xo=Ko();var Go=at("<title> </title>"),Qo=at('<svg><!><path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2ZM14,21.5908l-5-5L10.5906,15,14,18.4092,21.41,11l1.5957,1.5859Z"></path><path fill="none" d="M14 21.591 9 16.591 10.591 15 14 18.409 21.41 11 23.005 12.585 14 21.591z" data-icon-path="inner-path"></path></svg>');function Jo(o,t){const n=Lt(t,["children","$$slots","$$events","$$legacy"]),i=Lt(n,["size","title"]);Mt(t,!1);const a=Dt(),l=Dt();let u=S(t,"size",8,16),v=S(t,"title",8,void 0);zt(()=>(ct(n),ct(v())),()=>{r(a,n["aria-label"]||n["aria-labelledby"]||v())}),zt(()=>(e(a),ct(n)),()=>{r(l,{"aria-hidden":e(a)?void 0:!0,role:e(a)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),fe(),me();var d=Qo();te(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:u(),height:u(),...e(l),...i}));var _=W(d);{var P=D=>{var I=Go(),q=W(I,!0);R(I),Y(()=>kt(q,v())),s(D,I)};z(_,D=>{v()&&D(P)})}he(2),R(d),s(o,d),At()}var $o=at("<title> </title>"),ti=at('<svg><!><path fill="none" d="M14.9 7.2H17.1V24.799H14.9z" data-icon-path="inner-path" transform="rotate(-45 16 16)"></path><path d="M16,2A13.914,13.914,0,0,0,2,16,13.914,13.914,0,0,0,16,30,13.914,13.914,0,0,0,30,16,13.914,13.914,0,0,0,16,2Zm5.4449,21L9,10.5557,10.5557,9,23,21.4448Z"></path></svg>');function ei(o,t){const n=Lt(t,["children","$$slots","$$events","$$legacy"]),i=Lt(n,["size","title"]);Mt(t,!1);const a=Dt(),l=Dt();let u=S(t,"size",8,16),v=S(t,"title",8,void 0);zt(()=>(ct(n),ct(v())),()=>{r(a,n["aria-label"]||n["aria-labelledby"]||v())}),zt(()=>(e(a),ct(n)),()=>{r(l,{"aria-hidden":e(a)?void 0:!0,role:e(a)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),fe(),me();var d=ti();te(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:u(),height:u(),...e(l),...i}));var _=W(d);{var P=D=>{var I=$o(),q=W(I,!0);R(I),Y(()=>kt(q,v())),s(D,I)};z(_,D=>{v()&&D(P)})}he(2),R(d),s(o,d),At()}var ni=at("<title> </title>"),oi=at('<svg><!><path fill="none" d="M16,8a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,16,8Zm4,13.875H17.125v-8H13v2.25h1.875v5.75H12v2.25h8Z" data-icon-path="inner-path"></path><path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,6a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,16,8Zm4,16.125H12v-2.25h2.875v-5.75H13v-2.25h4.125v8H20Z"></path></svg>');function ii(o,t){const n=Lt(t,["children","$$slots","$$events","$$legacy"]),i=Lt(n,["size","title"]);Mt(t,!1);const a=Dt(),l=Dt();let u=S(t,"size",8,16),v=S(t,"title",8,void 0);zt(()=>(ct(n),ct(v())),()=>{r(a,n["aria-label"]||n["aria-labelledby"]||v())}),zt(()=>(e(a),ct(n)),()=>{r(l,{"aria-hidden":e(a)?void 0:!0,role:e(a)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),fe(),me();var d=oi();te(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:u(),height:u(),...e(l),...i}));var _=W(d);{var P=D=>{var I=ni(),q=W(I,!0);R(I),Y(()=>kt(q,v())),s(D,I)};z(_,D=>{v()&&D(P)})}he(2),R(d),s(o,d),At()}var ai=at("<title> </title>"),ri=at('<svg><!><path fill="none" d="M16,26a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,16,26Zm-1.125-5h2.25V12h-2.25Z" data-icon-path="inner-path"></path><path d="M16.002,6.1714h-.004L4.6487,27.9966,4.6506,28H27.3494l.0019-.0034ZM14.875,12h2.25v9h-2.25ZM16,26a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,16,26Z"></path><path d="M29,30H3a1,1,0,0,1-.8872-1.4614l13-25a1,1,0,0,1,1.7744,0l13,25A1,1,0,0,1,29,30ZM4.6507,28H27.3493l.002-.0033L16.002,6.1714h-.004L4.6487,27.9967Z"></path></svg>');function si(o,t){const n=Lt(t,["children","$$slots","$$events","$$legacy"]),i=Lt(n,["size","title"]);Mt(t,!1);const a=Dt(),l=Dt();let u=S(t,"size",8,16),v=S(t,"title",8,void 0);zt(()=>(ct(n),ct(v())),()=>{r(a,n["aria-label"]||n["aria-labelledby"]||v())}),zt(()=>(e(a),ct(n)),()=>{r(l,{"aria-hidden":e(a)?void 0:!0,role:e(a)?"img":void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),fe(),me();var d=ri();te(d,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:u(),height:u(),...e(l),...i}));var _=W(d);{var P=D=>{var I=ai(),q=W(I,!0);R(I),Y(()=>kt(q,v())),s(D,I)};z(_,D=>{v()&&D(P)})}he(3),R(d),s(o,d),At()}function li(o,t){Mt(t,!0);let n=nn(t,["$$slots","$$events","$$legacy"]);go(o,de({get theme(){return Xo.current},class:"toaster group",style:"--normal-bg: var(--color-bg-elevated); --normal-text: var(--color-text-primary); --normal-border: var(--color-border-strong);"},()=>n,{loadingIcon:d=>{xn(d,{class:"size-4 animate-spin"})},successIcon:d=>{Jo(d,{class:"size-4"})},errorIcon:d=>{ei(d,{class:"size-4"})},infoIcon:d=>{ii(d,{class:"size-4"})},warningIcon:d=>{si(d,{class:"size-4"})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),At()}var ci=it('<div style="display: contents;"><!> <!></div>');function Ii(o,t){Mt(t,!0);const n=typeof localStorage<"u"?localStorage.getItem("theme"):null;let i=k(Vt(n==="light"?"light":"dark"));Le("theme",{get current(){return e(i)},toggle(){r(i,e(i)==="dark"?"light":"dark",!0),localStorage.setItem("theme",e(i))}});const l=typeof localStorage<"u"?localStorage.getItem("chatOpen"):null;let u=k(l==="true");Le("chat",{get open(){return e(u)},toggle(){r(u,!e(u)),localStorage.setItem("chatOpen",String(e(u)))},close(){r(u,!1),localStorage.setItem("chatOpen","false")}}),lt(()=>{document.documentElement.setAttribute("data-theme",e(i))});let d=k(null);lt(()=>{if(se.loading)return;const I=se.user?.email??(se.authEnabled?null:"__open__");I&&I!==e(d)&&(e(d)!==null&&yn.deselect(),r(d,I,!0),je.load(),Ue.connect()),!I&&e(d)&&(r(d,null),Ue.disconnect())}),He(async()=>{const I=window.location.pathname,q=I==="/login",U=I==="/setup",{authenticated:rt,authEnabled:Bt,needsSetup:et}=await se.checkAuth();if(et&&!U){Ce("/setup");return}if(Bt&&!rt&&!q){Ce("/login");return}if(rt&&(q||U)){Ce("/");return}q||U||(Ut(()=>import("../chunks/BXo5rIdU.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).catch(()=>{}),Promise.all([Ut(()=>import("../chunks/CX_61fY8.js"),[],import.meta.url),Ut(()=>import("../chunks/DnL9f0lc.js").then(Q=>Q.i),__vite__mapDeps([5,6]),import.meta.url),Ut(()=>import("../chunks/CscoF-YL.js"),__vite__mapDeps([7,6,5,8,9,10]),import.meta.url),Ut(()=>import("../chunks/D7ZqAKi9.js"),__vite__mapDeps([8,9,6,5]),import.meta.url),Ut(()=>import("../chunks/C7VoTosa.js").then(Q=>Q.i),[],import.meta.url)]).catch(()=>{}),window.addEventListener("sg-theme-change",Q=>{r(i,Q.detail,!0)}))});var _=ci();bn("12qhfyh",I=>{gn(()=>{vn.title=(je.name||"Studiograph")??""})});var P=W(_);st(P,()=>t.children);var D=pt(P,2);li(D,{}),R(_),Y(()=>C(_,"data-theme",e(i))),s(o,_),At()}export{Ii as component};
@@ -0,0 +1 @@
1
+ import{a as u,b as h,s as a}from"../chunks/DJumtN6X.js";import{i as g}from"../chunks/BWbpPmKt.js";import{p as v,u as l,t as d,b as _,c as e,r as o,v as x}from"../chunks/Cd2AAfar.js";import{s as b,p}from"../chunks/CGoS23Dn.js";const $={get error(){return p.error},get status(){return p.status}};b.updated.check;const m=$;var k=h("<h1> </h1> <p> </p>",1);function y(i,c){v(c,!1),g();var t=k(),r=l(t),n=e(r,!0);o(r);var s=x(r,2),f=e(s,!0);o(s),d(()=>{a(n,m.status),a(f,m.error?.message)}),u(i,t),_()}export{y as component};
@@ -0,0 +1 @@
1
+ import{a as s,s as _,b as l}from"../chunks/DJumtN6X.js";import{i as g}from"../chunks/BWbpPmKt.js";import{p as u,b,u as w,v as $,c as i,n as x,r as m,t as y}from"../chunks/Cd2AAfar.js";import{i as S}from"../chunks/BBKhbmnU.js";import{A as V}from"../chunks/DZ7uBozP.js";import{V as k}from"../chunks/C5Jg9_3k.js";import{w as p}from"../chunks/VEgGCdut.js";import{n as A}from"../chunks/CkwRiDze.js";var E=l('<h2 class="svelte-1uha8ag"> </h2>'),L=l('<!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div>',1);function F(n,f){u(f,!1),A.showEntity(),g(),V(n,{children:(v,P)=>{var e=L(),o=w(e);k(o,{activeView:"entity"});var r=$(o,2),c=i(r);{var d=a=>{var t=E(),h=i(t);m(t),y(()=>_(h,`Welcome to ${(p.name||"Studiograph")??""}`)),s(a,t)};S(c,a=>{p.nameLoaded&&a(d)})}x(2),m(r),s(v,e)},$$slots:{default:!0}}),b()}export{F as component};
@@ -0,0 +1,11 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/B340SUKR.js","../chunks/DZnk0U6X.js","../chunks/CLFba8FK.js","../chunks/CkwRiDze.js","../chunks/Cd2AAfar.js","../chunks/CGoS23Dn.js","../chunks/VEgGCdut.js","../chunks/BBKhbmnU.js","../chunks/DJumtN6X.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
2
+ import{f as oa,r as vt,d as it,w as xt,a as st,h as zt,i as et,s as la,c as It,j as ua}from"../chunks/VEgGCdut.js";import{c as Ue,_ as He}from"../chunks/SzjCv9g2.js";import{g as Lt,d as Ke,e as at,a as p,c as Xe,t as tt,s as ce,b as q,f as Ze}from"../chunks/DJumtN6X.js";import{P as da,L as Bt,p as Je,y as Pe,a9 as rt,K as nt,U as ca,c as b,v as Q,r as h,g as e,s as _,b as Qe,u as Ce,n as Te,t as ve,V as De,l as We,d as ze,a as ot,m as Be,bk as Yt,al as ft,w as fa,T as va,bl as Zt}from"../chunks/Cd2AAfar.js";import{p as Le,i as me,b as Ct,l as Ye}from"../chunks/BBKhbmnU.js";import{e as Ie,i as Ne,a as Ve,n as Tt,r as ha}from"../chunks/CkwRiDze.js";import{g as Ot,i as pa}from"../chunks/CGoS23Dn.js";import{T as _a,P as ga,a as ma,I as jt,S as ya,b as wa,R as ba,c as ka,d as Et,e as Vt,f as xa,p as Ut,A as Ea,g as Ca,h as Sa,i as Aa,j as Pa,k as Ra,l as Da,m as Ta,n as za,r as Oa}from"../chunks/DZ7uBozP.js";import{V as La}from"../chunks/C5Jg9_3k.js";import{b as Jt,B as je}from"../chunks/BAoPZe8v.js";import{i as lt}from"../chunks/BWbpPmKt.js";import{C as Ma}from"../chunks/wnPynj2h.js";import{g as Fa}from"../chunks/CqkleIqs.js";import{I as Kt}from"../chunks/DDuM5_bq.js";function Ia(G,t,o){da(()=>{var s=Bt(()=>t(G,o?.())||{});if(s?.destroy)return()=>s.destroy()})}const ja=async({params:G,fetch:t})=>{const{repo:o,type:s,id:d}=G,g=await oa(o,s,d);return{repo:o,type:s,id:d,entity:g}},Ln=Object.freeze(Object.defineProperty({__proto__:null,load:ja},Symbol.toStringTag,{value:"Module"}));var Va=q('<span class="chip svelte-84vb17"> <!></span>'),Ua=q('<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=q('<div class="dropdown svelte-84vb17"></div>'),Na=q('<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){Je(t,!0);let o=Le(t,"multi",3,!1),s=Pe(""),d=Pe(0),g;const C=De(()=>xt.repos.flatMap(k=>k.entities.map(x=>({id:x.id,title:x.title,entityType:x.entityType,repo:k.name})))),m=De(()=>()=>{const k=e(s).toLowerCase().trim();return k?e(C).filter(x=>x.title.toLowerCase().includes(k)||x.id.toLowerCase().includes(k)).slice(0,20):e(C).slice(0,20)}),E=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let c=Pe(rt(E));nt(()=>{ca().then(()=>g?.focus())});function O(k){o()?(e(c).includes(k)||_(c,[...e(c),k],!0),_(s,""),_(d,0),g?.focus()):t.onselect(k)}function S(k){_(c,e(c).filter(x=>x!==k),!0)}function A(){e(c).length===E.length&&e(c).every((x,a)=>x===E[a])?t.oncancel():t.onselect(e(c))}function N(k){const x=e(m)();k.key==="ArrowDown"?(k.preventDefault(),_(d,Math.min(e(d)+1,x.length-1),!0)):k.key==="ArrowUp"?(k.preventDefault(),_(d,Math.max(e(d)-1,0),!0)):k.key==="Enter"?(k.preventDefault(),x.length>0?O(x[e(d)].id):o()&&A()):k.key==="Escape"?o()&&e(c).length>0?A():t.oncancel():k.key==="Backspace"&&!e(s)&&o()&&e(c).length>0&&_(c,e(c).slice(0,-1),!0)}var oe=Na(),$=b(oe),fe=b($);{var Se=k=>{var x=Xe(),a=Ce(x);Ie(a,17,()=>e(c),Ne,(r,l)=>{var y=Va(),P=b(y),H=Q(P);je(H,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>S(e(l)),children:(_e,Ee)=>{Te();var w=tt("×");p(_e,w)},$$slots:{default:!0}}),h(y),ve(()=>ce(P,`${e(l)??""} `)),p(r,y)}),p(k,x)};me(fe,k=>{o()&&k(Se)})}var te=Q(fe,2);vt(te),Ct(te,k=>g=k,()=>g),h($);var de=Q($,2);{var ye=k=>{var x=Ka();Ie(x,21,()=>e(m)(),Ne,(a,r,l)=>{var y=Ua();let P;var H=b(y),_e=b(H,!0);h(H);var Ee=Q(H,2),w=b(Ee),f=b(w,!0);h(w);var v=Q(w,2),u=b(v,!0);h(v),h(Ee),h(y),ve(()=>{P=it(y,1,"dropdown-item svelte-84vb17",null,P,{highlighted:l===e(d)}),ce(_e,e(r).title),ce(f,e(r).entityType),ce(u,e(r).repo)}),Ke("mousedown",y,T=>{T.preventDefault(),O(e(r).id)}),at("mouseenter",y,()=>_(d,l,!0)),p(a,y)}),h(x),p(k,x)},pe=De(()=>e(m)().length>0);me(de,k=>{e(pe)&&k(ye)})}h(oe),Ke("keydown",te,N),at("blur",te,()=>{setTimeout(()=>{o()&&e(c).length>0?A():o()||t.oncancel()},150)}),Jt(te,()=>e(s),k=>_(s,k)),p(G,oe),Qe()}Lt(["keydown","mousedown"]);var Ha=Ze("<title> </title>"),Wa=Ze('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function mt(G,t){const o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=Wa();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=Ha(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(2),h(E),p(G,E),Qe()}var Ba=Ze("<title> </title>"),Ya=Ze('<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 o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=Ya();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=Ba(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(),h(E),p(G,E),Qe()}var Za=Ze("<title> </title>"),Ja=Ze('<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 o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=Ja();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=Za(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(2),h(E),p(G,E),Qe()}var Qa=Ze("<title> </title>"),Ga=Ze('<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 o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=Ga();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=Qa(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(2),h(E),p(G,E),Qe()}var Xa=Ze("<title> </title>"),$a=Ze('<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 o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=$a();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=Xa(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(2),h(E),p(G,E),Qe()}var er=Ze("<title> </title>"),tr=Ze('<svg><!><path d="M10 16 20 6 21.4 7.4 12.8 16 21.4 24.6 20 26z"></path></svg>');function ar(G,t){const o=Ye(t,["children","$$slots","$$events","$$legacy"]),s=Ye(o,["size","title"]);Je(t,!1);const d=Be(),g=Be();let C=Le(t,"size",8,16),m=Le(t,"title",8,void 0);We(()=>(ze(o),ze(m())),()=>{_(d,o["aria-label"]||o["aria-labelledby"]||m())}),We(()=>(e(d),ze(o)),()=>{_(g,{"aria-hidden":e(d)?void 0:!0,role:e(d)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),ot(),lt();var E=tr();st(E,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:C(),height:C(),...e(g),...s}));var c=b(E);{var O=S=>{var A=er(),N=b(A,!0);h(A),ve(()=>ce(N,m())),p(S,A)};me(c,S=>{m()&&S(O)})}Te(),h(E),p(G,E),Qe()}var rr=q('<span class="ip-menu-check svelte-x7sio8"><!></span>'),nr=q('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),ir=q('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),sr=q("<!> <!> <!>",1),or=q("<!> <!>",1),lr=q('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),ur=q('<span class="ip-status-dot svelte-x7sio8"></span> ',1),dr=q('<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>'),cr=q('<span class="ip-cal-wd svelte-x7sio8"> </span>'),fr=q('<div class="ip-cal-week svelte-x7sio8"></div>'),vr=q('<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>'),hr=q('<span class="ip-badge svelte-x7sio8"> </span>'),pr=q('<div class="ip-wikilink-group svelte-x7sio8"></div>'),_r=q('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),gr=q('<span class="ip-date-text svelte-x7sio8"> </span>'),mr=q('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),yr=q('<span class="ip-text-value svelte-x7sio8"> </span>'),wr=q('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),br=q('<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>'),kr=q("<!> <span>Add property</span>",1),xr=q('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function Er(G,t){Je(t,!0);let o=Le(t,"editable",3,!1);const s=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],d=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let g=Pe(null),C=Pe(!1),m=Pe(""),E=Pe(void 0);function c(n){switch(n.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function O(n){for(const i of xt.repos){const L=i.entities.find(j=>j.id===n);if(L){Ot(`/${i.name}/${L.entityType}/${L.id}`);return}}}function S(n){return typeof n.value=="string"?n.value:n.value[0]}function A(n){return/^https?:\/\//.test(n)}function N(n){try{return new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return n}}let oe=Pe(rt(new Date().getFullYear())),$=Pe(rt(new Date().getMonth()));const fe=["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 L=new Date(n,i,1).getDay(),j=new Date(n,i+1,0).getDate(),J=new Date(n,i,0).getDate(),D=[];let M=[];for(let ee=L-1;ee>=0;ee--){const z=J-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 de(n){const i=new Date;return n.day===i.getDate()&&n.month===i.getMonth()&&n.year===i.getFullYear()}function ye(n,i){const L=i.slice(0,10).split("-");return n.year===+L[0]&&n.month===+L[1]-1&&n.day===+L[2]}function pe(){e($)===0?(_($,11),ft(oe,-1)):ft($,-1)}function k(){e($)===11?(_($,0),ft(oe)):ft($)}function x(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){!o()||n.type==="badge"||(n.type==="date"&&x(S(n)),_(g,n.key,!0))}function l(n,i){t.onedit&&t.onedit(n,i),_(g,null)}function y(n,i){const L=`${i.year}-${String(i.month+1).padStart(2,"0")}-${String(i.day).padStart(2,"0")}`;t.onedit&&t.onedit(n,L),_(g,null)}function P(n,i){t.ontypechange&&t.ontypechange(n,i)}function H(n){_(g,null),t.onremove&&t.onremove(n)}function _e(){_(C,!0),_(m,""),requestAnimationFrame(()=>e(E)?.focus())}function Ee(){const n=e(m).trim();n&&t.onadd&&t.onadd(n,""),_(C,!1),_(m,"")}function w(){_(C,!1),_(m,"")}function f(n){n.key==="Enter"?(n.preventDefault(),Ee()):n.key==="Escape"&&w()}var v=xr();at("click",Yt,()=>{_(g,null)});var u=b(v);Ie(u,17,()=>t.properties,n=>n.key,(n,i)=>{const L=De(()=>e(g)===e(i).key);var j=wr();let J;var D=b(j),M=b(D);{var ee=F=>{var U=Xe(),B=Ce(U);Ue(B,()=>ba,(I,ue)=>{ue(I,{children:(ie,ge)=>{var we=or(),he=Ce(we);Ue(he,()=>_a,(re,Z)=>{Z(re,{class:"ip-icon-trigger",children:(se,xe)=>{var Ae=Xe(),qe=Ce(Ae);{var Me=Oe=>{yt(Oe,{size:14})},$e=Oe=>{wt(Oe,{size:14})},ut=Oe=>{bt(Oe,{size:14})},ht=Oe=>{mt(Oe,{size:14})};me(qe,Oe=>{e(i).type==="date"?Oe(Me):e(i).type==="status"?Oe($e,1):e(i).type==="wikilink"?Oe(ut,2):Oe(ht,!1)})}p(se,Ae)},$$slots:{default:!0}})});var Re=Q(he,2);Ue(Re,()=>ga,(re,Z)=>{Z(re,{children:(se,xe)=>{var Ae=Xe(),qe=Ce(Ae);Ue(qe,()=>ma,(Me,$e)=>{$e(Me,{class:"ip-menu-content",sideOffset:4,align:"start",children:(ut,ht)=>{var Oe=sr(),St=Ce(Oe);Ie(St,17,()=>s,Ne,(ct,Ge)=>{var pt=Xe(),Mt=Ce(pt);Ue(Mt,()=>jt,(_t,gt)=>{gt(_t,{class:"ip-menu-item",onSelect:()=>P(e(i).key,e(Ge).type),children:(At,yn)=>{var Ft=nr(),Pt=Ce(Ft),Xt=b(Pt);{var $t=Fe=>{mt(Fe,{size:13})},ea=Fe=>{yt(Fe,{size:13})},ta=Fe=>{wt(Fe,{size:13})},aa=Fe=>{bt(Fe,{size:13})};me(Xt,Fe=>{e(Ge).type==="text"?Fe($t):e(Ge).type==="date"?Fe(ea,1):e(Ge).type==="status"?Fe(ta,2):e(Ge).type==="wikilink"&&Fe(aa,3)})}h(Pt);var Rt=Q(Pt,2),ra=b(Rt,!0);h(Rt);var na=Q(Rt,2);{var ia=Fe=>{var Dt=rr(),sa=b(Dt);Ma(sa,{size:12}),h(Dt),p(Fe,Dt)};me(na,Fe=>{e(i).type===e(Ge).type&&Fe(ia)})}ve(()=>ce(ra,e(Ge).label)),p(At,Ft)},$$slots:{default:!0}})}),p(ct,pt)});var dt=Q(St,2);Ue(dt,()=>ya,(ct,Ge)=>{Ge(ct,{class:"ip-menu-sep"})});var Gt=Q(dt,2);Ue(Gt,()=>jt,(ct,Ge)=>{Ge(ct,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>H(e(i).key),children:(pt,Mt)=>{var _t=ir(),gt=Ce(_t),At=b(gt);wa(At,{size:13}),h(gt),Te(2),p(pt,_t)},$$slots:{default:!0}})}),p(ut,Oe)},$$slots:{default:!0}})}),p(se,Ae)},$$slots:{default:!0}})}),p(ie,we)},$$slots:{default:!0}})}),p(F,U)},z=F=>{var U=Xe(),B=Ce(U);{var I=he=>{yt(he,{size:14})},ue=he=>{wt(he,{size:14})},ie=he=>{bt(he,{size:14})},ge=he=>{Qt(he,{size:14})},we=he=>{mt(he,{size:14})};me(B,he=>{e(i).type==="date"?he(I):e(i).type==="status"?he(ue,1):e(i).type==="wikilink"?he(ie,2):e(i).type==="badge"?he(ge,3):he(we,!1)})}p(F,U)};me(M,F=>{o()&&e(i).type!=="badge"?F(ee):F(z,!1)})}h(D);var le=Q(D,2),W=b(le,!0);h(le);var Y=Q(le,2),ae=b(Y);{var X=F=>{var U=lr();vt(U),Ia(U,B=>a?.(B)),ve(B=>zt(U,B),[()=>S(e(i))]),at("blur",U,B=>{const I=B.currentTarget.value;I!==S(e(i))&&t.onedit?.(e(i).key,I),_(g,null)}),Ke("keydown",U,B=>{B.key==="Enter"?B.currentTarget.blur():B.key==="Escape"&&(B.currentTarget.value=S(e(i)),_(g,null))}),p(F,U)},ke=F=>{var U=dr(),B=b(U),I=b(B);let ue;var ie=Q(I,2),ge=b(ie,!0);h(ie),h(B);var we=Q(B,2);Ie(we,21,()=>d,Ne,(he,Re)=>{{let re=De(()=>S(e(i))===e(Re)?"selected":"");je(he,{variant:"ghost",get class(){return`ip-status-option ${e(re)??""}`},onclick:()=>l(e(i).key,e(Re)),children:(Z,se)=>{var xe=ur(),Ae=Ce(xe);let qe;var Me=Q(Ae);ve($e=>{qe=et(Ae,"",qe,$e),ce(Me,` ${e(Re)??""}`)},[()=>({background:c(e(Re))})]),p(Z,xe)},$$slots:{default:!0}})}}),h(we),h(U),ve((he,Re)=>{ue=et(I,"",ue,he),ce(ge,Re)},[()=>({background:c(S(e(i)))}),()=>S(e(i))]),Ke("click",U,he=>he.stopPropagation()),p(F,U)},K=F=>{var U=vr(),B=b(U),I=b(B,!0);h(B);var ue=Q(B,2),ie=b(ue),ge=b(ie);je(ge,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:pe,children:(se,xe)=>{ar(se,{size:14})},$$slots:{default:!0}});var we=Q(ge,2),he=b(we);h(we);var Re=Q(we,2);je(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:k,children:(se,xe)=>{ka(se,{size:14})},$$slots:{default:!0}}),h(ie);var re=Q(ie,2);Ie(re,21,()=>fe,Ne,(se,xe)=>{var Ae=cr(),qe=b(Ae,!0);h(Ae),ve(()=>ce(qe,e(xe))),p(se,Ae)}),h(re);var Z=Q(re,2);Ie(Z,17,()=>te(e(oe),e($)),Ne,(se,xe)=>{var Ae=fr();Ie(Ae,21,()=>e(xe),Ne,(qe,Me)=>{{let $e=De(()=>e(Me).outside?"outside":""),ut=De(()=>de(e(Me))?"today":""),ht=De(()=>ye(e(Me),S(e(i)))?"selected":"");je(qe,{variant:"ghost",get class(){return`ip-cal-day ${e($e)??""} ${e(ut)??""} ${e(ht)??""}`},onclick:()=>y(e(i).key,e(Me)),children:(Oe,St)=>{Te();var dt=tt();ve(()=>ce(dt,e(Me).day)),p(Oe,dt)},$$slots:{default:!0}})}}),h(Ae),p(se,Ae)}),h(ue),h(U),ve(se=>{ce(I,se),ce(he,`${Se[e($)]??""} ${e(oe)??""}`)},[()=>N(S(e(i)))]),Ke("click",U,se=>se.stopPropagation()),p(F,U)},ne=F=>{{let U=De(()=>Array.isArray(e(i).value));qa(F,{get value(){return e(i).value},get multi(){return e(U)},onselect:B=>{t.onedit?.(e(i).key,B),_(g,null)},oncancel:()=>{_(g,null)}})}},be=F=>{var U=Xe(),B=Ce(U);{var I=re=>{var Z=hr(),se=b(Z,!0);h(Z),ve(xe=>ce(se,xe),[()=>S(e(i))]),p(re,Z)},ue=re=>{var Z=pr();Ie(Z,21,()=>Array.isArray(e(i).value)?e(i).value:[e(i).value],Ne,(se,xe)=>{je(se,{variant:"ghost",class:"ip-wikilink-chip",onclick:Ae=>{Ae.stopPropagation(),O(e(xe))},children:(Ae,qe)=>{Te();var Me=tt();ve(()=>ce(Me,e(xe))),p(Ae,Me)},$$slots:{default:!0}})}),h(Z),p(re,Z)},ie=re=>{var Z=_r(),se=b(Z);let xe;var Ae=Q(se,2),qe=b(Ae,!0);h(Ae),h(Z),ve((Me,$e)=>{xe=et(se,"",xe,Me),ce(qe,$e)},[()=>({background:c(S(e(i)))}),()=>S(e(i))]),p(re,Z)},ge=re=>{var Z=gr(),se=b(Z,!0);h(Z),ve(xe=>ce(se,xe),[()=>N(S(e(i)))]),p(re,Z)},we=re=>{var Z=mr(),se=b(Z,!0);h(Z),ve((xe,Ae)=>{la(Z,"href",xe),ce(se,Ae)},[()=>S(e(i)),()=>S(e(i))]),Ke("click",Z,xe=>xe.stopPropagation()),p(re,Z)},he=De(()=>A(S(e(i)))),Re=re=>{var Z=yr(),se=b(Z,!0);h(Z),ve(xe=>ce(se,xe),[()=>S(e(i))]),p(re,Z)};me(B,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(he)?re(we,4):re(Re,!1)})}p(F,U)};me(ae,F=>{e(L)&&e(i).type==="text"?F(X):e(L)&&e(i).type==="status"?F(ke,1):e(L)&&e(i).type==="date"?F(K,2):e(L)&&e(i).type==="wikilink"?F(ne,3):F(be,!1)})}h(Y),h(j),ve(()=>{J=it(j,1,"ip-row svelte-x7sio8",null,J,{"ip-focused":e(L)}),ce(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(u,2);{var R=n=>{var i=br(),L=b(i),j=b(L);Et(j,{size:14}),h(L);var J=Q(L,2),D=b(J);vt(D),Ct(D,M=>_(E,M),()=>e(E)),h(J),Te(2),h(i),Ke("keydown",D,f),at("blur",D,w),Jt(D,()=>e(m),M=>_(m,M)),p(n,i)},V=n=>{je(n,{variant:"ghost",class:"ip-add-btn",onclick:i=>{i.stopPropagation(),_e()},children:(i,L)=>{var j=kr(),J=Ce(j);Et(J,{size:14}),Te(2),p(i,j)},$$slots:{default:!0}})};me(T,n=>{e(C)?n(R):o()&&n(V,1)})}h(v),p(G,v),Qe()}Lt(["click","keydown"]);var Cr=q('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),Sr=q('<div class="cursor-overlay svelte-ok7wy5"></div>'),Ar=q('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function Pr(G,t){Je(t,!0);let o=Le(t,"readonly",3,!0),s=Le(t,"resetKey",3,0);const d=fa("theme");let g,C=null,m=null,E=Pe(""),c=null,O=Pe(rt([])),S=null,A=t.content;function N(de,ye){return de.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),m&&(m.destroy(),m=null),_(O,[],!0);const{EditorState:de,Transaction:ye}=await He(async()=>{const{EditorState:n,Transaction:i}=await import("../chunks/CX_61fY8.js");return{EditorState:n,Transaction:i}},[],import.meta.url);c=ye;const{EditorView:pe,keymap:k,ViewPlugin:x}=await He(async()=>{const{EditorView:n,keymap:i,ViewPlugin:L}=await import("../chunks/DnL9f0lc.js").then(j=>j.i);return{EditorView:n,keymap:i,ViewPlugin:L}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await He(async()=>{const{markdown:n}=await import("../chunks/CscoF-YL.js");return{markdown:n}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:r,HighlightStyle:l}=await He(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:y,defaultKeymap:P,historyKeymap:H}=await He(async()=>{const{history:n,defaultKeymap:i,historyKeymap:L}=await import("../chunks/CWQRQXxy.js");return{history:n,defaultKeymap:i,historyKeymap:L}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:_e}=await He(async()=>{const{tags:n}=await import("../chunks/C7VoTosa.js").then(i=>i.i);return{tags:n}},[],import.meta.url),{livePreviewPlugin:Ee,livePreviewTheme:w}=await He(async()=>{const{livePreviewPlugin:n,livePreviewTheme:i}=await import("../chunks/B340SUKR.js");return{livePreviewPlugin:n,livePreviewTheme:i}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),f=d.current==="dark",v=N(pe,f),u=l.define([{tag:_e.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),T=[a(),v,r(u),Ee,w,pe.lineWrapping];o()&&T.push(de.readOnly.of(!0));let R=!1;if(t.cursorDocName&&!o())try{let K=function(){if(!C||!z){_(O,[],!0);return}const F=z.awareness,U=z.ytext,B=U.doc;if(!B){_(O,[],!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:he="Anonymous",color:Re="#e05050"}=ie.user||{};let re;try{re=M.createRelativePositionFromJSON(we.head)}catch{return}const Z=M.createAbsolutePositionFromRelativePosition(re,B);if(!Z||Z.type!==U)return;const se=C.coordsAtPos(Math.min(Z.index,C.state.doc.length));se&&I.push({id:ge,name:he,color:Re,top:se.top-ue.top,left:se.left-ue.left,height:se.bottom-se.top})}),_(O,I,!0)},ne=function(){S&&cancelAnimationFrame(S),S=requestAnimationFrame(()=>{S=null,K()})},be=function({added:F,updated:U,removed:B}){[...F,...U,...B].some(ue=>ue!==ke)&&ne()};const{createCollabSession:n}=await He(async()=>{const{createCollabSession:F}=await import("../chunks/DZnk0U6X.js");return{createCollabSession:F}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url),{ySync:i,ySyncFacet:L,YSyncConfig:j,yUndoManagerKeymap:J}=await He(async()=>{const{ySync:F,ySyncFacet:U,YSyncConfig:B,yUndoManagerKeymap:I}=await import("../chunks/i9c_RUF6.js");return{ySync:F,ySyncFacet:U,YSyncConfig:B,yUndoManagerKeymap:I}},__vite__mapDeps([16,9,0,1]),import.meta.url),{auth:D}=await He(async()=>{const{auth:F}=await import("../chunks/VEgGCdut.js").then(U=>U.x);return{auth:F}},__vite__mapDeps([13,11,14,15]),import.meta.url),M=await He(()=>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 He(async()=>{const{yUndoManagerFacet:F,yUndoManager:U,YUndoManagerConfig:B}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:F,yUndoManager:U,YUndoManagerConfig:B}},__vite__mapDeps([16,9,0,1]),import.meta.url),X=new j(z.ytext,z.awareness);T.push(L.of(X),i,W.of(new ae(le)),Y,k.of(J)),T.push(x.define(F=>{function U(){const B=F.state.selection.main,I=z.ytext,ue=M.createRelativePositionFromTypeIndex(I,B.anchor),ie=M.createRelativePositionFromTypeIndex(I,B.head);z.awareness.setLocalStateField("cursor",{anchor:M.relativePositionToJSON(ue),head:M.relativePositionToJSON(ie)})}return U(),{update(B){(B.selectionSet||B.docChanged)&&U()}}}));const ke=z.ydoc.clientID;z.awareness.on("change",be),T.push(x.define(()=>({update(F){(F.docChanged||F.geometryChanged||F.viewportChanged)&&ne()},destroy(){z.awareness.off("change",be)}}))),m=z,R=!0}catch(n){console.warn("Yjs collab setup failed, falling back to solo editing:",n)}if(!o()&&!R?(T.push(y({newGroupDelay:500})),T.push(k.of([...P,...H]))):!o()&&R&&T.push(k.of(P)),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 J=j.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return J&&t.onwikilinkclick(J),!0}}const L=i.closest(".cm-live-link");if(L){const j=L.getAttribute("data-href");if(j)return n.preventDefault(),window.open(j,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&T.push(k.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const V=de.create({doc:R?"":t.content,extensions:T});C=new pe({state:V,parent:g}),A=R?"":t.content,_(E,t.cursorDocName??"",!0)}va(()=>{oe()}),nt(()=>{t.cursorDocName&&e(E)&&t.cursorDocName!==e(E)&&oe()}),nt(()=>{if(s(),C&&!m&&t.content!==A){A=t.content;const de=g.closest(".document-scroll"),ye=de?.scrollTop??0;C.dispatch({changes:{from:0,to:C.state.doc.length,insert:t.content},...c?{annotations:c.addToHistory.of(!1)}:{}}),de&&requestAnimationFrame(()=>{de.scrollTop=ye})}}),Zt(()=>{S&&cancelAnimationFrame(S),m?.destroy(),m=null,C?.destroy()});var $=Ar(),fe=b($);Ct(fe,de=>g=de,()=>g);var Se=Q(fe,2);{var te=de=>{var ye=Sr();Ie(ye,21,()=>e(O),pe=>pe.id,(pe,k)=>{var x=Cr(),a=b(x),r=b(a,!0);h(a),h(x),ve(()=>{et(x,`top: ${e(k).top??""}px; left: ${e(k).left??""}px; height: ${e(k).height??""}px; --cursor-color: ${e(k).color??""};`),et(a,`background-color: ${e(k).color??""};`),ce(r,e(k).name)}),p(pe,x)}),h(ye),p(de,ye)};me(Se,de=>{e(O).length>0&&de(te)})}h($),p(G,$),Qe()}var kt={exports:{}};var Rr=kt.exports,Nt;function Dr(){return Nt||(Nt=1,(function(G,t){((o,s)=>{G.exports=s()})(Rr,function o(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},d,g=!s.document&&!!s.postMessage,C=s.IS_PAPA_WORKER||!1,m={},E=0,c={};function O(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(r){var l=pe(r);l.chunkSize=parseInt(l.chunkSize),r.step||r.chunk||(l.chunkSize=null),this._handle=new $(l),(this._handle.streamer=this)._config=l}).call(this,a),this.parseChunk=function(r,l){var y=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<y){let H=this._config.newline;H||(P=this._config.quoteChar||'"',H=this._handle.guessLineEndings(r,P)),r=[...r.split(H).slice(y)].join(H)}this.isFirstChunk&&x(this._config.beforeFirstChunk)&&(P=this._config.beforeFirstChunk(r))!==void 0&&(r=P),this.isFirstChunk=!1,this._halted=!1;var y=this._partialLine+r,P=(this._partialLine="",this._handle.parse(y,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(r=P.meta.cursor,y=(this._finished||(this._partialLine=y.substring(r-this._baseIndex),this._baseIndex=r),P&&P.data&&(this._rowCount+=P.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),C)s.postMessage({results:P,workerId:c.WORKER_ID,finished:y});else if(x(this._config.chunk)&&!l){if(this._config.chunk(P,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=P=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(P.data),this._completeResults.errors=this._completeResults.errors.concat(P.errors),this._completeResults.meta=P.meta),this._completed||!y||!x(this._config.complete)||P&&P.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),y||P&&P.meta.paused||this._nextChunk(),P}this._halted=!0},this._sendError=function(r){x(this._config.error)?this._config.error(r):C&&this._config.error&&s.postMessage({workerId:c.WORKER_ID,error:r,finished:!1})}}function S(a){var r;(a=a||{}).chunkSize||(a.chunkSize=c.RemoteChunkSize),O.call(this,a),this._nextChunk=g?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(l){this._input=l,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),g||(r.onload=k(this._chunkLoaded,this),r.onerror=k(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!g),this._config.downloadRequestHeaders){var l,y=this._config.downloadRequestHeaders;for(l in y)r.setRequestHeader(l,y[l])}var P;this._config.chunkSize&&(P=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+P));try{r.send(this._config.downloadRequestBody)}catch(H){this._chunkError(H.message)}g&&r.status===0&&this._chunkError()}},this._chunkLoaded=function(){r.readyState===4&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(l=>(l=l.getResponseHeader("Content-Range"))!==null?parseInt(l.substring(l.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)))},this._chunkError=function(l){l=r.statusText||l,this._sendError(new Error(l))}}function A(a){(a=a||{}).chunkSize||(a.chunkSize=c.LocalChunkSize),O.call(this,a);var r,l,y=typeof FileReader<"u";this.stream=function(P){this._input=P,l=P.slice||P.webkitSlice||P.mozSlice,y?((r=new FileReader).onload=k(this._chunkLoaded,this),r.onerror=k(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 P=this._input,H=(this._config.chunkSize&&(H=Math.min(this._start+this._config.chunkSize,this._input.size),P=l.call(P,this._start,H)),r.readAsText(P,this._config.encoding));y||this._chunkLoaded({target:{result:H}})},this._chunkLoaded=function(P){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(P.target.result)},this._chunkError=function(){this._sendError(r.error)}}function N(a){var r;O.call(this,a=a||{}),this.stream=function(l){return r=l,this._nextChunk()},this._nextChunk=function(){var l,y;if(!this._finished)return l=this._config.chunkSize,r=l?(y=r.substring(0,l),r.substring(l)):(y=r,""),this._finished=!r,this.parseChunk(y)}}function oe(a){O.call(this,a=a||{});var r=[],l=!0,y=!1;this.pause=function(){O.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){O.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(P){this._input=P,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){y&&r.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):l=!0},this._streamData=k(function(P){try{r.push(typeof P=="string"?P:P.toString(this._config.encoding)),l&&(l=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(H){this._streamError(H)}},this),this._streamError=k(function(P){this._streamCleanUp(),this._sendError(P)},this),this._streamEnd=k(function(){this._streamCleanUp(),y=!0,this._streamData("")},this),this._streamCleanUp=k(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function $(a){var r,l,y,P,H=Math.pow(2,53),_e=-H,Ee=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,w=/^((\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,u=0,T=!1,R=!1,V=[],n={data:[],errors:[],meta:{}};function i(D){return a.skipEmptyLines==="greedy"?D.join("").trim()==="":D.length===1&&D[0].length===0}function L(){if(n&&y&&(J("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),y=!1),a.skipEmptyLines&&(n.data=n.data.filter(function(z){return!i(z)})),j()){let z=function(le,W){x(a.transformHeader)&&(le=a.transformHeader(le,W)),V.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<H))return 1})(K)?parseFloat(K):w.test(K)?new Date(K):K===""?null:K):K)(ae=a.header?Y>=V.length?"__parsed_extra":V[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>V.length?J("FieldMismatch","TooManyFields","Too many fields: expected "+V.length+" fields but parsed "+Y,u+le):Y<V.length&&J("FieldMismatch","TooFewFields","Too few fields: expected "+V.length+" fields but parsed "+Y,u+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=V),u+=ee)}function j(){return a.header&&V.length===0}function J(D,M,ee,z){D={type:D,code:M,message:ee},z!==void 0&&(D.row=z),n.errors.push(D)}x(a.step)&&(P=a.step,a.step=function(D){n=D,j()?L():(L(),n.data.length!==0&&(v+=D.data.length,a.preview&&v>a.preview?l.abort():(n.data=n.data[0],P(n,f))))}),this.parse=function(D,M,ee){var z=a.quoteChar||'"',z=(a.newline||(a.newline=this.guessLineEndings(D,z)),y=!1,a.delimiter?x(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||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var F=0;F<X.length;F++){for(var U,B=X[F],I=0,ue=0,ie=0,ge=(ne=void 0,new Se({comments:ae,delimiter:B,newline:W,preview:10}).parse(le)),we=0;we<ge.data.length;we++)Y&&i(ge.data[we])?ie++:(U=ge.data[we].length,ue+=U,ne===void 0?ne=U:0<U&&(I+=Math.abs(U-ne),ne=U));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=B,be=ue)}return{successful:!!(a.delimiter=ke),bestDelimiter:ke}})(D,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=z.bestDelimiter:(y=!0,a.delimiter=c.DefaultDelimiter),n.meta.delimiter=a.delimiter),pe(a));return a.preview&&a.header&&z.preview++,r=D,l=new Se(z),n=l.parse(r,M,ee),L(),T?{meta:{paused:!0}}:n||{meta:{paused:!1}}},this.paused=function(){return T},this.pause=function(){T=!0,l.abort(),r=x(a.chunk)?"":r.substring(l.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,l.abort(),n.meta.aborted=!0,x(a.complete)&&a.complete(n),r=""},this.guessLineEndings=function(le,z){le=le.substring(0,1048576);var z=new RegExp(fe(z)+"([^]*?)"+fe(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 fe(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(a){var r=(a=a||{}).delimiter,l=a.newline,y=a.comments,P=a.step,H=a.preview,_e=a.fastMode,Ee=null,w=!1,f=a.quoteChar==null?'"':a.quoteChar,v=f;if(a.escapeChar!==void 0&&(v=a.escapeChar),(typeof r!="string"||-1<c.BAD_DELIMITERS.indexOf(r))&&(r=","),y===r)throw new Error("Comment character same as delimiter");y===!0?y="#":(typeof y!="string"||-1<c.BAD_DELIMITERS.indexOf(y))&&(y=!1),l!==`
7
+ `&&l!=="\r"&&l!==`\r
8
+ `&&(l=`
9
+ `);var u=0,T=!1;this.parse=function(R,V,n){if(typeof R!="string")throw new Error("Input must be a string");var i=R.length,L=r.length,j=l.length,J=y.length,D=x(P),M=[],ee=[],z=[],le=u=0;if(!R)return I();if(_e||_e!==!1&&R.indexOf(f)===-1){for(var W=R.split(l),Y=0;Y<W.length;Y++){if(z=W[Y],u+=z.length,Y!==W.length-1)u+=l.length;else if(n)return I();if(!y||z.substring(0,J)!==y){if(D){if(M=[],be(z.split(r)),ue(),T)return I()}else be(z.split(r));if(H&&H<=Y)return M=M.slice(0,H),I(!0)}}return I()}for(var ae=R.indexOf(r,u),X=R.indexOf(l,u),ke=new RegExp(fe(v)+fe(f),"g"),K=R.indexOf(f,u);;)if(R[u]===f)for(K=u,u++;;){if((K=R.indexOf(f,K+1))===-1)return n||ee.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:M.length,index:u}),U();if(K===i-1)return U(R.substring(u,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(l,K+1):X)===-1?ae:Math.min(ae,X));if(R.substr(K+1+ne,L)===r){z.push(R.substring(u,K).replace(ke,f)),R[u=K+1+ne+L]!==f&&(K=R.indexOf(f,u)),ae=R.indexOf(r,u),X=R.indexOf(l,u);break}if(ne=F(X),R.substring(K+1+ne,K+1+ne+j)===l){if(z.push(R.substring(u,K).replace(ke,f)),B(K+1+ne+j),ae=R.indexOf(r,u),K=R.indexOf(f,u),D&&(ue(),T))return I();if(H&&M.length>=H)return I(!0);break}ee.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:M.length,index:u}),K++}}else if(y&&z.length===0&&R.substring(u,u+J)===y){if(X===-1)return I();u=X+j,X=R.indexOf(l,u),ae=R.indexOf(r,u)}else if(ae!==-1&&(ae<X||X===-1))z.push(R.substring(u,ae)),u=ae+L,ae=R.indexOf(r,u);else{if(X===-1)break;if(z.push(R.substring(u,X)),B(X+j),D&&(ue(),T))return I();if(H&&M.length>=H)return I(!0)}return U();function be(ie){M.push(ie),le=u}function F(ie){var ge=0;return ge=ie!==-1&&(ie=R.substring(K+1,ie))&&ie.trim()===""?ie.length:ge}function U(ie){return n||(ie===void 0&&(ie=R.substring(u)),z.push(ie),u=i,be(z),D&&ue()),I()}function B(ie){u=ie,be(z),z=[],X=R.indexOf(l,u)}function I(ie){if(a.header&&!V&&M.length&&!w){var ge=M[0],we=Object.create(null),he=new Set(ge);let Re=!1;for(let re=0;re<ge.length;re++){let Z=ge[re];if(we[Z=x(a.transformHeader)?a.transformHeader(Z,re):Z]){let se,xe=we[Z];for(;se=Z+"_"+xe,xe++,he.has(se););he.add(se),ge[re]=se,we[Z]++,Re=!0,(Ee=Ee===null?{}:Ee)[se]=Z}else we[Z]=1,ge[re]=Z;he.add(Z)}Re&&console.warn("Duplicate headers found and renamed."),w=!0}return{data:M,errors:ee,meta:{delimiter:r,linebreak:l,aborted:T,truncated:!!ie,cursor:le+(V||0),renamedHeaders:Ee}}}function ue(){P(I()),M=[],ee=[]}},this.abort=function(){T=!0},this.getCharIndex=function(){return u}}function te(a){var r=a.data,l=m[r.workerId],y=!1;if(r.error)l.userError(r.error,r.file);else if(r.results&&r.results.data){var P={abort:function(){y=!0,de(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:ye,resume:ye};if(x(l.userStep)){for(var H=0;H<r.results.data.length&&(l.userStep({data:r.results.data[H],errors:r.results.errors,meta:r.results.meta},P),!y);H++);delete r.results}else x(l.userChunk)&&(l.userChunk(r.results,P,r.file),delete r.results)}r.finished&&!y&&de(r.workerId,r.results)}function de(a,r){var l=m[a];x(l.userComplete)&&l.userComplete(r),l.terminate(),delete m[a]}function ye(){throw new Error("Not implemented.")}function pe(a){if(typeof a!="object"||a===null)return a;var r,l=Array.isArray(a)?[]:{};for(r in a)l[r]=pe(a[r]);return l}function k(a,r){return function(){a.apply(r,arguments)}}function x(a){return typeof a=="function"}return c.parse=function(a,r){var l=(r=r||{}).dynamicTyping||!1;if(x(l)&&(r.dynamicTypingFunction=l,l={}),r.dynamicTyping=l,r.transform=!!x(r.transform)&&r.transform,!r.worker||!c.WORKERS_SUPPORTED)return l=null,c.NODE_STREAM_INPUT,typeof a=="string"?(a=(y=>y.charCodeAt(0)!==65279?y:y.slice(1))(a),l=new(r.download?S:N)(r)):a.readable===!0&&x(a.read)&&x(a.on)?l=new oe(r):(s.File&&a instanceof File||a instanceof Object)&&(l=new A(r)),l.stream(a);(l=(()=>{var y;return!!c.WORKERS_SUPPORTED&&(y=(()=>{var P=s.URL||s.webkitURL||null,H=o.toString();return c.BLOB_URL||(c.BLOB_URL=P.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; ","(",H,")();"],{type:"text/javascript"})))})(),(y=new s.Worker(y)).onmessage=te,y.id=E++,m[y.id]=y)})()).userStep=r.step,l.userChunk=r.chunk,l.userComplete=r.complete,l.userError=r.error,r.step=x(r.step),r.chunk=x(r.chunk),r.complete=x(r.complete),r.error=x(r.error),delete r.worker,l.postMessage({input:a,config:r,workerId:l.id})},c.unparse=function(a,r){var l=!1,y=!0,P=",",H=`\r
10
+ `,_e='"',Ee=_e+_e,w=!1,f=null,v=!1,u=((()=>{if(typeof r=="object"){if(typeof r.delimiter!="string"||c.BAD_DELIMITERS.filter(function(V){return r.delimiter.indexOf(V)!==-1}).length||(P=r.delimiter),typeof r.quotes!="boolean"&&typeof r.quotes!="function"&&!Array.isArray(r.quotes)||(l=r.quotes),typeof r.skipEmptyLines!="boolean"&&typeof r.skipEmptyLines!="string"||(w=r.skipEmptyLines),typeof r.newline=="string"&&(H=r.newline),typeof r.quoteChar=="string"&&(_e=r.quoteChar),typeof r.header=="boolean"&&(y=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(fe(_e),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return T(null,a,w);if(typeof a[0]=="object")return T(f||Object.keys(a[0]),a,w)}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||[],w);throw new Error("Unable to serialize unrecognized input");function T(V,n,i){var L="",j=(typeof V=="string"&&(V=JSON.parse(V)),typeof n=="string"&&(n=JSON.parse(n)),Array.isArray(V)&&0<V.length),J=!Array.isArray(n[0]);if(j&&y){for(var D=0;D<V.length;D++)0<D&&(L+=P),L+=R(V[D],D);0<n.length&&(L+=H)}for(var M=0;M<n.length;M++){var ee=(j?V: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=J?V[Y]:Y;W.push(n[M][ae])}z=W.join("").trim()===""}if(!z){for(var X=0;X<ee;X++){0<X&&!le&&(L+=P);var ke=j&&J?V[X]:X;L+=R(n[M][ke],X)}M<n.length-1&&(!i||0<ee&&!le)&&(L+=H)}}return L}function R(V,n){var i,L;return V==null?"":V.constructor===Date?JSON.stringify(V).slice(1,25):(L=!1,v&&typeof V=="string"&&v.test(V)&&(V="'"+V,L=!0),i=V.toString().replace(u,Ee),(L=L||l===!0||typeof l=="function"&&l(V,n)||Array.isArray(l)&&l[n]||((j,J)=>{for(var D=0;D<J.length;D++)if(-1<j.indexOf(J[D]))return!0;return!1})(i,c.BAD_DELIMITERS)||-1<i.indexOf(P)||i.charAt(0)===" "||i.charAt(i.length-1)===" ")?_e+i+_e:i)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
11
+ `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!g&&!!s.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=Se,c.ParserHandle=$,c.NetworkStreamer=S,c.FileStreamer=A,c.StringStreamer=N,c.ReadableStreamStreamer=oe,s.jQuery&&((d=s.jQuery).fn.parse=function(a){var r=a.config||{},l=[];return this.each(function(H){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var _e=0;_e<this.files.length;_e++)l.push({file:this.files[_e],inputElem:this,instanceConfig:d.extend({},r)})}),y(),this;function y(){if(l.length===0)x(a.complete)&&a.complete();else{var H,_e,Ee,w,f=l[0];if(x(a.before)){var v=a.before(f.file,f.inputElem);if(typeof v=="object"){if(v.action==="abort")return H="AbortError",_e=f.file,Ee=f.inputElem,w=v.reason,void(x(a.error)&&a.error({name:H},_e,Ee,w));if(v.action==="skip")return void P();typeof v.config=="object"&&(f.instanceConfig=d.extend(f.instanceConfig,v.config))}else if(v==="skip")return void P()}var u=f.instanceConfig.complete;f.instanceConfig.complete=function(T){x(u)&&u(T,f.file,f.inputElem),P()},c.parse(f.file,f.instanceConfig)}}function P(){l.splice(0,1),y()}}),C&&(s.onmessage=function(a){a=a.data,c.WORKER_ID===void 0&&a&&(c.WORKER_ID=a.workerId),typeof a.input=="string"?s.postMessage({workerId:c.WORKER_ID,results:c.parse(a.input,a.config),finished:!0}):(s.File&&a.input instanceof File||a.input instanceof Object)&&(a=c.parse(a.input,a.config))&&s.postMessage({workerId:c.WORKER_ID,results:a,finished:!0})}),(S.prototype=Object.create(O.prototype)).constructor=S,(A.prototype=Object.create(O.prototype)).constructor=A,(N.prototype=Object.create(N.prototype)).constructor=N,(oe.prototype=Object.create(O.prototype)).constructor=oe,c})})(kt)),kt.exports}var Tr=Dr();const qt=Fa(Tr);var zr=q('<span class="remote-cell-label svelte-63hltt"> </span>'),Or=q('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),Lr=q('<span class="remote-cell-label svelte-63hltt"> </span>'),Mr=q('<td><!> <input class="cell-input svelte-63hltt"/></td>'),Fr=q('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),Ir=q("<!> <span>Add row</span>",1),jr=q('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Vr(G,t){Je(t,!0);let o=Le(t,"remoteCursors",19,()=>[]),s=Pe(rt([])),d=Pe(rt([])),g=Pe(void 0);function C(w){const f=qt.parse(w.trim(),{header:!1,skipEmptyLines:!0});f.data.length>0?(_(s,f.data[0],!0),_(d,f.data.slice(1),!0)):(_(s,[],!0),_(d,[],!0))}C(t.content),nt(()=>{C(t.content)});function m(){return qt.unparse([e(s),...e(d)])}function E(){const w=m();t.onchange?.(w)}function c(w,f,v){e(d)[w][f]=v,_(d,[...e(d)],!0),E()}function O(w,f){e(s)[w]=f,_(s,[...e(s)],!0),E()}function S(){_(d,[...e(d),e(s).map(()=>"")],!0),E(),$(e(d).length-1,0)}function A(w){_(d,e(d).filter((f,v)=>v!==w),!0),E()}function N(){const w=`col${e(s).length+1}`;_(s,[...e(s),w],!0),_(d,e(d).map(f=>[...f,""]),!0),E(),requestAnimationFrame(()=>{const f=e(g)?.querySelector(`thead th:nth-child(${e(s).length+1}) input`);f&&(f.focus(),f.select())})}function oe(w){e(s).length<=1||(_(s,e(s).filter((f,v)=>v!==w),!0),_(d,e(d).map(f=>f.filter((v,u)=>u!==w)),!0),E())}function $(w,f){requestAnimationFrame(()=>{if(!e(g))return;let v=null;w<0?v=e(g).querySelector(`thead th:nth-child(${f+2}) input`):v=e(g).querySelector(`tbody tr:nth-child(${w+1}) td:nth-child(${f+2}) input`),v&&(v.focus(),v.select())})}function fe(w,f,v){if(w.key==="Tab"){w.preventDefault(),w.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(d).length-1?$(f+1,0):f===e(d).length-1&&S();return}if(w.key==="Enter"){w.preventDefault(),w.shiftKey?f>0?$(f-1,v):$(-1,v):f<e(d).length-1?$(f+1,v):S();return}if(w.key==="Escape"){w.target.blur();return}}function Se(w,f){if(w.key==="Tab"){w.preventDefault(),w.shiftKey?f>0&&$(-1,f-1):f<e(s).length-1?$(-1,f+1):e(d).length>0&&$(0,0);return}if(w.key==="Enter"){w.preventDefault(),e(d).length>0?$(0,f):S();return}if(w.key==="Escape"){w.target.blur();return}}function te(w,f){return o().find(v=>v.row===w&&v.col===f)}function de(w,f){t.oncellselect?.(w,f)}function ye(w){(w.metaKey||w.ctrlKey)&&w.key==="s"&&(w.preventDefault(),t.onsave?.())}var pe=jr(),k=b(pe),x=b(k),a=b(x),r=b(a),l=Q(b(r));Ie(l,17,()=>e(s),Ne,(w,f,v)=>{const u=De(()=>te(-1,v));var T=Or();let R;var V=b(T);{var n=J=>{var D=zr(),M=b(D,!0);h(D),ve(()=>{et(D,`background-color: ${e(u).color??""}`),ce(M,e(u).name)}),p(J,D)};me(V,J=>{e(u)&&J(n)})}var i=Q(V,2);vt(i);var L=Q(i,2);{var j=J=>{je(J,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>oe(v),children:(D,M)=>{Vt(D,{size:12})},$$slots:{default:!0}})};me(L,J=>{e(s).length>1&&J(j)})}h(T),ve(()=>{et(T,e(u)?`--rc-color: ${e(u).color}`:""),R=it(T,1,"svelte-63hltt",null,R,{"remote-active":!!e(u)}),zt(i,e(f))}),Ke("input",i,J=>O(v,J.currentTarget.value)),Ke("keydown",i,J=>Se(J,v)),at("focus",i,()=>de(-1,v)),p(w,T)});var y=Q(l),P=b(y);je(P,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:N,children:(w,f)=>{Et(w,{size:14})},$$slots:{default:!0}}),h(y),h(r),h(a);var H=Q(a);Ie(H,21,()=>e(d),Ne,(w,f,v)=>{var u=Fr(),T=b(u);T.textContent=v+1;var R=Q(T);Ie(R,17,()=>e(f),Ne,(i,L,j)=>{const J=De(()=>te(v,j));var D=Mr();let M;var ee=b(D);{var z=W=>{var Y=Lr(),ae=b(Y,!0);h(Y),ve(()=>{et(Y,`background-color: ${e(J).color??""}`),ce(ae,e(J).name)}),p(W,Y)};me(ee,W=>{e(J)&&W(z)})}var le=Q(ee,2);vt(le),h(D),ve(()=>{et(D,e(J)?`--rc-color: ${e(J).color}`:""),M=it(D,1,"svelte-63hltt",null,M,{"remote-active":!!e(J)}),zt(le,e(L))}),Ke("input",le,W=>c(v,j,W.currentTarget.value)),Ke("keydown",le,W=>fe(W,v,j)),at("focus",le,()=>de(v,j)),p(i,D)});var V=Q(R),n=b(V);je(n,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>A(v),children:(i,L)=>{Vt(i,{size:12})},$$slots:{default:!0}}),h(V),h(u),p(w,u)}),h(H),h(x),Ct(x,w=>_(g,w),()=>e(g)),h(k);var _e=Q(k,2),Ee=b(_e);je(Ee,{variant:"ghost",class:"add-row-btn",onclick:S,children:(w,f)=>{var v=Ir(),u=Ce(v);Et(u,{size:14}),Te(2),p(w,v)},$$slots:{default:!0}}),h(_e),h(pe),Ke("keydown",pe,ye),p(G,pe),Qe()}Lt(["keydown","input"]);const Ur=/^\d{4}-\d{2}-\d{2}/,Kr=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),Nr=new Set(["entity_type","format"]),qr=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Hr(G,t){const o=[];for(const[s,d]of Object.entries(G)){if(qr.has(s)||d==null)continue;const g=Wr(s,d);g&&o.push(g)}return o}function Wr(G,t){if(Nr.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 m=t.map(E=>Object.entries(E).map(([O,S])=>`${O}: ${S}`).join(", "));return{key:G,value:m.join(" | "),type:"text"}}const d=t.map(String),g=d.some(m=>/^\[\[.+?\]\]$/.test(m)),C=d.map(m=>{const E=m.match(/^\[\[(.+?)\]\]$/);return E?E[1]:m});return g||C.every(m=>Ht(m))?{key:G,value:C,type:"wikilink"}:{key:G,value:d.join(", "),type:"text"}}const o=String(t),s=o.match(/^\[\[(.+?)\]\]$/);return s?{key:G,value:s[1],type:"wikilink"}:Ur.test(o)?{key:G,value:o,type:"date"}:Kr.has(o.toLowerCase())?{key:G,value:o,type:"status"}:Ht(o)&&!o.includes(" ")?{key:G,value:o,type:"wikilink"}:{key:G,value:o,type:"text"}}function Ht(G){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(G)&&G.includes("-")}class Br{diff(t,o,s={}){let d;typeof s=="function"?(d=s,s={}):"callback"in s&&(d=s.callback);const g=this.castInput(t,s),C=this.castInput(o,s),m=this.removeEmpty(this.tokenize(g,s)),E=this.removeEmpty(this.tokenize(C,s));return this.diffWithOptionsObj(m,E,s,d)}diffWithOptionsObj(t,o,s,d){var g;const C=te=>{if(te=this.postProcess(te,s),d){setTimeout(function(){d(te)},0);return}else return te},m=o.length,E=t.length;let c=1,O=m+E;s.maxEditLength!=null&&(O=Math.min(O,s.maxEditLength));const S=(g=s.timeout)!==null&&g!==void 0?g:1/0,A=Date.now()+S,N=[{oldPos:-1,lastComponent:void 0}];let oe=this.extractCommon(N[0],o,t,0,s);if(N[0].oldPos+1>=E&&oe+1>=m)return C(this.buildValues(N[0].lastComponent,o,t));let $=-1/0,fe=1/0;const Se=()=>{for(let te=Math.max($,-c);te<=Math.min(fe,c);te+=2){let de;const ye=N[te-1],pe=N[te+1];ye&&(N[te-1]=void 0);let k=!1;if(pe){const a=pe.oldPos-te;k=pe&&0<=a&&a<m}const x=ye&&ye.oldPos+1<E;if(!k&&!x){N[te]=void 0;continue}if(!x||k&&ye.oldPos<pe.oldPos?de=this.addToPath(pe,!0,!1,0,s):de=this.addToPath(ye,!1,!0,1,s),oe=this.extractCommon(de,o,t,te,s),de.oldPos+1>=E&&oe+1>=m)return C(this.buildValues(de.lastComponent,o,t))||!0;N[te]=de,de.oldPos+1>=E&&(fe=Math.min(fe,te-1)),oe+1>=m&&($=Math.max($,te+1))}c++};if(d)(function te(){setTimeout(function(){if(c>O||Date.now()>A)return d(void 0);Se()||te()},0)})();else for(;c<=O&&Date.now()<=A;){const te=Se();if(te)return te}}addToPath(t,o,s,d,g){const C=t.lastComponent;return C&&!g.oneChangePerToken&&C.added===o&&C.removed===s?{oldPos:t.oldPos+d,lastComponent:{count:C.count+1,added:o,removed:s,previousComponent:C.previousComponent}}:{oldPos:t.oldPos+d,lastComponent:{count:1,added:o,removed:s,previousComponent:C}}}extractCommon(t,o,s,d,g){const C=o.length,m=s.length;let E=t.oldPos,c=E-d,O=0;for(;c+1<C&&E+1<m&&this.equals(s[E+1],o[c+1],g);)c++,E++,O++,g.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return O&&!g.oneChangePerToken&&(t.lastComponent={count:O,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=E,c}equals(t,o,s){return s.comparator?s.comparator(t,o):t===o||!!s.ignoreCase&&t.toLowerCase()===o.toLowerCase()}removeEmpty(t){const o=[];for(let s=0;s<t.length;s++)t[s]&&o.push(t[s]);return o}castInput(t,o){return t}tokenize(t,o){return Array.from(t)}join(t){return t.join("")}postProcess(t,o){return t}get useLongestToken(){return!1}buildValues(t,o,s){const d=[];let g;for(;t;)d.push(t),g=t.previousComponent,delete t.previousComponent,t=g;d.reverse();const C=d.length;let m=0,E=0,c=0;for(;m<C;m++){const O=d[m];if(O.removed)O.value=this.join(s.slice(c,c+O.count)),c+=O.count;else{if(!O.added&&this.useLongestToken){let S=o.slice(E,E+O.count);S=S.map(function(A,N){const oe=s[c+N];return oe.length>A.length?oe:A}),O.value=this.join(S)}else O.value=this.join(o.slice(E,E+O.count));E+=O.count,O.added||(c+=O.count)}}return d}}const Wt="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 Yr extends Br{tokenize(t){const o=new RegExp(`(\\r?\\n)|[${Wt}]+|[^\\S\\n\\r]+|[^${Wt}]`,"ug");return t.match(o)||[]}}const Zr=new Yr;function Jr(G,t,o){return Zr.diff(G,t,o)}var Qr=q('<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>'),Gr=q('<div class="diff-properties svelte-1g4tvol"></div>'),Xr=q('<span class="db-added"> </span>'),$r=q('<span class="db-removed"> </span>'),en=q("<span> </span>"),tn=q("<span> </span>"),an=q('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function rn(G,t){Je(t,!0);function o(A){if(A==null)return"";if(typeof A!="object")return String(A);const N=A;return String(N.name??N.title??N.label??N.id??JSON.stringify(N))}function s(A){return A==null?"":Array.isArray(A)?A.map(o).join(", "):typeof A=="object"?o(A):String(A)}const d=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Jr(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var g=an(),C=b(g);{var m=A=>{var N=Gr();Ie(N,21,()=>t.refreshResult.diffs,Ne,(oe,$)=>{const fe=De(()=>t.properties.find(v=>v.key===e($).field));var Se=Qr(),te=b(Se),de=b(te);{var ye=v=>{yt(v,{size:14})},pe=v=>{wt(v,{size:14})},k=v=>{bt(v,{size:14})},x=v=>{Qt(v,{size:14})},a=v=>{mt(v,{size:14})};me(de,v=>{e(fe)?.type==="date"?v(ye):e(fe)?.type==="status"?v(pe,1):e(fe)?.type==="wikilink"?v(k,2):e(fe)?.type==="badge"?v(x,3):v(a,!1)})}h(te);var r=Q(te,2),l=b(r,!0);h(r);var y=Q(r,2),P=b(y),H=b(P),_e=b(H,!0);h(H),h(P);var Ee=Q(P,2),w=b(Ee),f=b(w,!0);h(w),h(Ee),h(y),h(Se),ve((v,u)=>{ce(l,e($).field),ce(_e,v),ce(f,u)},[()=>s(e($).old_value),()=>s(e($).new_value)]),p(oe,Se)}),h(N),p(A,N)};me(C,A=>{t.refreshResult.diffs.length>0&&A(m)})}var E=Q(C,2),c=b(E);{var O=A=>{var N=Xe(),oe=Ce(N);Ie(oe,17,()=>e(d),Ne,($,fe)=>{var Se=Xe(),te=Ce(Se);{var de=k=>{var x=Xr(),a=b(x,!0);h(x),ve(()=>ce(a,e(fe).value)),p(k,x)},ye=k=>{var x=$r(),a=b(x,!0);h(x),ve(()=>ce(a,e(fe).value)),p(k,x)},pe=k=>{var x=en(),a=b(x,!0);h(x),ve(()=>ce(a,e(fe).value)),p(k,x)};me(te,k=>{e(fe).added?k(de):e(fe).removed?k(ye,1):k(pe,!1)})}p($,Se)}),p(A,N)},S=A=>{var N=tn(),oe=b(N,!0);h(N),ve(()=>ce(oe,t.bodyContent)),p(A,N)};me(c,A=>{e(d)?A(O):A(S,!1)})}h(E),h(g),p(G,g),Qe()}var nn=q("<!> ",1),sn=q('<span class="diff-action-title svelte-1dc9loe">Changes from source</span> <div class="diff-action-buttons svelte-1dc9loe"><!> <!></div>',1),on=q('<span class="bc-sep svelte-1dc9loe">/</span>'),ln=q("<!><span> </span>",1),un=q('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),dn=q('<span class="status-text error svelte-1dc9loe"> </span>'),cn=q("<!> ",1),fn=q('<div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!> <!></div>',1),vn=q('<div class="refresh-panel svelte-1dc9loe"><div class="refresh-uptodate svelte-1dc9loe">Entity is up to date with source.</div></div>'),hn=q('<div class="document-scroll svelte-1dc9loe"><!> <!></div>'),pn=q("<!> <div><!></div> <!> <!>",1),_n=q("<!> <!>",1),gn=q("<!> <!>",1),mn=q("<!> <!>",1);function Mn(G,t){Je(t,!0);const o=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)),d=De(()=>()=>{const u=t.data.entity.path;if(u){const T=u.lastIndexOf(`/${t.data.repo}/`);if(T>=0)return u.substring(T+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let g=Pe(""),C=Pe(rt({})),m=Pe(0);const E=De(()=>Hr(e(C))),c=De(()=>!!t.data.entity.data?.source_ref);let O=Pe(!1),S=Pe(null),A=Pe(null);async function N(){if(!e(O)){_(O,!0),_(S,null),_(A,null);try{const{result:u}=await Oa(t.data.repo,t.data.type,t.data.id);_(S,u,!0)}catch(u){_(A,u.message||"Refresh failed",!0)}finally{_(O,!1)}}}let oe=Pe(!1);async function $(){if(!e(oe)){_(oe,!0);try{await za(t.data.repo,t.data.type,t.data.id),_(S,null),await pa()}catch(u){_(A,u.message||"Apply changes failed",!0)}finally{_(oe,!1)}}}let fe=null,Se=Pe(""),te=!1,de=Pe(rt([]));function ye(u){pe(),He(async()=>{const{createCollabSession:T}=await import("../chunks/DZnk0U6X.js");return{createCollabSession:T}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url).then(({createCollabSession:T})=>{const R=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#e05050",V=T(u,{name:It.user?.displayName??"Anonymous",color:R,colorLight:R+"33"});V.ytext.observe(()=>{const L=V.ytext.toString();L!==e(g)&&(te=!0,_(g,L,!0),requestAnimationFrame(()=>{te=!1}))});const n=V.ydoc.clientID;function i(){const L=[];V.awareness.getStates().forEach((j,J)=>{if(J===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||{};L.push({row:D.row,col:D.col,name:M,color:ee})}),_(de,L,!0)}V.awareness.on("change",i),fe=V,_(Se,u,!0)})}function pe(){fe&&(fe.destroy(),fe=null,_(Se,""),_(de,[],!0))}Zt(()=>pe());let k=Pe(""),x=Pe(0);nt(()=>{const u=`${t.data.repo}/${t.data.type}/${t.data.id}`,T=xa.mutationCount;if(u!==e(k)||T!==e(x)){e(k)&&u!==e(k)&&Ve.flush(),_(k,u),_(x,T,!0),_(g,t.data.entity.document?.content??"",!0),_(C,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ft(m),Ve.reset();const R=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(o)&&R!==e(Se)?ye(R):e(o)||pe()}}),nt(()=>{const u=t.data.repo,T=t.data.type,R=t.data.id;Bt(()=>{Tt.select(u,T,R),Tt.showEntity()})});function a(u){if(!te){if(_(g,u,!0),fe){const T=fe.ytext,R=T.toString();u!==R&&fe.ydoc.transact(()=>{T.delete(0,T.length),T.insert(0,u)})}Ve.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:u})}}function r(u,T){_(C,{...e(C),[u]:T},!0),Ve.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(C)})}function l(u){const{[u]:T,...R}=e(C);_(C,R,!0),Ve.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(C)})}function y(u,T){_(C,{...e(C),[u]:T},!0),Ve.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(C)})}function P(u,T){Ve.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(C)})}function H(u){for(const T of xt.repos){const R=T.entities.find(V=>V.id===u);if(R){Ot(`/${T.name}/${R.entityType}/${R.id}`);return}}ha.showToast(`"${u}" is in a collection you don't have access to`)}nt(()=>(Ut.enter(t.data.repo,t.data.type,t.data.id),()=>Ut.leave()));const _e=De(()=>e(S)!==null&&(e(S).diffs.length>0||e(S).body_changed));function Ee(u){(u.metaKey||u.ctrlKey)&&u.key==="s"&&(u.preventDefault(),Ve.flush()),u.key==="Escape"&&!(u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement)&&(Ve.flush(),Tt.deselect(),Ot("/"))}var w=mn();at("keydown",Yt,Ee);var f=Ce(w);Ea(f,{children:(u,T)=>{var R=pn(),V=Ce(R);La(V,{activeView:"entity"});var n=Q(V,2);let i;var L=b(n);{var j=W=>{var Y=sn(),ae=Q(Ce(Y),2),X=b(ae);je(X,{variant:"outline",size:"default",onclick:()=>_(S,null),get disabled(){return e(oe)},children:(K,ne)=>{Te();var be=tt("Dismiss");p(K,be)},$$slots:{default:!0}});var ke=Q(X,2);je(ke,{variant:"accent",size:"default",onclick:$,get disabled(){return e(oe)},children:(K,ne)=>{var be=nn(),F=Ce(be);{var U=I=>{Kt(I,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};me(F,I=>{e(oe)&&I(U)})}var B=Q(F,1,!0);ve(()=>ce(B,e(oe)?"Applying...":"Apply changes")),p(K,be)},$$slots:{default:!0}}),h(ae),p(W,Y)},J=W=>{var Y=fn(),ae=Ce(Y);Ie(ae,21,()=>e(d)(),Ne,(I,ue,ie)=>{var ge=ln(),we=Ce(ge);{var he=Z=>{var se=on();p(Z,se)};me(we,Z=>{ie>0&&Z(he)})}var Re=Q(we),re=b(Re,!0);h(Re),ve(Z=>{it(Re,1,Z,"svelte-1dc9loe"),ce(re,e(ue))},[()=>ua(ie===e(d)().length-1?"bc-current":"bc-segment")]),p(I,ge)}),h(ae);var X=Q(ae,2),ke=b(X);{var K=I=>{var ue=un();p(I,ue)},ne=I=>{var ue=dn(),ie=b(ue,!0);h(ue),ve(()=>ce(ie,Ve.error)),p(I,ue)};me(ke,I=>{Ve.saving?I(K):Ve.error&&I(ne,1)})}var be=Q(ke,2);{var F=I=>{je(I,{variant:"outline",size:"sm",class:"refresh-btn",onclick:N,get disabled(){return e(O)},children:(ue,ie)=>{var ge=cn(),we=Ce(ge);{var he=re=>{Kt(re,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};me(we,re=>{e(O)&&re(he)})}var Re=Q(we,1,!0);ve(()=>ce(Re,e(O)?"Refreshing...":"Refresh from source")),p(ue,ge)},$$slots:{default:!0}})};me(be,I=>{e(c)&&It.user?.role==="admin"&&I(F)})}var U=Q(be,2);{var B=I=>{je(I,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(ue,ie)=>{Te();var ge=tt();ve(()=>ce(ge,`Open in ${e(s).name??""} →`)),p(ue,ge)},$$slots:{default:!0}})};me(U,I=>{e(s)&&I(B)})}h(X),p(W,Y)};me(L,W=>{e(_e)?W(j):W(J,!1)})}h(n);var D=Q(n,2);{var M=W=>{var Y=vn();p(W,Y)};me(D,W=>{e(S)&&!e(_e)&&W(M)})}var ee=Q(D,2);{var z=W=>{rn(W,{get properties(){return e(E)},get refreshResult(){return e(S)},get bodyContent(){return e(g)}})},le=W=>{var Y=hn(),ae=b(Y);Er(ae,{get properties(){return e(E)},editable:!0,onedit:r,onremove:l,onadd:y,ontypechange:P});var X=Q(ae,2);{var ke=ne=>{Vr(ne,{get content(){return e(g)},onchange:a,onsave:()=>Ve.flush(),oncellselect:(be,F)=>{fe?.awareness.setLocalStateField("cell",{row:be,col:F})},get remoteCursors(){return e(de)}})},K=ne=>{{let be=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);Pr(ne,{get content(){return e(g)},readonly:!1,onchange:a,onsave:()=>Ve.flush(),onwikilinkclick:H,get resetKey(){return e(m)},get cursorDocName(){return e(be)}})}};me(X,ne=>{e(o)?ne(ke):ne(K,!1)})}h(Y),p(W,Y)};me(ee,W=>{e(_e)?W(z):W(le,!1)})}ve(()=>i=it(n,1,"editor-bar svelte-1dc9loe",null,i,{"editor-bar-diff":e(_e)})),p(u,R)},$$slots:{default:!0}});var v=Q(f,2);{let u=De(()=>!!e(A));Ue(v,()=>Ta,(T,R)=>{R(T,{get open(){return e(u)},onOpenChange:V=>{V||_(A,null)},children:(V,n)=>{var i=Xe(),L=Ce(i);Ue(L,()=>Ca,(j,J)=>{J(j,{children:(D,M)=>{var ee=gn(),z=Ce(ee);Ue(z,()=>Sa,(W,Y)=>{Y(W,{children:(ae,X)=>{var ke=_n(),K=Ce(ke);Ue(K,()=>Aa,(be,F)=>{F(be,{children:(U,B)=>{Te();var I=tt("Refresh failed");p(U,I)},$$slots:{default:!0}})});var ne=Q(K,2);Ue(ne,()=>Pa,(be,F)=>{F(be,{children:(U,B)=>{Te();var I=tt();ve(()=>ce(I,e(A))),p(U,I)},$$slots:{default:!0}})}),p(ae,ke)},$$slots:{default:!0}})});var le=Q(z,2);Ue(le,()=>Ra,(W,Y)=>{Y(W,{children:(ae,X)=>{var ke=Xe(),K=Ce(ke);Ue(K,()=>Da,(ne,be)=>{be(ne,{children:(F,U)=>{Te();var B=tt("OK");p(F,B)},$$slots:{default:!0}})}),p(ae,ke)},$$slots:{default:!0}})}),p(D,ee)},$$slots:{default:!0}})}),p(V,i)},$$slots:{default:!0}})})}p(G,w),Qe()}export{Mn as component,Ln as universal};
@@ -1,4 +1,4 @@
1
- import{f as dt,s as J,w as ut}from"../chunks/EDLlAC9C.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/0x0awhVy.js";import{q as $,a as tt,R as mt,w as H,x as T,g as h,z as F,A as I,v as et,F as Q,D as S,f as vt,T as ht}from"../chunks/8FUQuwgM.js";import{b as X,i as O}from"../chunks/CbJfRYJV.js";import{A as yt}from"../chunks/DPUtMAph.js";import{g as pt}from"../chunks/BeqErRmy.js";import{n as Y}from"../chunks/Co733CqR.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}},Ht=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=Q(!0),m=Q(null),p=[],b=[],w=[],d={},y=[],v=null,_=null,A=0;function j(){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 p)r.remove();p=[];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 y)document.body.classList.remove(r);y=[],c&&(c.innerHTML="")}async function q(){const e=++A;S(f,!0),S(m,null),j();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),p.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),p.push(n)}v=document.createElement("style"),v.textContent=`
1
+ import{f as dt,d as J,w as ut}from"../chunks/VEgGCdut.js";import{a as k,s as Z,b as M,c as ft}from"../chunks/DJumtN6X.js";import{p as $,K as tt,T as mt,c as H,v as T,g as h,r as I,t as O,b as et,y as Q,s as S,u as vt,V as ht}from"../chunks/Cd2AAfar.js";import{b as X,i as j}from"../chunks/BBKhbmnU.js";import{A as yt}from"../chunks/DZ7uBozP.js";import{g as pt}from"../chunks/CGoS23Dn.js";import{n as Y}from"../chunks/CkwRiDze.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}},Ht=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=Q(!0),m=Q(null),p=[],b=[],w=[],d={},y=[],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 p)r.remove();p=[];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 y)document.body.classList.remove(r);y=[],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),p.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),p.push(n)}v=document.createElement("style"),v.textContent=`
2
2
  body.sg-chrome-active { height: auto !important; }
3
3
  body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
4
- `,document.head.appendChild(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),y.push(t)));const ct=L.querySelectorAll("script"),R=[],K=[];for(const t of ct){if(t.src){const n=t.getAttribute("src")||"";if(n.includes("chrome.js"))continue;let a=n;a&&!a.startsWith("http")&&!a.startsWith("/")&&(a=`${o.appMountPath}/${a}`),R.push(a)}else t.textContent&&K.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(),pt(`/${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 R){if(e!==A)return;await ot(t+lt)}for(const t of K){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&&q(),x=e}),mt(()=>(q(),j));var C=_t();let B;var V=H(C);X(V,e=>l=e,()=>l);var W=T(V,2);{var nt=e=>{var i=gt();k(e,i)};O(W,e=>{h(f)&&e(nt)})}var D=T(W,2);{var rt=e=>{var i=wt(),r=H(i,!0);F(i),I(()=>Z(r,h(m))),k(e,i)};O(D,e=>{h(m)&&e(rt)})}var U=T(D,2);let z;X(U,e=>c=e,()=>c),F(C),I(()=>{B=J(C,1,"editor-frame svelte-1fltv0h",null,B,{loading:h(f)}),z=J(U,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 Ft(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()}),yt(g,{showSidebar:!1,children:(c,f)=>{var m=ft(),p=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 y=St(),v=H(y);F(y),I(()=>Z(v,`No app editor available for entity type "${o.data.type??""}"`)),k(d,y)};O(p,d=>{h(l)?d(b):d(w,!1)})}k(c,m)},$$slots:{default:!0}}),et()}export{Ft as component,Ht as universal};
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),y.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(),pt(`/${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=H(C);X(B,e=>l=e,()=>l);var W=T(B,2);{var nt=e=>{var i=gt();k(e,i)};j(W,e=>{h(f)&&e(nt)})}var U=T(W,2);{var rt=e=>{var i=wt(),r=H(i,!0);I(i),O(()=>Z(r,h(m))),k(e,i)};j(U,e=>{h(m)&&e(rt)})}var D=T(U,2);let z;X(D,e=>c=e,()=>c),I(C),O(()=>{q=J(C,1,"editor-frame svelte-1fltv0h",null,q,{loading:h(f)}),z=J(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 It(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()}),yt(g,{showSidebar:!1,children:(c,f)=>{var m=ft(),p=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 y=St(),v=H(y);I(y),O(()=>Z(v,`No app editor available for entity type "${o.data.type??""}"`)),k(d,y)};j(p,d=>{h(l)?d(b):d(w,!1)})}k(c,m)},$$slots:{default:!0}}),et()}export{It as component,Ht as universal};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BXo5rIdU.js","../chunks/SzjCv9g2.js","../chunks/Cd2AAfar.js","../chunks/BBKhbmnU.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/DJumtN6X.js";import{p as Bt,w as $e,K as St,g as h,V as nt,T 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/Cd2AAfar.js";import{o as Mt,A as tn,f as en}from"../chunks/DZ7uBozP.js";import{V as nn}from"../chunks/C5Jg9_3k.js";import{_ as rn}from"../chunks/SzjCv9g2.js";import{e as ce,i as fe,n as se}from"../chunks/CkwRiDze.js";import{d as on,i as Pt,a as ke,w as Wt}from"../chunks/VEgGCdut.js";import{p as mt,b as Ee,l as Zt,i as Qt}from"../chunks/BBKhbmnU.js";import{g as an}from"../chunks/CGoS23Dn.js";import{B as sn}from"../chunks/BAoPZe8v.js";import{i as Re}from"../chunks/BWbpPmKt.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/BXo5rIdU.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 di(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{di as component};