studiograph 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/_app/immutable/chunks/{DcaJM5Zr.js → Bt3IOBgW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{C7axjIkO.js → BxXlKFyx.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CzGIS76D.js → C_8lGlxx.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CIMAAqkt.js → DCGmlzGM.js} +1 -1
- package/dist/web/_app/immutable/chunks/{RaFtQ6Nr.js → DEzvDbcy.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CgeRpKxa.js → hnbuI7Nz.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.MspBiFtM.js → app.DJBDJcSh.js} +2 -2
- package/dist/web/_app/immutable/entry/start.3Q9lJ-bM.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.Ce8kXvq7.js → 0.CAcmB7D0.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.CL4Veu7q.js → 1.CTI57h4T.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.Z0cN7pjd.js → 2.DLksu1-5.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.CHRkLKHQ.js → 3.B5xlkeVI.js} +3 -3
- package/dist/web/_app/immutable/nodes/{4.0GYr-_DC.js → 4.b6iwPmuI.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.B1USZ_5d.js → 5.BHhKeE_h.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.G72u2W15.js → 6.B3IKA9tf.js} +1 -1
- package/dist/web/_app/immutable/nodes/7.Eq6DAyo_.js +2 -0
- package/dist/web/_app/immutable/nodes/{8.f-lZ1U9h.js → 8.rJtfXi9L.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/_app/immutable/entry/start.BMnf5AKO.js +0 -1
- package/dist/web/_app/immutable/nodes/7.C29v8Chj.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js","../chunks/BVBRzmeQ.js","../chunks/Cs5oz2oJ.js","../chunks/B1y7Wy5O.js","../chunks/D2aTbzFm.js","../chunks/BXuvR8Ks.js","../chunks/0oxpWEgM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as jt}from"../chunks/PPVm8Dsz.js";import{a as s,f as rt,o as Jt,p as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,q as Ut}from"../chunks/Cs_ROD7H.js";import{y as ht,B as it,G as $,I as nt,A as mt,bq as cn,z as He,br as Pe,L as B,a7 as Rt,j as ct,K as c,m as e,k as Gt,R as Ce,D as Mt,T as m,aF as Q,f as g,u as Xe,bs as De,bp as ln,J as un,$ as dn}from"../chunks/BeBar3OL.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/DP09rP34.js";import{h as hn}from"../chunks/O0fx2ss6.js";import{g as Ee}from"../chunks/CzGIS76D.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/RaFtQ6Nr.js";import{p as k,i as L,b as Je,s as kt,r as Ct}from"../chunks/xBRYfpah.js";import{c as Nt}from"../chunks/DCGSm8Hl.js";import"../chunks/CQCkXCml.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Jt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,G=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Gt(()=>e(G));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(G)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Gt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(G)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(G)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(G)?.style.setProperty("--swipe-amount-x","0px"),e(G)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(G)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(G)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??Q),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,J)=>{J(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var J=y(),At=g(J);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,J)},ft=Y=>{var J=y(),At=g(J);U(At,()=>t.successIcon??Q),s(Y,J)},Pt=Y=>{var J=y(),At=g(J);U(At,()=>t.errorIcon??Q),s(Y,J)},oe=Y=>{var J=y(),At=g(J);U(At,()=>t.warningIcon??Q),s(Y,J)},Te=Y=>{var J=y(),At=g(J);U(At,()=>t.infoIcon??Q),s(Y,J)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var X=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(X,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Je(f,h=>c(G,h),()=>e(G)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<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 Gn(n){var t=Zn();s(n,t)}var Xn=Ut('<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 Jn(n){var t=Xn();s(n,t)}var Qn=Ut('<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 pn(n){var t=Qn();s(n,t)}var $n=Ut('<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 to(n){var t=$n();s(n,t)}var eo=Ut('<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 no(n){var t=eo();s(n,t)}const oo=3,Qe="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Qe;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Qe),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),G=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(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 fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Gt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Gt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??Q),s(d,D)},S=d=>{Gn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,X)},be=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??Q),s(d,D)},S=d=>{Jn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,X)},xe=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??Q),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,X)},h=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??Q),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,X)},w=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??Q),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,X)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return G()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Je(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Xe(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Gt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Jt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Xt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Xt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Xt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Xt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Xt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Xt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
|
|
2
|
+
import{_ as jt}from"../chunks/PPVm8Dsz.js";import{a as s,f as rt,o as Jt,p as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,q as Ut}from"../chunks/Cs_ROD7H.js";import{y as ht,B as it,G as $,I as nt,A as mt,bq as cn,z as He,br as Pe,L as B,a7 as Rt,j as ct,K as c,m as e,k as Gt,R as Ce,D as Mt,T as m,aF as Q,f as g,u as Xe,bs as De,bp as ln,J as un,$ as dn}from"../chunks/BeBar3OL.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/DP09rP34.js";import{h as hn}from"../chunks/O0fx2ss6.js";import{g as Ee}from"../chunks/C_8lGlxx.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/DEzvDbcy.js";import{p as k,i as L,b as Je,s as kt,r as Ct}from"../chunks/xBRYfpah.js";import{c as Nt}from"../chunks/DCGSm8Hl.js";import"../chunks/CQCkXCml.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Jt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,G=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Gt(()=>e(G));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(G)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Gt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(G)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(G)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(G)?.style.setProperty("--swipe-amount-x","0px"),e(G)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(G)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(G)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??Q),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,J)=>{J(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var J=y(),At=g(J);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,J)},ft=Y=>{var J=y(),At=g(J);U(At,()=>t.successIcon??Q),s(Y,J)},Pt=Y=>{var J=y(),At=g(J);U(At,()=>t.errorIcon??Q),s(Y,J)},oe=Y=>{var J=y(),At=g(J);U(At,()=>t.warningIcon??Q),s(Y,J)},Te=Y=>{var J=y(),At=g(J);U(At,()=>t.infoIcon??Q),s(Y,J)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var X=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(X,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Je(f,h=>c(G,h),()=>e(G)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<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 Gn(n){var t=Zn();s(n,t)}var Xn=Ut('<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 Jn(n){var t=Xn();s(n,t)}var Qn=Ut('<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 pn(n){var t=Qn();s(n,t)}var $n=Ut('<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 to(n){var t=$n();s(n,t)}var eo=Ut('<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 no(n){var t=eo();s(n,t)}const oo=3,Qe="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Qe;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Qe),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),G=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(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 fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Gt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Gt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??Q),s(d,D)},S=d=>{Gn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,X)},be=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??Q),s(d,D)},S=d=>{Jn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,X)},xe=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??Q),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,X)},h=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??Q),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,X)},w=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??Q),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,X)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return G()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Je(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Xe(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Gt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Jt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Xt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Xt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Xt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Xt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Xt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Xt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
|
|
3
3
|
`)}function Bo(n={}){return ko(n).replace(`
|
|
4
4
|
`," ")}const Po={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%)"};Bo(Po);const Mo=typeof window<"u"?window:void 0;function Co(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Do{#e;#t;constructor(t={}){const{window:o=Mo,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Co(this.#e):null}}new Do;const ke=F("mode-watcher-mode"),Be=F("mode-watcher-theme"),Lo=["dark","light","system"];function Ue(n){return typeof n!="string"?!1:Lo.includes(n)}class Oo{#e="system";#t=ue?localStorage:nn;#o=this.#t.getItem(ke.current);#n=Ue(this.#o)?this.#o:this.#e;#r=B(Rt(this.#i()));#i(t=this.#n){return new en(ke.current,t,{serializer:{serialize:o=>o,deserialize:o=>Ue(o)?o:this.#e}})}constructor(){De(()=>Le.pre(()=>ke.current,(t,o)=>{const i=e(this.#r).current;c(this.#r,this.#i(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#r).current}set current(t){e(this.#r).current=t}}class zo{#e=void 0;#t=!0;#o=B(Rt(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kn("prefers-color-scheme: light"):{current:!1};query(){ue&&c(this.#o,this.#n.current?"light":"dark",!0)}tracking(t){this.#t=t}constructor(){De(()=>{Xe(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return e(this.#o)}}const Ke=new Oo,No=new zo;class Ro{#e=ue?localStorage:nn;#t=this.#e.getItem(Be.current);#o=this.#t===null||this.#t===void 0?"":this.#t;#n=B(Rt(this.#r()));#r(t=this.#o){return new en(Be.current,t,{serializer:{serialize:o=>typeof o!="string"?"":o,deserialize:o=>o}})}constructor(){De(()=>Le.pre(()=>Be.current,(t,o)=>{const i=e(this.#n).current;c(this.#n,this.#r(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#n).current}set current(t){e(this.#n).current=t}}new Ro;let Ye,Ze,Ge=!1,Zt=null;function Ho(){return Zt||(Zt=document.createElement("style"),Zt.appendChild(document.createTextNode(`* {
|
|
5
5
|
-webkit-transition: none !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,f as h,s as a}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as g,f as l,I as v,A as d,B as e,G as o,D as _}from"../chunks/BeBar3OL.js";import{i as x}from"../chunks/DiP47fAp.js";import{s as $,p}from"../chunks/
|
|
1
|
+
import{a as u,f as h,s as a}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as g,f as l,I as v,A as d,B as e,G as o,D as _}from"../chunks/BeBar3OL.js";import{i as x}from"../chunks/DiP47fAp.js";import{s as $,p}from"../chunks/C_8lGlxx.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function G(i,f){g(f,!1),x();var t=b(),r=l(t),n=e(r,!0);o(r);var s=_(r,2),c=e(s,!0);o(s),v(()=>{a(n,m.status),a(c,m.error?.message)}),u(i,t),d()}export{G as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,s as $,f as d}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as b,z as C,A,B as t,D as l,F as S,G as e,I as V}from"../chunks/BeBar3OL.js";import{i as m}from"../chunks/xBRYfpah.js";import{i as k}from"../chunks/DiP47fAp.js";import{A as P}from"../chunks/
|
|
1
|
+
import{a as v,s as $,f as d}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as b,z as C,A,B as t,D as l,F as S,G as e,I as V}from"../chunks/BeBar3OL.js";import{i as m}from"../chunks/xBRYfpah.js";import{i as k}from"../chunks/DiP47fAp.js";import{A as P}from"../chunks/Bt3IOBgW.js";import{V as z,C as B}from"../chunks/hnbuI7Nz.js";import{w as p}from"../chunks/DP09rP34.js";import{n as D}from"../chunks/DEzvDbcy.js";var E=d('<h2 class="svelte-1uha8ag"> </h2>'),F=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function M(c,f){b(f,!1);const h=C("chat");D.showEntity(),k(),P(c,{children:(g,G)=>{var o=F(),s=t(o),i=t(s);z(i,{activeView:"entity"});var n=l(i,2),_=t(n);{var u=a=>{var r=E(),y=t(r);e(r),V(()=>$(y,`Welcome to ${(p.name||"Studiograph")??""}`)),v(a,r)};m(_,a=>{p.nameLoaded&&a(u)})}S(2),e(n),e(s);var w=l(s,2);{var x=a=>{B(a,{})};m(w,a=>{h.open&&a(x)})}e(o),v(g,o)},$$slots:{default:!0}}),A()}export{M as component};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BVBRzmeQ.js","../chunks/Cs5oz2oJ.js","../chunks/B1y7Wy5O.js","../chunks/D2aTbzFm.js","../chunks/BXuvR8Ks.js","../chunks/0oxpWEgM.js","../chunks/BPUy9_sS.js","../chunks/
|
|
2
|
-
import{f as na,r as lt,s as tt,w as yt,h as At,i as Be,g as ra,a as sa,j as ia}from"../chunks/DP09rP34.js";import{_ as We}from"../chunks/PPVm8Dsz.js";import{j as Dt,g as Ne,e as Je,a as w,c as Le,t as Ye,s as me,f as M}from"../chunks/Cs_ROD7H.js";import{M as oa,k as Ut,y as at,L as Ae,a7 as Qe,j as Ge,S as la,B as S,D as W,G as y,m as e,K as C,A as nt,f as we,F as qe,I as ye,T as De,bn as qt,aj as ot,z as Vt,R as ca,bo as Wt}from"../chunks/BeBar3OL.js";import{p as ct,i as Ce,b as kt,l as Ze,s as Xe}from"../chunks/xBRYfpah.js";import{e as Me,i as Ue,a as je,n as Pt,r as ua}from"../chunks/RaFtQ6Nr.js";import{c as Ke}from"../chunks/DCGSm8Hl.js";import{g as Rt,i as da}from"../chunks/CzGIS76D.js";import{I as $e,s as et,b as fa,P as va,C as ha,c as Lt,S as pa,T as _a,R as ga,d as ma,e as wt,X as zt,p as Ft,A as ya,f as wa,g as ka,h as ba,i as xa,j as Ea,k as Ca,l as Sa,m as Pa,r as Aa}from"../chunks/DcaJM5Zr.js";import{c as Ra,V as Da,C as Ta}from"../chunks/CgeRpKxa.js";import{b as Ht,B as Ie}from"../chunks/BuOTIbJu.js";import"../chunks/CQCkXCml.js";import{C as Oa}from"../chunks/CIMAAqkt.js";import{g as La}from"../chunks/CqkleIqs.js";function za(U,t,v){oa(()=>{var i=Ut(()=>t(U,v?.())||{});if(i?.destroy)return()=>i.destroy()})}const Fa=async({params:U,fetch:t})=>{const{repo:v,type:i,id:f}=U,R=await na(v,i,f);return{repo:v,type:i,id:f,entity:R}},yr=Object.freeze(Object.defineProperty({__proto__:null,load:Fa},Symbol.toStringTag,{value:"Module"}));var Ma=M('<span class="chip svelte-84vb17"> <!></span>'),Ia=M('<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>'),ja=M('<div class="dropdown svelte-84vb17"></div>'),Na=M('<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 Ka(U,t){at(t,!0);let v=ct(t,"multi",3,!1),i=Ae(""),f=Ae(0),R;const b=De(()=>yt.repos.flatMap(E=>E.entities.map(m=>({id:m.id,title:m.title,entityType:m.entityType,repo:E.name})))),x=De(()=>()=>{const E=e(i).toLowerCase().trim();return E?e(b).filter(m=>m.title.toLowerCase().includes(E)||m.id.toLowerCase().includes(E)).slice(0,20):e(b).slice(0,20)}),Y=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let d=Ae(Qe(Y));Ge(()=>{la().then(()=>R?.focus())});function J(E){v()?(e(d).includes(E)||C(d,[...e(d),E],!0),C(i,""),C(f,0),R?.focus()):t.onselect(E)}function H(E){C(d,e(d).filter(m=>m!==E),!0)}function I(){e(d).length===Y.length&&e(d).every((m,a)=>m===Y[a])?t.oncancel():t.onselect(e(d))}function G(E){const m=e(x)();E.key==="ArrowDown"?(E.preventDefault(),C(f,Math.min(e(f)+1,m.length-1),!0)):E.key==="ArrowUp"?(E.preventDefault(),C(f,Math.max(e(f)-1,0),!0)):E.key==="Enter"?(E.preventDefault(),m.length>0?J(m[e(f)].id):v()&&I()):E.key==="Escape"?v()&&e(d).length>0?I():t.oncancel():E.key==="Backspace"&&!e(i)&&v()&&e(d).length>0&&C(d,e(d).slice(0,-1),!0)}var ve=Na(),q=S(ve),ke=S(q);{var xe=E=>{var m=Le(),a=we(m);Me(a,17,()=>e(d),Ue,(n,l)=>{var _=Ma(),k=S(_),j=W(k);Ie(j,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>H(e(l)),children:(ge,fe)=>{qe();var p=Ye("×");w(ge,p)},$$slots:{default:!0}}),y(_),ye(()=>me(k,`${e(l)??""} `)),w(n,_)}),w(E,m)};Ce(ke,E=>{v()&&E(xe)})}var F=W(ke,2);lt(F),kt(F,E=>R=E,()=>R),y(q);var ce=W(q,2);{var Ee=E=>{var m=ja();Me(m,21,()=>e(x)(),Ue,(a,n,l)=>{var _=Ia();let k;var j=S(_),ge=S(j,!0);y(j);var fe=W(j,2),p=S(fe),c=S(p,!0);y(p);var o=W(p,2),h=S(o,!0);y(o),y(fe),y(_),ye(()=>{k=tt(_,1,"dropdown-item svelte-84vb17",null,k,{highlighted:l===e(f)}),me(ge,e(n).title),me(c,e(n).entityType),me(h,e(n).repo)}),Ne("mousedown",_,g=>{g.preventDefault(),J(e(n).id)}),Je("mouseenter",_,()=>C(f,l,!0)),w(a,_)}),y(m),w(E,m)},_e=De(()=>e(x)().length>0);Ce(ce,E=>{e(_e)&&E(Ee)})}y(ve),Ne("keydown",F,G),Je("blur",F,()=>{setTimeout(()=>{v()&&e(d).length>0?I():v()||t.oncancel()},150)}),Ht(F,()=>e(i),E=>C(i,E)),w(U,ve),nt()}Dt(["keydown","mousedown"]);function ht(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];$e(U,Xe({name:"type"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function pt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];$e(U,Xe({name:"calendar"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function _t(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];$e(U,Xe({name:"circle-dot"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function gt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];$e(U,Xe({name:"link"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function Bt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];$e(U,Xe({name:"tag"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function Ua(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"m15 18-6-6 6-6"}]];$e(U,Xe({name:"chevron-left"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}var qa=M('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Va=M('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Wa=M('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Ha=M("<!> <!> <!>",1),Ba=M("<!> <!>",1),Ya=M('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Ja=M('<span class="ip-status-dot svelte-x7sio8"></span> ',1),Qa=M('<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>'),Ga=M('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Za=M('<div class="ip-cal-week svelte-x7sio8"></div>'),Xa=M('<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>'),$a=M('<span class="ip-badge svelte-x7sio8"> </span>'),en=M('<div class="ip-wikilink-group svelte-x7sio8"></div>'),tn=M('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),an=M('<span class="ip-date-text svelte-x7sio8"> </span>'),nn=M('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),rn=M('<span class="ip-text-value svelte-x7sio8"> </span>'),sn=M('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),on=M('<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>'),ln=M("<!> <span>Add property</span>",1),cn=M('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function un(U,t){at(t,!0);let v=ct(t,"editable",3,!1);const i=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],f=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let R=Ae(null),b=Ae(!1),x=Ae(""),Y=Ae(void 0);function d(r){switch(r.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 J(r){for(const s of yt.repos){const z=s.entities.find(O=>O.id===r);if(z){Rt(`/${s.name}/${z.entityType}/${z.id}`);return}}}function H(r){return typeof r.value=="string"?r.value:r.value[0]}function I(r){return/^https?:\/\//.test(r)}function G(r){try{return new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return r}}let ve=Ae(Qe(new Date().getFullYear())),q=Ae(Qe(new Date().getMonth()));const ke=["Su","Mo","Tu","We","Th","Fr","Sa"],xe=["January","February","March","April","May","June","July","August","September","October","November","December"];function F(r,s){const z=new Date(r,s,1).getDay(),O=new Date(r,s+1,0).getDate(),$=new Date(r,s,0).getDate(),P=[];let D=[];for(let ae=z-1;ae>=0;ae--){const L=$-ae,ne=s===0?11:s-1,V=s===0?r-1:r;D.push({day:L,month:ne,year:V,outside:!0})}for(let ae=1;ae<=O;ae++)D.push({day:ae,month:s,year:r,outside:!1}),D.length===7&&(P.push(D),D=[]);if(D.length>0){const ae=s===11?0:s+1,L=s===11?r+1:r;let ne=1;for(;D.length<7;)D.push({day:ne++,month:ae,year:L,outside:!0});P.push(D)}return P}function ce(r){const s=new Date;return r.day===s.getDate()&&r.month===s.getMonth()&&r.year===s.getFullYear()}function Ee(r,s){const z=s.slice(0,10).split("-");return r.year===+z[0]&&r.month===+z[1]-1&&r.day===+z[2]}function _e(){e(q)===0?(C(q,11),ot(ve,-1)):ot(q,-1)}function E(){e(q)===11?(C(q,0),ot(ve)):ot(q)}function m(r){try{const s=r.slice(0,10).split("-");C(ve,+s[0]),C(q,+s[1]-1)}catch{const s=new Date;C(ve,s.getFullYear(),!0),C(q,s.getMonth(),!0)}}function a(r){requestAnimationFrame(()=>{r.focus(),r.select()})}function n(r){!v()||r.type==="badge"||(r.type==="date"&&m(H(r)),C(R,r.key,!0))}function l(r,s){t.onedit&&t.onedit(r,s),C(R,null)}function _(r,s){const z=`${s.year}-${String(s.month+1).padStart(2,"0")}-${String(s.day).padStart(2,"0")}`;t.onedit&&t.onedit(r,z),C(R,null)}function k(r,s){t.ontypechange&&t.ontypechange(r,s)}function j(r){C(R,null),t.onremove&&t.onremove(r)}function ge(){C(b,!0),C(x,""),requestAnimationFrame(()=>e(Y)?.focus())}function fe(){const r=e(x).trim();r&&t.onadd&&t.onadd(r,""),C(b,!1),C(x,"")}function p(){C(b,!1),C(x,"")}function c(r){r.key==="Enter"?(r.preventDefault(),fe()):r.key==="Escape"&&p()}var o=cn();Je("click",qt,()=>{C(R,null)});var h=S(o);Me(h,17,()=>t.properties,r=>r.key,(r,s)=>{const z=De(()=>e(R)===e(s).key);var O=sn();let $;var P=S(O),D=S(P);{var ae=te=>{var K=Le(),Q=we(K);Ke(Q,()=>ga,(Z,ue)=>{ue(Z,{children:(he,Se)=>{var se=Ba(),ie=we(se);Ke(ie,()=>fa,(oe,X)=>{X(oe,{class:"ip-icon-trigger",children:(de,pe)=>{var be=Le(),Te=we(be);{var Oe=ze=>{pt(ze,{size:14})},He=ze=>{_t(ze,{size:14})},rt=ze=>{gt(ze,{size:14})},ut=ze=>{ht(ze,{size:14})};Ce(Te,ze=>{e(s).type==="date"?ze(Oe):e(s).type==="status"?ze(He,1):e(s).type==="wikilink"?ze(rt,2):ze(ut,!1)})}w(de,be)},$$slots:{default:!0}})});var Re=W(ie,2);Ke(Re,()=>va,(oe,X)=>{X(oe,{children:(de,pe)=>{var be=Le(),Te=we(be);Ke(Te,()=>ha,(Oe,He)=>{He(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(rt,ut)=>{var ze=Ha(),bt=we(ze);Me(bt,17,()=>i,Ue,(it,Ve)=>{var dt=Le(),Tt=we(dt);Ke(Tt,()=>Lt,(ft,vt)=>{vt(ft,{class:"ip-menu-item",onSelect:()=>k(e(s).key,e(Ve).type),children:(xt,rr)=>{var Ot=Va(),Et=we(Ot),Jt=S(Et);{var Qt=Fe=>{ht(Fe,{size:13})},Gt=Fe=>{pt(Fe,{size:13})},Zt=Fe=>{_t(Fe,{size:13})},Xt=Fe=>{gt(Fe,{size:13})};Ce(Jt,Fe=>{e(Ve).type==="text"?Fe(Qt):e(Ve).type==="date"?Fe(Gt,1):e(Ve).type==="status"?Fe(Zt,2):e(Ve).type==="wikilink"&&Fe(Xt,3)})}y(Et);var Ct=W(Et,2),$t=S(Ct,!0);y(Ct);var ea=W(Ct,2);{var ta=Fe=>{var St=qa(),aa=S(St);Oa(aa,{size:12}),y(St),w(Fe,St)};Ce(ea,Fe=>{e(s).type===e(Ve).type&&Fe(ta)})}ye(()=>me($t,e(Ve).label)),w(xt,Ot)},$$slots:{default:!0}})}),w(it,dt)});var st=W(bt,2);Ke(st,()=>pa,(it,Ve)=>{Ve(it,{class:"ip-menu-sep"})});var Yt=W(st,2);Ke(Yt,()=>Lt,(it,Ve)=>{Ve(it,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>j(e(s).key),children:(dt,Tt)=>{var ft=Wa(),vt=we(ft),xt=S(vt);_a(xt,{size:13}),y(vt),qe(2),w(dt,ft)},$$slots:{default:!0}})}),w(rt,ze)},$$slots:{default:!0}})}),w(de,be)},$$slots:{default:!0}})}),w(he,se)},$$slots:{default:!0}})}),w(te,K)},L=te=>{var K=Le(),Q=we(K);{var Z=ie=>{pt(ie,{size:14})},ue=ie=>{_t(ie,{size:14})},he=ie=>{gt(ie,{size:14})},Se=ie=>{Bt(ie,{size:14})},se=ie=>{ht(ie,{size:14})};Ce(Q,ie=>{e(s).type==="date"?ie(Z):e(s).type==="status"?ie(ue,1):e(s).type==="wikilink"?ie(he,2):e(s).type==="badge"?ie(Se,3):ie(se,!1)})}w(te,K)};Ce(D,te=>{v()&&e(s).type!=="badge"?te(ae):te(L,!1)})}y(P);var ne=W(P,2),V=S(ne,!0);y(ne);var N=W(ne,2),ee=S(N);{var B=te=>{var K=Ya();lt(K),za(K,Q=>a?.(Q)),ye(Q=>At(K,Q),[()=>H(e(s))]),Je("blur",K,Q=>{const Z=Q.currentTarget.value;Z!==H(e(s))&&t.onedit?.(e(s).key,Z),C(R,null)}),Ne("keydown",K,Q=>{Q.key==="Enter"?Q.currentTarget.blur():Q.key==="Escape"&&(Q.currentTarget.value=H(e(s)),C(R,null))}),w(te,K)},re=te=>{var K=Qa(),Q=S(K),Z=S(Q);let ue;var he=W(Z,2),Se=S(he,!0);y(he),y(Q);var se=W(Q,2);Me(se,21,()=>f,Ue,(ie,Re)=>{{let oe=De(()=>H(e(s))===e(Re)?"selected":"");Ie(ie,{variant:"ghost",get class(){return`ip-status-option ${e(oe)??""}`},onclick:()=>l(e(s).key,e(Re)),children:(X,de)=>{var pe=Ja(),be=we(pe);let Te;var Oe=W(be);ye(He=>{Te=Be(be,"",Te,He),me(Oe,` ${e(Re)??""}`)},[()=>({background:d(e(Re))})]),w(X,pe)},$$slots:{default:!0}})}}),y(se),y(K),ye((ie,Re)=>{ue=Be(Z,"",ue,ie),me(Se,Re)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),Ne("click",K,ie=>ie.stopPropagation()),w(te,K)},T=te=>{var K=Xa(),Q=S(K),Z=S(Q,!0);y(Q);var ue=W(Q,2),he=S(ue),Se=S(he);Ie(Se,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:_e,children:(de,pe)=>{Ua(de,{size:14})},$$slots:{default:!0}});var se=W(Se,2),ie=S(se);y(se);var Re=W(se,2);Ie(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:E,children:(de,pe)=>{ma(de,{size:14})},$$slots:{default:!0}}),y(he);var oe=W(he,2);Me(oe,21,()=>ke,Ue,(de,pe)=>{var be=Ga(),Te=S(be,!0);y(be),ye(()=>me(Te,e(pe))),w(de,be)}),y(oe);var X=W(oe,2);Me(X,17,()=>F(e(ve),e(q)),Ue,(de,pe)=>{var be=Za();Me(be,21,()=>e(pe),Ue,(Te,Oe)=>{{let He=De(()=>e(Oe).outside?"outside":""),rt=De(()=>ce(e(Oe))?"today":""),ut=De(()=>Ee(e(Oe),H(e(s)))?"selected":"");Ie(Te,{variant:"ghost",get class(){return`ip-cal-day ${e(He)??""} ${e(rt)??""} ${e(ut)??""}`},onclick:()=>_(e(s).key,e(Oe)),children:(ze,bt)=>{qe();var st=Ye();ye(()=>me(st,e(Oe).day)),w(ze,st)},$$slots:{default:!0}})}}),y(be),w(de,be)}),y(ue),y(K),ye(de=>{me(Z,de),me(ie,`${xe[e(q)]??""} ${e(ve)??""}`)},[()=>G(H(e(s)))]),Ne("click",K,de=>de.stopPropagation()),w(te,K)},le=te=>{{let K=De(()=>Array.isArray(e(s).value));Ka(te,{get value(){return e(s).value},get multi(){return e(K)},onselect:Q=>{t.onedit?.(e(s).key,Q),C(R,null)},oncancel:()=>{C(R,null)}})}},Pe=te=>{var K=Le(),Q=we(K);{var Z=oe=>{var X=$a(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>H(e(s))]),w(oe,X)},ue=oe=>{var X=en();Me(X,21,()=>Array.isArray(e(s).value)?e(s).value:[e(s).value],Ue,(de,pe)=>{Ie(de,{variant:"ghost",class:"ip-wikilink-chip",onclick:be=>{be.stopPropagation(),J(e(pe))},children:(be,Te)=>{qe();var Oe=Ye();ye(()=>me(Oe,e(pe))),w(be,Oe)},$$slots:{default:!0}})}),y(X),w(oe,X)},he=oe=>{var X=tn(),de=S(X);let pe;var be=W(de,2),Te=S(be,!0);y(be),y(X),ye((Oe,He)=>{pe=Be(de,"",pe,Oe),me(Te,He)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),w(oe,X)},Se=oe=>{var X=an(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>G(H(e(s)))]),w(oe,X)},se=oe=>{var X=nn(),de=S(X,!0);y(X),ye((pe,be)=>{ra(X,"href",pe),me(de,be)},[()=>H(e(s)),()=>H(e(s))]),Ne("click",X,pe=>pe.stopPropagation()),w(oe,X)},ie=De(()=>I(H(e(s)))),Re=oe=>{var X=rn(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>H(e(s))]),w(oe,X)};Ce(Q,oe=>{e(s).type==="badge"?oe(Z):e(s).type==="wikilink"?oe(ue,1):e(s).type==="status"?oe(he,2):e(s).type==="date"?oe(Se,3):e(ie)?oe(se,4):oe(Re,!1)})}w(te,K)};Ce(ee,te=>{e(z)&&e(s).type==="text"?te(B):e(z)&&e(s).type==="status"?te(re,1):e(z)&&e(s).type==="date"?te(T,2):e(z)&&e(s).type==="wikilink"?te(le,3):te(Pe,!1)})}y(N),y(O),ye(()=>{$=tt(O,1,"ip-row svelte-x7sio8",null,$,{"ip-focused":e(z)}),me(V,e(s).key)}),Ne("click",P,te=>te.stopPropagation()),Ne("click",N,te=>{te.stopPropagation(),n(e(s))}),w(r,O)});var g=W(h,2);{var u=r=>{var s=on(),z=S(s),O=S(z);wt(O,{size:14}),y(z);var $=W(z,2),P=S($);lt(P),kt(P,D=>C(Y,D),()=>e(Y)),y($),qe(2),y(s),Ne("keydown",P,c),Je("blur",P,p),Ht(P,()=>e(x),D=>C(x,D)),w(r,s)},A=r=>{Ie(r,{variant:"ghost",class:"ip-add-btn",onclick:s=>{s.stopPropagation(),ge()},children:(s,z)=>{var O=ln(),$=we(O);wt($,{size:14}),qe(2),w(s,O)},$$slots:{default:!0}})};Ce(g,r=>{e(b)?r(u):v()&&r(A,1)})}y(o),w(U,o),nt()}Dt(["click","keydown"]);var dn=M('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),fn=M('<div class="cursor-overlay svelte-ok7wy5"></div>'),vn=M('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function hn(U,t){at(t,!0);let v=ct(t,"readonly",3,!0),i=ct(t,"resetKey",3,0);const f=Vt("theme");let R,b=null,x=null,Y=Ae(""),d=Ae(Qe([])),J=null,H=t.content;function I(F,ce){return F.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:ce?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:ce?"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:ce})}async function G(){b&&(b.destroy(),b=null),x&&(x.destroy(),x=null),C(d,[],!0);const{EditorState:F}=await We(async()=>{const{EditorState:o}=await import("../chunks/Cs5oz2oJ.js");return{EditorState:o}},[],import.meta.url),{EditorView:ce,keymap:Ee,ViewPlugin:_e}=await We(async()=>{const{EditorView:o,keymap:h,ViewPlugin:g}=await import("../chunks/BVBRzmeQ.js").then(u=>u.i);return{EditorView:o,keymap:h,ViewPlugin:g}},__vite__mapDeps([0,1]),import.meta.url),{markdown:E}=await We(async()=>{const{markdown:o}=await import("../chunks/B1y7Wy5O.js");return{markdown:o}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:m,HighlightStyle:a}=await We(async()=>{const{syntaxHighlighting:o,HighlightStyle:h}=await import("../chunks/D2aTbzFm.js");return{syntaxHighlighting:o,HighlightStyle:h}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:n}=await We(async()=>{const{tags:o}=await import("../chunks/BXuvR8Ks.js").then(h=>h.i);return{tags:o}},[],import.meta.url),{livePreviewPlugin:l,livePreviewTheme:_}=await We(async()=>{const{livePreviewPlugin:o,livePreviewTheme:h}=await import("../chunks/BPUy9_sS.js");return{livePreviewPlugin:o,livePreviewTheme:h}},__vite__mapDeps([6,0,1,3,4]),import.meta.url),k=f.current==="dark",j=I(ce,k),ge=a.define([{tag:n.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),fe=[E(),j,m(ge),l,_,ce.lineWrapping];v()&&fe.push(F.readOnly.of(!0));let p=!1;if(t.cursorDocName&&!v())try{let ae=function(){if(!b||!O){C(d,[],!0);return}const V=O.awareness,N=O.ytext,ee=N.doc;if(!ee){C(d,[],!0);return}const B=[],re=b.dom.getBoundingClientRect();V.getStates().forEach((T,le)=>{if(le===D)return;const Pe=T.cursor;if(!Pe?.head)return;const{name:te="Anonymous",color:K="#6e6ee8"}=T.user||{};let Q;try{Q=s.createRelativePositionFromJSON(Pe.head)}catch{return}const Z=s.createAbsolutePositionFromRelativePosition(Q,ee);if(!Z||Z.type!==N)return;const ue=b.coordsAtPos(Math.min(Z.index,b.state.doc.length));ue&&B.push({id:le,name:te,color:K,top:ue.top-re.top,left:ue.left-re.left,height:ue.bottom-ue.top})}),C(d,B,!0)},L=function(){J&&cancelAnimationFrame(J),J=requestAnimationFrame(()=>{J=null,ae()})},ne=function({added:V,updated:N,removed:ee}){[...V,...N,...ee].some(re=>re!==D)&&L()};const{createCollabSession:o}=await We(async()=>{const{createCollabSession:V}=await import("../chunks/C7axjIkO.js");return{createCollabSession:V}},__vite__mapDeps([7,8,9,10,11,12,13,14]),import.meta.url),{ySync:h,ySyncFacet:g,YSyncConfig:u,yUndoManagerKeymap:A}=await We(async()=>{const{ySync:V,ySyncFacet:N,YSyncConfig:ee,yUndoManagerKeymap:B}=await import("../chunks/BCB5cYCz.js");return{ySync:V,ySyncFacet:N,YSyncConfig:ee,yUndoManagerKeymap:B}},__vite__mapDeps([15,8,0,1]),import.meta.url),{auth:r}=await We(async()=>{const{auth:V}=await import("../chunks/DP09rP34.js").then(N=>N.v);return{auth:V}},__vite__mapDeps([14,10,12,11]),import.meta.url),s=await We(()=>import("../chunks/CLFba8FK.js").then(V=>V.A),[],import.meta.url),z=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",O=o(t.cursorDocName,{name:r.user?.displayName??"Anonymous",color:z,colorLight:z+"33"}),$=new s.UndoManager(O.ytext),P=new u(O.ytext,O.awareness);fe.push(g.of(P),h,Ee.of(A)),fe.push(_e.define(V=>{function N(){const ee=V.state.selection.main,B=O.ytext,re=s.createRelativePositionFromTypeIndex(B,ee.anchor),T=s.createRelativePositionFromTypeIndex(B,ee.head);O.awareness.setLocalStateField("cursor",{anchor:s.relativePositionToJSON(re),head:s.relativePositionToJSON(T)})}return N(),{update(ee){(ee.selectionSet||ee.docChanged)&&N()}}}));const D=O.ydoc.clientID;O.awareness.on("change",ne),fe.push(_e.define(()=>({update(V){(V.docChanged||V.geometryChanged||V.viewportChanged)&&L()},destroy(){O.awareness.off("change",ne)}}))),x=O,p=!0}catch(o){console.warn("Yjs collab setup failed, falling back to solo editing:",o)}if(t.onchange)if(p){const o=Date.now();fe.push(ce.updateListener.of(h=>{if(h.docChanged&&Date.now()-o>1e3&&h.transactions.some(u=>u.isUserEvent("input")||u.isUserEvent("delete")||u.isUserEvent("move")||u.isUserEvent("undo")||u.isUserEvent("redo"))){const u=h.state.doc.toString();H=u,t.onchange(u)}}))}else fe.push(ce.updateListener.of(o=>{if(o.docChanged){const h=o.state.doc.toString();H=h,t.onchange(h)}}));fe.push(ce.domEventHandlers({click(o){const h=o.target;if(t.onwikilinkclick){const u=h.closest(".cm-live-wikilink");if(u){o.preventDefault();const A=u.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return A&&t.onwikilinkclick(A),!0}}const g=h.closest(".cm-live-link");if(g){const u=g.getAttribute("data-href");if(u)return o.preventDefault(),window.open(u,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&fe.push(Ee.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const c=F.create({doc:p?"":t.content,extensions:fe});b=new ce({state:c,parent:R}),H=p?"":t.content,C(Y,t.cursorDocName??"",!0)}ca(()=>{G()}),Ge(()=>{t.cursorDocName&&e(Y)&&t.cursorDocName!==e(Y)&&G()}),Ge(()=>{if(i(),b&&!x&&t.content!==H){H=t.content;const F=R.closest(".document-scroll"),ce=F?.scrollTop??0;b.dispatch({changes:{from:0,to:b.state.doc.length,insert:t.content}}),F&&requestAnimationFrame(()=>{F.scrollTop=ce})}}),Wt(()=>{J&&cancelAnimationFrame(J),x?.destroy(),x=null,b?.destroy()});var ve=vn(),q=S(ve);kt(q,F=>R=F,()=>R);var ke=W(q,2);{var xe=F=>{var ce=fn();Me(ce,21,()=>e(d),Ee=>Ee.id,(Ee,_e)=>{var E=dn(),m=S(E),a=S(m,!0);y(m),y(E),ye(()=>{Be(E,`top: ${e(_e).top??""}px; left: ${e(_e).left??""}px; height: ${e(_e).height??""}px; --cursor-color: ${e(_e).color??""};`),Be(m,`background-color: ${e(_e).color??""};`),me(a,e(_e).name)}),w(Ee,E)}),y(ce),w(F,ce)};Ce(ke,F=>{e(d).length>0&&F(xe)})}y(ve),w(U,ve),nt()}var mt={exports:{}};var pn=mt.exports,Mt;function _n(){return Mt||(Mt=1,(function(U,t){((v,i)=>{U.exports=i()})(pn,function v(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},f,R=!i.document&&!!i.postMessage,b=i.IS_PAPA_WORKER||!1,x={},Y=0,d={};function J(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(n){var l=_e(n);l.chunkSize=parseInt(l.chunkSize),n.step||n.chunk||(l.chunkSize=null),this._handle=new q(l),(this._handle.streamer=this)._config=l}).call(this,a),this.parseChunk=function(n,l){var _=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<_){let j=this._config.newline;j||(k=this._config.quoteChar||'"',j=this._handle.guessLineEndings(n,k)),n=[...n.split(j).slice(_)].join(j)}this.isFirstChunk&&m(this._config.beforeFirstChunk)&&(k=this._config.beforeFirstChunk(n))!==void 0&&(n=k),this.isFirstChunk=!1,this._halted=!1;var _=this._partialLine+n,k=(this._partialLine="",this._handle.parse(_,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=k.meta.cursor,_=(this._finished||(this._partialLine=_.substring(n-this._baseIndex),this._baseIndex=n),k&&k.data&&(this._rowCount+=k.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),b)i.postMessage({results:k,workerId:d.WORKER_ID,finished:_});else if(m(this._config.chunk)&&!l){if(this._config.chunk(k,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=k=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(k.data),this._completeResults.errors=this._completeResults.errors.concat(k.errors),this._completeResults.meta=k.meta),this._completed||!_||!m(this._config.complete)||k&&k.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),_||k&&k.meta.paused||this._nextChunk(),k}this._halted=!0},this._sendError=function(n){m(this._config.error)?this._config.error(n):b&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:n,finished:!1})}}function H(a){var n;(a=a||{}).chunkSize||(a.chunkSize=d.RemoteChunkSize),J.call(this,a),this._nextChunk=R?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(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),R||(n.onload=E(this._chunkLoaded,this),n.onerror=E(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!R),this._config.downloadRequestHeaders){var l,_=this._config.downloadRequestHeaders;for(l in _)n.setRequestHeader(l,_[l])}var k;this._config.chunkSize&&(k=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+k));try{n.send(this._config.downloadRequestBody)}catch(j){this._chunkError(j.message)}R&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(l=>(l=l.getResponseHeader("Content-Range"))!==null?parseInt(l.substring(l.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(l){l=n.statusText||l,this._sendError(new Error(l))}}function I(a){(a=a||{}).chunkSize||(a.chunkSize=d.LocalChunkSize),J.call(this,a);var n,l,_=typeof FileReader<"u";this.stream=function(k){this._input=k,l=k.slice||k.webkitSlice||k.mozSlice,_?((n=new FileReader).onload=E(this._chunkLoaded,this),n.onerror=E(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var k=this._input,j=(this._config.chunkSize&&(j=Math.min(this._start+this._config.chunkSize,this._input.size),k=l.call(k,this._start,j)),n.readAsText(k,this._config.encoding));_||this._chunkLoaded({target:{result:j}})},this._chunkLoaded=function(k){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(k.target.result)},this._chunkError=function(){this._sendError(n.error)}}function G(a){var n;J.call(this,a=a||{}),this.stream=function(l){return n=l,this._nextChunk()},this._nextChunk=function(){var l,_;if(!this._finished)return l=this._config.chunkSize,n=l?(_=n.substring(0,l),n.substring(l)):(_=n,""),this._finished=!n,this.parseChunk(_)}}function ve(a){J.call(this,a=a||{});var n=[],l=!0,_=!1;this.pause=function(){J.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){J.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(k){this._input=k,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){_&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):l=!0},this._streamData=E(function(k){try{n.push(typeof k=="string"?k:k.toString(this._config.encoding)),l&&(l=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(j){this._streamError(j)}},this),this._streamError=E(function(k){this._streamCleanUp(),this._sendError(k)},this),this._streamEnd=E(function(){this._streamCleanUp(),_=!0,this._streamData("")},this),this._streamCleanUp=E(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function q(a){var n,l,_,k,j=Math.pow(2,53),ge=-j,fe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,p=/^((\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)))$/,c=this,o=0,h=0,g=!1,u=!1,A=[],r={data:[],errors:[],meta:{}};function s(P){return a.skipEmptyLines==="greedy"?P.join("").trim()==="":P.length===1&&P[0].length===0}function z(){if(r&&_&&($("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),_=!1),a.skipEmptyLines&&(r.data=r.data.filter(function(L){return!s(L)})),O()){let L=function(ne,V){m(a.transformHeader)&&(ne=a.transformHeader(ne,V)),A.push(ne)};if(r)if(Array.isArray(r.data[0])){for(var P=0;O()&&P<r.data.length;P++)r.data[P].forEach(L);r.data.splice(0,1)}else r.data.forEach(L)}function D(L,ne){for(var V=a.header?{}:[],N=0;N<L.length;N++){var ee=N,B=L[N],B=((re,T)=>(le=>(a.dynamicTypingFunction&&a.dynamicTyping[le]===void 0&&(a.dynamicTyping[le]=a.dynamicTypingFunction(le)),(a.dynamicTyping[le]||a.dynamicTyping)===!0))(re)?T==="true"||T==="TRUE"||T!=="false"&&T!=="FALSE"&&((le=>{if(fe.test(le)&&(le=parseFloat(le),ge<le&&le<j))return 1})(T)?parseFloat(T):p.test(T)?new Date(T):T===""?null:T):T)(ee=a.header?N>=A.length?"__parsed_extra":A[N]:ee,B=a.transform?a.transform(B,ee):B);ee==="__parsed_extra"?(V[ee]=V[ee]||[],V[ee].push(B)):V[ee]=B}return a.header&&(N>A.length?$("FieldMismatch","TooManyFields","Too many fields: expected "+A.length+" fields but parsed "+N,h+ne):N<A.length&&$("FieldMismatch","TooFewFields","Too few fields: expected "+A.length+" fields but parsed "+N,h+ne)),V}var ae;r&&(a.header||a.dynamicTyping||a.transform)&&(ae=1,!r.data.length||Array.isArray(r.data[0])?(r.data=r.data.map(D),ae=r.data.length):r.data=D(r.data,0),a.header&&r.meta&&(r.meta.fields=A),h+=ae)}function O(){return a.header&&A.length===0}function $(P,D,ae,L){P={type:P,code:D,message:ae},L!==void 0&&(P.row=L),r.errors.push(P)}m(a.step)&&(k=a.step,a.step=function(P){r=P,O()?z():(z(),r.data.length!==0&&(o+=P.data.length,a.preview&&o>a.preview?l.abort():(r.data=r.data[0],k(r,c))))}),this.parse=function(P,D,ae){var L=a.quoteChar||'"',L=(a.newline||(a.newline=this.guessLineEndings(P,L)),_=!1,a.delimiter?m(a.delimiter)&&(a.delimiter=a.delimiter(P),r.meta.delimiter=a.delimiter):((L=((ne,V,N,ee,B)=>{var re,T,le,Pe;B=B||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var te=0;te<B.length;te++){for(var K,Q=B[te],Z=0,ue=0,he=0,Se=(le=void 0,new xe({comments:ee,delimiter:Q,newline:V,preview:10}).parse(ne)),se=0;se<Se.data.length;se++)N&&s(Se.data[se])?he++:(K=Se.data[se].length,ue+=K,le===void 0?le=K:0<K&&(Z+=Math.abs(K-le),le=K));0<Se.data.length&&(ue/=Se.data.length-he),(T===void 0||Z<=T)&&(Pe===void 0||Pe<ue)&&1.99<ue&&(T=Z,re=Q,Pe=ue)}return{successful:!!(a.delimiter=re),bestDelimiter:re}})(P,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=L.bestDelimiter:(_=!0,a.delimiter=d.DefaultDelimiter),r.meta.delimiter=a.delimiter),_e(a));return a.preview&&a.header&&L.preview++,n=P,l=new xe(L),r=l.parse(n,D,ae),z(),g?{meta:{paused:!0}}:r||{meta:{paused:!1}}},this.paused=function(){return g},this.pause=function(){g=!0,l.abort(),n=m(a.chunk)?"":n.substring(l.getCharIndex())},this.resume=function(){c.streamer._halted?(g=!1,c.streamer.parseChunk(n,!0)):setTimeout(c.resume,3)},this.aborted=function(){return u},this.abort=function(){u=!0,l.abort(),r.meta.aborted=!0,m(a.complete)&&a.complete(r),n=""},this.guessLineEndings=function(ne,L){ne=ne.substring(0,1048576);var L=new RegExp(ke(L)+"([^]*?)"+ke(L),"gm"),ae=(ne=ne.replace(L,"")).split("\r"),L=ne.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BVBRzmeQ.js","../chunks/Cs5oz2oJ.js","../chunks/B1y7Wy5O.js","../chunks/D2aTbzFm.js","../chunks/BXuvR8Ks.js","../chunks/0oxpWEgM.js","../chunks/BPUy9_sS.js","../chunks/BxXlKFyx.js","../chunks/CLFba8FK.js","../chunks/DEzvDbcy.js","../chunks/BeBar3OL.js","../chunks/Cs_ROD7H.js","../chunks/xBRYfpah.js","../chunks/C_8lGlxx.js","../chunks/DP09rP34.js","../chunks/BCB5cYCz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as na,r as lt,s as tt,w as yt,h as At,i as Be,g as ra,a as sa,j as ia}from"../chunks/DP09rP34.js";import{_ as We}from"../chunks/PPVm8Dsz.js";import{j as Dt,g as Ne,e as Je,a as w,c as Le,t as Ye,s as me,f as M}from"../chunks/Cs_ROD7H.js";import{M as oa,k as Ut,y as at,L as Ae,a7 as Qe,j as Ge,S as la,B as S,D as W,G as y,m as e,K as C,A as nt,f as we,F as qe,I as ye,T as De,bn as qt,aj as ot,z as Vt,R as ca,bo as Wt}from"../chunks/BeBar3OL.js";import{p as ct,i as Ce,b as kt,l as Ze,s as Xe}from"../chunks/xBRYfpah.js";import{e as Me,i as Ue,a as je,n as Pt,r as ua}from"../chunks/DEzvDbcy.js";import{c as Ke}from"../chunks/DCGSm8Hl.js";import{g as Rt,i as da}from"../chunks/C_8lGlxx.js";import{I as $e,s as et,b as fa,P as va,C as ha,c as Lt,S as pa,T as _a,R as ga,d as ma,e as wt,X as zt,p as Ft,A as ya,f as wa,g as ka,h as ba,i as xa,j as Ea,k as Ca,l as Sa,m as Pa,r as Aa}from"../chunks/Bt3IOBgW.js";import{c as Ra,V as Da,C as Ta}from"../chunks/hnbuI7Nz.js";import{b as Ht,B as Ie}from"../chunks/BuOTIbJu.js";import"../chunks/CQCkXCml.js";import{C as Oa}from"../chunks/DCGmlzGM.js";import{g as La}from"../chunks/CqkleIqs.js";function za(U,t,v){oa(()=>{var i=Ut(()=>t(U,v?.())||{});if(i?.destroy)return()=>i.destroy()})}const Fa=async({params:U,fetch:t})=>{const{repo:v,type:i,id:f}=U,R=await na(v,i,f);return{repo:v,type:i,id:f,entity:R}},yr=Object.freeze(Object.defineProperty({__proto__:null,load:Fa},Symbol.toStringTag,{value:"Module"}));var Ma=M('<span class="chip svelte-84vb17"> <!></span>'),Ia=M('<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>'),ja=M('<div class="dropdown svelte-84vb17"></div>'),Na=M('<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 Ka(U,t){at(t,!0);let v=ct(t,"multi",3,!1),i=Ae(""),f=Ae(0),R;const b=De(()=>yt.repos.flatMap(E=>E.entities.map(m=>({id:m.id,title:m.title,entityType:m.entityType,repo:E.name})))),x=De(()=>()=>{const E=e(i).toLowerCase().trim();return E?e(b).filter(m=>m.title.toLowerCase().includes(E)||m.id.toLowerCase().includes(E)).slice(0,20):e(b).slice(0,20)}),Y=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let d=Ae(Qe(Y));Ge(()=>{la().then(()=>R?.focus())});function J(E){v()?(e(d).includes(E)||C(d,[...e(d),E],!0),C(i,""),C(f,0),R?.focus()):t.onselect(E)}function H(E){C(d,e(d).filter(m=>m!==E),!0)}function I(){e(d).length===Y.length&&e(d).every((m,a)=>m===Y[a])?t.oncancel():t.onselect(e(d))}function G(E){const m=e(x)();E.key==="ArrowDown"?(E.preventDefault(),C(f,Math.min(e(f)+1,m.length-1),!0)):E.key==="ArrowUp"?(E.preventDefault(),C(f,Math.max(e(f)-1,0),!0)):E.key==="Enter"?(E.preventDefault(),m.length>0?J(m[e(f)].id):v()&&I()):E.key==="Escape"?v()&&e(d).length>0?I():t.oncancel():E.key==="Backspace"&&!e(i)&&v()&&e(d).length>0&&C(d,e(d).slice(0,-1),!0)}var ve=Na(),q=S(ve),ke=S(q);{var xe=E=>{var m=Le(),a=we(m);Me(a,17,()=>e(d),Ue,(n,l)=>{var _=Ma(),k=S(_),j=W(k);Ie(j,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>H(e(l)),children:(ge,fe)=>{qe();var p=Ye("×");w(ge,p)},$$slots:{default:!0}}),y(_),ye(()=>me(k,`${e(l)??""} `)),w(n,_)}),w(E,m)};Ce(ke,E=>{v()&&E(xe)})}var F=W(ke,2);lt(F),kt(F,E=>R=E,()=>R),y(q);var ce=W(q,2);{var Ee=E=>{var m=ja();Me(m,21,()=>e(x)(),Ue,(a,n,l)=>{var _=Ia();let k;var j=S(_),ge=S(j,!0);y(j);var fe=W(j,2),p=S(fe),c=S(p,!0);y(p);var o=W(p,2),h=S(o,!0);y(o),y(fe),y(_),ye(()=>{k=tt(_,1,"dropdown-item svelte-84vb17",null,k,{highlighted:l===e(f)}),me(ge,e(n).title),me(c,e(n).entityType),me(h,e(n).repo)}),Ne("mousedown",_,g=>{g.preventDefault(),J(e(n).id)}),Je("mouseenter",_,()=>C(f,l,!0)),w(a,_)}),y(m),w(E,m)},_e=De(()=>e(x)().length>0);Ce(ce,E=>{e(_e)&&E(Ee)})}y(ve),Ne("keydown",F,G),Je("blur",F,()=>{setTimeout(()=>{v()&&e(d).length>0?I():v()||t.oncancel()},150)}),Ht(F,()=>e(i),E=>C(i,E)),w(U,ve),nt()}Dt(["keydown","mousedown"]);function ht(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];$e(U,Xe({name:"type"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function pt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];$e(U,Xe({name:"calendar"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function _t(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];$e(U,Xe({name:"circle-dot"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function gt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];$e(U,Xe({name:"link"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function Bt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];$e(U,Xe({name:"tag"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}function Ua(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"m15 18-6-6 6-6"}]];$e(U,Xe({name:"chevron-left"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}var qa=M('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Va=M('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Wa=M('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Ha=M("<!> <!> <!>",1),Ba=M("<!> <!>",1),Ya=M('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Ja=M('<span class="ip-status-dot svelte-x7sio8"></span> ',1),Qa=M('<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>'),Ga=M('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Za=M('<div class="ip-cal-week svelte-x7sio8"></div>'),Xa=M('<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>'),$a=M('<span class="ip-badge svelte-x7sio8"> </span>'),en=M('<div class="ip-wikilink-group svelte-x7sio8"></div>'),tn=M('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),an=M('<span class="ip-date-text svelte-x7sio8"> </span>'),nn=M('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),rn=M('<span class="ip-text-value svelte-x7sio8"> </span>'),sn=M('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),on=M('<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>'),ln=M("<!> <span>Add property</span>",1),cn=M('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function un(U,t){at(t,!0);let v=ct(t,"editable",3,!1);const i=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],f=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let R=Ae(null),b=Ae(!1),x=Ae(""),Y=Ae(void 0);function d(r){switch(r.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 J(r){for(const s of yt.repos){const z=s.entities.find(O=>O.id===r);if(z){Rt(`/${s.name}/${z.entityType}/${z.id}`);return}}}function H(r){return typeof r.value=="string"?r.value:r.value[0]}function I(r){return/^https?:\/\//.test(r)}function G(r){try{return new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return r}}let ve=Ae(Qe(new Date().getFullYear())),q=Ae(Qe(new Date().getMonth()));const ke=["Su","Mo","Tu","We","Th","Fr","Sa"],xe=["January","February","March","April","May","June","July","August","September","October","November","December"];function F(r,s){const z=new Date(r,s,1).getDay(),O=new Date(r,s+1,0).getDate(),$=new Date(r,s,0).getDate(),P=[];let D=[];for(let ae=z-1;ae>=0;ae--){const L=$-ae,ne=s===0?11:s-1,V=s===0?r-1:r;D.push({day:L,month:ne,year:V,outside:!0})}for(let ae=1;ae<=O;ae++)D.push({day:ae,month:s,year:r,outside:!1}),D.length===7&&(P.push(D),D=[]);if(D.length>0){const ae=s===11?0:s+1,L=s===11?r+1:r;let ne=1;for(;D.length<7;)D.push({day:ne++,month:ae,year:L,outside:!0});P.push(D)}return P}function ce(r){const s=new Date;return r.day===s.getDate()&&r.month===s.getMonth()&&r.year===s.getFullYear()}function Ee(r,s){const z=s.slice(0,10).split("-");return r.year===+z[0]&&r.month===+z[1]-1&&r.day===+z[2]}function _e(){e(q)===0?(C(q,11),ot(ve,-1)):ot(q,-1)}function E(){e(q)===11?(C(q,0),ot(ve)):ot(q)}function m(r){try{const s=r.slice(0,10).split("-");C(ve,+s[0]),C(q,+s[1]-1)}catch{const s=new Date;C(ve,s.getFullYear(),!0),C(q,s.getMonth(),!0)}}function a(r){requestAnimationFrame(()=>{r.focus(),r.select()})}function n(r){!v()||r.type==="badge"||(r.type==="date"&&m(H(r)),C(R,r.key,!0))}function l(r,s){t.onedit&&t.onedit(r,s),C(R,null)}function _(r,s){const z=`${s.year}-${String(s.month+1).padStart(2,"0")}-${String(s.day).padStart(2,"0")}`;t.onedit&&t.onedit(r,z),C(R,null)}function k(r,s){t.ontypechange&&t.ontypechange(r,s)}function j(r){C(R,null),t.onremove&&t.onremove(r)}function ge(){C(b,!0),C(x,""),requestAnimationFrame(()=>e(Y)?.focus())}function fe(){const r=e(x).trim();r&&t.onadd&&t.onadd(r,""),C(b,!1),C(x,"")}function p(){C(b,!1),C(x,"")}function c(r){r.key==="Enter"?(r.preventDefault(),fe()):r.key==="Escape"&&p()}var o=cn();Je("click",qt,()=>{C(R,null)});var h=S(o);Me(h,17,()=>t.properties,r=>r.key,(r,s)=>{const z=De(()=>e(R)===e(s).key);var O=sn();let $;var P=S(O),D=S(P);{var ae=te=>{var K=Le(),Q=we(K);Ke(Q,()=>ga,(Z,ue)=>{ue(Z,{children:(he,Se)=>{var se=Ba(),ie=we(se);Ke(ie,()=>fa,(oe,X)=>{X(oe,{class:"ip-icon-trigger",children:(de,pe)=>{var be=Le(),Te=we(be);{var Oe=ze=>{pt(ze,{size:14})},He=ze=>{_t(ze,{size:14})},rt=ze=>{gt(ze,{size:14})},ut=ze=>{ht(ze,{size:14})};Ce(Te,ze=>{e(s).type==="date"?ze(Oe):e(s).type==="status"?ze(He,1):e(s).type==="wikilink"?ze(rt,2):ze(ut,!1)})}w(de,be)},$$slots:{default:!0}})});var Re=W(ie,2);Ke(Re,()=>va,(oe,X)=>{X(oe,{children:(de,pe)=>{var be=Le(),Te=we(be);Ke(Te,()=>ha,(Oe,He)=>{He(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(rt,ut)=>{var ze=Ha(),bt=we(ze);Me(bt,17,()=>i,Ue,(it,Ve)=>{var dt=Le(),Tt=we(dt);Ke(Tt,()=>Lt,(ft,vt)=>{vt(ft,{class:"ip-menu-item",onSelect:()=>k(e(s).key,e(Ve).type),children:(xt,rr)=>{var Ot=Va(),Et=we(Ot),Jt=S(Et);{var Qt=Fe=>{ht(Fe,{size:13})},Gt=Fe=>{pt(Fe,{size:13})},Zt=Fe=>{_t(Fe,{size:13})},Xt=Fe=>{gt(Fe,{size:13})};Ce(Jt,Fe=>{e(Ve).type==="text"?Fe(Qt):e(Ve).type==="date"?Fe(Gt,1):e(Ve).type==="status"?Fe(Zt,2):e(Ve).type==="wikilink"&&Fe(Xt,3)})}y(Et);var Ct=W(Et,2),$t=S(Ct,!0);y(Ct);var ea=W(Ct,2);{var ta=Fe=>{var St=qa(),aa=S(St);Oa(aa,{size:12}),y(St),w(Fe,St)};Ce(ea,Fe=>{e(s).type===e(Ve).type&&Fe(ta)})}ye(()=>me($t,e(Ve).label)),w(xt,Ot)},$$slots:{default:!0}})}),w(it,dt)});var st=W(bt,2);Ke(st,()=>pa,(it,Ve)=>{Ve(it,{class:"ip-menu-sep"})});var Yt=W(st,2);Ke(Yt,()=>Lt,(it,Ve)=>{Ve(it,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>j(e(s).key),children:(dt,Tt)=>{var ft=Wa(),vt=we(ft),xt=S(vt);_a(xt,{size:13}),y(vt),qe(2),w(dt,ft)},$$slots:{default:!0}})}),w(rt,ze)},$$slots:{default:!0}})}),w(de,be)},$$slots:{default:!0}})}),w(he,se)},$$slots:{default:!0}})}),w(te,K)},L=te=>{var K=Le(),Q=we(K);{var Z=ie=>{pt(ie,{size:14})},ue=ie=>{_t(ie,{size:14})},he=ie=>{gt(ie,{size:14})},Se=ie=>{Bt(ie,{size:14})},se=ie=>{ht(ie,{size:14})};Ce(Q,ie=>{e(s).type==="date"?ie(Z):e(s).type==="status"?ie(ue,1):e(s).type==="wikilink"?ie(he,2):e(s).type==="badge"?ie(Se,3):ie(se,!1)})}w(te,K)};Ce(D,te=>{v()&&e(s).type!=="badge"?te(ae):te(L,!1)})}y(P);var ne=W(P,2),V=S(ne,!0);y(ne);var N=W(ne,2),ee=S(N);{var B=te=>{var K=Ya();lt(K),za(K,Q=>a?.(Q)),ye(Q=>At(K,Q),[()=>H(e(s))]),Je("blur",K,Q=>{const Z=Q.currentTarget.value;Z!==H(e(s))&&t.onedit?.(e(s).key,Z),C(R,null)}),Ne("keydown",K,Q=>{Q.key==="Enter"?Q.currentTarget.blur():Q.key==="Escape"&&(Q.currentTarget.value=H(e(s)),C(R,null))}),w(te,K)},re=te=>{var K=Qa(),Q=S(K),Z=S(Q);let ue;var he=W(Z,2),Se=S(he,!0);y(he),y(Q);var se=W(Q,2);Me(se,21,()=>f,Ue,(ie,Re)=>{{let oe=De(()=>H(e(s))===e(Re)?"selected":"");Ie(ie,{variant:"ghost",get class(){return`ip-status-option ${e(oe)??""}`},onclick:()=>l(e(s).key,e(Re)),children:(X,de)=>{var pe=Ja(),be=we(pe);let Te;var Oe=W(be);ye(He=>{Te=Be(be,"",Te,He),me(Oe,` ${e(Re)??""}`)},[()=>({background:d(e(Re))})]),w(X,pe)},$$slots:{default:!0}})}}),y(se),y(K),ye((ie,Re)=>{ue=Be(Z,"",ue,ie),me(Se,Re)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),Ne("click",K,ie=>ie.stopPropagation()),w(te,K)},T=te=>{var K=Xa(),Q=S(K),Z=S(Q,!0);y(Q);var ue=W(Q,2),he=S(ue),Se=S(he);Ie(Se,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:_e,children:(de,pe)=>{Ua(de,{size:14})},$$slots:{default:!0}});var se=W(Se,2),ie=S(se);y(se);var Re=W(se,2);Ie(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:E,children:(de,pe)=>{ma(de,{size:14})},$$slots:{default:!0}}),y(he);var oe=W(he,2);Me(oe,21,()=>ke,Ue,(de,pe)=>{var be=Ga(),Te=S(be,!0);y(be),ye(()=>me(Te,e(pe))),w(de,be)}),y(oe);var X=W(oe,2);Me(X,17,()=>F(e(ve),e(q)),Ue,(de,pe)=>{var be=Za();Me(be,21,()=>e(pe),Ue,(Te,Oe)=>{{let He=De(()=>e(Oe).outside?"outside":""),rt=De(()=>ce(e(Oe))?"today":""),ut=De(()=>Ee(e(Oe),H(e(s)))?"selected":"");Ie(Te,{variant:"ghost",get class(){return`ip-cal-day ${e(He)??""} ${e(rt)??""} ${e(ut)??""}`},onclick:()=>_(e(s).key,e(Oe)),children:(ze,bt)=>{qe();var st=Ye();ye(()=>me(st,e(Oe).day)),w(ze,st)},$$slots:{default:!0}})}}),y(be),w(de,be)}),y(ue),y(K),ye(de=>{me(Z,de),me(ie,`${xe[e(q)]??""} ${e(ve)??""}`)},[()=>G(H(e(s)))]),Ne("click",K,de=>de.stopPropagation()),w(te,K)},le=te=>{{let K=De(()=>Array.isArray(e(s).value));Ka(te,{get value(){return e(s).value},get multi(){return e(K)},onselect:Q=>{t.onedit?.(e(s).key,Q),C(R,null)},oncancel:()=>{C(R,null)}})}},Pe=te=>{var K=Le(),Q=we(K);{var Z=oe=>{var X=$a(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>H(e(s))]),w(oe,X)},ue=oe=>{var X=en();Me(X,21,()=>Array.isArray(e(s).value)?e(s).value:[e(s).value],Ue,(de,pe)=>{Ie(de,{variant:"ghost",class:"ip-wikilink-chip",onclick:be=>{be.stopPropagation(),J(e(pe))},children:(be,Te)=>{qe();var Oe=Ye();ye(()=>me(Oe,e(pe))),w(be,Oe)},$$slots:{default:!0}})}),y(X),w(oe,X)},he=oe=>{var X=tn(),de=S(X);let pe;var be=W(de,2),Te=S(be,!0);y(be),y(X),ye((Oe,He)=>{pe=Be(de,"",pe,Oe),me(Te,He)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),w(oe,X)},Se=oe=>{var X=an(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>G(H(e(s)))]),w(oe,X)},se=oe=>{var X=nn(),de=S(X,!0);y(X),ye((pe,be)=>{ra(X,"href",pe),me(de,be)},[()=>H(e(s)),()=>H(e(s))]),Ne("click",X,pe=>pe.stopPropagation()),w(oe,X)},ie=De(()=>I(H(e(s)))),Re=oe=>{var X=rn(),de=S(X,!0);y(X),ye(pe=>me(de,pe),[()=>H(e(s))]),w(oe,X)};Ce(Q,oe=>{e(s).type==="badge"?oe(Z):e(s).type==="wikilink"?oe(ue,1):e(s).type==="status"?oe(he,2):e(s).type==="date"?oe(Se,3):e(ie)?oe(se,4):oe(Re,!1)})}w(te,K)};Ce(ee,te=>{e(z)&&e(s).type==="text"?te(B):e(z)&&e(s).type==="status"?te(re,1):e(z)&&e(s).type==="date"?te(T,2):e(z)&&e(s).type==="wikilink"?te(le,3):te(Pe,!1)})}y(N),y(O),ye(()=>{$=tt(O,1,"ip-row svelte-x7sio8",null,$,{"ip-focused":e(z)}),me(V,e(s).key)}),Ne("click",P,te=>te.stopPropagation()),Ne("click",N,te=>{te.stopPropagation(),n(e(s))}),w(r,O)});var g=W(h,2);{var u=r=>{var s=on(),z=S(s),O=S(z);wt(O,{size:14}),y(z);var $=W(z,2),P=S($);lt(P),kt(P,D=>C(Y,D),()=>e(Y)),y($),qe(2),y(s),Ne("keydown",P,c),Je("blur",P,p),Ht(P,()=>e(x),D=>C(x,D)),w(r,s)},A=r=>{Ie(r,{variant:"ghost",class:"ip-add-btn",onclick:s=>{s.stopPropagation(),ge()},children:(s,z)=>{var O=ln(),$=we(O);wt($,{size:14}),qe(2),w(s,O)},$$slots:{default:!0}})};Ce(g,r=>{e(b)?r(u):v()&&r(A,1)})}y(o),w(U,o),nt()}Dt(["click","keydown"]);var dn=M('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),fn=M('<div class="cursor-overlay svelte-ok7wy5"></div>'),vn=M('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function hn(U,t){at(t,!0);let v=ct(t,"readonly",3,!0),i=ct(t,"resetKey",3,0);const f=Vt("theme");let R,b=null,x=null,Y=Ae(""),d=Ae(Qe([])),J=null,H=t.content;function I(F,ce){return F.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:ce?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:ce?"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:ce})}async function G(){b&&(b.destroy(),b=null),x&&(x.destroy(),x=null),C(d,[],!0);const{EditorState:F}=await We(async()=>{const{EditorState:o}=await import("../chunks/Cs5oz2oJ.js");return{EditorState:o}},[],import.meta.url),{EditorView:ce,keymap:Ee,ViewPlugin:_e}=await We(async()=>{const{EditorView:o,keymap:h,ViewPlugin:g}=await import("../chunks/BVBRzmeQ.js").then(u=>u.i);return{EditorView:o,keymap:h,ViewPlugin:g}},__vite__mapDeps([0,1]),import.meta.url),{markdown:E}=await We(async()=>{const{markdown:o}=await import("../chunks/B1y7Wy5O.js");return{markdown:o}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:m,HighlightStyle:a}=await We(async()=>{const{syntaxHighlighting:o,HighlightStyle:h}=await import("../chunks/D2aTbzFm.js");return{syntaxHighlighting:o,HighlightStyle:h}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:n}=await We(async()=>{const{tags:o}=await import("../chunks/BXuvR8Ks.js").then(h=>h.i);return{tags:o}},[],import.meta.url),{livePreviewPlugin:l,livePreviewTheme:_}=await We(async()=>{const{livePreviewPlugin:o,livePreviewTheme:h}=await import("../chunks/BPUy9_sS.js");return{livePreviewPlugin:o,livePreviewTheme:h}},__vite__mapDeps([6,0,1,3,4]),import.meta.url),k=f.current==="dark",j=I(ce,k),ge=a.define([{tag:n.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),fe=[E(),j,m(ge),l,_,ce.lineWrapping];v()&&fe.push(F.readOnly.of(!0));let p=!1;if(t.cursorDocName&&!v())try{let ae=function(){if(!b||!O){C(d,[],!0);return}const V=O.awareness,N=O.ytext,ee=N.doc;if(!ee){C(d,[],!0);return}const B=[],re=b.dom.getBoundingClientRect();V.getStates().forEach((T,le)=>{if(le===D)return;const Pe=T.cursor;if(!Pe?.head)return;const{name:te="Anonymous",color:K="#6e6ee8"}=T.user||{};let Q;try{Q=s.createRelativePositionFromJSON(Pe.head)}catch{return}const Z=s.createAbsolutePositionFromRelativePosition(Q,ee);if(!Z||Z.type!==N)return;const ue=b.coordsAtPos(Math.min(Z.index,b.state.doc.length));ue&&B.push({id:le,name:te,color:K,top:ue.top-re.top,left:ue.left-re.left,height:ue.bottom-ue.top})}),C(d,B,!0)},L=function(){J&&cancelAnimationFrame(J),J=requestAnimationFrame(()=>{J=null,ae()})},ne=function({added:V,updated:N,removed:ee}){[...V,...N,...ee].some(re=>re!==D)&&L()};const{createCollabSession:o}=await We(async()=>{const{createCollabSession:V}=await import("../chunks/BxXlKFyx.js");return{createCollabSession:V}},__vite__mapDeps([7,8,9,10,11,12,13,14]),import.meta.url),{ySync:h,ySyncFacet:g,YSyncConfig:u,yUndoManagerKeymap:A}=await We(async()=>{const{ySync:V,ySyncFacet:N,YSyncConfig:ee,yUndoManagerKeymap:B}=await import("../chunks/BCB5cYCz.js");return{ySync:V,ySyncFacet:N,YSyncConfig:ee,yUndoManagerKeymap:B}},__vite__mapDeps([15,8,0,1]),import.meta.url),{auth:r}=await We(async()=>{const{auth:V}=await import("../chunks/DP09rP34.js").then(N=>N.v);return{auth:V}},__vite__mapDeps([14,10,12,11]),import.meta.url),s=await We(()=>import("../chunks/CLFba8FK.js").then(V=>V.A),[],import.meta.url),z=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",O=o(t.cursorDocName,{name:r.user?.displayName??"Anonymous",color:z,colorLight:z+"33"}),$=new s.UndoManager(O.ytext),P=new u(O.ytext,O.awareness);fe.push(g.of(P),h,Ee.of(A)),fe.push(_e.define(V=>{function N(){const ee=V.state.selection.main,B=O.ytext,re=s.createRelativePositionFromTypeIndex(B,ee.anchor),T=s.createRelativePositionFromTypeIndex(B,ee.head);O.awareness.setLocalStateField("cursor",{anchor:s.relativePositionToJSON(re),head:s.relativePositionToJSON(T)})}return N(),{update(ee){(ee.selectionSet||ee.docChanged)&&N()}}}));const D=O.ydoc.clientID;O.awareness.on("change",ne),fe.push(_e.define(()=>({update(V){(V.docChanged||V.geometryChanged||V.viewportChanged)&&L()},destroy(){O.awareness.off("change",ne)}}))),x=O,p=!0}catch(o){console.warn("Yjs collab setup failed, falling back to solo editing:",o)}if(t.onchange)if(p){const o=Date.now();fe.push(ce.updateListener.of(h=>{if(h.docChanged&&Date.now()-o>1e3&&h.transactions.some(u=>u.isUserEvent("input")||u.isUserEvent("delete")||u.isUserEvent("move")||u.isUserEvent("undo")||u.isUserEvent("redo"))){const u=h.state.doc.toString();H=u,t.onchange(u)}}))}else fe.push(ce.updateListener.of(o=>{if(o.docChanged){const h=o.state.doc.toString();H=h,t.onchange(h)}}));fe.push(ce.domEventHandlers({click(o){const h=o.target;if(t.onwikilinkclick){const u=h.closest(".cm-live-wikilink");if(u){o.preventDefault();const A=u.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return A&&t.onwikilinkclick(A),!0}}const g=h.closest(".cm-live-link");if(g){const u=g.getAttribute("data-href");if(u)return o.preventDefault(),window.open(u,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&fe.push(Ee.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const c=F.create({doc:p?"":t.content,extensions:fe});b=new ce({state:c,parent:R}),H=p?"":t.content,C(Y,t.cursorDocName??"",!0)}ca(()=>{G()}),Ge(()=>{t.cursorDocName&&e(Y)&&t.cursorDocName!==e(Y)&&G()}),Ge(()=>{if(i(),b&&!x&&t.content!==H){H=t.content;const F=R.closest(".document-scroll"),ce=F?.scrollTop??0;b.dispatch({changes:{from:0,to:b.state.doc.length,insert:t.content}}),F&&requestAnimationFrame(()=>{F.scrollTop=ce})}}),Wt(()=>{J&&cancelAnimationFrame(J),x?.destroy(),x=null,b?.destroy()});var ve=vn(),q=S(ve);kt(q,F=>R=F,()=>R);var ke=W(q,2);{var xe=F=>{var ce=fn();Me(ce,21,()=>e(d),Ee=>Ee.id,(Ee,_e)=>{var E=dn(),m=S(E),a=S(m,!0);y(m),y(E),ye(()=>{Be(E,`top: ${e(_e).top??""}px; left: ${e(_e).left??""}px; height: ${e(_e).height??""}px; --cursor-color: ${e(_e).color??""};`),Be(m,`background-color: ${e(_e).color??""};`),me(a,e(_e).name)}),w(Ee,E)}),y(ce),w(F,ce)};Ce(ke,F=>{e(d).length>0&&F(xe)})}y(ve),w(U,ve),nt()}var mt={exports:{}};var pn=mt.exports,Mt;function _n(){return Mt||(Mt=1,(function(U,t){((v,i)=>{U.exports=i()})(pn,function v(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},f,R=!i.document&&!!i.postMessage,b=i.IS_PAPA_WORKER||!1,x={},Y=0,d={};function J(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(n){var l=_e(n);l.chunkSize=parseInt(l.chunkSize),n.step||n.chunk||(l.chunkSize=null),this._handle=new q(l),(this._handle.streamer=this)._config=l}).call(this,a),this.parseChunk=function(n,l){var _=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<_){let j=this._config.newline;j||(k=this._config.quoteChar||'"',j=this._handle.guessLineEndings(n,k)),n=[...n.split(j).slice(_)].join(j)}this.isFirstChunk&&m(this._config.beforeFirstChunk)&&(k=this._config.beforeFirstChunk(n))!==void 0&&(n=k),this.isFirstChunk=!1,this._halted=!1;var _=this._partialLine+n,k=(this._partialLine="",this._handle.parse(_,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=k.meta.cursor,_=(this._finished||(this._partialLine=_.substring(n-this._baseIndex),this._baseIndex=n),k&&k.data&&(this._rowCount+=k.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),b)i.postMessage({results:k,workerId:d.WORKER_ID,finished:_});else if(m(this._config.chunk)&&!l){if(this._config.chunk(k,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=k=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(k.data),this._completeResults.errors=this._completeResults.errors.concat(k.errors),this._completeResults.meta=k.meta),this._completed||!_||!m(this._config.complete)||k&&k.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),_||k&&k.meta.paused||this._nextChunk(),k}this._halted=!0},this._sendError=function(n){m(this._config.error)?this._config.error(n):b&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:n,finished:!1})}}function H(a){var n;(a=a||{}).chunkSize||(a.chunkSize=d.RemoteChunkSize),J.call(this,a),this._nextChunk=R?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(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),R||(n.onload=E(this._chunkLoaded,this),n.onerror=E(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!R),this._config.downloadRequestHeaders){var l,_=this._config.downloadRequestHeaders;for(l in _)n.setRequestHeader(l,_[l])}var k;this._config.chunkSize&&(k=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+k));try{n.send(this._config.downloadRequestBody)}catch(j){this._chunkError(j.message)}R&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(l=>(l=l.getResponseHeader("Content-Range"))!==null?parseInt(l.substring(l.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(l){l=n.statusText||l,this._sendError(new Error(l))}}function I(a){(a=a||{}).chunkSize||(a.chunkSize=d.LocalChunkSize),J.call(this,a);var n,l,_=typeof FileReader<"u";this.stream=function(k){this._input=k,l=k.slice||k.webkitSlice||k.mozSlice,_?((n=new FileReader).onload=E(this._chunkLoaded,this),n.onerror=E(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var k=this._input,j=(this._config.chunkSize&&(j=Math.min(this._start+this._config.chunkSize,this._input.size),k=l.call(k,this._start,j)),n.readAsText(k,this._config.encoding));_||this._chunkLoaded({target:{result:j}})},this._chunkLoaded=function(k){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(k.target.result)},this._chunkError=function(){this._sendError(n.error)}}function G(a){var n;J.call(this,a=a||{}),this.stream=function(l){return n=l,this._nextChunk()},this._nextChunk=function(){var l,_;if(!this._finished)return l=this._config.chunkSize,n=l?(_=n.substring(0,l),n.substring(l)):(_=n,""),this._finished=!n,this.parseChunk(_)}}function ve(a){J.call(this,a=a||{});var n=[],l=!0,_=!1;this.pause=function(){J.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){J.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(k){this._input=k,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){_&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):l=!0},this._streamData=E(function(k){try{n.push(typeof k=="string"?k:k.toString(this._config.encoding)),l&&(l=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(j){this._streamError(j)}},this),this._streamError=E(function(k){this._streamCleanUp(),this._sendError(k)},this),this._streamEnd=E(function(){this._streamCleanUp(),_=!0,this._streamData("")},this),this._streamCleanUp=E(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function q(a){var n,l,_,k,j=Math.pow(2,53),ge=-j,fe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,p=/^((\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)))$/,c=this,o=0,h=0,g=!1,u=!1,A=[],r={data:[],errors:[],meta:{}};function s(P){return a.skipEmptyLines==="greedy"?P.join("").trim()==="":P.length===1&&P[0].length===0}function z(){if(r&&_&&($("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),_=!1),a.skipEmptyLines&&(r.data=r.data.filter(function(L){return!s(L)})),O()){let L=function(ne,V){m(a.transformHeader)&&(ne=a.transformHeader(ne,V)),A.push(ne)};if(r)if(Array.isArray(r.data[0])){for(var P=0;O()&&P<r.data.length;P++)r.data[P].forEach(L);r.data.splice(0,1)}else r.data.forEach(L)}function D(L,ne){for(var V=a.header?{}:[],N=0;N<L.length;N++){var ee=N,B=L[N],B=((re,T)=>(le=>(a.dynamicTypingFunction&&a.dynamicTyping[le]===void 0&&(a.dynamicTyping[le]=a.dynamicTypingFunction(le)),(a.dynamicTyping[le]||a.dynamicTyping)===!0))(re)?T==="true"||T==="TRUE"||T!=="false"&&T!=="FALSE"&&((le=>{if(fe.test(le)&&(le=parseFloat(le),ge<le&&le<j))return 1})(T)?parseFloat(T):p.test(T)?new Date(T):T===""?null:T):T)(ee=a.header?N>=A.length?"__parsed_extra":A[N]:ee,B=a.transform?a.transform(B,ee):B);ee==="__parsed_extra"?(V[ee]=V[ee]||[],V[ee].push(B)):V[ee]=B}return a.header&&(N>A.length?$("FieldMismatch","TooManyFields","Too many fields: expected "+A.length+" fields but parsed "+N,h+ne):N<A.length&&$("FieldMismatch","TooFewFields","Too few fields: expected "+A.length+" fields but parsed "+N,h+ne)),V}var ae;r&&(a.header||a.dynamicTyping||a.transform)&&(ae=1,!r.data.length||Array.isArray(r.data[0])?(r.data=r.data.map(D),ae=r.data.length):r.data=D(r.data,0),a.header&&r.meta&&(r.meta.fields=A),h+=ae)}function O(){return a.header&&A.length===0}function $(P,D,ae,L){P={type:P,code:D,message:ae},L!==void 0&&(P.row=L),r.errors.push(P)}m(a.step)&&(k=a.step,a.step=function(P){r=P,O()?z():(z(),r.data.length!==0&&(o+=P.data.length,a.preview&&o>a.preview?l.abort():(r.data=r.data[0],k(r,c))))}),this.parse=function(P,D,ae){var L=a.quoteChar||'"',L=(a.newline||(a.newline=this.guessLineEndings(P,L)),_=!1,a.delimiter?m(a.delimiter)&&(a.delimiter=a.delimiter(P),r.meta.delimiter=a.delimiter):((L=((ne,V,N,ee,B)=>{var re,T,le,Pe;B=B||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var te=0;te<B.length;te++){for(var K,Q=B[te],Z=0,ue=0,he=0,Se=(le=void 0,new xe({comments:ee,delimiter:Q,newline:V,preview:10}).parse(ne)),se=0;se<Se.data.length;se++)N&&s(Se.data[se])?he++:(K=Se.data[se].length,ue+=K,le===void 0?le=K:0<K&&(Z+=Math.abs(K-le),le=K));0<Se.data.length&&(ue/=Se.data.length-he),(T===void 0||Z<=T)&&(Pe===void 0||Pe<ue)&&1.99<ue&&(T=Z,re=Q,Pe=ue)}return{successful:!!(a.delimiter=re),bestDelimiter:re}})(P,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=L.bestDelimiter:(_=!0,a.delimiter=d.DefaultDelimiter),r.meta.delimiter=a.delimiter),_e(a));return a.preview&&a.header&&L.preview++,n=P,l=new xe(L),r=l.parse(n,D,ae),z(),g?{meta:{paused:!0}}:r||{meta:{paused:!1}}},this.paused=function(){return g},this.pause=function(){g=!0,l.abort(),n=m(a.chunk)?"":n.substring(l.getCharIndex())},this.resume=function(){c.streamer._halted?(g=!1,c.streamer.parseChunk(n,!0)):setTimeout(c.resume,3)},this.aborted=function(){return u},this.abort=function(){u=!0,l.abort(),r.meta.aborted=!0,m(a.complete)&&a.complete(r),n=""},this.guessLineEndings=function(ne,L){ne=ne.substring(0,1048576);var L=new RegExp(ke(L)+"([^]*?)"+ke(L),"gm"),ae=(ne=ne.replace(L,"")).split("\r"),L=ne.split(`
|
|
3
3
|
`),ne=1<L.length&&L[0].length<ae[0].length;if(ae.length===1||ne)return`
|
|
4
4
|
`;for(var V=0,N=0;N<ae.length;N++)ae[N][0]===`
|
|
5
5
|
`&&V++;return V>=ae.length/2?`\r
|
|
@@ -8,4 +8,4 @@ import{f as na,r as lt,s as tt,w as yt,h as At,i as Be,g as ra,a as sa,j as ia}f
|
|
|
8
8
|
`&&(l=`
|
|
9
9
|
`);var h=0,g=!1;this.parse=function(u,A,r){if(typeof u!="string")throw new Error("Input must be a string");var s=u.length,z=n.length,O=l.length,$=_.length,P=m(k),D=[],ae=[],L=[],ne=h=0;if(!u)return Z();if(ge||ge!==!1&&u.indexOf(c)===-1){for(var V=u.split(l),N=0;N<V.length;N++){if(L=V[N],h+=L.length,N!==V.length-1)h+=l.length;else if(r)return Z();if(!_||L.substring(0,$)!==_){if(P){if(D=[],Pe(L.split(n)),ue(),g)return Z()}else Pe(L.split(n));if(j&&j<=N)return D=D.slice(0,j),Z(!0)}}return Z()}for(var ee=u.indexOf(n,h),B=u.indexOf(l,h),re=new RegExp(ke(o)+ke(c),"g"),T=u.indexOf(c,h);;)if(u[h]===c)for(T=h,h++;;){if((T=u.indexOf(c,T+1))===-1)return r||ae.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:D.length,index:h}),K();if(T===s-1)return K(u.substring(h,T).replace(re,c));if(c===o&&u[T+1]===o)T++;else if(c===o||T===0||u[T-1]!==o){ee!==-1&&ee<T+1&&(ee=u.indexOf(n,T+1));var le=te((B=B!==-1&&B<T+1?u.indexOf(l,T+1):B)===-1?ee:Math.min(ee,B));if(u.substr(T+1+le,z)===n){L.push(u.substring(h,T).replace(re,c)),u[h=T+1+le+z]!==c&&(T=u.indexOf(c,h)),ee=u.indexOf(n,h),B=u.indexOf(l,h);break}if(le=te(B),u.substring(T+1+le,T+1+le+O)===l){if(L.push(u.substring(h,T).replace(re,c)),Q(T+1+le+O),ee=u.indexOf(n,h),T=u.indexOf(c,h),P&&(ue(),g))return Z();if(j&&D.length>=j)return Z(!0);break}ae.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:D.length,index:h}),T++}}else if(_&&L.length===0&&u.substring(h,h+$)===_){if(B===-1)return Z();h=B+O,B=u.indexOf(l,h),ee=u.indexOf(n,h)}else if(ee!==-1&&(ee<B||B===-1))L.push(u.substring(h,ee)),h=ee+z,ee=u.indexOf(n,h);else{if(B===-1)break;if(L.push(u.substring(h,B)),Q(B+O),P&&(ue(),g))return Z();if(j&&D.length>=j)return Z(!0)}return K();function Pe(he){D.push(he),ne=h}function te(he){var Se=0;return Se=he!==-1&&(he=u.substring(T+1,he))&&he.trim()===""?he.length:Se}function K(he){return r||(he===void 0&&(he=u.substring(h)),L.push(he),h=s,Pe(L),P&&ue()),Z()}function Q(he){h=he,Pe(L),L=[],B=u.indexOf(l,h)}function Z(he){if(a.header&&!A&&D.length&&!p){var Se=D[0],se=Object.create(null),ie=new Set(Se);let Re=!1;for(let oe=0;oe<Se.length;oe++){let X=Se[oe];if(se[X=m(a.transformHeader)?a.transformHeader(X,oe):X]){let de,pe=se[X];for(;de=X+"_"+pe,pe++,ie.has(de););ie.add(de),Se[oe]=de,se[X]++,Re=!0,(fe=fe===null?{}:fe)[de]=X}else se[X]=1,Se[oe]=X;ie.add(X)}Re&&console.warn("Duplicate headers found and renamed."),p=!0}return{data:D,errors:ae,meta:{delimiter:n,linebreak:l,aborted:g,truncated:!!he,cursor:ne+(A||0),renamedHeaders:fe}}}function ue(){k(Z()),D=[],ae=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return h}}function F(a){var n=a.data,l=x[n.workerId],_=!1;if(n.error)l.userError(n.error,n.file);else if(n.results&&n.results.data){var k={abort:function(){_=!0,ce(n.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:Ee,resume:Ee};if(m(l.userStep)){for(var j=0;j<n.results.data.length&&(l.userStep({data:n.results.data[j],errors:n.results.errors,meta:n.results.meta},k),!_);j++);delete n.results}else m(l.userChunk)&&(l.userChunk(n.results,k,n.file),delete n.results)}n.finished&&!_&&ce(n.workerId,n.results)}function ce(a,n){var l=x[a];m(l.userComplete)&&l.userComplete(n),l.terminate(),delete x[a]}function Ee(){throw new Error("Not implemented.")}function _e(a){if(typeof a!="object"||a===null)return a;var n,l=Array.isArray(a)?[]:{};for(n in a)l[n]=_e(a[n]);return l}function E(a,n){return function(){a.apply(n,arguments)}}function m(a){return typeof a=="function"}return d.parse=function(a,n){var l=(n=n||{}).dynamicTyping||!1;if(m(l)&&(n.dynamicTypingFunction=l,l={}),n.dynamicTyping=l,n.transform=!!m(n.transform)&&n.transform,!n.worker||!d.WORKERS_SUPPORTED)return l=null,d.NODE_STREAM_INPUT,typeof a=="string"?(a=(_=>_.charCodeAt(0)!==65279?_:_.slice(1))(a),l=new(n.download?H:G)(n)):a.readable===!0&&m(a.read)&&m(a.on)?l=new ve(n):(i.File&&a instanceof File||a instanceof Object)&&(l=new I(n)),l.stream(a);(l=(()=>{var _;return!!d.WORKERS_SUPPORTED&&(_=(()=>{var k=i.URL||i.webkitURL||null,j=v.toString();return d.BLOB_URL||(d.BLOB_URL=k.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; ","(",j,")();"],{type:"text/javascript"})))})(),(_=new i.Worker(_)).onmessage=F,_.id=Y++,x[_.id]=_)})()).userStep=n.step,l.userChunk=n.chunk,l.userComplete=n.complete,l.userError=n.error,n.step=m(n.step),n.chunk=m(n.chunk),n.complete=m(n.complete),n.error=m(n.error),delete n.worker,l.postMessage({input:a,config:n,workerId:l.id})},d.unparse=function(a,n){var l=!1,_=!0,k=",",j=`\r
|
|
10
10
|
`,ge='"',fe=ge+ge,p=!1,c=null,o=!1,h=((()=>{if(typeof n=="object"){if(typeof n.delimiter!="string"||d.BAD_DELIMITERS.filter(function(A){return n.delimiter.indexOf(A)!==-1}).length||(k=n.delimiter),typeof n.quotes!="boolean"&&typeof n.quotes!="function"&&!Array.isArray(n.quotes)||(l=n.quotes),typeof n.skipEmptyLines!="boolean"&&typeof n.skipEmptyLines!="string"||(p=n.skipEmptyLines),typeof n.newline=="string"&&(j=n.newline),typeof n.quoteChar=="string"&&(ge=n.quoteChar),typeof n.header=="boolean"&&(_=n.header),Array.isArray(n.columns)){if(n.columns.length===0)throw new Error("Option columns is empty");c=n.columns}n.escapeChar!==void 0&&(fe=n.escapeChar+ge),n.escapeFormulae instanceof RegExp?o=n.escapeFormulae:typeof n.escapeFormulae=="boolean"&&n.escapeFormulae&&(o=/^[=+\-@\t\r].*$/)}})(),new RegExp(ke(ge),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return g(null,a,p);if(typeof a[0]=="object")return g(c||Object.keys(a[0]),a,p)}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||c),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])),g(a.fields||[],a.data||[],p);throw new Error("Unable to serialize unrecognized input");function g(A,r,s){var z="",O=(typeof A=="string"&&(A=JSON.parse(A)),typeof r=="string"&&(r=JSON.parse(r)),Array.isArray(A)&&0<A.length),$=!Array.isArray(r[0]);if(O&&_){for(var P=0;P<A.length;P++)0<P&&(z+=k),z+=u(A[P],P);0<r.length&&(z+=j)}for(var D=0;D<r.length;D++){var ae=(O?A:r[D]).length,L=!1,ne=O?Object.keys(r[D]).length===0:r[D].length===0;if(s&&!O&&(L=s==="greedy"?r[D].join("").trim()==="":r[D].length===1&&r[D][0].length===0),s==="greedy"&&O){for(var V=[],N=0;N<ae;N++){var ee=$?A[N]:N;V.push(r[D][ee])}L=V.join("").trim()===""}if(!L){for(var B=0;B<ae;B++){0<B&&!ne&&(z+=k);var re=O&&$?A[B]:B;z+=u(r[D][re],B)}D<r.length-1&&(!s||0<ae&&!ne)&&(z+=j)}}return z}function u(A,r){var s,z;return A==null?"":A.constructor===Date?JSON.stringify(A).slice(1,25):(z=!1,o&&typeof A=="string"&&o.test(A)&&(A="'"+A,z=!0),s=A.toString().replace(h,fe),(z=z||l===!0||typeof l=="function"&&l(A,r)||Array.isArray(l)&&l[r]||((O,$)=>{for(var P=0;P<$.length;P++)if(-1<O.indexOf($[P]))return!0;return!1})(s,d.BAD_DELIMITERS)||-1<s.indexOf(k)||s.charAt(0)===" "||s.charAt(s.length-1)===" ")?ge+s+ge:s)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
|
|
11
|
-
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!R&&!!i.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=xe,d.ParserHandle=q,d.NetworkStreamer=H,d.FileStreamer=I,d.StringStreamer=G,d.ReadableStreamStreamer=ve,i.jQuery&&((f=i.jQuery).fn.parse=function(a){var n=a.config||{},l=[];return this.each(function(j){if(!(f(this).prop("tagName").toUpperCase()==="INPUT"&&f(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var ge=0;ge<this.files.length;ge++)l.push({file:this.files[ge],inputElem:this,instanceConfig:f.extend({},n)})}),_(),this;function _(){if(l.length===0)m(a.complete)&&a.complete();else{var j,ge,fe,p,c=l[0];if(m(a.before)){var o=a.before(c.file,c.inputElem);if(typeof o=="object"){if(o.action==="abort")return j="AbortError",ge=c.file,fe=c.inputElem,p=o.reason,void(m(a.error)&&a.error({name:j},ge,fe,p));if(o.action==="skip")return void k();typeof o.config=="object"&&(c.instanceConfig=f.extend(c.instanceConfig,o.config))}else if(o==="skip")return void k()}var h=c.instanceConfig.complete;c.instanceConfig.complete=function(g){m(h)&&h(g,c.file,c.inputElem),k()},d.parse(c.file,c.instanceConfig)}}function k(){l.splice(0,1),_()}}),b&&(i.onmessage=function(a){a=a.data,d.WORKER_ID===void 0&&a&&(d.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:d.WORKER_ID,results:d.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=d.parse(a.input,a.config))&&i.postMessage({workerId:d.WORKER_ID,results:a,finished:!0})}),(H.prototype=Object.create(J.prototype)).constructor=H,(I.prototype=Object.create(J.prototype)).constructor=I,(G.prototype=Object.create(G.prototype)).constructor=G,(ve.prototype=Object.create(J.prototype)).constructor=ve,d})})(mt)),mt.exports}var gn=_n();const It=La(gn);var mn=M('<span class="remote-cell-label svelte-63hltt"> </span>'),yn=M('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),wn=M('<span class="remote-cell-label svelte-63hltt"> </span>'),kn=M('<td><!> <input class="cell-input svelte-63hltt"/></td>'),bn=M('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),xn=M("<!> <span>Add row</span>",1),En=M('<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 Cn(U,t){at(t,!0);let v=ct(t,"remoteCursors",19,()=>[]),i=Ae(Qe([])),f=Ae(Qe([])),R=Ae(void 0);function b(p){const c=It.parse(p.trim(),{header:!1,skipEmptyLines:!0});c.data.length>0?(C(i,c.data[0],!0),C(f,c.data.slice(1),!0)):(C(i,[],!0),C(f,[],!0))}b(t.content),Ge(()=>{b(t.content)});function x(){return It.unparse([e(i),...e(f)])}function Y(){const p=x();t.onchange?.(p)}function d(p,c,o){e(f)[p][c]=o,C(f,[...e(f)],!0),Y()}function J(p,c){e(i)[p]=c,C(i,[...e(i)],!0),Y()}function H(){C(f,[...e(f),e(i).map(()=>"")],!0),Y(),q(e(f).length-1,0)}function I(p){C(f,e(f).filter((c,o)=>o!==p),!0),Y()}function G(){const p=`col${e(i).length+1}`;C(i,[...e(i),p],!0),C(f,e(f).map(c=>[...c,""]),!0),Y(),requestAnimationFrame(()=>{const c=e(R)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);c&&(c.focus(),c.select())})}function ve(p){e(i).length<=1||(C(i,e(i).filter((c,o)=>o!==p),!0),C(f,e(f).map(c=>c.filter((o,h)=>h!==p)),!0),Y())}function q(p,c){requestAnimationFrame(()=>{if(!e(R))return;let o=null;p<0?o=e(R).querySelector(`thead th:nth-child(${c+2}) input`):o=e(R).querySelector(`tbody tr:nth-child(${p+1}) td:nth-child(${c+2}) input`),o&&(o.focus(),o.select())})}function ke(p,c,o){if(p.key==="Tab"){p.preventDefault(),p.shiftKey?o>0?q(c,o-1):c>0?q(c-1,e(i).length-1):c===0&&q(-1,e(i).length-1):o<e(i).length-1?q(c,o+1):c<e(f).length-1?q(c+1,0):c===e(f).length-1&&H();return}if(p.key==="Enter"){p.preventDefault(),p.shiftKey?c>0?q(c-1,o):q(-1,o):c<e(f).length-1?q(c+1,o):H();return}if(p.key==="Escape"){p.target.blur();return}}function xe(p,c){if(p.key==="Tab"){p.preventDefault(),p.shiftKey?c>0&&q(-1,c-1):c<e(i).length-1?q(-1,c+1):e(f).length>0&&q(0,0);return}if(p.key==="Enter"){p.preventDefault(),e(f).length>0?q(0,c):H();return}if(p.key==="Escape"){p.target.blur();return}}function F(p,c){return v().find(o=>o.row===p&&o.col===c)}function ce(p,c){t.oncellselect?.(p,c)}function Ee(p){(p.metaKey||p.ctrlKey)&&p.key==="s"&&(p.preventDefault(),t.onsave?.())}var _e=En(),E=S(_e),m=S(E),a=S(m),n=S(a),l=W(S(n));Me(l,17,()=>e(i),Ue,(p,c,o)=>{const h=De(()=>F(-1,o));var g=yn();let u;var A=S(g);{var r=$=>{var P=mn(),D=S(P,!0);y(P),ye(()=>{Be(P,`background-color: ${e(h).color??""}`),me(D,e(h).name)}),w($,P)};Ce(A,$=>{e(h)&&$(r)})}var s=W(A,2);lt(s);var z=W(s,2);{var O=$=>{Ie($,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>ve(o),children:(P,D)=>{zt(P,{size:12})},$$slots:{default:!0}})};Ce(z,$=>{e(i).length>1&&$(O)})}y(g),ye(()=>{Be(g,e(h)?`--rc-color: ${e(h).color}`:""),u=tt(g,1,"svelte-63hltt",null,u,{"remote-active":!!e(h)}),At(s,e(c))}),Ne("input",s,$=>J(o,$.currentTarget.value)),Ne("keydown",s,$=>xe($,o)),Je("focus",s,()=>ce(-1,o)),w(p,g)});var _=W(l),k=S(_);Ie(k,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:G,children:(p,c)=>{wt(p,{size:14})},$$slots:{default:!0}}),y(_),y(n),y(a);var j=W(a);Me(j,21,()=>e(f),Ue,(p,c,o)=>{var h=bn(),g=S(h);g.textContent=o+1;var u=W(g);Me(u,17,()=>e(c),Ue,(s,z,O)=>{const $=De(()=>F(o,O));var P=kn();let D;var ae=S(P);{var L=V=>{var N=wn(),ee=S(N,!0);y(N),ye(()=>{Be(N,`background-color: ${e($).color??""}`),me(ee,e($).name)}),w(V,N)};Ce(ae,V=>{e($)&&V(L)})}var ne=W(ae,2);lt(ne),y(P),ye(()=>{Be(P,e($)?`--rc-color: ${e($).color}`:""),D=tt(P,1,"svelte-63hltt",null,D,{"remote-active":!!e($)}),At(ne,e(z))}),Ne("input",ne,V=>d(o,O,V.currentTarget.value)),Ne("keydown",ne,V=>ke(V,o,O)),Je("focus",ne,()=>ce(o,O)),w(s,P)});var A=W(u),r=S(A);Ie(r,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>I(o),children:(s,z)=>{zt(s,{size:12})},$$slots:{default:!0}}),y(A),y(h),w(p,h)}),y(j),y(m),kt(m,p=>C(R,p),()=>e(R)),y(E);var ge=W(E,2),fe=S(ge);Ie(fe,{variant:"ghost",class:"add-row-btn",onclick:H,children:(p,c)=>{var o=xn(),h=we(o);wt(h,{size:14}),qe(2),w(p,o)},$$slots:{default:!0}}),y(ge),y(_e),Ne("keydown",_e,Ee),w(U,_e),nt()}Dt(["keydown","input"]);const Sn=/^\d{4}-\d{2}-\d{2}/,Pn=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),An=new Set(["entity_type","format"]),Rn=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Dn(U,t){const v=[];for(const[i,f]of Object.entries(U)){if(Rn.has(i)||f==null)continue;const R=Tn(i,f);R&&v.push(R)}return v}function Tn(U,t){if(An.has(U))return{key:U,value:String(t).toUpperCase(),type:"badge"};if(U==="status")return{key:U,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const x=t.map(Y=>Object.entries(Y).map(([J,H])=>`${J}: ${H}`).join(", "));return{key:U,value:x.join(" | "),type:"text"}}const f=t.map(String),R=f.some(x=>/^\[\[.+?\]\]$/.test(x)),b=f.map(x=>{const Y=x.match(/^\[\[(.+?)\]\]$/);return Y?Y[1]:x});return R||b.every(x=>jt(x))?{key:U,value:b,type:"wikilink"}:{key:U,value:f.join(", "),type:"text"}}const v=String(t),i=v.match(/^\[\[(.+?)\]\]$/);return i?{key:U,value:i[1],type:"wikilink"}:Sn.test(v)?{key:U,value:v,type:"date"}:Pn.has(v.toLowerCase())?{key:U,value:v,type:"status"}:jt(v)&&!v.includes(" ")?{key:U,value:v,type:"wikilink"}:{key:U,value:v,type:"text"}}function jt(U){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(U)&&U.includes("-")}function Nt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];$e(U,Xe({name:"loader-circle"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}class On{diff(t,v,i={}){let f;typeof i=="function"?(f=i,i={}):"callback"in i&&(f=i.callback);const R=this.castInput(t,i),b=this.castInput(v,i),x=this.removeEmpty(this.tokenize(R,i)),Y=this.removeEmpty(this.tokenize(b,i));return this.diffWithOptionsObj(x,Y,i,f)}diffWithOptionsObj(t,v,i,f){var R;const b=F=>{if(F=this.postProcess(F,i),f){setTimeout(function(){f(F)},0);return}else return F},x=v.length,Y=t.length;let d=1,J=x+Y;i.maxEditLength!=null&&(J=Math.min(J,i.maxEditLength));const H=(R=i.timeout)!==null&&R!==void 0?R:1/0,I=Date.now()+H,G=[{oldPos:-1,lastComponent:void 0}];let ve=this.extractCommon(G[0],v,t,0,i);if(G[0].oldPos+1>=Y&&ve+1>=x)return b(this.buildValues(G[0].lastComponent,v,t));let q=-1/0,ke=1/0;const xe=()=>{for(let F=Math.max(q,-d);F<=Math.min(ke,d);F+=2){let ce;const Ee=G[F-1],_e=G[F+1];Ee&&(G[F-1]=void 0);let E=!1;if(_e){const a=_e.oldPos-F;E=_e&&0<=a&&a<x}const m=Ee&&Ee.oldPos+1<Y;if(!E&&!m){G[F]=void 0;continue}if(!m||E&&Ee.oldPos<_e.oldPos?ce=this.addToPath(_e,!0,!1,0,i):ce=this.addToPath(Ee,!1,!0,1,i),ve=this.extractCommon(ce,v,t,F,i),ce.oldPos+1>=Y&&ve+1>=x)return b(this.buildValues(ce.lastComponent,v,t))||!0;G[F]=ce,ce.oldPos+1>=Y&&(ke=Math.min(ke,F-1)),ve+1>=x&&(q=Math.max(q,F+1))}d++};if(f)(function F(){setTimeout(function(){if(d>J||Date.now()>I)return f(void 0);xe()||F()},0)})();else for(;d<=J&&Date.now()<=I;){const F=xe();if(F)return F}}addToPath(t,v,i,f,R){const b=t.lastComponent;return b&&!R.oneChangePerToken&&b.added===v&&b.removed===i?{oldPos:t.oldPos+f,lastComponent:{count:b.count+1,added:v,removed:i,previousComponent:b.previousComponent}}:{oldPos:t.oldPos+f,lastComponent:{count:1,added:v,removed:i,previousComponent:b}}}extractCommon(t,v,i,f,R){const b=v.length,x=i.length;let Y=t.oldPos,d=Y-f,J=0;for(;d+1<b&&Y+1<x&&this.equals(i[Y+1],v[d+1],R);)d++,Y++,J++,R.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return J&&!R.oneChangePerToken&&(t.lastComponent={count:J,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=Y,d}equals(t,v,i){return i.comparator?i.comparator(t,v):t===v||!!i.ignoreCase&&t.toLowerCase()===v.toLowerCase()}removeEmpty(t){const v=[];for(let i=0;i<t.length;i++)t[i]&&v.push(t[i]);return v}castInput(t,v){return t}tokenize(t,v){return Array.from(t)}join(t){return t.join("")}postProcess(t,v){return t}get useLongestToken(){return!1}buildValues(t,v,i){const f=[];let R;for(;t;)f.push(t),R=t.previousComponent,delete t.previousComponent,t=R;f.reverse();const b=f.length;let x=0,Y=0,d=0;for(;x<b;x++){const J=f[x];if(J.removed)J.value=this.join(i.slice(d,d+J.count)),d+=J.count;else{if(!J.added&&this.useLongestToken){let H=v.slice(Y,Y+J.count);H=H.map(function(I,G){const ve=i[d+G];return ve.length>I.length?ve:I}),J.value=this.join(H)}else J.value=this.join(v.slice(Y,Y+J.count));Y+=J.count,J.added||(d+=J.count)}}return f}}const Kt="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 Ln extends On{tokenize(t){const v=new RegExp(`(\\r?\\n)|[${Kt}]+|[^\\S\\n\\r]+|[^${Kt}]`,"ug");return t.match(v)||[]}}const zn=new Ln;function Fn(U,t,v){return zn.diff(U,t,v)}var Mn=M('<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>'),In=M('<div class="diff-properties svelte-1g4tvol"></div>'),jn=M('<span class="db-added"> </span>'),Nn=M('<span class="db-removed"> </span>'),Kn=M("<span> </span>"),Un=M("<span> </span>"),qn=M('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function Vn(U,t){at(t,!0);function v(I){if(I==null)return"";if(typeof I!="object")return String(I);const G=I;return String(G.name??G.title??G.label??G.id??JSON.stringify(G))}function i(I){return I==null?"":Array.isArray(I)?I.map(v).join(", "):typeof I=="object"?v(I):String(I)}const f=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Fn(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var R=qn(),b=S(R);{var x=I=>{var G=In();Me(G,21,()=>t.refreshResult.diffs,Ue,(ve,q)=>{const ke=De(()=>t.properties.find(o=>o.key===e(q).field));var xe=Mn(),F=S(xe),ce=S(F);{var Ee=o=>{pt(o,{size:14})},_e=o=>{_t(o,{size:14})},E=o=>{gt(o,{size:14})},m=o=>{Bt(o,{size:14})},a=o=>{ht(o,{size:14})};Ce(ce,o=>{e(ke)?.type==="date"?o(Ee):e(ke)?.type==="status"?o(_e,1):e(ke)?.type==="wikilink"?o(E,2):e(ke)?.type==="badge"?o(m,3):o(a,!1)})}y(F);var n=W(F,2),l=S(n,!0);y(n);var _=W(n,2),k=S(_),j=S(k),ge=S(j,!0);y(j),y(k);var fe=W(k,2),p=S(fe),c=S(p,!0);y(p),y(fe),y(_),y(xe),ye((o,h)=>{me(l,e(q).field),me(ge,o),me(c,h)},[()=>i(e(q).old_value),()=>i(e(q).new_value)]),w(ve,xe)}),y(G),w(I,G)};Ce(b,I=>{t.refreshResult.diffs.length>0&&I(x)})}var Y=W(b,2),d=S(Y);{var J=I=>{var G=Le(),ve=we(G);Me(ve,17,()=>e(f),Ue,(q,ke)=>{var xe=Le(),F=we(xe);{var ce=E=>{var m=jn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)},Ee=E=>{var m=Nn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)},_e=E=>{var m=Kn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)};Ce(F,E=>{e(ke).added?E(ce):e(ke).removed?E(Ee,1):E(_e,!1)})}w(q,xe)}),w(I,G)},H=I=>{var G=Un(),ve=S(G,!0);y(G),ye(()=>me(ve,t.bodyContent)),w(I,G)};Ce(d,I=>{e(f)?I(J):I(H,!1)})}y(Y),y(R),w(U,R),nt()}var Wn=M("<!> ",1),Hn=M('<span class="diff-action-title svelte-1dc9loe">Changes from source</span> <div class="diff-action-buttons svelte-1dc9loe"><!> <!></div>',1),Bn=M('<span class="bc-sep svelte-1dc9loe">/</span>'),Yn=M("<!><span> </span>",1),Jn=M('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),Qn=M('<span class="status-text error svelte-1dc9loe"> </span>'),Gn=M("<!> ",1),Zn=M('<div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!> <!></div>',1),Xn=M('<div class="refresh-panel svelte-1dc9loe"><div class="refresh-uptodate svelte-1dc9loe">Entity is up to date with source.</div></div>'),$n=M('<div class="document-scroll svelte-1dc9loe"><!> <!></div>'),er=M('<div class="content-row svelte-1dc9loe"><div class="entity-area svelte-1dc9loe"><!> <div><!></div> <!> <!></div> <!></div>'),tr=M("<!> <!>",1),ar=M("<!> <!>",1),nr=M("<!> <!>",1);function wr(U,t){at(t,!0);const v=Vt("chat"),i=De(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),f=De(()=>yt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),R=De(()=>()=>{const g=t.data.entity.path;if(g){const u=g.lastIndexOf(`/${t.data.repo}/`);if(u>=0)return g.substring(u+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let b=Ae(""),x=Ae(Qe({})),Y=Ae(0);const d=De(()=>Dn(e(x))),J=De(()=>!!t.data.entity.data?.source_ref);let H=Ae(!1),I=Ae(null),G=Ae(null);async function ve(){if(!e(H)){C(H,!0),C(I,null),C(G,null);try{const{result:g}=await Aa(t.data.repo,t.data.type,t.data.id);C(I,g,!0)}catch(g){C(G,g.message||"Refresh failed",!0)}finally{C(H,!1)}}}let q=Ae(!1);async function ke(){if(!e(q)){C(q,!0);try{await Pa(t.data.repo,t.data.type,t.data.id),C(I,null),await da()}catch(g){C(G,g.message||"Apply changes failed",!0)}finally{C(q,!1)}}}let xe=null,F=Ae(""),ce=!1,Ee=Ae(Qe([]));function _e(g){E(),We(async()=>{const{createCollabSession:u}=await import("../chunks/C7axjIkO.js");return{createCollabSession:u}},__vite__mapDeps([7,8,9,10,11,12,13,14]),import.meta.url).then(({createCollabSession:u})=>{const A=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",r=u(g,{name:sa.user?.displayName??"Anonymous",color:A,colorLight:A+"33"});r.ytext.observe(()=>{const O=r.ytext.toString();O!==e(b)&&(ce=!0,C(b,O,!0),requestAnimationFrame(()=>{ce=!1}))});const s=r.ydoc.clientID;function z(){const O=[];r.awareness.getStates().forEach(($,P)=>{if(P===s)return;const D=$.cell;if(D==null||D.row==null||D.col==null)return;const{name:ae="Anonymous",color:L="#6e6ee8"}=$.user||{};O.push({row:D.row,col:D.col,name:ae,color:L})}),C(Ee,O,!0)}r.awareness.on("change",z),xe=r,C(F,g,!0)})}function E(){xe&&(xe.destroy(),xe=null,C(F,""),C(Ee,[],!0))}Wt(()=>E());let m=Ae(""),a=Ae(0);Ge(()=>{const g=`${t.data.repo}/${t.data.type}/${t.data.id}`,u=Ra.mutationCount;if(g!==e(m)||u!==e(a)){e(m)&&g!==e(m)&&je.flush(),C(m,g),C(a,u,!0),C(b,t.data.entity.document?.content??"",!0),C(x,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ot(Y),je.reset();const A=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(i)&&A!==e(F)?_e(A):e(i)||E()}}),Ge(()=>{const g=t.data.repo,u=t.data.type,A=t.data.id;Ut(()=>{Pt.select(g,u,A),Pt.showEntity()})});function n(g){if(!ce){if(C(b,g,!0),xe){const u=xe.ytext,A=u.toString();g!==A&&xe.ydoc.transact(()=>{u.delete(0,u.length),u.insert(0,g)})}je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:g})}}function l(g,u){C(x,{...e(x),[g]:u},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function _(g){const{[g]:u,...A}=e(x);C(x,A,!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function k(g,u){C(x,{...e(x),[g]:u},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function j(g,u){je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function ge(g){for(const u of yt.repos){const A=u.entities.find(r=>r.id===g);if(A){Rt(`/${u.name}/${A.entityType}/${A.id}`);return}}ua.showToast(`"${g}" is in a collection you don't have access to`)}Ge(()=>(Ft.enter(t.data.repo,t.data.type,t.data.id),()=>Ft.leave()));const fe=De(()=>e(I)!==null&&(e(I).diffs.length>0||e(I).body_changed));function p(g){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),je.flush()),g.key==="Escape"&&!(g.target instanceof HTMLInputElement||g.target instanceof HTMLTextAreaElement)&&(je.flush(),Pt.deselect(),Rt("/"))}var c=nr();Je("keydown",qt,p);var o=we(c);ya(o,{children:(g,u)=>{var A=er(),r=S(A),s=S(r);Da(s,{activeView:"entity"});var z=W(s,2);let O;var $=S(z);{var P=re=>{var T=Hn(),le=W(we(T),2),Pe=S(le);Ie(Pe,{variant:"outline",size:"default",onclick:()=>C(I,null),get disabled(){return e(q)},children:(K,Q)=>{qe();var Z=Ye("Dismiss");w(K,Z)},$$slots:{default:!0}});var te=W(Pe,2);Ie(te,{variant:"accent",size:"default",onclick:ke,get disabled(){return e(q)},children:(K,Q)=>{var Z=Wn(),ue=we(Z);{var he=se=>{Nt(se,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Ce(ue,se=>{e(q)&&se(he)})}var Se=W(ue,1,!0);ye(()=>me(Se,e(q)?"Applying...":"Apply changes")),w(K,Z)},$$slots:{default:!0}}),y(le),w(re,T)},D=re=>{var T=Zn(),le=we(T);Me(le,21,()=>e(R)(),Ue,(se,ie,Re)=>{var oe=Yn(),X=we(oe);{var de=Te=>{var Oe=Bn();w(Te,Oe)};Ce(X,Te=>{Re>0&&Te(de)})}var pe=W(X),be=S(pe,!0);y(pe),ye(Te=>{tt(pe,1,Te,"svelte-1dc9loe"),me(be,e(ie))},[()=>ia(Re===e(R)().length-1?"bc-current":"bc-segment")]),w(se,oe)}),y(le);var Pe=W(le,2),te=S(Pe);{var K=se=>{var ie=Jn();w(se,ie)},Q=se=>{var ie=Qn(),Re=S(ie,!0);y(ie),ye(()=>me(Re,je.error)),w(se,ie)};Ce(te,se=>{je.saving?se(K):je.error&&se(Q,1)})}var Z=W(te,2);{var ue=se=>{Ie(se,{variant:"outline",size:"sm",class:"refresh-btn",onclick:ve,get disabled(){return e(H)},children:(ie,Re)=>{var oe=Gn(),X=we(oe);{var de=be=>{Nt(be,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Ce(X,be=>{e(H)&&be(de)})}var pe=W(X,1,!0);ye(()=>me(pe,e(H)?"Refreshing...":"Refresh from source")),w(ie,oe)},$$slots:{default:!0}})};Ce(Z,se=>{e(J)&&se(ue)})}var he=W(Z,2);{var Se=se=>{Ie(se,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(ie,Re)=>{qe();var oe=Ye();ye(()=>me(oe,`Open in ${e(f).name??""} →`)),w(ie,oe)},$$slots:{default:!0}})};Ce(he,se=>{e(f)&&se(Se)})}y(Pe),w(re,T)};Ce($,re=>{e(fe)?re(P):re(D,!1)})}y(z);var ae=W(z,2);{var L=re=>{var T=Xn();w(re,T)};Ce(ae,re=>{e(I)&&!e(fe)&&re(L)})}var ne=W(ae,2);{var V=re=>{Vn(re,{get properties(){return e(d)},get refreshResult(){return e(I)},get bodyContent(){return e(b)}})},N=re=>{var T=$n(),le=S(T);un(le,{get properties(){return e(d)},editable:!0,onedit:l,onremove:_,onadd:k,ontypechange:j});var Pe=W(le,2);{var te=Q=>{Cn(Q,{get content(){return e(b)},onchange:n,onsave:()=>je.flush(),oncellselect:(Z,ue)=>{xe?.awareness.setLocalStateField("cell",{row:Z,col:ue})},get remoteCursors(){return e(Ee)}})},K=Q=>{{let Z=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);hn(Q,{get content(){return e(b)},readonly:!1,onchange:n,onsave:()=>je.flush(),onwikilinkclick:ge,get resetKey(){return e(Y)},get cursorDocName(){return e(Z)}})}};Ce(Pe,Q=>{e(i)?Q(te):Q(K,!1)})}y(T),w(re,T)};Ce(ne,re=>{e(fe)?re(V):re(N,!1)})}y(r);var ee=W(r,2);{var B=re=>{Ta(re,{})};Ce(ee,re=>{v.open&&re(B)})}y(A),ye(()=>O=tt(z,1,"editor-bar svelte-1dc9loe",null,O,{"editor-bar-diff":e(fe)})),w(g,A)},$$slots:{default:!0}});var h=W(o,2);{let g=De(()=>!!e(G));Ke(h,()=>Sa,(u,A)=>{A(u,{get open(){return e(g)},onOpenChange:r=>{r||C(G,null)},children:(r,s)=>{var z=Le(),O=we(z);Ke(O,()=>wa,($,P)=>{P($,{children:(D,ae)=>{var L=ar(),ne=we(L);Ke(ne,()=>ka,(N,ee)=>{ee(N,{children:(B,re)=>{var T=tr(),le=we(T);Ke(le,()=>ba,(te,K)=>{K(te,{children:(Q,Z)=>{qe();var ue=Ye("Refresh failed");w(Q,ue)},$$slots:{default:!0}})});var Pe=W(le,2);Ke(Pe,()=>xa,(te,K)=>{K(te,{children:(Q,Z)=>{qe();var ue=Ye();ye(()=>me(ue,e(G))),w(Q,ue)},$$slots:{default:!0}})}),w(B,T)},$$slots:{default:!0}})});var V=W(ne,2);Ke(V,()=>Ea,(N,ee)=>{ee(N,{children:(B,re)=>{var T=Le(),le=we(T);Ke(le,()=>Ca,(Pe,te)=>{te(Pe,{children:(K,Q)=>{qe();var Z=Ye("OK");w(K,Z)},$$slots:{default:!0}})}),w(B,T)},$$slots:{default:!0}})}),w(D,L)},$$slots:{default:!0}})}),w(r,z)},$$slots:{default:!0}})})}w(U,c),nt()}export{wr as component,yr as universal};
|
|
11
|
+
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!R&&!!i.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=xe,d.ParserHandle=q,d.NetworkStreamer=H,d.FileStreamer=I,d.StringStreamer=G,d.ReadableStreamStreamer=ve,i.jQuery&&((f=i.jQuery).fn.parse=function(a){var n=a.config||{},l=[];return this.each(function(j){if(!(f(this).prop("tagName").toUpperCase()==="INPUT"&&f(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var ge=0;ge<this.files.length;ge++)l.push({file:this.files[ge],inputElem:this,instanceConfig:f.extend({},n)})}),_(),this;function _(){if(l.length===0)m(a.complete)&&a.complete();else{var j,ge,fe,p,c=l[0];if(m(a.before)){var o=a.before(c.file,c.inputElem);if(typeof o=="object"){if(o.action==="abort")return j="AbortError",ge=c.file,fe=c.inputElem,p=o.reason,void(m(a.error)&&a.error({name:j},ge,fe,p));if(o.action==="skip")return void k();typeof o.config=="object"&&(c.instanceConfig=f.extend(c.instanceConfig,o.config))}else if(o==="skip")return void k()}var h=c.instanceConfig.complete;c.instanceConfig.complete=function(g){m(h)&&h(g,c.file,c.inputElem),k()},d.parse(c.file,c.instanceConfig)}}function k(){l.splice(0,1),_()}}),b&&(i.onmessage=function(a){a=a.data,d.WORKER_ID===void 0&&a&&(d.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:d.WORKER_ID,results:d.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=d.parse(a.input,a.config))&&i.postMessage({workerId:d.WORKER_ID,results:a,finished:!0})}),(H.prototype=Object.create(J.prototype)).constructor=H,(I.prototype=Object.create(J.prototype)).constructor=I,(G.prototype=Object.create(G.prototype)).constructor=G,(ve.prototype=Object.create(J.prototype)).constructor=ve,d})})(mt)),mt.exports}var gn=_n();const It=La(gn);var mn=M('<span class="remote-cell-label svelte-63hltt"> </span>'),yn=M('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),wn=M('<span class="remote-cell-label svelte-63hltt"> </span>'),kn=M('<td><!> <input class="cell-input svelte-63hltt"/></td>'),bn=M('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),xn=M("<!> <span>Add row</span>",1),En=M('<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 Cn(U,t){at(t,!0);let v=ct(t,"remoteCursors",19,()=>[]),i=Ae(Qe([])),f=Ae(Qe([])),R=Ae(void 0);function b(p){const c=It.parse(p.trim(),{header:!1,skipEmptyLines:!0});c.data.length>0?(C(i,c.data[0],!0),C(f,c.data.slice(1),!0)):(C(i,[],!0),C(f,[],!0))}b(t.content),Ge(()=>{b(t.content)});function x(){return It.unparse([e(i),...e(f)])}function Y(){const p=x();t.onchange?.(p)}function d(p,c,o){e(f)[p][c]=o,C(f,[...e(f)],!0),Y()}function J(p,c){e(i)[p]=c,C(i,[...e(i)],!0),Y()}function H(){C(f,[...e(f),e(i).map(()=>"")],!0),Y(),q(e(f).length-1,0)}function I(p){C(f,e(f).filter((c,o)=>o!==p),!0),Y()}function G(){const p=`col${e(i).length+1}`;C(i,[...e(i),p],!0),C(f,e(f).map(c=>[...c,""]),!0),Y(),requestAnimationFrame(()=>{const c=e(R)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);c&&(c.focus(),c.select())})}function ve(p){e(i).length<=1||(C(i,e(i).filter((c,o)=>o!==p),!0),C(f,e(f).map(c=>c.filter((o,h)=>h!==p)),!0),Y())}function q(p,c){requestAnimationFrame(()=>{if(!e(R))return;let o=null;p<0?o=e(R).querySelector(`thead th:nth-child(${c+2}) input`):o=e(R).querySelector(`tbody tr:nth-child(${p+1}) td:nth-child(${c+2}) input`),o&&(o.focus(),o.select())})}function ke(p,c,o){if(p.key==="Tab"){p.preventDefault(),p.shiftKey?o>0?q(c,o-1):c>0?q(c-1,e(i).length-1):c===0&&q(-1,e(i).length-1):o<e(i).length-1?q(c,o+1):c<e(f).length-1?q(c+1,0):c===e(f).length-1&&H();return}if(p.key==="Enter"){p.preventDefault(),p.shiftKey?c>0?q(c-1,o):q(-1,o):c<e(f).length-1?q(c+1,o):H();return}if(p.key==="Escape"){p.target.blur();return}}function xe(p,c){if(p.key==="Tab"){p.preventDefault(),p.shiftKey?c>0&&q(-1,c-1):c<e(i).length-1?q(-1,c+1):e(f).length>0&&q(0,0);return}if(p.key==="Enter"){p.preventDefault(),e(f).length>0?q(0,c):H();return}if(p.key==="Escape"){p.target.blur();return}}function F(p,c){return v().find(o=>o.row===p&&o.col===c)}function ce(p,c){t.oncellselect?.(p,c)}function Ee(p){(p.metaKey||p.ctrlKey)&&p.key==="s"&&(p.preventDefault(),t.onsave?.())}var _e=En(),E=S(_e),m=S(E),a=S(m),n=S(a),l=W(S(n));Me(l,17,()=>e(i),Ue,(p,c,o)=>{const h=De(()=>F(-1,o));var g=yn();let u;var A=S(g);{var r=$=>{var P=mn(),D=S(P,!0);y(P),ye(()=>{Be(P,`background-color: ${e(h).color??""}`),me(D,e(h).name)}),w($,P)};Ce(A,$=>{e(h)&&$(r)})}var s=W(A,2);lt(s);var z=W(s,2);{var O=$=>{Ie($,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>ve(o),children:(P,D)=>{zt(P,{size:12})},$$slots:{default:!0}})};Ce(z,$=>{e(i).length>1&&$(O)})}y(g),ye(()=>{Be(g,e(h)?`--rc-color: ${e(h).color}`:""),u=tt(g,1,"svelte-63hltt",null,u,{"remote-active":!!e(h)}),At(s,e(c))}),Ne("input",s,$=>J(o,$.currentTarget.value)),Ne("keydown",s,$=>xe($,o)),Je("focus",s,()=>ce(-1,o)),w(p,g)});var _=W(l),k=S(_);Ie(k,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:G,children:(p,c)=>{wt(p,{size:14})},$$slots:{default:!0}}),y(_),y(n),y(a);var j=W(a);Me(j,21,()=>e(f),Ue,(p,c,o)=>{var h=bn(),g=S(h);g.textContent=o+1;var u=W(g);Me(u,17,()=>e(c),Ue,(s,z,O)=>{const $=De(()=>F(o,O));var P=kn();let D;var ae=S(P);{var L=V=>{var N=wn(),ee=S(N,!0);y(N),ye(()=>{Be(N,`background-color: ${e($).color??""}`),me(ee,e($).name)}),w(V,N)};Ce(ae,V=>{e($)&&V(L)})}var ne=W(ae,2);lt(ne),y(P),ye(()=>{Be(P,e($)?`--rc-color: ${e($).color}`:""),D=tt(P,1,"svelte-63hltt",null,D,{"remote-active":!!e($)}),At(ne,e(z))}),Ne("input",ne,V=>d(o,O,V.currentTarget.value)),Ne("keydown",ne,V=>ke(V,o,O)),Je("focus",ne,()=>ce(o,O)),w(s,P)});var A=W(u),r=S(A);Ie(r,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>I(o),children:(s,z)=>{zt(s,{size:12})},$$slots:{default:!0}}),y(A),y(h),w(p,h)}),y(j),y(m),kt(m,p=>C(R,p),()=>e(R)),y(E);var ge=W(E,2),fe=S(ge);Ie(fe,{variant:"ghost",class:"add-row-btn",onclick:H,children:(p,c)=>{var o=xn(),h=we(o);wt(h,{size:14}),qe(2),w(p,o)},$$slots:{default:!0}}),y(ge),y(_e),Ne("keydown",_e,Ee),w(U,_e),nt()}Dt(["keydown","input"]);const Sn=/^\d{4}-\d{2}-\d{2}/,Pn=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),An=new Set(["entity_type","format"]),Rn=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Dn(U,t){const v=[];for(const[i,f]of Object.entries(U)){if(Rn.has(i)||f==null)continue;const R=Tn(i,f);R&&v.push(R)}return v}function Tn(U,t){if(An.has(U))return{key:U,value:String(t).toUpperCase(),type:"badge"};if(U==="status")return{key:U,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const x=t.map(Y=>Object.entries(Y).map(([J,H])=>`${J}: ${H}`).join(", "));return{key:U,value:x.join(" | "),type:"text"}}const f=t.map(String),R=f.some(x=>/^\[\[.+?\]\]$/.test(x)),b=f.map(x=>{const Y=x.match(/^\[\[(.+?)\]\]$/);return Y?Y[1]:x});return R||b.every(x=>jt(x))?{key:U,value:b,type:"wikilink"}:{key:U,value:f.join(", "),type:"text"}}const v=String(t),i=v.match(/^\[\[(.+?)\]\]$/);return i?{key:U,value:i[1],type:"wikilink"}:Sn.test(v)?{key:U,value:v,type:"date"}:Pn.has(v.toLowerCase())?{key:U,value:v,type:"status"}:jt(v)&&!v.includes(" ")?{key:U,value:v,type:"wikilink"}:{key:U,value:v,type:"text"}}function jt(U){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(U)&&U.includes("-")}function Nt(U,t){const v=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];$e(U,Xe({name:"loader-circle"},()=>v,{get iconNode(){return i},children:(f,R)=>{var b=Le(),x=we(b);et(x,t,"default",{}),w(f,b)},$$slots:{default:!0}}))}class On{diff(t,v,i={}){let f;typeof i=="function"?(f=i,i={}):"callback"in i&&(f=i.callback);const R=this.castInput(t,i),b=this.castInput(v,i),x=this.removeEmpty(this.tokenize(R,i)),Y=this.removeEmpty(this.tokenize(b,i));return this.diffWithOptionsObj(x,Y,i,f)}diffWithOptionsObj(t,v,i,f){var R;const b=F=>{if(F=this.postProcess(F,i),f){setTimeout(function(){f(F)},0);return}else return F},x=v.length,Y=t.length;let d=1,J=x+Y;i.maxEditLength!=null&&(J=Math.min(J,i.maxEditLength));const H=(R=i.timeout)!==null&&R!==void 0?R:1/0,I=Date.now()+H,G=[{oldPos:-1,lastComponent:void 0}];let ve=this.extractCommon(G[0],v,t,0,i);if(G[0].oldPos+1>=Y&&ve+1>=x)return b(this.buildValues(G[0].lastComponent,v,t));let q=-1/0,ke=1/0;const xe=()=>{for(let F=Math.max(q,-d);F<=Math.min(ke,d);F+=2){let ce;const Ee=G[F-1],_e=G[F+1];Ee&&(G[F-1]=void 0);let E=!1;if(_e){const a=_e.oldPos-F;E=_e&&0<=a&&a<x}const m=Ee&&Ee.oldPos+1<Y;if(!E&&!m){G[F]=void 0;continue}if(!m||E&&Ee.oldPos<_e.oldPos?ce=this.addToPath(_e,!0,!1,0,i):ce=this.addToPath(Ee,!1,!0,1,i),ve=this.extractCommon(ce,v,t,F,i),ce.oldPos+1>=Y&&ve+1>=x)return b(this.buildValues(ce.lastComponent,v,t))||!0;G[F]=ce,ce.oldPos+1>=Y&&(ke=Math.min(ke,F-1)),ve+1>=x&&(q=Math.max(q,F+1))}d++};if(f)(function F(){setTimeout(function(){if(d>J||Date.now()>I)return f(void 0);xe()||F()},0)})();else for(;d<=J&&Date.now()<=I;){const F=xe();if(F)return F}}addToPath(t,v,i,f,R){const b=t.lastComponent;return b&&!R.oneChangePerToken&&b.added===v&&b.removed===i?{oldPos:t.oldPos+f,lastComponent:{count:b.count+1,added:v,removed:i,previousComponent:b.previousComponent}}:{oldPos:t.oldPos+f,lastComponent:{count:1,added:v,removed:i,previousComponent:b}}}extractCommon(t,v,i,f,R){const b=v.length,x=i.length;let Y=t.oldPos,d=Y-f,J=0;for(;d+1<b&&Y+1<x&&this.equals(i[Y+1],v[d+1],R);)d++,Y++,J++,R.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return J&&!R.oneChangePerToken&&(t.lastComponent={count:J,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=Y,d}equals(t,v,i){return i.comparator?i.comparator(t,v):t===v||!!i.ignoreCase&&t.toLowerCase()===v.toLowerCase()}removeEmpty(t){const v=[];for(let i=0;i<t.length;i++)t[i]&&v.push(t[i]);return v}castInput(t,v){return t}tokenize(t,v){return Array.from(t)}join(t){return t.join("")}postProcess(t,v){return t}get useLongestToken(){return!1}buildValues(t,v,i){const f=[];let R;for(;t;)f.push(t),R=t.previousComponent,delete t.previousComponent,t=R;f.reverse();const b=f.length;let x=0,Y=0,d=0;for(;x<b;x++){const J=f[x];if(J.removed)J.value=this.join(i.slice(d,d+J.count)),d+=J.count;else{if(!J.added&&this.useLongestToken){let H=v.slice(Y,Y+J.count);H=H.map(function(I,G){const ve=i[d+G];return ve.length>I.length?ve:I}),J.value=this.join(H)}else J.value=this.join(v.slice(Y,Y+J.count));Y+=J.count,J.added||(d+=J.count)}}return f}}const Kt="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 Ln extends On{tokenize(t){const v=new RegExp(`(\\r?\\n)|[${Kt}]+|[^\\S\\n\\r]+|[^${Kt}]`,"ug");return t.match(v)||[]}}const zn=new Ln;function Fn(U,t,v){return zn.diff(U,t,v)}var Mn=M('<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>'),In=M('<div class="diff-properties svelte-1g4tvol"></div>'),jn=M('<span class="db-added"> </span>'),Nn=M('<span class="db-removed"> </span>'),Kn=M("<span> </span>"),Un=M("<span> </span>"),qn=M('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function Vn(U,t){at(t,!0);function v(I){if(I==null)return"";if(typeof I!="object")return String(I);const G=I;return String(G.name??G.title??G.label??G.id??JSON.stringify(G))}function i(I){return I==null?"":Array.isArray(I)?I.map(v).join(", "):typeof I=="object"?v(I):String(I)}const f=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Fn(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var R=qn(),b=S(R);{var x=I=>{var G=In();Me(G,21,()=>t.refreshResult.diffs,Ue,(ve,q)=>{const ke=De(()=>t.properties.find(o=>o.key===e(q).field));var xe=Mn(),F=S(xe),ce=S(F);{var Ee=o=>{pt(o,{size:14})},_e=o=>{_t(o,{size:14})},E=o=>{gt(o,{size:14})},m=o=>{Bt(o,{size:14})},a=o=>{ht(o,{size:14})};Ce(ce,o=>{e(ke)?.type==="date"?o(Ee):e(ke)?.type==="status"?o(_e,1):e(ke)?.type==="wikilink"?o(E,2):e(ke)?.type==="badge"?o(m,3):o(a,!1)})}y(F);var n=W(F,2),l=S(n,!0);y(n);var _=W(n,2),k=S(_),j=S(k),ge=S(j,!0);y(j),y(k);var fe=W(k,2),p=S(fe),c=S(p,!0);y(p),y(fe),y(_),y(xe),ye((o,h)=>{me(l,e(q).field),me(ge,o),me(c,h)},[()=>i(e(q).old_value),()=>i(e(q).new_value)]),w(ve,xe)}),y(G),w(I,G)};Ce(b,I=>{t.refreshResult.diffs.length>0&&I(x)})}var Y=W(b,2),d=S(Y);{var J=I=>{var G=Le(),ve=we(G);Me(ve,17,()=>e(f),Ue,(q,ke)=>{var xe=Le(),F=we(xe);{var ce=E=>{var m=jn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)},Ee=E=>{var m=Nn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)},_e=E=>{var m=Kn(),a=S(m,!0);y(m),ye(()=>me(a,e(ke).value)),w(E,m)};Ce(F,E=>{e(ke).added?E(ce):e(ke).removed?E(Ee,1):E(_e,!1)})}w(q,xe)}),w(I,G)},H=I=>{var G=Un(),ve=S(G,!0);y(G),ye(()=>me(ve,t.bodyContent)),w(I,G)};Ce(d,I=>{e(f)?I(J):I(H,!1)})}y(Y),y(R),w(U,R),nt()}var Wn=M("<!> ",1),Hn=M('<span class="diff-action-title svelte-1dc9loe">Changes from source</span> <div class="diff-action-buttons svelte-1dc9loe"><!> <!></div>',1),Bn=M('<span class="bc-sep svelte-1dc9loe">/</span>'),Yn=M("<!><span> </span>",1),Jn=M('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),Qn=M('<span class="status-text error svelte-1dc9loe"> </span>'),Gn=M("<!> ",1),Zn=M('<div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!> <!></div>',1),Xn=M('<div class="refresh-panel svelte-1dc9loe"><div class="refresh-uptodate svelte-1dc9loe">Entity is up to date with source.</div></div>'),$n=M('<div class="document-scroll svelte-1dc9loe"><!> <!></div>'),er=M('<div class="content-row svelte-1dc9loe"><div class="entity-area svelte-1dc9loe"><!> <div><!></div> <!> <!></div> <!></div>'),tr=M("<!> <!>",1),ar=M("<!> <!>",1),nr=M("<!> <!>",1);function wr(U,t){at(t,!0);const v=Vt("chat"),i=De(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),f=De(()=>yt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),R=De(()=>()=>{const g=t.data.entity.path;if(g){const u=g.lastIndexOf(`/${t.data.repo}/`);if(u>=0)return g.substring(u+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let b=Ae(""),x=Ae(Qe({})),Y=Ae(0);const d=De(()=>Dn(e(x))),J=De(()=>!!t.data.entity.data?.source_ref);let H=Ae(!1),I=Ae(null),G=Ae(null);async function ve(){if(!e(H)){C(H,!0),C(I,null),C(G,null);try{const{result:g}=await Aa(t.data.repo,t.data.type,t.data.id);C(I,g,!0)}catch(g){C(G,g.message||"Refresh failed",!0)}finally{C(H,!1)}}}let q=Ae(!1);async function ke(){if(!e(q)){C(q,!0);try{await Pa(t.data.repo,t.data.type,t.data.id),C(I,null),await da()}catch(g){C(G,g.message||"Apply changes failed",!0)}finally{C(q,!1)}}}let xe=null,F=Ae(""),ce=!1,Ee=Ae(Qe([]));function _e(g){E(),We(async()=>{const{createCollabSession:u}=await import("../chunks/BxXlKFyx.js");return{createCollabSession:u}},__vite__mapDeps([7,8,9,10,11,12,13,14]),import.meta.url).then(({createCollabSession:u})=>{const A=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",r=u(g,{name:sa.user?.displayName??"Anonymous",color:A,colorLight:A+"33"});r.ytext.observe(()=>{const O=r.ytext.toString();O!==e(b)&&(ce=!0,C(b,O,!0),requestAnimationFrame(()=>{ce=!1}))});const s=r.ydoc.clientID;function z(){const O=[];r.awareness.getStates().forEach(($,P)=>{if(P===s)return;const D=$.cell;if(D==null||D.row==null||D.col==null)return;const{name:ae="Anonymous",color:L="#6e6ee8"}=$.user||{};O.push({row:D.row,col:D.col,name:ae,color:L})}),C(Ee,O,!0)}r.awareness.on("change",z),xe=r,C(F,g,!0)})}function E(){xe&&(xe.destroy(),xe=null,C(F,""),C(Ee,[],!0))}Wt(()=>E());let m=Ae(""),a=Ae(0);Ge(()=>{const g=`${t.data.repo}/${t.data.type}/${t.data.id}`,u=Ra.mutationCount;if(g!==e(m)||u!==e(a)){e(m)&&g!==e(m)&&je.flush(),C(m,g),C(a,u,!0),C(b,t.data.entity.document?.content??"",!0),C(x,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ot(Y),je.reset();const A=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(i)&&A!==e(F)?_e(A):e(i)||E()}}),Ge(()=>{const g=t.data.repo,u=t.data.type,A=t.data.id;Ut(()=>{Pt.select(g,u,A),Pt.showEntity()})});function n(g){if(!ce){if(C(b,g,!0),xe){const u=xe.ytext,A=u.toString();g!==A&&xe.ydoc.transact(()=>{u.delete(0,u.length),u.insert(0,g)})}je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:g})}}function l(g,u){C(x,{...e(x),[g]:u},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function _(g){const{[g]:u,...A}=e(x);C(x,A,!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function k(g,u){C(x,{...e(x),[g]:u},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function j(g,u){je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function ge(g){for(const u of yt.repos){const A=u.entities.find(r=>r.id===g);if(A){Rt(`/${u.name}/${A.entityType}/${A.id}`);return}}ua.showToast(`"${g}" is in a collection you don't have access to`)}Ge(()=>(Ft.enter(t.data.repo,t.data.type,t.data.id),()=>Ft.leave()));const fe=De(()=>e(I)!==null&&(e(I).diffs.length>0||e(I).body_changed));function p(g){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),je.flush()),g.key==="Escape"&&!(g.target instanceof HTMLInputElement||g.target instanceof HTMLTextAreaElement)&&(je.flush(),Pt.deselect(),Rt("/"))}var c=nr();Je("keydown",qt,p);var o=we(c);ya(o,{children:(g,u)=>{var A=er(),r=S(A),s=S(r);Da(s,{activeView:"entity"});var z=W(s,2);let O;var $=S(z);{var P=re=>{var T=Hn(),le=W(we(T),2),Pe=S(le);Ie(Pe,{variant:"outline",size:"default",onclick:()=>C(I,null),get disabled(){return e(q)},children:(K,Q)=>{qe();var Z=Ye("Dismiss");w(K,Z)},$$slots:{default:!0}});var te=W(Pe,2);Ie(te,{variant:"accent",size:"default",onclick:ke,get disabled(){return e(q)},children:(K,Q)=>{var Z=Wn(),ue=we(Z);{var he=se=>{Nt(se,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Ce(ue,se=>{e(q)&&se(he)})}var Se=W(ue,1,!0);ye(()=>me(Se,e(q)?"Applying...":"Apply changes")),w(K,Z)},$$slots:{default:!0}}),y(le),w(re,T)},D=re=>{var T=Zn(),le=we(T);Me(le,21,()=>e(R)(),Ue,(se,ie,Re)=>{var oe=Yn(),X=we(oe);{var de=Te=>{var Oe=Bn();w(Te,Oe)};Ce(X,Te=>{Re>0&&Te(de)})}var pe=W(X),be=S(pe,!0);y(pe),ye(Te=>{tt(pe,1,Te,"svelte-1dc9loe"),me(be,e(ie))},[()=>ia(Re===e(R)().length-1?"bc-current":"bc-segment")]),w(se,oe)}),y(le);var Pe=W(le,2),te=S(Pe);{var K=se=>{var ie=Jn();w(se,ie)},Q=se=>{var ie=Qn(),Re=S(ie,!0);y(ie),ye(()=>me(Re,je.error)),w(se,ie)};Ce(te,se=>{je.saving?se(K):je.error&&se(Q,1)})}var Z=W(te,2);{var ue=se=>{Ie(se,{variant:"outline",size:"sm",class:"refresh-btn",onclick:ve,get disabled(){return e(H)},children:(ie,Re)=>{var oe=Gn(),X=we(oe);{var de=be=>{Nt(be,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Ce(X,be=>{e(H)&&be(de)})}var pe=W(X,1,!0);ye(()=>me(pe,e(H)?"Refreshing...":"Refresh from source")),w(ie,oe)},$$slots:{default:!0}})};Ce(Z,se=>{e(J)&&se(ue)})}var he=W(Z,2);{var Se=se=>{Ie(se,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(ie,Re)=>{qe();var oe=Ye();ye(()=>me(oe,`Open in ${e(f).name??""} →`)),w(ie,oe)},$$slots:{default:!0}})};Ce(he,se=>{e(f)&&se(Se)})}y(Pe),w(re,T)};Ce($,re=>{e(fe)?re(P):re(D,!1)})}y(z);var ae=W(z,2);{var L=re=>{var T=Xn();w(re,T)};Ce(ae,re=>{e(I)&&!e(fe)&&re(L)})}var ne=W(ae,2);{var V=re=>{Vn(re,{get properties(){return e(d)},get refreshResult(){return e(I)},get bodyContent(){return e(b)}})},N=re=>{var T=$n(),le=S(T);un(le,{get properties(){return e(d)},editable:!0,onedit:l,onremove:_,onadd:k,ontypechange:j});var Pe=W(le,2);{var te=Q=>{Cn(Q,{get content(){return e(b)},onchange:n,onsave:()=>je.flush(),oncellselect:(Z,ue)=>{xe?.awareness.setLocalStateField("cell",{row:Z,col:ue})},get remoteCursors(){return e(Ee)}})},K=Q=>{{let Z=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);hn(Q,{get content(){return e(b)},readonly:!1,onchange:n,onsave:()=>je.flush(),onwikilinkclick:ge,get resetKey(){return e(Y)},get cursorDocName(){return e(Z)}})}};Ce(Pe,Q=>{e(i)?Q(te):Q(K,!1)})}y(T),w(re,T)};Ce(ne,re=>{e(fe)?re(V):re(N,!1)})}y(r);var ee=W(r,2);{var B=re=>{Ta(re,{})};Ce(ee,re=>{v.open&&re(B)})}y(A),ye(()=>O=tt(z,1,"editor-bar svelte-1dc9loe",null,O,{"editor-bar-diff":e(fe)})),w(g,A)},$$slots:{default:!0}});var h=W(o,2);{let g=De(()=>!!e(G));Ke(h,()=>Sa,(u,A)=>{A(u,{get open(){return e(g)},onOpenChange:r=>{r||C(G,null)},children:(r,s)=>{var z=Le(),O=we(z);Ke(O,()=>wa,($,P)=>{P($,{children:(D,ae)=>{var L=ar(),ne=we(L);Ke(ne,()=>ka,(N,ee)=>{ee(N,{children:(B,re)=>{var T=tr(),le=we(T);Ke(le,()=>ba,(te,K)=>{K(te,{children:(Q,Z)=>{qe();var ue=Ye("Refresh failed");w(Q,ue)},$$slots:{default:!0}})});var Pe=W(le,2);Ke(Pe,()=>xa,(te,K)=>{K(te,{children:(Q,Z)=>{qe();var ue=Ye();ye(()=>me(ue,e(G))),w(Q,ue)},$$slots:{default:!0}})}),w(B,T)},$$slots:{default:!0}})});var V=W(ne,2);Ke(V,()=>Ea,(N,ee)=>{ee(N,{children:(B,re)=>{var T=Le(),le=we(T);Ke(le,()=>Ca,(Pe,te)=>{te(Pe,{children:(K,Q)=>{qe();var Z=Ye("OK");w(K,Z)},$$slots:{default:!0}})}),w(B,T)},$$slots:{default:!0}})}),w(D,L)},$$slots:{default:!0}})}),w(r,z)},$$slots:{default:!0}})})}w(U,c),nt()}export{wr as component,yr as universal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as dt,s as J,w as ut}from"../chunks/DP09rP34.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/Cs_ROD7H.js";import{y as $,j as tt,R as mt,B as H,D as T,m as v,G as I,I as j,A as et,L as Q,K as S,f as ht,T as vt}from"../chunks/BeBar3OL.js";import{b as X,i as O}from"../chunks/xBRYfpah.js";import{A as yt}from"../chunks/
|
|
1
|
+
import{f as dt,s as J,w as ut}from"../chunks/DP09rP34.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/Cs_ROD7H.js";import{y as $,j as tt,R as mt,B as H,D as T,m as v,G as I,I as j,A as et,L as Q,K as S,f as ht,T as vt}from"../chunks/BeBar3OL.js";import{b as X,i as O}from"../chunks/xBRYfpah.js";import{A as yt}from"../chunks/Bt3IOBgW.js";import{g as pt}from"../chunks/C_8lGlxx.js";import{n as Y}from"../chunks/DEzvDbcy.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=[],h=null,_=null,A=0;function B(){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=[],h&&(h.remove(),h=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 F(){const e=++A;S(f,!0),S(m,null),B();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)}h=document.createElement("style"),h.textContent=`
|
|
2
2
|
body.sg-chrome-active { height: auto !important; }
|
|
3
3
|
body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
|
|
4
4
|
`,document.head.appendChild(h);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"),z=[],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}`),z.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 G=N=>{N.preventDefault(),N.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",G,!0),_={el:a,handler:G}}}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 z){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&&F(),x=e}),mt(()=>(F(),B));var C=_t();let q;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=>{v(f)&&e(nt)})}var D=T(W,2);{var rt=e=>{var i=wt(),r=H(i,!0);I(i),j(()=>Z(r,v(m))),k(e,i)};O(D,e=>{v(m)&&e(rt)})}var U=T(D,2);let R;X(U,e=>c=e,()=>c),I(C),j(()=>{q=J(C,1,"editor-frame svelte-1fltv0h",null,q,{loading:v(f)}),R=J(U,1,"editor-container svelte-1fltv0h",null,R,{hidden:v(f)||!!v(m)})}),k(g,C),et()}var St=M('<div class="no-editor svelte-bzivfp"> </div>');function It(g,o){$(o,!0);const l=vt(()=>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=ht(m);{var b=d=>{At(d,{get appMountPath(){return v(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(),h=H(y);I(y),j(()=>Z(h,`No app editor available for entity type "${o.data.type??""}"`)),k(d,y)};O(p,d=>{v(l)?d(b):d(w,!1)})}k(c,m)},$$slots:{default:!0}}),et()}export{It as component,Ht as universal};
|