@granularjs/ui 0.1.0 → 0.1.1
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/granular-ui.min.js +16 -8
- package/dist/granular-ui.min.js.map +3 -3
- package/package.json +1 -1
- package/src/components/Button.js +3 -1
- package/src/components/Card.js +17 -16
- package/src/components/Tabs.js +4 -7
- package/src/components/Text.js +3 -1
- package/src/theme/styles.js +15 -7
package/dist/granular-ui.min.js
CHANGED
|
@@ -802,7 +802,6 @@ body {
|
|
|
802
802
|
line-height: 1;
|
|
803
803
|
display: inline-flex;
|
|
804
804
|
align-items: center;
|
|
805
|
-
justify-content: center;
|
|
806
805
|
}
|
|
807
806
|
.g-ui-button:active { transform: translateY(1px); }
|
|
808
807
|
.g-ui-button:disabled { opacity: 0.6; cursor: not-allowed; }
|
|
@@ -879,6 +878,11 @@ body {
|
|
|
879
878
|
flex-direction: column;
|
|
880
879
|
gap: var(--g-ui-space-6);
|
|
881
880
|
}
|
|
881
|
+
.g-ui-text-ellipsis {
|
|
882
|
+
overflow: hidden;
|
|
883
|
+
text-overflow: ellipsis;
|
|
884
|
+
white-space: nowrap;
|
|
885
|
+
}
|
|
882
886
|
.g-ui-text-input-label {
|
|
883
887
|
font-size: 13px;
|
|
884
888
|
font-weight: 500;
|
|
@@ -944,6 +948,9 @@ body {
|
|
|
944
948
|
padding: 0;
|
|
945
949
|
width: 28px;
|
|
946
950
|
height: 28px;
|
|
951
|
+
display: flex;
|
|
952
|
+
align-items: center;
|
|
953
|
+
justify-content: center;
|
|
947
954
|
}
|
|
948
955
|
.g-ui-modal-close svg {
|
|
949
956
|
width: 16px;
|
|
@@ -983,6 +990,7 @@ body {
|
|
|
983
990
|
background: var(--g-ui-bg);
|
|
984
991
|
position: relative;
|
|
985
992
|
transition: background-color .12s ease, border-color .12s ease;
|
|
993
|
+
cursor: pointer;
|
|
986
994
|
}
|
|
987
995
|
.g-ui-checkbox-input:focus-visible {
|
|
988
996
|
outline: 2px solid var(--g-ui-primary);
|
|
@@ -1063,14 +1071,14 @@ body {
|
|
|
1063
1071
|
border-color: var(--g-ui-primary);
|
|
1064
1072
|
}
|
|
1065
1073
|
.g-ui-switch-input:checked::after {
|
|
1066
|
-
transform: translateX(calc(var(--g-ui-switch-width, 36px) - var(--g-ui-switch-thumb, 14px) - (var(--g-ui-switch-offset, 2px) * 2)));
|
|
1074
|
+
transform: translateX(calc(var(--g-ui-switch-width, 36px) - var(--g-ui-switch-thumb, 14px) - (var(--g-ui-switch-offset, 2px) * 2) - 2px));
|
|
1067
1075
|
}
|
|
1068
1076
|
.g-ui-switch-label { font-size: 14px; }
|
|
1069
|
-
.g-ui-switch-size-xs { --g-ui-switch-width: 32px; --g-ui-switch-height: 16px; --g-ui-switch-thumb: 12px; --g-ui-switch-offset:
|
|
1070
|
-
.g-ui-switch-size-sm { --g-ui-switch-width: 38px; --g-ui-switch-height: 20px; --g-ui-switch-thumb: 14px; --g-ui-switch-offset:
|
|
1071
|
-
.g-ui-switch-size-md { --g-ui-switch-width: 46px; --g-ui-switch-height: 24px; --g-ui-switch-thumb: 18px; --g-ui-switch-offset:
|
|
1072
|
-
.g-ui-switch-size-lg { --g-ui-switch-width: 56px; --g-ui-switch-height: 30px; --g-ui-switch-thumb: 22px; --g-ui-switch-offset:
|
|
1073
|
-
.g-ui-switch-size-xl { --g-ui-switch-width: 72px; --g-ui-switch-height: 36px; --g-ui-switch-thumb: 28px; --g-ui-switch-offset:
|
|
1077
|
+
.g-ui-switch-size-xs { --g-ui-switch-width: 32px; --g-ui-switch-height: 16px; --g-ui-switch-thumb: 12px; --g-ui-switch-offset: 1px; }
|
|
1078
|
+
.g-ui-switch-size-sm { --g-ui-switch-width: 38px; --g-ui-switch-height: 20px; --g-ui-switch-thumb: 14px; --g-ui-switch-offset: 2px; }
|
|
1079
|
+
.g-ui-switch-size-md { --g-ui-switch-width: 46px; --g-ui-switch-height: 24px; --g-ui-switch-thumb: 18px; --g-ui-switch-offset: 2px; }
|
|
1080
|
+
.g-ui-switch-size-lg { --g-ui-switch-width: 56px; --g-ui-switch-height: 30px; --g-ui-switch-thumb: 22px; --g-ui-switch-offset: 3px; }
|
|
1081
|
+
.g-ui-switch-size-xl { --g-ui-switch-width: 72px; --g-ui-switch-height: 36px; --g-ui-switch-thumb: 28px; --g-ui-switch-offset: 3px; }
|
|
1074
1082
|
|
|
1075
1083
|
.g-ui-select-root {
|
|
1076
1084
|
position: relative;
|
|
@@ -3601,5 +3609,5 @@ body {
|
|
|
3601
3609
|
@keyframes g-ui-spin { to { transform: rotate(360deg); } }
|
|
3602
3610
|
@keyframes g-ui-bounce { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(-5px); opacity: 1; } }
|
|
3603
3611
|
@keyframes g-ui-bars { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1.2); } }
|
|
3604
|
-
`;function Nt(){if(typeof document>"u"||document.getElementById(zt))return;let e=document.createElement("style");e.id=zt,e.textContent=Gr,document.head.appendChild(e)}var Zr=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function Ur(e={},i=document?.documentElement){if(i)for(let[t,r]of Object.entries(e)){let a=t.startsWith("--")?t:`--g-ui-${t}`;Zr.has(a)&&i.style.setProperty(a,String(r))}}function Xr(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}import{Renderer as Ct,isSignal as St,isState as Dt,isStatePath as Pt,isComputed as Mt,resolve as Le,computed as _r,after as Ai,concat as Kr}from"@granularjs/core";function Fi(e){return St(e)||Dt(e)||Pt(e)||Mt(e)}function o(...e){return Kr(...e,{separator:" ",filterFalsy:!0})}function Tt(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function s(e,i){let t={},r=[],a=n=>!!n&&typeof n=="object"&&!Array.isArray(n)&&!Ct.isRenderable(n)&&!Ct.isDomNode(n)&&!St(n)&&!Dt(n)&&!Pt(n)&&!Mt(n);for(let n of e)a(n)?Object.assign(t,n):r.push(n);if(i&&typeof i=="object")for(let n of Object.keys(i))t[n]===void 0&&(t[n]=i[n]);return{props:_r(t),rawProps:t,children:r}}function l(e){return Le(e)}function ve(e){return!!Le(e)}function k(e,i,t){let r=a=>{let n=Le(a),u=n==null||n===""?t:n;return u==null||u===""?"":`${e}${u}`};return Fi(i)?Ai(i).compute(a=>r(a)):r(i)}function W(e,i){return Fi(i)?Ai(i).compute(t=>Le(t)?e:""):Le(i)?e:""}function me(e,i,t){let r=a=>i[a]||null;return Fi(e)?Ai(e).compute(a=>r(Le(a??t))):r(Le(e??t))}import{Button as Qr,Span as ji,when as Ei,after as Jr}from"@granularjs/core";function Ri(...e){let{props:i,children:t}=s(e,{variant:"filled",size:"md"}),{variant:r,size:a,fullWidth:n,loading:u,leftSection:g,rightSection:p,className:h,disabled:m,...b}=i,x=Jr(m,u).compute(([d,y])=>d||y);return Qr({...b,disabled:x,className:o("g-ui-button",k("g-ui-button-variant-",r,"filled"),k("g-ui-button-size-",a,"md"),W("g-ui-button-full",n),W("g-ui-button-loading",u),h)},Ei(g,()=>ji({className:"g-ui-button-section-left"},g)),Ei(u,()=>ji("Loading..."),()=>t),Ei(p,()=>ji({className:"g-ui-button-section-right"},p)))}import{Span as ea}from"@granularjs/core";function Hi(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,weight:a,color:n,dimmed:u,align:g,className:p,style:h,...m}=i,b=me(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),x=me(n,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),d=me(g,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"});return ea({...m,className:o("g-ui-text",k("g-ui-text-size-",r,"md"),W("g-ui-text-dimmed",u),b,x,d,p)},t)}import{H1 as ia,H2 as Vt,H3 as ta,H4 as ra,H5 as aa,H6 as oa}from"@granularjs/core";var na={1:ia,2:Vt,3:ta,4:ra,5:aa,6:oa};function sa(...e){let{props:i,children:t}=s(e,{order:2}),{order:r,className:a,style:n,...u}=i,g=l(r)||2;return(na[g]||Vt)({...u,className:o("g-ui-title",k("g-ui-title-order-",r,2),a)},t)}import{Div as ua}from"@granularjs/core";function ga(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,fluid:a,className:n,style:u,...g}=i;return ua({...g,className:o("g-ui-container",W("g-ui-container-fluid",a),k("g-ui-container-size-",r,"md"),n)},t)}import{Div as la}from"@granularjs/core";function ca(...e){let{props:i,children:t}=s(e,{gap:"md"}),{gap:r,align:a,justify:n,className:u,style:g,...p}=i,h=me(n,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return la({...p,style:g,className:o("g-ui-stack",k("g-ui-gap-",r,"md"),k("g-ui-align-",a),h,u)},t)}import{Div as pa}from"@granularjs/core";function da(...e){let{props:i,children:t}=s(e,{gap:"md",align:"center"}),{gap:r,align:a,justify:n,position:u,noWrap:g,className:p,style:h,...m}=i,b=me(u,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return pa({...m,style:h,className:o("g-ui-group",k("g-ui-gap-",r,"md"),k("g-ui-align-",a,"center"),k("g-ui-justify-",n,"none"),b,W("g-ui-no-wrap",g),p)},t)}import{Div as pi,list as ma,when as Oi,after as Lt}from"@granularjs/core";function fa(...e){let{props:i,children:t}=s(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:r,content:a,actions:n,border:u,padding:g,radius:p,shadow:h,className:m,style:b,...x}=i;return pi(Oi(r,()=>pi({className:"g-ui-card-title"},r)),Oi(a,()=>pi({className:"g-ui-card-content"},a)),Oi(n,()=>pi({className:"g-ui-card-actions"},ma(n,d=>Ri({className:"g-ui-card-action",onClick:y=>d.onClick.get()?.(y),leftSection:d.leftSection,rightSection:d.rightSection,size:Lt(d.size).compute(y=>y||"sm"),variant:Lt(d.variant).compute(y=>y||"outline"),...d.props.get()||{}},d.label)))),{className:o("g-ui-card",k("g-ui-card-border-",u,"md"),k("g-ui-card-padding-",g,"md"),k("g-ui-card-radius-",p,"md"),k("g-ui-card-shadow-",h,"md"),m),...x},t)}import{Span as ha}from"@granularjs/core";function xa(...e){let{props:i,children:t}=s(e,{variant:"filled",size:"md"}),{variant:r,size:a,className:n,dot:u,style:g,...p}=i,h=me(r,{dot:"g-ui-badge-dot"});return ha({...p,className:o("g-ui-badge",k("g-ui-badge-variant-",r,"filled"),k("g-ui-badge-size-",a,"md"),W("g-ui-badge-dot",u),h,n)},t)}import{Div as Ue,Input as va,Textarea as ba,Label as wa,Span as ya,when as Xe,state as ka,after as za,isState as Na}from"@granularjs/core";function ge(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{label:r,description:a,error:n,size:u,leftSection:g,rightSection:p,className:h,inputClassName:m,multiline:b,value:x,...d}=i,{value:y,onChange:P,onInput:A,onFocus:$,onBlur:S,onKeyDown:F,onKeyUp:z,onClick:w}=t,v=Na(y)&&!P&&!A,f=v?y:ka(l(x)??"");za(x).change(K=>{v||f.set(l(K)??"")});let C=K=>{let ue=K?.target?.value??"";ue!==x.get()&&(f.set(ue),P?.(K),A?.(K))},V=ve(b),I=V?ba:va,X=o(m,V&&"g-ui-textarea"),re=I({...d,value:f,onInput:C,onChange:C,onFocus:$,onBlur:S,onKeyDown:F,onKeyUp:z,onClick:w,className:o("g-ui-input",X)});return Ue({className:o("g-ui-text-input",h)},Xe(r,()=>wa({className:"g-ui-text-input-label"},r)),Xe(a,()=>ya({className:"g-ui-text-input-description"},a)),Ue({className:o("g-ui-input-wrapper",W("g-ui-input-multiline",b),k("g-ui-input-size-",u,"md"),W("g-ui-input-error",n))},Xe(g,()=>Ue({className:"g-ui-input-section"},g)),re,Xe(p,()=>Ue({className:"g-ui-input-section"},p))),Xe(n,()=>Ue({className:"g-ui-text-input-error-text"},n)))}function qi(...e){let{props:i}=s(e,{size:"md"}),{size:t,leftSection:r,rightSection:a,className:n,...u}=i;return ge({...u,size:t,className:n,leftSection:r,rightSection:a,multiline:!0})}import{Div as $t,Span as It,after as $e,state as Ca}from"@granularjs/core";function Yi(...e){let{props:i,rawProps:t}=s(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:r,min:a,max:n,step:u,size:g,allowDecimal:p,allowNegative:h,decimalSeparator:m,thousandSeparator:b,decimalScale:x,clampBehavior:d,hideControls:y,format:P,locale:A,currency:$,formatOptions:S,prefix:F,suffix:z,leftSection:w,rightSection:v,className:f,onChange:C,onInput:V,...I}=i,{onChange:X,onInput:re,onBlur:K,onFocus:ue,onKeyDown:te}=t,oe=M=>{X?.(M.target?.value??""),re?.(M.target?.value??"")},de=oe,ie=Ca(""),T=M=>String(M??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=()=>{if(!!!l(p))return 0;let D=l(x);if(D!=null&&D!==""&&Number.isFinite(Number(D)))return Math.max(0,Number(D));let E=l(P);return E==="currency"||E==="percent"?2:0},N=M=>{let D=l(m)??".",E=l(b)??"",O=String(M??"");if(E&&(O=O.split(E).join("")),!O||O==="-"||O===D||O.endsWith(D))return null;let _=O.replace(D,"."),Z=Number(_);return Number.isFinite(Z)?Z:null},G=M=>{let D=l(b)??"";return D?M.replace(/\B(?=(\d{3})+(?!\d))/g,D):M},H=M=>{let D=l(m)??".",E=R(),O=Number(M);if(!Number.isFinite(O))return"";let _=O<0?"-":"",Z=Math.abs(O),[Y,U=""]=String(Z).split("."),ee=G(Y);if(E>0){let fe=U.slice(0,E).padEnd(E,"0");return`${_}${ee}${D}${fe}`}return`${_}${ee}`},ne=(M,D)=>{try{let E=l(A),O=l($)??"USD",_=l(S)??{},Z=R(),Y=D==="currency"?"currency":"decimal";return new Intl.NumberFormat(E,{style:Y,currency:O,...Z>0?{minimumFractionDigits:Z,maximumFractionDigits:Z}:{maximumFractionDigits:0},..._}).format(M)}catch{return H(M)}},se=M=>{let D=M,E=l(a),O=l(n);return E!=null&&Number.isFinite(Number(E))&&(D=Math.max(D,Number(E))),O!=null&&Number.isFinite(Number(O))&&(D=Math.min(D,Number(O))),!l(h)&&D<0&&(D=0),D},xe=()=>{let M=l(z)??"",D=l(P);return!M&&D==="percent"?"%":M},ze=(M,D,E)=>{let O=l(F)??"",_=xe(),Z=String(M??"").replace(/\u00A0/g," "),Y=String(O??"").replace(/\u00A0/g," "),U=String(_??"").replace(/\u00A0/g," "),ee=Y&&Z.startsWith(Y),fe=U&&Z.endsWith(U);return`${D??""}${ee?"":O}${M}${fe?"":_}`},Se=(M,D)=>{let E=R(),O=l(m)??".",Z=String(M??"").replace(/\D/g,"")||"0",Y=E>0?Z.padStart(E+1,"0"):Z,ee=(E>0?Y.slice(0,-E):Y).replace(/^0+(?=\d)/,"")||"0",fe=E>0?Y.slice(-E):"",Te=E>0?`${ee}${O}${fe}`:ee;return`${D??""}${Te}`},Ve=M=>{let D=l(F)??"",E=xe(),O=String(M??""),_=String(D??"").replace(/\u00A0/g," "),Z=String(E??"").replace(/\u00A0/g," ");return _&&O.replace(/\u00A0/g," ").startsWith(_)&&(O=O.slice(D.length)),Z&&O.replace(/\u00A0/g," ").endsWith(Z)&&(O=O.slice(0,-E.length)),O},li=M=>{let D=!!l(h),E=Ve(M),O=D&&E.includes("-")?"-":"",_=E.replace(/\D/g,""),Z=Se(_,O);if(l(d)==="strict"){let Y=N(Z);if(Y!=null){let U=se(Y);Z=`${U<0?"-":""}${H(Math.abs(U))}`}}return Z},Vi=M=>{if(M==null||M==="")return Se("","");if(typeof M=="number"&&Number.isFinite(M)){let U=l(d)==="strict"?se(M):M;return`${U<0?"-":""}${H(Math.abs(U))}`}let D=Ve(M),E=l(m)??".",_=!!l(h)&&String(D).includes("-")?"-":"",Z=String(D??"").replace(new RegExp(`[^0-9${T(E)}]`,"g"),""),Y=N(`${_}${Z}`);if(Y!=null){let U=l(d)==="strict"?se(Y):Y;return`${U<0?"-":""}${H(Math.abs(U))}`}return li(M)},Ne,Ze=M=>{let D=l(M);if(D===void 0)return;let E=Vi(D);E!==ie.get()&&(Ne=E,ie.set(E))};Ze(r),$e(r).change(M=>{Ze(M)}),$e(ie).change(M=>{if(M===Ne){Ne=void 0;return}Ne=void 0;let D=N(M);if(D==null){oe?.(M??"");return}oe?.(D)});let Li=$e(v).compute(M=>M!=null&&M!==!1),$i=$e(y,Li).compute(([M,D])=>!l(M)&&!D),ci=$e(p).compute(M=>l(M)?"decimal":"numeric"),Ii=$e(P,F,z,p,h,m,b,x,d,a,n,A,$,S).compute(()=>({mode:"both",format:M=>{let D=li(M),E=l(P),_=!!l(h)&&D.startsWith("-")?"-":"",Z=N(D),Y=D.replace(_,"");if(Z!=null){let U=Math.abs(Z);if(typeof E=="function")try{Y=E(U)}catch{Y=H(U)}else if(E==="currency")Y=ne(U,"currency");else if(E==="decimal"){let ee=l(A),fe=l(S);Y=ee||fe?ne(U,"decimal"):H(U)}else Y=H(U)}return{value:D,raw:D,visual:ze(Y,_,E)}}})),c=M=>{let D=N(ie.get()),E=Number(l(u)??1),_=se((D??0)+E*M);ie.set(H(_))},B=M=>{if(!M||typeof M.setSelectionRange!="function")return;let D=()=>{try{let E=String(M.value??"").length;M.setSelectionRange(E,E)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(D):D()},ae=M=>{de?.(M);let D=M?.target;D&&B(D)},q=M=>{if(K?.(M),l(d)!=="blur")return;let D=N(ie.get());if(D==null)return;let E=se(D);ie.set(H(E))},J=M=>{ue?.(M),B(M?.target)},pe=M=>{te?.(M);let D=M?.target;if(!D)return;let E=l(F)??"",O=xe();O&&typeof D.selectionEnd=="number"&&(D.selectionEnd=Math.min(D.selectionEnd,String(D.value??"").length-O.length)),E&&typeof D.selectionStart=="number"&&(D.selectionStart=Math.max(D.selectionStart,E.length))},Q=$t({className:"g-ui-number-field-controls"},It({className:"g-ui-number-field-control",onClick:()=>c(1)},"+"),It({className:"g-ui-number-field-control",onClick:()=>c(-1)},"\u2212")),Ce=$t({className:"g-ui-number-field-controls-wrapper"},Q),De=$e($i,v).compute(([M,D])=>M?Ce:D);return ge({...I,size:g,className:o("g-ui-number-field",f),leftSection:w,rightSection:De,type:"text",inputMode:ci,inputClassName:o("g-ui-input-number"),value:ie,format:Ii,onInput:ae,onBlur:q,onFocus:J,onKeyDown:pe})}function Sa(...e){return Yi(...e)}import{Div as hi,Button as Da,portal as Pa,when as Wi,after as Ma}from"@granularjs/core";var di='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',mi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',fi='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Bt='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',Ee='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',At='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Ft='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',jt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',Et='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',Rt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>';function _e(...e){let{props:i,rawProps:t,children:r}=s(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:n,size:u,centered:g,overlay:p,position:h,className:m,style:b}=i,{onClose:x}=t,d=Ma(h,g).compute(([y,P])=>`g-ui-modal-position-${y??(P===!1?"top-center":"center")}`);return Wi(a,()=>Pa(hi({className:o("g-ui-modal-overlay",k("g-ui-modal-overlay-",p,"normal"),d),onClick:y=>{y.target===y.currentTarget&&x?.()}},hi({className:o("g-ui-modal",k("g-ui-modal-size-",u,"md"),m)},hi({className:"g-ui-modal-header"},Wi(n,()=>hi({className:"g-ui-modal-title"},n)),Wi(x,()=>Da({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:x,innerHTML:Ee}))),r))))}import{Div as xi,Span as Gi,after as Ht,when as Ot}from"@granularjs/core";function Ke(...e){let{props:i}=s(e,{variant:"spinner",size:"md"}),{variant:t,size:r,className:a}=i,n=Ht(t).compute(g=>g==="dots"),u=Ht(t).compute(g=>g==="bars");return Ot(n,()=>xi({className:o("g-ui-loading g-ui-dots",k("g-ui-loading-size-",r,"md"),a)}),()=>Ot(u,()=>xi({className:o("g-ui-loading g-ui-bars",k("g-ui-loading-size-",r,"md"),a)},Gi(""),Gi(""),Gi("")),()=>xi({className:o("g-ui-loading",k("g-ui-loading-size-",r,"md"),a)},xi({className:"g-ui-spinner"}))))}import{Div as Zi,Input as Ta,Label as Va,Span as qt,when as Ui,state as La,after as $a}from"@granularjs/core";function Xi(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{checked:r,label:a,description:n,size:u,indeterminate:g,className:p,style:h,inputProps:m,...b}=i,{onChange:x}=t,d=La(ve(r));$a(r).change(P=>{P!=null&&(d.set(!!P),x?.(P))});let y=Va({className:"g-ui-checkbox-control"},Ta({type:"checkbox",indeterminate:g,checked:d,className:o("g-ui-checkbox-input",k("g-ui-checkbox-size-",u,"md"),m?.className),...b}),Ui(d,()=>Zi({className:"g-ui-checkbox-checked",innerHTML:fi}),()=>{if(!d.get()&&g.get())return Zi({className:"g-ui-checkbox-indeterminate",innerHTML:Bt})}),Ui(a,()=>qt({className:"g-ui-checkbox-label"},a)));return Zi({className:o("g-ui-checkbox",k("g-ui-checkbox-size-",u,"md"),p)},y,Ui(n,()=>qt({className:"g-ui-checkbox-description"},n)))}import{Input as Ia,Label as Ba,Span as Aa,when as Fa}from"@granularjs/core";function ja(...e){let{props:i}=s(e,{size:"md"}),{label:t,size:r,className:a,style:n,inputProps:u,...g}=i;return Ba({className:o("g-ui-switch",k("g-ui-switch-size-",r,"md"),a)},Ia({type:"checkbox",className:o("g-ui-switch-input",k("g-ui-switch-size-",r,"md"),u?.className),...g}),Fa(t,()=>Aa({className:"g-ui-switch-label"},t)))}import{Div as Ie,Span as Yt,when as _i,state as Wt,after as vi}from"@granularjs/core";function Ea(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"md"}),{data:r,value:a,size:n,leftSection:u,rightSection:g,placeholder:p,className:h,...m}=i,{onChange:b}=t,x=Wt(!1),d=Wt(l(a)??"");vi(a).change($=>{let S=l($);S!==void 0&&d.set(S??"")});let y=$=>{d.set($),b?.($),x.set(!1)},P=vi(d).compute($=>$?"":"g-ui-select-placeholder"),A=vi(d).compute($=>{let F=(l(r)??[]).find(z=>z.value===$);return $?F?.label??"":p??""});return Ie({...m,className:o("g-ui-select-root",h)},Ie({className:o("g-ui-input-wrapper",k("g-ui-input-size-",n,"md"))},_i(u,()=>Ie({className:"g-ui-input-section"},u)),Ie({className:o("g-ui-select",P),onClick:()=>x.set(!x.get())},Yt({className:"g-ui-select-value"},A)),_i(g,()=>Ie({className:"g-ui-input-section"},g),()=>Yt({className:"g-ui-select-caret"},"\u25BE"))),_i(x,()=>Ie({className:"g-ui-select-dropdown"},(l(r)??[]).map($=>Ie({className:o("g-ui-select-item",vi(d).compute(S=>S===$.value?"g-ui-select-item-active":"")),onClick:()=>y($.value)},$.label)))))}import{Button as Ra,Div as Re,state as Pe,after as Qe,list as Ha,when as Oa}from"@granularjs/core";function qa(...e){let{props:i,rawProps:t}=s(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0}),{value:r,tabs:a,orientation:n,variant:u,sticky:g,className:p,style:h}=i,{onChange:m}=t,b=Pe(l(r)??l(a)?.[0]?.value??""),x=Pe(),d=Pe(),y=Pe(0),P=Pe(0),A=Pe(0),$=Pe(0),S=Pe(!1),F=Pe(0),z=!1,w=null,v=!1,f=new Set;Qe(r).change(N=>{let G=l(N);G!=null&&b.set(G)});let C=N=>{b.set(N),m?.(N)},V=N=>{let G=[],H=N?.parentElement;for(;H;){let ne=getComputedStyle(H),se=`${ne.overflow}${ne.overflowY}${ne.overflowX}`;/(auto|scroll)/.test(se)&&G.push(H),H=H.parentElement}return G},I=N=>V(N)[0]??null,X=N=>N?N.getBoundingClientRect().top:0,re=N=>N?N.scrollTop:window.scrollY||window.pageYOffset||0,K=(N,G)=>N>G?"down":N<G?"up":"none",ue=(N,G,H,ne)=>N==="down"&&G<H?!0:N==="up"&&G>=H?!1:ne,te=()=>{let N=x.get(),G=d.get();if(!N||!G)return;if(!ve(g)){S.set(!1),y.set(0);return}if(typeof window>"u")return;let H=N.getBoundingClientRect(),ne=G.getBoundingClientRect(),se=I(N),xe=X(se),ze=re(se),Se=K(ze,F.get());F.set(ze);let Ve=ue(Se,H.top,xe,S.get());y.set(ne.height),P.set(H.left),A.set(H.width),$.set(xe),Ve!==S.get()&&S.set(Ve)},oe=()=>{w==null&&(w=requestAnimationFrame(()=>{w=null,te()}))},de=N=>{!N||f.has(N)||(f.add(N),N.addEventListener("scroll",oe,{passive:!0}))},ie=()=>{if(z)return;let N=x.get(),G=d.get();!N||!G||typeof window>"u"||(z=!0,te(),de(window),window.addEventListener("resize",oe),V(N).forEach(de))};Qe(d,x,g).change(ie),!v&&typeof window<"u"&&(v=!0,setTimeout(()=>ie(),0));let T=Qe(S,P,A,$).compute(N=>{let[G,H,ne,se]=N;return G?{position:"fixed",top:`${se}px`,left:`${H}px`,width:`${ne}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),R=Qe(S,y).compute(N=>{let[G,H]=N;return{height:G?`${H}px`:"0px"}});return Re(Re({className:o("g-ui-tabs",me(n,{vertical:"g-ui-tabs-vertical"}),k("g-ui-tabs-variant-",u,"default"),i.className??p)},Re({node:x}),Re({style:R}),Re({node:d,className:"g-ui-tabs-list",style:T},Ha(a,N=>Ra({className:Qe(b,N.value).compute(([G,H])=>o("g-ui-tabs-tab",H===G&&"g-ui-tabs-tab-active")),onClick:()=>C(N.value.get())},N.label))),Re({className:"g-ui-tabs-panel"},Oa(b,()=>a.get()?.find(N=>N.value===b.get())?.content??null))))}import{Table as Ya,Thead as Wa,Tbody as Ga,Tr as Gt,Th as Za,Td as Zt}from"@granularjs/core";function Ua(...e){let{props:i}=s(e,{headers:[],rows:[]}),{headers:t,rows:r,striped:a,highlightOnHover:n,withBorder:u,withColumnBorders:g,className:p,style:h,...m}=i;return Ya({...m,className:o("g-ui-table",W("g-ui-table-striped",a),W("g-ui-table-hover",n),W("g-ui-table-with-border",u),W("g-ui-table-column-borders",g),p)},t.length?Wa(Gt(t.map(b=>Za(b)))):null,Ga(r.map(b=>Gt(Array.isArray(b)?b.map(x=>Zt(x)):Object.values(b).map(x=>Zt(x))))))}import{Div as Ki}from"@granularjs/core";import{state as Xa,when as _a,after as Ka}from"@granularjs/core";function Qa(...e){let{props:i,children:t}=s(e,{opened:!1}),{opened:r,className:a,...n}=i,u=Xa(ve(r));Ka(r).change(m=>{u.set(ve(m))});let g=()=>{u.set(!u.get())},p=t[0],h=t[1];return Ki({...n,className:o("g-ui-accordion",a)},Ki({className:"g-ui-accordion-header",onClick:g},p),_a(u,()=>Ki({className:"g-ui-accordion-content"},h)))}import{Span as Ut}from"@granularjs/core";function Ja(...e){let{props:i,children:t}=s(e),{label:r,className:a,style:n}=i;return Ut({className:o("g-ui-tooltip",a)},t,Ut({className:"g-ui-tooltip-content"},r))}import{Div as Je,when as eo,after as io,state as ei,portal as to}from"@granularjs/core";var Qi=ei({currentOpenState:null});function ro(...e){let i=ei(),t=ei(),r=ei({}),{props:a,rawProps:n,children:u}=s(e,{position:"right"}),{opened:g,content:p,position:h,className:m,...b}=a,{onChange:x}=n,d=ei(l(g)??!1);io(g).change(z=>{let w=l(z);w!=null&&(d.set(!!w),w&&y())});let y=()=>{Qi.get().currentOpenState!==d&&(Qi.get().currentOpenState?.set(!1),Qi.set().currentOpenState=d)};g.get()&&y();let P=z=>{let v=String(z??"right").toLowerCase().split("-").filter(Boolean);if(v.length===1){let V=v[0];return V==="top"||V==="bottom"?{placement:V,align:"center"}:V==="left"||V==="right"?{placement:"bottom",align:V}:V==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[f,C]=v;return f==="top"||f==="bottom"?{placement:f,align:C||"center"}:f==="left"||f==="right"?{placement:f,align:C||"center"}:{placement:"bottom",align:"right"}},A=()=>{let z=i.get(),w=t.get();if(!z||!w||typeof window>"u")return;let v=z.getBoundingClientRect(),f=w.getBoundingClientRect(),C=l(h)??"right",V=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),I=Number.parseFloat(V)||20,X=window.innerWidth||0,re=window.innerHeight||0,K=Math.max(I,X-f.width-I),ue=Math.max(I,re-f.height-I),{placement:te,align:oe}=P(C),de=8,ie=v.bottom+de,T=v.left;te==="top"||te==="bottom"?(ie=te==="top"?v.top-f.height-de:v.bottom+de,oe==="center"?T=v.left+v.width/2-f.width/2:oe==="right"?T=v.right-f.width:T=v.left):(te==="left"||te==="right")&&(T=te==="left"?v.left-f.width-de:v.right+de,oe==="center"?ie=v.top+v.height/2-f.height/2:oe==="bottom"?ie=v.bottom-f.height:ie=v.top),T=Math.max(I,Math.min(T,K)),ie=Math.max(I,Math.min(ie,ue)),r.set({top:`${ie}px`,left:`${T}px`})},$=z=>{d.set(z),x?.(z),z&&(y(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>A()):setTimeout(()=>A(),0))},S=()=>$(!d.get()),F=()=>$(!1);return Je({...b,node:i,className:o("g-ui-menu",m)},Je({onClick:S},u),eo(d,()=>to(Je(Je({className:"g-ui-menu-overlay",onClick:F}),Je({className:"g-ui-menu-dropdown",node:t,style:r},p)))))}import{Div as Xt,portal as ao,when as oo}from"@granularjs/core";function no(...e){let{props:i,children:t}=s(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:r,onClose:a,position:n,size:u,overlay:g,shadowed:p,className:h,style:m}=i;return oo(r,()=>ao(Xt({className:o("g-ui-drawer-overlay",k("g-ui-drawer-overlay-",g,"normal")),onClick:a},Xt({className:o("g-ui-drawer",me(p,{true:"g-ui-drawer-shadowed"},!0),k("g-ui-drawer-",n,"right"),k("g-ui-drawer-size-",u,"md"),h),onClick:b=>b.stopPropagation()},t))))}import{Button as so,Div as Ji,Span as _t,when as bi,after as Kt}from"@granularjs/core";function et(...e){let{props:i,rawProps:t,children:r}=s(e,{color:"blue",withCloseButton:!0}),{title:a,color:n,icon:u,loading:g,withCloseButton:p,withBorder:h,className:m,style:b}=i,{onClose:x}=t,d=Kt(u,g).compute(([P,A])=>!P&&!!A),y=Kt(u,g).compute(([P,A])=>!!P||!!A);return Ji({className:o("g-ui-notification",[h,"g-ui-notification-bordered"],[n,P=>`g-ui-notification-${P}`],[y,"g-ui-notification-with-icon"],m)},bi(u,()=>_t({className:"g-ui-notification-icon"},u)),bi(d,()=>Ke({size:"sm",className:"g-ui-notification-loader"})),Ji({className:"g-ui-notification-body"},bi(a,()=>Ji({className:"g-ui-notification-title"},a)),r),bi(p,()=>so({type:"button",className:"g-ui-notification-close",onClick:()=>x?.()},_t({innerHTML:Ee}))))}import{Div as uo,when as go}from"@granularjs/core";function lo(...e){let{props:i}=s(e,{labelPosition:"center"}),{label:t,labelPosition:r,vertical:a,className:n,...u}=i;return uo({...u,className:o("g-ui-divider",W("label",t),k("g-ui-divider-label-",r,"center"),W("g-ui-divider-vertical",a),n)},go(t,()=>Hi({className:"g-ui-divider-label-text",size:"sm"},t)))}import{Div as co}from"@granularjs/core";function po(...e){let{props:i,children:t}=s(e,{padding:"md",radius:"md",shadow:"none"}),{padding:r,radius:a,shadow:n,className:u,...g}=i;return co({...g,className:o("g-ui-paper",[r,p=>`g-ui-card-padding-${p}`],[a,p=>`g-ui-card-radius-${p}`],[n,p=>`g-ui-card-shadow-${p}`],u)},t)}import{Button as mo,Div as it,Span as fo,after as Qt,when as tt}from"@granularjs/core";function ho(...e){let{props:i,rawProps:t,children:r}=s(e,{color:"blue"}),{title:a,color:n,icon:u,withCloseButton:g,className:p,...h}=i,{onClose:m}=t,b=Qt(a,g).compute(([d,y])=>d||y),x=Qt(u).compute(d=>d!==void 0);return it({...h,className:o("g-ui-alert",[n,d=>`g-ui-alert-${d}`],p)},it({className:"g-ui-alert-header"},tt(u,()=>fo({className:"g-ui-alert-icon"},u)),tt(a,()=>it({className:"g-ui-alert-title"},a)),tt(g,()=>mo({type:"button",className:"g-ui-alert-close",onClick:()=>m?.()},"\xD7"))),r)}import{Div as xo,Img as vo,when as bo}from"@granularjs/core";function wo(...e){let{props:i,children:t}=s(e,{size:"md",alt:""}),{src:r,size:a,alt:n,className:u,...g}=i;return xo({...g,className:o("g-ui-avatar",[a,p=>`g-ui-avatar-size-${p}`],u)},bo(r,()=>vo({className:"g-ui-avatar-img",src:r,alt:n}),()=>t))}import{Span as yo}from"@granularjs/core";function ko(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return yo({...a,className:o("g-ui-kbd",r)},t)}import{Code as zo}from"@granularjs/core";function No(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return zo({...a,className:o("g-ui-code",r)},t)}import{Blockquote as Co}from"@granularjs/core";function So(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Co({...a,className:o("g-ui-blockquote",r)},t)}import{Div as Do}from"@granularjs/core";function Po(...e){let{props:i,children:t}=s(e,{cols:3,gap:"md"}),{cols:r,gap:a,className:n,...u}=i;return Do({...u,className:o("g-ui-grid",[a,g=>`g-ui-gap-${g}`],[r,g=>`g-ui-grid-cols-${g}`],n)},t)}import{Ul as Mo,Ol as To,Li as rt,Div as wi,Span as at,after as ot,when as He,isSignal as Vo,isState as Lo,isStatePath as $o,isComputed as Io}from"@granularjs/core";function Jt(...e){let{props:i,children:t}=s(e,{type:"none",size:"md"}),{type:r,size:a,withPadding:n,className:u,...g}=i,p=me(r,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),h=ot(r).compute(P=>P==="ordered"),m=P=>P&&typeof P=="object"&&typeof P.tagName=="string"&&(P.tagName.toLowerCase()==="ul"||P.tagName.toLowerCase()==="ol"),b=P=>P&&typeof P=="object"&&typeof P.tagName=="string"&&P.tagName.toLowerCase()==="li",x=P=>{let A=$=>$==null||$===!1?null:Array.isArray($)?$.map(S=>A(S)):b($)?$:m($)?rt({className:"g-ui-list-nested-item"},$):rt(at({className:"g-ui-list-item-shell"},$));return Vo(P)||Lo(P)||$o(P)||Io(P)?ot(P).compute($=>A($)):A(P)},d=t.map(P=>x(P)),y={...g,className:o("g-ui-list",k("g-ui-list-size-",a,"md"),W("g-ui-list-with-padding",n),p,u)};return He(h,()=>To(y,d),()=>Mo(y,d))}function Bo(...e){let{props:i,children:t}=s(e,{withBorder:!1}),{leftSection:r,rightSection:a,title:n,body:u,withBorder:g,className:p,...h}=i,m=ot(n,u).compute(([b,x])=>!!b||!!x);return rt({...h,className:o("g-ui-list-item",W("g-ui-list-item-border",g),p)},wi({className:"g-ui-list-item-shell"},He(r,()=>at({className:"g-ui-list-item-section g-ui-list-item-section-left"},r)),He(m,()=>wi({className:"g-ui-list-item-content"},He(n,()=>wi({className:"g-ui-list-item-title"},n)),He(u,()=>wi({className:"g-ui-list-item-body"},u))),()=>t),He(a,()=>at({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}Jt.Item=Bo;import{A as Ao}from"@granularjs/core";function Fo(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Ao({...a,className:o("g-ui-anchor",r)},t)}import{Img as jo}from"@granularjs/core";function Eo(...e){let{props:i}=s(e),{className:t,...r}=i;return jo({...r,className:o("g-ui-image",t)})}import{Span as Ro}from"@granularjs/core";function ye(...e){let{props:i,children:t}=s(e,{size:"md"});return Ro({...i,className:o("g-ui-icon",k("g-ui-icon-size-",i.size,"md"),k("g-ui-icon-color-",i.color),i.className)},...t)}import{Div as er}from"@granularjs/core";function Ho(...e){let{props:i}=s(e,{value:0,color:"primary",size:"md"}),{value:t,color:r,size:a,className:n,...u}=i;return er({...u,className:o("g-ui-progress",k("g-ui-progress-size-",a,"md"),[t,g=>{let p=Math.max(0,Math.min(100,Number(g)||0));return`g-ui-progress-${Math.round(p/5)*5}`}],[r,g=>g?`g-ui-progress-${g}`:""],n)},er({className:"g-ui-progress-bar"}))}import{Div as Be,after as yi,state as Oo,when as qo}from"@granularjs/core";function Yo(...e){let{props:i,rawProps:t}=s(e,{size:"md",min:0,max:100,step:1}),{onChange:r}=t,{value:a,marks:n,size:u,min:g,max:p,step:h,disabled:m,className:b,...x}=i,d=Oo(l(a??g));yi(a).change(z=>{z!=null&&d.set(l(z))});let y=()=>{let z=Number(l(g)),w=Number(l(p));return!Number.isFinite(z)||!Number.isFinite(w)?{minValue:0,maxValue:100}:{minValue:Math.min(z,w),maxValue:Math.max(z,w)}},P=()=>{let z=Number(l(h));return Number.isFinite(z)&&z>0?z:1},A=z=>{let{minValue:w,maxValue:v}=y(),f=P(),C=Math.max(w,Math.min(v,Number(z))),V=Math.round((C-w)/f)*f+w;V!==d.get()&&(d.set(V),r?.(V))},$=yi(d).compute(z=>{let{minValue:w,maxValue:v}=y(),f=v-w;if(f<=0)return 0;let C=(Number(z??w)-w)/f*100;return Math.max(0,Math.min(100,C))}),S=(z,w)=>{let v=w?.();if(!v||v.width===0)return;let C=Math.min(Math.max(z.clientX-v.left,0),v.width)/v.width,{minValue:V,maxValue:I}=y();A(V+C*(I-V))},F=z=>{if(ve(m))return;z.preventDefault?.();let w=z.currentTarget,v=()=>w.getBoundingClientRect();w.setPointerCapture?.(z.pointerId),S(z,v);let f=V=>S(V,v),C=()=>{w.releasePointerCapture?.(z.pointerId),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",C)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",C)};return Be({...x,className:o("g-ui-slider",k("g-ui-slider-size-",u,"md"),W("g-ui-slider-disabled",m),b)},Be({className:"g-ui-slider-track",onPointerDown:F},Be({className:"g-ui-slider-bar",style:yi($).compute(z=>({width:`${z}%`}))}),Be({className:"g-ui-slider-thumb",style:yi($).compute(z=>({left:`${z}%`}))})),qo(n,()=>Be({className:"g-ui-slider-marks"},n.map(z=>nt({mark:z,getBounds:y})))))}var nt=({mark:e,getBounds:i})=>{let{minValue:t,maxValue:r}=i(),a=r-t,n=e.value??e,u=e.label??String(e.value)??n,g=Number(n),p=0;return a>0&&(p=(g-t)/a*100),Be({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,p))}%`}},Be({className:"g-ui-slider-mark-label"},u))};import{Div as Wo,after as Go}from"@granularjs/core";function Zo(...e){let{props:i}=s(e,{height:"md",width:"full"}),{height:t,width:r,className:a,...n}=i,u=Go(t,r).compute(([g,p])=>{let h={};return isNaN(g)||(h.height=`${g}px`),isNaN(p)||(h.width=`${p}px`),h});return Wo({...n,style:{width:u.width,height:u.height,...n.style||{}},className:o("g-ui-skeleton",[t,g=>`g-ui-skeleton-h-${g}`],[r,g=>`g-ui-skeleton-w-${g}`],a)})}import{Button as Uo,after as ir,state as Xo}from"@granularjs/core";function _o(...e){let{props:i,rawProps:t,children:r}=s(e,{size:"md",variant:"filled"}),{checked:a,size:n,variant:u,className:g,...p}=i,{onChange:h}=t,m=Xo(!!a);ir(a).change(x=>{x!=null&&m.set(!!x)});let b=x=>{m.set(x),h?.(x)};return Uo({...p,type:"button",className:o("g-ui-chip",k("g-ui-chip-size-",n,"md"),k("g-ui-chip-variant-",u,"filled"),ir(m).compute(x=>x?"g-ui-chip-active":""),g),onClick:()=>b(!m.get())},r)}import{Div as st,after as tr,state as Ko}from"@granularjs/core";function Qo(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"sm"}),{value:r,data:a,size:n,scroll:u,className:g,...p}=i,{onChange:h}=t,m=Ko(l(r));tr(r).change(x=>{let d=l(x);d!=null&&m.set(d)});let b=x=>{m.set(x),h?.(x)};return st({...p,className:o(u&&"g-ui-segmented-scroll")},st({className:o("g-ui-segmented",k("g-ui-segmented-size-",n,"sm"),i.className??g)},a.map(x=>st({className:o("g-ui-segmented-item",tr(m).compute(d=>x.value===d?"g-ui-segmented-active":"")),onClick:()=>b(x.value)},x.label))))}import{Button as ut,Div as Jo,state as en,after as ki}from"@granularjs/core";function tn(...e){let{props:i,rawProps:t}=s(e,{total:1,size:"md"}),{page:r,total:a,size:n,className:u,...g}=i,{onChange:p}=t,h=en(l(r??1));ki(r).change(d=>{let y=l(d);y!=null&&h.set(y)});let m=d=>{let y=Number(l(a))||1,P=Math.max(1,Math.min(y,d));h.set(P),p?.(P)},b=[],x=Number(l(a))||1;for(let d=1;d<=x;d+=1)b.push(d);return Jo({...g,className:o("g-ui-pagination",k("g-ui-pagination-size-",n,"md"),i.className??u)},ut({className:"g-ui-pagination-item",onClick:()=>m((h.get?.()??h)-1),disabled:ki(h).compute(d=>d<=1)},"<"),b.map(d=>ut({className:ki(h).compute(y=>o("g-ui-pagination-item",d===y&&"g-ui-pagination-item-active")),onClick:()=>m(d)},String(d))),ut({className:"g-ui-pagination-item",onClick:()=>m((h.get?.()??h)+1),disabled:ki(h).compute(d=>d>=a)},">"))}import{Div as rn,Input as an,Label as on,Span as rr,when as ar}from"@granularjs/core";function nn(...e){let{props:i}=s(e,{size:"md"}),{label:t,description:r,size:a,className:n,inputProps:u,...g}=i,p=on({className:"g-ui-radio-control"},an({type:"radio",className:o("g-ui-radio-input",k("g-ui-radio-size-",a,"md"),u?.className),...g}),ar(t,()=>rr({className:"g-ui-radio-label"},t)));return rn({className:o("g-ui-radio",k("g-ui-radio-size-",a,"md"),n)},p,ar(r,()=>rr({className:"g-ui-radio-description"},r)))}import{Div as sn}from"@granularjs/core";function un(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return sn({...a,className:o("g-ui-stack g-ui-gap-sm",r)},t)}import{Nav as gn,Span as ln}from"@granularjs/core";function cn(...e){let{props:i,children:t}=s(e,{separator:"/"}),{separator:r,className:a,...n}=i,u=[];Array.isArray(t)?u.push(...t):u.push(t);let g=u.filter(Boolean),p=[];return g.forEach((h,m)=>{p.push(h),m<g.length-1&&p.push(ln({className:"g-ui-breadcrumbs-separator"},r))}),gn({...n,className:o("g-ui-breadcrumbs",a)},p)}import{Div as pn}from"@granularjs/core";function dn(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return pn({...a,className:o("g-ui-center",r)},t)}import{Div as mn}from"@granularjs/core";function fn(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return mn({...a,className:o("g-ui-space",[t,n=>`g-ui-space-${n}`],r)})}import{Div as hn,when as xn}from"@granularjs/core";function vn(...e){let{props:i,children:t}=s(e),{opened:r,className:a,...n}=i;return xn(r,()=>hn({...n,className:o("g-ui-collapse",a)},t))}import{Button as bn}from"@granularjs/core";function Ae(...e){let{props:i,children:t}=s(e,{size:"md",variant:"filled"}),{size:r,variant:a,className:n,...u}=i;return bn({...u,type:"button",className:o("g-ui-action-icon",k("g-ui-action-icon-size-",r,"md"),k("g-ui-action-icon-",a,"filled"),n)},t)}import{Div as gt,when as wn,after as yn,state as kn}from"@granularjs/core";function lt(...e){let{props:i,rawProps:t,children:r}=s(e,{position:"left"}),{opened:a,position:n,content:u,className:g,...p}=i,{onChange:h}=t,m=kn(l(a)??!1);yn(a).change(x=>{let d=l(x);d!=null&&m.set(!!d)});let b=x=>{m.set(x),h?.(x)};return gt({...p,className:o("g-ui-popover",i.className??g)},gt({onClick:()=>b(!m.get())},r),wn(m,()=>gt({className:o("g-ui-popover-dropdown",n==="right"&&"g-ui-popover-right",n==="center"&&"g-ui-popover-center")},u)))}import{Div as or}from"@granularjs/core";function zn(...e){let{props:i,children:t}=s(e,{position:"left"}),{position:r,content:a,className:n,...u}=i;return or({...u,className:o("g-ui-hover-card",n)},t,or({className:o("g-ui-hover-card-dropdown",[r,g=>g==="right"?"g-ui-hover-card-right":""],[r,g=>g==="center"?"g-ui-hover-card-center":""])},a))}import{Div as Nn}from"@granularjs/core";function Cn(...e){let{props:i,children:t}=s(e,{position:"bottom-right"}),{position:r,className:a,...n}=i;return Nn({...n,className:o("g-ui-affix",[r,u=>`g-ui-affix-${u}`],a)},t)}import{Fieldset as Sn,Legend as Dn,when as Pn}from"@granularjs/core";function Mn(...e){let{props:i,children:t}=s(e),{legend:r,className:a,...n}=i;return Sn({...n,className:o("g-ui-fieldset",a)},Pn(r,()=>Dn({className:"g-ui-legend"},r)),t)}import{Div as Tn}from"@granularjs/core";function Vn(...e){let{props:i,children:t}=s(e,{position:"sticky"}),{position:r,className:a,...n}=i;return Tn({...n,className:o("g-ui-appbar",k("g-ui-appbar-",r,"sticky"),a)},t)}import{Div as ct,portal as Ln,after as zi,state as nr,when as sr}from"@granularjs/core";function $n(...e){let{props:i,children:t}=s(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return sr(i.fixed,()=>Bn(i,t),()=>In(i,t))}var In=(e,i)=>{let{open:t,onClose:r,position:a,size:n,blur:u,fixed:g,minWidth:p,className:h,...m}=e,b=nr(!1),x=nr(!1),d=220,y=$=>{if($){b.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>x.set(!0)):setTimeout(()=>x.set(!0),0);return}x.set(!1),setTimeout(()=>b.set(!1),d)};y(!!t.get()),zi(t).change($=>y(!!$));let P=zi(x,u).compute($=>{let[S,F]=$;return o("g-ui-sidebar-overlay",S&&"g-ui-sidebar-overlay-open",!F&&"g-ui-sidebar-overlay-noblur")}),A=zi(n,a,x,h).compute($=>{let[S,F,z,w]=$,v=F==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return o("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${S}`,v,z&&"g-ui-sidebar-drawer-open",l(w))});return sr(b,()=>Ln(ct({className:P,onClick:r},ct({className:A,onClick:$=>$.stopPropagation()},i))))},Bn=(e,i)=>{let{open:t,position:r,size:a,minWidth:n,className:u,...g}=e,p=zi(a,r,t,n,u).compute(h=>{let[m,b,x,d,y]=h,P=d||"button",A=null;return P==="button"?A="g-ui-sidebar-min-button":P==="xs"?A="g-ui-sidebar-min-xs":P==="sm"?A="g-ui-sidebar-min-sm":P==="md"&&(A="g-ui-sidebar-min-md"),o("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${m||"md"}`,A,x&&"g-ui-sidebar-fixed-open",y)});return ct({...g,className:p},i)};import{Div as Oe,when as ur}from"@granularjs/core";function An(...e){let{props:i}=s(e,{items:[]}),{items:t,className:r,...a}=i;return Oe({...a,className:o("g-ui-timeline",r)},t.map(n=>Oe({className:"g-ui-timeline-item"},Oe({className:"g-ui-timeline-dot"}),Oe({className:"g-ui-timeline-content"},ur(n.title,()=>Oe({className:"g-ui-timeline-title"},n.title)),ur(n.description,()=>Oe({className:"g-ui-timeline-desc"},n.description)),n.content))))}import{Div as Ni}from"@granularjs/core";function Fn(...e){let{props:i}=s(e,{active:0,items:[]}),{active:t,items:r,className:a,...n}=i;return Ni({...n,className:o("g-ui-stepper",a)},r.map((u,g)=>Ni({className:o("g-ui-stepper-item",[t,p=>g===p?"g-ui-stepper-active":""])},Ni({className:"g-ui-stepper-index"},String(g+1)),Ni({className:"g-ui-stepper-label"},u.label))))}import{Span as gr,after as lr,state as jn}from"@granularjs/core";function En(...e){let{props:i,rawProps:t}=s(e,{value:0,max:5,size:"md"}),{value:r,max:a,size:n,className:u,...g}=i,{onChange:p}=t,h=jn(l(r));lr(r).change(d=>{let y=l(d);y!=null&&h.set(y)});let m=d=>{h.set(d),p?.(d)},b=[],x=Number(l(a))||0;for(let d=1;d<=x;d+=1)b.push(d);return gr({...g,className:o("g-ui-rating",k("g-ui-rating-size-",n,"md"),i.className??u)},b.map(d=>gr({className:o("g-ui-rating-item",lr(h).compute(y=>d<=y?"g-ui-rating-item-active":"")),onClick:()=>m(d)},"\u2605")))}import{Span as Rn}from"@granularjs/core";function Hn(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Rn({...a,className:o("g-ui-tag",r)},t)}import{Button as cr,Div as qe,state as pr,after as Ci}from"@granularjs/core";var On=["S","M","T","W","T","F","S"];function ii(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{value:r,className:a,size:n,...u}=i,{onChange:g}=t,p=S=>{let F=l(S);if(F instanceof Date)return F;if(F==null)return null;let z=new Date(F);return Number.isNaN(z.getTime())?null:z},h=pr(p(r)??new Date),m=pr(new Date(h.get()));Ci(r).change(S=>{let F=p(S);F!=null&&(h.set(F),m.set(new Date(F)))});let b=(S,F,z)=>{let w=new Date(S,F+1,0).getDate();return new Date(S,F,Math.min(z,w))},x=S=>{let F=m.get(),z=b(F.getFullYear(),F.getMonth(),S);h.set(z),m.set(z),g?.(z)},d=S=>{let F=m.get(),z=b(F.getFullYear(),F.getMonth()+S,F.getDate());m.set(z)},y=S=>{let F=m.get(),z=b(F.getFullYear()+S,F.getMonth(),F.getDate());m.set(z)},P=Ci(m).compute(S=>S.toLocaleString("default",{month:"long"})),A=Ci(m).compute(S=>String(S.getFullYear())),$=Ci(m,h).compute(([S,F])=>{let z=S.getFullYear(),w=S.getMonth(),f=new Date(z,w,1).getDay(),C=new Date(z,w+1,0).getDate(),V=[];for(let I=0;I<f;I+=1)V.push({muted:!0,label:""});for(let I=1;I<=C;I+=1)V.push({label:I});return[...On.map(I=>qe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},I)),...V.map(I=>qe({className:o("g-ui-calendar-cell",I.muted&&"g-ui-calendar-cell-muted",I.label&&F.getFullYear()===z&&F.getMonth()===w&&I.label===F.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>I.label&&x(I.label)},I.label))]});return qe({...u,className:o("g-ui-calendar",a,k("g-ui-calendar-size-",n,"md"))},qe({className:"g-ui-calendar-header"},Ae({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>d(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:mi})),qe({className:"g-ui-calendar-title-group"},cr({type:"button",className:"g-ui-calendar-title-button",onClick:()=>d(1)},P),cr({type:"button",className:"g-ui-calendar-title-button",onClick:()=>y(1)},A)),Ae({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>d(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:di}))),qe({className:"g-ui-calendar-grid"},$))}import{Div as ti,Span as Ye,Input as qn,when as pt,after as ke,state as Si}from"@granularjs/core";function Yn(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"md",searchable:!0}),{value:r,data:a,size:n,className:u,placeholder:g,searchable:p,...h}=i,{onChange:m,onSearchChange:b}=t,x=Si(l(r)??[]),d=Si(""),y=Si(!1),P=Si(null),A=f=>(l(f)??[]).map(V=>typeof V=="string"?{value:V,label:V}:V&&typeof V=="object"?V:{value:String(V),label:String(V)});ke(r).change(f=>{let C=l(f);C!=null&&x.set(C)});let $=null;ke(y).change(f=>{if($&&($(),$=null),!f)return;let C=V=>{let I=P.get();I&&(I.contains(V.target)||y.set(!1))};document.addEventListener("mousedown",C),$=()=>document.removeEventListener("mousedown",C)}),ke(d).change(f=>{b?.(f)});let S=f=>{let C=x.get()??[],V=C.includes(f)?C.filter(I=>I!==f):C.concat(f);x.set(V),m?.(V)},F=ke(a).compute(f=>A(f)),z=ke(F,d).compute(([f,C])=>{let V=String(l(C)??"").toLowerCase().trim();return V?f.filter(I=>String(I.label??"").toLowerCase().includes(V)):f}),w=ke(x,d).compute(([f,C])=>{let V=l(f)??[],I=String(l(C)??"");return!V.length&&!I}),v=ke(p).compute(f=>!!f);return ti({...h,node:P,className:o("g-ui-select-multi-root",u)},ti({className:o("g-ui-select-multi",k("g-ui-select-multi-size-",n,"md")),onClick:()=>y.set(!0)},ke(F,x).compute(([f,C])=>(l(C)??[]).map(I=>{let re=(f??[]).find(K=>K.value===I)?.label??I;return Ye({className:"g-ui-select-tag"},Ye({className:"g-ui-select-tag-label",onClick:K=>{K?.stopPropagation?.()}},re),Ye({className:"g-ui-select-tag-remove",innerHTML:Ee,onClick:K=>{K?.stopPropagation?.(),S(I)}}))})),pt(w,()=>Ye({className:"g-ui-select-multi-placeholder"},g??"Select...")),pt(v,()=>qn({className:"g-ui-select-multi-input",value:d,onInput:f=>d.set(f.target?.value??""),onFocus:()=>y.set(!0)}))),pt(y,()=>ti({className:"g-ui-select-dropdown"},ke(z).compute(f=>f.length?f.map(C=>ti({className:o("g-ui-select-item",C.disabled&&"g-ui-select-item-disabled",ke(x).compute(V=>(l(V)??[]).includes(C.value)?"g-ui-select-item-active":"")),onClick:()=>{C.disabled||S(C.value)}},Ye({className:"g-ui-select-item-check",innerHTML:ke(x).compute(V=>(l(V)??[]).includes(C.value)?fi:"")}),Ye({className:"g-ui-select-item-label"},C.label))):ti({className:"g-ui-select-item"},"Nothing found")))))}import{Div as ri,when as dr}from"@granularjs/core";function Wn(...e){let{props:i}=s(e,{items:[]}),{items:t,className:r,onClose:a,timeout:n,...u}=i;return ri({...u,className:o("g-ui-toast-stack",r)},t.map(g=>ri({className:o("g-ui-toast",[n,"g-ui-toast-auto"])},ri({className:"g-ui-toast-row"},dr(g.title,()=>ri({className:"g-ui-toast-title"},g.title)),dr(a,()=>ri({className:"g-ui-toast-close",onClick:()=>a(g)},"\xD7"))),g.message)))}function Gn(...e){let{props:i}=s(e);return ii(i)}import{Div as Zn,after as Un}from"@granularjs/core";function Xn(...e){let{props:i,rawProps:t}=s(e,{items:[],position:"top-right"}),{items:r,position:a,className:n,...u}=i,{onRemove:g}=t,p=new Map,h=(b,x)=>b?.id??b?.key??x,m=Un(r).compute(b=>{let x=l(b)??[],d=new Set;x.forEach((y,P)=>{let A=h(y,P);if(d.add(A),y?.autoClose&&!p.has(A)){let $=setTimeout(()=>{p.delete(A),g?.(y)},y.autoClose);p.set(A,$)}});for(let[y,P]of p.entries())d.has(y)||(clearTimeout(P),p.delete(y));return x.map((y,P)=>et({key:h(y,P),title:y.title,color:y.color,icon:y.icon,loading:y.loading,withCloseButton:y.withCloseButton,withBorder:y.withBorder,onClose:()=>{y.onClose?.(),g?.(y)}},y.message??y.body??y.content??y.text))});return Zn({...u,className:o("g-ui-notifications",k("g-ui-notifications-position-",a,"top-right"),n)},m)}import{Div as We,after as ai,state as _n,when as Kn}from"@granularjs/core";function Qn(...e){let{props:i,rawProps:t}=s(e,{min:0,max:100,step:1,size:"md"}),{value:r,marks:a,min:n,max:u,step:g,size:p,disabled:h,className:m,...b}=i,{onChange:x}=t,d=_n(l(r??[n,u])),y=()=>{let w=Number(l(n)),v=Number(l(u));return!Number.isFinite(w)||!Number.isFinite(v)?{minValue:0,maxValue:100}:{minValue:Math.min(w,v),maxValue:Math.max(w,v)}},P=()=>{let w=Number(l(g));return Number.isFinite(w)&&w>0?w:1},A=w=>{let{minValue:v,maxValue:f}=y(),C=P(),V=[v,f];Array.isArray(w)&&(V=w);let I=Math.max(v,Math.min(f,Number(V[0]))),X=Math.max(v,Math.min(f,Number(V[1]))),re=Math.round(Math.min(I,X)/C)*C,K=Math.round(Math.max(I,X)/C)*C;return[re,K]};ai(r).change(w=>{w!=null&&d.set(A(w))});let $=w=>{let v=A(w);v?.[0]===d.get()?.[0]&&v?.[1]===d.get()?.[1]||(d.set(v),x?.(v))},S=ai(d).compute(w=>{let{minValue:v,maxValue:f}=y(),C=f-v,[V,I]=A(w);if(C<=0)return{lowPct:0,highPct:0};let X=(V-v)/C*100,re=(I-v)/C*100;return{lowPct:Math.max(0,Math.min(100,X)),highPct:Math.max(0,Math.min(100,re))}}),F=(w,v,f)=>{let C=v?.();if(!C||C.width===0)return;let I=Math.min(Math.max(w.clientX-C.left,0),C.width)/C.width,{minValue:X,maxValue:re}=y(),K=X+I*(re-X),ue=d;typeof d.get=="function"&&(ue=d.get());let[te,oe]=A(ue);$(f==="low"?[K,oe]:[te,K])},z=(w,v,f)=>{if(ve(h))return;w.preventDefault?.();let C=f||w.currentTarget,V=()=>C.getBoundingClientRect(),I=V(),X=S;typeof S.get=="function"&&(X=S.get());let{lowPct:re,highPct:K}=X,ue=(w.clientX-I.left)/I.width*100,te=v;if(!te){let ie=Math.abs(ue-re)<=Math.abs(ue-K);te="high",ie&&(te="low")}C.setPointerCapture?.(w.pointerId),F(w,V,te);let oe=ie=>F(ie,V,te),de=()=>{C.releasePointerCapture?.(w.pointerId),window.removeEventListener("pointermove",oe),window.removeEventListener("pointerup",de)};window.addEventListener("pointermove",oe),window.addEventListener("pointerup",de)};return We({...b,className:o("g-ui-range-slider",k("g-ui-slider-size-",p,"md"),W("g-ui-slider-disabled",h),i.className??m)},We({className:"g-ui-slider-track",onPointerDown:w=>z(w)},We({className:"g-ui-slider-bar",style:ai(S).compute(({lowPct:w,highPct:v})=>({left:`${w}%`,width:`${Math.max(0,v-w)}%`}))}),We({className:"g-ui-slider-thumb",style:ai(S).compute(({lowPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),z(w,"low",w.currentTarget.parentElement)}}),We({className:"g-ui-slider-thumb",style:ai(S).compute(({highPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),z(w,"high",w.currentTarget.parentElement)}})),Kn(a,()=>We({className:"g-ui-slider-marks"},a.map(w=>nt({mark:w,getBounds:y})))))}import{state as dt,after as mr}from"@granularjs/core";function Jn(...e){let{props:i,rawProps:t}=s(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:r,size:a,calendarSize:n,leftSection:u,rightSection:g,className:p,format:h,minDate:m,maxDate:b,...x}=i,{onChange:d}=t,y=v=>{let f=l(v);if(f instanceof Date)return f;if(f==null||f==="")return null;let C=new Date(f);return Number.isNaN(C.getTime())?null:C},P=(v,f)=>v&&f&&v.getFullYear()===f.getFullYear()&&v.getMonth()===f.getMonth()&&v.getDate()===f.getDate(),A=v=>{if(!v)return"";let f=String(v.getFullYear()).padStart(4,"0"),C=String(v.getMonth()+1).padStart(2,"0"),V=String(v.getDate()).padStart(2,"0");return`${f}-${C}-${V}`},$=v=>{let f=String(v??"").replace(/\D/g,"");if(f.length<8)return null;let C=Number(f.slice(0,4)),V=Number(f.slice(4,6)),I=Number(f.slice(6,8));if(!C||!V||!I)return null;let X=new Date(C,V-1,I);if(X.getFullYear()!==C||X.getMonth()!==V-1||X.getDate()!==I)return null;let re=y(m);if(re&&X<re)return null;let K=y(b);return K&&X>K?null:X},S=dt(y(r)),F=dt(A(S.get())),z=dt(!1);mr(r).change(v=>{if(r.get()==v)return;let f=y(v);if(f==null){S.set(null),F.set("");return}S.set(f),F.set(A(f))}),mr(F).change(v=>{let f=$(v);console.log("parsed",f),console.log("currentDate",S.get()),f&&(P(f,S.get())||(S.set(f),d?.(f)))});let w=v=>{v&&(P(v,S.get())||(S.set(v),F.set(A(v)),d?.(v),z.set(!1)))};return lt({opened:z,onChange:v=>z.set(!!v),content:ii({size:k("",n,"xs"),value:S,onChange:w}),className:"g-ui-date-input-popover"},ge({...x,size:a,className:o("g-ui-dateinput",p),leftSection:u,rightSection:g,type:"text",inputMode:"numeric",format:h,value:F,onChange:v=>F.set(v)}))}import{Div as mt,when as es,after as is,state as ts}from"@granularjs/core";function rs(...e){let{props:i,rawProps:t,children:r}=s(e),{opened:a,content:n,className:u,...g}=i,{onChange:p}=t,h=ts(l(a)??!1);is(a).change(b=>{let x=l(b);x!=null&&h.set(!!x)});let m=b=>{h.set(b),p?.(b)};return mt({...g,className:o("g-ui-popper",u)},mt({onClick:()=>m(!h.get())},r),es(h,()=>mt({className:"g-ui-popper-dropdown"},n)))}import{Button as as,after as fr,when as os,state as ns}from"@granularjs/core";function ss(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{size:r,className:a,rightSection:n,...u}=i,{onChange:g}=t,p=ns(!1),h=fr(p).compute(b=>b?"text":"password"),m=fr(n).compute(b=>b??as({className:"g-ui-password-toggle",onClick:()=>p.set(!p.get())},os(p,()=>"Hide",()=>"Show")));return ge({...u,size:r,className:a,onChange:g,rightSection:m,type:h})}import{Div as us}from"@granularjs/core";function gs(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return ge({...a,size:t,className:r,leftSection:us({className:"g-ui-search-input-left-section",innerHTML:At}),type:"text",inputMode:"search"})}import{Button as ls,after as cs,when as hr}from"@granularjs/core";import{state as ps}from"@granularjs/core";function ds(...e){let{props:i,children:t}=s(e,{value:"",timeout:1500}),{value:r,timeout:a,className:n,...u}=i,g=ps(!1),p=cs(g).compute(m=>o("g-ui-copy-button",m&&"g-ui-copy-button-done",n));return ls({...u,className:p,onClick:async()=>{try{await navigator.clipboard.writeText(String(r)),g.set(!0),setTimeout(()=>g.set(!1),a)}catch{}},type:"button"},hr(t?.length,()=>t,()=>hr(g,()=>"Copied",()=>"Copy")))}import{Div as ms}from"@granularjs/core";function fs(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return ms({...a,className:o("g-ui-progress-ring",[t,n=>`g-ui-progress-ring-size-${n}`],r)})}import{Div as ft,Button as hs,when as xr}from"@granularjs/core";function xs(...e){let{props:i,children:t}=s(e),{title:r,onClose:a,className:n,...u}=i;return ft({...u,className:o("g-ui-toast",n)},ft({className:"g-ui-toast-row"},xr(r,()=>ft({className:"g-ui-toast-title"},r)),xr(a,()=>hs({className:"g-ui-toast-close",onClick:a},"\xD7"))),t)}import{Div as ht}from"@granularjs/core";import{state as vs}from"@granularjs/core";function bs(...e){let{props:i,rawProps:t}=s(e,{data:[]}),{data:r,className:a,...n}=i,{onChange:u}=t,g=vs(""),p=r.filter(h=>String(h.label||"").toLowerCase().includes(String(g.get()).toLowerCase()));return ht({...n,className:o("g-ui-select-search",a)},ge({inputClassName:"g-ui-select-search-input",placeholder:"Search...",value:g,onInput:h=>g.set(h?.target?.value??"")}),ht({className:"g-ui-select-search-list"},p.map(h=>ht({className:"g-ui-select-search-item",onClick:()=>u?.(h.value)},h.label))))}import{Div as ws}from"@granularjs/core";function ys(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return ws({...a,className:o("g-ui-switch-group",r)},t)}import{Div as ks,state as zs,after as xt}from"@granularjs/core";function Ns(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{value:r,size:a,className:n,...u}=i,{onChange:g}=t,p=zs(l(r)??["",""]);xt(r).change(m=>{let b=l(m);b!=null&&p.set(b)});let h=m=>{p.set(m),g?.(m)};return ks({...u,className:o("g-ui-range-picker",i.className??n)},ge({size:a,type:"text",inputMode:"numeric",value:xt(p).compute(m=>m?.[0]??""),onInput:m=>{let b=p.get()??["",""];h([m.target.value,b[1]])}}),ge({size:a,type:"text",inputMode:"numeric",value:xt(p).compute(m=>m?.[1]??""),onInput:m=>{let b=p.get()??["",""];h([b[0],m.target.value])}}))}import{Div as Cs}from"@granularjs/core";function Ss(...e){let{props:i,children:t}=s(e,{align:"center",direction:"row"}),{direction:r,wrap:a,align:n,justify:u,gap:g,className:p,...h}=i;return Cs({...h,className:o("g-ui-flex",[r,m=>m==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[n,m=>m&&`g-ui-align-${m}`],[u,m=>m&&`g-ui-justify-${m}`],[g,m=>m&&`g-ui-gap-${m}`],p)},t)}import{A as Ds,Div as oi,Span as vr,when as ni,after as br,state as Ps}from"@granularjs/core";function Ms(...e){let{props:i,rawProps:t,children:r}=s(e,{variant:"subtle",childrenOffset:24}),{label:a,description:n,leftSection:u,rightSection:g,active:p,disabled:h,variant:m,childrenOffset:b,opened:x,defaultOpened:d,className:y,padding:P,...A}=i,{onClick:$,onChange:S}=t,F=r.length>0,z=Ps(l(x)??l(d)??!1);br(x).change(f=>{let C=l(f);C!=null&&z.set(!!C)});let w=br(b).compute(f=>({paddingLeft:Tt(l(f??24))??"24px"})),v=f=>{if(l(h)){f?.preventDefault?.();return}if(F){let C=!z.get();z.set(C),S?.(C)}$?.(f)};return oi({className:o("g-ui-navlink-root",y)},Ds({...A,className:o("g-ui-navlink",k("g-ui-navlink-variant-",m,"subtle"),W("g-ui-navlink-active",p),W("g-ui-navlink-disabled",h),k("g-ui-navlink-padding-",P,"md")),onClick:v},ni(u,()=>vr({className:"g-ui-navlink-section g-ui-navlink-left"},u)),oi({className:"g-ui-navlink-body"},ni(a,()=>oi({className:"g-ui-navlink-label"},a)),ni(n,()=>oi({className:"g-ui-navlink-description"},n))),ni(g,()=>vr({className:"g-ui-navlink-section g-ui-navlink-right"},g))),F?ni(z,()=>oi({className:"g-ui-navlink-children",style:w},r)):null)}import{Div as wr,when as Ts}from"@granularjs/core";function Vs(...e){let{props:i,children:t}=s(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:r,position:a,color:n,size:u,className:g,...p}=i;return wr({...p,className:o("g-ui-indicator",k("g-ui-indicator-position-",a,"top-right"),k("g-ui-indicator-color-",n,"danger"),k("g-ui-indicator-size-",u,"md"),g)},t,Ts(r,()=>wr({className:"g-ui-indicator-badge"})))}import{Span as Di}from"@granularjs/core";function Ls(...e){let{props:i}=s(e),{opened:t,className:r,...a}=i;return Di({...a,className:o("g-ui-burger",[t,"g-ui-burger-open"],r)},Di(""),Di(""),Di(""))}import{Div as $s,when as Is}from"@granularjs/core";function Bs(...e){let{props:i}=s(e),{visible:t,...r}=i;return Is(t,()=>$s({...r,className:"g-ui-loading-overlay"},Ke({})))}import{Div as As}from"@granularjs/core";function Fs(...e){let{props:i,children:t}=s(e,{gap:"md"}),{className:r,gap:a,...n}=i;return As({...n,className:o("g-ui-grid-system",[a,u=>`g-ui-gap-${u}`],r)},t)}import{Div as js}from"@granularjs/core";function Es(...e){let{props:i,children:t}=s(e,{span:12}),{span:r,className:a,...n}=i;return js({...n,className:o([r,u=>`g-ui-col-span-${u}`],a)},t)}import{Div as Rs}from"@granularjs/core";function Hs(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,className:a,...n}=i;return Rs({...n,className:o("g-ui-scroll-area",[r,u=>`g-ui-scroll-area-${u}`],a)},t)}import{Div as yr,Input as Os,after as Me,state as vt,when as kr,list as qs}from"@granularjs/core";function Ys(...e){let{props:i,rawProps:t}=s(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:r,value:a,size:n,type:u,mask:g,placeholder:p,disabled:h,error:m,oneTimeCode:b,className:x}=i,{onChange:d,onComplete:y}=t,P=vt(l(r)??4),A=()=>P.get();Me(r).change(T=>{let R=l(T)??4,N=P.get();if(R===N)return;P.set(R);let G=S.get(),H=$.get();S.set(Array.from({length:R},(ne,se)=>G[se]??"")),$.set(Array.from({length:R},(ne,se)=>H[se]??null))});let $=vt(Array.from({length:A()},()=>null)),S=vt(Array.from({length:A()},(T,R)=>{let N=l(a);return typeof N=="string"||Array.isArray(N)?N[R]??"":""}));Me(a).change(T=>{if(T==null)return;let R=A();typeof T=="string"?S.set(Array.from({length:R},(N,G)=>T[G]??"")):Array.isArray(T)&&S.set(Array.from({length:R},(N,G)=>T[G]??""))});let F=()=>S.get().join(""),z=T=>{S.set(T);let R=T.join("");d?.(R),T.every(N=>N!=="")&&T.length===A()&&y?.(R)},w=T=>{let R=A(),N=$.get();T>=0&&T<R&&N[T]&&(N[T].focus(),N[T].select())},v=()=>{let T=l(u);return T==="number"?/^[0-9]$/:T instanceof RegExp?T:/^[a-zA-Z0-9]$/},f=(T,R)=>{let N=R.target.value,G=v();if(N.length>1){C(T,N);return}if(N&&!G.test(N)){R.target.value=S.get()[T]??"";return}let H=S.get().slice();H[T]=N,z(H),N&&T<A()-1&&w(T+1)},C=(T,R)=>{let N=v(),G=R.split("").filter(xe=>N.test(xe)),H=S.get().slice(),ne=A();G.forEach((xe,ze)=>{let Se=T+ze;Se<ne&&(H[Se]=xe)}),z(H);let se=H.findIndex((xe,ze)=>ze>=T&&xe==="");se>=0?w(se):w(Math.min(T+G.length,ne-1))},V=(T,R)=>{if(R.key==="Backspace"){let N=S.get().slice();N[T]===""&&T>0?(R.preventDefault(),N[T-1]="",z(N),w(T-1)):N[T]!==""&&(N[T]="",z(N))}else R.key==="ArrowLeft"&&T>0?(R.preventDefault(),w(T-1)):R.key==="ArrowRight"&&T<A()-1&&(R.preventDefault(),w(T+1))},I=(T,R)=>{R.target.select()},X=()=>{let T=S.get(),R=T.findIndex(N=>N==="");R>=0?w(R):w(T.length-1)},re=Me(g).compute(T=>l(T)?"password":"text"),K=Me(u).compute(T=>l(T)==="number"?"numeric":"text"),ue=Me(b).compute(T=>l(T)?"one-time-code":"off"),te=Me(h).compute(T=>!!l(T)),oe=Me(m).compute(T=>!!l(T)),de=Me(P).compute(T=>Array.from({length:T},(R,N)=>N)),ie=T=>Os({className:o("g-ui-pin-input-field",kr(oe,()=>"g-ui-pin-input-error")),type:re,inputMode:K,autocomplete:ue,maxLength:2,placeholder:kr(te,()=>"",()=>p),disabled:te,value:Me(S,T).compute(([R,N])=>R[N]??""),node:$[T.get()],onInput:R=>f(T.get(),R),onChange:R=>f(T.get(),R),onKeyDown:R=>V(T.get(),R),onFocus:R=>I(T.get(),R)});return yr({className:o("g-ui-pin-input",k("g-ui-input-size-",n,"md"),x),onClick:X},yr({className:"g-ui-pin-input-wrapper"},qs(de,ie)))}import{Div as Ws}from"@granularjs/core";function Gs(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Ws({...a,className:o("g-ui-checkbox-group",r)},t)}import{Div as Zs}from"@granularjs/core";function Us(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Zs({...a,className:o("g-ui-avatar-group",r)},t)}import{Div as Xs}from"@granularjs/core";function _s(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Xs({...a,className:o("g-ui-badge-group",r)},t)}import{Div as Pi,Span as Ks,after as si,context as zr}from"@granularjs/core";var Qs=zr([]),Nr=zr({sort:null,onSort:null});function bt(...e){let{props:i,rawProps:t,children:r}=s(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:n,sort:u,stickyHeader:g,...p}=i,{onSort:h}=t,m=Qs.scope(n.get());si(n).change(x=>m.set(x));let b=Nr.scope({sort:u.get(),onSort:h||null});return si(u).change(x=>b.set().sort=x),m.serve(b.serve(Pi({className:o("g-ui-grid-table",W("g-ui-grid-table-sticky",g),a),style:{gridTemplateColumns:si(m).compute(x=>Array.isArray(x)?x.join(" "):"")},...p},r)))}bt.GridRow=(...e)=>{let{props:i,children:t}=s(e,{}),{className:r,header:a,...n}=i;return Pi({className:o("g-ui-grid-table-row",W("g-ui-grid-table-row-header",a),r),...n},...t)};bt.GridCell=function(...e){let{props:i,rawProps:t,children:r}=s(e,{}),{className:a,sort:n,...u}=i,g=t.sort;if(g){let p=Nr.state(),h=si(p.sort).compute(b=>b?.key===g?b.direction:null),m=()=>{let b=p.get().sort,x;b?.key===g?x=b.direction==="asc"?{key:g,direction:"desc"}:null:x={key:g,direction:"asc"},p.set().sort=x;let{onSort:d}=p.get();d&&d(x)};return Pi({className:o("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:m,...u},r,Ks({className:"g-ui-grid-table-sort-icon"},si(h).compute(b=>b==="asc"?" \u2191":b==="desc"?" \u2193":"")))}return Pi({className:o("g-ui-grid-table-cell",a),...u},r)};import{Button as Js,Div as eu,Span as Cr,when as Sr}from"@granularjs/core";function Dr(...e){let{props:i,children:t}=s(e,{grow:!0}),{grow:r,className:a,...n}=i;return eu({...n,className:o("g-ui-bottombar",W("g-ui-bottombar-grow",r),a)},t)}Dr.Action=function(...i){let{props:t,rawProps:r,children:a}=s(i,{variant:"subtle"}),{icon:n,label:u,active:g,disabled:p,variant:h,className:m,...b}=t,{onClick:x}=r;return Js({...b,className:o("g-ui-bottombar-action",k("g-ui-bottombar-action-variant-",h,"subtle"),W("g-ui-bottombar-action-active",g),W("g-ui-bottombar-action-disabled",p),m),onClick:x,disabled:p},Sr(n,()=>Cr({className:"g-ui-bottombar-action-icon"},n)),Sr(u,()=>Cr({className:"g-ui-bottombar-action-label"},u)),a)};import{Div as j,Button as Fe,state as le,after as be,when as ce,Input as Mi,Label as ui,Span as je}from"@granularjs/core";var iu=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tu=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function Ti(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function Tr(e){let i=Ti(e.start),t=Ti(e.end);return!i||!t?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:t,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function Vr(e,i,t){let r=Ti(i).getTime(),a=Ti(t).getTime();return e.map(Tr).filter(Boolean).filter(n=>n.end.getTime()>r&&n.start.getTime()<a)}function Pr(e,i){let t=new Date(i);t.setHours(0,0,0,0);let r=t.getTime();t.setHours(23,59,59,999);let a=t.getTime();return Vr(e,r,a)}function wt(e,i){let t=new Date(e),a=(t.getDay()-i+7)%7;return t.setDate(t.getDate()-a),t.setHours(0,0,0,0),t}function Ge(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function gi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function ru(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function au(e,i="default"){let t=new Date(e);return t.setDate(t.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${t.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function Mr(e,i,t,r){let a=new Date(e).setHours(t,0,0,0),n=new Date(e).setHours(r,0,0,0),u=(r-t)*60,g=Math.max(e.getTime(),a),h=(Math.min(i.getTime(),n)-g)/6e4,m=(g-a)/6e4/u*100,b=h/u*100;return{top:m,height:b}}function ou(...e){let{props:i,rawProps:t}=s(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:r=[],defaultView:a,firstDayOfWeek:n,locale:u,hourSlotDuration:g,minTime:p,maxTime:h,eventCreationColorOptions:m,className:b,...x}=i,{onCreateEventRequest:d,onViewEventRequest:y,onUpdateEventRequest:P,onRemoveEventRequest:A,eventCreationEmailLookup:$,eventCreationLocationsCallback:S,eventCreationCalendarsCallback:F,onSlotClick:z,onDateRangeChange:w}=t,v=le(l(a)??"month"),f=le(new Date),C=le(null),V=le(null),I=le({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),X=be(r).compute(c=>Array.isArray(c)?c:[]),re=f.get(),K=wt(re,l(n)??0),ue=l(p)??6,te=l(h)??22,oe=l(g)??30,de=()=>{let c=new Date(f.get());v.get()==="month"?c.setMonth(c.getMonth()-1):v.get()==="week"?c.setDate(c.getDate()-7):c.setDate(c.getDate()-1),f.set(c),w?.({start:c,end:c,view:v.get()})},ie=()=>{let c=new Date(f.get());v.get()==="month"?c.setMonth(c.getMonth()+1):v.get()==="week"?c.setDate(c.getDate()+7):c.setDate(c.getDate()+1),f.set(c),w?.({start:c,end:c,view:v.get()})},T=()=>{let c=new Date;f.set(c),w?.({start:c,end:c,view:v.get()})},R=(c,B,ae=!1)=>{let q=c?new Date(c):new Date(f.get()),J=B?new Date(B):new Date(q.getTime()+3600*1e3);ae&&(q.setHours(0,0,0,0),J.setHours(23,59,59,999)),I.set({title:"",start:q,end:J,allDay:ae,description:"",location:"",attendees:[],color:null}),C.set("create")},N=c=>{V.set(Tr(c)),C.set("view"),y?.(c)},G=()=>{let c=V.get();c&&(I.set({title:c.title,start:new Date(c.start),end:new Date(c.end),allDay:c.allDay,description:c.description??"",location:c.location??"",attendees:[...c.attendees||[]],color:c.color??null}),C.set("edit"))},H=()=>{C.set(null),V.set(null)},ne=(c,B,ae)=>{if(z){z({date:c,hour:B,allDay:ae});return}let q=new Date(c);if(ae){q.setHours(0,0,0,0);let J=new Date(q);J.setHours(23,59,59,999),R(q,J,!0)}else{q.setHours(B,0,0,0);let J=new Date(q.getTime()+oe*60*1e3);R(q,J,!1)}},se=()=>{let c=I.get();!c.start||!c.end||d?.({title:c.title,start:c.start,end:c.end,allDay:c.allDay,description:c.description,location:c.location,attendees:c.attendees,color:c.color},()=>{H()})},xe=()=>{let c=V.get(),B=I.get();!c||!B.start||!B.end||P?.(c,{title:B.title,start:B.start,end:B.end,allDay:B.allDay,description:B.description,location:B.location,attendees:B.attendees,color:B.color},()=>H())},ze=()=>{let c=V.get();c&&A?.(c,()=>H())},Se=be(v,f).compute(([c,B])=>c==="month"?ru(B,l(u)):c==="week"?au(wt(B,l(n)??0),l(u)):gi(B,l(u))),Ve=j({className:"g-ui-event-calendar-header"},j({className:"g-ui-event-calendar-nav-group"},Ae({size:"sm",variant:"subtle",onClick:de,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:mi})),Ae({size:"sm",variant:"subtle",onClick:ie,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:di})),Fe({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:T},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:Rt}),"Today")),j({className:"g-ui-event-calendar-title"},Se),j({className:"g-ui-event-calendar-actions"},tu.map(c=>j({className:o("g-ui-event-calendar-view-option",be(v).compute(B=>B===c.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{v.set(c.value),w?.({start:f.get(),end:f.get(),view:c.value})}},c.label)),Fe({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>R(f.get(),null,!1)},ye({size:"sm",innerHTML:Ft}),"Create"))),li=be(f,X,n).compute(([c,B,ae])=>{let q=c.getFullYear(),J=c.getMonth(),Q=(new Date(q,J,1).getDay()-(ae??0)+7)%7,Ce=new Date(q,J+1,0).getDate(),De=new Date(q,J,0).getDate(),M=[],D=1,E=1,O=Math.ceil((Q+Ce)/7)*7,_=[];for(let Z=0;Z<O;Z+=1){let Y,U,ee;Z<Q?(Y=De-Q+Z+1,ee=new Date(q,J-1,Y),U=!1):D<=Ce?(Y=D,ee=new Date(q,J,Y),U=!0,D+=1):(Y=E,ee=new Date(q,J+1,Y),U=!1,E+=1);let fe=Pr(B,ee),Te=ee.getDate()===new Date().getDate()&&ee.getMonth()===new Date().getMonth()&&ee.getFullYear()===new Date().getFullYear();_.push(j({key:ee.getTime(),className:o("g-ui-event-calendar-month-cell",!U&&"g-ui-event-calendar-month-cell-outside",Te&&"g-ui-event-calendar-month-cell-today")},j({className:"g-ui-event-calendar-month-cell-header",onClick:()=>ne(ee,0,!0)},je({className:"g-ui-event-calendar-month-cell-day"},ee.getDate())),j({className:"g-ui-event-calendar-month-cell-events"},fe.slice(0,3).map(we=>j({key:we.id,className:"g-ui-event-calendar-month-event",style:we.color?{borderLeftColor:we.color,backgroundColor:`${we.color}20`}:{},onClick:Bi=>{Bi.stopPropagation(),N(we)}},we.title||"(No title)")),ce(fe.length>3,()=>j({className:"g-ui-event-calendar-month-more",onClick:we=>{we.stopPropagation(),N(fe[3])}},`+${fe.length-3} more`)))))}return _}),Vi=j({className:"g-ui-event-calendar-month"},j({className:"g-ui-event-calendar-weekdays"},iu.map(c=>j({key:c,className:"g-ui-event-calendar-weekday"},c))),j({className:"g-ui-event-calendar-month-grid"},li)),Ne=[];for(let c=ue;c<te;c+=1)for(let B=0;B<60;B+=oe)Ne.push(c+B/60);let Ze=be(f,n).compute(([c,B])=>{let ae=wt(c,B??0),q=[];for(let J=0;J<7;J+=1){let pe=new Date(ae);pe.setDate(pe.getDate()+J),q.push(pe)}return q}),Li=j({className:"g-ui-event-calendar-week"},be(Ze).compute(c=>j({className:"g-ui-event-calendar-week-days"},j({className:"g-ui-event-calendar-week-time-col"},""),(c||[]).map(B=>j({key:B.getTime(),className:"g-ui-event-calendar-week-day-col"},j({className:"g-ui-event-calendar-week-day-header"},gi(B,l(u))))))),j({className:"g-ui-event-calendar-week-body"},j({className:"g-ui-event-calendar-week-time-col"},Ne.map(c=>{let B=Math.floor(c),ae=(c-B)*60,q=`${B<=12?B:B-12}:${ae===0?"00":ae} ${B<12?"AM":"PM"}`;return j({key:c,className:"g-ui-event-calendar-week-slot-label"},q)})),be(Ze,X).compute(([c,B])=>{if(!c||!c.length)return null;let ae=c[0],q=new Date(c[6]);q.setHours(23,59,59,999);let J=Vr(B,ae,q);return j({className:"g-ui-event-calendar-week-grid-cols"},c.map(pe=>j({key:pe.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Ne.map(Q=>j({key:Q,className:"g-ui-event-calendar-week-slot",onClick:()=>ne(pe,Q,!1)})),J.filter(Q=>!Q.allDay&&Q.start.getDate()===pe.getDate()&&Q.start.getMonth()===pe.getMonth()&&Q.start.getFullYear()===pe.getFullYear()).map(Q=>{let{top:Ce,height:De}=Mr(Q.start,Q.end,ue,te);return j({key:Q.id,className:"g-ui-event-calendar-week-event",style:{top:`${Ce}%`,height:`${De}%`,borderLeftColor:Q.color||"var(--g-ui-primary)"},onClick:M=>{M.stopPropagation(),N(Q)}},j({className:"g-ui-event-calendar-week-event-title"},Q.title||"(No title)"),ce(!Q.allDay,()=>je({className:"g-ui-event-calendar-week-event-time"},`${Ge(Q.start,l(u))} \u2013 ${Ge(Q.end,l(u))}`)))}))))}))),$i=j({className:"g-ui-event-calendar-day"},j({className:"g-ui-event-calendar-day-body"},j({className:"g-ui-event-calendar-day-time-col"},Ne.map(c=>{let B=Math.floor(c),ae=(c-B)*60,q=`${B<=12?B:B-12}:${ae===0?"00":ae} ${B<12?"AM":"PM"}`;return j({key:c,className:"g-ui-event-calendar-day-slot-label"},q)})),j({className:"g-ui-event-calendar-day-slots"},Ne.map(c=>j({key:c,className:"g-ui-event-calendar-day-slot",onClick:()=>ne(f.get(),c,!1)})),be(X,f).compute(([c,B])=>B?Pr(c,B).filter(q=>!q.allDay).map(q=>{let{top:J,height:pe}=Mr(q.start,q.end,ue,te);return j({key:q.id,className:"g-ui-event-calendar-day-event",style:{top:`${J}%`,height:`${pe}%`,borderLeftColor:q.color||"var(--g-ui-primary)"},onClick:Q=>{Q.stopPropagation(),N(q)}},j({className:"g-ui-event-calendar-day-event-title"},q.title||"(No title)"),je({className:"g-ui-event-calendar-day-event-time"},`${Ge(q.start,l(u))} \u2013 ${Ge(q.end,l(u))}`))}):[])))),ci=c=>{let B=I.get(),ae=new Date,q=B.start||ae,J=B.end||new Date(ae.getTime()+3600*1e3),pe=le(B.title),Q=le(q.toISOString().slice(0,10)),Ce=le(!B.allDay&&q?q.toTimeString().slice(0,5):"09:00"),De=le(J.toISOString().slice(0,10)),M=le(!B.allDay&&J?J.toTimeString().slice(0,5):"10:00"),D=le(B.allDay),E=le(B.description),O=le(B.location),_=le(B.attendees||[]),Z=le(""),Y=le([]),U=le([]),ee=le(""),fe=Array.isArray(m)?m:[],Te=le(B.color),we=()=>{let L=new Date(Q.get()+"T"+(D.get()?"00:00:00":Ce.get()+":00")),he=new Date(De.get()+"T"+(D.get()?"23:59:59":M.get()+":00"));I.set({title:pe.get(),start:L,end:he,allDay:D.get(),description:E.get(),location:O.get(),attendees:_.get(),color:Te.get()})},Bi=L=>{if(Z.set(L),!$||!L.trim()){Y.set([]);return}Promise.resolve($(L.trim())).then(he=>Y.set(Array.isArray(he)?he:[])).catch(()=>Y.set([]))},Lr=L=>{let he=_.get();he.some(kt=>(kt.email||kt.id)===(L.email||L.id))||(_.set([...he,{id:L.id,email:L.email??L.label,label:L.label}]),Z.set(""),Y.set([]))},$r=L=>{let he=[..._.get()];he.splice(L,1),_.set(he)},yt=()=>{S&&Promise.resolve(S(ee.get())).then(L=>U.set(Array.isArray(L)?L:[])).catch(()=>U.set([]))};return j({className:"g-ui-event-calendar-form"},j({className:"g-ui-event-calendar-form-row"},ge({label:"Title",placeholder:"Event title",value:pe,onInput:L=>pe.set(L?.target?.value??"")})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},Xi({label:"All day",checked:D,onChange:L=>D.set(L)})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"Start"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:Q,onInput:L=>Q.set(L?.target?.value??"")}),ce(!D,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:Ce,onInput:L=>Ce.set(L?.target?.value??"")}))),j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"End"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:De,onInput:L=>De.set(L?.target?.value??"")}),ce(!D,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:M,onInput:L=>M.set(L?.target?.value??"")})))),ce(S,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Location"),ge({placeholder:"Search or type location",value:ee,onInput:L=>{ee.set(L?.target?.value??""),yt()},onFocus:yt}),ce(be(U).compute(L=>L&&L.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},U.get().map(L=>j({key:L.id??L.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{O.set(L.label??L.id),ee.set(""),U.set([])}},L.label??L.id)))),ce(be(O).compute(L=>!!L),()=>je({className:"g-ui-event-calendar-form-chip"},O)))),ce($,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Add guests"),ge({placeholder:"Type email to search",value:Z,onInput:L=>Bi(L?.target?.value??"")}),j({className:"g-ui-event-calendar-form-chips"},_.get().map((L,he)=>je({key:(L.email||L.id)+he,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>$r(he)},L.label||L.email||L.id," \xD7"))),ce(be(Y).compute(L=>L&&L.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},Y.get().map(L=>j({key:L.id??L.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>Lr(L)},L.label??L.email??L.id)))))),j({className:"g-ui-event-calendar-form-row"},qi({label:"Description",placeholder:"Add description",value:E,onInput:L=>E.set(L?.target?.value??"")})),ce(fe.length>0,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Color"),j({className:"g-ui-event-calendar-form-colors"},fe.map(L=>j({key:L.value??L.id??L,className:o("g-ui-event-calendar-form-color-swatch",be(Te).compute(he=>he===(L.value??L.id??L)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:L.color??L.value??L},onClick:()=>Te.set(L.value??L.id??L)}))))),j({className:"g-ui-event-calendar-form-actions"},Fe({variant:"subtle",onClick:H},"Cancel"),Fe({variant:"filled",onClick:()=>{we(),c?xe():se()}},c?"Save":"Create")))},Ii=()=>{let c=V.get();return c?j({className:"g-ui-event-calendar-view-modal"},j({className:"g-ui-event-calendar-view-modal-title"},c.title||"(No title)"),j({className:"g-ui-event-calendar-view-modal-meta"},c.allDay?je({className:"g-ui-event-calendar-view-modal-date"},gi(c.start,l(u))+(c.start.getTime()!==c.end.getTime()?` \u2013 ${gi(c.end,l(u))}`:"")):je({className:"g-ui-event-calendar-view-modal-date"},`${gi(c.start,l(u))} \xB7 ${Ge(c.start,l(u))} \u2013 ${Ge(c.end,l(u))}`)),ce(c.location,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Location: ",c.location)),ce(c.description,()=>j({className:"g-ui-event-calendar-view-modal-field"},c.description)),ce(c.attendees?.length,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",c.attendees.map(B=>B.label||B.email||B.id).join(", "))),j({className:"g-ui-event-calendar-view-modal-actions"},Fe({variant:"subtle",size:"sm",onClick:G},ye({size:"sm",innerHTML:jt})," Edit"),Fe({variant:"subtle",size:"sm",onClick:ze,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:Et})," Delete"),Fe({variant:"filled",size:"sm",onClick:H},"Close"))):null};return j({...x,className:o("g-ui-event-calendar",b)},Ve,ce(v,c=>c==="month",()=>Vi),ce(v,c=>c==="week",()=>Li),ce(v,c=>c==="day",()=>$i),ce(C,c=>c==="create",()=>_e({opened:!0,title:"New event",size:"lg",onClose:H},ci(!1))),ce(C,c=>c==="view",()=>_e({opened:!0,title:"Event",size:"md",onClose:H},Ii())),ce(C,c=>c==="edit",()=>_e({opened:!0,title:"Edit event",size:"lg",onClose:H},ci(!0))))}import{state as nu}from"@granularjs/core";function su(e=!1){let i=nu(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Nt();export{Qa as Accordion,Ae as ActionIcon,Cn as Affix,ho as Alert,Fo as Anchor,Vn as AppBar,wo as Avatar,Us as AvatarGroup,xa as Badge,_s as BadgeGroup,So as Blockquote,Dr as BottomBar,cn as Breadcrumbs,Ls as Burger,Ri as Button,ii as Calendar,fa as Card,dn as Center,Xi as Checkbox,Gs as CheckboxGroup,_o as Chip,No as Code,Es as Col,vn as Collapse,ga as Container,ds as CopyButton,Jn as DateInput,Gn as DatePicker,lo as Divider,no as Drawer,ou as EventCalendar,Mn as Fieldset,Ss as Flex,Fs as Grid,bt as GridTable,da as Group,zn as HoverCard,ye as Icon,Eo as Image,Vs as Indicator,ko as Kbd,Jt as List,Ke as Loading,Bs as LoadingOverlay,ro as Menu,_e as Modal,Yn as MultiSelect,Ms as NavLink,et as Notification,Xn as Notifications,Yi as NumberField,Sa as NumberInput,tn as Pagination,po as Paper,ss as PasswordInput,Ys as PinInput,lt as Popover,rs as Popper,Ho as Progress,fs as ProgressRing,nn as Radio,un as RadioGroup,Ns as RangePicker,Qn as RangeSlider,En as Rating,Hs as ScrollArea,gs as SearchInput,Qo as SegmentedControl,Ea as Select,bs as SelectSearch,$n as Sidebar,Po as SimpleGrid,Zo as Skeleton,Yo as Slider,fn as Space,ca as Stack,Fn as Stepper,ja as Switch,ys as SwitchGroup,Ua as Table,qa as Tabs,Hn as Tag,Hi as Text,ge as TextInput,qi as Textarea,An as Timeline,sa as Title,xs as Toast,Wn as ToastStack,Ja as Tooltip,o as cx,Xr as setThemeMode,Ur as setThemeVars,su as useDisclosure};
|
|
3612
|
+
`;function Nt(){if(typeof document>"u"||document.getElementById(zt))return;let e=document.createElement("style");e.id=zt,e.textContent=Gr,document.head.appendChild(e)}var Zr=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function Ur(e={},i=document?.documentElement){if(i)for(let[t,r]of Object.entries(e)){let a=t.startsWith("--")?t:`--g-ui-${t}`;Zr.has(a)&&i.style.setProperty(a,String(r))}}function Xr(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}import{Renderer as Ct,isSignal as St,isState as Dt,isStatePath as Pt,isComputed as Mt,resolve as Le,computed as _r,after as Ai,concat as Kr}from"@granularjs/core";function Fi(e){return St(e)||Dt(e)||Pt(e)||Mt(e)}function o(...e){return Kr(...e,{separator:" ",filterFalsy:!0})}function Tt(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function s(e,i){let t={},r=[],a=n=>!!n&&typeof n=="object"&&!Array.isArray(n)&&!Ct.isRenderable(n)&&!Ct.isDomNode(n)&&!St(n)&&!Dt(n)&&!Pt(n)&&!Mt(n);for(let n of e)a(n)?Object.assign(t,n):r.push(n);if(i&&typeof i=="object")for(let n of Object.keys(i))t[n]===void 0&&(t[n]=i[n]);return{props:_r(t),rawProps:t,children:r}}function l(e){return Le(e)}function ve(e){return!!Le(e)}function k(e,i,t){let r=a=>{let n=Le(a),u=n==null||n===""?t:n;return u==null||u===""?"":`${e}${u}`};return Fi(i)?Ai(i).compute(a=>r(a)):r(i)}function W(e,i){return Fi(i)?Ai(i).compute(t=>Le(t)?e:""):Le(i)?e:""}function me(e,i,t){let r=a=>i[a]||null;return Fi(e)?Ai(e).compute(a=>r(Le(a??t))):r(Le(e??t))}import{Button as Qr,Span as ji,when as Ei,after as Jr}from"@granularjs/core";function Ri(...e){let{props:i,children:t}=s(e,{variant:"filled",size:"md",justify:"center"}),{variant:r,size:a,fullWidth:n,loading:u,leftSection:g,rightSection:p,className:h,disabled:m,justify:b,...x}=i,d=Jr(m,u).compute(([y,D])=>y||D);return Qr({...x,disabled:d,className:o("g-ui-button",k("g-ui-button-variant-",r,"filled"),k("g-ui-justify-",b,"center"),k("g-ui-button-size-",a,"md"),W("g-ui-button-full",n),W("g-ui-button-loading",u),h)},Ei(g,()=>ji({className:"g-ui-button-section-left"},g)),Ei(u,()=>ji("Loading..."),()=>t),Ei(p,()=>ji({className:"g-ui-button-section-right"},p)))}import{Span as ea}from"@granularjs/core";function Hi(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,weight:a,color:n,dimmed:u,align:g,ellipsis:p,className:h,style:m,...b}=i,x=me(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),d=me(n,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),y=me(g,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"});return ea({...b,style:m,className:o("g-ui-text",k("g-ui-text-size-",r,"md"),W("g-ui-text-dimmed",u),W("g-ui-text-ellipsis",p),x,d,y,h)},t)}import{H1 as ia,H2 as Vt,H3 as ta,H4 as ra,H5 as aa,H6 as oa}from"@granularjs/core";var na={1:ia,2:Vt,3:ta,4:ra,5:aa,6:oa};function sa(...e){let{props:i,children:t}=s(e,{order:2}),{order:r,className:a,style:n,...u}=i,g=l(r)||2;return(na[g]||Vt)({...u,className:o("g-ui-title",k("g-ui-title-order-",r,2),a)},t)}import{Div as ua}from"@granularjs/core";function ga(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,fluid:a,className:n,style:u,...g}=i;return ua({...g,className:o("g-ui-container",W("g-ui-container-fluid",a),k("g-ui-container-size-",r,"md"),n)},t)}import{Div as la}from"@granularjs/core";function ca(...e){let{props:i,children:t}=s(e,{gap:"md"}),{gap:r,align:a,justify:n,className:u,style:g,...p}=i,h=me(n,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return la({...p,style:g,className:o("g-ui-stack",k("g-ui-gap-",r,"md"),k("g-ui-align-",a),h,u)},t)}import{Div as pa}from"@granularjs/core";function da(...e){let{props:i,children:t}=s(e,{gap:"md",align:"center"}),{gap:r,align:a,justify:n,position:u,noWrap:g,className:p,style:h,...m}=i,b=me(u,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return pa({...m,style:h,className:o("g-ui-group",k("g-ui-gap-",r,"md"),k("g-ui-align-",a,"center"),k("g-ui-justify-",n,"none"),b,W("g-ui-no-wrap",g),p)},t)}import{Div as pi,list as ma,when as Oi,after as Lt}from"@granularjs/core";function fa(...e){let{props:i,children:t}=s(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:r,content:a,actions:n,border:u,padding:g,radius:p,shadow:h,className:m,style:b,...x}=i;return pi({style:b},Oi(r,()=>pi({className:"g-ui-card-title"},r)),Oi(a,()=>pi({className:"g-ui-card-content"},a)),{className:o("g-ui-card",k("g-ui-card-border-",u,"md"),k("g-ui-card-padding-",g,"md"),k("g-ui-card-radius-",p,"md"),k("g-ui-card-shadow-",h,"md"),m),...x},t,Oi(n,()=>pi({className:"g-ui-card-actions"},ma(n,d=>Ri({className:"g-ui-card-action",onClick:y=>d.get().onClick?.(y),leftSection:d.leftSection,rightSection:d.rightSection,size:Lt(d.size).compute(y=>y||"sm"),variant:Lt(d.variant).compute(y=>y||"outline"),...d.get().props||{}},d.label)))))}import{Span as ha}from"@granularjs/core";function xa(...e){let{props:i,children:t}=s(e,{variant:"filled",size:"md"}),{variant:r,size:a,className:n,dot:u,style:g,...p}=i,h=me(r,{dot:"g-ui-badge-dot"});return ha({...p,className:o("g-ui-badge",k("g-ui-badge-variant-",r,"filled"),k("g-ui-badge-size-",a,"md"),W("g-ui-badge-dot",u),h,n)},t)}import{Div as Ue,Input as va,Textarea as ba,Label as wa,Span as ya,when as Xe,state as ka,after as za,isState as Na}from"@granularjs/core";function ge(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{label:r,description:a,error:n,size:u,leftSection:g,rightSection:p,className:h,inputClassName:m,multiline:b,value:x,...d}=i,{value:y,onChange:D,onInput:A,onFocus:$,onBlur:S,onKeyDown:F,onKeyUp:z,onClick:w}=t,v=Na(y)&&!D&&!A,f=v?y:ka(l(x)??"");za(x).change(K=>{v||f.set(l(K)??"")});let C=K=>{let ue=K?.target?.value??"";ue!==x.get()&&(f.set(ue),D?.(K),A?.(K))},V=ve(b),I=V?ba:va,X=o(m,V&&"g-ui-textarea"),re=I({...d,value:f,onInput:C,onChange:C,onFocus:$,onBlur:S,onKeyDown:F,onKeyUp:z,onClick:w,className:o("g-ui-input",X)});return Ue({className:o("g-ui-text-input",h)},Xe(r,()=>wa({className:"g-ui-text-input-label"},r)),Xe(a,()=>ya({className:"g-ui-text-input-description"},a)),Ue({className:o("g-ui-input-wrapper",W("g-ui-input-multiline",b),k("g-ui-input-size-",u,"md"),W("g-ui-input-error",n))},Xe(g,()=>Ue({className:"g-ui-input-section"},g)),re,Xe(p,()=>Ue({className:"g-ui-input-section"},p))),Xe(n,()=>Ue({className:"g-ui-text-input-error-text"},n)))}function qi(...e){let{props:i}=s(e,{size:"md"}),{size:t,leftSection:r,rightSection:a,className:n,...u}=i;return ge({...u,size:t,className:n,leftSection:r,rightSection:a,multiline:!0})}import{Div as $t,Span as It,after as $e,state as Ca}from"@granularjs/core";function Yi(...e){let{props:i,rawProps:t}=s(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:r,min:a,max:n,step:u,size:g,allowDecimal:p,allowNegative:h,decimalSeparator:m,thousandSeparator:b,decimalScale:x,clampBehavior:d,hideControls:y,format:D,locale:A,currency:$,formatOptions:S,prefix:F,suffix:z,leftSection:w,rightSection:v,className:f,onChange:C,onInput:V,...I}=i,{onChange:X,onInput:re,onBlur:K,onFocus:ue,onKeyDown:te}=t,oe=M=>{X?.(M.target?.value??""),re?.(M.target?.value??"")},de=oe,ie=Ca(""),T=M=>String(M??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=()=>{if(!!!l(p))return 0;let P=l(x);if(P!=null&&P!==""&&Number.isFinite(Number(P)))return Math.max(0,Number(P));let E=l(D);return E==="currency"||E==="percent"?2:0},N=M=>{let P=l(m)??".",E=l(b)??"",O=String(M??"");if(E&&(O=O.split(E).join("")),!O||O==="-"||O===P||O.endsWith(P))return null;let _=O.replace(P,"."),Z=Number(_);return Number.isFinite(Z)?Z:null},G=M=>{let P=l(b)??"";return P?M.replace(/\B(?=(\d{3})+(?!\d))/g,P):M},H=M=>{let P=l(m)??".",E=R(),O=Number(M);if(!Number.isFinite(O))return"";let _=O<0?"-":"",Z=Math.abs(O),[Y,U=""]=String(Z).split("."),ee=G(Y);if(E>0){let fe=U.slice(0,E).padEnd(E,"0");return`${_}${ee}${P}${fe}`}return`${_}${ee}`},ne=(M,P)=>{try{let E=l(A),O=l($)??"USD",_=l(S)??{},Z=R(),Y=P==="currency"?"currency":"decimal";return new Intl.NumberFormat(E,{style:Y,currency:O,...Z>0?{minimumFractionDigits:Z,maximumFractionDigits:Z}:{maximumFractionDigits:0},..._}).format(M)}catch{return H(M)}},se=M=>{let P=M,E=l(a),O=l(n);return E!=null&&Number.isFinite(Number(E))&&(P=Math.max(P,Number(E))),O!=null&&Number.isFinite(Number(O))&&(P=Math.min(P,Number(O))),!l(h)&&P<0&&(P=0),P},xe=()=>{let M=l(z)??"",P=l(D);return!M&&P==="percent"?"%":M},ze=(M,P,E)=>{let O=l(F)??"",_=xe(),Z=String(M??"").replace(/\u00A0/g," "),Y=String(O??"").replace(/\u00A0/g," "),U=String(_??"").replace(/\u00A0/g," "),ee=Y&&Z.startsWith(Y),fe=U&&Z.endsWith(U);return`${P??""}${ee?"":O}${M}${fe?"":_}`},Se=(M,P)=>{let E=R(),O=l(m)??".",Z=String(M??"").replace(/\D/g,"")||"0",Y=E>0?Z.padStart(E+1,"0"):Z,ee=(E>0?Y.slice(0,-E):Y).replace(/^0+(?=\d)/,"")||"0",fe=E>0?Y.slice(-E):"",Te=E>0?`${ee}${O}${fe}`:ee;return`${P??""}${Te}`},Ve=M=>{let P=l(F)??"",E=xe(),O=String(M??""),_=String(P??"").replace(/\u00A0/g," "),Z=String(E??"").replace(/\u00A0/g," ");return _&&O.replace(/\u00A0/g," ").startsWith(_)&&(O=O.slice(P.length)),Z&&O.replace(/\u00A0/g," ").endsWith(Z)&&(O=O.slice(0,-E.length)),O},li=M=>{let P=!!l(h),E=Ve(M),O=P&&E.includes("-")?"-":"",_=E.replace(/\D/g,""),Z=Se(_,O);if(l(d)==="strict"){let Y=N(Z);if(Y!=null){let U=se(Y);Z=`${U<0?"-":""}${H(Math.abs(U))}`}}return Z},Vi=M=>{if(M==null||M==="")return Se("","");if(typeof M=="number"&&Number.isFinite(M)){let U=l(d)==="strict"?se(M):M;return`${U<0?"-":""}${H(Math.abs(U))}`}let P=Ve(M),E=l(m)??".",_=!!l(h)&&String(P).includes("-")?"-":"",Z=String(P??"").replace(new RegExp(`[^0-9${T(E)}]`,"g"),""),Y=N(`${_}${Z}`);if(Y!=null){let U=l(d)==="strict"?se(Y):Y;return`${U<0?"-":""}${H(Math.abs(U))}`}return li(M)},Ne,Ze=M=>{let P=l(M);if(P===void 0)return;let E=Vi(P);E!==ie.get()&&(Ne=E,ie.set(E))};Ze(r),$e(r).change(M=>{Ze(M)}),$e(ie).change(M=>{if(M===Ne){Ne=void 0;return}Ne=void 0;let P=N(M);if(P==null){oe?.(M??"");return}oe?.(P)});let Li=$e(v).compute(M=>M!=null&&M!==!1),$i=$e(y,Li).compute(([M,P])=>!l(M)&&!P),ci=$e(p).compute(M=>l(M)?"decimal":"numeric"),Ii=$e(D,F,z,p,h,m,b,x,d,a,n,A,$,S).compute(()=>({mode:"both",format:M=>{let P=li(M),E=l(D),_=!!l(h)&&P.startsWith("-")?"-":"",Z=N(P),Y=P.replace(_,"");if(Z!=null){let U=Math.abs(Z);if(typeof E=="function")try{Y=E(U)}catch{Y=H(U)}else if(E==="currency")Y=ne(U,"currency");else if(E==="decimal"){let ee=l(A),fe=l(S);Y=ee||fe?ne(U,"decimal"):H(U)}else Y=H(U)}return{value:P,raw:P,visual:ze(Y,_,E)}}})),c=M=>{let P=N(ie.get()),E=Number(l(u)??1),_=se((P??0)+E*M);ie.set(H(_))},B=M=>{if(!M||typeof M.setSelectionRange!="function")return;let P=()=>{try{let E=String(M.value??"").length;M.setSelectionRange(E,E)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(P):P()},ae=M=>{de?.(M);let P=M?.target;P&&B(P)},q=M=>{if(K?.(M),l(d)!=="blur")return;let P=N(ie.get());if(P==null)return;let E=se(P);ie.set(H(E))},J=M=>{ue?.(M),B(M?.target)},pe=M=>{te?.(M);let P=M?.target;if(!P)return;let E=l(F)??"",O=xe();O&&typeof P.selectionEnd=="number"&&(P.selectionEnd=Math.min(P.selectionEnd,String(P.value??"").length-O.length)),E&&typeof P.selectionStart=="number"&&(P.selectionStart=Math.max(P.selectionStart,E.length))},Q=$t({className:"g-ui-number-field-controls"},It({className:"g-ui-number-field-control",onClick:()=>c(1)},"+"),It({className:"g-ui-number-field-control",onClick:()=>c(-1)},"\u2212")),Ce=$t({className:"g-ui-number-field-controls-wrapper"},Q),De=$e($i,v).compute(([M,P])=>M?Ce:P);return ge({...I,size:g,className:o("g-ui-number-field",f),leftSection:w,rightSection:De,type:"text",inputMode:ci,inputClassName:o("g-ui-input-number"),value:ie,format:Ii,onInput:ae,onBlur:q,onFocus:J,onKeyDown:pe})}function Sa(...e){return Yi(...e)}import{Div as hi,Button as Da,portal as Pa,when as Wi,after as Ma}from"@granularjs/core";var di='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',mi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',fi='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Bt='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',Ee='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',At='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Ft='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',jt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',Et='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',Rt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>';function _e(...e){let{props:i,rawProps:t,children:r}=s(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:n,size:u,centered:g,overlay:p,position:h,className:m,style:b}=i,{onClose:x}=t,d=Ma(h,g).compute(([y,D])=>`g-ui-modal-position-${y??(D===!1?"top-center":"center")}`);return Wi(a,()=>Pa(hi({className:o("g-ui-modal-overlay",k("g-ui-modal-overlay-",p,"normal"),d),onClick:y=>{y.target===y.currentTarget&&x?.()}},hi({className:o("g-ui-modal",k("g-ui-modal-size-",u,"md"),m)},hi({className:"g-ui-modal-header"},Wi(n,()=>hi({className:"g-ui-modal-title"},n)),Wi(x,()=>Da({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:x,innerHTML:Ee}))),r))))}import{Div as xi,Span as Gi,after as Ht,when as Ot}from"@granularjs/core";function Ke(...e){let{props:i}=s(e,{variant:"spinner",size:"md"}),{variant:t,size:r,className:a}=i,n=Ht(t).compute(g=>g==="dots"),u=Ht(t).compute(g=>g==="bars");return Ot(n,()=>xi({className:o("g-ui-loading g-ui-dots",k("g-ui-loading-size-",r,"md"),a)}),()=>Ot(u,()=>xi({className:o("g-ui-loading g-ui-bars",k("g-ui-loading-size-",r,"md"),a)},Gi(""),Gi(""),Gi("")),()=>xi({className:o("g-ui-loading",k("g-ui-loading-size-",r,"md"),a)},xi({className:"g-ui-spinner"}))))}import{Div as Zi,Input as Ta,Label as Va,Span as qt,when as Ui,state as La,after as $a}from"@granularjs/core";function Xi(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{checked:r,label:a,description:n,size:u,indeterminate:g,className:p,style:h,inputProps:m,...b}=i,{onChange:x}=t,d=La(ve(r));$a(r).change(D=>{D!=null&&(d.set(!!D),x?.(D))});let y=Va({className:"g-ui-checkbox-control"},Ta({type:"checkbox",indeterminate:g,checked:d,className:o("g-ui-checkbox-input",k("g-ui-checkbox-size-",u,"md"),m?.className),...b}),Ui(d,()=>Zi({className:"g-ui-checkbox-checked",innerHTML:fi}),()=>{if(!d.get()&&g.get())return Zi({className:"g-ui-checkbox-indeterminate",innerHTML:Bt})}),Ui(a,()=>qt({className:"g-ui-checkbox-label"},a)));return Zi({className:o("g-ui-checkbox",k("g-ui-checkbox-size-",u,"md"),p)},y,Ui(n,()=>qt({className:"g-ui-checkbox-description"},n)))}import{Input as Ia,Label as Ba,Span as Aa,when as Fa}from"@granularjs/core";function ja(...e){let{props:i}=s(e,{size:"md"}),{label:t,size:r,className:a,style:n,inputProps:u,...g}=i;return Ba({className:o("g-ui-switch",k("g-ui-switch-size-",r,"md"),a)},Ia({type:"checkbox",className:o("g-ui-switch-input",k("g-ui-switch-size-",r,"md"),u?.className),...g}),Fa(t,()=>Aa({className:"g-ui-switch-label"},t)))}import{Div as Ie,Span as Yt,when as _i,state as Wt,after as vi}from"@granularjs/core";function Ea(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"md"}),{data:r,value:a,size:n,leftSection:u,rightSection:g,placeholder:p,className:h,...m}=i,{onChange:b}=t,x=Wt(!1),d=Wt(l(a)??"");vi(a).change($=>{let S=l($);S!==void 0&&d.set(S??"")});let y=$=>{d.set($),b?.($),x.set(!1)},D=vi(d).compute($=>$?"":"g-ui-select-placeholder"),A=vi(d).compute($=>{let F=(l(r)??[]).find(z=>z.value===$);return $?F?.label??"":p??""});return Ie({...m,className:o("g-ui-select-root",h)},Ie({className:o("g-ui-input-wrapper",k("g-ui-input-size-",n,"md"))},_i(u,()=>Ie({className:"g-ui-input-section"},u)),Ie({className:o("g-ui-select",D),onClick:()=>x.set(!x.get())},Yt({className:"g-ui-select-value"},A)),_i(g,()=>Ie({className:"g-ui-input-section"},g),()=>Yt({className:"g-ui-select-caret"},"\u25BE"))),_i(x,()=>Ie({className:"g-ui-select-dropdown"},(l(r)??[]).map($=>Ie({className:o("g-ui-select-item",vi(d).compute(S=>S===$.value?"g-ui-select-item-active":"")),onClick:()=>y($.value)},$.label)))))}import{Button as Ra,Div as Re,state as Pe,after as Qe,list as Ha,when as Oa}from"@granularjs/core";function qa(...e){let{props:i,rawProps:t}=s(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0}),{value:r,tabs:a,orientation:n,variant:u,sticky:g,className:p,style:h}=i,{onChange:m}=t,b=Pe(l(r)??l(a)?.[0]?.value??""),x=Pe(),d=Pe(),y=Pe(0),D=Pe(0),A=Pe(0),$=Pe(0),S=Pe(!1),F=Pe(0),z=!1,w=null,v=!1,f=new Set;Qe(r).change(N=>{let G=l(N);G!=null&&b.set(G)});let C=N=>{b.set(N),m?.(N)},V=N=>{let G=[],H=N?.parentElement;for(;H;){let ne=getComputedStyle(H),se=`${ne.overflow}${ne.overflowY}${ne.overflowX}`;/(auto|scroll)/.test(se)&&G.push(H),H=H.parentElement}return G},I=N=>V(N)[0]??null,X=N=>N?N.getBoundingClientRect().top:0,re=N=>N?N.scrollTop:window.scrollY||window.pageYOffset||0,K=(N,G)=>N>G?"down":N<G?"up":"none",ue=(N,G,H,ne)=>N==="down"&&G<H?!0:N==="up"&&G>=H?!1:ne,te=()=>{let N=x.get(),G=d.get();if(!N||!G)return;if(!ve(g)){S.set(!1),y.set(0);return}if(typeof window>"u")return;let H=N.getBoundingClientRect(),ne=G.getBoundingClientRect(),se=I(N),xe=X(se),ze=re(se),Se=K(ze,F.get());F.set(ze);let Ve=ue(Se,H.top,xe,S.get());y.set(ne.height),D.set(H.left),A.set(H.width),$.set(xe),Ve!==S.get()&&S.set(Ve)},oe=()=>{w==null&&(w=requestAnimationFrame(()=>{w=null,te()}))},de=N=>{!N||f.has(N)||(f.add(N),N.addEventListener("scroll",oe,{passive:!0}))},ie=()=>{if(z)return;let N=x.get(),G=d.get();!N||!G||typeof window>"u"||(z=!0,te(),de(window),window.addEventListener("resize",oe),V(N).forEach(de))};Qe(d,x,g).change(ie),!v&&typeof window<"u"&&(v=!0,setTimeout(()=>ie(),0));let T=Qe(S,D,A,$).compute(N=>{let[G,H,ne,se]=N;return G?{position:"fixed",top:`${se}px`,left:`${H}px`,width:`${ne}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),R=Qe(S,y).compute(N=>{let[G,H]=N;return{height:G?`${H}px`:"0px"}});return Re(Re({className:o("g-ui-tabs",me(n,{vertical:"g-ui-tabs-vertical"}),k("g-ui-tabs-variant-",u,"default"),i.className??p)},Re({node:x}),Re({style:R}),Re({node:d,className:"g-ui-tabs-list",style:T},Ha(a,N=>Ra({className:Qe(b,N.value).compute(([G,H])=>o("g-ui-tabs-tab",H===G&&"g-ui-tabs-tab-active")),onClick:()=>C(N.get().value)},N.label))),Re({className:"g-ui-tabs-panel"},Oa(b,()=>a.get()?.find(N=>N.value===b.get())?.content??null))))}import{Table as Ya,Thead as Wa,Tbody as Ga,Tr as Gt,Th as Za,Td as Zt}from"@granularjs/core";function Ua(...e){let{props:i}=s(e,{headers:[],rows:[]}),{headers:t,rows:r,striped:a,highlightOnHover:n,withBorder:u,withColumnBorders:g,className:p,style:h,...m}=i;return Ya({...m,className:o("g-ui-table",W("g-ui-table-striped",a),W("g-ui-table-hover",n),W("g-ui-table-with-border",u),W("g-ui-table-column-borders",g),p)},t.length?Wa(Gt(t.map(b=>Za(b)))):null,Ga(r.map(b=>Gt(Array.isArray(b)?b.map(x=>Zt(x)):Object.values(b).map(x=>Zt(x))))))}import{Div as Ki}from"@granularjs/core";import{state as Xa,when as _a,after as Ka}from"@granularjs/core";function Qa(...e){let{props:i,children:t}=s(e,{opened:!1}),{opened:r,className:a,...n}=i,u=Xa(ve(r));Ka(r).change(m=>{u.set(ve(m))});let g=()=>{u.set(!u.get())},p=t[0],h=t[1];return Ki({...n,className:o("g-ui-accordion",a)},Ki({className:"g-ui-accordion-header",onClick:g},p),_a(u,()=>Ki({className:"g-ui-accordion-content"},h)))}import{Span as Ut}from"@granularjs/core";function Ja(...e){let{props:i,children:t}=s(e),{label:r,className:a,style:n}=i;return Ut({className:o("g-ui-tooltip",a)},t,Ut({className:"g-ui-tooltip-content"},r))}import{Div as Je,when as eo,after as io,state as ei,portal as to}from"@granularjs/core";var Qi=ei({currentOpenState:null});function ro(...e){let i=ei(),t=ei(),r=ei({}),{props:a,rawProps:n,children:u}=s(e,{position:"right"}),{opened:g,content:p,position:h,className:m,...b}=a,{onChange:x}=n,d=ei(l(g)??!1);io(g).change(z=>{let w=l(z);w!=null&&(d.set(!!w),w&&y())});let y=()=>{Qi.get().currentOpenState!==d&&(Qi.get().currentOpenState?.set(!1),Qi.set().currentOpenState=d)};g.get()&&y();let D=z=>{let v=String(z??"right").toLowerCase().split("-").filter(Boolean);if(v.length===1){let V=v[0];return V==="top"||V==="bottom"?{placement:V,align:"center"}:V==="left"||V==="right"?{placement:"bottom",align:V}:V==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[f,C]=v;return f==="top"||f==="bottom"?{placement:f,align:C||"center"}:f==="left"||f==="right"?{placement:f,align:C||"center"}:{placement:"bottom",align:"right"}},A=()=>{let z=i.get(),w=t.get();if(!z||!w||typeof window>"u")return;let v=z.getBoundingClientRect(),f=w.getBoundingClientRect(),C=l(h)??"right",V=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),I=Number.parseFloat(V)||20,X=window.innerWidth||0,re=window.innerHeight||0,K=Math.max(I,X-f.width-I),ue=Math.max(I,re-f.height-I),{placement:te,align:oe}=D(C),de=8,ie=v.bottom+de,T=v.left;te==="top"||te==="bottom"?(ie=te==="top"?v.top-f.height-de:v.bottom+de,oe==="center"?T=v.left+v.width/2-f.width/2:oe==="right"?T=v.right-f.width:T=v.left):(te==="left"||te==="right")&&(T=te==="left"?v.left-f.width-de:v.right+de,oe==="center"?ie=v.top+v.height/2-f.height/2:oe==="bottom"?ie=v.bottom-f.height:ie=v.top),T=Math.max(I,Math.min(T,K)),ie=Math.max(I,Math.min(ie,ue)),r.set({top:`${ie}px`,left:`${T}px`})},$=z=>{d.set(z),x?.(z),z&&(y(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>A()):setTimeout(()=>A(),0))},S=()=>$(!d.get()),F=()=>$(!1);return Je({...b,node:i,className:o("g-ui-menu",m)},Je({onClick:S},u),eo(d,()=>to(Je(Je({className:"g-ui-menu-overlay",onClick:F}),Je({className:"g-ui-menu-dropdown",node:t,style:r},p)))))}import{Div as Xt,portal as ao,when as oo}from"@granularjs/core";function no(...e){let{props:i,children:t}=s(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:r,onClose:a,position:n,size:u,overlay:g,shadowed:p,className:h,style:m}=i;return oo(r,()=>ao(Xt({className:o("g-ui-drawer-overlay",k("g-ui-drawer-overlay-",g,"normal")),onClick:a},Xt({className:o("g-ui-drawer",me(p,{true:"g-ui-drawer-shadowed"},!0),k("g-ui-drawer-",n,"right"),k("g-ui-drawer-size-",u,"md"),h),onClick:b=>b.stopPropagation()},t))))}import{Button as so,Div as Ji,Span as _t,when as bi,after as Kt}from"@granularjs/core";function et(...e){let{props:i,rawProps:t,children:r}=s(e,{color:"blue",withCloseButton:!0}),{title:a,color:n,icon:u,loading:g,withCloseButton:p,withBorder:h,className:m,style:b}=i,{onClose:x}=t,d=Kt(u,g).compute(([D,A])=>!D&&!!A),y=Kt(u,g).compute(([D,A])=>!!D||!!A);return Ji({className:o("g-ui-notification",[h,"g-ui-notification-bordered"],[n,D=>`g-ui-notification-${D}`],[y,"g-ui-notification-with-icon"],m)},bi(u,()=>_t({className:"g-ui-notification-icon"},u)),bi(d,()=>Ke({size:"sm",className:"g-ui-notification-loader"})),Ji({className:"g-ui-notification-body"},bi(a,()=>Ji({className:"g-ui-notification-title"},a)),r),bi(p,()=>so({type:"button",className:"g-ui-notification-close",onClick:()=>x?.()},_t({innerHTML:Ee}))))}import{Div as uo,when as go}from"@granularjs/core";function lo(...e){let{props:i}=s(e,{labelPosition:"center"}),{label:t,labelPosition:r,vertical:a,className:n,...u}=i;return uo({...u,className:o("g-ui-divider",W("label",t),k("g-ui-divider-label-",r,"center"),W("g-ui-divider-vertical",a),n)},go(t,()=>Hi({className:"g-ui-divider-label-text",size:"sm"},t)))}import{Div as co}from"@granularjs/core";function po(...e){let{props:i,children:t}=s(e,{padding:"md",radius:"md",shadow:"none"}),{padding:r,radius:a,shadow:n,className:u,...g}=i;return co({...g,className:o("g-ui-paper",[r,p=>`g-ui-card-padding-${p}`],[a,p=>`g-ui-card-radius-${p}`],[n,p=>`g-ui-card-shadow-${p}`],u)},t)}import{Button as mo,Div as it,Span as fo,after as Qt,when as tt}from"@granularjs/core";function ho(...e){let{props:i,rawProps:t,children:r}=s(e,{color:"blue"}),{title:a,color:n,icon:u,withCloseButton:g,className:p,...h}=i,{onClose:m}=t,b=Qt(a,g).compute(([d,y])=>d||y),x=Qt(u).compute(d=>d!==void 0);return it({...h,className:o("g-ui-alert",[n,d=>`g-ui-alert-${d}`],p)},it({className:"g-ui-alert-header"},tt(u,()=>fo({className:"g-ui-alert-icon"},u)),tt(a,()=>it({className:"g-ui-alert-title"},a)),tt(g,()=>mo({type:"button",className:"g-ui-alert-close",onClick:()=>m?.()},"\xD7"))),r)}import{Div as xo,Img as vo,when as bo}from"@granularjs/core";function wo(...e){let{props:i,children:t}=s(e,{size:"md",alt:""}),{src:r,size:a,alt:n,className:u,...g}=i;return xo({...g,className:o("g-ui-avatar",[a,p=>`g-ui-avatar-size-${p}`],u)},bo(r,()=>vo({className:"g-ui-avatar-img",src:r,alt:n}),()=>t))}import{Span as yo}from"@granularjs/core";function ko(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return yo({...a,className:o("g-ui-kbd",r)},t)}import{Code as zo}from"@granularjs/core";function No(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return zo({...a,className:o("g-ui-code",r)},t)}import{Blockquote as Co}from"@granularjs/core";function So(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Co({...a,className:o("g-ui-blockquote",r)},t)}import{Div as Do}from"@granularjs/core";function Po(...e){let{props:i,children:t}=s(e,{cols:3,gap:"md"}),{cols:r,gap:a,className:n,...u}=i;return Do({...u,className:o("g-ui-grid",[a,g=>`g-ui-gap-${g}`],[r,g=>`g-ui-grid-cols-${g}`],n)},t)}import{Ul as Mo,Ol as To,Li as rt,Div as wi,Span as at,after as ot,when as He,isSignal as Vo,isState as Lo,isStatePath as $o,isComputed as Io}from"@granularjs/core";function Jt(...e){let{props:i,children:t}=s(e,{type:"none",size:"md"}),{type:r,size:a,withPadding:n,className:u,...g}=i,p=me(r,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),h=ot(r).compute(D=>D==="ordered"),m=D=>D&&typeof D=="object"&&typeof D.tagName=="string"&&(D.tagName.toLowerCase()==="ul"||D.tagName.toLowerCase()==="ol"),b=D=>D&&typeof D=="object"&&typeof D.tagName=="string"&&D.tagName.toLowerCase()==="li",x=D=>{let A=$=>$==null||$===!1?null:Array.isArray($)?$.map(S=>A(S)):b($)?$:m($)?rt({className:"g-ui-list-nested-item"},$):rt(at({className:"g-ui-list-item-shell"},$));return Vo(D)||Lo(D)||$o(D)||Io(D)?ot(D).compute($=>A($)):A(D)},d=t.map(D=>x(D)),y={...g,className:o("g-ui-list",k("g-ui-list-size-",a,"md"),W("g-ui-list-with-padding",n),p,u)};return He(h,()=>To(y,d),()=>Mo(y,d))}function Bo(...e){let{props:i,children:t}=s(e,{withBorder:!1}),{leftSection:r,rightSection:a,title:n,body:u,withBorder:g,className:p,...h}=i,m=ot(n,u).compute(([b,x])=>!!b||!!x);return rt({...h,className:o("g-ui-list-item",W("g-ui-list-item-border",g),p)},wi({className:"g-ui-list-item-shell"},He(r,()=>at({className:"g-ui-list-item-section g-ui-list-item-section-left"},r)),He(m,()=>wi({className:"g-ui-list-item-content"},He(n,()=>wi({className:"g-ui-list-item-title"},n)),He(u,()=>wi({className:"g-ui-list-item-body"},u))),()=>t),He(a,()=>at({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}Jt.Item=Bo;import{A as Ao}from"@granularjs/core";function Fo(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Ao({...a,className:o("g-ui-anchor",r)},t)}import{Img as jo}from"@granularjs/core";function Eo(...e){let{props:i}=s(e),{className:t,...r}=i;return jo({...r,className:o("g-ui-image",t)})}import{Span as Ro}from"@granularjs/core";function ye(...e){let{props:i,children:t}=s(e,{size:"md"});return Ro({...i,className:o("g-ui-icon",k("g-ui-icon-size-",i.size,"md"),k("g-ui-icon-color-",i.color),i.className)},...t)}import{Div as er}from"@granularjs/core";function Ho(...e){let{props:i}=s(e,{value:0,color:"primary",size:"md"}),{value:t,color:r,size:a,className:n,...u}=i;return er({...u,className:o("g-ui-progress",k("g-ui-progress-size-",a,"md"),[t,g=>{let p=Math.max(0,Math.min(100,Number(g)||0));return`g-ui-progress-${Math.round(p/5)*5}`}],[r,g=>g?`g-ui-progress-${g}`:""],n)},er({className:"g-ui-progress-bar"}))}import{Div as Be,after as yi,state as Oo,when as qo}from"@granularjs/core";function Yo(...e){let{props:i,rawProps:t}=s(e,{size:"md",min:0,max:100,step:1}),{onChange:r}=t,{value:a,marks:n,size:u,min:g,max:p,step:h,disabled:m,className:b,...x}=i,d=Oo(l(a??g));yi(a).change(z=>{z!=null&&d.set(l(z))});let y=()=>{let z=Number(l(g)),w=Number(l(p));return!Number.isFinite(z)||!Number.isFinite(w)?{minValue:0,maxValue:100}:{minValue:Math.min(z,w),maxValue:Math.max(z,w)}},D=()=>{let z=Number(l(h));return Number.isFinite(z)&&z>0?z:1},A=z=>{let{minValue:w,maxValue:v}=y(),f=D(),C=Math.max(w,Math.min(v,Number(z))),V=Math.round((C-w)/f)*f+w;V!==d.get()&&(d.set(V),r?.(V))},$=yi(d).compute(z=>{let{minValue:w,maxValue:v}=y(),f=v-w;if(f<=0)return 0;let C=(Number(z??w)-w)/f*100;return Math.max(0,Math.min(100,C))}),S=(z,w)=>{let v=w?.();if(!v||v.width===0)return;let C=Math.min(Math.max(z.clientX-v.left,0),v.width)/v.width,{minValue:V,maxValue:I}=y();A(V+C*(I-V))},F=z=>{if(ve(m))return;z.preventDefault?.();let w=z.currentTarget,v=()=>w.getBoundingClientRect();w.setPointerCapture?.(z.pointerId),S(z,v);let f=V=>S(V,v),C=()=>{w.releasePointerCapture?.(z.pointerId),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",C)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",C)};return Be({...x,className:o("g-ui-slider",k("g-ui-slider-size-",u,"md"),W("g-ui-slider-disabled",m),b)},Be({className:"g-ui-slider-track",onPointerDown:F},Be({className:"g-ui-slider-bar",style:yi($).compute(z=>({width:`${z}%`}))}),Be({className:"g-ui-slider-thumb",style:yi($).compute(z=>({left:`${z}%`}))})),qo(n,()=>Be({className:"g-ui-slider-marks"},n.map(z=>nt({mark:z,getBounds:y})))))}var nt=({mark:e,getBounds:i})=>{let{minValue:t,maxValue:r}=i(),a=r-t,n=e.value??e,u=e.label??String(e.value)??n,g=Number(n),p=0;return a>0&&(p=(g-t)/a*100),Be({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,p))}%`}},Be({className:"g-ui-slider-mark-label"},u))};import{Div as Wo,after as Go}from"@granularjs/core";function Zo(...e){let{props:i}=s(e,{height:"md",width:"full"}),{height:t,width:r,className:a,...n}=i,u=Go(t,r).compute(([g,p])=>{let h={};return isNaN(g)||(h.height=`${g}px`),isNaN(p)||(h.width=`${p}px`),h});return Wo({...n,style:{width:u.width,height:u.height,...n.style||{}},className:o("g-ui-skeleton",[t,g=>`g-ui-skeleton-h-${g}`],[r,g=>`g-ui-skeleton-w-${g}`],a)})}import{Button as Uo,after as ir,state as Xo}from"@granularjs/core";function _o(...e){let{props:i,rawProps:t,children:r}=s(e,{size:"md",variant:"filled"}),{checked:a,size:n,variant:u,className:g,...p}=i,{onChange:h}=t,m=Xo(!!a);ir(a).change(x=>{x!=null&&m.set(!!x)});let b=x=>{m.set(x),h?.(x)};return Uo({...p,type:"button",className:o("g-ui-chip",k("g-ui-chip-size-",n,"md"),k("g-ui-chip-variant-",u,"filled"),ir(m).compute(x=>x?"g-ui-chip-active":""),g),onClick:()=>b(!m.get())},r)}import{Div as st,after as tr,state as Ko}from"@granularjs/core";function Qo(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"sm"}),{value:r,data:a,size:n,scroll:u,className:g,...p}=i,{onChange:h}=t,m=Ko(l(r));tr(r).change(x=>{let d=l(x);d!=null&&m.set(d)});let b=x=>{m.set(x),h?.(x)};return st({...p,className:o(u&&"g-ui-segmented-scroll")},st({className:o("g-ui-segmented",k("g-ui-segmented-size-",n,"sm"),i.className??g)},a.map(x=>st({className:o("g-ui-segmented-item",tr(m).compute(d=>x.value===d?"g-ui-segmented-active":"")),onClick:()=>b(x.value)},x.label))))}import{Button as ut,Div as Jo,state as en,after as ki}from"@granularjs/core";function tn(...e){let{props:i,rawProps:t}=s(e,{total:1,size:"md"}),{page:r,total:a,size:n,className:u,...g}=i,{onChange:p}=t,h=en(l(r??1));ki(r).change(d=>{let y=l(d);y!=null&&h.set(y)});let m=d=>{let y=Number(l(a))||1,D=Math.max(1,Math.min(y,d));h.set(D),p?.(D)},b=[],x=Number(l(a))||1;for(let d=1;d<=x;d+=1)b.push(d);return Jo({...g,className:o("g-ui-pagination",k("g-ui-pagination-size-",n,"md"),i.className??u)},ut({className:"g-ui-pagination-item",onClick:()=>m((h.get?.()??h)-1),disabled:ki(h).compute(d=>d<=1)},"<"),b.map(d=>ut({className:ki(h).compute(y=>o("g-ui-pagination-item",d===y&&"g-ui-pagination-item-active")),onClick:()=>m(d)},String(d))),ut({className:"g-ui-pagination-item",onClick:()=>m((h.get?.()??h)+1),disabled:ki(h).compute(d=>d>=a)},">"))}import{Div as rn,Input as an,Label as on,Span as rr,when as ar}from"@granularjs/core";function nn(...e){let{props:i}=s(e,{size:"md"}),{label:t,description:r,size:a,className:n,inputProps:u,...g}=i,p=on({className:"g-ui-radio-control"},an({type:"radio",className:o("g-ui-radio-input",k("g-ui-radio-size-",a,"md"),u?.className),...g}),ar(t,()=>rr({className:"g-ui-radio-label"},t)));return rn({className:o("g-ui-radio",k("g-ui-radio-size-",a,"md"),n)},p,ar(r,()=>rr({className:"g-ui-radio-description"},r)))}import{Div as sn}from"@granularjs/core";function un(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return sn({...a,className:o("g-ui-stack g-ui-gap-sm",r)},t)}import{Nav as gn,Span as ln}from"@granularjs/core";function cn(...e){let{props:i,children:t}=s(e,{separator:"/"}),{separator:r,className:a,...n}=i,u=[];Array.isArray(t)?u.push(...t):u.push(t);let g=u.filter(Boolean),p=[];return g.forEach((h,m)=>{p.push(h),m<g.length-1&&p.push(ln({className:"g-ui-breadcrumbs-separator"},r))}),gn({...n,className:o("g-ui-breadcrumbs",a)},p)}import{Div as pn}from"@granularjs/core";function dn(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return pn({...a,className:o("g-ui-center",r)},t)}import{Div as mn}from"@granularjs/core";function fn(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return mn({...a,className:o("g-ui-space",[t,n=>`g-ui-space-${n}`],r)})}import{Div as hn,when as xn}from"@granularjs/core";function vn(...e){let{props:i,children:t}=s(e),{opened:r,className:a,...n}=i;return xn(r,()=>hn({...n,className:o("g-ui-collapse",a)},t))}import{Button as bn}from"@granularjs/core";function Ae(...e){let{props:i,children:t}=s(e,{size:"md",variant:"filled"}),{size:r,variant:a,className:n,...u}=i;return bn({...u,type:"button",className:o("g-ui-action-icon",k("g-ui-action-icon-size-",r,"md"),k("g-ui-action-icon-",a,"filled"),n)},t)}import{Div as gt,when as wn,after as yn,state as kn}from"@granularjs/core";function lt(...e){let{props:i,rawProps:t,children:r}=s(e,{position:"left"}),{opened:a,position:n,content:u,className:g,...p}=i,{onChange:h}=t,m=kn(l(a)??!1);yn(a).change(x=>{let d=l(x);d!=null&&m.set(!!d)});let b=x=>{m.set(x),h?.(x)};return gt({...p,className:o("g-ui-popover",i.className??g)},gt({onClick:()=>b(!m.get())},r),wn(m,()=>gt({className:o("g-ui-popover-dropdown",n==="right"&&"g-ui-popover-right",n==="center"&&"g-ui-popover-center")},u)))}import{Div as or}from"@granularjs/core";function zn(...e){let{props:i,children:t}=s(e,{position:"left"}),{position:r,content:a,className:n,...u}=i;return or({...u,className:o("g-ui-hover-card",n)},t,or({className:o("g-ui-hover-card-dropdown",[r,g=>g==="right"?"g-ui-hover-card-right":""],[r,g=>g==="center"?"g-ui-hover-card-center":""])},a))}import{Div as Nn}from"@granularjs/core";function Cn(...e){let{props:i,children:t}=s(e,{position:"bottom-right"}),{position:r,className:a,...n}=i;return Nn({...n,className:o("g-ui-affix",[r,u=>`g-ui-affix-${u}`],a)},t)}import{Fieldset as Sn,Legend as Dn,when as Pn}from"@granularjs/core";function Mn(...e){let{props:i,children:t}=s(e),{legend:r,className:a,...n}=i;return Sn({...n,className:o("g-ui-fieldset",a)},Pn(r,()=>Dn({className:"g-ui-legend"},r)),t)}import{Div as Tn}from"@granularjs/core";function Vn(...e){let{props:i,children:t}=s(e,{position:"sticky"}),{position:r,className:a,...n}=i;return Tn({...n,className:o("g-ui-appbar",k("g-ui-appbar-",r,"sticky"),a)},t)}import{Div as ct,portal as Ln,after as zi,state as nr,when as sr}from"@granularjs/core";function $n(...e){let{props:i,children:t}=s(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return sr(i.fixed,()=>Bn(i,t),()=>In(i,t))}var In=(e,i)=>{let{open:t,onClose:r,position:a,size:n,blur:u,fixed:g,minWidth:p,className:h,...m}=e,b=nr(!1),x=nr(!1),d=220,y=$=>{if($){b.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>x.set(!0)):setTimeout(()=>x.set(!0),0);return}x.set(!1),setTimeout(()=>b.set(!1),d)};y(!!t.get()),zi(t).change($=>y(!!$));let D=zi(x,u).compute($=>{let[S,F]=$;return o("g-ui-sidebar-overlay",S&&"g-ui-sidebar-overlay-open",!F&&"g-ui-sidebar-overlay-noblur")}),A=zi(n,a,x,h).compute($=>{let[S,F,z,w]=$,v=F==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return o("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${S}`,v,z&&"g-ui-sidebar-drawer-open",l(w))});return sr(b,()=>Ln(ct({className:D,onClick:r},ct({className:A,onClick:$=>$.stopPropagation()},i))))},Bn=(e,i)=>{let{open:t,position:r,size:a,minWidth:n,className:u,...g}=e,p=zi(a,r,t,n,u).compute(h=>{let[m,b,x,d,y]=h,D=d||"button",A=null;return D==="button"?A="g-ui-sidebar-min-button":D==="xs"?A="g-ui-sidebar-min-xs":D==="sm"?A="g-ui-sidebar-min-sm":D==="md"&&(A="g-ui-sidebar-min-md"),o("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${m||"md"}`,A,x&&"g-ui-sidebar-fixed-open",y)});return ct({...g,className:p},i)};import{Div as Oe,when as ur}from"@granularjs/core";function An(...e){let{props:i}=s(e,{items:[]}),{items:t,className:r,...a}=i;return Oe({...a,className:o("g-ui-timeline",r)},t.map(n=>Oe({className:"g-ui-timeline-item"},Oe({className:"g-ui-timeline-dot"}),Oe({className:"g-ui-timeline-content"},ur(n.title,()=>Oe({className:"g-ui-timeline-title"},n.title)),ur(n.description,()=>Oe({className:"g-ui-timeline-desc"},n.description)),n.content))))}import{Div as Ni}from"@granularjs/core";function Fn(...e){let{props:i}=s(e,{active:0,items:[]}),{active:t,items:r,className:a,...n}=i;return Ni({...n,className:o("g-ui-stepper",a)},r.map((u,g)=>Ni({className:o("g-ui-stepper-item",[t,p=>g===p?"g-ui-stepper-active":""])},Ni({className:"g-ui-stepper-index"},String(g+1)),Ni({className:"g-ui-stepper-label"},u.label))))}import{Span as gr,after as lr,state as jn}from"@granularjs/core";function En(...e){let{props:i,rawProps:t}=s(e,{value:0,max:5,size:"md"}),{value:r,max:a,size:n,className:u,...g}=i,{onChange:p}=t,h=jn(l(r));lr(r).change(d=>{let y=l(d);y!=null&&h.set(y)});let m=d=>{h.set(d),p?.(d)},b=[],x=Number(l(a))||0;for(let d=1;d<=x;d+=1)b.push(d);return gr({...g,className:o("g-ui-rating",k("g-ui-rating-size-",n,"md"),i.className??u)},b.map(d=>gr({className:o("g-ui-rating-item",lr(h).compute(y=>d<=y?"g-ui-rating-item-active":"")),onClick:()=>m(d)},"\u2605")))}import{Span as Rn}from"@granularjs/core";function Hn(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Rn({...a,className:o("g-ui-tag",r)},t)}import{Button as cr,Div as qe,state as pr,after as Ci}from"@granularjs/core";var On=["S","M","T","W","T","F","S"];function ii(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{value:r,className:a,size:n,...u}=i,{onChange:g}=t,p=S=>{let F=l(S);if(F instanceof Date)return F;if(F==null)return null;let z=new Date(F);return Number.isNaN(z.getTime())?null:z},h=pr(p(r)??new Date),m=pr(new Date(h.get()));Ci(r).change(S=>{let F=p(S);F!=null&&(h.set(F),m.set(new Date(F)))});let b=(S,F,z)=>{let w=new Date(S,F+1,0).getDate();return new Date(S,F,Math.min(z,w))},x=S=>{let F=m.get(),z=b(F.getFullYear(),F.getMonth(),S);h.set(z),m.set(z),g?.(z)},d=S=>{let F=m.get(),z=b(F.getFullYear(),F.getMonth()+S,F.getDate());m.set(z)},y=S=>{let F=m.get(),z=b(F.getFullYear()+S,F.getMonth(),F.getDate());m.set(z)},D=Ci(m).compute(S=>S.toLocaleString("default",{month:"long"})),A=Ci(m).compute(S=>String(S.getFullYear())),$=Ci(m,h).compute(([S,F])=>{let z=S.getFullYear(),w=S.getMonth(),f=new Date(z,w,1).getDay(),C=new Date(z,w+1,0).getDate(),V=[];for(let I=0;I<f;I+=1)V.push({muted:!0,label:""});for(let I=1;I<=C;I+=1)V.push({label:I});return[...On.map(I=>qe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},I)),...V.map(I=>qe({className:o("g-ui-calendar-cell",I.muted&&"g-ui-calendar-cell-muted",I.label&&F.getFullYear()===z&&F.getMonth()===w&&I.label===F.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>I.label&&x(I.label)},I.label))]});return qe({...u,className:o("g-ui-calendar",a,k("g-ui-calendar-size-",n,"md"))},qe({className:"g-ui-calendar-header"},Ae({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>d(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:mi})),qe({className:"g-ui-calendar-title-group"},cr({type:"button",className:"g-ui-calendar-title-button",onClick:()=>d(1)},D),cr({type:"button",className:"g-ui-calendar-title-button",onClick:()=>y(1)},A)),Ae({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>d(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:di}))),qe({className:"g-ui-calendar-grid"},$))}import{Div as ti,Span as Ye,Input as qn,when as pt,after as ke,state as Si}from"@granularjs/core";function Yn(...e){let{props:i,rawProps:t}=s(e,{data:[],size:"md",searchable:!0}),{value:r,data:a,size:n,className:u,placeholder:g,searchable:p,...h}=i,{onChange:m,onSearchChange:b}=t,x=Si(l(r)??[]),d=Si(""),y=Si(!1),D=Si(null),A=f=>(l(f)??[]).map(V=>typeof V=="string"?{value:V,label:V}:V&&typeof V=="object"?V:{value:String(V),label:String(V)});ke(r).change(f=>{let C=l(f);C!=null&&x.set(C)});let $=null;ke(y).change(f=>{if($&&($(),$=null),!f)return;let C=V=>{let I=D.get();I&&(I.contains(V.target)||y.set(!1))};document.addEventListener("mousedown",C),$=()=>document.removeEventListener("mousedown",C)}),ke(d).change(f=>{b?.(f)});let S=f=>{let C=x.get()??[],V=C.includes(f)?C.filter(I=>I!==f):C.concat(f);x.set(V),m?.(V)},F=ke(a).compute(f=>A(f)),z=ke(F,d).compute(([f,C])=>{let V=String(l(C)??"").toLowerCase().trim();return V?f.filter(I=>String(I.label??"").toLowerCase().includes(V)):f}),w=ke(x,d).compute(([f,C])=>{let V=l(f)??[],I=String(l(C)??"");return!V.length&&!I}),v=ke(p).compute(f=>!!f);return ti({...h,node:D,className:o("g-ui-select-multi-root",u)},ti({className:o("g-ui-select-multi",k("g-ui-select-multi-size-",n,"md")),onClick:()=>y.set(!0)},ke(F,x).compute(([f,C])=>(l(C)??[]).map(I=>{let re=(f??[]).find(K=>K.value===I)?.label??I;return Ye({className:"g-ui-select-tag"},Ye({className:"g-ui-select-tag-label",onClick:K=>{K?.stopPropagation?.()}},re),Ye({className:"g-ui-select-tag-remove",innerHTML:Ee,onClick:K=>{K?.stopPropagation?.(),S(I)}}))})),pt(w,()=>Ye({className:"g-ui-select-multi-placeholder"},g??"Select...")),pt(v,()=>qn({className:"g-ui-select-multi-input",value:d,onInput:f=>d.set(f.target?.value??""),onFocus:()=>y.set(!0)}))),pt(y,()=>ti({className:"g-ui-select-dropdown"},ke(z).compute(f=>f.length?f.map(C=>ti({className:o("g-ui-select-item",C.disabled&&"g-ui-select-item-disabled",ke(x).compute(V=>(l(V)??[]).includes(C.value)?"g-ui-select-item-active":"")),onClick:()=>{C.disabled||S(C.value)}},Ye({className:"g-ui-select-item-check",innerHTML:ke(x).compute(V=>(l(V)??[]).includes(C.value)?fi:"")}),Ye({className:"g-ui-select-item-label"},C.label))):ti({className:"g-ui-select-item"},"Nothing found")))))}import{Div as ri,when as dr}from"@granularjs/core";function Wn(...e){let{props:i}=s(e,{items:[]}),{items:t,className:r,onClose:a,timeout:n,...u}=i;return ri({...u,className:o("g-ui-toast-stack",r)},t.map(g=>ri({className:o("g-ui-toast",[n,"g-ui-toast-auto"])},ri({className:"g-ui-toast-row"},dr(g.title,()=>ri({className:"g-ui-toast-title"},g.title)),dr(a,()=>ri({className:"g-ui-toast-close",onClick:()=>a(g)},"\xD7"))),g.message)))}function Gn(...e){let{props:i}=s(e);return ii(i)}import{Div as Zn,after as Un}from"@granularjs/core";function Xn(...e){let{props:i,rawProps:t}=s(e,{items:[],position:"top-right"}),{items:r,position:a,className:n,...u}=i,{onRemove:g}=t,p=new Map,h=(b,x)=>b?.id??b?.key??x,m=Un(r).compute(b=>{let x=l(b)??[],d=new Set;x.forEach((y,D)=>{let A=h(y,D);if(d.add(A),y?.autoClose&&!p.has(A)){let $=setTimeout(()=>{p.delete(A),g?.(y)},y.autoClose);p.set(A,$)}});for(let[y,D]of p.entries())d.has(y)||(clearTimeout(D),p.delete(y));return x.map((y,D)=>et({key:h(y,D),title:y.title,color:y.color,icon:y.icon,loading:y.loading,withCloseButton:y.withCloseButton,withBorder:y.withBorder,onClose:()=>{y.onClose?.(),g?.(y)}},y.message??y.body??y.content??y.text))});return Zn({...u,className:o("g-ui-notifications",k("g-ui-notifications-position-",a,"top-right"),n)},m)}import{Div as We,after as ai,state as _n,when as Kn}from"@granularjs/core";function Qn(...e){let{props:i,rawProps:t}=s(e,{min:0,max:100,step:1,size:"md"}),{value:r,marks:a,min:n,max:u,step:g,size:p,disabled:h,className:m,...b}=i,{onChange:x}=t,d=_n(l(r??[n,u])),y=()=>{let w=Number(l(n)),v=Number(l(u));return!Number.isFinite(w)||!Number.isFinite(v)?{minValue:0,maxValue:100}:{minValue:Math.min(w,v),maxValue:Math.max(w,v)}},D=()=>{let w=Number(l(g));return Number.isFinite(w)&&w>0?w:1},A=w=>{let{minValue:v,maxValue:f}=y(),C=D(),V=[v,f];Array.isArray(w)&&(V=w);let I=Math.max(v,Math.min(f,Number(V[0]))),X=Math.max(v,Math.min(f,Number(V[1]))),re=Math.round(Math.min(I,X)/C)*C,K=Math.round(Math.max(I,X)/C)*C;return[re,K]};ai(r).change(w=>{w!=null&&d.set(A(w))});let $=w=>{let v=A(w);v?.[0]===d.get()?.[0]&&v?.[1]===d.get()?.[1]||(d.set(v),x?.(v))},S=ai(d).compute(w=>{let{minValue:v,maxValue:f}=y(),C=f-v,[V,I]=A(w);if(C<=0)return{lowPct:0,highPct:0};let X=(V-v)/C*100,re=(I-v)/C*100;return{lowPct:Math.max(0,Math.min(100,X)),highPct:Math.max(0,Math.min(100,re))}}),F=(w,v,f)=>{let C=v?.();if(!C||C.width===0)return;let I=Math.min(Math.max(w.clientX-C.left,0),C.width)/C.width,{minValue:X,maxValue:re}=y(),K=X+I*(re-X),ue=d;typeof d.get=="function"&&(ue=d.get());let[te,oe]=A(ue);$(f==="low"?[K,oe]:[te,K])},z=(w,v,f)=>{if(ve(h))return;w.preventDefault?.();let C=f||w.currentTarget,V=()=>C.getBoundingClientRect(),I=V(),X=S;typeof S.get=="function"&&(X=S.get());let{lowPct:re,highPct:K}=X,ue=(w.clientX-I.left)/I.width*100,te=v;if(!te){let ie=Math.abs(ue-re)<=Math.abs(ue-K);te="high",ie&&(te="low")}C.setPointerCapture?.(w.pointerId),F(w,V,te);let oe=ie=>F(ie,V,te),de=()=>{C.releasePointerCapture?.(w.pointerId),window.removeEventListener("pointermove",oe),window.removeEventListener("pointerup",de)};window.addEventListener("pointermove",oe),window.addEventListener("pointerup",de)};return We({...b,className:o("g-ui-range-slider",k("g-ui-slider-size-",p,"md"),W("g-ui-slider-disabled",h),i.className??m)},We({className:"g-ui-slider-track",onPointerDown:w=>z(w)},We({className:"g-ui-slider-bar",style:ai(S).compute(({lowPct:w,highPct:v})=>({left:`${w}%`,width:`${Math.max(0,v-w)}%`}))}),We({className:"g-ui-slider-thumb",style:ai(S).compute(({lowPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),z(w,"low",w.currentTarget.parentElement)}}),We({className:"g-ui-slider-thumb",style:ai(S).compute(({highPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),z(w,"high",w.currentTarget.parentElement)}})),Kn(a,()=>We({className:"g-ui-slider-marks"},a.map(w=>nt({mark:w,getBounds:y})))))}import{state as dt,after as mr}from"@granularjs/core";function Jn(...e){let{props:i,rawProps:t}=s(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:r,size:a,calendarSize:n,leftSection:u,rightSection:g,className:p,format:h,minDate:m,maxDate:b,...x}=i,{onChange:d}=t,y=v=>{let f=l(v);if(f instanceof Date)return f;if(f==null||f==="")return null;let C=new Date(f);return Number.isNaN(C.getTime())?null:C},D=(v,f)=>v&&f&&v.getFullYear()===f.getFullYear()&&v.getMonth()===f.getMonth()&&v.getDate()===f.getDate(),A=v=>{if(!v)return"";let f=String(v.getFullYear()).padStart(4,"0"),C=String(v.getMonth()+1).padStart(2,"0"),V=String(v.getDate()).padStart(2,"0");return`${f}-${C}-${V}`},$=v=>{let f=String(v??"").replace(/\D/g,"");if(f.length<8)return null;let C=Number(f.slice(0,4)),V=Number(f.slice(4,6)),I=Number(f.slice(6,8));if(!C||!V||!I)return null;let X=new Date(C,V-1,I);if(X.getFullYear()!==C||X.getMonth()!==V-1||X.getDate()!==I)return null;let re=y(m);if(re&&X<re)return null;let K=y(b);return K&&X>K?null:X},S=dt(y(r)),F=dt(A(S.get())),z=dt(!1);mr(r).change(v=>{if(r.get()==v)return;let f=y(v);if(f==null){S.set(null),F.set("");return}S.set(f),F.set(A(f))}),mr(F).change(v=>{let f=$(v);console.log("parsed",f),console.log("currentDate",S.get()),f&&(D(f,S.get())||(S.set(f),d?.(f)))});let w=v=>{v&&(D(v,S.get())||(S.set(v),F.set(A(v)),d?.(v),z.set(!1)))};return lt({opened:z,onChange:v=>z.set(!!v),content:ii({size:k("",n,"xs"),value:S,onChange:w}),className:"g-ui-date-input-popover"},ge({...x,size:a,className:o("g-ui-dateinput",p),leftSection:u,rightSection:g,type:"text",inputMode:"numeric",format:h,value:F,onChange:v=>F.set(v)}))}import{Div as mt,when as es,after as is,state as ts}from"@granularjs/core";function rs(...e){let{props:i,rawProps:t,children:r}=s(e),{opened:a,content:n,className:u,...g}=i,{onChange:p}=t,h=ts(l(a)??!1);is(a).change(b=>{let x=l(b);x!=null&&h.set(!!x)});let m=b=>{h.set(b),p?.(b)};return mt({...g,className:o("g-ui-popper",u)},mt({onClick:()=>m(!h.get())},r),es(h,()=>mt({className:"g-ui-popper-dropdown"},n)))}import{Button as as,after as fr,when as os,state as ns}from"@granularjs/core";function ss(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{size:r,className:a,rightSection:n,...u}=i,{onChange:g}=t,p=ns(!1),h=fr(p).compute(b=>b?"text":"password"),m=fr(n).compute(b=>b??as({className:"g-ui-password-toggle",onClick:()=>p.set(!p.get())},os(p,()=>"Hide",()=>"Show")));return ge({...u,size:r,className:a,onChange:g,rightSection:m,type:h})}import{Div as us}from"@granularjs/core";function gs(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return ge({...a,size:t,className:r,leftSection:us({className:"g-ui-search-input-left-section",innerHTML:At}),type:"text",inputMode:"search"})}import{Button as ls,after as cs,when as hr}from"@granularjs/core";import{state as ps}from"@granularjs/core";function ds(...e){let{props:i,children:t}=s(e,{value:"",timeout:1500}),{value:r,timeout:a,className:n,...u}=i,g=ps(!1),p=cs(g).compute(m=>o("g-ui-copy-button",m&&"g-ui-copy-button-done",n));return ls({...u,className:p,onClick:async()=>{try{await navigator.clipboard.writeText(String(r)),g.set(!0),setTimeout(()=>g.set(!1),a)}catch{}},type:"button"},hr(t?.length,()=>t,()=>hr(g,()=>"Copied",()=>"Copy")))}import{Div as ms}from"@granularjs/core";function fs(...e){let{props:i}=s(e,{size:"md"}),{size:t,className:r,...a}=i;return ms({...a,className:o("g-ui-progress-ring",[t,n=>`g-ui-progress-ring-size-${n}`],r)})}import{Div as ft,Button as hs,when as xr}from"@granularjs/core";function xs(...e){let{props:i,children:t}=s(e),{title:r,onClose:a,className:n,...u}=i;return ft({...u,className:o("g-ui-toast",n)},ft({className:"g-ui-toast-row"},xr(r,()=>ft({className:"g-ui-toast-title"},r)),xr(a,()=>hs({className:"g-ui-toast-close",onClick:a},"\xD7"))),t)}import{Div as ht}from"@granularjs/core";import{state as vs}from"@granularjs/core";function bs(...e){let{props:i,rawProps:t}=s(e,{data:[]}),{data:r,className:a,...n}=i,{onChange:u}=t,g=vs(""),p=r.filter(h=>String(h.label||"").toLowerCase().includes(String(g.get()).toLowerCase()));return ht({...n,className:o("g-ui-select-search",a)},ge({inputClassName:"g-ui-select-search-input",placeholder:"Search...",value:g,onInput:h=>g.set(h?.target?.value??"")}),ht({className:"g-ui-select-search-list"},p.map(h=>ht({className:"g-ui-select-search-item",onClick:()=>u?.(h.value)},h.label))))}import{Div as ws}from"@granularjs/core";function ys(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return ws({...a,className:o("g-ui-switch-group",r)},t)}import{Div as ks,state as zs,after as xt}from"@granularjs/core";function Ns(...e){let{props:i,rawProps:t}=s(e,{size:"md"}),{value:r,size:a,className:n,...u}=i,{onChange:g}=t,p=zs(l(r)??["",""]);xt(r).change(m=>{let b=l(m);b!=null&&p.set(b)});let h=m=>{p.set(m),g?.(m)};return ks({...u,className:o("g-ui-range-picker",i.className??n)},ge({size:a,type:"text",inputMode:"numeric",value:xt(p).compute(m=>m?.[0]??""),onInput:m=>{let b=p.get()??["",""];h([m.target.value,b[1]])}}),ge({size:a,type:"text",inputMode:"numeric",value:xt(p).compute(m=>m?.[1]??""),onInput:m=>{let b=p.get()??["",""];h([b[0],m.target.value])}}))}import{Div as Cs}from"@granularjs/core";function Ss(...e){let{props:i,children:t}=s(e,{align:"center",direction:"row"}),{direction:r,wrap:a,align:n,justify:u,gap:g,className:p,...h}=i;return Cs({...h,className:o("g-ui-flex",[r,m=>m==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[n,m=>m&&`g-ui-align-${m}`],[u,m=>m&&`g-ui-justify-${m}`],[g,m=>m&&`g-ui-gap-${m}`],p)},t)}import{A as Ds,Div as oi,Span as vr,when as ni,after as br,state as Ps}from"@granularjs/core";function Ms(...e){let{props:i,rawProps:t,children:r}=s(e,{variant:"subtle",childrenOffset:24}),{label:a,description:n,leftSection:u,rightSection:g,active:p,disabled:h,variant:m,childrenOffset:b,opened:x,defaultOpened:d,className:y,padding:D,...A}=i,{onClick:$,onChange:S}=t,F=r.length>0,z=Ps(l(x)??l(d)??!1);br(x).change(f=>{let C=l(f);C!=null&&z.set(!!C)});let w=br(b).compute(f=>({paddingLeft:Tt(l(f??24))??"24px"})),v=f=>{if(l(h)){f?.preventDefault?.();return}if(F){let C=!z.get();z.set(C),S?.(C)}$?.(f)};return oi({className:o("g-ui-navlink-root",y)},Ds({...A,className:o("g-ui-navlink",k("g-ui-navlink-variant-",m,"subtle"),W("g-ui-navlink-active",p),W("g-ui-navlink-disabled",h),k("g-ui-navlink-padding-",D,"md")),onClick:v},ni(u,()=>vr({className:"g-ui-navlink-section g-ui-navlink-left"},u)),oi({className:"g-ui-navlink-body"},ni(a,()=>oi({className:"g-ui-navlink-label"},a)),ni(n,()=>oi({className:"g-ui-navlink-description"},n))),ni(g,()=>vr({className:"g-ui-navlink-section g-ui-navlink-right"},g))),F?ni(z,()=>oi({className:"g-ui-navlink-children",style:w},r)):null)}import{Div as wr,when as Ts}from"@granularjs/core";function Vs(...e){let{props:i,children:t}=s(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:r,position:a,color:n,size:u,className:g,...p}=i;return wr({...p,className:o("g-ui-indicator",k("g-ui-indicator-position-",a,"top-right"),k("g-ui-indicator-color-",n,"danger"),k("g-ui-indicator-size-",u,"md"),g)},t,Ts(r,()=>wr({className:"g-ui-indicator-badge"})))}import{Span as Di}from"@granularjs/core";function Ls(...e){let{props:i}=s(e),{opened:t,className:r,...a}=i;return Di({...a,className:o("g-ui-burger",[t,"g-ui-burger-open"],r)},Di(""),Di(""),Di(""))}import{Div as $s,when as Is}from"@granularjs/core";function Bs(...e){let{props:i}=s(e),{visible:t,...r}=i;return Is(t,()=>$s({...r,className:"g-ui-loading-overlay"},Ke({})))}import{Div as As}from"@granularjs/core";function Fs(...e){let{props:i,children:t}=s(e,{gap:"md"}),{className:r,gap:a,...n}=i;return As({...n,className:o("g-ui-grid-system",[a,u=>`g-ui-gap-${u}`],r)},t)}import{Div as js}from"@granularjs/core";function Es(...e){let{props:i,children:t}=s(e,{span:12}),{span:r,className:a,...n}=i;return js({...n,className:o([r,u=>`g-ui-col-span-${u}`],a)},t)}import{Div as Rs}from"@granularjs/core";function Hs(...e){let{props:i,children:t}=s(e,{size:"md"}),{size:r,className:a,...n}=i;return Rs({...n,className:o("g-ui-scroll-area",[r,u=>`g-ui-scroll-area-${u}`],a)},t)}import{Div as yr,Input as Os,after as Me,state as vt,when as kr,list as qs}from"@granularjs/core";function Ys(...e){let{props:i,rawProps:t}=s(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:r,value:a,size:n,type:u,mask:g,placeholder:p,disabled:h,error:m,oneTimeCode:b,className:x}=i,{onChange:d,onComplete:y}=t,D=vt(l(r)??4),A=()=>D.get();Me(r).change(T=>{let R=l(T)??4,N=D.get();if(R===N)return;D.set(R);let G=S.get(),H=$.get();S.set(Array.from({length:R},(ne,se)=>G[se]??"")),$.set(Array.from({length:R},(ne,se)=>H[se]??null))});let $=vt(Array.from({length:A()},()=>null)),S=vt(Array.from({length:A()},(T,R)=>{let N=l(a);return typeof N=="string"||Array.isArray(N)?N[R]??"":""}));Me(a).change(T=>{if(T==null)return;let R=A();typeof T=="string"?S.set(Array.from({length:R},(N,G)=>T[G]??"")):Array.isArray(T)&&S.set(Array.from({length:R},(N,G)=>T[G]??""))});let F=()=>S.get().join(""),z=T=>{S.set(T);let R=T.join("");d?.(R),T.every(N=>N!=="")&&T.length===A()&&y?.(R)},w=T=>{let R=A(),N=$.get();T>=0&&T<R&&N[T]&&(N[T].focus(),N[T].select())},v=()=>{let T=l(u);return T==="number"?/^[0-9]$/:T instanceof RegExp?T:/^[a-zA-Z0-9]$/},f=(T,R)=>{let N=R.target.value,G=v();if(N.length>1){C(T,N);return}if(N&&!G.test(N)){R.target.value=S.get()[T]??"";return}let H=S.get().slice();H[T]=N,z(H),N&&T<A()-1&&w(T+1)},C=(T,R)=>{let N=v(),G=R.split("").filter(xe=>N.test(xe)),H=S.get().slice(),ne=A();G.forEach((xe,ze)=>{let Se=T+ze;Se<ne&&(H[Se]=xe)}),z(H);let se=H.findIndex((xe,ze)=>ze>=T&&xe==="");se>=0?w(se):w(Math.min(T+G.length,ne-1))},V=(T,R)=>{if(R.key==="Backspace"){let N=S.get().slice();N[T]===""&&T>0?(R.preventDefault(),N[T-1]="",z(N),w(T-1)):N[T]!==""&&(N[T]="",z(N))}else R.key==="ArrowLeft"&&T>0?(R.preventDefault(),w(T-1)):R.key==="ArrowRight"&&T<A()-1&&(R.preventDefault(),w(T+1))},I=(T,R)=>{R.target.select()},X=()=>{let T=S.get(),R=T.findIndex(N=>N==="");R>=0?w(R):w(T.length-1)},re=Me(g).compute(T=>l(T)?"password":"text"),K=Me(u).compute(T=>l(T)==="number"?"numeric":"text"),ue=Me(b).compute(T=>l(T)?"one-time-code":"off"),te=Me(h).compute(T=>!!l(T)),oe=Me(m).compute(T=>!!l(T)),de=Me(D).compute(T=>Array.from({length:T},(R,N)=>N)),ie=T=>Os({className:o("g-ui-pin-input-field",kr(oe,()=>"g-ui-pin-input-error")),type:re,inputMode:K,autocomplete:ue,maxLength:2,placeholder:kr(te,()=>"",()=>p),disabled:te,value:Me(S,T).compute(([R,N])=>R[N]??""),node:$[T.get()],onInput:R=>f(T.get(),R),onChange:R=>f(T.get(),R),onKeyDown:R=>V(T.get(),R),onFocus:R=>I(T.get(),R)});return yr({className:o("g-ui-pin-input",k("g-ui-input-size-",n,"md"),x),onClick:X},yr({className:"g-ui-pin-input-wrapper"},qs(de,ie)))}import{Div as Ws}from"@granularjs/core";function Gs(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Ws({...a,className:o("g-ui-checkbox-group",r)},t)}import{Div as Zs}from"@granularjs/core";function Us(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Zs({...a,className:o("g-ui-avatar-group",r)},t)}import{Div as Xs}from"@granularjs/core";function _s(...e){let{props:i,children:t}=s(e),{className:r,...a}=i;return Xs({...a,className:o("g-ui-badge-group",r)},t)}import{Div as Pi,Span as Ks,after as si,context as zr}from"@granularjs/core";var Qs=zr([]),Nr=zr({sort:null,onSort:null});function bt(...e){let{props:i,rawProps:t,children:r}=s(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:n,sort:u,stickyHeader:g,...p}=i,{onSort:h}=t,m=Qs.scope(n.get());si(n).change(x=>m.set(x));let b=Nr.scope({sort:u.get(),onSort:h||null});return si(u).change(x=>b.set().sort=x),m.serve(b.serve(Pi({className:o("g-ui-grid-table",W("g-ui-grid-table-sticky",g),a),style:{gridTemplateColumns:si(m).compute(x=>Array.isArray(x)?x.join(" "):"")},...p},r)))}bt.GridRow=(...e)=>{let{props:i,children:t}=s(e,{}),{className:r,header:a,...n}=i;return Pi({className:o("g-ui-grid-table-row",W("g-ui-grid-table-row-header",a),r),...n},...t)};bt.GridCell=function(...e){let{props:i,rawProps:t,children:r}=s(e,{}),{className:a,sort:n,...u}=i,g=t.sort;if(g){let p=Nr.state(),h=si(p.sort).compute(b=>b?.key===g?b.direction:null),m=()=>{let b=p.get().sort,x;b?.key===g?x=b.direction==="asc"?{key:g,direction:"desc"}:null:x={key:g,direction:"asc"},p.set().sort=x;let{onSort:d}=p.get();d&&d(x)};return Pi({className:o("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:m,...u},r,Ks({className:"g-ui-grid-table-sort-icon"},si(h).compute(b=>b==="asc"?" \u2191":b==="desc"?" \u2193":"")))}return Pi({className:o("g-ui-grid-table-cell",a),...u},r)};import{Button as Js,Div as eu,Span as Cr,when as Sr}from"@granularjs/core";function Dr(...e){let{props:i,children:t}=s(e,{grow:!0}),{grow:r,className:a,...n}=i;return eu({...n,className:o("g-ui-bottombar",W("g-ui-bottombar-grow",r),a)},t)}Dr.Action=function(...i){let{props:t,rawProps:r,children:a}=s(i,{variant:"subtle"}),{icon:n,label:u,active:g,disabled:p,variant:h,className:m,...b}=t,{onClick:x}=r;return Js({...b,className:o("g-ui-bottombar-action",k("g-ui-bottombar-action-variant-",h,"subtle"),W("g-ui-bottombar-action-active",g),W("g-ui-bottombar-action-disabled",p),m),onClick:x,disabled:p},Sr(n,()=>Cr({className:"g-ui-bottombar-action-icon"},n)),Sr(u,()=>Cr({className:"g-ui-bottombar-action-label"},u)),a)};import{Div as j,Button as Fe,state as le,after as be,when as ce,Input as Mi,Label as ui,Span as je}from"@granularjs/core";var iu=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tu=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function Ti(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function Tr(e){let i=Ti(e.start),t=Ti(e.end);return!i||!t?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:t,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function Vr(e,i,t){let r=Ti(i).getTime(),a=Ti(t).getTime();return e.map(Tr).filter(Boolean).filter(n=>n.end.getTime()>r&&n.start.getTime()<a)}function Pr(e,i){let t=new Date(i);t.setHours(0,0,0,0);let r=t.getTime();t.setHours(23,59,59,999);let a=t.getTime();return Vr(e,r,a)}function wt(e,i){let t=new Date(e),a=(t.getDay()-i+7)%7;return t.setDate(t.getDate()-a),t.setHours(0,0,0,0),t}function Ge(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function gi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function ru(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function au(e,i="default"){let t=new Date(e);return t.setDate(t.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${t.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function Mr(e,i,t,r){let a=new Date(e).setHours(t,0,0,0),n=new Date(e).setHours(r,0,0,0),u=(r-t)*60,g=Math.max(e.getTime(),a),h=(Math.min(i.getTime(),n)-g)/6e4,m=(g-a)/6e4/u*100,b=h/u*100;return{top:m,height:b}}function ou(...e){let{props:i,rawProps:t}=s(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:r=[],defaultView:a,firstDayOfWeek:n,locale:u,hourSlotDuration:g,minTime:p,maxTime:h,eventCreationColorOptions:m,className:b,...x}=i,{onCreateEventRequest:d,onViewEventRequest:y,onUpdateEventRequest:D,onRemoveEventRequest:A,eventCreationEmailLookup:$,eventCreationLocationsCallback:S,eventCreationCalendarsCallback:F,onSlotClick:z,onDateRangeChange:w}=t,v=le(l(a)??"month"),f=le(new Date),C=le(null),V=le(null),I=le({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),X=be(r).compute(c=>Array.isArray(c)?c:[]),re=f.get(),K=wt(re,l(n)??0),ue=l(p)??6,te=l(h)??22,oe=l(g)??30,de=()=>{let c=new Date(f.get());v.get()==="month"?c.setMonth(c.getMonth()-1):v.get()==="week"?c.setDate(c.getDate()-7):c.setDate(c.getDate()-1),f.set(c),w?.({start:c,end:c,view:v.get()})},ie=()=>{let c=new Date(f.get());v.get()==="month"?c.setMonth(c.getMonth()+1):v.get()==="week"?c.setDate(c.getDate()+7):c.setDate(c.getDate()+1),f.set(c),w?.({start:c,end:c,view:v.get()})},T=()=>{let c=new Date;f.set(c),w?.({start:c,end:c,view:v.get()})},R=(c,B,ae=!1)=>{let q=c?new Date(c):new Date(f.get()),J=B?new Date(B):new Date(q.getTime()+3600*1e3);ae&&(q.setHours(0,0,0,0),J.setHours(23,59,59,999)),I.set({title:"",start:q,end:J,allDay:ae,description:"",location:"",attendees:[],color:null}),C.set("create")},N=c=>{V.set(Tr(c)),C.set("view"),y?.(c)},G=()=>{let c=V.get();c&&(I.set({title:c.title,start:new Date(c.start),end:new Date(c.end),allDay:c.allDay,description:c.description??"",location:c.location??"",attendees:[...c.attendees||[]],color:c.color??null}),C.set("edit"))},H=()=>{C.set(null),V.set(null)},ne=(c,B,ae)=>{if(z){z({date:c,hour:B,allDay:ae});return}let q=new Date(c);if(ae){q.setHours(0,0,0,0);let J=new Date(q);J.setHours(23,59,59,999),R(q,J,!0)}else{q.setHours(B,0,0,0);let J=new Date(q.getTime()+oe*60*1e3);R(q,J,!1)}},se=()=>{let c=I.get();!c.start||!c.end||d?.({title:c.title,start:c.start,end:c.end,allDay:c.allDay,description:c.description,location:c.location,attendees:c.attendees,color:c.color},()=>{H()})},xe=()=>{let c=V.get(),B=I.get();!c||!B.start||!B.end||D?.(c,{title:B.title,start:B.start,end:B.end,allDay:B.allDay,description:B.description,location:B.location,attendees:B.attendees,color:B.color},()=>H())},ze=()=>{let c=V.get();c&&A?.(c,()=>H())},Se=be(v,f).compute(([c,B])=>c==="month"?ru(B,l(u)):c==="week"?au(wt(B,l(n)??0),l(u)):gi(B,l(u))),Ve=j({className:"g-ui-event-calendar-header"},j({className:"g-ui-event-calendar-nav-group"},Ae({size:"sm",variant:"subtle",onClick:de,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:mi})),Ae({size:"sm",variant:"subtle",onClick:ie,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:di})),Fe({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:T},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:Rt}),"Today")),j({className:"g-ui-event-calendar-title"},Se),j({className:"g-ui-event-calendar-actions"},tu.map(c=>j({className:o("g-ui-event-calendar-view-option",be(v).compute(B=>B===c.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{v.set(c.value),w?.({start:f.get(),end:f.get(),view:c.value})}},c.label)),Fe({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>R(f.get(),null,!1)},ye({size:"sm",innerHTML:Ft}),"Create"))),li=be(f,X,n).compute(([c,B,ae])=>{let q=c.getFullYear(),J=c.getMonth(),Q=(new Date(q,J,1).getDay()-(ae??0)+7)%7,Ce=new Date(q,J+1,0).getDate(),De=new Date(q,J,0).getDate(),M=[],P=1,E=1,O=Math.ceil((Q+Ce)/7)*7,_=[];for(let Z=0;Z<O;Z+=1){let Y,U,ee;Z<Q?(Y=De-Q+Z+1,ee=new Date(q,J-1,Y),U=!1):P<=Ce?(Y=P,ee=new Date(q,J,Y),U=!0,P+=1):(Y=E,ee=new Date(q,J+1,Y),U=!1,E+=1);let fe=Pr(B,ee),Te=ee.getDate()===new Date().getDate()&&ee.getMonth()===new Date().getMonth()&&ee.getFullYear()===new Date().getFullYear();_.push(j({key:ee.getTime(),className:o("g-ui-event-calendar-month-cell",!U&&"g-ui-event-calendar-month-cell-outside",Te&&"g-ui-event-calendar-month-cell-today")},j({className:"g-ui-event-calendar-month-cell-header",onClick:()=>ne(ee,0,!0)},je({className:"g-ui-event-calendar-month-cell-day"},ee.getDate())),j({className:"g-ui-event-calendar-month-cell-events"},fe.slice(0,3).map(we=>j({key:we.id,className:"g-ui-event-calendar-month-event",style:we.color?{borderLeftColor:we.color,backgroundColor:`${we.color}20`}:{},onClick:Bi=>{Bi.stopPropagation(),N(we)}},we.title||"(No title)")),ce(fe.length>3,()=>j({className:"g-ui-event-calendar-month-more",onClick:we=>{we.stopPropagation(),N(fe[3])}},`+${fe.length-3} more`)))))}return _}),Vi=j({className:"g-ui-event-calendar-month"},j({className:"g-ui-event-calendar-weekdays"},iu.map(c=>j({key:c,className:"g-ui-event-calendar-weekday"},c))),j({className:"g-ui-event-calendar-month-grid"},li)),Ne=[];for(let c=ue;c<te;c+=1)for(let B=0;B<60;B+=oe)Ne.push(c+B/60);let Ze=be(f,n).compute(([c,B])=>{let ae=wt(c,B??0),q=[];for(let J=0;J<7;J+=1){let pe=new Date(ae);pe.setDate(pe.getDate()+J),q.push(pe)}return q}),Li=j({className:"g-ui-event-calendar-week"},be(Ze).compute(c=>j({className:"g-ui-event-calendar-week-days"},j({className:"g-ui-event-calendar-week-time-col"},""),(c||[]).map(B=>j({key:B.getTime(),className:"g-ui-event-calendar-week-day-col"},j({className:"g-ui-event-calendar-week-day-header"},gi(B,l(u))))))),j({className:"g-ui-event-calendar-week-body"},j({className:"g-ui-event-calendar-week-time-col"},Ne.map(c=>{let B=Math.floor(c),ae=(c-B)*60,q=`${B<=12?B:B-12}:${ae===0?"00":ae} ${B<12?"AM":"PM"}`;return j({key:c,className:"g-ui-event-calendar-week-slot-label"},q)})),be(Ze,X).compute(([c,B])=>{if(!c||!c.length)return null;let ae=c[0],q=new Date(c[6]);q.setHours(23,59,59,999);let J=Vr(B,ae,q);return j({className:"g-ui-event-calendar-week-grid-cols"},c.map(pe=>j({key:pe.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Ne.map(Q=>j({key:Q,className:"g-ui-event-calendar-week-slot",onClick:()=>ne(pe,Q,!1)})),J.filter(Q=>!Q.allDay&&Q.start.getDate()===pe.getDate()&&Q.start.getMonth()===pe.getMonth()&&Q.start.getFullYear()===pe.getFullYear()).map(Q=>{let{top:Ce,height:De}=Mr(Q.start,Q.end,ue,te);return j({key:Q.id,className:"g-ui-event-calendar-week-event",style:{top:`${Ce}%`,height:`${De}%`,borderLeftColor:Q.color||"var(--g-ui-primary)"},onClick:M=>{M.stopPropagation(),N(Q)}},j({className:"g-ui-event-calendar-week-event-title"},Q.title||"(No title)"),ce(!Q.allDay,()=>je({className:"g-ui-event-calendar-week-event-time"},`${Ge(Q.start,l(u))} \u2013 ${Ge(Q.end,l(u))}`)))}))))}))),$i=j({className:"g-ui-event-calendar-day"},j({className:"g-ui-event-calendar-day-body"},j({className:"g-ui-event-calendar-day-time-col"},Ne.map(c=>{let B=Math.floor(c),ae=(c-B)*60,q=`${B<=12?B:B-12}:${ae===0?"00":ae} ${B<12?"AM":"PM"}`;return j({key:c,className:"g-ui-event-calendar-day-slot-label"},q)})),j({className:"g-ui-event-calendar-day-slots"},Ne.map(c=>j({key:c,className:"g-ui-event-calendar-day-slot",onClick:()=>ne(f.get(),c,!1)})),be(X,f).compute(([c,B])=>B?Pr(c,B).filter(q=>!q.allDay).map(q=>{let{top:J,height:pe}=Mr(q.start,q.end,ue,te);return j({key:q.id,className:"g-ui-event-calendar-day-event",style:{top:`${J}%`,height:`${pe}%`,borderLeftColor:q.color||"var(--g-ui-primary)"},onClick:Q=>{Q.stopPropagation(),N(q)}},j({className:"g-ui-event-calendar-day-event-title"},q.title||"(No title)"),je({className:"g-ui-event-calendar-day-event-time"},`${Ge(q.start,l(u))} \u2013 ${Ge(q.end,l(u))}`))}):[])))),ci=c=>{let B=I.get(),ae=new Date,q=B.start||ae,J=B.end||new Date(ae.getTime()+3600*1e3),pe=le(B.title),Q=le(q.toISOString().slice(0,10)),Ce=le(!B.allDay&&q?q.toTimeString().slice(0,5):"09:00"),De=le(J.toISOString().slice(0,10)),M=le(!B.allDay&&J?J.toTimeString().slice(0,5):"10:00"),P=le(B.allDay),E=le(B.description),O=le(B.location),_=le(B.attendees||[]),Z=le(""),Y=le([]),U=le([]),ee=le(""),fe=Array.isArray(m)?m:[],Te=le(B.color),we=()=>{let L=new Date(Q.get()+"T"+(P.get()?"00:00:00":Ce.get()+":00")),he=new Date(De.get()+"T"+(P.get()?"23:59:59":M.get()+":00"));I.set({title:pe.get(),start:L,end:he,allDay:P.get(),description:E.get(),location:O.get(),attendees:_.get(),color:Te.get()})},Bi=L=>{if(Z.set(L),!$||!L.trim()){Y.set([]);return}Promise.resolve($(L.trim())).then(he=>Y.set(Array.isArray(he)?he:[])).catch(()=>Y.set([]))},Lr=L=>{let he=_.get();he.some(kt=>(kt.email||kt.id)===(L.email||L.id))||(_.set([...he,{id:L.id,email:L.email??L.label,label:L.label}]),Z.set(""),Y.set([]))},$r=L=>{let he=[..._.get()];he.splice(L,1),_.set(he)},yt=()=>{S&&Promise.resolve(S(ee.get())).then(L=>U.set(Array.isArray(L)?L:[])).catch(()=>U.set([]))};return j({className:"g-ui-event-calendar-form"},j({className:"g-ui-event-calendar-form-row"},ge({label:"Title",placeholder:"Event title",value:pe,onInput:L=>pe.set(L?.target?.value??"")})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},Xi({label:"All day",checked:P,onChange:L=>P.set(L)})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"Start"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:Q,onInput:L=>Q.set(L?.target?.value??"")}),ce(!P,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:Ce,onInput:L=>Ce.set(L?.target?.value??"")}))),j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"End"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:De,onInput:L=>De.set(L?.target?.value??"")}),ce(!P,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:M,onInput:L=>M.set(L?.target?.value??"")})))),ce(S,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Location"),ge({placeholder:"Search or type location",value:ee,onInput:L=>{ee.set(L?.target?.value??""),yt()},onFocus:yt}),ce(be(U).compute(L=>L&&L.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},U.get().map(L=>j({key:L.id??L.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{O.set(L.label??L.id),ee.set(""),U.set([])}},L.label??L.id)))),ce(be(O).compute(L=>!!L),()=>je({className:"g-ui-event-calendar-form-chip"},O)))),ce($,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Add guests"),ge({placeholder:"Type email to search",value:Z,onInput:L=>Bi(L?.target?.value??"")}),j({className:"g-ui-event-calendar-form-chips"},_.get().map((L,he)=>je({key:(L.email||L.id)+he,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>$r(he)},L.label||L.email||L.id," \xD7"))),ce(be(Y).compute(L=>L&&L.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},Y.get().map(L=>j({key:L.id??L.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>Lr(L)},L.label??L.email??L.id)))))),j({className:"g-ui-event-calendar-form-row"},qi({label:"Description",placeholder:"Add description",value:E,onInput:L=>E.set(L?.target?.value??"")})),ce(fe.length>0,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Color"),j({className:"g-ui-event-calendar-form-colors"},fe.map(L=>j({key:L.value??L.id??L,className:o("g-ui-event-calendar-form-color-swatch",be(Te).compute(he=>he===(L.value??L.id??L)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:L.color??L.value??L},onClick:()=>Te.set(L.value??L.id??L)}))))),j({className:"g-ui-event-calendar-form-actions"},Fe({variant:"subtle",onClick:H},"Cancel"),Fe({variant:"filled",onClick:()=>{we(),c?xe():se()}},c?"Save":"Create")))},Ii=()=>{let c=V.get();return c?j({className:"g-ui-event-calendar-view-modal"},j({className:"g-ui-event-calendar-view-modal-title"},c.title||"(No title)"),j({className:"g-ui-event-calendar-view-modal-meta"},c.allDay?je({className:"g-ui-event-calendar-view-modal-date"},gi(c.start,l(u))+(c.start.getTime()!==c.end.getTime()?` \u2013 ${gi(c.end,l(u))}`:"")):je({className:"g-ui-event-calendar-view-modal-date"},`${gi(c.start,l(u))} \xB7 ${Ge(c.start,l(u))} \u2013 ${Ge(c.end,l(u))}`)),ce(c.location,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Location: ",c.location)),ce(c.description,()=>j({className:"g-ui-event-calendar-view-modal-field"},c.description)),ce(c.attendees?.length,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",c.attendees.map(B=>B.label||B.email||B.id).join(", "))),j({className:"g-ui-event-calendar-view-modal-actions"},Fe({variant:"subtle",size:"sm",onClick:G},ye({size:"sm",innerHTML:jt})," Edit"),Fe({variant:"subtle",size:"sm",onClick:ze,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:Et})," Delete"),Fe({variant:"filled",size:"sm",onClick:H},"Close"))):null};return j({...x,className:o("g-ui-event-calendar",b)},Ve,ce(v,c=>c==="month",()=>Vi),ce(v,c=>c==="week",()=>Li),ce(v,c=>c==="day",()=>$i),ce(C,c=>c==="create",()=>_e({opened:!0,title:"New event",size:"lg",onClose:H},ci(!1))),ce(C,c=>c==="view",()=>_e({opened:!0,title:"Event",size:"md",onClose:H},Ii())),ce(C,c=>c==="edit",()=>_e({opened:!0,title:"Edit event",size:"lg",onClose:H},ci(!0))))}import{state as nu}from"@granularjs/core";function su(e=!1){let i=nu(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Nt();export{Qa as Accordion,Ae as ActionIcon,Cn as Affix,ho as Alert,Fo as Anchor,Vn as AppBar,wo as Avatar,Us as AvatarGroup,xa as Badge,_s as BadgeGroup,So as Blockquote,Dr as BottomBar,cn as Breadcrumbs,Ls as Burger,Ri as Button,ii as Calendar,fa as Card,dn as Center,Xi as Checkbox,Gs as CheckboxGroup,_o as Chip,No as Code,Es as Col,vn as Collapse,ga as Container,ds as CopyButton,Jn as DateInput,Gn as DatePicker,lo as Divider,no as Drawer,ou as EventCalendar,Mn as Fieldset,Ss as Flex,Fs as Grid,bt as GridTable,da as Group,zn as HoverCard,ye as Icon,Eo as Image,Vs as Indicator,ko as Kbd,Jt as List,Ke as Loading,Bs as LoadingOverlay,ro as Menu,_e as Modal,Yn as MultiSelect,Ms as NavLink,et as Notification,Xn as Notifications,Yi as NumberField,Sa as NumberInput,tn as Pagination,po as Paper,ss as PasswordInput,Ys as PinInput,lt as Popover,rs as Popper,Ho as Progress,fs as ProgressRing,nn as Radio,un as RadioGroup,Ns as RangePicker,Qn as RangeSlider,En as Rating,Hs as ScrollArea,gs as SearchInput,Qo as SegmentedControl,Ea as Select,bs as SelectSearch,$n as Sidebar,Po as SimpleGrid,Zo as Skeleton,Yo as Slider,fn as Space,ca as Stack,Fn as Stepper,ja as Switch,ys as SwitchGroup,Ua as Table,qa as Tabs,Hn as Tag,Hi as Text,ge as TextInput,qi as Textarea,An as Timeline,sa as Title,xs as Toast,Wn as ToastStack,Ja as Tooltip,o as cx,Xr as setThemeMode,Ur as setThemeVars,su as useDisclosure};
|
|
3605
3613
|
//# sourceMappingURL=granular-ui.min.js.map
|