@rovula/ui 0.1.33 → 0.1.35

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.
@@ -29,7 +29,7 @@ var $C={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const UC=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},qC=i({}),GC=n((({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...c},d)=>{const{size:u=24,strokeWidth:f=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:p=""}=a(qC)??{},g=r??h?24*Number(n??f)/Number(t??u):n??f;return l("svg",{ref:d,...$C,width:t??u??$C.width,height:t??u??$C.height,stroke:e??m,strokeWidth:g,className:_C("lucide",p,o),...!i&&!UC(c)&&{"aria-hidden":"true"},...c},[...s.map((([e,t])=>l(e,t))),...Array.isArray(i)?i:[i]])})),YC=(e,t)=>{const r=n((({className:n,...r},o)=>l(GC,{ref:o,iconNode:t,className:_C(`lucide-${WC(zC(e))}`,`lucide-${e}`,n),...r})));return r.displayName=zC(e),r},KC=YC("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),XC=YC("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),QC=YC("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),JC=YC("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ek=YC("chevron-first",[["path",{d:"m17 18-6-6 6-6",key:"1yerx2"}],["path",{d:"M7 6v12",key:"1p53r6"}]]),tk=YC("chevron-last",[["path",{d:"m7 18 6-6-6-6",key:"lwmzdw"}],["path",{d:"M17 6v12",key:"1o0aio"}]]),nk=YC("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),rk=YC("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),ok=YC("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ak=YC("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ik=YC("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),lk=YC("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),sk=YC("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),ck=YC("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),dk=YC("equal",[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]]),uk=YC("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),fk=YC("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),hk=YC("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mk=n(((e,t)=>{var{id:n,label:a,size:i="md",rounded:l="normal",variant:c="outline",type:d="text",iconMode:u="flat",helperText:f,errorMessage:h,warningMessage:m,status:p,fullwidth:g=!0,disabled:v=!1,error:w=!1,warning:b=!1,required:y=!0,isFloatingLabel:x=!0,keepCloseIconOnValue:k=!1,keepFooterSpace:M=!0,hasClearIcon:R=!0,hasSearchIcon:I=!1,startIcon:O,endIcon:A,labelClassName:L,onClickStartIcon:S,onClickEndIcon:N,renderStartIcon:j,renderEndIcon:D,classes:Z,normalize:V,format:T,trimOnCommit:B,normalizeOnCommit:F,placeholder:P}=e,H=IC(e,["id","label","size","rounded","variant","type","iconMode","helperText","errorMessage","warningMessage","status","fullwidth","disabled","error","warning","required","isFloatingLabel","keepCloseIconOnValue","keepFooterSpace","hasClearIcon","hasSearchIcon","startIcon","endIcon","labelClassName","onClickStartIcon","onClickEndIcon","renderStartIcon","renderEndIcon","classes","normalize","format","trimOnCommit","normalizeOnCommit","placeholder"]);const _=r(null),W=n||`${d}-${a}-input`,z=function(...e){const t=r();return t.current=function(...e){return t=>{e.forEach((e=>{e&&("function"==typeof e?e(t):e.current=t)}))}}(...e),o((e=>{var n;null===(n=t.current)||void 0===n||n.call(t,e)}),[])}(t,_),$=!!O||!!j,U=!!A||!!D,q=p||(w||h?"error":b||m?"warning":"default"),G="error"===q,Y="warning"===q,K="error"===q?h:"warning"===q?m:f,X=jC({size:i,rounded:l,variant:c,fullwidth:g,disabled:v,error:G,warning:Y,hasSearchIcon:"flat"===u&&$||I,hasClearIcon:"flat"===u&&U||R,leftSectionIcon:"solid"===u&&$,rightSectionIcon:"solid"===u&&U,floatingLabelPlaceholder:x}),Q=DC({size:i,disabled:v,error:G,hasSearchIcon:"flat"===u&&$||I,hasLeftSectionIcon:"solid"===u&&$,isFloatingLabel:x}),J=ZC({size:i,error:G,warning:Y,disabled:v}),ee=TC({size:i}),te=BC({size:i}),ne=FC({size:i}),re=PC({size:i}),oe=HC({size:i,rounded:l,error:G,warning:Y,position:"start"}),ae=HC({size:i,rounded:l,error:G,warning:Y,position:"end"}),ie=o((e=>{var t;V&&(e.target.value=V(e.target.value)),null===(t=H.onChange)||void 0===t||t.call(H,e)}),[V,H.onChange]),le=o((e=>{var t;const n=e.currentTarget;let r=n.value;B&&(r=r.trim()),F&&(r=F(r)),r!==n.value&&(n.value=r,null===(t=H.onChange)||void 0===t||t.call(H,Object.assign(Object.assign({},e),{target:n})))}),[B,F,H.onChange]),se=o((e=>{var t;(B||F)&&le(e),null===(t=H.onBlur)||void 0===t||t.call(H,e)}),[B,F,le,H.onBlur]),ce=o((e=>{var t;(B||F)&&"Enter"===e.key&&le(e),null===(t=H.onKeyDown)||void 0===t||t.call(H,e)}),[B,F,le,H.onKeyDown]),de=T&&"string"==typeof H.value?T(H.value):H.value,ue=o((()=>{_.current&&(_.current.value="",H.onChange&&(new Event("input",{bubbles:!0}),H.onChange({target:{value:""}})))}),[H.onChange]),fe=o((()=>{v||(null==S||S(),_.current&&_.current.focus())}),[v,S]),he=o((()=>{v||(null==N||N(),_.current&&_.current.focus())}),[v,N]),me=s((()=>{if($)return E("div",j?{className:LC(te,"flex",null==Z?void 0:Z.iconSearchWrapper),children:j()}:"flat"===u?{className:LC(te,null==Z?void 0:Z.iconSearchWrapper),children:E("div",{className:LC(ne,null==Z?void 0:Z.icon),onClick:fe,children:O})}:{className:LC(oe,null==Z?void 0:Z.startIconWrapper),onClick:fe,children:O})}),[$,O,u,te,oe,ne,j,fe]),pe=s((()=>{if(U)return E("div",D?{className:LC(ee,"flex",null==Z?void 0:Z.iconWrapper),children:D()}:"flat"===u?{className:LC(ee,"flex",null==Z?void 0:Z.iconWrapper),children:E("div",{className:LC(ne,null==Z?void 0:Z.icon),onClick:he,children:A})}:{className:LC(ae,null==Z?void 0:Z.endIconWrapper),onClick:he,children:A})}),[U,A,u,ee,ae,ne,D,he]),ge=x||null!=a&&""!==String(a);return C("div",{className:"inline-flex flex-col "+(g?"w-full":""),children:[C("div",{className:"relative",children:[E("input",Object.assign({},H,{placeholder:x?" ":null!=P?P:"",ref:z,type:d,id:W,disabled:v,value:de,className:LC(X,H.className),onChange:V?ie:H.onChange,onBlur:B||F?se:H.onBlur,onKeyDown:B||F?ce:H.onKeyDown})),I&&!$&&E("div",{className:LC(te,null==Z?void 0:Z.iconSearchWrapper),children:E(hk,{className:LC(re,null==Z?void 0:Z.icon)})}),me,R&&!U&&E("div",{className:LC(ee,null==Z?void 0:Z.iconWrapper),style:{display:k&&H.value?"flex":void 0},children:E(ik,{className:LC(ne,null==Z?void 0:Z.icon),onMouseDown:ue})}),pe,ge&&C("label",{htmlFor:W,className:LC(Q,L),children:[a," ",y&&E("span",{className:LC("text-input-error",{"text-input-disable-text":v}),children:"*"})]})]}),(K||M)&&C("span",{className:J,children:[K&&E("span",{className:"h-full shrink-0",children:E(ok,{width:14,height:14,className:LC("fill-none stroke-current",G?"text-input-error":Y?"text-warning":"text-input-filled-text")})}),M&&!K&&E("span",{className:"block min-h-[14px]","aria-hidden":!0}),K||""]})]})})),pk={0:{pattern:/[0-9]/,placeholder:"0"},9:{pattern:/[0-9\s]/,placeholder:"9"},"#":{pattern:/[0-9\s+\-]/,placeholder:"#"},L:{pattern:/[a-zA-Z]/,placeholder:"L"},"?":{pattern:/[a-zA-Z\s]/,placeholder:"?"},"&":{pattern:/[^\s]/,placeholder:"&"},C:{pattern:/./,placeholder:"C"},A:{pattern:/[a-zA-Z0-9]/,placeholder:"A"},a:{pattern:/[a-zA-Z0-9\s]/,placeholder:"a"}},gk=(e,t,n="_",r=!0,o=!0)=>{let a="",i=0;for(let l=0;l<t.length;l++){const s=t[l];if(s.isLiteral)a+=s.placeholder;else{let t=!1;for(;i<e.length;){const n=e[i];i++;if(s.validator?s.validator(n):s.pattern.test(n)){a+=n,t=!0;break}}if(!t&&o&&r)a+=n;else if(!t)break}}return a},vk=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){const o=t[r],a=e[r];o.isLiteral||(n+=a)}return n},wk=n(((e,n)=>{var{mask:a,maskChar:i="_",showMask:l=!0,guide:s=!0,keepCharPositions:f=!1,rules:h,onMaskedChange:m,onChange:p,value:g,defaultValue:v}=e,w=IC(e,["mask","maskChar","showMask","guide","keepCharPositions","rules","onMaskedChange","onChange","value","defaultValue"]);const b=r(null),[y,x]=c(""),[C,k]=c(""),M=t.useMemo((()=>a?((e,t)=>{const n=Object.assign(Object.assign({},pk),t),r=[];let o=0;for(;o<e.length;){const t=e[o];if("\\"===t&&o+1<e.length){const t=e[o+1];r.push({pattern:new RegExp(`^${t}$`),placeholder:t,isLiteral:!0}),o+=2}else if(n[t]){const e=n[t];"function"==typeof e?r.push({pattern:/./,placeholder:t,validator:e}):e instanceof RegExp?r.push({pattern:e,placeholder:t}):r.push({pattern:e.pattern,placeholder:e.placeholder}),o++}else r.push({pattern:new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`),placeholder:t,isLiteral:!0}),o++}return r})(a,h):null),[a,h]);d((()=>{const e=g||v||"";if(M&&e){const t=gk(e,M,i,l,s),n=vk(t,M);x(t),k(n)}else x(e),k(e)}),[M,i,l,s,g,v]),u(n,(()=>null==b?void 0:b.current));const R=o((e=>{const t=e.target.value;if(!M)return x(t),k(t),null==p||p(e),void(null==m||m(t,t));const n=gk(t,M,i,l,s),r=vk(n,M);x(n),k(r);const o=Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{value:n})});null==p||p(o),null==m||m(n,r),setTimeout((()=>{if(b.current){const e=r.replace(/[_\s]/g,"").length,t=((e,t,n)=>{let r=0,o=0;for(let a=0;a<n.length&&a<e.length;a++){const i=n[a];if(e[a],i.isLiteral)o=a+1;else if(r++,o=a+1,r>=t)break}return o})(n,e,M);b.current.setSelectionRange(t,t)}}),0)}),[M,i,l,s,p,m]),I=o((e=>{var t,n,r;if(!M)return void(null===(t=w.onKeyDown)||void 0===t||t.call(w,e));const{key:o,ctrlKey:a,metaKey:i}=e,l=e.target.selectionStart||0;if("Backspace"===o||"Delete"===o||"ArrowLeft"===o||"ArrowRight"===o||"Home"===o||"End"===o||"Tab"===o||o.length>1||a||i)return void(null===(n=w.onKeyDown)||void 0===n||n.call(w,e));let s=l;for(;s<M.length&&M[s].isLiteral;)s++;if(s<M.length){const t=M[s];if(!(t.validator?t.validator(o):t.pattern.test(o)))return void e.preventDefault()}null===(r=w.onKeyDown)||void 0===r||r.call(w,e)}),[M,w]);return E(mk,Object.assign({},w,{ref:b,value:y,onChange:R,onKeyDown:I,className:LC(w.className)}))}));async function bk(){const{default:e}=await import("lucide-react/dynamicIconImports");return Object.keys(e)}wk.displayName="MaskedTextInput";const yk=M(["text-inherit"],{variants:{color:{primary:"text-primary",secondary:"text-secondary",tertiary:"text-tertiary",success:"text-success",info:"text-info",warning:"text-warning",error:"text-error",inherit:"text-inherit"},size:{sm:"size-4",md:"size-6",lg:"size-8",inherit:""}},defaultVariants:{size:"inherit",color:"inherit"}}),xk={sm:16,md:24,lg:32},Ek=e=>{var{name:n,type:r="heroicons",color:o="inherit",variant:a="solid",size:i="md",className:l}=e,s=IC(e,["name","type","color","variant","size","className"]);const[c,d]=t.useState(null);if(t.useEffect((()=>{if("lucide"===r)return void import("lucide-react/dynamicIconImports").then((({default:e})=>{const t=e[n];t?t().then((e=>{d((()=>e.default))})):console.warn(`Lucide icon "${n}" not found.`)}));const e=((e,t,n)=>{var r,o;return null===(o=null===(r=xC[e])||void 0===r?void 0:r[t])||void 0===o?void 0:o[n]})(r,n,a);e?d((()=>e)):console.warn(`Icon "${n}" from "${r}" not found.`)}),[n,r,a]),"lucide"===r){if(!c)return E("span",{className:LC(yk({color:o,size:i}),l)});const e="inherit"===i?24:xk[i];return E(c,Object.assign({},s,{size:e,strokeWidth:e<=16?1.5:2,absoluteStrokeWidth:!0,shapeRendering:"geometricPrecision",className:LC(yk({color:o,size:i}),"stroke-current",l)}))}return E(c||"svg",Object.assign({className:LC(yk({color:o,size:i}),l)},s))},Ck=n(((e,t)=>{var n,{showToggle:o=!0,hasClearIcon:a=!1,hideIcon:i,showIcon:l,endIcon:s,renderEndIcon:d,onClickEndIcon:f}=e,h=IC(e,["showToggle","hasClearIcon","hideIcon","showIcon","endIcon","renderEndIcon","onClickEndIcon"]);const m=r(null),[p,g]=c(!1);u(t,(()=>null==m?void 0:m.current));const v=p?null!=l?l:E(Ek,{name:"eye",type:"lucide",size:"inherit",className:"size-full","aria-label":"Hide password"}):null!=i?i:E(Ek,{name:"eye-closed",type:"lucide",size:"inherit",className:"size-full","aria-label":"Show password"});return E(mk,Object.assign({iconMode:"flat"},h,{ref:m,type:p?"text":"password",hasClearIcon:a,endIcon:o?v:s,renderEndIcon:d,onClickEndIcon:o?()=>{var e;h.disabled||(g((e=>!e)),null===(e=m.current)||void 0===e||e.focus(),null==f||f())}:f,autoComplete:null!==(n=h.autoComplete)&&void 0!==n?n:"current-password"}))}));Ck.displayName="PasswordInput";const kk=n(((e,n)=>{var a,{value:i,defaultValue:l,min:s,max:d,step:f=1,precision:h,hideControls:m=!1,allowDecimal:p=!0,allowNegative:g=!0,formatDisplay:v=!1,thousandSeparator:w=",",decimalSeparator:b=".",prefix:y="",suffix:x="",disabled:k=!1,onChange:M,onValueChange:R,className:I,size:O="md"}=e,A=IC(e,["value","defaultValue","min","max","step","precision","hideControls","allowDecimal","allowNegative","formatDisplay","thousandSeparator","decimalSeparator","prefix","suffix","disabled","onChange","onValueChange","className","size"]);const L=r(null),[S,N]=c((null!==(a=null!=i?i:l)&&void 0!==a?a:"").toString()),[j,D]=c(!1);u(n,(()=>null==L?void 0:L.current));const Z=o((e=>{let t=e;return y&&(t=t.replace(y,"")),x&&(t=t.replace(x,"")),w&&(t=t.split(w).join("")),"."!==b&&(t=t.replace(b,".")),t.trim()}),[y,x,w,b]),V=o((e=>{if(!v||""===e||"-"===e)return e;const t=parseFloat(e);if(isNaN(t))return e;let n=t.toString();void 0!==h&&(n=t.toFixed(h));const r=n.split(".");let o=r[0];const a=r[1];return w&&(o=o.replace(/\B(?=(\d{3})+(?!\d))/g,w)),n=a?`${o}${b}${a}`:o,y&&(n=`${y}${n}`),x&&(n=`${n}${x}`),n}),[v,h,w,b,y,x]),T=o((e=>{if(""===e||"-"===e)return e;let t=parseFloat(e);return isNaN(t)?S:(void 0!==s&&t<s&&(t=s),void 0!==d&&t>d&&(t=d),void 0!==h&&(t=parseFloat(t.toFixed(h))),t.toString())}),[s,d,h,S]),B=o((e=>{let t=e.target.value;if(v&&(t=Z(t)),""===t)return N(""),null==M||M(void 0),void(null==R||R(""));if(g&&"-"===t)return N("-"),void(null==R||R("-"));if(!(p?g?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/:g?/^-?\d*$/:/^\d*$/).test(t))return;N(t),null==R||R(t);const n=parseFloat(t);isNaN(n)||null==M||M(n)}),[p,g,v,Z,M,R]),F=o((e=>{var t;D(!0),null===(t=A.onFocus)||void 0===t||t.call(A,e)}),[A]),P=o((e=>{var t;D(!1);const n=T(S);N(n);const r=parseFloat(n);isNaN(r)||null==M||M(r),null===(t=A.onBlur)||void 0===t||t.call(A,e)}),[S,T,M,A]),H=o((e=>{if(k)return;e.stopPropagation(),e.preventDefault();let t=(parseFloat(S)||0)+f;void 0!==d&&t>d&&(t=d);const n=T(t.toString());N(n),null==M||M(parseFloat(n)),null==R||R(n)}),[S,f,d,k,T,M,R]),_=o((e=>{if(k)return;e.stopPropagation(),e.preventDefault();let t=(parseFloat(S)||0)-f;void 0!==s&&t<s&&(t=s);const n=T(t.toString());N(n),null==M||M(parseFloat(n)),null==R||R(n)}),[S,f,s,k,T,M,R]),W=o((e=>{var t;switch(e.key){case"ArrowUp":H(e);break;case"ArrowDown":_(e);break;case"Enter":e.currentTarget.blur()}null===(t=A.onKeyDown)||void 0===t||t.call(A,e)}),[H,_,A]);t.useEffect((()=>{void 0!==i&&N(i.toString())}),[i]);const z=t.useMemo((()=>j||!v?S:V(S)),[j,v,S,V]),$={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-6 h-6"}[O],U={sm:"absolute top-0.5",md:"absolute top-1",lg:"absolute top-1"}[O];return E(mk,Object.assign({},A,{ref:L,type:"text",inputMode:"decimal",value:z,onChange:B,onFocus:F,onBlur:P,onKeyDown:W,disabled:k,size:O,hasClearIcon:!1,endIcon:m?null:C("div",{className:LC("flex flex-col","flat"===A.iconMode&&U),children:[E("button",{type:"button",onClick:H,disabled:k||void 0!==d&&parseFloat(S)>=d,className:LC(" hover:bg-input-active-stroke/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors rounded-full text-input-filled-text"),tabIndex:-1,children:E(zr,{className:$})}),E("button",{type:"button",onClick:_,disabled:k||void 0!==s&&parseFloat(S)<=s,className:LC(" hover:bg-input-active-stroke/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors rounded-full text-input-filled-text"),tabIndex:-1,children:E(Vr,{className:$})})]}),className:LC(I)}))}));kk.displayName="NumberInput";const Mk=M(["peer block w-full bg-transparent outline-none placeholder:text-transparent resize-y ui-scrollbar","text-input-filled-text caret-primary"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitle4",lg:"p-4 typography-subtitle1"},rounded:{none:"rounded-none",normal:"rounded-md",full:"rounded-full"},variant:{flat:"",outline:["ring-1 ring-inset ring-input-default-stroke","hover:ring-input-active-stroke","focus:ring-1 focus:ring-inset focus:ring-input-active-stroke"],underline:"border-b-2 border-input-default-stroke transition-colors hover:border-input-active-stroke focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:["bg-input-disable-bg text-input-disable-text ring-input-disable-stroke placeholder:text-input-disable-text","hover:ring-input-disable-stroke","cursor-not-allowed"]},error:{true:"ring-input-error focus:ring-input-error"},hasClearIcon:{true:""},isFloatingLabel:{true:"",false:"placeholder:text-input-placeholder"}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",className:"focus:pe-6"},{hasClearIcon:!0,size:"md",className:"focus:pe-8"},{hasClearIcon:!0,size:"lg",className:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1,isFloatingLabel:!0}}),Rk=M(["absolute block duration-450 transition-all px-[2px] text-input-default-text","peer-focus:text-input-filled-text peer-focus:bg-input-label-bg"],{variants:{size:{sm:[],md:[],lg:[]},disabled:{true:"text-input-default-text placeholder:text-input-default-text"},error:{true:"ring-error"},isFloatingLabel:{false:"hidden peer-placeholder-shown:block peer-focus:bg-transparent"}},compoundVariants:[{isFloatingLabel:!0,size:"sm",className:["left-3 -top-1.5 typography-label2 bg-input-label-bg","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"]},{isFloatingLabel:!0,size:"md",className:["left-3 -top-1.5 typography-label1 bg-input-label-bg","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{isFloatingLabel:!0,size:"lg",className:["left-4 -top-1.5 typography-label1 bg-input-label-bg","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{isFloatingLabel:!1,size:"sm",className:["left-3 peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1"]},{isFloatingLabel:!1,size:"md",className:["left-3 peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4"]},{isFloatingLabel:!1,size:"lg",className:["left-4 peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1"]}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloatingLabel:!0}}),Ik=M(["absolute inset-y-0 right-0 items-start justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2 pt-2",md:"mr-3 pt-2",lg:"mr-4 pt-4"}},defaultVariants:{size:"md"}}),Ok=M(["cursor-pointer z-50 fill-input-active-stroke hover:fill-input-default-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}}),Ak=M(["typography-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-disable-text"},error:{true:"text-input-error",false:"text-input-filled-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),Lk=n(((e,t)=>{var{id:n,label:a,size:i="md",rounded:l="normal",variant:c="outline",helperText:d,errorMessage:f,fullwidth:h=!0,disabled:m=!1,error:p=!1,required:g=!0,isFloatingLabel:v=!0,keepCloseIconOnValue:w=!1,hasClearIcon:b=!0,labelClassName:y,className:x,normalize:k,format:M,trimOnCommit:R,normalizeOnCommit:I}=e,O=IC(e,["id","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","required","isFloatingLabel","keepCloseIconOnValue","hasClearIcon","labelClassName","className","normalize","format","trimOnCommit","normalizeOnCommit"]);const A=r(null),L=n||`textarea-${null!=a?a:""}`;u(t,(()=>null==A?void 0:A.current));const S=o((e=>{var t;k&&(e.target.value=k(e.target.value)),null===(t=O.onChange)||void 0===t||t.call(O,e)}),[k,O.onChange]),N=o((e=>{var t;const n=e.currentTarget;let r=n.value;R&&(r=r.trim()),I&&(r=I(r)),r!==n.value&&(n.value=r,null===(t=O.onChange)||void 0===t||t.call(O,Object.assign(Object.assign({},e),{target:n})))}),[R,I,O.onChange]),j=o((e=>{var t;(R||I)&&N(e),null===(t=O.onBlur)||void 0===t||t.call(O,e)}),[R,I,N,O.onBlur]),D=M&&"string"==typeof O.value?M(O.value):O.value,Z=s((()=>"inline-flex flex-col "+(h?"w-full":"")),[h]),V=Mk({size:i,rounded:l,variant:c,fullwidth:h,disabled:m,error:p,hasClearIcon:b,isFloatingLabel:v});return C("div",{className:Z,children:[C("div",{className:"relative",children:[E("textarea",Object.assign({},O,{id:L,ref:A,disabled:m,placeholder:v?" ":O.placeholder,className:LC(V,x),value:D,onChange:k?S:O.onChange,onBlur:R||I?j:O.onBlur})),b&&E("div",{className:Ik({size:i}),style:{display:w&&O.value?"flex":void 0},children:E(pu,{type:"button",className:Ok({size:i}),onMouseDown:e=>{if(e.preventDefault(),A.current){const e=A.current.value;A.current.value="",O.onChange&&""!==e&&O.onChange({target:{value:""}}),A.current.focus()}}})}),a&&C("label",{htmlFor:L,className:LC(Rk({size:i,disabled:m,error:p,isFloatingLabel:v}),y),children:[a," ",g&&E("span",{className:LC("text-error",{"text-input-disable-text":m}),children:"*"})]})]}),(f||d)&&E("span",{className:Ak({size:i,disabled:m,error:p}),children:f||d})]})})),Sk=M(["text-common-black"],{variants:{color:{primary:"text-primary",secondary:"text-secondary",success:"text-success",tertiary:"text-tertiary",info:"text-info",warning:"text-warning",error:"text-error"}}}),Nk={subtitile1:"subtitle1",subtitile2:"subtitle2",subtitile3:"subtitle3",subtitile4:"subtitle4",subtitile5:"subtitle5",subtitile6:"subtitle6"},jk=n(((e,t)=>{var n,{variant:r="body1",tag:o="p",children:a,className:i="",color:l,style:s}=e,c=IC(e,["variant","tag","children","className","color","style"]);const d=null!==(n=Nk[r])&&void 0!==n?n:r;return E(o,Object.assign({ref:t,className:LC(`typography-${d}`,Sk({color:l}),i),style:s},c,{children:a}))})),Dk=M(["box-border flex items-center justify-center outline-none focus-visible:outline-none"],{variants:{variant:{solid:["bg-action-button-solid-default border-action-button-solid-default text-action-button-solid-default fill-action-button-solid-default","hover:bg-action-button-solid-hover hover:border-action-button-solid-hover hover:text-action-button-solid-hover hover:fill-action-button-solid-hover","active:bg-action-button-solid-pressed active:border-action-button-solid-pressed active:text-action-button-solid-pressed active:fill-action-button-solid-pressed","focus-visible:ring-none focus-visible:ring-offset-2 focus-visible:ring-[var(--action-button-solid-default-border)]"],outline:["ring-1 ring-inset","bg-action-button-outline-default text-action-button-outline-default fill-action-button-outline-default ring-[var(--action-button-outline-default-border)]","hover:bg-action-button-outline-hover hover:text-action-button-outline-hover hover:fill-action-button-outline-hover hover:ring-[var(--action-button-outline-hover-border)]","active:bg-action-button-outline-pressed active:text-action-button-outline-pressed active:fill-action-button-outline-pressed active:ring-[var(--action-button-outline-pressed-border)]","focus-visible:ring-none focus-visible:ring-[var(--action-button-outline-default-border)]"],icon:["bg-action-button-icon-default border-action-button-icon-default text-action-button-icon-default fill-action-button-icon-default","hover:bg-action-button-icon-hover hover:border-action-button-icon-hover hover:text-action-button-icon-hover hover:fill-action-button-icon-hover","active:bg-action-button-icon-pressed active:border-action-button-icon-pressed active:text-action-button-icon-pressed active:fill-action-button-icon-pressed","focus-visible:ring-none focus-visible:ring-offset-2 focus-visible:ring-[var(--action-button-icon-default-border)]"]},size:{xxs:"",xs:"",sm:"",md:"",lg:""},shape:{round:"",capsule:""},disabled:{false:""},active:{false:""}},compoundVariants:[{variant:"solid",active:!0,className:["bg-action-button-solid-active border-action-button-solid-active text-action-button-solid-active fill-action-button-solid-active","hover:bg-action-button-solid-active-hover hover:border-action-button-solid-active-hover hover:text-action-button-solid-active-hover hover:fill-action-button-solid-active-hover","active:bg-action-button-solid-active-pressed active:border-action-button-solid-active-pressed active:text-action-button-solid-active-pressed active:fill-action-button-solid-active-pressed","focus-visible:ring-[var(--action-button-solid-active-border)]"]},{variant:"outline",active:!0,className:["bg-action-button-outline-active text-action-button-outline-active fill-action-button-outline-active ring-[var(--action-button-outline-active-border)]","hover:bg-action-button-outline-active-hover hover:text-action-button-outline-active-hover hover:fill-action-button-outline-active-hover hover:ring-[var(--action-button-outline-active-hover-border)]","active:bg-action-button-outline-active-pressed active:text-action-button-outline-active-pressed active:fill-action-button-outline-active-pressed active:ring-[var(--action-button-outline-active-pressed-border)]","focus-visible:ring-[var(--action-button-outline-active-border)]"]},{variant:"icon",active:!0,className:["bg-action-button-icon-active border-action-button-icon-active text-action-button-icon-active fill-action-button-icon-active","hover:bg-action-button-icon-active-hover hover:border-action-button-icon-active-hover hover:text-action-button-icon-active-hover hover:fill-action-button-icon-active-hover","active:bg-action-button-icon-active-pressed active:border-action-button-icon-active-pressed active:text-action-button-icon-active-pressed active:fill-action-button-icon-active-pressed","focus-visible:ring-[var(--action-button-icon-active-border)]"]},{size:"lg",variant:["solid","outline"],className:"px-[12px] py-[12px] [&_svg]:size-[32px]"},{size:"md",variant:["solid","outline"],className:"px-[8px] py-[8px] [&_svg]:size-[22px]"},{size:"sm",variant:["solid","outline"],className:"px-[4px] py-[4px] [&_svg]:size-[22px]"},{size:"xs",variant:["solid","outline"],className:"px-[2px] py-[2px] [&_svg]:size-[14px]"},{size:"lg",variant:"icon",className:"px-[12px] py-[12px] [&_svg]:size-[32px]"},{size:"md",variant:"icon",className:"px-[8px] py-[8px] [&_svg]:size-[22px]"},{size:"sm",variant:"icon",className:"px-[4px] py-[4px] [&_svg]:size-[22px]"},{size:"xxs",variant:"icon",className:"px-[1px] py-[1px] [&_svg]:size-[10px]"},{size:"xs",variant:"icon",className:"px-[2px] py-[2px] [&_svg]:size-[14px]"},{size:"lg",shape:"round",className:"rounded-[var(--function-button-l-round)]"},{size:"md",shape:"round",className:"rounded-[var(--function-button-m-round)]"},{size:"sm",shape:"round",className:"rounded-[var(--function-button-s-round)]"},{size:"xs",shape:"round",className:"rounded-[var(--function-button-xs-round)]"},{size:"xxs",shape:"round",className:"rounded-[var(--function-button-xxs-round)]"},{size:"lg",shape:"capsule",className:"rounded-[var(--function-button-l-capsule)]"},{size:"md",shape:"capsule",className:"rounded-[var(--function-button-m-capsule)]"},{size:"sm",shape:"capsule",className:"rounded-[var(--function-button-s-capsule)]"},{size:"xxs",shape:"capsule",className:"rounded-[var(--function-button-xxs-capsule)]"},{size:"xs",shape:"capsule",className:"rounded-[var(--function-button-xs-capsule)]"},{variant:"solid",disabled:!0,className:["pointer-events-none","bg-action-button-solid-disabled border-action-button-solid-disabled text-action-button-solid-disabled fill-action-button-solid-disabled"]},{variant:"outline",disabled:!0,className:["pointer-events-none","bg-action-button-outline-disabled text-action-button-outline-disabled fill-action-button-outline-disabled ring-[var(--action-button-outline-disabled-border)]"]},{variant:"icon",disabled:!0,className:["pointer-events-none","bg-action-button-icon-disabled border-action-button-icon-disabled text-action-button-icon-disabled fill-action-button-icon-disabled"]}],defaultVariants:{size:"md",variant:"solid",shape:"round",disabled:!1,active:!1}}),Zk=n(((e,t)=>{var{children:n,disabled:r,active:o,className:a,size:i,shape:l,variant:s}=e,c=IC(e,["children","disabled","active","className","size","shape","variant"]);const d=Dk({size:i,shape:l,variant:s,active:o,disabled:r});return E("button",Object.assign({},c,{ref:t,type:"button","aria-disabled":r||void 0,disabled:r,tabIndex:r?-1:0,className:LC(".action-button",d,a),children:n}))})),Vk=({tabs:e=[],value:t,initialTab:n=0,tabBarSize:o=38,enableBorderLine:a=!0,enableAddTabButton:i=!1,keepIconSpace:l=!1,disabled:s=!1,keepMounted:u=!1,tabMode:f="start",className:h,tabBarClassName:m,tabBarContainerClassName:p,tabBarWrapperClassName:g,tabButtonClassName:v,tabButtonActiveClassName:w,tabButtonActiveDisableClassName:b,tabButtonDisableClassName:y,tabContentClassName:x,addTabButtonWrapperClassName:k,borderSliderClassName:M,leftAction:R,rightAction:I,onAddTab:O,onTabChange:A})=>{var L;const[S,N]=c(n),[j,D]=c(null),[Z,V]=c({width:"0px",transform:"translateX(0px)"}),T=r([]),B=r(!0);d((()=>{void 0!==t&&N(t)}),[t]);const F=()=>{const e=T.current[S];e&&V({width:`${e.offsetWidth}px`,transform:`translateX(${e.offsetLeft}px)`})};return d((()=>{let e;if(B.current){B.current=!1;const t=T.current[S];t&&(V({width:"0px",transform:`translateX(${t.offsetLeft+t.offsetWidth/2}px)`}),e=setTimeout((()=>{F()}),50))}else F();const t=()=>{F()};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),e&&clearTimeout(e)}}),[S,e,f,l]),C("div",{className:LC("w-full",h),children:[C("div",{className:LC(" relative flex flex-row w-full",{"border-b-[1px] border-base-stroke":a,"border-state-disable-outline":s,"flex-1":"justify"===f},p),children:[R,E("div",{className:LC("relative flex flex-row overflow-x-auto",{"flex-1":"justify"===f},g),children:C("div",{className:LC("tabs-scrollbar overflow-x-auto w-full",`relative flex gap-3 h-[${o}px] box-border`,{"gap-0":"justify"===f},m),style:{justifyContent:"justify"===f?"stretch":f},role:"tablist",children:[e.map(((e,t)=>{var n,r,o,a,i,c,d,u;return C("button",{ref:e=>T.current[t]=e,role:"tab","aria-selected":t===S,"aria-controls":`tab-content-${t}`,disabled:s||e.disabled,id:`tab-${t}`,className:LC("group relative flex justify-center flex-row items-center py-3 cursor-pointer transition-colors duration-300 box-border gap-1 flex-shrink-0 typography-subtitle6",{"text-text-contrast-max":t===S,"text-text-g-contrast-medium":t!==S,"text-state-disable-outline pointer-events-none":s||e.disabled,[null!==(r=null!==(n=e.disableClassName)&&void 0!==n?n:y)&&void 0!==r?r:""]:s||e.disabled,"text-state-disable-outline":t===S&&(s||e.disabled),[null!==(a=null!==(o=e.activeDisableClassName)&&void 0!==o?o:b)&&void 0!==a?a:""]:t===S&&(s||e.disabled),[null!==(c=null!==(i=e.className)&&void 0!==i?i:v)&&void 0!==c?c:""]:!0,[null!==(u=null!==(d=e.activeClassName)&&void 0!==d?d:w)&&void 0!==u?u:""]:t===S,"flex-1":"justify"===f}),onClick:()=>{N(t),null==A||A(t)},onMouseEnter:()=>D(t),onMouseLeave:()=>D(null),children:[(l||e.startTabContent)&&E("div",{className:"h-full w-3 flex items-center justify-center [&_svg]:size-3 [&_svg]:stroke-current [&_svg]:text-current",children:e.isLoading?E(SC,{size:12}):e.startTabContent}),e.label,(l||e.endTabContent)&&E("div",{className:"h-full w-3 flex items-center justify-center [&_svg]:size-3 [&_svg]:stroke-current [&_svg]:text-current",children:e.endTabContent}),!s&&!e.disabled&&t!==S&&E("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-[1px] bg-function-default-hover opacity-0 transition-opacity duration-150 group-hover:opacity-100"})]},t)})),E("div",{className:LC("absolute left-0 bottom-0 h-[2px] rounded-[1px] bg-function-active-solid transition-all duration-300 ease-in-out",{hidden:s||(null===(L=e[S])||void 0===L?void 0:L.disabled),"bg-function-active-hover":j===S&&!s},M),style:Z})]})}),i&&E("div",{className:LC("sticky right-0 flex content-center items-center mx-4",k),children:E(Zk,{variant:"outline",size:"sm",onClick:()=>null==O?void 0:O(),disabled:s,children:E(Ek,{name:"plus"})})}),I]}),E("div",{className:LC("mt-4 text-text-g-contrast-high",x),role:"tabpanel",id:`tab-content-${S}`,"aria-labelledby":`tab-${S}`,children:e.map(((e,t)=>{var n;return u||S===t?E("div",{className:"transition "+(S===t?"block":"hidden"),children:e.content},null!==(n=e.id)&&void 0!==n?n:t):null}))})]})},Tk="undefined"!=typeof document?t.useLayoutEffect:()=>{};const Bk=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},Fk=e=>{if(e&&"window"in e&&e.window===e)return e;return Bk(e).defaultView||window};function Pk(e){let t=null;return()=>(null==t&&(t=e()),t)}const Hk=Pk((function(){return function(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}(/^Mac/i)})),_k=Pk((function(){return function(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}(/Android/i)}));class Wk{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function zk(e){let t=r({isFocused:!1,observer:null});Tk((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]);let n=function(e){const t=r(null);return Tk((()=>{t.current=e}),[e]),o(((...e)=>{const n=t.current;return null==n?void 0:n(...e)}),[])}((t=>{null==e||e(t)}));return o((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,o=e=>{t.current.isFocused=!1,r.disabled&&n(new Wk("blur",e)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver((()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}})),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}}),[n])}let $k=null,Uk=new Set,qk=new Map,Gk=!1,Yk=!1;const Kk={Tab:!0,Escape:!0};function Xk(e,t){for(let n of Uk)n(e,t)}function Qk(e){Gk=!0,function(e){return!(e.metaKey||!Hk()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&($k="keyboard",Xk("keyboard",e))}function Jk(e){$k="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Gk=!0,Xk("pointer",e))}function eM(e){var t;(0===(t=e).mozInputSource&&t.isTrusted||(_k()&&t.pointerType?"click"===t.type&&1===t.buttons:0===t.detail&&!t.pointerType))&&(Gk=!0,$k="virtual")}function tM(e){e.target!==window&&e.target!==document&&(Gk||Yk||($k="virtual",Xk("virtual",e)),Gk=!1,Yk=!1)}function nM(){Gk=!1,Yk=!0}function rM(e){if("undefined"==typeof window||qk.get(Fk(e)))return;const t=Fk(e),n=Bk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Gk=!0,r.apply(this,arguments)},n.addEventListener("keydown",Qk,!0),n.addEventListener("keyup",Qk,!0),n.addEventListener("click",eM,!0),t.addEventListener("focus",tM,!0),t.addEventListener("blur",nM,!1),"undefined"!=typeof PointerEvent?(n.addEventListener("pointerdown",Jk,!0),n.addEventListener("pointermove",Jk,!0),n.addEventListener("pointerup",Jk,!0)):(n.addEventListener("mousedown",Jk,!0),n.addEventListener("mousemove",Jk,!0),n.addEventListener("mouseup",Jk,!0)),t.addEventListener("beforeunload",(()=>{oM(e)}),{once:!0}),qk.set(t,{focus:r})}const oM=(e,t)=>{const n=Fk(e),r=Bk(e);t&&r.removeEventListener("DOMContentLoaded",t),qk.has(n)&&(n.HTMLElement.prototype.focus=qk.get(n).focus,r.removeEventListener("keydown",Qk,!0),r.removeEventListener("keyup",Qk,!0),r.removeEventListener("click",eM,!0),n.removeEventListener("focus",tM,!0),n.removeEventListener("blur",nM,!1),"undefined"!=typeof PointerEvent?(r.removeEventListener("pointerdown",Jk,!0),r.removeEventListener("pointermove",Jk,!0),r.removeEventListener("pointerup",Jk,!0)):(r.removeEventListener("mousedown",Jk,!0),r.removeEventListener("mousemove",Jk,!0),r.removeEventListener("mouseup",Jk,!0)),qk.delete(n))};function aM(){return"pointer"!==$k}"undefined"!=typeof document&&function(e){const t=Bk(e);let n;"loading"!==t.readyState?rM(e):(n=()=>{rM(e)},t.addEventListener("DOMContentLoaded",n))}();const iM=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function lM(e,t,n){rM(),d((()=>{let t=(t,r)=>{(function(e,t,n){var r;const o="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,a="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLElement:HTMLElement,l="undefined"!=typeof window?Fk(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent;return!((e=e||(null==n?void 0:n.target)instanceof o&&!iM.has(null==n||null===(r=n.target)||void 0===r?void 0:r.type)||(null==n?void 0:n.target)instanceof a||(null==n?void 0:n.target)instanceof i&&(null==n?void 0:n.target.isContentEditable))&&"keyboard"===t&&n instanceof l&&!Kk[n.key])})(!!(null==n?void 0:n.isTextInput),t,r)&&e(aM())};return Uk.add(t),()=>{Uk.delete(t)}}),t)}let sM=!1,cM=0;function dM(){sM=!0,setTimeout((()=>{sM=!1}),50)}function uM(e){"touch"===e.pointerType&&dM()}function fM(){if("undefined"!=typeof document)return"undefined"!=typeof PointerEvent?document.addEventListener("pointerup",uM):document.addEventListener("touchend",dM),cM++,()=>{cM--,cM>0||("undefined"!=typeof PointerEvent?document.removeEventListener("pointerup",uM):document.removeEventListener("touchend",dM))}}function hM(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:o,isDisabled:a}=e,[i,l]=c(!1),u=r({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d(fM,[]);let{hoverProps:f,triggerHoverEnd:h}=s((()=>{let e=(e,r)=>{if(u.pointerType=r,a||"touch"===r||u.isHovered||!e.currentTarget.contains(e.target))return;u.isHovered=!0;let o=e.currentTarget;u.target=o,t&&t({type:"hoverstart",target:o,pointerType:r}),n&&n(!0),l(!0)},r=(e,t)=>{if(u.pointerType="",u.target=null,"touch"===t||!u.isHovered)return;u.isHovered=!1;let r=e.currentTarget;o&&o({type:"hoverend",target:r,pointerType:t}),n&&n(!1),l(!1)},i={};return"undefined"!=typeof PointerEvent?(i.onPointerEnter=t=>{sM&&"mouse"===t.pointerType||e(t,t.pointerType)},i.onPointerLeave=e=>{!a&&e.currentTarget.contains(e.target)&&r(e,e.pointerType)}):(i.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},i.onMouseEnter=t=>{u.ignoreEmulatedMouseEvents||sM||e(t,"mouse"),u.ignoreEmulatedMouseEvents=!1},i.onMouseLeave=e=>{!a&&e.currentTarget.contains(e.target)&&r(e,"mouse")}),{hoverProps:i,triggerHoverEnd:r}}),[t,n,o,a,u]);return d((()=>{a&&h({currentTarget:u.target},u.pointerType)}),[a]),{hoverProps:f,isHovered:i}}function mM(e={}){let{autoFocus:t=!1,isTextInput:n,within:a}=e,i=r({isFocused:!1,isFocusVisible:t||aM()}),[l,s]=c(!1),[d,u]=c((()=>i.current.isFocused&&i.current.isFocusVisible)),f=o((()=>u(i.current.isFocused&&i.current.isFocusVisible)),[]),h=o((e=>{i.current.isFocused=e,s(e),f()}),[f]);lM((e=>{i.current.isFocusVisible=e,f()}),[],{isTextInput:n});let{focusProps:m}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:a}=e;const i=o((e=>{if(e.target===e.currentTarget)return r&&r(e),a&&a(!1),!0}),[r,a]),l=zk(i),s=o((e=>{const t=Bk(e.target);e.target===e.currentTarget&&t.activeElement===e.target&&(n&&n(e),a&&a(!0),l(e))}),[a,n,l]);return{focusProps:{onFocus:!t&&(n||a||r)?s:void 0,onBlur:t||!r&&!a?void 0:i}}}({isDisabled:a,onFocusChange:h}),{focusWithinProps:p}=function(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:a,onFocusWithinChange:i}=e,l=r({isFocusWithin:!1}),s=o((e=>{l.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(l.current.isFocusWithin=!1,n&&n(e),i&&i(!1))}),[n,i,l]),c=zk(s),d=o((e=>{l.current.isFocusWithin||document.activeElement!==e.target||(a&&a(e),i&&i(!0),l.current.isFocusWithin=!0,c(e))}),[a,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:s}}}({isDisabled:!a,onFocusWithinChange:h});return{isFocused:l,isFocusVisible:d,focusProps:a?p:m}}var pM=Object.defineProperty,gM=(e,t,n)=>(((e,t,n)=>{t in e?pM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let vM=new class{constructor(){gM(this,"current",this.detect()),gM(this,"handoffState","pending"),gM(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function wM(e){return vM.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function bM(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function yM(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add((()=>e.removeEventListener(n,r,o)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return bM((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=yM();return e(t),this.add((()=>t.dispose()))},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function xM(){let[e]=c(yM);return d((()=>()=>e.dispose()),[e]),e}let EM=(e,t)=>{vM.isServer?d(e,t):f(e,t)};function CM(e){let t=r(e);return EM((()=>{t.current=e}),[e]),t}let kM=function(e){let n=CM(e);return t.useCallback(((...e)=>n.current(...e)),[n])};let MM=i(void 0);function RM(){return a(MM)}function IM(...e){return Array.from(new Set(e.flatMap((e=>"string"==typeof e?e.split(" "):[])))).filter(Boolean).join(" ")}function OM(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,OM),r}var AM=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(AM||{}),LM=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(LM||{});function SM(){let e=function(){let e=r([]),t=o((t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)}),[]);return(...n)=>{if(!n.every((e=>null==e)))return e.current=n,t}}();return o((t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:a=!0,name:i,mergeRefs:l}){l=null!=l?l:jM;let s=DM(t,e);if(a)return NM(s,n,r,i,l);let c=null!=o?o:0;if(2&c){let{static:e=!1,...t}=s;if(e)return NM(t,n,r,i,l)}if(1&c){let{unmount:e=!0,...t}=s;return OM(e?0:1,{0:()=>null,1:()=>NM({...t,hidden:!0,style:{display:"none"}},n,r,i,l)})}return NM(s,n,r,i,l)}({mergeRefs:e,...t})),[e])}function NM(e,t={},n,r,o){let{as:a=n,children:i,refName:s="ref",...c}=BM(e,["unmount","static"]),d=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof i?i(t):i;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)));if(e){f["data-headlessui-state"]=n.join(" ");for(let e of n)f[`data-${e}`]=""}}if(a===h&&(Object.keys(TM(c)).length>0||Object.keys(TM(f)).length>0)){if(m(u)&&!(Array.isArray(u)&&u.length>1)){let e=u.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>IM(t(...e),c.className):IM(t,c.className),r=n?{className:n}:{},a=DM(u.props,TM(BM(c,["ref"])));for(let e in f)e in a&&delete f[e];return p(u,Object.assign({},a,f,d,{ref:o(FM(u),d.ref)},r))}if(Object.keys(TM(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(TM(c)).concat(Object.keys(TM(f))).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"))}return l(a,Object.assign({},BM(c,["ref"]),a!==h&&d,a!==h&&f),u)}function jM(...e){return e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function DM(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ZM(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function VM(e){var t;return Object.assign(n(e),{displayName:null!=(t=e.displayName)?t:e.name})}function TM(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function BM(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function FM(e){return t.version.split(".")[0]>="19"?e.props.ref:e.ref}function PM(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))_M(n,HM(t,r),o);return n}function HM(e,t){return e?e+"["+t+"]":t}function _M(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())_M(e,HM(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):PM(n,t,e)}var WM=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(WM||{});let zM=VM((function(e,t){var n;let{features:r=1,...o}=e,a={ref:t,"aria-hidden":!(2&~r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return SM()({ourProps:a,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})})),$M=i(null);function UM({children:e}){let n=a($M);if(!n)return t.createElement(t.Fragment,null,e);let{target:r}=n;return r?A(t.createElement(t.Fragment,null,e),r):null}function qM({data:e,form:n,disabled:r,onReset:o,overrides:a}){let[i,l]=c(null),s=xM();return d((()=>{if(o&&i)return s.addEventListener(i,"reset",o)}),[i,n,o]),t.createElement(UM,null,t.createElement(GM,{setForm:l,formId:n}),PM(e).map((([e,o])=>t.createElement(zM,{features:WM.Hidden,...TM({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:n,disabled:r,name:e,value:o,...a})}))))}function GM({setForm:e,formId:n}){return d((()=>{if(n){let t=document.getElementById(n);t&&e(t)}}),[e,n]),n?null:t.createElement(zM,{features:WM.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest("form");n&&e(n)}})}let YM=i(void 0);function KM(){return a(YM)}function XM(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}let QM=Symbol();function JM(...e){let t=r(e);d((()=>{t.current=e}),[e]);let n=kM((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[QM])))?void 0:n}let eR=i(null);function tR(){let e=a(eR);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,tR),e}return e}eR.displayName="DescriptionContext";let nR=VM((function(e,t){let n=g(),r=RM(),{id:o=`headlessui-description-${n}`,...a}=e,i=tR(),l=JM(t);EM((()=>i.register(o)),[o,i.register]);let c=r||!1,d=s((()=>({...i.slot,disabled:c})),[i.slot,c]),u={ref:l,...i.props,id:o};return SM()({ourProps:u,theirProps:a,slot:d,defaultTag:"p",name:i.name||"Description"})}));Object.assign(nR,{});var rR=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(rR||{});let oR=i(null);function aR(){let e=a(oR);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,aR),e}return e}function iR(e){var t,n,r;let o=null!=(n=null==(t=a(oR))?void 0:t.value)?n:void 0;return(null!=(r=null==e?void 0:e.length)?r:0)>0?[o,...e].filter(Boolean).join(" "):o}oR.displayName="LabelContext";let lR=VM((function(e,t){var n;let r=g(),o=aR(),a=KM(),i=RM(),{id:l=`headlessui-label-${r}`,htmlFor:c=(null!=a?a:null==(n=o.props)?void 0:n.htmlFor),passive:d=!1,...u}=e,f=JM(t);EM((()=>o.register(l)),[l,o.register]);let h=kM((e=>{let t=e.currentTarget;if(t instanceof HTMLLabelElement&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),t instanceof HTMLLabelElement){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let n=e.getAttribute("aria-disabled");if("true"===n||""===n)return;(e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}})),m=i||!1,p=s((()=>({...o.slot,disabled:m})),[o.slot,m]),v={ref:f,...o.props,id:l,htmlFor:c,onClick:h};return d&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in u&&delete u.onClick),SM()({ourProps:v,theirProps:u,slot:p,defaultTag:c?"label":"div",name:o.name||"Label"})})),sR=Object.assign(lR,{});function cR(e,t,n){let r,o=n.initialDeps??[];return()=>{var a,i,l,s;let c;n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(c=Date.now());const d=e(),u=d.length!==o.length||d.some(((e,t)=>o[t]!==e));if(!u)return r;let f;if(o=d,n.key&&(null==(i=n.debug)?void 0:i.call(n))&&(f=Date.now()),r=t(...d),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-f))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(s=null==n?void 0:n.onChange)||s.call(n,r),r}}function dR(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const uR=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,o)),n)}},fR=e=>e,hR=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},mR=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void o({width:e.inlineSize,height:e.blockSize})}o(n.getBoundingClientRect())}));return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},pR={passive:!0},gR="undefined"==typeof window||"onscrollend"in window,vR=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const a=e.options.useScrollendEvent&&gR?()=>{}:uR(r,(()=>{t(o,!1)}),e.options.isScrollingResetDelay),i=r=>()=>{const{horizontal:i,isRtl:l}=e.options;o=i?n.scrollLeft*(l?-1:1):n.scrollTop,a(),t(o,r)},l=i(!0),s=i(!1);return s(),n.addEventListener("scroll",l,pR),n.addEventListener("scrollend",s,pR),()=>{n.removeEventListener("scroll",l),n.removeEventListener("scrollend",s)}},wR=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},bR=(e,{adjustments:t=0,behavior:n},r)=>{var o,a;const i=e+t;null==(a=null==(o=r.scrollElement)?void 0:o.scrollTo)||a.call(o,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class yR{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{this._measureElement(e.target,e)}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fR,rangeExtractor:hR,onChange:()=>{},measureElement:wR,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=cR((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=cR((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o})),{key:!1}),this.getMeasurements=cR((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,i);for(let o=i;o<e;o++){const e=r(o),i=1===this.options.lanes?l[o-1]:this.getFurthestMeasurement(l,o),s=i?i.end+this.options.gap:t+n,c=a.get(e),d="number"==typeof c?c:this.options.estimateSize(o),u=s+d,f=i?i.lane:o%this.options.lanes;l[o]={index:o,start:s,size:d,end:u,key:e,lane:f}}return this.measurementsCache=l,l}),{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=cR((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=t=>e[t].start,a=xR(0,r,o,n);let i=a;for(;i<r&&e[i].end<n+t;)i++;return{startIndex:a,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:n}):null),{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=cR((()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count]),((e,t,n,r)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r})),{key:"production"!==process.env.NODE_ENV&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const o=r.key,a=this.elementsCache.get(o);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug&&console.info("correction",r),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=cR((()=>[this.getIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n}),{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return dR(t[xR(0,t.length-1,(e=>dR(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize(),r=this.getScrollOffset();"auto"===t&&(t=e<=r?"start":e>=r+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));const o=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(n.end>=o+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}const a="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[o,a]=r;this._scrollToOffset(o,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[t]=dR(this.getOffsetForIndex(e,a));((e,t)=>Math.abs(e-t)<1)(t,this.getScrollOffset())||this.scrollToIndex(e,{align:a,behavior:n})}else this.scrollToIndex(e,{align:a,behavior:n})})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;return n=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map((e=>e.end))),Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const xR=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<r)e=o+1;else{if(!(a>r))return o;t=o-1}}return e>0?e-1:0};const ER="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function CR(t){return function(t){const n=e.useReducer((()=>({})),{})[1],r={...t,onChange:(e,r)=>{var o;r?L(n):n(),null==(o=t.onChange)||o.call(t,e,r)}},[o]=e.useState((()=>new yR(r)));return o.setOptions(r),ER((()=>o._didMount()),[]),ER((()=>o._willUpdate())),o}({observeElementRect:mR,observeElementOffset:vR,scrollToFn:bR,...t})}function kR(e,t){return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&"id"in e&&"id"in t?e.id===t.id:e===t}function MR(e,t=!1){let[n,r]=v((()=>({})),{}),o=s((()=>function(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}(e)),[e,n]);return EM((()=>{if(!e)return;let t=new ResizeObserver(r);return t.observe(e),()=>{t.disconnect()}}),[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let RR=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};function IR(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let a=t[e].call(n,...o);a&&(n=a,r.forEach((e=>e())))}}}function OR(e){return w(e.subscribe,e.getSnapshot,e.getSnapshot)}let AR=new RR((()=>IR((()=>[]),{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(-1===t)return this;let n=this.slice();return n.splice(t,1),n}})));function LR(e,t){let n=AR.get(t),r=g(),o=OR(n);if(EM((()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)}),[n,e]),!e)return!1;let a=o.indexOf(r),i=o.length;return-1===a&&(a=i,i+=1),a===i-1}let SR=new Map,NR=new Map;function jR(e){var t;let n=null!=(t=NR.get(e))?t:0;return NR.set(e,n+1),0!==n||(SR.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>DR(e)}function DR(e){var t;let n=null!=(t=NR.get(e))?t:1;if(1===n?NR.delete(e):NR.set(e,n-1),1!==n)return;let r=SR.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,SR.delete(e))}function ZR(e,{allowed:t,disallowed:n}={}){let r=LR(e,"inert-others");EM((()=>{var e,o;if(!r)return;let a=yM();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&a.add(jR(t));let i=null!=(o=null==t?void 0:t())?o:[];for(let e of i){if(!e)continue;let t=wM(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)i.some((t=>e.contains(t)))||a.add(jR(e));n=n.parentElement}}return a.dispose}),[r,t,n])}let VR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var TR=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(TR||{}),BR=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(BR||{}),FR=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(FR||{}),PR=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(PR||{});var HR=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(HR||{});function _R(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function WR(){return _R()||/Android/gi.test(window.navigator.userAgent)}function zR(e,t,n,r){let o=CM(n);d((()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){o.current(e)}}),[e,t,r])}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));function $R(e,t,n){let a=LR(e,"outside-click"),i=CM(n),l=o((function(e,n){if(e.defaultPrevented)return;let r=n(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of o)if(null!==t&&(t.contains(r)||e.composed&&e.composedPath().includes(t)))return;return!function(e,t=0){var n;return e!==(null==(n=wM(e))?void 0:n.body)&&OM(t,{0:()=>e.matches(VR),1(){let t=e;for(;null!==t;){if(t.matches(VR))return!0;t=t.parentElement}return!1}})}(r,PR.Loose)&&-1!==r.tabIndex&&e.preventDefault(),i.current(e,r)}),[i,t]),s=r(null);zR(a,"pointerdown",(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),zR(a,"mousedown",(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),zR(a,"click",(e=>{WR()||s.current&&(l(e,(()=>s.current)),s.current=null)}),!0);let c=r({x:0,y:0});zR(a,"touchstart",(e=>{c.current.x=e.touches[0].clientX,c.current.y=e.touches[0].clientY}),!0),zR(a,"touchend",(e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-c.current.x)>=30||Math.abs(n-c.current.y)>=30))return l(e,(()=>e.target instanceof HTMLElement?e.target:null))}),!0),function(e,t,n,r){let o=CM(n);d((()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){o.current(e)}}),[e,t,r])}(a,"blur",(e=>l(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}function UR(...e){return s((()=>wM(...e)),[...e])}function qR(e){let t=r({value:"",selectionStart:null,selectionEnd:null});return function(e,t,n,r){let o=CM(n);d((()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}(e,"blur",(e=>{let n=e.target;n instanceof HTMLInputElement&&(t.current={value:n.value,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})})),kM((()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;null!==n&&null!==r&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}}))}function GR(e,t){return s((()=>{var n;if(e.type)return e.type;let r=null!=(n=e.as)?n:"button";return"string"==typeof r&&"button"===r.toLowerCase()||"BUTTON"===(null==t?void 0:t.tagName)&&!t.hasAttribute("type")?"button":void 0}),[e.type,e.as,t])}function YR(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-o);n.style(r,"paddingRight",`${a}px`)}}}function KR(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let XR=IR((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:yM(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:KR(n)},o=[_R()?{before({doc:e,d:t,meta:n}){function r(e){return n.containers.flatMap((e=>e())).some((t=>t.contains(e)))}t.microTask((()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=yM();n.style(e.documentElement,"scrollBehavior","auto"),t.add((()=>t.microTask((()=>n.dispose()))))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,a=null;t.addEventListener(e,"click",(t=>{if(t.target instanceof HTMLElement)try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),i=e.querySelector(o);i&&!r(i)&&(a=i)}catch{}}),!0),t.addEventListener(e,"touchstart",(e=>{if(e.target instanceof HTMLElement)if(r(e.target)){let n=e.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;t.style(n,"overscrollBehavior","contain")}else t.style(e.target,"touchAction","none")})),t.addEventListener(e,"touchmove",(e=>{if(e.target instanceof HTMLElement){if("INPUT"===e.target.tagName)return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)}))}))}}:{},YR(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];o.forEach((({before:e})=>null==e?void 0:e(r))),o.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function QR(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=OR(XR),o=t?r.get(t):void 0,a=!!o&&o.count>0;EM((()=>{if(t&&e)return XR.dispatch("PUSH",t,n),()=>XR.dispatch("POP",t,n)}),[e,t])}(LR(e,"scroll-lock"),t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}function JR(e){return[e.screenX,e.screenY]}var eI,tI;XR.subscribe((()=>{let e=XR.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&XR.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&XR.dispatch("TEARDOWN",n)}})),"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(eI=null==process?void 0:process.env)?void 0:eI.NODE_ENV)&&void 0===(null==(tI=null==Element?void 0:Element.prototype)?void 0:tI.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var nI=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(nI||{});function rI(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function oI(e,t,n,a){let[i,l]=c(n),{hasFlag:s,addFlag:d,removeFlag:u}=function(e=0){let[t,n]=c(e),r=o((e=>n(e)),[t]),a=o((e=>n((t=>t|e))),[t]),i=o((e=>(t&e)===e),[t]),l=o((e=>n((t=>t&~e))),[n]),s=o((e=>n((t=>t^e))),[n]);return{flags:t,setFlag:r,addFlag:a,hasFlag:i,removeFlag:l,toggleFlag:s}}(e&&i?3:0),f=r(!1),h=r(!1),m=xM();return EM((()=>{if(e)return n&&l(!0),t?(null==void 0||undefined.call(a,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let a=yM();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),a.nextFrame((()=>{n(),a.requestAnimationFrame((()=>{a.add(function(e,t){var n,r;let o=yM();if(!e)return o.dispose;let a=!1;o.add((()=>{a=!0}));let i=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter((e=>e instanceof CSSTransition)))?r:[];return 0===i.length?(t(),o.dispose):(Promise.allSettled(i.map((e=>e.finished))).then((()=>{a||t()})),o.dispose)}(e,r))}))})),a.dispose}(t,{inFlight:f,prepare(){h.current?h.current=!1:h.current=f.current,f.current=!0,!h.current&&(n?(d(3),u(4)):(d(4),u(2)))},run(){h.current?n?(u(3),d(4)):(u(4),d(3)):n?u(1):d(1)},done(){h.current&&"function"==typeof t.getAnimations&&t.getAnimations().length>0||(f.current=!1,u(7),n||l(!1),null==void 0||undefined.call(a,n))}})):void(n&&d(3))}),[e,n,t,m]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function aI(e,t){let n=r([]),o=kM(e);d((()=>{let e=[...n.current];for(let[r,a]of t.entries())if(n.current[r]!==a){let r=o(t,e);return n.current=t,r}}),[o,...t])}function iI(){return"undefined"!=typeof window}function lI(e){return dI(e)?(e.nodeName||"").toLowerCase():"#document"}function sI(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cI(e){var t;return null==(t=(dI(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function dI(e){return!!iI()&&(e instanceof Node||e instanceof sI(e).Node)}function uI(e){return!!iI()&&(e instanceof Element||e instanceof sI(e).Element)}function fI(e){return!!iI()&&(e instanceof HTMLElement||e instanceof sI(e).HTMLElement)}function hI(e){return!(!iI()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof sI(e).ShadowRoot)}function mI(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yI(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pI(e){return["table","td","th"].includes(lI(e))}function gI(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function vI(e){const t=wI(),n=uI(e)?yI(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function wI(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function bI(e){return["html","body","#document"].includes(lI(e))}function yI(e){return sI(e).getComputedStyle(e)}function xI(e){return uI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function EI(e){if("html"===lI(e))return e;const t=e.assignedSlot||e.parentNode||hI(e)&&e.host||cI(e);return hI(t)?t.host:t}function CI(e){const t=EI(e);return bI(t)?e.ownerDocument?e.ownerDocument.body:e.body:fI(t)&&mI(t)?t:CI(t)}function kI(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=CI(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=sI(o);if(a){const e=MI(i);return t.concat(i,i.visualViewport||[],mI(o)?o:[],e&&n?kI(e):[])}return t.concat(o,kI(o,[],n))}function MI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const RI=["top","right","bottom","left"],II=Math.min,OI=Math.max,AI=Math.round,LI=Math.floor,SI=e=>({x:e,y:e}),NI={left:"right",right:"left",bottom:"top",top:"bottom"},jI={start:"end",end:"start"};function DI(e,t,n){return OI(e,II(t,n))}function ZI(e,t){return"function"==typeof e?e(t):e}function VI(e){return e.split("-")[0]}function TI(e){return e.split("-")[1]}function BI(e){return"x"===e?"y":"x"}function FI(e){return"y"===e?"height":"width"}function PI(e){return["top","bottom"].includes(VI(e))?"y":"x"}function HI(e){return BI(PI(e))}function _I(e){return e.replace(/start|end/g,(e=>jI[e]))}function WI(e){return e.replace(/left|right|bottom|top/g,(e=>NI[e]))}function zI(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function $I(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function UI(e,t,n){let{reference:r,floating:o}=e;const a=PI(t),i=HI(t),l=FI(i),s=VI(t),c="y"===a,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let h;switch(s){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(TI(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1)}return h}async function qI(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=ZI(t,e),m=zI(h),p=l[f?"floating"===u?"reference":"floating":u],g=$I(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(p)))||n?p:p.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:s})),v="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l.floating)),b=await(null==a.isElement?void 0:a.isElement(w))&&await(null==a.getScale?void 0:a.getScale(w))||{x:1,y:1},y=$I(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:s}):v);return{top:(g.top-y.top+m.top)/b.y,bottom:(y.bottom-g.bottom+m.bottom)/b.y,left:(g.left-y.left+m.left)/b.x,right:(y.right-g.right+m.right)/b.x}}function GI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YI(e){return RI.some((t=>e[t]>=0))}function KI(e){const t=yI(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=fI(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=AI(n)!==a||AI(r)!==i;return l&&(n=a,r=i),{width:n,height:r,$:l}}function XI(e){return uI(e)?e:e.contextElement}function QI(e){const t=XI(e);if(!fI(t))return SI(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=KI(t);let i=(a?AI(n.width):n.width)/r,l=(a?AI(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const JI=SI(0);function eO(e){const t=sI(e);return wI()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:JI}function tO(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=XI(e);let i=SI(1);t&&(r?uI(r)&&(i=QI(r)):i=QI(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==sI(e))&&t}(a,n,r)?eO(a):SI(0);let s=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=sI(a),t=r&&uI(r)?sI(r):r;let n=e,o=MI(n);for(;o&&r&&t!==n;){const e=QI(o),t=o.getBoundingClientRect(),r=yI(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=a,c+=i,n=sI(o),o=MI(n)}}return $I({width:d,height:u,x:s,y:c})}function nO(e,t){const n=xI(e).scrollLeft;return t?t.left+n:tO(cI(e)).left+n}function rO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:nO(e,r)),y:r.top+t.scrollTop}}function oO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=sI(e),r=cI(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,l=0,s=0;if(o){a=o.width,i=o.height;const e=wI();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:a,height:i,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=cI(e),n=xI(e),r=e.ownerDocument.body,o=OI(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=OI(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+nO(e);const l=-n.scrollTop;return"rtl"===yI(r).direction&&(i+=OI(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:l}}(cI(e));else if(uI(t))r=function(e,t){const n=tO(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=fI(e)?QI(e):SI(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=eO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $I(r)}function aO(e,t){const n=EI(e);return!(n===t||!uI(n)||bI(n))&&("fixed"===yI(n).position||aO(n,t))}function iO(e,t,n){const r=fI(t),o=cI(t),a="fixed"===n,i=tO(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const s=SI(0);if(r||!r&&!a)if(("body"!==lI(t)||mI(o))&&(l=xI(t)),r){const e=tO(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=nO(o));const c=!o||r||a?SI(0):rO(o,l);return{x:i.left+l.scrollLeft-s.x-c.x,y:i.top+l.scrollTop-s.y-c.y,width:i.width,height:i.height}}function lO(e){return"static"===yI(e).position}function sO(e,t){if(!fI(e)||"fixed"===yI(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cI(e)===n&&(n=n.ownerDocument.body),n}function cO(e,t){const n=sI(e);if(gI(e))return n;if(!fI(e)){let t=EI(e);for(;t&&!bI(t);){if(uI(t)&&!lO(t))return t;t=EI(t)}return n}let r=sO(e,t);for(;r&&pI(r)&&lO(r);)r=sO(r,t);return r&&bI(r)&&lO(r)&&!vI(r)?n:r||function(e){let t=EI(e);for(;fI(t)&&!bI(t);){if(vI(t))return t;if(gI(t))return null;t=EI(t)}return null}(e)||n}const dO={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=cI(r),l=!!t&&gI(t.floating);if(r===i||l&&a)return n;let s={scrollLeft:0,scrollTop:0},c=SI(1);const d=SI(0),u=fI(r);if((u||!u&&!a)&&(("body"!==lI(r)||mI(i))&&(s=xI(r)),fI(r))){const e=tO(r);c=QI(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!i||u||a?SI(0):rO(i,s,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-s.scrollTop*c.y+d.y+f.y}},getDocumentElement:cI,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?gI(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=kI(e,[],!1).filter((e=>uI(e)&&"body"!==lI(e))),o=null;const a="fixed"===yI(e).position;let i=a?EI(e):e;for(;uI(i)&&!bI(i);){const t=yI(i),n=vI(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||mI(i)&&!n&&aO(e,i))?r=r.filter((e=>e!==i)):o=t,i=EI(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],l=a.reduce(((e,n)=>{const r=oO(t,n,o);return e.top=OI(r.top,e.top),e.right=II(r.right,e.right),e.bottom=II(r.bottom,e.bottom),e.left=OI(r.left,e.left),e}),oO(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:cO,getElementRects:async function(e){const t=this.getOffsetParent||cO,n=this.getDimensions,r=await n(e.floating);return{reference:iO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=KI(e);return{width:t,height:n}},getScale:QI,isElement:uI,isRTL:function(e){return"rtl"===yI(e).direction}};function uO(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=XI(e),d=o||a?[...c?kI(c):[],...kI(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const u=c&&l?function(e,t){let n,r=null;const o=cI(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),a();const{left:c,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const h={rootMargin:-LI(d)+"px "+-LI(o.clientWidth-(c+u))+"px "+-LI(o.clientHeight-(d+f))+"px "+-LI(c)+"px",threshold:OI(0,II(1,s))||1};let m=!0;function p(e){const t=e[0].intersectionRatio;if(t!==s){if(!m)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(p,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(p,h)}r.observe(e)}(!0),a}(c,n):null;let f,h=-1,m=null;i&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),c&&!s&&m.observe(c),m.observe(t));let p=s?tO(e):null;return s&&function t(){const r=tO(e);!p||r.x===p.x&&r.y===p.y&&r.width===p.width&&r.height===p.height||n();p=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(f)}}const fO=qI,hO=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=VI(n),l=TI(n),s="y"===PI(n),c=["left","top"].includes(i)?-1:1,d=a&&s?-1:1,u=ZI(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof m&&(h="end"===l?-1*m:m),s?{x:h*d,y:f*c}:{x:f*c,y:h*d}}(t,e);return i===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:a+s.y,data:{...s,placement:i}}}}},mO=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=ZI(e,t),c={x:n,y:r},d=await qI(t,s),u=PI(VI(o)),f=BI(u);let h=c[f],m=c[u];if(a){const e="y"===f?"bottom":"right";h=DI(h+d["y"===f?"top":"left"],h,h-d[e])}if(i){const e="y"===u?"bottom":"right";m=DI(m+d["y"===u?"top":"left"],m,m-d[e])}const p=l.fn({...t,[f]:h,[u]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:a,[u]:i}}}}}},pO=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=ZI(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=VI(o),w=PI(l),b=VI(l)===l,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=f||(b||!p?[WI(l)]:function(e){const t=WI(e);return[_I(e),t,_I(t)]}(l)),E="none"!==m;!f&&E&&x.push(...function(e,t,n,r){const o=TI(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}(VI(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(_I)))),a}(l,p,m,y));const C=[l,...x],k=await qI(t,g),M=[];let R=(null==(r=a.flip)?void 0:r.overflows)||[];if(d&&M.push(k[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=TI(e),o=HI(e),a=FI(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=WI(i)),[i,WI(i)]}(o,i,y);M.push(k[e[0]],k[e[1]])}if(R=[...R,{placement:o,overflows:M}],!M.every((e=>e<=0))){var I,O;const e=((null==(I=a.flip)?void 0:I.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(O=R.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!n)switch(h){case"bestFit":{var A;const e=null==(A=R.filter((e=>{if(E){const t=PI(e.placement);return t===w||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},gO=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:l}=t,{apply:s=()=>{},...c}=ZI(e,t),d=await qI(t,c),u=VI(o),f=TI(o),h="y"===PI(o),{width:m,height:p}=a.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=f===(await(null==i.isRTL?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(v=u,g="end"===f?"top":"bottom");const w=p-d.top-d.bottom,b=m-d.left-d.right,y=II(p-d[g],w),x=II(m-d[v],b),E=!t.middlewareData.shift;let C=y,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=w),E&&!f){const e=OI(d.left,0),t=OI(d.right,0),n=OI(d.top,0),r=OI(d.bottom,0);h?k=m-2*(0!==e||0!==t?e+t:OI(d.left,d.right)):C=p-2*(0!==n||0!==r?n+r:OI(d.top,d.bottom))}await s({...t,availableWidth:k,availableHeight:C});const M=await i.getDimensions(l.floating);return m!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},vO=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ZI(e,t);switch(r){case"referenceHidden":{const e=GI(await qI(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:YI(e)}}}case"escaped":{const e=GI(await qI(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:YI(e)}}}default:return{}}}}},wO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:l,middlewareData:s}=t,{element:c,padding:d=0}=ZI(e,t)||{};if(null==c)return{};const u=zI(d),f={x:n,y:r},h=HI(o),m=FI(h),p=await i.getDimensions(c),g="y"===h,v=g?"top":"left",w=g?"bottom":"right",b=g?"clientHeight":"clientWidth",y=a.reference[m]+a.reference[h]-f[h]-a.floating[m],x=f[h]-a.reference[h],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let C=E?E[b]:0;C&&await(null==i.isElement?void 0:i.isElement(E))||(C=l.floating[b]||a.floating[m]);const k=y/2-x/2,M=C/2-p[m]/2-1,R=II(u[v],M),I=II(u[w],M),O=R,A=C-p[m]-I,L=C/2-p[m]/2+k,S=DI(O,L,A),N=!s.arrow&&null!=TI(o)&&L!==S&&a.reference[m]/2-(L<O?R:I)-p[m]/2<0,j=N?L<O?L-O:L-A:0;return{[h]:f[h]+j,data:{[h]:S,centerOffset:L-S-j,...N&&{alignmentOffset:j}},reset:N}}}),bO=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=ZI(e,t),d={x:n,y:r},u=PI(o),f=BI(u);let h=d[f],m=d[u];const p=ZI(l,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(s){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var v,w;const e="y"===f?"width":"height",t=["top","left"].includes(VI(o)),n=a.reference[u]-a.floating[e]+(t&&(null==(v=i.offset)?void 0:v[u])||0)+(t?0:g.crossAxis),r=a.reference[u]+a.reference[e]+(t?0:(null==(w=i.offset)?void 0:w[u])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:h,[u]:m}}}},yO=(e,t,n)=>{const r=new Map,o={platform:dO,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,l=a.filter(Boolean),s=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=UI(c,r,s),f=r,h={},m=0;for(let n=0;n<l.length;n++){const{name:a,fn:p}=l[n],{x:g,y:v,data:w,reset:b}=await p({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,h={...h,[a]:{...h[a],...w}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=UI(c,f,s))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var xO="undefined"!=typeof document?f:d;function EO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!EO(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!EO(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function CO(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kO(e,t){const n=CO(e);return Math.round(t*n)/n}function MO(t){const n=e.useRef(t);return xO((()=>{n.current=t})),n}function RO(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:c,open:d}=t,[u,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);EO(h,o)||m(o);const[p,g]=e.useState(null),[v,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),y=e.useCallback((e=>{e!==k.current&&(k.current=e,w(e))}),[]),x=i||p,E=l||v,C=e.useRef(null),k=e.useRef(null),M=e.useRef(u),R=null!=c,O=MO(c),A=MO(a),L=MO(d),S=e.useCallback((()=>{if(!C.current||!k.current)return;const e={placement:n,strategy:r,middleware:h};A.current&&(e.platform=A.current),yO(C.current,k.current,e).then((e=>{const t={...e,isPositioned:!1!==L.current};N.current&&!EO(M.current,t)&&(M.current=t,I.flushSync((()=>{f(t)})))}))}),[h,n,r,A,L]);xO((()=>{!1===d&&M.current.isPositioned&&(M.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const N=e.useRef(!1);xO((()=>(N.current=!0,()=>{N.current=!1})),[]),xO((()=>{if(x&&(C.current=x),E&&(k.current=E),x&&E){if(O.current)return O.current(x,E,S);S()}}),[x,E,S,O,R]);const j=e.useMemo((()=>({reference:C,floating:k,setReference:b,setFloating:y})),[b,y]),D=e.useMemo((()=>({reference:x,floating:E})),[x,E]),Z=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=kO(D.floating,u.x),n=kO(D.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...CO(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,D.floating,u.x,u.y]);return e.useMemo((()=>({...u,update:S,refs:j,elements:D,floatingStyles:Z})),[u,S,j,D,Z])}const IO=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?wO({element:n.current,padding:r}).fn(t):{}:n?wO({element:n,padding:r}).fn(t):{};var o}}),OO=(e,t)=>({...hO(e),options:[e,t]}),AO=(e,t)=>({...mO(e),options:[e,t]}),LO=(e,t)=>({...bO(e),options:[e,t]}),SO=(e,t)=>({...pO(e),options:[e,t]}),NO=(e,t)=>({...gO(e),options:[e,t]}),jO=(e,t)=>({...vO(e),options:[e,t]}),DO=(e,t)=>({...IO(e),options:[e,t]}),ZO={...e},VO=ZO.useInsertionEffect||(e=>e());function TO(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return VO((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var BO="undefined"!=typeof document?f:d;let FO=!1,PO=0;const HO=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+PO++;const _O=ZO.useId||function(){const[t,n]=e.useState((()=>FO?HO():void 0));return BO((()=>{null==t&&n(HO())}),[]),e.useEffect((()=>{FO=!0}),[]),t};let WO;"production"!==process.env.NODE_ENV&&(WO=new Set);const zO=e.createContext(null),$O=e.createContext(null),UO="data-floating-ui-focusable";function qO(t){const{open:n=!1,onOpenChange:r,elements:o}=t,a=_O(),i=e.useRef({}),[l]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),s=null!=((null==(c=e.useContext(zO))?void 0:c.id)||null);var c;if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!uI(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var a;null!=(e=WO)&&e.has(o)||(null==(a=WO)||a.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=e.useState(o.reference),f=TO(((e,t,n)=>{i.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:s}),null==r||r(e,t,n)})),h=e.useMemo((()=>({setPositionReference:u})),[]),m=e.useMemo((()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference})),[d,o.reference,o.floating]);return e.useMemo((()=>({dataRef:i,open:n,onOpenChange:f,elements:m,events:l,floatingId:a,refs:h})),[n,f,m,l,a,h])}function GO(t){void 0===t&&(t={});const{nodeId:n}=t,r=qO({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,a=o.elements,[i,l]=e.useState(null),[s,c]=e.useState(null),d=(null==a?void 0:a.domReference)||i,u=e.useRef(null),f=e.useContext($O);BO((()=>{d&&(u.current=d)}),[d]);const h=RO({...t,elements:{...a,...s&&{reference:s}}}),m=e.useCallback((e=>{const t=uI(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),p=e.useCallback((e=>{(uI(e)||null===e)&&(u.current=e,l(e)),(uI(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!uI(e))&&h.refs.setReference(e)}),[h.refs]),g=e.useMemo((()=>({...h.refs,setReference:p,setPositionReference:m,domReference:u})),[h.refs,p,m]),v=e.useMemo((()=>({...h.elements,domReference:d})),[h.elements,d]),w=e.useMemo((()=>({...h,...o,refs:g,elements:v,nodeId:n})),[h,g,v,n,o]);return BO((()=>{o.dataRef.current.floatingContext=w;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...h,context:w,refs:g,elements:v})),[h,g,v,w])}const YO="active",KO="selected";function XO(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[YO]:t,[KO]:n,...r}=e;a=r}return{..."floating"===n&&{tabIndex:-1,[UO]:""},...a,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,a]=t;var i;o&&[YO,KO].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=a)})),e):e),{})}}function QO(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const JO=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:c,...d}=ZI(e,t),{rects:u,elements:{floating:f}}=t,h=n.current[i],m=(null==c?void 0:c.current)||f,p=f.clientTop||m.clientTop,g=0!==f.clientTop,v=0!==m.clientTop,w=f===m;if("production"!==process.env.NODE_ENV&&(t.placement.startsWith("bottom")||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var a;null!=(e=WO)&&e.has(o)||(null==(a=WO)||a.add(o),console.warn(o))}('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const b={...t,...await OO(-h.offsetTop-f.clientTop-u.reference.height/2-h.offsetHeight/2-a).fn(t)},y=await fO(QO(b,m.scrollHeight+p+f.clientTop),d),x=await fO(b,{...d,elementContext:"reference"}),E=OI(0,y.top),C=b.y+E,k=m.scrollHeight>m.clientHeight?e=>e:AI,M=k(OI(0,m.scrollHeight+(g&&w||v?2*p:0)-E-OI(0,y.bottom)));if(m.style.maxHeight=M+"px",m.scrollTop=E,o){const e=m.offsetHeight<h.offsetHeight*II(l,n.current.length)-1||x.top>=-s||x.bottom>=-s;I.flushSync((()=>o(e)))}return r&&(r.current=await fO(QO({...b,y:C},m.offsetHeight+p+f.clientTop),d)),{y:C}}});function eA(t,n){const{open:r,elements:o}=t,{enabled:a=!0,overflowRef:i,scrollRef:l,onChange:s}=n,c=TO(s),d=e.useRef(!1),u=e.useRef(null),f=e.useRef(null);e.useEffect((()=>{if(!a)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,a=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),I.flushSync((()=>{c((e=>e+Math[s](n,a*l)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return r&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{u.current=t.scrollTop,null!=i.current&&(f.current={...i.current})})),()=>{u.current=null,f.current=null,t.removeEventListener("wheel",e)}):void 0}),[a,r,o.floating,i,l,c]);const h=e.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(i.current&&e&&d.current){if(null!==u.current){const t=e.scrollTop-u.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&I.flushSync((()=>c((e=>e+t))))}requestAnimationFrame((()=>{u.current=e.scrollTop}))}}})),[o.floating,c,i,l]);return e.useMemo((()=>a?{floating:h}:{}),[a,h])}let tA=i({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tA.displayName="FloatingContext";let nA=i(null);nA.displayName="PlacementContext";function rA({children:t,enabled:n=!0}){let[o,a]=c(null),[i,l]=c(0),d=r(null),[u,f]=c(null);!function(e){EM((()=>{if(!e)return;let t=new MutationObserver((()=>{let t=window.getComputedStyle(e).maxHeight,n=parseFloat(t);if(isNaN(n))return;let r=parseInt(t);isNaN(r)||n!==r&&(e.style.maxHeight=`${Math.ceil(n)}px`)}));return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}}),[e])}(u);let h=n&&null!==o&&null!==u,{to:m="bottom",gap:p=0,offset:g=0,padding:v=0,inner:w}=function(e,t){var n,r,o;let a=oA(null!=(n=null==e?void 0:e.gap)?n:"var(--anchor-gap, 0)",t),i=oA(null!=(r=null==e?void 0:e.offset)?r:"var(--anchor-offset, 0)",t),l=oA(null!=(o=null==e?void 0:e.padding)?o:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:i,padding:l}}(o,u),[b,y="center"]=m.split(" ");EM((()=>{h&&l(0)}),[h]);let{refs:x,floatingStyles:E,context:C}=GO({open:h,placement:"selection"===b?"center"===y?"bottom":`bottom-${y}`:"center"===y?`${b}`:`${b}-${y}`,strategy:"absolute",transform:!1,middleware:[OO({mainAxis:"selection"===b?0:p,crossAxis:g}),AO({padding:v}),"selection"!==b&&SO({padding:v}),"selection"===b&&w?JO({...w,padding:v,overflowRef:d,offset:i,minItemsVisible:4,referenceOverflowThreshold:v,onFallbackChange(e){var t,n;if(!e)return;let r=C.elements.floating;if(!r)return;let o=parseFloat(getComputedStyle(r).scrollPaddingBottom)||0,a=Math.min(4,r.childElementCount),i=0,s=0;for(let e of null!=(n=null==(t=C.elements.floating)?void 0:t.childNodes)?n:[])if(e instanceof HTMLElement){let t=e.offsetTop,n=t+e.clientHeight+o,l=r.scrollTop,c=l+r.clientHeight;if(!(t>=l&&n<=c)){s=Math.max(0,Math.min(n,c)-Math.max(t,l)),i=e.clientHeight;break}a--}a>=1&&l((e=>{let t=i*a-s+o;return e>=t?e:t}))}}):null,NO({padding:v,apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{overflow:"auto",maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:uO}),[k=b,M=y]=C.placement.split("-");"selection"===b&&(k="selection");let R=s((()=>({anchor:[k,M].filter(Boolean).join(" ")})),[k,M]),I=eA(C,{overflowRef:d,onChange:l}),{getReferenceProps:O,getFloatingProps:A}=function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),a=e.useCallback((e=>XO(e,t,"reference")),n),i=e.useCallback((e=>XO(e,t,"floating")),r),l=e.useCallback((e=>XO(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:l})),[a,i,l])}([I]),L=kM((e=>{f(e),x.setFloating(e)}));return e.createElement(nA.Provider,{value:a},e.createElement(tA.Provider,{value:{setFloating:L,setReference:x.setReference,styles:E,getReferenceProps:O,getFloatingProps:A,slot:R}},t))}function oA(e,t,n=void 0){let r=xM(),o=kM(((e,t)=>{if(null==e)return[n,null];if("number"==typeof e)return[e,null];if("string"==typeof e){if(!t)return[n,null];let o=iA(e,t);return[o,n=>{let a=aA(e);{let i=a.map((e=>window.getComputedStyle(t).getPropertyValue(e)));r.requestAnimationFrame((function l(){r.nextFrame(l);let s=!1;for(let[e,n]of a.entries()){let r=window.getComputedStyle(t).getPropertyValue(n);if(i[e]!==r){i[e]=r,s=!0;break}}if(!s)return;let c=iA(e,t);o!==c&&(n(c),o=c)}))}return r.dispose}]}return[n,null]})),a=s((()=>o(e,t)[0]),[e,t]),[i=a,l]=c();return EM((()=>{let[n,r]=o(e,t);if(l(n),r)return r(l)}),[e,t]),i}function aA(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(",");if(-1===e)return[t[1]];let n=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[n,...aA(r)]:[n]}return[]}function iA(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function lA({children:e,freeze:n}){let r=sA(n,e);return t.createElement(t.Fragment,null,r)}function sA(e,t){let[n,r]=c(t);return!e&&n!==t&&r(t),e?n:t}let cA=i(null);cA.displayName="OpenClosedContext";var dA=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(dA||{});function uA({value:e,children:n}){return t.createElement(cA.Provider,{value:e},n)}let fA=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}((()=>{function e(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||fA[0]===e.target)return;let t=e.target;t=t.closest(VR),fA.unshift(null!=t?t:e.target),fA=fA.filter((e=>null!=e&&e.isConnected)),fA.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})}));var hA=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(hA||{});function mA(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:-1===o&&(o=n.length);for(let e=o-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=o+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}var pA=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(pA||{});function gA(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in e&&e.useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!t))}(),[n,r]=e.useState(vM.isHandoffComplete);return n&&!1===vM.isHandoffComplete&&r(!1),e.useEffect((()=>{!0!==n&&r(!0)}),[n]),e.useEffect((()=>vM.handoff()),[]),!t&&n}let vA=i(!1);function wA(){return a(vA)}function bA(e){let t=wA(),n=a(CA),r=UR(e),[o,i]=c((()=>{var e;if(!t&&null!==n)return null!=(e=n.current)?e:null;if(vM.isServer)return null;let o=null==r?void 0:r.getElementById("headlessui-portal-root");if(o)return o;if(null===r)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)}));return d((()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))}),[o,r]),d((()=>{t||null!==n&&i(n.current)}),[n,i,t]),o}let yA=h,xA=VM((function(e,t){let n=e,o=r(null),i=JM(function(e,t=!0){return Object.assign(e,{[QM]:t})}((e=>{o.current=e})),t),l=UR(o),s=bA(o),[u]=c((()=>{var e;return vM.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null})),f=a(kA),h=gA();EM((()=>{!s||!u||s.contains(u)||(u.setAttribute("data-headlessui-portal",""),s.appendChild(u))}),[s,u]),EM((()=>{if(u&&f)return f.register(u)}),[f,u]),function(e){let t=kM(e),n=r(!1);d((()=>(n.current=!1,()=>{n.current=!0,bM((()=>{n.current&&t()}))})),[t])}((()=>{var e;!s||!u||(u instanceof Node&&s.contains(u)&&s.removeChild(u),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))}));let m=SM();return h&&s&&u?A(m({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:yA,name:"Portal"}),u):null}));let EA=h,CA=i(null);let kA=i(null),MA=VM((function(e,n){let r=JM(n),{enabled:o=!0,...a}=e,i=SM();return o?t.createElement(xA,{...a,ref:r}):i({ourProps:{ref:r},theirProps:a,slot:{},defaultTag:yA,name:"Portal"})})),RA=VM((function(e,n){let{target:r,...o}=e,a={ref:JM(n)},i=SM();return t.createElement(CA.Provider,{value:r},i({ourProps:a,theirProps:o,defaultTag:EA,name:"Popover.Group"}))})),IA=Object.assign(MA,{Group:RA});var OA=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(OA||{}),AA=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(AA||{}),LA=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(LA||{}),SA=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(SA||{});function NA(e,t=e=>e){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&null!==r[0].dataRef.current.order?r.sort(((e,t)=>e.dataRef.current.order-t.dataRef.current.order)):function(e,t=e=>e){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}(r,(e=>e.dataRef.current.domRef.current)),a=n?o.indexOf(n):null;return-1===a&&(a=null),{options:o,activeOptionIndex:a}}let jA={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(n=e.dataRef.current)&&n.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3:(e,t)=>e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping},2(e,t){var n,r,o,a;if(null!=(n=e.dataRef.current)&&n.disabled||e.optionsElement&&(null==(r=e.dataRef.current)||!r.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let{options:n,disabled:r}=e.virtual,a=t.focus===hA.Specific?t.idx:mA(t,{resolveItems:()=>n,resolveActiveIndex:()=>{var t,o;return null!=(o=null!=(t=e.activeOptionIndex)?t:n.findIndex((e=>!r(e))))?o:null},resolveDisabled:r,resolveId(){throw new Error("Function not implemented.")}}),i=null!=(o=t.trigger)?o:2;return e.activeOptionIndex===a&&e.activationTrigger===i?e:{...e,activeOptionIndex:a,activationTrigger:i,isTyping:!1,__demoMode:!1}}let i=NA(e);if(null===i.activeOptionIndex){let e=i.options.findIndex((e=>!e.dataRef.current.disabled));-1!==e&&(i.activeOptionIndex=e)}let l=t.focus===hA.Specific?t.idx:mA(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),s=null!=(a=t.trigger)?a:2;return e.activeOptionIndex===l&&e.activationTrigger===s?e:{...e,...i,isTyping:!1,activeOptionIndex:l,activationTrigger:s,__demoMode:!1}},4:(e,t)=>{var n,r,o;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:[...e.options,t.payload]};let a=t.payload,i=NA(e,(e=>(e.push(a),e)));null===e.activeOptionIndex&&null!=(r=e.dataRef.current)&&r.isSelected(t.payload.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(a));let l={...e,...i,activationTrigger:2};return null!=(o=e.dataRef.current)&&o.__demoMode&&void 0===e.dataRef.current.value&&(l.activeOptionIndex=0),l},5:(e,t)=>{var n;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:e.options.filter((e=>e.id!==t.id))};let r=NA(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(null===e.virtual)return{...e,virtual:{options:t.options,disabled:null!=(n=t.disabled)?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(null!==e.activeOptionIndex){let n=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o=-1!==n?n:null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:null!=(r=t.disabled)?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},DA=i(null);function ZA(e){let t=a(DA);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ZA),t}return t}DA.displayName="ComboboxActionsContext";let VA=i(null);function TA(e){let n=FA("VirtualProvider"),{options:r}=n.virtual,[o,a]=s((()=>{let e=n.optionsElement;if(!e)return[0,0];let t=window.getComputedStyle(e);return[parseFloat(t.paddingBlockStart||t.paddingTop),parseFloat(t.paddingBlockEnd||t.paddingBottom)]}),[n.optionsElement]),i=CR({enabled:0!==r.length,scrollPaddingStart:o,scrollPaddingEnd:a,count:r.length,estimateSize:()=>40,getScrollElement:()=>n.optionsElement,overscan:12}),[l,d]=c(0);EM((()=>{d((e=>e+1))}),[r]);let u=i.getVirtualItems();return 0===u.length?null:t.createElement(VA.Provider,{value:i},t.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:e=>{e&&0!==n.activationTrigger&&null!==n.activeOptionIndex&&r.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}},u.map((n=>{var o;return t.createElement(h,{key:n.key},t.cloneElement(null==(o=e.children)?void 0:o.call(e,{...e.slot,option:r[n.index]}),{key:`${l}-${n.key}`,"data-index":n.index,"aria-setsize":r.length,"aria-posinset":n.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${n.start}px)`,overflowAnchor:"none"}}))}))))}let BA=i(null);function FA(e){let t=a(BA);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,FA),t}return t}function PA(e,t){return OM(t.type,jA,e,t)}BA.displayName="ComboboxDataContext";let HA=h;let _A=AM.RenderStrategy|AM.Static;let WA=VM((function(e,n){var a,i;let l=RM(),{value:d,defaultValue:u,onChange:f,form:h,name:m,by:p,disabled:g=l||!1,onClose:w,__demoMode:y=!1,multiple:x=!1,immediate:E=!1,virtual:C=null,nullable:k,...M}=e,R=function(e){let[t]=c(e);return t}(u),[I=(x?[]:void 0),O]=function(e,t,n){let[o,a]=c(n),i=void 0!==e,l=r(i),s=r(!1),d=r(!1);return!i||l.current||s.current?!i&&l.current&&!d.current&&(d.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:o,kM((e=>(i||a(e),null==t?void 0:t(e))))]}(d,f,R),[A,L]=v(PA,{dataRef:b(),comboboxState:y?0:1,isTyping:!1,options:[],virtual:C?{options:C.options,disabled:null!=(a=C.disabled)?a:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:y}),S=r(!1),N=r({static:!1,hold:!1}),j=function(e=kR){return o(((t,n)=>{if("string"==typeof e){let r=e;return(null==t?void 0:t[r])===(null==n?void 0:n[r])}return e(t,n)}),[e])}(p),D=kM((e=>C?null===p?C.options.indexOf(e):C.options.findIndex((t=>j(t,e))):A.options.findIndex((t=>j(t.dataRef.current.value,e))))),Z=o((e=>OM(T.mode,{1:()=>I.some((t=>j(t,e))),0:()=>j(I,e)})),[I]),V=kM((e=>A.activeOptionIndex===D(e))),T=s((()=>({...A,immediate:E,optionsPropsRef:N,value:I,defaultValue:R,disabled:g,mode:x?1:0,virtual:C?A.virtual:null,get activeOptionIndex(){if(S.current&&null===A.activeOptionIndex&&(C?C.options.length>0:A.options.length>0)){if(C){let e=C.options.findIndex((e=>{var t,n;return!(null!=(n=null==(t=C.disabled)?void 0:t.call(C,e))&&n)}));if(-1!==e)return e}let e=A.options.findIndex((e=>!e.dataRef.current.disabled));if(-1!==e)return e}return A.activeOptionIndex},calculateIndex:D,compare:j,isSelected:Z,isActive:V})),[I,R,g,x,y,A,C]);EM((()=>{var e;C&&L({type:7,options:C.options,disabled:null!=(e=C.disabled)?e:null})}),[C,null==C?void 0:C.options,null==C?void 0:C.disabled]),EM((()=>{A.dataRef.current=T}),[T]),$R(0===T.comboboxState,[T.buttonElement,T.inputElement,T.optionsElement],(()=>K.closeCombobox()));let B=s((()=>{var e,t,n;return{open:0===T.comboboxState,disabled:g,activeIndex:T.activeOptionIndex,activeOption:null===T.activeOptionIndex?null:T.virtual?T.virtual.options[null!=(e=T.activeOptionIndex)?e:0]:null!=(n=null==(t=T.options[T.activeOptionIndex])?void 0:t.dataRef.current.value)?n:null,value:I}}),[T,g,I]),F=kM((()=>{if(null!==T.activeOptionIndex){if(K.setIsTyping(!1),T.virtual)$(T.virtual.options[T.activeOptionIndex]);else{let{dataRef:e}=T.options[T.activeOptionIndex];$(e.current.value)}K.goToOption(hA.Specific,T.activeOptionIndex)}})),P=kM((()=>{L({type:0}),S.current=!0})),H=kM((()=>{L({type:1}),S.current=!1,null==w||w()})),_=kM((e=>{L({type:3,isTyping:e})})),W=kM(((e,t,n)=>(S.current=!1,e===hA.Specific?L({type:2,focus:hA.Specific,idx:t,trigger:n}):L({type:2,focus:e,trigger:n})))),z=kM(((e,t)=>(L({type:4,payload:{id:e,dataRef:t}}),()=>{T.isActive(t.current.value)&&(S.current=!0),L({type:5,id:e})}))),$=kM((e=>OM(T.mode,{0:()=>null==O?void 0:O(e),1(){let t=T.value.slice(),n=t.findIndex((t=>j(t,e)));return-1===n?t.push(e):t.splice(n,1),null==O?void 0:O(t)}}))),U=kM((e=>{L({type:6,trigger:e})})),q=kM((e=>{L({type:8,element:e})})),G=kM((e=>{L({type:9,element:e})})),Y=kM((e=>{L({type:10,element:e})})),K=s((()=>({onChange:$,registerOption:z,goToOption:W,setIsTyping:_,closeCombobox:H,openCombobox:P,setActivationTrigger:U,selectActiveOption:F,setInputElement:q,setButtonElement:G,setOptionsElement:Y})),[]),[X,Q]=function({inherit:e=!1}={}){let n=iR(),[r,o]=c([]),a=e?[n,...r].filter(Boolean):r;return[a.length>0?a.join(" "):void 0,s((()=>function(e){let n=kM((e=>(o((t=>[...t,e])),()=>o((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),r=s((()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value})),[n,e.slot,e.name,e.props,e.value]);return t.createElement(oR.Provider,{value:r},e.children)}),[o])]}(),J=null===n?{}:{ref:n},ee=o((()=>{if(void 0!==R)return null==O?void 0:O(R)}),[O,R]),te=SM();return t.createElement(Q,{value:X,props:{htmlFor:null==(i=T.inputElement)?void 0:i.id},slot:{open:0===T.comboboxState,disabled:g}},t.createElement(rA,null,t.createElement(DA.Provider,{value:K},t.createElement(BA.Provider,{value:T},t.createElement(uA,{value:OM(T.comboboxState,{0:dA.Open,1:dA.Closed})},null!=m&&t.createElement(qM,{disabled:g,data:null!=I?{[m]:I}:{},form:h,onReset:ee}),te({ourProps:J,theirProps:M,slot:B,defaultTag:HA,name:"Combobox"}))))))})),zA=VM((function(e,t){var n;let o=FA("Combobox.Button"),a=ZA("Combobox.Button"),i=JM(t,a.setButtonElement),l=g(),{id:d=`headlessui-combobox-button-${l}`,disabled:u=o.disabled||!1,autoFocus:f=!1,...h}=e,m=qR(o.inputElement),p=kM((e=>{switch(e.key){case rR.Space:case rR.Enter:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&L((()=>a.openCombobox())),void m();case rR.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(L((()=>a.openCombobox())),o.value||a.goToOption(hA.First)),void m();case rR.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(L((()=>a.openCombobox())),o.value||a.goToOption(hA.Last)),void m();case rR.Escape:if(0!==o.comboboxState)return;return e.preventDefault(),o.optionsElement&&!o.optionsPropsRef.current.static&&e.stopPropagation(),L((()=>a.closeCombobox())),void m();default:return}})),v=kM((e=>{e.preventDefault(),!XM(e.currentTarget)&&(e.button===pA.Left&&(0===o.comboboxState?a.closeCombobox():a.openCombobox()),m())})),w=iR([d]),{isFocusVisible:b,focusProps:y}=mM({autoFocus:f}),{isHovered:x,hoverProps:E}=hM({isDisabled:u}),{pressed:C,pressProps:k}=function({disabled:e=!1}={}){let t=r(null),[n,o]=c(!1),a=xM(),i=kM((()=>{t.current=null,o(!1),a.dispose()})),l=kM((e=>{if(a.dispose(),null===t.current){t.current=e.currentTarget,o(!0);{let n=wM(e.currentTarget);a.addEventListener(n,"pointerup",i,!1),a.addEventListener(n,"pointermove",(e=>{if(t.current){let n=function(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);o(function(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}(n,t.current.getBoundingClientRect()))}}),!1),a.addEventListener(n,"pointercancel",i,!1)}}}));return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}({disabled:u}),M=s((()=>({open:0===o.comboboxState,active:C||0===o.comboboxState,disabled:u,value:o.value,hover:x,focus:b})),[o,x,b,C,u]),R=ZM({ref:i,id:d,type:GR(e,o.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==(n=o.optionsElement)?void 0:n.id,"aria-expanded":0===o.comboboxState,"aria-labelledby":w,disabled:u||void 0,autoFocus:f,onMouseDown:v,onKeyDown:p},y,E,k);return SM()({ourProps:R,theirProps:h,slot:M,defaultTag:"button",name:"Combobox.Button"})})),$A=VM((function(e,t){var n,o,i,l,c;let d=FA("Combobox.Input"),u=ZA("Combobox.Input"),f=g(),h=KM(),{id:m=h||`headlessui-combobox-input-${f}`,onChange:p,displayValue:v,disabled:w=d.disabled||!1,autoFocus:b=!1,type:y="text",...x}=e,E=r(null),C=JM(E,t,a(tA).setReference,u.setInputElement),k=UR(d.inputElement),M=xM(),R=kM((()=>{u.onChange(null),d.optionsElement&&(d.optionsElement.scrollTop=0),u.goToOption(hA.Nothing)})),I=s((()=>{var e;return"function"==typeof v&&void 0!==d.value?null!=(e=v(d.value))?e:"":"string"==typeof d.value?d.value:""}),[d.value,v]);aI((([e,t],[n,r])=>{if(d.isTyping)return;let o=E.current;o&&((0===r&&1===t||e!==n)&&(o.value=e),requestAnimationFrame((()=>{if(d.isTyping||!o||(null==k?void 0:k.activeElement)!==o)return;let{selectionStart:e,selectionEnd:t}=o;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&o.setSelectionRange(o.value.length,o.value.length)})))}),[I,d.comboboxState,k,d.isTyping]),aI((([e],[t])=>{if(0===e&&1===t){if(d.isTyping)return;let e=E.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:r,selectionDirection:o}=e;e.value="",e.value=t,null!==o?e.setSelectionRange(n,r,o):e.setSelectionRange(n,r)}}),[d.comboboxState]);let O=r(!1),A=kM((()=>{O.current=!0})),S=kM((()=>{M.nextFrame((()=>{O.current=!1}))})),N=kM((e=>{switch(u.setIsTyping(!0),e.key){case rR.Enter:if(0!==d.comboboxState||O.current)return;if(e.preventDefault(),e.stopPropagation(),null===d.activeOptionIndex)return void u.closeCombobox();u.selectActiveOption(),0===d.mode&&u.closeCombobox();break;case rR.ArrowDown:return e.preventDefault(),e.stopPropagation(),OM(d.comboboxState,{0:()=>u.goToOption(hA.Next),1:()=>u.openCombobox()});case rR.ArrowUp:return e.preventDefault(),e.stopPropagation(),OM(d.comboboxState,{0:()=>u.goToOption(hA.Previous),1:()=>{L((()=>u.openCombobox())),d.value||u.goToOption(hA.Last)}});case rR.Home:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.First);case rR.PageUp:return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.First);case rR.End:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.Last);case rR.PageDown:return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.Last);case rR.Escape:return 0!==d.comboboxState?void 0:(e.preventDefault(),d.optionsElement&&!d.optionsPropsRef.current.static&&e.stopPropagation(),0===d.mode&&null===d.value&&R(),u.closeCombobox());case rR.Tab:if(0!==d.comboboxState)return;0===d.mode&&1!==d.activationTrigger&&u.selectActiveOption(),u.closeCombobox()}})),j=kM((e=>{null==p||p(e),0===d.mode&&""===e.target.value&&R(),u.openCombobox()})),D=kM((e=>{var t,n,r;let o=null!=(t=e.relatedTarget)?t:fA.find((t=>t!==e.currentTarget));if(!(null!=(n=d.optionsElement)&&n.contains(o)||null!=(r=d.buttonElement)&&r.contains(o)||0!==d.comboboxState))return e.preventDefault(),0===d.mode&&null===d.value&&R(),u.closeCombobox()})),Z=kM((e=>{var t,n,r;let o=null!=(t=e.relatedTarget)?t:fA.find((t=>t!==e.currentTarget));null!=(n=d.buttonElement)&&n.contains(o)||null!=(r=d.optionsElement)&&r.contains(o)||d.disabled||d.immediate&&0!==d.comboboxState&&M.microTask((()=>{L((()=>u.openCombobox())),u.setActivationTrigger(1)}))})),V=iR(),T=function(){var e,t;return null!=(t=null==(e=a(eR))?void 0:e.value)?t:void 0}(),{isFocused:B,focusProps:F}=mM({autoFocus:b}),{isHovered:P,hoverProps:H}=hM({isDisabled:w}),_=s((()=>({open:0===d.comboboxState,disabled:w,hover:P,focus:B,autofocus:b})),[d,P,B,b,w]),W=ZM({ref:C,id:m,role:"combobox",type:y,"aria-controls":null==(n=d.optionsElement)?void 0:n.id,"aria-expanded":0===d.comboboxState,"aria-activedescendant":null===d.activeOptionIndex?void 0:d.virtual?null==(o=d.options.find((e=>!e.dataRef.current.disabled&&d.compare(e.dataRef.current.value,d.virtual.options[d.activeOptionIndex]))))?void 0:o.id:null==(i=d.options[d.activeOptionIndex])?void 0:i.id,"aria-labelledby":V,"aria-describedby":T,"aria-autocomplete":"list",defaultValue:null!=(c=null!=(l=e.defaultValue)?l:void 0!==d.defaultValue?null==v?void 0:v(d.defaultValue):null)?c:d.defaultValue,disabled:w||void 0,autoFocus:b,onCompositionStart:A,onCompositionEnd:S,onKeyDown:N,onChange:j,onFocus:Z,onBlur:D},F,H);return SM()({ourProps:W,theirProps:x,slot:_,defaultTag:"input",name:"Combobox.Input"})})),UA=sR,qA=VM((function(e,n){var i,l,u;let f=g(),{id:h=`headlessui-combobox-options-${f}`,hold:m=!1,anchor:p,portal:v=!1,modal:w=!0,transition:b=!1,...y}=e,x=FA("Combobox.Options"),E=ZA("Combobox.Options"),C=function(e){return s((()=>e?"string"==typeof e?{to:e}:e:null),[e])}(p);C&&(v=!0);let[k,M]=function(e=null){!1===e&&(e=null),"string"==typeof e&&(e={to:e});let t=a(nA),n=s((()=>e),[JSON.stringify(e,((e,t)=>{var n;return null!=(n=null==t?void 0:t.outerHTML)?n:t}))]);EM((()=>{null==t||t(null!=n?n:null)}),[t,n]);let r=a(tA);return s((()=>[r.setFloating,e?r.styles:{}]),[r.setFloating,e,r.styles])}(C),[R,I]=c(null),O=function(){let{getFloatingProps:e,slot:t}=a(tA);return o(((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor})),[e,t])}(),A=JM(n,C?k:null,E.setOptionsElement,I),L=UR(x.optionsElement),S=a(cA),[N,j]=oI(b,R,null!==S?(S&dA.Open)===dA.Open:0===x.comboboxState);!function(e,t,n){let r=CM((e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()}));d((()=>{if(!e)return;let n=null===t?null:t instanceof HTMLElement?t:t.current;if(!n)return;let o=yM();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver((()=>r.current(n)));e.observe(n),o.add((()=>e.disconnect()))}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver((()=>r.current(n)));e.observe(n),o.add((()=>e.disconnect()))}return()=>o.dispose()}),[t,r,e])}(N,x.inputElement,E.closeCombobox),QR(!x.__demoMode&&(w&&0===x.comboboxState),L),ZR(!x.__demoMode&&(w&&0===x.comboboxState),{allowed:o((()=>[x.inputElement,x.buttonElement,x.optionsElement]),[x.inputElement,x.buttonElement,x.optionsElement])}),EM((()=>{var t;x.optionsPropsRef.current.static=null!=(t=e.static)&&t}),[x.optionsPropsRef,e.static]),EM((()=>{x.optionsPropsRef.current.hold=m}),[x.optionsPropsRef,m]),function(e,{container:t,accept:n,walk:o}){let a=r(n),i=r(o);d((()=>{a.current=n,i.current=o}),[n,o]),EM((()=>{if(!t||!e)return;let n=wM(t);if(!n)return;let r=a.current,o=i.current,l=Object.assign((e=>r(e)),{acceptNode:r}),s=n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,l,!1);for(;s.nextNode();)o(s.currentNode)}),[t,e,a,i])}(0===x.comboboxState,{container:x.optionsElement,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let D=iR([null==(i=x.buttonElement)?void 0:i.id]),Z=s((()=>({open:0===x.comboboxState,option:void 0})),[x.comboboxState]),V=kM((()=>{E.setActivationTrigger(0)})),T=kM((e=>{e.preventDefault(),E.setActivationTrigger(0)})),B=ZM(C?O():{},{"aria-labelledby":D,role:"listbox","aria-multiselectable":1===x.mode||void 0,id:h,ref:A,style:{...y.style,...M,"--input-width":MR(x.inputElement,!0).width,"--button-width":MR(x.buttonElement,!0).width},onWheel:0===x.activationTrigger?void 0:V,onMouseDown:T,...rI(j)}),F=N&&1===x.comboboxState,P=sA(F,null==(l=x.virtual)?void 0:l.options),H=sA(F,x.value),_=kM((e=>x.compare(H,e)));if(x.virtual){if(void 0===P)throw new Error("Missing `options` in virtual mode");Object.assign(y,{children:t.createElement(BA.Provider,{value:P!==x.virtual.options?{...x,virtual:{...x.virtual,options:P}}:x},t.createElement(TA,{slot:Z},y.children))})}let W=SM();return t.createElement(IA,{enabled:!!v&&(e.static||N)},t.createElement(BA.Provider,{value:1===x.mode?x:{...x,isSelected:_}},W({ourProps:B,theirProps:{...y,children:t.createElement(lA,{freeze:F},"function"==typeof y.children?null==(u=y.children)?void 0:u.call(y,Z):y.children)},slot:Z,defaultTag:"div",features:_A,visible:N,name:"Combobox.Options"})))})),GA=VM((function(e,t){var n,o,i,l;let c=FA("Combobox.Option"),d=ZA("Combobox.Option"),u=g(),{id:f=`headlessui-combobox-option-${u}`,value:h,disabled:m=null!=(i=null==(o=null==(n=c.virtual)?void 0:n.disabled)?void 0:o.call(n,h))&&i,order:p=null,...v}=e,w=qR(c.inputElement),b=c.virtual?c.activeOptionIndex===c.calculateIndex(h):null!==c.activeOptionIndex&&(null==(l=c.options[c.activeOptionIndex])?void 0:l.id)===f,y=c.isSelected(h),x=r(null),E=CM({disabled:m,value:h,domRef:x,order:p}),C=a(VA),k=JM(t,x,C?C.measureElement:null),M=kM((()=>{d.setIsTyping(!1),d.onChange(h)}));EM((()=>d.registerOption(f,E)),[E,f]);let R=r(!(c.virtual||c.__demoMode));EM((()=>{if(!c.virtual&&!c.__demoMode)return yM().requestAnimationFrame((()=>{R.current=!0}))}),[c.virtual,c.__demoMode]),EM((()=>{if(R.current&&0===c.comboboxState&&b&&0!==c.activationTrigger)return yM().requestAnimationFrame((()=>{var e,t;null==(t=null==(e=x.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}))}),[x,b,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let I=kM((e=>{e.preventDefault(),e.button===pA.Left&&(m||(M(),WR()||requestAnimationFrame((()=>w())),0===c.mode&&d.closeCombobox()))})),O=kM((()=>{if(m)return d.goToOption(hA.Nothing);let e=c.calculateIndex(h);d.goToOption(hA.Specific,e)})),A=function(){let e=r([-1,-1]);return{wasMoved(t){let n=JR(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=JR(t)}}}(),L=kM((e=>A.update(e))),S=kM((e=>{if(!A.wasMoved(e)||m||b)return;let t=c.calculateIndex(h);d.goToOption(hA.Specific,t,0)})),N=kM((e=>{A.wasMoved(e)&&(m||b&&(c.optionsPropsRef.current.hold||d.goToOption(hA.Nothing)))})),j=s((()=>({active:b,focus:b,selected:y,disabled:m})),[b,y,m]),D={id:f,ref:k,role:"option",tabIndex:!0===m?void 0:-1,"aria-disabled":!0===m||void 0,"aria-selected":y,disabled:void 0,onMouseDown:I,onFocus:O,onPointerEnter:L,onMouseEnter:L,onPointerMove:S,onMouseMove:S,onPointerLeave:N,onMouseLeave:N};return SM()({ourProps:D,theirProps:v,slot:j,defaultTag:"div",name:"Combobox.Option"})})),YA=Object.assign(WA,{Input:$A,Button:zA,Label:UA,Options:qA,Option:GA});M(["absolute inset-y-0 right-0 flex items-center justify-center"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}});const KA=M(["transition-all"],{variants:{disabled:{true:"fill-input-text-disabled",false:"fill-inherit"},isFocus:{true:"fill-input-text-active rotate-180",false:""}},defaultVariants:{disabled:!1,isFocus:!1}}),XA=M([],{variants:{size:{sm:"pe-[30px]",md:"pe-[40px]",lg:"pe-[68px]"}},defaultVariants:{size:"md"}}),QA=LC("relative flex gap-1 cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","hover:bg-[var(--dropdown-menu-hover-bg)] hover:text-[var(--dropdown-menu-hover-text)]"),JA=n(((e,t)=>{var{id:n,options:a=[],value:i,label:l,size:f="md",rounded:m="normal",variant:p="outline",helperText:g,errorMessage:v,fullwidth:w=!0,disabled:b=!1,error:y=!1,filterMode:x=!1,required:M=!0,modal:R,onChangeText:I,onSelect:O,renderOptions:A,optionContainerClassName:L,optionItemClassName:S,optionNotFoundItemClassName:N,segmentedInput:j=!0,keepOpenAfterSelect:D=!1,portal:Z=!1}=e,V=IC(e,["id","options","value","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","modal","onChangeText","onSelect","renderOptions","optionContainerClassName","optionItemClassName","optionNotFoundItemClassName","segmentedInput","keepOpenAfterSelect","portal"]);const T=n||`${l}-select`,[B,F]=c(null),[P,H]=c(""),_=r(null);u(t,(()=>_.current),[]),d((()=>{F(null!=i?i:null)}),[i]);const W=s((()=>x&&P?a.filter((e=>e.label.toLowerCase().includes(P.toLowerCase()))):a),[a,x,P]),z=o((e=>{F(e),H(""),e&&(null==O||O(e),D||setTimeout((()=>{var e;return null===(e=_.current)||void 0===e?void 0:e.blur()}),0))}),[O,D]),$=o((e=>{x&&H(e.target.value),null==I||I(e)}),[x,I]);return E(YA,{value:B,onChange:z,immediate:!0,by:"value",disabled:b,children:({open:e})=>C("div",{className:LC("relative",w&&"w-full"),children:[E($A,Object.assign({as:mk,ref:_,hasClearIcon:!1,endIcon:E(Vr,{className:KA({isFocus:e})}),label:l,autoComplete:"off",rounded:m,variant:p,helperText:g,errorMessage:v,fullwidth:w,error:y,required:M,id:T,disabled:b,size:f,className:j?XA({size:f}):void 0,displayValue:e=>{var t;return null!==(t=null==e?void 0:e.label)&&void 0!==t?t:""},readOnly:!x,onChange:$},V)),E(qA,Object.assign({},Z?{portal:!0,anchor:{to:"bottom start",gap:4}}:{},{className:LC(!Z&&"absolute top-full left-0 w-full -mt-3 z-[51]",Z&&"z-[51] !max-h-60 w-[var(--input-width)]","min-w-[154px] max-h-60 overflow-y-auto","rounded-md bg-modal-dropdown-surface border border-bg-stroke3 text-text-g-contrast-high",L),style:{boxShadow:"var(--dropdown-menu-shadow)"},children:A?A({optionsFiltered:W,selectedOption:B,onClick:z}):0===W.length?E("div",{className:LC("px-4 py-14 text-center text-input-text",N),children:"Not found"}):W.map((e=>e.renderLabel?E(h,{children:e.renderLabel({value:e.value,label:e.label,handleOnClick:()=>z(e),className:LC(QA,(null==B?void 0:B.value)===e.value&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)]",S)})},e.value):E(GA,{value:e,className:({focus:t,selected:n})=>LC(QA,(n||(null==B?void 0:B.value)===e.value)&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)]",t&&"bg-[var(--dropdown-menu-hover-bg)] text-[var(--dropdown-menu-hover-text)]",S),children:({selected:t})=>C(k,{children:[E("span",{className:"shrink-0 size-4 flex items-center justify-center",children:(t||(null==B?void 0:B.value)===e.value)&&E(Ek,{type:"heroicons",name:"check",className:"size-4 text-[var(--dropdown-menu-selected-text)]"})}),e.label]})},e.value)))}))]})})}));function eL(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function tL(...t){return e.useCallback(eL(...t),t)}function nL(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,s=r?.[t]?.[i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})};return l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t]?.[i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},rL(o,...n)]}function rL(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function oL(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function aL(t){const n=e.useRef(t);return e.useEffect((()=>{n.current=t})),e.useMemo((()=>(...e)=>n.current?.(...e)),[])}function iL({prop:t,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:t,onChange:n}){const r=e.useState(t),[o]=r,a=e.useRef(o),i=aL(n);return e.useEffect((()=>{a.current!==o&&(i(o),a.current=o)}),[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==t,l=i?t:o,s=aL(r);return[l,e.useCallback((e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&s(n)}else a(e)}),[i,t,a,s])]}function lL(t){const n=e.useRef({value:t,previous:t});return e.useMemo((()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous)),[t])}JA.displayName="Dropdown";var sL=Boolean(globalThis?.document)?e.useLayoutEffect:()=>{};function cL(t){const[n,r]=e.useState(void 0);return sL((()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})}));return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)}),[t]),n}var dL=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=uL(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=uL(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=uL(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=uL(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function uL(e){return e?.animationName||"none"}dL.displayName="Presence";var fL=e.forwardRef(((t,n)=>{const{children:r,...o}=t,a=e.Children.toArray(r),i=a.find(pL);if(i){const t=i.props.children,r=a.map((n=>n===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n));return E(hL,{...o,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return E(hL,{...o,ref:n,children:r})}));fL.displayName="Slot";var hL=e.forwardRef(((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r);return e.cloneElement(r,{...gL(o,r.props),ref:n?eL(n,t):t})}return e.Children.count(r)>1?e.Children.only(null):null}));hL.displayName="SlotClone";var mL=({children:e})=>E(k,{children:e});function pL(t){return e.isValidElement(t)&&t.type===mL}function gL(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}var vL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),wL="Checkbox",[bL]=nL(wL),[yL,xL]=bL(wL),EL=e.forwardRef(((t,n)=>{const{__scopeCheckbox:r,name:o,checked:a,defaultChecked:i,required:l,disabled:s,value:c="on",onCheckedChange:d,form:u,...f}=t,[h,m]=e.useState(null),p=tL(n,(e=>m(e))),g=e.useRef(!1),v=!h||(u||!!h.closest("form")),[w=!1,b]=iL({prop:a,defaultProp:i,onChange:d}),y=e.useRef(w);return e.useEffect((()=>{const e=h?.form;if(e){const t=()=>b(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[h,b]),C(yL,{scope:r,state:w,disabled:s,children:[E(vL.button,{type:"button",role:"checkbox","aria-checked":RL(w)?"mixed":w,"aria-required":l,"data-state":IL(w),"data-disabled":s?"":void 0,disabled:s,value:c,...f,ref:p,onKeyDown:oL(t.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:oL(t.onClick,(e=>{b((e=>!!RL(e)||!e)),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())}))}),v&&E(ML,{control:h,bubbles:!g.current,name:o,value:c,checked:w,required:l,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:!RL(i)&&i})]})}));EL.displayName=wL;var CL="CheckboxIndicator",kL=e.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=xL(CL,n);return E(dL,{present:r||RL(a.state)||!0===a.state,children:E(vL.span,{"data-state":IL(a.state),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})}));kL.displayName=CL;var ML=t=>{const{control:n,checked:r,bubbles:o=!0,defaultChecked:a,...i}=t,l=e.useRef(null),s=lL(r),c=cL(n);e.useEffect((()=>{const e=l.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==r&&n){const t=new Event("click",{bubbles:o});e.indeterminate=RL(r),n.call(e,!RL(r)&&r),e.dispatchEvent(t)}}),[s,r,o]);const d=e.useRef(!RL(r)&&r);return E("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...i,tabIndex:-1,ref:l,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function RL(e){return"indeterminate"===e}function IL(e){return RL(e)?"indeterminate":e?"checked":"unchecked"}var OL=EL,AL=kL;const LL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(OL,Object.assign({ref:t,className:LC("peer size-4 shrink-0 cursor-pointer rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-bg-bg1","hover:border-function-default-hover","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-input-active-stroke focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:border-state-disable-outline disabled:text-state-disable-outline","disabled:data-[state=checked]:border-state-disable-solid disabled:data-[state=checked]:bg-state-disable-solid","disabled:data-[state=indeterminate]:border-state-disable-solid disabled:data-[state=indeterminate]:bg-state-disable-solid",{"data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon data-[state=indeterminate]:border-function-active-solid data-[state=indeterminate]:bg-function-active-solid data-[state=indeterminate]:text-function-active-icon":!r.disabled,"hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover hover:data-[state=indeterminate]:border-function-active-hover hover:data-[state=indeterminate]:bg-function-active-hover":!r.disabled},n)},r,{children:C(AL,{className:LC("flex size-[14px] items-center justify-center text-current","[&[data-state=checked]_.checkbox-check-icon]:block","[&[data-state=indeterminate]_.checkbox-minus-icon]:block"),children:[E(Rr,{className:"checkbox-check-icon hidden size-[14px]"}),E(ts,{className:"checkbox-minus-icon hidden size-[14px]"})]})}))}));LL.displayName=OL.displayName;var SL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),NL=e.forwardRef(((e,t)=>E(SL.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));NL.displayName="Label";var jL=NL;const DL=M(["block cursor-pointer duration-450 transition-all px-[2px] text-input-default-text peer-focus:text-input-text-active"],{variants:{size:{sm:"typography-small1",md:"typography-subtitle2",lg:"typography-subtitle1"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled peer-disabled:cursor-not-allowed"},error:{true:"ring-error"},isFloatable:{true:"absolute peer-focus:text-input-text-active peer-focus:bg-input-label-background",false:""}},compoundVariants:[{size:"sm",isFloatable:!0,className:["left-3 -top-1.5 typography-label2 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"]},{size:"md",isFloatable:!0,className:["left-3 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{size:"lg",isFloatable:!0,className:["left-4 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloatable:!1}}),ZL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(jL,Object.assign({ref:t,className:LC(DL({size:r.size,disabled:r.disabled,error:r.error,isFloatable:r.isFloatable}),n)},r))}));ZL.displayName=jL.displayName;const VL=M(["border-0 outline-none","p-1 flex w-auto h-fit box-border","peer text-input-filled-text placeholder:text-input-default-text bg-transparent caret-primary"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitle4",lg:"p-4 typography-subtitle1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:["ring-1 ring-inset ring-input-default-stroke","hover:ring-input-active-stroke hover:text-input-filled-text","focus:ring-1 focus:ring-inset focus:ring-input-active-stroke focus:text-input-filled-text active:text-input-filled-text"],underline:"border-b-2 border-input-default-stroke transition-colors hover:border-input-active-stroke focus:border-input-default-stroke"},hiddenPlaceholder:{true:"placeholder:text-transparent"},fullwidth:{true:"w-full"},disabled:{true:["text-input-disable-text ring-input-disable-stroke bg-input-disable-bg placeholder:text-input-disable-text","hover:text-input-disable-text hover:ring-input-disable-stroke hover:bg-input-disable-bg hover:placeholder:text-input-disable-text","active:text-input-disable-text active:ring-input-disable-stroke active:bg-input-disable-bg active:placeholder:text-input-disable-text"]},error:{true:"ring-input-error focus:ring-input-error"}},defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hiddenPlaceholder:!0}}),TL=n(((e,t)=>{var{className:n,type:r="text",size:o="md",variant:a="outline",rounded:i="normal",fullwidth:l=!1,disabled:s=!1,error:c=!1,required:d=!1,hiddenPlaceholder:u=!1}=e,f=IC(e,["className","type","size","variant","rounded","fullwidth","disabled","error","required","hiddenPlaceholder"]);return E("input",Object.assign({type:r,className:LC(VL({size:o,variant:a,fullwidth:l,error:c,hiddenPlaceholder:u,disabled:s,rounded:i}),n),ref:t,disabled:s},f))}));TL.displayName="Input";const BL=({children:e,className:t,variant:n="default",scrollShadow:r=!1,center:o,leftNav:a,rightNav:i,position:l,container:s=!1,containerClassName:u,leftNavClassName:f,centerClassName:h,rightNavClassName:m})=>{const[p,g]=c(!1);d((()=>{if(!r||"undefined"==typeof window)return;const e=()=>{g(window.scrollY>4)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)}),[r]);const v="transparent"===n;return C("header",{className:LC("relative w-full px-4 py-6 h-[var(--navbar-height)] box-border overflow-hidden typography-subtitle2 border-solid border-b-2 border-b-[var(--navbar-border-color)] transition-shadow duration-200",v?"text-inherit":"text-[var(--navbar-text-color)]",{position:l},r&&p&&"shadow-[var(--navbar-shadow-scrolled)]",t),children:[!v&&E("div",{className:"absolute inset-0 -z-10 bg-[var(--navbar-bg-color)]","aria-hidden":!0}),E("div",{className:LC("absolute inset-0 -z-[5] pointer-events-none",t),"aria-hidden":!0}),E("div",{className:LC("relative mx-auto flex h-full justify-between items-center",{container:s},u),children:e||C(k,{children:[E("nav",{className:LC("flex w-1/2 gap-x-[var(--navbar-gap)] text-xl",f),children:a}),E("div",{className:LC("flex flex-shrink-0 flex-wrap justify-center",h),children:o}),E("nav",{className:LC("flex w-1/2 justify-end gap-x-[var(--navbar-gap)] text-xl",m),children:i})]})})]})},FL=({children:e,className:t,variant:n="default",copyright:r,center:o,leftNav:a,rightNav:i,position:l,container:s=!1,containerClassName:c,leftNavClassName:d,centerClassName:u,rightNavClassName:f})=>{const h="simple"===n,m="transparent"===n,p=a||r,g=h&&null!=r?r:o,v=h?null:i;return C("footer",{className:LC("relative w-full px-4 py-6 box-border overflow-hidden typography-subtitle2 border-solid border-t-2 text-[var(--footer-text-color)] border-t-[var(--footer-border-color)]",h?"h-[var(--footer-height-simple)]":"h-[var(--footer-height)]",{position:l},t),children:[!m&&E("div",{className:"absolute inset-0 -z-10 bg-[var(--footer-bg-color)]","aria-hidden":!0}),E("div",{className:LC("absolute inset-0 -z-[5] pointer-events-none",t),"aria-hidden":!0}),E("div",{className:LC("relative mx-auto flex h-full items-center",h?"justify-center":"justify-between",{container:s},c),children:null!=e?e:h?E("div",{className:LC("text-center",u),children:g}):C(k,{children:[E("nav",{className:LC("flex w-1/2 items-center gap-x-[var(--footer-gap)] text-xl",d),children:r&&a?C(k,{children:[E("span",{className:"flex-shrink-0",children:r}),a]}):p}),E("div",{className:LC("flex flex-shrink-0 flex-wrap justify-center",u),children:g}),E("nav",{className:LC("flex w-1/2 justify-end gap-x-[var(--footer-gap)] text-xl",f),children:v})]})})]})};var PL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),HL="Avatar",[_L]=nL(HL),[WL,zL]=_L(HL),$L=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,...o}=t,[a,i]=e.useState("idle");return E(WL,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:E(PL.span,{...o,ref:n})})}));$L.displayName=HL;var UL="AvatarImage",qL=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:a=()=>{},...i}=t,l=zL(UL,r),s=function(t,n){const[r,o]=e.useState("idle");return sL((()=>{if(!t)return void o("error");let e=!0;const r=new window.Image,a=t=>()=>{e&&o(t)};return o("loading"),r.onload=a("loaded"),r.onerror=a("error"),r.src=t,n&&(r.referrerPolicy=n),()=>{e=!1}}),[t,n]),r}(o,i.referrerPolicy),c=aL((e=>{a(e),l.onImageLoadingStatusChange(e)}));return sL((()=>{"idle"!==s&&c(s)}),[s,c]),"loaded"===s?E(PL.img,{...i,ref:n,src:o}):null}));qL.displayName=UL;var GL="AvatarFallback",YL=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,delayMs:o,...a}=t,i=zL(GL,r),[l,s]=e.useState(void 0===o);return e.useEffect((()=>{if(void 0!==o){const e=window.setTimeout((()=>s(!0)),o);return()=>window.clearTimeout(e)}}),[o]),l&&"loaded"!==i.imageLoadingStatus?E(PL.span,{...a,ref:n}):null}));YL.displayName=GL;var KL=$L,XL=qL,QL=YL;const JL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KL,Object.assign({ref:t,className:LC("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n)},r))}));JL.displayName=KL.displayName;const eS=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(XL,Object.assign({ref:t,className:LC("object-cover object-top h-full w-full",n)},r))}));eS.displayName=XL.displayName;const tS=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(QL,Object.assign({ref:t,className:LC("flex h-full w-full items-center justify-center rounded-full bg-inherit text-inherit",n)},r))}));tS.displayName=QL.displayName;const nS=M(["flex items-center justify-center bg-grey2-900 text-text-white typography-subtitle6 truncate"],{variants:{size:{xxs:"w-[24px] h-[24px] typography-small3",xs:"w-[32px] h-[32px]",sm:"w-[40px] h-[40px]",md:"w-[48px] h-[48px]",lg:"w-[64px] h-[64px]"},rounded:{normal:"rounded",full:"rounded-full",none:"rounded-none"},hasImage:{true:"bg-white"}},defaultVariants:{size:"md",rounded:"normal"}}),rS=e=>{var t,n,r;if(!e.length)return"-";const o=e.split(" ");return`${null==e?void 0:e.charAt(0)}${null!==(r=null!==(n=null===(t=null==o?void 0:o[1])||void 0===t?void 0:t.charAt(0))&&void 0!==n?n:null==e?void 0:e.charAt(1))&&void 0!==r?r:""}`},oS=({text:e,imageUrl:t,icon:n,fallback:r,size:o,rounded:a,className:i,imageClassName:l,fallbackClassName:s,type:c="text",children:d,style:u})=>{const f=nS({size:o,rounded:a,hasImage:!!t});return E(JL,{className:LC(f,i),style:u,children:d||C(k,{children:["image"===c&&C(k,{children:[E(eS,{src:t,className:LC(l)}),E(tS,{className:LC(s),children:"string"==typeof r?rS(r):r})]}),"text"===c&&rS(null!=e?e:""),"icon"===c&&n]})})},aS=({borderWidth:e=2,borderColor:t="white",maxDisplay:n=4,children:r,remainingText:o,remainingAvatar:a})=>{const i=y.toArray(r),l=i.slice(0,n),s=Math.max(0,i.length-n),c=a||p(l[0],{style:{borderWidth:e,borderColor:t},className:"relative z-0",children:o||`+${s}`});return C("div",{className:"flex items-center -space-x-2",children:[l.map(((n,r)=>E("div",{className:"relative",style:{zIndex:i.length-r},children:p(n,{style:{borderWidth:e,borderColor:t}})},r))),s>0&&c]})},iS=M(["inline-flex items-center justify-center rounded-lg px-3 py-1","typography-body3"],{variants:{color:{default:["bg-[var(--badge-default-bg)]","text-[var(--badge-default-text)]"],success:["bg-[var(--badge-success-bg)]","text-[var(--badge-success-text)]"],warning:["bg-[var(--badge-warning-bg)]","text-[var(--badge-warning-text)]"],info:["bg-[var(--badge-info-bg)]","text-[var(--badge-info-text)]"],error:["bg-[var(--badge-error-bg)]","text-[var(--badge-error-text)]"]},clickable:{true:"border border-solid",false:""}},compoundVariants:[{color:"default",clickable:!0,className:"border-[var(--badge-default-border)]"},{color:"success",clickable:!0,className:"border-[var(--badge-success-border)]"},{color:"warning",clickable:!0,className:"border-[var(--badge-warning-border)]"},{color:"info",clickable:!0,className:"border-[var(--badge-info-border)]"},{color:"error",clickable:!0,className:"border-[var(--badge-error-border)]"}],defaultVariants:{color:"default",clickable:!1}}),lS=M(["inline-flex items-center justify-center rounded px-1 py-0.5","typography-small6 text-[var(--badge-severity-text)]"],{variants:{severity:{highest:"bg-[var(--badge-severity-highest-bg)]",high:"bg-[var(--badge-severity-high-bg)]",medium:"bg-[var(--badge-severity-medium-bg)]",low:"bg-[var(--badge-severity-low-bg)]",lowest:"bg-[var(--badge-severity-lowest-bg)]"}},defaultVariants:{severity:"medium"}}),sS=e.forwardRef(((e,t)=>{var{label:n,color:r="default",clickable:o=!1,percent:a,className:i}=e,l=IC(e,["label","color","clickable","percent","className"]);const s=void 0!==a;return C("span",Object.assign({ref:t,className:LC(iS({color:r,clickable:o}),s&&"flex-col gap-0.5",o&&"cursor-pointer gap-1",i)},l,{children:[C("span",{className:"flex items-center gap-1",children:[n,o&&E(Vr,{className:"size-4 shrink-0","aria-hidden":!0})]}),s&&C("span",{className:"tabular-nums",children:[a,"%"]})]}))}));sS.displayName="Badge";const cS={highest:"Highest",high:"High",medium:"Medium",low:"Low",lowest:"Lowest"},dS=e.forwardRef(((e,t)=>{var{severity:n,className:r}=e,o=IC(e,["severity","className"]);return E("span",Object.assign({ref:t,className:LC(lS({severity:n}),r)},o,{children:cS[n]}))}));dS.displayName="SeverityBadge";const uS=i(void 0),fS=()=>{const e=a(uS);if(!e)throw new Error("useCollapsible must be used within a CollapsibleProvider");return e},hS=({size:e,children:t,isExpandControlled:n,onToggle:r})=>{const[o,a]=c(!1);return d((()=>{void 0!==n&&a(n)}),[n]),E(uS.Provider,{value:{size:e,isExpand:o,toggle:()=>{a((e=>!e)),r&&r(!o)},setIsExpand:a},children:t})},mS=M(["flex flex-1 bg-secondary-default hover:bg-secondary-hover text-state-secondary-text-solid","focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75"],{variants:{size:{sm:"py-2 px-3",md:"py-3 px-4",lg:"py-4 px-5"}},defaultVariants:{size:"md"}}),pS=M(["transition-all flex content-center justify-center "],{variants:{size:{sm:"size-5",md:"size-6",lg:"size-7"},isExpand:{true:"rotate-180"}},defaultVariants:{size:"md",isExpand:!1}}),gS=M(["flex flex-1 border-t border-t-secondary","transition ease-in-out delay-150 duration-300"],{variants:{size:{sm:"py-2 px-3",md:"py-3 px-4",lg:"py-4 px-5"}},defaultVariants:{size:"md"}}),vS=M(["flex flex-col border border-secondary rounded overflow-hidden"]),wS=n((({children:e,className:t,hideExpandIcon:n=!1},r)=>{const{toggle:o,isExpand:a,size:i}=fS(),l=mS({size:i}),s=pS({isExpand:a,size:i});return C("button",{onClick:o,className:LC(l,t),ref:r,children:[E("span",{className:"flex flex-1",children:e}),!n&&E("span",{className:LC(s),children:E(Vr,{className:LC("size-full")})})]})}));wS.displayName="CollapsibleButton";const bS=n((({children:e,className:t},n)=>{const{isExpand:o,size:a}=fS(),i=gS({size:a}),[l,s]=c("0px"),u=r(null);return d((()=>{u.current&&s(o?`${u.current.scrollHeight}px`:"0px")}),[o,e]),E("div",{ref:n,className:LC("overflow-hidden transition-all ease-in-out"),style:{height:l},children:E("div",{ref:u,className:LC(i,t),children:e})})}));bS.displayName="CollapsiblePanel";const yS=n((({children:e,isExpand:t,size:n,className:r,onToggle:o},a)=>{const i=vS();return E(hS,{size:n,isExpandControlled:t,onToggle:o,children:E("div",{ref:a,className:LC(i,r),children:e})})}));var xS,ES,CS;yS.displayName="Collapsible",yS.Button=wS,yS.Panel=bS,function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(xS||(xS={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(ES||(ES={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(CS||(CS={}));const kS=6048e5,MS=Symbol.for("constructDateFrom");function RS(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&MS in e?e[MS](t):e instanceof Date?new e.constructor(t):new Date(t)}function IS(e,t){return RS(t||e,e)}function OS(e,t,n){const r=IS(e,n?.in);return isNaN(t)?RS(e,NaN):t?(r.setDate(r.getDate()+t),r):r}function AS(e,t,n){const r=IS(e,n?.in);if(isNaN(t))return RS(e,NaN);if(!t)return r;const o=r.getDate(),a=RS(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);return o>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let LS={};function SS(){return LS}function NS(e,t){const n=SS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=IS(e,t?.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function jS(e,t){return NS(e,{...t,weekStartsOn:1})}function DS(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=RS(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=jS(o),i=RS(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=jS(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function ZS(e){const t=IS(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function VS(e,...t){const n=RS.bind(null,t.find((e=>"object"==typeof e)));return t.map(n)}function TS(e,t){const n=IS(e,t?.in);return n.setHours(0,0,0,0),n}function BS(e,t,n){const[r,o]=VS(0,e,t),a=TS(r),i=TS(o),l=+a-ZS(a),s=+i-ZS(i);return Math.round((l-s)/864e5)}function FS(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function PS(e,t){const n=IS(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function HS(e,t){const n=SS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=IS(e,t?.in),a=o.getDay(),i=6+(a<r?-7:0)-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const _S={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function WS(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const zS={date:WS({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:WS({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:WS({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$S={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function US(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const qS={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:US({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:US({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:US({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:US({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:US({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function GS(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const YS={ordinalNumber:(KS={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(KS.matchPattern);if(!n)return null;const r=n[0],o=e.match(KS.parsePattern);if(!o)return null;let a=KS.valueCallback?KS.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:GS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:GS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:GS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:GS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:GS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var KS;const XS={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=_S[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:zS,formatRelative:(e,t,n,r)=>$S[e],localize:qS,match:YS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function QS(e,t){const n=IS(e,t?.in),r=+jS(n)-+function(e,t){const n=DS(e,t),r=RS(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),jS(r)}(n);return Math.round(r/kS)+1}function JS(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=SS(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=RS(t?.in||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=NS(i,t),s=RS(t?.in||e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=NS(s,t);return+n>=+l?r+1:+n>=+c?r:r-1}function eN(e,t){const n=IS(e,t?.in),r=+NS(n,t)-+function(e,t){const n=SS(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=JS(e,t),a=RS(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),NS(a,t)}(n,t);return Math.round(r/kS)+1}function tN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const nN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):tN(n+1,2)},d:(e,t)=>tN(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>tN(e.getHours()%12||12,t.length),H:(e,t)=>tN(e.getHours(),t.length),m:(e,t)=>tN(e.getMinutes(),t.length),s:(e,t)=>tN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return tN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},rN="midnight",oN="noon",aN="morning",iN="afternoon",lN="evening",sN="night",cN={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return nN.y(e,t)},Y:function(e,t,n,r){const o=JS(e,r),a=o>0?o:1-o;if("YY"===t){return tN(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):tN(a,t.length)},R:function(e,t){return tN(DS(e),t.length)},u:function(e,t){return tN(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return tN(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return tN(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return nN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return tN(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=eN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):tN(o,t.length)},I:function(e,t,n){const r=QS(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):tN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):nN.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=IS(e,t?.in);return BS(n,PS(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):tN(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return tN(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return tN(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return tN(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?oN:0===r?rN:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?lN:r>=12?iN:r>=4?aN:sN,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return nN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):nN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):tN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):tN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nN.s(e,t)},S:function(e,t){return nN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return uN(r);case"XXXX":case"XX":return fN(r);default:return fN(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return uN(r);case"xxxx":case"xx":return fN(r);default:return fN(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dN(r,":");default:return"GMT"+fN(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dN(r,":");default:return"GMT"+fN(r,":")}},t:function(e,t,n){return tN(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return tN(+e,t.length)}};function dN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+tN(a,2)}function uN(e,t){if(e%60==0){return(e>0?"-":"+")+tN(Math.abs(e)/60,2)}return fN(e,t)}function fN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+tN(Math.trunc(r/60),2)+t+tN(r%60,2)}const hN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},mN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pN={p:mN,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return hN(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",hN(r,t)).replace("{{time}}",mN(o,t))}},gN=/^D+$/,vN=/^Y+$/,wN=["D","DD","YY","YYYY"];const bN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xN=/^'([^]*?)'?$/,EN=/''/g,CN=/[a-zA-Z]/;function kN(e,t,n){const r=SS(),o=n?.locale??r.locale??XS,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=IS(e,n?.in);if(!function(e){return!(!FS(e)&&"number"!=typeof e||isNaN(+IS(e)))}(l))throw new RangeError("Invalid time value");let s=t.match(yN).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,pN[t])(e,o.formatLong)}return e})).join("").match(bN).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:MN(e)};if(cN[t])return{isToken:!0,value:e};if(t.match(CN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((r=>{if(!r.isToken)return r.value;const a=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return vN.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return gN.test(e)}(a))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),wN.includes(e))throw new RangeError(r)}(a,t,String(e));return(0,cN[a[0]])(l,a,o.localize,c)})).join("")}function MN(e){const t=e.match(xN);return t?t[1].replace(EN,"'"):e}function RN(e,t,n){const r=IS(e,n?.in),o=r.getFullYear(),a=r.getDate(),i=RS(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const l=function(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=n.getMonth(),a=RS(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return r.setMonth(t,Math.min(a,l)),r}function IN(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class ON{constructor(e,t){this.Date=Date,this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):OS(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):AS(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return OS(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return AS(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):BS(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):function(e,t){const[n,r]=VS(0,e,t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(e,t),this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e,this):function(e,t){const n=IN(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,1-r),a=t.addDays(o,34);return e.getMonth()===a.getMonth()?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return HS(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=IS(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=e=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,this.options):HS(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=IS(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t)=>this.overrides?.format?this.overrides.format(e,t,this.options):kN(e,t,this.options),this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):QS(e),this.getWeek=e=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):eN(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+IS(e)>+IS(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+IS(e)<+IS(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):FS(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,r]=VS(0,e,t);return+TS(n)==+TS(r)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,r]=VS(0,e,t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,r]=VS(0,e,t);return n.getFullYear()===r.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=RS.bind(null,e));const t=IS(e,r);(!n||n<t||isNaN(+t))&&(n=t)})),RS(r,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=RS.bind(null,e));const t=IS(e,r);(!n||n>t||isNaN(+t))&&(n=t)})),RS(r,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):RN(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const r=IS(e,n?.in);return isNaN(+r)?RS(e,NaN):(r.setFullYear(t),r)}(e,t),this.startOfBroadcastWeek=e=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):IN(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):TS(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):jS(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=IS(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=e=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):NS(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):PS(e),this.options={locale:XS,...e},this.overrides=t}}const AN=new ON;const LN=i(void 0);function SN(){const e=a(LN);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}var NN=Object.freeze({__proto__:null,Button:function(e){return t.createElement("button",{...e})},CaptionLabel:function(e){return t.createElement("span",{...e})},Chevron:function(e){const{size:n=24,orientation:r="left",className:o}=e;return t.createElement("svg",{className:o,width:n,height:n,viewBox:"0 0 24 24"},"up"===r&&t.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===r&&t.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===r&&t.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===r&&t.createElement("polygon",{points:"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5"}))},Day:function(e){const{day:n,modifiers:r,...o}=e;return t.createElement("td",{...o})},DayButton:function(e){const{day:n,modifiers:r,...o}=e,a=t.useRef(null);return t.useEffect((()=>{r.focused&&a.current?.focus()}),[r.focused]),t.createElement("button",{ref:a,...o})},Dropdown:function(e){const{options:n,className:r,components:o,classNames:a,...i}=e,l=[a[xS.Dropdown],r].join(" "),s=n?.find((({value:e})=>e===i.value));return t.createElement("span",{"data-disabled":i.disabled,className:a[xS.DropdownRoot]},t.createElement(o.Select,{className:l,...i},n?.map((({value:e,label:n,disabled:r})=>t.createElement(o.Option,{key:e,value:e,disabled:r},n)))),t.createElement("span",{className:a[xS.CaptionLabel],"aria-hidden":!0},s?.label,t.createElement(o.Chevron,{orientation:"down",size:18,className:a[xS.Chevron]})))},DropdownNav:function(e){return t.createElement("div",{...e})},Footer:function(e){return t.createElement("div",{...e})},Month:function(e){const{calendarMonth:n,displayIndex:r,...o}=e;return t.createElement("div",{...o},e.children)},MonthCaption:function(e){const{calendarMonth:n,displayIndex:r,...o}=e;return t.createElement("div",{...o})},MonthGrid:function(e){return t.createElement("table",{...e})},Months:function(e){return t.createElement("div",{...e})},MonthsDropdown:function(e){const{components:n}=SN();return t.createElement(n.Dropdown,{...e})},Nav:function(e){const{onPreviousClick:n,onNextClick:r,previousMonth:o,nextMonth:a,...i}=e,{components:l,classNames:s,labels:{labelPrevious:c,labelNext:d}}=SN();return t.createElement("nav",{...i},t.createElement(l.PreviousMonthButton,{type:"button",className:s[xS.PreviousMonthButton],tabIndex:o?void 0:-1,disabled:!o||void 0,"aria-label":c(o),onClick:e.onPreviousClick},t.createElement(l.Chevron,{disabled:!o||void 0,className:s[xS.Chevron],orientation:"left"})),t.createElement(l.NextMonthButton,{type:"button",className:s[xS.NextMonthButton],tabIndex:a?void 0:-1,disabled:!a||void 0,"aria-label":d(a),onClick:e.onNextClick},t.createElement(l.Chevron,{disabled:!a||void 0,orientation:"right",className:s[xS.Chevron]})))},NextMonthButton:function(e){const{components:n}=SN();return t.createElement(n.Button,{...e})},Option:function(e){return t.createElement("option",{...e})},PreviousMonthButton:function(e){const{components:n}=SN();return t.createElement(n.Button,{...e})},Root:function(e){return t.createElement("div",{...e})},Select:function(e){return t.createElement("select",{...e})},Week:function(e){const{week:n,...r}=e;return t.createElement("tr",{...r})},WeekNumber:function(e){const{week:n,...r}=e;return t.createElement("th",{...r})},WeekNumberHeader:function(e){return t.createElement("th",{...e})},Weekday:function(e){return t.createElement("th",{...e})},Weekdays:function(e){return t.createElement("thead",{"aria-hidden":!0},t.createElement("tr",{...e}))},Weeks:function(e){return t.createElement("tbody",{...e})},YearsDropdown:function(e){const{components:n}=SN();return t.createElement(n.Dropdown,{...e})}});function jN(e){return{...NN,...e}}function DN(){const e={};for(const t in xS)e[xS[t]]=`rdp-${xS[t]}`;for(const t in ES)e[ES[t]]=`rdp-${ES[t]}`;for(const t in CS)e[CS[t]]=`rdp-${CS[t]}`;return e}function ZN(e,t,n){return(n??new ON(t)).format(e,"LLLL y")}const VN=ZN;function TN(e){return e.toString()}const BN=TN;var FN=Object.freeze({__proto__:null,formatCaption:ZN,formatDay:function(e,t,n){return(n??new ON(t)).format(e,"d")},formatMonthCaption:VN,formatMonthDropdown:function(e,t){return t.localize?.month(e)},formatWeekNumber:function(e){return e<10?`0${e.toLocaleString()}`:`${e.toLocaleString()}`},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new ON(t)).format(e,"cccccc")},formatYearCaption:BN,formatYearDropdown:TN});const PN={},HN={};function _N(e,t){try{const n=(PN[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return n in HN?HN[n]:zN(n,n.split(":"))}catch{if(e in HN)return HN[e];const t=e?.match(WN);return t?zN(e,t.slice(1)):NaN}}const WN=/([+-]\d\d):?(\d\d)?/;function zN(e,t){const n=+t[0],r=+(t[1]||0);return HN[e]=n>0?60*n+r:60*n-r}class $N extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_N(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),GN(this),qN(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new $N(...t,e):new $N(Date.now(),e)}withTimeZone(e){return new $N(+this,e)}getTimezoneOffset(){return-_N(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),qN(this),+this}[Symbol.for("constructDateFrom")](e){return new $N(+new Date(e),this.timeZone)}}const UN=/^(get|set)(?!UTC)/;function qN(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function GN(e){const t=_N(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=r- -new Date(+n).getTimezoneOffset(),a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const i=r-t;i&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i);const l=_N(e.timeZone,e),s=-new Date(+e).getTimezoneOffset()-l-i;if(l!==t&&s){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const t=l-_N(e.timeZone,e);t&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+t),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+t))}}Object.getOwnPropertyNames(Date.prototype).forEach((e=>{if(!UN.test(e))return;const t=e.replace(UN,"$1UTC");$N.prototype[t]&&(e.startsWith("get")?$N.prototype[e]=function(){return this.internal[t]()}:($N.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),function(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),GN(e)}(this),+this},$N.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),qN(this),+this}))}));class YN extends $N{static tz(e,...t){return t.length?new YN(...t,e):new YN(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new YN(+this,e)}[Symbol.for("constructDateFrom")](e){return new YN(+new Date(e),this.timeZone)}}function KN(e,t,n){return(n??new ON(t)).format(e,"LLLL y")}const XN=KN;function QN(e,t,n,r){let o=(r??new ON(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const JN=QN;var ej=Object.freeze({__proto__:null,labelCaption:XN,labelDay:JN,labelDayButton:QN,labelGrid:KN,labelGridcell:function(e,t,n,r){let o=(r??new ON(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o},labelMonthDropdown:function(e){return"Choose the Month"},labelNav:function(){return""},labelNext:function(e){return"Go to the Next Month"},labelPrevious:function(e){return"Go to the Previous Month"},labelWeekNumber:function(e,t){return`Week ${e}`},labelWeekNumberHeader:function(e){return"Week Number"},labelWeekday:function(e,t,n){return(n??new ON(t)).format(e,"cccc")},labelYearDropdown:function(e){return"Choose the Year"}});function tj(e,t){const{month:n,defaultMonth:r,today:o=(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date),numberOfMonths:a=1,endMonth:i,startMonth:l}=e;let s=n||r||o;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=t;if(i&&c(i,s)<0){s=d(i,-1*(a-1))}return l&&c(s,l)<0&&(s=l),u(s)}class nj{constructor(e,t,n=AN){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class rj{constructor(e,t){this.date=e,this.weeks=t}}class oj{constructor(e,t){this.days=t,this.weekNumber=e}}function aj(e,t){const[n,r]=c(e);return[void 0===t?n:t,r]}function ij(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:l,addYears:s,endOfYear:c}=t,{fromYear:d,toYear:u,fromMonth:f,toMonth:h}=e;!n&&f&&(n=f),!n&&d&&(n=new Date(d,0,1)),!r&&h&&(r=h),!r&&u&&(r=new Date(u,11,31));const m=e.captionLayout?.startsWith("dropdown");n?n=i(n):d?n=new Date(d,0,1):!n&&m&&(n=o(s(e.today??(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date),-100)));r?r=l(r):u?r=new Date(u,11,31):!r&&m&&(r=c(e.today??(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date)));return[n?a(n):n,r?a(r):r]}(e,t),{startOfMonth:o,endOfMonth:a}=t,i=tj(e,t),[l,s]=aj(i,e.month?o(e.month):void 0);d((()=>{const n=tj(e,t);s(n)}),[e.timeZone]);const c=function(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let n=0;n<o;n++){const o=r.addMonths(e,n);if(t&&o>t)break;a.push(o)}return a}(l,r,e,t),u=function(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:l,broadcastCalendar:s}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:m,endOfWeek:p,isAfter:g,startOfBroadcastWeek:v,startOfISOWeek:w,startOfWeek:b}=r,y=s?v(o,r):i?w(o):b(o),x=d(s?f(a,r):i?h(m(a)):p(m(a)),y),E=u(a,o)+1,C=[];for(let e=0;e<=x;e++){const n=c(y,e);if(t&&g(n,t))break;C.push(n)}const k=(s?35:42)*E;if(l&&C.length<k){const e=k-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(c,e.endMonth?a(e.endMonth):void 0,e,t),f=function(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:l,endOfWeek:s,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:h}=r,m=e.reduce(((e,m)=>{const p=n.broadcastCalendar?u(m,r):n.ISOWeek?f(m):h(m),g=n.broadcastCalendar?a(m,r):n.ISOWeek?i(l(m)):s(l(m)),v=t.filter((e=>e>=p&&e<=g)),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&v.length<w){const e=t.filter((e=>{const t=w-v.length;return e>g&&e<=o(g,t)}));v.push(...e)}const b=v.reduce(((e,t)=>{const o=n.ISOWeek?c(t):d(t),a=e.find((e=>e.weekNumber===o)),i=new nj(t,m,r);return a?a.days.push(i):e.push(new oj(o,[i])),e}),[]),y=new rj(m,b);return e.push(y),e}),[]);return n.reverseMonths?m.reverse():m}(c,u,e,t),h=function(e){return e.reduce(((e,t)=>[...e,...t.weeks]),[])}(f),m=f.reduce(((e,t)=>[...e,...t.weeks.reduce(((e,t)=>[...e,...t.days]),[])]),[]);const p=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:s}=r,c=o?a??1:1,d=i(e);return t&&s(d,t)<=0?void 0:l(d,-c)}(l,n,e,t),g=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:s}=r,c=o?a:1,d=i(e);return t&&s(t,e)<a?void 0:l(d,c)}(l,r,e,t),{disableNavigation:v,onMonthChange:w}=e,b=e=>{if(v)return;let t=o(e);n&&t<o(n)&&(t=o(n)),r&&t>o(r)&&(t=o(r)),s(t),w?.(t)},y={months:f,weeks:h,days:m,navStart:n,navEnd:r,previousMonth:p,nextMonth:g,goToMonth:b,goToDay:e=>{(e=>h.some((t=>t.days.some((t=>t.isEqualTo(e))))))(e)||b(e.date)}};return y}function lj(e,t,n=!1,r=AN){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:l}=r;if(o&&a){i(a,o)<0&&([o,a]=[a,o]);return i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?l(a,t):!(n||!o)&&l(o,t)}function sj(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function cj(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function dj(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function uj(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function fj(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function hj(e,t){return Array.isArray(e)&&e.every(t.isDate)}function mj(e,t,n=AN){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return o(e,t);if(hj(t,n))return t.includes(e);if(cj(t))return lj(t,e,!1,n);if(fj(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(sj(t)){const n=a(t.before,e)>0,r=a(t.after,e)<0;return i(t.before,t.after)?r&&n:n||r}return dj(t)?a(e,t.after)>0:uj(t)?a(t.before,e)>0:"function"==typeof t&&t(e)}))}function pj(e,t,n,r,o,a,i,l=0){if(l>365)return;const s=function(e,t,n,r,o,a,i){const{ISOWeek:l,broadcastCalendar:s}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:m,endOfWeek:p,max:g,min:v,startOfBroadcastWeek:w,startOfISOWeek:b,startOfWeek:y}=i,x={day:c,week:u,month:d,year:f,startOfWeek:e=>s?w(e,i):l?b(e):y(e),endOfWeek:e=>s?h(e,i):l?m(e):p(e)};let E=x[e](n,"after"===t?1:-1);return"before"===t&&r?E=g([r,E]):"after"===t&&o&&(E=v([o,E])),E}(e,t,n.date,r,o,a,i),c=Boolean(a.disabled&&mj(s,a.disabled,i)),d=Boolean(a.hidden&&mj(s,a.hidden,i)),u=new nj(s,s,i);return c||d?pj(e,t,u,r,o,a,i,l+1):u}function gj(e,t,n,r,o){const{autoFocus:a}=e,[i,l]=c(),s=function(e,t,n,r){let o,a=0,i=!1;for(;a<e.length&&!i;){const l=e[a],s=t(l);s[ES.disabled]||s[ES.hidden]||s[ES.outside]||(s[ES.focused]||r?.isEqualTo(l)||n(l.date)||s[ES.today])&&(o=l,i=!0),a++}return o||(o=e.find((e=>{const n=t(e);return!n[ES.disabled]&&!n[ES.hidden]&&!n[ES.outside]}))),o}(t.days,n,r||(()=>!1),i),[d,u]=c(a?s:void 0);return{isFocusTarget:e=>Boolean(s?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(n,r)=>{if(!d)return;const a=pj(n,r,d,t.navStart,t.navEnd,e,o);a&&(t.goToDay(a),u(a))}}}function vj(e,t,n=AN){return lj(e,t.from,!1,n)||lj(e,t.to,!1,n)||lj(t,e.from,!1,n)||lj(t,e.to,!1,n)}function wj(e,t,n=AN){const r=Array.isArray(t)?t:[t],o=r.filter((e=>"function"!=typeof e)).some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return lj(e,t,!1,n);if(hj(t,n))return t.some((t=>lj(e,t,!1,n)));if(cj(t))return!(!t.from||!t.to)&&vj(e,{from:t.from,to:t.to},n);if(fj(t))return function(e,t,n=AN){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}(e,t.dayOfWeek,n);if(sj(t)){return n.isAfter(t.before,t.after)?vj(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):mj(e.from,t,n)||mj(e.to,t,n)}return!(!dj(t)&&!uj(t))&&(mj(e.from,t,n)||mj(e.to,t,n))}));if(o)return!0;const a=r.filter((e=>"function"==typeof e));if(a.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(a.some((e=>e(t))))return!0;t=n.addDays(t,1)}}return!1}function bj(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:i}=e,[l,s]=aj(o,i?o:void 0),c=i?o:l;return{selected:c,select:(o,l,d)=>{const{min:u,max:f}=e,h=o?function(e,t,n=0,r=0,o=!1,a=AN){const{from:i,to:l}=t||{},{isSameDay:s,isAfter:c,isBefore:d}=a;let u;if(i||l){if(i&&!l)u=s(i,e)?o?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&l)if(s(i,e)&&s(l,e))u=o?{from:i,to:l}:void 0;else if(s(i,e))u={from:i,to:n>0?void 0:e};else if(s(l,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:l};else if(c(e,i))u={from:i,to:e};else{if(!c(e,l))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(r>0&&t>r||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(o,c,u,f,a,t):void 0;return r&&n&&h?.from&&h.to&&wj({from:h.from,to:h.to},n,t)&&(h.from=o,h.to=void 0),i||s(h),i?.(h,o,l,d),h},isSelected:e=>c&&lj(c,e,!1,t)}}function yj(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=aj(n,o?n:void 0),l=o?n:a,{isSameDay:s}=t;return{selected:l,select:(e,t,n)=>{let a=e;return!r&&l&&l&&s(e,l)&&(a=void 0),o||i(a),o?.(a,e,t,n),a},isSelected:e=>!!l&&s(l,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=aj(n,o?n:void 0),l=o?n:a,{isSameDay:s}=t,c=e=>l?.some((t=>s(t,e)))??!1,{min:d,max:u}=e;return{selected:l,select:(e,t,n)=>{let a=[...l??[]];if(c(e)){if(l?.length===d)return;if(r&&1===l?.length)return;a=l?.filter((t=>!s(t,e)))}else a=l?.length===u?[e]:[...a,e];return o||i(a),o?.(a,e,t,n),a},isSelected:c}}(e,t),o=bj(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function xj(e){const{components:n,formatters:r,labels:a,dateLib:i,locale:l,classNames:c}=s((()=>{const t={...XS,...e.locale};return{dateLib:new ON({locale:t,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens},e.dateLib),components:jN(e.components),formatters:(n=e.formatters,n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...FN,...n}),labels:{...ej,...e.labels},locale:t,classNames:{...DN(),...e.classNames}};var n}),[e.classNames,e.components,e.dateLib,e.firstWeekContainsDate,e.formatters,e.labels,e.locale,e.useAdditionalDayOfYearTokens,e.useAdditionalWeekYearTokens,e.weekStartsOn,e.broadcastCalendar]),{captionLayout:d,mode:u,onDayBlur:f,onDayClick:h,onDayFocus:m,onDayKeyDown:p,onDayMouseEnter:g,onDayMouseLeave:v,onNextClick:w,onPrevClick:b,showWeekNumber:y,styles:x}=e,{formatCaption:E,formatDay:C,formatMonthDropdown:k,formatWeekNumber:M,formatWeekNumberHeader:R,formatWeekdayName:I,formatYearDropdown:O}=r,A=ij(e,i),{days:L,months:S,navStart:N,navEnd:j,previousMonth:D,nextMonth:Z,goToMonth:V}=A,T=function(e,t,n){const{disabled:r,hidden:o,modifiers:a,showOutsideDays:i,broadcastCalendar:l,today:s}=t,{isSameDay:c,isSameMonth:d,startOfMonth:u,isBefore:f,endOfMonth:h,isAfter:m}=n,p=t.startMonth&&u(t.startMonth),g=t.endMonth&&h(t.endMonth),v={[ES.focused]:[],[ES.outside]:[],[ES.disabled]:[],[ES.hidden]:[],[ES.today]:[]},w={};for(const u of e){const{date:e,displayMonth:h}=u,b=Boolean(h&&!d(e,h)),y=Boolean(p&&f(e,p)),x=Boolean(g&&m(e,g)),E=Boolean(r&&mj(e,r,n)),C=Boolean(o&&mj(e,o,n))||y||x||!l&&!i&&b||l&&!1===i&&b,k=c(e,s??(t.timeZone?YN.tz(t.timeZone):n.Date?new n.Date:new Date));b&&v.outside.push(u),E&&v.disabled.push(u),C&&v.hidden.push(u),k&&v.today.push(u),a&&Object.keys(a).forEach((t=>{const r=a?.[t];r&&mj(e,r,n)&&(w[t]?w[t].push(u):w[t]=[u])}))}return e=>{const t={[ES.focused]:!1,[ES.disabled]:!1,[ES.hidden]:!1,[ES.outside]:!1,[ES.today]:!1},n={};for(const n in v){const r=v[n];t[n]=r.some((t=>t===e))}for(const t in w)n[t]=w[t].some((t=>t===e));return{...t,...n}}}(L,e,i),{isSelected:B,select:F,selected:P}=yj(e,i)??{},{blur:H,focused:_,isFocusTarget:W,moveFocus:z,setFocused:$}=gj(e,A,T,B??(()=>!1),i),{labelDayButton:U,labelGridcell:q,labelGrid:G,labelMonthDropdown:Y,labelNav:K,labelWeekday:X,labelWeekNumber:Q,labelWeekNumberHeader:J,labelYearDropdown:ee}=a,te=s((()=>function(e,t,n){const r=n?YN.tz(n):e.Date?new e.Date:new Date,o=t?e.startOfISOWeek(r):e.startOfWeek(r),a=[];for(let t=0;t<7;t++){const n=e.addDays(o,t);a.push(n)}return a}(i,e.ISOWeek,e.timeZone)),[i,e.ISOWeek,e.timeZone]),ne=void 0!==u||void 0!==h,re=o((()=>{D&&(V(D),b?.(D))}),[D,V,b]),oe=o((()=>{Z&&(V(Z),w?.(Z))}),[V,Z,w]),ae=o(((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),$(e),F?.(e.date,t,n),h?.(e.date,t,n)}),[F,h,$]),ie=o(((e,t)=>n=>{$(e),m?.(e.date,t,n)}),[m,$]),le=o(((e,t)=>n=>{H(),f?.(e.date,t,n)}),[H,f]),se=o(((t,n)=>r=>{const o={ArrowLeft:["day","rtl"===e.dir?"after":"before"],ArrowRight:["day","rtl"===e.dir?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(o[r.key]){r.preventDefault(),r.stopPropagation();const[e,t]=o[r.key];z(e,t)}p?.(t.date,n,r)}),[z,p,e.dir]),ce=o(((e,t)=>n=>{g?.(e.date,t,n)}),[g]),de=o(((e,t)=>n=>{v?.(e.date,t,n)}),[v]),ue=o((e=>t=>{const n=Number(t.target.value),r=i.setMonth(i.startOfMonth(e),n);V(r)}),[i,V]),fe=o((e=>t=>{const n=Number(t.target.value),r=i.setYear(i.startOfMonth(e),n);V(r)}),[i,V]),{className:he,style:me}=s((()=>({className:[c[xS.Root],e.className].filter(Boolean).join(" "),style:{...x?.[xS.Root],...e.style}})),[c,e.className,e.style,x]),pe=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0};return Object.entries(e).forEach((([e,n])=>{e.startsWith("data-")&&(t[e]=n)})),t}(e),ge={dayPickerProps:e,selected:P,select:F,isSelected:B,months:S,nextMonth:Z,previousMonth:D,goToMonth:V,getModifiers:T,components:n,classNames:c,styles:x,labels:a,formatters:r};return t.createElement(LN.Provider,{value:ge},t.createElement(n.Root,{className:he,style:me,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...pe},t.createElement(n.Months,{className:c[xS.Months],style:x?.[xS.Months]},!e.hideNavigation&&t.createElement(n.Nav,{className:c[xS.Nav],style:x?.[xS.Nav],"aria-label":K(),onPreviousClick:re,onNextClick:oe,previousMonth:D,nextMonth:Z}),S.map(((o,a)=>{const s=function(e,t,n,r,o){if(!t)return;if(!n)return;const{addMonths:a,startOfMonth:i}=o,l=e.getFullYear(),s=[];let c=t;for(;s.length<12;)s.push(c.getMonth()),c=a(c,1);const d=s.sort(((e,t)=>e-t)),u=d.map((e=>{const a=r.formatMonthDropdown(e,o.options.locale??XS),s=o.Date?new o.Date(l,e):new Date(l,e);return{value:e,label:a,disabled:t&&s<i(t)||n&&s>i(n)||!1}}));return u}(o.date,N,j,r,i),f=function(e,t,n,r){if(!e)return;if(!t)return;const{startOfYear:o,endOfYear:a,addYears:i,isBefore:l,isSameYear:s}=r,c=o(e),d=a(t),u=[];let f=c;for(;l(f,d)||s(f,d);)u.push(f.getFullYear()),f=i(f,1);return u.map((e=>({value:e,label:n.formatYearDropdown(e),disabled:!1})))}(N,j,r,i);return t.createElement(n.Month,{className:c[xS.Month],style:x?.[xS.Month],key:a,displayIndex:a,calendarMonth:o},t.createElement(n.MonthCaption,{className:c[xS.MonthCaption],style:x?.[xS.MonthCaption],calendarMonth:o,displayIndex:a},d?.startsWith("dropdown")?t.createElement(n.DropdownNav,{className:c[xS.Dropdowns],style:x?.[xS.Dropdowns]},"dropdown"===d||"dropdown-months"===d?t.createElement(n.MonthsDropdown,{className:c[xS.MonthsDropdown],"aria-label":Y(),classNames:c,components:n,disabled:Boolean(e.disableNavigation),onChange:ue(o.date),options:s,style:x?.[xS.Dropdown],value:o.date.getMonth()}):t.createElement("span",{role:"status","aria-live":"polite"},k(o.date.getMonth(),l)),"dropdown"===d||"dropdown-years"===d?t.createElement(n.YearsDropdown,{className:c[xS.YearsDropdown],"aria-label":ee(i.options),classNames:c,components:n,disabled:Boolean(e.disableNavigation),onChange:fe(o.date),options:f,style:x?.[xS.Dropdown],value:o.date.getFullYear()}):t.createElement("span",{role:"status","aria-live":"polite"},O(o.date.getFullYear()))):t.createElement(n.CaptionLabel,{className:c[xS.CaptionLabel],role:"status","aria-live":"polite"},E(o.date,i.options,i))),t.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":G(o.date,i.options,i)||void 0,className:c[xS.MonthGrid],style:x?.[xS.MonthGrid]},!e.hideWeekdays&&t.createElement(n.Weekdays,{className:c[xS.Weekdays],style:x?.[xS.Weekdays]},y&&t.createElement(n.WeekNumberHeader,{"aria-label":J(i.options),className:c[xS.WeekNumberHeader],style:x?.[xS.WeekNumberHeader],scope:"col"},R()),te.map(((e,r)=>t.createElement(n.Weekday,{"aria-label":X(e,i.options,i),className:c[xS.Weekday],key:r,style:x?.[xS.Weekday],scope:"col"},I(e,i.options,i))))),t.createElement(n.Weeks,{className:c[xS.Weeks],style:x?.[xS.Weeks]},o.weeks.map(((r,o)=>t.createElement(n.Week,{className:c[xS.Week],key:r.weekNumber,style:x?.[xS.Week],week:r},y&&t.createElement(n.WeekNumber,{week:r,style:x?.[xS.WeekNumber],"aria-label":Q(r.weekNumber,{locale:l}),className:c[xS.WeekNumber],scope:"row",role:"rowheader"},M(r.weekNumber)),r.days.map((r=>{const{date:o}=r,a=T(r);if(a[ES.focused]=!a.hidden&&Boolean(_?.isEqualTo(r)),a[CS.selected]=!a.disabled&&(B?.(o)||a.selected),cj(P)){const{from:e,to:t}=P;a[CS.range_start]=Boolean(e&&t&&i.isSameDay(o,e)),a[CS.range_end]=Boolean(e&&t&&i.isSameDay(o,t)),a[CS.range_middle]=lj(P,o,!0,i)}const l=function(e,t={},n={}){let r={...t?.[xS.Day]};return Object.entries(e).filter((([,e])=>!0===e)).forEach((([e])=>{r={...r,...n?.[e]}})),r}(a,x,e.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter((([,e])=>!0===e)).reduce(((e,[r])=>(n[r]?e.push(n[r]):t[ES[r]]?e.push(t[ES[r]]):t[CS[r]]&&e.push(t[CS[r]]),e)),[t[xS.Day]])}(a,c,e.modifiersClassNames),d=ne||a.hidden?void 0:q(o,a,i.options,i);return t.createElement(n.Day,{key:`${i.format(o,"yyyy-MM-dd")}_${i.format(r.displayMonth,"yyyy-MM")}`,day:r,modifiers:a,className:s.join(" "),style:l,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":i.format(o,"yyyy-MM-dd"),"data-month":r.outside?i.format(o,"yyyy-MM"):void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":r.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ne?t.createElement(n.DayButton,{className:c[xS.DayButton],style:x?.[xS.DayButton],type:"button",day:r,modifiers:a,disabled:a.disabled||void 0,tabIndex:W(r)?0:-1,"aria-label":U(o,a,i.options,i),onClick:ae(r,a),onBlur:le(r,a),onFocus:ie(r,a),onKeyDown:se(r,a),onMouseEnter:ce(r,a),onMouseLeave:de(r,a)},C(o,i.options,i)):!a.hidden&&C(r.date,i.options,i))}))))))))}))),e.footer&&t.createElement(n.Footer,{className:c[xS.Footer],style:x?.[xS.Footer],role:"status","aria-live":"polite"},e.footer)))}function Ej(e){var{className:t,classNames:n,showOutsideDays:r=!0}=e,o=IC(e,["className","classNames","showOutsideDays"]);const a=DN();return E(xj,Object.assign({showOutsideDays:r,captionLayout:"dropdown-years"},o,{className:LC("bg-bg-bg1 text-common-black border-bg-bg1",t),classNames:Object.assign(Object.assign(Object.assign({},a),{day_button:LC(a.day_button,"size-9"),day:"typography-subtitle1 ",today:"text-bold text-common-black [&_button]:rounded-full [&_button]:!border-primary [&_button]:!border [&_button]:!border-solid",selected:"bg-primary !text-state-primary-text-solid rounded-full ",weekdays:"text-gray-400",month_caption:LC(a.month_caption,"h-[54px]"),outside:"text-gray-400",nav:LC(a.nav,"gap-6 absolute flex right-0"),chevron:"fill-primary",root:LC(a.root,"px-6 py-4"),caption_label:LC(a.caption_label,"gap-2 flex items-center"),months:"flex flex-col relative",disabled:"[&_button]:rounded-full [&_button]:!text-input-disable-text"}),n),styles:{caption_label:{zIndex:1,position:"relative",display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",border:0},dropdown:{zIndex:2,opacity:0,WebkitAppearance:"none",MozAppearance:"none",appearance:"none",position:"absolute",insetBlockStart:0,insetBlockEnd:0,insetInlineStart:0,width:"100%",margin:0,padding:0,cursor:"inherit",border:"none",lineHeight:"inherit"},dropdowns:{position:"relative",display:"inline-flex",alignItems:"center",gap:4},dropdown_root:{position:"relative",display:"inline-flex",alignItems:"center"}}}))}Ej.displayName="Calendar";var Cj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function kj(t,n=globalThis?.document){const r=aL(t);e.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})}),[r,n])}var Mj,Rj="dismissableLayer.update",Ij="dismissableLayer.pointerDownOutside",Oj="dismissableLayer.focusOutside",Aj=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lj=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(Aj),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){Nj(Ij,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){Nj(Oj,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Mj=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Sj(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Mj)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Sj())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Rj,e),()=>document.removeEventListener(Rj,e)}),[]),E(Cj.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));Lj.displayName="DismissableLayer";function Sj(){const e=new CustomEvent(Rj);document.dispatchEvent(e)}function Nj(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(Aj),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Cj.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var jj=0;function Dj(){e.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zj()),document.body.insertAdjacentElement("beforeend",e[1]??Zj()),jj++,()=>{1===jj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),jj--}}),[])}function Zj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vj="focusScope.autoFocusOnMount",Tj="focusScope.autoFocusOnUnmount",Bj={bubbles:!1,cancelable:!0},Fj=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:Wj(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||Wj(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Wj(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){zj.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Vj,Bj);s.addEventListener(Vj,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Wj(r,{select:t}),document.activeElement!==n)return}((e=Pj(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Wj(s))}return()=>{s.removeEventListener(Vj,d),setTimeout((()=>{const e=new CustomEvent(Tj,Bj);s.addEventListener(Tj,u),s.dispatchEvent(e),e.defaultPrevented||Wj(t??document.body,{select:!0}),s.removeEventListener(Tj,u),zj.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=Pj(e),n=Hj(t,e),r=Hj(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&Wj(a,{select:!0})):(e.preventDefault(),r&&Wj(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(Cj.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function Pj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hj(e,t){for(const n of e)if(!_j(n,{upTo:t}))return n}function _j(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Wj(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Fj.displayName="FocusScope";var zj=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$j(e,t),e.unshift(t)},remove(t){e=$j(e,t),e[0]?.resume()}}}();function $j(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Uj=e["useId".toString()]||(()=>{}),qj=0;function Gj(t){const[n,r]=e.useState(Uj());return sL((()=>{r((e=>e??String(qj++)))}),[t]),n?`radix-${n}`:""}var Yj=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(Cj.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));Yj.displayName="Arrow";var Kj=Yj;function Xj(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var Qj="Popper",[Jj,eD]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Xj(o,...n)]}(Qj),[tD,nD]=Jj(Qj),rD=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(tD,{scope:n,anchor:o,onAnchorChange:a,children:r})};rD.displayName=Qj;var oD="PopperAnchor",aD=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=nD(oD,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(Cj.div,{...a,ref:s})}));aD.displayName=oD;var iD="PopperContent",[lD,sD]=Jj(iD),cD=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=nD(iD,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(hD),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),mD({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=pD(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(lD,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(Cj.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));cD.displayName=iD;var dD="PopperArrow",uD={top:"bottom",right:"left",bottom:"top",left:"right"},fD=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=sD(dD,n),a=uD[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E(Kj,{...r,ref:t,style:{...r.style,display:"block"}})})}));function hD(e){return null!==e}fD.displayName=dD;var mD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=pD(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function pD(e){const[t,n="center"]=e.split("-");return[t,n]}var gD=rD,vD=aD,wD=cD,bD=fD,yD=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(Cj.div,{...o,ref:n}),l):null}));yD.displayName="Portal";var xD=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=ED(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=ED(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=ED(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=ED(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function ED(e){return e?.animationName||"none"}xD.displayName="Presence";var CD=new WeakMap,kD=new WeakMap,MD={},RD=0,ID=function(e){return e&&(e.host||ID(e.parentNode))},OD=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=ID(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);MD[n]||(MD[n]=new WeakMap);var a=MD[n],i=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(CD.get(e)||0)+1,c=(a.get(e)||0)+1;CD.set(e,s),a.set(e,c),i.push(e),1===s&&o&&kD.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return d(t),l.clear(),RD++,function(){i.forEach((function(e){var t=CD.get(e)-1,o=a.get(e)-1;CD.set(e,t),a.set(e,o),t||(kD.has(e)||e.removeAttribute(r),kD.delete(e)),o||e.removeAttribute(n)})),--RD||(CD=new WeakMap,CD=new WeakMap,kD=new WeakMap,MD={})}},AD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),OD(r,o,n,"aria-hidden")):function(){return null}},LD="right-scroll-bar-position",SD="width-before-scroll-bar";function ND(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var jD="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,DD=new WeakMap;function ZD(e,t){var n,r,o,a=(n=null,r=function(t){return e.forEach((function(e){return ND(e,t)}))},(o=c((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return jD((function(){var t=DD.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach((function(e){r.has(e)||ND(e,null)})),r.forEach((function(e){n.has(e)||ND(e,o)}))}DD.set(a,e)}),[e]),a}function VD(e){return e}var TD=function(t){var n=t.sideCar,r=IC(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,RC({},r))};TD.isSideCarExport=!0;var BD=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=VD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=RC({async:!0,ssr:!1},e),t}(),FD=function(){},PD=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:FD,onWheelCapture:FD,onTouchMoveCapture:FD}),a=o[0],i=o[1],l=t.forwardProps,s=t.children,c=t.className,d=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,m=t.noIsolation,p=t.inert,g=t.allowPinchZoom,v=t.as,w=void 0===v?"div":v,b=t.gapMode,y=IC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=h,E=ZD([r,n]),C=RC(RC({},y),a);return e.createElement(e.Fragment,null,u&&e.createElement(x,{sideCar:BD,removeScrollBar:d,shards:f,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:b}),l?e.cloneElement(e.Children.only(s),RC(RC({},C),{ref:E})):e.createElement(w,RC({},C,{className:c,ref:E}),s))}));PD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},PD.classNames={fullWidth:SD,zeroRight:LD};function HD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var _D=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=HD())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WD=function(){var t,n=(t=_D(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},zD={left:0,top:0,right:0,gap:0},$D=function(e){return parseInt(e||"",10)||0},UD=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return zD;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[$D(n),$D(r),$D(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qD=WD(),GD="data-scroll-locked",YD=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(GD,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(LD," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(SD," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(LD," .").concat(LD," {\n right: 0 ").concat(r,";\n }\n \n .").concat(SD," .").concat(SD," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(GD,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},KD=function(){var e=parseInt(document.body.getAttribute(GD)||"0",10);return isFinite(e)?e:0},XD=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect((function(){return document.body.setAttribute(GD,(KD()+1).toString()),function(){var e=KD()-1;e<=0?document.body.removeAttribute(GD):document.body.setAttribute(GD,e.toString())}}),[]);var i=e.useMemo((function(){return UD(a)}),[a]);return e.createElement(qD,{styles:YD(i,!n,a,r?"":"!important")})},QD=!1;if("undefined"!=typeof window)try{var JD=Object.defineProperty({},"passive",{get:function(){return QD=!0,!0}});window.addEventListener("test",JD,JD),window.removeEventListener("test",JD,JD)}catch(e){QD=!1}var eZ=!!QD&&{passive:!1},tZ=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},nZ=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rZ(e,r)){var o=oZ(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rZ=function(e,t){return"v"===e?function(e){return tZ(e,"overflowY")}(t):function(e){return tZ(e,"overflowX")}(t)},oZ=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},aZ=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iZ=function(e){return[e.deltaX,e.deltaY]},lZ=function(e){return e&&"current"in e?e.current:e},sZ=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},cZ=0,dZ=[];function uZ(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var fZ,hZ=(fZ=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(cZ++)[0],i=e.useState(WD)[0],l=e.useRef(t);e.useEffect((function(){l.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(lZ),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var n,a=aZ(e),i=r.current,s="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=nZ(u,d);if(!f)return!0;if(f?n=u:(n="v"===u?"h":"v",f=nZ(u,d)),!f)return!1;if(!o.current&&"changedTouches"in e&&(s||c)&&(o.current=n),!n)return!0;var h=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,l=t.contains(i),s=!1,c=a>0,d=0,u=0;do{var f=oZ(e,i),h=f[0],m=f[1]-f[2]-o*h;(h||m)&&rZ(e,i)&&(d+=m,u+=h),i=i instanceof ShadowRoot?i.host:i.parentNode}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(s=!0),s}(h,t,e,"h"===h?s:c)}),[]),c=e.useCallback((function(e){var t=e;if(dZ.length&&dZ[dZ.length-1]===i){var r="deltaY"in t?iZ(t):aZ(t),o=n.current.filter((function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(l.current.shards||[]).map(lZ).filter(Boolean).filter((function(e){return e.contains(t.target)}));(a.length>0?s(t,a[0]):!l.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),d=e.useCallback((function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:uZ(r)};n.current.push(a),setTimeout((function(){n.current=n.current.filter((function(e){return e!==a}))}),1)}),[]),u=e.useCallback((function(e){r.current=aZ(e),o.current=void 0}),[]),f=e.useCallback((function(e){d(e.type,iZ(e),e.target,s(e,t.lockRef.current))}),[]),h=e.useCallback((function(e){d(e.type,aZ(e),e.target,s(e,t.lockRef.current))}),[]);e.useEffect((function(){return dZ.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,eZ),document.addEventListener("touchmove",c,eZ),document.addEventListener("touchstart",u,eZ),function(){dZ=dZ.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,eZ),document.removeEventListener("touchmove",c,eZ),document.removeEventListener("touchstart",u,eZ)}}),[]);var m=t.removeScrollBar,p=t.inert;return e.createElement(e.Fragment,null,p?e.createElement(i,{styles:sZ(a)}):null,m?e.createElement(XD,{gapMode:t.gapMode}):null)},BD.useMedium(fZ),TD),mZ=e.forwardRef((function(t,n){return e.createElement(PD,RC({},t,{ref:n,sideCar:hZ}))}));mZ.classNames=PD.classNames;var pZ="Popover",[gZ]=nL(pZ,[eD]),vZ=eD(),[wZ,bZ]=gZ(pZ),yZ=t=>{const{__scopePopover:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=t,s=vZ(n),c=e.useRef(null),[d,u]=e.useState(!1),[f=!1,h]=iL({prop:o,defaultProp:a,onChange:i});return E(gD,{...s,children:E(wZ,{scope:n,contentId:Gj(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:e.useCallback((()=>h((e=>!e))),[h]),hasCustomAnchor:d,onCustomAnchorAdd:e.useCallback((()=>u(!0)),[]),onCustomAnchorRemove:e.useCallback((()=>u(!1)),[]),modal:l,children:r})})};yZ.displayName=pZ;var xZ="PopoverAnchor";e.forwardRef(((t,n)=>{const{__scopePopover:r,...o}=t,a=bZ(xZ,r),i=vZ(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:s}=a;return e.useEffect((()=>(l(),()=>s())),[l,s]),E(vD,{...i,...o,ref:n})})).displayName=xZ;var EZ="PopoverTrigger",CZ=e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=bZ(EZ,n),a=vZ(n),i=tL(t,o.triggerRef),l=E(Cj.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":DZ(o.open),...r,ref:i,onClick:oL(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:E(vD,{asChild:!0,...a,children:l})}));CZ.displayName=EZ;var kZ="PopoverPortal",[MZ,RZ]=gZ(kZ,{forceMount:void 0}),IZ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=bZ(kZ,t);return E(MZ,{scope:t,forceMount:n,children:E(xD,{present:n||a.open,children:E(yD,{asChild:!0,container:o,children:r})})})};IZ.displayName=kZ;var OZ="PopoverContent",AZ=e.forwardRef(((e,t)=>{const n=RZ(OZ,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=bZ(OZ,e.__scopePopover);return E(xD,{present:r||a.open,children:a.modal?E(LZ,{...o,ref:t}):E(SZ,{...o,ref:t})})}));AZ.displayName=OZ;var LZ=e.forwardRef(((t,n)=>{const r=bZ(OZ,t.__scopePopover),o=e.useRef(null),a=tL(n,o),i=e.useRef(!1);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(mZ,{as:fL,allowPinchZoom:!0,children:E(NZ,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{e.preventDefault(),i.current||r.triggerRef.current?.focus()})),onPointerDownOutside:oL(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),SZ=e.forwardRef(((t,n)=>{const r=bZ(OZ,t.__scopePopover),o=e.useRef(!1),a=e.useRef(!1);return E(NZ,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})})),NZ=e.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:d,...u}=e,f=bZ(OZ,n),h=vZ(n);return Dj(),E(Fj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:E(Lj,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:E(wD,{"data-state":DZ(f.open),role:"dialog",id:f.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),jZ="PopoverClose";e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=bZ(jZ,n);return E(Cj.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,(()=>o.onOpenChange(!1)))})})).displayName=jZ;function DZ(e){return e?"open":"closed"}e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=vZ(n);return E(bD,{...o,...r,ref:t})})).displayName="PopoverArrow";var ZZ=IZ,VZ=AZ;const TZ=yZ,BZ=CZ,FZ=e.forwardRef(((e,t)=>{var{className:n,align:r="center",sideOffset:o=4}=e,a=IC(e,["className","align","sideOffset"]);return E(ZZ,{children:E(VZ,Object.assign({ref:t,align:r,sideOffset:o,className:LC("z-50 min-w-72 rounded-md border bg-modal-surface border-bg-stroke3 overflow-hidden p-0 text-text-g-contrast-medium shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},a))})}));FZ.displayName=VZ.displayName;const PZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function HZ(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _Z={date:HZ({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:HZ({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:HZ({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},WZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function zZ(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const $Z={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:zZ({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:zZ({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:zZ({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:zZ({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:zZ({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function UZ(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const qZ={ordinalNumber:function(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=n.valueCallback?n.valueCallback(i):i;return{value:i,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:UZ({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:UZ({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:UZ({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:UZ({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:UZ({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},GZ={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=PZ[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:_Z,formatRelative:(e,t,n,r)=>WZ[e],localize:$Z,match:qZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};let YZ={};function KZ(){return YZ}const XZ=6048e5;function QZ(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function JZ(e){const t=QZ(e);return t.setHours(0,0,0,0),t}function eV(e){const t=QZ(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tV(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function nV(e){const t=QZ(e),n=function(e,t){const n=JZ(e),r=JZ(t),o=+n-eV(n),a=+r-eV(r);return Math.round((o-a)/864e5)}(t,function(e){const t=QZ(e),n=tV(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function rV(e,t){const n=KZ(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=QZ(e),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function oV(e){return rV(e,{weekStartsOn:1})}function aV(e){const t=QZ(e),n=t.getFullYear(),r=tV(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=oV(r),a=tV(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const i=oV(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function iV(e){const t=QZ(e),n=+oV(t)-+function(e){const t=aV(e),n=tV(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),oV(n)}(t);return Math.round(n/XZ)+1}function lV(e,t){const n=QZ(e),r=n.getFullYear(),o=KZ(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=tV(e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=rV(i,t),s=tV(e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=rV(s,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function sV(e,t){const n=QZ(e),r=+rV(n,t)-+function(e,t){const n=KZ(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=lV(e,t),a=tV(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),rV(a,t)}(n,t);return Math.round(r/XZ)+1}function cV(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const dV={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return cV("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):cV(n+1,2)},d:(e,t)=>cV(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>cV(e.getHours()%12||12,t.length),H:(e,t)=>cV(e.getHours(),t.length),m:(e,t)=>cV(e.getMinutes(),t.length),s:(e,t)=>cV(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return cV(Math.trunc(r*Math.pow(10,n-3)),t.length)}},uV="midnight",fV="noon",hV="morning",mV="afternoon",pV="evening",gV="night",vV={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return dV.y(e,t)},Y:function(e,t,n,r){const o=lV(e,r),a=o>0?o:1-o;if("YY"===t){return cV(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):cV(a,t.length)},R:function(e,t){return cV(aV(e),t.length)},u:function(e,t){return cV(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return cV(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return cV(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return dV.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return cV(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=sV(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):cV(o,t.length)},I:function(e,t,n){const r=iV(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):cV(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):dV.d(e,t)},D:function(e,t,n){const r=nV(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):cV(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return cV(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return cV(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return cV(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?fV:0===r?uV:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?pV:r>=12?mV:r>=4?hV:gV,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return dV.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):dV.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):cV(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):cV(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):dV.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):dV.s(e,t)},S:function(e,t){return dV.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return bV(r);case"XXXX":case"XX":return yV(r);default:return yV(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return bV(r);case"xxxx":case"xx":return yV(r);default:return yV(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wV(r,":");default:return"GMT"+yV(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wV(r,":");default:return"GMT"+yV(r,":")}},t:function(e,t,n){return cV(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return cV(e.getTime(),t.length)}};function wV(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+cV(a,2)}function bV(e,t){if(e%60==0){return(e>0?"-":"+")+cV(Math.abs(e)/60,2)}return yV(e,t)}function yV(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+cV(Math.trunc(r/60),2)+t+cV(r%60,2)}const xV=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},EV=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},CV={p:EV,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return xV(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",xV(r,t)).replace("{{time}}",EV(o,t))}},kV=/^D+$/,MV=/^Y+$/,RV=["D","DD","YY","YYYY"];function IV(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=QZ(e);return!isNaN(Number(n))}const OV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,LV=/^'([^]*?)'?$/,SV=/''/g,NV=/[a-zA-Z]/;function jV(e,t,n){const r=KZ(),o=r.locale??GZ,a=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=QZ(e);if(!IV(l))throw new RangeError("Invalid time value");let s=t.match(AV).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,CV[t])(e,o.formatLong)}return e})).join("").match(OV).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:DV(e)};if(vV[t])return{isToken:!0,value:e};if(t.match(NV))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return MV.test(e)}(r)||function(e){return kV.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),RV.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,vV[r[0]])(l,r,o.localize,c)})).join("")}function DV(e){const t=e.match(LV);return t?t[1].replace(SV,"'"):e}const ZV=e=>{var{date:t,onSelect:n,textInputProps:r,popoverContentProps:o}=e,a=IC(e,["date","onSelect","textInputProps","popoverContentProps"]);const[i,l]=c(!1);return E("div",{children:C(TZ,{modal:!0,open:i,onOpenChange:l,children:[E(BZ,{asChild:!0,children:E("div",{className:"flex",children:E(mk,Object.assign({fullwidth:!0,id:"date-picker",readOnly:!0,label:"Date",size:"md",value:t?jV(t,"dd MMM yyyy"):i?" ":"",hasClearIcon:!1,endIcon:E(Qn,{fill:"inherit",className:"cursor-pointer"})},r,{labelClassName:LC("pointer-events-none",null==r?void 0:r.labelClassName)}))})}),E(FZ,Object.assign({className:"w-auto p-0 z-[100]"},o,{children:E(Ej,Object.assign({defaultMonth:t},a,{mode:"single",selected:t,onSelect:(...e)=>{null==n||n(...e),l(!1)}}))}))]})})},VV=(e,t,n)=>Array.from(e).filter((e=>t.test(e))).slice(0,n),TV=n((({value:e,onChange:t,onBlur:n,onComplete:o,length:a=6,disabled:i=!1,invalid:l=!1,autoFocus:c=!1,inputMode:d="numeric",charPattern:f=/^\d$/,className:h,inputClassName:m},p)=>{const g=r([]),v=r(null),w=s((()=>{const t=e||"";return Array.from({length:a},((e,n)=>t[n]||""))}),[a,e]);u(p,(()=>g.current[0]),[]);const b=e=>{const n=e.join("");t(n),o&&e.every((e=>""!==e))&&o(n)},y=e=>{var t,n;const r=Math.max(0,Math.min(a-1,e));null===(t=g.current[r])||void 0===t||t.focus(),null===(n=g.current[r])||void 0===n||n.select()};return E("div",{className:LC("flex items-center gap-3",h),ref:v,children:w.map(((e,t)=>E("input",{ref:e=>{g.current[t]=e},type:"text",inputMode:d,autoComplete:0===t?"one-time-code":"off",value:e,maxLength:1,disabled:i,autoFocus:c&&0===t,"aria-invalid":l||void 0,className:LC("h-14 w-[46px] rounded-[8px] text-input-filled-text border bg-transparent text-center text-2xl font-semibold outline-none transition-all duration-200","border-input-default-stroke focus:border-input-active-stroke","disabled:cursor-not-allowed disabled:opacity-50",l&&"border-input-error focus:border-input-error",m),onFocus:e=>{e.target.select()},onBlur:e=>{var t;const r=e.relatedTarget;r&&(null===(t=v.current)||void 0===t?void 0:t.contains(r))||null==n||n()},onChange:e=>((e,t)=>{if(i)return;if(!t){const t=[...w];return t[e]="",void b(t)}const n=VV(t,f,a);if(!n.length)return;const r=[...w];let o=e;n.forEach((e=>{o<a&&(r[o]=e,o+=1)})),b(r),y(o<a?o:a-1)})(t,e.target.value),onPaste:e=>((e,t)=>{if(t.preventDefault(),i)return;const n=t.clipboardData.getData("text"),r=VV(n,f,a-e);if(!r.length)return;const o=[...w];r.forEach(((t,n)=>{o[e+n]=t})),b(o);const l=Math.min(e+r.length,a-1);y(l)})(t,e),onKeyDown:e=>((e,t)=>{if(!i){if("ArrowLeft"===t.key)return t.preventDefault(),void y(e-1);if("ArrowRight"===t.key)return t.preventDefault(),void y(e+1);if("Backspace"===t.key){if(w[e]){t.preventDefault();const n=[...w];return n[e]="",void b(n)}if(e>0){t.preventDefault();const n=[...w];n[e-1]="",b(n),y(e-1)}}}})(t,e)},t)))})}));TV.displayName="OtpInput";const BV=t.forwardRef(((e,t)=>{var{id:n,label:r,required:o=!1,helperText:a,error:i=!1,errorMessage:l,keepFooterSpace:s=!0,wrapperClassName:c,labelClassName:d,messageClassName:u}=e,f=IC(e,["id","label","required","helperText","error","errorMessage","keepFooterSpace","wrapperClassName","labelClassName","messageClassName"]);const h=Boolean(i||l),m=h?l:a;return C("div",{className:LC("inline-flex w-full flex-col gap-2",c),children:[r&&C("label",{htmlFor:n,className:LC("typography-overline text-input-default-text",h&&"text-input-error",d),children:[r,o&&E("span",{className:"ml-1 text-input-error",children:"*"})]}),E(TV,Object.assign({},f,{ref:t,invalid:h})),(m||s)&&E("div",{className:LC("typography-small2 min-h-[18px]",h?"text-input-error":"text-text-g-contrast-medium",u),role:h?"alert":void 0,children:m||" "})]})}));BV.displayName="OtpInputGroup";const FV=({progress:e=0,color:t,gradientStart:n,gradientEnd:r,animationDuration:o=.5,height:a=8,trackClassName:i,progressClassName:l})=>{const[s,u]=c(0);d((()=>{u(e)}),[e]);return E("div",{className:LC("w-full bg-grey2-transparent-16 rounded-full overflow-hidden",i),style:{height:`${a}px`},children:E("div",{className:LC("h-full rounded-full transition-all ease-out bg-primary",l),style:{width:`${s}%`,background:n&&r?`linear-gradient(to right, ${n}, ${r})`:t,transition:`width ${o}s ease-out`}})})},PV=e.forwardRef(((e,t)=>{var{rootClassName:n,className:r,rootRef:o,bordered:a=!1,scrollableWrapper:i=!0}=e,l=IC(e,["rootClassName","className","rootRef","bordered","scrollableWrapper"]);const s=LC("relative h-full w-full min-h-0 overflow-auto","ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s"),c=LC("min-w-full caption-bottom border-separate border-spacing-0",r),d=E("table",Object.assign({ref:t,className:c},l));return a||!1!==i?E("div",a?{className:LC("relative flex h-full w-full min-h-0 flex-col overflow-hidden rounded-md border border-table-c-border",n),ref:o,children:E("div",{className:s,children:d})}:{className:LC(s,n),ref:o,children:d}):E("table",Object.assign({ref:t,className:LC(c,n)},l))}));PV.displayName="Table";const HV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("thead",Object.assign({ref:t,className:LC("[&_tr>th]:box-border [&_tr>th]:border-b [&_tr>th]:border-b-table-c-header-line",n)},r))}));HV.displayName="TableHeader";const _V=e.forwardRef(((e,t)=>{var{className:n,striped:r=!1}=e,o=IC(e,["className","striped"]);return E("tbody",Object.assign({ref:t,className:LC("[&_tr:last-child>td]:border-b-0 [&_tr:last-child>th]:border-b-0","[&_tr]:bg-table-c-row-bg","[&_tr:hover]:!bg-table-c-hover","[&_tr[data-state=selected]]:!bg-table-c-selected","[&_tr[data-highlighted=true]]:!bg-table-c-selected",r&&["[&_tr:nth-child(odd)]:bg-table-c-row-bg","[&_tr:nth-child(even)]:bg-table-c-row-bg-even","[&_tr>td]:border-b-0"],n)},o))}));_V.displayName="TableBody";const WV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("tfoot",Object.assign({ref:t,className:LC("bg-table-c-header-bg border-t border-t-table-c-header-line font-medium [&>tr]:last:border-b-0",n)},r))}));WV.displayName="TableFooter";const zV=e.forwardRef(((e,t)=>{var{className:n,divided:r=!0,colDivided:o=!1}=e,a=IC(e,["className","divided","colDivided"]);return E("tr",Object.assign({ref:t,className:LC("transition-colors box-border",r&&["[&>td]:border-b [&>td]:border-b-table-c-row-line","[&>th]:border-b [&>th]:border-b-table-c-row-line"],o&&["[&>td:not(:last-child)]:border-r [&>td:not(:last-child)]:border-r-table-c-col-line","[&>th:not(:last-child)]:border-r [&>th:not(:last-child)]:border-r-table-c-col-line"],n)},a))}));zV.displayName="TableRow";const $V=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("th",Object.assign({ref:t,className:LC("box-border py-3 px-3 text-left align-middle","typography-body2 text-text-contrast-max","bg-table-c-header-bg","leading-[20px]","[&:has([role=checkbox])]:px-3 [&:has([role=checkbox])]:min-w-10",n)},r))}));$V.displayName="TableHead";const UV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("td",Object.assign({ref:t,className:LC("box-border py-3 px-3 text-left align-middle","typography-body3 text-text-contrast-max","leading-[18px]","bg-inherit","[&:has([role=checkbox])]:px-3 [&:has([role=checkbox])]:min-w-10",n)},r))}));UV.displayName="TableCell";const qV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("caption",Object.assign({ref:t,className:LC("mt-4 pb-3 text-sm text-text-g-contrast-medium",n)},r))}));qV.displayName="TableCaption";const GV=e.forwardRef((({pageIndex:e,pageSize:t,totalCount:n,pageSizeOptions:r=[10,20,50,100],onPageChange:o,onPageSizeChange:a,className:i},l)=>{const s=Math.max(1,Math.ceil(n/t)),c=0===n?0:e*t+1,d=Math.min((e+1)*t,n);return C("div",{ref:l,className:LC("flex items-center justify-end gap-8 px-6 py-2","bg-table-c-header-bg","border-t border-t-table-c-header-line",i),children:[C("div",{className:"flex items-center gap-3",children:[E("span",{className:"typography-subtitle4 text-text-g-contrast-high whitespace-nowrap",children:"items per page"}),C("div",{className:"relative",children:[E("select",{value:t,onChange:e=>{a(Number(e.target.value)),o(0)},className:LC("appearance-none w-[72px] rounded-md border border-input-default-stroke","bg-table-c-header-bg p-2 pr-7","typography-small2 text-text-g-contrast-high","cursor-pointer focus:outline-none focus:ring-1 focus:ring-input-active-stroke"),children:r.map((e=>E("option",{value:e,children:e},e)))}),E(JC,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 size-[14px] text-text-g-contrast-high","aria-hidden":!0})]})]}),C("span",{className:"typography-subtitle4 text-text-g-contrast-high whitespace-nowrap tabular-nums",children:[c,"–",d," of ",n," items"]}),C("div",{className:"flex items-center gap-2",children:[E(Zk,{variant:"icon",size:"sm",onClick:()=>o(0),disabled:0===e,"aria-label":"First page",children:E(ek,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(e-1),disabled:0===e,"aria-label":"Previous page",children:E(nk,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(e+1),disabled:e>=s-1,"aria-label":"Next page",children:E(rk,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(s-1),disabled:e>=s-1,"aria-label":"Last page",children:E(tk,{})})]})]})}));
32
+ */const UC=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},qC=i({}),GC=n((({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...c},d)=>{const{size:u=24,strokeWidth:f=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:p=""}=a(qC)??{},g=r??h?24*Number(n??f)/Number(t??u):n??f;return l("svg",{ref:d,...$C,width:t??u??$C.width,height:t??u??$C.height,stroke:e??m,strokeWidth:g,className:_C("lucide",p,o),...!i&&!UC(c)&&{"aria-hidden":"true"},...c},[...s.map((([e,t])=>l(e,t))),...Array.isArray(i)?i:[i]])})),YC=(e,t)=>{const r=n((({className:n,...r},o)=>l(GC,{ref:o,iconNode:t,className:_C(`lucide-${WC(zC(e))}`,`lucide-${e}`,n),...r})));return r.displayName=zC(e),r},KC=YC("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),XC=YC("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),QC=YC("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),JC=YC("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ek=YC("chevron-first",[["path",{d:"m17 18-6-6 6-6",key:"1yerx2"}],["path",{d:"M7 6v12",key:"1p53r6"}]]),tk=YC("chevron-last",[["path",{d:"m7 18 6-6-6-6",key:"lwmzdw"}],["path",{d:"M17 6v12",key:"1o0aio"}]]),nk=YC("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),rk=YC("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),ok=YC("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),ak=YC("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ik=YC("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),lk=YC("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),sk=YC("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),ck=YC("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),dk=YC("equal",[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]]),uk=YC("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),fk=YC("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),hk=YC("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),mk=n(((e,t)=>{var{id:n,label:a,size:i="md",rounded:l="normal",variant:c="outline",type:d="text",iconMode:u="flat",helperText:f,errorMessage:h,warningMessage:m,status:p,fullwidth:g=!0,disabled:v=!1,error:w=!1,warning:b=!1,required:y=!0,isFloatingLabel:x=!0,keepCloseIconOnValue:k=!1,keepFooterSpace:M=!0,hasClearIcon:R=!0,hasSearchIcon:I=!1,startIcon:O,endIcon:A,labelClassName:L,onClickStartIcon:S,onClickEndIcon:N,renderStartIcon:j,renderEndIcon:D,classes:Z,normalize:V,format:T,trimOnCommit:B,normalizeOnCommit:F,placeholder:P}=e,H=IC(e,["id","label","size","rounded","variant","type","iconMode","helperText","errorMessage","warningMessage","status","fullwidth","disabled","error","warning","required","isFloatingLabel","keepCloseIconOnValue","keepFooterSpace","hasClearIcon","hasSearchIcon","startIcon","endIcon","labelClassName","onClickStartIcon","onClickEndIcon","renderStartIcon","renderEndIcon","classes","normalize","format","trimOnCommit","normalizeOnCommit","placeholder"]);const _=r(null),W=n||`${d}-${a}-input`,z=function(...e){const t=r();return t.current=function(...e){return t=>{e.forEach((e=>{e&&("function"==typeof e?e(t):e.current=t)}))}}(...e),o((e=>{var n;null===(n=t.current)||void 0===n||n.call(t,e)}),[])}(t,_),$=!!O||!!j,U=!!A||!!D,q=p||(w?"error":b||m?"warning":"default"),G="error"===q,Y="warning"===q,K="error"===q?h:"warning"===q?m:f,X=jC({size:i,rounded:l,variant:c,fullwidth:g,disabled:v,error:G,warning:Y,hasSearchIcon:"flat"===u&&$||I,hasClearIcon:"flat"===u&&U||R,leftSectionIcon:"solid"===u&&$,rightSectionIcon:"solid"===u&&U,floatingLabelPlaceholder:x}),Q=DC({size:i,disabled:v,error:G,hasSearchIcon:"flat"===u&&$||I,hasLeftSectionIcon:"solid"===u&&$,isFloatingLabel:x}),J=ZC({size:i,error:G,warning:Y,disabled:v}),ee=TC({size:i}),te=BC({size:i}),ne=FC({size:i}),re=PC({size:i}),oe=HC({size:i,rounded:l,error:G,warning:Y,position:"start"}),ae=HC({size:i,rounded:l,error:G,warning:Y,position:"end"}),ie=o((e=>{var t;V&&(e.target.value=V(e.target.value)),null===(t=H.onChange)||void 0===t||t.call(H,e)}),[V,H.onChange]),le=o((e=>{var t;const n=e.currentTarget;let r=n.value;B&&(r=r.trim()),F&&(r=F(r)),r!==n.value&&(n.value=r,null===(t=H.onChange)||void 0===t||t.call(H,Object.assign(Object.assign({},e),{target:n})))}),[B,F,H.onChange]),se=o((e=>{var t;(B||F)&&le(e),null===(t=H.onBlur)||void 0===t||t.call(H,e)}),[B,F,le,H.onBlur]),ce=o((e=>{var t;(B||F)&&"Enter"===e.key&&le(e),null===(t=H.onKeyDown)||void 0===t||t.call(H,e)}),[B,F,le,H.onKeyDown]),de=T&&"string"==typeof H.value?T(H.value):H.value,ue=o((()=>{_.current&&(_.current.value="",H.onChange&&(new Event("input",{bubbles:!0}),H.onChange({target:{value:""}})))}),[H.onChange]),fe=o((()=>{v||(null==S||S(),_.current&&_.current.focus())}),[v,S]),he=o((()=>{v||(null==N||N(),_.current&&_.current.focus())}),[v,N]),me=s((()=>{if($)return E("div",j?{className:LC(te,"flex",null==Z?void 0:Z.iconSearchWrapper),children:j()}:"flat"===u?{className:LC(te,null==Z?void 0:Z.iconSearchWrapper),children:E("div",{className:LC(ne,null==Z?void 0:Z.icon),onClick:fe,children:O})}:{className:LC(oe,null==Z?void 0:Z.startIconWrapper),onClick:fe,children:O})}),[$,O,u,te,oe,ne,j,fe]),pe=s((()=>{if(U)return E("div",D?{className:LC(ee,"flex",null==Z?void 0:Z.iconWrapper),children:D()}:"flat"===u?{className:LC(ee,"flex",null==Z?void 0:Z.iconWrapper),children:E("div",{className:LC(ne,null==Z?void 0:Z.icon),onClick:he,children:A})}:{className:LC(ae,null==Z?void 0:Z.endIconWrapper),onClick:he,children:A})}),[U,A,u,ee,ae,ne,D,he]),ge=x||null!=a&&""!==String(a);return C("div",{className:"inline-flex flex-col "+(g?"w-full":""),children:[C("div",{className:"relative",children:[E("input",Object.assign({},H,{placeholder:x?" ":null!=P?P:"",ref:z,type:d,id:W,disabled:v,value:de,className:LC(X,H.className),onChange:V?ie:H.onChange,onBlur:B||F?se:H.onBlur,onKeyDown:B||F?ce:H.onKeyDown})),I&&!$&&E("div",{className:LC(te,null==Z?void 0:Z.iconSearchWrapper),children:E(hk,{className:LC(re,null==Z?void 0:Z.icon)})}),me,R&&!U&&E("div",{className:LC(ee,null==Z?void 0:Z.iconWrapper),style:{display:k&&H.value?"flex":void 0},children:E(ik,{className:LC(ne,null==Z?void 0:Z.icon),onMouseDown:ue})}),pe,ge&&C("label",{htmlFor:W,className:LC(Q,L),children:[a," ",y&&E("span",{className:LC("text-input-error",{"text-input-disable-text":v}),children:"*"})]})]}),(K||M)&&C("span",{className:J,children:[K&&E("span",{className:"h-full shrink-0",children:E(ok,{width:14,height:14,className:LC("fill-none stroke-current",G?"text-input-error":Y?"text-warning":"text-input-filled-text")})}),M&&!K&&E("span",{className:"block min-h-[14px]","aria-hidden":!0}),K||""]})]})})),pk={0:{pattern:/[0-9]/,placeholder:"0"},9:{pattern:/[0-9\s]/,placeholder:"9"},"#":{pattern:/[0-9\s+\-]/,placeholder:"#"},L:{pattern:/[a-zA-Z]/,placeholder:"L"},"?":{pattern:/[a-zA-Z\s]/,placeholder:"?"},"&":{pattern:/[^\s]/,placeholder:"&"},C:{pattern:/./,placeholder:"C"},A:{pattern:/[a-zA-Z0-9]/,placeholder:"A"},a:{pattern:/[a-zA-Z0-9\s]/,placeholder:"a"}},gk=(e,t,n="_",r=!0,o=!0)=>{let a="",i=0;for(let l=0;l<t.length;l++){const s=t[l];if(s.isLiteral)a+=s.placeholder;else{let t=!1;for(;i<e.length;){const n=e[i];i++;if(s.validator?s.validator(n):s.pattern.test(n)){a+=n,t=!0;break}}if(!t&&o&&r)a+=n;else if(!t)break}}return a},vk=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){const o=t[r],a=e[r];o.isLiteral||(n+=a)}return n},wk=n(((e,n)=>{var{mask:a,maskChar:i="_",showMask:l=!0,guide:s=!0,keepCharPositions:f=!1,rules:h,onMaskedChange:m,onChange:p,value:g,defaultValue:v}=e,w=IC(e,["mask","maskChar","showMask","guide","keepCharPositions","rules","onMaskedChange","onChange","value","defaultValue"]);const b=r(null),[y,x]=c(""),[C,k]=c(""),M=t.useMemo((()=>a?((e,t)=>{const n=Object.assign(Object.assign({},pk),t),r=[];let o=0;for(;o<e.length;){const t=e[o];if("\\"===t&&o+1<e.length){const t=e[o+1];r.push({pattern:new RegExp(`^${t}$`),placeholder:t,isLiteral:!0}),o+=2}else if(n[t]){const e=n[t];"function"==typeof e?r.push({pattern:/./,placeholder:t,validator:e}):e instanceof RegExp?r.push({pattern:e,placeholder:t}):r.push({pattern:e.pattern,placeholder:e.placeholder}),o++}else r.push({pattern:new RegExp(`^${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`),placeholder:t,isLiteral:!0}),o++}return r})(a,h):null),[a,h]);d((()=>{const e=g||v||"";if(M&&e){const t=gk(e,M,i,l,s),n=vk(t,M);x(t),k(n)}else x(e),k(e)}),[M,i,l,s,g,v]),u(n,(()=>null==b?void 0:b.current));const R=o((e=>{const t=e.target.value;if(!M)return x(t),k(t),null==p||p(e),void(null==m||m(t,t));const n=gk(t,M,i,l,s),r=vk(n,M);x(n),k(r);const o=Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{value:n})});null==p||p(o),null==m||m(n,r),setTimeout((()=>{if(b.current){const e=r.replace(/[_\s]/g,"").length,t=((e,t,n)=>{let r=0,o=0;for(let a=0;a<n.length&&a<e.length;a++){const i=n[a];if(e[a],i.isLiteral)o=a+1;else if(r++,o=a+1,r>=t)break}return o})(n,e,M);b.current.setSelectionRange(t,t)}}),0)}),[M,i,l,s,p,m]),I=o((e=>{var t,n,r;if(!M)return void(null===(t=w.onKeyDown)||void 0===t||t.call(w,e));const{key:o,ctrlKey:a,metaKey:i}=e,l=e.target.selectionStart||0;if("Backspace"===o||"Delete"===o||"ArrowLeft"===o||"ArrowRight"===o||"Home"===o||"End"===o||"Tab"===o||o.length>1||a||i)return void(null===(n=w.onKeyDown)||void 0===n||n.call(w,e));let s=l;for(;s<M.length&&M[s].isLiteral;)s++;if(s<M.length){const t=M[s];if(!(t.validator?t.validator(o):t.pattern.test(o)))return void e.preventDefault()}null===(r=w.onKeyDown)||void 0===r||r.call(w,e)}),[M,w]);return E(mk,Object.assign({},w,{ref:b,value:y,onChange:R,onKeyDown:I,className:LC(w.className)}))}));async function bk(){const{default:e}=await import("lucide-react/dynamicIconImports");return Object.keys(e)}wk.displayName="MaskedTextInput";const yk=M(["text-inherit"],{variants:{color:{primary:"text-primary",secondary:"text-secondary",tertiary:"text-tertiary",success:"text-success",info:"text-info",warning:"text-warning",error:"text-error",inherit:"text-inherit"},size:{sm:"size-4",md:"size-6",lg:"size-8",inherit:""}},defaultVariants:{size:"inherit",color:"inherit"}}),xk={sm:16,md:24,lg:32},Ek=e=>{var{name:n,type:r="heroicons",color:o="inherit",variant:a="solid",size:i="md",className:l}=e,s=IC(e,["name","type","color","variant","size","className"]);const[c,d]=t.useState(null);if(t.useEffect((()=>{if("lucide"===r)return void import("lucide-react/dynamicIconImports").then((({default:e})=>{const t=e[n];t?t().then((e=>{d((()=>e.default))})):console.warn(`Lucide icon "${n}" not found.`)}));const e=((e,t,n)=>{var r,o;return null===(o=null===(r=xC[e])||void 0===r?void 0:r[t])||void 0===o?void 0:o[n]})(r,n,a);e?d((()=>e)):console.warn(`Icon "${n}" from "${r}" not found.`)}),[n,r,a]),"lucide"===r){if(!c)return E("span",{className:LC(yk({color:o,size:i}),l)});const e="inherit"===i?24:xk[i];return E(c,Object.assign({},s,{size:e,strokeWidth:e<=16?1.5:2,absoluteStrokeWidth:!0,shapeRendering:"geometricPrecision",className:LC(yk({color:o,size:i}),"stroke-current",l)}))}return E(c||"svg",Object.assign({className:LC(yk({color:o,size:i}),l)},s))},Ck=n(((e,t)=>{var n,{showToggle:o=!0,hasClearIcon:a=!1,hideIcon:i,showIcon:l,endIcon:s,renderEndIcon:d,onClickEndIcon:f}=e,h=IC(e,["showToggle","hasClearIcon","hideIcon","showIcon","endIcon","renderEndIcon","onClickEndIcon"]);const m=r(null),[p,g]=c(!1);u(t,(()=>null==m?void 0:m.current));const v=p?null!=l?l:E(Ek,{name:"eye",type:"lucide",size:"inherit",className:"size-full","aria-label":"Hide password"}):null!=i?i:E(Ek,{name:"eye-closed",type:"lucide",size:"inherit",className:"size-full","aria-label":"Show password"});return E(mk,Object.assign({iconMode:"flat"},h,{ref:m,type:p?"text":"password",hasClearIcon:a,endIcon:o?v:s,renderEndIcon:d,onClickEndIcon:o?()=>{var e;h.disabled||(g((e=>!e)),null===(e=m.current)||void 0===e||e.focus(),null==f||f())}:f,autoComplete:null!==(n=h.autoComplete)&&void 0!==n?n:"current-password"}))}));Ck.displayName="PasswordInput";const kk=n(((e,n)=>{var a,{value:i,defaultValue:l,min:s,max:d,step:f=1,precision:h,hideControls:m=!1,allowDecimal:p=!0,allowNegative:g=!0,formatDisplay:v=!1,thousandSeparator:w=",",decimalSeparator:b=".",prefix:y="",suffix:x="",disabled:k=!1,onChange:M,onValueChange:R,className:I,size:O="md"}=e,A=IC(e,["value","defaultValue","min","max","step","precision","hideControls","allowDecimal","allowNegative","formatDisplay","thousandSeparator","decimalSeparator","prefix","suffix","disabled","onChange","onValueChange","className","size"]);const L=r(null),[S,N]=c((null!==(a=null!=i?i:l)&&void 0!==a?a:"").toString()),[j,D]=c(!1);u(n,(()=>null==L?void 0:L.current));const Z=o((e=>{let t=e;return y&&(t=t.replace(y,"")),x&&(t=t.replace(x,"")),w&&(t=t.split(w).join("")),"."!==b&&(t=t.replace(b,".")),t.trim()}),[y,x,w,b]),V=o((e=>{if(!v||""===e||"-"===e)return e;const t=parseFloat(e);if(isNaN(t))return e;let n=t.toString();void 0!==h&&(n=t.toFixed(h));const r=n.split(".");let o=r[0];const a=r[1];return w&&(o=o.replace(/\B(?=(\d{3})+(?!\d))/g,w)),n=a?`${o}${b}${a}`:o,y&&(n=`${y}${n}`),x&&(n=`${n}${x}`),n}),[v,h,w,b,y,x]),T=o((e=>{if(""===e||"-"===e)return e;let t=parseFloat(e);return isNaN(t)?S:(void 0!==s&&t<s&&(t=s),void 0!==d&&t>d&&(t=d),void 0!==h&&(t=parseFloat(t.toFixed(h))),t.toString())}),[s,d,h,S]),B=o((e=>{let t=e.target.value;if(v&&(t=Z(t)),""===t)return N(""),null==M||M(void 0),void(null==R||R(""));if(g&&"-"===t)return N("-"),void(null==R||R("-"));if(!(p?g?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/:g?/^-?\d*$/:/^\d*$/).test(t))return;N(t),null==R||R(t);const n=parseFloat(t);isNaN(n)||null==M||M(n)}),[p,g,v,Z,M,R]),F=o((e=>{var t;D(!0),null===(t=A.onFocus)||void 0===t||t.call(A,e)}),[A]),P=o((e=>{var t;D(!1);const n=T(S);N(n);const r=parseFloat(n);isNaN(r)||null==M||M(r),null===(t=A.onBlur)||void 0===t||t.call(A,e)}),[S,T,M,A]),H=o((e=>{if(k)return;e.stopPropagation(),e.preventDefault();let t=(parseFloat(S)||0)+f;void 0!==d&&t>d&&(t=d);const n=T(t.toString());N(n),null==M||M(parseFloat(n)),null==R||R(n)}),[S,f,d,k,T,M,R]),_=o((e=>{if(k)return;e.stopPropagation(),e.preventDefault();let t=(parseFloat(S)||0)-f;void 0!==s&&t<s&&(t=s);const n=T(t.toString());N(n),null==M||M(parseFloat(n)),null==R||R(n)}),[S,f,s,k,T,M,R]),W=o((e=>{var t;switch(e.key){case"ArrowUp":H(e);break;case"ArrowDown":_(e);break;case"Enter":e.currentTarget.blur()}null===(t=A.onKeyDown)||void 0===t||t.call(A,e)}),[H,_,A]);t.useEffect((()=>{void 0!==i&&N(i.toString())}),[i]);const z=t.useMemo((()=>j||!v?S:V(S)),[j,v,S,V]),$={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-6 h-6"}[O],U={sm:"absolute top-0.5",md:"absolute top-1",lg:"absolute top-1"}[O];return E(mk,Object.assign({},A,{ref:L,type:"text",inputMode:"decimal",value:z,onChange:B,onFocus:F,onBlur:P,onKeyDown:W,disabled:k,size:O,hasClearIcon:!1,endIcon:m?null:C("div",{className:LC("flex flex-col","flat"===A.iconMode&&U),children:[E("button",{type:"button",onClick:H,disabled:k||void 0!==d&&parseFloat(S)>=d,className:LC(" hover:bg-input-active-stroke/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors rounded-full text-input-filled-text"),tabIndex:-1,children:E(zr,{className:$})}),E("button",{type:"button",onClick:_,disabled:k||void 0!==s&&parseFloat(S)<=s,className:LC(" hover:bg-input-active-stroke/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors rounded-full text-input-filled-text"),tabIndex:-1,children:E(Vr,{className:$})})]}),className:LC(I)}))}));kk.displayName="NumberInput";const Mk=M(["peer block w-full bg-transparent outline-none placeholder:text-transparent resize-y ui-scrollbar","text-input-filled-text caret-primary"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitle4",lg:"p-4 typography-subtitle1"},rounded:{none:"rounded-none",normal:"rounded-md",full:"rounded-full"},variant:{flat:"",outline:["ring-1 ring-inset ring-input-default-stroke","hover:ring-input-active-stroke","focus:ring-1 focus:ring-inset focus:ring-input-active-stroke"],underline:"border-b-2 border-input-default-stroke transition-colors hover:border-input-active-stroke focus:border-input-stroke"},fullwidth:{true:"w-full"},disabled:{true:["bg-input-disable-bg text-input-disable-text ring-input-disable-stroke placeholder:text-input-disable-text","hover:ring-input-disable-stroke","cursor-not-allowed"]},error:{true:"ring-input-error focus:ring-input-error"},hasClearIcon:{true:""},isFloatingLabel:{true:"",false:"placeholder:text-input-placeholder"}},compoundVariants:[{variant:"underline",className:"rounded-none"},{hasClearIcon:!0,size:"sm",className:"focus:pe-6"},{hasClearIcon:!0,size:"md",className:"focus:pe-8"},{hasClearIcon:!0,size:"lg",className:"focus:pe-10"}],defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hasClearIcon:!1,isFloatingLabel:!0}}),Rk=M(["absolute block duration-450 transition-all px-[2px] text-input-default-text","peer-focus:text-input-filled-text peer-focus:bg-input-label-bg"],{variants:{size:{sm:[],md:[],lg:[]},disabled:{true:"text-input-default-text placeholder:text-input-default-text"},error:{true:"ring-error"},isFloatingLabel:{false:"hidden peer-placeholder-shown:block peer-focus:bg-transparent"}},compoundVariants:[{isFloatingLabel:!0,size:"sm",className:["left-3 -top-1.5 typography-label2 bg-input-label-bg","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"]},{isFloatingLabel:!0,size:"md",className:["left-3 -top-1.5 typography-label1 bg-input-label-bg","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{isFloatingLabel:!0,size:"lg",className:["left-4 -top-1.5 typography-label1 bg-input-label-bg","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{isFloatingLabel:!1,size:"sm",className:["left-3 peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1"]},{isFloatingLabel:!1,size:"md",className:["left-3 peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4"]},{isFloatingLabel:!1,size:"lg",className:["left-4 peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1"]}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloatingLabel:!0}}),Ik=M(["absolute inset-y-0 right-0 items-start justify-center hidden peer-focus:flex"],{variants:{size:{sm:"mr-2 pt-2",md:"mr-3 pt-2",lg:"mr-4 pt-4"}},defaultVariants:{size:"md"}}),Ok=M(["cursor-pointer z-50 fill-input-active-stroke hover:fill-input-default-text"],{variants:{size:{sm:"size-3",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}}),Ak=M(["typography-small1 flex flex-row items-center gap-1"],{variants:{size:{sm:"mt-1",md:"mt-[6px]",lg:"mt-[6px]"},disabled:{true:"text-input-disable-text"},error:{true:"text-input-error",false:"text-input-filled-text"}},defaultVariants:{size:"md",disabled:!1,error:!1}}),Lk=n(((e,t)=>{var{id:n,label:a,size:i="md",rounded:l="normal",variant:c="outline",helperText:d,errorMessage:f,fullwidth:h=!0,disabled:m=!1,error:p=!1,required:g=!0,isFloatingLabel:v=!0,keepCloseIconOnValue:w=!1,hasClearIcon:b=!0,labelClassName:y,className:x,normalize:k,format:M,trimOnCommit:R,normalizeOnCommit:I}=e,O=IC(e,["id","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","required","isFloatingLabel","keepCloseIconOnValue","hasClearIcon","labelClassName","className","normalize","format","trimOnCommit","normalizeOnCommit"]);const A=r(null),L=n||`textarea-${null!=a?a:""}`;u(t,(()=>null==A?void 0:A.current));const S=o((e=>{var t;k&&(e.target.value=k(e.target.value)),null===(t=O.onChange)||void 0===t||t.call(O,e)}),[k,O.onChange]),N=o((e=>{var t;const n=e.currentTarget;let r=n.value;R&&(r=r.trim()),I&&(r=I(r)),r!==n.value&&(n.value=r,null===(t=O.onChange)||void 0===t||t.call(O,Object.assign(Object.assign({},e),{target:n})))}),[R,I,O.onChange]),j=o((e=>{var t;(R||I)&&N(e),null===(t=O.onBlur)||void 0===t||t.call(O,e)}),[R,I,N,O.onBlur]),D=M&&"string"==typeof O.value?M(O.value):O.value,Z=s((()=>"inline-flex flex-col "+(h?"w-full":"")),[h]),V=Mk({size:i,rounded:l,variant:c,fullwidth:h,disabled:m,error:p,hasClearIcon:b,isFloatingLabel:v});return C("div",{className:Z,children:[C("div",{className:"relative",children:[E("textarea",Object.assign({},O,{id:L,ref:A,disabled:m,placeholder:v?" ":O.placeholder,className:LC(V,x),value:D,onChange:k?S:O.onChange,onBlur:R||I?j:O.onBlur})),b&&E("div",{className:Ik({size:i}),style:{display:w&&O.value?"flex":void 0},children:E(pu,{type:"button",className:Ok({size:i}),onMouseDown:e=>{if(e.preventDefault(),A.current){const e=A.current.value;A.current.value="",O.onChange&&""!==e&&O.onChange({target:{value:""}}),A.current.focus()}}})}),a&&C("label",{htmlFor:L,className:LC(Rk({size:i,disabled:m,error:p,isFloatingLabel:v}),y),children:[a," ",g&&E("span",{className:LC("text-error",{"text-input-disable-text":m}),children:"*"})]})]}),(f||d)&&E("span",{className:Ak({size:i,disabled:m,error:p}),children:f||d})]})})),Sk=M(["text-common-black"],{variants:{color:{primary:"text-primary",secondary:"text-secondary",success:"text-success",tertiary:"text-tertiary",info:"text-info",warning:"text-warning",error:"text-error"}}}),Nk={subtitile1:"subtitle1",subtitile2:"subtitle2",subtitile3:"subtitle3",subtitile4:"subtitle4",subtitile5:"subtitle5",subtitile6:"subtitle6"},jk=n(((e,t)=>{var n,{variant:r="body1",tag:o="p",children:a,className:i="",color:l,style:s}=e,c=IC(e,["variant","tag","children","className","color","style"]);const d=null!==(n=Nk[r])&&void 0!==n?n:r;return E(o,Object.assign({ref:t,className:LC(`typography-${d}`,Sk({color:l}),i),style:s},c,{children:a}))})),Dk=M(["box-border flex items-center justify-center outline-none focus-visible:outline-none"],{variants:{variant:{solid:["bg-action-button-solid-default border-action-button-solid-default text-action-button-solid-default fill-action-button-solid-default","hover:bg-action-button-solid-hover hover:border-action-button-solid-hover hover:text-action-button-solid-hover hover:fill-action-button-solid-hover","active:bg-action-button-solid-pressed active:border-action-button-solid-pressed active:text-action-button-solid-pressed active:fill-action-button-solid-pressed","focus-visible:ring-none focus-visible:ring-offset-2 focus-visible:ring-[var(--action-button-solid-default-border)]"],outline:["ring-1 ring-inset","bg-action-button-outline-default text-action-button-outline-default fill-action-button-outline-default ring-[var(--action-button-outline-default-border)]","hover:bg-action-button-outline-hover hover:text-action-button-outline-hover hover:fill-action-button-outline-hover hover:ring-[var(--action-button-outline-hover-border)]","active:bg-action-button-outline-pressed active:text-action-button-outline-pressed active:fill-action-button-outline-pressed active:ring-[var(--action-button-outline-pressed-border)]","focus-visible:ring-none focus-visible:ring-[var(--action-button-outline-default-border)]"],icon:["bg-action-button-icon-default border-action-button-icon-default text-action-button-icon-default fill-action-button-icon-default","hover:bg-action-button-icon-hover hover:border-action-button-icon-hover hover:text-action-button-icon-hover hover:fill-action-button-icon-hover","active:bg-action-button-icon-pressed active:border-action-button-icon-pressed active:text-action-button-icon-pressed active:fill-action-button-icon-pressed","focus-visible:ring-none focus-visible:ring-offset-2 focus-visible:ring-[var(--action-button-icon-default-border)]"]},size:{xxs:"",xs:"",sm:"",md:"",lg:""},shape:{round:"",capsule:""},disabled:{false:""},active:{false:""}},compoundVariants:[{variant:"solid",active:!0,className:["bg-action-button-solid-active border-action-button-solid-active text-action-button-solid-active fill-action-button-solid-active","hover:bg-action-button-solid-active-hover hover:border-action-button-solid-active-hover hover:text-action-button-solid-active-hover hover:fill-action-button-solid-active-hover","active:bg-action-button-solid-active-pressed active:border-action-button-solid-active-pressed active:text-action-button-solid-active-pressed active:fill-action-button-solid-active-pressed","focus-visible:ring-[var(--action-button-solid-active-border)]"]},{variant:"outline",active:!0,className:["bg-action-button-outline-active text-action-button-outline-active fill-action-button-outline-active ring-[var(--action-button-outline-active-border)]","hover:bg-action-button-outline-active-hover hover:text-action-button-outline-active-hover hover:fill-action-button-outline-active-hover hover:ring-[var(--action-button-outline-active-hover-border)]","active:bg-action-button-outline-active-pressed active:text-action-button-outline-active-pressed active:fill-action-button-outline-active-pressed active:ring-[var(--action-button-outline-active-pressed-border)]","focus-visible:ring-[var(--action-button-outline-active-border)]"]},{variant:"icon",active:!0,className:["bg-action-button-icon-active border-action-button-icon-active text-action-button-icon-active fill-action-button-icon-active","hover:bg-action-button-icon-active-hover hover:border-action-button-icon-active-hover hover:text-action-button-icon-active-hover hover:fill-action-button-icon-active-hover","active:bg-action-button-icon-active-pressed active:border-action-button-icon-active-pressed active:text-action-button-icon-active-pressed active:fill-action-button-icon-active-pressed","focus-visible:ring-[var(--action-button-icon-active-border)]"]},{size:"lg",variant:["solid","outline"],className:"px-[12px] py-[12px] [&_svg]:size-[32px]"},{size:"md",variant:["solid","outline"],className:"px-[8px] py-[8px] [&_svg]:size-[22px]"},{size:"sm",variant:["solid","outline"],className:"px-[4px] py-[4px] [&_svg]:size-[22px]"},{size:"xs",variant:["solid","outline"],className:"px-[2px] py-[2px] [&_svg]:size-[14px]"},{size:"lg",variant:"icon",className:"px-[12px] py-[12px] [&_svg]:size-[32px]"},{size:"md",variant:"icon",className:"px-[8px] py-[8px] [&_svg]:size-[22px]"},{size:"sm",variant:"icon",className:"px-[4px] py-[4px] [&_svg]:size-[22px]"},{size:"xxs",variant:"icon",className:"px-[1px] py-[1px] [&_svg]:size-[10px]"},{size:"xs",variant:"icon",className:"px-[2px] py-[2px] [&_svg]:size-[14px]"},{size:"lg",shape:"round",className:"rounded-[var(--function-button-l-round)]"},{size:"md",shape:"round",className:"rounded-[var(--function-button-m-round)]"},{size:"sm",shape:"round",className:"rounded-[var(--function-button-s-round)]"},{size:"xs",shape:"round",className:"rounded-[var(--function-button-xs-round)]"},{size:"xxs",shape:"round",className:"rounded-[var(--function-button-xxs-round)]"},{size:"lg",shape:"capsule",className:"rounded-[var(--function-button-l-capsule)]"},{size:"md",shape:"capsule",className:"rounded-[var(--function-button-m-capsule)]"},{size:"sm",shape:"capsule",className:"rounded-[var(--function-button-s-capsule)]"},{size:"xxs",shape:"capsule",className:"rounded-[var(--function-button-xxs-capsule)]"},{size:"xs",shape:"capsule",className:"rounded-[var(--function-button-xs-capsule)]"},{variant:"solid",disabled:!0,className:["pointer-events-none","bg-action-button-solid-disabled border-action-button-solid-disabled text-action-button-solid-disabled fill-action-button-solid-disabled"]},{variant:"outline",disabled:!0,className:["pointer-events-none","bg-action-button-outline-disabled text-action-button-outline-disabled fill-action-button-outline-disabled ring-[var(--action-button-outline-disabled-border)]"]},{variant:"icon",disabled:!0,className:["pointer-events-none","bg-action-button-icon-disabled border-action-button-icon-disabled text-action-button-icon-disabled fill-action-button-icon-disabled"]}],defaultVariants:{size:"md",variant:"solid",shape:"round",disabled:!1,active:!1}}),Zk=n(((e,t)=>{var{children:n,disabled:r,active:o,className:a,size:i,shape:l,variant:s}=e,c=IC(e,["children","disabled","active","className","size","shape","variant"]);const d=Dk({size:i,shape:l,variant:s,active:o,disabled:r});return E("button",Object.assign({},c,{ref:t,type:"button","aria-disabled":r||void 0,disabled:r,tabIndex:r?-1:0,className:LC(".action-button",d,a),children:n}))})),Vk=({tabs:e=[],value:t,initialTab:n=0,tabBarSize:o=38,enableBorderLine:a=!0,enableAddTabButton:i=!1,keepIconSpace:l=!1,disabled:s=!1,keepMounted:u=!1,tabMode:f="start",className:h,tabBarClassName:m,tabBarContainerClassName:p,tabBarWrapperClassName:g,tabButtonClassName:v,tabButtonActiveClassName:w,tabButtonActiveDisableClassName:b,tabButtonDisableClassName:y,tabContentClassName:x,addTabButtonWrapperClassName:k,borderSliderClassName:M,leftAction:R,rightAction:I,onAddTab:O,onTabChange:A})=>{var L;const[S,N]=c(n),[j,D]=c(null),[Z,V]=c({width:"0px",transform:"translateX(0px)"}),T=r([]),B=r(!0);d((()=>{void 0!==t&&N(t)}),[t]);const F=()=>{const e=T.current[S];e&&V({width:`${e.offsetWidth}px`,transform:`translateX(${e.offsetLeft}px)`})};return d((()=>{let e;if(B.current){B.current=!1;const t=T.current[S];t&&(V({width:"0px",transform:`translateX(${t.offsetLeft+t.offsetWidth/2}px)`}),e=setTimeout((()=>{F()}),50))}else F();const t=()=>{F()};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),e&&clearTimeout(e)}}),[S,e,f,l]),C("div",{className:LC("w-full",h),children:[C("div",{className:LC(" relative flex flex-row w-full",{"border-b-[1px] border-base-stroke":a,"border-state-disable-outline":s,"flex-1":"justify"===f},p),children:[R,E("div",{className:LC("relative flex flex-row overflow-x-auto",{"flex-1":"justify"===f},g),children:C("div",{className:LC("tabs-scrollbar overflow-x-auto w-full",`relative flex gap-3 h-[${o}px] box-border`,{"gap-0":"justify"===f},m),style:{justifyContent:"justify"===f?"stretch":f},role:"tablist",children:[e.map(((e,t)=>{var n,r,o,a,i,c,d,u;return C("button",{ref:e=>T.current[t]=e,role:"tab","aria-selected":t===S,"aria-controls":`tab-content-${t}`,disabled:s||e.disabled,id:`tab-${t}`,className:LC("group relative flex justify-center flex-row items-center py-3 cursor-pointer transition-colors duration-300 box-border gap-1 flex-shrink-0 typography-subtitle6",{"text-text-contrast-max":t===S,"text-text-g-contrast-medium":t!==S,"text-state-disable-outline pointer-events-none":s||e.disabled,[null!==(r=null!==(n=e.disableClassName)&&void 0!==n?n:y)&&void 0!==r?r:""]:s||e.disabled,"text-state-disable-outline":t===S&&(s||e.disabled),[null!==(a=null!==(o=e.activeDisableClassName)&&void 0!==o?o:b)&&void 0!==a?a:""]:t===S&&(s||e.disabled),[null!==(c=null!==(i=e.className)&&void 0!==i?i:v)&&void 0!==c?c:""]:!0,[null!==(u=null!==(d=e.activeClassName)&&void 0!==d?d:w)&&void 0!==u?u:""]:t===S,"flex-1":"justify"===f}),onClick:()=>{N(t),null==A||A(t)},onMouseEnter:()=>D(t),onMouseLeave:()=>D(null),children:[(l||e.startTabContent)&&E("div",{className:"h-full w-3 flex items-center justify-center [&_svg]:size-3 [&_svg]:stroke-current [&_svg]:text-current",children:e.isLoading?E(SC,{size:12}):e.startTabContent}),e.label,(l||e.endTabContent)&&E("div",{className:"h-full w-3 flex items-center justify-center [&_svg]:size-3 [&_svg]:stroke-current [&_svg]:text-current",children:e.endTabContent}),!s&&!e.disabled&&t!==S&&E("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-[1px] bg-function-default-hover opacity-0 transition-opacity duration-150 group-hover:opacity-100"})]},t)})),E("div",{className:LC("absolute left-0 bottom-0 h-[2px] rounded-[1px] bg-function-active-solid transition-all duration-300 ease-in-out",{hidden:s||(null===(L=e[S])||void 0===L?void 0:L.disabled),"bg-function-active-hover":j===S&&!s},M),style:Z})]})}),i&&E("div",{className:LC("sticky right-0 flex content-center items-center mx-4",k),children:E(Zk,{variant:"outline",size:"sm",onClick:()=>null==O?void 0:O(),disabled:s,children:E(Ek,{name:"plus"})})}),I]}),E("div",{className:LC("mt-4 text-text-g-contrast-high",x),role:"tabpanel",id:`tab-content-${S}`,"aria-labelledby":`tab-${S}`,children:e.map(((e,t)=>{var n;return u||S===t?E("div",{className:"transition "+(S===t?"block":"hidden"),children:e.content},null!==(n=e.id)&&void 0!==n?n:t):null}))})]})},Tk="undefined"!=typeof document?t.useLayoutEffect:()=>{};const Bk=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},Fk=e=>{if(e&&"window"in e&&e.window===e)return e;return Bk(e).defaultView||window};function Pk(e){let t=null;return()=>(null==t&&(t=e()),t)}const Hk=Pk((function(){return function(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}(/^Mac/i)})),_k=Pk((function(){return function(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}(/Android/i)}));class Wk{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function zk(e){let t=r({isFocused:!1,observer:null});Tk((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]);let n=function(e){const t=r(null);return Tk((()=>{t.current=e}),[e]),o(((...e)=>{const n=t.current;return null==n?void 0:n(...e)}),[])}((t=>{null==e||e(t)}));return o((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,o=e=>{t.current.isFocused=!1,r.disabled&&n(new Wk("blur",e)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver((()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}})),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}}),[n])}let $k=null,Uk=new Set,qk=new Map,Gk=!1,Yk=!1;const Kk={Tab:!0,Escape:!0};function Xk(e,t){for(let n of Uk)n(e,t)}function Qk(e){Gk=!0,function(e){return!(e.metaKey||!Hk()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&($k="keyboard",Xk("keyboard",e))}function Jk(e){$k="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Gk=!0,Xk("pointer",e))}function eM(e){var t;(0===(t=e).mozInputSource&&t.isTrusted||(_k()&&t.pointerType?"click"===t.type&&1===t.buttons:0===t.detail&&!t.pointerType))&&(Gk=!0,$k="virtual")}function tM(e){e.target!==window&&e.target!==document&&(Gk||Yk||($k="virtual",Xk("virtual",e)),Gk=!1,Yk=!1)}function nM(){Gk=!1,Yk=!0}function rM(e){if("undefined"==typeof window||qk.get(Fk(e)))return;const t=Fk(e),n=Bk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Gk=!0,r.apply(this,arguments)},n.addEventListener("keydown",Qk,!0),n.addEventListener("keyup",Qk,!0),n.addEventListener("click",eM,!0),t.addEventListener("focus",tM,!0),t.addEventListener("blur",nM,!1),"undefined"!=typeof PointerEvent?(n.addEventListener("pointerdown",Jk,!0),n.addEventListener("pointermove",Jk,!0),n.addEventListener("pointerup",Jk,!0)):(n.addEventListener("mousedown",Jk,!0),n.addEventListener("mousemove",Jk,!0),n.addEventListener("mouseup",Jk,!0)),t.addEventListener("beforeunload",(()=>{oM(e)}),{once:!0}),qk.set(t,{focus:r})}const oM=(e,t)=>{const n=Fk(e),r=Bk(e);t&&r.removeEventListener("DOMContentLoaded",t),qk.has(n)&&(n.HTMLElement.prototype.focus=qk.get(n).focus,r.removeEventListener("keydown",Qk,!0),r.removeEventListener("keyup",Qk,!0),r.removeEventListener("click",eM,!0),n.removeEventListener("focus",tM,!0),n.removeEventListener("blur",nM,!1),"undefined"!=typeof PointerEvent?(r.removeEventListener("pointerdown",Jk,!0),r.removeEventListener("pointermove",Jk,!0),r.removeEventListener("pointerup",Jk,!0)):(r.removeEventListener("mousedown",Jk,!0),r.removeEventListener("mousemove",Jk,!0),r.removeEventListener("mouseup",Jk,!0)),qk.delete(n))};function aM(){return"pointer"!==$k}"undefined"!=typeof document&&function(e){const t=Bk(e);let n;"loading"!==t.readyState?rM(e):(n=()=>{rM(e)},t.addEventListener("DOMContentLoaded",n))}();const iM=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function lM(e,t,n){rM(),d((()=>{let t=(t,r)=>{(function(e,t,n){var r;const o="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,a="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i="undefined"!=typeof window?Fk(null==n?void 0:n.target).HTMLElement:HTMLElement,l="undefined"!=typeof window?Fk(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent;return!((e=e||(null==n?void 0:n.target)instanceof o&&!iM.has(null==n||null===(r=n.target)||void 0===r?void 0:r.type)||(null==n?void 0:n.target)instanceof a||(null==n?void 0:n.target)instanceof i&&(null==n?void 0:n.target.isContentEditable))&&"keyboard"===t&&n instanceof l&&!Kk[n.key])})(!!(null==n?void 0:n.isTextInput),t,r)&&e(aM())};return Uk.add(t),()=>{Uk.delete(t)}}),t)}let sM=!1,cM=0;function dM(){sM=!0,setTimeout((()=>{sM=!1}),50)}function uM(e){"touch"===e.pointerType&&dM()}function fM(){if("undefined"!=typeof document)return"undefined"!=typeof PointerEvent?document.addEventListener("pointerup",uM):document.addEventListener("touchend",dM),cM++,()=>{cM--,cM>0||("undefined"!=typeof PointerEvent?document.removeEventListener("pointerup",uM):document.removeEventListener("touchend",dM))}}function hM(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:o,isDisabled:a}=e,[i,l]=c(!1),u=r({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d(fM,[]);let{hoverProps:f,triggerHoverEnd:h}=s((()=>{let e=(e,r)=>{if(u.pointerType=r,a||"touch"===r||u.isHovered||!e.currentTarget.contains(e.target))return;u.isHovered=!0;let o=e.currentTarget;u.target=o,t&&t({type:"hoverstart",target:o,pointerType:r}),n&&n(!0),l(!0)},r=(e,t)=>{if(u.pointerType="",u.target=null,"touch"===t||!u.isHovered)return;u.isHovered=!1;let r=e.currentTarget;o&&o({type:"hoverend",target:r,pointerType:t}),n&&n(!1),l(!1)},i={};return"undefined"!=typeof PointerEvent?(i.onPointerEnter=t=>{sM&&"mouse"===t.pointerType||e(t,t.pointerType)},i.onPointerLeave=e=>{!a&&e.currentTarget.contains(e.target)&&r(e,e.pointerType)}):(i.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},i.onMouseEnter=t=>{u.ignoreEmulatedMouseEvents||sM||e(t,"mouse"),u.ignoreEmulatedMouseEvents=!1},i.onMouseLeave=e=>{!a&&e.currentTarget.contains(e.target)&&r(e,"mouse")}),{hoverProps:i,triggerHoverEnd:r}}),[t,n,o,a,u]);return d((()=>{a&&h({currentTarget:u.target},u.pointerType)}),[a]),{hoverProps:f,isHovered:i}}function mM(e={}){let{autoFocus:t=!1,isTextInput:n,within:a}=e,i=r({isFocused:!1,isFocusVisible:t||aM()}),[l,s]=c(!1),[d,u]=c((()=>i.current.isFocused&&i.current.isFocusVisible)),f=o((()=>u(i.current.isFocused&&i.current.isFocusVisible)),[]),h=o((e=>{i.current.isFocused=e,s(e),f()}),[f]);lM((e=>{i.current.isFocusVisible=e,f()}),[],{isTextInput:n});let{focusProps:m}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:a}=e;const i=o((e=>{if(e.target===e.currentTarget)return r&&r(e),a&&a(!1),!0}),[r,a]),l=zk(i),s=o((e=>{const t=Bk(e.target);e.target===e.currentTarget&&t.activeElement===e.target&&(n&&n(e),a&&a(!0),l(e))}),[a,n,l]);return{focusProps:{onFocus:!t&&(n||a||r)?s:void 0,onBlur:t||!r&&!a?void 0:i}}}({isDisabled:a,onFocusChange:h}),{focusWithinProps:p}=function(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:a,onFocusWithinChange:i}=e,l=r({isFocusWithin:!1}),s=o((e=>{l.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(l.current.isFocusWithin=!1,n&&n(e),i&&i(!1))}),[n,i,l]),c=zk(s),d=o((e=>{l.current.isFocusWithin||document.activeElement!==e.target||(a&&a(e),i&&i(!0),l.current.isFocusWithin=!0,c(e))}),[a,i,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:s}}}({isDisabled:!a,onFocusWithinChange:h});return{isFocused:l,isFocusVisible:d,focusProps:a?p:m}}var pM=Object.defineProperty,gM=(e,t,n)=>(((e,t,n)=>{t in e?pM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let vM=new class{constructor(){gM(this,"current",this.detect()),gM(this,"handoffState","pending"),gM(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function wM(e){return vM.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function bM(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function yM(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add((()=>e.removeEventListener(n,r,o)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return bM((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=yM();return e(t),this.add((()=>t.dispose()))},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function xM(){let[e]=c(yM);return d((()=>()=>e.dispose()),[e]),e}let EM=(e,t)=>{vM.isServer?d(e,t):f(e,t)};function CM(e){let t=r(e);return EM((()=>{t.current=e}),[e]),t}let kM=function(e){let n=CM(e);return t.useCallback(((...e)=>n.current(...e)),[n])};let MM=i(void 0);function RM(){return a(MM)}function IM(...e){return Array.from(new Set(e.flatMap((e=>"string"==typeof e?e.split(" "):[])))).filter(Boolean).join(" ")}function OM(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,OM),r}var AM=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(AM||{}),LM=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(LM||{});function SM(){let e=function(){let e=r([]),t=o((t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)}),[]);return(...n)=>{if(!n.every((e=>null==e)))return e.current=n,t}}();return o((t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:a=!0,name:i,mergeRefs:l}){l=null!=l?l:jM;let s=DM(t,e);if(a)return NM(s,n,r,i,l);let c=null!=o?o:0;if(2&c){let{static:e=!1,...t}=s;if(e)return NM(t,n,r,i,l)}if(1&c){let{unmount:e=!0,...t}=s;return OM(e?0:1,{0:()=>null,1:()=>NM({...t,hidden:!0,style:{display:"none"}},n,r,i,l)})}return NM(s,n,r,i,l)}({mergeRefs:e,...t})),[e])}function NM(e,t={},n,r,o){let{as:a=n,children:i,refName:s="ref",...c}=BM(e,["unmount","static"]),d=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof i?i(t):i;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)));if(e){f["data-headlessui-state"]=n.join(" ");for(let e of n)f[`data-${e}`]=""}}if(a===h&&(Object.keys(TM(c)).length>0||Object.keys(TM(f)).length>0)){if(m(u)&&!(Array.isArray(u)&&u.length>1)){let e=u.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>IM(t(...e),c.className):IM(t,c.className),r=n?{className:n}:{},a=DM(u.props,TM(BM(c,["ref"])));for(let e in f)e in a&&delete f[e];return p(u,Object.assign({},a,f,d,{ref:o(FM(u),d.ref)},r))}if(Object.keys(TM(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(TM(c)).concat(Object.keys(TM(f))).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"))}return l(a,Object.assign({},BM(c,["ref"]),a!==h&&d,a!==h&&f),u)}function jM(...e){return e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function DM(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ZM(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function VM(e){var t;return Object.assign(n(e),{displayName:null!=(t=e.displayName)?t:e.name})}function TM(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function BM(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function FM(e){return t.version.split(".")[0]>="19"?e.props.ref:e.ref}function PM(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))_M(n,HM(t,r),o);return n}function HM(e,t){return e?e+"["+t+"]":t}function _M(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())_M(e,HM(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):PM(n,t,e)}var WM=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(WM||{});let zM=VM((function(e,t){var n;let{features:r=1,...o}=e,a={ref:t,"aria-hidden":!(2&~r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return SM()({ourProps:a,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})})),$M=i(null);function UM({children:e}){let n=a($M);if(!n)return t.createElement(t.Fragment,null,e);let{target:r}=n;return r?A(t.createElement(t.Fragment,null,e),r):null}function qM({data:e,form:n,disabled:r,onReset:o,overrides:a}){let[i,l]=c(null),s=xM();return d((()=>{if(o&&i)return s.addEventListener(i,"reset",o)}),[i,n,o]),t.createElement(UM,null,t.createElement(GM,{setForm:l,formId:n}),PM(e).map((([e,o])=>t.createElement(zM,{features:WM.Hidden,...TM({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:n,disabled:r,name:e,value:o,...a})}))))}function GM({setForm:e,formId:n}){return d((()=>{if(n){let t=document.getElementById(n);t&&e(t)}}),[e,n]),n?null:t.createElement(zM,{features:WM.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest("form");n&&e(n)}})}let YM=i(void 0);function KM(){return a(YM)}function XM(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}let QM=Symbol();function JM(...e){let t=r(e);d((()=>{t.current=e}),[e]);let n=kM((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[QM])))?void 0:n}let eR=i(null);function tR(){let e=a(eR);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,tR),e}return e}eR.displayName="DescriptionContext";let nR=VM((function(e,t){let n=g(),r=RM(),{id:o=`headlessui-description-${n}`,...a}=e,i=tR(),l=JM(t);EM((()=>i.register(o)),[o,i.register]);let c=r||!1,d=s((()=>({...i.slot,disabled:c})),[i.slot,c]),u={ref:l,...i.props,id:o};return SM()({ourProps:u,theirProps:a,slot:d,defaultTag:"p",name:i.name||"Description"})}));Object.assign(nR,{});var rR=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(rR||{});let oR=i(null);function aR(){let e=a(oR);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,aR),e}return e}function iR(e){var t,n,r;let o=null!=(n=null==(t=a(oR))?void 0:t.value)?n:void 0;return(null!=(r=null==e?void 0:e.length)?r:0)>0?[o,...e].filter(Boolean).join(" "):o}oR.displayName="LabelContext";let lR=VM((function(e,t){var n;let r=g(),o=aR(),a=KM(),i=RM(),{id:l=`headlessui-label-${r}`,htmlFor:c=(null!=a?a:null==(n=o.props)?void 0:n.htmlFor),passive:d=!1,...u}=e,f=JM(t);EM((()=>o.register(l)),[l,o.register]);let h=kM((e=>{let t=e.currentTarget;if(t instanceof HTMLLabelElement&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),t instanceof HTMLLabelElement){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let n=e.getAttribute("aria-disabled");if("true"===n||""===n)return;(e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}})),m=i||!1,p=s((()=>({...o.slot,disabled:m})),[o.slot,m]),v={ref:f,...o.props,id:l,htmlFor:c,onClick:h};return d&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in u&&delete u.onClick),SM()({ourProps:v,theirProps:u,slot:p,defaultTag:c?"label":"div",name:o.name||"Label"})})),sR=Object.assign(lR,{});function cR(e,t,n){let r,o=n.initialDeps??[];return()=>{var a,i,l,s;let c;n.key&&(null==(a=n.debug)?void 0:a.call(n))&&(c=Date.now());const d=e(),u=d.length!==o.length||d.some(((e,t)=>o[t]!==e));if(!u)return r;let f;if(o=d,n.key&&(null==(i=n.debug)?void 0:i.call(n))&&(f=Date.now()),r=t(...d),n.key&&(null==(l=n.debug)?void 0:l.call(n))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-f))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(s=null==n?void 0:n.onChange)||s.call(n,r),r}}function dR(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const uR=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,o)),n)}},fR=e=>e,hR=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},mR=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void o({width:e.inlineSize,height:e.blockSize})}o(n.getBoundingClientRect())}));return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},pR={passive:!0},gR="undefined"==typeof window||"onscrollend"in window,vR=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const a=e.options.useScrollendEvent&&gR?()=>{}:uR(r,(()=>{t(o,!1)}),e.options.isScrollingResetDelay),i=r=>()=>{const{horizontal:i,isRtl:l}=e.options;o=i?n.scrollLeft*(l?-1:1):n.scrollTop,a(),t(o,r)},l=i(!0),s=i(!1);return s(),n.addEventListener("scroll",l,pR),n.addEventListener("scrollend",s,pR),()=>{n.removeEventListener("scroll",l),n.removeEventListener("scrollend",s)}},wR=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},bR=(e,{adjustments:t=0,behavior:n},r)=>{var o,a;const i=e+t;null==(a=null==(o=r.scrollElement)?void 0:o.scrollTo)||a.call(o,{[r.options.horizontal?"left":"top"]:i,behavior:n})};class yR{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{this._measureElement(e.target,e)}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fR,rangeExtractor:hR,onChange:()=>{},measureElement:wR,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=cR((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=cR((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o})),{key:!1}),this.getMeasurements=cR((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,i);for(let o=i;o<e;o++){const e=r(o),i=1===this.options.lanes?l[o-1]:this.getFurthestMeasurement(l,o),s=i?i.end+this.options.gap:t+n,c=a.get(e),d="number"==typeof c?c:this.options.estimateSize(o),u=s+d,f=i?i.lane:o%this.options.lanes;l[o]={index:o,start:s,size:d,end:u,key:e,lane:f}}return this.measurementsCache=l,l}),{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=cR((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=t=>e[t].start,a=xR(0,r,o,n);let i=a;for(;i<r&&e[i].end<n+t;)i++;return{startIndex:a,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:n}):null),{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=cR((()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count]),((e,t,n,r)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r})),{key:"production"!==process.env.NODE_ENV&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const o=r.key,a=this.elementsCache.get(o);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const r=t-(this.itemSizeCache.get(n.key)??n.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug&&console.info("correction",r),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=cR((()=>[this.getIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n}),{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return dR(t[xR(0,t.length-1,(e=>dR(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize(),r=this.getScrollOffset();"auto"===t&&(t=e<=r?"start":e>=r+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));const o=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(n.end>=o+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}const a="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[o,a]=r;this._scrollToOffset(o,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[t]=dR(this.getOffsetForIndex(e,a));((e,t)=>Math.abs(e-t)<1)(t,this.getScrollOffset())||this.scrollToIndex(e,{align:a,behavior:n})}else this.scrollToIndex(e,{align:a,behavior:n})})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;return n=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map((e=>e.end))),Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const xR=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,a=n(o);if(a<r)e=o+1;else{if(!(a>r))return o;t=o-1}}return e>0?e-1:0};const ER="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function CR(t){return function(t){const n=e.useReducer((()=>({})),{})[1],r={...t,onChange:(e,r)=>{var o;r?L(n):n(),null==(o=t.onChange)||o.call(t,e,r)}},[o]=e.useState((()=>new yR(r)));return o.setOptions(r),ER((()=>o._didMount()),[]),ER((()=>o._willUpdate())),o}({observeElementRect:mR,observeElementOffset:vR,scrollToFn:bR,...t})}function kR(e,t){return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&"id"in e&&"id"in t?e.id===t.id:e===t}function MR(e,t=!1){let[n,r]=v((()=>({})),{}),o=s((()=>function(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}(e)),[e,n]);return EM((()=>{if(!e)return;let t=new ResizeObserver(r);return t.observe(e),()=>{t.disconnect()}}),[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let RR=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};function IR(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let a=t[e].call(n,...o);a&&(n=a,r.forEach((e=>e())))}}}function OR(e){return w(e.subscribe,e.getSnapshot,e.getSnapshot)}let AR=new RR((()=>IR((()=>[]),{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(-1===t)return this;let n=this.slice();return n.splice(t,1),n}})));function LR(e,t){let n=AR.get(t),r=g(),o=OR(n);if(EM((()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)}),[n,e]),!e)return!1;let a=o.indexOf(r),i=o.length;return-1===a&&(a=i,i+=1),a===i-1}let SR=new Map,NR=new Map;function jR(e){var t;let n=null!=(t=NR.get(e))?t:0;return NR.set(e,n+1),0!==n||(SR.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>DR(e)}function DR(e){var t;let n=null!=(t=NR.get(e))?t:1;if(1===n?NR.delete(e):NR.set(e,n-1),1!==n)return;let r=SR.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,SR.delete(e))}function ZR(e,{allowed:t,disallowed:n}={}){let r=LR(e,"inert-others");EM((()=>{var e,o;if(!r)return;let a=yM();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&a.add(jR(t));let i=null!=(o=null==t?void 0:t())?o:[];for(let e of i){if(!e)continue;let t=wM(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)i.some((t=>e.contains(t)))||a.add(jR(e));n=n.parentElement}}return a.dispose}),[r,t,n])}let VR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var TR=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(TR||{}),BR=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(BR||{}),FR=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(FR||{}),PR=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(PR||{});var HR=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(HR||{});function _R(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function WR(){return _R()||/Android/gi.test(window.navigator.userAgent)}function zR(e,t,n,r){let o=CM(n);d((()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){o.current(e)}}),[e,t,r])}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));function $R(e,t,n){let a=LR(e,"outside-click"),i=CM(n),l=o((function(e,n){if(e.defaultPrevented)return;let r=n(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of o)if(null!==t&&(t.contains(r)||e.composed&&e.composedPath().includes(t)))return;return!function(e,t=0){var n;return e!==(null==(n=wM(e))?void 0:n.body)&&OM(t,{0:()=>e.matches(VR),1(){let t=e;for(;null!==t;){if(t.matches(VR))return!0;t=t.parentElement}return!1}})}(r,PR.Loose)&&-1!==r.tabIndex&&e.preventDefault(),i.current(e,r)}),[i,t]),s=r(null);zR(a,"pointerdown",(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),zR(a,"mousedown",(e=>{var t,n;s.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),zR(a,"click",(e=>{WR()||s.current&&(l(e,(()=>s.current)),s.current=null)}),!0);let c=r({x:0,y:0});zR(a,"touchstart",(e=>{c.current.x=e.touches[0].clientX,c.current.y=e.touches[0].clientY}),!0),zR(a,"touchend",(e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-c.current.x)>=30||Math.abs(n-c.current.y)>=30))return l(e,(()=>e.target instanceof HTMLElement?e.target:null))}),!0),function(e,t,n,r){let o=CM(n);d((()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){o.current(e)}}),[e,t,r])}(a,"blur",(e=>l(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}function UR(...e){return s((()=>wM(...e)),[...e])}function qR(e){let t=r({value:"",selectionStart:null,selectionEnd:null});return function(e,t,n,r){let o=CM(n);d((()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}(e,"blur",(e=>{let n=e.target;n instanceof HTMLInputElement&&(t.current={value:n.value,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})})),kM((()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;null!==n&&null!==r&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}}))}function GR(e,t){return s((()=>{var n;if(e.type)return e.type;let r=null!=(n=e.as)?n:"button";return"string"==typeof r&&"button"===r.toLowerCase()||"BUTTON"===(null==t?void 0:t.tagName)&&!t.hasAttribute("type")?"button":void 0}),[e.type,e.as,t])}function YR(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-o);n.style(r,"paddingRight",`${a}px`)}}}function KR(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let XR=IR((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:yM(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:KR(n)},o=[_R()?{before({doc:e,d:t,meta:n}){function r(e){return n.containers.flatMap((e=>e())).some((t=>t.contains(e)))}t.microTask((()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=yM();n.style(e.documentElement,"scrollBehavior","auto"),t.add((()=>t.microTask((()=>n.dispose()))))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,a=null;t.addEventListener(e,"click",(t=>{if(t.target instanceof HTMLElement)try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),i=e.querySelector(o);i&&!r(i)&&(a=i)}catch{}}),!0),t.addEventListener(e,"touchstart",(e=>{if(e.target instanceof HTMLElement)if(r(e.target)){let n=e.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;t.style(n,"overscrollBehavior","contain")}else t.style(e.target,"touchAction","none")})),t.addEventListener(e,"touchmove",(e=>{if(e.target instanceof HTMLElement){if("INPUT"===e.target.tagName)return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)}))}))}}:{},YR(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];o.forEach((({before:e})=>null==e?void 0:e(r))),o.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function QR(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=OR(XR),o=t?r.get(t):void 0,a=!!o&&o.count>0;EM((()=>{if(t&&e)return XR.dispatch("PUSH",t,n),()=>XR.dispatch("POP",t,n)}),[e,t])}(LR(e,"scroll-lock"),t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}function JR(e){return[e.screenX,e.screenY]}var eI,tI;XR.subscribe((()=>{let e=XR.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&XR.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&XR.dispatch("TEARDOWN",n)}})),"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(eI=null==process?void 0:process.env)?void 0:eI.NODE_ENV)&&void 0===(null==(tI=null==Element?void 0:Element.prototype)?void 0:tI.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var nI=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(nI||{});function rI(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function oI(e,t,n,a){let[i,l]=c(n),{hasFlag:s,addFlag:d,removeFlag:u}=function(e=0){let[t,n]=c(e),r=o((e=>n(e)),[t]),a=o((e=>n((t=>t|e))),[t]),i=o((e=>(t&e)===e),[t]),l=o((e=>n((t=>t&~e))),[n]),s=o((e=>n((t=>t^e))),[n]);return{flags:t,setFlag:r,addFlag:a,hasFlag:i,removeFlag:l,toggleFlag:s}}(e&&i?3:0),f=r(!1),h=r(!1),m=xM();return EM((()=>{if(e)return n&&l(!0),t?(null==void 0||undefined.call(a,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let a=yM();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),a.nextFrame((()=>{n(),a.requestAnimationFrame((()=>{a.add(function(e,t){var n,r;let o=yM();if(!e)return o.dispose;let a=!1;o.add((()=>{a=!0}));let i=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter((e=>e instanceof CSSTransition)))?r:[];return 0===i.length?(t(),o.dispose):(Promise.allSettled(i.map((e=>e.finished))).then((()=>{a||t()})),o.dispose)}(e,r))}))})),a.dispose}(t,{inFlight:f,prepare(){h.current?h.current=!1:h.current=f.current,f.current=!0,!h.current&&(n?(d(3),u(4)):(d(4),u(2)))},run(){h.current?n?(u(3),d(4)):(u(4),d(3)):n?u(1):d(1)},done(){h.current&&"function"==typeof t.getAnimations&&t.getAnimations().length>0||(f.current=!1,u(7),n||l(!1),null==void 0||undefined.call(a,n))}})):void(n&&d(3))}),[e,n,t,m]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function aI(e,t){let n=r([]),o=kM(e);d((()=>{let e=[...n.current];for(let[r,a]of t.entries())if(n.current[r]!==a){let r=o(t,e);return n.current=t,r}}),[o,...t])}function iI(){return"undefined"!=typeof window}function lI(e){return dI(e)?(e.nodeName||"").toLowerCase():"#document"}function sI(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cI(e){var t;return null==(t=(dI(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function dI(e){return!!iI()&&(e instanceof Node||e instanceof sI(e).Node)}function uI(e){return!!iI()&&(e instanceof Element||e instanceof sI(e).Element)}function fI(e){return!!iI()&&(e instanceof HTMLElement||e instanceof sI(e).HTMLElement)}function hI(e){return!(!iI()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof sI(e).ShadowRoot)}function mI(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=yI(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pI(e){return["table","td","th"].includes(lI(e))}function gI(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function vI(e){const t=wI(),n=uI(e)?yI(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function wI(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function bI(e){return["html","body","#document"].includes(lI(e))}function yI(e){return sI(e).getComputedStyle(e)}function xI(e){return uI(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function EI(e){if("html"===lI(e))return e;const t=e.assignedSlot||e.parentNode||hI(e)&&e.host||cI(e);return hI(t)?t.host:t}function CI(e){const t=EI(e);return bI(t)?e.ownerDocument?e.ownerDocument.body:e.body:fI(t)&&mI(t)?t:CI(t)}function kI(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=CI(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=sI(o);if(a){const e=MI(i);return t.concat(i,i.visualViewport||[],mI(o)?o:[],e&&n?kI(e):[])}return t.concat(o,kI(o,[],n))}function MI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const RI=["top","right","bottom","left"],II=Math.min,OI=Math.max,AI=Math.round,LI=Math.floor,SI=e=>({x:e,y:e}),NI={left:"right",right:"left",bottom:"top",top:"bottom"},jI={start:"end",end:"start"};function DI(e,t,n){return OI(e,II(t,n))}function ZI(e,t){return"function"==typeof e?e(t):e}function VI(e){return e.split("-")[0]}function TI(e){return e.split("-")[1]}function BI(e){return"x"===e?"y":"x"}function FI(e){return"y"===e?"height":"width"}function PI(e){return["top","bottom"].includes(VI(e))?"y":"x"}function HI(e){return BI(PI(e))}function _I(e){return e.replace(/start|end/g,(e=>jI[e]))}function WI(e){return e.replace(/left|right|bottom|top/g,(e=>NI[e]))}function zI(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function $I(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function UI(e,t,n){let{reference:r,floating:o}=e;const a=PI(t),i=HI(t),l=FI(i),s=VI(t),c="y"===a,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let h;switch(s){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-o.width,y:u};break;default:h={x:r.x,y:r.y}}switch(TI(t)){case"start":h[i]-=f*(n&&c?-1:1);break;case"end":h[i]+=f*(n&&c?-1:1)}return h}async function qI(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:h=0}=ZI(t,e),m=zI(h),p=l[f?"floating"===u?"reference":"floating":u],g=$I(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(p)))||n?p:p.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:s})),v="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l.floating)),b=await(null==a.isElement?void 0:a.isElement(w))&&await(null==a.getScale?void 0:a.getScale(w))||{x:1,y:1},y=$I(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:s}):v);return{top:(g.top-y.top+m.top)/b.y,bottom:(y.bottom-g.bottom+m.bottom)/b.y,left:(g.left-y.left+m.left)/b.x,right:(y.right-g.right+m.right)/b.x}}function GI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function YI(e){return RI.some((t=>e[t]>=0))}function KI(e){const t=yI(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=fI(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=AI(n)!==a||AI(r)!==i;return l&&(n=a,r=i),{width:n,height:r,$:l}}function XI(e){return uI(e)?e:e.contextElement}function QI(e){const t=XI(e);if(!fI(t))return SI(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=KI(t);let i=(a?AI(n.width):n.width)/r,l=(a?AI(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const JI=SI(0);function eO(e){const t=sI(e);return wI()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:JI}function tO(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=XI(e);let i=SI(1);t&&(r?uI(r)&&(i=QI(r)):i=QI(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==sI(e))&&t}(a,n,r)?eO(a):SI(0);let s=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=sI(a),t=r&&uI(r)?sI(r):r;let n=e,o=MI(n);for(;o&&r&&t!==n;){const e=QI(o),t=o.getBoundingClientRect(),r=yI(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,u*=e.y,s+=a,c+=i,n=sI(o),o=MI(n)}}return $I({width:d,height:u,x:s,y:c})}function nO(e,t){const n=xI(e).scrollLeft;return t?t.left+n:tO(cI(e)).left+n}function rO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:nO(e,r)),y:r.top+t.scrollTop}}function oO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=sI(e),r=cI(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,l=0,s=0;if(o){a=o.width,i=o.height;const e=wI();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:a,height:i,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=cI(e),n=xI(e),r=e.ownerDocument.body,o=OI(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=OI(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+nO(e);const l=-n.scrollTop;return"rtl"===yI(r).direction&&(i+=OI(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:l}}(cI(e));else if(uI(t))r=function(e,t){const n=tO(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=fI(e)?QI(e):SI(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=eO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $I(r)}function aO(e,t){const n=EI(e);return!(n===t||!uI(n)||bI(n))&&("fixed"===yI(n).position||aO(n,t))}function iO(e,t,n){const r=fI(t),o=cI(t),a="fixed"===n,i=tO(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const s=SI(0);if(r||!r&&!a)if(("body"!==lI(t)||mI(o))&&(l=xI(t)),r){const e=tO(t,!0,a,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=nO(o));const c=!o||r||a?SI(0):rO(o,l);return{x:i.left+l.scrollLeft-s.x-c.x,y:i.top+l.scrollTop-s.y-c.y,width:i.width,height:i.height}}function lO(e){return"static"===yI(e).position}function sO(e,t){if(!fI(e)||"fixed"===yI(e).position)return null;if(t)return t(e);let n=e.offsetParent;return cI(e)===n&&(n=n.ownerDocument.body),n}function cO(e,t){const n=sI(e);if(gI(e))return n;if(!fI(e)){let t=EI(e);for(;t&&!bI(t);){if(uI(t)&&!lO(t))return t;t=EI(t)}return n}let r=sO(e,t);for(;r&&pI(r)&&lO(r);)r=sO(r,t);return r&&bI(r)&&lO(r)&&!vI(r)?n:r||function(e){let t=EI(e);for(;fI(t)&&!bI(t);){if(vI(t))return t;if(gI(t))return null;t=EI(t)}return null}(e)||n}const dO={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=cI(r),l=!!t&&gI(t.floating);if(r===i||l&&a)return n;let s={scrollLeft:0,scrollTop:0},c=SI(1);const d=SI(0),u=fI(r);if((u||!u&&!a)&&(("body"!==lI(r)||mI(i))&&(s=xI(r)),fI(r))){const e=tO(r);c=QI(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!i||u||a?SI(0):rO(i,s,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-s.scrollTop*c.y+d.y+f.y}},getDocumentElement:cI,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?gI(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=kI(e,[],!1).filter((e=>uI(e)&&"body"!==lI(e))),o=null;const a="fixed"===yI(e).position;let i=a?EI(e):e;for(;uI(i)&&!bI(i);){const t=yI(i),n=vI(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||mI(i)&&!n&&aO(e,i))?r=r.filter((e=>e!==i)):o=t,i=EI(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],l=a.reduce(((e,n)=>{const r=oO(t,n,o);return e.top=OI(r.top,e.top),e.right=II(r.right,e.right),e.bottom=II(r.bottom,e.bottom),e.left=OI(r.left,e.left),e}),oO(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:cO,getElementRects:async function(e){const t=this.getOffsetParent||cO,n=this.getDimensions,r=await n(e.floating);return{reference:iO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=KI(e);return{width:t,height:n}},getScale:QI,isElement:uI,isRTL:function(e){return"rtl"===yI(e).direction}};function uO(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=XI(e),d=o||a?[...c?kI(c):[],...kI(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const u=c&&l?function(e,t){let n,r=null;const o=cI(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),a();const{left:c,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const h={rootMargin:-LI(d)+"px "+-LI(o.clientWidth-(c+u))+"px "+-LI(o.clientHeight-(d+f))+"px "+-LI(c)+"px",threshold:OI(0,II(1,s))||1};let m=!0;function p(e){const t=e[0].intersectionRatio;if(t!==s){if(!m)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(p,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(p,h)}r.observe(e)}(!0),a}(c,n):null;let f,h=-1,m=null;i&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),c&&!s&&m.observe(c),m.observe(t));let p=s?tO(e):null;return s&&function t(){const r=tO(e);!p||r.x===p.x&&r.y===p.y&&r.width===p.width&&r.height===p.height||n();p=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(f)}}const fO=qI,hO=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=VI(n),l=TI(n),s="y"===PI(n),c=["left","top"].includes(i)?-1:1,d=a&&s?-1:1,u=ZI(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof m&&(h="end"===l?-1*m:m),s?{x:h*d,y:f*c}:{x:f*c,y:h*d}}(t,e);return i===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:a+s.y,data:{...s,placement:i}}}}},mO=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=ZI(e,t),c={x:n,y:r},d=await qI(t,s),u=PI(VI(o)),f=BI(u);let h=c[f],m=c[u];if(a){const e="y"===f?"bottom":"right";h=DI(h+d["y"===f?"top":"left"],h,h-d[e])}if(i){const e="y"===u?"bottom":"right";m=DI(m+d["y"===u?"top":"left"],m,m-d[e])}const p=l.fn({...t,[f]:h,[u]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:a,[u]:i}}}}}},pO=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=ZI(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=VI(o),w=PI(l),b=VI(l)===l,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=f||(b||!p?[WI(l)]:function(e){const t=WI(e);return[_I(e),t,_I(t)]}(l)),E="none"!==m;!f&&E&&x.push(...function(e,t,n,r){const o=TI(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}(VI(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(_I)))),a}(l,p,m,y));const C=[l,...x],k=await qI(t,g),M=[];let R=(null==(r=a.flip)?void 0:r.overflows)||[];if(d&&M.push(k[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=TI(e),o=HI(e),a=FI(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=WI(i)),[i,WI(i)]}(o,i,y);M.push(k[e[0]],k[e[1]])}if(R=[...R,{placement:o,overflows:M}],!M.every((e=>e<=0))){var I,O;const e=((null==(I=a.flip)?void 0:I.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(O=R.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!n)switch(h){case"bestFit":{var A;const e=null==(A=R.filter((e=>{if(E){const t=PI(e.placement);return t===w||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},gO=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:l}=t,{apply:s=()=>{},...c}=ZI(e,t),d=await qI(t,c),u=VI(o),f=TI(o),h="y"===PI(o),{width:m,height:p}=a.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=f===(await(null==i.isRTL?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(v=u,g="end"===f?"top":"bottom");const w=p-d.top-d.bottom,b=m-d.left-d.right,y=II(p-d[g],w),x=II(m-d[v],b),E=!t.middlewareData.shift;let C=y,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(C=w),E&&!f){const e=OI(d.left,0),t=OI(d.right,0),n=OI(d.top,0),r=OI(d.bottom,0);h?k=m-2*(0!==e||0!==t?e+t:OI(d.left,d.right)):C=p-2*(0!==n||0!==r?n+r:OI(d.top,d.bottom))}await s({...t,availableWidth:k,availableHeight:C});const M=await i.getDimensions(l.floating);return m!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},vO=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ZI(e,t);switch(r){case"referenceHidden":{const e=GI(await qI(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:YI(e)}}}case"escaped":{const e=GI(await qI(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:YI(e)}}}default:return{}}}}},wO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:l,middlewareData:s}=t,{element:c,padding:d=0}=ZI(e,t)||{};if(null==c)return{};const u=zI(d),f={x:n,y:r},h=HI(o),m=FI(h),p=await i.getDimensions(c),g="y"===h,v=g?"top":"left",w=g?"bottom":"right",b=g?"clientHeight":"clientWidth",y=a.reference[m]+a.reference[h]-f[h]-a.floating[m],x=f[h]-a.reference[h],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let C=E?E[b]:0;C&&await(null==i.isElement?void 0:i.isElement(E))||(C=l.floating[b]||a.floating[m]);const k=y/2-x/2,M=C/2-p[m]/2-1,R=II(u[v],M),I=II(u[w],M),O=R,A=C-p[m]-I,L=C/2-p[m]/2+k,S=DI(O,L,A),N=!s.arrow&&null!=TI(o)&&L!==S&&a.reference[m]/2-(L<O?R:I)-p[m]/2<0,j=N?L<O?L-O:L-A:0;return{[h]:f[h]+j,data:{[h]:S,centerOffset:L-S-j,...N&&{alignmentOffset:j}},reset:N}}}),bO=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=ZI(e,t),d={x:n,y:r},u=PI(o),f=BI(u);let h=d[f],m=d[u];const p=ZI(l,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(s){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var v,w;const e="y"===f?"width":"height",t=["top","left"].includes(VI(o)),n=a.reference[u]-a.floating[e]+(t&&(null==(v=i.offset)?void 0:v[u])||0)+(t?0:g.crossAxis),r=a.reference[u]+a.reference[e]+(t?0:(null==(w=i.offset)?void 0:w[u])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:h,[u]:m}}}},yO=(e,t,n)=>{const r=new Map,o={platform:dO,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,l=a.filter(Boolean),s=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=UI(c,r,s),f=r,h={},m=0;for(let n=0;n<l.length;n++){const{name:a,fn:p}=l[n],{x:g,y:v,data:w,reset:b}=await p({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,h={...h,[a]:{...h[a],...w}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=UI(c,f,s))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var xO="undefined"!=typeof document?f:d;function EO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!EO(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!EO(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function CO(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kO(e,t){const n=CO(e);return Math.round(t*n)/n}function MO(t){const n=e.useRef(t);return xO((()=>{n.current=t})),n}function RO(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:c,open:d}=t,[u,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);EO(h,o)||m(o);const[p,g]=e.useState(null),[v,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),y=e.useCallback((e=>{e!==k.current&&(k.current=e,w(e))}),[]),x=i||p,E=l||v,C=e.useRef(null),k=e.useRef(null),M=e.useRef(u),R=null!=c,O=MO(c),A=MO(a),L=MO(d),S=e.useCallback((()=>{if(!C.current||!k.current)return;const e={placement:n,strategy:r,middleware:h};A.current&&(e.platform=A.current),yO(C.current,k.current,e).then((e=>{const t={...e,isPositioned:!1!==L.current};N.current&&!EO(M.current,t)&&(M.current=t,I.flushSync((()=>{f(t)})))}))}),[h,n,r,A,L]);xO((()=>{!1===d&&M.current.isPositioned&&(M.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const N=e.useRef(!1);xO((()=>(N.current=!0,()=>{N.current=!1})),[]),xO((()=>{if(x&&(C.current=x),E&&(k.current=E),x&&E){if(O.current)return O.current(x,E,S);S()}}),[x,E,S,O,R]);const j=e.useMemo((()=>({reference:C,floating:k,setReference:b,setFloating:y})),[b,y]),D=e.useMemo((()=>({reference:x,floating:E})),[x,E]),Z=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=kO(D.floating,u.x),n=kO(D.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...CO(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,D.floating,u.x,u.y]);return e.useMemo((()=>({...u,update:S,refs:j,elements:D,floatingStyles:Z})),[u,S,j,D,Z])}const IO=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?wO({element:n.current,padding:r}).fn(t):{}:n?wO({element:n,padding:r}).fn(t):{};var o}}),OO=(e,t)=>({...hO(e),options:[e,t]}),AO=(e,t)=>({...mO(e),options:[e,t]}),LO=(e,t)=>({...bO(e),options:[e,t]}),SO=(e,t)=>({...pO(e),options:[e,t]}),NO=(e,t)=>({...gO(e),options:[e,t]}),jO=(e,t)=>({...vO(e),options:[e,t]}),DO=(e,t)=>({...IO(e),options:[e,t]}),ZO={...e},VO=ZO.useInsertionEffect||(e=>e());function TO(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return VO((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var BO="undefined"!=typeof document?f:d;let FO=!1,PO=0;const HO=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+PO++;const _O=ZO.useId||function(){const[t,n]=e.useState((()=>FO?HO():void 0));return BO((()=>{null==t&&n(HO())}),[]),e.useEffect((()=>{FO=!0}),[]),t};let WO;"production"!==process.env.NODE_ENV&&(WO=new Set);const zO=e.createContext(null),$O=e.createContext(null),UO="data-floating-ui-focusable";function qO(t){const{open:n=!1,onOpenChange:r,elements:o}=t,a=_O(),i=e.useRef({}),[l]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),s=null!=((null==(c=e.useContext(zO))?void 0:c.id)||null);var c;if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!uI(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var a;null!=(e=WO)&&e.has(o)||(null==(a=WO)||a.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=e.useState(o.reference),f=TO(((e,t,n)=>{i.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:s}),null==r||r(e,t,n)})),h=e.useMemo((()=>({setPositionReference:u})),[]),m=e.useMemo((()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference})),[d,o.reference,o.floating]);return e.useMemo((()=>({dataRef:i,open:n,onOpenChange:f,elements:m,events:l,floatingId:a,refs:h})),[n,f,m,l,a,h])}function GO(t){void 0===t&&(t={});const{nodeId:n}=t,r=qO({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,a=o.elements,[i,l]=e.useState(null),[s,c]=e.useState(null),d=(null==a?void 0:a.domReference)||i,u=e.useRef(null),f=e.useContext($O);BO((()=>{d&&(u.current=d)}),[d]);const h=RO({...t,elements:{...a,...s&&{reference:s}}}),m=e.useCallback((e=>{const t=uI(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),p=e.useCallback((e=>{(uI(e)||null===e)&&(u.current=e,l(e)),(uI(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!uI(e))&&h.refs.setReference(e)}),[h.refs]),g=e.useMemo((()=>({...h.refs,setReference:p,setPositionReference:m,domReference:u})),[h.refs,p,m]),v=e.useMemo((()=>({...h.elements,domReference:d})),[h.elements,d]),w=e.useMemo((()=>({...h,...o,refs:g,elements:v,nodeId:n})),[h,g,v,n,o]);return BO((()=>{o.dataRef.current.floatingContext=w;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...h,context:w,refs:g,elements:v})),[h,g,v,w])}const YO="active",KO="selected";function XO(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[YO]:t,[KO]:n,...r}=e;a=r}return{..."floating"===n&&{tabIndex:-1,[UO]:""},...a,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,a]=t;var i;o&&[YO,KO].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=a)})),e):e),{})}}function QO(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const JO=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:a=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:c,...d}=ZI(e,t),{rects:u,elements:{floating:f}}=t,h=n.current[i],m=(null==c?void 0:c.current)||f,p=f.clientTop||m.clientTop,g=0!==f.clientTop,v=0!==m.clientTop,w=f===m;if("production"!==process.env.NODE_ENV&&(t.placement.startsWith("bottom")||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var a;null!=(e=WO)&&e.has(o)||(null==(a=WO)||a.add(o),console.warn(o))}('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const b={...t,...await OO(-h.offsetTop-f.clientTop-u.reference.height/2-h.offsetHeight/2-a).fn(t)},y=await fO(QO(b,m.scrollHeight+p+f.clientTop),d),x=await fO(b,{...d,elementContext:"reference"}),E=OI(0,y.top),C=b.y+E,k=m.scrollHeight>m.clientHeight?e=>e:AI,M=k(OI(0,m.scrollHeight+(g&&w||v?2*p:0)-E-OI(0,y.bottom)));if(m.style.maxHeight=M+"px",m.scrollTop=E,o){const e=m.offsetHeight<h.offsetHeight*II(l,n.current.length)-1||x.top>=-s||x.bottom>=-s;I.flushSync((()=>o(e)))}return r&&(r.current=await fO(QO({...b,y:C},m.offsetHeight+p+f.clientTop),d)),{y:C}}});function eA(t,n){const{open:r,elements:o}=t,{enabled:a=!0,overflowRef:i,scrollRef:l,onChange:s}=n,c=TO(s),d=e.useRef(!1),u=e.useRef(null),f=e.useRef(null);e.useEffect((()=>{if(!a)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,a=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),I.flushSync((()=>{c((e=>e+Math[s](n,a*l)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return r&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{u.current=t.scrollTop,null!=i.current&&(f.current={...i.current})})),()=>{u.current=null,f.current=null,t.removeEventListener("wheel",e)}):void 0}),[a,r,o.floating,i,l,c]);const h=e.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(i.current&&e&&d.current){if(null!==u.current){const t=e.scrollTop-u.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&I.flushSync((()=>c((e=>e+t))))}requestAnimationFrame((()=>{u.current=e.scrollTop}))}}})),[o.floating,c,i,l]);return e.useMemo((()=>a?{floating:h}:{}),[a,h])}let tA=i({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tA.displayName="FloatingContext";let nA=i(null);nA.displayName="PlacementContext";function rA({children:t,enabled:n=!0}){let[o,a]=c(null),[i,l]=c(0),d=r(null),[u,f]=c(null);!function(e){EM((()=>{if(!e)return;let t=new MutationObserver((()=>{let t=window.getComputedStyle(e).maxHeight,n=parseFloat(t);if(isNaN(n))return;let r=parseInt(t);isNaN(r)||n!==r&&(e.style.maxHeight=`${Math.ceil(n)}px`)}));return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}}),[e])}(u);let h=n&&null!==o&&null!==u,{to:m="bottom",gap:p=0,offset:g=0,padding:v=0,inner:w}=function(e,t){var n,r,o;let a=oA(null!=(n=null==e?void 0:e.gap)?n:"var(--anchor-gap, 0)",t),i=oA(null!=(r=null==e?void 0:e.offset)?r:"var(--anchor-offset, 0)",t),l=oA(null!=(o=null==e?void 0:e.padding)?o:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:i,padding:l}}(o,u),[b,y="center"]=m.split(" ");EM((()=>{h&&l(0)}),[h]);let{refs:x,floatingStyles:E,context:C}=GO({open:h,placement:"selection"===b?"center"===y?"bottom":`bottom-${y}`:"center"===y?`${b}`:`${b}-${y}`,strategy:"absolute",transform:!1,middleware:[OO({mainAxis:"selection"===b?0:p,crossAxis:g}),AO({padding:v}),"selection"!==b&&SO({padding:v}),"selection"===b&&w?JO({...w,padding:v,overflowRef:d,offset:i,minItemsVisible:4,referenceOverflowThreshold:v,onFallbackChange(e){var t,n;if(!e)return;let r=C.elements.floating;if(!r)return;let o=parseFloat(getComputedStyle(r).scrollPaddingBottom)||0,a=Math.min(4,r.childElementCount),i=0,s=0;for(let e of null!=(n=null==(t=C.elements.floating)?void 0:t.childNodes)?n:[])if(e instanceof HTMLElement){let t=e.offsetTop,n=t+e.clientHeight+o,l=r.scrollTop,c=l+r.clientHeight;if(!(t>=l&&n<=c)){s=Math.max(0,Math.min(n,c)-Math.max(t,l)),i=e.clientHeight;break}a--}a>=1&&l((e=>{let t=i*a-s+o;return e>=t?e:t}))}}):null,NO({padding:v,apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{overflow:"auto",maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:uO}),[k=b,M=y]=C.placement.split("-");"selection"===b&&(k="selection");let R=s((()=>({anchor:[k,M].filter(Boolean).join(" ")})),[k,M]),I=eA(C,{overflowRef:d,onChange:l}),{getReferenceProps:O,getFloatingProps:A}=function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),a=e.useCallback((e=>XO(e,t,"reference")),n),i=e.useCallback((e=>XO(e,t,"floating")),r),l=e.useCallback((e=>XO(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:l})),[a,i,l])}([I]),L=kM((e=>{f(e),x.setFloating(e)}));return e.createElement(nA.Provider,{value:a},e.createElement(tA.Provider,{value:{setFloating:L,setReference:x.setReference,styles:E,getReferenceProps:O,getFloatingProps:A,slot:R}},t))}function oA(e,t,n=void 0){let r=xM(),o=kM(((e,t)=>{if(null==e)return[n,null];if("number"==typeof e)return[e,null];if("string"==typeof e){if(!t)return[n,null];let o=iA(e,t);return[o,n=>{let a=aA(e);{let i=a.map((e=>window.getComputedStyle(t).getPropertyValue(e)));r.requestAnimationFrame((function l(){r.nextFrame(l);let s=!1;for(let[e,n]of a.entries()){let r=window.getComputedStyle(t).getPropertyValue(n);if(i[e]!==r){i[e]=r,s=!0;break}}if(!s)return;let c=iA(e,t);o!==c&&(n(c),o=c)}))}return r.dispose}]}return[n,null]})),a=s((()=>o(e,t)[0]),[e,t]),[i=a,l]=c();return EM((()=>{let[n,r]=o(e,t);if(l(n),r)return r(l)}),[e,t]),i}function aA(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(",");if(-1===e)return[t[1]];let n=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[n,...aA(r)]:[n]}return[]}function iA(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function lA({children:e,freeze:n}){let r=sA(n,e);return t.createElement(t.Fragment,null,r)}function sA(e,t){let[n,r]=c(t);return!e&&n!==t&&r(t),e?n:t}let cA=i(null);cA.displayName="OpenClosedContext";var dA=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(dA||{});function uA({value:e,children:n}){return t.createElement(cA.Provider,{value:e},n)}let fA=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}((()=>{function e(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||fA[0]===e.target)return;let t=e.target;t=t.closest(VR),fA.unshift(null!=t?t:e.target),fA=fA.filter((e=>null!=e&&e.isConnected)),fA.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})}));var hA=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(hA||{});function mA(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:-1===o&&(o=n.length);for(let e=o-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=o+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}var pA=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(pA||{});function gA(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in e&&e.useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!t))}(),[n,r]=e.useState(vM.isHandoffComplete);return n&&!1===vM.isHandoffComplete&&r(!1),e.useEffect((()=>{!0!==n&&r(!0)}),[n]),e.useEffect((()=>vM.handoff()),[]),!t&&n}let vA=i(!1);function wA(){return a(vA)}function bA(e){let t=wA(),n=a(CA),r=UR(e),[o,i]=c((()=>{var e;if(!t&&null!==n)return null!=(e=n.current)?e:null;if(vM.isServer)return null;let o=null==r?void 0:r.getElementById("headlessui-portal-root");if(o)return o;if(null===r)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)}));return d((()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))}),[o,r]),d((()=>{t||null!==n&&i(n.current)}),[n,i,t]),o}let yA=h,xA=VM((function(e,t){let n=e,o=r(null),i=JM(function(e,t=!0){return Object.assign(e,{[QM]:t})}((e=>{o.current=e})),t),l=UR(o),s=bA(o),[u]=c((()=>{var e;return vM.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null})),f=a(kA),h=gA();EM((()=>{!s||!u||s.contains(u)||(u.setAttribute("data-headlessui-portal",""),s.appendChild(u))}),[s,u]),EM((()=>{if(u&&f)return f.register(u)}),[f,u]),function(e){let t=kM(e),n=r(!1);d((()=>(n.current=!1,()=>{n.current=!0,bM((()=>{n.current&&t()}))})),[t])}((()=>{var e;!s||!u||(u instanceof Node&&s.contains(u)&&s.removeChild(u),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))}));let m=SM();return h&&s&&u?A(m({ourProps:{ref:i},theirProps:n,slot:{},defaultTag:yA,name:"Portal"}),u):null}));let EA=h,CA=i(null);let kA=i(null),MA=VM((function(e,n){let r=JM(n),{enabled:o=!0,...a}=e,i=SM();return o?t.createElement(xA,{...a,ref:r}):i({ourProps:{ref:r},theirProps:a,slot:{},defaultTag:yA,name:"Portal"})})),RA=VM((function(e,n){let{target:r,...o}=e,a={ref:JM(n)},i=SM();return t.createElement(CA.Provider,{value:r},i({ourProps:a,theirProps:o,defaultTag:EA,name:"Popover.Group"}))})),IA=Object.assign(MA,{Group:RA});var OA=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(OA||{}),AA=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(AA||{}),LA=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(LA||{}),SA=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(SA||{});function NA(e,t=e=>e){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&null!==r[0].dataRef.current.order?r.sort(((e,t)=>e.dataRef.current.order-t.dataRef.current.order)):function(e,t=e=>e){return e.slice().sort(((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}(r,(e=>e.dataRef.current.domRef.current)),a=n?o.indexOf(n):null;return-1===a&&(a=null),{options:o,activeOptionIndex:a}}let jA={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!1}},0(e){var t,n;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(n=e.dataRef.current)&&n.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3:(e,t)=>e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping},2(e,t){var n,r,o,a;if(null!=(n=e.dataRef.current)&&n.disabled||e.optionsElement&&(null==(r=e.dataRef.current)||!r.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let{options:n,disabled:r}=e.virtual,a=t.focus===hA.Specific?t.idx:mA(t,{resolveItems:()=>n,resolveActiveIndex:()=>{var t,o;return null!=(o=null!=(t=e.activeOptionIndex)?t:n.findIndex((e=>!r(e))))?o:null},resolveDisabled:r,resolveId(){throw new Error("Function not implemented.")}}),i=null!=(o=t.trigger)?o:2;return e.activeOptionIndex===a&&e.activationTrigger===i?e:{...e,activeOptionIndex:a,activationTrigger:i,isTyping:!1,__demoMode:!1}}let i=NA(e);if(null===i.activeOptionIndex){let e=i.options.findIndex((e=>!e.dataRef.current.disabled));-1!==e&&(i.activeOptionIndex=e)}let l=t.focus===hA.Specific?t.idx:mA(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),s=null!=(a=t.trigger)?a:2;return e.activeOptionIndex===l&&e.activationTrigger===s?e:{...e,...i,isTyping:!1,activeOptionIndex:l,activationTrigger:s,__demoMode:!1}},4:(e,t)=>{var n,r,o;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:[...e.options,t.payload]};let a=t.payload,i=NA(e,(e=>(e.push(a),e)));null===e.activeOptionIndex&&null!=(r=e.dataRef.current)&&r.isSelected(t.payload.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(a));let l={...e,...i,activationTrigger:2};return null!=(o=e.dataRef.current)&&o.__demoMode&&void 0===e.dataRef.current.value&&(l.activeOptionIndex=0),l},5:(e,t)=>{var n;if(null!=(n=e.dataRef.current)&&n.virtual)return{...e,options:e.options.filter((e=>e.id!==t.id))};let r=NA(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(null===e.virtual)return{...e,virtual:{options:t.options,disabled:null!=(n=t.disabled)?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(null!==e.activeOptionIndex){let n=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o=-1!==n?n:null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:null!=(r=t.disabled)?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},DA=i(null);function ZA(e){let t=a(DA);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ZA),t}return t}DA.displayName="ComboboxActionsContext";let VA=i(null);function TA(e){let n=FA("VirtualProvider"),{options:r}=n.virtual,[o,a]=s((()=>{let e=n.optionsElement;if(!e)return[0,0];let t=window.getComputedStyle(e);return[parseFloat(t.paddingBlockStart||t.paddingTop),parseFloat(t.paddingBlockEnd||t.paddingBottom)]}),[n.optionsElement]),i=CR({enabled:0!==r.length,scrollPaddingStart:o,scrollPaddingEnd:a,count:r.length,estimateSize:()=>40,getScrollElement:()=>n.optionsElement,overscan:12}),[l,d]=c(0);EM((()=>{d((e=>e+1))}),[r]);let u=i.getVirtualItems();return 0===u.length?null:t.createElement(VA.Provider,{value:i},t.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:e=>{e&&0!==n.activationTrigger&&null!==n.activeOptionIndex&&r.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}},u.map((n=>{var o;return t.createElement(h,{key:n.key},t.cloneElement(null==(o=e.children)?void 0:o.call(e,{...e.slot,option:r[n.index]}),{key:`${l}-${n.key}`,"data-index":n.index,"aria-setsize":r.length,"aria-posinset":n.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${n.start}px)`,overflowAnchor:"none"}}))}))))}let BA=i(null);function FA(e){let t=a(BA);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,FA),t}return t}function PA(e,t){return OM(t.type,jA,e,t)}BA.displayName="ComboboxDataContext";let HA=h;let _A=AM.RenderStrategy|AM.Static;let WA=VM((function(e,n){var a,i;let l=RM(),{value:d,defaultValue:u,onChange:f,form:h,name:m,by:p,disabled:g=l||!1,onClose:w,__demoMode:y=!1,multiple:x=!1,immediate:E=!1,virtual:C=null,nullable:k,...M}=e,R=function(e){let[t]=c(e);return t}(u),[I=(x?[]:void 0),O]=function(e,t,n){let[o,a]=c(n),i=void 0!==e,l=r(i),s=r(!1),d=r(!1);return!i||l.current||s.current?!i&&l.current&&!d.current&&(d.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:o,kM((e=>(i||a(e),null==t?void 0:t(e))))]}(d,f,R),[A,L]=v(PA,{dataRef:b(),comboboxState:y?0:1,isTyping:!1,options:[],virtual:C?{options:C.options,disabled:null!=(a=C.disabled)?a:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:y}),S=r(!1),N=r({static:!1,hold:!1}),j=function(e=kR){return o(((t,n)=>{if("string"==typeof e){let r=e;return(null==t?void 0:t[r])===(null==n?void 0:n[r])}return e(t,n)}),[e])}(p),D=kM((e=>C?null===p?C.options.indexOf(e):C.options.findIndex((t=>j(t,e))):A.options.findIndex((t=>j(t.dataRef.current.value,e))))),Z=o((e=>OM(T.mode,{1:()=>I.some((t=>j(t,e))),0:()=>j(I,e)})),[I]),V=kM((e=>A.activeOptionIndex===D(e))),T=s((()=>({...A,immediate:E,optionsPropsRef:N,value:I,defaultValue:R,disabled:g,mode:x?1:0,virtual:C?A.virtual:null,get activeOptionIndex(){if(S.current&&null===A.activeOptionIndex&&(C?C.options.length>0:A.options.length>0)){if(C){let e=C.options.findIndex((e=>{var t,n;return!(null!=(n=null==(t=C.disabled)?void 0:t.call(C,e))&&n)}));if(-1!==e)return e}let e=A.options.findIndex((e=>!e.dataRef.current.disabled));if(-1!==e)return e}return A.activeOptionIndex},calculateIndex:D,compare:j,isSelected:Z,isActive:V})),[I,R,g,x,y,A,C]);EM((()=>{var e;C&&L({type:7,options:C.options,disabled:null!=(e=C.disabled)?e:null})}),[C,null==C?void 0:C.options,null==C?void 0:C.disabled]),EM((()=>{A.dataRef.current=T}),[T]),$R(0===T.comboboxState,[T.buttonElement,T.inputElement,T.optionsElement],(()=>K.closeCombobox()));let B=s((()=>{var e,t,n;return{open:0===T.comboboxState,disabled:g,activeIndex:T.activeOptionIndex,activeOption:null===T.activeOptionIndex?null:T.virtual?T.virtual.options[null!=(e=T.activeOptionIndex)?e:0]:null!=(n=null==(t=T.options[T.activeOptionIndex])?void 0:t.dataRef.current.value)?n:null,value:I}}),[T,g,I]),F=kM((()=>{if(null!==T.activeOptionIndex){if(K.setIsTyping(!1),T.virtual)$(T.virtual.options[T.activeOptionIndex]);else{let{dataRef:e}=T.options[T.activeOptionIndex];$(e.current.value)}K.goToOption(hA.Specific,T.activeOptionIndex)}})),P=kM((()=>{L({type:0}),S.current=!0})),H=kM((()=>{L({type:1}),S.current=!1,null==w||w()})),_=kM((e=>{L({type:3,isTyping:e})})),W=kM(((e,t,n)=>(S.current=!1,e===hA.Specific?L({type:2,focus:hA.Specific,idx:t,trigger:n}):L({type:2,focus:e,trigger:n})))),z=kM(((e,t)=>(L({type:4,payload:{id:e,dataRef:t}}),()=>{T.isActive(t.current.value)&&(S.current=!0),L({type:5,id:e})}))),$=kM((e=>OM(T.mode,{0:()=>null==O?void 0:O(e),1(){let t=T.value.slice(),n=t.findIndex((t=>j(t,e)));return-1===n?t.push(e):t.splice(n,1),null==O?void 0:O(t)}}))),U=kM((e=>{L({type:6,trigger:e})})),q=kM((e=>{L({type:8,element:e})})),G=kM((e=>{L({type:9,element:e})})),Y=kM((e=>{L({type:10,element:e})})),K=s((()=>({onChange:$,registerOption:z,goToOption:W,setIsTyping:_,closeCombobox:H,openCombobox:P,setActivationTrigger:U,selectActiveOption:F,setInputElement:q,setButtonElement:G,setOptionsElement:Y})),[]),[X,Q]=function({inherit:e=!1}={}){let n=iR(),[r,o]=c([]),a=e?[n,...r].filter(Boolean):r;return[a.length>0?a.join(" "):void 0,s((()=>function(e){let n=kM((e=>(o((t=>[...t,e])),()=>o((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),r=s((()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value})),[n,e.slot,e.name,e.props,e.value]);return t.createElement(oR.Provider,{value:r},e.children)}),[o])]}(),J=null===n?{}:{ref:n},ee=o((()=>{if(void 0!==R)return null==O?void 0:O(R)}),[O,R]),te=SM();return t.createElement(Q,{value:X,props:{htmlFor:null==(i=T.inputElement)?void 0:i.id},slot:{open:0===T.comboboxState,disabled:g}},t.createElement(rA,null,t.createElement(DA.Provider,{value:K},t.createElement(BA.Provider,{value:T},t.createElement(uA,{value:OM(T.comboboxState,{0:dA.Open,1:dA.Closed})},null!=m&&t.createElement(qM,{disabled:g,data:null!=I?{[m]:I}:{},form:h,onReset:ee}),te({ourProps:J,theirProps:M,slot:B,defaultTag:HA,name:"Combobox"}))))))})),zA=VM((function(e,t){var n;let o=FA("Combobox.Button"),a=ZA("Combobox.Button"),i=JM(t,a.setButtonElement),l=g(),{id:d=`headlessui-combobox-button-${l}`,disabled:u=o.disabled||!1,autoFocus:f=!1,...h}=e,m=qR(o.inputElement),p=kM((e=>{switch(e.key){case rR.Space:case rR.Enter:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&L((()=>a.openCombobox())),void m();case rR.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(L((()=>a.openCombobox())),o.value||a.goToOption(hA.First)),void m();case rR.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===o.comboboxState&&(L((()=>a.openCombobox())),o.value||a.goToOption(hA.Last)),void m();case rR.Escape:if(0!==o.comboboxState)return;return e.preventDefault(),o.optionsElement&&!o.optionsPropsRef.current.static&&e.stopPropagation(),L((()=>a.closeCombobox())),void m();default:return}})),v=kM((e=>{e.preventDefault(),!XM(e.currentTarget)&&(e.button===pA.Left&&(0===o.comboboxState?a.closeCombobox():a.openCombobox()),m())})),w=iR([d]),{isFocusVisible:b,focusProps:y}=mM({autoFocus:f}),{isHovered:x,hoverProps:E}=hM({isDisabled:u}),{pressed:C,pressProps:k}=function({disabled:e=!1}={}){let t=r(null),[n,o]=c(!1),a=xM(),i=kM((()=>{t.current=null,o(!1),a.dispose()})),l=kM((e=>{if(a.dispose(),null===t.current){t.current=e.currentTarget,o(!0);{let n=wM(e.currentTarget);a.addEventListener(n,"pointerup",i,!1),a.addEventListener(n,"pointermove",(e=>{if(t.current){let n=function(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);o(function(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}(n,t.current.getBoundingClientRect()))}}),!1),a.addEventListener(n,"pointercancel",i,!1)}}}));return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}({disabled:u}),M=s((()=>({open:0===o.comboboxState,active:C||0===o.comboboxState,disabled:u,value:o.value,hover:x,focus:b})),[o,x,b,C,u]),R=ZM({ref:i,id:d,type:GR(e,o.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==(n=o.optionsElement)?void 0:n.id,"aria-expanded":0===o.comboboxState,"aria-labelledby":w,disabled:u||void 0,autoFocus:f,onMouseDown:v,onKeyDown:p},y,E,k);return SM()({ourProps:R,theirProps:h,slot:M,defaultTag:"button",name:"Combobox.Button"})})),$A=VM((function(e,t){var n,o,i,l,c;let d=FA("Combobox.Input"),u=ZA("Combobox.Input"),f=g(),h=KM(),{id:m=h||`headlessui-combobox-input-${f}`,onChange:p,displayValue:v,disabled:w=d.disabled||!1,autoFocus:b=!1,type:y="text",...x}=e,E=r(null),C=JM(E,t,a(tA).setReference,u.setInputElement),k=UR(d.inputElement),M=xM(),R=kM((()=>{u.onChange(null),d.optionsElement&&(d.optionsElement.scrollTop=0),u.goToOption(hA.Nothing)})),I=s((()=>{var e;return"function"==typeof v&&void 0!==d.value?null!=(e=v(d.value))?e:"":"string"==typeof d.value?d.value:""}),[d.value,v]);aI((([e,t],[n,r])=>{if(d.isTyping)return;let o=E.current;o&&((0===r&&1===t||e!==n)&&(o.value=e),requestAnimationFrame((()=>{if(d.isTyping||!o||(null==k?void 0:k.activeElement)!==o)return;let{selectionStart:e,selectionEnd:t}=o;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&o.setSelectionRange(o.value.length,o.value.length)})))}),[I,d.comboboxState,k,d.isTyping]),aI((([e],[t])=>{if(0===e&&1===t){if(d.isTyping)return;let e=E.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:r,selectionDirection:o}=e;e.value="",e.value=t,null!==o?e.setSelectionRange(n,r,o):e.setSelectionRange(n,r)}}),[d.comboboxState]);let O=r(!1),A=kM((()=>{O.current=!0})),S=kM((()=>{M.nextFrame((()=>{O.current=!1}))})),N=kM((e=>{switch(u.setIsTyping(!0),e.key){case rR.Enter:if(0!==d.comboboxState||O.current)return;if(e.preventDefault(),e.stopPropagation(),null===d.activeOptionIndex)return void u.closeCombobox();u.selectActiveOption(),0===d.mode&&u.closeCombobox();break;case rR.ArrowDown:return e.preventDefault(),e.stopPropagation(),OM(d.comboboxState,{0:()=>u.goToOption(hA.Next),1:()=>u.openCombobox()});case rR.ArrowUp:return e.preventDefault(),e.stopPropagation(),OM(d.comboboxState,{0:()=>u.goToOption(hA.Previous),1:()=>{L((()=>u.openCombobox())),d.value||u.goToOption(hA.Last)}});case rR.Home:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.First);case rR.PageUp:return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.First);case rR.End:if(e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.Last);case rR.PageDown:return e.preventDefault(),e.stopPropagation(),u.goToOption(hA.Last);case rR.Escape:return 0!==d.comboboxState?void 0:(e.preventDefault(),d.optionsElement&&!d.optionsPropsRef.current.static&&e.stopPropagation(),0===d.mode&&null===d.value&&R(),u.closeCombobox());case rR.Tab:if(0!==d.comboboxState)return;0===d.mode&&1!==d.activationTrigger&&u.selectActiveOption(),u.closeCombobox()}})),j=kM((e=>{null==p||p(e),0===d.mode&&""===e.target.value&&R(),u.openCombobox()})),D=kM((e=>{var t,n,r;let o=null!=(t=e.relatedTarget)?t:fA.find((t=>t!==e.currentTarget));if(!(null!=(n=d.optionsElement)&&n.contains(o)||null!=(r=d.buttonElement)&&r.contains(o)||0!==d.comboboxState))return e.preventDefault(),0===d.mode&&null===d.value&&R(),u.closeCombobox()})),Z=kM((e=>{var t,n,r;let o=null!=(t=e.relatedTarget)?t:fA.find((t=>t!==e.currentTarget));null!=(n=d.buttonElement)&&n.contains(o)||null!=(r=d.optionsElement)&&r.contains(o)||d.disabled||d.immediate&&0!==d.comboboxState&&M.microTask((()=>{L((()=>u.openCombobox())),u.setActivationTrigger(1)}))})),V=iR(),T=function(){var e,t;return null!=(t=null==(e=a(eR))?void 0:e.value)?t:void 0}(),{isFocused:B,focusProps:F}=mM({autoFocus:b}),{isHovered:P,hoverProps:H}=hM({isDisabled:w}),_=s((()=>({open:0===d.comboboxState,disabled:w,hover:P,focus:B,autofocus:b})),[d,P,B,b,w]),W=ZM({ref:C,id:m,role:"combobox",type:y,"aria-controls":null==(n=d.optionsElement)?void 0:n.id,"aria-expanded":0===d.comboboxState,"aria-activedescendant":null===d.activeOptionIndex?void 0:d.virtual?null==(o=d.options.find((e=>!e.dataRef.current.disabled&&d.compare(e.dataRef.current.value,d.virtual.options[d.activeOptionIndex]))))?void 0:o.id:null==(i=d.options[d.activeOptionIndex])?void 0:i.id,"aria-labelledby":V,"aria-describedby":T,"aria-autocomplete":"list",defaultValue:null!=(c=null!=(l=e.defaultValue)?l:void 0!==d.defaultValue?null==v?void 0:v(d.defaultValue):null)?c:d.defaultValue,disabled:w||void 0,autoFocus:b,onCompositionStart:A,onCompositionEnd:S,onKeyDown:N,onChange:j,onFocus:Z,onBlur:D},F,H);return SM()({ourProps:W,theirProps:x,slot:_,defaultTag:"input",name:"Combobox.Input"})})),UA=sR,qA=VM((function(e,n){var i,l,u;let f=g(),{id:h=`headlessui-combobox-options-${f}`,hold:m=!1,anchor:p,portal:v=!1,modal:w=!0,transition:b=!1,...y}=e,x=FA("Combobox.Options"),E=ZA("Combobox.Options"),C=function(e){return s((()=>e?"string"==typeof e?{to:e}:e:null),[e])}(p);C&&(v=!0);let[k,M]=function(e=null){!1===e&&(e=null),"string"==typeof e&&(e={to:e});let t=a(nA),n=s((()=>e),[JSON.stringify(e,((e,t)=>{var n;return null!=(n=null==t?void 0:t.outerHTML)?n:t}))]);EM((()=>{null==t||t(null!=n?n:null)}),[t,n]);let r=a(tA);return s((()=>[r.setFloating,e?r.styles:{}]),[r.setFloating,e,r.styles])}(C),[R,I]=c(null),O=function(){let{getFloatingProps:e,slot:t}=a(tA);return o(((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor})),[e,t])}(),A=JM(n,C?k:null,E.setOptionsElement,I),L=UR(x.optionsElement),S=a(cA),[N,j]=oI(b,R,null!==S?(S&dA.Open)===dA.Open:0===x.comboboxState);!function(e,t,n){let r=CM((e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()}));d((()=>{if(!e)return;let n=null===t?null:t instanceof HTMLElement?t:t.current;if(!n)return;let o=yM();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver((()=>r.current(n)));e.observe(n),o.add((()=>e.disconnect()))}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver((()=>r.current(n)));e.observe(n),o.add((()=>e.disconnect()))}return()=>o.dispose()}),[t,r,e])}(N,x.inputElement,E.closeCombobox),QR(!x.__demoMode&&(w&&0===x.comboboxState),L),ZR(!x.__demoMode&&(w&&0===x.comboboxState),{allowed:o((()=>[x.inputElement,x.buttonElement,x.optionsElement]),[x.inputElement,x.buttonElement,x.optionsElement])}),EM((()=>{var t;x.optionsPropsRef.current.static=null!=(t=e.static)&&t}),[x.optionsPropsRef,e.static]),EM((()=>{x.optionsPropsRef.current.hold=m}),[x.optionsPropsRef,m]),function(e,{container:t,accept:n,walk:o}){let a=r(n),i=r(o);d((()=>{a.current=n,i.current=o}),[n,o]),EM((()=>{if(!t||!e)return;let n=wM(t);if(!n)return;let r=a.current,o=i.current,l=Object.assign((e=>r(e)),{acceptNode:r}),s=n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,l,!1);for(;s.nextNode();)o(s.currentNode)}),[t,e,a,i])}(0===x.comboboxState,{container:x.optionsElement,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let D=iR([null==(i=x.buttonElement)?void 0:i.id]),Z=s((()=>({open:0===x.comboboxState,option:void 0})),[x.comboboxState]),V=kM((()=>{E.setActivationTrigger(0)})),T=kM((e=>{e.preventDefault(),E.setActivationTrigger(0)})),B=ZM(C?O():{},{"aria-labelledby":D,role:"listbox","aria-multiselectable":1===x.mode||void 0,id:h,ref:A,style:{...y.style,...M,"--input-width":MR(x.inputElement,!0).width,"--button-width":MR(x.buttonElement,!0).width},onWheel:0===x.activationTrigger?void 0:V,onMouseDown:T,...rI(j)}),F=N&&1===x.comboboxState,P=sA(F,null==(l=x.virtual)?void 0:l.options),H=sA(F,x.value),_=kM((e=>x.compare(H,e)));if(x.virtual){if(void 0===P)throw new Error("Missing `options` in virtual mode");Object.assign(y,{children:t.createElement(BA.Provider,{value:P!==x.virtual.options?{...x,virtual:{...x.virtual,options:P}}:x},t.createElement(TA,{slot:Z},y.children))})}let W=SM();return t.createElement(IA,{enabled:!!v&&(e.static||N)},t.createElement(BA.Provider,{value:1===x.mode?x:{...x,isSelected:_}},W({ourProps:B,theirProps:{...y,children:t.createElement(lA,{freeze:F},"function"==typeof y.children?null==(u=y.children)?void 0:u.call(y,Z):y.children)},slot:Z,defaultTag:"div",features:_A,visible:N,name:"Combobox.Options"})))})),GA=VM((function(e,t){var n,o,i,l;let c=FA("Combobox.Option"),d=ZA("Combobox.Option"),u=g(),{id:f=`headlessui-combobox-option-${u}`,value:h,disabled:m=null!=(i=null==(o=null==(n=c.virtual)?void 0:n.disabled)?void 0:o.call(n,h))&&i,order:p=null,...v}=e,w=qR(c.inputElement),b=c.virtual?c.activeOptionIndex===c.calculateIndex(h):null!==c.activeOptionIndex&&(null==(l=c.options[c.activeOptionIndex])?void 0:l.id)===f,y=c.isSelected(h),x=r(null),E=CM({disabled:m,value:h,domRef:x,order:p}),C=a(VA),k=JM(t,x,C?C.measureElement:null),M=kM((()=>{d.setIsTyping(!1),d.onChange(h)}));EM((()=>d.registerOption(f,E)),[E,f]);let R=r(!(c.virtual||c.__demoMode));EM((()=>{if(!c.virtual&&!c.__demoMode)return yM().requestAnimationFrame((()=>{R.current=!0}))}),[c.virtual,c.__demoMode]),EM((()=>{if(R.current&&0===c.comboboxState&&b&&0!==c.activationTrigger)return yM().requestAnimationFrame((()=>{var e,t;null==(t=null==(e=x.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}))}),[x,b,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let I=kM((e=>{e.preventDefault(),e.button===pA.Left&&(m||(M(),WR()||requestAnimationFrame((()=>w())),0===c.mode&&d.closeCombobox()))})),O=kM((()=>{if(m)return d.goToOption(hA.Nothing);let e=c.calculateIndex(h);d.goToOption(hA.Specific,e)})),A=function(){let e=r([-1,-1]);return{wasMoved(t){let n=JR(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=JR(t)}}}(),L=kM((e=>A.update(e))),S=kM((e=>{if(!A.wasMoved(e)||m||b)return;let t=c.calculateIndex(h);d.goToOption(hA.Specific,t,0)})),N=kM((e=>{A.wasMoved(e)&&(m||b&&(c.optionsPropsRef.current.hold||d.goToOption(hA.Nothing)))})),j=s((()=>({active:b,focus:b,selected:y,disabled:m})),[b,y,m]),D={id:f,ref:k,role:"option",tabIndex:!0===m?void 0:-1,"aria-disabled":!0===m||void 0,"aria-selected":y,disabled:void 0,onMouseDown:I,onFocus:O,onPointerEnter:L,onMouseEnter:L,onPointerMove:S,onMouseMove:S,onPointerLeave:N,onMouseLeave:N};return SM()({ourProps:D,theirProps:v,slot:j,defaultTag:"div",name:"Combobox.Option"})})),YA=Object.assign(WA,{Input:$A,Button:zA,Label:UA,Options:qA,Option:GA});M(["absolute inset-y-0 right-0 flex items-center justify-center"],{variants:{size:{sm:"mr-2",md:"mr-3",lg:"mr-4"}},defaultVariants:{size:"md"}});const KA=M(["transition-all"],{variants:{disabled:{true:"fill-input-text-disabled",false:"fill-inherit"},isFocus:{true:"fill-input-text-active rotate-180",false:""}},defaultVariants:{disabled:!1,isFocus:!1}}),XA=M([],{variants:{size:{sm:"pe-[30px]",md:"pe-[40px]",lg:"pe-[68px]"}},defaultVariants:{size:"md"}}),QA=LC("relative flex gap-1 cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","hover:bg-[var(--dropdown-menu-hover-bg)] hover:text-[var(--dropdown-menu-hover-text)]"),JA=n(((e,t)=>{var{id:n,options:a=[],value:i,label:l,size:f="md",rounded:m="normal",variant:p="outline",helperText:g,errorMessage:v,fullwidth:w=!0,disabled:b=!1,error:y=!1,filterMode:x=!1,required:M=!0,modal:R,onChangeText:I,onSelect:O,renderOptions:A,optionContainerClassName:L,optionItemClassName:S,optionNotFoundItemClassName:N,segmentedInput:j=!0,keepOpenAfterSelect:D=!1,portal:Z=!1}=e,V=IC(e,["id","options","value","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","modal","onChangeText","onSelect","renderOptions","optionContainerClassName","optionItemClassName","optionNotFoundItemClassName","segmentedInput","keepOpenAfterSelect","portal"]);const T=n||`${l}-select`,[B,F]=c(null),[P,H]=c(""),_=r(null);u(t,(()=>_.current),[]),d((()=>{F(null!=i?i:null)}),[i]);const W=s((()=>x&&P?a.filter((e=>e.label.toLowerCase().includes(P.toLowerCase()))):a),[a,x,P]),z=o((e=>{F(e),H(""),e&&(null==O||O(e),D||setTimeout((()=>{var e;return null===(e=_.current)||void 0===e?void 0:e.blur()}),0))}),[O,D]),$=o((e=>{x&&H(e.target.value),null==I||I(e)}),[x,I]);return E(YA,{value:B,onChange:z,immediate:!0,by:"value",disabled:b,children:({open:e})=>C("div",{className:LC("relative",w&&"w-full"),children:[E($A,Object.assign({as:mk,ref:_,hasClearIcon:!1,endIcon:E(Vr,{className:KA({isFocus:e})}),label:l,autoComplete:"off",rounded:m,variant:p,helperText:g,errorMessage:v,fullwidth:w,error:y,required:M,id:T,disabled:b,size:f,className:j?XA({size:f}):void 0,displayValue:e=>{var t;return null!==(t=null==e?void 0:e.label)&&void 0!==t?t:""},readOnly:!x,onChange:$},V)),E(qA,Object.assign({},Z?{portal:!0,anchor:{to:"bottom start",gap:4}}:{},{className:LC(!Z&&"absolute top-full left-0 w-full -mt-3 z-[51]",Z&&"z-[51] !max-h-60 w-[var(--input-width)]","min-w-[154px] max-h-60 overflow-y-auto","rounded-md bg-modal-dropdown-surface border border-bg-stroke3 text-text-g-contrast-high",L),style:{boxShadow:"var(--dropdown-menu-shadow)"},children:A?A({optionsFiltered:W,selectedOption:B,onClick:z}):0===W.length?E("div",{className:LC("px-4 py-14 text-center text-input-text",N),children:"Not found"}):W.map((e=>e.renderLabel?E(h,{children:e.renderLabel({value:e.value,label:e.label,handleOnClick:()=>z(e),className:LC(QA,(null==B?void 0:B.value)===e.value&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)]",S)})},e.value):E(GA,{value:e,className:({focus:t,selected:n})=>LC(QA,(n||(null==B?void 0:B.value)===e.value)&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)]",t&&"bg-[var(--dropdown-menu-hover-bg)] text-[var(--dropdown-menu-hover-text)]",S),children:({selected:t})=>C(k,{children:[E("span",{className:"shrink-0 size-4 flex items-center justify-center",children:(t||(null==B?void 0:B.value)===e.value)&&E(Ek,{type:"heroicons",name:"check",className:"size-4 text-[var(--dropdown-menu-selected-text)]"})}),e.label]})},e.value)))}))]})})}));function eL(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function tL(...t){return e.useCallback(eL(...t),t)}function nL(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,s=r?.[t]?.[i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})};return l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t]?.[i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},rL(o,...n)]}function rL(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function oL(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function aL(t){const n=e.useRef(t);return e.useEffect((()=>{n.current=t})),e.useMemo((()=>(...e)=>n.current?.(...e)),[])}function iL({prop:t,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:t,onChange:n}){const r=e.useState(t),[o]=r,a=e.useRef(o),i=aL(n);return e.useEffect((()=>{a.current!==o&&(i(o),a.current=o)}),[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==t,l=i?t:o,s=aL(r);return[l,e.useCallback((e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&s(n)}else a(e)}),[i,t,a,s])]}function lL(t){const n=e.useRef({value:t,previous:t});return e.useMemo((()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous)),[t])}JA.displayName="Dropdown";var sL=Boolean(globalThis?.document)?e.useLayoutEffect:()=>{};function cL(t){const[n,r]=e.useState(void 0);return sL((()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})}));return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)}),[t]),n}var dL=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=uL(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=uL(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=uL(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=uL(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function uL(e){return e?.animationName||"none"}dL.displayName="Presence";var fL=e.forwardRef(((t,n)=>{const{children:r,...o}=t,a=e.Children.toArray(r),i=a.find(pL);if(i){const t=i.props.children,r=a.map((n=>n===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n));return E(hL,{...o,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return E(hL,{...o,ref:n,children:r})}));fL.displayName="Slot";var hL=e.forwardRef(((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r);return e.cloneElement(r,{...gL(o,r.props),ref:n?eL(n,t):t})}return e.Children.count(r)>1?e.Children.only(null):null}));hL.displayName="SlotClone";var mL=({children:e})=>E(k,{children:e});function pL(t){return e.isValidElement(t)&&t.type===mL}function gL(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}var vL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),wL="Checkbox",[bL]=nL(wL),[yL,xL]=bL(wL),EL=e.forwardRef(((t,n)=>{const{__scopeCheckbox:r,name:o,checked:a,defaultChecked:i,required:l,disabled:s,value:c="on",onCheckedChange:d,form:u,...f}=t,[h,m]=e.useState(null),p=tL(n,(e=>m(e))),g=e.useRef(!1),v=!h||(u||!!h.closest("form")),[w=!1,b]=iL({prop:a,defaultProp:i,onChange:d}),y=e.useRef(w);return e.useEffect((()=>{const e=h?.form;if(e){const t=()=>b(y.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[h,b]),C(yL,{scope:r,state:w,disabled:s,children:[E(vL.button,{type:"button",role:"checkbox","aria-checked":RL(w)?"mixed":w,"aria-required":l,"data-state":IL(w),"data-disabled":s?"":void 0,disabled:s,value:c,...f,ref:p,onKeyDown:oL(t.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:oL(t.onClick,(e=>{b((e=>!!RL(e)||!e)),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())}))}),v&&E(ML,{control:h,bubbles:!g.current,name:o,value:c,checked:w,required:l,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:!RL(i)&&i})]})}));EL.displayName=wL;var CL="CheckboxIndicator",kL=e.forwardRef(((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=xL(CL,n);return E(dL,{present:r||RL(a.state)||!0===a.state,children:E(vL.span,{"data-state":IL(a.state),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})}));kL.displayName=CL;var ML=t=>{const{control:n,checked:r,bubbles:o=!0,defaultChecked:a,...i}=t,l=e.useRef(null),s=lL(r),c=cL(n);e.useEffect((()=>{const e=l.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==r&&n){const t=new Event("click",{bubbles:o});e.indeterminate=RL(r),n.call(e,!RL(r)&&r),e.dispatchEvent(t)}}),[s,r,o]);const d=e.useRef(!RL(r)&&r);return E("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...i,tabIndex:-1,ref:l,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function RL(e){return"indeterminate"===e}function IL(e){return RL(e)?"indeterminate":e?"checked":"unchecked"}var OL=EL,AL=kL;const LL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(OL,Object.assign({ref:t,className:LC("peer size-4 shrink-0 cursor-pointer rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-bg-bg1","hover:border-function-default-hover","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-input-active-stroke focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:border-state-disable-outline disabled:text-state-disable-outline","disabled:data-[state=checked]:border-state-disable-solid disabled:data-[state=checked]:bg-state-disable-solid","disabled:data-[state=indeterminate]:border-state-disable-solid disabled:data-[state=indeterminate]:bg-state-disable-solid",{"data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon data-[state=indeterminate]:border-function-active-solid data-[state=indeterminate]:bg-function-active-solid data-[state=indeterminate]:text-function-active-icon":!r.disabled,"hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover hover:data-[state=indeterminate]:border-function-active-hover hover:data-[state=indeterminate]:bg-function-active-hover":!r.disabled},n)},r,{children:C(AL,{className:LC("flex size-[14px] items-center justify-center text-current","[&[data-state=checked]_.checkbox-check-icon]:block","[&[data-state=indeterminate]_.checkbox-minus-icon]:block"),children:[E(Rr,{className:"checkbox-check-icon hidden size-[14px]"}),E(ts,{className:"checkbox-minus-icon hidden size-[14px]"})]})}))}));LL.displayName=OL.displayName;var SL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),NL=e.forwardRef(((e,t)=>E(SL.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));NL.displayName="Label";var jL=NL;const DL=M(["block cursor-pointer duration-450 transition-all px-[2px] text-input-default-text peer-focus:text-input-text-active"],{variants:{size:{sm:"typography-small1",md:"typography-subtitle2",lg:"typography-subtitle1"},disabled:{true:"text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled peer-disabled:cursor-not-allowed"},error:{true:"ring-error"},isFloatable:{true:"absolute peer-focus:text-input-text-active peer-focus:bg-input-label-background",false:""}},compoundVariants:[{size:"sm",isFloatable:!0,className:["left-3 -top-1.5 typography-label2 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label2"]},{size:"md",isFloatable:!0,className:["left-3 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitle4 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]},{size:"lg",isFloatable:!0,className:["left-4 -top-1.5 typography-label1 bg-input-label-background","peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitle1 peer-placeholder-shown:bg-transparent","peer-focus:-top-1.5 peer-focus:typography-label1"]}],defaultVariants:{size:"md",disabled:!1,error:!1,isFloatable:!1}}),ZL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(jL,Object.assign({ref:t,className:LC(DL({size:r.size,disabled:r.disabled,error:r.error,isFloatable:r.isFloatable}),n)},r))}));ZL.displayName=jL.displayName;const VL=M(["border-0 outline-none","p-1 flex w-auto h-fit box-border","peer text-input-filled-text placeholder:text-input-default-text bg-transparent caret-primary"],{variants:{size:{sm:"p-2 px-3 typography-small1",md:"py-2 px-3 typography-subtitle4",lg:"p-4 typography-subtitle1"},rounded:{none:"rounded-none",normal:"rounded-xl",full:"rounded-full"},variant:{flat:"",outline:["ring-1 ring-inset ring-input-default-stroke","hover:ring-input-active-stroke hover:text-input-filled-text","focus:ring-1 focus:ring-inset focus:ring-input-active-stroke focus:text-input-filled-text active:text-input-filled-text"],underline:"border-b-2 border-input-default-stroke transition-colors hover:border-input-active-stroke focus:border-input-default-stroke"},hiddenPlaceholder:{true:"placeholder:text-transparent"},fullwidth:{true:"w-full"},disabled:{true:["text-input-disable-text ring-input-disable-stroke bg-input-disable-bg placeholder:text-input-disable-text","hover:text-input-disable-text hover:ring-input-disable-stroke hover:bg-input-disable-bg hover:placeholder:text-input-disable-text","active:text-input-disable-text active:ring-input-disable-stroke active:bg-input-disable-bg active:placeholder:text-input-disable-text"]},error:{true:"ring-input-error focus:ring-input-error"}},defaultVariants:{size:"md",variant:"outline",rounded:"normal",fullwidth:!1,disabled:!1,error:!1,hiddenPlaceholder:!0}}),TL=n(((e,t)=>{var{className:n,type:r="text",size:o="md",variant:a="outline",rounded:i="normal",fullwidth:l=!1,disabled:s=!1,error:c=!1,required:d=!1,hiddenPlaceholder:u=!1}=e,f=IC(e,["className","type","size","variant","rounded","fullwidth","disabled","error","required","hiddenPlaceholder"]);return E("input",Object.assign({type:r,className:LC(VL({size:o,variant:a,fullwidth:l,error:c,hiddenPlaceholder:u,disabled:s,rounded:i}),n),ref:t,disabled:s},f))}));TL.displayName="Input";const BL=({children:e,className:t,variant:n="default",scrollShadow:r=!1,center:o,leftNav:a,rightNav:i,position:l,container:s=!1,containerClassName:u,leftNavClassName:f,centerClassName:h,rightNavClassName:m})=>{const[p,g]=c(!1);d((()=>{if(!r||"undefined"==typeof window)return;const e=()=>{g(window.scrollY>4)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)}),[r]);const v="transparent"===n;return C("header",{className:LC("relative w-full px-4 py-6 h-[var(--navbar-height)] box-border overflow-hidden typography-subtitle2 border-solid border-b-2 border-b-[var(--navbar-border-color)] transition-shadow duration-200",v?"text-inherit":"text-[var(--navbar-text-color)]",{position:l},r&&p&&"shadow-[var(--navbar-shadow-scrolled)]",t),children:[!v&&E("div",{className:"absolute inset-0 -z-10 bg-[var(--navbar-bg-color)]","aria-hidden":!0}),E("div",{className:LC("absolute inset-0 -z-[5] pointer-events-none",t),"aria-hidden":!0}),E("div",{className:LC("relative mx-auto flex h-full justify-between items-center",{container:s},u),children:e||C(k,{children:[E("nav",{className:LC("flex w-1/2 gap-x-[var(--navbar-gap)] text-xl",f),children:a}),E("div",{className:LC("flex flex-shrink-0 flex-wrap justify-center",h),children:o}),E("nav",{className:LC("flex w-1/2 justify-end gap-x-[var(--navbar-gap)] text-xl",m),children:i})]})})]})},FL=({children:e,className:t,variant:n="default",copyright:r,center:o,leftNav:a,rightNav:i,position:l,container:s=!1,containerClassName:c,leftNavClassName:d,centerClassName:u,rightNavClassName:f})=>{const h="simple"===n,m="transparent"===n,p=a||r,g=h&&null!=r?r:o,v=h?null:i;return C("footer",{className:LC("relative w-full px-4 py-6 box-border overflow-hidden typography-subtitle2 border-solid border-t-2 text-[var(--footer-text-color)] border-t-[var(--footer-border-color)]",h?"h-[var(--footer-height-simple)]":"h-[var(--footer-height)]",{position:l},t),children:[!m&&E("div",{className:"absolute inset-0 -z-10 bg-[var(--footer-bg-color)]","aria-hidden":!0}),E("div",{className:LC("absolute inset-0 -z-[5] pointer-events-none",t),"aria-hidden":!0}),E("div",{className:LC("relative mx-auto flex h-full items-center",h?"justify-center":"justify-between",{container:s},c),children:null!=e?e:h?E("div",{className:LC("text-center",u),children:g}):C(k,{children:[E("nav",{className:LC("flex w-1/2 items-center gap-x-[var(--footer-gap)] text-xl",d),children:r&&a?C(k,{children:[E("span",{className:"flex-shrink-0",children:r}),a]}):p}),E("div",{className:LC("flex flex-shrink-0 flex-wrap justify-center",u),children:g}),E("nav",{className:LC("flex w-1/2 justify-end gap-x-[var(--footer-gap)] text-xl",f),children:v})]})})]})};var PL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),HL="Avatar",[_L]=nL(HL),[WL,zL]=_L(HL),$L=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,...o}=t,[a,i]=e.useState("idle");return E(WL,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:E(PL.span,{...o,ref:n})})}));$L.displayName=HL;var UL="AvatarImage",qL=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:a=()=>{},...i}=t,l=zL(UL,r),s=function(t,n){const[r,o]=e.useState("idle");return sL((()=>{if(!t)return void o("error");let e=!0;const r=new window.Image,a=t=>()=>{e&&o(t)};return o("loading"),r.onload=a("loaded"),r.onerror=a("error"),r.src=t,n&&(r.referrerPolicy=n),()=>{e=!1}}),[t,n]),r}(o,i.referrerPolicy),c=aL((e=>{a(e),l.onImageLoadingStatusChange(e)}));return sL((()=>{"idle"!==s&&c(s)}),[s,c]),"loaded"===s?E(PL.img,{...i,ref:n,src:o}):null}));qL.displayName=UL;var GL="AvatarFallback",YL=e.forwardRef(((t,n)=>{const{__scopeAvatar:r,delayMs:o,...a}=t,i=zL(GL,r),[l,s]=e.useState(void 0===o);return e.useEffect((()=>{if(void 0!==o){const e=window.setTimeout((()=>s(!0)),o);return()=>window.clearTimeout(e)}}),[o]),l&&"loaded"!==i.imageLoadingStatus?E(PL.span,{...a,ref:n}):null}));YL.displayName=GL;var KL=$L,XL=qL,QL=YL;const JL=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KL,Object.assign({ref:t,className:LC("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",n)},r))}));JL.displayName=KL.displayName;const eS=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(XL,Object.assign({ref:t,className:LC("object-cover object-top h-full w-full",n)},r))}));eS.displayName=XL.displayName;const tS=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(QL,Object.assign({ref:t,className:LC("flex h-full w-full items-center justify-center rounded-full bg-inherit text-inherit",n)},r))}));tS.displayName=QL.displayName;const nS=M(["flex items-center justify-center bg-grey2-900 text-text-white typography-subtitle6 truncate"],{variants:{size:{xxs:"w-[24px] h-[24px] typography-small3",xs:"w-[32px] h-[32px]",sm:"w-[40px] h-[40px]",md:"w-[48px] h-[48px]",lg:"w-[64px] h-[64px]"},rounded:{normal:"rounded",full:"rounded-full",none:"rounded-none"},hasImage:{true:"bg-white"}},defaultVariants:{size:"md",rounded:"normal"}}),rS=e=>{var t,n,r;if(!e.length)return"-";const o=e.split(" ");return`${null==e?void 0:e.charAt(0)}${null!==(r=null!==(n=null===(t=null==o?void 0:o[1])||void 0===t?void 0:t.charAt(0))&&void 0!==n?n:null==e?void 0:e.charAt(1))&&void 0!==r?r:""}`},oS=({text:e,imageUrl:t,icon:n,fallback:r,size:o,rounded:a,className:i,imageClassName:l,fallbackClassName:s,type:c="text",children:d,style:u})=>{const f=nS({size:o,rounded:a,hasImage:!!t});return E(JL,{className:LC(f,i),style:u,children:d||C(k,{children:["image"===c&&C(k,{children:[E(eS,{src:t,className:LC(l)}),E(tS,{className:LC(s),children:"string"==typeof r?rS(r):r})]}),"text"===c&&rS(null!=e?e:""),"icon"===c&&n]})})},aS=({borderWidth:e=2,borderColor:t="white",maxDisplay:n=4,children:r,remainingText:o,remainingAvatar:a})=>{const i=y.toArray(r),l=i.slice(0,n),s=Math.max(0,i.length-n),c=a||p(l[0],{style:{borderWidth:e,borderColor:t},className:"relative z-0",children:o||`+${s}`});return C("div",{className:"flex items-center -space-x-2",children:[l.map(((n,r)=>E("div",{className:"relative",style:{zIndex:i.length-r},children:p(n,{style:{borderWidth:e,borderColor:t}})},r))),s>0&&c]})},iS=M(["inline-flex items-center justify-center rounded-lg px-3 py-1","typography-body3"],{variants:{color:{default:["bg-[var(--badge-default-bg)]","text-[var(--badge-default-text)]"],success:["bg-[var(--badge-success-bg)]","text-[var(--badge-success-text)]"],warning:["bg-[var(--badge-warning-bg)]","text-[var(--badge-warning-text)]"],info:["bg-[var(--badge-info-bg)]","text-[var(--badge-info-text)]"],error:["bg-[var(--badge-error-bg)]","text-[var(--badge-error-text)]"]},clickable:{true:"border border-solid",false:""}},compoundVariants:[{color:"default",clickable:!0,className:"border-[var(--badge-default-border)]"},{color:"success",clickable:!0,className:"border-[var(--badge-success-border)]"},{color:"warning",clickable:!0,className:"border-[var(--badge-warning-border)]"},{color:"info",clickable:!0,className:"border-[var(--badge-info-border)]"},{color:"error",clickable:!0,className:"border-[var(--badge-error-border)]"}],defaultVariants:{color:"default",clickable:!1}}),lS=M(["inline-flex items-center justify-center rounded px-1 py-0.5","typography-small6 text-[var(--badge-severity-text)]"],{variants:{severity:{highest:"bg-[var(--badge-severity-highest-bg)]",high:"bg-[var(--badge-severity-high-bg)]",medium:"bg-[var(--badge-severity-medium-bg)]",low:"bg-[var(--badge-severity-low-bg)]",lowest:"bg-[var(--badge-severity-lowest-bg)]"}},defaultVariants:{severity:"medium"}}),sS=e.forwardRef(((e,t)=>{var{label:n,color:r="default",clickable:o=!1,percent:a,className:i}=e,l=IC(e,["label","color","clickable","percent","className"]);const s=void 0!==a;return C("span",Object.assign({ref:t,className:LC(iS({color:r,clickable:o}),s&&"flex-col gap-0.5",o&&"cursor-pointer gap-1",i)},l,{children:[C("span",{className:"flex items-center gap-1",children:[n,o&&E(Vr,{className:"size-4 shrink-0","aria-hidden":!0})]}),s&&C("span",{className:"tabular-nums",children:[a,"%"]})]}))}));sS.displayName="Badge";const cS={highest:"Highest",high:"High",medium:"Medium",low:"Low",lowest:"Lowest"},dS=e.forwardRef(((e,t)=>{var{severity:n,className:r}=e,o=IC(e,["severity","className"]);return E("span",Object.assign({ref:t,className:LC(lS({severity:n}),r)},o,{children:cS[n]}))}));dS.displayName="SeverityBadge";const uS=i(void 0),fS=()=>{const e=a(uS);if(!e)throw new Error("useCollapsible must be used within a CollapsibleProvider");return e},hS=({size:e,children:t,isExpandControlled:n,onToggle:r})=>{const[o,a]=c(!1);return d((()=>{void 0!==n&&a(n)}),[n]),E(uS.Provider,{value:{size:e,isExpand:o,toggle:()=>{a((e=>!e)),r&&r(!o)},setIsExpand:a},children:t})},mS=M(["flex flex-1 bg-secondary-default hover:bg-secondary-hover text-state-secondary-text-solid","focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75"],{variants:{size:{sm:"py-2 px-3",md:"py-3 px-4",lg:"py-4 px-5"}},defaultVariants:{size:"md"}}),pS=M(["transition-all flex content-center justify-center "],{variants:{size:{sm:"size-5",md:"size-6",lg:"size-7"},isExpand:{true:"rotate-180"}},defaultVariants:{size:"md",isExpand:!1}}),gS=M(["flex flex-1 border-t border-t-secondary","transition ease-in-out delay-150 duration-300"],{variants:{size:{sm:"py-2 px-3",md:"py-3 px-4",lg:"py-4 px-5"}},defaultVariants:{size:"md"}}),vS=M(["flex flex-col border border-secondary rounded overflow-hidden"]),wS=n((({children:e,className:t,hideExpandIcon:n=!1},r)=>{const{toggle:o,isExpand:a,size:i}=fS(),l=mS({size:i}),s=pS({isExpand:a,size:i});return C("button",{onClick:o,className:LC(l,t),ref:r,children:[E("span",{className:"flex flex-1",children:e}),!n&&E("span",{className:LC(s),children:E(Vr,{className:LC("size-full")})})]})}));wS.displayName="CollapsibleButton";const bS=n((({children:e,className:t},n)=>{const{isExpand:o,size:a}=fS(),i=gS({size:a}),[l,s]=c("0px"),u=r(null);return d((()=>{u.current&&s(o?`${u.current.scrollHeight}px`:"0px")}),[o,e]),E("div",{ref:n,className:LC("overflow-hidden transition-all ease-in-out"),style:{height:l},children:E("div",{ref:u,className:LC(i,t),children:e})})}));bS.displayName="CollapsiblePanel";const yS=n((({children:e,isExpand:t,size:n,className:r,onToggle:o},a)=>{const i=vS();return E(hS,{size:n,isExpandControlled:t,onToggle:o,children:E("div",{ref:a,className:LC(i,r),children:e})})}));var xS,ES,CS;yS.displayName="Collapsible",yS.Button=wS,yS.Panel=bS,function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(xS||(xS={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(ES||(ES={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(CS||(CS={}));const kS=6048e5,MS=Symbol.for("constructDateFrom");function RS(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&MS in e?e[MS](t):e instanceof Date?new e.constructor(t):new Date(t)}function IS(e,t){return RS(t||e,e)}function OS(e,t,n){const r=IS(e,n?.in);return isNaN(t)?RS(e,NaN):t?(r.setDate(r.getDate()+t),r):r}function AS(e,t,n){const r=IS(e,n?.in);if(isNaN(t))return RS(e,NaN);if(!t)return r;const o=r.getDate(),a=RS(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);return o>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let LS={};function SS(){return LS}function NS(e,t){const n=SS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=IS(e,t?.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function jS(e,t){return NS(e,{...t,weekStartsOn:1})}function DS(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=RS(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=jS(o),i=RS(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=jS(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function ZS(e){const t=IS(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function VS(e,...t){const n=RS.bind(null,t.find((e=>"object"==typeof e)));return t.map(n)}function TS(e,t){const n=IS(e,t?.in);return n.setHours(0,0,0,0),n}function BS(e,t,n){const[r,o]=VS(0,e,t),a=TS(r),i=TS(o),l=+a-ZS(a),s=+i-ZS(i);return Math.round((l-s)/864e5)}function FS(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function PS(e,t){const n=IS(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function HS(e,t){const n=SS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=IS(e,t?.in),a=o.getDay(),i=6+(a<r?-7:0)-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}const _S={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function WS(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const zS={date:WS({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:WS({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:WS({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$S={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function US(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const qS={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:US({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:US({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:US({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:US({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:US({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function GS(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const YS={ordinalNumber:(KS={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(KS.matchPattern);if(!n)return null;const r=n[0],o=e.match(KS.parsePattern);if(!o)return null;let a=KS.valueCallback?KS.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:GS({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:GS({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:GS({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:GS({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:GS({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var KS;const XS={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=_S[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:zS,formatRelative:(e,t,n,r)=>$S[e],localize:qS,match:YS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function QS(e,t){const n=IS(e,t?.in),r=+jS(n)-+function(e,t){const n=DS(e,t),r=RS(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),jS(r)}(n);return Math.round(r/kS)+1}function JS(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=SS(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=RS(t?.in||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=NS(i,t),s=RS(t?.in||e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=NS(s,t);return+n>=+l?r+1:+n>=+c?r:r-1}function eN(e,t){const n=IS(e,t?.in),r=+NS(n,t)-+function(e,t){const n=SS(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=JS(e,t),a=RS(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),NS(a,t)}(n,t);return Math.round(r/kS)+1}function tN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const nN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):tN(n+1,2)},d:(e,t)=>tN(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>tN(e.getHours()%12||12,t.length),H:(e,t)=>tN(e.getHours(),t.length),m:(e,t)=>tN(e.getMinutes(),t.length),s:(e,t)=>tN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return tN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},rN="midnight",oN="noon",aN="morning",iN="afternoon",lN="evening",sN="night",cN={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return nN.y(e,t)},Y:function(e,t,n,r){const o=JS(e,r),a=o>0?o:1-o;if("YY"===t){return tN(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):tN(a,t.length)},R:function(e,t){return tN(DS(e),t.length)},u:function(e,t){return tN(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return tN(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return tN(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return nN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return tN(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=eN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):tN(o,t.length)},I:function(e,t,n){const r=QS(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):tN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):nN.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=IS(e,t?.in);return BS(n,PS(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):tN(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return tN(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return tN(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return tN(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?oN:0===r?rN:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?lN:r>=12?iN:r>=4?aN:sN,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return nN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):nN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):tN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):tN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):nN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):nN.s(e,t)},S:function(e,t){return nN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return uN(r);case"XXXX":case"XX":return fN(r);default:return fN(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return uN(r);case"xxxx":case"xx":return fN(r);default:return fN(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dN(r,":");default:return"GMT"+fN(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dN(r,":");default:return"GMT"+fN(r,":")}},t:function(e,t,n){return tN(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return tN(+e,t.length)}};function dN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+tN(a,2)}function uN(e,t){if(e%60==0){return(e>0?"-":"+")+tN(Math.abs(e)/60,2)}return fN(e,t)}function fN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+tN(Math.trunc(r/60),2)+t+tN(r%60,2)}const hN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},mN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},pN={p:mN,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return hN(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",hN(r,t)).replace("{{time}}",mN(o,t))}},gN=/^D+$/,vN=/^Y+$/,wN=["D","DD","YY","YYYY"];const bN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xN=/^'([^]*?)'?$/,EN=/''/g,CN=/[a-zA-Z]/;function kN(e,t,n){const r=SS(),o=n?.locale??r.locale??XS,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=IS(e,n?.in);if(!function(e){return!(!FS(e)&&"number"!=typeof e||isNaN(+IS(e)))}(l))throw new RangeError("Invalid time value");let s=t.match(yN).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,pN[t])(e,o.formatLong)}return e})).join("").match(bN).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:MN(e)};if(cN[t])return{isToken:!0,value:e};if(t.match(CN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((r=>{if(!r.isToken)return r.value;const a=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return vN.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return gN.test(e)}(a))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),wN.includes(e))throw new RangeError(r)}(a,t,String(e));return(0,cN[a[0]])(l,a,o.localize,c)})).join("")}function MN(e){const t=e.match(xN);return t?t[1].replace(EN,"'"):e}function RN(e,t,n){const r=IS(e,n?.in),o=r.getFullYear(),a=r.getDate(),i=RS(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const l=function(e,t){const n=IS(e,t?.in),r=n.getFullYear(),o=n.getMonth(),a=RS(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return r.setMonth(t,Math.min(a,l)),r}function IN(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class ON{constructor(e,t){this.Date=Date,this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):OS(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):AS(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return OS(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return AS(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):BS(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):function(e,t){const[n,r]=VS(0,e,t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(e,t),this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e,this):function(e,t){const n=IN(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,1-r),a=t.addDays(o,34);return e.getMonth()===a.getMonth()?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return HS(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=IS(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=e=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,this.options):HS(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=IS(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t)=>this.overrides?.format?this.overrides.format(e,t,this.options):kN(e,t,this.options),this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):QS(e),this.getWeek=e=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):eN(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+IS(e)>+IS(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+IS(e)<+IS(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):FS(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,r]=VS(0,e,t);return+TS(n)==+TS(r)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,r]=VS(0,e,t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,r]=VS(0,e,t);return n.getFullYear()===r.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=RS.bind(null,e));const t=IS(e,r);(!n||n<t||isNaN(+t))&&(n=t)})),RS(r,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,r=t?.in;return e.forEach((e=>{r||"object"!=typeof e||(r=RS.bind(null,e));const t=IS(e,r);(!n||n>t||isNaN(+t))&&(n=t)})),RS(r,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):RN(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const r=IS(e,n?.in);return isNaN(+r)?RS(e,NaN):(r.setFullYear(t),r)}(e,t),this.startOfBroadcastWeek=e=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):IN(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):TS(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):jS(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=IS(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=e=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):NS(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):PS(e),this.options={locale:XS,...e},this.overrides=t}}const AN=new ON;const LN=i(void 0);function SN(){const e=a(LN);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}var NN=Object.freeze({__proto__:null,Button:function(e){return t.createElement("button",{...e})},CaptionLabel:function(e){return t.createElement("span",{...e})},Chevron:function(e){const{size:n=24,orientation:r="left",className:o}=e;return t.createElement("svg",{className:o,width:n,height:n,viewBox:"0 0 24 24"},"up"===r&&t.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===r&&t.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===r&&t.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===r&&t.createElement("polygon",{points:"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5"}))},Day:function(e){const{day:n,modifiers:r,...o}=e;return t.createElement("td",{...o})},DayButton:function(e){const{day:n,modifiers:r,...o}=e,a=t.useRef(null);return t.useEffect((()=>{r.focused&&a.current?.focus()}),[r.focused]),t.createElement("button",{ref:a,...o})},Dropdown:function(e){const{options:n,className:r,components:o,classNames:a,...i}=e,l=[a[xS.Dropdown],r].join(" "),s=n?.find((({value:e})=>e===i.value));return t.createElement("span",{"data-disabled":i.disabled,className:a[xS.DropdownRoot]},t.createElement(o.Select,{className:l,...i},n?.map((({value:e,label:n,disabled:r})=>t.createElement(o.Option,{key:e,value:e,disabled:r},n)))),t.createElement("span",{className:a[xS.CaptionLabel],"aria-hidden":!0},s?.label,t.createElement(o.Chevron,{orientation:"down",size:18,className:a[xS.Chevron]})))},DropdownNav:function(e){return t.createElement("div",{...e})},Footer:function(e){return t.createElement("div",{...e})},Month:function(e){const{calendarMonth:n,displayIndex:r,...o}=e;return t.createElement("div",{...o},e.children)},MonthCaption:function(e){const{calendarMonth:n,displayIndex:r,...o}=e;return t.createElement("div",{...o})},MonthGrid:function(e){return t.createElement("table",{...e})},Months:function(e){return t.createElement("div",{...e})},MonthsDropdown:function(e){const{components:n}=SN();return t.createElement(n.Dropdown,{...e})},Nav:function(e){const{onPreviousClick:n,onNextClick:r,previousMonth:o,nextMonth:a,...i}=e,{components:l,classNames:s,labels:{labelPrevious:c,labelNext:d}}=SN();return t.createElement("nav",{...i},t.createElement(l.PreviousMonthButton,{type:"button",className:s[xS.PreviousMonthButton],tabIndex:o?void 0:-1,disabled:!o||void 0,"aria-label":c(o),onClick:e.onPreviousClick},t.createElement(l.Chevron,{disabled:!o||void 0,className:s[xS.Chevron],orientation:"left"})),t.createElement(l.NextMonthButton,{type:"button",className:s[xS.NextMonthButton],tabIndex:a?void 0:-1,disabled:!a||void 0,"aria-label":d(a),onClick:e.onNextClick},t.createElement(l.Chevron,{disabled:!a||void 0,orientation:"right",className:s[xS.Chevron]})))},NextMonthButton:function(e){const{components:n}=SN();return t.createElement(n.Button,{...e})},Option:function(e){return t.createElement("option",{...e})},PreviousMonthButton:function(e){const{components:n}=SN();return t.createElement(n.Button,{...e})},Root:function(e){return t.createElement("div",{...e})},Select:function(e){return t.createElement("select",{...e})},Week:function(e){const{week:n,...r}=e;return t.createElement("tr",{...r})},WeekNumber:function(e){const{week:n,...r}=e;return t.createElement("th",{...r})},WeekNumberHeader:function(e){return t.createElement("th",{...e})},Weekday:function(e){return t.createElement("th",{...e})},Weekdays:function(e){return t.createElement("thead",{"aria-hidden":!0},t.createElement("tr",{...e}))},Weeks:function(e){return t.createElement("tbody",{...e})},YearsDropdown:function(e){const{components:n}=SN();return t.createElement(n.Dropdown,{...e})}});function jN(e){return{...NN,...e}}function DN(){const e={};for(const t in xS)e[xS[t]]=`rdp-${xS[t]}`;for(const t in ES)e[ES[t]]=`rdp-${ES[t]}`;for(const t in CS)e[CS[t]]=`rdp-${CS[t]}`;return e}function ZN(e,t,n){return(n??new ON(t)).format(e,"LLLL y")}const VN=ZN;function TN(e){return e.toString()}const BN=TN;var FN=Object.freeze({__proto__:null,formatCaption:ZN,formatDay:function(e,t,n){return(n??new ON(t)).format(e,"d")},formatMonthCaption:VN,formatMonthDropdown:function(e,t){return t.localize?.month(e)},formatWeekNumber:function(e){return e<10?`0${e.toLocaleString()}`:`${e.toLocaleString()}`},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new ON(t)).format(e,"cccccc")},formatYearCaption:BN,formatYearDropdown:TN});const PN={},HN={};function _N(e,t){try{const n=(PN[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return n in HN?HN[n]:zN(n,n.split(":"))}catch{if(e in HN)return HN[e];const t=e?.match(WN);return t?zN(e,t.slice(1)):NaN}}const WN=/([+-]\d\d):?(\d\d)?/;function zN(e,t){const n=+t[0],r=+(t[1]||0);return HN[e]=n>0?60*n+r:60*n-r}class $N extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_N(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),GN(this),qN(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new $N(...t,e):new $N(Date.now(),e)}withTimeZone(e){return new $N(+this,e)}getTimezoneOffset(){return-_N(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),qN(this),+this}[Symbol.for("constructDateFrom")](e){return new $N(+new Date(e),this.timeZone)}}const UN=/^(get|set)(?!UTC)/;function qN(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function GN(e){const t=_N(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=r- -new Date(+n).getTimezoneOffset(),a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const i=r-t;i&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i);const l=_N(e.timeZone,e),s=-new Date(+e).getTimezoneOffset()-l-i;if(l!==t&&s){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const t=l-_N(e.timeZone,e);t&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+t),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+t))}}Object.getOwnPropertyNames(Date.prototype).forEach((e=>{if(!UN.test(e))return;const t=e.replace(UN,"$1UTC");$N.prototype[t]&&(e.startsWith("get")?$N.prototype[e]=function(){return this.internal[t]()}:($N.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),function(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),GN(e)}(this),+this},$N.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),qN(this),+this}))}));class YN extends $N{static tz(e,...t){return t.length?new YN(...t,e):new YN(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new YN(+this,e)}[Symbol.for("constructDateFrom")](e){return new YN(+new Date(e),this.timeZone)}}function KN(e,t,n){return(n??new ON(t)).format(e,"LLLL y")}const XN=KN;function QN(e,t,n,r){let o=(r??new ON(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const JN=QN;var ej=Object.freeze({__proto__:null,labelCaption:XN,labelDay:JN,labelDayButton:QN,labelGrid:KN,labelGridcell:function(e,t,n,r){let o=(r??new ON(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o},labelMonthDropdown:function(e){return"Choose the Month"},labelNav:function(){return""},labelNext:function(e){return"Go to the Next Month"},labelPrevious:function(e){return"Go to the Previous Month"},labelWeekNumber:function(e,t){return`Week ${e}`},labelWeekNumberHeader:function(e){return"Week Number"},labelWeekday:function(e,t,n){return(n??new ON(t)).format(e,"cccc")},labelYearDropdown:function(e){return"Choose the Year"}});function tj(e,t){const{month:n,defaultMonth:r,today:o=(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date),numberOfMonths:a=1,endMonth:i,startMonth:l}=e;let s=n||r||o;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=t;if(i&&c(i,s)<0){s=d(i,-1*(a-1))}return l&&c(s,l)<0&&(s=l),u(s)}class nj{constructor(e,t,n=AN){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class rj{constructor(e,t){this.date=e,this.weeks=t}}class oj{constructor(e,t){this.days=t,this.weekNumber=e}}function aj(e,t){const[n,r]=c(e);return[void 0===t?n:t,r]}function ij(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:l,addYears:s,endOfYear:c}=t,{fromYear:d,toYear:u,fromMonth:f,toMonth:h}=e;!n&&f&&(n=f),!n&&d&&(n=new Date(d,0,1)),!r&&h&&(r=h),!r&&u&&(r=new Date(u,11,31));const m=e.captionLayout?.startsWith("dropdown");n?n=i(n):d?n=new Date(d,0,1):!n&&m&&(n=o(s(e.today??(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date),-100)));r?r=l(r):u?r=new Date(u,11,31):!r&&m&&(r=c(e.today??(e.timeZone?YN.tz(e.timeZone):t.Date?new t.Date:new Date)));return[n?a(n):n,r?a(r):r]}(e,t),{startOfMonth:o,endOfMonth:a}=t,i=tj(e,t),[l,s]=aj(i,e.month?o(e.month):void 0);d((()=>{const n=tj(e,t);s(n)}),[e.timeZone]);const c=function(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let n=0;n<o;n++){const o=r.addMonths(e,n);if(t&&o>t)break;a.push(o)}return a}(l,r,e,t),u=function(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:l,broadcastCalendar:s}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:m,endOfWeek:p,isAfter:g,startOfBroadcastWeek:v,startOfISOWeek:w,startOfWeek:b}=r,y=s?v(o,r):i?w(o):b(o),x=d(s?f(a,r):i?h(m(a)):p(m(a)),y),E=u(a,o)+1,C=[];for(let e=0;e<=x;e++){const n=c(y,e);if(t&&g(n,t))break;C.push(n)}const k=(s?35:42)*E;if(l&&C.length<k){const e=k-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(c,e.endMonth?a(e.endMonth):void 0,e,t),f=function(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:l,endOfWeek:s,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:f,startOfWeek:h}=r,m=e.reduce(((e,m)=>{const p=n.broadcastCalendar?u(m,r):n.ISOWeek?f(m):h(m),g=n.broadcastCalendar?a(m,r):n.ISOWeek?i(l(m)):s(l(m)),v=t.filter((e=>e>=p&&e<=g)),w=n.broadcastCalendar?35:42;if(n.fixedWeeks&&v.length<w){const e=t.filter((e=>{const t=w-v.length;return e>g&&e<=o(g,t)}));v.push(...e)}const b=v.reduce(((e,t)=>{const o=n.ISOWeek?c(t):d(t),a=e.find((e=>e.weekNumber===o)),i=new nj(t,m,r);return a?a.days.push(i):e.push(new oj(o,[i])),e}),[]),y=new rj(m,b);return e.push(y),e}),[]);return n.reverseMonths?m.reverse():m}(c,u,e,t),h=function(e){return e.reduce(((e,t)=>[...e,...t.weeks]),[])}(f),m=f.reduce(((e,t)=>[...e,...t.weeks.reduce(((e,t)=>[...e,...t.days]),[])]),[]);const p=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:s}=r,c=o?a??1:1,d=i(e);return t&&s(d,t)<=0?void 0:l(d,-c)}(l,n,e,t),g=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:s}=r,c=o?a:1,d=i(e);return t&&s(t,e)<a?void 0:l(d,c)}(l,r,e,t),{disableNavigation:v,onMonthChange:w}=e,b=e=>{if(v)return;let t=o(e);n&&t<o(n)&&(t=o(n)),r&&t>o(r)&&(t=o(r)),s(t),w?.(t)},y={months:f,weeks:h,days:m,navStart:n,navEnd:r,previousMonth:p,nextMonth:g,goToMonth:b,goToDay:e=>{(e=>h.some((t=>t.days.some((t=>t.isEqualTo(e))))))(e)||b(e.date)}};return y}function lj(e,t,n=!1,r=AN){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:l}=r;if(o&&a){i(a,o)<0&&([o,a]=[a,o]);return i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?l(a,t):!(n||!o)&&l(o,t)}function sj(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function cj(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function dj(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function uj(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function fj(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function hj(e,t){return Array.isArray(e)&&e.every(t.isDate)}function mj(e,t,n=AN){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return o(e,t);if(hj(t,n))return t.includes(e);if(cj(t))return lj(t,e,!1,n);if(fj(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(sj(t)){const n=a(t.before,e)>0,r=a(t.after,e)<0;return i(t.before,t.after)?r&&n:n||r}return dj(t)?a(e,t.after)>0:uj(t)?a(t.before,e)>0:"function"==typeof t&&t(e)}))}function pj(e,t,n,r,o,a,i,l=0){if(l>365)return;const s=function(e,t,n,r,o,a,i){const{ISOWeek:l,broadcastCalendar:s}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:m,endOfWeek:p,max:g,min:v,startOfBroadcastWeek:w,startOfISOWeek:b,startOfWeek:y}=i,x={day:c,week:u,month:d,year:f,startOfWeek:e=>s?w(e,i):l?b(e):y(e),endOfWeek:e=>s?h(e,i):l?m(e):p(e)};let E=x[e](n,"after"===t?1:-1);return"before"===t&&r?E=g([r,E]):"after"===t&&o&&(E=v([o,E])),E}(e,t,n.date,r,o,a,i),c=Boolean(a.disabled&&mj(s,a.disabled,i)),d=Boolean(a.hidden&&mj(s,a.hidden,i)),u=new nj(s,s,i);return c||d?pj(e,t,u,r,o,a,i,l+1):u}function gj(e,t,n,r,o){const{autoFocus:a}=e,[i,l]=c(),s=function(e,t,n,r){let o,a=0,i=!1;for(;a<e.length&&!i;){const l=e[a],s=t(l);s[ES.disabled]||s[ES.hidden]||s[ES.outside]||(s[ES.focused]||r?.isEqualTo(l)||n(l.date)||s[ES.today])&&(o=l,i=!0),a++}return o||(o=e.find((e=>{const n=t(e);return!n[ES.disabled]&&!n[ES.hidden]&&!n[ES.outside]}))),o}(t.days,n,r||(()=>!1),i),[d,u]=c(a?s:void 0);return{isFocusTarget:e=>Boolean(s?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(n,r)=>{if(!d)return;const a=pj(n,r,d,t.navStart,t.navEnd,e,o);a&&(t.goToDay(a),u(a))}}}function vj(e,t,n=AN){return lj(e,t.from,!1,n)||lj(e,t.to,!1,n)||lj(t,e.from,!1,n)||lj(t,e.to,!1,n)}function wj(e,t,n=AN){const r=Array.isArray(t)?t:[t],o=r.filter((e=>"function"!=typeof e)).some((t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return lj(e,t,!1,n);if(hj(t,n))return t.some((t=>lj(e,t,!1,n)));if(cj(t))return!(!t.from||!t.to)&&vj(e,{from:t.from,to:t.to},n);if(fj(t))return function(e,t,n=AN){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}(e,t.dayOfWeek,n);if(sj(t)){return n.isAfter(t.before,t.after)?vj(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):mj(e.from,t,n)||mj(e.to,t,n)}return!(!dj(t)&&!uj(t))&&(mj(e.from,t,n)||mj(e.to,t,n))}));if(o)return!0;const a=r.filter((e=>"function"==typeof e));if(a.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(a.some((e=>e(t))))return!0;t=n.addDays(t,1)}}return!1}function bj(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:i}=e,[l,s]=aj(o,i?o:void 0),c=i?o:l;return{selected:c,select:(o,l,d)=>{const{min:u,max:f}=e,h=o?function(e,t,n=0,r=0,o=!1,a=AN){const{from:i,to:l}=t||{},{isSameDay:s,isAfter:c,isBefore:d}=a;let u;if(i||l){if(i&&!l)u=s(i,e)?o?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&l)if(s(i,e)&&s(l,e))u=o?{from:i,to:l}:void 0;else if(s(i,e))u={from:i,to:n>0?void 0:e};else if(s(l,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:l};else if(c(e,i))u={from:i,to:e};else{if(!c(e,l))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(r>0&&t>r||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(o,c,u,f,a,t):void 0;return r&&n&&h?.from&&h.to&&wj({from:h.from,to:h.to},n,t)&&(h.from=o,h.to=void 0),i||s(h),i?.(h,o,l,d),h},isSelected:e=>c&&lj(c,e,!1,t)}}function yj(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=aj(n,o?n:void 0),l=o?n:a,{isSameDay:s}=t;return{selected:l,select:(e,t,n)=>{let a=e;return!r&&l&&l&&s(e,l)&&(a=void 0),o||i(a),o?.(a,e,t,n),a},isSelected:e=>!!l&&s(l,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=aj(n,o?n:void 0),l=o?n:a,{isSameDay:s}=t,c=e=>l?.some((t=>s(t,e)))??!1,{min:d,max:u}=e;return{selected:l,select:(e,t,n)=>{let a=[...l??[]];if(c(e)){if(l?.length===d)return;if(r&&1===l?.length)return;a=l?.filter((t=>!s(t,e)))}else a=l?.length===u?[e]:[...a,e];return o||i(a),o?.(a,e,t,n),a},isSelected:c}}(e,t),o=bj(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function xj(e){const{components:n,formatters:r,labels:a,dateLib:i,locale:l,classNames:c}=s((()=>{const t={...XS,...e.locale};return{dateLib:new ON({locale:t,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens},e.dateLib),components:jN(e.components),formatters:(n=e.formatters,n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...FN,...n}),labels:{...ej,...e.labels},locale:t,classNames:{...DN(),...e.classNames}};var n}),[e.classNames,e.components,e.dateLib,e.firstWeekContainsDate,e.formatters,e.labels,e.locale,e.useAdditionalDayOfYearTokens,e.useAdditionalWeekYearTokens,e.weekStartsOn,e.broadcastCalendar]),{captionLayout:d,mode:u,onDayBlur:f,onDayClick:h,onDayFocus:m,onDayKeyDown:p,onDayMouseEnter:g,onDayMouseLeave:v,onNextClick:w,onPrevClick:b,showWeekNumber:y,styles:x}=e,{formatCaption:E,formatDay:C,formatMonthDropdown:k,formatWeekNumber:M,formatWeekNumberHeader:R,formatWeekdayName:I,formatYearDropdown:O}=r,A=ij(e,i),{days:L,months:S,navStart:N,navEnd:j,previousMonth:D,nextMonth:Z,goToMonth:V}=A,T=function(e,t,n){const{disabled:r,hidden:o,modifiers:a,showOutsideDays:i,broadcastCalendar:l,today:s}=t,{isSameDay:c,isSameMonth:d,startOfMonth:u,isBefore:f,endOfMonth:h,isAfter:m}=n,p=t.startMonth&&u(t.startMonth),g=t.endMonth&&h(t.endMonth),v={[ES.focused]:[],[ES.outside]:[],[ES.disabled]:[],[ES.hidden]:[],[ES.today]:[]},w={};for(const u of e){const{date:e,displayMonth:h}=u,b=Boolean(h&&!d(e,h)),y=Boolean(p&&f(e,p)),x=Boolean(g&&m(e,g)),E=Boolean(r&&mj(e,r,n)),C=Boolean(o&&mj(e,o,n))||y||x||!l&&!i&&b||l&&!1===i&&b,k=c(e,s??(t.timeZone?YN.tz(t.timeZone):n.Date?new n.Date:new Date));b&&v.outside.push(u),E&&v.disabled.push(u),C&&v.hidden.push(u),k&&v.today.push(u),a&&Object.keys(a).forEach((t=>{const r=a?.[t];r&&mj(e,r,n)&&(w[t]?w[t].push(u):w[t]=[u])}))}return e=>{const t={[ES.focused]:!1,[ES.disabled]:!1,[ES.hidden]:!1,[ES.outside]:!1,[ES.today]:!1},n={};for(const n in v){const r=v[n];t[n]=r.some((t=>t===e))}for(const t in w)n[t]=w[t].some((t=>t===e));return{...t,...n}}}(L,e,i),{isSelected:B,select:F,selected:P}=yj(e,i)??{},{blur:H,focused:_,isFocusTarget:W,moveFocus:z,setFocused:$}=gj(e,A,T,B??(()=>!1),i),{labelDayButton:U,labelGridcell:q,labelGrid:G,labelMonthDropdown:Y,labelNav:K,labelWeekday:X,labelWeekNumber:Q,labelWeekNumberHeader:J,labelYearDropdown:ee}=a,te=s((()=>function(e,t,n){const r=n?YN.tz(n):e.Date?new e.Date:new Date,o=t?e.startOfISOWeek(r):e.startOfWeek(r),a=[];for(let t=0;t<7;t++){const n=e.addDays(o,t);a.push(n)}return a}(i,e.ISOWeek,e.timeZone)),[i,e.ISOWeek,e.timeZone]),ne=void 0!==u||void 0!==h,re=o((()=>{D&&(V(D),b?.(D))}),[D,V,b]),oe=o((()=>{Z&&(V(Z),w?.(Z))}),[V,Z,w]),ae=o(((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),$(e),F?.(e.date,t,n),h?.(e.date,t,n)}),[F,h,$]),ie=o(((e,t)=>n=>{$(e),m?.(e.date,t,n)}),[m,$]),le=o(((e,t)=>n=>{H(),f?.(e.date,t,n)}),[H,f]),se=o(((t,n)=>r=>{const o={ArrowLeft:["day","rtl"===e.dir?"after":"before"],ArrowRight:["day","rtl"===e.dir?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(o[r.key]){r.preventDefault(),r.stopPropagation();const[e,t]=o[r.key];z(e,t)}p?.(t.date,n,r)}),[z,p,e.dir]),ce=o(((e,t)=>n=>{g?.(e.date,t,n)}),[g]),de=o(((e,t)=>n=>{v?.(e.date,t,n)}),[v]),ue=o((e=>t=>{const n=Number(t.target.value),r=i.setMonth(i.startOfMonth(e),n);V(r)}),[i,V]),fe=o((e=>t=>{const n=Number(t.target.value),r=i.setYear(i.startOfMonth(e),n);V(r)}),[i,V]),{className:he,style:me}=s((()=>({className:[c[xS.Root],e.className].filter(Boolean).join(" "),style:{...x?.[xS.Root],...e.style}})),[c,e.className,e.style,x]),pe=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0};return Object.entries(e).forEach((([e,n])=>{e.startsWith("data-")&&(t[e]=n)})),t}(e),ge={dayPickerProps:e,selected:P,select:F,isSelected:B,months:S,nextMonth:Z,previousMonth:D,goToMonth:V,getModifiers:T,components:n,classNames:c,styles:x,labels:a,formatters:r};return t.createElement(LN.Provider,{value:ge},t.createElement(n.Root,{className:he,style:me,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...pe},t.createElement(n.Months,{className:c[xS.Months],style:x?.[xS.Months]},!e.hideNavigation&&t.createElement(n.Nav,{className:c[xS.Nav],style:x?.[xS.Nav],"aria-label":K(),onPreviousClick:re,onNextClick:oe,previousMonth:D,nextMonth:Z}),S.map(((o,a)=>{const s=function(e,t,n,r,o){if(!t)return;if(!n)return;const{addMonths:a,startOfMonth:i}=o,l=e.getFullYear(),s=[];let c=t;for(;s.length<12;)s.push(c.getMonth()),c=a(c,1);const d=s.sort(((e,t)=>e-t)),u=d.map((e=>{const a=r.formatMonthDropdown(e,o.options.locale??XS),s=o.Date?new o.Date(l,e):new Date(l,e);return{value:e,label:a,disabled:t&&s<i(t)||n&&s>i(n)||!1}}));return u}(o.date,N,j,r,i),f=function(e,t,n,r){if(!e)return;if(!t)return;const{startOfYear:o,endOfYear:a,addYears:i,isBefore:l,isSameYear:s}=r,c=o(e),d=a(t),u=[];let f=c;for(;l(f,d)||s(f,d);)u.push(f.getFullYear()),f=i(f,1);return u.map((e=>({value:e,label:n.formatYearDropdown(e),disabled:!1})))}(N,j,r,i);return t.createElement(n.Month,{className:c[xS.Month],style:x?.[xS.Month],key:a,displayIndex:a,calendarMonth:o},t.createElement(n.MonthCaption,{className:c[xS.MonthCaption],style:x?.[xS.MonthCaption],calendarMonth:o,displayIndex:a},d?.startsWith("dropdown")?t.createElement(n.DropdownNav,{className:c[xS.Dropdowns],style:x?.[xS.Dropdowns]},"dropdown"===d||"dropdown-months"===d?t.createElement(n.MonthsDropdown,{className:c[xS.MonthsDropdown],"aria-label":Y(),classNames:c,components:n,disabled:Boolean(e.disableNavigation),onChange:ue(o.date),options:s,style:x?.[xS.Dropdown],value:o.date.getMonth()}):t.createElement("span",{role:"status","aria-live":"polite"},k(o.date.getMonth(),l)),"dropdown"===d||"dropdown-years"===d?t.createElement(n.YearsDropdown,{className:c[xS.YearsDropdown],"aria-label":ee(i.options),classNames:c,components:n,disabled:Boolean(e.disableNavigation),onChange:fe(o.date),options:f,style:x?.[xS.Dropdown],value:o.date.getFullYear()}):t.createElement("span",{role:"status","aria-live":"polite"},O(o.date.getFullYear()))):t.createElement(n.CaptionLabel,{className:c[xS.CaptionLabel],role:"status","aria-live":"polite"},E(o.date,i.options,i))),t.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":G(o.date,i.options,i)||void 0,className:c[xS.MonthGrid],style:x?.[xS.MonthGrid]},!e.hideWeekdays&&t.createElement(n.Weekdays,{className:c[xS.Weekdays],style:x?.[xS.Weekdays]},y&&t.createElement(n.WeekNumberHeader,{"aria-label":J(i.options),className:c[xS.WeekNumberHeader],style:x?.[xS.WeekNumberHeader],scope:"col"},R()),te.map(((e,r)=>t.createElement(n.Weekday,{"aria-label":X(e,i.options,i),className:c[xS.Weekday],key:r,style:x?.[xS.Weekday],scope:"col"},I(e,i.options,i))))),t.createElement(n.Weeks,{className:c[xS.Weeks],style:x?.[xS.Weeks]},o.weeks.map(((r,o)=>t.createElement(n.Week,{className:c[xS.Week],key:r.weekNumber,style:x?.[xS.Week],week:r},y&&t.createElement(n.WeekNumber,{week:r,style:x?.[xS.WeekNumber],"aria-label":Q(r.weekNumber,{locale:l}),className:c[xS.WeekNumber],scope:"row",role:"rowheader"},M(r.weekNumber)),r.days.map((r=>{const{date:o}=r,a=T(r);if(a[ES.focused]=!a.hidden&&Boolean(_?.isEqualTo(r)),a[CS.selected]=!a.disabled&&(B?.(o)||a.selected),cj(P)){const{from:e,to:t}=P;a[CS.range_start]=Boolean(e&&t&&i.isSameDay(o,e)),a[CS.range_end]=Boolean(e&&t&&i.isSameDay(o,t)),a[CS.range_middle]=lj(P,o,!0,i)}const l=function(e,t={},n={}){let r={...t?.[xS.Day]};return Object.entries(e).filter((([,e])=>!0===e)).forEach((([e])=>{r={...r,...n?.[e]}})),r}(a,x,e.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter((([,e])=>!0===e)).reduce(((e,[r])=>(n[r]?e.push(n[r]):t[ES[r]]?e.push(t[ES[r]]):t[CS[r]]&&e.push(t[CS[r]]),e)),[t[xS.Day]])}(a,c,e.modifiersClassNames),d=ne||a.hidden?void 0:q(o,a,i.options,i);return t.createElement(n.Day,{key:`${i.format(o,"yyyy-MM-dd")}_${i.format(r.displayMonth,"yyyy-MM")}`,day:r,modifiers:a,className:s.join(" "),style:l,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":i.format(o,"yyyy-MM-dd"),"data-month":r.outside?i.format(o,"yyyy-MM"):void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":r.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ne?t.createElement(n.DayButton,{className:c[xS.DayButton],style:x?.[xS.DayButton],type:"button",day:r,modifiers:a,disabled:a.disabled||void 0,tabIndex:W(r)?0:-1,"aria-label":U(o,a,i.options,i),onClick:ae(r,a),onBlur:le(r,a),onFocus:ie(r,a),onKeyDown:se(r,a),onMouseEnter:ce(r,a),onMouseLeave:de(r,a)},C(o,i.options,i)):!a.hidden&&C(r.date,i.options,i))}))))))))}))),e.footer&&t.createElement(n.Footer,{className:c[xS.Footer],style:x?.[xS.Footer],role:"status","aria-live":"polite"},e.footer)))}function Ej(e){var{className:t,classNames:n,showOutsideDays:r=!0}=e,o=IC(e,["className","classNames","showOutsideDays"]);const a=DN();return E(xj,Object.assign({showOutsideDays:r,captionLayout:"dropdown-years"},o,{className:LC("bg-bg-bg1 text-common-black border-bg-bg1",t),classNames:Object.assign(Object.assign(Object.assign({},a),{day_button:LC(a.day_button,"size-9"),day:"typography-subtitle1 ",today:"text-bold text-common-black [&_button]:rounded-full [&_button]:!border-primary [&_button]:!border [&_button]:!border-solid",selected:"bg-primary !text-state-primary-text-solid rounded-full ",weekdays:"text-gray-400",month_caption:LC(a.month_caption,"h-[54px]"),outside:"text-gray-400",nav:LC(a.nav,"gap-6 absolute flex right-0"),chevron:"fill-primary",root:LC(a.root,"px-6 py-4"),caption_label:LC(a.caption_label,"gap-2 flex items-center"),months:"flex flex-col relative",disabled:"[&_button]:rounded-full [&_button]:!text-input-disable-text"}),n),styles:{caption_label:{zIndex:1,position:"relative",display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",border:0},dropdown:{zIndex:2,opacity:0,WebkitAppearance:"none",MozAppearance:"none",appearance:"none",position:"absolute",insetBlockStart:0,insetBlockEnd:0,insetInlineStart:0,width:"100%",margin:0,padding:0,cursor:"inherit",border:"none",lineHeight:"inherit"},dropdowns:{position:"relative",display:"inline-flex",alignItems:"center",gap:4},dropdown_root:{position:"relative",display:"inline-flex",alignItems:"center"}}}))}Ej.displayName="Calendar";var Cj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function kj(t,n=globalThis?.document){const r=aL(t);e.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})}),[r,n])}var Mj,Rj="dismissableLayer.update",Ij="dismissableLayer.pointerDownOutside",Oj="dismissableLayer.focusOutside",Aj=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lj=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(Aj),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){Nj(Ij,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){Nj(Oj,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Mj=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Sj(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Mj)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Sj())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Rj,e),()=>document.removeEventListener(Rj,e)}),[]),E(Cj.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));Lj.displayName="DismissableLayer";function Sj(){const e=new CustomEvent(Rj);document.dispatchEvent(e)}function Nj(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(Aj),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Cj.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var jj=0;function Dj(){e.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zj()),document.body.insertAdjacentElement("beforeend",e[1]??Zj()),jj++,()=>{1===jj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),jj--}}),[])}function Zj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vj="focusScope.autoFocusOnMount",Tj="focusScope.autoFocusOnUnmount",Bj={bubbles:!1,cancelable:!0},Fj=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:Wj(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||Wj(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Wj(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){zj.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(Vj,Bj);s.addEventListener(Vj,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Wj(r,{select:t}),document.activeElement!==n)return}((e=Pj(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Wj(s))}return()=>{s.removeEventListener(Vj,d),setTimeout((()=>{const e=new CustomEvent(Tj,Bj);s.addEventListener(Tj,u),s.dispatchEvent(e),e.defaultPrevented||Wj(t??document.body,{select:!0}),s.removeEventListener(Tj,u),zj.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=Pj(e),n=Hj(t,e),r=Hj(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&Wj(a,{select:!0})):(e.preventDefault(),r&&Wj(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(Cj.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function Pj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Hj(e,t){for(const n of e)if(!_j(n,{upTo:t}))return n}function _j(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Wj(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Fj.displayName="FocusScope";var zj=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$j(e,t),e.unshift(t)},remove(t){e=$j(e,t),e[0]?.resume()}}}();function $j(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Uj=e["useId".toString()]||(()=>{}),qj=0;function Gj(t){const[n,r]=e.useState(Uj());return sL((()=>{r((e=>e??String(qj++)))}),[t]),n?`radix-${n}`:""}var Yj=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(Cj.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));Yj.displayName="Arrow";var Kj=Yj;function Xj(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var Qj="Popper",[Jj,eD]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Xj(o,...n)]}(Qj),[tD,nD]=Jj(Qj),rD=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(tD,{scope:n,anchor:o,onAnchorChange:a,children:r})};rD.displayName=Qj;var oD="PopperAnchor",aD=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=nD(oD,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(Cj.div,{...a,ref:s})}));aD.displayName=oD;var iD="PopperContent",[lD,sD]=Jj(iD),cD=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=nD(iD,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(hD),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),mD({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=pD(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(lD,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(Cj.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));cD.displayName=iD;var dD="PopperArrow",uD={top:"bottom",right:"left",bottom:"top",left:"right"},fD=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=sD(dD,n),a=uD[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E(Kj,{...r,ref:t,style:{...r.style,display:"block"}})})}));function hD(e){return null!==e}fD.displayName=dD;var mD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=pD(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function pD(e){const[t,n="center"]=e.split("-");return[t,n]}var gD=rD,vD=aD,wD=cD,bD=fD,yD=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(Cj.div,{...o,ref:n}),l):null}));yD.displayName="Portal";var xD=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=ED(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=ED(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=ED(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=ED(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function ED(e){return e?.animationName||"none"}xD.displayName="Presence";var CD=new WeakMap,kD=new WeakMap,MD={},RD=0,ID=function(e){return e&&(e.host||ID(e.parentNode))},OD=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=ID(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);MD[n]||(MD[n]=new WeakMap);var a=MD[n],i=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(l.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(CD.get(e)||0)+1,c=(a.get(e)||0)+1;CD.set(e,s),a.set(e,c),i.push(e),1===s&&o&&kD.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return d(t),l.clear(),RD++,function(){i.forEach((function(e){var t=CD.get(e)-1,o=a.get(e)-1;CD.set(e,t),a.set(e,o),t||(kD.has(e)||e.removeAttribute(r),kD.delete(e)),o||e.removeAttribute(n)})),--RD||(CD=new WeakMap,CD=new WeakMap,kD=new WeakMap,MD={})}},AD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),OD(r,o,n,"aria-hidden")):function(){return null}},LD="right-scroll-bar-position",SD="width-before-scroll-bar";function ND(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var jD="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,DD=new WeakMap;function ZD(e,t){var n,r,o,a=(n=null,r=function(t){return e.forEach((function(e){return ND(e,t)}))},(o=c((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return jD((function(){var t=DD.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach((function(e){r.has(e)||ND(e,null)})),r.forEach((function(e){n.has(e)||ND(e,o)}))}DD.set(a,e)}),[e]),a}function VD(e){return e}var TD=function(t){var n=t.sideCar,r=IC(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,RC({},r))};TD.isSideCarExport=!0;var BD=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=VD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=RC({async:!0,ssr:!1},e),t}(),FD=function(){},PD=e.forwardRef((function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:FD,onWheelCapture:FD,onTouchMoveCapture:FD}),a=o[0],i=o[1],l=t.forwardProps,s=t.children,c=t.className,d=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,m=t.noIsolation,p=t.inert,g=t.allowPinchZoom,v=t.as,w=void 0===v?"div":v,b=t.gapMode,y=IC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=h,E=ZD([r,n]),C=RC(RC({},y),a);return e.createElement(e.Fragment,null,u&&e.createElement(x,{sideCar:BD,removeScrollBar:d,shards:f,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:b}),l?e.cloneElement(e.Children.only(s),RC(RC({},C),{ref:E})):e.createElement(w,RC({},C,{className:c,ref:E}),s))}));PD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},PD.classNames={fullWidth:SD,zeroRight:LD};function HD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var _D=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=HD())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WD=function(){var t,n=(t=_D(),function(n,r){e.useEffect((function(){return t.add(n),function(){t.remove()}}),[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},zD={left:0,top:0,right:0,gap:0},$D=function(e){return parseInt(e||"",10)||0},UD=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return zD;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[$D(n),$D(r),$D(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qD=WD(),GD="data-scroll-locked",YD=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(GD,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(LD," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(SD," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(LD," .").concat(LD," {\n right: 0 ").concat(r,";\n }\n \n .").concat(SD," .").concat(SD," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(GD,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},KD=function(){var e=parseInt(document.body.getAttribute(GD)||"0",10);return isFinite(e)?e:0},XD=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect((function(){return document.body.setAttribute(GD,(KD()+1).toString()),function(){var e=KD()-1;e<=0?document.body.removeAttribute(GD):document.body.setAttribute(GD,e.toString())}}),[]);var i=e.useMemo((function(){return UD(a)}),[a]);return e.createElement(qD,{styles:YD(i,!n,a,r?"":"!important")})},QD=!1;if("undefined"!=typeof window)try{var JD=Object.defineProperty({},"passive",{get:function(){return QD=!0,!0}});window.addEventListener("test",JD,JD),window.removeEventListener("test",JD,JD)}catch(e){QD=!1}var eZ=!!QD&&{passive:!1},tZ=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},nZ=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rZ(e,r)){var o=oZ(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rZ=function(e,t){return"v"===e?function(e){return tZ(e,"overflowY")}(t):function(e){return tZ(e,"overflowX")}(t)},oZ=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},aZ=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iZ=function(e){return[e.deltaX,e.deltaY]},lZ=function(e){return e&&"current"in e?e.current:e},sZ=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},cZ=0,dZ=[];function uZ(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var fZ,hZ=(fZ=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(cZ++)[0],i=e.useState(WD)[0],l=e.useRef(t);e.useEffect((function(){l.current=t}),[t]),e.useEffect((function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(lZ),!0).filter(Boolean);return e.forEach((function(e){return e.classList.add("allow-interactivity-".concat(a))})),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(a))}))}}}),[t.inert,t.lockRef.current,t.shards]);var s=e.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var n,a=aZ(e),i=r.current,s="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=nZ(u,d);if(!f)return!0;if(f?n=u:(n="v"===u?"h":"v",f=nZ(u,d)),!f)return!1;if(!o.current&&"changedTouches"in e&&(s||c)&&(o.current=n),!n)return!0;var h=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,l=t.contains(i),s=!1,c=a>0,d=0,u=0;do{var f=oZ(e,i),h=f[0],m=f[1]-f[2]-o*h;(h||m)&&rZ(e,i)&&(d+=m,u+=h),i=i instanceof ShadowRoot?i.host:i.parentNode}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(s=!0),s}(h,t,e,"h"===h?s:c)}),[]),c=e.useCallback((function(e){var t=e;if(dZ.length&&dZ[dZ.length-1]===i){var r="deltaY"in t?iZ(t):aZ(t),o=n.current.filter((function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(l.current.shards||[]).map(lZ).filter(Boolean).filter((function(e){return e.contains(t.target)}));(a.length>0?s(t,a[0]):!l.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),d=e.useCallback((function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:uZ(r)};n.current.push(a),setTimeout((function(){n.current=n.current.filter((function(e){return e!==a}))}),1)}),[]),u=e.useCallback((function(e){r.current=aZ(e),o.current=void 0}),[]),f=e.useCallback((function(e){d(e.type,iZ(e),e.target,s(e,t.lockRef.current))}),[]),h=e.useCallback((function(e){d(e.type,aZ(e),e.target,s(e,t.lockRef.current))}),[]);e.useEffect((function(){return dZ.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,eZ),document.addEventListener("touchmove",c,eZ),document.addEventListener("touchstart",u,eZ),function(){dZ=dZ.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,eZ),document.removeEventListener("touchmove",c,eZ),document.removeEventListener("touchstart",u,eZ)}}),[]);var m=t.removeScrollBar,p=t.inert;return e.createElement(e.Fragment,null,p?e.createElement(i,{styles:sZ(a)}):null,m?e.createElement(XD,{gapMode:t.gapMode}):null)},BD.useMedium(fZ),TD),mZ=e.forwardRef((function(t,n){return e.createElement(PD,RC({},t,{ref:n,sideCar:hZ}))}));mZ.classNames=PD.classNames;var pZ="Popover",[gZ]=nL(pZ,[eD]),vZ=eD(),[wZ,bZ]=gZ(pZ),yZ=t=>{const{__scopePopover:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=t,s=vZ(n),c=e.useRef(null),[d,u]=e.useState(!1),[f=!1,h]=iL({prop:o,defaultProp:a,onChange:i});return E(gD,{...s,children:E(wZ,{scope:n,contentId:Gj(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:e.useCallback((()=>h((e=>!e))),[h]),hasCustomAnchor:d,onCustomAnchorAdd:e.useCallback((()=>u(!0)),[]),onCustomAnchorRemove:e.useCallback((()=>u(!1)),[]),modal:l,children:r})})};yZ.displayName=pZ;var xZ="PopoverAnchor";e.forwardRef(((t,n)=>{const{__scopePopover:r,...o}=t,a=bZ(xZ,r),i=vZ(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:s}=a;return e.useEffect((()=>(l(),()=>s())),[l,s]),E(vD,{...i,...o,ref:n})})).displayName=xZ;var EZ="PopoverTrigger",CZ=e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=bZ(EZ,n),a=vZ(n),i=tL(t,o.triggerRef),l=E(Cj.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":DZ(o.open),...r,ref:i,onClick:oL(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:E(vD,{asChild:!0,...a,children:l})}));CZ.displayName=EZ;var kZ="PopoverPortal",[MZ,RZ]=gZ(kZ,{forceMount:void 0}),IZ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=bZ(kZ,t);return E(MZ,{scope:t,forceMount:n,children:E(xD,{present:n||a.open,children:E(yD,{asChild:!0,container:o,children:r})})})};IZ.displayName=kZ;var OZ="PopoverContent",AZ=e.forwardRef(((e,t)=>{const n=RZ(OZ,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=bZ(OZ,e.__scopePopover);return E(xD,{present:r||a.open,children:a.modal?E(LZ,{...o,ref:t}):E(SZ,{...o,ref:t})})}));AZ.displayName=OZ;var LZ=e.forwardRef(((t,n)=>{const r=bZ(OZ,t.__scopePopover),o=e.useRef(null),a=tL(n,o),i=e.useRef(!1);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(mZ,{as:fL,allowPinchZoom:!0,children:E(NZ,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{e.preventDefault(),i.current||r.triggerRef.current?.focus()})),onPointerDownOutside:oL(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),SZ=e.forwardRef(((t,n)=>{const r=bZ(OZ,t.__scopePopover),o=e.useRef(!1),a=e.useRef(!1);return E(NZ,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})})),NZ=e.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:d,...u}=e,f=bZ(OZ,n),h=vZ(n);return Dj(),E(Fj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:E(Lj,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:E(wD,{"data-state":DZ(f.open),role:"dialog",id:f.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),jZ="PopoverClose";e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=bZ(jZ,n);return E(Cj.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,(()=>o.onOpenChange(!1)))})})).displayName=jZ;function DZ(e){return e?"open":"closed"}e.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=vZ(n);return E(bD,{...o,...r,ref:t})})).displayName="PopoverArrow";var ZZ=IZ,VZ=AZ;const TZ=yZ,BZ=CZ,FZ=e.forwardRef(((e,t)=>{var{className:n,align:r="center",sideOffset:o=4}=e,a=IC(e,["className","align","sideOffset"]);return E(ZZ,{children:E(VZ,Object.assign({ref:t,align:r,sideOffset:o,className:LC("z-50 min-w-72 rounded-md border bg-modal-surface border-bg-stroke3 overflow-hidden p-0 text-text-contrast-max shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},a))})}));FZ.displayName=VZ.displayName;const PZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function HZ(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _Z={date:HZ({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:HZ({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:HZ({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},WZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function zZ(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const $Z={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:zZ({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:zZ({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:zZ({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:zZ({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:zZ({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function UZ(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(l,(e=>e.test(i)));let c;c=e.valueCallback?e.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const qZ={ordinalNumber:function(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=n.valueCallback?n.valueCallback(i):i;return{value:i,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:UZ({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:UZ({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:UZ({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:UZ({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:UZ({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},GZ={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=PZ[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:_Z,formatRelative:(e,t,n,r)=>WZ[e],localize:$Z,match:qZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};let YZ={};function KZ(){return YZ}const XZ=6048e5;function QZ(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function JZ(e){const t=QZ(e);return t.setHours(0,0,0,0),t}function eV(e){const t=QZ(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tV(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function nV(e){const t=QZ(e),n=function(e,t){const n=JZ(e),r=JZ(t),o=+n-eV(n),a=+r-eV(r);return Math.round((o-a)/864e5)}(t,function(e){const t=QZ(e),n=tV(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function rV(e,t){const n=KZ(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=QZ(e),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function oV(e){return rV(e,{weekStartsOn:1})}function aV(e){const t=QZ(e),n=t.getFullYear(),r=tV(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=oV(r),a=tV(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const i=oV(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function iV(e){const t=QZ(e),n=+oV(t)-+function(e){const t=aV(e),n=tV(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),oV(n)}(t);return Math.round(n/XZ)+1}function lV(e,t){const n=QZ(e),r=n.getFullYear(),o=KZ(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=tV(e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const l=rV(i,t),s=tV(e,0);s.setFullYear(r,0,a),s.setHours(0,0,0,0);const c=rV(s,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function sV(e,t){const n=QZ(e),r=+rV(n,t)-+function(e,t){const n=KZ(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=lV(e,t),a=tV(e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),rV(a,t)}(n,t);return Math.round(r/XZ)+1}function cV(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const dV={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return cV("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):cV(n+1,2)},d:(e,t)=>cV(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>cV(e.getHours()%12||12,t.length),H:(e,t)=>cV(e.getHours(),t.length),m:(e,t)=>cV(e.getMinutes(),t.length),s:(e,t)=>cV(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return cV(Math.trunc(r*Math.pow(10,n-3)),t.length)}},uV="midnight",fV="noon",hV="morning",mV="afternoon",pV="evening",gV="night",vV={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return dV.y(e,t)},Y:function(e,t,n,r){const o=lV(e,r),a=o>0?o:1-o;if("YY"===t){return cV(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):cV(a,t.length)},R:function(e,t){return cV(aV(e),t.length)},u:function(e,t){return cV(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return cV(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return cV(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return dV.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return cV(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=sV(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):cV(o,t.length)},I:function(e,t,n){const r=iV(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):cV(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):dV.d(e,t)},D:function(e,t,n){const r=nV(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):cV(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return cV(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return cV(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return cV(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?fV:0===r?uV:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?pV:r>=12?mV:r>=4?hV:gV,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return dV.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):dV.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):cV(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):cV(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):dV.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):dV.s(e,t)},S:function(e,t){return dV.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return bV(r);case"XXXX":case"XX":return yV(r);default:return yV(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return bV(r);case"xxxx":case"xx":return yV(r);default:return yV(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wV(r,":");default:return"GMT"+yV(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wV(r,":");default:return"GMT"+yV(r,":")}},t:function(e,t,n){return cV(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return cV(e.getTime(),t.length)}};function wV(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+cV(a,2)}function bV(e,t){if(e%60==0){return(e>0?"-":"+")+cV(Math.abs(e)/60,2)}return yV(e,t)}function yV(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+cV(Math.trunc(r/60),2)+t+cV(r%60,2)}const xV=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},EV=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},CV={p:EV,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return xV(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",xV(r,t)).replace("{{time}}",EV(o,t))}},kV=/^D+$/,MV=/^Y+$/,RV=["D","DD","YY","YYYY"];function IV(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=QZ(e);return!isNaN(Number(n))}const OV=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,LV=/^'([^]*?)'?$/,SV=/''/g,NV=/[a-zA-Z]/;function jV(e,t,n){const r=KZ(),o=r.locale??GZ,a=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=QZ(e);if(!IV(l))throw new RangeError("Invalid time value");let s=t.match(AV).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,CV[t])(e,o.formatLong)}return e})).join("").match(OV).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:DV(e)};if(vV[t])return{isToken:!0,value:e};if(t.match(NV))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(s=o.localize.preprocessor(l,s));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return s.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return MV.test(e)}(r)||function(e){return kV.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),RV.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,vV[r[0]])(l,r,o.localize,c)})).join("")}function DV(e){const t=e.match(LV);return t?t[1].replace(SV,"'"):e}const ZV=e=>{var{date:t,onSelect:n,textInputProps:r,popoverContentProps:o}=e,a=IC(e,["date","onSelect","textInputProps","popoverContentProps"]);const[i,l]=c(!1);return E("div",{children:C(TZ,{modal:!0,open:i,onOpenChange:l,children:[E(BZ,{asChild:!0,children:E("div",{className:"flex",children:E(mk,Object.assign({fullwidth:!0,id:"date-picker",readOnly:!0,label:"Date",size:"md",value:t?jV(t,"dd MMM yyyy"):i?" ":"",hasClearIcon:!1,endIcon:E(Qn,{fill:"inherit",className:"cursor-pointer"})},r,{labelClassName:LC("pointer-events-none",null==r?void 0:r.labelClassName)}))})}),E(FZ,Object.assign({className:"w-auto p-0 z-[100]"},o,{children:E(Ej,Object.assign({defaultMonth:t},a,{mode:"single",selected:t,onSelect:(...e)=>{null==n||n(...e),l(!1)}}))}))]})})},VV=(e,t,n)=>Array.from(e).filter((e=>t.test(e))).slice(0,n),TV=n((({value:e,onChange:t,onBlur:n,onComplete:o,length:a=6,disabled:i=!1,invalid:l=!1,autoFocus:c=!1,inputMode:d="numeric",charPattern:f=/^\d$/,className:h,inputClassName:m},p)=>{const g=r([]),v=r(null),w=s((()=>{const t=e||"";return Array.from({length:a},((e,n)=>t[n]||""))}),[a,e]);u(p,(()=>g.current[0]),[]);const b=e=>{const n=e.join("");t(n),o&&e.every((e=>""!==e))&&o(n)},y=e=>{var t,n;const r=Math.max(0,Math.min(a-1,e));null===(t=g.current[r])||void 0===t||t.focus(),null===(n=g.current[r])||void 0===n||n.select()};return E("div",{className:LC("flex items-center gap-3",h),ref:v,children:w.map(((e,t)=>E("input",{ref:e=>{g.current[t]=e},type:"text",inputMode:d,autoComplete:0===t?"one-time-code":"off",value:e,maxLength:1,disabled:i,autoFocus:c&&0===t,"aria-invalid":l||void 0,className:LC("h-14 w-[46px] rounded-[8px] text-input-filled-text border bg-transparent text-center text-2xl font-semibold outline-none transition-all duration-200","border-input-default-stroke focus:border-input-active-stroke","disabled:cursor-not-allowed disabled:opacity-50",l&&"border-input-error focus:border-input-error",m),onFocus:e=>{e.target.select()},onBlur:e=>{var t;const r=e.relatedTarget;r&&(null===(t=v.current)||void 0===t?void 0:t.contains(r))||null==n||n()},onChange:e=>((e,t)=>{if(i)return;if(!t){const t=[...w];return t[e]="",void b(t)}const n=VV(t,f,a);if(!n.length)return;const r=[...w];let o=e;n.forEach((e=>{o<a&&(r[o]=e,o+=1)})),b(r),y(o<a?o:a-1)})(t,e.target.value),onPaste:e=>((e,t)=>{if(t.preventDefault(),i)return;const n=t.clipboardData.getData("text"),r=VV(n,f,a-e);if(!r.length)return;const o=[...w];r.forEach(((t,n)=>{o[e+n]=t})),b(o);const l=Math.min(e+r.length,a-1);y(l)})(t,e),onKeyDown:e=>((e,t)=>{if(!i){if("ArrowLeft"===t.key)return t.preventDefault(),void y(e-1);if("ArrowRight"===t.key)return t.preventDefault(),void y(e+1);if("Backspace"===t.key){if(w[e]){t.preventDefault();const n=[...w];return n[e]="",void b(n)}if(e>0){t.preventDefault();const n=[...w];n[e-1]="",b(n),y(e-1)}}}})(t,e)},t)))})}));TV.displayName="OtpInput";const BV=t.forwardRef(((e,t)=>{var{id:n,label:r,required:o=!1,helperText:a,error:i=!1,errorMessage:l,keepFooterSpace:s=!0,wrapperClassName:c,labelClassName:d,messageClassName:u}=e,f=IC(e,["id","label","required","helperText","error","errorMessage","keepFooterSpace","wrapperClassName","labelClassName","messageClassName"]);const h=Boolean(i||l),m=h?l:a;return C("div",{className:LC("inline-flex w-full flex-col gap-2",c),children:[r&&C("label",{htmlFor:n,className:LC("typography-overline text-input-default-text",h&&"text-input-error",d),children:[r,o&&E("span",{className:"ml-1 text-input-error",children:"*"})]}),E(TV,Object.assign({},f,{ref:t,invalid:h})),(m||s)&&E("div",{className:LC("typography-small2 min-h-[18px]",h?"text-input-error":"text-text-g-contrast-medium",u),role:h?"alert":void 0,children:m||" "})]})}));BV.displayName="OtpInputGroup";const FV=({progress:e=0,color:t,gradientStart:n,gradientEnd:r,animationDuration:o=.5,height:a=8,trackClassName:i,progressClassName:l})=>{const[s,u]=c(0);d((()=>{u(e)}),[e]);return E("div",{className:LC("w-full bg-grey2-transparent-16 rounded-full overflow-hidden",i),style:{height:`${a}px`},children:E("div",{className:LC("h-full rounded-full transition-all ease-out bg-primary",l),style:{width:`${s}%`,background:n&&r?`linear-gradient(to right, ${n}, ${r})`:t,transition:`width ${o}s ease-out`}})})},PV=e.forwardRef(((e,t)=>{var{rootClassName:n,className:r,rootRef:o,bordered:a=!1,scrollableWrapper:i=!0}=e,l=IC(e,["rootClassName","className","rootRef","bordered","scrollableWrapper"]);const s=LC("relative h-full w-full min-h-0 overflow-auto","ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s"),c=LC("min-w-full caption-bottom border-separate border-spacing-0",r),d=E("table",Object.assign({ref:t,className:c},l));return a||!1!==i?E("div",a?{className:LC("relative flex h-full w-full min-h-0 flex-col overflow-hidden rounded-md border border-table-c-border",n),ref:o,children:E("div",{className:s,children:d})}:{className:LC(s,n),ref:o,children:d}):E("table",Object.assign({ref:t,className:LC(c,n)},l))}));PV.displayName="Table";const HV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("thead",Object.assign({ref:t,className:LC("[&_tr>th]:box-border [&_tr>th]:border-b [&_tr>th]:border-b-table-c-header-line",n)},r))}));HV.displayName="TableHeader";const _V=e.forwardRef(((e,t)=>{var{className:n,striped:r=!1}=e,o=IC(e,["className","striped"]);return E("tbody",Object.assign({ref:t,className:LC("[&_tr:last-child>td]:border-b-0 [&_tr:last-child>th]:border-b-0","[&_tr]:bg-table-c-row-bg","[&_tr:hover]:!bg-table-c-hover","[&_tr[data-state=selected]]:!bg-table-c-selected","[&_tr[data-highlighted=true]]:!bg-table-c-selected",r&&["[&_tr:nth-child(odd)]:bg-table-c-row-bg","[&_tr:nth-child(even)]:bg-table-c-row-bg-even","[&_tr>td]:border-b-0"],n)},o))}));_V.displayName="TableBody";const WV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("tfoot",Object.assign({ref:t,className:LC("bg-table-c-header-bg border-t border-t-table-c-header-line font-medium [&>tr]:last:border-b-0",n)},r))}));WV.displayName="TableFooter";const zV=e.forwardRef(((e,t)=>{var{className:n,divided:r=!0,colDivided:o=!1}=e,a=IC(e,["className","divided","colDivided"]);return E("tr",Object.assign({ref:t,className:LC("transition-colors box-border",r&&["[&>td]:border-b [&>td]:border-b-table-c-row-line","[&>th]:border-b [&>th]:border-b-table-c-row-line"],o&&["[&>td:not(:last-child)]:border-r [&>td:not(:last-child)]:border-r-table-c-col-line","[&>th:not(:last-child)]:border-r [&>th:not(:last-child)]:border-r-table-c-col-line"],n)},a))}));zV.displayName="TableRow";const $V=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("th",Object.assign({ref:t,className:LC("box-border py-3 px-3 text-left align-middle","typography-body2 text-text-contrast-max","bg-table-c-header-bg","leading-[20px]","[&:has([role=checkbox])]:px-3 [&:has([role=checkbox])]:min-w-10",n)},r))}));$V.displayName="TableHead";const UV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("td",Object.assign({ref:t,className:LC("box-border py-3 px-3 text-left align-middle","typography-body3 text-text-contrast-max","leading-[18px]","bg-inherit","[&:has([role=checkbox])]:px-3 [&:has([role=checkbox])]:min-w-10",n)},r))}));UV.displayName="TableCell";const qV=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E("caption",Object.assign({ref:t,className:LC("mt-4 pb-3 text-sm text-text-g-contrast-medium",n)},r))}));qV.displayName="TableCaption";const GV=e.forwardRef((({pageIndex:e,pageSize:t,totalCount:n,pageSizeOptions:r=[10,20,50,100],onPageChange:o,onPageSizeChange:a,className:i},l)=>{const s=Math.max(1,Math.ceil(n/t)),c=0===n?0:e*t+1,d=Math.min((e+1)*t,n);return C("div",{ref:l,className:LC("flex items-center justify-end gap-8 px-6 py-2","bg-table-c-header-bg","border-t border-t-table-c-header-line",i),children:[C("div",{className:"flex items-center gap-3",children:[E("span",{className:"typography-subtitle4 text-text-g-contrast-high whitespace-nowrap",children:"items per page"}),C("div",{className:"relative",children:[E("select",{value:t,onChange:e=>{a(Number(e.target.value)),o(0)},className:LC("appearance-none w-[72px] rounded-md border border-input-default-stroke","bg-table-c-header-bg p-2 pr-7","typography-small2 text-text-g-contrast-high","cursor-pointer focus:outline-none focus:ring-1 focus:ring-input-active-stroke"),children:r.map((e=>E("option",{value:e,children:e},e)))}),E(JC,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 size-[14px] text-text-g-contrast-high","aria-hidden":!0})]})]}),C("span",{className:"typography-subtitle4 text-text-g-contrast-high whitespace-nowrap tabular-nums",children:[c,"–",d," of ",n," items"]}),C("div",{className:"flex items-center gap-2",children:[E(Zk,{variant:"icon",size:"sm",onClick:()=>o(0),disabled:0===e,"aria-label":"First page",children:E(ek,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(e-1),disabled:0===e,"aria-label":"Previous page",children:E(nk,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(e+1),disabled:e>=s-1,"aria-label":"Next page",children:E(rk,{})}),E(Zk,{variant:"icon",size:"sm",onClick:()=>o(s-1),disabled:e>=s-1,"aria-label":"Last page",children:E(tk,{})})]})]})}));
33
33
  /**
34
34
  * table-core
35
35
  *
@@ -51,5 +51,5 @@ function YV(e,t){return"function"==typeof e?e(t):e}function KV(e,t){return n=>{t
51
51
  *
52
52
  * @license MIT
53
53
  */
54
- function qT(t,n){return t?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(r=t)||"function"==typeof r||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?e.createElement(t,n):t:null;var r}function GT(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function YT(...e){return t=>{let n=!1;const r=e.map((e=>{const r=GT(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():GT(e[t],null)}}}}var KT=e.forwardRef(((t,n)=>{const{children:r,...o}=t,a=e.Children.toArray(r),i=a.find(JT);if(i){const t=i.props.children,r=a.map((n=>n===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n));return E(XT,{...o,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return E(XT,{...o,ref:n,children:r})}));KT.displayName="Slot";var XT=e.forwardRef(((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r);return e.cloneElement(r,{...eB(o,r.props),ref:n?YT(n,t):t})}return e.Children.count(r)>1?e.Children.only(null):null}));XT.displayName="SlotClone";var QT=({children:e})=>E(k,{children:e});function JT(t){return e.isValidElement(t)&&t.type===QT}function eB(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}var tB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?KT:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),nB=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(tB.div,{...o,ref:n}),l):null}));nB.displayName="Portal";var rB=nB;const oB="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function aB(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function iB(e){return"nodeType"in e}function lB(e){var t,n;return e?aB(e)?e:iB(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function sB(e){const{Document:t}=lB(e);return e instanceof t}function cB(e){return!aB(e)&&e instanceof lB(e).HTMLElement}function dB(e){return e instanceof lB(e).SVGElement}function uB(e){return e?aB(e)?e.document:iB(e)?sB(e)?e:cB(e)||dB(e)?e.ownerDocument:document:document:document}const fB=oB?f:d;function hB(e){const t=r(e);return fB((()=>{t.current=e})),o((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function mB(e,t){void 0===t&&(t=[e]);const n=r(e);return fB((()=>{n.current!==e&&(n.current=e)}),t),n}function pB(e,t){const n=r();return s((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function gB(e){const t=hB(e),n=r(null),a=o((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,a]}function vB(e){const t=r();return d((()=>{t.current=e}),[e]),t.current}let wB={};function bB(e,t){return s((()=>{if(t)return t;const n=null==wB[e]?0:wB[e]+1;return wB[e]=n,e+"-"+n}),[e,t])}function yB(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const xB=yB(1),EB=yB(-1);function CB(e){if(!e)return!1;const{KeyboardEvent:t}=lB(e.target);return t&&e instanceof t}function kB(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=lB(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const MB=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[MB.Translate.toString(e),MB.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),RB="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function IB(e){return e.matches(RB)?e:e.querySelector(RB)}const OB={display:"none"};function AB(e){let{id:n,value:r}=e;return t.createElement("div",{id:n,style:OB},r)}function LB(e){let{id:n,announcement:r,ariaLiveType:o="assertive"}=e;return t.createElement("div",{id:n,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const SB=i(null);const NB={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},jB={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function DB(e){let{announcements:n=jB,container:r,hiddenTextDescribedById:i,screenReaderInstructions:l=NB}=e;const{announce:u,announcement:f}=function(){const[e,t]=c("");return{announce:o((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=bB("DndLiveRegion"),[m,p]=c(!1);if(d((()=>{p(!0)}),[]),function(e){const t=a(SB);d((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(s((()=>({onDragStart(e){let{active:t}=e;u(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:r}=e;n.onDragMove&&u(n.onDragMove({active:t,over:r}))},onDragOver(e){let{active:t,over:r}=e;u(n.onDragOver({active:t,over:r}))},onDragEnd(e){let{active:t,over:r}=e;u(n.onDragEnd({active:t,over:r}))},onDragCancel(e){let{active:t,over:r}=e;u(n.onDragCancel({active:t,over:r}))}})),[u,n])),!m)return null;const g=t.createElement(t.Fragment,null,t.createElement(AB,{id:i,value:l.draggable}),t.createElement(LB,{id:h,announcement:f}));return r?A(g,r):g}var ZB;function VB(){}function TB(e,t){return s((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function BB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(ZB||(ZB={}));const FB=Object.freeze({x:0,y:0});function PB(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function HB(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _B(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function WB(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function zB(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function $B(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const UB=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=$B(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=PB($B(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(HB)};function qB(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=i*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const GB=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=qB(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_B)};function YB(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:FB}function KB(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const XB=KB(1);const QB={ignoreTransform:!1};function JB(e,t){void 0===t&&(t=QB);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=lB(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,s=e.left-i-(1-o)*parseFloat(n),c=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=a?e.height/a:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:i,bottom:l,right:s}=n;return{top:r,left:o,width:a,height:i,bottom:l,right:s}}function eF(e){return JB(e,{ignoreTransform:!0})}function tF(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(sB(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!cB(o)||dB(o))return n;if(n.includes(o))return n;const a=lB(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=lB(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=lB(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function nF(e){const[t]=tF(e,1);return null!=t?t:null}function rF(e){return oB&&e?aB(e)?e:iB(e)?sB(e)||e===uB(e).scrollingElement?window:cB(e)?e:null:null:null}function oF(e){return aB(e)?e.scrollX:e.scrollLeft}function aF(e){return aB(e)?e.scrollY:e.scrollTop}function iF(e){return{x:oF(e),y:aF(e)}}var lF;function sF(e){return!(!oB||!e)&&e===document.scrollingElement}function cF(e){const t={x:0,y:0},n=sF(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(lF||(lF={}));const dF={x:.2,y:.2};function uF(e,t,n,r,o){let{top:a,left:i,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=dF);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=cF(e),h={x:0,y:0},m={x:0,y:0},p=t.height*o.y,g=t.width*o.x;return!c&&a<=t.top+p?(h.y=lF.Backward,m.y=r*Math.abs((t.top+p-a)/p)):!d&&s>=t.bottom-p&&(h.y=lF.Forward,m.y=r*Math.abs((t.bottom-p-s)/p)),!f&&l>=t.right-g?(h.x=lF.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!u&&i<=t.left+g&&(h.x=lF.Backward,m.x=r*Math.abs((t.left+g-i)/g)),{direction:h,speed:m}}function fF(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function hF(e){return e.reduce(((e,t)=>xB(e,iF(t))),FB)}const mF=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+oF(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+aF(t)),0)}]];class pF{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=tF(t),r=hF(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of mF)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gF{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function vF(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var wF,bF;function yF(e){e.preventDefault()}function xF(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(wF||(wF={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(bF||(bF={}));const EF={start:[bF.Space,bF.Enter],cancel:[bF.Esc],end:[bF.Space,bF.Enter,bF.Tab]},CF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case bF.Right:return{...n,x:n.x+25};case bF.Left:return{...n,x:n.x-25};case bF.Down:return{...n,y:n.y+25};case bF.Up:return{...n,y:n.y-25}}};class kF{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new gF(uB(t)),this.windowListeners=new gF(lB(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(wF.Resize,this.handleCancel),this.windowListeners.add(wF.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(wF.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=JB),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);nF(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(FB)}handleKeyDown(e){if(CB(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=EF,coordinateGetter:a=CF,scrollBehavior:i="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:FB;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=EB(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:f}=cF(n),h=fF(n),m={x:Math.min(o===bF.Right?h.right-h.width/2:h.right,Math.max(o===bF.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===bF.Down?h.bottom-h.height/2:h.bottom,Math.max(o===bF.Down?h.top:h.top+h.height/2,d.y))},p=o===bF.Right&&!l||o===bF.Left&&!s,g=o===bF.Down&&!c||o===bF.Up&&!a;if(p&&m.x!==d.x){const e=n.scrollLeft+t.x,a=o===bF.Right&&e<=u.x||o===bF.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:i});r.x=a?n.scrollLeft-e:o===bF.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:i});break}if(g&&m.y!==d.y){const e=n.scrollTop+t.y,a=o===bF.Down&&e<=u.y||o===bF.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:i});r.y=a?n.scrollTop-e:o===bF.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:i});break}}this.handleMove(e,xB(EB(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function MF(e){return Boolean(e&&"distance"in e)}function RF(e){return Boolean(e&&"delay"in e)}kF.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=EF,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class IF{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=lB(e);return e instanceof t?e:uB(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=uB(a),this.documentListeners=new gF(this.document),this.listeners=new gF(n),this.windowListeners=new gF(lB(a)),this.initialCoordinates=null!=(r=kB(o))?r:FB,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(wF.Resize,this.handleCancel),this.windowListeners.add(wF.DragStart,yF),this.windowListeners.add(wF.VisibilityChange,this.handleCancel),this.windowListeners.add(wF.ContextMenu,yF),this.documentListeners.add(wF.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RF(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(MF(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(wF.Click,xF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(wF.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!r)return;const l=null!=(t=kB(e))?t:FB,s=EB(r,l);if(!n&&i){if(MF(i)){if(null!=i.tolerance&&vF(s,i.tolerance))return this.handleCancel();if(vF(s,i.distance))return this.handleStart()}return RF(i)&&vF(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===bF.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const OF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class AF extends IF{constructor(e){const{event:t}=e,n=uB(t.target);super(e,OF,n)}}AF.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const LF={move:{name:"mousemove"},end:{name:"mouseup"}};var SF;!function(e){e[e.RightClick=2]="RightClick"}(SF||(SF={}));(class extends IF{constructor(e){super(e,LF,uB(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==SF.RightClick&&(null==r||r({event:n}),!0)}}];const NF={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var jF,DF;function ZF(e){let{acceleration:t,activator:n=jF.Pointer,canScroll:a,draggingRect:i,enabled:l,interval:c=5,order:u=DF.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:m,delta:p,threshold:g}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=vB(t);return pB((e=>{if(n||!r||!e)return VF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[lF.Backward]:e.x[lF.Backward]||-1===o.x,[lF.Forward]:e.x[lF.Forward]||1===o.x},y:{[lF.Backward]:e.y[lF.Backward]||-1===o.y,[lF.Forward]:e.y[lF.Forward]||1===o.y}}}),[n,t,r])}({delta:p,disabled:!l}),[w,b]=function(){const e=r(null);return[o(((t,n)=>{e.current=setInterval(t,n)}),[]),o((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=r({x:0,y:0}),x=r({x:0,y:0}),E=s((()=>{switch(n){case jF.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case jF.DraggableRect:return i}}),[n,i,f]),C=r(null),k=o((()=>{const e=C.current;if(!e)return;const t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)}),[]),M=s((()=>u===DF.TreeOrder?[...h].reverse():h),[u,h]);d((()=>{if(l&&h.length&&E){for(const e of M){if(!1===(null==a?void 0:a(e)))continue;const n=h.indexOf(e),r=m[n];if(!r)continue;const{direction:o,speed:i}=uF(e,r,E,t,g);for(const e of["x","y"])v[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0)return b(),C.current=e,w(k,c),y.current=i,void(x.current=o)}y.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,k,a,b,l,c,JSON.stringify(E),JSON.stringify(v),w,h,M,m,JSON.stringify(g)])}(class extends IF{constructor(e){super(e,NF)}static setup(){return window.addEventListener(NF.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(NF.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(jF||(jF={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(DF||(DF={}));const VF={x:{[lF.Backward]:!1,[lF.Forward]:!1},y:{[lF.Backward]:!1,[lF.Forward]:!1}};var TF,BF;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(TF||(TF={})),function(e){e.Optimized="optimized"}(BF||(BF={}));const FF=new Map;function PF(e,t){return pB((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function HF(e){let{callback:t,disabled:n}=e;const r=hB(t),o=s((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return d((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function _F(e){return new pF(JB(e),e)}function WF(e,t,n){void 0===t&&(t=_F);const[r,o]=c(null);function a(){o((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}))}const i=function(e){let{callback:t,disabled:n}=e;const r=hB(t),o=s((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return d((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),l=HF({callback:a});return fB((()=>{a(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),r}const zF=[];function $F(e,t){void 0===t&&(t=[]);const n=r(null);return d((()=>{n.current=null}),t),d((()=>{const t=e!==FB;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?EB(e,n.current):FB}function UF(e){return s((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const qF=[];function GF(e){let{measure:t}=e;const[n,r]=c(null),a=o((e=>{for(const{target:n}of e)if(cB(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=HF({callback:a}),l=o((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return cB(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[d,u]=gB(l);return s((()=>({nodeRef:d,rect:n,setRef:u})),[n,d,u])}const YF=[{sensor:AF,options:{}},{sensor:kF,options:{}}],KF={current:{}},XF={draggable:{measure:eF},droppable:{measure:eF,strategy:TF.WhileDragging,frequency:BF.Optimized},dragOverlay:{measure:JB}};class QF extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const JF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new QF,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:VB},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:XF,measureDroppableContainers:VB,windowRect:null,measuringScheduled:!1},eP=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:VB,draggableNodes:new Map,over:null,measureDroppableContainers:VB}),tP=i(JF);function nP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new QF}}}function rP(e,t){switch(t.type){case ZB.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ZB.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ZB.DragEnd:case ZB.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ZB.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new QF(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case ZB.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new QF(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case ZB.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new QF(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function oP(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=a(eP),i=vB(r),l=vB(null==n?void 0:n.id);return d((()=>{if(!t&&!r&&i&&null!=l){if(!CB(i))return;if(document.activeElement===i.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=IB(e);if(t){t.focus();break}}}))}}),[r,t,o,l,i]),null}const aP=i({...FB,scaleX:1,scaleY:1});var iP;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(iP||(iP={}));const lP=x((function(e){var n,a,i,l;let{id:u,accessibility:f,autoScroll:h=!0,children:m,sensors:p=YF,collisionDetection:g=GB,measuring:w,modifiers:b,...y}=e;const x=v(rP,void 0,nP),[E,C]=x,[k,M]=function(){const[e]=c((()=>new Set)),t=o((t=>(e.add(t),()=>e.delete(t))),[e]);return[o((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[R,I]=c(iP.Uninitialized),O=R===iP.Initialized,{draggable:{active:A,nodes:L,translate:N},droppable:{containers:j}}=E,D=null!=A?L.get(A):null,Z=r({initial:null,translated:null}),V=s((()=>{var e;return null!=A?{id:A,data:null!=(e=null==D?void 0:D.data)?e:KF,rect:Z}:null}),[A,D]),T=r(null),[B,F]=c(null),[P,H]=c(null),_=mB(y,Object.values(y)),W=bB("DndDescribedBy",u),z=s((()=>j.getEnabled()),[j]),$=s((()=>({draggable:{...XF.draggable,...null==U?void 0:U.draggable},droppable:{...XF.droppable,...null==U?void 0:U.droppable},dragOverlay:{...XF.dragOverlay,...null==U?void 0:U.dragOverlay}})),[null==(U=w)?void 0:U.draggable,null==U?void 0:U.droppable,null==U?void 0:U.dragOverlay]);var U;const{droppableRects:q,measureDroppableContainers:G,measuringScheduled:Y}=function(e,t){let{dragging:n,dependencies:a,config:i}=t;const[l,s]=c(null),{frequency:u,measure:f,strategy:h}=i,m=r(e),p=function(){switch(h){case TF.Always:return!1;case TF.BeforeDragging:return n;default:return!n}}(),g=mB(p),v=o((function(e){void 0===e&&(e=[]),g.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),w=r(null),b=pB((t=>{if(p&&!n)return FF;if(!t||t===FF||m.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new pF(f(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,p,f]);return d((()=>{m.current=e}),[e]),d((()=>{p||v()}),[n,p]),d((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),d((()=>{p||"number"!=typeof u||null!==w.current||(w.current=setTimeout((()=>{v(),w.current=null}),u))}),[u,p,v,...a]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=l}}(z,{dragging:O,dependencies:[N.x,N.y],config:$.droppable}),K=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return pB((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(L,A),X=s((()=>P?kB(P):null),[P]),Q=function(){const e=!1===(null==B?void 0:B.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=O&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),J=function(e,t){return PF(e,t)}(K,$.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const i=r(!1),{x:l,y:s}="boolean"==typeof a?{x:a,y:a}:a;fB((()=>{if(!l&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=YB(n(e),o);if(l||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=nF(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,s,o,n])}({activeNode:null!=A?L.get(A):null,config:Q.layoutShiftCompensation,initialRect:J,measure:$.draggable.measure});const ee=WF(K,$.draggable.measure,J),te=WF(K?K.parentElement:null),ne=r({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=j.getNodeFor(null==(n=ne.current.over)?void 0:n.id),oe=GF({measure:$.dragOverlay.measure}),ae=null!=(a=oe.nodeRef.current)?a:K,ie=O?null!=(i=oe.rect)?i:ee:null,le=Boolean(oe.nodeRef.current&&oe.rect),se=YB(ce=le?null:ee,PF(ce));var ce;const de=UF(ae?lB(ae):null),ue=function(e){const t=r(e),n=pB((n=>e?n&&n!==zF&&e&&t.current&&e.parentNode===t.current.parentNode?n:tF(e):zF),[e]);return d((()=>{t.current=e}),[e]),n}(O?null!=re?re:K:null),fe=function(e,t){void 0===t&&(t=JB);const[n]=e,r=UF(n?lB(n):null),[o,a]=c(qF);function i(){a((()=>e.length?e.map((e=>sF(e)?r:new pF(t(e),e))):qF))}const l=HF({callback:i});return fB((()=>{null==l||l.disconnect(),i(),e.forEach((e=>null==l?void 0:l.observe(e)))}),[e]),o}(ue),he=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(b,{transform:{x:N.x-se.x,y:N.y-se.y,scaleX:1,scaleY:1},activatorEvent:P,active:V,activeNodeRect:ee,containerNodeRect:te,draggingNodeRect:ie,over:ne.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ue,scrollableAncestorRects:fe,windowRect:de}),me=X?xB(X,N):null,pe=function(e){const[t,n]=c(null),a=r(e),i=o((e=>{const t=rF(e.target);t&&n((e=>e?(e.set(t,iF(t)),new Map(e)):null))}),[]);return d((()=>{const t=a.current;if(e!==t){r(t);const o=e.map((e=>{const t=rF(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,iF(t)]):null})).filter((e=>null!=e));n(o.length?new Map(o):null),a.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=rF(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),s((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>xB(e,t)),FB):hF(e):FB),[e,t])}(ue),ge=$F(pe),ve=$F(pe,[ee]),we=xB(he,ge),be=ie?XB(ie,he):null,ye=V&&be?g({active:V,collisionRect:be,droppableRects:q,droppableContainers:z,pointerCoordinates:me}):null,xe=zB(ye,"id"),[Ee,Ce]=c(null),ke=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(le?he:xB(he,ve),null!=(l=null==Ee?void 0:Ee.rect)?l:null,ee),Me=r(null),Re=o(((e,t)=>{let{sensor:n,options:r}=t;if(null==T.current)return;const o=L.get(T.current);if(!o)return;const a=e.nativeEvent,i=new n({active:T.current,activeNode:o,event:a,options:r,context:ne,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=_.current,n={id:e};null==t||t(n),k({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!L.get(e))return;const{onDragPending:o}=_.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),k({type:"onDragPending",event:a})},onStart(e){const t=T.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:r}=_.current,o={activatorEvent:a,active:{id:t,data:n.data,rect:Z}};S((()=>{null==r||r(o),I(iP.Initializing),C({type:ZB.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:o}),F(Me.current),H(a)}))},onMove(e){C({type:ZB.DragMove,coordinates:e})},onEnd:l(ZB.DragEnd),onCancel:l(ZB.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ne.current;let i=null;if(t&&o){const{cancelDrop:l}=_.current;if(i={activatorEvent:a,active:t,collisions:n,delta:o,over:r},e===ZB.DragEnd&&"function"==typeof l){await Promise.resolve(l(i))&&(e=ZB.DragCancel)}}T.current=null,S((()=>{C({type:e}),I(iP.Uninitialized),Ce(null),F(null),H(null),Me.current=null;const t=e===ZB.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=_.current[t];null==e||e(i),k({type:t,event:i})}}))}}Me.current=i}),[L]),Ie=o(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=L.get(r);if(null!==T.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},T.current=r,Re(n,t))}),[L,Re]),Oe=function(e,t){return s((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(p,Ie);!function(e){d((()=>{if(!oB)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(p),fB((()=>{ee&&R===iP.Initializing&&I(iP.Initialized)}),[ee,R]),d((()=>{const{onDragMove:e}=_.current,{active:t,activatorEvent:n,collisions:r,over:o}=ne.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:we.x,y:we.y},over:o};S((()=>{null==e||e(a),k({type:"onDragMove",event:a})}))}),[we.x,we.y]),d((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ne.current;if(!e||null==T.current||!t||!o)return;const{onDragOver:a}=_.current,i=r.get(xe),l=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};S((()=>{Ce(l),null==a||a(s),k({type:"onDragOver",event:s})}))}),[xe]),fB((()=>{ne.current={activatorEvent:P,active:V,activeNode:K,collisionRect:be,collisions:ye,droppableRects:q,draggableNodes:L,draggingNode:ae,draggingNodeRect:ie,droppableContainers:j,over:Ee,scrollableAncestors:ue,scrollAdjustedTranslate:we},Z.current={initial:ie,translated:be}}),[V,K,ye,be,L,ae,ie,q,j,Ee,ue,we]),ZF({...Q,delta:N,draggingRect:be,pointerCoordinates:me,scrollableAncestors:ue,scrollableAncestorRects:fe});const Ae=s((()=>({active:V,activeNode:K,activeNodeRect:ee,activatorEvent:P,collisions:ye,containerNodeRect:te,dragOverlay:oe,draggableNodes:L,droppableContainers:j,droppableRects:q,over:Ee,measureDroppableContainers:G,scrollableAncestors:ue,scrollableAncestorRects:fe,measuringConfiguration:$,measuringScheduled:Y,windowRect:de})),[V,K,ee,P,ye,te,oe,L,j,q,Ee,G,ue,fe,$,Y,de]),Le=s((()=>({activatorEvent:P,activators:Oe,active:V,activeNodeRect:ee,ariaDescribedById:{draggable:W},dispatch:C,draggableNodes:L,over:Ee,measureDroppableContainers:G})),[P,Oe,V,ee,C,W,L,Ee,G]);return t.createElement(SB.Provider,{value:M},t.createElement(eP.Provider,{value:Le},t.createElement(tP.Provider,{value:Ae},t.createElement(aP.Provider,{value:ke},m)),t.createElement(oP,{disabled:!1===(null==f?void 0:f.restoreFocus)})),t.createElement(DB,{...f,hiddenTextDescribedById:W}))})),sP=i(null),cP="button";function dP(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=bB("Draggable"),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:f,draggableNodes:h,over:m}=a(eP),{role:p=cP,roleDescription:g="draggable",tabIndex:v=0}=null!=o?o:{},w=(null==d?void 0:d.id)===t,b=a(w?aP:sP),[y,x]=gB(),[E,C]=gB(),k=function(e,t){return s((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(l,t),M=mB(n);fB((()=>(h.set(t,{id:t,key:i,node:y,activatorNode:E,data:M}),()=>{const e=h.get(t);e&&e.key===i&&h.delete(t)})),[h,t]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:s((()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!w||p!==cP)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[r,p,v,w,g,f.draggable]),isDragging:w,listeners:r?void 0:k,node:y,over:m,setNodeRef:x,setActivatorNodeRef:C,transform:b}}const uP={timeout:25};const fP=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},hP=e=>{let{transform:t}=e;return{...t,x:0}};function mP(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function pP(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function gP(e){return null!==e&&e>=0}const vP=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=mP(t,r,n),i=t[o],l=a[o];return l&&i?{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}:null},wP={scaleX:1,scaleY:1},bP=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const l=null!=(t=a[n])?t:r;if(!l)return null;if(o===n){const e=a[i];return e?{x:0,y:n<i?e.top+e.height-(l.top+l.height):e.top-l.top,...wP}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):a?a.top-(r.top+r.height):0;return a?a.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(a,o,n);return o>n&&o<=i?{x:0,y:-l.height-s,...wP}:o<n&&o>=i?{x:0,y:l.height+s,...wP}:{x:0,y:0,...wP}};const yP="Sortable",xP=t.createContext({activeIndex:-1,containerId:yP,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vP,disabled:{draggable:!1,droppable:!1}});function EP(e){let{children:n,id:o,items:i,strategy:l=vP,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:h,over:m,measureDroppableContainers:p}=a(tP),g=bB(yP,o),v=Boolean(null!==f.rect),w=s((()=>i.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[i]),b=null!=u,y=u?w.indexOf(u.id):-1,x=m?w.indexOf(m.id):-1,E=r(w),C=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(w,E.current),k=-1!==x&&-1===y||C,M=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);fB((()=>{C&&b&&p(w)}),[C,w,b,p]),d((()=>{E.current=w}),[w]);const R=s((()=>({activeIndex:y,containerId:g,disabled:M,disableTransforms:k,items:w,overIndex:x,useDragOverlay:v,sortedRects:pP(w,h),strategy:l})),[y,g,M.draggable,M.droppable,k,w,x,h,v,l]);return t.createElement(xP.Provider,{value:R},n)}const CP=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return mP(n,r,o).indexOf(t)},kP=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r)&&((l===a||o!==i)&&(!!n||i!==o&&t===s))},MP={duration:200,easing:"ease"},RP="transform",IP=MB.Transition.toString({property:RP,duration:0,easing:"linear"}),OP={roleDescription:"sortable"};function AP(e){let{animateLayoutChanges:t=kP,attributes:n,disabled:i,data:l,getNewIndex:u=CP,id:f,strategy:h,resizeObserverConfig:m,transition:p=MP}=e;const{items:g,containerId:v,activeIndex:w,disabled:b,disableTransforms:y,sortedRects:x,overIndex:E,useDragOverlay:C,strategy:k}=a(xP),M=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(i,b),R=g.indexOf(f),I=s((()=>({sortable:{containerId:v,index:R,items:g},...l})),[v,l,R,g]),O=s((()=>g.slice(g.indexOf(f))),[g,f]),{rect:A,node:L,isOver:S,setNodeRef:N}=function(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:l}=e;const s=bB("Droppable"),{active:c,dispatch:u,over:f,measureDroppableContainers:h}=a(eP),m=r({disabled:n}),p=r(!1),g=r(null),v=r(null),{disabled:w,updateMeasurementsFor:b,timeout:y}={...uP,...l},x=mB(null!=b?b:i),E=HF({callback:o((()=>{p.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{h(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),y)):p.current=!0}),[y]),disabled:w||!c}),C=o(((e,t)=>{E&&(t&&(E.unobserve(t),p.current=!1),e&&E.observe(e))}),[E]),[k,M]=gB(C),R=mB(t);return d((()=>{E&&k.current&&(E.disconnect(),p.current=!1,E.observe(k.current))}),[k,E]),d((()=>(u({type:ZB.RegisterDroppable,element:{id:i,key:s,disabled:n,node:k,rect:g,data:R}}),()=>u({type:ZB.UnregisterDroppable,key:s,id:i}))),[i]),d((()=>{n!==m.current.disabled&&(u({type:ZB.SetDroppableDisabled,id:i,key:s,disabled:n}),m.current.disabled=n)}),[i,s,n,u]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===i,node:k,over:f,setNodeRef:M}}({id:f,data:I,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...m}}),{active:j,activatorEvent:D,activeNodeRect:Z,attributes:V,setNodeRef:T,listeners:B,isDragging:F,over:P,setActivatorNodeRef:H,transform:_}=dP({id:f,data:I,attributes:{...OP,...n},disabled:M.draggable}),W=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>e=>{t.forEach((t=>t(e)))}),t)}(N,T),z=Boolean(j),$=z&&!y&&gP(w)&&gP(E),U=!C&&F,q=U&&$?_:null,G=$?null!=q?q:(null!=h?h:k)({rects:x,activeNodeRect:Z,activeIndex:w,overIndex:E,index:R}):null,Y=gP(w)&&gP(E)?u({id:f,items:g,activeIndex:w,overIndex:E}):R,K=null==j?void 0:j.id,X=r({activeId:K,items:g,newIndex:Y,containerId:v}),Q=g!==X.current.items,J=t({active:j,containerId:v,isDragging:F,isSorting:z,id:f,index:R,items:g,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:p,wasDragging:null!=X.current.activeId}),ee=function(e){let{disabled:t,index:n,node:o,rect:a}=e;const[i,l]=c(null),s=r(n);return fB((()=>{if(!t&&n!==s.current&&o.current){const e=a.current;if(e){const t=JB(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&l(n)}}n!==s.current&&(s.current=n)}),[t,n,o,a]),d((()=>{i&&l(null)}),[i]),i}({disabled:!J,index:R,node:L,rect:A});return d((()=>{z&&X.current.newIndex!==Y&&(X.current.newIndex=Y),v!==X.current.containerId&&(X.current.containerId=v),g!==X.current.items&&(X.current.items=g)}),[z,Y,v,g]),d((()=>{if(K===X.current.activeId)return;if(null!=K&&null==X.current.activeId)return void(X.current.activeId=K);const e=setTimeout((()=>{X.current.activeId=K}),50);return()=>clearTimeout(e)}),[K]),{active:j,activeIndex:w,attributes:V,data:I,rect:A,index:R,newIndex:Y,items:g,isOver:S,isSorting:z,isDragging:F,listeners:B,node:L,overIndex:E,over:P,setNodeRef:W,setActivatorNodeRef:H,setDroppableNodeRef:N,setDraggableNodeRef:T,transform:null!=ee?ee:G,transition:function(){if(ee||Q&&X.current.newIndex===R)return IP;if(U&&!CB(D)||!p)return;if(z||J)return MB.Transition.toString({...p,property:RP});return}()}}function LP(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const SP=[bF.Down,bF.Right,bF.Up,bF.Left],NP=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:l}}=t;if(SP.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];a.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const a=o.get(n.id);if(a)switch(e.code){case bF.Down:r.top<a.top&&t.push(n);break;case bF.Up:r.top>a.top&&t.push(n);break;case bF.Left:r.left>a.left&&t.push(n);break;case bF.Right:r.left<a.left&&t.push(n)}}));const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=WB(t),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=WB(r),i=o.reduce(((e,t,r)=>e+PB(n[r],t)),0),l=Number((i/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:l}})}}return a.sort(HB)})({collisionRect:r,droppableRects:o,droppableContainers:t});let c=zB(s,"id");if(c===(null==i?void 0:i.id)&&s.length>1&&(c=s[1].id),null!=c){const e=a.get(n.id),t=a.get(c),i=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=tF(s).some(((e,t)=>l[t]!==e)),o=jP(e,t),a=function(e,t){if(!LP(e)||!LP(t))return!1;if(!jP(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!o?{x:0,y:0}:{x:a?r.width-i.width:0,y:a?r.height-i.height:0},d={x:i.left,y:i.top};return c.x&&c.y?d:EB(d,c)}}}};function jP(e,t){return!(!LP(e)||!LP(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var DP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function ZP(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}function VP(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function TP(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},VP(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}var BP=e.createContext(void 0);function FP(t){const n=e.useContext(BP);return t||n||"ltr"}var PP,HP="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",WP="dismissableLayer.focusOutside",zP=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$P=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(zP),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){qP(_P,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){qP(WP,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(PP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),UP(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=PP)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),UP())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(HP,e),()=>document.removeEventListener(HP,e)}),[]),E(DP.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));$P.displayName="DismissableLayer";function UP(){const e=new CustomEvent(HP);document.dispatchEvent(e)}function qP(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ZP(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(zP),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(DP.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var GP="focusScope.autoFocusOnMount",YP="focusScope.autoFocusOnUnmount",KP={bubbles:!1,cancelable:!0},XP=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:tH(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||tH(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&tH(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){nH.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(GP,KP);s.addEventListener(GP,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tH(r,{select:t}),document.activeElement!==n)return}((e=QP(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&tH(s))}return()=>{s.removeEventListener(GP,d),setTimeout((()=>{const e=new CustomEvent(YP,KP);s.addEventListener(YP,u),s.dispatchEvent(e),e.defaultPrevented||tH(t??document.body,{select:!0}),s.removeEventListener(YP,u),nH.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=QP(e),n=JP(t,e),r=JP(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&tH(a,{select:!0})):(e.preventDefault(),r&&tH(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(DP.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function QP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JP(e,t){for(const n of e)if(!eH(n,{upTo:t}))return n}function eH(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function tH(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}XP.displayName="FocusScope";var nH=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=rH(e,t),e.unshift(t)},remove(t){e=rH(e,t),e[0]?.resume()}}}();function rH(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var oH=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(DP.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));oH.displayName="Arrow";var aH=oH;function iH(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var lH="Popper",[sH,cH]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},iH(o,...n)]}(lH),[dH,uH]=sH(lH),fH=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(dH,{scope:n,anchor:o,onAnchorChange:a,children:r})};fH.displayName=lH;var hH="PopperAnchor",mH=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=uH(hH,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(DP.div,{...a,ref:s})}));mH.displayName=hH;var pH="PopperContent",[gH,vH]=sH(pH),wH=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=uH(pH,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(EH),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),CH({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=kH(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(gH,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(DP.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));wH.displayName=pH;var bH="PopperArrow",yH={top:"bottom",right:"left",bottom:"top",left:"right"},xH=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=vH(bH,n),a=yH[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E(aH,{...r,ref:t,style:{...r.style,display:"block"}})})}));function EH(e){return null!==e}xH.displayName=bH;var CH=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=kH(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function kH(e){const[t,n="center"]=e.split("-");return[t,n]}var MH=fH,RH=mH,IH=wH,OH=xH,AH=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(DP.div,{...o,ref:n}),l):null}));AH.displayName="Portal";var LH=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=SH(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=SH(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=SH(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=SH(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function SH(e){return e?.animationName||"none"}function NH(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}LH.displayName="Presence";var jH="rovingFocusGroup.onEntryFocus",DH={bubbles:!1,cancelable:!0},ZH="RovingFocusGroup",[VH,TH,BH]=TP(ZH),[FH,PH]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},NH(o,...n)]}(ZH,[BH]),[HH,_H]=FH(ZH),WH=e.forwardRef(((e,t)=>E(VH.Provider,{scope:e.__scopeRovingFocusGroup,children:E(VH.Slot,{scope:e.__scopeRovingFocusGroup,children:E(zH,{...e,ref:t})})})));WH.displayName=ZH;var zH=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=t,h=e.useRef(null),m=tL(n,h),p=FP(i),[g=null,v]=iL({prop:l,defaultProp:s,onChange:c}),[w,b]=e.useState(!1),y=aL(d),x=TH(r),C=e.useRef(!1),[k,M]=e.useState(0);return e.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(jH,y),()=>e.removeEventListener(jH,y)}),[y]),E(HH,{scope:r,orientation:o,dir:p,loop:a,currentTabStopId:g,onItemFocus:e.useCallback((e=>v(e)),[v]),onItemShiftTab:e.useCallback((()=>b(!0)),[]),onFocusableItemAdd:e.useCallback((()=>M((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>M((e=>e-1))),[]),children:E(DP.div,{tabIndex:w||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:oL(t.onMouseDown,(()=>{C.current=!0})),onFocus:oL(t.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(jH,DH);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));GH([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}C.current=!1})),onBlur:oL(t.onBlur,(()=>b(!1)))})})})),$H="RovingFocusGroupItem",UH=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:i,...l}=t,s=Gj(),c=i||s,d=_H($H,r),u=d.currentTabStopId===c,f=TH(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return e.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),E(VH.ItemSlot,{scope:r,id:c,focusable:o,active:a,children:E(DP.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:oL(t.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:oL(t.onFocus,(()=>d.onItemFocus(c))),onKeyDown:oL(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:qH[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=d.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>GH(n)))}}))})})}));UH.displayName=$H;var qH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GH(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var YH=WH,KH=UH,XH=["Enter"," "],QH=["ArrowUp","PageDown","End"],JH=["ArrowDown","PageUp","Home",...QH],e_={ltr:[...XH,"ArrowRight"],rtl:[...XH,"ArrowLeft"]},t_={ltr:["ArrowLeft"],rtl:["ArrowRight"]},n_="Menu",[r_,o_,a_]=TP(n_),[i_,l_]=nL(n_,[a_,cH,PH]),s_=cH(),c_=PH(),[d_,u_]=i_(n_),[f_,h_]=i_(n_),m_=t=>{const{__scopeMenu:n,open:r=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=t,s=s_(n),[c,d]=e.useState(null),u=e.useRef(!1),f=aL(i),h=FP(a);return e.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),E(MH,{...s,children:E(d_,{scope:n,open:r,onOpenChange:f,content:c,onContentChange:d,children:E(f_,{scope:n,onClose:e.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:u,dir:h,modal:l,children:o})})})};m_.displayName=n_;var p_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=s_(n);return E(RH,{...o,...r,ref:t})}));p_.displayName="MenuAnchor";var g_="MenuPortal",[v_,w_]=i_(g_,{forceMount:void 0}),b_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=u_(g_,t);return E(v_,{scope:t,forceMount:n,children:E(LH,{present:n||a.open,children:E(AH,{asChild:!0,container:o,children:r})})})};b_.displayName=g_;var y_="MenuContent",[x_,E_]=i_(y_),C_=e.forwardRef(((e,t)=>{const n=w_(y_,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=u_(y_,e.__scopeMenu),i=h_(y_,e.__scopeMenu);return E(r_.Provider,{scope:e.__scopeMenu,children:E(LH,{present:r||a.open,children:E(r_.Slot,{scope:e.__scopeMenu,children:i.modal?E(k_,{...o,ref:t}):E(M_,{...o,ref:t})})})})})),k_=e.forwardRef(((t,n)=>{const r=u_(y_,t.__scopeMenu),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(R_,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),M_=e.forwardRef(((e,t)=>{const n=u_(y_,e.__scopeMenu);return E(R_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),R_=e.forwardRef(((t,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:p,...g}=t,v=u_(y_,r),w=h_(y_,r),b=s_(r),y=c_(r),x=o_(r),[C,k]=e.useState(null),M=e.useRef(null),R=tL(n,M,v.onContentChange),I=e.useRef(0),O=e.useRef(""),A=e.useRef(0),L=e.useRef(null),S=e.useRef("right"),N=e.useRef(0),j=p?mZ:e.Fragment,D=p?{as:fL,allowPinchZoom:!0}:void 0,Z=e=>{const t=O.current+e,n=x().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(e,Math.max(a,0));1===o.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return l!==n?l:void 0}(n.map((e=>e.textValue)),t,o),i=n.find((e=>e.textValue===a))?.ref.current;!function e(t){O.current=t,window.clearTimeout(I.current),""!==t&&(I.current=window.setTimeout((()=>e("")),1e3))}(t),i&&setTimeout((()=>i.focus()))};e.useEffect((()=>()=>window.clearTimeout(I.current)),[]),Dj();const V=e.useCallback((e=>S.current===L.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e].x,l=t[e].y,s=t[a].x,c=t[a].y;l>r!=c>r&&n<(s-i)*(r-l)/(c-l)+i&&(o=!o)}return o}(n,t)}(e,L.current?.area)),[]);return E(x_,{scope:r,searchRef:O,onItemEnter:e.useCallback((e=>{V(e)&&e.preventDefault()}),[V]),onItemLeave:e.useCallback((e=>{V(e)||(M.current?.focus(),k(null))}),[V]),onTriggerLeave:e.useCallback((e=>{V(e)&&e.preventDefault()}),[V]),pointerGraceTimerRef:A,onPointerGraceIntentChange:e.useCallback((e=>{L.current=e}),[]),children:E(j,{...D,children:E(XP,{asChild:!0,trapped:a,onMountAutoFocus:oL(i,(e=>{e.preventDefault(),M.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:E($P,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:E(YH,{asChild:!0,...y,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:oL(c,(e=>{w.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:E(IH,{role:"menu","aria-orientation":"vertical","data-state":eW(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...g,ref:R,style:{outline:"none",...g.style},onKeyDown:oL(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&Z(e.key));const o=M.current;if(e.target!==o)return;if(!JH.includes(e.key))return;e.preventDefault();const a=x().filter((e=>!e.disabled)).map((e=>e.ref.current));QH.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)})),onBlur:oL(t.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(I.current),O.current="")})),onPointerMove:oL(t.onPointerMove,rW((e=>{const t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>N.current?"right":"left";S.current=t,N.current=e.clientX}})))})})})})})})}));C_.displayName=y_;var I_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{role:"group",...r,ref:t})}));I_.displayName="MenuGroup";var O_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{...r,ref:t})}));O_.displayName="MenuLabel";var A_="MenuItem",L_="menu.itemSelect",S_=e.forwardRef(((t,n)=>{const{disabled:r=!1,onSelect:o,...a}=t,i=e.useRef(null),l=h_(A_,t.__scopeMenu),s=E_(A_,t.__scopeMenu),c=tL(n,i),d=e.useRef(!1);return E(N_,{...a,ref:c,disabled:r,onClick:oL(t.onClick,(()=>{const e=i.current;if(!r&&e){const t=new CustomEvent(L_,{bubbles:!0,cancelable:!0});e.addEventListener(L_,(e=>o?.(e)),{once:!0}),ZP(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:e=>{t.onPointerDown?.(e),d.current=!0},onPointerUp:oL(t.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:oL(t.onKeyDown,(e=>{const t=""!==s.searchRef.current;r||t&&" "===e.key||XH.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));S_.displayName=A_;var N_=e.forwardRef(((t,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:a,...i}=t,l=E_(A_,r),s=c_(r),c=e.useRef(null),d=tL(n,c),[u,f]=e.useState(!1),[h,m]=e.useState("");return e.useEffect((()=>{const e=c.current;e&&m((e.textContent??"").trim())}),[i.children]),E(r_.ItemSlot,{scope:r,disabled:o,textValue:a??h,children:E(KH,{asChild:!0,...s,focusable:!o,children:E(DP.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:oL(t.onPointerMove,rW((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:oL(t.onPointerLeave,rW((e=>l.onItemLeave(e)))),onFocus:oL(t.onFocus,(()=>f(!0))),onBlur:oL(t.onBlur,(()=>f(!1)))})})})})),j_=e.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return E(H_,{scope:e.__scopeMenu,checked:n,children:E(S_,{role:"menuitemcheckbox","aria-checked":tW(n)?"mixed":n,...o,ref:t,"data-state":nW(n),onSelect:oL(o.onSelect,(()=>r?.(!!tW(n)||!n)),{checkForDefaultPrevented:!1})})})}));j_.displayName="MenuCheckboxItem";var D_="MenuRadioGroup",[Z_,V_]=i_(D_,{value:void 0,onValueChange:()=>{}}),T_=e.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=aL(r);return E(Z_,{scope:e.__scopeMenu,value:n,onValueChange:a,children:E(I_,{...o,ref:t})})}));T_.displayName=D_;var B_="MenuRadioItem",F_=e.forwardRef(((e,t)=>{const{value:n,...r}=e,o=V_(B_,e.__scopeMenu),a=n===o.value;return E(H_,{scope:e.__scopeMenu,checked:a,children:E(S_,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":nW(a),onSelect:oL(r.onSelect,(()=>o.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));F_.displayName=B_;var P_="MenuItemIndicator",[H_,__]=i_(P_,{checked:!1}),W_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=__(P_,n);return E(LH,{present:r||tW(a.checked)||!0===a.checked,children:E(DP.span,{...o,ref:t,"data-state":nW(a.checked)})})}));W_.displayName=P_;var z_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));z_.displayName="MenuSeparator";var $_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=s_(n);return E(OH,{...o,...r,ref:t})}));$_.displayName="MenuArrow";var U_="MenuSub",[q_,G_]=i_(U_),Y_=t=>{const{__scopeMenu:n,children:r,open:o=!1,onOpenChange:a}=t,i=u_(U_,n),l=s_(n),[s,c]=e.useState(null),[d,u]=e.useState(null),f=aL(a);return e.useEffect((()=>(!1===i.open&&f(!1),()=>f(!1))),[i.open,f]),E(MH,{...l,children:E(d_,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:E(q_,{scope:n,contentId:Gj(),triggerId:Gj(),trigger:s,onTriggerChange:c,children:r})})})};Y_.displayName=U_;var K_="MenuSubTrigger",X_=e.forwardRef(((t,n)=>{const r=u_(K_,t.__scopeMenu),o=h_(K_,t.__scopeMenu),a=G_(K_,t.__scopeMenu),i=E_(K_,t.__scopeMenu),l=e.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},u=e.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return e.useEffect((()=>u),[u]),e.useEffect((()=>{const e=s.current;return()=>{window.clearTimeout(e),c(null)}}),[s,c]),E(p_,{asChild:!0,...d,children:E(N_,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":eW(r.open),...t,ref:eL(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:oL(t.onPointerMove,rW((e=>{i.onItemEnter(e),e.defaultPrevented||t.disabled||r.open||l.current||(i.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),u()}),100))}))),onPointerLeave:oL(t.onPointerLeave,rW((e=>{u();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,a=o?-5:5,l=t[o?"left":"right"],c=t[o?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:l,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:l,y:t.bottom}],side:n}),window.clearTimeout(s.current),s.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:oL(t.onKeyDown,(e=>{const n=""!==i.searchRef.current;t.disabled||n&&" "===e.key||e_[o.dir].includes(e.key)&&(r.onOpenChange(!0),r.content?.focus(),e.preventDefault())}))})})}));X_.displayName=K_;var Q_="MenuSubContent",J_=e.forwardRef(((t,n)=>{const r=w_(y_,t.__scopeMenu),{forceMount:o=r.forceMount,...a}=t,i=u_(y_,t.__scopeMenu),l=h_(y_,t.__scopeMenu),s=G_(Q_,t.__scopeMenu),c=e.useRef(null),d=tL(n,c);return E(r_.Provider,{scope:t.__scopeMenu,children:E(LH,{present:o||i.open,children:E(r_.Slot,{scope:t.__scopeMenu,children:E(R_,{id:s.contentId,"aria-labelledby":s.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:oL(t.onFocusOutside,(e=>{e.target!==s.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:oL(t.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:oL(t.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=t_[l.dir].includes(e.key);t&&n&&(i.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())}))})})})})}));function eW(e){return e?"open":"closed"}function tW(e){return"indeterminate"===e}function nW(e){return tW(e)?"indeterminate":e?"checked":"unchecked"}function rW(e){return t=>"mouse"===t.pointerType?e(t):void 0}J_.displayName=Q_;var oW=m_,aW=p_,iW=b_,lW=C_,sW=I_,cW=O_,dW=S_,uW=j_,fW=T_,hW=F_,mW=W_,pW=z_,gW=$_,vW=Y_,wW=X_,bW=J_,yW="DropdownMenu",[xW]=nL(yW,[l_]),EW=l_(),[CW,kW]=xW(yW),MW=t=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:s=!0}=t,c=EW(n),d=e.useRef(null),[u=!1,f]=iL({prop:a,defaultProp:i,onChange:l});return E(CW,{scope:n,triggerId:Gj(),triggerRef:d,contentId:Gj(),open:u,onOpenChange:f,onOpenToggle:e.useCallback((()=>f((e=>!e))),[f]),modal:s,children:E(oW,{...c,open:u,onOpenChange:f,dir:o,modal:s,children:r})})};MW.displayName=yW;var RW="DropdownMenuTrigger",IW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=kW(RW,n),i=EW(n);return E(aW,{asChild:!0,...i,children:E(DP.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:eL(t,a.triggerRef),onPointerDown:oL(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())})),onKeyDown:oL(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));IW.displayName=RW;var OW=e=>{const{__scopeDropdownMenu:t,...n}=e,r=EW(t);return E(iW,{...r,...n})};OW.displayName="DropdownMenuPortal";var AW="DropdownMenuContent",LW=e.forwardRef(((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,a=kW(AW,r),i=EW(r),l=e.useRef(!1);return E(lW,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:n,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:oL(t.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(l.current=!0)})),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));LW.displayName=AW;var SW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(sW,{...o,...r,ref:t})}));SW.displayName="DropdownMenuGroup";var NW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(cW,{...o,...r,ref:t})}));NW.displayName="DropdownMenuLabel";var jW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(dW,{...o,...r,ref:t})}));jW.displayName="DropdownMenuItem";var DW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(uW,{...o,...r,ref:t})}));DW.displayName="DropdownMenuCheckboxItem";var ZW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(fW,{...o,...r,ref:t})}));ZW.displayName="DropdownMenuRadioGroup";var VW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(hW,{...o,...r,ref:t})}));VW.displayName="DropdownMenuRadioItem";var TW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(mW,{...o,...r,ref:t})}));TW.displayName="DropdownMenuItemIndicator";var BW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(pW,{...o,...r,ref:t})}));BW.displayName="DropdownMenuSeparator";e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(gW,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var FW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(wW,{...o,...r,ref:t})}));FW.displayName="DropdownMenuSubTrigger";var PW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(bW,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));PW.displayName="DropdownMenuSubContent";var HW=OW,_W=LW,WW=NW,zW=jW,$W=DW,UW=VW,qW=TW,GW=BW,YW=FW,KW=PW;const XW=MW,QW=IW,JW=SW,ez=HW,tz=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,i=EW(t),[l=!1,s]=iL({prop:r,defaultProp:a,onChange:o});return E(vW,{...i,open:l,onOpenChange:s,children:n})},nz=ZW,rz=e.forwardRef(((e,t)=>{var{className:n,inset:r,children:o}=e,a=IC(e,["className","inset","children"]);return C(YW,Object.assign({ref:t,className:LC("relative flex gap-4 cursor-pointer select-none box-border items-center py-4 pl-4 pr-4 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",r&&"pl-8",n)},a,{children:[o,E(Ek,{type:"heroicons",name:"chevron-right",className:"ml-auto h-4 w-4"})]}))}));rz.displayName=YW.displayName;const oz=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KW,Object.assign({ref:t,className:LC("z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},r,{style:Object.assign({boxShadow:"var(--dropdown-menu-shadow)"},r.style)}))}));oz.displayName=KW.displayName;const az=e.forwardRef(((e,t)=>{var{className:n,sideOffset:r=4}=e,o=IC(e,["className","sideOffset"]);return E(HW,{children:E(_W,Object.assign({ref:t,sideOffset:r,className:LC("z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},o,{style:Object.assign({boxShadow:"var(--dropdown-menu-shadow)"},o.style)}))})}));az.displayName=_W.displayName;const iz=e.forwardRef(((e,t)=>{var{className:n,inset:r,selected:o,icon:a,children:i}=e,l=IC(e,["className","inset","selected","icon","children"]);const s=!!a;return C(zW,Object.assign({ref:t,className:LC("relative flex cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]",o&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)] typography-subtitle5","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",r&&"pl-8",n,s?"gap-4":"gap-1")},l,{children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4 flex items-center justify-center",children:o&&E(Ek,{type:"heroicons",name:"check",className:"size-4 text-[var(--dropdown-menu-selected-text)]"})}),a]}),i]}))}));iz.displayName=zW.displayName;const lz=e.forwardRef(((e,t)=>{var{className:n,children:r,checked:o,disabled:a}=e,i=IC(e,["className","children","checked","disabled"]);return C($W,Object.assign({ref:t,className:LC("relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",n),checked:o,disabled:a},i,{children:[E("span",{className:LC("shrink-0 size-4 rounded-[2px] border flex items-center justify-center transition-all overflow-hidden",o&&!a&&"bg-[var(--dropdown-menu-checkbox-checked-bg)] border-[var(--dropdown-menu-checkbox-checked-bg)]",o&&a&&"bg-[var(--dropdown-menu-checkbox-disabled-checked-bg)] border-transparent",!o&&a&&"border-[var(--dropdown-menu-checkbox-disabled-border)]",!o&&!a&&"border-[var(--dropdown-menu-checkbox-border)]"),children:E(qW,{children:E(Ek,{type:"heroicons",name:"check",className:"size-3 text-[var(--dropdown-menu-checkbox-checked-icon)]"})})}),r]}))}));lz.displayName=$W.displayName;const sz=e.forwardRef(((e,t)=>{var{className:n,children:r,disabled:o,icon:a}=e,i=IC(e,["className","children","disabled","icon"]);const l=!!a;return C(UW,Object.assign({ref:t,className:LC("relative flex cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-radio-disabled-text)]","data-[state='checked']:data-[disabled]:!text-[var(--dropdown-menu-radio-selected-disabled-text)]",n,l?"gap-4":"gap-1")},i,{disabled:o,children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4",children:E(qW,{className:"shrink-0",children:E(Ek,{type:"heroicons",name:"check",className:LC("size-4",o?"text-[var(--dropdown-menu-radio-selected-disabled-text)]":"text-[var(--dropdown-menu-selected-text)]")})})}),a]}),r]}))}));sz.displayName=UW.displayName;const cz=e.forwardRef(((e,t)=>{var{className:n,inset:r}=e,o=IC(e,["className","inset"]);return E(WW,Object.assign({ref:t,className:LC("px-3 py-2 typography-small4 text-text-g-contrast-high",r&&"pl-8",n)},o))}));cz.displayName=WW.displayName;const dz=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(GW,Object.assign({ref:t,className:LC("h-px bg-[var(--dropdown-menu-seperator-bg)]",n)},r))}));dz.displayName=GW.displayName;const uz=e=>{var{className:t}=e,n=IC(e,["className"]);return E("span",Object.assign({className:LC("ml-auto text-xs tracking-widest opacity-60",t)},n))};uz.displayName="DropdownMenuShortcut";var fz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),hz="Switch",[mz]=nL(hz),[pz,gz]=mz(hz),vz=e.forwardRef(((t,n)=>{const{__scopeSwitch:r,name:o,checked:a,defaultChecked:i,required:l,disabled:s,value:c="on",onCheckedChange:d,form:u,...f}=t,[h,m]=e.useState(null),p=tL(n,(e=>m(e))),g=e.useRef(!1),v=!h||(u||!!h.closest("form")),[w=!1,b]=iL({prop:a,defaultProp:i,onChange:d});return C(pz,{scope:r,checked:w,disabled:s,children:[E(fz.button,{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":xz(w),"data-disabled":s?"":void 0,disabled:s,value:c,...f,ref:p,onClick:oL(t.onClick,(e=>{b((e=>!e)),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())}))}),v&&E(yz,{control:h,bubbles:!g.current,name:o,value:c,checked:w,required:l,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})}));vz.displayName=hz;var wz="SwitchThumb",bz=e.forwardRef(((e,t)=>{const{__scopeSwitch:n,...r}=e,o=gz(wz,n);return E(fz.span,{"data-state":xz(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})}));bz.displayName=wz;var yz=t=>{const{control:n,checked:r,bubbles:o=!0,...a}=t,i=e.useRef(null),l=lL(r),s=cL(n);return e.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),E("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function xz(e){return e?"checked":"unchecked"}var Ez=vz,Cz=bz;const kz=M(["group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center overflow-visible px-1","before:pointer-events-none before:absolute before:left-1 before:top-1/2 before:h-3 before:w-8 before:-translate-y-1/2 before:rounded-full before:transition-colors","data-[state=unchecked]:before:bg-[var(--switch-default-color)] hover:data-[state=unchecked]:before:bg-[var(--switch-hover-color)]","data-[state=checked]:before:bg-[var(--switch-active-color)] hover:data-[state=checked]:before:bg-[var(--switch-active-hover-color)]","data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:before:!bg-[var(--switch-disabled-color)]"],{variants:{forceHover:{true:"data-[state=unchecked]:before:bg-[var(--switch-hover-color)] data-[state=checked]:before:bg-[var(--switch-active-hover-color)]",false:""}},defaultVariants:{forceHover:!1}}),Mz=M(["relative isolate block size-4 rounded-full [filter:var(--switch-thumb-filter)] transition-[transform,background-color,color,filter]","data-[state=unchecked]:bg-[var(--switch-thumb-default-color)] data-[state=unchecked]:translate-x-0","data-[state=checked]:bg-[var(--switch-thumb-active-color)] data-[state=checked]:translate-x-4","data-[state=unchecked]:text-[var(--state-tertiary-hover-bg)] data-[state=checked]:text-[var(--state-primary-hover-bg)]","group-hover:[&_.switch-thumb-halo]:opacity-100 group-hover:data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)] group-hover:data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)]","group-disabled:!bg-[var(--switch-thumb-disabled-color)] group-disabled:[&_.switch-thumb-halo]:opacity-0"],{variants:{forceHover:{true:"[&_.switch-thumb-halo]:opacity-100 data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)] data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)]",false:""}},defaultVariants:{forceHover:!1}}),Rz=M(["switch-thumb-halo pointer-events-none absolute left-0 top-0.5 -z-10 block size-6 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity"]),Iz=e.forwardRef(((e,t)=>{var{className:n,forceHover:r=!1}=e,o=IC(e,["className","forceHover"]);return E(Ez,Object.assign({className:LC(kz({forceHover:r}),n)},o,{ref:t,children:E(Cz,{className:Mz({forceHover:r}),children:E("span",{"aria-hidden":!0,className:Rz(),children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[E("g",{filter:"url(#switch-hover-halo-shadow)",children:E("circle",{cx:"20",cy:"18",r:"12",fill:"currentColor",shapeRendering:"crispEdges"})}),E("defs",{children:C("filter",{id:"switch-hover-halo-shadow",x:"0",y:"0",width:"40",height:"40",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[E("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),E("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),E("feOffset",{dy:"2"}),E("feGaussianBlur",{stdDeviation:"4"}),E("feComposite",{in2:"hardAlpha",operator:"out"}),E("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.568627 0 0 0 0 0.619608 0 0 0 0 0.670588 0 0 0 0.24 0"}),E("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),E("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})]})})]})})})}))}));Iz.displayName=Ez.displayName;const Oz=t.createContext(null);const Az="__edit_ph__";function Lz(e){return{value:`${Az}:${e}`,label:e}}function Sz(e,t){if("number"===e){const e=Number(t);return Number.isNaN(e)?0:e}return"checkbox"===e?"true"===t:t}function Nz(e,t,n,r){return e.onCommit?e.onCommit(t,n):{[r]:Sz(e.editVariant,n)}}function jz({columnId:e,row:t,placeholder:n,autoFocus:r,errorMessage:o,onBlur:a,onKeyDown:i}){var l;const s=String(null!==(l=t.original[e])&&void 0!==l?l:"");return E(mk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:s,placeholder:n,"aria-label":n||e,autoFocus:r,error:!!o,errorMessage:o,onBlur:a,onKeyDown:i,className:"rounded-md px-2 py-2 typography-small2"})}function Dz({row:e,columnId:t,col:n,autoFocus:r,onCommit:o,onBlurField:a,onKeyDown:i,keepOpenAfterSelect:l,errorMessage:c}){var d,u,f,h,m;const p=String(null!==(d=e.original[t])&&void 0!==d?d:""),g="function"==typeof(null===(u=n.editSelectProps)||void 0===u?void 0:u.options)?n.editSelectProps.options(e):null!==(h=null===(f=n.editSelectProps)||void 0===f?void 0:f.options)&&void 0!==h?h:[],v=s((()=>{var e,r;return[Lz(null!==(r=null===(e=n.editSelectProps)||void 0===e?void 0:e.placeholder)&&void 0!==r?r:t),...g]}),[g,null===(m=n.editSelectProps)||void 0===m?void 0:m.placeholder,t]),w=s((()=>{var e;const t=p.trim();return t&&null!==(e=v.find((e=>e.label===t)))&&void 0!==e?e:v[0]}),[p,v]);return E("div",{children:E(JA,{id:`edit-dd-${t}-${e.id}`,options:v,value:w,onSelect:e=>{(function(e){var t;return null!==(t=null==e?void 0:e.value.startsWith(`${Az}:`))&&void 0!==t&&t})(e)||o(e.label)},size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,required:!1,isFloatingLabel:!1,label:"",keepFooterSpace:!1,segmentedInput:!0,autoFocus:r,onBlur:a,onKeyDown:i,keepOpenAfterSelect:l,portal:!0,error:!!c,errorMessage:c,className:LC("rounded-md",XA({size:"sm"}),p.trim().length>0&&"font-medium")})})}function Zz({columnId:e,row:t,col:n,autoFocus:r,errorMessage:o,onBlur:a,onKeyDown:i}){var l;const s=t.original[e],c=""===s||null==s?void 0:Number(s),d=n.editNumberProps;return E(kk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:c,placeholder:null!==(l=null==d?void 0:d.placeholder)&&void 0!==l?l:e,"aria-label":(null==d?void 0:d.placeholder)||e,autoFocus:r,min:null==d?void 0:d.min,max:null==d?void 0:d.max,step:null==d?void 0:d.step,precision:null==d?void 0:d.precision,allowDecimal:null==d?void 0:d.allowDecimal,allowNegative:null==d?void 0:d.allowNegative,hideControls:!0,error:!!o,errorMessage:o,onBlur:e=>a(e.currentTarget.value.trim()),onKeyDown:i,className:"rounded-md px-2 py-2 typography-small2"})}function Vz({columnId:e,row:t,col:n,errorMessage:r,onCommit:o,onKeyDown:a}){var i;const l=t.original[e],s=!0===l||"true"===l,c=null===(i=n.editCheckboxProps)||void 0===i?void 0:i.label;return C("div",{className:"flex flex-col gap-0.5",children:[C("div",{className:"flex items-center gap-2 min-h-[32px]",children:[E(LL,{checked:s,onCheckedChange:e=>{o(!0===e)},onKeyDown:a?e=>a(e):void 0,"aria-label":c||e}),c&&E("span",{className:"typography-small2 text-text-contrast-high select-none",children:c})]}),r&&E("span",{className:"typography-small3 text-error-500",children:r})]})}function Tz({row:e,col:t,columnId:n}){var r,o,a,i,l,s,c,d,u,f,h,m;const p=null!==(r=t.editVariant)&&void 0!==r?r:"text";if("select"===p){const r="function"==typeof(null===(o=t.editSelectProps)||void 0===o?void 0:o.options)?t.editSelectProps.options(e):null!==(i=null===(a=t.editSelectProps)||void 0===a?void 0:a.options)&&void 0!==i?i:[],u=[Lz(null!==(s=null===(l=t.editSelectProps)||void 0===l?void 0:l.placeholder)&&void 0!==s?s:n),...r],f=String(null!==(c=e.original[n])&&void 0!==c?c:""),h=null!==(d=u.find((e=>e.label===f.trim())))&&void 0!==d?d:u[0];return E(JA,{id:`edit-dd-disabled-${n}-${e.id}`,options:u,value:h,onSelect:()=>{},size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,required:!1,isFloatingLabel:!1,label:"",keepFooterSpace:!1,segmentedInput:!0,disabled:!0,className:LC("rounded-md",XA({size:"sm"}))})}if("number"===p){const t=e.original[n],r=""===t||null==t?void 0:Number(t);return E(kk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:r,disabled:!0,hideControls:!0,className:"rounded-md px-2 py-2 typography-small2"})}if("checkbox"===p){const r=e.original[n];return C("div",{className:"flex items-center gap-2 min-h-[32px]",children:[E(LL,{checked:!0===r||"true"===r,disabled:!0}),(null===(u=t.editCheckboxProps)||void 0===u?void 0:u.label)&&E("span",{className:"typography-small2 text-text-g-contrast-medium select-none",children:t.editCheckboxProps.label})]})}const g=String(null!==(f=e.original[n])&&void 0!==f?f:""),v=null!==(m=null===(h=t.editTextProps)||void 0===h?void 0:h.placeholder)&&void 0!==m?m:"";return E(mk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:g,placeholder:v,"aria-label":v||n,disabled:!0,className:"rounded-md px-2 py-2 typography-small2"})}function Bz(e){switch(null==e?void 0:e.align){case"center":return"text-center";case"right":return"text-right";case"left":return"text-left";default:return}}function Fz(e){const{row:t,getSubRows:n,firstDataCellId:r,fixedColStyles:o,flexWidth:a,lockPxExactWidth:i,resizable:l,tableLayout:s,resizableSlackGrowColId:c,cellClassName:d,onCellClick:u}=e;return function(e){const t=[];let n=0;for(;n<e.length;){const r=e[n],o=r.column.columnDef.meta;let a=1;if(null!=(null==o?void 0:o.colSpan)){const e="function"==typeof o.colSpan?o.colSpan(r.row):o.colSpan,t=Math.floor(Number(e));Number.isFinite(t)&&t>=1&&(a=t)}const i=e.length-n,l=Math.min(a,i);t.push({cell:r,colSpan:Math.max(1,l)}),n+=Math.max(1,l)}return t}(t.getVisibleCells()).map((({cell:e,colSpan:f})=>{var h;const m=Boolean(n)&&e.id===r(t),p=l&&"equal"!==s&&!(null!=c&&e.column.id===c);return E(UV,{colSpan:f>1?f:void 0,style:qz(e.column.columnDef,null==o?void 0:o.get(e.column.id),a,i,p?e.column.getSize():void 0),className:LC(Bz(e.column.columnDef.meta),null===(h=e.column.columnDef.meta)||void 0===h?void 0:h.cellClassName,"function"==typeof d?d(e,t):d),onClick:u?n=>u(e,t,n):void 0,children:m?C("div",{className:"flex items-center gap-1",style:{paddingLeft:20*t.depth+"px"},children:[t.getCanExpand()?E("button",{type:"button",onClick:t.getToggleExpandedHandler(),className:"flex items-center justify-center size-5 rounded hover:bg-table-c-hover shrink-0 transition-colors","aria-label":t.getIsExpanded()?"Collapse":"Expand",children:t.getIsExpanded()?E(JC,{className:"size-4"}):E(rk,{className:"size-4"})}):E("span",{className:"size-5 shrink-0"}),qT(e.column.columnDef.cell,e.getContext())]}):qT(e.column.columnDef.cell,e.getContext())},e.id)}))}function Pz({rowId:e}){const{attributes:t,listeners:n,setNodeRef:r,isDragging:o}=AP({id:e});return E(Zk,Object.assign({ref:r},t,n,{variant:"icon",size:"sm",active:o,className:LC("touch-none",o?"cursor-grabbing":"cursor-grab"),"aria-label":"Drag to reorder",children:E(dk,{className:"!size-4"})}))}function Hz(e){var{id:t,children:n}=e,r=IC(e,["id","children"]);const{transform:o,transition:a,isDragging:i,setNodeRef:l}=AP({id:t}),s={transform:MB.Transform.toString(o?Object.assign(Object.assign({},o),{scaleX:1,scaleY:1}):null),transition:a,opacity:i?.5:1,position:"relative",zIndex:i?50:void 0};return E(zV,Object.assign({ref:l,style:s},r,{children:n}))}const _z=["__reorder__","__select__"],Wz=["__actions__"];function zz(e){const t=e.column.columnDef.header;return"string"==typeof t?t:e.column.id}function $z(e,t){var n;const r=null===(n=e.meta)||void 0===n?void 0:n.exactWidth;if(null==r)return;const o=null!=Uz(r),a=t&&o,i="number"==typeof r?`${r}px`:r.trim();return a?{width:i,minWidth:i,maxWidth:i,overflow:"hidden",boxSizing:"border-box"}:{width:r}}function Uz(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim().match(/^(-?\d*\.?\d+)\s*px$/i);return t?parseFloat(t[1]):null}return null}function qz(e,t,n,r,o){const a=$z(e,r);if(a)return a;if(null!=o){const t=e.maxSize;return Object.assign({width:o},null!=t&&t!==Number.MAX_SAFE_INTEGER&&{maxWidth:t})}return t||(n?{width:n}:void 0)}function Gz({col:e,label:t,isLastVisible:n,showReorder:r,showVisibility:o}){var a;const{attributes:i,listeners:l,setNodeRef:s,setActivatorNodeRef:c,transform:d,transition:u,isDragging:f}=AP({id:e.id}),h={transform:f?`translateY(${null!==(a=null==d?void 0:d.y)&&void 0!==a?a:0}px)`:MB.Transform.toString(d),transition:f?void 0:u};return C("div",{ref:s,style:h,className:LC("flex h-14 items-center gap-4 pl-6 pr-8 bg-modal-surface","relative select-none",f&&"z-50 border border-primary-500/40 shadow-[0_8px_24px_-4px_rgba(0,0,0,0.24)] scale-[1.01]"),children:[r&&E(Zk,Object.assign({ref:c},i,l,{variant:"icon",size:"sm",active:f,"aria-label":`Drag to reorder ${t}`,className:LC("shrink-0 touch-none",f?"cursor-grabbing":"cursor-grab"),children:E(dk,{className:"size-[14px]"})})),o&&E(Iz,{checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(t),disabled:n}),E("span",{className:LC("flex-1 typography-subtitle4",f?"text-text-contrast-max":"text-text-g-contrast-high"),children:t})]})}function Yz({table:e,onClose:t,maxListHeight:n=400,options:r={}}){const{reorder:o=!0,visibility:a=!0,hideAll:i=!0,showAll:l=!0}=r,s=e.getAllLeafColumns().filter((e=>e.getCanHide())),c=s.filter((e=>e.getIsVisible())).length,d=e=>{const t=e.columnDef.header;return"string"==typeof t?t:e.id},u=BB(TB(AF),TB(kF,{coordinateGetter:NP}));return C(k,{children:[C("div",{className:"flex items-center gap-2 px-6 pt-4 pb-3 border-b border-modal-line",children:[E("span",{className:"flex-1 typography-subtitle3 text-text-contrast-max",children:"Manage column"}),i&&E(NC,{variant:"text",color:"secondary",size:"sm",disabled:c<=1,onClick:()=>{var e;const t=null!==(e=s.find((e=>e.getIsVisible())))&&void 0!==e?e:s[0];s.forEach((e=>e.toggleVisibility(e.id===t.id)))},children:"Hide all"}),l&&E(NC,{variant:"text",color:"primary",size:"sm",onClick:()=>e.toggleAllColumnsVisible(!0),children:"Show all"}),E(NC,{variant:"outline",color:"primary",size:"sm",onClick:t,children:"Done"})]}),E(lP,{sensors:u,collisionDetection:UB,modifiers:[hP,fP],onDragEnd:t=>{const{active:n,over:r}=t;if(!r||n.id===r.id)return;const o=e.getAllLeafColumns().map((e=>e.id)),a=o.filter((e=>!_z.includes(e)&&!Wz.includes(e))),i=a.indexOf(n.id),l=a.indexOf(r.id);if(-1===i||-1===l)return;const s=o.filter((e=>_z.includes(e))),c=o.filter((e=>Wz.includes(e)));e.setColumnOrder([...s,...mP(a,i,l),...c])},children:E(EP,{items:s.map((e=>e.id)),strategy:bP,children:E("div",{className:"overflow-y-auto ui-scrollbar",style:{maxHeight:n},children:s.map((e=>E(Gz,{col:e,label:d(e),isLastVisible:e.getIsVisible()&&1===c,showReorder:o,showVisibility:a},e.id)))})})})]})}function Kz({data:n,columns:a,manualSorting:i=!1,onSorting:l,paginationMode:u="infinite",totalCount:h,pageIndex:m,pageSize:p,onPaginationChange:g,pageSizeOptions:v,fetchMoreData:w,fetchMoreOffset:b,fetchingMore:y=!1,fetchingMoreLabel:x="Loading more…",loading:M=!1,loadingLabel:R="Loading…",highlightRowId:I,scrollToHighlightOnMouseLeave:O=!1,selectable:A=!1,onRowSelectionChange:L,rowActions:S,reorderable:N=!1,getRowId:j,onRowReorder:D,isRowReorderLocked:Z,onRowClick:V,onCellClick:T,getSubRows:B,defaultExpanded:F,expanded:P,onExpandedChange:H,bordered:_=!0,surface:W="default",striped:z=!1,divided:$=!0,rowClassName:U,cellClassName:q,headerCellClassName:G,headerClassName:Y,headerRowClassName:K,sortIndicatorVisibility:X="hover",tableLayout:Q="auto",columnManagement:J=!1,resizable:ee=!1,columnMinSize:te=60,columnMaxSize:ne=Number.MAX_SAFE_INTEGER,virtualized:re=!1,virtualRowEstimate:oe,className:ae,enableEditing:ie=!1,editDisplayMode:le="cell",editTrigger:se="click",onCellCommit:ce,alwaysEditing:de,enableCellTabTraversal:ue,editableColumnIds:fe,testId:he}){var me;const pe=r(null),ge=r(null),ve=r(!1),we=r(0),[be,ye]=c(48),xe=o((()=>{const e=pe.current;let t=!1;const n=()=>{t||(t=!0,we.current=Math.max(0,we.current-1))};null==e||e.addEventListener("scrollend",n,{once:!0}),window.setTimeout(n,550)}),[]),Ee=o(((e,t,n)=>{var r,o;const a=n.scrollDirection;if("forward"===a||null===a){const n=null===(r=null==t?void 0:t.borderBoxSize)||void 0===r?void 0:r[0];return n?Math.round(n.blockSize):Math.round(e.getBoundingClientRect().height)}const i=e.getAttribute("data-index"),l=null!=i?Number.parseInt(i,10):NaN,s=n.measurementsCache,c=Number.isFinite(l)&&(null==s?void 0:s[l])?s[l].size:void 0;if("number"==typeof c)return c;const d=null===(o=null==t?void 0:t.borderBoxSize)||void 0===o?void 0:o[0];return d?Math.round(d.blockSize):Math.round(e.getBoundingClientRect().height)}),[]),Ce=!!J,ke="object"==typeof J?J:{},[Me,Re]=c([]),[Ie,Oe]=c([]),[Ae,Le]=c({}),[Se,Ne]=c([]),[je,De]=c({}),[Ze,Ve]=c({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),[Te,Be]=c({}),[Fe,Pe]=c(null!==(me=F)&&void 0!==me?me:{}),He=void 0!==P,_e=He?P:Fe,[We,ze]=c({pageIndex:null!=m?m:0,pageSize:null!=p?p:10}),[$e,Ue]=c(!1),[qe,Ge]=c(null),[Ye,Ke]=c(null),[Xe,Qe]=c({top:0,right:0,maxListHeight:400}),Je=r(new Map),et=o(((e,t)=>{Ke(null);const n=window.innerWidth-t.right,r=Math.min(Math.max(n,8),window.innerWidth-460-8),o=t.bottom+8,a=Math.max(80,window.innerHeight-o-80);Qe({top:o,right:r,maxListHeight:a}),Ge(e),Ue(!0)}),[]);d((()=>{if(!$e)return;const e=e=>{"Escape"===e.key&&Ue(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[$e]),d((()=>{"server"===u&&ze({pageIndex:null!=m?m:0,pageSize:null!=p?p:10})}),[u,m,p]);const tt=t.useMemo((()=>null!=fe?fe:ie?function(e){return e.filter((e=>null!=e.enableEditing||null!=e.editVariant)).map((e=>{var t,n;return null!==(n=null!==(t=e.accessorKey)&&void 0!==t?t:e.id)&&void 0!==n?n:""})).filter(Boolean)}(a):[]),[ie,fe,a]),nt=function(e){const{enabled:n,editDisplayMode:r,editTrigger:a,editableColumnIds:i}=e,[l,u]=c(null),[f,h]=c(null),m=t.useRef(!1),p=o((e=>{u(e),h(null)}),[]),g=o(((e,t)=>{h({rowId:e,columnId:t}),u(null)}),[]),v=o((()=>{u(null),h(null)}),[]),w=o(((e,t)=>{m.current||"cell"===r&&h(null)}),[r]),b=o(((e,t,n)=>{const r=i.indexOf(t);if(r<0)return h(null),"exited";const o=r+n;return o<0||o>=i.length?(h(null),"exited"):(m.current=!0,h({rowId:e,columnId:i[o]}),requestAnimationFrame((()=>{m.current=!1})),"moved")}),[i]);return d((()=>{if(!n||"row"!==r||!l)return;const e=e=>{"Escape"===e.key&&u(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[n,r,l]),s((()=>({editingRowId:l,editingCell:f,editDisplayMode:r,editTrigger:a,requestRowEdit:p,requestCellEdit:g,clearEdit:v,onFieldBlur:w,moveCellEdit:b})),[l,f,r,a,p,g,v,w,b])}({enabled:ie,editDisplayMode:le,editTrigger:se,editableColumnIds:tt}),rt=t.useMemo((()=>{let e;var t;return e=ie?function(e,t){const{editing:n,onCellCommit:r,alwaysEditing:o,enableCellTabTraversal:a,editableColumnIds:i}=t;return e.map((e=>{var t,l;const s=e.enableEditing;if(null==s&&null==e.editVariant)return e;const c=null!==(l=null!==(t=e.accessorKey)&&void 0!==t?t:e.id)&&void 0!==l?l:"",d=e.cell,u=Object.assign(Object.assign({},e),{cell:t=>{var l,u,f,h,m,p,g,v;const{row:w}=t,b=function(e){const t=e.original;return"string"==typeof t.id?t.id:e.id}(w);if(!("function"==typeof s?s(w):!1!==s)){const r=null!==(l=null==o?void 0:o(w))&&void 0!==l&&l,a=r||n.editingRowId===b||(null===(u=n.editingCell)||void 0===u?void 0:u.rowId)===b;if((r||e.editShowDisabledField&&a)&&(e.editVariant||null!=s))return E(Tz,{row:w,col:e,columnId:c});if(e.displayCell)return e.displayCell(w);if(d)return"function"==typeof d?d(t):d;const i=w.original[c];return E(k,{children:String(null!=i?i:"")})}const y=null!==(f=null==o?void 0:o(w))&&void 0!==f&&f,x=y||function(e,t,n){var r;const o="string"==typeof t.original.id?t.original.id:t.id;return"row"===e.editDisplayMode?e.editingRowId===o:(null===(r=e.editingCell)||void 0===r?void 0:r.rowId)===o&&e.editingCell.columnId===n}(n,w,c);if(!x){const t=e.displayCell?e.displayCell(w):String(null!==(h=w.original[c])&&void 0!==h?h:""),r=()=>{"row"===n.editDisplayMode?n.requestRowEdit(b):n.requestCellEdit(b,c)},o="click"===n.editTrigger?{onClick:r}:{onDoubleClick:r};return E("div",Object.assign({className:LC("-mx-1 flex min-h-[32px] w-full min-w-0 cursor-pointer items-center rounded-sm px-1","hover:bg-table-c-hover/35")},o,{children:t}))}const C=null!==(m=e.editVariant)&&void 0!==m?m:"text",M=!y&&"cell"===n.editDisplayMode,R=null===(p=e.editError)||void 0===p?void 0:p.call(e,w),I=t=>{const o=Nz(e,w,t,c);null==r||r(b,c,o),y||n.onFieldBlur(b,c)},O=a?(e,t)=>{if("Tab"===e.key){if("row"===n.editDisplayMode){const n=i.indexOf(c);if(n<0)return;const r=n+(e.shiftKey?-1:1);if(r<0||r>=i.length)return;const o=i[r];return t(),e.preventDefault(),void requestAnimationFrame((()=>{const e=document.querySelector(`[data-edit-cell="${b}:${o}"] input, [data-edit-cell="${b}:${o}"] button`);null==e||e.focus()}))}t(),"moved"===n.moveCellEdit(b,c,e.shiftKey?-1:1)&&e.preventDefault()}}:void 0;if("select"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Dz,{row:w,columnId:c,col:e,autoFocus:M,keepOpenAfterSelect:"row"===n.editDisplayMode||y,onCommit:t=>{var n;const o=String(null!==(n=w.original[c])&&void 0!==n?n:"");if(t.trim()===o.trim())return;const a=Nz(e,w,t,c);null==r||r(b,c,a)},onBlurField:"row"===n.editDisplayMode?void 0:()=>{y||n.onFieldBlur(b,c)},onKeyDown:O?e=>O(e,(()=>{})):void 0,errorMessage:R})});if("number"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Zz,{columnId:c,row:w,col:e,autoFocus:M,errorMessage:R,onBlur:e=>I(e),onKeyDown:O?t=>O(t,(()=>{const n=t.target.value.trim(),o=Nz(e,w,n,c);null==r||r(b,c,o)})):void 0})});if("checkbox"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Vz,{columnId:c,row:w,col:e,errorMessage:R,onCommit:t=>{const n=Nz(e,w,String(t),c);null==r||r(b,c,n)},onKeyDown:O?e=>O(e,(()=>{})):void 0})});if("custom"===C&&e.editCustomCell){const t=()=>{y||n.onFieldBlur(b,c)};return E("div",{"data-edit-cell":`${b}:${c}`,children:e.editCustomCell(w,{commit:t=>{const n=Nz(e,w,t,c);null==r||r(b,c,n)},blur:t,columnId:c,autoFocus:M,errorMessage:R,onKeyDown:O?e=>O(e,(()=>{})):void 0})})}return E("div",{"data-edit-cell":`${b}:${c}`,children:E(jz,{columnId:c,row:w,placeholder:null!==(v=null===(g=e.editTextProps)||void 0===g?void 0:g.placeholder)&&void 0!==v?v:"",autoFocus:M,errorMessage:R,onBlur:e=>I(e.currentTarget.value.trim()),onKeyDown:O?t=>O(t,(()=>{const n=t.target.value.trim(),o=Nz(e,w,n,c);null==r||r(b,c,o)})):void 0})})}});return u}))}(a,{editing:nt,onCellCommit:ce,alwaysEditing:de,enableCellTabTraversal:null==ue||ue,editableColumnIds:tt}):[...a],N&&e.unshift({id:"__reorder__",header:()=>null,cell:({row:e})=>E(Pz,{rowId:e.id}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:54,maxSize:54,minSize:54,meta:{exactWidth:54}}),A&&e.unshift({id:"__select__",header:({table:e})=>E(LL,{checked:e.getIsSomeRowsSelected()?"indeterminate":e.getIsAllRowsSelected(),onCheckedChange:t=>e.toggleAllRowsSelected(!!t),"aria-label":"Select all"}),cell:({row:e})=>E(LL,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row",disabled:!e.getCanSelect()}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:42,maxSize:42,minSize:42,meta:{exactWidth:42}}),S&&e.push((t=S,{id:"__actions__",header:()=>null,cell:({row:e})=>E("div",{className:"flex items-center justify-center gap-1",children:t(e)}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:80,maxSize:80,minSize:80,meta:{exactWidth:80}})),e}),[a,A,N,S,ie,nt,ce,de,ue]),ot="client"===u||"server"===u,at=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[r]=e.useState((()=>({current:zT(n)}))),[o,a]=e.useState((()=>r.current.initialState));return r.current.setOptions((e=>({...e,...t,state:{...o,...t.state},onStateChange:e=>{a(e),null==t.onStateChange||t.onStateChange(e)}}))),r.current}(Object.assign(Object.assign(Object.assign(Object.assign({data:n,columns:rt,columnResizeMode:"onChange",defaultColumn:{minSize:te,maxSize:ne}},j?{getRowId:e=>j(e)}:{getRowId:e=>e.id}),{manualSorting:i,manualPagination:"server"===u,rowCount:"server"===u?null!=h?h:n.length:void 0,getSubRows:B,onSortingChange:Re,onColumnFiltersChange:Oe,onColumnVisibilityChange:Le,onColumnOrderChange:Ne,onColumnSizingChange:De,onColumnSizingInfoChange:Ve,onRowSelectionChange:Be,onExpandedChange:e=>{const t="function"==typeof e?e(_e):e;He||Pe(t),null==H||H(t)},onPaginationChange:e=>{const t="function"==typeof e?e(We):e;ze(t),null==g||g(t)},getCoreRowModel:e=>QV((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let s=0;s<t.length;s++){const c=oT(e,e._getRowId(t[s],s,a),t[s],s,o,0,null==a?void 0:a.id);var l;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=c.originalSubRows)&&l.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),JV(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>QV((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],l=i[o.id],s=l.sortUndefined,c=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(s){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===s)return n?-1:1;if("last"===s)return n?1:-1;d=n&&r?0:n?s:-s}}if(0===d&&(d=l.sortingFn(e,t,o.id)),0!==d)return c&&(d*=-1),l.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))})),t};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}}),JV(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex()))),getFilteredRowModel:e=>QV((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],a=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const a=r.getFilterFn();a?o.push({id:t.id,filterFn:a,resolvedValue:null!=(n=null==a.resolveFilterValue?void 0:a.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${r.id}.`)}));const i=(null!=n?n:[]).map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,d;r&&l&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;a.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(a.length){for(let e=0;e<a.length;e++){d=a[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return UT(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),JV(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex()))),getExpandedRowModel:e=>QV((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?$T(t):t),JV(e.options,"debugTable","getExpandedRowModel"))}),ot?{getPaginationRowModel:e=>QV((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:a,flatRows:i,rowsById:l}=n;const s=r*o,c=s+r;let d;a=a.slice(s,c),d=e.options.paginateExpandedRows?{rows:a,flatRows:i,rowsById:l}:$T({rows:a,flatRows:i,rowsById:l}),d.flatRows=[];const u=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(u)};return d.rows.forEach(u),d}),JV(e.options,"debugTable","getPaginationRowModel"))}:{}),{enableRowSelection:A,enableColumnResizing:ee,state:Object.assign({sorting:Me,columnFilters:Ie,columnVisibility:Ae,columnOrder:Se,columnSizing:je,columnSizingInfo:Ze,rowSelection:Te,expanded:_e},ot?{pagination:We}:{})})),it=t.useMemo((()=>{const e=at.getRowModel().rows;if(!Z)return e;const t=e.filter((e=>Z(e))),r=e.filter((e=>!Z(e)));if(0===t.length)return e;const o=new Map(n.map(((e,t)=>[j?j(e):String(e.id),t])));return t.sort(((e,t)=>{var n,r;return(null!==(n=o.get(e.id))&&void 0!==n?n:0)-(null!==(r=o.get(t.id))&&void 0!==r?r:0)})),[...r,...t]}),[at.getRowModel().rows,Z,n,j]);d((()=>{null==l||l(Me)}),[Me,l]),d((()=>{null==L||L(Te)}),[Te,L]),d((()=>{if("infinite"!==u)return;const e=pe.current;if(!e)return;const t=()=>{if(we.current>0)return;const{scrollTop:t,scrollHeight:n,clientHeight:r}=e;if(y||M)return;t+r>=n-("number"==typeof b?b:10)&&(null==w||w())};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[u,w,y,M,b]);const lt=0===it.length;f((()=>{if(!re)return;const e=ge.current;if(!e)return;const t=()=>{ye(Math.round(e.getBoundingClientRect().height))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}),[re]);const st=r((()=>{})),ct=r(!1),dt=CR({count:re?it.length:0,getScrollElement:()=>pe.current,estimateSize:()=>null!=oe?oe:40,overscan:4,paddingStart:re?be:0,scrollPaddingStart:0,measureElement:Ee,onChange:()=>{var e,t;if(!re||!I)return;(null!==(t=null===(e=pe.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)<1?ct.current=!1:ct.current||(ct.current=!0,requestAnimationFrame((()=>{ve.current||st.current("auto")})))}}),ut=o(((e="smooth")=>{var t,n;if(!I)return;if(ve.current)return;const r=pe.current;if(!r)return;const o=Array.isArray(I)?I:[I];if(re){dt.getTotalSize();for(const a of o){const o=it.findIndex((e=>e.id===a));if(-1!==o){const a=null!=oe?oe:40,i=dt.getOffsetForIndex(o,"start");if(!i)continue;const[l]=i,s=null===(n=null===(t=dt.measurementsCache)||void 0===t?void 0:t[o])||void 0===n?void 0:n.size,c=l+("number"==typeof s?s:a)/2-r.clientHeight/2;return we.current+=1,xe(),void dt.scrollToOffset(Math.max(0,c),{align:"start",behavior:"smooth"===e?"smooth":"auto"})}}}else for(const t of o){const n=r.querySelector(`[data-row-id="${t}"]`);if(n){we.current+=1,xe(),n.scrollIntoView({block:"center",behavior:e});break}}}),[I,it,re,dt,oe,be,xe]);st.current=ut,f((()=>{ct.current=!1}),[re,I]),f((()=>{ut("smooth")}),[re,ut,I]);const ft={pageIndex:We.pageIndex,pageSize:We.pageSize,totalCount:"server"===u?null!=h?h:n.length:at.getFilteredRowModel().rows.length,pageSizeOptions:v,onPageChange:e=>at.setPagination((t=>Object.assign(Object.assign({},t),{pageIndex:e}))),onPageSizeChange:e=>at.setPagination({pageIndex:0,pageSize:e})},ht=function(e){return t.useMemo((()=>{var t;const n=e.getVisibleLeafColumns();let r=0,o=0;for(const e of n){const n=null===(t=e.columnDef.meta)||void 0===t?void 0:t.exactWidth,a=Uz(n);null!=a?r+=a:null==n&&(o+=1)}if(0!==o&&0!==r)return`calc((100% - ${r}px) / ${o})`}),[e.getVisibleLeafColumns()])}(at),mt="equal"===Q?ht:void 0,pt=t.useMemo((()=>{if("fixed"!==Q)return null;const e=at.getVisibleLeafColumns(),t=e=>{var t;return null!=Uz(null===(t=e.columnDef.meta)||void 0===t?void 0:t.exactWidth)},n=e.map(((e,n)=>t(e)?-1:n)).filter((e=>e>=0)),r=n.length>0?n[n.length-1]:-1,o=new Map;return e.forEach(((e,n)=>{var a,i,l;if(t(e))return;if(n===r)return;const s=null!==(l=null!==(a=e.columnDef.size)&&void 0!==a?a:null===(i=e.getSize)||void 0===i?void 0:i.call(e))&&void 0!==l?l:150,c="number"==typeof s?s:Number.isFinite(parseFloat(String(s)))?parseFloat(String(s)):150;o.set(e.id,{width:`${c}px`,minWidth:`${c}px`,maxWidth:`${c}px`,overflow:"hidden",boxSizing:"border-box"})})),o}),[Q,at.getVisibleLeafColumns()]),gt=t.useMemo((()=>{var e,t;if(!ee||"equal"===Q)return null;const n=at.getVisibleLeafColumns(),r=n.map(((e,t)=>{var n;return null==Uz(null===(n=e.columnDef.meta)||void 0===n?void 0:n.exactWidth)?t:-1})).filter((e=>e>=0));return 0===r.length?null:null!==(t=null===(e=n[r[r.length-1]])||void 0===e?void 0:e.id)&&void 0!==t?t:null}),[ee,Q,at.getVisibleLeafColumns()]),vt=e=>{var t;return null===(t=e.getVisibleCells().find((e=>"__select__"!==e.column.id&&"__actions__"!==e.column.id&&"__reorder__"!==e.column.id)))||void 0===t?void 0:t.id},wt=BB(TB(AF),TB(kF,{coordinateGetter:NP})),bt=t.useMemo((()=>it.filter((e=>!(null==Z?void 0:Z(e)))).map((e=>e.id))),[it,Z]),yt="fixed"===Q||ee,xt=Ce&&!1!==ke.visibility,Et=Ce?at.getAllLeafColumns().filter((e=>e.getCanHide()&&e.getIsVisible())).length:0,Ct=ie?nt:null;return E(Oz.Provider,{value:Ct,children:C("div",{className:LC("flex flex-col w-full h-full min-h-0",_&&"overflow-hidden rounded-md border border-table-c-border",!_&&"overflow-hidden rounded-none",ae),"data-surface":"panel"===W?"panel":void 0,"data-testid":he,children:[E("div",{ref:pe,className:LC("relative min-h-0 overflow-auto","ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s",ot?"flex-1":"h-full"),onWheel:O?()=>{ve.current=!0}:void 0,onPointerDownCapture:O?()=>{ve.current=!0}:void 0,onMouseLeave:O?()=>{ve.current=!1,ut("smooth")}:void 0,children:C(PV,{scrollableWrapper:!1,className:LC(("fixed"===Q||"equal"===Q||ee)&&"table-fixed",lt&&"h-full"),style:ee?{width:`max(100%, ${at.getTotalSize()}px)`}:{width:"100%"},children:["fixed"===Q&&!ee&&E("colgroup",{children:at.getVisibleLeafColumns().map((e=>{const t=$z(e.columnDef,yt),n=null!=t?t:null==pt?void 0:pt.get(e.id);return E("col",{style:n},e.id)}))}),ee&&E("colgroup",{children:at.getVisibleLeafColumns().map((e=>{const t=$z(e.columnDef,yt);return t?E("col",{style:t},e.id):"equal"===Q||null!=gt&&e.id===gt?E("col",{},e.id):E("col",{style:{width:e.getSize()}},e.id)}))}),E(HV,{ref:ge,className:LC("sticky top-0 z-10",Y),"data-testid":he?`${he}-thead`:void 0,children:at.getHeaderGroups().map((e=>E(zV,{divided:!1,colDivided:$,className:LC("hover:bg-transparent",K),children:e.headers.map((e=>{var t;const n=e.column.getCanSort(),r=e.column.getIsSorted(),o=Ce&&e.column.getCanHide(),a=ee&&"equal"!==Q&&e.column.getCanResize(),i=e.column.getIsResizing(),l=!ee&&pt?pt.get(e.column.id):void 0,s=ee&&"equal"!==Q&&!(null!=gt&&e.column.id===gt),c=function(e,t,n,r,o){const a=$z(e,r);if(a)return a;if(null!=o){const t=e.maxSize;return Object.assign({width:o},null!=t&&t!==Number.MAX_SAFE_INTEGER&&{maxWidth:t})}return t?{width:t}:n}(e.column.columnDef,mt,l,yt,s?e.getSize():void 0);return C($V,{colSpan:e.colSpan,style:c,className:LC("relative overflow-visible group/col whitespace-pre",i&&"select-none",null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.headerCellClassName,"function"==typeof G?G(e):G),children:[C("div",{className:"flex flex-row items-center gap-1 group/header",children:[E("span",{className:LC("flex flex-1 flex-row items-center overflow-hidden",n&&"cursor-pointer select-none",Bz(e.column.columnDef.meta)),onClick:e.column.getToggleSortingHandler(),children:e.isPlaceholder?null:qT(e.column.columnDef.header,e.getContext())}),n&&E(Zk,{variant:"icon",size:"xs",className:LC("shrink-0 transition-opacity",r||"always"===X?"opacity-100":"opacity-0 group-hover/header:opacity-100"),onClick:e.column.getToggleSortingHandler(),"aria-label":"asc"===r?"Sorted ascending — click to sort descending":"desc"===r?"Sorted descending — click to clear sort":"Sort column",children:"asc"===r?E(QC,{className:"!size-4"}):"desc"===r?E(KC,{className:"!size-4"}):E(XC,{className:"!size-4 text-text-g-contrast-medium"})}),o&&C(XW,{open:Ye===e.column.id,onOpenChange:t=>Ke(t?e.column.id:null),modal:!1,children:[E(QW,{asChild:!0,children:E(Zk,{variant:"icon",size:"sm",active:$e&&qe===e.column.id||Ye===e.column.id,"aria-haspopup":"menu","aria-expanded":Ye===e.column.id,"aria-label":"Column options",className:"shrink-0",ref:t=>{t?Je.current.set(e.column.id,t):Je.current.delete(e.column.id)},onClick:e=>e.stopPropagation(),children:E(ck,{className:"!size-4"})})}),C(az,{align:"end",sideOffset:4,className:"min-w-[220px] py-1",onCloseAutoFocus:e=>e.preventDefault(),children:[xt&&C(iz,{className:"py-3",disabled:e.column.getIsVisible()&&Et<=1,icon:E(uk,{className:"size-4","aria-hidden":!0}),onSelect:()=>{e.column.toggleVisibility(!1)},children:["Hide ",zz(e)," ","column"]}),E(iz,{className:"py-3",icon:E(sk,{className:"size-4","aria-hidden":!0}),onSelect:()=>{requestAnimationFrame((()=>{const t=Je.current.get(e.column.id);t&&et(e.column.id,t.getBoundingClientRect())}))},children:"Manage columns"})]})]})]}),a&&E("div",{onMouseDown:e.getResizeHandler(document),onTouchStart:e.getResizeHandler(document),onClick:e=>e.stopPropagation(),className:LC("absolute right-0 top-0 h-full w-[5px] z-10","cursor-col-resize select-none touch-none","flex items-center justify-center group/resize"),children:E("div",{className:LC("h-4/5 w-1.5 rounded-full transition-all duration-150",i?"opacity-100 w-0.5 bg-primary-500":"opacity-0 bg-table-c-col-line group-hover/col:opacity-100 group-hover/resize:bg-primary-400")})})]},e.id)}))},e.id)))}),E(_V,{striped:z,"data-testid":he?`${he}-tbody`:void 0,children:lt?E(zV,M?{className:"h-full hover:bg-transparent",divided:!1,children:E(UV,{colSpan:rt.length,className:"typography-body1 text-text-g-contrast-medium text-center h-full min-h-[200px]",children:C("div",{className:"flex flex-1 min-h-[200px] h-full flex-col items-center justify-center gap-3 py-16",role:"status","aria-live":"polite","aria-busy":"true",children:[E(fk,{className:"size-8 shrink-0 animate-spin text-secondary-120","aria-hidden":!0}),R]})})}:{className:"h-full hover:bg-transparent",divided:!1,children:E(UV,{colSpan:rt.length,className:"typography-body1 text-text-g-contrast-medium text-center h-full",children:C("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 py-16",children:[E(lk,{className:"w-8 text-secondary-120"}),"There is no information yet."]})})}):re?(()=>{var e;const t=dt.getVirtualItems();if(!t.length)return null;const n=Math.max(0,t[0].start-be),r=dt.getTotalSize()-(null!==(e=t[t.length-1].end)&&void 0!==e?e:0);return C(k,{children:[n>0&&E("tr",{"aria-hidden":!0,children:E("td",{colSpan:rt.length,style:{height:n}})}),t.map((e=>{const t=it[e.index],n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=Array.isArray(I)?I.includes(t.id):I===t.id,a={divided:!(!n||z)||!z,colDivided:$,"data-state":t.getIsSelected()?"selected":void 0,"data-highlighted":o?"true":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(t,e.index):U),onClick:V?e=>V(t,e):void 0};return E(zV,Object.assign({ref:dt.measureElement,"data-index":e.index,"data-row-id":t.id},a,{children:Fz({row:t,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T})}),t.id)})),r>0&&E("tr",{"aria-hidden":!0,children:E("td",{colSpan:rt.length,style:{height:r}})})]})})():N?E(lP,{sensors:wt,collisionDetection:UB,modifiers:[hP],onDragEnd:e=>{const{active:t,over:r}=e;if(!r||t.id===r.id||!D)return;const o=n.findIndex((e=>(j?j(e):e.id)===t.id)),a=n.findIndex((e=>(j?j(e):e.id)===r.id));-1!==o&&-1!==a&&D(mP([...n],o,a))},children:E(EP,{items:bt,strategy:bP,children:it.map(((e,t)=>{const n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=null==Z?void 0:Z(e),a=Array.isArray(I)?I.includes(e.id):I===e.id,i={divided:!(!n||z)||!z,colDivided:$,"data-state":e.getIsSelected()?"selected":void 0,"data-highlighted":a?"true":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(e,t):U),onClick:V?t=>V(e,t):void 0},l=Fz({row:e,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T});return o?E(zV,Object.assign({"data-row-id":e.id},i,{children:l}),e.id):E(Hz,Object.assign({id:e.id,"data-row-id":e.id},i,{children:l}),e.id)}))})}):it.map(((e,t)=>{const n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=Array.isArray(I)?I.includes(e.id):I===e.id;return E(zV,{divided:!(!n||z)||!z,colDivided:$,"data-state":e.getIsSelected()?"selected":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(e,t):U),"data-highlighted":o?"true":void 0,onClick:V?t=>V(e,t):void 0,"data-row-id":e.id,children:Fz({row:e,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T})},e.id)}))}),"infinite"===u&&y&&!lt&&at.getVisibleLeafColumns().length>0&&E("tfoot",{className:"[&_tr]:bg-table-c-row-bg",children:E(zV,{divided:!1,className:"hover:!bg-table-c-row-bg border-t border-t-table-c-row-line",children:E(UV,{colSpan:at.getVisibleLeafColumns().length,className:"py-3 text-center typography-body3 text-text-g-contrast-medium bg-inherit",children:C("span",{role:"status","aria-live":"polite",className:"inline-flex items-center justify-center gap-2",children:[E(fk,{className:"size-4 shrink-0 animate-spin","aria-hidden":!0}),x]})})})})]})}),ot&&E(GV,Object.assign({},ft)),Ce&&$e&&C(rB,{children:[E("div",{className:"fixed inset-0 z-40",onClick:()=>Ue(!1)}),E("div",{className:"fixed z-50 w-[460px] rounded-lg bg-modal-surface shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] overflow-hidden",style:{top:Xe.top,right:Xe.right},onClick:e=>e.stopPropagation(),children:E(Yz,{table:at,onClose:()=>Ue(!1),maxListHeight:Xe.maxListHeight,options:ke})})]})]})})}var Xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});var Qz,Jz="dismissableLayer.update",e$="dismissableLayer.pointerDownOutside",t$="dismissableLayer.focusOutside",n$=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),r$=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(n$),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){a$(e$,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){a$(t$,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Qz=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),o$(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Qz)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),o$())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Jz,e),()=>document.removeEventListener(Jz,e)}),[]),E(Xz.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));r$.displayName="DismissableLayer";function o$(){const e=new CustomEvent(Jz);document.dispatchEvent(e)}function a$(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(n$),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Xz.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var i$="focusScope.autoFocusOnMount",l$="focusScope.autoFocusOnUnmount",s$={bubbles:!1,cancelable:!0},c$=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:h$(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||h$(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&h$(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){m$.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(i$,s$);s.addEventListener(i$,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(h$(r,{select:t}),document.activeElement!==n)return}((e=d$(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&h$(s))}return()=>{s.removeEventListener(i$,d),setTimeout((()=>{const e=new CustomEvent(l$,s$);s.addEventListener(l$,u),s.dispatchEvent(e),e.defaultPrevented||h$(t??document.body,{select:!0}),s.removeEventListener(l$,u),m$.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=d$(e),n=u$(t,e),r=u$(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&h$(a,{select:!0})):(e.preventDefault(),r&&h$(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(Xz.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function d$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function u$(e,t){for(const n of e)if(!f$(n,{upTo:t}))return n}function f$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function h$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}c$.displayName="FocusScope";var m$=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=p$(e,t),e.unshift(t)},remove(t){e=p$(e,t),e[0]?.resume()}}}();function p$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var g$=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(Xz.div,{...o,ref:n}),l):null}));g$.displayName="Portal";var v$=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=w$(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=w$(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=w$(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=w$(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function w$(e){return e?.animationName||"none"}v$.displayName="Presence";var b$="Dialog",[y$,x$]=nL(b$),[E$,C$]=y$(b$),k$=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=t,s=e.useRef(null),c=e.useRef(null),[d=!1,u]=iL({prop:o,defaultProp:a,onChange:i});return E(E$,{scope:n,triggerRef:s,contentRef:c,contentId:Gj(),titleId:Gj(),descriptionId:Gj(),open:d,onOpenChange:u,onOpenToggle:e.useCallback((()=>u((e=>!e))),[u]),modal:l,children:r})};k$.displayName=b$;var M$="DialogTrigger",R$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(M$,n),a=tL(t,o.triggerRef);return E(Xz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$$(o.open),...r,ref:a,onClick:oL(e.onClick,o.onOpenToggle)})}));R$.displayName=M$;var I$="DialogPortal",[O$,A$]=y$(I$,{forceMount:void 0}),L$=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=C$(I$,n);return E(O$,{scope:n,forceMount:r,children:e.Children.map(o,(e=>E(v$,{present:r||i.open,children:E(g$,{asChild:!0,container:a,children:e})})))})};L$.displayName=I$;var S$="DialogOverlay",N$=e.forwardRef(((e,t)=>{const n=A$(S$,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=C$(S$,e.__scopeDialog);return a.modal?E(v$,{present:r||a.open,children:E(j$,{...o,ref:t})}):null}));N$.displayName=S$;var j$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(S$,n);return E(mZ,{as:fL,allowPinchZoom:!0,shards:[o.contentRef],children:E(Xz.div,{"data-state":$$(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),D$="DialogContent",Z$=e.forwardRef(((e,t)=>{const n=A$(D$,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=C$(D$,e.__scopeDialog);return E(v$,{present:r||a.open,children:a.modal?E(V$,{...o,ref:t}):E(T$,{...o,ref:t})})}));Z$.displayName=D$;var V$=e.forwardRef(((t,n)=>{const r=C$(D$,t.__scopeDialog),o=e.useRef(null),a=tL(n,r.contentRef,o);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(B$,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:oL(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()))})})),T$=e.forwardRef(((t,n)=>{const r=C$(D$,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return E(B$,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})})),B$=e.forwardRef(((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=t,s=C$(D$,r),c=e.useRef(null),d=tL(n,c);return Dj(),C(k,{children:[E(c$,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:E(r$,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":$$(s.open),...l,ref:d,onDismiss:()=>s.onOpenChange(!1)})}),C(k,{children:[E(Y$,{titleId:s.titleId}),E(K$,{contentRef:c,descriptionId:s.descriptionId})]})]})})),F$="DialogTitle",P$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(F$,n);return E(Xz.h2,{id:o.titleId,...r,ref:t})}));P$.displayName=F$;var H$="DialogDescription",_$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(H$,n);return E(Xz.p,{id:o.descriptionId,...r,ref:t})}));_$.displayName=H$;var W$="DialogClose",z$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(W$,n);return E(Xz.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,(()=>o.onOpenChange(!1)))})}));function $$(e){return e?"open":"closed"}z$.displayName=W$;var U$="DialogTitleWarning",[q$,G$]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,a=e.useMemo((()=>o),Object.values(o));return E(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(o){const a=e.useContext(r);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(U$,{contentName:D$,titleName:F$,docsSlug:"dialog"}),Y$=({titleId:t})=>{const n=G$(U$),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect((()=>{if(t){document.getElementById(t)||console.error(r)}}),[r,t]),null},K$=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G$("DialogDescriptionWarning").contentName}}.`;return e.useEffect((()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}}),[r,t,n]),null},X$=k$,Q$=R$,J$=L$,eU=N$,tU=Z$,nU=P$,rU=_$,oU=z$;const aU=X$,iU=Q$,lU=J$,sU=oU,cU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(eU,Object.assign({ref:t,className:LC("fixed inset-0 z-50 bg-modal-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n)},r))}));cU.displayName=eU.displayName;const dU=e.forwardRef(((e,t)=>{var{className:n,children:r,showCloseButton:o=!1,closeButtonClassName:a}=e,i=IC(e,["className","children","showCloseButton","closeButtonClassName"]);return C(lU,{children:[E(cU,{}),C(tU,Object.assign({ref:t,className:LC("fixed left-[50%] top-[50%] z-50 flex w-[calc(100%-32px)] max-w-[650px] translate-x-[-50%] translate-y-[-50%] flex-col gap-6 rounded-md bg-modal-surface p-8 text-text-g-contrast-medium shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 focus:outline-none focus-visible:outline-none outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n)},i,{children:[r,o&&C(oU,{className:LC("absolute right-8 top-8 rounded-sm opacity-70 ring-offset-bg-bg1 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-input-active-stroke focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-state-primary-text-solid",a),children:[E(vu,{className:"h-4 w-4"}),E("span",{className:"sr-only",children:"Close"})]})]}))]})}));dU.displayName=tU.displayName;const uU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-col gap-1 text-left",t)},n))};uU.displayName="DialogHeader";const fU=e=>{var{className:t,scrollable:n=!1}=e,r=IC(e,["className","scrollable"]);return E("div",Object.assign({className:LC("flex flex-1 min-h-0 flex-col",n&&"overflow-y-auto",t)},r))};fU.displayName="DialogBody";const hU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-row items-center justify-end gap-4",t)},n))};hU.displayName="DialogFooter";const mU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(nU,Object.assign({ref:t,className:LC("typography-h6 tracking-tight text-text-contrast-max",n)},r))}));mU.displayName=nU.displayName;const pU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(rU,Object.assign({ref:t,className:LC("typography-body3 text-text-contrast-max",n)},r))}));pU.displayName=rU.displayName;var gU="AlertDialog",[vU]=nL(gU,[x$]),wU=x$(),bU=e=>{const{__scopeAlertDialog:t,...n}=e,r=wU(t);return E(X$,{...r,...n,modal:!0})};bU.displayName=gU;var yU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(Q$,{...o,...r,ref:t})}));yU.displayName="AlertDialogTrigger";var xU=e=>{const{__scopeAlertDialog:t,...n}=e,r=wU(t);return E(J$,{...r,...n})};xU.displayName="AlertDialogPortal";var EU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(eU,{...o,...r,ref:t})}));EU.displayName="AlertDialogOverlay";var CU="AlertDialogContent",[kU,MU]=vU(CU),RU=e.forwardRef(((t,n)=>{const{__scopeAlertDialog:r,children:o,...a}=t,i=wU(r),l=e.useRef(null),s=tL(n,l),c=e.useRef(null);return E(q$,{contentName:CU,titleName:IU,docsSlug:"alert-dialog",children:E(kU,{scope:r,cancelRef:c,children:C(tU,{role:"alertdialog",...i,...a,ref:s,onOpenAutoFocus:oL(a.onOpenAutoFocus,(e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})})),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[E(mL,{children:o}),E(DU,{contentRef:l})]})})})}));RU.displayName=CU;var IU="AlertDialogTitle",OU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(nU,{...o,...r,ref:t})}));OU.displayName=IU;var AU="AlertDialogDescription",LU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(rU,{...o,...r,ref:t})}));LU.displayName=AU;var SU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(oU,{...o,...r,ref:t})}));SU.displayName="AlertDialogAction";var NU="AlertDialogCancel",jU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=MU(NU,n),a=wU(n),i=tL(t,o);return E(oU,{...a,...r,ref:i})}));jU.displayName=NU;var DU=({contentRef:t})=>{const n=`\`${CU}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${CU}\` by passing a \`${AU}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CU}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return e.useEffect((()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(n)}),[n,t]),null},ZU=EU,VU=RU,TU=SU,BU=jU,FU=OU,PU=LU;const HU=bU,_U=yU,WU=xU,zU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(ZU,Object.assign({className:LC("fixed inset-0 bg-modal-overlay z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n)},r,{ref:t}))}));zU.displayName=ZU.displayName;const $U=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return C(WU,{children:[E(zU,{}),E(VU,Object.assign({ref:t,className:LC("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-32px)] max-w-[460px] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-md bg-modal-surface px-6 py-8 text-text-contrast-max shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 focus:outline-none focus-visible:outline-none outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n)},r))]})}));$U.displayName=VU.displayName;const UU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-col items-center gap-2 text-center",t)},n))};UU.displayName="AlertDialogHeader";const qU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-row items-center justify-center gap-4",t)},n))};qU.displayName="AlertDialogFooter";const GU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(FU,Object.assign({ref:t,className:LC("typography-subtitle3 text-text-contrast-max",n)},r))}));GU.displayName=FU.displayName;const YU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(PU,Object.assign({ref:t,className:LC("typography-body3 text-text-contrast-max",n)},r))}));YU.displayName=PU.displayName;const KU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(TU,Object.assign({ref:t,className:LC(OC({fullwidth:!1}),"min-w-[100px] justify-center",n)},r))}));KU.displayName=TU.displayName;const XU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(BU,Object.assign({ref:t,className:LC(OC({fullwidth:!1,variant:"outline"}),"min-w-[100px] justify-center whitespace-pre-line",n)},r))}));XU.displayName=BU.displayName;const QU=n(((e,t)=>{const{label:n="Search",required:r=!1}=e,o=IC(e,["label","required"]);return E(JA,Object.assign({label:n,required:r},o,{ref:t,keepCloseIconOnValue:!0,hasClearIcon:!0,hasSearchIcon:!0,endIcon:null,filterMode:!0,isFloatingLabel:!1,segmentedInput:!1}))})),JU=M(["absolute flex items-center justify-center cursor-pointer","border-l border-l-input-default-stroke","peer-hover:border-l-input-active-stroke","peer-focus:border-l-input-active-stroke","fill-primary","peer-hover:fill-input-filled-text","peer-focus:fill-input-filled-text","stroke-input-default-stroke","peer-hover:stroke-input-active-stroke","peer-focus:stroke-input-filled-text"],{variants:{size:{sm:"p-1 size-[30px]",md:"p-2 size-[38px]",lg:"p-3 size-14"},rounded:{none:"rounded-r-none",normal:"",full:"rounded-r-full"},error:{true:"border-l-input-error"},position:{start:"inset-y-0 left-0",end:"inset-y-0 right-0"},active:{false:"",true:["fill-primary-default","peer-hover:fill-primary-default","peer-focus:fill-primary-hover","stroke-primary-default","peer-hover:stroke-primary-default","peer-focus:stroke-primary-hover"]},disabled:{true:["cursor-default pointer-events-none","border-l-input-disable-stroke","fill-input-disable-stroke","stroke-input-disable-stroke"]}},compoundVariants:[{rounded:"normal",size:"sm",className:"rounded-r-sm"},{rounded:"normal",size:["md","lg"],className:"rounded-r-md"}],defaultVariants:{size:"md",rounded:"normal",error:!1,position:"end",active:!1,disabled:!1}}),eq=n(((e,t)=>{var{id:n,options:a=[],values:i=[],label:l,size:u="md",rounded:f="normal",variant:m="outline",helperText:p,errorMessage:g,fullwidth:v=!0,disabled:w=!1,error:b=!1,filterMode:y=!1,required:x=!0,onChangeText:k,onSelect:M,renderOptions:R,optionContainerClassName:I}=e,O=IC(e,["id","options","values","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","onChangeText","onSelect","renderOptions","optionContainerClassName"]);const A=n||`${l}-select`,[L,S]=c(!1),[N,j]=c(i),[D,Z]=c(""),V=r(""),T=r(null);d((()=>{var e;j(null!=i?i:[]),Z(null!==(e=null==i?void 0:i.map((e=>e.label)).join(", "))&&void 0!==e?e:"")}),[i]),d((()=>{const e=e=>{T.current&&!T.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const B=o((e=>{null==k||k(e),Z(e.target.value),e.target.value||_(e)}),[k]),F=o((e=>{const t=N.some((t=>t.value===e.value));let n=[...N];t?n=n.filter((t=>t.value!==e.value)):n.push(e),j(n),Z(n.map((e=>e.label)).join(", ")),null==M||M(n)}),[N,M]),P=s((()=>{const e=null==D?void 0:D.split(",").pop(),t=null!=e?e:"";return a.filter((e=>{var n;return!y||(null===(n=e.label)||void 0===n?void 0:n.toLowerCase().includes(null==t?void 0:t.toLowerCase()))}))}),[a,y,D]),H=o((e=>{var t;S(!0),null===(t=null==O?void 0:O.onFocus)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onFocus]),_=o((e=>{const t=P.filter((t=>{var n,r;return t.value===(null===(n=e.target)||void 0===n?void 0:n.value)||t.label===(null===(r=e.target)||void 0===r?void 0:r.value)}));"Enter"!==V.current&&(j(t),Z(t.map((e=>e.label)).join(", ")),null==M||M(t))}),[P,D]),W=o((e=>{var t;V.current=e.code,null===(t=null==O?void 0:O.onKeyDown)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onKeyDown]),z=JU({size:u,rounded:f,error:b,active:!!i.length,disabled:w}),$="lg"===u?"size-8":"md"===u?"size-[22px]":"size-[18px]";return C("div",{ref:T,className:"relative "+(v?"w-full":""),children:[E(mk,Object.assign({hasClearIcon:!1,endIcon:E(Ek,{type:"heroicons",name:"adjustments-horizontal",variant:"outline",color:"inherit",stroke:"inherit",fill:"transparent",className:$}),classes:{endIconWrapper:z}},O,{ref:t,readOnly:!y,value:D,onChange:B,label:l,placeholder:" ",type:"text",rounded:f,variant:m,helperText:p,errorMessage:g,fullwidth:v,error:b,required:x,id:A,disabled:w,size:u,className:XA({size:u}),onFocus:H,onKeyDown:W})),L&&(R?R({optionsFiltered:P,selectedOptions:N,onClick:F}):C("ul",{className:LC("absolute text-text-g-contrast-high mt-1 w-full bg-modal-surface border border-modal-surface text-text-contrast-low rounded-md shadow-md z-10 max-h-60 overflow-y-auto",I),children:[P.map((e=>e.renderLabel?E(h,{children:e.renderLabel({value:e.value,label:e.label,handleOnClick:()=>F(e),className:"p-4 typography-subtitle4 hover:bg-gray-100 cursor-pointer flex items-center gap-3 "+(N.some((t=>t.value===e.value))?"bg-gray-200":"")})},e.value):C("li",{onMouseDown:()=>F(e),className:"p-4 text-text-g-contrast-high typography-subtitle4 hover:bg-primary-hover-bg cursor-pointer flex items-center gap-3 "+(N.some((t=>t.value===e.value))?"bg-modal-highlight":""),children:[E(LL,{checked:N.some((t=>t.value===e.value))}),e.label]},e.value))),0===P.length&&E("li",{className:"px-4 py-14 text-center text-input-text",children:"Not found"})]}))]})}));function tq(e,[t,n]){return Math.min(n,Math.max(t,e))}var nq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function rq(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var oq=["PageUp","PageDown"],aq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iq={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},lq="Slider",[sq,cq,dq]=function(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},rq(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}(lq),[uq]=nL(lq,[dq]),[fq,hq]=uq(lq),mq=e.forwardRef(((t,n)=>{const{name:r,min:o=0,max:a=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[o],value:u,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:m=!1,form:p,...g}=t,v=e.useRef(new Set),w=e.useRef(0),b="horizontal"===l?vq:wq,[y=[],x]=iL({prop:u,defaultProp:d,onChange:e=>{const t=[...v.current];t[w.current]?.focus(),f(e)}}),C=e.useRef(y);function k(e,t,{commit:n}={commit:!1}){const r=function(e){return(String(e).split(".")[1]||"").length}(i),l=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-o)/i)*i+o,r),s=tq(l,[o,a]);x(((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort(((e,t)=>e-t))}(e,s,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map(((t,n)=>e[n+1]-t))}(e);return Math.min(...n)>=t}return!0}(r,c*i)){w.current=r.indexOf(s);const t=String(r)!==String(e);return t&&n&&h(r),t?r:e}return e}))}return E(fq,{scope:t.__scopeSlider,name:r,disabled:s,min:o,max:a,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:l,form:p,children:E(sq.Provider,{scope:t.__scopeSlider,children:E(sq.Slot,{scope:t.__scopeSlider,children:E(b,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:n,onPointerDown:oL(g.onPointerDown,(()=>{s||(C.current=y)})),min:o,max:a,inverted:m,onSlideStart:s?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map((e=>Math.abs(e-t))),r=Math.min(...n);return n.indexOf(r)}(y,e);k(e,t)},onSlideMove:s?void 0:function(e){k(e,w.current)},onSlideEnd:s?void 0:function(){const e=C.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!s&&k(o,0,{commit:!0}),onEndKeyDown:()=>!s&&k(a,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){const n=oq.includes(e.key)||e.shiftKey&&aq.includes(e.key)?10:1,r=w.current;k(y[r]+i*n*t,r,{commit:!0})}}})})})})}));mq.displayName=lq;var[pq,gq]=uq(lq,{startEdge:"left",endEdge:"right",size:"width",direction:1}),vq=e.forwardRef(((t,n)=>{const{min:r,max:o,dir:a,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:c,onStepKeyDown:d,...u}=t,[f,h]=e.useState(null),m=tL(n,(e=>h(e))),p=e.useRef(),g=FP(a),v="ltr"===g,w=v&&!i||!v&&i;function b(e){const t=p.current||f.getBoundingClientRect(),n=Aq([0,t.width],w?[r,o]:[o,r]);return p.current=t,n(e-t.left)}return E(pq,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:E(bq,{dir:g,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=b(e.clientX);l?.(t)},onSlideMove:e=>{const t=b(e.clientX);s?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{const t=iq[w?"from-left":"from-right"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})})),wq=e.forwardRef(((t,n)=>{const{min:r,max:o,inverted:a,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:c,...d}=t,u=e.useRef(null),f=tL(n,u),h=e.useRef(),m=!a;function p(e){const t=h.current||u.current.getBoundingClientRect(),n=Aq([0,t.height],m?[o,r]:[r,o]);return h.current=t,n(e-t.top)}return E(pq,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:E(bq,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=p(e.clientY);i?.(t)},onSlideMove:e=>{const t=p(e.clientY);l?.(t)},onSlideEnd:()=>{h.current=void 0,s?.()},onStepKeyDown:e=>{const t=iq[m?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})})),bq=e.forwardRef(((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:s,...c}=e,d=hq(lq,n);return E(nq.span,{...c,ref:t,onKeyDown:oL(e.onKeyDown,(e=>{"Home"===e.key?(i(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):oq.concat(aq).includes(e.key)&&(s(e),e.preventDefault())})),onPointerDown:oL(e.onPointerDown,(e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus():r(e)})),onPointerMove:oL(e.onPointerMove,(e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)})),onPointerUp:oL(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))}))})})),yq="SliderTrack",xq=e.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,o=hq(yq,n);return E(nq.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})}));xq.displayName=yq;var Eq="SliderRange",Cq=e.forwardRef(((t,n)=>{const{__scopeSlider:r,...o}=t,a=hq(Eq,r),i=gq(Eq,r),l=tL(n,e.useRef(null)),s=a.values.length,c=a.values.map((e=>Oq(e,a.min,a.max))),d=s>1?Math.min(...c):0,u=100-Math.max(...c);return E(nq.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...o,ref:l,style:{...t.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})}));Cq.displayName=Eq;var kq="SliderThumb",Mq=e.forwardRef(((t,n)=>{const r=cq(t.__scopeSlider),[o,a]=e.useState(null),i=tL(n,(e=>a(e))),l=e.useMemo((()=>o?r().findIndex((e=>e.ref.current===o)):-1),[r,o]);return E(Rq,{...t,ref:i,index:l})})),Rq=e.forwardRef(((t,n)=>{const{__scopeSlider:r,index:o,name:a,...i}=t,l=hq(kq,r),s=gq(kq,r),[c,d]=e.useState(null),u=tL(n,(e=>d(e))),f=!c||(l.form||!!c.closest("form")),h=cL(c),m=l.values[o],p=void 0===m?0:Oq(m,l.min,l.max),g=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(o,l.values.length),v=h?.[s.size],w=v?function(e,t,n){const r=e/2,o=Aq([0,50],[0,r]);return(r-o(t)*n)*n}(v,p,s.direction):0;return e.useEffect((()=>{if(c)return l.thumbs.add(c),()=>{l.thumbs.delete(c)}}),[c,l.thumbs]),C("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${p}% + ${w}px)`},children:[E(sq.ItemSlot,{scope:t.__scopeSlider,children:E(nq.span,{role:"slider","aria-label":t["aria-label"]||g,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:u,style:void 0===m?{display:"none"}:t.style,onFocus:oL(t.onFocus,(()=>{l.valueIndexToChangeRef.current=o}))})}),f&&E(Iq,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},o)]})}));Mq.displayName=kq;var Iq=t=>{const{value:n,...r}=t,o=e.useRef(null),a=lL(n);return e.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(a!==n&&r){const t=new Event("input",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[a,n]),E("input",{style:{display:"none"},...r,ref:o,defaultValue:n})};function Oq(e,t,n){return tq(100/(n-t)*(e-t),[0,100])}function Aq(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var Lq=mq,Sq=xq,Nq=Cq,jq=Mq;const Dq=e.forwardRef(((e,t)=>{var{className:n,trackClassName:r,rangeClassName:o,thumbClassName:a,thumbStyle:i,trackStyle:l,rangeStyle:s}=e,c=IC(e,["className","trackClassName","rangeClassName","thumbClassName","thumbStyle","trackStyle","rangeStyle"]);return C(Lq,Object.assign({ref:t,className:LC("relative flex w-full touch-none select-none items-center",n)},c,{children:[E(Sq,{className:LC("relative h-2 w-full grow overflow-hidden rounded-full bg-grey-50",r),style:l,children:E(Nq,{className:LC("absolute h-full bg-primary",o),style:s})}),E(jq,{className:LC("block h-5 w-5 cursor-pointer rounded-full border-[3px] border-primary bg-bg-bg1 outline-none ring-0 transition-colors disabled:pointer-events-none disabled:opacity-50",a),style:i})]}))}));Dq.displayName=Lq.displayName;var Zq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});var Vq,Tq="dismissableLayer.update",Bq="dismissableLayer.pointerDownOutside",Fq="dismissableLayer.focusOutside",Pq=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hq=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(Pq),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){Wq(Bq,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){Wq(Fq,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Vq=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),_q(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Vq)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),_q())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Tq,e),()=>document.removeEventListener(Tq,e)}),[]),E(Zq.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));Hq.displayName="DismissableLayer";function _q(){const e=new CustomEvent(Tq);document.dispatchEvent(e)}function Wq(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(Pq),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Zq.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var zq=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(Zq.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));zq.displayName="Arrow";var $q=zq;function Uq(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var qq="Popper",[Gq,Yq]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Uq(o,...n)]}(qq),[Kq,Xq]=Gq(qq),Qq=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(Kq,{scope:n,anchor:o,onAnchorChange:a,children:r})};Qq.displayName=qq;var Jq="PopperAnchor",eG=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=Xq(Jq,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(Zq.div,{...a,ref:s})}));eG.displayName=Jq;var tG="PopperContent",[nG,rG]=Gq(tG),oG=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=Xq(tG,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(sG),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),cG({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=dG(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(nG,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(Zq.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));oG.displayName=tG;var aG="PopperArrow",iG={top:"bottom",right:"left",bottom:"top",left:"right"},lG=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=rG(aG,n),a=iG[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E($q,{...r,ref:t,style:{...r.style,display:"block"}})})}));function sG(e){return null!==e}lG.displayName=aG;var cG=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=dG(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function dG(e){const[t,n="center"]=e.split("-");return[t,n]}var uG=Qq,fG=eG,hG=oG,mG=lG;var pG=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=gG(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=gG(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=gG(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=gG(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function gG(e){return e?.animationName||"none"}pG.displayName="Presence";var vG=e.forwardRef(((e,t)=>E(Zq.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));vG.displayName="VisuallyHidden";var wG=vG,[bG]=nL("Tooltip",[Yq]),yG=Yq(),xG="TooltipProvider",EG=700,CG="tooltip.open",[kG,MG]=bG(xG),RG=t=>{const{__scopeTooltip:n,delayDuration:r=EG,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=t,[l,s]=e.useState(!0),c=e.useRef(!1),d=e.useRef(0);return e.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),E(kG,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:e.useCallback((()=>{window.clearTimeout(d.current),s(!1)}),[]),onClose:e.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>s(!0)),o)}),[o]),isPointerInTransitRef:c,onPointerInTransitChange:e.useCallback((e=>{c.current=e}),[]),disableHoverableContent:a,children:i})};RG.displayName=xG;var IG="Tooltip",[OG,AG]=bG(IG),LG=t=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:s}=t,c=MG(IG,t.__scopeTooltip),d=yG(n),[u,f]=e.useState(null),h=Gj(),m=e.useRef(0),p=l??c.disableHoverableContent,g=s??c.delayDuration,v=e.useRef(!1),[w=!1,b]=iL({prop:o,defaultProp:a,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(CG))):c.onClose(),i?.(e)}}),y=e.useMemo((()=>w?v.current?"delayed-open":"instant-open":"closed"),[w]),x=e.useCallback((()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)}),[b]),C=e.useCallback((()=>{window.clearTimeout(m.current),m.current=0,b(!1)}),[b]),k=e.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{v.current=!0,b(!0),m.current=0}),g)}),[g,b]);return e.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),E(uG,{...d,children:E(OG,{scope:n,contentId:h,open:w,stateAttribute:y,trigger:u,onTriggerChange:f,onTriggerEnter:e.useCallback((()=>{c.isOpenDelayed?k():x()}),[c.isOpenDelayed,k,x]),onTriggerLeave:e.useCallback((()=>{p?C():(window.clearTimeout(m.current),m.current=0)}),[C,p]),onOpen:x,onClose:C,disableHoverableContent:p,children:r})})};LG.displayName=IG;var SG="TooltipTrigger",NG=e.forwardRef(((t,n)=>{const{__scopeTooltip:r,...o}=t,a=AG(SG,r),i=MG(SG,r),l=yG(r),s=tL(n,e.useRef(null),a.onTriggerChange),c=e.useRef(!1),d=e.useRef(!1),u=e.useCallback((()=>c.current=!1),[]);return e.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),E(fG,{asChild:!0,...l,children:E(Zq.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:s,onPointerMove:oL(t.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))})),onPointerLeave:oL(t.onPointerLeave,(()=>{a.onTriggerLeave(),d.current=!1})),onPointerDown:oL(t.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:oL(t.onFocus,(()=>{c.current||a.onOpen()})),onBlur:oL(t.onBlur,a.onClose),onClick:oL(t.onClick,a.onClose)})})}));NG.displayName=SG;var[jG,DG]=bG("TooltipPortal",{forceMount:void 0}),ZG="TooltipContent",VG=e.forwardRef(((e,t)=>{const n=DG(ZG,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=AG(ZG,e.__scopeTooltip);return E(pG,{present:r||i.open,children:i.disableHoverableContent?E(PG,{side:o,...a,ref:t}):E(TG,{side:o,...a,ref:t})})})),TG=e.forwardRef(((t,n)=>{const r=AG(ZG,t.__scopeTooltip),o=MG(ZG,t.__scopeTooltip),a=e.useRef(null),i=tL(n,a),[l,s]=e.useState(null),{trigger:c,onClose:d}=r,u=a.current,{onPointerInTransitChange:f}=o,h=e.useCallback((()=>{s(null),f(!1)}),[f]),m=e.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);s(a),f(!0)}),[f]);return e.useEffect((()=>()=>h()),[h]),e.useEffect((()=>{if(c&&u){const e=e=>m(e,u),t=e=>m(e,c);return c.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[c,u,m,h]),e.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e].x,l=t[e].y,s=t[a].x,c=t[a].y;l>r!=c>r&&n<(s-i)*(r-l)/(c-l)+i&&(o=!o)}return o}(n,l);r?h():o&&(h(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,u,l,d,h]),E(PG,{...t,ref:i})})),[BG,FG]=bG(IG,{isInside:!1}),PG=e.forwardRef(((t,n)=>{const{__scopeTooltip:r,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...s}=t,c=AG(ZG,r),d=yG(r),{onClose:u}=c;return e.useEffect((()=>(document.addEventListener(CG,u),()=>document.removeEventListener(CG,u))),[u]),e.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,u]),E(Hq,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:C(hG,{"data-state":c.stateAttribute,...d,...s,ref:n,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E(mL,{children:o}),E(BG,{scope:r,isInside:!0,children:E(wG,{id:c.contentId,role:"tooltip",children:a||o})})]})})}));VG.displayName=ZG;var HG="TooltipArrow",_G=e.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,o=yG(n);return FG(HG,n).isInside?null:E(mG,{...o,...r,ref:t})}));_G.displayName=HG;var WG=VG;const zG=RG,$G=LG,UG=NG,qG=_G,GG=e.forwardRef(((e,t)=>{var{className:n,sideOffset:r=4}=e,o=IC(e,["className","sideOffset"]);return E(WG,Object.assign({ref:t,sideOffset:r,className:LC("z-50 overflow-hidden rounded-md bg-common-black px-3 py-1.5 typography-buttonMS text-common-white shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},o))}));function YG(e){var{children:t,content:n,open:r,defaultOpen:o,onOpenChange:a}=e,i=IC(e,["children","content","open","defaultOpen","onOpenChange"]);return E(zG,{children:C($G,{open:r,defaultOpen:o,onOpenChange:a,children:[E(UG,{asChild:!0,children:t}),C(GG,Object.assign({side:"top",align:"center"},i,{children:[n,E(qG,{width:11,height:5})]}))]})})}function KG(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}GG.displayName=WG.displayName;var XG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function QG(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}var JG,eY="dismissableLayer.update",tY="dismissableLayer.pointerDownOutside",nY="dismissableLayer.focusOutside",rY=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oY=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(rY),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){lY(tY,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){lY(nY,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(JG=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),iY(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=JG)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),iY())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(eY,e),()=>document.removeEventListener(eY,e)}),[]),E(XG.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));oY.displayName="DismissableLayer";var aY=e.forwardRef(((t,n)=>{const r=e.useContext(rY),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(XG.div,{...t,ref:a})}));function iY(){const e=new CustomEvent(eY);document.dispatchEvent(e)}function lY(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?QG(o,a):o.dispatchEvent(a)}aY.displayName="DismissableLayerBranch";var sY=oY,cY=aY,dY=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(XG.div,{...o,ref:n}),l):null}));dY.displayName="Portal";var uY=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=fY(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=fY(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=fY(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=fY(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function fY(e){return e?.animationName||"none"}uY.displayName="Presence";var hY=e.forwardRef(((e,t)=>E(XG.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));hY.displayName="VisuallyHidden";var mY="ToastProvider",[pY,gY,vY]=function(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},KG(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}("Toast"),[wY]=nL("Toast",[vY]),[bY,yY]=wY(mY),xY=t=>{const{__scopeToast:n,label:r="Notification",duration:o=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:l}=t,[s,c]=e.useState(null),[d,u]=e.useState(0),f=e.useRef(!1),h=e.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${mY}\`. Expected non-empty \`string\`.`),E(pY.Provider,{scope:n,children:E(bY,{scope:n,label:r,duration:o,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:s,onViewportChange:c,onToastAdd:e.useCallback((()=>u((e=>e+1))),[]),onToastRemove:e.useCallback((()=>u((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:l})})};xY.displayName=mY;var EY="ToastViewport",CY=["F8"],kY="toast.viewportPause",MY="toast.viewportResume",RY=e.forwardRef(((t,n)=>{const{__scopeToast:r,hotkey:o=CY,label:a="Notifications ({hotkey})",...i}=t,l=yY(EY,r),s=gY(r),c=e.useRef(null),d=e.useRef(null),u=e.useRef(null),f=e.useRef(null),h=tL(n,f,l.onViewportChange),m=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=l.toastCount>0;e.useEffect((()=>{const e=e=>{0!==o.length&&o.every((t=>e[t]||e.code===t))&&f.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[o]),e.useEffect((()=>{const e=c.current,t=f.current;if(p&&e&&t){const n=()=>{if(!l.isClosePausedRef.current){const e=new CustomEvent(kY);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(MY);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",a),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",a),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}}),[p,l.isClosePausedRef]);const g=e.useCallback((({tabbingDirection:e})=>{const t=s().map((t=>{const n=t.ref.current,r=[n,...$Y(n)];return"forwards"===e?r:r.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[s]);return e.useEffect((()=>{const e=f.current;if(e){const t=t=>{const n=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!n){const n=document.activeElement,r=t.shiftKey;if(t.target===e&&r)return void d.current?.focus();const o=g({tabbingDirection:r?"backwards":"forwards"}),a=o.findIndex((e=>e===n));UY(o.slice(a+1))?t.preventDefault():r?d.current?.focus():u.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[s,g]),C(cY,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&E(OY,{ref:d,onFocusFromOutsideViewport:()=>{UY(g({tabbingDirection:"forwards"}))}}),E(pY.Slot,{scope:r,children:E(XG.ol,{tabIndex:-1,...i,ref:h})}),p&&E(OY,{ref:u,onFocusFromOutsideViewport:()=>{UY(g({tabbingDirection:"backwards"}))}})]})}));RY.displayName=EY;var IY="ToastFocusProxy",OY=e.forwardRef(((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,a=yY(IY,n);return E(hY,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!a.viewport?.contains(t)&&r()}})}));OY.displayName=IY;var AY="Toast",LY=e.forwardRef(((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...i}=e,[l=!0,s]=iL({prop:r,defaultProp:o,onChange:a});return E(uY,{present:n||l,children:E(jY,{open:l,...i,ref:t,onClose:()=>s(!1),onPause:aL(e.onPause),onResume:aL(e.onResume),onSwipeStart:oL(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:oL(e.onSwipeMove,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)})),onSwipeCancel:oL(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:oL(e.onSwipeEnd,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),s(!1)}))})})}));LY.displayName=AY;var[SY,NY]=wY(AY,{onClose(){}}),jY=e.forwardRef(((t,n)=>{const{__scopeToast:r,type:o="foreground",duration:a,open:i,onClose:l,onEscapeKeyDown:s,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...p}=t,g=yY(AY,r),[v,w]=e.useState(null),b=tL(n,(e=>w(e))),y=e.useRef(null),x=e.useRef(null),M=a||g.duration,R=e.useRef(0),O=e.useRef(M),A=e.useRef(0),{onToastAdd:L,onToastRemove:S}=g,N=aL((()=>{const e=v?.contains(document.activeElement);e&&g.viewport?.focus(),l()})),j=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(A.current),R.current=(new Date).getTime(),A.current=window.setTimeout(N,e))}),[N]);e.useEffect((()=>{const e=g.viewport;if(e){const t=()=>{j(O.current),d?.()},n=()=>{const e=(new Date).getTime()-R.current;O.current=O.current-e,window.clearTimeout(A.current),c?.()};return e.addEventListener(kY,n),e.addEventListener(MY,t),()=>{e.removeEventListener(kY,n),e.removeEventListener(MY,t)}}}),[g.viewport,M,c,d,j]),e.useEffect((()=>{i&&!g.isClosePausedRef.current&&j(M)}),[i,M,g.isClosePausedRef,j]),e.useEffect((()=>(L(),()=>S())),[L,S]);const D=e.useMemo((()=>v?_Y(v):null),[v]);return g.viewport?C(k,{children:[D&&E(DY,{__scopeToast:r,role:"status","aria-live":"foreground"===o?"assertive":"polite","aria-atomic":!0,children:D}),E(SY,{scope:r,onClose:N,children:I.createPortal(E(pY.ItemSlot,{scope:r,children:E(sY,{asChild:!0,onEscapeKeyDown:oL(s,(()=>{g.isFocusedToastEscapeKeyDownRef.current||N(),g.isFocusedToastEscapeKeyDownRef.current=!1})),children:E(XG.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...p,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:oL(t.onKeyDown,(e=>{"Escape"===e.key&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,N()))})),onPointerDown:oL(t.onPointerDown,(e=>{0===e.button&&(y.current={x:e.clientX,y:e.clientY})})),onPointerMove:oL(t.onPointerMove,(e=>{if(!y.current)return;const t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=Boolean(x.current),o=["left","right"].includes(g.swipeDirection),a=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,i=o?a(0,t):0,l=o?0:a(0,n),s="touch"===e.pointerType?10:2,c={x:i,y:l},d={originalEvent:e,delta:c};r?(x.current=c,WY("toast.swipeMove",f,d,{discrete:!1})):zY(c,g.swipeDirection,s)?(x.current=c,WY("toast.swipeStart",u,d,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>s||Math.abs(n)>s)&&(y.current=null)})),onPointerUp:oL(t.onPointerUp,(e=>{const t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,y.current=null,t){const n=e.currentTarget,r={originalEvent:e,delta:t};zY(t,g.swipeDirection,g.swipeThreshold)?WY("toast.swipeEnd",m,r,{discrete:!0}):WY("toast.swipeCancel",h,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),g.viewport)})]}):null})),DY=t=>{const{__scopeToast:n,children:r,...o}=t,a=yY(AY,n),[i,l]=e.useState(!1),[s,c]=e.useState(!1);return function(e=()=>{}){const t=aL(e);sL((()=>{let e=0,n=0;return e=window.requestAnimationFrame((()=>n=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}}),[t])}((()=>l(!0))),e.useEffect((()=>{const e=window.setTimeout((()=>c(!0)),1e3);return()=>window.clearTimeout(e)}),[]),s?null:E(dY,{asChild:!0,children:E(hY,{...o,children:i&&C(k,{children:[a.label," ",r]})})})},ZY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e;return E(XG.div,{...r,ref:t})}));ZY.displayName="ToastTitle";var VY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e;return E(XG.div,{...r,ref:t})}));VY.displayName="ToastDescription";var TY="ToastAction",BY=e.forwardRef(((e,t)=>{const{altText:n,...r}=e;return n.trim()?E(HY,{altText:n,asChild:!0,children:E(PY,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${TY}\`. Expected non-empty \`string\`.`),null)}));BY.displayName=TY;var FY="ToastClose",PY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e,o=NY(FY,n);return E(HY,{asChild:!0,children:E(XG.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,o.onClose)})})}));PY.displayName=FY;var HY=e.forwardRef(((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return E(XG.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})}));function _Y(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const n=e.ariaHidden||e.hidden||"none"===e.style.display,r=""===e.dataset.radixToastAnnounceExclude;if(!n)if(r){const n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(..._Y(e))}})),t}function WY(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?QG(o,a):o.dispatchEvent(a)}var zY=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),a=r>o;return"left"===t||"right"===t?a&&r>n:!a&&o>n};function $Y(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function UY(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var qY=xY,GY=RY,YY=LY,KY=ZY,XY=VY,QY=BY,JY=PY;const eK=M(["group pointer-events-auto relative flex w-full","rounded-lg shadow-[0px_8px_16px_0px_rgba(0,0,0,0.08)] px-4 py-3 gap-1","transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full","bg-modal-surface text-text-contrast-low"],{variants:{variant:{default:"",success:"",info:"",warning:"",error:""},showBorder:{true:"",false:"border-transparent"}},compoundVariants:[{variant:"default",showBorder:!0,className:"border"},{variant:"success",showBorder:!0,className:"border border-success-stroke"},{variant:"info",showBorder:!0,className:"border border-info-stroke"},{variant:"warning",showBorder:!0,className:"border border-warning-stroke"},{variant:"error",showBorder:!0,className:"border border-error-stroke"}],defaultVariants:{variant:"success",showBorder:!1}}),tK=M(["fixed z-[1000] flex w-auto flex-col-reverse px-4"],{variants:{position:{"top-center":"top-[40px] left-0 right-0 justify-self-center","top-left":"top-[40px] left-0 md:left-[40px]","top-right":"top-[40px] right-0 md:right-[40px]","bottom-center":"bottom-[40px] left-0 right-0 justify-self-center","bottom-left":"bottom-[40px] left-0 md:left-[40px]","bottom-right":"bottom-[40px] right-0 md:right-[40px]"}},defaultVariants:{position:"top-center"}}),nK=M(["flex items-center justify-center mr-2 rounded-full size-7"],{variants:{variant:{default:"text-text-g-contrast-high",success:"bg-success-transparent-8 text-success",info:"bg-info-transparent-8 text-info",warning:"bg-warning-transparent-8 text-warning",error:"bg-error-transparent-8 text-error"}},defaultVariants:{variant:"success"}}),rK=M(["flex flex-1"],{variants:{contentMode:{horizontal:"items-center flex-row gap-2",vertical:"items-start flex-col gap-0"}},defaultVariants:{contentMode:"vertical"}}),oK=qY,aK=e.forwardRef(((e,t)=>{var{className:n,position:r}=e,o=IC(e,["className","position"]);return E(GY,Object.assign({ref:t,className:LC(tK({position:r}),n)},o))}));aK.displayName=GY.displayName;const iK=e.forwardRef(((e,t)=>{var{className:n,variant:r,showBorder:o}=e,a=IC(e,["className","variant","showBorder"]);return E(YY,Object.assign({ref:t,className:LC(eK({variant:r,showBorder:o}),n)},a))}));iK.displayName=YY.displayName;const lK=e.forwardRef(((e,t)=>{var{className:n,children:r}=e,o=IC(e,["className","children"]);return E(QY,Object.assign({ref:t,className:LC("",n)},o,{asChild:!0,children:E(NC,{variant:"outline",color:"secondary",size:"sm",children:r})}))}));lK.displayName=QY.displayName;const sK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(JY,Object.assign({ref:t,className:LC("self-center text-text-g-contrast-high",n),"toast-close":""},r,{asChild:!0,children:E(Zk,{variant:"icon",size:"sm",children:E(Ek,{type:"heroicons",name:"xmark"})})}))}));sK.displayName=JY.displayName;const cK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KY,Object.assign({ref:t,className:LC("typography-subtitle6",n)},r))}));cK.displayName=KY.displayName;const dK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(XY,Object.assign({ref:t,className:LC("typography-subtitle4 text-text-g-contrast-high",n)},r))}));dK.displayName=XY.displayName;let uK=0;const fK=new Map,hK=e=>{if(fK.has(e))return;const t=setTimeout((()=>{fK.delete(e),vK({type:"REMOVE_TOAST",toastId:e})}),3e3);fK.set(e,t)},mK=(e,t)=>{switch(t.type){case"ADD_TOAST":return Object.assign(Object.assign({},e),{toasts:[t.toast,...e.toasts].slice(0,1)});case"UPDATE_TOAST":return Object.assign(Object.assign({},e),{toasts:e.toasts.map((e=>e.id===t.toast.id?Object.assign(Object.assign({},e),t.toast):e))});case"DISMISS_TOAST":{const{toastId:n}=t;return n?hK(n):e.toasts.forEach((e=>{hK(e.id)})),Object.assign(Object.assign({},e),{toasts:e.toasts.map((e=>e.id===n||void 0===n?Object.assign(Object.assign({},e),{open:!1}):e))})}case"REMOVE_TOAST":return void 0===t.toastId?Object.assign(Object.assign({},e),{toasts:[]}):Object.assign(Object.assign({},e),{toasts:e.toasts.filter((e=>e.id!==t.toastId))});case"ADD_POSITION":return Object.assign(Object.assign({},e),{position:t.position})}},pK=[];let gK={toasts:[],position:void 0};function vK(e){gK=mK(gK,e),pK.forEach((e=>{e(gK)}))}function wK(e){var t=IC(e,[]);const n=(uK=(uK+1)%Number.MAX_SAFE_INTEGER,uK.toString()),r=()=>vK({type:"DISMISS_TOAST",toastId:n});return vK({type:"ADD_TOAST",toast:Object.assign(Object.assign({},t),{id:n,open:!0,onOpenChange:e=>{var n;e||(r(),null===(n=null==t?void 0:t.onClose)||void 0===n||n.call(t))}})}),{id:n,dismiss:r,update:e=>vK({type:"UPDATE_TOAST",toast:Object.assign(Object.assign({},e),{id:n})})}}function bK(t){const[n,r]=e.useState(gK);return e.useEffect((()=>(pK.push(r),()=>{const e=pK.indexOf(r);e>-1&&pK.splice(e,1)})),[n]),e.useEffect((()=>{vK({type:"ADD_POSITION",position:null==t?void 0:t.position})}),[null==t?void 0:t.position]),Object.assign(Object.assign({},n),{toast:wK,dismiss:e=>vK({type:"DISMISS_TOAST",toastId:e})})}function yK(e){var{viewportClassName:t,titleClassName:n,descriptionClassName:r,contentClassName:o,iconWrapperClassName:a,actionWrapperClassName:i}=e,l=IC(e,["viewportClassName","titleClassName","descriptionClassName","contentClassName","iconWrapperClassName","actionWrapperClassName"]);const{toasts:s,position:c}=bK();return C(oK,Object.assign({},l,{children:[s.map((function(e){var{id:t,title:l,description:s,action:c,contentMode:d="horizontal",iconProps:u,renderIcon:f}=e,h=IC(e,["id","title","description","action","contentMode","iconProps","renderIcon"]);const m="error"===h.variant?"circle-x":"warning"===h.variant?"circle-alert":"info"===h.variant?"info":"circle-check",p="error"===h.variant?"text-error":"warning"===h.variant?"text-warning":"info"===h.variant?"text-info":"success"===h.variant?"text-success":"text-text-g-contrast-high";return C(iK,Object.assign({},h,{children:[E("div",{className:LC(nK({variant:h.variant}),a),children:f?null==f?void 0:f():E(Ek,Object.assign({type:"lucide",name:m,className:"size-[22px]"},u))}),C("div",{className:LC(rK({contentMode:d}),o),children:[l&&E(cK,{className:LC(p,n),children:l}),s&&E(dK,{className:r,children:s})]}),c?E("div",{className:LC("self-center mx-5",i),children:c}):null,E(sK,{})]}),t)})),E(aK,{position:c,className:t})]}))}const xK=({id:e,title:t,classes:n,children:r,isFirstLevel:a=!1,isLeaf:i=!1,disabled:l,icon:c,showIcon:u,showExpandButton:f,enableSeparatorLine:h=!0,isLastItem:m,checkable:p,checkIsExpanded:g,checkIsChecked:v,checkAutoDisabled:w,checkIsLoading:b,onExpandChange:y,onCheckedChange:x,onClickItem:k,renderIcon:M,renderElement:R,renderTitle:I,renderRightSection:O,lineSize:A=2,horizontalLineWidth:L=4,expandButtonSize:S=30,spacing:N=2,currentLevel:j=1,maxLevel:D=10,notifyClickItem:Z,itemData:V})=>{const T=s((()=>null==b?void 0:b(e)),[b,e]),B=s((()=>v(e)),[v,e]),F=s((()=>g(e)),[g,e]),P=s((()=>!!(null==r?void 0:r.length)),[r]),H=s((()=>(void 0!==f?f:P)&&j<(D||1/0)),[P,f,D,j]),_=s((()=>!!p&&!i),[p,i]),W=i?21.328:0,z=s((()=>({branch:{width:A,borderBottomLeftRadius:m?A/2:0},horizontalLine:{height:A,width:A+L+(H?0:S+N)+W,marginLeft:-A,borderBottomLeftRadius:A/2},expandButton:{width:S,height:S},childPadding:{paddingLeft:a?S/2-A/2:S/2+L-A/2}})),[A,L,S,N,a,m,H,W]),$=o((()=>{null==y||y(e,!F,V)}),[e,F,y,V]);d((()=>{!F||T||P||$()}),[T,$]);const U=o((()=>{null==k||k(e,V),null==Z||Z(e,V)}),[e,F,k,Z,V]),q=E(Ek,{name:F?"folder-open":"folder",className:"fill-warning size-[18px]"}),G=null!=c?c:null==M?void 0:M({id:e,expanded:F,selected:B}),Y=null==O?void 0:O({id:e,expanded:F,selected:B}),K=I?I({id:e,title:t,expanded:F,selected:B}):t;return X=E("div",{className:LC("flex flex-row w-full",null==n?void 0:n.elementWrapper),children:C("div",{className:LC("flex flex-col w-full",null==n?void 0:n.itemWrapper),children:[C("div",{className:LC("flex flex-row flex-1",null==n?void 0:n.rowWrapperClasses),children:[C("div",{className:LC("flex flex-col h-full",null==n?void 0:n.columnWrapperClasses),children:[!a&&E("div",{className:LC("flex w-[2px] h-1/2 bg-grey-150",null==n?void 0:n.branch),style:z.branch}),!a&&!m&&(F&&(P||T)||!F)&&E("div",{className:LC("flex w-[2px] h-1/2 bg-grey-150",null==n?void 0:n.branch),style:z.branch})]}),C("div",{className:LC("flex flex-1 items-center py-2 min-h-10",null==n?void 0:n.itemContainer),children:[!a&&E("div",{className:LC("bg-grey-150",null==n?void 0:n.horizontalLine),style:z.horizontalLine}),a&&!H&&E("div",{className:LC("flex mr-[2px]",null==n?void 0:n.expandButton),style:z.expandButton}),H&&E("div",{className:LC("flex mr-[2px]",null==n?void 0:n.expandButton),style:z.expandButton,onClick:!T&&$,children:E(Zk,{variant:"icon",size:"sm",children:T?E(SC,{}):E(Ek,{name:F?"chevron-down":"chevron-right"})})}),_?E(LL,{id:e,className:LC("size-[16px]",null==n?void 0:n.checkbox),checked:B,disabled:l,onCheckedChange:t=>null==x?void 0:x(e,t,V)}):E("div",{className:a&&p?LC("size-[16px]",null==n?void 0:n.checkbox):""}),C("div",{className:LC("ml-2 gap-1 flex flex-1 items-center text-common-black",null==n?void 0:n.item),onClick:U,children:[u?G||q:null,E("div",{className:LC("flex flex-1 cursor-pointer text-subtitle5 text-ellipsis overflow-hidden break-all text-left",null==n?void 0:n.title),children:K})]}),Y]})]}),F&&P&&j<(D||1/0)&&C("div",{className:LC("flex flex-row overflow-hidden",null==n?void 0:n.expandedChildrenWrapper),children:[!a&&!m&&E("div",{className:LC("flex w-[2px] h-full bg-grey-150",null==n?void 0:n.branch),style:z.branch}),E("div",{className:LC("flex flex-col overflow-hidden",null==n?void 0:n.expandedChildrenWrapperInner),style:z.childPadding,children:null==r?void 0:r.map(((e,t)=>E(xK,Object.assign({classes:n,isLastItem:t===r.length-1,checkIsExpanded:g,checkIsChecked:v,checkAutoDisabled:w,checkIsLoading:b,onExpandChange:y,onCheckedChange:x,renderIcon:M,renderElement:R,renderTitle:I,disabled:w(e.id),showIcon:u,lineSize:A,horizontalLineWidth:L,expandButtonSize:S,spacing:N,notifyClickItem:Z,maxLevel:D,currentLevel:j+1,checkable:p},e),e.id)))})]}),h&&a&&!m&&E("div",{className:LC("bg-grey-150 w-full h-[2px] rounded",null==n?void 0:n.separatorLine)})]})}),R?R({id:e,expanded:F,selected:B,children:X,styles:z,onClick:U}):X;var X};function EK(e){const t=r();return d((()=>{t.current=e})),t.current}const CK=({classes:e,data:t,defaultExpandedId:n,defaultCheckedId:r,checkedId:a,loadingId:i,lineSize:l,horizontalLineWidth:s,expandButtonSize:u,spacing:f,renderIcon:h,renderRightSection:m,renderElement:p,renderTitle:g,onExpandChange:v,onCheckedChange:w,onClickItem:b,onCheckedItem:y,defaultExpandAll:x=!1,defaultCheckAll:C=!1,hierarchicalCheck:k=!1,showIcon:M=!0,disabled:R,enableSeparatorLine:I=!0,checkable:O=!0,maxLevel:A,mode:L="checkbox",autoDisabled:S=!1,checkedAll:N=!1})=>{const[j,D]=c({}),[Z,V]=c({}),T=(e,t)=>{e.forEach((e=>{t(e),e.children&&T(e.children,t)}))};d((()=>{if(t.length&&x){const e={};T(t,(t=>{e[t.id]=!0})),V(e)}else if(null==n?void 0:n.length){const e=n.reduce(((e,t)=>(e[t]=!0,e)),{});V(e)}}),[t,n,x]),d((()=>{var e;if(t.length&&C){const e={};T(t,(t=>{e[t.id]=!0})),D(e)}else if(0===(null===(e=Object.keys(j))||void 0===e?void 0:e.length)&&(null==r?void 0:r.length)){const e=r.reduce(((e,t)=>(e[t]=!0,e)),{});D(e)}}),[t,r,C]),d((()=>{void 0!==a&&D(a.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:!0})),{}))}),[a]),d((()=>{if(!k)return;const e={},n=(r,o)=>{T(t,(t=>{t.id===r&&t.children&&t.children.forEach((t=>{e[t.id]=o,n(t.id,o)}))}))};D((t=>(Object.keys(t).filter((e=>t[e])).map((e=>{n(e,!0)})),Object.assign(Object.assign({},t),e))))}),[t,k]);const B=EK(N);d((()=>{if(void 0!==B&&B!==N)if(N){const e={};T(t,(t=>{t.id&&(e[t.id]=!0)})),D(e),null==w||w(e,void 0,null)}else{let e={};D((t=>(e=Object.keys(t).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:!1})),{}),e))),null==w||w(e,void 0,null)}}),[t,N,B]);const F=o(((e,t,n)=>{null==v||v(e,t,n),V((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[v]),P=o(((e,n,r)=>{if("radio"===L){let t={[e]:n};return null==y||y(e,n,r),D(t),void(null==w||w(t,e,r))}null==y||y(e,n,r);let o=Object.assign(Object.assign({},j),{[e]:n});if(k){o=((e,n,r)=>{r[e]=n;const o=(e,n)=>{T(t,(t=>{t.id===e&&t.children&&t.children.forEach((e=>{r[e.id]=n,o(e.id,n)}))}))},a=(e,n)=>{T(t,(t=>{var r;if(null===(r=t.children)||void 0===r?void 0:r.some((t=>t.id===e))){const e=t.children.every((e=>n[e.id]));n[t.id]=e,a(t.id,n)}}))};return o(e,n),a(e,r),r})(e,n,o)}D(o),w&&(null==w||w(o,e,r))}),[j,t,w,k,y,L,S]),H=o((e=>!!Z[e]),[Z]),_=o((e=>a?a.includes(e):!!j[e]),[a,j]),W=o((e=>{if(i)return i.includes(e)}),[i]),z=o((e=>{var t;return!(!S||!Object.values(j).filter(Boolean).length)&&(null!==(t=!(null==j?void 0:j[e])||R)&&void 0!==t&&t)}),[j,R,S]);return E("div",{className:LC("w-full",null==e?void 0:e.container),children:t.map(((n,r)=>E(xK,Object.assign({classes:e,isFirstLevel:!0,isLastItem:r===t.length-1,checkIsExpanded:H,checkIsChecked:_,onExpandChange:F,onCheckedChange:P,checkAutoDisabled:z,checkIsLoading:W,renderIcon:h,renderElement:p,renderTitle:g,renderRightSection:m,enableSeparatorLine:I,disabled:z(n.id),showIcon:M,lineSize:l,horizontalLineWidth:s,expandButtonSize:u,spacing:f,notifyClickItem:b,maxLevel:A,currentLevel:1,checkable:O},n),n.id)))})},kK=({selectedKey:e,children:t,direction:n="vertical",className:o,containerProps:a,scrollAlign:i="center"})=>{const l=r(null),s=r({});d((()=>{e&&(e=>{const t=l.current,r=s.current[e];if(t&&r)if("vertical"===n){const e=t.getBoundingClientRect().top,n=r.getBoundingClientRect().top-e+t.scrollTop,o=t.clientHeight,a=r.offsetHeight;let l=n;"center"===i?l=n-(o/2-a/2):"end"===i&&(l=n+(a-o)),t.scrollTo({top:l,behavior:"smooth"})}else if("horizontal"===n){const e=t.getBoundingClientRect().left,n=r.getBoundingClientRect().left-e+t.scrollLeft,o=t.clientWidth,a=r.offsetWidth;let l=n;"center"===i?l=n-(o/2-a/2):"end"===i&&(l=n+(a-o)),t.scrollTo({left:l,behavior:"smooth"})}})(e)}),[e,n,i]);const c=Array.isArray(t)?t.map((e=>m(e)&&e.key?p(e,{ref:t=>{s.current[String(e.key)]=t}}):e)):t;return E("div",Object.assign({ref:l,className:`overflow-auto ${"vertical"===n?"max-h-60":"max-w-full whitespace-nowrap"} ${null!=o?o:""}`},a,{children:c}))},MK={m:"ui-scrollbar",s:"ui-scrollbar ui-scrollbar-s",xs:"ui-scrollbar ui-scrollbar-xs"},RK={vertical:"overflow-y-auto overflow-x-hidden",horizontal:"overflow-x-auto overflow-y-hidden",both:"overflow-auto"},IK=e.forwardRef(((e,t)=>{var{className:n,scrollbarSize:r="m",direction:o="vertical",children:a}=e,i=IC(e,["className","scrollbarSize","direction","children"]);return E("div",Object.assign({ref:t,className:LC(RK[o],MK[r],n)},i,{children:a}))}));IK.displayName="ScrollArea";var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function AK(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},LK(o,...n)]}function LK(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var SK="rovingFocusGroup.onEntryFocus",NK={bubbles:!1,cancelable:!0},jK="RovingFocusGroup",[DK,ZK,VK]=function(e){const n=e+"CollectionProvider",[r,o]=AK(n),[a,i]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:r}=e,o=t.useRef(null),i=t.useRef(new Map).current;return E(a,{scope:n,itemMap:i,collectionRef:o,children:r})};l.displayName=n;const s=e+"CollectionSlot",c=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,i(s,n).collectionRef);return E(fL,{ref:o,children:r})}));c.displayName=s;const d=e+"CollectionItemSlot",u="data-radix-collection-item",f=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,l=t.useRef(null),s=tL(n,l),c=i(d,r);return t.useEffect((()=>(c.itemMap.set(l,{ref:l,...a}),()=>{c.itemMap.delete(l)}))),E(fL,{[u]:"",ref:s,children:o})}));return f.displayName=d,[{Provider:l,Slot:c,ItemSlot:f},function(n){const r=i(e+"CollectionConsumer",n),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},o]}(jK),[TK,BK]=AK(jK,[VK]),[FK,PK]=TK(jK),HK=e.forwardRef(((e,t)=>E(DK.Provider,{scope:e.__scopeRovingFocusGroup,children:E(DK.Slot,{scope:e.__scopeRovingFocusGroup,children:E(_K,{...e,ref:t})})})));HK.displayName=jK;var _K=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=t,h=e.useRef(null),m=tL(n,h),p=FP(i),[g=null,v]=iL({prop:l,defaultProp:s,onChange:c}),[w,b]=e.useState(!1),y=aL(d),x=ZK(r),C=e.useRef(!1),[k,M]=e.useState(0);return e.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(SK,y),()=>e.removeEventListener(SK,y)}),[y]),E(FK,{scope:r,orientation:o,dir:p,loop:a,currentTabStopId:g,onItemFocus:e.useCallback((e=>v(e)),[v]),onItemShiftTab:e.useCallback((()=>b(!0)),[]),onFocusableItemAdd:e.useCallback((()=>M((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>M((e=>e-1))),[]),children:E(OK.div,{tabIndex:w||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:oL(t.onMouseDown,(()=>{C.current=!0})),onFocus:oL(t.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(SK,NK);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));UK([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}C.current=!1})),onBlur:oL(t.onBlur,(()=>b(!1)))})})})),WK="RovingFocusGroupItem",zK=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:i,...l}=t,s=Gj(),c=i||s,d=PK(WK,r),u=d.currentTabStopId===c,f=ZK(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return e.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),E(DK.ItemSlot,{scope:r,id:c,focusable:o,active:a,children:E(OK.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:oL(t.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:oL(t.onFocus,(()=>d.onItemFocus(c))),onKeyDown:oL(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:$K[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=d.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>UK(n)))}}))})})}));zK.displayName=WK;var $K={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UK(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var qK=HK,GK=zK;var YK=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=KK(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=KK(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=KK(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=KK(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function KK(e){return e?.animationName||"none"}YK.displayName="Presence";var XK="Radio",[QK,JK]=nL(XK),[eX,tX]=QK(XK),nX=e.forwardRef(((t,n)=>{const{__scopeRadio:r,name:o,checked:a=!1,required:i,disabled:l,value:s="on",onCheck:c,form:d,...u}=t,[f,h]=e.useState(null),m=tL(n,(e=>h(e))),p=e.useRef(!1),g=!f||(d||!!f.closest("form"));return C(eX,{scope:r,checked:a,disabled:l,children:[E(OK.button,{type:"button",role:"radio","aria-checked":a,"data-state":iX(a),"data-disabled":l?"":void 0,disabled:l,value:s,...u,ref:m,onClick:oL(t.onClick,(e=>{a||c?.(),g&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())}))}),g&&E(aX,{control:f,bubbles:!p.current,name:o,value:s,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})}));nX.displayName=XK;var rX="RadioIndicator",oX=e.forwardRef(((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=tX(rX,n);return E(YK,{present:r||a.checked,children:E(OK.span,{"data-state":iX(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})}));oX.displayName=rX;var aX=t=>{const{control:n,checked:r,bubbles:o=!0,...a}=t,i=e.useRef(null),l=lL(r),s=cL(n);return e.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),E("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function iX(e){return e?"checked":"unchecked"}var lX=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sX="RadioGroup",[cX]=nL(sX,[BK,JK]),dX=BK(),uX=JK(),[fX,hX]=cX(sX),mX=e.forwardRef(((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:i=!1,disabled:l=!1,orientation:s,dir:c,loop:d=!0,onValueChange:u,...f}=e,h=dX(n),m=FP(c),[p,g]=iL({prop:a,defaultProp:o,onChange:u});return E(fX,{scope:n,name:r,required:i,disabled:l,value:p,onValueChange:g,children:E(qK,{asChild:!0,...h,orientation:s,dir:m,loop:d,children:E(OK.div,{role:"radiogroup","aria-required":i,"aria-orientation":s,"data-disabled":l?"":void 0,dir:m,...f,ref:t})})})}));mX.displayName=sX;var pX="RadioGroupItem",gX=e.forwardRef(((t,n)=>{const{__scopeRadioGroup:r,disabled:o,...a}=t,i=hX(pX,r),l=i.disabled||o,s=dX(r),c=uX(r),d=e.useRef(null),u=tL(n,d),f=i.value===a.value,h=e.useRef(!1);return e.useEffect((()=>{const e=e=>{lX.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),E(GK,{asChild:!0,...s,focusable:!l,active:f,children:E(nX,{disabled:l,required:i.required,checked:f,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:oL((e=>{"Enter"===e.key&&e.preventDefault()})),onFocus:oL(a.onFocus,(()=>{h.current&&d.current?.click()}))})})}));gX.displayName=pX;var vX=e.forwardRef(((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=uX(n);return E(oX,{...o,...r,ref:t})}));vX.displayName="RadioGroupIndicator";var wX=mX,bX=gX,yX=vX;const xX=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(wX,Object.assign({className:LC("grid gap-2",n)},r,{ref:t}))}));xX.displayName=wX.displayName;const EX=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(bX,Object.assign({ref:t,className:LC("aspect-square box-border size-4 cursor-pointer rounded-full border border-function-default-solid text-function-default-solid","hover:border-function-default-hover","focus:outline-none","data-[disabled]:!border-state-disable-outline data-[disabled]:!fill-state-disable-outline data-[disabled]:!cursor-not-allowed data-[disabled]:!pointer-events-none data-[disabled]:!text-state-disable-outline","[&[data-disabled][data-state=checked]]:!border-state-disable-solid [&[data-disabled][data-state=checked]]:!text-state-disable-solid","data-[state=checked]:border-function-active-solid data-[state=checked]:text-function-active-solid","hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:text-function-active-hover",n)},r,{children:E(yX,{className:"flex items-center justify-center",children:E("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"fill-current text-current",children:E("circle",{cx:"5",cy:"5",r:"5",fill:"current"})})})}))}));EX.displayName=bX.displayName;var CX=e=>"checkbox"===e.type,kX=e=>e instanceof Date,MX=e=>null==e;const RX=e=>"object"==typeof e;var IX=e=>!MX(e)&&!Array.isArray(e)&&RX(e)&&!kX(e),OX=e=>IX(e)&&e.target?CX(e.target)?e.target.checked:e.target.value:e,AX=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),LX="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function SX(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(LX&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!(n||IX(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return IX(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=SX(e[t]));return r}var NX=e=>/^\w*$/.test(e),jX=e=>void 0===e,DX=e=>Array.isArray(e)?e.filter(Boolean):[],ZX=e=>DX(e.replace(/["|']|\]/g,"").split(/\.|\[/)),VX=(e,t,n)=>{if(!t||!IX(e))return n;const r=(NX(t)?[t]:ZX(t)).reduce(((e,t)=>MX(e)?e:e[t]),e);return jX(r)||r===e?jX(e[t])?n:e[t]:r},TX=e=>"boolean"==typeof e,BX=e=>"function"==typeof e,FX=(e,t,n)=>{let r=-1;const o=NX(t)?[t]:ZX(t),a=o.length,i=a-1;for(;++r<a;){const t=o[r];let a=n;if(r!==i){const n=e[t];a=IX(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const PX="blur",HX="focusout",_X="change",WX="onBlur",zX="onChange",$X="onSubmit",UX="onTouched",qX="all",GX="max",YX="min",KX="maxLength",XX="minLength",QX="pattern",JX="required",eQ="validate",tQ=t.createContext(null);tQ.displayName="HookFormControlContext";const nQ=()=>t.useContext(tQ);var rQ=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==qX&&(t._proxyFormState[o]=!r||qX),n&&(n[o]=!0),e[o]}});return o};const oQ="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var aQ=e=>"string"==typeof e,iQ=(e,t,n,r,o)=>aQ(e)?(r&&t.watch.add(e),VX(n,e,o)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),VX(n,e)))):(r&&(t.watchAll=!0),n),lQ=e=>MX(e)||!RX(e);function sQ(e,t,n=new WeakSet){if(lQ(e)||lQ(t))return Object.is(e,t);if(kX(e)&&kX(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const r=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(kX(r)&&kX(e)||IX(r)&&IX(e)||Array.isArray(r)&&Array.isArray(e)?!sQ(r,e,n):!Object.is(r,e))return!1}}return!0}function cQ(e){const n=nQ(),{name:r,disabled:o,control:a=n,shouldUnregister:i,defaultValue:l,exact:s=!0}=e,c=AX(a._names.array,r),d=t.useMemo((()=>VX(a._formValues,r,VX(a._defaultValues,r,l))),[a,r,l]),u=function(e){const n=nQ(),{control:r=n,name:o,defaultValue:a,disabled:i,exact:l,compute:s}=e||{},c=t.useRef(a),d=t.useRef(s),u=t.useRef(void 0),f=t.useRef(r),h=t.useRef(o);d.current=s;const[m,p]=t.useState((()=>{const e=r._getWatch(o,c.current);return d.current?d.current(e):e})),g=t.useCallback((e=>{const t=iQ(o,r._names,e||r._formValues,!1,c.current);return d.current?d.current(t):t}),[r._formValues,r._names,o]),v=t.useCallback((e=>{if(!i){const t=iQ(o,r._names,e||r._formValues,!1,c.current);if(d.current){const e=d.current(t);sQ(e,u.current)||(p(e),u.current=e)}else p(t)}}),[r._formValues,r._names,i,o]);oQ((()=>(f.current===r&&sQ(h.current,o)||(f.current=r,h.current=o,v()),r._subscribe({name:o,formState:{values:!0},exact:l,callback:e=>{v(e.values)}}))),[r,l,o,v]),t.useEffect((()=>r._removeUnmounted()));const w=f.current!==r,b=h.current,y=t.useMemo((()=>{if(i)return null;const e=!w&&!sQ(b,o);return w||e?g():null}),[i,w,o,b,g]);return null!==y?y:m}({control:a,name:r,defaultValue:d,exact:s}),f=function(e){const n=nQ(),{control:r=n,disabled:o,name:a,exact:i}=e||{},[l,s]=t.useState(r._formState),c=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return oQ((()=>r._subscribe({name:a,formState:c.current,exact:i,callback:e=>{!o&&s({...r._formState,...e})}})),[a,o,i]),t.useEffect((()=>{c.current.isValid&&r._setValid(!0)}),[r]),t.useMemo((()=>rQ(l,r,c.current,!1)),[l,r])}({control:a,name:r,exact:s}),h=t.useRef(e),m=t.useRef(void 0),p=t.useRef(a.register(r,{...e.rules,value:u,...TX(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const g=t.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!VX(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!VX(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!VX(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!VX(f.validatingFields,r)},error:{enumerable:!0,get:()=>VX(f.errors,r)}})),[f,r]),v=t.useCallback((e=>p.current.onChange({target:{value:OX(e),name:r},type:_X})),[r]),w=t.useCallback((()=>p.current.onBlur({target:{value:VX(a._formValues,r),name:r},type:PX})),[r,a._formValues]),b=t.useCallback((e=>{const t=VX(a._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>BX(e.focus)&&e.focus(),select:()=>BX(e.select)&&e.select(),setCustomValidity:t=>BX(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>BX(e.reportValidity)&&e.reportValidity()})}),[a._fields,r]),y=t.useMemo((()=>({name:r,value:u,...TX(o)||f.disabled?{disabled:f.disabled||o}:{},onChange:v,onBlur:w,ref:b})),[r,o,f.disabled,v,w,b,u]);return t.useEffect((()=>{const e=a._options.shouldUnregister||i,t=m.current;t&&t!==r&&!c&&a.unregister(t),a.register(r,{...h.current.rules,...TX(h.current.disabled)?{disabled:h.current.disabled}:{}});const n=(e,t)=>{const n=VX(a._fields,e);n&&n._f&&(n._f.mount=t)};if(n(r,!0),e){const e=SX(VX(a._options.defaultValues,r,h.current.defaultValue));FX(a._defaultValues,r,e),jX(VX(a._formValues,r))&&FX(a._formValues,r,e)}return!c&&a.register(r),m.current=r,()=>{(c?e&&!a._state.action:e)?a.unregister(r):n(r,!1)}}),[r,a,c,i]),t.useEffect((()=>{a._setDisabledField({disabled:o,name:r})}),[o,r,a]),t.useMemo((()=>({field:y,formState:f,fieldState:g})),[y,f,g])}const dQ=t.createContext(null);dQ.displayName="HookFormContext";const uQ=()=>t.useContext(dQ),fQ=e=>{const{children:n,watch:r,getValues:o,getFieldState:a,setError:i,clearErrors:l,setValue:s,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:h,unregister:m,control:p,register:g,setFocus:v,subscribe:w}=e;return t.createElement(dQ.Provider,{value:t.useMemo((()=>({watch:r,getValues:o,getFieldState:a,setError:i,clearErrors:l,setValue:s,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:h,unregister:m,control:p,register:g,setFocus:v,subscribe:w})),[l,p,d,a,o,h,g,f,u,i,v,s,w,c,m,r])},t.createElement(tQ.Provider,{value:p},n))};var hQ=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},mQ=e=>Array.isArray(e)?e:[e],pQ=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}};function gQ(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],a=t[r];if(o&&IX(o)&&a){const e=gQ(o,a);IX(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var vQ=e=>IX(e)&&!Object.keys(e).length,wQ=e=>"file"===e.type,bQ=e=>{if(!LX)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yQ=e=>"select-multiple"===e.type,xQ=e=>"radio"===e.type,EQ=e=>bQ(e)&&e.isConnected;function CQ(e,t){const n=Array.isArray(t)?t:NX(t)?[t]:ZX(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=jX(e)?r++:e[t[r++]];return e}(e,n),o=n.length-1,a=n[o];return r&&delete r[a],0!==o&&(IX(r)&&vQ(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!jX(e[t]))return!1;return!0}(r))&&CQ(e,n.slice(0,-1)),e}function kQ(e){return Array.isArray(e)||IX(e)&&!(e=>{for(const t in e)if(BX(e[t]))return!0;return!1})(e)}function MQ(e,t={}){for(const n in e){const r=e[n];kQ(r)?(t[n]=Array.isArray(r)?[]:{},MQ(r,t[n])):jX(r)||(t[n]=!0)}return t}function RQ(e,t,n){n||(n=MQ(t));for(const r in e){const o=e[r];if(kQ(o))jX(t)||lQ(n[r])?n[r]=MQ(o,Array.isArray(o)?[]:{}):RQ(o,MX(t)?{}:t[r],n[r]);else{const e=t[r];n[r]=!sQ(o,e)}}return n}const IQ={value:!1,isValid:!1},OQ={value:!0,isValid:!0};var AQ=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!jX(e[0].attributes.value)?jX(e[0].value)||""===e[0].value?OQ:{value:e[0].value,isValid:!0}:OQ:IQ}return IQ},LQ=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>jX(e)?e:t?""===e?NaN:e?+e:e:n&&aQ(e)?new Date(e):r?r(e):e;const SQ={isValid:!1,value:null};var NQ=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),SQ):SQ;function jQ(e){const t=e.ref;return wQ(t)?t.files:xQ(t)?NQ(e.refs).value:yQ(t)?[...t.selectedOptions].map((({value:e})=>e)):CX(t)?AQ(e.refs).value:LQ(jX(t.value)?e.ref.value:t.value,e)}var DQ=e=>e instanceof RegExp,ZQ=e=>jX(e)?e:DQ(e)?e.source:IX(e)?DQ(e.value)?e.value.source:e.value:e,VQ=e=>({isOnSubmit:!e||e===$X,isOnBlur:e===WX,isOnChange:e===zX,isOnAll:e===qX,isOnTouch:e===UX});const TQ="AsyncFunction";var BQ=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const FQ=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const n=VX(e,o);if(n){const{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(FQ(a,t))break}else if(IX(a)&&FQ(a,t))break}}};function PQ(e,t,n){const r=VX(e,n);if(r||NX(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),a=VX(t,r),i=VX(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:`${r}.root`,error:i.root};o.pop()}return{name:n}}var HQ=(e,t,n)=>{const r=mQ(VX(e,n));return FX(r,"root",t[n]),FX(e,n,r),e};function _Q(e,t,n="validate"){if(aQ(e)||Array.isArray(e)&&e.every(aQ)||TX(e)&&!e)return{type:n,message:aQ(e)?e:"",ref:t}}var WQ=e=>IX(e)&&!DQ(e)?e:{value:e,message:""},zQ=async(e,t,n,r,o,a)=>{const{ref:i,refs:l,required:s,maxLength:c,minLength:d,min:u,max:f,pattern:h,validate:m,name:p,valueAsNumber:g,mount:v}=e._f,w=VX(n,p);if(!v||t.has(p))return{};const b=l?l[0]:i,y=e=>{o&&b.reportValidity&&(b.setCustomValidity(TX(e)?"":e||""),b.reportValidity())},x={},E=xQ(i),C=CX(i),k=E||C,M=(g||wQ(i))&&jX(i.value)&&jX(w)||bQ(i)&&""===i.value||""===w||Array.isArray(w)&&!w.length,R=hQ.bind(null,p,r,x),I=(e,t,n,r=KX,o=XX)=>{const a=e?t:n;x[p]={type:e?r:o,message:a,ref:i,...R(e?r:o,a)}};if(a?!Array.isArray(w)||!w.length:s&&(!k&&(M||MX(w))||TX(w)&&!w||C&&!AQ(l).isValid||E&&!NQ(l).isValid)){const{value:e,message:t}=aQ(s)?{value:!!s,message:s}:WQ(s);if(e&&(x[p]={type:JX,message:t,ref:b,...R(JX,t)},!r))return y(t),x}if(!(M||MX(u)&&MX(f))){let e,t;const n=WQ(f),o=WQ(u);if(MX(w)||isNaN(w)){const r=i.valueAsDate||new Date(w),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==i.type,s="week"==i.type;aQ(n.value)&&w&&(e=l?a(w)>a(n.value):s?w>n.value:r>new Date(n.value)),aQ(o.value)&&w&&(t=l?a(w)<a(o.value):s?w<o.value:r<new Date(o.value))}else{const r=i.valueAsNumber||(w?+w:w);MX(n.value)||(e=r>n.value),MX(o.value)||(t=r<o.value)}if((e||t)&&(I(!!e,n.message,o.message,GX,YX),!r))return y(x[p].message),x}if((c||d)&&!M&&(aQ(w)||a&&Array.isArray(w))){const e=WQ(c),t=WQ(d),n=!MX(e.value)&&w.length>+e.value,o=!MX(t.value)&&w.length<+t.value;if((n||o)&&(I(n,e.message,t.message),!r))return y(x[p].message),x}if(h&&!M&&aQ(w)){const{value:e,message:t}=WQ(h);if(DQ(e)&&!w.match(e)&&(x[p]={type:QX,message:t,ref:i,...R(QX,t)},!r))return y(t),x}if(m)if(BX(m)){const e=_Q(await m(w,n),b);if(e&&(x[p]={...e,...R(eQ,e.message)},!r))return y(e.message),x}else if(IX(m)){let e={};for(const t in m){if(!vQ(e)&&!r)break;const o=_Q(await m[t](w,n),b,t);o&&(e={...o,...R(t,o.message)},y(o.message),r&&(x[p]=e))}if(!vQ(e)&&(x[p]={ref:b,...e},!r))return x}return y(!0),x};const $Q={mode:$X,reValidateMode:zX,shouldFocusError:!0};function UQ(e={}){let t,n={...$Q,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:BX(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},a=(IX(n.defaultValues)||IX(n.values))&&SX(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:SX(a),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let f={...u};const h={array:pQ(),state:pQ()},m=n.criteriaMode===qX,p=async e=>{if(!l.keepIsValid&&!n.disabled&&(u.isValid||f.isValid||e)){let e;n.resolver?(e=vQ((await y()).errors),g()):e=await x(o,!0),e!==r.isValid&&h.state.next({isValid:e})}},g=(e,t)=>{!n.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach((e=>{e&&(t?FX(r.validatingFields,e,t):CQ(r.validatingFields,e))})),h.state.next({validatingFields:r.validatingFields,isValidating:!vQ(r.validatingFields)}))},v=(e,t,n,r)=>{const s=VX(o,e);if(s){const o=VX(i,e,jX(n)?VX(a,e):n);jX(o)||r&&r.defaultChecked||t?FX(i,e,t?o:jQ(s._f)):k(e,o),l.mount&&!l.action&&p()}},w=(e,t,o,i,l)=>{let s=!1,c=!1;const d={name:e};if(!n.disabled){if(!o||i){(u.isDirty||f.isDirty)&&(c=r.isDirty,r.isDirty=d.isDirty=E(),s=c!==d.isDirty);const n=sQ(VX(a,e),t);c=!!VX(r.dirtyFields,e),n?CQ(r.dirtyFields,e):FX(r.dirtyFields,e,!0),d.dirtyFields=r.dirtyFields,s=s||(u.dirtyFields||f.dirtyFields)&&c!==!n}if(o){const t=VX(r.touchedFields,e);t||(FX(r.touchedFields,e,o),d.touchedFields=r.touchedFields,s=s||(u.touchedFields||f.touchedFields)&&t!==o)}s&&l&&h.state.next(d)}return s?d:{}},b=(e,o,a,i)=>{const l=VX(r.errors,e),s=(u.isValid||f.isValid)&&TX(o)&&r.isValid!==o;var d;if(n.delayError&&a?(d=()=>((e,t)=>{FX(r.errors,e,t),h.state.next({errors:r.errors})})(e,a),t=e=>{clearTimeout(c),c=setTimeout(d,e)},t(n.delayError)):(clearTimeout(c),t=null,a?FX(r.errors,e,a):CQ(r.errors,e)),(a?!sQ(l,a):l)||!vQ(i)||s){const t={...i,...s&&TX(o)?{isValid:o}:{},errors:r.errors,name:e};r={...r,...t},h.state.next(t)}},y=async e=>{g(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=VX(t,n);e&&FX(o,n,e._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||s.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return t},x=async(t,o,a={valid:!0})=>{for(const c in t){const d=t[c];if(d){const{_f:t,...c}=d;if(t){const c=s.array.has(t.name),f=d._f&&(!!(l=d._f)&&!!l.validate&&!!(BX(l.validate)&&l.validate.constructor.name===TQ||IX(l.validate)&&Object.values(l.validate).find((e=>e.constructor.name===TQ))));f&&u.validatingFields&&g([t.name],!0);const h=await zQ(d,s.disabled,i,m,n.shouldUseNativeValidation&&!o,c);if(f&&u.validatingFields&&g([t.name]),h[t.name]&&(a.valid=!1,o||e.shouldUseNativeValidation))break;!o&&(VX(h,t.name)?c?HQ(r.errors,h,t.name):FX(r.errors,t.name,h[t.name]):CQ(r.errors,t.name))}!vQ(c)&&await x(c,o,a)}}var l;return a.valid},E=(e,t)=>!n.disabled&&(e&&t&&FX(i,e,t),!sQ(L(),a)),C=(e,t,n)=>iQ(e,s,{...l.mount?i:jX(t)?a:aQ(e)?{[e]:t}:t},n,t),k=(e,t,n={})=>{const r=VX(o,e);let a=t;if(r){const n=r._f;n&&(!n.disabled&&FX(i,e,LQ(t,n)),a=bQ(n.ref)&&MX(t)?"":t,yQ(n.ref)?[...n.ref.options].forEach((e=>e.selected=a.includes(e.value))):n.refs?CX(n.ref)?n.refs.forEach((e=>{e.defaultChecked&&e.disabled||(Array.isArray(a)?e.checked=!!a.find((t=>t===e.value)):e.checked=a===e.value||!!a)})):n.refs.forEach((e=>e.checked=e.value===a)):wQ(n.ref)?n.ref.value="":(n.ref.value=a,n.ref.type||h.state.next({name:e,values:SX(i)})))}(n.shouldDirty||n.shouldTouch)&&w(e,a,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&A(e)},M=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const a=t[r],i=e+"."+r,l=VX(o,i);(s.array.has(e)||IX(a)||l&&!l._f)&&!kX(a)?M(i,a,n):k(i,a,n)}},R=(e,t,n={})=>{const c=VX(o,e),d=s.array.has(e),m=SX(t);FX(i,e,m),d?(h.array.next({name:e,values:SX(i)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&n.shouldDirty&&h.state.next({name:e,dirtyFields:RQ(a,i),isDirty:E(e,m)})):!c||c._f||MX(m)?k(e,m,n):M(e,m,n),BQ(e,s)?h.state.next({...r,name:e,values:SX(i)}):h.state.next({name:l.mount?e:void 0,values:SX(i)})},I=async e=>{l.mount=!0;const a=e.target;let c=a.name,d=!0;const v=VX(o,c),E=e=>{d=Number.isNaN(e)||kX(e)&&isNaN(e.getTime())||sQ(e,VX(i,c,e))},C=VQ(n.mode),k=VQ(n.reValidateMode);if(v){let l,M;const R=a.type?jQ(v._f):OX(e),I=e.type===PX||e.type===HX,O=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(v._f)&&!n.resolver&&!VX(r.errors,c)&&!v._f.deps||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(I,VX(r.touchedFields,c),r.isSubmitted,k,C),L=BQ(c,s,I);FX(i,c,R),I?a&&a.readOnly||(v._f.onBlur&&v._f.onBlur(e),t&&t(0)):v._f.onChange&&v._f.onChange(e);const S=w(c,R,I),N=!vQ(S)||L;if(!I&&h.state.next({name:c,type:e.type,values:SX(i)}),O)return(u.isValid||f.isValid)&&("onBlur"===n.mode?I&&p():I||p()),N&&h.state.next({name:c,...L?{}:S});if(!I&&L&&h.state.next({...r}),n.resolver){const{errors:e}=await y([c]);if(g([c]),E(R),d){const t=PQ(r.errors,o,c),n=PQ(e,o,t.name||c);l=n.error,c=n.name,M=vQ(e)}}else g([c],!0),l=(await zQ(v,s.disabled,i,m,n.shouldUseNativeValidation))[c],g([c]),E(R),d&&(l?M=!1:(u.isValid||f.isValid)&&(M=await x(o,!0)));d&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&A(v._f.deps),b(c,M,l,S))}},O=(e,t)=>{if(VX(r.errors,t)&&e.focus)return e.focus(),1},A=async(e,t={})=>{let a,i;const l=mQ(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await y(e);if(g(e),e)for(const n of e){const e=VX(t,n);e?FX(r.errors,n,e):CQ(r.errors,n)}else r.errors=t;return t})(jX(e)?e:l);a=vQ(t),i=e?!l.some((e=>VX(t,e))):a}else e?(i=(await Promise.all(l.map((async e=>{const t=VX(o,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||r.isValid)&&p()):i=a=await x(o);return h.state.next({...!aQ(e)||(u.isValid||f.isValid)&&a!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:a}:{},errors:r.errors}),t.shouldFocus&&!i&&FQ(o,O,e?l:s.mount),i},L=(e,t)=>{let n={...l.mount?i:a};return t&&(n=gQ(t.dirtyFields?r.dirtyFields:r.touchedFields,n)),jX(e)?n:aQ(e)?VX(n,e):e.map((e=>VX(n,e)))},S=(e,t)=>({invalid:!!VX((t||r).errors,e),isDirty:!!VX((t||r).dirtyFields,e),error:VX((t||r).errors,e),isValidating:!!VX(r.validatingFields,e),isTouched:!!VX((t||r).touchedFields,e)}),N=(e,t,n)=>{const a=(VX(o,e,{_f:{}})._f||{}).ref,i=VX(r.errors,e)||{},{ref:l,message:s,type:c,...d}=i;FX(r.errors,e,{...d,...t,ref:a}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},j=e=>h.state.subscribe({next:t=>{var n,o,l;n=e.name,o=t.name,l=e.exact,n&&o&&n!==o&&!mQ(n).some((e=>e&&(l?e===o:e.startsWith(o)||o.startsWith(e))))||!((e,t,n,r)=>{n(e);const{name:o,...a}=e;return vQ(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!r||qX)))})(t,e.formState||u,H,e.reRenderRoot)||e.callback({values:{...i},...r,...t,defaultValues:a})}}).unsubscribe,D=(e,t={})=>{for(const l of e?mQ(e):s.mount)s.mount.delete(l),s.array.delete(l),t.keepValue||(CQ(o,l),CQ(i,l)),!t.keepError&&CQ(r.errors,l),!t.keepDirty&&CQ(r.dirtyFields,l),!t.keepTouched&&CQ(r.touchedFields,l),!t.keepIsValidating&&CQ(r.validatingFields,l),!n.shouldUnregister&&!t.keepDefaultValue&&CQ(a,l);h.state.next({values:SX(i)}),h.state.next({...r,...t.keepDirty?{isDirty:E()}:{}}),!t.keepIsValid&&p()},Z=({disabled:e,name:t})=>{if(TX(e)&&l.mount||e||s.disabled.has(t)){const n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&l.mount&&!l.action&&p()}},V=(e,t={})=>{let r=VX(o,e);const i=TX(t.disabled)||TX(n.disabled);return FX(o,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),s.mount.add(e),r?Z({disabled:TX(t.disabled)?t.disabled:n.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:ZQ(t.min),max:ZQ(t.max),minLength:ZQ(t.minLength),maxLength:ZQ(t.maxLength),pattern:ZQ(t.pattern)}:{},name:e,onChange:I,onBlur:I,ref:i=>{if(i){V(e,t),r=VX(o,e);const n=jX(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,l=(e=>xQ(e)||CX(e))(n),s=r._f.refs||[];if(l?s.find((e=>e===n)):n===r._f.ref)return;FX(o,e,{_f:{...r._f,...l?{refs:[...s.filter(EQ),n,...Array.isArray(VX(a,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=VX(o,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!AX(s.array,e)||!l.action)&&s.unMount.add(e)}}},T=()=>n.shouldFocusError&&FQ(o,O,s.mount),B=(e,t)=>async a=>{let l;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=SX(i);if(h.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await y();g(),r.errors=e,c=SX(t)}else await x(o);if(s.disabled.size)for(const e of s.disabled)CQ(c,e);if(CQ(r.errors,"root"),vQ(r.errors)){h.state.next({errors:{}});try{await e(c,a)}catch(e){l=e}}else t&&await t({...r.errors},a),T(),setTimeout(T);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:vQ(r.errors)&&!l,submitCount:r.submitCount+1,errors:r.errors}),l)throw l},F=(e,t={})=>{const c=e?SX(e):a,d=SX(c),f=vQ(e),m=f?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...s.mount,...Object.keys(RQ(a,i))]);for(const t of Array.from(e)){const e=VX(r.dirtyFields,t),n=VX(i,t),o=VX(m,t);e&&!jX(n)?FX(m,t,n):e||jX(o)||R(t,o)}}else{if(LX&&jX(e))for(const e of s.mount){const t=VX(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(bQ(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of s.mount)R(e,VX(m,e));else o={}}i=n.shouldUnregister?t.keepDefaultValues?SX(a):{}:SX(m),h.array.next({values:{...m}}),h.state.next({values:{...m}})}s={mount:t.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!n.shouldUnregister&&!vQ(m),l.watch=!!n.shouldUnregister,l.keepIsValid=!!t.keepIsValid,l.action=!1,t.keepErrors||(r.errors={}),h.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!f&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||sQ(e,a))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:f?{}:t.keepDirtyValues?t.keepDefaultValues&&i?RQ(a,i):r.dirtyFields:t.keepDefaultValues&&e?RQ(a,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1,defaultValues:a})},P=(e,t)=>F(BX(e)?e(i):e,{...n.resetOptions,...t}),H=e=>{r={...r,...e}},_={control:{register:V,unregister:D,getFieldState:S,handleSubmit:B,setError:N,_subscribe:j,_runSchema:y,_updateIsValidating:g,_focusError:T,_getWatch:C,_getDirty:E,_setValid:p,_setFieldArray:(e,t=[],s,c,d=!0,m=!0)=>{if(c&&s&&!n.disabled){if(l.action=!0,m&&Array.isArray(VX(o,e))){const t=s(VX(o,e),c.argA,c.argB);d&&FX(o,e,t)}if(m&&Array.isArray(VX(r.errors,e))){const t=s(VX(r.errors,e),c.argA,c.argB);d&&FX(r.errors,e,t),((e,t)=>{!DX(VX(e,t)).length&&CQ(e,t)})(r.errors,e)}if((u.touchedFields||f.touchedFields)&&m&&Array.isArray(VX(r.touchedFields,e))){const t=s(VX(r.touchedFields,e),c.argA,c.argB);d&&FX(r.touchedFields,e,t)}(u.dirtyFields||f.dirtyFields)&&(r.dirtyFields=RQ(a,i)),h.state.next({name:e,isDirty:E(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else FX(i,e,t)},_setDisabledField:Z,_setErrors:e=>{r.errors=e,h.state.next({errors:r.errors,isValid:!1})},_getFieldArray:e=>DX(VX(l.mount?i:a,e,n.shouldUnregister?VX(a,e,[]):[])),_reset:F,_resetDefaultValues:()=>BX(n.defaultValues)&&n.defaultValues().then((e=>{P(e,n.resetOptions),h.state.next({isLoading:!1})})),_removeUnmounted:()=>{for(const e of s.unMount){const t=VX(o,e);t&&(t._f.refs?t._f.refs.every((e=>!EQ(e))):!EQ(t._f.ref))&&D(e)}s.unMount=new Set},_disableForm:e=>{TX(e)&&(h.state.next({disabled:e}),FQ(o,((t,n)=>{const r=VX(o,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach((t=>{t.disabled=r._f.disabled||e})))}),0,!1))},_subjects:h,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(e){l=e},get _defaultValues(){return a},get _names(){return s},set _names(e){s=e},get _formState(){return r},get _options(){return n},set _options(e){n={...n,...e}}},subscribe:e=>(l.mount=!0,f={...f,...e.formState},j({...e,formState:{...d,...e.formState}})),trigger:A,register:V,handleSubmit:B,watch:(e,t)=>BX(e)?h.state.subscribe({next:n=>"values"in n&&e(C(void 0,t),n)}):C(e,t,!0),setValue:R,getValues:L,reset:P,resetField:(e,t={})=>{VX(o,e)&&(jX(t.defaultValue)?R(e,SX(VX(a,e))):(R(e,t.defaultValue),FX(a,e,SX(t.defaultValue))),t.keepTouched||CQ(r.touchedFields,e),t.keepDirty||(CQ(r.dirtyFields,e),r.isDirty=t.defaultValue?E(e,SX(VX(a,e))):E()),t.keepError||(CQ(r.errors,e),u.isValid&&p()),h.state.next({...r}))},clearErrors:e=>{const t=e?mQ(e):void 0;null==t||t.forEach((e=>CQ(r.errors,e))),t?t.forEach((e=>{h.state.next({name:e,errors:r.errors})})):h.state.next({errors:{}})},unregister:D,setError:N,setFocus:(e,t={})=>{const n=VX(o,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&setTimeout((()=>{e.focus(),t.shouldSelect&&BX(e.select)&&e.select()}))}},getFieldState:S};return{..._,formControl:_}}function qQ(e={}){const n=t.useRef(void 0),r=t.useRef(void 0),[o,a]=t.useState({isDirty:!1,isValidating:!1,isLoading:BX(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:BX(e.defaultValues)?void 0:e.defaultValues});if(!n.current)if(e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!BX(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...r}=UQ(e);n.current={...r,formState:o}}const i=n.current.control;return i._options=e,oQ((()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a((e=>({...e,isReady:!0}))),i._formState.isReady=!0,e}),[i]),t.useEffect((()=>i._disableForm(e.disabled)),[i,e.disabled]),t.useEffect((()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)}),[i,e.mode,e.reValidateMode]),t.useEffect((()=>{e.errors&&(i._setErrors(e.errors),i._focusError())}),[i,e.errors]),t.useEffect((()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})}),[i,e.shouldUnregister]),t.useEffect((()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==o.isDirty&&i._subjects.state.next({isDirty:e})}}),[i,o.isDirty]),t.useEffect((()=>{var t;e.values&&!sQ(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),r.current=e.values,a((e=>({...e})))):i._resetDefaultValues()}),[i,e.values]),t.useEffect((()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()})),n.current.formState=t.useMemo((()=>rQ(o,i)),[i,o]),n.current}const GQ=(e,t,n)=>{if(e&&"reportValidity"in e){const r=VX(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},YQ=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?GQ(r.ref,n,e):r&&r.refs&&r.refs.forEach((t=>GQ(t,n,e)))}},KQ=(e,t)=>{t.shouldUseNativeValidation&&YQ(e,t);const n={};for(const r in e){const o=VX(t.fields,r),a=Object.assign(e[r]||{},{ref:o&&o.ref});if(XQ(t.names||Object.keys(e),r)){const e=Object.assign({},VX(n,r));FX(e,"root",a),FX(n,r,e)}else FX(n,r,a)}return n},XQ=(e,t)=>{const n=QQ(t);return e.some((e=>QQ(e).match(`^${n}\\.\\d+`)))};function QQ(e){return e.replace(/\]|\[/g,"")}const JQ=e=>function(e,t,n){return void 0===n&&(n={}),function(r,o,a){try{return Promise.resolve(function(i,l){try{var s=(null!=t&&t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:o}))).then((function(e){return a.shouldUseNativeValidation&&YQ({},a),{values:n.raw?Object.assign({},r):e,errors:{}}})))}catch(e){return l(e)}return s&&s.then?s.then(void 0,l):s}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:KQ((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,o=r&&r[t.type];e[t.path]=hQ(t.path,n,e,t.type,o?[].concat(o,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}}(e),eJ=({methods:e,defaultValues:n,controllerRef:r})=>{const o=t.forwardRef(((t,o)=>{var{children:a}=t,i=IC(t,["children"]);return E(rJ,Object.assign({},i,{ref:o,methods:e,defaultValues:n,controllerRef:r,children:a}))}));return o.displayName="ControlledFormRoot",{methods:e,FormRoot:o}},tJ=({defaultValues:e,controllerRef:n,resolver:r,validationSchema:o,mode:a="onSubmit",reValidateMode:i="onChange"})=>{const l=qQ({defaultValues:e,resolver:null!=r?r:o?JQ(o):void 0,mode:a,reValidateMode:i}),s=t.useRef(null);return s.current||(s.current=eJ({methods:l,defaultValues:e,controllerRef:n})),{methods:l,FormRoot:s.current.FormRoot}},nJ=({onFormStateChange:e})=>{const{formState:n}=uQ();return t.useEffect((()=>{e(n)}),[n,e]),null},rJ=t.forwardRef(((e,n)=>{var{children:r,defaultValues:o,methods:a,controllerRef:i,onSubmit:l,onInvalidSubmit:s,onFormStateChange:c,resolver:d,validationSchema:u,mode:f="onSubmit",reValidateMode:h="onChange",noValidate:m=!0}=e,p=IC(e,["children","defaultValues","methods","controllerRef","onSubmit","onInvalidSubmit","onFormStateChange","resolver","validationSchema","mode","reValidateMode","noValidate"]);const g=qQ({defaultValues:o,resolver:null!=d?d:u?JQ(u):void 0,mode:f,reValidateMode:h}),v=null!=a?a:g,w=t.useMemo((()=>({submit:async()=>{await v.handleSubmit(l,s)()},getValues:()=>v.getValues(),setValue:v.setValue,trigger:v.trigger,reset:v.reset})),[v,l,s]);return t.useImperativeHandle(n,(()=>w),[w]),t.useEffect((()=>{if(i)return i.current=w,()=>{i.current=null}}),[i,w]),E(fQ,Object.assign({},v,{children:C("form",Object.assign({},p,{noValidate:m,onSubmit:v.handleSubmit(l,s),children:[c&&E(nJ,{onFormStateChange:c}),"function"==typeof r?r(v):r]}))}))})),oJ=({name:e,component:t,componentProps:n,rules:r,defaultValue:o,disabled:a=!1,shouldUnregister:i=!1,id:l,describedBy:s,valuePropName:c="value",changePropName:d="onChange",blurPropName:u="onBlur",refPropName:f="ref",errorMessagePropName:h="errorMessage",invalidPropName:m="error",parseValue:p,formatValue:v,onChange:w,onBlur:b})=>{const y=g(),x=l||`${e.replace(/\./g,"-")}-${y}`,{field:C,fieldState:{error:k,invalid:M}}=cQ({name:e,rules:r,disabled:a,defaultValue:o,shouldUnregister:i}),R=()=>{C.onBlur(),null==b||b()},I=v?v(C.value):C.value,O=Object.assign(Object.assign({},n),{id:x,name:C.name,disabled:a,"aria-invalid":M||void 0,"aria-describedby":s});return O[c]=I,O[d]=e=>{const t=(e=>{if(e&&"object"==typeof e&&"target"in e&&e.target&&"object"==typeof e.target){const t=e.target;return"checkbox"===t.type?t.checked:t.value}return e})(e),n=p?p(t,e):t;C.onChange(n),null==w||w(n,e)},u&&(O[u]=R),f&&(O[f]=C.ref),h&&(O[h]=null==k?void 0:k.message),m&&(O[m]=M),E(t,Object.assign({},O))},aJ=e=>{var{name:t,className:n}=e,r=IC(e,["name","className"]);const{getFieldState:o,formState:a}=uQ(),{error:i}=o(t,a);return(null==i?void 0:i.message)?E("p",Object.assign({},r,{className:LC("text-sm text-input-error mt-1",n),role:"alert",children:i.message})):null},iJ={valid:"text-text-g-contrast-high",invalid:"text-input-error",pending:"text-text-g-contrast-high"},lJ={valid:"text-primary",invalid:"text-input-error",pending:"text-text-g-contrast-low"},sJ=({values:e,rules:t,mode:n=["pending","valid","invalid"],className:r,itemClassName:o,labelStateClassName:a,iconStateClassName:i})=>{const l=new Set(n);return E("ul",{className:LC("mt-2 flex flex-col gap-3",r),children:t.map((t=>{const n=((e,t)=>!t.when||t.when(e)?t.validate(e)?"valid":"invalid":"pending")(e,t),r=l.has(n)?n:"pending";return C("li",{className:LC("flex items-center gap-2 typography-small2 ",iJ[r],null==a?void 0:a[r],o),children:[E(ak,{className:LC("size-4",lJ[r],null==i?void 0:i[r])}),E("span",{children:t.label})]},t.id)}))})},cJ=({options:e,loading:t=!1,buildFallbackOption:n})=>{const r=s((()=>new Map(e.map((e=>[e.value,e])))),[e]),o=e=>{if(null!=e)return r.get(e)};return{toOption:o,toOptionWithFallback:e=>{var r;if(null!=e)return null!==(r=o(e))&&void 0!==r?r:null==n?void 0:n(e,t)},toValue:e=>null==e?void 0:e.value,optionsByValue:r}};function dJ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function uJ(e){this._maxSize=e,this.clear()}uJ.prototype.clear=function(){this._size=0,this._values=Object.create(null)},uJ.prototype.get=function(e){return this._values[e]},uJ.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var fJ=/[^.^\]^[]+|(?=\[\]|\.\.)/g,hJ=/^\d+$/,mJ=/^\d/,pJ=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,gJ=/^\s*(['"]?)(.*?)(\1)\s*$/,vJ=new uJ(512);new uJ(512);var wJ=new uJ(512),bJ={split:xJ,normalizePath:yJ,getter:function(e,t){var n=yJ(e);return wJ.get(e)||wJ.set(e,(function(e){for(var r=0,o=n.length;r<o;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(EJ(t)||hJ.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,o,a,i,l=e.length;for(o=0;o<l;o++)(r=e[o])&&(CJ(r)&&(r='"'+r+'"'),a=!(i=EJ(r))&&/^\d+$/.test(r),t.call(n,r,i,a,o,e))}(Array.isArray(e)?e:xJ(e),t,n)}};function yJ(e){return vJ.get(e)||vJ.set(e,xJ(e).map((function(e){return e.replace(gJ,"$2")})))}function xJ(e){return e.match(fJ)||[""]}function EJ(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function CJ(e){return!EJ(e)&&(function(e){return e.match(mJ)&&!e.match(hJ)}(e)||function(e){return pJ.test(e)}(e))}const kJ=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,MJ=e=>e.match(kJ)||[];var RJ=e=>MJ(e).reduce(((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`),""),IJ=e=>((e,t)=>MJ(e).join(t).toLowerCase())(e,"_"),OJ={exports:{}};function AJ(e,t){var n=e.length,r=new Array(n),o={},a=n,i=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),l=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!l.has(e[0])||!l.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)o[a]||s(e[a],a,new Set);return r;function s(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!l.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var d=i.get(e)||new Set;if(t=(d=Array.from(d)).length){a.add(e);do{var u=d[--t];s(u,l.get(u),a)}while(t);a.delete(e)}r[--n]=e}}}OJ.exports=function(e){return AJ(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)},OJ.exports.array=AJ;var LJ=dJ(OJ.exports);const SJ=Object.prototype.toString,NJ=Error.prototype.toString,jJ=RegExp.prototype.toString,DJ="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ZJ=/^Symbol\((.*)\)(.*)$/;function VJ(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return DJ.call(e).replace(ZJ,"Symbol($1)");const r=SJ.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+NJ.call(e)+"]":"RegExp"===r?jJ.call(e):null}function TJ(e,t){let n=VJ(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=VJ(this[e],t);return null!==r?r:n}),2)}function BJ(e){return null==e?[]:[].concat(e)}let FJ,PJ,HJ,_J=/\$\{\s*(\w+)\s*\}/g;FJ=Symbol.toStringTag;class WJ{constructor(e,t,n,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[FJ]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],BJ(e).forEach((e=>{if(zJ.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}PJ=Symbol.hasInstance,HJ=Symbol.toStringTag;class zJ extends Error{static formatError(e,t){const n=t.label||t.path||"this";return t=Object.assign({},t,{path:n,originalPath:t.path}),"string"==typeof e?e.replace(_J,((e,n)=>TJ(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r,o){const a=new WJ(e,t,n,r);if(o)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[HJ]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,zJ)}static[PJ](e){return WJ[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let $J={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=null!=r&&r!==n?` (cast from the value \`${TJ(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${TJ(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${TJ(n,!0)}\``+o}},UJ={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},qJ={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},GJ={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},YJ={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${TJ(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${TJ(n,!0)}\``}return zJ.formatError($J.notType,e)}};Object.assign(Object.create(null),{mixed:$J,string:UJ,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:qJ,object:GJ,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:YJ});const KJ=e=>e&&e.__isYupSchema__;class XJ{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:o}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));return new XJ(e,((e,t)=>{var n;let i=a(...e)?r:o;return null!=(n=null==i?void 0:i(t))?n:t}))}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn(n,e,t);if(void 0===r||r===e)return e;if(!KJ(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}const QJ="$",JJ=".";class e0{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===QJ,this.isValue=this.key[0]===JJ,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?QJ:this.isValue?JJ:"";this.path=this.key.slice(n.length),this.getter=this.path&&bJ.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}e0.prototype.__isYupRef=!0;const t0=e=>null==e;function n0(e){function t({value:t,path:n="",options:r,originalValue:o,schema:a},i,l){const{name:s,test:c,params:d,message:u,skipAbsent:f}=e;let{parent:h,context:m,abortEarly:p=a.spec.abortEarly,disableStackTrace:g=a.spec.disableStackTrace}=r;function v(e){return e0.isRef(e)?e.getValue(t,h,m):e}function w(e={}){const r=Object.assign({value:t,originalValue:o,label:a.spec.label,path:e.path||n,spec:a.spec,disableStackTrace:e.disableStackTrace||g},d,e.params);for(const e of Object.keys(r))r[e]=v(r[e]);const i=new zJ(zJ.formatError(e.message||u,r),t,r.path,e.type||s,r.disableStackTrace);return i.params=r,i}const b=p?i:l;let y={path:n,parent:h,type:s,from:r.from,createError:w,resolve:v,options:r,originalValue:o,schema:a};const x=e=>{zJ.isError(e)?b(e):e?l(null):b(w())},E=e=>{zJ.isError(e)?b(e):i(e)};if(f&&t0(t))return x(!0);let C;try{var k;if(C=c.call(y,t,y),"function"==typeof(null==(k=C)?void 0:k.then)){if(r.sync)throw new Error(`Validation test of type: "${y.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(C).then(x,E)}}catch(e){return void E(e)}x(C)}return t.OPTIONS=e,t}function r0(e,t,n,r=n){let o,a,i;return t?(bJ.forEach(t,((l,s,c)=>{let d=s?l.slice(1,l.length-1):l,u="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,f=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${i}" must contain an index to the tuple element, e.g. "${i}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[f],e=u?e.spec.types[f]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${i} which is a type: "${e.type}")`);o=n,n=n&&n[d],e=e.fields[d]}a=d,i=s?"["+l+"]":"."+l})),{schema:e,parent:o,parentPath:a}):{parent:o,parentPath:t,schema:e}}class o0 extends Set{describe(){const e=[];for(const t of this.values())e.push(e0.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new o0(this.values())}merge(e,t){const n=this.clone();return e.forEach((e=>n.add(e))),t.forEach((e=>n.delete(e))),n}}function a0(e,t=new Map){if(KJ(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=a0(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,a0(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(a0(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=a0(o,t)}return n}class i0{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new o0,this._blacklist=new o0,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError($J.notType)})),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation((e=>{e.nonNullable()}))}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=a0(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Object.assign({},t.spec,n.spec);return n.spec=r,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,r,o;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(n=e.abortEarly)?n:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(o=e.disableStackTrace)?o:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({value:e},t)),r="ignore-optionality"===t.assert,o=n._cast(e,t);if(!1!==t.assert&&!n.isType(o)){if(r&&t0(o))return o;let a=TJ(e),i=TJ(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". \n\nattempted value: ${a} \n`+(i!==a?`result of cast: ${i}`:""))}return o}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault(t)),n}_validate(e,t={},n,r){let{path:o,originalValue:a=e,strict:i=this.spec.strict}=t,l=e;i||(l=this._cast(l,Object.assign({assert:!1},t)));let s=[];for(let e of Object.values(this.internalTests))e&&s.push(e);this.runTests({path:o,value:l,originalValue:a,options:t,tests:s},n,(e=>{if(e.length)return r(e,l);this.runTests({path:o,value:l,originalValue:a,options:t,tests:this.tests},n,r)}))}runTests(e,t,n){let r=!1,{tests:o,value:a,originalValue:i,path:l,options:s}=e,c=e=>{r||(r=!0,t(e,a))},d=e=>{r||(r=!0,n(e,a))},u=o.length,f=[];if(!u)return d([]);let h={value:a,originalValue:i,path:l,options:s,schema:this};for(let e=0;e<o.length;e++){(0,o[e])(h,c,(function(e){e&&(Array.isArray(e)?f.push(...e):f.push(e)),--u<=0&&d(f)}))}}asNestedTest({key:e,index:t,parent:n,parentPath:r,originalParent:o,options:a}){const i=null!=e?e:t;if(null==i)throw TypeError("Must include `key` or `index` for nested validations");const l="number"==typeof i;let s=n[i];const c=Object.assign({},a,{strict:!0,parent:n,value:s,originalValue:o[i],key:void 0,[l?"index":"key"]:i,path:l||i.includes(".")?`${r||""}[${l?i:`"${i}"`}]`:(r?`${r}.`:"")+e});return(e,t,n)=>this.resolve(c)._validate(s,c,t,n)}validate(e,t){var n;let r=this.resolve(Object.assign({},t,{value:e})),o=null!=(n=null==t?void 0:t.disableStackTrace)?n:r.spec.disableStackTrace;return new Promise(((n,a)=>r._validate(e,t,((e,t)=>{zJ.isError(e)&&(e.value=t),a(e)}),((e,t)=>{e.length?a(new zJ(e,t,void 0,void 0,o)):n(t)}))))}validateSync(e,t){var n;let r,o=this.resolve(Object.assign({},t,{value:e})),a=null!=(n=null==t?void 0:t.disableStackTrace)?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},t,{sync:!0}),((e,t)=>{throw zJ.isError(e)&&(e.value=t),e}),((t,n)=>{if(t.length)throw new zJ(t,e,void 0,void 0,a);r=n})),r}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(zJ.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(zJ.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):a0(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=n0({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=n0({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=$J.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=$J.notNull){return this.nullability(!1,e)}required(e=$J.required){return this.clone().withMutation((t=>t.nonNullable(e).defined(e)))}notRequired(){return this.clone().withMutation((e=>e.nullable().optional()))}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=$J.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=n0(t),o=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(o)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=BJ(e).map((e=>new e0(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push("function"==typeof t?new XJ(r,t):XJ.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=n0({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=$J.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n.internalTests.whiteList=n0({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}notOneOf(e,t=$J.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n.internalTests.blacklist=n0({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:r,optional:o,nullable:a}=t.spec,i={meta:r,label:n,optional:o,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return i}}i0.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])i0.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:a,schema:i}=r0(this,t,n,r.context);return i[e](o&&o[a],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])i0.prototype[e]=i0.prototype.oneOf;for(const e of["not","nope"])i0.prototype[e]=i0.prototype.notOneOf;const l0=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function s0(e){var t,n;const r=l0.exec(e);return r?{year:c0(r[1]),month:c0(r[2],1)-1,day:c0(r[3],1),hour:c0(r[4]),minute:c0(r[5]),second:c0(r[6]),millisecond:r[7]?c0(r[7].substring(0,3)):0,precision:null!=(t=null==(n=r[7])?void 0:n.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:c0(r[10]),minuteOffset:c0(r[11])}:null}function c0(e,t=0){return Number(e)||t}let d0=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,u0=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,f0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,h0=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),m0=e=>t0(e)||e===e.trim(),p0={}.toString();function g0(){return new v0}class v0 extends i0{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation((()=>{this.transform(((e,t,n)=>{if(!n.spec.coerce||n.isType(e))return e;if(Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===p0?e:r}))}))}required(e){return super.required(e).withMutation((t=>t.test({message:e||$J.required,name:"required",skipAbsent:!0,test:e=>!!e.length})))}notRequired(){return super.notRequired().withMutation((e=>(e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e)))}length(e,t=UJ.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=UJ.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=UJ.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let n,r,o=!1;return t&&("object"==typeof t?({excludeEmptyString:o=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||UJ.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=UJ.email){return this.matches(d0,{name:"email",message:e,excludeEmptyString:!0})}url(e=UJ.url){return this.matches(u0,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=UJ.uuid){return this.matches(f0,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,n,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:n}=e):r=e),this.matches(h0,{name:"datetime",message:r||UJ.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||UJ.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=s0(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||UJ.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=s0(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=UJ.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:m0})}lowercase(e=UJ.lowercase){return this.transform((e=>t0(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>t0(e)||e===e.toLowerCase()})}uppercase(e=UJ.uppercase){return this.transform((e=>t0(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>t0(e)||e===e.toUpperCase()})}}g0.prototype=v0.prototype;let w0=new Date("");class b0 extends i0{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation((()=>{this.transform(((e,t,n)=>!n.spec.coerce||n.isType(e)||null===e?e:(e=function(e){const t=s0(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(n=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}(e),isNaN(e)?b0.INVALID_DATE:new Date(e))))}))}prepareParam(e,t){let n;if(e0.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=qJ.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(n)}})}max(e,t=qJ.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(n)}})}}function y0(e,t){let n=1/0;return e.some(((e,r)=>{var o;if(null!=(o=t.path)&&o.includes(e))return n=r,!0})),n}function x0(e){return(t,n)=>y0(e,t)-y0(e,n)}b0.INVALID_DATE=w0;const E0=(e,t,n)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return n.isType(r)?r:e};function C0(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=C0(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=C0(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(C0)}):"optional"in e?e.optional():e}let k0=e=>"[object Object]"===Object.prototype.toString.call(e);function M0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}const R0=x0([]);function I0(e){return new O0(e)}class O0 extends i0{constructor(e){super({type:"object",check:e=>k0(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=R0,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{e&&this.shape(e)}))}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let o=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,i=[].concat(this._nodes,Object.keys(r).filter((e=>!this._nodes.includes(e)))),l={},s=Object.assign({},t,{parent:l,__validating:t.__validating||!1}),c=!1;for(const e of i){let n=o[e],i=e in r;if(n){let o,a=r[e];s.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:l});let i=n instanceof i0?n.spec:void 0,d=null==i?void 0:i.strict;if(null!=i&&i.strip){c=c||e in r;continue}o=t.__validating&&d?r[e]:n.cast(r[e],s),void 0!==o&&(l[e]=o)}else i&&!a&&(l[e]=r[e]);i===e in l&&l[e]===r[e]||(c=!0)}return c?l:r}_validate(e,t={},n,r){let{from:o=[],originalValue:a=e,recursive:i=this.spec.recursive}=t;t.from=[{schema:this,value:a},...o],t.__validating=!0,t.originalValue=a,super._validate(e,t,n,((e,o)=>{if(!i||!k0(o))return void r(e,o);a=a||o;let l=[];for(let e of this._nodes){let n=this.fields[e];n&&!e0.isRef(n)&&l.push(n.asNestedTest({options:t,key:e,parent:o,parentPath:t.path,originalParent:a}))}this.runTests({tests:l,value:o,originalValue:a,options:t},n,(t=>{r(t.sort(this._sortErrors).concat(e),o)}))}))}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];n[e]=void 0===r?t:r}return t.withMutation((t=>t.setFields(n,[...this._excludedEdges,...e._excludedEdges])))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach((n=>{var r;const o=this.fields[n];let a=e;null!=(r=a)&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[n]})),t[n]=o&&"getDefault"in o?o.getDefault(a):void 0})),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=function(e,t=[]){let n=[],r=new Set,o=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=bJ.split(e)[0];r.add(a),o.has(`${t}-${a}`)||n.push([t,a])}for(const t of Object.keys(e)){let n=e[t];r.add(t),e0.isRef(n)&&n.isSibling?a(n.path,t):KJ(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return LJ.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=x0(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation((n=>{let r=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),r)}))}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return C0(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter((([t,n])=>e.includes(t)&&e.includes(n))))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let r=bJ.getter(e,!0);return this.transform((o=>{if(!o)return o;let a=o;return((e,t)=>{const n=[...bJ.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=bJ.getter(bJ.join(n),!0)(e);return!(!o||!(r in o))})(o,e)&&(a=Object.assign({},o),n||delete a[e],a[t]=r(o)),a}))}json(){return this.transform(E0)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||GJ.exact,test(e){if(null==e)return!0;const t=M0(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=GJ.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=M0(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=GJ.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>{if(!t)return t;const n={};for(const r of Object.keys(t))n[e(r)]=t[r];return n}))}camelCase(){return this.transformKeys(RJ)}snakeCase(){return this.transformKeys(IJ)}constantCase(){return this.transformKeys((e=>IJ(e).toUpperCase()))}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[o,a]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[o]})),n.fields[o]=a.describe(t)}return n}}I0.prototype=O0.prototype;const A0=({open:t,onOpenChange:n,title:r,description:o,children:a,confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:s,onCancel:c,onClose:d,trigger:u,typeToConfirm:f,hideCancelButton:h=!1,isLoading:m=!1,testId:p,cancelClassName:g,confirmClassName:v})=>{const w=!!f,b=e.useMemo((()=>I0({confirmInput:g0().required("This field is required.").test("type-to-confirm",`Please type '${f}' to proceed`,(e=>e===f))})),[f]),{methods:y,FormRoot:x}=tJ({defaultValues:{confirmInput:""},validationSchema:b,mode:"onTouched",reValidateMode:"onChange"}),k=y.formState.isValid;e.useEffect((()=>{t||y.reset()}),[t]);const M=()=>{null==s||s()};return C(HU,{open:t,onOpenChange:e=>{m||(e||null==d||d(),null==n||n(e))},children:[u&&E(_U,{asChild:!0,children:u}),C($U,{"data-testid":p,children:[C(UU,{children:[E(GU,{"data-testid":p&&`${p}-title`,children:r}),o&&E(YU,{"data-testid":p&&`${p}-description`,children:o})]}),a,w&&C(x,{className:"flex flex-col gap-4 w-full",onSubmit:M,children:[C("p",{className:"typography-small1 text-text-contrast-max",children:["Type “",f,"” to proceed."]}),E(oJ,{name:"confirmInput",component:mk,componentProps:{label:"Type to confirm",required:!0,hasClearIcon:!0,keepFooterSpace:!0,fullwidth:!0,testId:p&&`${p}-type-to-confirm-input`},disabled:m})]}),C(qU,{children:[!h&&E(XU,{className:g,"data-testid":p&&`${p}-cancel-button`,onClick:()=>{null==c||c(),null==d||d()},disabled:m,children:l}),C(KU,{type:"button",disabled:m||w&&!k,onClick:e=>{e.preventDefault(),w?y.handleSubmit(M)():null==s||s()},className:v,"data-testid":p&&`${p}-confirm-button`,children:[m&&E(SC,{}),i]})]})]})]})};A0.displayName="ConfirmDialog";const L0=({open:e,onOpenChange:t,title:n,description:r,children:o,trigger:a,confirmAction:i,cancelAction:l,extraAction:s,scrollable:c=!1,className:d,formId:u,testId:f})=>{var h,m,p,g,v,w,b,y,x;const k=i||l||s;return C(aU,{open:e,onOpenChange:t,children:[a&&E(iU,{asChild:!0,children:a}),C(dU,{className:d,"data-testid":f,children:[C(uU,{children:[n&&E(mU,{"data-testid":f&&`${f}-title`,children:n}),r&&E(pU,{"data-testid":f&&`${f}-description`,children:r})]}),o&&E(fU,{scrollable:c,children:o}),k&&C(hU,{className:s?"justify-between":void 0,children:[s&&E(NC,{type:null!==(h=s.type)&&void 0!==h?h:"button",variant:null!==(m=s.variant)&&void 0!==m?m:"outline",color:null!==(p=s.color)&&void 0!==p?p:"secondary",fullwidth:!1,disabled:s.disabled,isLoading:s.isLoading,onClick:s.onClick,className:s.className,"data-testid":f&&`${f}-extra-button`,children:s.label}),C("div",{className:"flex items-center gap-4",children:[l&&E(NC,{type:null!==(g=l.type)&&void 0!==g?g:"button",variant:null!==(v=l.variant)&&void 0!==v?v:"outline",color:null!==(w=l.color)&&void 0!==w?w:"primary",fullwidth:!1,disabled:l.disabled,isLoading:l.isLoading,onClick:l.onClick,className:l.className,"data-testid":f&&`${f}-cancel-button`,children:l.label}),i&&E(NC,{type:u?"submit":null!==(b=i.type)&&void 0!==b?b:"button",form:u,variant:null!==(y=i.variant)&&void 0!==y?y:"solid",color:null!==(x=i.color)&&void 0!==x?x:"primary",fullwidth:!1,disabled:i.disabled,isLoading:i.isLoading,onClick:i.onClick,className:i.className,"data-testid":f&&`${f}-confirm-button`,children:i.label})]})]})]})]})};function S0(e,n,r){const o=[];let a=[];const i=e=>{var t,i;if(0===a.length)return;const l=a;a=[];const s=null!==(i=null===(t=l.find((e=>n.includes(e.value))))||void 0===t?void 0:t.value)&&void 0!==i?i:"";o.push(E(nz,{value:s,onValueChange:e=>{var t;const n=l.find((t=>t.value===e));n&&(null==r||r(e,n),null===(t=n.onClick)||void 0===t||t.call(n))},children:l.map((e=>E(sz,{value:e.value,disabled:e.disabled,icon:e.icon,"data-testid":e.testId,children:e.label},e.value)))},e))};return e.forEach(((e,l)=>{var s;if("item"!==e.type||"radio"!==e.item.type)if(i(`radio-${l}`),"separator"!==e.type)if("label"!==e.type)if("custom"!==e.type)if("submenu"!==e.type){if("item"===e.type){const t=e.item,a=null!==(s=t.checked)&&void 0!==s?s:n.includes(t.value);if("checkbox"===t.type)return void o.push(E(lz,{checked:a,disabled:t.disabled,"data-testid":t.testId,onCheckedChange:()=>{var e;null==r||r(t.value,t),null===(e=t.onClick)||void 0===e||e.call(t)},children:t.label},t.value));o.push(E(iz,{selected:a,icon:t.icon,disabled:t.disabled,className:LC(t.danger&&"text-red-500"),"data-testid":t.testId,onSelect:()=>{var e;null==r||r(t.value,t),null===(e=t.onClick)||void 0===e||e.call(t)},children:t.label},t.value))}}else o.push(C(tz,{children:[C(rz,{disabled:e.disabled,children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4"}),e.icon]}),e.label]}),E(oz,{children:S0(e.items,n,r)})]},`sub-${l}`));else o.push(E(t.Fragment,{children:e.render()},`custom-${l}`));else o.push(E(cz,{children:e.label},`lbl-${l}`));else o.push(E(dz,{},`sep-${l}`));else a.push(e.item)})),i("radio-end"),o}L0.displayName="FormDialog";const N0=({trigger:e,items:t,selectedValues:n=[],onSelect:r,header:o,open:a,onOpenChange:i,align:l="start",side:s="bottom",sideOffset:c=4,contentClassName:d,testId:u})=>E("div",{onClick:e=>e.stopPropagation(),children:C(XW,{open:a,onOpenChange:i,children:[e&&E(QW,{asChild:!0,children:e}),C(az,{align:l,side:s,sideOffset:c,className:d,"data-testid":u,children:[o&&E("div",{className:"sticky top-0 z-10 bg-modal-surface border-b border-[var(--dropdown-menu-seperator-bg)]",children:o}),S0(t,n,r)]})]})});N0.displayName="Menu";const j0=e=>String(e).length>10?e/1e3:e,D0=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},Z0=e=>{const t=new Date(e);return t.setHours(23,59,59,999),t},V0=()=>{const e=D0(new Date);return{startTime:e,endTime:Z0(e)}},T0=e=>{const t=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());return j0(t)},B0={"main-primary":"--main-primary","main-secondary":"--main-secondary","main-tertiary":"--main-tertiary","brand-midnight-blue":"--brand-midnight-blue","brand-columbia-blue":"--brand-columbia-blue","brand-background":"--brand-background","brand-lemon-glacier":"--brand-lemon-glacier","primary-5":"--ramps-primary-5","primary-10":"--ramps-primary-10","primary-20":"--ramps-primary-20","primary-30":"--ramps-primary-30","primary-40":"--ramps-primary-40","primary-50":"--ramps-primary-50","primary-60":"--ramps-primary-60","primary-70":"--ramps-primary-70","primary-80":"--ramps-primary-80","primary-90":"--ramps-primary-90","primary-100":"--ramps-primary-100","primary-110":"--ramps-primary-110","primary-120":"--ramps-primary-120","primary-130":"--ramps-primary-130","primary-140":"--ramps-primary-140","primary-150":"--ramps-primary-150","secondary-5":"--ramps-secondary-5","secondary-10":"--ramps-secondary-10","secondary-20":"--ramps-secondary-20","secondary-30":"--ramps-secondary-30","secondary-40":"--ramps-secondary-40","secondary-50":"--ramps-secondary-50","secondary-60":"--ramps-secondary-60","secondary-70":"--ramps-secondary-70","secondary-80":"--ramps-secondary-80","secondary-90":"--ramps-secondary-90","secondary-100":"--ramps-secondary-100","secondary-110":"--ramps-secondary-110","secondary-120":"--ramps-secondary-120","secondary-130":"--ramps-secondary-130","secondary-140":"--ramps-secondary-140","secondary-150":"--ramps-secondary-150","tertiary-5":"--ramps-tertiary-5","tertiary-10":"--ramps-tertiary-10","tertiary-20":"--ramps-tertiary-20","tertiary-30":"--ramps-tertiary-30","tertiary-40":"--ramps-tertiary-40","tertiary-50":"--ramps-tertiary-50","tertiary-60":"--ramps-tertiary-60","tertiary-70":"--ramps-tertiary-70","tertiary-80":"--ramps-tertiary-80","tertiary-90":"--ramps-tertiary-90","tertiary-100":"--ramps-tertiary-100","tertiary-110":"--ramps-tertiary-110","tertiary-120":"--ramps-tertiary-120","tertiary-130":"--ramps-tertiary-130","tertiary-140":"--ramps-tertiary-140","tertiary-150":"--ramps-tertiary-150","grey-5":"--ramps-grey-5","grey-10":"--ramps-grey-10","grey-20":"--ramps-grey-20","grey-30":"--ramps-grey-30","grey-40":"--ramps-grey-40","grey-50":"--ramps-grey-50","grey-60":"--ramps-grey-60","grey-70":"--ramps-grey-70","grey-80":"--ramps-grey-80","grey-90":"--ramps-grey-90","grey-100":"--ramps-grey-100","grey-110":"--ramps-grey-110","grey-120":"--ramps-grey-120","grey-130":"--ramps-grey-130","grey-140":"--ramps-grey-140","grey-150":"--ramps-grey-150","grey2-50":"--ramps-grey2-50","grey2-100":"--ramps-grey2-100","grey2-200":"--ramps-grey2-200","grey2-300":"--ramps-grey2-300","grey2-400":"--ramps-grey2-400","grey2-500":"--ramps-grey2-500","grey2-600":"--ramps-grey2-600","grey2-700":"--ramps-grey2-700","grey2-800":"--ramps-grey2-800","grey2-900":"--ramps-grey2-900","grey2-950":"--ramps-grey2-950","info-50":"--ramps-info-50","info-100":"--ramps-info-100","info-200":"--ramps-info-200","info-300":"--ramps-info-300","info-400":"--ramps-info-400","info-500":"--ramps-info-500","info-600":"--ramps-info-600","info-700":"--ramps-info-700","info-800":"--ramps-info-800","info-900":"--ramps-info-900","info-950":"--ramps-info-950","success-50":"--ramps-success-50","success-100":"--ramps-success-100","success-200":"--ramps-success-200","success-300":"--ramps-success-300","success-400":"--ramps-success-400","success-500":"--ramps-success-500","success-600":"--ramps-success-600","success-700":"--ramps-success-700","success-800":"--ramps-success-800","success-900":"--ramps-success-900","success-950":"--ramps-success-950","warning-50":"--ramps-warning-50","warning-100":"--ramps-warning-100","warning-200":"--ramps-warning-200","warning-300":"--ramps-warning-300","warning-400":"--ramps-warning-400","warning-500":"--ramps-warning-500","warning-600":"--ramps-warning-600","warning-700":"--ramps-warning-700","warning-800":"--ramps-warning-800","warning-900":"--ramps-warning-900","warning-950":"--ramps-warning-950","error-50":"--ramps-error-50","error-100":"--ramps-error-100","error-200":"--ramps-error-200","error-300":"--ramps-error-300","error-400":"--ramps-error-400","error-500":"--ramps-error-500","error-600":"--ramps-error-600","error-700":"--ramps-error-700","error-800":"--ramps-error-800","error-900":"--ramps-error-900","error-950":"--ramps-error-950",primary:"--state-primary-default","primary-hover":"--state-primary-hover","primary-stroke":"--state-primary-stroke","primary-hover-bg":"--state-primary-hover-bg","primary-pressed":"--state-primary-pressed","primary-active":"--state-primary-active","primary-text-solid":"--state-primary-text-solid","primary-text-outline":"--state-primary-text-outline","primary-text-hover":"--state-primary-text-hover","primary-text-pressed":"--state-primary-text-pressed",secondary:"--state-secondary-default","secondary-hover":"--state-secondary-hover","secondary-stroke":"--state-secondary-stroke","secondary-hover-bg":"--state-secondary-hover-bg","secondary-pressed":"--state-secondary-pressed","secondary-active":"--state-secondary-active","secondary-text-solid":"--state-secondary-text-solid","secondary-text-outline":"--state-secondary-text-outline","secondary-text-hover":"--state-secondary-text-hover","secondary-text-pressed":"--state-secondary-text-pressed",tertiary:"--state-tertiary-default","tertiary-hover":"--state-tertiary-hover","tertiary-stroke":"--state-tertiary-stroke","tertiary-hover-bg":"--state-tertiary-hover-bg","tertiary-pressed":"--state-tertiary-pressed","tertiary-active":"--state-tertiary-active","tertiary-text-solid":"--state-tertiary-text-solid","tertiary-text-outline":"--state-tertiary-text-outline","tertiary-text-hover":"--state-tertiary-text-hover","tertiary-text-pressed":"--state-tertiary-text-pressed",info:"--state-info-default","info-hover":"--state-info-hover","info-stroke":"--state-info-stroke","info-hover-bg":"--state-info-hover-bg","info-pressed":"--state-info-pressed","info-active":"--state-info-active","info-text-solid":"--state-info-text-solid","info-text-outline":"--state-info-text-outline","info-text-hover":"--state-info-text-hover","info-text-pressed":"--state-info-text-pressed",success:"--state-success-default","success-hover":"--state-success-hover","success-stroke":"--state-success-stroke","success-hover-bg":"--state-success-hover-bg","success-pressed":"--state-success-pressed","success-active":"--state-success-active","success-text-solid":"--state-success-text-solid","success-text-outline":"--state-success-text-outline","success-text-hover":"--state-success-text-hover","success-text-pressed":"--state-success-text-pressed",warning:"--state-warning-default","warning-hover":"--state-warning-hover","warning-stroke":"--state-warning-stroke","warning-hover-bg":"--state-warning-hover-bg","warning-pressed":"--state-warning-pressed","warning-active":"--state-warning-active","warning-text-solid":"--state-warning-text-solid","warning-text-outline":"--state-warning-text-outline","warning-text-hover":"--state-warning-text-hover","warning-text-pressed":"--state-warning-text-pressed",error:"--state-error-default","error-hover":"--state-error-hover","error-stroke":"--state-error-stroke","error-hover-bg":"--state-error-hover-bg","error-pressed":"--state-error-pressed","error-active":"--state-error-active","error-text-solid":"--state-error-text-solid","error-text-outline":"--state-error-text-outline","error-text-hover":"--state-error-text-hover","error-text-pressed":"--state-error-text-pressed","disable-solid":"--state-disable-solid","disable-outline":"--state-disable-outline","text-black":"--text-black","text-contrast-low":"--text-contrast-low","text-contrast-medium":"--text-contrast-medium","text-contrast-high":"--text-contrast-high","text-contrast-max":"--text-contrast-max","text-g-contrast-low":"--text-g-contrast-low","text-g-contrast-medium":"--text-g-contrast-medium","text-g-contrast-high":"--text-g-contrast-high","text-dark":"--text-dark","text-medium":"--text-medium","text-light":"--text-light","text-grey-dark":"--text-grey-dark","text-grey-medium":"--text-grey-medium","text-grey-light":"--text-grey-light","text-white":"--text-white","input-default-text":"--input-default-text","input-default-stroke":"--input-default-stroke","input-filled-text":"--input-filled-text","input-active-stroke":"--input-active-stroke","input-disable-text":"--input-disable-text","input-disable-stroke":"--input-disable-stroke","input-disable-bg":"--input-disable-bg","input-label-bg":"--input-label-bg","input-error":"--input-error","function-default-solid":"--function-default-solid","function-default-hover":"--function-default-hover","function-default-hover-bg":"--function-default-hover-bg","function-default-stroke":"--function-default-stroke","function-default-icon":"--function-default-icon","function-default-outline-icon":"--function-default-outline-icon","function-active-solid":"--function-active-solid","function-active-hover":"--function-active-hover","function-active-hover-bg":"--function-active-hover-bg","function-active-stroke":"--function-active-stroke","function-active-icon":"--function-active-icon","modal-surface":"--modal-surface","modal-highlight":"--modal-highlight","modal-overlay":"--modal-overlay","bg-bg1":"--bg-bg1","bg-bg2":"--bg-bg2","bg-bg3":"--bg-bg3","bg-stroke1":"--bg-stroke1","bg-stroke2":"--bg-stroke2","state-primary-text-solid":"--state-primary-text-solid","state-primary-text-hover":"--state-primary-text-hover","state-secondary-text-solid":"--state-secondary-text-solid","state-secondary-text-hover":"--state-secondary-text-hover","state-tertiary-text-solid":"--state-tertiary-text-solid","state-tertiary-text-hover":"--state-tertiary-text-hover","state-info-text-solid":"--state-info-text-solid","state-info-text-hover":"--state-info-text-hover","state-success-text-solid":"--state-success-text-solid","state-success-text-hover":"--state-success-text-hover","state-warning-text-solid":"--state-warning-text-solid","state-warning-text-hover":"--state-warning-text-hover","state-error-text-solid":"--state-error-text-solid","state-error-text-hover":"--state-error-text-hover","base-bg":"--base-color-bg","base-bg2":"--base-color-bg2","base-bg3":"--base-color-bg3","base-workspace-stroke":"--base-color-workspace-stroke","base-guideline-stroke":"--base-color-guideline-stroke","base-popup":"--base-color-popup","base-popup-highlight":"--base-color-popup-highlight","base-popup-curtain":"--base-color-popup-curtain","base-popup-foreground":"--base-color-popup-foreground","common-white":"--common-white","common-black":"--common-black","brand-rvl-yellow":"--brand-rvl-yellow","brand-rvl-grey":"--brand-rvl-grey","others-1":"--others-1","others-2":"--others-2","others-3":"--others-3","others-4":"--others-4","others-5":"--others-5","others-6":"--others-6","others-7":"--others-7","others-8":"--others-8","others-9":"--others-9","others-10":"--others-10","others-11":"--others-11","others-12":"--others-12","others-13":"--others-13","others-14":"--others-14","others-15":"--others-15","others-16":"--others-16","others-17":"--others-17","others-18":"--others-18","others-19":"--others-19","others-20":"--others-20","others-21":"--others-21","others-22":"--others-22","others-23":"--others-23","others-24":"--others-24","others-25":"--others-25","others-26":"--others-26","others-27":"--others-27","others-28":"--others-28","others-29":"--others-29","others-30":"--others-30","others-31":"--others-31","others-32":"--others-32","others-33":"--others-33","others-34":"--others-34","others-35":"--others-35","page-bg-main":"--page-bg-main","page-bg-circle-top-g-in":"--page-bg-circle-top-g-in","page-bg-circle-top-g-out":"--page-bg-circle-top-g-out","page-bg-circle-bottom-g-in":"--page-bg-circle-bottom-g-in","page-bg-circle-bottom-g-out":"--page-bg-circle-bottom-g-out","modal-line":"--modal-line","bg-bg4":"--bg-bg4","bg-bg5":"--bg-bg5","bg-stroke3":"--bg-stroke3","bg-stroke4":"--bg-stroke4","bg-stroke5":"--bg-stroke5",background:"--background",foreground:"--foreground",surface:"--surface","surface-foreground":"--surface-foreground","primary-foreground":"--primary-foreground","secondary-foreground":"--secondary-foreground","tertiary-foreground":"--tertiary-foreground","info-foreground":"--info-foreground","success-foreground":"--success-foreground","warning-foreground":"--warning-foreground","error-foreground":"--error-foreground","grey-foreground":"--grey-foreground","grey2-foreground":"--grey2-foreground","primary-transparent-8":"--transparent-primary-8","primary-transparent-12":"--transparent-primary-12","primary-transparent-16":"--transparent-primary-16","primary-transparent-24":"--transparent-primary-24","primary-transparent-32":"--transparent-primary-32","primary-transparent-48":"--transparent-primary-48","secondary-transparent-8":"--transparent-secondary-8","secondary-transparent-12":"--transparent-secondary-12","secondary-transparent-16":"--transparent-secondary-16","secondary-transparent-24":"--transparent-secondary-24","secondary-transparent-32":"--transparent-secondary-32","secondary-transparent-48":"--transparent-secondary-48","tertiary-transparent-8":"--transparent-tertiary-8","tertiary-transparent-12":"--transparent-tertiary-12","tertiary-transparent-16":"--transparent-tertiary-16","tertiary-transparent-24":"--transparent-tertiary-24","tertiary-transparent-32":"--transparent-tertiary-32","tertiary-transparent-48":"--transparent-tertiary-48","info-transparent-8":"--transparent-info-8","info-transparent-12":"--transparent-info-12","info-transparent-16":"--transparent-info-16","info-transparent-24":"--transparent-info-24","info-transparent-32":"--transparent-info-32","info-transparent-48":"--transparent-info-48","success-transparent-8":"--transparent-success-8","success-transparent-12":"--transparent-success-12","success-transparent-16":"--transparent-success-16","success-transparent-24":"--transparent-success-24","success-transparent-32":"--transparent-success-32","success-transparent-48":"--transparent-success-48","warning-transparent-8":"--transparent-warning-8","warning-transparent-12":"--transparent-warning-12","warning-transparent-16":"--transparent-warning-16","warning-transparent-24":"--transparent-warning-24","warning-transparent-32":"--transparent-warning-32","warning-transparent-48":"--transparent-warning-48","error-transparent-8":"--transparent-error-8","error-transparent-12":"--transparent-error-12","error-transparent-16":"--transparent-error-16","error-transparent-24":"--transparent-error-24","error-transparent-32":"--transparent-error-32","error-transparent-48":"--transparent-error-48","grey-transparent-8":"--transparent-grey-8","grey-transparent-12":"--transparent-grey-12","grey-transparent-16":"--transparent-grey-16","grey-transparent-24":"--transparent-grey-24","grey-transparent-32":"--transparent-grey-32","grey-transparent-48":"--transparent-grey-48","grey2-transparent-8":"--transparent-grey2-8","grey2-transparent-12":"--transparent-grey2-12","grey2-transparent-16":"--transparent-grey2-16","grey2-transparent-24":"--transparent-grey2-24","grey2-transparent-32":"--transparent-grey2-32","grey2-transparent-48":"--transparent-grey2-48","white-transparent-8":"--transparent-white-8","white-transparent-12":"--transparent-white-12","white-transparent-16":"--transparent-white-16","white-transparent-24":"--transparent-white-24","white-transparent-32":"--transparent-white-32","white-transparent-48":"--transparent-white-48","black-transparent-8":"--transparent-black-8","black-transparent-12":"--transparent-black-12","black-transparent-16":"--transparent-black-16","black-transparent-24":"--transparent-black-24","black-transparent-32":"--transparent-black-32","black-transparent-48":"--transparent-black-48"};function F0(e,t=document){if("undefined"==typeof window)return"";const n=t instanceof Document?t.documentElement:t,r=e in B0?B0[e]:e.startsWith("--")?e:`--${e}`;return getComputedStyle(n).getPropertyValue(r).trim()}function P0(e=Object.keys(B0),t){return e.reduce(((e,n)=>(e[n]=F0(n,t),e)),{})}const H0=e=>{if(e.startsWith("color(")){const t=e.match(/([\d.]+)/g);if(t&&t.length>=3){const[e,n,r]=t.slice(0,3).map((e=>Math.round(255*parseFloat(e))));let o=`#${[e,n,r].map((e=>("0"+e.toString(16)).slice(-2))).join("")}`;if(4===t.length){o+=("0"+Math.round(255*parseFloat(t[3])).toString(16)).slice(-2)}return o}}else{if(e.startsWith("#"))return e;{const t=e.match(/\d+/g);if(t&&t.length>=3)return`#${t.slice(0,3).map((e=>("0"+parseInt(e).toString(16)).slice(-2))).join("")}`}}return e};export{Zk as ActionButton,HU as AlertDialog,KU as AlertDialogAction,XU as AlertDialogCancel,$U as AlertDialogContent,YU as AlertDialogDescription,qU as AlertDialogFooter,UU as AlertDialogHeader,zU as AlertDialogOverlay,WU as AlertDialogPortal,GU as AlertDialogTitle,_U as AlertDialogTrigger,oS as Avatar,aS as AvatarGroup,sS as Badge,NC as Button,Ej as Calendar,LL as Checkbox,yS as Collapsible,A0 as ConfirmDialog,Kz as DataTable,ZV as DatePicker,aU as Dialog,fU as DialogBody,sU as DialogClose,dU as DialogContent,pU as DialogDescription,hU as DialogFooter,uU as DialogHeader,cU as DialogOverlay,lU as DialogPortal,mU as DialogTitle,iU as DialogTrigger,JA as Dropdown,XW as DropdownMenu,lz as DropdownMenuCheckboxItem,az as DropdownMenuContent,JW as DropdownMenuGroup,iz as DropdownMenuItem,cz as DropdownMenuLabel,ez as DropdownMenuPortal,nz as DropdownMenuRadioGroup,sz as DropdownMenuRadioItem,dz as DropdownMenuSeparator,uz as DropdownMenuShortcut,tz as DropdownMenuSub,oz as DropdownMenuSubContent,rz as DropdownMenuSubTrigger,QW as DropdownMenuTrigger,oJ as Field,aJ as FieldMessage,kK as FocusedScrollView,FL as Footer,rJ as Form,L0 as FormDialog,Ek as Icon,TL as Input,eq as InputFilter,ZL as Label,SC as Loading,wk as MaskedTextInput,N0 as Menu,iz as MenuItem,cz as MenuLabel,dz as MenuSeparator,BL as Navbar,kk as NumberInput,TV as OtpInput,BV as OtpInputGroup,Ck as PasswordInput,TZ as Popover,FZ as PopoverContent,BZ as PopoverTrigger,FV as ProgressBar,xX as RadioGroup,EX as RadioGroupItem,IK as ScrollArea,QU as Search,dS as SeverityBadge,Dq as Slider,Iz as Switch,B0 as THEME_COLOR_KEYS,PV as Table,_V as TableBody,qV as TableCaption,UV as TableCell,WV as TableFooter,$V as TableHead,HV as TableHeader,GV as TablePagination,zV as TableRow,Vk as Tabs,jk as Text,Lk as TextArea,mk as TextInput,iK as Toast,lK as ToastAction,sK as ToastClose,dK as ToastDescription,oK as ToastProvider,cK as ToastTitle,aK as ToastViewport,yK as Toaster,$G as Tooltip,qG as TooltipArrow,GG as TooltipContent,zG as TooltipProvider,YG as TooltipSimple,UG as TooltipTrigger,CK as Tree,xK as TreeItem,sJ as ValidationHintList,LC as cn,eJ as createControlledForm,JQ as createYupResolver,Z0 as getEndDateOfDay,bk as getLucideIconNames,D0 as getStartDateOfDay,V0 as getStartEndTimestampOfDay,F0 as getThemeColor,P0 as getThemeColors,T0 as getTimestampUTC,mK as reducer,j0 as resloveTimestamp,H0 as srgbToHex,wK as toast,tJ as useControlledForm,cJ as useOptionBridge,EK as usePrevious,bK as useToast};
54
+ function qT(t,n){return t?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(r=t)||"function"==typeof r||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?e.createElement(t,n):t:null;var r}function GT(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function YT(...e){return t=>{let n=!1;const r=e.map((e=>{const r=GT(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():GT(e[t],null)}}}}var KT=e.forwardRef(((t,n)=>{const{children:r,...o}=t,a=e.Children.toArray(r),i=a.find(JT);if(i){const t=i.props.children,r=a.map((n=>n===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n));return E(XT,{...o,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return E(XT,{...o,ref:n,children:r})}));KT.displayName="Slot";var XT=e.forwardRef(((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r);return e.cloneElement(r,{...eB(o,r.props),ref:n?YT(n,t):t})}return e.Children.count(r)>1?e.Children.only(null):null}));XT.displayName="SlotClone";var QT=({children:e})=>E(k,{children:e});function JT(t){return e.isValidElement(t)&&t.type===QT}function eB(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{a(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}var tB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?KT:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),nB=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(tB.div,{...o,ref:n}),l):null}));nB.displayName="Portal";var rB=nB;const oB="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function aB(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function iB(e){return"nodeType"in e}function lB(e){var t,n;return e?aB(e)?e:iB(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function sB(e){const{Document:t}=lB(e);return e instanceof t}function cB(e){return!aB(e)&&e instanceof lB(e).HTMLElement}function dB(e){return e instanceof lB(e).SVGElement}function uB(e){return e?aB(e)?e.document:iB(e)?sB(e)?e:cB(e)||dB(e)?e.ownerDocument:document:document:document}const fB=oB?f:d;function hB(e){const t=r(e);return fB((()=>{t.current=e})),o((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function mB(e,t){void 0===t&&(t=[e]);const n=r(e);return fB((()=>{n.current!==e&&(n.current=e)}),t),n}function pB(e,t){const n=r();return s((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function gB(e){const t=hB(e),n=r(null),a=o((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,a]}function vB(e){const t=r();return d((()=>{t.current=e}),[e]),t.current}let wB={};function bB(e,t){return s((()=>{if(t)return t;const n=null==wB[e]?0:wB[e]+1;return wB[e]=n,e+"-"+n}),[e,t])}function yB(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const xB=yB(1),EB=yB(-1);function CB(e){if(!e)return!1;const{KeyboardEvent:t}=lB(e.target);return t&&e instanceof t}function kB(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=lB(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const MB=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[MB.Translate.toString(e),MB.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),RB="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function IB(e){return e.matches(RB)?e:e.querySelector(RB)}const OB={display:"none"};function AB(e){let{id:n,value:r}=e;return t.createElement("div",{id:n,style:OB},r)}function LB(e){let{id:n,announcement:r,ariaLiveType:o="assertive"}=e;return t.createElement("div",{id:n,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const SB=i(null);const NB={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},jB={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function DB(e){let{announcements:n=jB,container:r,hiddenTextDescribedById:i,screenReaderInstructions:l=NB}=e;const{announce:u,announcement:f}=function(){const[e,t]=c("");return{announce:o((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=bB("DndLiveRegion"),[m,p]=c(!1);if(d((()=>{p(!0)}),[]),function(e){const t=a(SB);d((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(s((()=>({onDragStart(e){let{active:t}=e;u(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:r}=e;n.onDragMove&&u(n.onDragMove({active:t,over:r}))},onDragOver(e){let{active:t,over:r}=e;u(n.onDragOver({active:t,over:r}))},onDragEnd(e){let{active:t,over:r}=e;u(n.onDragEnd({active:t,over:r}))},onDragCancel(e){let{active:t,over:r}=e;u(n.onDragCancel({active:t,over:r}))}})),[u,n])),!m)return null;const g=t.createElement(t.Fragment,null,t.createElement(AB,{id:i,value:l.draggable}),t.createElement(LB,{id:h,announcement:f}));return r?A(g,r):g}var ZB;function VB(){}function TB(e,t){return s((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function BB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>[...t].filter((e=>null!=e))),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(ZB||(ZB={}));const FB=Object.freeze({x:0,y:0});function PB(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function HB(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _B(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function WB(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function zB(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}function $B(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const UB=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=$B(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=PB($B(r),o);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(HB)};function qB(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=i*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const GB=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=qB(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(_B)};function YB(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:FB}function KB(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const XB=KB(1);const QB={ignoreTransform:!1};function JB(e,t){void 0===t&&(t=QB);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=lB(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,s=e.left-i-(1-o)*parseFloat(n),c=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=a?e.height/a:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:i,bottom:l,right:s}=n;return{top:r,left:o,width:a,height:i,bottom:l,right:s}}function eF(e){return JB(e,{ignoreTransform:!0})}function tF(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(sB(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!cB(o)||dB(o))return n;if(n.includes(o))return n;const a=lB(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=lB(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=lB(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function nF(e){const[t]=tF(e,1);return null!=t?t:null}function rF(e){return oB&&e?aB(e)?e:iB(e)?sB(e)||e===uB(e).scrollingElement?window:cB(e)?e:null:null:null}function oF(e){return aB(e)?e.scrollX:e.scrollLeft}function aF(e){return aB(e)?e.scrollY:e.scrollTop}function iF(e){return{x:oF(e),y:aF(e)}}var lF;function sF(e){return!(!oB||!e)&&e===document.scrollingElement}function cF(e){const t={x:0,y:0},n=sF(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(lF||(lF={}));const dF={x:.2,y:.2};function uF(e,t,n,r,o){let{top:a,left:i,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=dF);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=cF(e),h={x:0,y:0},m={x:0,y:0},p=t.height*o.y,g=t.width*o.x;return!c&&a<=t.top+p?(h.y=lF.Backward,m.y=r*Math.abs((t.top+p-a)/p)):!d&&s>=t.bottom-p&&(h.y=lF.Forward,m.y=r*Math.abs((t.bottom-p-s)/p)),!f&&l>=t.right-g?(h.x=lF.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!u&&i<=t.left+g&&(h.x=lF.Backward,m.x=r*Math.abs((t.left+g-i)/g)),{direction:h,speed:m}}function fF(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function hF(e){return e.reduce(((e,t)=>xB(e,iF(t))),FB)}const mF=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+oF(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+aF(t)),0)}]];class pF{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=tF(t),r=hF(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of mF)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class gF{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function vF(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var wF,bF;function yF(e){e.preventDefault()}function xF(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(wF||(wF={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(bF||(bF={}));const EF={start:[bF.Space,bF.Enter],cancel:[bF.Esc],end:[bF.Space,bF.Enter,bF.Tab]},CF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case bF.Right:return{...n,x:n.x+25};case bF.Left:return{...n,x:n.x-25};case bF.Down:return{...n,y:n.y+25};case bF.Up:return{...n,y:n.y-25}}};class kF{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new gF(uB(t)),this.windowListeners=new gF(lB(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(wF.Resize,this.handleCancel),this.windowListeners.add(wF.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(wF.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=JB),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);nF(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(FB)}handleKeyDown(e){if(CB(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=EF,coordinateGetter:a=CF,scrollBehavior:i="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:FB;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=EB(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:f}=cF(n),h=fF(n),m={x:Math.min(o===bF.Right?h.right-h.width/2:h.right,Math.max(o===bF.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===bF.Down?h.bottom-h.height/2:h.bottom,Math.max(o===bF.Down?h.top:h.top+h.height/2,d.y))},p=o===bF.Right&&!l||o===bF.Left&&!s,g=o===bF.Down&&!c||o===bF.Up&&!a;if(p&&m.x!==d.x){const e=n.scrollLeft+t.x,a=o===bF.Right&&e<=u.x||o===bF.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:i});r.x=a?n.scrollLeft-e:o===bF.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:i});break}if(g&&m.y!==d.y){const e=n.scrollTop+t.y,a=o===bF.Down&&e<=u.y||o===bF.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:i});r.y=a?n.scrollTop-e:o===bF.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:i});break}}this.handleMove(e,xB(EB(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function MF(e){return Boolean(e&&"distance"in e)}function RF(e){return Boolean(e&&"delay"in e)}kF.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=EF,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class IF{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=lB(e);return e instanceof t?e:uB(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=uB(a),this.documentListeners=new gF(this.document),this.listeners=new gF(n),this.windowListeners=new gF(lB(a)),this.initialCoordinates=null!=(r=kB(o))?r:FB,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(wF.Resize,this.handleCancel),this.windowListeners.add(wF.DragStart,yF),this.windowListeners.add(wF.VisibilityChange,this.handleCancel),this.windowListeners.add(wF.ContextMenu,yF),this.documentListeners.add(wF.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RF(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(MF(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(wF.Click,xF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(wF.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!r)return;const l=null!=(t=kB(e))?t:FB,s=EB(r,l);if(!n&&i){if(MF(i)){if(null!=i.tolerance&&vF(s,i.tolerance))return this.handleCancel();if(vF(s,i.distance))return this.handleStart()}return RF(i)&&vF(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),a(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===bF.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const OF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class AF extends IF{constructor(e){const{event:t}=e,n=uB(t.target);super(e,OF,n)}}AF.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const LF={move:{name:"mousemove"},end:{name:"mouseup"}};var SF;!function(e){e[e.RightClick=2]="RightClick"}(SF||(SF={}));(class extends IF{constructor(e){super(e,LF,uB(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==SF.RightClick&&(null==r||r({event:n}),!0)}}];const NF={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var jF,DF;function ZF(e){let{acceleration:t,activator:n=jF.Pointer,canScroll:a,draggingRect:i,enabled:l,interval:c=5,order:u=DF.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:m,delta:p,threshold:g}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=vB(t);return pB((e=>{if(n||!r||!e)return VF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[lF.Backward]:e.x[lF.Backward]||-1===o.x,[lF.Forward]:e.x[lF.Forward]||1===o.x},y:{[lF.Backward]:e.y[lF.Backward]||-1===o.y,[lF.Forward]:e.y[lF.Forward]||1===o.y}}}),[n,t,r])}({delta:p,disabled:!l}),[w,b]=function(){const e=r(null);return[o(((t,n)=>{e.current=setInterval(t,n)}),[]),o((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=r({x:0,y:0}),x=r({x:0,y:0}),E=s((()=>{switch(n){case jF.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case jF.DraggableRect:return i}}),[n,i,f]),C=r(null),k=o((()=>{const e=C.current;if(!e)return;const t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)}),[]),M=s((()=>u===DF.TreeOrder?[...h].reverse():h),[u,h]);d((()=>{if(l&&h.length&&E){for(const e of M){if(!1===(null==a?void 0:a(e)))continue;const n=h.indexOf(e),r=m[n];if(!r)continue;const{direction:o,speed:i}=uF(e,r,E,t,g);for(const e of["x","y"])v[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0)return b(),C.current=e,w(k,c),y.current=i,void(x.current=o)}y.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,k,a,b,l,c,JSON.stringify(E),JSON.stringify(v),w,h,M,m,JSON.stringify(g)])}(class extends IF{constructor(e){super(e,NF)}static setup(){return window.addEventListener(NF.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(NF.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(jF||(jF={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(DF||(DF={}));const VF={x:{[lF.Backward]:!1,[lF.Forward]:!1},y:{[lF.Backward]:!1,[lF.Forward]:!1}};var TF,BF;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(TF||(TF={})),function(e){e.Optimized="optimized"}(BF||(BF={}));const FF=new Map;function PF(e,t){return pB((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function HF(e){let{callback:t,disabled:n}=e;const r=hB(t),o=s((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return d((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function _F(e){return new pF(JB(e),e)}function WF(e,t,n){void 0===t&&(t=_F);const[r,o]=c(null);function a(){o((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}))}const i=function(e){let{callback:t,disabled:n}=e;const r=hB(t),o=s((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return d((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),l=HF({callback:a});return fB((()=>{a(),e?(null==l||l.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==i||i.disconnect())}),[e]),r}const zF=[];function $F(e,t){void 0===t&&(t=[]);const n=r(null);return d((()=>{n.current=null}),t),d((()=>{const t=e!==FB;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?EB(e,n.current):FB}function UF(e){return s((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const qF=[];function GF(e){let{measure:t}=e;const[n,r]=c(null),a=o((e=>{for(const{target:n}of e)if(cB(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),i=HF({callback:a}),l=o((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return cB(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)}),[t,i]),[d,u]=gB(l);return s((()=>({nodeRef:d,rect:n,setRef:u})),[n,d,u])}const YF=[{sensor:AF,options:{}},{sensor:kF,options:{}}],KF={current:{}},XF={draggable:{measure:eF},droppable:{measure:eF,strategy:TF.WhileDragging,frequency:BF.Optimized},dragOverlay:{measure:JB}};class QF extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const JF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new QF,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:VB},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:XF,measureDroppableContainers:VB,windowRect:null,measuringScheduled:!1},eP=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:VB,draggableNodes:new Map,over:null,measureDroppableContainers:VB}),tP=i(JF);function nP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new QF}}}function rP(e,t){switch(t.type){case ZB.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ZB.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ZB.DragEnd:case ZB.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ZB.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new QF(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case ZB.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new QF(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case ZB.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new QF(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function oP(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=a(eP),i=vB(r),l=vB(null==n?void 0:n.id);return d((()=>{if(!t&&!r&&i&&null!=l){if(!CB(i))return;if(document.activeElement===i.target)return;const e=o.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=IB(e);if(t){t.focus();break}}}))}}),[r,t,o,l,i]),null}const aP=i({...FB,scaleX:1,scaleY:1});var iP;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(iP||(iP={}));const lP=x((function(e){var n,a,i,l;let{id:u,accessibility:f,autoScroll:h=!0,children:m,sensors:p=YF,collisionDetection:g=GB,measuring:w,modifiers:b,...y}=e;const x=v(rP,void 0,nP),[E,C]=x,[k,M]=function(){const[e]=c((()=>new Set)),t=o((t=>(e.add(t),()=>e.delete(t))),[e]);return[o((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[R,I]=c(iP.Uninitialized),O=R===iP.Initialized,{draggable:{active:A,nodes:L,translate:N},droppable:{containers:j}}=E,D=null!=A?L.get(A):null,Z=r({initial:null,translated:null}),V=s((()=>{var e;return null!=A?{id:A,data:null!=(e=null==D?void 0:D.data)?e:KF,rect:Z}:null}),[A,D]),T=r(null),[B,F]=c(null),[P,H]=c(null),_=mB(y,Object.values(y)),W=bB("DndDescribedBy",u),z=s((()=>j.getEnabled()),[j]),$=s((()=>({draggable:{...XF.draggable,...null==U?void 0:U.draggable},droppable:{...XF.droppable,...null==U?void 0:U.droppable},dragOverlay:{...XF.dragOverlay,...null==U?void 0:U.dragOverlay}})),[null==(U=w)?void 0:U.draggable,null==U?void 0:U.droppable,null==U?void 0:U.dragOverlay]);var U;const{droppableRects:q,measureDroppableContainers:G,measuringScheduled:Y}=function(e,t){let{dragging:n,dependencies:a,config:i}=t;const[l,s]=c(null),{frequency:u,measure:f,strategy:h}=i,m=r(e),p=function(){switch(h){case TF.Always:return!1;case TF.BeforeDragging:return n;default:return!n}}(),g=mB(p),v=o((function(e){void 0===e&&(e=[]),g.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),w=r(null),b=pB((t=>{if(p&&!n)return FF;if(!t||t===FF||m.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new pF(f(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,p,f]);return d((()=>{m.current=e}),[e]),d((()=>{p||v()}),[n,p]),d((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),d((()=>{p||"number"!=typeof u||null!==w.current||(w.current=setTimeout((()=>{v(),w.current=null}),u))}),[u,p,v,...a]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=l}}(z,{dragging:O,dependencies:[N.x,N.y],config:$.droppable}),K=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return pB((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(L,A),X=s((()=>P?kB(P):null),[P]),Q=function(){const e=!1===(null==B?void 0:B.autoScrollEnabled),t="object"==typeof h?!1===h.enabled:!1===h,n=O&&!e&&!t;if("object"==typeof h)return{...h,enabled:n};return{enabled:n}}(),J=function(e,t){return PF(e,t)}(K,$.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const i=r(!1),{x:l,y:s}="boolean"==typeof a?{x:a,y:a}:a;fB((()=>{if(!l&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=YB(n(e),o);if(l||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=nF(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,s,o,n])}({activeNode:null!=A?L.get(A):null,config:Q.layoutShiftCompensation,initialRect:J,measure:$.draggable.measure});const ee=WF(K,$.draggable.measure,J),te=WF(K?K.parentElement:null),ne=r({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=j.getNodeFor(null==(n=ne.current.over)?void 0:n.id),oe=GF({measure:$.dragOverlay.measure}),ae=null!=(a=oe.nodeRef.current)?a:K,ie=O?null!=(i=oe.rect)?i:ee:null,le=Boolean(oe.nodeRef.current&&oe.rect),se=YB(ce=le?null:ee,PF(ce));var ce;const de=UF(ae?lB(ae):null),ue=function(e){const t=r(e),n=pB((n=>e?n&&n!==zF&&e&&t.current&&e.parentNode===t.current.parentNode?n:tF(e):zF),[e]);return d((()=>{t.current=e}),[e]),n}(O?null!=re?re:K:null),fe=function(e,t){void 0===t&&(t=JB);const[n]=e,r=UF(n?lB(n):null),[o,a]=c(qF);function i(){a((()=>e.length?e.map((e=>sF(e)?r:new pF(t(e),e))):qF))}const l=HF({callback:i});return fB((()=>{null==l||l.disconnect(),i(),e.forEach((e=>null==l?void 0:l.observe(e)))}),[e]),o}(ue),he=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(b,{transform:{x:N.x-se.x,y:N.y-se.y,scaleX:1,scaleY:1},activatorEvent:P,active:V,activeNodeRect:ee,containerNodeRect:te,draggingNodeRect:ie,over:ne.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ue,scrollableAncestorRects:fe,windowRect:de}),me=X?xB(X,N):null,pe=function(e){const[t,n]=c(null),a=r(e),i=o((e=>{const t=rF(e.target);t&&n((e=>e?(e.set(t,iF(t)),new Map(e)):null))}),[]);return d((()=>{const t=a.current;if(e!==t){r(t);const o=e.map((e=>{const t=rF(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,iF(t)]):null})).filter((e=>null!=e));n(o.length?new Map(o):null),a.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=rF(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),s((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>xB(e,t)),FB):hF(e):FB),[e,t])}(ue),ge=$F(pe),ve=$F(pe,[ee]),we=xB(he,ge),be=ie?XB(ie,he):null,ye=V&&be?g({active:V,collisionRect:be,droppableRects:q,droppableContainers:z,pointerCoordinates:me}):null,xe=zB(ye,"id"),[Ee,Ce]=c(null),ke=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(le?he:xB(he,ve),null!=(l=null==Ee?void 0:Ee.rect)?l:null,ee),Me=r(null),Re=o(((e,t)=>{let{sensor:n,options:r}=t;if(null==T.current)return;const o=L.get(T.current);if(!o)return;const a=e.nativeEvent,i=new n({active:T.current,activeNode:o,event:a,options:r,context:ne,onAbort(e){if(!L.get(e))return;const{onDragAbort:t}=_.current,n={id:e};null==t||t(n),k({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!L.get(e))return;const{onDragPending:o}=_.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(a),k({type:"onDragPending",event:a})},onStart(e){const t=T.current;if(null==t)return;const n=L.get(t);if(!n)return;const{onDragStart:r}=_.current,o={activatorEvent:a,active:{id:t,data:n.data,rect:Z}};S((()=>{null==r||r(o),I(iP.Initializing),C({type:ZB.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:o}),F(Me.current),H(a)}))},onMove(e){C({type:ZB.DragMove,coordinates:e})},onEnd:l(ZB.DragEnd),onCancel:l(ZB.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=ne.current;let i=null;if(t&&o){const{cancelDrop:l}=_.current;if(i={activatorEvent:a,active:t,collisions:n,delta:o,over:r},e===ZB.DragEnd&&"function"==typeof l){await Promise.resolve(l(i))&&(e=ZB.DragCancel)}}T.current=null,S((()=>{C({type:e}),I(iP.Uninitialized),Ce(null),F(null),H(null),Me.current=null;const t=e===ZB.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=_.current[t];null==e||e(i),k({type:t,event:i})}}))}}Me.current=i}),[L]),Ie=o(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=L.get(r);if(null!==T.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},T.current=r,Re(n,t))}),[L,Re]),Oe=function(e,t){return s((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(p,Ie);!function(e){d((()=>{if(!oB)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(p),fB((()=>{ee&&R===iP.Initializing&&I(iP.Initialized)}),[ee,R]),d((()=>{const{onDragMove:e}=_.current,{active:t,activatorEvent:n,collisions:r,over:o}=ne.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:we.x,y:we.y},over:o};S((()=>{null==e||e(a),k({type:"onDragMove",event:a})}))}),[we.x,we.y]),d((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=ne.current;if(!e||null==T.current||!t||!o)return;const{onDragOver:a}=_.current,i=r.get(xe),l=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};S((()=>{Ce(l),null==a||a(s),k({type:"onDragOver",event:s})}))}),[xe]),fB((()=>{ne.current={activatorEvent:P,active:V,activeNode:K,collisionRect:be,collisions:ye,droppableRects:q,draggableNodes:L,draggingNode:ae,draggingNodeRect:ie,droppableContainers:j,over:Ee,scrollableAncestors:ue,scrollAdjustedTranslate:we},Z.current={initial:ie,translated:be}}),[V,K,ye,be,L,ae,ie,q,j,Ee,ue,we]),ZF({...Q,delta:N,draggingRect:be,pointerCoordinates:me,scrollableAncestors:ue,scrollableAncestorRects:fe});const Ae=s((()=>({active:V,activeNode:K,activeNodeRect:ee,activatorEvent:P,collisions:ye,containerNodeRect:te,dragOverlay:oe,draggableNodes:L,droppableContainers:j,droppableRects:q,over:Ee,measureDroppableContainers:G,scrollableAncestors:ue,scrollableAncestorRects:fe,measuringConfiguration:$,measuringScheduled:Y,windowRect:de})),[V,K,ee,P,ye,te,oe,L,j,q,Ee,G,ue,fe,$,Y,de]),Le=s((()=>({activatorEvent:P,activators:Oe,active:V,activeNodeRect:ee,ariaDescribedById:{draggable:W},dispatch:C,draggableNodes:L,over:Ee,measureDroppableContainers:G})),[P,Oe,V,ee,C,W,L,Ee,G]);return t.createElement(SB.Provider,{value:M},t.createElement(eP.Provider,{value:Le},t.createElement(tP.Provider,{value:Ae},t.createElement(aP.Provider,{value:ke},m)),t.createElement(oP,{disabled:!1===(null==f?void 0:f.restoreFocus)})),t.createElement(DB,{...f,hiddenTextDescribedById:W}))})),sP=i(null),cP="button";function dP(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=bB("Draggable"),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:f,draggableNodes:h,over:m}=a(eP),{role:p=cP,roleDescription:g="draggable",tabIndex:v=0}=null!=o?o:{},w=(null==d?void 0:d.id)===t,b=a(w?aP:sP),[y,x]=gB(),[E,C]=gB(),k=function(e,t){return s((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(l,t),M=mB(n);fB((()=>(h.set(t,{id:t,key:i,node:y,activatorNode:E,data:M}),()=>{const e=h.get(t);e&&e.key===i&&h.delete(t)})),[h,t]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:s((()=>({role:p,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!w||p!==cP)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[r,p,v,w,g,f.draggable]),isDragging:w,listeners:r?void 0:k,node:y,over:m,setNodeRef:x,setActivatorNodeRef:C,transform:b}}const uP={timeout:25};const fP=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},hP=e=>{let{transform:t}=e;return{...t,x:0}};function mP(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function pP(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function gP(e){return null!==e&&e>=0}const vP=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=mP(t,r,n),i=t[o],l=a[o];return l&&i?{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}:null},wP={scaleX:1,scaleY:1},bP=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const l=null!=(t=a[n])?t:r;if(!l)return null;if(o===n){const e=a[i];return e?{x:0,y:n<i?e.top+e.height-(l.top+l.height):e.top-l.top,...wP}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):a?a.top-(r.top+r.height):0;return a?a.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(a,o,n);return o>n&&o<=i?{x:0,y:-l.height-s,...wP}:o<n&&o>=i?{x:0,y:l.height+s,...wP}:{x:0,y:0,...wP}};const yP="Sortable",xP=t.createContext({activeIndex:-1,containerId:yP,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vP,disabled:{draggable:!1,droppable:!1}});function EP(e){let{children:n,id:o,items:i,strategy:l=vP,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:h,over:m,measureDroppableContainers:p}=a(tP),g=bB(yP,o),v=Boolean(null!==f.rect),w=s((()=>i.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[i]),b=null!=u,y=u?w.indexOf(u.id):-1,x=m?w.indexOf(m.id):-1,E=r(w),C=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(w,E.current),k=-1!==x&&-1===y||C,M=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);fB((()=>{C&&b&&p(w)}),[C,w,b,p]),d((()=>{E.current=w}),[w]);const R=s((()=>({activeIndex:y,containerId:g,disabled:M,disableTransforms:k,items:w,overIndex:x,useDragOverlay:v,sortedRects:pP(w,h),strategy:l})),[y,g,M.draggable,M.droppable,k,w,x,h,v,l]);return t.createElement(xP.Provider,{value:R},n)}const CP=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return mP(n,r,o).indexOf(t)},kP=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r)&&((l===a||o!==i)&&(!!n||i!==o&&t===s))},MP={duration:200,easing:"ease"},RP="transform",IP=MB.Transition.toString({property:RP,duration:0,easing:"linear"}),OP={roleDescription:"sortable"};function AP(e){let{animateLayoutChanges:t=kP,attributes:n,disabled:i,data:l,getNewIndex:u=CP,id:f,strategy:h,resizeObserverConfig:m,transition:p=MP}=e;const{items:g,containerId:v,activeIndex:w,disabled:b,disableTransforms:y,sortedRects:x,overIndex:E,useDragOverlay:C,strategy:k}=a(xP),M=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(i,b),R=g.indexOf(f),I=s((()=>({sortable:{containerId:v,index:R,items:g},...l})),[v,l,R,g]),O=s((()=>g.slice(g.indexOf(f))),[g,f]),{rect:A,node:L,isOver:S,setNodeRef:N}=function(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:l}=e;const s=bB("Droppable"),{active:c,dispatch:u,over:f,measureDroppableContainers:h}=a(eP),m=r({disabled:n}),p=r(!1),g=r(null),v=r(null),{disabled:w,updateMeasurementsFor:b,timeout:y}={...uP,...l},x=mB(null!=b?b:i),E=HF({callback:o((()=>{p.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{h(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),y)):p.current=!0}),[y]),disabled:w||!c}),C=o(((e,t)=>{E&&(t&&(E.unobserve(t),p.current=!1),e&&E.observe(e))}),[E]),[k,M]=gB(C),R=mB(t);return d((()=>{E&&k.current&&(E.disconnect(),p.current=!1,E.observe(k.current))}),[k,E]),d((()=>(u({type:ZB.RegisterDroppable,element:{id:i,key:s,disabled:n,node:k,rect:g,data:R}}),()=>u({type:ZB.UnregisterDroppable,key:s,id:i}))),[i]),d((()=>{n!==m.current.disabled&&(u({type:ZB.SetDroppableDisabled,id:i,key:s,disabled:n}),m.current.disabled=n)}),[i,s,n,u]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===i,node:k,over:f,setNodeRef:M}}({id:f,data:I,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...m}}),{active:j,activatorEvent:D,activeNodeRect:Z,attributes:V,setNodeRef:T,listeners:B,isDragging:F,over:P,setActivatorNodeRef:H,transform:_}=dP({id:f,data:I,attributes:{...OP,...n},disabled:M.draggable}),W=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s((()=>e=>{t.forEach((t=>t(e)))}),t)}(N,T),z=Boolean(j),$=z&&!y&&gP(w)&&gP(E),U=!C&&F,q=U&&$?_:null,G=$?null!=q?q:(null!=h?h:k)({rects:x,activeNodeRect:Z,activeIndex:w,overIndex:E,index:R}):null,Y=gP(w)&&gP(E)?u({id:f,items:g,activeIndex:w,overIndex:E}):R,K=null==j?void 0:j.id,X=r({activeId:K,items:g,newIndex:Y,containerId:v}),Q=g!==X.current.items,J=t({active:j,containerId:v,isDragging:F,isSorting:z,id:f,index:R,items:g,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:p,wasDragging:null!=X.current.activeId}),ee=function(e){let{disabled:t,index:n,node:o,rect:a}=e;const[i,l]=c(null),s=r(n);return fB((()=>{if(!t&&n!==s.current&&o.current){const e=a.current;if(e){const t=JB(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&l(n)}}n!==s.current&&(s.current=n)}),[t,n,o,a]),d((()=>{i&&l(null)}),[i]),i}({disabled:!J,index:R,node:L,rect:A});return d((()=>{z&&X.current.newIndex!==Y&&(X.current.newIndex=Y),v!==X.current.containerId&&(X.current.containerId=v),g!==X.current.items&&(X.current.items=g)}),[z,Y,v,g]),d((()=>{if(K===X.current.activeId)return;if(null!=K&&null==X.current.activeId)return void(X.current.activeId=K);const e=setTimeout((()=>{X.current.activeId=K}),50);return()=>clearTimeout(e)}),[K]),{active:j,activeIndex:w,attributes:V,data:I,rect:A,index:R,newIndex:Y,items:g,isOver:S,isSorting:z,isDragging:F,listeners:B,node:L,overIndex:E,over:P,setNodeRef:W,setActivatorNodeRef:H,setDroppableNodeRef:N,setDraggableNodeRef:T,transform:null!=ee?ee:G,transition:function(){if(ee||Q&&X.current.newIndex===R)return IP;if(U&&!CB(D)||!p)return;if(z||J)return MB.Transition.toString({...p,property:RP});return}()}}function LP(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const SP=[bF.Down,bF.Right,bF.Up,bF.Left],NP=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:l}}=t;if(SP.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];a.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const a=o.get(n.id);if(a)switch(e.code){case bF.Down:r.top<a.top&&t.push(n);break;case bF.Up:r.top>a.top&&t.push(n);break;case bF.Left:r.left>a.left&&t.push(n);break;case bF.Right:r.left<a.left&&t.push(n)}}));const s=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=WB(t),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=WB(r),i=o.reduce(((e,t,r)=>e+PB(n[r],t)),0),l=Number((i/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:l}})}}return a.sort(HB)})({collisionRect:r,droppableRects:o,droppableContainers:t});let c=zB(s,"id");if(c===(null==i?void 0:i.id)&&s.length>1&&(c=s[1].id),null!=c){const e=a.get(n.id),t=a.get(c),i=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&i&&e&&t){const n=tF(s).some(((e,t)=>l[t]!==e)),o=jP(e,t),a=function(e,t){if(!LP(e)||!LP(t))return!1;if(!jP(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!o?{x:0,y:0}:{x:a?r.width-i.width:0,y:a?r.height-i.height:0},d={x:i.left,y:i.top};return c.x&&c.y?d:EB(d,c)}}}};function jP(e,t){return!(!LP(e)||!LP(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var DP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function ZP(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}function VP(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}function TP(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},VP(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}var BP=e.createContext(void 0);function FP(t){const n=e.useContext(BP);return t||n||"ltr"}var PP,HP="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",WP="dismissableLayer.focusOutside",zP=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$P=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(zP),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){qP(_P,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){qP(WP,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(PP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),UP(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=PP)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),UP())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(HP,e),()=>document.removeEventListener(HP,e)}),[]),E(DP.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));$P.displayName="DismissableLayer";function UP(){const e=new CustomEvent(HP);document.dispatchEvent(e)}function qP(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ZP(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(zP),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(DP.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var GP="focusScope.autoFocusOnMount",YP="focusScope.autoFocusOnUnmount",KP={bubbles:!1,cancelable:!0},XP=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:tH(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||tH(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&tH(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){nH.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(GP,KP);s.addEventListener(GP,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tH(r,{select:t}),document.activeElement!==n)return}((e=QP(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&tH(s))}return()=>{s.removeEventListener(GP,d),setTimeout((()=>{const e=new CustomEvent(YP,KP);s.addEventListener(YP,u),s.dispatchEvent(e),e.defaultPrevented||tH(t??document.body,{select:!0}),s.removeEventListener(YP,u),nH.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=QP(e),n=JP(t,e),r=JP(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&tH(a,{select:!0})):(e.preventDefault(),r&&tH(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(DP.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function QP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JP(e,t){for(const n of e)if(!eH(n,{upTo:t}))return n}function eH(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function tH(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}XP.displayName="FocusScope";var nH=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=rH(e,t),e.unshift(t)},remove(t){e=rH(e,t),e[0]?.resume()}}}();function rH(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var oH=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(DP.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));oH.displayName="Arrow";var aH=oH;function iH(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var lH="Popper",[sH,cH]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},iH(o,...n)]}(lH),[dH,uH]=sH(lH),fH=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(dH,{scope:n,anchor:o,onAnchorChange:a,children:r})};fH.displayName=lH;var hH="PopperAnchor",mH=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=uH(hH,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(DP.div,{...a,ref:s})}));mH.displayName=hH;var pH="PopperContent",[gH,vH]=sH(pH),wH=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=uH(pH,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(EH),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),CH({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=kH(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(gH,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(DP.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));wH.displayName=pH;var bH="PopperArrow",yH={top:"bottom",right:"left",bottom:"top",left:"right"},xH=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=vH(bH,n),a=yH[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E(aH,{...r,ref:t,style:{...r.style,display:"block"}})})}));function EH(e){return null!==e}xH.displayName=bH;var CH=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=kH(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function kH(e){const[t,n="center"]=e.split("-");return[t,n]}var MH=fH,RH=mH,IH=wH,OH=xH,AH=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(DP.div,{...o,ref:n}),l):null}));AH.displayName="Portal";var LH=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=SH(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=SH(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=SH(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=SH(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function SH(e){return e?.animationName||"none"}function NH(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}LH.displayName="Presence";var jH="rovingFocusGroup.onEntryFocus",DH={bubbles:!1,cancelable:!0},ZH="RovingFocusGroup",[VH,TH,BH]=TP(ZH),[FH,PH]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},NH(o,...n)]}(ZH,[BH]),[HH,_H]=FH(ZH),WH=e.forwardRef(((e,t)=>E(VH.Provider,{scope:e.__scopeRovingFocusGroup,children:E(VH.Slot,{scope:e.__scopeRovingFocusGroup,children:E(zH,{...e,ref:t})})})));WH.displayName=ZH;var zH=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=t,h=e.useRef(null),m=tL(n,h),p=FP(i),[g=null,v]=iL({prop:l,defaultProp:s,onChange:c}),[w,b]=e.useState(!1),y=aL(d),x=TH(r),C=e.useRef(!1),[k,M]=e.useState(0);return e.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(jH,y),()=>e.removeEventListener(jH,y)}),[y]),E(HH,{scope:r,orientation:o,dir:p,loop:a,currentTabStopId:g,onItemFocus:e.useCallback((e=>v(e)),[v]),onItemShiftTab:e.useCallback((()=>b(!0)),[]),onFocusableItemAdd:e.useCallback((()=>M((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>M((e=>e-1))),[]),children:E(DP.div,{tabIndex:w||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:oL(t.onMouseDown,(()=>{C.current=!0})),onFocus:oL(t.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(jH,DH);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));GH([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}C.current=!1})),onBlur:oL(t.onBlur,(()=>b(!1)))})})})),$H="RovingFocusGroupItem",UH=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:i,...l}=t,s=Gj(),c=i||s,d=_H($H,r),u=d.currentTabStopId===c,f=TH(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return e.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),E(VH.ItemSlot,{scope:r,id:c,focusable:o,active:a,children:E(DP.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:oL(t.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:oL(t.onFocus,(()=>d.onItemFocus(c))),onKeyDown:oL(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:qH[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=d.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>GH(n)))}}))})})}));UH.displayName=$H;var qH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GH(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var YH=WH,KH=UH,XH=["Enter"," "],QH=["ArrowUp","PageDown","End"],JH=["ArrowDown","PageUp","Home",...QH],e_={ltr:[...XH,"ArrowRight"],rtl:[...XH,"ArrowLeft"]},t_={ltr:["ArrowLeft"],rtl:["ArrowRight"]},n_="Menu",[r_,o_,a_]=TP(n_),[i_,l_]=nL(n_,[a_,cH,PH]),s_=cH(),c_=PH(),[d_,u_]=i_(n_),[f_,h_]=i_(n_),m_=t=>{const{__scopeMenu:n,open:r=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=t,s=s_(n),[c,d]=e.useState(null),u=e.useRef(!1),f=aL(i),h=FP(a);return e.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),E(MH,{...s,children:E(d_,{scope:n,open:r,onOpenChange:f,content:c,onContentChange:d,children:E(f_,{scope:n,onClose:e.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:u,dir:h,modal:l,children:o})})})};m_.displayName=n_;var p_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=s_(n);return E(RH,{...o,...r,ref:t})}));p_.displayName="MenuAnchor";var g_="MenuPortal",[v_,w_]=i_(g_,{forceMount:void 0}),b_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=u_(g_,t);return E(v_,{scope:t,forceMount:n,children:E(LH,{present:n||a.open,children:E(AH,{asChild:!0,container:o,children:r})})})};b_.displayName=g_;var y_="MenuContent",[x_,E_]=i_(y_),C_=e.forwardRef(((e,t)=>{const n=w_(y_,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=u_(y_,e.__scopeMenu),i=h_(y_,e.__scopeMenu);return E(r_.Provider,{scope:e.__scopeMenu,children:E(LH,{present:r||a.open,children:E(r_.Slot,{scope:e.__scopeMenu,children:i.modal?E(k_,{...o,ref:t}):E(M_,{...o,ref:t})})})})})),k_=e.forwardRef(((t,n)=>{const r=u_(y_,t.__scopeMenu),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(R_,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),M_=e.forwardRef(((e,t)=>{const n=u_(y_,e.__scopeMenu);return E(R_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),R_=e.forwardRef(((t,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:p,...g}=t,v=u_(y_,r),w=h_(y_,r),b=s_(r),y=c_(r),x=o_(r),[C,k]=e.useState(null),M=e.useRef(null),R=tL(n,M,v.onContentChange),I=e.useRef(0),O=e.useRef(""),A=e.useRef(0),L=e.useRef(null),S=e.useRef("right"),N=e.useRef(0),j=p?mZ:e.Fragment,D=p?{as:fL,allowPinchZoom:!0}:void 0,Z=e=>{const t=O.current+e,n=x().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(e,Math.max(a,0));1===o.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return l!==n?l:void 0}(n.map((e=>e.textValue)),t,o),i=n.find((e=>e.textValue===a))?.ref.current;!function e(t){O.current=t,window.clearTimeout(I.current),""!==t&&(I.current=window.setTimeout((()=>e("")),1e3))}(t),i&&setTimeout((()=>i.focus()))};e.useEffect((()=>()=>window.clearTimeout(I.current)),[]),Dj();const V=e.useCallback((e=>S.current===L.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e].x,l=t[e].y,s=t[a].x,c=t[a].y;l>r!=c>r&&n<(s-i)*(r-l)/(c-l)+i&&(o=!o)}return o}(n,t)}(e,L.current?.area)),[]);return E(x_,{scope:r,searchRef:O,onItemEnter:e.useCallback((e=>{V(e)&&e.preventDefault()}),[V]),onItemLeave:e.useCallback((e=>{V(e)||(M.current?.focus(),k(null))}),[V]),onTriggerLeave:e.useCallback((e=>{V(e)&&e.preventDefault()}),[V]),pointerGraceTimerRef:A,onPointerGraceIntentChange:e.useCallback((e=>{L.current=e}),[]),children:E(j,{...D,children:E(XP,{asChild:!0,trapped:a,onMountAutoFocus:oL(i,(e=>{e.preventDefault(),M.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:E($P,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:E(YH,{asChild:!0,...y,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:oL(c,(e=>{w.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:E(IH,{role:"menu","aria-orientation":"vertical","data-state":eW(v.open),"data-radix-menu-content":"",dir:w.dir,...b,...g,ref:R,style:{outline:"none",...g.style},onKeyDown:oL(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&Z(e.key));const o=M.current;if(e.target!==o)return;if(!JH.includes(e.key))return;e.preventDefault();const a=x().filter((e=>!e.disabled)).map((e=>e.ref.current));QH.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)})),onBlur:oL(t.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(I.current),O.current="")})),onPointerMove:oL(t.onPointerMove,rW((e=>{const t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>N.current?"right":"left";S.current=t,N.current=e.clientX}})))})})})})})})}));C_.displayName=y_;var I_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{role:"group",...r,ref:t})}));I_.displayName="MenuGroup";var O_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{...r,ref:t})}));O_.displayName="MenuLabel";var A_="MenuItem",L_="menu.itemSelect",S_=e.forwardRef(((t,n)=>{const{disabled:r=!1,onSelect:o,...a}=t,i=e.useRef(null),l=h_(A_,t.__scopeMenu),s=E_(A_,t.__scopeMenu),c=tL(n,i),d=e.useRef(!1);return E(N_,{...a,ref:c,disabled:r,onClick:oL(t.onClick,(()=>{const e=i.current;if(!r&&e){const t=new CustomEvent(L_,{bubbles:!0,cancelable:!0});e.addEventListener(L_,(e=>o?.(e)),{once:!0}),ZP(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:e=>{t.onPointerDown?.(e),d.current=!0},onPointerUp:oL(t.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:oL(t.onKeyDown,(e=>{const t=""!==s.searchRef.current;r||t&&" "===e.key||XH.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));S_.displayName=A_;var N_=e.forwardRef(((t,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:a,...i}=t,l=E_(A_,r),s=c_(r),c=e.useRef(null),d=tL(n,c),[u,f]=e.useState(!1),[h,m]=e.useState("");return e.useEffect((()=>{const e=c.current;e&&m((e.textContent??"").trim())}),[i.children]),E(r_.ItemSlot,{scope:r,disabled:o,textValue:a??h,children:E(KH,{asChild:!0,...s,focusable:!o,children:E(DP.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:oL(t.onPointerMove,rW((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:oL(t.onPointerLeave,rW((e=>l.onItemLeave(e)))),onFocus:oL(t.onFocus,(()=>f(!0))),onBlur:oL(t.onBlur,(()=>f(!1)))})})})})),j_=e.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return E(H_,{scope:e.__scopeMenu,checked:n,children:E(S_,{role:"menuitemcheckbox","aria-checked":tW(n)?"mixed":n,...o,ref:t,"data-state":nW(n),onSelect:oL(o.onSelect,(()=>r?.(!!tW(n)||!n)),{checkForDefaultPrevented:!1})})})}));j_.displayName="MenuCheckboxItem";var D_="MenuRadioGroup",[Z_,V_]=i_(D_,{value:void 0,onValueChange:()=>{}}),T_=e.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=aL(r);return E(Z_,{scope:e.__scopeMenu,value:n,onValueChange:a,children:E(I_,{...o,ref:t})})}));T_.displayName=D_;var B_="MenuRadioItem",F_=e.forwardRef(((e,t)=>{const{value:n,...r}=e,o=V_(B_,e.__scopeMenu),a=n===o.value;return E(H_,{scope:e.__scopeMenu,checked:a,children:E(S_,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":nW(a),onSelect:oL(r.onSelect,(()=>o.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));F_.displayName=B_;var P_="MenuItemIndicator",[H_,__]=i_(P_,{checked:!1}),W_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=__(P_,n);return E(LH,{present:r||tW(a.checked)||!0===a.checked,children:E(DP.span,{...o,ref:t,"data-state":nW(a.checked)})})}));W_.displayName=P_;var z_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return E(DP.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));z_.displayName="MenuSeparator";var $_=e.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=s_(n);return E(OH,{...o,...r,ref:t})}));$_.displayName="MenuArrow";var U_="MenuSub",[q_,G_]=i_(U_),Y_=t=>{const{__scopeMenu:n,children:r,open:o=!1,onOpenChange:a}=t,i=u_(U_,n),l=s_(n),[s,c]=e.useState(null),[d,u]=e.useState(null),f=aL(a);return e.useEffect((()=>(!1===i.open&&f(!1),()=>f(!1))),[i.open,f]),E(MH,{...l,children:E(d_,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:E(q_,{scope:n,contentId:Gj(),triggerId:Gj(),trigger:s,onTriggerChange:c,children:r})})})};Y_.displayName=U_;var K_="MenuSubTrigger",X_=e.forwardRef(((t,n)=>{const r=u_(K_,t.__scopeMenu),o=h_(K_,t.__scopeMenu),a=G_(K_,t.__scopeMenu),i=E_(K_,t.__scopeMenu),l=e.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=i,d={__scopeMenu:t.__scopeMenu},u=e.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return e.useEffect((()=>u),[u]),e.useEffect((()=>{const e=s.current;return()=>{window.clearTimeout(e),c(null)}}),[s,c]),E(p_,{asChild:!0,...d,children:E(N_,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":eW(r.open),...t,ref:eL(n,a.onTriggerChange),onClick:e=>{t.onClick?.(e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:oL(t.onPointerMove,rW((e=>{i.onItemEnter(e),e.defaultPrevented||t.disabled||r.open||l.current||(i.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),u()}),100))}))),onPointerLeave:oL(t.onPointerLeave,rW((e=>{u();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,a=o?-5:5,l=t[o?"left":"right"],c=t[o?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:l,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:l,y:t.bottom}],side:n}),window.clearTimeout(s.current),s.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:oL(t.onKeyDown,(e=>{const n=""!==i.searchRef.current;t.disabled||n&&" "===e.key||e_[o.dir].includes(e.key)&&(r.onOpenChange(!0),r.content?.focus(),e.preventDefault())}))})})}));X_.displayName=K_;var Q_="MenuSubContent",J_=e.forwardRef(((t,n)=>{const r=w_(y_,t.__scopeMenu),{forceMount:o=r.forceMount,...a}=t,i=u_(y_,t.__scopeMenu),l=h_(y_,t.__scopeMenu),s=G_(Q_,t.__scopeMenu),c=e.useRef(null),d=tL(n,c);return E(r_.Provider,{scope:t.__scopeMenu,children:E(LH,{present:o||i.open,children:E(r_.Slot,{scope:t.__scopeMenu,children:E(R_,{id:s.contentId,"aria-labelledby":s.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:oL(t.onFocusOutside,(e=>{e.target!==s.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:oL(t.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:oL(t.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=t_[l.dir].includes(e.key);t&&n&&(i.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())}))})})})})}));function eW(e){return e?"open":"closed"}function tW(e){return"indeterminate"===e}function nW(e){return tW(e)?"indeterminate":e?"checked":"unchecked"}function rW(e){return t=>"mouse"===t.pointerType?e(t):void 0}J_.displayName=Q_;var oW=m_,aW=p_,iW=b_,lW=C_,sW=I_,cW=O_,dW=S_,uW=j_,fW=T_,hW=F_,mW=W_,pW=z_,gW=$_,vW=Y_,wW=X_,bW=J_,yW="DropdownMenu",[xW]=nL(yW,[l_]),EW=l_(),[CW,kW]=xW(yW),MW=t=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:s=!0}=t,c=EW(n),d=e.useRef(null),[u=!1,f]=iL({prop:a,defaultProp:i,onChange:l});return E(CW,{scope:n,triggerId:Gj(),triggerRef:d,contentId:Gj(),open:u,onOpenChange:f,onOpenToggle:e.useCallback((()=>f((e=>!e))),[f]),modal:s,children:E(oW,{...c,open:u,onOpenChange:f,dir:o,modal:s,children:r})})};MW.displayName=yW;var RW="DropdownMenuTrigger",IW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=kW(RW,n),i=EW(n);return E(aW,{asChild:!0,...i,children:E(DP.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:eL(t,a.triggerRef),onPointerDown:oL(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())})),onKeyDown:oL(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));IW.displayName=RW;var OW=e=>{const{__scopeDropdownMenu:t,...n}=e,r=EW(t);return E(iW,{...r,...n})};OW.displayName="DropdownMenuPortal";var AW="DropdownMenuContent",LW=e.forwardRef(((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,a=kW(AW,r),i=EW(r),l=e.useRef(!1);return E(lW,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:n,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:oL(t.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.modal&&!r||(l.current=!0)})),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));LW.displayName=AW;var SW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(sW,{...o,...r,ref:t})}));SW.displayName="DropdownMenuGroup";var NW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(cW,{...o,...r,ref:t})}));NW.displayName="DropdownMenuLabel";var jW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(dW,{...o,...r,ref:t})}));jW.displayName="DropdownMenuItem";var DW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(uW,{...o,...r,ref:t})}));DW.displayName="DropdownMenuCheckboxItem";var ZW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(fW,{...o,...r,ref:t})}));ZW.displayName="DropdownMenuRadioGroup";var VW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(hW,{...o,...r,ref:t})}));VW.displayName="DropdownMenuRadioItem";var TW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(mW,{...o,...r,ref:t})}));TW.displayName="DropdownMenuItemIndicator";var BW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(pW,{...o,...r,ref:t})}));BW.displayName="DropdownMenuSeparator";e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(gW,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var FW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(wW,{...o,...r,ref:t})}));FW.displayName="DropdownMenuSubTrigger";var PW=e.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=EW(n);return E(bW,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));PW.displayName="DropdownMenuSubContent";var HW=OW,_W=LW,WW=NW,zW=jW,$W=DW,UW=VW,qW=TW,GW=BW,YW=FW,KW=PW;const XW=MW,QW=IW,JW=SW,ez=HW,tz=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:a}=e,i=EW(t),[l=!1,s]=iL({prop:r,defaultProp:a,onChange:o});return E(vW,{...i,open:l,onOpenChange:s,children:n})},nz=ZW,rz=e.forwardRef(((e,t)=>{var{className:n,inset:r,children:o}=e,a=IC(e,["className","inset","children"]);return C(YW,Object.assign({ref:t,className:LC("relative flex gap-4 cursor-pointer select-none box-border items-center py-4 pl-4 pr-4 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",r&&"pl-8",n)},a,{children:[o,E(Ek,{type:"heroicons",name:"chevron-right",className:"ml-auto h-4 w-4"})]}))}));rz.displayName=YW.displayName;const oz=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KW,Object.assign({ref:t,className:LC("z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},r,{style:Object.assign({boxShadow:"var(--dropdown-menu-shadow)"},r.style)}))}));oz.displayName=KW.displayName;const az=e.forwardRef(((e,t)=>{var{className:n,sideOffset:r=4}=e,o=IC(e,["className","sideOffset"]);return E(HW,{children:E(_W,Object.assign({ref:t,sideOffset:r,className:LC("z-50 min-w-[154px] overflow-hidden rounded-md bg-modal-surface text-text-contrast-low data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},o,{style:Object.assign({boxShadow:"var(--dropdown-menu-shadow)"},o.style)}))})}));az.displayName=_W.displayName;const iz=e.forwardRef(((e,t)=>{var{className:n,inset:r,selected:o,icon:a,children:i}=e,l=IC(e,["className","inset","selected","icon","children"]);const s=!!a;return C(zW,Object.assign({ref:t,className:LC("relative flex cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]",o&&"bg-[var(--dropdown-menu-selected-bg)] text-[var(--dropdown-menu-selected-text)] typography-subtitle5","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",r&&"pl-8",n,s?"gap-4":"gap-1")},l,{children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4 flex items-center justify-center",children:o&&E(Ek,{type:"heroicons",name:"check",className:"size-4 text-[var(--dropdown-menu-selected-text)]"})}),a]}),i]}))}));iz.displayName=zW.displayName;const lz=e.forwardRef(((e,t)=>{var{className:n,children:r,checked:o,disabled:a}=e,i=IC(e,["className","children","checked","disabled"]);return C($W,Object.assign({ref:t,className:LC("relative flex gap-3 cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-disabled-text)]",n),checked:o,disabled:a},i,{children:[E("span",{className:LC("shrink-0 size-4 rounded-[2px] border flex items-center justify-center transition-all overflow-hidden",o&&!a&&"bg-[var(--dropdown-menu-checkbox-checked-bg)] border-[var(--dropdown-menu-checkbox-checked-bg)]",o&&a&&"bg-[var(--dropdown-menu-checkbox-disabled-checked-bg)] border-transparent",!o&&a&&"border-[var(--dropdown-menu-checkbox-disabled-border)]",!o&&!a&&"border-[var(--dropdown-menu-checkbox-border)]"),children:E(qW,{children:E(Ek,{type:"heroicons",name:"check",className:"size-3 text-[var(--dropdown-menu-checkbox-checked-icon)]"})})}),r]}))}));lz.displayName=$W.displayName;const sz=e.forwardRef(((e,t)=>{var{className:n,children:r,disabled:o,icon:a}=e,i=IC(e,["className","children","disabled","icon"]);const l=!!a;return C(UW,Object.assign({ref:t,className:LC("relative flex cursor-pointer select-none box-border items-center py-4 pl-4 pr-8 typography-subtitle4 outline-none transition-colors data-[disabled]:pointer-events-none","bg-[var(--dropdown-menu-default-bg)] text-[var(--dropdown-menu-default-text)]","active:opacity-75","focus:!bg-[var(--dropdown-menu-hover-bg)] focus:!text-[var(--dropdown-menu-hover-text)]","data-[state='checked']:bg-[var(--dropdown-menu-selected-bg)] data-[state='checked']:text-[var(--dropdown-menu-selected-text)]","data-[disabled]:!bg-[var(--dropdown-menu-disabled-bg)] data-[disabled]:!text-[var(--dropdown-menu-radio-disabled-text)]","data-[state='checked']:data-[disabled]:!text-[var(--dropdown-menu-radio-selected-disabled-text)]",n,l?"gap-4":"gap-1")},i,{disabled:o,children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4",children:E(qW,{className:"shrink-0",children:E(Ek,{type:"heroicons",name:"check",className:LC("size-4",o?"text-[var(--dropdown-menu-radio-selected-disabled-text)]":"text-[var(--dropdown-menu-selected-text)]")})})}),a]}),r]}))}));sz.displayName=UW.displayName;const cz=e.forwardRef(((e,t)=>{var{className:n,inset:r}=e,o=IC(e,["className","inset"]);return E(WW,Object.assign({ref:t,className:LC("px-3 py-2 typography-small4 text-text-g-contrast-high",r&&"pl-8",n)},o))}));cz.displayName=WW.displayName;const dz=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(GW,Object.assign({ref:t,className:LC("h-px bg-[var(--dropdown-menu-seperator-bg)]",n)},r))}));dz.displayName=GW.displayName;const uz=e=>{var{className:t}=e,n=IC(e,["className"]);return E("span",Object.assign({className:LC("ml-auto text-xs tracking-widest opacity-60",t)},n))};uz.displayName="DropdownMenuShortcut";var fz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{}),hz="Switch",[mz]=nL(hz),[pz,gz]=mz(hz),vz=e.forwardRef(((t,n)=>{const{__scopeSwitch:r,name:o,checked:a,defaultChecked:i,required:l,disabled:s,value:c="on",onCheckedChange:d,form:u,...f}=t,[h,m]=e.useState(null),p=tL(n,(e=>m(e))),g=e.useRef(!1),v=!h||(u||!!h.closest("form")),[w=!1,b]=iL({prop:a,defaultProp:i,onChange:d});return C(pz,{scope:r,checked:w,disabled:s,children:[E(fz.button,{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":xz(w),"data-disabled":s?"":void 0,disabled:s,value:c,...f,ref:p,onClick:oL(t.onClick,(e=>{b((e=>!e)),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())}))}),v&&E(yz,{control:h,bubbles:!g.current,name:o,value:c,checked:w,required:l,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})}));vz.displayName=hz;var wz="SwitchThumb",bz=e.forwardRef(((e,t)=>{const{__scopeSwitch:n,...r}=e,o=gz(wz,n);return E(fz.span,{"data-state":xz(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})}));bz.displayName=wz;var yz=t=>{const{control:n,checked:r,bubbles:o=!0,...a}=t,i=e.useRef(null),l=lL(r),s=cL(n);return e.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),E("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function xz(e){return e?"checked":"unchecked"}var Ez=vz,Cz=bz;const kz=M(["group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center overflow-visible px-1","before:pointer-events-none before:absolute before:left-1 before:top-1/2 before:h-3 before:w-8 before:-translate-y-1/2 before:rounded-full before:transition-colors","data-[state=unchecked]:before:bg-[var(--switch-default-color)] hover:data-[state=unchecked]:before:bg-[var(--switch-hover-color)]","data-[state=checked]:before:bg-[var(--switch-active-color)] hover:data-[state=checked]:before:bg-[var(--switch-active-hover-color)]","data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:before:!bg-[var(--switch-disabled-color)]"],{variants:{forceHover:{true:"data-[state=unchecked]:before:bg-[var(--switch-hover-color)] data-[state=checked]:before:bg-[var(--switch-active-hover-color)]",false:""}},defaultVariants:{forceHover:!1}}),Mz=M(["relative isolate block size-4 rounded-full [filter:var(--switch-thumb-filter)] transition-[transform,background-color,color,filter]","data-[state=unchecked]:bg-[var(--switch-thumb-default-color)] data-[state=unchecked]:translate-x-0","data-[state=checked]:bg-[var(--switch-thumb-active-color)] data-[state=checked]:translate-x-4","data-[state=unchecked]:text-[var(--state-tertiary-hover-bg)] data-[state=checked]:text-[var(--state-primary-hover-bg)]","group-hover:[&_.switch-thumb-halo]:opacity-100 group-hover:data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)] group-hover:data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)]","group-disabled:!bg-[var(--switch-thumb-disabled-color)] group-disabled:[&_.switch-thumb-halo]:opacity-0"],{variants:{forceHover:{true:"[&_.switch-thumb-halo]:opacity-100 data-[state=unchecked]:bg-[var(--switch-thumb-hover-color)] data-[state=checked]:bg-[var(--switch-thumb-active-hover-color)]",false:""}},defaultVariants:{forceHover:!1}}),Rz=M(["switch-thumb-halo pointer-events-none absolute left-0 top-0.5 -z-10 block size-6 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity"]),Iz=e.forwardRef(((e,t)=>{var{className:n,forceHover:r=!1}=e,o=IC(e,["className","forceHover"]);return E(Ez,Object.assign({className:LC(kz({forceHover:r}),n)},o,{ref:t,children:E(Cz,{className:Mz({forceHover:r}),children:E("span",{"aria-hidden":!0,className:Rz(),children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[E("g",{filter:"url(#switch-hover-halo-shadow)",children:E("circle",{cx:"20",cy:"18",r:"12",fill:"currentColor",shapeRendering:"crispEdges"})}),E("defs",{children:C("filter",{id:"switch-hover-halo-shadow",x:"0",y:"0",width:"40",height:"40",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[E("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),E("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),E("feOffset",{dy:"2"}),E("feGaussianBlur",{stdDeviation:"4"}),E("feComposite",{in2:"hardAlpha",operator:"out"}),E("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.568627 0 0 0 0 0.619608 0 0 0 0 0.670588 0 0 0 0.24 0"}),E("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),E("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})]})})]})})})}))}));Iz.displayName=Ez.displayName;const Oz=t.createContext(null);const Az="__edit_ph__";function Lz(e){return{value:`${Az}:${e}`,label:e}}function Sz(e,t){if("number"===e){const e=Number(t);return Number.isNaN(e)?0:e}return"checkbox"===e?"true"===t:t}function Nz(e,t,n,r){return e.onCommit?e.onCommit(t,n):{[r]:Sz(e.editVariant,n)}}function jz({columnId:e,row:t,placeholder:n,autoFocus:r,errorMessage:o,onBlur:a,onKeyDown:i}){var l;const s=String(null!==(l=t.original[e])&&void 0!==l?l:"");return E(mk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:s,placeholder:n,"aria-label":n||e,autoFocus:r,error:!!o,errorMessage:o,onBlur:a,onKeyDown:i,className:"rounded-md px-2 py-2 typography-small2"})}function Dz({row:e,columnId:t,col:n,autoFocus:r,onCommit:o,onBlurField:a,onKeyDown:i,keepOpenAfterSelect:l,errorMessage:c}){var d,u,f,h,m;const p=String(null!==(d=e.original[t])&&void 0!==d?d:""),g="function"==typeof(null===(u=n.editSelectProps)||void 0===u?void 0:u.options)?n.editSelectProps.options(e):null!==(h=null===(f=n.editSelectProps)||void 0===f?void 0:f.options)&&void 0!==h?h:[],v=s((()=>{var e,r;return[Lz(null!==(r=null===(e=n.editSelectProps)||void 0===e?void 0:e.placeholder)&&void 0!==r?r:t),...g]}),[g,null===(m=n.editSelectProps)||void 0===m?void 0:m.placeholder,t]),w=s((()=>{var e;const t=p.trim();return t&&null!==(e=v.find((e=>e.label===t)))&&void 0!==e?e:v[0]}),[p,v]);return E("div",{children:E(JA,{id:`edit-dd-${t}-${e.id}`,options:v,value:w,onSelect:e=>{(function(e){var t;return null!==(t=null==e?void 0:e.value.startsWith(`${Az}:`))&&void 0!==t&&t})(e)||o(e.label)},size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,required:!1,isFloatingLabel:!1,label:"",keepFooterSpace:!1,segmentedInput:!0,autoFocus:r,onBlur:a,onKeyDown:i,keepOpenAfterSelect:l,portal:!0,error:!!c,errorMessage:c,className:LC("rounded-md",XA({size:"sm"}),p.trim().length>0&&"font-medium")})})}function Zz({columnId:e,row:t,col:n,autoFocus:r,errorMessage:o,onBlur:a,onKeyDown:i}){var l;const s=t.original[e],c=""===s||null==s?void 0:Number(s),d=n.editNumberProps;return E(kk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:c,placeholder:null!==(l=null==d?void 0:d.placeholder)&&void 0!==l?l:e,"aria-label":(null==d?void 0:d.placeholder)||e,autoFocus:r,min:null==d?void 0:d.min,max:null==d?void 0:d.max,step:null==d?void 0:d.step,precision:null==d?void 0:d.precision,allowDecimal:null==d?void 0:d.allowDecimal,allowNegative:null==d?void 0:d.allowNegative,hideControls:!0,error:!!o,errorMessage:o,onBlur:e=>a(e.currentTarget.value.trim()),onKeyDown:i,className:"rounded-md px-2 py-2 typography-small2"})}function Vz({columnId:e,row:t,col:n,errorMessage:r,onCommit:o,onKeyDown:a}){var i;const l=t.original[e],s=!0===l||"true"===l,c=null===(i=n.editCheckboxProps)||void 0===i?void 0:i.label;return C("div",{className:"flex flex-col gap-0.5",children:[C("div",{className:"flex items-center gap-2 min-h-[32px]",children:[E(LL,{checked:s,onCheckedChange:e=>{o(!0===e)},onKeyDown:a?e=>a(e):void 0,"aria-label":c||e}),c&&E("span",{className:"typography-small2 text-text-contrast-high select-none",children:c})]}),r&&E("span",{className:"typography-small3 text-error-500",children:r})]})}function Tz({row:e,col:t,columnId:n}){var r,o,a,i,l,s,c,d,u,f,h,m;const p=null!==(r=t.editVariant)&&void 0!==r?r:"text";if("select"===p){const r="function"==typeof(null===(o=t.editSelectProps)||void 0===o?void 0:o.options)?t.editSelectProps.options(e):null!==(i=null===(a=t.editSelectProps)||void 0===a?void 0:a.options)&&void 0!==i?i:[],u=[Lz(null!==(s=null===(l=t.editSelectProps)||void 0===l?void 0:l.placeholder)&&void 0!==s?s:n),...r],f=String(null!==(c=e.original[n])&&void 0!==c?c:""),h=null!==(d=u.find((e=>e.label===f.trim())))&&void 0!==d?d:u[0];return E(JA,{id:`edit-dd-disabled-${n}-${e.id}`,options:u,value:h,onSelect:()=>{},size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,required:!1,isFloatingLabel:!1,label:"",keepFooterSpace:!1,segmentedInput:!0,disabled:!0,className:LC("rounded-md",XA({size:"sm"}))})}if("number"===p){const t=e.original[n],r=""===t||null==t?void 0:Number(t);return E(kk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:r,disabled:!0,hideControls:!0,className:"rounded-md px-2 py-2 typography-small2"})}if("checkbox"===p){const r=e.original[n];return C("div",{className:"flex items-center gap-2 min-h-[32px]",children:[E(LL,{checked:!0===r||"true"===r,disabled:!0}),(null===(u=t.editCheckboxProps)||void 0===u?void 0:u.label)&&E("span",{className:"typography-small2 text-text-g-contrast-medium select-none",children:t.editCheckboxProps.label})]})}const g=String(null!==(f=e.original[n])&&void 0!==f?f:""),v=null!==(m=null===(h=t.editTextProps)||void 0===h?void 0:h.placeholder)&&void 0!==m?m:"";return E(mk,{size:"sm",variant:"outline",rounded:"normal",fullwidth:!0,isFloatingLabel:!1,label:"",required:!1,hasClearIcon:!1,keepFooterSpace:!1,defaultValue:g,placeholder:v,"aria-label":v||n,disabled:!0,className:"rounded-md px-2 py-2 typography-small2"})}function Bz(e){switch(null==e?void 0:e.align){case"center":return"text-center";case"right":return"text-right";case"left":return"text-left";default:return}}function Fz(e){const{row:t,getSubRows:n,firstDataCellId:r,fixedColStyles:o,flexWidth:a,lockPxExactWidth:i,resizable:l,tableLayout:s,resizableSlackGrowColId:c,cellClassName:d,onCellClick:u}=e;return function(e){const t=[];let n=0;for(;n<e.length;){const r=e[n],o=r.column.columnDef.meta;let a=1;if(null!=(null==o?void 0:o.colSpan)){const e="function"==typeof o.colSpan?o.colSpan(r.row):o.colSpan,t=Math.floor(Number(e));Number.isFinite(t)&&t>=1&&(a=t)}const i=e.length-n,l=Math.min(a,i);t.push({cell:r,colSpan:Math.max(1,l)}),n+=Math.max(1,l)}return t}(t.getVisibleCells()).map((({cell:e,colSpan:f})=>{var h;const m=Boolean(n)&&e.id===r(t),p=l&&"equal"!==s&&!(null!=c&&e.column.id===c);return E(UV,{colSpan:f>1?f:void 0,style:qz(e.column.columnDef,null==o?void 0:o.get(e.column.id),a,i,p?e.column.getSize():void 0),className:LC(Bz(e.column.columnDef.meta),null===(h=e.column.columnDef.meta)||void 0===h?void 0:h.cellClassName,"function"==typeof d?d(e,t):d),onClick:u?n=>u(e,t,n):void 0,children:m?C("div",{className:"flex items-center gap-1",style:{paddingLeft:20*t.depth+"px"},children:[t.getCanExpand()?E("button",{type:"button",onClick:t.getToggleExpandedHandler(),className:"flex items-center justify-center size-5 rounded hover:bg-table-c-hover shrink-0 transition-colors","aria-label":t.getIsExpanded()?"Collapse":"Expand",children:t.getIsExpanded()?E(JC,{className:"size-4"}):E(rk,{className:"size-4"})}):E("span",{className:"size-5 shrink-0"}),qT(e.column.columnDef.cell,e.getContext())]}):qT(e.column.columnDef.cell,e.getContext())},e.id)}))}function Pz({rowId:e}){const{attributes:t,listeners:n,setNodeRef:r,isDragging:o}=AP({id:e});return E(Zk,Object.assign({ref:r},t,n,{variant:"icon",size:"sm",active:o,className:LC("touch-none",o?"cursor-grabbing":"cursor-grab"),"aria-label":"Drag to reorder",children:E(dk,{className:"!size-4"})}))}function Hz(e){var{id:t,children:n}=e,r=IC(e,["id","children"]);const{transform:o,transition:a,isDragging:i,setNodeRef:l}=AP({id:t}),s={transform:MB.Transform.toString(o?Object.assign(Object.assign({},o),{scaleX:1,scaleY:1}):null),transition:a,opacity:i?.5:1,position:"relative",zIndex:i?50:void 0};return E(zV,Object.assign({ref:l,style:s},r,{children:n}))}const _z=["__reorder__","__select__"],Wz=["__actions__"];function zz(e){const t=e.column.columnDef.header;return"string"==typeof t?t:e.column.id}function $z(e,t){var n;const r=null===(n=e.meta)||void 0===n?void 0:n.exactWidth;if(null==r)return;const o=null!=Uz(r),a=t&&o,i="number"==typeof r?`${r}px`:r.trim();return a?{width:i,minWidth:i,maxWidth:i,overflow:"hidden",boxSizing:"border-box"}:{width:r}}function Uz(e){if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"==typeof e){const t=e.trim().match(/^(-?\d*\.?\d+)\s*px$/i);return t?parseFloat(t[1]):null}return null}function qz(e,t,n,r,o){const a=$z(e,r);if(a)return a;if(null!=o){const t=e.maxSize;return Object.assign({width:o},null!=t&&t!==Number.MAX_SAFE_INTEGER&&{maxWidth:t})}return t||(n?{width:n}:void 0)}function Gz({col:e,label:t,isLastVisible:n,showReorder:r,showVisibility:o}){var a;const{attributes:i,listeners:l,setNodeRef:s,setActivatorNodeRef:c,transform:d,transition:u,isDragging:f}=AP({id:e.id}),h={transform:f?`translateY(${null!==(a=null==d?void 0:d.y)&&void 0!==a?a:0}px)`:MB.Transform.toString(d),transition:f?void 0:u};return C("div",{ref:s,style:h,className:LC("flex h-14 items-center gap-4 pl-6 pr-8 bg-modal-surface","relative select-none",f&&"z-50 border border-primary-500/40 shadow-[0_8px_24px_-4px_rgba(0,0,0,0.24)] scale-[1.01]"),children:[r&&E(Zk,Object.assign({ref:c},i,l,{variant:"icon",size:"sm",active:f,"aria-label":`Drag to reorder ${t}`,className:LC("shrink-0 touch-none",f?"cursor-grabbing":"cursor-grab"),children:E(dk,{className:"size-[14px]"})})),o&&E(Iz,{checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(t),disabled:n}),E("span",{className:LC("flex-1 typography-subtitle4",f?"text-text-contrast-max":"text-text-g-contrast-high"),children:t})]})}function Yz({table:e,onClose:t,maxListHeight:n=400,options:r={}}){const{reorder:o=!0,visibility:a=!0,hideAll:i=!0,showAll:l=!0}=r,s=e.getAllLeafColumns().filter((e=>e.getCanHide())),c=s.filter((e=>e.getIsVisible())).length,d=e=>{const t=e.columnDef.header;return"string"==typeof t?t:e.id},u=BB(TB(AF),TB(kF,{coordinateGetter:NP}));return C(k,{children:[C("div",{className:"flex items-center gap-2 px-6 pt-4 pb-3 border-b border-modal-line",children:[E("span",{className:"flex-1 typography-subtitle3 text-text-contrast-max",children:"Manage column"}),i&&E(NC,{variant:"text",color:"secondary",size:"sm",disabled:c<=1,onClick:()=>{var e;const t=null!==(e=s.find((e=>e.getIsVisible())))&&void 0!==e?e:s[0];s.forEach((e=>e.toggleVisibility(e.id===t.id)))},children:"Hide all"}),l&&E(NC,{variant:"text",color:"primary",size:"sm",onClick:()=>e.toggleAllColumnsVisible(!0),children:"Show all"}),E(NC,{variant:"outline",color:"primary",size:"sm",onClick:t,children:"Done"})]}),E(lP,{sensors:u,collisionDetection:UB,modifiers:[hP,fP],onDragEnd:t=>{const{active:n,over:r}=t;if(!r||n.id===r.id)return;const o=e.getAllLeafColumns().map((e=>e.id)),a=o.filter((e=>!_z.includes(e)&&!Wz.includes(e))),i=a.indexOf(n.id),l=a.indexOf(r.id);if(-1===i||-1===l)return;const s=o.filter((e=>_z.includes(e))),c=o.filter((e=>Wz.includes(e)));e.setColumnOrder([...s,...mP(a,i,l),...c])},children:E(EP,{items:s.map((e=>e.id)),strategy:bP,children:E("div",{className:"overflow-y-auto ui-scrollbar",style:{maxHeight:n},children:s.map((e=>E(Gz,{col:e,label:d(e),isLastVisible:e.getIsVisible()&&1===c,showReorder:o,showVisibility:a},e.id)))})})})]})}function Kz({data:n,columns:a,manualSorting:i=!1,onSorting:l,paginationMode:u="infinite",totalCount:h,pageIndex:m,pageSize:p,onPaginationChange:g,pageSizeOptions:v,fetchMoreData:w,fetchMoreOffset:b,fetchingMore:y=!1,fetchingMoreLabel:x="Loading more…",loading:M=!1,loadingLabel:R="Loading…",highlightRowId:I,scrollToHighlightOnMouseLeave:O=!1,selectable:A=!1,onRowSelectionChange:L,rowActions:S,reorderable:N=!1,getRowId:j,onRowReorder:D,isRowReorderLocked:Z,onRowClick:V,onCellClick:T,getSubRows:B,defaultExpanded:F,expanded:P,onExpandedChange:H,bordered:_=!0,surface:W="default",striped:z=!1,divided:$=!0,rowClassName:U,cellClassName:q,headerCellClassName:G,headerClassName:Y,headerRowClassName:K,sortIndicatorVisibility:X="hover",tableLayout:Q="auto",columnManagement:J=!1,resizable:ee=!1,columnMinSize:te=60,columnMaxSize:ne=Number.MAX_SAFE_INTEGER,virtualized:re=!1,virtualRowEstimate:oe,className:ae,enableEditing:ie=!1,editDisplayMode:le="cell",editTrigger:se="click",onCellCommit:ce,alwaysEditing:de,enableCellTabTraversal:ue,editableColumnIds:fe,testId:he}){var me;const pe=r(null),ge=r(null),ve=r(!1),we=r(0),[be,ye]=c(48),xe=o((()=>{const e=pe.current;let t=!1;const n=()=>{t||(t=!0,we.current=Math.max(0,we.current-1))};null==e||e.addEventListener("scrollend",n,{once:!0}),window.setTimeout(n,550)}),[]),Ee=o(((e,t,n)=>{var r,o;const a=n.scrollDirection;if("forward"===a||null===a){const n=null===(r=null==t?void 0:t.borderBoxSize)||void 0===r?void 0:r[0];return n?Math.round(n.blockSize):Math.round(e.getBoundingClientRect().height)}const i=e.getAttribute("data-index"),l=null!=i?Number.parseInt(i,10):NaN,s=n.measurementsCache,c=Number.isFinite(l)&&(null==s?void 0:s[l])?s[l].size:void 0;if("number"==typeof c)return c;const d=null===(o=null==t?void 0:t.borderBoxSize)||void 0===o?void 0:o[0];return d?Math.round(d.blockSize):Math.round(e.getBoundingClientRect().height)}),[]),Ce=!!J,ke="object"==typeof J?J:{},[Me,Re]=c([]),[Ie,Oe]=c([]),[Ae,Le]=c({}),[Se,Ne]=c([]),[je,De]=c({}),[Ze,Ve]=c({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),[Te,Be]=c({}),[Fe,Pe]=c(null!==(me=F)&&void 0!==me?me:{}),He=void 0!==P,_e=He?P:Fe,[We,ze]=c({pageIndex:null!=m?m:0,pageSize:null!=p?p:10}),[$e,Ue]=c(!1),[qe,Ge]=c(null),[Ye,Ke]=c(null),[Xe,Qe]=c({top:0,right:0,maxListHeight:400}),Je=r(new Map),et=o(((e,t)=>{Ke(null);const n=window.innerWidth-t.right,r=Math.min(Math.max(n,8),window.innerWidth-460-8),o=t.bottom+8,a=Math.max(80,window.innerHeight-o-80);Qe({top:o,right:r,maxListHeight:a}),Ge(e),Ue(!0)}),[]);d((()=>{if(!$e)return;const e=e=>{"Escape"===e.key&&Ue(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[$e]),d((()=>{"server"===u&&ze({pageIndex:null!=m?m:0,pageSize:null!=p?p:10})}),[u,m,p]);const tt=t.useMemo((()=>null!=fe?fe:ie?function(e){return e.filter((e=>null!=e.enableEditing||null!=e.editVariant)).map((e=>{var t,n;return null!==(n=null!==(t=e.accessorKey)&&void 0!==t?t:e.id)&&void 0!==n?n:""})).filter(Boolean)}(a):[]),[ie,fe,a]),nt=function(e){const{enabled:n,editDisplayMode:r,editTrigger:a,editableColumnIds:i}=e,[l,u]=c(null),[f,h]=c(null),m=t.useRef(!1),p=o((e=>{u(e),h(null)}),[]),g=o(((e,t)=>{h({rowId:e,columnId:t}),u(null)}),[]),v=o((()=>{u(null),h(null)}),[]),w=o(((e,t)=>{m.current||"cell"===r&&h(null)}),[r]),b=o(((e,t,n)=>{const r=i.indexOf(t);if(r<0)return h(null),"exited";const o=r+n;return o<0||o>=i.length?(h(null),"exited"):(m.current=!0,h({rowId:e,columnId:i[o]}),requestAnimationFrame((()=>{m.current=!1})),"moved")}),[i]);return d((()=>{if(!n||"row"!==r||!l)return;const e=e=>{"Escape"===e.key&&u(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[n,r,l]),s((()=>({editingRowId:l,editingCell:f,editDisplayMode:r,editTrigger:a,requestRowEdit:p,requestCellEdit:g,clearEdit:v,onFieldBlur:w,moveCellEdit:b})),[l,f,r,a,p,g,v,w,b])}({enabled:ie,editDisplayMode:le,editTrigger:se,editableColumnIds:tt}),rt=t.useMemo((()=>{let e;var t;return e=ie?function(e,t){const{editing:n,onCellCommit:r,alwaysEditing:o,enableCellTabTraversal:a,editableColumnIds:i}=t;return e.map((e=>{var t,l;const s=e.enableEditing;if(null==s&&null==e.editVariant)return e;const c=null!==(l=null!==(t=e.accessorKey)&&void 0!==t?t:e.id)&&void 0!==l?l:"",d=e.cell,u=Object.assign(Object.assign({},e),{cell:t=>{var l,u,f,h,m,p,g,v;const{row:w}=t,b=function(e){const t=e.original;return"string"==typeof t.id?t.id:e.id}(w);if(!("function"==typeof s?s(w):!1!==s)){const r=null!==(l=null==o?void 0:o(w))&&void 0!==l&&l,a=r||n.editingRowId===b||(null===(u=n.editingCell)||void 0===u?void 0:u.rowId)===b;if((r||e.editShowDisabledField&&a)&&(e.editVariant||null!=s))return E(Tz,{row:w,col:e,columnId:c});if(e.displayCell)return e.displayCell(w);if(d)return"function"==typeof d?d(t):d;const i=w.original[c];return E(k,{children:String(null!=i?i:"")})}const y=null!==(f=null==o?void 0:o(w))&&void 0!==f&&f,x=y||function(e,t,n){var r;const o="string"==typeof t.original.id?t.original.id:t.id;return"row"===e.editDisplayMode?e.editingRowId===o:(null===(r=e.editingCell)||void 0===r?void 0:r.rowId)===o&&e.editingCell.columnId===n}(n,w,c);if(!x){const t=e.displayCell?e.displayCell(w):String(null!==(h=w.original[c])&&void 0!==h?h:""),r=()=>{"row"===n.editDisplayMode?n.requestRowEdit(b):n.requestCellEdit(b,c)},o="click"===n.editTrigger?{onClick:r}:{onDoubleClick:r};return E("div",Object.assign({className:LC("-mx-1 flex min-h-[32px] w-full min-w-0 cursor-pointer items-center rounded-sm px-1","hover:bg-table-c-hover/35")},o,{children:t}))}const C=null!==(m=e.editVariant)&&void 0!==m?m:"text",M=!y&&"cell"===n.editDisplayMode,R=null===(p=e.editError)||void 0===p?void 0:p.call(e,w),I=t=>{const o=Nz(e,w,t,c);null==r||r(b,c,o),y||n.onFieldBlur(b,c)},O=a?(e,t)=>{if("Tab"===e.key){if("row"===n.editDisplayMode){const n=i.indexOf(c);if(n<0)return;const r=n+(e.shiftKey?-1:1);if(r<0||r>=i.length)return;const o=i[r];return t(),e.preventDefault(),void requestAnimationFrame((()=>{const e=document.querySelector(`[data-edit-cell="${b}:${o}"] input, [data-edit-cell="${b}:${o}"] button`);null==e||e.focus()}))}t(),"moved"===n.moveCellEdit(b,c,e.shiftKey?-1:1)&&e.preventDefault()}}:void 0;if("select"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Dz,{row:w,columnId:c,col:e,autoFocus:M,keepOpenAfterSelect:"row"===n.editDisplayMode||y,onCommit:t=>{var n;const o=String(null!==(n=w.original[c])&&void 0!==n?n:"");if(t.trim()===o.trim())return;const a=Nz(e,w,t,c);null==r||r(b,c,a)},onBlurField:"row"===n.editDisplayMode?void 0:()=>{y||n.onFieldBlur(b,c)},onKeyDown:O?e=>O(e,(()=>{})):void 0,errorMessage:R})});if("number"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Zz,{columnId:c,row:w,col:e,autoFocus:M,errorMessage:R,onBlur:e=>I(e),onKeyDown:O?t=>O(t,(()=>{const n=t.target.value.trim(),o=Nz(e,w,n,c);null==r||r(b,c,o)})):void 0})});if("checkbox"===C)return E("div",{"data-edit-cell":`${b}:${c}`,children:E(Vz,{columnId:c,row:w,col:e,errorMessage:R,onCommit:t=>{const n=Nz(e,w,String(t),c);null==r||r(b,c,n)},onKeyDown:O?e=>O(e,(()=>{})):void 0})});if("custom"===C&&e.editCustomCell){const t=()=>{y||n.onFieldBlur(b,c)};return E("div",{"data-edit-cell":`${b}:${c}`,children:e.editCustomCell(w,{commit:t=>{const n=Nz(e,w,t,c);null==r||r(b,c,n)},blur:t,columnId:c,autoFocus:M,errorMessage:R,onKeyDown:O?e=>O(e,(()=>{})):void 0})})}return E("div",{"data-edit-cell":`${b}:${c}`,children:E(jz,{columnId:c,row:w,placeholder:null!==(v=null===(g=e.editTextProps)||void 0===g?void 0:g.placeholder)&&void 0!==v?v:"",autoFocus:M,errorMessage:R,onBlur:e=>I(e.currentTarget.value.trim()),onKeyDown:O?t=>O(t,(()=>{const n=t.target.value.trim(),o=Nz(e,w,n,c);null==r||r(b,c,o)})):void 0})})}});return u}))}(a,{editing:nt,onCellCommit:ce,alwaysEditing:de,enableCellTabTraversal:null==ue||ue,editableColumnIds:tt}):[...a],N&&e.unshift({id:"__reorder__",header:()=>null,cell:({row:e})=>E(Pz,{rowId:e.id}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:54,maxSize:54,minSize:54,meta:{exactWidth:54}}),A&&e.unshift({id:"__select__",header:({table:e})=>E(LL,{checked:e.getIsSomeRowsSelected()?"indeterminate":e.getIsAllRowsSelected(),onCheckedChange:t=>e.toggleAllRowsSelected(!!t),"aria-label":"Select all"}),cell:({row:e})=>E(LL,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row",disabled:!e.getCanSelect()}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:42,maxSize:42,minSize:42,meta:{exactWidth:42}}),S&&e.push((t=S,{id:"__actions__",header:()=>null,cell:({row:e})=>E("div",{className:"flex items-center justify-center gap-1",children:t(e)}),enableSorting:!1,enableHiding:!1,enableResizing:!1,size:80,maxSize:80,minSize:80,meta:{exactWidth:80}})),e}),[a,A,N,S,ie,nt,ce,de,ue]),ot="client"===u||"server"===u,at=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[r]=e.useState((()=>({current:zT(n)}))),[o,a]=e.useState((()=>r.current.initialState));return r.current.setOptions((e=>({...e,...t,state:{...o,...t.state},onStateChange:e=>{a(e),null==t.onStateChange||t.onStateChange(e)}}))),r.current}(Object.assign(Object.assign(Object.assign(Object.assign({data:n,columns:rt,columnResizeMode:"onChange",defaultColumn:{minSize:te,maxSize:ne}},j?{getRowId:e=>j(e)}:{getRowId:e=>e.id}),{manualSorting:i,manualPagination:"server"===u,rowCount:"server"===u?null!=h?h:n.length:void 0,getSubRows:B,onSortingChange:Re,onColumnFiltersChange:Oe,onColumnVisibilityChange:Le,onColumnOrderChange:Ne,onColumnSizingChange:De,onColumnSizingInfoChange:Ve,onRowSelectionChange:Be,onExpandedChange:e=>{const t="function"==typeof e?e(_e):e;He||Pe(t),null==H||H(t)},onPaginationChange:e=>{const t="function"==typeof e?e(We):e;ze(t),null==g||g(t)},getCoreRowModel:e=>QV((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let s=0;s<t.length;s++){const c=oT(e,e._getRowId(t[s],s,a),t[s],s,o,0,null==a?void 0:a.id);var l;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=c.originalSubRows)&&l.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),JV(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getSortedRowModel:e=>QV((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],l=i[o.id],s=l.sortUndefined,c=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(s){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===s)return n?-1:1;if("last"===s)return n?1:-1;d=n&&r?0:n?s:-s}}if(0===d&&(d=l.sortingFn(e,t,o.id)),0!==d)return c&&(d*=-1),l.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))})),t};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}}),JV(e.options,"debugTable","getSortedRowModel",(()=>e._autoResetPageIndex()))),getFilteredRowModel:e=>QV((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],a=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const a=r.getFilterFn();a?o.push({id:t.id,filterFn:a,resolvedValue:null!=(n=null==a.resolveFilterValue?void 0:a.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${r.id}.`)}));const i=(null!=n?n:[]).map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,d;r&&l&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;a.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(a.length){for(let e=0;e<a.length;e++){d=a[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return UT(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),JV(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex()))),getExpandedRowModel:e=>QV((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?$T(t):t),JV(e.options,"debugTable","getExpandedRowModel"))}),ot?{getPaginationRowModel:e=>QV((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:a,flatRows:i,rowsById:l}=n;const s=r*o,c=s+r;let d;a=a.slice(s,c),d=e.options.paginateExpandedRows?{rows:a,flatRows:i,rowsById:l}:$T({rows:a,flatRows:i,rowsById:l}),d.flatRows=[];const u=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(u)};return d.rows.forEach(u),d}),JV(e.options,"debugTable","getPaginationRowModel"))}:{}),{enableRowSelection:A,enableColumnResizing:ee,state:Object.assign({sorting:Me,columnFilters:Ie,columnVisibility:Ae,columnOrder:Se,columnSizing:je,columnSizingInfo:Ze,rowSelection:Te,expanded:_e},ot?{pagination:We}:{})})),it=t.useMemo((()=>{const e=at.getRowModel().rows;if(!Z)return e;const t=e.filter((e=>Z(e))),r=e.filter((e=>!Z(e)));if(0===t.length)return e;const o=new Map(n.map(((e,t)=>[j?j(e):String(e.id),t])));return t.sort(((e,t)=>{var n,r;return(null!==(n=o.get(e.id))&&void 0!==n?n:0)-(null!==(r=o.get(t.id))&&void 0!==r?r:0)})),[...r,...t]}),[at.getRowModel().rows,Z,n,j]);d((()=>{null==l||l(Me)}),[Me,l]),d((()=>{null==L||L(Te)}),[Te,L]),d((()=>{if("infinite"!==u)return;const e=pe.current;if(!e)return;const t=()=>{if(we.current>0)return;const{scrollTop:t,scrollHeight:n,clientHeight:r}=e;if(y||M)return;t+r>=n-("number"==typeof b?b:10)&&(null==w||w())};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}),[u,w,y,M,b]);const lt=0===it.length;f((()=>{if(!re)return;const e=ge.current;if(!e)return;const t=()=>{ye(Math.round(e.getBoundingClientRect().height))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()}),[re]);const st=r((()=>{})),ct=r(!1),dt=CR({count:re?it.length:0,getScrollElement:()=>pe.current,estimateSize:()=>null!=oe?oe:40,overscan:4,paddingStart:re?be:0,scrollPaddingStart:0,measureElement:Ee,onChange:()=>{var e,t;if(!re||!I)return;(null!==(t=null===(e=pe.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)<1?ct.current=!1:ct.current||(ct.current=!0,requestAnimationFrame((()=>{ve.current||st.current("auto")})))}}),ut=o(((e="smooth")=>{var t,n;if(!I)return;if(ve.current)return;const r=pe.current;if(!r)return;const o=Array.isArray(I)?I:[I];if(re){dt.getTotalSize();for(const a of o){const o=it.findIndex((e=>e.id===a));if(-1!==o){const a=null!=oe?oe:40,i=dt.getOffsetForIndex(o,"start");if(!i)continue;const[l]=i,s=null===(n=null===(t=dt.measurementsCache)||void 0===t?void 0:t[o])||void 0===n?void 0:n.size,c=l+("number"==typeof s?s:a)/2-r.clientHeight/2;return we.current+=1,xe(),void dt.scrollToOffset(Math.max(0,c),{align:"start",behavior:"smooth"===e?"smooth":"auto"})}}}else for(const t of o){const n=r.querySelector(`[data-row-id="${t}"]`);if(n){we.current+=1,xe(),n.scrollIntoView({block:"center",behavior:e});break}}}),[I,it,re,dt,oe,be,xe]);st.current=ut,f((()=>{ct.current=!1}),[re,I]),f((()=>{ut("smooth")}),[re,ut,I]);const ft={pageIndex:We.pageIndex,pageSize:We.pageSize,totalCount:"server"===u?null!=h?h:n.length:at.getFilteredRowModel().rows.length,pageSizeOptions:v,onPageChange:e=>at.setPagination((t=>Object.assign(Object.assign({},t),{pageIndex:e}))),onPageSizeChange:e=>at.setPagination({pageIndex:0,pageSize:e})},ht=function(e){return t.useMemo((()=>{var t;const n=e.getVisibleLeafColumns();let r=0,o=0;for(const e of n){const n=null===(t=e.columnDef.meta)||void 0===t?void 0:t.exactWidth,a=Uz(n);null!=a?r+=a:null==n&&(o+=1)}if(0!==o&&0!==r)return`calc((100% - ${r}px) / ${o})`}),[e.getVisibleLeafColumns()])}(at),mt="equal"===Q?ht:void 0,pt=t.useMemo((()=>{if("fixed"!==Q)return null;const e=at.getVisibleLeafColumns(),t=e=>{var t;return null!=Uz(null===(t=e.columnDef.meta)||void 0===t?void 0:t.exactWidth)},n=e.map(((e,n)=>t(e)?-1:n)).filter((e=>e>=0)),r=n.length>0?n[n.length-1]:-1,o=new Map;return e.forEach(((e,n)=>{var a,i,l;if(t(e))return;if(n===r)return;const s=null!==(l=null!==(a=e.columnDef.size)&&void 0!==a?a:null===(i=e.getSize)||void 0===i?void 0:i.call(e))&&void 0!==l?l:150,c="number"==typeof s?s:Number.isFinite(parseFloat(String(s)))?parseFloat(String(s)):150;o.set(e.id,{width:`${c}px`,minWidth:`${c}px`,maxWidth:`${c}px`,overflow:"hidden",boxSizing:"border-box"})})),o}),[Q,at.getVisibleLeafColumns()]),gt=t.useMemo((()=>{var e,t;if(!ee||"equal"===Q)return null;const n=at.getVisibleLeafColumns(),r=n.map(((e,t)=>{var n;return null==Uz(null===(n=e.columnDef.meta)||void 0===n?void 0:n.exactWidth)?t:-1})).filter((e=>e>=0));return 0===r.length?null:null!==(t=null===(e=n[r[r.length-1]])||void 0===e?void 0:e.id)&&void 0!==t?t:null}),[ee,Q,at.getVisibleLeafColumns()]),vt=e=>{var t;return null===(t=e.getVisibleCells().find((e=>"__select__"!==e.column.id&&"__actions__"!==e.column.id&&"__reorder__"!==e.column.id)))||void 0===t?void 0:t.id},wt=BB(TB(AF),TB(kF,{coordinateGetter:NP})),bt=t.useMemo((()=>it.filter((e=>!(null==Z?void 0:Z(e)))).map((e=>e.id))),[it,Z]),yt="fixed"===Q||ee,xt=Ce&&!1!==ke.visibility,Et=Ce?at.getAllLeafColumns().filter((e=>e.getCanHide()&&e.getIsVisible())).length:0,Ct=ie?nt:null;return E(Oz.Provider,{value:Ct,children:C("div",{className:LC("flex flex-col w-full h-full min-h-0",_&&"overflow-hidden rounded-md border border-table-c-border",!_&&"overflow-hidden rounded-none",ae),"data-surface":"panel"===W?"panel":void 0,"data-testid":he,children:[E("div",{ref:pe,className:LC("relative min-h-0 overflow-auto","ui-scrollbar ui-scrollbar-x-m ui-scrollbar-y-s",ot?"flex-1":"h-full"),onWheel:O?()=>{ve.current=!0}:void 0,onPointerDownCapture:O?()=>{ve.current=!0}:void 0,onMouseLeave:O?()=>{ve.current=!1,ut("smooth")}:void 0,children:C(PV,{scrollableWrapper:!1,className:LC(("fixed"===Q||"equal"===Q||ee)&&"table-fixed",lt&&"h-full"),style:ee?{width:`max(100%, ${at.getTotalSize()}px)`}:{width:"100%"},children:["fixed"===Q&&!ee&&E("colgroup",{children:at.getVisibleLeafColumns().map((e=>{const t=$z(e.columnDef,yt),n=null!=t?t:null==pt?void 0:pt.get(e.id);return E("col",{style:n},e.id)}))}),ee&&E("colgroup",{children:at.getVisibleLeafColumns().map((e=>{const t=$z(e.columnDef,yt);return t?E("col",{style:t},e.id):"equal"===Q||null!=gt&&e.id===gt?E("col",{},e.id):E("col",{style:{width:e.getSize()}},e.id)}))}),E(HV,{ref:ge,className:LC("sticky top-0 z-10",Y),"data-testid":he?`${he}-thead`:void 0,children:at.getHeaderGroups().map((e=>E(zV,{divided:!1,colDivided:$,className:LC("hover:bg-transparent",K),children:e.headers.map((e=>{var t;const n=e.column.getCanSort(),r=e.column.getIsSorted(),o=Ce&&e.column.getCanHide(),a=ee&&"equal"!==Q&&e.column.getCanResize(),i=e.column.getIsResizing(),l=!ee&&pt?pt.get(e.column.id):void 0,s=ee&&"equal"!==Q&&!(null!=gt&&e.column.id===gt),c=function(e,t,n,r,o){const a=$z(e,r);if(a)return a;if(null!=o){const t=e.maxSize;return Object.assign({width:o},null!=t&&t!==Number.MAX_SAFE_INTEGER&&{maxWidth:t})}return t?{width:t}:n}(e.column.columnDef,mt,l,yt,s?e.getSize():void 0);return C($V,{colSpan:e.colSpan,style:c,className:LC("relative overflow-visible group/col whitespace-pre",i&&"select-none",null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.headerCellClassName,"function"==typeof G?G(e):G),children:[C("div",{className:"flex flex-row items-center gap-1 group/header",children:[E("span",{className:LC("flex flex-1 flex-row items-center overflow-hidden",n&&"cursor-pointer select-none",Bz(e.column.columnDef.meta)),onClick:e.column.getToggleSortingHandler(),children:e.isPlaceholder?null:qT(e.column.columnDef.header,e.getContext())}),n&&E(Zk,{variant:"icon",size:"xs",className:LC("shrink-0 transition-opacity",r||"always"===X?"opacity-100":"opacity-0 group-hover/header:opacity-100"),onClick:e.column.getToggleSortingHandler(),"aria-label":"asc"===r?"Sorted ascending — click to sort descending":"desc"===r?"Sorted descending — click to clear sort":"Sort column",children:"asc"===r?E(QC,{className:"!size-4"}):"desc"===r?E(KC,{className:"!size-4"}):E(XC,{className:"!size-4 text-text-g-contrast-medium"})}),o&&C(XW,{open:Ye===e.column.id,onOpenChange:t=>Ke(t?e.column.id:null),modal:!1,children:[E(QW,{asChild:!0,children:E(Zk,{variant:"icon",size:"sm",active:$e&&qe===e.column.id||Ye===e.column.id,"aria-haspopup":"menu","aria-expanded":Ye===e.column.id,"aria-label":"Column options",className:"shrink-0",ref:t=>{t?Je.current.set(e.column.id,t):Je.current.delete(e.column.id)},onClick:e=>e.stopPropagation(),children:E(ck,{className:"!size-4"})})}),C(az,{align:"end",sideOffset:4,className:"min-w-[220px] py-1",onCloseAutoFocus:e=>e.preventDefault(),children:[xt&&C(iz,{className:"py-3",disabled:e.column.getIsVisible()&&Et<=1,icon:E(uk,{className:"size-4","aria-hidden":!0}),onSelect:()=>{e.column.toggleVisibility(!1)},children:["Hide ",zz(e)," ","column"]}),E(iz,{className:"py-3",icon:E(sk,{className:"size-4","aria-hidden":!0}),onSelect:()=>{requestAnimationFrame((()=>{const t=Je.current.get(e.column.id);t&&et(e.column.id,t.getBoundingClientRect())}))},children:"Manage columns"})]})]})]}),a&&E("div",{onMouseDown:e.getResizeHandler(document),onTouchStart:e.getResizeHandler(document),onClick:e=>e.stopPropagation(),className:LC("absolute right-0 top-0 h-full w-[5px] z-10","cursor-col-resize select-none touch-none","flex items-center justify-center group/resize"),children:E("div",{className:LC("h-4/5 w-1.5 rounded-full transition-all duration-150",i?"opacity-100 w-0.5 bg-primary-500":"opacity-0 bg-table-c-col-line group-hover/col:opacity-100 group-hover/resize:bg-primary-400")})})]},e.id)}))},e.id)))}),E(_V,{striped:z,"data-testid":he?`${he}-tbody`:void 0,children:lt?E(zV,M?{className:"h-full hover:bg-transparent",divided:!1,children:E(UV,{colSpan:rt.length,className:"typography-body1 text-text-g-contrast-medium text-center h-full min-h-[200px]",children:C("div",{className:"flex flex-1 min-h-[200px] h-full flex-col items-center justify-center gap-3 py-16",role:"status","aria-live":"polite","aria-busy":"true",children:[E(fk,{className:"size-8 shrink-0 animate-spin text-secondary-120","aria-hidden":!0}),R]})})}:{className:"h-full hover:bg-transparent",divided:!1,children:E(UV,{colSpan:rt.length,className:"typography-body1 text-text-g-contrast-medium text-center h-full",children:C("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 py-16",children:[E(lk,{className:"w-8 text-secondary-120"}),"There is no information yet."]})})}):re?(()=>{var e;const t=dt.getVirtualItems();if(!t.length)return null;const n=Math.max(0,t[0].start-be),r=dt.getTotalSize()-(null!==(e=t[t.length-1].end)&&void 0!==e?e:0);return C(k,{children:[n>0&&E("tr",{"aria-hidden":!0,children:E("td",{colSpan:rt.length,style:{height:n}})}),t.map((e=>{const t=it[e.index],n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=Array.isArray(I)?I.includes(t.id):I===t.id,a={divided:!(!n||z)||!z,colDivided:$,"data-state":t.getIsSelected()?"selected":void 0,"data-highlighted":o?"true":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(t,e.index):U),onClick:V?e=>V(t,e):void 0};return E(zV,Object.assign({ref:dt.measureElement,"data-index":e.index,"data-row-id":t.id},a,{children:Fz({row:t,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T})}),t.id)})),r>0&&E("tr",{"aria-hidden":!0,children:E("td",{colSpan:rt.length,style:{height:r}})})]})})():N?E(lP,{sensors:wt,collisionDetection:UB,modifiers:[hP],onDragEnd:e=>{const{active:t,over:r}=e;if(!r||t.id===r.id||!D)return;const o=n.findIndex((e=>(j?j(e):e.id)===t.id)),a=n.findIndex((e=>(j?j(e):e.id)===r.id));-1!==o&&-1!==a&&D(mP([...n],o,a))},children:E(EP,{items:bt,strategy:bP,children:it.map(((e,t)=>{const n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=null==Z?void 0:Z(e),a=Array.isArray(I)?I.includes(e.id):I===e.id,i={divided:!(!n||z)||!z,colDivided:$,"data-state":e.getIsSelected()?"selected":void 0,"data-highlighted":a?"true":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(e,t):U),onClick:V?t=>V(e,t):void 0},l=Fz({row:e,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T});return o?E(zV,Object.assign({"data-row-id":e.id},i,{children:l}),e.id):E(Hz,Object.assign({id:e.id,"data-row-id":e.id},i,{children:l}),e.id)}))})}):it.map(((e,t)=>{const n=Boolean(B),r=n&&!z?"bg-table-bg-a":void 0,o=Array.isArray(I)?I.includes(e.id):I===e.id;return E(zV,{divided:!(!n||z)||!z,colDivided:$,"data-state":e.getIsSelected()?"selected":void 0,className:LC(r,V&&"cursor-pointer","function"==typeof U?U(e,t):U),"data-highlighted":o?"true":void 0,onClick:V?t=>V(e,t):void 0,"data-row-id":e.id,children:Fz({row:e,getSubRows:B,firstDataCellId:vt,fixedColStyles:pt,flexWidth:mt,lockPxExactWidth:yt,resizable:ee,tableLayout:Q,resizableSlackGrowColId:gt,cellClassName:q,onCellClick:T})},e.id)}))}),"infinite"===u&&y&&!lt&&at.getVisibleLeafColumns().length>0&&E("tfoot",{className:"[&_tr]:bg-table-c-row-bg",children:E(zV,{divided:!1,className:"hover:!bg-table-c-row-bg border-t border-t-table-c-row-line",children:E(UV,{colSpan:at.getVisibleLeafColumns().length,className:"py-3 text-center typography-body3 text-text-g-contrast-medium bg-inherit",children:C("span",{role:"status","aria-live":"polite",className:"inline-flex items-center justify-center gap-2",children:[E(fk,{className:"size-4 shrink-0 animate-spin","aria-hidden":!0}),x]})})})})]})}),ot&&E(GV,Object.assign({},ft)),Ce&&$e&&C(rB,{children:[E("div",{className:"fixed inset-0 z-40",onClick:()=>Ue(!1)}),E("div",{className:"fixed z-50 w-[460px] rounded-lg bg-modal-surface shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] overflow-hidden",style:{top:Xe.top,right:Xe.right},onClick:e=>e.stopPropagation(),children:E(Yz,{table:at,onClose:()=>Ue(!1),maxListHeight:Xe.maxListHeight,options:ke})})]})]})})}var Xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});var Qz,Jz="dismissableLayer.update",e$="dismissableLayer.pointerDownOutside",t$="dismissableLayer.focusOutside",n$=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),r$=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(n$),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){a$(e$,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){a$(t$,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Qz=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),o$(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Qz)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),o$())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Jz,e),()=>document.removeEventListener(Jz,e)}),[]),E(Xz.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));r$.displayName="DismissableLayer";function o$(){const e=new CustomEvent(Jz);document.dispatchEvent(e)}function a$(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(n$),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Xz.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var i$="focusScope.autoFocusOnMount",l$="focusScope.autoFocusOnUnmount",s$={bubbles:!1,cancelable:!0},c$=e.forwardRef(((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[s,c]=e.useState(null),d=aL(a),u=aL(i),f=e.useRef(null),h=tL(n,(e=>c(e))),m=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect((()=>{if(o){let e=function(e){if(m.paused||!s)return;const t=e.target;s.contains(t)?f.current=t:h$(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||h$(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&h$(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,s,m.paused]),e.useEffect((()=>{if(s){m$.add(m);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(i$,s$);s.addEventListener(i$,d),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(h$(r,{select:t}),document.activeElement!==n)return}((e=d$(s),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&h$(s))}return()=>{s.removeEventListener(i$,d),setTimeout((()=>{const e=new CustomEvent(l$,s$);s.addEventListener(l$,u),s.dispatchEvent(e),e.defaultPrevented||h$(t??document.body,{select:!0}),s.removeEventListener(l$,u),m$.remove(m)}),0)}}var e}),[s,d,u,m]);const p=e.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=d$(e),n=u$(t,e),r=u$(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&h$(a,{select:!0})):(e.preventDefault(),r&&h$(o,{select:!0})):n===t&&e.preventDefault()}}),[r,o,m.paused]);return E(Xz.div,{tabIndex:-1,...l,ref:h,onKeyDown:p})}));function d$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function u$(e,t){for(const n of e)if(!f$(n,{upTo:t}))return n}function f$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function h$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}c$.displayName="FocusScope";var m$=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=p$(e,t),e.unshift(t)},remove(t){e=p$(e,t),e[0]?.resume()}}}();function p$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var g$=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(Xz.div,{...o,ref:n}),l):null}));g$.displayName="Portal";var v$=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=w$(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=w$(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=w$(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=w$(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function w$(e){return e?.animationName||"none"}v$.displayName="Presence";var b$="Dialog",[y$,x$]=nL(b$),[E$,C$]=y$(b$),k$=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=t,s=e.useRef(null),c=e.useRef(null),[d=!1,u]=iL({prop:o,defaultProp:a,onChange:i});return E(E$,{scope:n,triggerRef:s,contentRef:c,contentId:Gj(),titleId:Gj(),descriptionId:Gj(),open:d,onOpenChange:u,onOpenToggle:e.useCallback((()=>u((e=>!e))),[u]),modal:l,children:r})};k$.displayName=b$;var M$="DialogTrigger",R$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(M$,n),a=tL(t,o.triggerRef);return E(Xz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$$(o.open),...r,ref:a,onClick:oL(e.onClick,o.onOpenToggle)})}));R$.displayName=M$;var I$="DialogPortal",[O$,A$]=y$(I$,{forceMount:void 0}),L$=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=C$(I$,n);return E(O$,{scope:n,forceMount:r,children:e.Children.map(o,(e=>E(v$,{present:r||i.open,children:E(g$,{asChild:!0,container:a,children:e})})))})};L$.displayName=I$;var S$="DialogOverlay",N$=e.forwardRef(((e,t)=>{const n=A$(S$,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=C$(S$,e.__scopeDialog);return a.modal?E(v$,{present:r||a.open,children:E(j$,{...o,ref:t})}):null}));N$.displayName=S$;var j$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(S$,n);return E(mZ,{as:fL,allowPinchZoom:!0,shards:[o.contentRef],children:E(Xz.div,{"data-state":$$(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})})),D$="DialogContent",Z$=e.forwardRef(((e,t)=>{const n=A$(D$,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=C$(D$,e.__scopeDialog);return E(v$,{present:r||a.open,children:a.modal?E(V$,{...o,ref:t}):E(T$,{...o,ref:t})})}));Z$.displayName=D$;var V$=e.forwardRef(((t,n)=>{const r=C$(D$,t.__scopeDialog),o=e.useRef(null),a=tL(n,r.contentRef,o);return e.useEffect((()=>{const e=o.current;if(e)return AD(e)}),[]),E(B$,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oL(t.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:oL(t.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:oL(t.onFocusOutside,(e=>e.preventDefault()))})})),T$=e.forwardRef(((t,n)=>{const r=C$(D$,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return E(B$,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})})),B$=e.forwardRef(((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=t,s=C$(D$,r),c=e.useRef(null),d=tL(n,c);return Dj(),C(k,{children:[E(c$,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:E(r$,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":$$(s.open),...l,ref:d,onDismiss:()=>s.onOpenChange(!1)})}),C(k,{children:[E(Y$,{titleId:s.titleId}),E(K$,{contentRef:c,descriptionId:s.descriptionId})]})]})})),F$="DialogTitle",P$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(F$,n);return E(Xz.h2,{id:o.titleId,...r,ref:t})}));P$.displayName=F$;var H$="DialogDescription",_$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(H$,n);return E(Xz.p,{id:o.descriptionId,...r,ref:t})}));_$.displayName=H$;var W$="DialogClose",z$=e.forwardRef(((e,t)=>{const{__scopeDialog:n,...r}=e,o=C$(W$,n);return E(Xz.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,(()=>o.onOpenChange(!1)))})}));function $$(e){return e?"open":"closed"}z$.displayName=W$;var U$="DialogTitleWarning",[q$,G$]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,a=e.useMemo((()=>o),Object.values(o));return E(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(o){const a=e.useContext(r);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(U$,{contentName:D$,titleName:F$,docsSlug:"dialog"}),Y$=({titleId:t})=>{const n=G$(U$),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect((()=>{if(t){document.getElementById(t)||console.error(r)}}),[r,t]),null},K$=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G$("DialogDescriptionWarning").contentName}}.`;return e.useEffect((()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}}),[r,t,n]),null},X$=k$,Q$=R$,J$=L$,eU=N$,tU=Z$,nU=P$,rU=_$,oU=z$;const aU=X$,iU=Q$,lU=J$,sU=oU,cU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(eU,Object.assign({ref:t,className:LC("fixed inset-0 z-50 bg-modal-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n)},r))}));cU.displayName=eU.displayName;const dU=e.forwardRef(((e,t)=>{var{className:n,children:r,showCloseButton:o=!1,closeButtonClassName:a}=e,i=IC(e,["className","children","showCloseButton","closeButtonClassName"]);return C(lU,{children:[E(cU,{}),C(tU,Object.assign({ref:t,className:LC("fixed left-[50%] top-[50%] z-50 flex w-[calc(100%-32px)] max-w-[650px] translate-x-[-50%] translate-y-[-50%] flex-col gap-6 rounded-md bg-modal-surface p-8 text-text-g-contrast-medium shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 focus:outline-none focus-visible:outline-none outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n)},i,{children:[r,o&&C(oU,{className:LC("absolute right-8 top-8 rounded-sm opacity-70 ring-offset-bg-bg1 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-input-active-stroke focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-state-primary-text-solid",a),children:[E(vu,{className:"h-4 w-4"}),E("span",{className:"sr-only",children:"Close"})]})]}))]})}));dU.displayName=tU.displayName;const uU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-col gap-1 text-left",t)},n))};uU.displayName="DialogHeader";const fU=e=>{var{className:t,scrollable:n=!1}=e,r=IC(e,["className","scrollable"]);return E("div",Object.assign({className:LC("flex flex-1 min-h-0 flex-col",n&&"overflow-y-auto",t)},r))};fU.displayName="DialogBody";const hU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-row items-center justify-end gap-4",t)},n))};hU.displayName="DialogFooter";const mU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(nU,Object.assign({ref:t,className:LC("typography-h6 tracking-tight text-text-contrast-max",n)},r))}));mU.displayName=nU.displayName;const pU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(rU,Object.assign({ref:t,className:LC("typography-body3 text-text-contrast-max",n)},r))}));pU.displayName=rU.displayName;var gU="AlertDialog",[vU]=nL(gU,[x$]),wU=x$(),bU=e=>{const{__scopeAlertDialog:t,...n}=e,r=wU(t);return E(X$,{...r,...n,modal:!0})};bU.displayName=gU;var yU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(Q$,{...o,...r,ref:t})}));yU.displayName="AlertDialogTrigger";var xU=e=>{const{__scopeAlertDialog:t,...n}=e,r=wU(t);return E(J$,{...r,...n})};xU.displayName="AlertDialogPortal";var EU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(eU,{...o,...r,ref:t})}));EU.displayName="AlertDialogOverlay";var CU="AlertDialogContent",[kU,MU]=vU(CU),RU=e.forwardRef(((t,n)=>{const{__scopeAlertDialog:r,children:o,...a}=t,i=wU(r),l=e.useRef(null),s=tL(n,l),c=e.useRef(null);return E(q$,{contentName:CU,titleName:IU,docsSlug:"alert-dialog",children:E(kU,{scope:r,cancelRef:c,children:C(tU,{role:"alertdialog",...i,...a,ref:s,onOpenAutoFocus:oL(a.onOpenAutoFocus,(e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})})),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[E(mL,{children:o}),E(DU,{contentRef:l})]})})})}));RU.displayName=CU;var IU="AlertDialogTitle",OU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(nU,{...o,...r,ref:t})}));OU.displayName=IU;var AU="AlertDialogDescription",LU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(rU,{...o,...r,ref:t})}));LU.displayName=AU;var SU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=wU(n);return E(oU,{...o,...r,ref:t})}));SU.displayName="AlertDialogAction";var NU="AlertDialogCancel",jU=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=MU(NU,n),a=wU(n),i=tL(t,o);return E(oU,{...a,...r,ref:i})}));jU.displayName=NU;var DU=({contentRef:t})=>{const n=`\`${CU}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${CU}\` by passing a \`${AU}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CU}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return e.useEffect((()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(n)}),[n,t]),null},ZU=EU,VU=RU,TU=SU,BU=jU,FU=OU,PU=LU;const HU=bU,_U=yU,WU=xU,zU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(ZU,Object.assign({className:LC("fixed inset-0 bg-modal-overlay z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n)},r,{ref:t}))}));zU.displayName=ZU.displayName;const $U=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return C(WU,{children:[E(zU,{}),E(VU,Object.assign({ref:t,className:LC("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-32px)] max-w-[460px] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-md bg-modal-surface px-6 py-8 text-text-contrast-max shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 focus:outline-none focus-visible:outline-none outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",n)},r))]})}));$U.displayName=VU.displayName;const UU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-col items-center gap-2 text-center",t)},n))};UU.displayName="AlertDialogHeader";const qU=e=>{var{className:t}=e,n=IC(e,["className"]);return E("div",Object.assign({className:LC("flex flex-row items-center justify-center gap-4",t)},n))};qU.displayName="AlertDialogFooter";const GU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(FU,Object.assign({ref:t,className:LC("typography-subtitle3 text-text-contrast-max",n)},r))}));GU.displayName=FU.displayName;const YU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(PU,Object.assign({ref:t,className:LC("typography-body3 text-text-contrast-max",n)},r))}));YU.displayName=PU.displayName;const KU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(TU,Object.assign({ref:t,className:LC(OC({fullwidth:!1}),"min-w-[100px] justify-center",n)},r))}));KU.displayName=TU.displayName;const XU=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(BU,Object.assign({ref:t,className:LC(OC({fullwidth:!1,variant:"outline"}),"min-w-[100px] justify-center whitespace-pre-line",n)},r))}));XU.displayName=BU.displayName;const QU=n(((e,t)=>{const{label:n="Search",required:r=!1}=e,o=IC(e,["label","required"]);return E(JA,Object.assign({label:n,required:r},o,{ref:t,keepCloseIconOnValue:!0,hasClearIcon:!0,hasSearchIcon:!0,endIcon:null,filterMode:!0,isFloatingLabel:!1,segmentedInput:!1}))})),JU=M(["absolute flex items-center justify-center cursor-pointer","border-l border-l-input-default-stroke","peer-hover:border-l-input-active-stroke","peer-focus:border-l-input-active-stroke","fill-primary","peer-hover:fill-input-filled-text","peer-focus:fill-input-filled-text","stroke-input-default-stroke","peer-hover:stroke-input-active-stroke","peer-focus:stroke-input-filled-text"],{variants:{size:{sm:"p-1 size-[30px]",md:"p-2 size-[38px]",lg:"p-3 size-14"},rounded:{none:"rounded-r-none",normal:"",full:"rounded-r-full"},error:{true:"border-l-input-error"},position:{start:"inset-y-0 left-0",end:"inset-y-0 right-0"},active:{false:"",true:["fill-primary-default","peer-hover:fill-primary-default","peer-focus:fill-primary-hover","stroke-primary-default","peer-hover:stroke-primary-default","peer-focus:stroke-primary-hover"]},disabled:{true:["cursor-default pointer-events-none","border-l-input-disable-stroke","fill-input-disable-stroke","stroke-input-disable-stroke"]}},compoundVariants:[{rounded:"normal",size:"sm",className:"rounded-r-sm"},{rounded:"normal",size:["md","lg"],className:"rounded-r-md"}],defaultVariants:{size:"md",rounded:"normal",error:!1,position:"end",active:!1,disabled:!1}}),eq=n(((e,t)=>{var{id:n,options:a=[],values:i=[],label:l,size:u="md",rounded:f="normal",variant:m="outline",helperText:p,errorMessage:g,fullwidth:v=!0,disabled:w=!1,error:b=!1,filterMode:y=!1,required:x=!0,onChangeText:k,onSelect:M,renderOptions:R,optionContainerClassName:I}=e,O=IC(e,["id","options","values","label","size","rounded","variant","helperText","errorMessage","fullwidth","disabled","error","filterMode","required","onChangeText","onSelect","renderOptions","optionContainerClassName"]);const A=n||`${l}-select`,[L,S]=c(!1),[N,j]=c(i),[D,Z]=c(""),V=r(""),T=r(null);d((()=>{var e;j(null!=i?i:[]),Z(null!==(e=null==i?void 0:i.map((e=>e.label)).join(", "))&&void 0!==e?e:"")}),[i]),d((()=>{const e=e=>{T.current&&!T.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const B=o((e=>{null==k||k(e),Z(e.target.value),e.target.value||_(e)}),[k]),F=o((e=>{const t=N.some((t=>t.value===e.value));let n=[...N];t?n=n.filter((t=>t.value!==e.value)):n.push(e),j(n),Z(n.map((e=>e.label)).join(", ")),null==M||M(n)}),[N,M]),P=s((()=>{const e=null==D?void 0:D.split(",").pop(),t=null!=e?e:"";return a.filter((e=>{var n;return!y||(null===(n=e.label)||void 0===n?void 0:n.toLowerCase().includes(null==t?void 0:t.toLowerCase()))}))}),[a,y,D]),H=o((e=>{var t;S(!0),null===(t=null==O?void 0:O.onFocus)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onFocus]),_=o((e=>{const t=P.filter((t=>{var n,r;return t.value===(null===(n=e.target)||void 0===n?void 0:n.value)||t.label===(null===(r=e.target)||void 0===r?void 0:r.value)}));"Enter"!==V.current&&(j(t),Z(t.map((e=>e.label)).join(", ")),null==M||M(t))}),[P,D]),W=o((e=>{var t;V.current=e.code,null===(t=null==O?void 0:O.onKeyDown)||void 0===t||t.call(O,e)}),[null==O?void 0:O.onKeyDown]),z=JU({size:u,rounded:f,error:b,active:!!i.length,disabled:w}),$="lg"===u?"size-8":"md"===u?"size-[22px]":"size-[18px]";return C("div",{ref:T,className:"relative "+(v?"w-full":""),children:[E(mk,Object.assign({hasClearIcon:!1,endIcon:E(Ek,{type:"heroicons",name:"adjustments-horizontal",variant:"outline",color:"inherit",stroke:"inherit",fill:"transparent",className:$}),classes:{endIconWrapper:z}},O,{ref:t,readOnly:!y,value:D,onChange:B,label:l,placeholder:" ",type:"text",rounded:f,variant:m,helperText:p,errorMessage:g,fullwidth:v,error:b,required:x,id:A,disabled:w,size:u,className:XA({size:u}),onFocus:H,onKeyDown:W})),L&&(R?R({optionsFiltered:P,selectedOptions:N,onClick:F}):C("ul",{className:LC("absolute text-text-g-contrast-high mt-1 w-full bg-modal-surface border border-modal-surface text-text-contrast-low rounded-md shadow-md z-10 max-h-60 overflow-y-auto",I),children:[P.map((e=>e.renderLabel?E(h,{children:e.renderLabel({value:e.value,label:e.label,handleOnClick:()=>F(e),className:"p-4 typography-subtitle4 hover:bg-gray-100 cursor-pointer flex items-center gap-3 "+(N.some((t=>t.value===e.value))?"bg-gray-200":"")})},e.value):C("li",{onMouseDown:()=>F(e),className:"p-4 text-text-g-contrast-high typography-subtitle4 hover:bg-primary-hover-bg cursor-pointer flex items-center gap-3 "+(N.some((t=>t.value===e.value))?"bg-modal-highlight":""),children:[E(LL,{checked:N.some((t=>t.value===e.value))}),e.label]},e.value))),0===P.length&&E("li",{className:"px-4 py-14 text-center text-input-text",children:"Not found"})]}))]})}));function tq(e,[t,n]){return Math.min(n,Math.max(t,e))}var nq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function rq(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var oq=["PageUp","PageDown"],aq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iq={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},lq="Slider",[sq,cq,dq]=function(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},rq(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}(lq),[uq]=nL(lq,[dq]),[fq,hq]=uq(lq),mq=e.forwardRef(((t,n)=>{const{name:r,min:o=0,max:a=100,step:i=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[o],value:u,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:m=!1,form:p,...g}=t,v=e.useRef(new Set),w=e.useRef(0),b="horizontal"===l?vq:wq,[y=[],x]=iL({prop:u,defaultProp:d,onChange:e=>{const t=[...v.current];t[w.current]?.focus(),f(e)}}),C=e.useRef(y);function k(e,t,{commit:n}={commit:!1}){const r=function(e){return(String(e).split(".")[1]||"").length}(i),l=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-o)/i)*i+o,r),s=tq(l,[o,a]);x(((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort(((e,t)=>e-t))}(e,s,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map(((t,n)=>e[n+1]-t))}(e);return Math.min(...n)>=t}return!0}(r,c*i)){w.current=r.indexOf(s);const t=String(r)!==String(e);return t&&n&&h(r),t?r:e}return e}))}return E(fq,{scope:t.__scopeSlider,name:r,disabled:s,min:o,max:a,valueIndexToChangeRef:w,thumbs:v.current,values:y,orientation:l,form:p,children:E(sq.Provider,{scope:t.__scopeSlider,children:E(sq.Slot,{scope:t.__scopeSlider,children:E(b,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:n,onPointerDown:oL(g.onPointerDown,(()=>{s||(C.current=y)})),min:o,max:a,inverted:m,onSlideStart:s?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map((e=>Math.abs(e-t))),r=Math.min(...n);return n.indexOf(r)}(y,e);k(e,t)},onSlideMove:s?void 0:function(e){k(e,w.current)},onSlideEnd:s?void 0:function(){const e=C.current[w.current];y[w.current]!==e&&h(y)},onHomeKeyDown:()=>!s&&k(o,0,{commit:!0}),onEndKeyDown:()=>!s&&k(a,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){const n=oq.includes(e.key)||e.shiftKey&&aq.includes(e.key)?10:1,r=w.current;k(y[r]+i*n*t,r,{commit:!0})}}})})})})}));mq.displayName=lq;var[pq,gq]=uq(lq,{startEdge:"left",endEdge:"right",size:"width",direction:1}),vq=e.forwardRef(((t,n)=>{const{min:r,max:o,dir:a,inverted:i,onSlideStart:l,onSlideMove:s,onSlideEnd:c,onStepKeyDown:d,...u}=t,[f,h]=e.useState(null),m=tL(n,(e=>h(e))),p=e.useRef(),g=FP(a),v="ltr"===g,w=v&&!i||!v&&i;function b(e){const t=p.current||f.getBoundingClientRect(),n=Aq([0,t.width],w?[r,o]:[o,r]);return p.current=t,n(e-t.left)}return E(pq,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:E(bq,{dir:g,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=b(e.clientX);l?.(t)},onSlideMove:e=>{const t=b(e.clientX);s?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{const t=iq[w?"from-left":"from-right"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})})),wq=e.forwardRef(((t,n)=>{const{min:r,max:o,inverted:a,onSlideStart:i,onSlideMove:l,onSlideEnd:s,onStepKeyDown:c,...d}=t,u=e.useRef(null),f=tL(n,u),h=e.useRef(),m=!a;function p(e){const t=h.current||u.current.getBoundingClientRect(),n=Aq([0,t.height],m?[o,r]:[r,o]);return h.current=t,n(e-t.top)}return E(pq,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:E(bq,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=p(e.clientY);i?.(t)},onSlideMove:e=>{const t=p(e.clientY);l?.(t)},onSlideEnd:()=>{h.current=void 0,s?.()},onStepKeyDown:e=>{const t=iq[m?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})})),bq=e.forwardRef(((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:a,onHomeKeyDown:i,onEndKeyDown:l,onStepKeyDown:s,...c}=e,d=hq(lq,n);return E(nq.span,{...c,ref:t,onKeyDown:oL(e.onKeyDown,(e=>{"Home"===e.key?(i(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):oq.concat(aq).includes(e.key)&&(s(e),e.preventDefault())})),onPointerDown:oL(e.onPointerDown,(e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus():r(e)})),onPointerMove:oL(e.onPointerMove,(e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)})),onPointerUp:oL(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))}))})})),yq="SliderTrack",xq=e.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,o=hq(yq,n);return E(nq.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})}));xq.displayName=yq;var Eq="SliderRange",Cq=e.forwardRef(((t,n)=>{const{__scopeSlider:r,...o}=t,a=hq(Eq,r),i=gq(Eq,r),l=tL(n,e.useRef(null)),s=a.values.length,c=a.values.map((e=>Oq(e,a.min,a.max))),d=s>1?Math.min(...c):0,u=100-Math.max(...c);return E(nq.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...o,ref:l,style:{...t.style,[i.startEdge]:d+"%",[i.endEdge]:u+"%"}})}));Cq.displayName=Eq;var kq="SliderThumb",Mq=e.forwardRef(((t,n)=>{const r=cq(t.__scopeSlider),[o,a]=e.useState(null),i=tL(n,(e=>a(e))),l=e.useMemo((()=>o?r().findIndex((e=>e.ref.current===o)):-1),[r,o]);return E(Rq,{...t,ref:i,index:l})})),Rq=e.forwardRef(((t,n)=>{const{__scopeSlider:r,index:o,name:a,...i}=t,l=hq(kq,r),s=gq(kq,r),[c,d]=e.useState(null),u=tL(n,(e=>d(e))),f=!c||(l.form||!!c.closest("form")),h=cL(c),m=l.values[o],p=void 0===m?0:Oq(m,l.min,l.max),g=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(o,l.values.length),v=h?.[s.size],w=v?function(e,t,n){const r=e/2,o=Aq([0,50],[0,r]);return(r-o(t)*n)*n}(v,p,s.direction):0;return e.useEffect((()=>{if(c)return l.thumbs.add(c),()=>{l.thumbs.delete(c)}}),[c,l.thumbs]),C("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${p}% + ${w}px)`},children:[E(sq.ItemSlot,{scope:t.__scopeSlider,children:E(nq.span,{role:"slider","aria-label":t["aria-label"]||g,"aria-valuemin":l.min,"aria-valuenow":m,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...i,ref:u,style:void 0===m?{display:"none"}:t.style,onFocus:oL(t.onFocus,(()=>{l.valueIndexToChangeRef.current=o}))})}),f&&E(Iq,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},o)]})}));Mq.displayName=kq;var Iq=t=>{const{value:n,...r}=t,o=e.useRef(null),a=lL(n);return e.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(a!==n&&r){const t=new Event("input",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[a,n]),E("input",{style:{display:"none"},...r,ref:o,defaultValue:n})};function Oq(e,t,n){return tq(100/(n-t)*(e-t),[0,100])}function Aq(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var Lq=mq,Sq=xq,Nq=Cq,jq=Mq;const Dq=e.forwardRef(((e,t)=>{var{className:n,trackClassName:r,rangeClassName:o,thumbClassName:a,thumbStyle:i,trackStyle:l,rangeStyle:s}=e,c=IC(e,["className","trackClassName","rangeClassName","thumbClassName","thumbStyle","trackStyle","rangeStyle"]);return C(Lq,Object.assign({ref:t,className:LC("relative flex w-full touch-none select-none items-center",n)},c,{children:[E(Sq,{className:LC("relative h-2 w-full grow overflow-hidden rounded-full bg-grey-50",r),style:l,children:E(Nq,{className:LC("absolute h-full bg-primary",o),style:s})}),E(jq,{className:LC("block h-5 w-5 cursor-pointer rounded-full border-[3px] border-primary bg-bg-bg1 outline-none ring-0 transition-colors disabled:pointer-events-none disabled:opacity-50",a),style:i})]}))}));Dq.displayName=Lq.displayName;var Zq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});var Vq,Tq="dismissableLayer.update",Bq="dismissableLayer.pointerDownOutside",Fq="dismissableLayer.focusOutside",Pq=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hq=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(Pq),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){Wq(Bq,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){Wq(Fq,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Vq=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),_q(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Vq)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),_q())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(Tq,e),()=>document.removeEventListener(Tq,e)}),[]),E(Zq.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));Hq.displayName="DismissableLayer";function _q(){const e=new CustomEvent(Tq);document.dispatchEvent(e)}function Wq(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}e.forwardRef(((t,n)=>{const r=e.useContext(Pq),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(Zq.div,{...t,ref:a})})).displayName="DismissableLayerBranch";var zq=e.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return E(Zq.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E("polygon",{points:"0,0 30,0 15,10"})})}));zq.displayName="Arrow";var $q=zq;function Uq(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var qq="Popper",[Gq,Yq]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Uq(o,...n)]}(qq),[Kq,Xq]=Gq(qq),Qq=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return E(Kq,{scope:n,anchor:o,onAnchorChange:a,children:r})};Qq.displayName=qq;var Jq="PopperAnchor",eG=e.forwardRef(((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=Xq(Jq,r),l=e.useRef(null),s=tL(n,l);return e.useEffect((()=>{i.onAnchorChange(o?.current||l.current)})),o?null:E(Zq.div,{...a,ref:s})}));eG.displayName=Jq;var tG="PopperContent",[nG,rG]=Gq(tG),oG=e.forwardRef(((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=t,v=Xq(tG,r),[w,b]=e.useState(null),y=tL(n,(e=>b(e))),[x,C]=e.useState(null),k=cL(x),M=k?.width??0,R=k?.height??0,I=o+("center"!==i?"-"+i:""),O="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],L=A.length>0,S={padding:O,boundary:A.filter(sG),altBoundary:L},{refs:N,floatingStyles:j,placement:D,isPositioned:Z,middlewareData:V}=RO({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>uO(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[OO({mainAxis:a+R,alignmentAxis:l}),c&&AO({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?LO():void 0,...S}),c&&SO({...S}),NO({...S,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),x&&DO({element:x,padding:s}),cG({arrowWidth:M,arrowHeight:R}),h&&jO({strategy:"referenceHidden",...S})]}),[T,B]=dG(D),F=aL(p);sL((()=>{Z&&F?.()}),[Z,F]);const P=V.arrow?.x,H=V.arrow?.y,_=0!==V.arrow?.centerOffset,[W,z]=e.useState();return sL((()=>{w&&z(window.getComputedStyle(w).zIndex)}),[w]),E("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:Z?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:E(nG,{scope:r,placedSide:T,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:_,children:E(Zq.div,{"data-side":T,"data-align":B,...g,ref:y,style:{...g.style,animation:Z?void 0:"none"}})})})}));oG.displayName=tG;var aG="PopperArrow",iG={top:"bottom",right:"left",bottom:"top",left:"right"},lG=e.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=rG(aG,n),a=iG[o.placedSide];return E("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E($q,{...r,ref:t,style:{...r.style,display:"block"}})})}));function sG(e){return null!==e}lG.displayName=aG;var cG=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,c]=dG(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+l/2;let h="",m="";return"bottom"===s?(h=a?d:`${u}px`,m=-l+"px"):"top"===s?(h=a?d:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",m=a?d:`${f}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?d:`${f}px`),{data:{x:h,y:m}}}});function dG(e){const[t,n="center"]=e.split("-");return[t,n]}var uG=Qq,fG=eG,hG=oG,mG=lG;var pG=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=gG(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=gG(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=gG(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=gG(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function gG(e){return e?.animationName||"none"}pG.displayName="Presence";var vG=e.forwardRef(((e,t)=>E(Zq.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));vG.displayName="VisuallyHidden";var wG=vG,[bG]=nL("Tooltip",[Yq]),yG=Yq(),xG="TooltipProvider",EG=700,CG="tooltip.open",[kG,MG]=bG(xG),RG=t=>{const{__scopeTooltip:n,delayDuration:r=EG,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=t,[l,s]=e.useState(!0),c=e.useRef(!1),d=e.useRef(0);return e.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),E(kG,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:e.useCallback((()=>{window.clearTimeout(d.current),s(!1)}),[]),onClose:e.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>s(!0)),o)}),[o]),isPointerInTransitRef:c,onPointerInTransitChange:e.useCallback((e=>{c.current=e}),[]),disableHoverableContent:a,children:i})};RG.displayName=xG;var IG="Tooltip",[OG,AG]=bG(IG),LG=t=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:a=!1,onOpenChange:i,disableHoverableContent:l,delayDuration:s}=t,c=MG(IG,t.__scopeTooltip),d=yG(n),[u,f]=e.useState(null),h=Gj(),m=e.useRef(0),p=l??c.disableHoverableContent,g=s??c.delayDuration,v=e.useRef(!1),[w=!1,b]=iL({prop:o,defaultProp:a,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(CG))):c.onClose(),i?.(e)}}),y=e.useMemo((()=>w?v.current?"delayed-open":"instant-open":"closed"),[w]),x=e.useCallback((()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,b(!0)}),[b]),C=e.useCallback((()=>{window.clearTimeout(m.current),m.current=0,b(!1)}),[b]),k=e.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{v.current=!0,b(!0),m.current=0}),g)}),[g,b]);return e.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),E(uG,{...d,children:E(OG,{scope:n,contentId:h,open:w,stateAttribute:y,trigger:u,onTriggerChange:f,onTriggerEnter:e.useCallback((()=>{c.isOpenDelayed?k():x()}),[c.isOpenDelayed,k,x]),onTriggerLeave:e.useCallback((()=>{p?C():(window.clearTimeout(m.current),m.current=0)}),[C,p]),onOpen:x,onClose:C,disableHoverableContent:p,children:r})})};LG.displayName=IG;var SG="TooltipTrigger",NG=e.forwardRef(((t,n)=>{const{__scopeTooltip:r,...o}=t,a=AG(SG,r),i=MG(SG,r),l=yG(r),s=tL(n,e.useRef(null),a.onTriggerChange),c=e.useRef(!1),d=e.useRef(!1),u=e.useCallback((()=>c.current=!1),[]);return e.useEffect((()=>()=>document.removeEventListener("pointerup",u)),[u]),E(fG,{asChild:!0,...l,children:E(Zq.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:s,onPointerMove:oL(t.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),d.current=!0))})),onPointerLeave:oL(t.onPointerLeave,(()=>{a.onTriggerLeave(),d.current=!1})),onPointerDown:oL(t.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:oL(t.onFocus,(()=>{c.current||a.onOpen()})),onBlur:oL(t.onBlur,a.onClose),onClick:oL(t.onClick,a.onClose)})})}));NG.displayName=SG;var[jG,DG]=bG("TooltipPortal",{forceMount:void 0}),ZG="TooltipContent",VG=e.forwardRef(((e,t)=>{const n=DG(ZG,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=AG(ZG,e.__scopeTooltip);return E(pG,{present:r||i.open,children:i.disableHoverableContent?E(PG,{side:o,...a,ref:t}):E(TG,{side:o,...a,ref:t})})})),TG=e.forwardRef(((t,n)=>{const r=AG(ZG,t.__scopeTooltip),o=MG(ZG,t.__scopeTooltip),a=e.useRef(null),i=tL(n,a),[l,s]=e.useState(null),{trigger:c,onClose:d}=r,u=a.current,{onPointerInTransitChange:f}=o,h=e.useCallback((()=>{s(null),f(!1)}),[f]),m=e.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);s(a),f(!0)}),[f]);return e.useEffect((()=>()=>h()),[h]),e.useEffect((()=>{if(c&&u){const e=e=>m(e,u),t=e=>m(e,c);return c.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[c,u,m,h]),e.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e].x,l=t[e].y,s=t[a].x,c=t[a].y;l>r!=c>r&&n<(s-i)*(r-l)/(c-l)+i&&(o=!o)}return o}(n,l);r?h():o&&(h(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,u,l,d,h]),E(PG,{...t,ref:i})})),[BG,FG]=bG(IG,{isInside:!1}),PG=e.forwardRef(((t,n)=>{const{__scopeTooltip:r,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...s}=t,c=AG(ZG,r),d=yG(r),{onClose:u}=c;return e.useEffect((()=>(document.addEventListener(CG,u),()=>document.removeEventListener(CG,u))),[u]),e.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,u]),E(Hq,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:C(hG,{"data-state":c.stateAttribute,...d,...s,ref:n,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E(mL,{children:o}),E(BG,{scope:r,isInside:!0,children:E(wG,{id:c.contentId,role:"tooltip",children:a||o})})]})})}));VG.displayName=ZG;var HG="TooltipArrow",_G=e.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,o=yG(n);return FG(HG,n).isInside?null:E(mG,{...o,...r,ref:t})}));_G.displayName=HG;var WG=VG;const zG=RG,$G=LG,UG=NG,qG=_G,GG=e.forwardRef(((e,t)=>{var{className:n,sideOffset:r=4}=e,o=IC(e,["className","sideOffset"]);return E(WG,Object.assign({ref:t,sideOffset:r,className:LC("z-50 overflow-hidden rounded-md bg-common-black px-3 py-1.5 typography-buttonMS text-common-white shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n)},o))}));function YG(e){var{children:t,content:n,open:r,defaultOpen:o,onOpenChange:a}=e,i=IC(e,["children","content","open","defaultOpen","onOpenChange"]);return E(zG,{children:C($G,{open:r,defaultOpen:o,onOpenChange:a,children:[E(UG,{asChild:!0,children:t}),C(GG,Object.assign({side:"top",align:"center"},i,{children:[n,E(qG,{width:11,height:5})]}))]})})}function KG(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}GG.displayName=WG.displayName;var XG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function QG(e,t){e&&I.flushSync((()=>e.dispatchEvent(t)))}var JG,eY="dismissableLayer.update",tY="dismissableLayer.pointerDownOutside",nY="dismissableLayer.focusOutside",rY=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oY=e.forwardRef(((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...c}=t,d=e.useContext(rY),[u,f]=e.useState(null),h=u?.ownerDocument??globalThis?.document,[,m]=e.useState({}),p=tL(n,(e=>f(e))),g=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),b=u?g.indexOf(u):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,C=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1),a=e.useRef((()=>{}));return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let t=function(){lY(tY,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout((()=>{n.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}}),[n,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));x&&!n&&(a?.(e),l?.(e),e.defaultPrevented||s?.())}),h),k=function(t,n=globalThis?.document){const r=aL(t),o=e.useRef(!1);return e.useEffect((()=>{const e=e=>{if(e.target&&!o.current){lY(nY,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)}),[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(i?.(e),l?.(e),e.defaultPrevented||s?.())}),h);return kj((e=>{b===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),h),e.useEffect((()=>{if(u)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(JG=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),iY(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=JG)}}),[u,h,r,d]),e.useEffect((()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),iY())}),[u,d]),e.useEffect((()=>{const e=()=>m({});return document.addEventListener(eY,e),()=>document.removeEventListener(eY,e)}),[]),E(XG.div,{...c,ref:p,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:oL(t.onFocusCapture,k.onFocusCapture),onBlurCapture:oL(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:oL(t.onPointerDownCapture,C.onPointerDownCapture)})}));oY.displayName="DismissableLayer";var aY=e.forwardRef(((t,n)=>{const r=e.useContext(rY),o=e.useRef(null),a=tL(n,o);return e.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),E(XG.div,{...t,ref:a})}));function iY(){const e=new CustomEvent(eY);document.dispatchEvent(e)}function lY(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?QG(o,a):o.dispatchEvent(a)}aY.displayName="DismissableLayerBranch";var sY=oY,cY=aY,dY=e.forwardRef(((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);sL((()=>i(!0)),[]);const l=r||a&&globalThis?.document?.body;return l?O.createPortal(E(XG.div,{...o,ref:n}),l):null}));dY.displayName="Portal";var uY=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=fY(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=fY(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=fY(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=fY(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function fY(e){return e?.animationName||"none"}uY.displayName="Presence";var hY=e.forwardRef(((e,t)=>E(XG.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));hY.displayName="VisuallyHidden";var mY="ToastProvider",[pY,gY,vY]=function(n){const r=n+"CollectionProvider",[o,a]=function(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},KG(o,...n)]}(r),[i,l]=o(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return E(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=r;const c=n+"CollectionSlot",d=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,l(c,n).collectionRef);return E(fL,{ref:o,children:r})}));d.displayName=c;const u=n+"CollectionItemSlot",f="data-radix-collection-item",h=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,i=t.useRef(null),s=tL(n,i),c=l(u,r);return t.useEffect((()=>(c.itemMap.set(i,{ref:i,...a}),()=>{c.itemMap.delete(i)}))),E(fL,{[f]:"",ref:s,children:o})}));return h.displayName=u,[{Provider:s,Slot:d,ItemSlot:h},function(e){const r=l(n+"CollectionConsumer",e),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},a]}("Toast"),[wY]=nL("Toast",[vY]),[bY,yY]=wY(mY),xY=t=>{const{__scopeToast:n,label:r="Notification",duration:o=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:l}=t,[s,c]=e.useState(null),[d,u]=e.useState(0),f=e.useRef(!1),h=e.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${mY}\`. Expected non-empty \`string\`.`),E(pY.Provider,{scope:n,children:E(bY,{scope:n,label:r,duration:o,swipeDirection:a,swipeThreshold:i,toastCount:d,viewport:s,onViewportChange:c,onToastAdd:e.useCallback((()=>u((e=>e+1))),[]),onToastRemove:e.useCallback((()=>u((e=>e-1))),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:l})})};xY.displayName=mY;var EY="ToastViewport",CY=["F8"],kY="toast.viewportPause",MY="toast.viewportResume",RY=e.forwardRef(((t,n)=>{const{__scopeToast:r,hotkey:o=CY,label:a="Notifications ({hotkey})",...i}=t,l=yY(EY,r),s=gY(r),c=e.useRef(null),d=e.useRef(null),u=e.useRef(null),f=e.useRef(null),h=tL(n,f,l.onViewportChange),m=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=l.toastCount>0;e.useEffect((()=>{const e=e=>{0!==o.length&&o.every((t=>e[t]||e.code===t))&&f.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[o]),e.useEffect((()=>{const e=c.current,t=f.current;if(p&&e&&t){const n=()=>{if(!l.isClosePausedRef.current){const e=new CustomEvent(kY);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(MY);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},o=t=>{!e.contains(t.relatedTarget)&&r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener("focusin",n),e.addEventListener("focusout",o),e.addEventListener("pointermove",n),e.addEventListener("pointerleave",a),window.addEventListener("blur",n),window.addEventListener("focus",r),()=>{e.removeEventListener("focusin",n),e.removeEventListener("focusout",o),e.removeEventListener("pointermove",n),e.removeEventListener("pointerleave",a),window.removeEventListener("blur",n),window.removeEventListener("focus",r)}}}),[p,l.isClosePausedRef]);const g=e.useCallback((({tabbingDirection:e})=>{const t=s().map((t=>{const n=t.ref.current,r=[n,...$Y(n)];return"forwards"===e?r:r.reverse()}));return("forwards"===e?t.reverse():t).flat()}),[s]);return e.useEffect((()=>{const e=f.current;if(e){const t=t=>{const n=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!n){const n=document.activeElement,r=t.shiftKey;if(t.target===e&&r)return void d.current?.focus();const o=g({tabbingDirection:r?"backwards":"forwards"}),a=o.findIndex((e=>e===n));UY(o.slice(a+1))?t.preventDefault():r?d.current?.focus():u.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}}),[s,g]),C(cY,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&E(OY,{ref:d,onFocusFromOutsideViewport:()=>{UY(g({tabbingDirection:"forwards"}))}}),E(pY.Slot,{scope:r,children:E(XG.ol,{tabIndex:-1,...i,ref:h})}),p&&E(OY,{ref:u,onFocusFromOutsideViewport:()=>{UY(g({tabbingDirection:"backwards"}))}})]})}));RY.displayName=EY;var IY="ToastFocusProxy",OY=e.forwardRef(((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,a=yY(IY,n);return E(hY,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!a.viewport?.contains(t)&&r()}})}));OY.displayName=IY;var AY="Toast",LY=e.forwardRef(((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...i}=e,[l=!0,s]=iL({prop:r,defaultProp:o,onChange:a});return E(uY,{present:n||l,children:E(jY,{open:l,...i,ref:t,onClose:()=>s(!1),onPause:aL(e.onPause),onResume:aL(e.onResume),onSwipeStart:oL(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:oL(e.onSwipeMove,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${n}px`)})),onSwipeCancel:oL(e.onSwipeCancel,(e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")})),onSwipeEnd:oL(e.onSwipeEnd,(e=>{const{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${n}px`),s(!1)}))})})}));LY.displayName=AY;var[SY,NY]=wY(AY,{onClose(){}}),jY=e.forwardRef(((t,n)=>{const{__scopeToast:r,type:o="foreground",duration:a,open:i,onClose:l,onEscapeKeyDown:s,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...p}=t,g=yY(AY,r),[v,w]=e.useState(null),b=tL(n,(e=>w(e))),y=e.useRef(null),x=e.useRef(null),M=a||g.duration,R=e.useRef(0),O=e.useRef(M),A=e.useRef(0),{onToastAdd:L,onToastRemove:S}=g,N=aL((()=>{const e=v?.contains(document.activeElement);e&&g.viewport?.focus(),l()})),j=e.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(A.current),R.current=(new Date).getTime(),A.current=window.setTimeout(N,e))}),[N]);e.useEffect((()=>{const e=g.viewport;if(e){const t=()=>{j(O.current),d?.()},n=()=>{const e=(new Date).getTime()-R.current;O.current=O.current-e,window.clearTimeout(A.current),c?.()};return e.addEventListener(kY,n),e.addEventListener(MY,t),()=>{e.removeEventListener(kY,n),e.removeEventListener(MY,t)}}}),[g.viewport,M,c,d,j]),e.useEffect((()=>{i&&!g.isClosePausedRef.current&&j(M)}),[i,M,g.isClosePausedRef,j]),e.useEffect((()=>(L(),()=>S())),[L,S]);const D=e.useMemo((()=>v?_Y(v):null),[v]);return g.viewport?C(k,{children:[D&&E(DY,{__scopeToast:r,role:"status","aria-live":"foreground"===o?"assertive":"polite","aria-atomic":!0,children:D}),E(SY,{scope:r,onClose:N,children:I.createPortal(E(pY.ItemSlot,{scope:r,children:E(sY,{asChild:!0,onEscapeKeyDown:oL(s,(()=>{g.isFocusedToastEscapeKeyDownRef.current||N(),g.isFocusedToastEscapeKeyDownRef.current=!1})),children:E(XG.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...p,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:oL(t.onKeyDown,(e=>{"Escape"===e.key&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,N()))})),onPointerDown:oL(t.onPointerDown,(e=>{0===e.button&&(y.current={x:e.clientX,y:e.clientY})})),onPointerMove:oL(t.onPointerMove,(e=>{if(!y.current)return;const t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=Boolean(x.current),o=["left","right"].includes(g.swipeDirection),a=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,i=o?a(0,t):0,l=o?0:a(0,n),s="touch"===e.pointerType?10:2,c={x:i,y:l},d={originalEvent:e,delta:c};r?(x.current=c,WY("toast.swipeMove",f,d,{discrete:!1})):zY(c,g.swipeDirection,s)?(x.current=c,WY("toast.swipeStart",u,d,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>s||Math.abs(n)>s)&&(y.current=null)})),onPointerUp:oL(t.onPointerUp,(e=>{const t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,y.current=null,t){const n=e.currentTarget,r={originalEvent:e,delta:t};zY(t,g.swipeDirection,g.swipeThreshold)?WY("toast.swipeEnd",m,r,{discrete:!0}):WY("toast.swipeCancel",h,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),g.viewport)})]}):null})),DY=t=>{const{__scopeToast:n,children:r,...o}=t,a=yY(AY,n),[i,l]=e.useState(!1),[s,c]=e.useState(!1);return function(e=()=>{}){const t=aL(e);sL((()=>{let e=0,n=0;return e=window.requestAnimationFrame((()=>n=window.requestAnimationFrame(t))),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}}),[t])}((()=>l(!0))),e.useEffect((()=>{const e=window.setTimeout((()=>c(!0)),1e3);return()=>window.clearTimeout(e)}),[]),s?null:E(dY,{asChild:!0,children:E(hY,{...o,children:i&&C(k,{children:[a.label," ",r]})})})},ZY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e;return E(XG.div,{...r,ref:t})}));ZY.displayName="ToastTitle";var VY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e;return E(XG.div,{...r,ref:t})}));VY.displayName="ToastDescription";var TY="ToastAction",BY=e.forwardRef(((e,t)=>{const{altText:n,...r}=e;return n.trim()?E(HY,{altText:n,asChild:!0,children:E(PY,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${TY}\`. Expected non-empty \`string\`.`),null)}));BY.displayName=TY;var FY="ToastClose",PY=e.forwardRef(((e,t)=>{const{__scopeToast:n,...r}=e,o=NY(FY,n);return E(HY,{asChild:!0,children:E(XG.button,{type:"button",...r,ref:t,onClick:oL(e.onClick,o.onClose)})})}));PY.displayName=FY;var HY=e.forwardRef(((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return E(XG.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})}));function _Y(e){const t=[];return Array.from(e.childNodes).forEach((e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),function(e){return e.nodeType===e.ELEMENT_NODE}(e)){const n=e.ariaHidden||e.hidden||"none"===e.style.display,r=""===e.dataset.radixToastAnnounceExclude;if(!n)if(r){const n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(..._Y(e))}})),t}function WY(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?QG(o,a):o.dispatchEvent(a)}var zY=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),a=r>o;return"left"===t||"right"===t?a&&r>n:!a&&o>n};function $Y(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function UY(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var qY=xY,GY=RY,YY=LY,KY=ZY,XY=VY,QY=BY,JY=PY;const eK=M(["group pointer-events-auto relative flex w-full","rounded-lg shadow-[0px_8px_16px_0px_rgba(0,0,0,0.08)] px-4 py-3 gap-1","transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full","bg-modal-surface text-text-contrast-low"],{variants:{variant:{default:"",success:"",info:"",warning:"",error:""},showBorder:{true:"",false:"border-transparent"}},compoundVariants:[{variant:"default",showBorder:!0,className:"border"},{variant:"success",showBorder:!0,className:"border border-success-stroke"},{variant:"info",showBorder:!0,className:"border border-info-stroke"},{variant:"warning",showBorder:!0,className:"border border-warning-stroke"},{variant:"error",showBorder:!0,className:"border border-error-stroke"}],defaultVariants:{variant:"success",showBorder:!1}}),tK=M(["fixed z-[1000] flex w-auto flex-col-reverse px-4"],{variants:{position:{"top-center":"top-[40px] left-0 right-0 justify-self-center","top-left":"top-[40px] left-0 md:left-[40px]","top-right":"top-[40px] right-0 md:right-[40px]","bottom-center":"bottom-[40px] left-0 right-0 justify-self-center","bottom-left":"bottom-[40px] left-0 md:left-[40px]","bottom-right":"bottom-[40px] right-0 md:right-[40px]"}},defaultVariants:{position:"top-center"}}),nK=M(["flex items-center justify-center mr-2 rounded-full size-7"],{variants:{variant:{default:"text-text-g-contrast-high",success:"bg-success-transparent-8 text-success",info:"bg-info-transparent-8 text-info",warning:"bg-warning-transparent-8 text-warning",error:"bg-error-transparent-8 text-error"}},defaultVariants:{variant:"success"}}),rK=M(["flex flex-1"],{variants:{contentMode:{horizontal:"items-center flex-row gap-2",vertical:"items-start flex-col gap-0"}},defaultVariants:{contentMode:"vertical"}}),oK=qY,aK=e.forwardRef(((e,t)=>{var{className:n,position:r}=e,o=IC(e,["className","position"]);return E(GY,Object.assign({ref:t,className:LC(tK({position:r}),n)},o))}));aK.displayName=GY.displayName;const iK=e.forwardRef(((e,t)=>{var{className:n,variant:r,showBorder:o}=e,a=IC(e,["className","variant","showBorder"]);return E(YY,Object.assign({ref:t,className:LC(eK({variant:r,showBorder:o}),n)},a))}));iK.displayName=YY.displayName;const lK=e.forwardRef(((e,t)=>{var{className:n,children:r}=e,o=IC(e,["className","children"]);return E(QY,Object.assign({ref:t,className:LC("",n)},o,{asChild:!0,children:E(NC,{variant:"outline",color:"secondary",size:"sm",children:r})}))}));lK.displayName=QY.displayName;const sK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(JY,Object.assign({ref:t,className:LC("self-center text-text-g-contrast-high",n),"toast-close":""},r,{asChild:!0,children:E(Zk,{variant:"icon",size:"sm",children:E(Ek,{type:"heroicons",name:"xmark"})})}))}));sK.displayName=JY.displayName;const cK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(KY,Object.assign({ref:t,className:LC("typography-subtitle6",n)},r))}));cK.displayName=KY.displayName;const dK=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(XY,Object.assign({ref:t,className:LC("typography-subtitle4 text-text-g-contrast-high",n)},r))}));dK.displayName=XY.displayName;let uK=0;const fK=new Map,hK=e=>{if(fK.has(e))return;const t=setTimeout((()=>{fK.delete(e),vK({type:"REMOVE_TOAST",toastId:e})}),3e3);fK.set(e,t)},mK=(e,t)=>{switch(t.type){case"ADD_TOAST":return Object.assign(Object.assign({},e),{toasts:[t.toast,...e.toasts].slice(0,1)});case"UPDATE_TOAST":return Object.assign(Object.assign({},e),{toasts:e.toasts.map((e=>e.id===t.toast.id?Object.assign(Object.assign({},e),t.toast):e))});case"DISMISS_TOAST":{const{toastId:n}=t;return n?hK(n):e.toasts.forEach((e=>{hK(e.id)})),Object.assign(Object.assign({},e),{toasts:e.toasts.map((e=>e.id===n||void 0===n?Object.assign(Object.assign({},e),{open:!1}):e))})}case"REMOVE_TOAST":return void 0===t.toastId?Object.assign(Object.assign({},e),{toasts:[]}):Object.assign(Object.assign({},e),{toasts:e.toasts.filter((e=>e.id!==t.toastId))});case"ADD_POSITION":return Object.assign(Object.assign({},e),{position:t.position})}},pK=[];let gK={toasts:[],position:void 0};function vK(e){gK=mK(gK,e),pK.forEach((e=>{e(gK)}))}function wK(e){var t=IC(e,[]);const n=(uK=(uK+1)%Number.MAX_SAFE_INTEGER,uK.toString()),r=()=>vK({type:"DISMISS_TOAST",toastId:n});return vK({type:"ADD_TOAST",toast:Object.assign(Object.assign({},t),{id:n,open:!0,onOpenChange:e=>{var n;e||(r(),null===(n=null==t?void 0:t.onClose)||void 0===n||n.call(t))}})}),{id:n,dismiss:r,update:e=>vK({type:"UPDATE_TOAST",toast:Object.assign(Object.assign({},e),{id:n})})}}function bK(t){const[n,r]=e.useState(gK);return e.useEffect((()=>(pK.push(r),()=>{const e=pK.indexOf(r);e>-1&&pK.splice(e,1)})),[n]),e.useEffect((()=>{vK({type:"ADD_POSITION",position:null==t?void 0:t.position})}),[null==t?void 0:t.position]),Object.assign(Object.assign({},n),{toast:wK,dismiss:e=>vK({type:"DISMISS_TOAST",toastId:e})})}function yK(e){var{viewportClassName:t,titleClassName:n,descriptionClassName:r,contentClassName:o,iconWrapperClassName:a,actionWrapperClassName:i}=e,l=IC(e,["viewportClassName","titleClassName","descriptionClassName","contentClassName","iconWrapperClassName","actionWrapperClassName"]);const{toasts:s,position:c}=bK();return C(oK,Object.assign({},l,{children:[s.map((function(e){var{id:t,title:l,description:s,action:c,contentMode:d="horizontal",iconProps:u,renderIcon:f}=e,h=IC(e,["id","title","description","action","contentMode","iconProps","renderIcon"]);const m="error"===h.variant?"circle-x":"warning"===h.variant?"circle-alert":"info"===h.variant?"info":"circle-check",p="error"===h.variant?"text-error":"warning"===h.variant?"text-warning":"info"===h.variant?"text-info":"success"===h.variant?"text-success":"text-text-g-contrast-high";return C(iK,Object.assign({},h,{children:[E("div",{className:LC(nK({variant:h.variant}),a),children:f?null==f?void 0:f():E(Ek,Object.assign({type:"lucide",name:m,className:"size-[22px]"},u))}),C("div",{className:LC(rK({contentMode:d}),o),children:[l&&E(cK,{className:LC(p,n),children:l}),s&&E(dK,{className:r,children:s})]}),c?E("div",{className:LC("self-center mx-5",i),children:c}):null,E(sK,{})]}),t)})),E(aK,{position:c,className:t})]}))}const xK=({id:e,title:t,classes:n,children:r,isFirstLevel:a=!1,isLeaf:i=!1,disabled:l,icon:c,showIcon:u,showExpandButton:f,enableSeparatorLine:h=!0,isLastItem:m,checkable:p,checkIsExpanded:g,checkIsChecked:v,checkAutoDisabled:w,checkIsLoading:b,onExpandChange:y,onCheckedChange:x,onClickItem:k,renderIcon:M,renderElement:R,renderTitle:I,renderRightSection:O,lineSize:A=2,horizontalLineWidth:L=4,expandButtonSize:S=30,spacing:N=2,currentLevel:j=1,maxLevel:D=10,notifyClickItem:Z,itemData:V})=>{const T=s((()=>null==b?void 0:b(e)),[b,e]),B=s((()=>v(e)),[v,e]),F=s((()=>g(e)),[g,e]),P=s((()=>!!(null==r?void 0:r.length)),[r]),H=s((()=>(void 0!==f?f:P)&&j<(D||1/0)),[P,f,D,j]),_=s((()=>!!p&&!i),[p,i]),W=i?21.328:0,z=s((()=>({branch:{width:A,borderBottomLeftRadius:m?A/2:0},horizontalLine:{height:A,width:A+L+(H?0:S+N)+W,marginLeft:-A,borderBottomLeftRadius:A/2},expandButton:{width:S,height:S},childPadding:{paddingLeft:a?S/2-A/2:S/2+L-A/2}})),[A,L,S,N,a,m,H,W]),$=o((()=>{null==y||y(e,!F,V)}),[e,F,y,V]);d((()=>{!F||T||P||$()}),[T,$]);const U=o((()=>{null==k||k(e,V),null==Z||Z(e,V)}),[e,F,k,Z,V]),q=E(Ek,{name:F?"folder-open":"folder",className:"fill-warning size-[18px]"}),G=null!=c?c:null==M?void 0:M({id:e,expanded:F,selected:B}),Y=null==O?void 0:O({id:e,expanded:F,selected:B}),K=I?I({id:e,title:t,expanded:F,selected:B}):t;return X=E("div",{className:LC("flex flex-row w-full",null==n?void 0:n.elementWrapper),children:C("div",{className:LC("flex flex-col w-full",null==n?void 0:n.itemWrapper),children:[C("div",{className:LC("flex flex-row flex-1",null==n?void 0:n.rowWrapperClasses),children:[C("div",{className:LC("flex flex-col h-full",null==n?void 0:n.columnWrapperClasses),children:[!a&&E("div",{className:LC("flex w-[2px] h-1/2 bg-grey-150",null==n?void 0:n.branch),style:z.branch}),!a&&!m&&(F&&(P||T)||!F)&&E("div",{className:LC("flex w-[2px] h-1/2 bg-grey-150",null==n?void 0:n.branch),style:z.branch})]}),C("div",{className:LC("flex flex-1 items-center py-2 min-h-10",null==n?void 0:n.itemContainer),children:[!a&&E("div",{className:LC("bg-grey-150",null==n?void 0:n.horizontalLine),style:z.horizontalLine}),a&&!H&&E("div",{className:LC("flex mr-[2px]",null==n?void 0:n.expandButton),style:z.expandButton}),H&&E("div",{className:LC("flex mr-[2px]",null==n?void 0:n.expandButton),style:z.expandButton,onClick:!T&&$,children:E(Zk,{variant:"icon",size:"sm",children:T?E(SC,{}):E(Ek,{name:F?"chevron-down":"chevron-right"})})}),_?E(LL,{id:e,className:LC("size-[16px]",null==n?void 0:n.checkbox),checked:B,disabled:l,onCheckedChange:t=>null==x?void 0:x(e,t,V)}):E("div",{className:a&&p?LC("size-[16px]",null==n?void 0:n.checkbox):""}),C("div",{className:LC("ml-2 gap-1 flex flex-1 items-center text-common-black",null==n?void 0:n.item),onClick:U,children:[u?G||q:null,E("div",{className:LC("flex flex-1 cursor-pointer text-subtitle5 text-ellipsis overflow-hidden break-all text-left",null==n?void 0:n.title),children:K})]}),Y]})]}),F&&P&&j<(D||1/0)&&C("div",{className:LC("flex flex-row overflow-hidden",null==n?void 0:n.expandedChildrenWrapper),children:[!a&&!m&&E("div",{className:LC("flex w-[2px] h-full bg-grey-150",null==n?void 0:n.branch),style:z.branch}),E("div",{className:LC("flex flex-col overflow-hidden",null==n?void 0:n.expandedChildrenWrapperInner),style:z.childPadding,children:null==r?void 0:r.map(((e,t)=>E(xK,Object.assign({classes:n,isLastItem:t===r.length-1,checkIsExpanded:g,checkIsChecked:v,checkAutoDisabled:w,checkIsLoading:b,onExpandChange:y,onCheckedChange:x,renderIcon:M,renderElement:R,renderTitle:I,disabled:w(e.id),showIcon:u,lineSize:A,horizontalLineWidth:L,expandButtonSize:S,spacing:N,notifyClickItem:Z,maxLevel:D,currentLevel:j+1,checkable:p},e),e.id)))})]}),h&&a&&!m&&E("div",{className:LC("bg-grey-150 w-full h-[2px] rounded",null==n?void 0:n.separatorLine)})]})}),R?R({id:e,expanded:F,selected:B,children:X,styles:z,onClick:U}):X;var X};function EK(e){const t=r();return d((()=>{t.current=e})),t.current}const CK=({classes:e,data:t,defaultExpandedId:n,defaultCheckedId:r,checkedId:a,loadingId:i,lineSize:l,horizontalLineWidth:s,expandButtonSize:u,spacing:f,renderIcon:h,renderRightSection:m,renderElement:p,renderTitle:g,onExpandChange:v,onCheckedChange:w,onClickItem:b,onCheckedItem:y,defaultExpandAll:x=!1,defaultCheckAll:C=!1,hierarchicalCheck:k=!1,showIcon:M=!0,disabled:R,enableSeparatorLine:I=!0,checkable:O=!0,maxLevel:A,mode:L="checkbox",autoDisabled:S=!1,checkedAll:N=!1})=>{const[j,D]=c({}),[Z,V]=c({}),T=(e,t)=>{e.forEach((e=>{t(e),e.children&&T(e.children,t)}))};d((()=>{if(t.length&&x){const e={};T(t,(t=>{e[t.id]=!0})),V(e)}else if(null==n?void 0:n.length){const e=n.reduce(((e,t)=>(e[t]=!0,e)),{});V(e)}}),[t,n,x]),d((()=>{var e;if(t.length&&C){const e={};T(t,(t=>{e[t.id]=!0})),D(e)}else if(0===(null===(e=Object.keys(j))||void 0===e?void 0:e.length)&&(null==r?void 0:r.length)){const e=r.reduce(((e,t)=>(e[t]=!0,e)),{});D(e)}}),[t,r,C]),d((()=>{void 0!==a&&D(a.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:!0})),{}))}),[a]),d((()=>{if(!k)return;const e={},n=(r,o)=>{T(t,(t=>{t.id===r&&t.children&&t.children.forEach((t=>{e[t.id]=o,n(t.id,o)}))}))};D((t=>(Object.keys(t).filter((e=>t[e])).map((e=>{n(e,!0)})),Object.assign(Object.assign({},t),e))))}),[t,k]);const B=EK(N);d((()=>{if(void 0!==B&&B!==N)if(N){const e={};T(t,(t=>{t.id&&(e[t.id]=!0)})),D(e),null==w||w(e,void 0,null)}else{let e={};D((t=>(e=Object.keys(t).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:!1})),{}),e))),null==w||w(e,void 0,null)}}),[t,N,B]);const F=o(((e,t,n)=>{null==v||v(e,t,n),V((n=>Object.assign(Object.assign({},n),{[e]:t})))}),[v]),P=o(((e,n,r)=>{if("radio"===L){let t={[e]:n};return null==y||y(e,n,r),D(t),void(null==w||w(t,e,r))}null==y||y(e,n,r);let o=Object.assign(Object.assign({},j),{[e]:n});if(k){o=((e,n,r)=>{r[e]=n;const o=(e,n)=>{T(t,(t=>{t.id===e&&t.children&&t.children.forEach((e=>{r[e.id]=n,o(e.id,n)}))}))},a=(e,n)=>{T(t,(t=>{var r;if(null===(r=t.children)||void 0===r?void 0:r.some((t=>t.id===e))){const e=t.children.every((e=>n[e.id]));n[t.id]=e,a(t.id,n)}}))};return o(e,n),a(e,r),r})(e,n,o)}D(o),w&&(null==w||w(o,e,r))}),[j,t,w,k,y,L,S]),H=o((e=>!!Z[e]),[Z]),_=o((e=>a?a.includes(e):!!j[e]),[a,j]),W=o((e=>{if(i)return i.includes(e)}),[i]),z=o((e=>{var t;return!(!S||!Object.values(j).filter(Boolean).length)&&(null!==(t=!(null==j?void 0:j[e])||R)&&void 0!==t&&t)}),[j,R,S]);return E("div",{className:LC("w-full",null==e?void 0:e.container),children:t.map(((n,r)=>E(xK,Object.assign({classes:e,isFirstLevel:!0,isLastItem:r===t.length-1,checkIsExpanded:H,checkIsChecked:_,onExpandChange:F,onCheckedChange:P,checkAutoDisabled:z,checkIsLoading:W,renderIcon:h,renderElement:p,renderTitle:g,renderRightSection:m,enableSeparatorLine:I,disabled:z(n.id),showIcon:M,lineSize:l,horizontalLineWidth:s,expandButtonSize:u,spacing:f,notifyClickItem:b,maxLevel:A,currentLevel:1,checkable:O},n),n.id)))})},kK=({selectedKey:e,children:t,direction:n="vertical",className:o,containerProps:a,scrollAlign:i="center"})=>{const l=r(null),s=r({});d((()=>{e&&(e=>{const t=l.current,r=s.current[e];if(t&&r)if("vertical"===n){const e=t.getBoundingClientRect().top,n=r.getBoundingClientRect().top-e+t.scrollTop,o=t.clientHeight,a=r.offsetHeight;let l=n;"center"===i?l=n-(o/2-a/2):"end"===i&&(l=n+(a-o)),t.scrollTo({top:l,behavior:"smooth"})}else if("horizontal"===n){const e=t.getBoundingClientRect().left,n=r.getBoundingClientRect().left-e+t.scrollLeft,o=t.clientWidth,a=r.offsetWidth;let l=n;"center"===i?l=n-(o/2-a/2):"end"===i&&(l=n+(a-o)),t.scrollTo({left:l,behavior:"smooth"})}})(e)}),[e,n,i]);const c=Array.isArray(t)?t.map((e=>m(e)&&e.key?p(e,{ref:t=>{s.current[String(e.key)]=t}}):e)):t;return E("div",Object.assign({ref:l,className:`overflow-auto ${"vertical"===n?"max-h-60":"max-w-full whitespace-nowrap"} ${null!=o?o:""}`},a,{children:c}))},MK={m:"ui-scrollbar",s:"ui-scrollbar ui-scrollbar-s",xs:"ui-scrollbar ui-scrollbar-xs"},RK={vertical:"overflow-y-auto overflow-x-hidden",horizontal:"overflow-x-auto overflow-y-hidden",both:"overflow-auto"},IK=e.forwardRef(((e,t)=>{var{className:n,scrollbarSize:r="m",direction:o="vertical",children:a}=e,i=IC(e,["className","scrollbarSize","direction","children"]);return E("div",Object.assign({ref:t,className:LC(RK[o],MK[r],n)},i,{children:a}))}));IK.displayName="ScrollArea";var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,n)=>{const r=e.forwardRef(((e,t)=>{const{asChild:r,...o}=e,a=r?fL:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),E(a,{...o,ref:t})}));return r.displayName=`Primitive.${n}`,{...t,[n]:r}}),{});function AK(t,n=[]){let r=[];const o=()=>{const n=r.map((t=>e.createContext(t)));return function(r){const o=r?.[t]||n;return e.useMemo((()=>({[`__scope${t}`]:{...r,[t]:o}})),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;function l(n){const{scope:r,children:o,...l}=n,s=r?.[t][i]||a,c=e.useMemo((()=>l),Object.values(l));return E(s.Provider,{value:c,children:o})}return r=[...r,o],l.displayName=n+"Provider",[l,function(r,l){const s=l?.[t][i]||a,c=e.useContext(s);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},LK(o,...n)]}function LK(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=r.reduce(((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]})),{});return e.useMemo((()=>({[`__scope${n.scopeName}`]:o})),[o])}};return r.scopeName=n.scopeName,r}var SK="rovingFocusGroup.onEntryFocus",NK={bubbles:!1,cancelable:!0},jK="RovingFocusGroup",[DK,ZK,VK]=function(e){const n=e+"CollectionProvider",[r,o]=AK(n),[a,i]=r(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:r}=e,o=t.useRef(null),i=t.useRef(new Map).current;return E(a,{scope:n,itemMap:i,collectionRef:o,children:r})};l.displayName=n;const s=e+"CollectionSlot",c=t.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=tL(t,i(s,n).collectionRef);return E(fL,{ref:o,children:r})}));c.displayName=s;const d=e+"CollectionItemSlot",u="data-radix-collection-item",f=t.forwardRef(((e,n)=>{const{scope:r,children:o,...a}=e,l=t.useRef(null),s=tL(n,l),c=i(d,r);return t.useEffect((()=>(c.itemMap.set(l,{ref:l,...a}),()=>{c.itemMap.delete(l)}))),E(fL,{[u]:"",ref:s,children:o})}));return f.displayName=d,[{Provider:l,Slot:c,ItemSlot:f},function(n){const r=i(e+"CollectionConsumer",n),o=t.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),n=Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return n}),[r.collectionRef,r.itemMap]);return o},o]}(jK),[TK,BK]=AK(jK,[VK]),[FK,PK]=TK(jK),HK=e.forwardRef(((e,t)=>E(DK.Provider,{scope:e.__scopeRovingFocusGroup,children:E(DK.Slot,{scope:e.__scopeRovingFocusGroup,children:E(_K,{...e,ref:t})})})));HK.displayName=jK;var _K=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=t,h=e.useRef(null),m=tL(n,h),p=FP(i),[g=null,v]=iL({prop:l,defaultProp:s,onChange:c}),[w,b]=e.useState(!1),y=aL(d),x=ZK(r),C=e.useRef(!1),[k,M]=e.useState(0);return e.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(SK,y),()=>e.removeEventListener(SK,y)}),[y]),E(FK,{scope:r,orientation:o,dir:p,loop:a,currentTabStopId:g,onItemFocus:e.useCallback((e=>v(e)),[v]),onItemShiftTab:e.useCallback((()=>b(!0)),[]),onFocusableItemAdd:e.useCallback((()=>M((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>M((e=>e-1))),[]),children:E(OK.div,{tabIndex:w||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:oL(t.onMouseDown,(()=>{C.current=!0})),onFocus:oL(t.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(SK,NK);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));UK([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}C.current=!1})),onBlur:oL(t.onBlur,(()=>b(!1)))})})})),WK="RovingFocusGroupItem",zK=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:i,...l}=t,s=Gj(),c=i||s,d=PK(WK,r),u=d.currentTabStopId===c,f=ZK(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return e.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),E(DK.ItemSlot,{scope:r,id:c,focusable:o,active:a,children:E(OK.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:oL(t.onMouseDown,(e=>{o?d.onItemFocus(c):e.preventDefault()})),onFocus:oL(t.onFocus,(()=>d.onItemFocus(c))),onKeyDown:oL(t.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:$K[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=d.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>UK(n)))}}))})})}));zK.displayName=WK;var $K={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UK(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var qK=HK,GK=zK;var YK=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),a=e.useRef(t),i=e.useRef("none"),l=t?"mounted":"unmounted",[s,c]=function(t,n){return e.useReducer(((e,t)=>n[e][t]??e),t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=KK(o.current);i.current="mounted"===s?e:"none"}),[s]),sL((()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=KK(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}}),[t,c]),sL((()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=KK(o.current).includes(r.animationName);if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout((()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)}))}},l=e=>{e.target===n&&(i.current=KK(o.current))};return n.addEventListener("animationstart",l),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",l),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")}),[n,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback((e=>{e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=tL(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function KK(e){return e?.animationName||"none"}YK.displayName="Presence";var XK="Radio",[QK,JK]=nL(XK),[eX,tX]=QK(XK),nX=e.forwardRef(((t,n)=>{const{__scopeRadio:r,name:o,checked:a=!1,required:i,disabled:l,value:s="on",onCheck:c,form:d,...u}=t,[f,h]=e.useState(null),m=tL(n,(e=>h(e))),p=e.useRef(!1),g=!f||(d||!!f.closest("form"));return C(eX,{scope:r,checked:a,disabled:l,children:[E(OK.button,{type:"button",role:"radio","aria-checked":a,"data-state":iX(a),"data-disabled":l?"":void 0,disabled:l,value:s,...u,ref:m,onClick:oL(t.onClick,(e=>{a||c?.(),g&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())}))}),g&&E(aX,{control:f,bubbles:!p.current,name:o,value:s,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})}));nX.displayName=XK;var rX="RadioIndicator",oX=e.forwardRef(((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,a=tX(rX,n);return E(YK,{present:r||a.checked,children:E(OK.span,{"data-state":iX(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t})})}));oX.displayName=rX;var aX=t=>{const{control:n,checked:r,bubbles:o=!0,...a}=t,i=e.useRef(null),l=lL(r),s=cL(n);return e.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),E("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function iX(e){return e?"checked":"unchecked"}var lX=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sX="RadioGroup",[cX]=nL(sX,[BK,JK]),dX=BK(),uX=JK(),[fX,hX]=cX(sX),mX=e.forwardRef(((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:a,required:i=!1,disabled:l=!1,orientation:s,dir:c,loop:d=!0,onValueChange:u,...f}=e,h=dX(n),m=FP(c),[p,g]=iL({prop:a,defaultProp:o,onChange:u});return E(fX,{scope:n,name:r,required:i,disabled:l,value:p,onValueChange:g,children:E(qK,{asChild:!0,...h,orientation:s,dir:m,loop:d,children:E(OK.div,{role:"radiogroup","aria-required":i,"aria-orientation":s,"data-disabled":l?"":void 0,dir:m,...f,ref:t})})})}));mX.displayName=sX;var pX="RadioGroupItem",gX=e.forwardRef(((t,n)=>{const{__scopeRadioGroup:r,disabled:o,...a}=t,i=hX(pX,r),l=i.disabled||o,s=dX(r),c=uX(r),d=e.useRef(null),u=tL(n,d),f=i.value===a.value,h=e.useRef(!1);return e.useEffect((()=>{const e=e=>{lX.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}}),[]),E(GK,{asChild:!0,...s,focusable:!l,active:f,children:E(nX,{disabled:l,required:i.required,checked:f,...c,...a,name:i.name,ref:u,onCheck:()=>i.onValueChange(a.value),onKeyDown:oL((e=>{"Enter"===e.key&&e.preventDefault()})),onFocus:oL(a.onFocus,(()=>{h.current&&d.current?.click()}))})})}));gX.displayName=pX;var vX=e.forwardRef(((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=uX(n);return E(oX,{...o,...r,ref:t})}));vX.displayName="RadioGroupIndicator";var wX=mX,bX=gX,yX=vX;const xX=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(wX,Object.assign({className:LC("grid gap-2",n)},r,{ref:t}))}));xX.displayName=wX.displayName;const EX=e.forwardRef(((e,t)=>{var{className:n}=e,r=IC(e,["className"]);return E(bX,Object.assign({ref:t,className:LC("aspect-square box-border size-4 cursor-pointer rounded-full border border-function-default-solid text-function-default-solid","hover:border-function-default-hover","focus:outline-none","data-[disabled]:!border-state-disable-outline data-[disabled]:!fill-state-disable-outline data-[disabled]:!cursor-not-allowed data-[disabled]:!pointer-events-none data-[disabled]:!text-state-disable-outline","[&[data-disabled][data-state=checked]]:!border-state-disable-solid [&[data-disabled][data-state=checked]]:!text-state-disable-solid","data-[state=checked]:border-function-active-solid data-[state=checked]:text-function-active-solid","hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:text-function-active-hover",n)},r,{children:E(yX,{className:"flex items-center justify-center",children:E("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"fill-current text-current",children:E("circle",{cx:"5",cy:"5",r:"5",fill:"current"})})})}))}));EX.displayName=bX.displayName;var CX=e=>"checkbox"===e.type,kX=e=>e instanceof Date,MX=e=>null==e;const RX=e=>"object"==typeof e;var IX=e=>!MX(e)&&!Array.isArray(e)&&RX(e)&&!kX(e),OX=e=>IX(e)&&e.target?CX(e.target)?e.target.checked:e.target.value:e,AX=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),LX="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function SX(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(LX&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!(n||IX(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return IX(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=SX(e[t]));return r}var NX=e=>/^\w*$/.test(e),jX=e=>void 0===e,DX=e=>Array.isArray(e)?e.filter(Boolean):[],ZX=e=>DX(e.replace(/["|']|\]/g,"").split(/\.|\[/)),VX=(e,t,n)=>{if(!t||!IX(e))return n;const r=(NX(t)?[t]:ZX(t)).reduce(((e,t)=>MX(e)?e:e[t]),e);return jX(r)||r===e?jX(e[t])?n:e[t]:r},TX=e=>"boolean"==typeof e,BX=e=>"function"==typeof e,FX=(e,t,n)=>{let r=-1;const o=NX(t)?[t]:ZX(t),a=o.length,i=a-1;for(;++r<a;){const t=o[r];let a=n;if(r!==i){const n=e[t];a=IX(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const PX="blur",HX="focusout",_X="change",WX="onBlur",zX="onChange",$X="onSubmit",UX="onTouched",qX="all",GX="max",YX="min",KX="maxLength",XX="minLength",QX="pattern",JX="required",eQ="validate",tQ=t.createContext(null);tQ.displayName="HookFormControlContext";const nQ=()=>t.useContext(tQ);var rQ=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==qX&&(t._proxyFormState[o]=!r||qX),n&&(n[o]=!0),e[o]}});return o};const oQ="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var aQ=e=>"string"==typeof e,iQ=(e,t,n,r,o)=>aQ(e)?(r&&t.watch.add(e),VX(n,e,o)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),VX(n,e)))):(r&&(t.watchAll=!0),n),lQ=e=>MX(e)||!RX(e);function sQ(e,t,n=new WeakSet){if(lQ(e)||lQ(t))return Object.is(e,t);if(kX(e)&&kX(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const r=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(kX(r)&&kX(e)||IX(r)&&IX(e)||Array.isArray(r)&&Array.isArray(e)?!sQ(r,e,n):!Object.is(r,e))return!1}}return!0}function cQ(e){const n=nQ(),{name:r,disabled:o,control:a=n,shouldUnregister:i,defaultValue:l,exact:s=!0}=e,c=AX(a._names.array,r),d=t.useMemo((()=>VX(a._formValues,r,VX(a._defaultValues,r,l))),[a,r,l]),u=function(e){const n=nQ(),{control:r=n,name:o,defaultValue:a,disabled:i,exact:l,compute:s}=e||{},c=t.useRef(a),d=t.useRef(s),u=t.useRef(void 0),f=t.useRef(r),h=t.useRef(o);d.current=s;const[m,p]=t.useState((()=>{const e=r._getWatch(o,c.current);return d.current?d.current(e):e})),g=t.useCallback((e=>{const t=iQ(o,r._names,e||r._formValues,!1,c.current);return d.current?d.current(t):t}),[r._formValues,r._names,o]),v=t.useCallback((e=>{if(!i){const t=iQ(o,r._names,e||r._formValues,!1,c.current);if(d.current){const e=d.current(t);sQ(e,u.current)||(p(e),u.current=e)}else p(t)}}),[r._formValues,r._names,i,o]);oQ((()=>(f.current===r&&sQ(h.current,o)||(f.current=r,h.current=o,v()),r._subscribe({name:o,formState:{values:!0},exact:l,callback:e=>{v(e.values)}}))),[r,l,o,v]),t.useEffect((()=>r._removeUnmounted()));const w=f.current!==r,b=h.current,y=t.useMemo((()=>{if(i)return null;const e=!w&&!sQ(b,o);return w||e?g():null}),[i,w,o,b,g]);return null!==y?y:m}({control:a,name:r,defaultValue:d,exact:s}),f=function(e){const n=nQ(),{control:r=n,disabled:o,name:a,exact:i}=e||{},[l,s]=t.useState(r._formState),c=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return oQ((()=>r._subscribe({name:a,formState:c.current,exact:i,callback:e=>{!o&&s({...r._formState,...e})}})),[a,o,i]),t.useEffect((()=>{c.current.isValid&&r._setValid(!0)}),[r]),t.useMemo((()=>rQ(l,r,c.current,!1)),[l,r])}({control:a,name:r,exact:s}),h=t.useRef(e),m=t.useRef(void 0),p=t.useRef(a.register(r,{...e.rules,value:u,...TX(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const g=t.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!VX(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!VX(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!VX(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!VX(f.validatingFields,r)},error:{enumerable:!0,get:()=>VX(f.errors,r)}})),[f,r]),v=t.useCallback((e=>p.current.onChange({target:{value:OX(e),name:r},type:_X})),[r]),w=t.useCallback((()=>p.current.onBlur({target:{value:VX(a._formValues,r),name:r},type:PX})),[r,a._formValues]),b=t.useCallback((e=>{const t=VX(a._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>BX(e.focus)&&e.focus(),select:()=>BX(e.select)&&e.select(),setCustomValidity:t=>BX(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>BX(e.reportValidity)&&e.reportValidity()})}),[a._fields,r]),y=t.useMemo((()=>({name:r,value:u,...TX(o)||f.disabled?{disabled:f.disabled||o}:{},onChange:v,onBlur:w,ref:b})),[r,o,f.disabled,v,w,b,u]);return t.useEffect((()=>{const e=a._options.shouldUnregister||i,t=m.current;t&&t!==r&&!c&&a.unregister(t),a.register(r,{...h.current.rules,...TX(h.current.disabled)?{disabled:h.current.disabled}:{}});const n=(e,t)=>{const n=VX(a._fields,e);n&&n._f&&(n._f.mount=t)};if(n(r,!0),e){const e=SX(VX(a._options.defaultValues,r,h.current.defaultValue));FX(a._defaultValues,r,e),jX(VX(a._formValues,r))&&FX(a._formValues,r,e)}return!c&&a.register(r),m.current=r,()=>{(c?e&&!a._state.action:e)?a.unregister(r):n(r,!1)}}),[r,a,c,i]),t.useEffect((()=>{a._setDisabledField({disabled:o,name:r})}),[o,r,a]),t.useMemo((()=>({field:y,formState:f,fieldState:g})),[y,f,g])}const dQ=t.createContext(null);dQ.displayName="HookFormContext";const uQ=()=>t.useContext(dQ),fQ=e=>{const{children:n,watch:r,getValues:o,getFieldState:a,setError:i,clearErrors:l,setValue:s,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:h,unregister:m,control:p,register:g,setFocus:v,subscribe:w}=e;return t.createElement(dQ.Provider,{value:t.useMemo((()=>({watch:r,getValues:o,getFieldState:a,setError:i,clearErrors:l,setValue:s,trigger:c,formState:d,resetField:u,reset:f,handleSubmit:h,unregister:m,control:p,register:g,setFocus:v,subscribe:w})),[l,p,d,a,o,h,g,f,u,i,v,s,w,c,m,r])},t.createElement(tQ.Provider,{value:p},n))};var hQ=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},mQ=e=>Array.isArray(e)?e:[e],pQ=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}};function gQ(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],a=t[r];if(o&&IX(o)&&a){const e=gQ(o,a);IX(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var vQ=e=>IX(e)&&!Object.keys(e).length,wQ=e=>"file"===e.type,bQ=e=>{if(!LX)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yQ=e=>"select-multiple"===e.type,xQ=e=>"radio"===e.type,EQ=e=>bQ(e)&&e.isConnected;function CQ(e,t){const n=Array.isArray(t)?t:NX(t)?[t]:ZX(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=jX(e)?r++:e[t[r++]];return e}(e,n),o=n.length-1,a=n[o];return r&&delete r[a],0!==o&&(IX(r)&&vQ(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!jX(e[t]))return!1;return!0}(r))&&CQ(e,n.slice(0,-1)),e}function kQ(e){return Array.isArray(e)||IX(e)&&!(e=>{for(const t in e)if(BX(e[t]))return!0;return!1})(e)}function MQ(e,t={}){for(const n in e){const r=e[n];kQ(r)?(t[n]=Array.isArray(r)?[]:{},MQ(r,t[n])):jX(r)||(t[n]=!0)}return t}function RQ(e,t,n){n||(n=MQ(t));for(const r in e){const o=e[r];if(kQ(o))jX(t)||lQ(n[r])?n[r]=MQ(o,Array.isArray(o)?[]:{}):RQ(o,MX(t)?{}:t[r],n[r]);else{const e=t[r];n[r]=!sQ(o,e)}}return n}const IQ={value:!1,isValid:!1},OQ={value:!0,isValid:!0};var AQ=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!jX(e[0].attributes.value)?jX(e[0].value)||""===e[0].value?OQ:{value:e[0].value,isValid:!0}:OQ:IQ}return IQ},LQ=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>jX(e)?e:t?""===e?NaN:e?+e:e:n&&aQ(e)?new Date(e):r?r(e):e;const SQ={isValid:!1,value:null};var NQ=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),SQ):SQ;function jQ(e){const t=e.ref;return wQ(t)?t.files:xQ(t)?NQ(e.refs).value:yQ(t)?[...t.selectedOptions].map((({value:e})=>e)):CX(t)?AQ(e.refs).value:LQ(jX(t.value)?e.ref.value:t.value,e)}var DQ=e=>e instanceof RegExp,ZQ=e=>jX(e)?e:DQ(e)?e.source:IX(e)?DQ(e.value)?e.value.source:e.value:e,VQ=e=>({isOnSubmit:!e||e===$X,isOnBlur:e===WX,isOnChange:e===zX,isOnAll:e===qX,isOnTouch:e===UX});const TQ="AsyncFunction";var BQ=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const FQ=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const n=VX(e,o);if(n){const{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(FQ(a,t))break}else if(IX(a)&&FQ(a,t))break}}};function PQ(e,t,n){const r=VX(e,n);if(r||NX(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),a=VX(t,r),i=VX(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:`${r}.root`,error:i.root};o.pop()}return{name:n}}var HQ=(e,t,n)=>{const r=mQ(VX(e,n));return FX(r,"root",t[n]),FX(e,n,r),e};function _Q(e,t,n="validate"){if(aQ(e)||Array.isArray(e)&&e.every(aQ)||TX(e)&&!e)return{type:n,message:aQ(e)?e:"",ref:t}}var WQ=e=>IX(e)&&!DQ(e)?e:{value:e,message:""},zQ=async(e,t,n,r,o,a)=>{const{ref:i,refs:l,required:s,maxLength:c,minLength:d,min:u,max:f,pattern:h,validate:m,name:p,valueAsNumber:g,mount:v}=e._f,w=VX(n,p);if(!v||t.has(p))return{};const b=l?l[0]:i,y=e=>{o&&b.reportValidity&&(b.setCustomValidity(TX(e)?"":e||""),b.reportValidity())},x={},E=xQ(i),C=CX(i),k=E||C,M=(g||wQ(i))&&jX(i.value)&&jX(w)||bQ(i)&&""===i.value||""===w||Array.isArray(w)&&!w.length,R=hQ.bind(null,p,r,x),I=(e,t,n,r=KX,o=XX)=>{const a=e?t:n;x[p]={type:e?r:o,message:a,ref:i,...R(e?r:o,a)}};if(a?!Array.isArray(w)||!w.length:s&&(!k&&(M||MX(w))||TX(w)&&!w||C&&!AQ(l).isValid||E&&!NQ(l).isValid)){const{value:e,message:t}=aQ(s)?{value:!!s,message:s}:WQ(s);if(e&&(x[p]={type:JX,message:t,ref:b,...R(JX,t)},!r))return y(t),x}if(!(M||MX(u)&&MX(f))){let e,t;const n=WQ(f),o=WQ(u);if(MX(w)||isNaN(w)){const r=i.valueAsDate||new Date(w),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==i.type,s="week"==i.type;aQ(n.value)&&w&&(e=l?a(w)>a(n.value):s?w>n.value:r>new Date(n.value)),aQ(o.value)&&w&&(t=l?a(w)<a(o.value):s?w<o.value:r<new Date(o.value))}else{const r=i.valueAsNumber||(w?+w:w);MX(n.value)||(e=r>n.value),MX(o.value)||(t=r<o.value)}if((e||t)&&(I(!!e,n.message,o.message,GX,YX),!r))return y(x[p].message),x}if((c||d)&&!M&&(aQ(w)||a&&Array.isArray(w))){const e=WQ(c),t=WQ(d),n=!MX(e.value)&&w.length>+e.value,o=!MX(t.value)&&w.length<+t.value;if((n||o)&&(I(n,e.message,t.message),!r))return y(x[p].message),x}if(h&&!M&&aQ(w)){const{value:e,message:t}=WQ(h);if(DQ(e)&&!w.match(e)&&(x[p]={type:QX,message:t,ref:i,...R(QX,t)},!r))return y(t),x}if(m)if(BX(m)){const e=_Q(await m(w,n),b);if(e&&(x[p]={...e,...R(eQ,e.message)},!r))return y(e.message),x}else if(IX(m)){let e={};for(const t in m){if(!vQ(e)&&!r)break;const o=_Q(await m[t](w,n),b,t);o&&(e={...o,...R(t,o.message)},y(o.message),r&&(x[p]=e))}if(!vQ(e)&&(x[p]={ref:b,...e},!r))return x}return y(!0),x};const $Q={mode:$X,reValidateMode:zX,shouldFocusError:!0};function UQ(e={}){let t,n={...$Q,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:BX(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},a=(IX(n.defaultValues)||IX(n.values))&&SX(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:SX(a),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let f={...u};const h={array:pQ(),state:pQ()},m=n.criteriaMode===qX,p=async e=>{if(!l.keepIsValid&&!n.disabled&&(u.isValid||f.isValid||e)){let e;n.resolver?(e=vQ((await y()).errors),g()):e=await x(o,!0),e!==r.isValid&&h.state.next({isValid:e})}},g=(e,t)=>{!n.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((e||Array.from(s.mount)).forEach((e=>{e&&(t?FX(r.validatingFields,e,t):CQ(r.validatingFields,e))})),h.state.next({validatingFields:r.validatingFields,isValidating:!vQ(r.validatingFields)}))},v=(e,t,n,r)=>{const s=VX(o,e);if(s){const o=VX(i,e,jX(n)?VX(a,e):n);jX(o)||r&&r.defaultChecked||t?FX(i,e,t?o:jQ(s._f)):k(e,o),l.mount&&!l.action&&p()}},w=(e,t,o,i,l)=>{let s=!1,c=!1;const d={name:e};if(!n.disabled){if(!o||i){(u.isDirty||f.isDirty)&&(c=r.isDirty,r.isDirty=d.isDirty=E(),s=c!==d.isDirty);const n=sQ(VX(a,e),t);c=!!VX(r.dirtyFields,e),n?CQ(r.dirtyFields,e):FX(r.dirtyFields,e,!0),d.dirtyFields=r.dirtyFields,s=s||(u.dirtyFields||f.dirtyFields)&&c!==!n}if(o){const t=VX(r.touchedFields,e);t||(FX(r.touchedFields,e,o),d.touchedFields=r.touchedFields,s=s||(u.touchedFields||f.touchedFields)&&t!==o)}s&&l&&h.state.next(d)}return s?d:{}},b=(e,o,a,i)=>{const l=VX(r.errors,e),s=(u.isValid||f.isValid)&&TX(o)&&r.isValid!==o;var d;if(n.delayError&&a?(d=()=>((e,t)=>{FX(r.errors,e,t),h.state.next({errors:r.errors})})(e,a),t=e=>{clearTimeout(c),c=setTimeout(d,e)},t(n.delayError)):(clearTimeout(c),t=null,a?FX(r.errors,e,a):CQ(r.errors,e)),(a?!sQ(l,a):l)||!vQ(i)||s){const t={...i,...s&&TX(o)?{isValid:o}:{},errors:r.errors,name:e};r={...r,...t},h.state.next(t)}},y=async e=>{g(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=VX(t,n);e&&FX(o,n,e._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||s.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return t},x=async(t,o,a={valid:!0})=>{for(const c in t){const d=t[c];if(d){const{_f:t,...c}=d;if(t){const c=s.array.has(t.name),f=d._f&&(!!(l=d._f)&&!!l.validate&&!!(BX(l.validate)&&l.validate.constructor.name===TQ||IX(l.validate)&&Object.values(l.validate).find((e=>e.constructor.name===TQ))));f&&u.validatingFields&&g([t.name],!0);const h=await zQ(d,s.disabled,i,m,n.shouldUseNativeValidation&&!o,c);if(f&&u.validatingFields&&g([t.name]),h[t.name]&&(a.valid=!1,o||e.shouldUseNativeValidation))break;!o&&(VX(h,t.name)?c?HQ(r.errors,h,t.name):FX(r.errors,t.name,h[t.name]):CQ(r.errors,t.name))}!vQ(c)&&await x(c,o,a)}}var l;return a.valid},E=(e,t)=>!n.disabled&&(e&&t&&FX(i,e,t),!sQ(L(),a)),C=(e,t,n)=>iQ(e,s,{...l.mount?i:jX(t)?a:aQ(e)?{[e]:t}:t},n,t),k=(e,t,n={})=>{const r=VX(o,e);let a=t;if(r){const n=r._f;n&&(!n.disabled&&FX(i,e,LQ(t,n)),a=bQ(n.ref)&&MX(t)?"":t,yQ(n.ref)?[...n.ref.options].forEach((e=>e.selected=a.includes(e.value))):n.refs?CX(n.ref)?n.refs.forEach((e=>{e.defaultChecked&&e.disabled||(Array.isArray(a)?e.checked=!!a.find((t=>t===e.value)):e.checked=a===e.value||!!a)})):n.refs.forEach((e=>e.checked=e.value===a)):wQ(n.ref)?n.ref.value="":(n.ref.value=a,n.ref.type||h.state.next({name:e,values:SX(i)})))}(n.shouldDirty||n.shouldTouch)&&w(e,a,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&A(e)},M=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const a=t[r],i=e+"."+r,l=VX(o,i);(s.array.has(e)||IX(a)||l&&!l._f)&&!kX(a)?M(i,a,n):k(i,a,n)}},R=(e,t,n={})=>{const c=VX(o,e),d=s.array.has(e),m=SX(t);FX(i,e,m),d?(h.array.next({name:e,values:SX(i)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&n.shouldDirty&&h.state.next({name:e,dirtyFields:RQ(a,i),isDirty:E(e,m)})):!c||c._f||MX(m)?k(e,m,n):M(e,m,n),BQ(e,s)?h.state.next({...r,name:e,values:SX(i)}):h.state.next({name:l.mount?e:void 0,values:SX(i)})},I=async e=>{l.mount=!0;const a=e.target;let c=a.name,d=!0;const v=VX(o,c),E=e=>{d=Number.isNaN(e)||kX(e)&&isNaN(e.getTime())||sQ(e,VX(i,c,e))},C=VQ(n.mode),k=VQ(n.reValidateMode);if(v){let l,M;const R=a.type?jQ(v._f):OX(e),I=e.type===PX||e.type===HX,O=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(v._f)&&!n.resolver&&!VX(r.errors,c)&&!v._f.deps||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(I,VX(r.touchedFields,c),r.isSubmitted,k,C),L=BQ(c,s,I);FX(i,c,R),I?a&&a.readOnly||(v._f.onBlur&&v._f.onBlur(e),t&&t(0)):v._f.onChange&&v._f.onChange(e);const S=w(c,R,I),N=!vQ(S)||L;if(!I&&h.state.next({name:c,type:e.type,values:SX(i)}),O)return(u.isValid||f.isValid)&&("onBlur"===n.mode?I&&p():I||p()),N&&h.state.next({name:c,...L?{}:S});if(!I&&L&&h.state.next({...r}),n.resolver){const{errors:e}=await y([c]);if(g([c]),E(R),d){const t=PQ(r.errors,o,c),n=PQ(e,o,t.name||c);l=n.error,c=n.name,M=vQ(e)}}else g([c],!0),l=(await zQ(v,s.disabled,i,m,n.shouldUseNativeValidation))[c],g([c]),E(R),d&&(l?M=!1:(u.isValid||f.isValid)&&(M=await x(o,!0)));d&&(v._f.deps&&(!Array.isArray(v._f.deps)||v._f.deps.length>0)&&A(v._f.deps),b(c,M,l,S))}},O=(e,t)=>{if(VX(r.errors,t)&&e.focus)return e.focus(),1},A=async(e,t={})=>{let a,i;const l=mQ(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await y(e);if(g(e),e)for(const n of e){const e=VX(t,n);e?FX(r.errors,n,e):CQ(r.errors,n)}else r.errors=t;return t})(jX(e)?e:l);a=vQ(t),i=e?!l.some((e=>VX(t,e))):a}else e?(i=(await Promise.all(l.map((async e=>{const t=VX(o,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||r.isValid)&&p()):i=a=await x(o);return h.state.next({...!aQ(e)||(u.isValid||f.isValid)&&a!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:a}:{},errors:r.errors}),t.shouldFocus&&!i&&FQ(o,O,e?l:s.mount),i},L=(e,t)=>{let n={...l.mount?i:a};return t&&(n=gQ(t.dirtyFields?r.dirtyFields:r.touchedFields,n)),jX(e)?n:aQ(e)?VX(n,e):e.map((e=>VX(n,e)))},S=(e,t)=>({invalid:!!VX((t||r).errors,e),isDirty:!!VX((t||r).dirtyFields,e),error:VX((t||r).errors,e),isValidating:!!VX(r.validatingFields,e),isTouched:!!VX((t||r).touchedFields,e)}),N=(e,t,n)=>{const a=(VX(o,e,{_f:{}})._f||{}).ref,i=VX(r.errors,e)||{},{ref:l,message:s,type:c,...d}=i;FX(r.errors,e,{...d,...t,ref:a}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},j=e=>h.state.subscribe({next:t=>{var n,o,l;n=e.name,o=t.name,l=e.exact,n&&o&&n!==o&&!mQ(n).some((e=>e&&(l?e===o:e.startsWith(o)||o.startsWith(e))))||!((e,t,n,r)=>{n(e);const{name:o,...a}=e;return vQ(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!r||qX)))})(t,e.formState||u,H,e.reRenderRoot)||e.callback({values:{...i},...r,...t,defaultValues:a})}}).unsubscribe,D=(e,t={})=>{for(const l of e?mQ(e):s.mount)s.mount.delete(l),s.array.delete(l),t.keepValue||(CQ(o,l),CQ(i,l)),!t.keepError&&CQ(r.errors,l),!t.keepDirty&&CQ(r.dirtyFields,l),!t.keepTouched&&CQ(r.touchedFields,l),!t.keepIsValidating&&CQ(r.validatingFields,l),!n.shouldUnregister&&!t.keepDefaultValue&&CQ(a,l);h.state.next({values:SX(i)}),h.state.next({...r,...t.keepDirty?{isDirty:E()}:{}}),!t.keepIsValid&&p()},Z=({disabled:e,name:t})=>{if(TX(e)&&l.mount||e||s.disabled.has(t)){const n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&l.mount&&!l.action&&p()}},V=(e,t={})=>{let r=VX(o,e);const i=TX(t.disabled)||TX(n.disabled);return FX(o,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),s.mount.add(e),r?Z({disabled:TX(t.disabled)?t.disabled:n.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:ZQ(t.min),max:ZQ(t.max),minLength:ZQ(t.minLength),maxLength:ZQ(t.maxLength),pattern:ZQ(t.pattern)}:{},name:e,onChange:I,onBlur:I,ref:i=>{if(i){V(e,t),r=VX(o,e);const n=jX(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,l=(e=>xQ(e)||CX(e))(n),s=r._f.refs||[];if(l?s.find((e=>e===n)):n===r._f.ref)return;FX(o,e,{_f:{...r._f,...l?{refs:[...s.filter(EQ),n,...Array.isArray(VX(a,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=VX(o,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!AX(s.array,e)||!l.action)&&s.unMount.add(e)}}},T=()=>n.shouldFocusError&&FQ(o,O,s.mount),B=(e,t)=>async a=>{let l;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=SX(i);if(h.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await y();g(),r.errors=e,c=SX(t)}else await x(o);if(s.disabled.size)for(const e of s.disabled)CQ(c,e);if(CQ(r.errors,"root"),vQ(r.errors)){h.state.next({errors:{}});try{await e(c,a)}catch(e){l=e}}else t&&await t({...r.errors},a),T(),setTimeout(T);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:vQ(r.errors)&&!l,submitCount:r.submitCount+1,errors:r.errors}),l)throw l},F=(e,t={})=>{const c=e?SX(e):a,d=SX(c),f=vQ(e),m=f?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...s.mount,...Object.keys(RQ(a,i))]);for(const t of Array.from(e)){const e=VX(r.dirtyFields,t),n=VX(i,t),o=VX(m,t);e&&!jX(n)?FX(m,t,n):e||jX(o)||R(t,o)}}else{if(LX&&jX(e))for(const e of s.mount){const t=VX(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(bQ(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of s.mount)R(e,VX(m,e));else o={}}i=n.shouldUnregister?t.keepDefaultValues?SX(a):{}:SX(m),h.array.next({values:{...m}}),h.state.next({values:{...m}})}s={mount:t.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!n.shouldUnregister&&!vQ(m),l.watch=!!n.shouldUnregister,l.keepIsValid=!!t.keepIsValid,l.action=!1,t.keepErrors||(r.errors={}),h.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!f&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||sQ(e,a))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:f?{}:t.keepDirtyValues?t.keepDefaultValues&&i?RQ(a,i):r.dirtyFields:t.keepDefaultValues&&e?RQ(a,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1,defaultValues:a})},P=(e,t)=>F(BX(e)?e(i):e,{...n.resetOptions,...t}),H=e=>{r={...r,...e}},_={control:{register:V,unregister:D,getFieldState:S,handleSubmit:B,setError:N,_subscribe:j,_runSchema:y,_updateIsValidating:g,_focusError:T,_getWatch:C,_getDirty:E,_setValid:p,_setFieldArray:(e,t=[],s,c,d=!0,m=!0)=>{if(c&&s&&!n.disabled){if(l.action=!0,m&&Array.isArray(VX(o,e))){const t=s(VX(o,e),c.argA,c.argB);d&&FX(o,e,t)}if(m&&Array.isArray(VX(r.errors,e))){const t=s(VX(r.errors,e),c.argA,c.argB);d&&FX(r.errors,e,t),((e,t)=>{!DX(VX(e,t)).length&&CQ(e,t)})(r.errors,e)}if((u.touchedFields||f.touchedFields)&&m&&Array.isArray(VX(r.touchedFields,e))){const t=s(VX(r.touchedFields,e),c.argA,c.argB);d&&FX(r.touchedFields,e,t)}(u.dirtyFields||f.dirtyFields)&&(r.dirtyFields=RQ(a,i)),h.state.next({name:e,isDirty:E(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else FX(i,e,t)},_setDisabledField:Z,_setErrors:e=>{r.errors=e,h.state.next({errors:r.errors,isValid:!1})},_getFieldArray:e=>DX(VX(l.mount?i:a,e,n.shouldUnregister?VX(a,e,[]):[])),_reset:F,_resetDefaultValues:()=>BX(n.defaultValues)&&n.defaultValues().then((e=>{P(e,n.resetOptions),h.state.next({isLoading:!1})})),_removeUnmounted:()=>{for(const e of s.unMount){const t=VX(o,e);t&&(t._f.refs?t._f.refs.every((e=>!EQ(e))):!EQ(t._f.ref))&&D(e)}s.unMount=new Set},_disableForm:e=>{TX(e)&&(h.state.next({disabled:e}),FQ(o,((t,n)=>{const r=VX(o,n);r&&(t.disabled=r._f.disabled||e,Array.isArray(r._f.refs)&&r._f.refs.forEach((t=>{t.disabled=r._f.disabled||e})))}),0,!1))},_subjects:h,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(e){l=e},get _defaultValues(){return a},get _names(){return s},set _names(e){s=e},get _formState(){return r},get _options(){return n},set _options(e){n={...n,...e}}},subscribe:e=>(l.mount=!0,f={...f,...e.formState},j({...e,formState:{...d,...e.formState}})),trigger:A,register:V,handleSubmit:B,watch:(e,t)=>BX(e)?h.state.subscribe({next:n=>"values"in n&&e(C(void 0,t),n)}):C(e,t,!0),setValue:R,getValues:L,reset:P,resetField:(e,t={})=>{VX(o,e)&&(jX(t.defaultValue)?R(e,SX(VX(a,e))):(R(e,t.defaultValue),FX(a,e,SX(t.defaultValue))),t.keepTouched||CQ(r.touchedFields,e),t.keepDirty||(CQ(r.dirtyFields,e),r.isDirty=t.defaultValue?E(e,SX(VX(a,e))):E()),t.keepError||(CQ(r.errors,e),u.isValid&&p()),h.state.next({...r}))},clearErrors:e=>{const t=e?mQ(e):void 0;null==t||t.forEach((e=>CQ(r.errors,e))),t?t.forEach((e=>{h.state.next({name:e,errors:r.errors})})):h.state.next({errors:{}})},unregister:D,setError:N,setFocus:(e,t={})=>{const n=VX(o,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&setTimeout((()=>{e.focus(),t.shouldSelect&&BX(e.select)&&e.select()}))}},getFieldState:S};return{..._,formControl:_}}function qQ(e={}){const n=t.useRef(void 0),r=t.useRef(void 0),[o,a]=t.useState({isDirty:!1,isValidating:!1,isLoading:BX(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:BX(e.defaultValues)?void 0:e.defaultValues});if(!n.current)if(e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!BX(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...r}=UQ(e);n.current={...r,formState:o}}const i=n.current.control;return i._options=e,oQ((()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a((e=>({...e,isReady:!0}))),i._formState.isReady=!0,e}),[i]),t.useEffect((()=>i._disableForm(e.disabled)),[i,e.disabled]),t.useEffect((()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)}),[i,e.mode,e.reValidateMode]),t.useEffect((()=>{e.errors&&(i._setErrors(e.errors),i._focusError())}),[i,e.errors]),t.useEffect((()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})}),[i,e.shouldUnregister]),t.useEffect((()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==o.isDirty&&i._subjects.state.next({isDirty:e})}}),[i,o.isDirty]),t.useEffect((()=>{var t;e.values&&!sQ(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),r.current=e.values,a((e=>({...e})))):i._resetDefaultValues()}),[i,e.values]),t.useEffect((()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()})),n.current.formState=t.useMemo((()=>rQ(o,i)),[i,o]),n.current}const GQ=(e,t,n)=>{if(e&&"reportValidity"in e){const r=VX(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},YQ=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?GQ(r.ref,n,e):r&&r.refs&&r.refs.forEach((t=>GQ(t,n,e)))}},KQ=(e,t)=>{t.shouldUseNativeValidation&&YQ(e,t);const n={};for(const r in e){const o=VX(t.fields,r),a=Object.assign(e[r]||{},{ref:o&&o.ref});if(XQ(t.names||Object.keys(e),r)){const e=Object.assign({},VX(n,r));FX(e,"root",a),FX(n,r,e)}else FX(n,r,a)}return n},XQ=(e,t)=>{const n=QQ(t);return e.some((e=>QQ(e).match(`^${n}\\.\\d+`)))};function QQ(e){return e.replace(/\]|\[/g,"")}const JQ=e=>function(e,t,n){return void 0===n&&(n={}),function(r,o,a){try{return Promise.resolve(function(i,l){try{var s=(null!=t&&t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:o}))).then((function(e){return a.shouldUseNativeValidation&&YQ({},a),{values:n.raw?Object.assign({},r):e,errors:{}}})))}catch(e){return l(e)}return s&&s.then?s.then(void 0,l):s}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:KQ((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,o=r&&r[t.type];e[t.path]=hQ(t.path,n,e,t.type,o?[].concat(o,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}}(e),eJ=({methods:e,defaultValues:n,controllerRef:r})=>{const o=t.forwardRef(((t,o)=>{var{children:a}=t,i=IC(t,["children"]);return E(rJ,Object.assign({},i,{ref:o,methods:e,defaultValues:n,controllerRef:r,children:a}))}));return o.displayName="ControlledFormRoot",{methods:e,FormRoot:o}},tJ=({defaultValues:e,controllerRef:n,resolver:r,validationSchema:o,mode:a="onSubmit",reValidateMode:i="onChange"})=>{const l=qQ({defaultValues:e,resolver:null!=r?r:o?JQ(o):void 0,mode:a,reValidateMode:i}),s=t.useRef(null);return s.current||(s.current=eJ({methods:l,defaultValues:e,controllerRef:n})),{methods:l,FormRoot:s.current.FormRoot}},nJ=({onFormStateChange:e})=>{const{formState:n}=uQ();return t.useEffect((()=>{e(n)}),[n,e]),null},rJ=t.forwardRef(((e,n)=>{var{children:r,defaultValues:o,methods:a,controllerRef:i,onSubmit:l,onInvalidSubmit:s,onFormStateChange:c,resolver:d,validationSchema:u,mode:f="onSubmit",reValidateMode:h="onChange",noValidate:m=!0}=e,p=IC(e,["children","defaultValues","methods","controllerRef","onSubmit","onInvalidSubmit","onFormStateChange","resolver","validationSchema","mode","reValidateMode","noValidate"]);const g=qQ({defaultValues:o,resolver:null!=d?d:u?JQ(u):void 0,mode:f,reValidateMode:h}),v=null!=a?a:g,w=t.useMemo((()=>({submit:async()=>{await v.handleSubmit(l,s)()},getValues:()=>v.getValues(),setValue:v.setValue,trigger:v.trigger,reset:v.reset})),[v,l,s]);return t.useImperativeHandle(n,(()=>w),[w]),t.useEffect((()=>{if(i)return i.current=w,()=>{i.current=null}}),[i,w]),E(fQ,Object.assign({},v,{children:C("form",Object.assign({},p,{noValidate:m,onSubmit:v.handleSubmit(l,s),children:[c&&E(nJ,{onFormStateChange:c}),"function"==typeof r?r(v):r]}))}))})),oJ=({name:e,component:t,componentProps:n,rules:r,defaultValue:o,disabled:a=!1,shouldUnregister:i=!1,id:l,describedBy:s,valuePropName:c="value",changePropName:d="onChange",blurPropName:u="onBlur",refPropName:f="ref",errorMessagePropName:h="errorMessage",invalidPropName:m="error",parseValue:p,formatValue:v,onChange:w,onBlur:b})=>{const y=g(),x=l||`${e.replace(/\./g,"-")}-${y}`,{field:C,fieldState:{error:k,invalid:M}}=cQ({name:e,rules:r,disabled:a,defaultValue:o,shouldUnregister:i}),R=()=>{C.onBlur(),null==b||b()},I=v?v(C.value):C.value,O=Object.assign(Object.assign({},n),{id:x,name:C.name,disabled:a,"aria-invalid":M||void 0,"aria-describedby":s});return O[c]=I,O[d]=e=>{const t=(e=>{if(e&&"object"==typeof e&&"target"in e&&e.target&&"object"==typeof e.target){const t=e.target;return"checkbox"===t.type?t.checked:t.value}return e})(e),n=p?p(t,e):t;C.onChange(n),null==w||w(n,e)},u&&(O[u]=R),f&&(O[f]=C.ref),h&&(O[h]=null==k?void 0:k.message),m&&(O[m]=M),E(t,Object.assign({},O))},aJ=e=>{var{name:t,className:n}=e,r=IC(e,["name","className"]);const{getFieldState:o,formState:a}=uQ(),{error:i}=o(t,a);return(null==i?void 0:i.message)?E("p",Object.assign({},r,{className:LC("text-sm text-input-error mt-1",n),role:"alert",children:i.message})):null},iJ={valid:"text-text-g-contrast-high",invalid:"text-input-error",pending:"text-text-g-contrast-high"},lJ={valid:"text-primary",invalid:"text-input-error",pending:"text-text-g-contrast-low"},sJ=({values:e,rules:t,mode:n=["pending","valid","invalid"],className:r,itemClassName:o,labelStateClassName:a,iconStateClassName:i})=>{const l=new Set(n);return E("ul",{className:LC("mt-2 flex flex-col gap-3",r),children:t.map((t=>{const n=((e,t)=>!t.when||t.when(e)?t.validate(e)?"valid":"invalid":"pending")(e,t),r=l.has(n)?n:"pending";return C("li",{className:LC("flex items-center gap-2 typography-small2 ",iJ[r],null==a?void 0:a[r],o),children:[E(ak,{className:LC("size-4",lJ[r],null==i?void 0:i[r])}),E("span",{children:t.label})]},t.id)}))})},cJ=({options:e,loading:t=!1,buildFallbackOption:n})=>{const r=s((()=>new Map(e.map((e=>[e.value,e])))),[e]),o=e=>{if(null!=e)return r.get(e)};return{toOption:o,toOptionWithFallback:e=>{var r;if(null!=e)return null!==(r=o(e))&&void 0!==r?r:null==n?void 0:n(e,t)},toValue:e=>null==e?void 0:e.value,optionsByValue:r}};function dJ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function uJ(e){this._maxSize=e,this.clear()}uJ.prototype.clear=function(){this._size=0,this._values=Object.create(null)},uJ.prototype.get=function(e){return this._values[e]},uJ.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var fJ=/[^.^\]^[]+|(?=\[\]|\.\.)/g,hJ=/^\d+$/,mJ=/^\d/,pJ=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,gJ=/^\s*(['"]?)(.*?)(\1)\s*$/,vJ=new uJ(512);new uJ(512);var wJ=new uJ(512),bJ={split:xJ,normalizePath:yJ,getter:function(e,t){var n=yJ(e);return wJ.get(e)||wJ.set(e,(function(e){for(var r=0,o=n.length;r<o;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(EJ(t)||hJ.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,o,a,i,l=e.length;for(o=0;o<l;o++)(r=e[o])&&(CJ(r)&&(r='"'+r+'"'),a=!(i=EJ(r))&&/^\d+$/.test(r),t.call(n,r,i,a,o,e))}(Array.isArray(e)?e:xJ(e),t,n)}};function yJ(e){return vJ.get(e)||vJ.set(e,xJ(e).map((function(e){return e.replace(gJ,"$2")})))}function xJ(e){return e.match(fJ)||[""]}function EJ(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function CJ(e){return!EJ(e)&&(function(e){return e.match(mJ)&&!e.match(hJ)}(e)||function(e){return pJ.test(e)}(e))}const kJ=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,MJ=e=>e.match(kJ)||[];var RJ=e=>MJ(e).reduce(((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`),""),IJ=e=>((e,t)=>MJ(e).join(t).toLowerCase())(e,"_"),OJ={exports:{}};function AJ(e,t){var n=e.length,r=new Array(n),o={},a=n,i=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),l=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!l.has(e[0])||!l.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)o[a]||s(e[a],a,new Set);return r;function s(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!l.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var d=i.get(e)||new Set;if(t=(d=Array.from(d)).length){a.add(e);do{var u=d[--t];s(u,l.get(u),a)}while(t);a.delete(e)}r[--n]=e}}}OJ.exports=function(e){return AJ(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)},OJ.exports.array=AJ;var LJ=dJ(OJ.exports);const SJ=Object.prototype.toString,NJ=Error.prototype.toString,jJ=RegExp.prototype.toString,DJ="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ZJ=/^Symbol\((.*)\)(.*)$/;function VJ(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return DJ.call(e).replace(ZJ,"Symbol($1)");const r=SJ.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+NJ.call(e)+"]":"RegExp"===r?jJ.call(e):null}function TJ(e,t){let n=VJ(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=VJ(this[e],t);return null!==r?r:n}),2)}function BJ(e){return null==e?[]:[].concat(e)}let FJ,PJ,HJ,_J=/\$\{\s*(\w+)\s*\}/g;FJ=Symbol.toStringTag;class WJ{constructor(e,t,n,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[FJ]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],BJ(e).forEach((e=>{if(zJ.isError(e)){this.errors.push(...e.errors);const t=e.inner.length?e.inner:[e];this.inner.push(...t)}else this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}PJ=Symbol.hasInstance,HJ=Symbol.toStringTag;class zJ extends Error{static formatError(e,t){const n=t.label||t.path||"this";return t=Object.assign({},t,{path:n,originalPath:t.path}),"string"==typeof e?e.replace(_J,((e,n)=>TJ(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r,o){const a=new WJ(e,t,n,r);if(o)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[HJ]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,zJ)}static[PJ](e){return WJ[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let $J={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=null!=r&&r!==n?` (cast from the value \`${TJ(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${TJ(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${TJ(n,!0)}\``+o}},UJ={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},qJ={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},GJ={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},YJ={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${TJ(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${TJ(n,!0)}\``}return zJ.formatError($J.notType,e)}};Object.assign(Object.create(null),{mixed:$J,string:UJ,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:qJ,object:GJ,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:{isValue:"${path} field must be ${value}"},tuple:YJ});const KJ=e=>e&&e.__isYupSchema__;class XJ{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:o}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));return new XJ(e,((e,t)=>{var n;let i=a(...e)?r:o;return null!=(n=null==i?void 0:i(t))?n:t}))}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn(n,e,t);if(void 0===r||r===e)return e;if(!KJ(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}const QJ="$",JJ=".";class e0{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===QJ,this.isValue=this.key[0]===JJ,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?QJ:this.isValue?JJ:"";this.path=this.key.slice(n.length),this.getter=this.path&&bJ.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}e0.prototype.__isYupRef=!0;const t0=e=>null==e;function n0(e){function t({value:t,path:n="",options:r,originalValue:o,schema:a},i,l){const{name:s,test:c,params:d,message:u,skipAbsent:f}=e;let{parent:h,context:m,abortEarly:p=a.spec.abortEarly,disableStackTrace:g=a.spec.disableStackTrace}=r;function v(e){return e0.isRef(e)?e.getValue(t,h,m):e}function w(e={}){const r=Object.assign({value:t,originalValue:o,label:a.spec.label,path:e.path||n,spec:a.spec,disableStackTrace:e.disableStackTrace||g},d,e.params);for(const e of Object.keys(r))r[e]=v(r[e]);const i=new zJ(zJ.formatError(e.message||u,r),t,r.path,e.type||s,r.disableStackTrace);return i.params=r,i}const b=p?i:l;let y={path:n,parent:h,type:s,from:r.from,createError:w,resolve:v,options:r,originalValue:o,schema:a};const x=e=>{zJ.isError(e)?b(e):e?l(null):b(w())},E=e=>{zJ.isError(e)?b(e):i(e)};if(f&&t0(t))return x(!0);let C;try{var k;if(C=c.call(y,t,y),"function"==typeof(null==(k=C)?void 0:k.then)){if(r.sync)throw new Error(`Validation test of type: "${y.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(C).then(x,E)}}catch(e){return void E(e)}x(C)}return t.OPTIONS=e,t}function r0(e,t,n,r=n){let o,a,i;return t?(bJ.forEach(t,((l,s,c)=>{let d=s?l.slice(1,l.length-1):l,u="tuple"===(e=e.resolve({context:r,parent:o,value:n})).type,f=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${i}" must contain an index to the tuple element, e.g. "${i}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[f],e=u?e.spec.types[f]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${i} which is a type: "${e.type}")`);o=n,n=n&&n[d],e=e.fields[d]}a=d,i=s?"["+l+"]":"."+l})),{schema:e,parent:o,parentPath:a}):{parent:o,parentPath:t,schema:e}}class o0 extends Set{describe(){const e=[];for(const t of this.values())e.push(e0.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new o0(this.values())}merge(e,t){const n=this.clone();return e.forEach((e=>n.add(e))),t.forEach((e=>n.delete(e))),n}}function a0(e,t=new Map){if(KJ(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=a0(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,a0(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(a0(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=a0(o,t)}return n}class i0{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new o0,this._blacklist=new o0,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError($J.notType)})),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation((e=>{e.nonNullable()}))}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=a0(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Object.assign({},t.spec,n.spec);return n.spec=r,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,r,o;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(n=e.abortEarly)?n:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(o=e.disableStackTrace)?o:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({value:e},t)),r="ignore-optionality"===t.assert,o=n._cast(e,t);if(!1!==t.assert&&!n.isType(o)){if(r&&t0(o))return o;let a=TJ(e),i=TJ(o);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". \n\nattempted value: ${a} \n`+(i!==a?`result of cast: ${i}`:""))}return o}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault(t)),n}_validate(e,t={},n,r){let{path:o,originalValue:a=e,strict:i=this.spec.strict}=t,l=e;i||(l=this._cast(l,Object.assign({assert:!1},t)));let s=[];for(let e of Object.values(this.internalTests))e&&s.push(e);this.runTests({path:o,value:l,originalValue:a,options:t,tests:s},n,(e=>{if(e.length)return r(e,l);this.runTests({path:o,value:l,originalValue:a,options:t,tests:this.tests},n,r)}))}runTests(e,t,n){let r=!1,{tests:o,value:a,originalValue:i,path:l,options:s}=e,c=e=>{r||(r=!0,t(e,a))},d=e=>{r||(r=!0,n(e,a))},u=o.length,f=[];if(!u)return d([]);let h={value:a,originalValue:i,path:l,options:s,schema:this};for(let e=0;e<o.length;e++){(0,o[e])(h,c,(function(e){e&&(Array.isArray(e)?f.push(...e):f.push(e)),--u<=0&&d(f)}))}}asNestedTest({key:e,index:t,parent:n,parentPath:r,originalParent:o,options:a}){const i=null!=e?e:t;if(null==i)throw TypeError("Must include `key` or `index` for nested validations");const l="number"==typeof i;let s=n[i];const c=Object.assign({},a,{strict:!0,parent:n,value:s,originalValue:o[i],key:void 0,[l?"index":"key"]:i,path:l||i.includes(".")?`${r||""}[${l?i:`"${i}"`}]`:(r?`${r}.`:"")+e});return(e,t,n)=>this.resolve(c)._validate(s,c,t,n)}validate(e,t){var n;let r=this.resolve(Object.assign({},t,{value:e})),o=null!=(n=null==t?void 0:t.disableStackTrace)?n:r.spec.disableStackTrace;return new Promise(((n,a)=>r._validate(e,t,((e,t)=>{zJ.isError(e)&&(e.value=t),a(e)}),((e,t)=>{e.length?a(new zJ(e,t,void 0,void 0,o)):n(t)}))))}validateSync(e,t){var n;let r,o=this.resolve(Object.assign({},t,{value:e})),a=null!=(n=null==t?void 0:t.disableStackTrace)?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},t,{sync:!0}),((e,t)=>{throw zJ.isError(e)&&(e.value=t),e}),((t,n)=>{if(t.length)throw new zJ(t,e,void 0,void 0,a);r=n})),r}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(zJ.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(zJ.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):a0(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=n0({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=n0({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=$J.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=$J.notNull){return this.nullability(!1,e)}required(e=$J.required){return this.clone().withMutation((t=>t.nonNullable(e).defined(e)))}notRequired(){return this.clone().withMutation((e=>e.nullable().optional()))}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=$J.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=n0(t),o=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(o)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=BJ(e).map((e=>new e0(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push("function"==typeof t?new XJ(r,t):XJ.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=n0({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=$J.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n.internalTests.whiteList=n0({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}notOneOf(e,t=$J.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n.internalTests.blacklist=n0({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:r,optional:o,nullable:a}=t.spec,i={meta:r,label:n,optional:o,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return i}}i0.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])i0.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:a,schema:i}=r0(this,t,n,r.context);return i[e](o&&o[a],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])i0.prototype[e]=i0.prototype.oneOf;for(const e of["not","nope"])i0.prototype[e]=i0.prototype.notOneOf;const l0=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function s0(e){var t,n;const r=l0.exec(e);return r?{year:c0(r[1]),month:c0(r[2],1)-1,day:c0(r[3],1),hour:c0(r[4]),minute:c0(r[5]),second:c0(r[6]),millisecond:r[7]?c0(r[7].substring(0,3)):0,precision:null!=(t=null==(n=r[7])?void 0:n.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:c0(r[10]),minuteOffset:c0(r[11])}:null}function c0(e,t=0){return Number(e)||t}let d0=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,u0=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,f0=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,h0=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),m0=e=>t0(e)||e===e.trim(),p0={}.toString();function g0(){return new v0}class v0 extends i0{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation((()=>{this.transform(((e,t,n)=>{if(!n.spec.coerce||n.isType(e))return e;if(Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===p0?e:r}))}))}required(e){return super.required(e).withMutation((t=>t.test({message:e||$J.required,name:"required",skipAbsent:!0,test:e=>!!e.length})))}notRequired(){return super.notRequired().withMutation((e=>(e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e)))}length(e,t=UJ.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=UJ.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=UJ.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let n,r,o=!1;return t&&("object"==typeof t?({excludeEmptyString:o=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||UJ.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&o||-1!==t.search(e)})}email(e=UJ.email){return this.matches(d0,{name:"email",message:e,excludeEmptyString:!0})}url(e=UJ.url){return this.matches(u0,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=UJ.uuid){return this.matches(f0,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,n,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:n}=e):r=e),this.matches(h0,{name:"datetime",message:r||UJ.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||UJ.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=s0(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||UJ.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=s0(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=UJ.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:m0})}lowercase(e=UJ.lowercase){return this.transform((e=>t0(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>t0(e)||e===e.toLowerCase()})}uppercase(e=UJ.uppercase){return this.transform((e=>t0(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>t0(e)||e===e.toUpperCase()})}}g0.prototype=v0.prototype;let w0=new Date("");class b0 extends i0{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation((()=>{this.transform(((e,t,n)=>!n.spec.coerce||n.isType(e)||null===e?e:(e=function(e){const t=s0(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(n=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}(e),isNaN(e)?b0.INVALID_DATE:new Date(e))))}))}prepareParam(e,t){let n;if(e0.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=qJ.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(n)}})}max(e,t=qJ.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(n)}})}}function y0(e,t){let n=1/0;return e.some(((e,r)=>{var o;if(null!=(o=t.path)&&o.includes(e))return n=r,!0})),n}function x0(e){return(t,n)=>y0(e,t)-y0(e,n)}b0.INVALID_DATE=w0;const E0=(e,t,n)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return n.isType(r)?r:e};function C0(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=C0(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=C0(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(C0)}):"optional"in e?e.optional():e}let k0=e=>"[object Object]"===Object.prototype.toString.call(e);function M0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}const R0=x0([]);function I0(e){return new O0(e)}class O0 extends i0{constructor(e){super({type:"object",check:e=>k0(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=R0,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{e&&this.shape(e)}))}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let o=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,i=[].concat(this._nodes,Object.keys(r).filter((e=>!this._nodes.includes(e)))),l={},s=Object.assign({},t,{parent:l,__validating:t.__validating||!1}),c=!1;for(const e of i){let n=o[e],i=e in r;if(n){let o,a=r[e];s.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:l});let i=n instanceof i0?n.spec:void 0,d=null==i?void 0:i.strict;if(null!=i&&i.strip){c=c||e in r;continue}o=t.__validating&&d?r[e]:n.cast(r[e],s),void 0!==o&&(l[e]=o)}else i&&!a&&(l[e]=r[e]);i===e in l&&l[e]===r[e]||(c=!0)}return c?l:r}_validate(e,t={},n,r){let{from:o=[],originalValue:a=e,recursive:i=this.spec.recursive}=t;t.from=[{schema:this,value:a},...o],t.__validating=!0,t.originalValue=a,super._validate(e,t,n,((e,o)=>{if(!i||!k0(o))return void r(e,o);a=a||o;let l=[];for(let e of this._nodes){let n=this.fields[e];n&&!e0.isRef(n)&&l.push(n.asNestedTest({options:t,key:e,parent:o,parentPath:t.path,originalParent:a}))}this.runTests({tests:l,value:o,originalValue:a,options:t},n,(t=>{r(t.sort(this._sortErrors).concat(e),o)}))}))}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];n[e]=void 0===r?t:r}return t.withMutation((t=>t.setFields(n,[...this._excludedEdges,...e._excludedEdges])))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach((n=>{var r;const o=this.fields[n];let a=e;null!=(r=a)&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[n]})),t[n]=o&&"getDefault"in o?o.getDefault(a):void 0})),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=function(e,t=[]){let n=[],r=new Set,o=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=bJ.split(e)[0];r.add(a),o.has(`${t}-${a}`)||n.push([t,a])}for(const t of Object.keys(e)){let n=e[t];r.add(t),e0.isRef(n)&&n.isSibling?a(n.path,t):KJ(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return LJ.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=x0(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation((n=>{let r=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),r)}))}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return C0(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter((([t,n])=>e.includes(t)&&e.includes(n))))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let r=bJ.getter(e,!0);return this.transform((o=>{if(!o)return o;let a=o;return((e,t)=>{const n=[...bJ.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),o=bJ.getter(bJ.join(n),!0)(e);return!(!o||!(r in o))})(o,e)&&(a=Object.assign({},o),n||delete a[e],a[t]=r(o)),a}))}json(){return this.transform(E0)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||GJ.exact,test(e){if(null==e)return!0;const t=M0(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=GJ.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=M0(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=GJ.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>{if(!t)return t;const n={};for(const r of Object.keys(t))n[e(r)]=t[r];return n}))}camelCase(){return this.transformKeys(RJ)}snakeCase(){return this.transformKeys(IJ)}constantCase(){return this.transformKeys((e=>IJ(e).toUpperCase()))}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[o,a]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[o]})),n.fields[o]=a.describe(t)}return n}}I0.prototype=O0.prototype;const A0=({open:t,onOpenChange:n,title:r,description:o,children:a,confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:s,onCancel:c,onClose:d,trigger:u,typeToConfirm:f,hideCancelButton:h=!1,isLoading:m=!1,testId:p,cancelClassName:g,confirmClassName:v})=>{const w=!!f,b=e.useMemo((()=>I0({confirmInput:g0().required("This field is required.").test("type-to-confirm",`Please type '${f}' to proceed`,(e=>e===f))})),[f]),{methods:y,FormRoot:x}=tJ({defaultValues:{confirmInput:""},validationSchema:b,mode:"onTouched",reValidateMode:"onChange"}),k=y.formState.isValid;e.useEffect((()=>{t||y.reset()}),[t]);const M=()=>{null==s||s()};return C(HU,{open:t,onOpenChange:e=>{m||(e||null==d||d(),null==n||n(e))},children:[u&&E(_U,{asChild:!0,children:u}),C($U,{"data-testid":p,children:[C(UU,{children:[E(GU,{"data-testid":p&&`${p}-title`,children:r}),o&&E(YU,{"data-testid":p&&`${p}-description`,children:o})]}),a,w&&C(x,{className:"flex flex-col gap-4 w-full",onSubmit:M,children:[C("p",{className:"typography-small1 text-text-contrast-max",children:["Type “",f,"” to proceed."]}),E(oJ,{name:"confirmInput",component:mk,componentProps:{label:"Type to confirm",required:!0,hasClearIcon:!0,keepFooterSpace:!0,fullwidth:!0,testId:p&&`${p}-type-to-confirm-input`},disabled:m})]}),C(qU,{children:[!h&&E(XU,{className:g,"data-testid":p&&`${p}-cancel-button`,onClick:()=>{null==c||c(),null==d||d()},disabled:m,children:l}),C(KU,{type:"button",disabled:m||w&&!k,onClick:e=>{e.preventDefault(),w?y.handleSubmit(M)():null==s||s()},className:v,"data-testid":p&&`${p}-confirm-button`,children:[m&&E(SC,{}),i]})]})]})]})};A0.displayName="ConfirmDialog";const L0=({open:e,onOpenChange:t,title:n,description:r,children:o,trigger:a,confirmAction:i,cancelAction:l,extraAction:s,scrollable:c=!1,className:d,headerClassName:u,titleClassName:f,descriptionClassName:h,bodyClassName:m,footerClassName:p,formId:g,testId:v})=>{var w,b,y,x,k,M,R,I,O;const A=i||l||s;return C(aU,{open:e,onOpenChange:t,children:[a&&E(iU,{asChild:!0,children:a}),C(dU,{className:d,"data-testid":v,children:[C(uU,{className:u,children:[n&&E(mU,{className:f,"data-testid":v&&`${v}-title`,children:n}),r&&E(pU,{className:h,"data-testid":v&&`${v}-description`,children:r})]}),o&&E(fU,{className:m,scrollable:c,children:o}),A&&C(hU,{className:LC(s&&"justify-between",p),children:[s&&E(NC,{type:null!==(w=s.type)&&void 0!==w?w:"button",variant:null!==(b=s.variant)&&void 0!==b?b:"outline",color:null!==(y=s.color)&&void 0!==y?y:"secondary",fullwidth:!1,disabled:s.disabled,isLoading:s.isLoading,onClick:s.onClick,className:s.className,"data-testid":v&&`${v}-extra-button`,children:s.label}),C("div",{className:"flex items-center gap-4",children:[l&&E(NC,{type:null!==(x=l.type)&&void 0!==x?x:"button",variant:null!==(k=l.variant)&&void 0!==k?k:"outline",color:null!==(M=l.color)&&void 0!==M?M:"primary",fullwidth:!1,disabled:l.disabled,isLoading:l.isLoading,onClick:l.onClick,className:l.className,"data-testid":v&&`${v}-cancel-button`,children:l.label}),i&&E(NC,{type:g?"submit":null!==(R=i.type)&&void 0!==R?R:"button",form:g,variant:null!==(I=i.variant)&&void 0!==I?I:"solid",color:null!==(O=i.color)&&void 0!==O?O:"primary",fullwidth:!1,disabled:i.disabled,isLoading:i.isLoading,onClick:i.onClick,className:i.className,"data-testid":v&&`${v}-confirm-button`,children:i.label})]})]})]})]})};function S0(e,n,r){const o=[];let a=[];const i=e=>{var t,i;if(0===a.length)return;const l=a;a=[];const s=null!==(i=null===(t=l.find((e=>n.includes(e.value))))||void 0===t?void 0:t.value)&&void 0!==i?i:"";o.push(E(nz,{value:s,onValueChange:e=>{var t;const n=l.find((t=>t.value===e));n&&(null==r||r(e,n),null===(t=n.onClick)||void 0===t||t.call(n))},children:l.map((e=>E(sz,{value:e.value,disabled:e.disabled,icon:e.icon,"data-testid":e.testId,children:e.label},e.value)))},e))};return e.forEach(((e,l)=>{var s;if("item"!==e.type||"radio"!==e.item.type)if(i(`radio-${l}`),"separator"!==e.type)if("label"!==e.type)if("custom"!==e.type)if("submenu"!==e.type){if("item"===e.type){const t=e.item,a=null!==(s=t.checked)&&void 0!==s?s:n.includes(t.value);if("checkbox"===t.type)return void o.push(E(lz,{checked:a,disabled:t.disabled,"data-testid":t.testId,onCheckedChange:()=>{var e;null==r||r(t.value,t),null===(e=t.onClick)||void 0===e||e.call(t)},children:t.label},t.value));o.push(E(iz,{selected:a,icon:t.icon,disabled:t.disabled,className:LC(t.danger&&"text-red-500"),"data-testid":t.testId,onSelect:()=>{var e;null==r||r(t.value,t),null===(e=t.onClick)||void 0===e||e.call(t)},children:t.label},t.value))}}else o.push(C(tz,{children:[C(rz,{disabled:e.disabled,children:[C("div",{className:"flex shrink-0 flex-row gap-1",children:[E("span",{className:"size-4"}),e.icon]}),e.label]}),E(oz,{children:S0(e.items,n,r)})]},`sub-${l}`));else o.push(E(t.Fragment,{children:e.render()},`custom-${l}`));else o.push(E(cz,{children:e.label},`lbl-${l}`));else o.push(E(dz,{},`sep-${l}`));else a.push(e.item)})),i("radio-end"),o}L0.displayName="FormDialog";const N0=({trigger:e,items:t,selectedValues:n=[],onSelect:r,header:o,open:a,onOpenChange:i,align:l="start",side:s="bottom",sideOffset:c=4,contentClassName:d,testId:u})=>E("div",{onClick:e=>e.stopPropagation(),children:C(XW,{open:a,onOpenChange:i,children:[e&&E(QW,{asChild:!0,children:e}),C(az,{align:l,side:s,sideOffset:c,className:d,"data-testid":u,children:[o&&E("div",{className:"sticky top-0 z-10 bg-modal-surface border-b border-[var(--dropdown-menu-seperator-bg)]",children:o}),S0(t,n,r)]})]})});N0.displayName="Menu";const j0=e=>String(e).length>10?e/1e3:e,D0=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},Z0=e=>{const t=new Date(e);return t.setHours(23,59,59,999),t},V0=()=>{const e=D0(new Date);return{startTime:e,endTime:Z0(e)}},T0=e=>{const t=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());return j0(t)},B0={"main-primary":"--main-primary","main-secondary":"--main-secondary","main-tertiary":"--main-tertiary","brand-midnight-blue":"--brand-midnight-blue","brand-columbia-blue":"--brand-columbia-blue","brand-background":"--brand-background","brand-lemon-glacier":"--brand-lemon-glacier","primary-5":"--ramps-primary-5","primary-10":"--ramps-primary-10","primary-20":"--ramps-primary-20","primary-30":"--ramps-primary-30","primary-40":"--ramps-primary-40","primary-50":"--ramps-primary-50","primary-60":"--ramps-primary-60","primary-70":"--ramps-primary-70","primary-80":"--ramps-primary-80","primary-90":"--ramps-primary-90","primary-100":"--ramps-primary-100","primary-110":"--ramps-primary-110","primary-120":"--ramps-primary-120","primary-130":"--ramps-primary-130","primary-140":"--ramps-primary-140","primary-150":"--ramps-primary-150","secondary-5":"--ramps-secondary-5","secondary-10":"--ramps-secondary-10","secondary-20":"--ramps-secondary-20","secondary-30":"--ramps-secondary-30","secondary-40":"--ramps-secondary-40","secondary-50":"--ramps-secondary-50","secondary-60":"--ramps-secondary-60","secondary-70":"--ramps-secondary-70","secondary-80":"--ramps-secondary-80","secondary-90":"--ramps-secondary-90","secondary-100":"--ramps-secondary-100","secondary-110":"--ramps-secondary-110","secondary-120":"--ramps-secondary-120","secondary-130":"--ramps-secondary-130","secondary-140":"--ramps-secondary-140","secondary-150":"--ramps-secondary-150","tertiary-5":"--ramps-tertiary-5","tertiary-10":"--ramps-tertiary-10","tertiary-20":"--ramps-tertiary-20","tertiary-30":"--ramps-tertiary-30","tertiary-40":"--ramps-tertiary-40","tertiary-50":"--ramps-tertiary-50","tertiary-60":"--ramps-tertiary-60","tertiary-70":"--ramps-tertiary-70","tertiary-80":"--ramps-tertiary-80","tertiary-90":"--ramps-tertiary-90","tertiary-100":"--ramps-tertiary-100","tertiary-110":"--ramps-tertiary-110","tertiary-120":"--ramps-tertiary-120","tertiary-130":"--ramps-tertiary-130","tertiary-140":"--ramps-tertiary-140","tertiary-150":"--ramps-tertiary-150","grey-5":"--ramps-grey-5","grey-10":"--ramps-grey-10","grey-20":"--ramps-grey-20","grey-30":"--ramps-grey-30","grey-40":"--ramps-grey-40","grey-50":"--ramps-grey-50","grey-60":"--ramps-grey-60","grey-70":"--ramps-grey-70","grey-80":"--ramps-grey-80","grey-90":"--ramps-grey-90","grey-100":"--ramps-grey-100","grey-110":"--ramps-grey-110","grey-120":"--ramps-grey-120","grey-130":"--ramps-grey-130","grey-140":"--ramps-grey-140","grey-150":"--ramps-grey-150","grey2-50":"--ramps-grey2-50","grey2-100":"--ramps-grey2-100","grey2-200":"--ramps-grey2-200","grey2-300":"--ramps-grey2-300","grey2-400":"--ramps-grey2-400","grey2-500":"--ramps-grey2-500","grey2-600":"--ramps-grey2-600","grey2-700":"--ramps-grey2-700","grey2-800":"--ramps-grey2-800","grey2-900":"--ramps-grey2-900","grey2-950":"--ramps-grey2-950","info-50":"--ramps-info-50","info-100":"--ramps-info-100","info-200":"--ramps-info-200","info-300":"--ramps-info-300","info-400":"--ramps-info-400","info-500":"--ramps-info-500","info-600":"--ramps-info-600","info-700":"--ramps-info-700","info-800":"--ramps-info-800","info-900":"--ramps-info-900","info-950":"--ramps-info-950","success-50":"--ramps-success-50","success-100":"--ramps-success-100","success-200":"--ramps-success-200","success-300":"--ramps-success-300","success-400":"--ramps-success-400","success-500":"--ramps-success-500","success-600":"--ramps-success-600","success-700":"--ramps-success-700","success-800":"--ramps-success-800","success-900":"--ramps-success-900","success-950":"--ramps-success-950","warning-50":"--ramps-warning-50","warning-100":"--ramps-warning-100","warning-200":"--ramps-warning-200","warning-300":"--ramps-warning-300","warning-400":"--ramps-warning-400","warning-500":"--ramps-warning-500","warning-600":"--ramps-warning-600","warning-700":"--ramps-warning-700","warning-800":"--ramps-warning-800","warning-900":"--ramps-warning-900","warning-950":"--ramps-warning-950","error-50":"--ramps-error-50","error-100":"--ramps-error-100","error-200":"--ramps-error-200","error-300":"--ramps-error-300","error-400":"--ramps-error-400","error-500":"--ramps-error-500","error-600":"--ramps-error-600","error-700":"--ramps-error-700","error-800":"--ramps-error-800","error-900":"--ramps-error-900","error-950":"--ramps-error-950",primary:"--state-primary-default","primary-hover":"--state-primary-hover","primary-stroke":"--state-primary-stroke","primary-hover-bg":"--state-primary-hover-bg","primary-pressed":"--state-primary-pressed","primary-active":"--state-primary-active","primary-text-solid":"--state-primary-text-solid","primary-text-outline":"--state-primary-text-outline","primary-text-hover":"--state-primary-text-hover","primary-text-pressed":"--state-primary-text-pressed",secondary:"--state-secondary-default","secondary-hover":"--state-secondary-hover","secondary-stroke":"--state-secondary-stroke","secondary-hover-bg":"--state-secondary-hover-bg","secondary-pressed":"--state-secondary-pressed","secondary-active":"--state-secondary-active","secondary-text-solid":"--state-secondary-text-solid","secondary-text-outline":"--state-secondary-text-outline","secondary-text-hover":"--state-secondary-text-hover","secondary-text-pressed":"--state-secondary-text-pressed",tertiary:"--state-tertiary-default","tertiary-hover":"--state-tertiary-hover","tertiary-stroke":"--state-tertiary-stroke","tertiary-hover-bg":"--state-tertiary-hover-bg","tertiary-pressed":"--state-tertiary-pressed","tertiary-active":"--state-tertiary-active","tertiary-text-solid":"--state-tertiary-text-solid","tertiary-text-outline":"--state-tertiary-text-outline","tertiary-text-hover":"--state-tertiary-text-hover","tertiary-text-pressed":"--state-tertiary-text-pressed",info:"--state-info-default","info-hover":"--state-info-hover","info-stroke":"--state-info-stroke","info-hover-bg":"--state-info-hover-bg","info-pressed":"--state-info-pressed","info-active":"--state-info-active","info-text-solid":"--state-info-text-solid","info-text-outline":"--state-info-text-outline","info-text-hover":"--state-info-text-hover","info-text-pressed":"--state-info-text-pressed",success:"--state-success-default","success-hover":"--state-success-hover","success-stroke":"--state-success-stroke","success-hover-bg":"--state-success-hover-bg","success-pressed":"--state-success-pressed","success-active":"--state-success-active","success-text-solid":"--state-success-text-solid","success-text-outline":"--state-success-text-outline","success-text-hover":"--state-success-text-hover","success-text-pressed":"--state-success-text-pressed",warning:"--state-warning-default","warning-hover":"--state-warning-hover","warning-stroke":"--state-warning-stroke","warning-hover-bg":"--state-warning-hover-bg","warning-pressed":"--state-warning-pressed","warning-active":"--state-warning-active","warning-text-solid":"--state-warning-text-solid","warning-text-outline":"--state-warning-text-outline","warning-text-hover":"--state-warning-text-hover","warning-text-pressed":"--state-warning-text-pressed",error:"--state-error-default","error-hover":"--state-error-hover","error-stroke":"--state-error-stroke","error-hover-bg":"--state-error-hover-bg","error-pressed":"--state-error-pressed","error-active":"--state-error-active","error-text-solid":"--state-error-text-solid","error-text-outline":"--state-error-text-outline","error-text-hover":"--state-error-text-hover","error-text-pressed":"--state-error-text-pressed","disable-solid":"--state-disable-solid","disable-outline":"--state-disable-outline","text-black":"--text-black","text-contrast-low":"--text-contrast-low","text-contrast-medium":"--text-contrast-medium","text-contrast-high":"--text-contrast-high","text-contrast-max":"--text-contrast-max","text-g-contrast-low":"--text-g-contrast-low","text-g-contrast-medium":"--text-g-contrast-medium","text-g-contrast-high":"--text-g-contrast-high","text-dark":"--text-dark","text-medium":"--text-medium","text-light":"--text-light","text-grey-dark":"--text-grey-dark","text-grey-medium":"--text-grey-medium","text-grey-light":"--text-grey-light","text-white":"--text-white","input-default-text":"--input-default-text","input-default-stroke":"--input-default-stroke","input-filled-text":"--input-filled-text","input-active-stroke":"--input-active-stroke","input-disable-text":"--input-disable-text","input-disable-stroke":"--input-disable-stroke","input-disable-bg":"--input-disable-bg","input-label-bg":"--input-label-bg","input-error":"--input-error","function-default-solid":"--function-default-solid","function-default-hover":"--function-default-hover","function-default-hover-bg":"--function-default-hover-bg","function-default-stroke":"--function-default-stroke","function-default-icon":"--function-default-icon","function-default-outline-icon":"--function-default-outline-icon","function-active-solid":"--function-active-solid","function-active-hover":"--function-active-hover","function-active-hover-bg":"--function-active-hover-bg","function-active-stroke":"--function-active-stroke","function-active-icon":"--function-active-icon","modal-surface":"--modal-surface","modal-highlight":"--modal-highlight","modal-overlay":"--modal-overlay","bg-bg1":"--bg-bg1","bg-bg2":"--bg-bg2","bg-bg3":"--bg-bg3","bg-stroke1":"--bg-stroke1","bg-stroke2":"--bg-stroke2","state-primary-text-solid":"--state-primary-text-solid","state-primary-text-hover":"--state-primary-text-hover","state-secondary-text-solid":"--state-secondary-text-solid","state-secondary-text-hover":"--state-secondary-text-hover","state-tertiary-text-solid":"--state-tertiary-text-solid","state-tertiary-text-hover":"--state-tertiary-text-hover","state-info-text-solid":"--state-info-text-solid","state-info-text-hover":"--state-info-text-hover","state-success-text-solid":"--state-success-text-solid","state-success-text-hover":"--state-success-text-hover","state-warning-text-solid":"--state-warning-text-solid","state-warning-text-hover":"--state-warning-text-hover","state-error-text-solid":"--state-error-text-solid","state-error-text-hover":"--state-error-text-hover","base-bg":"--base-color-bg","base-bg2":"--base-color-bg2","base-bg3":"--base-color-bg3","base-workspace-stroke":"--base-color-workspace-stroke","base-guideline-stroke":"--base-color-guideline-stroke","base-popup":"--base-color-popup","base-popup-highlight":"--base-color-popup-highlight","base-popup-curtain":"--base-color-popup-curtain","base-popup-foreground":"--base-color-popup-foreground","common-white":"--common-white","common-black":"--common-black","brand-rvl-yellow":"--brand-rvl-yellow","brand-rvl-grey":"--brand-rvl-grey","others-1":"--others-1","others-2":"--others-2","others-3":"--others-3","others-4":"--others-4","others-5":"--others-5","others-6":"--others-6","others-7":"--others-7","others-8":"--others-8","others-9":"--others-9","others-10":"--others-10","others-11":"--others-11","others-12":"--others-12","others-13":"--others-13","others-14":"--others-14","others-15":"--others-15","others-16":"--others-16","others-17":"--others-17","others-18":"--others-18","others-19":"--others-19","others-20":"--others-20","others-21":"--others-21","others-22":"--others-22","others-23":"--others-23","others-24":"--others-24","others-25":"--others-25","others-26":"--others-26","others-27":"--others-27","others-28":"--others-28","others-29":"--others-29","others-30":"--others-30","others-31":"--others-31","others-32":"--others-32","others-33":"--others-33","others-34":"--others-34","others-35":"--others-35","page-bg-main":"--page-bg-main","page-bg-circle-top-g-in":"--page-bg-circle-top-g-in","page-bg-circle-top-g-out":"--page-bg-circle-top-g-out","page-bg-circle-bottom-g-in":"--page-bg-circle-bottom-g-in","page-bg-circle-bottom-g-out":"--page-bg-circle-bottom-g-out","modal-line":"--modal-line","bg-bg4":"--bg-bg4","bg-bg5":"--bg-bg5","bg-stroke3":"--bg-stroke3","bg-stroke4":"--bg-stroke4","bg-stroke5":"--bg-stroke5",background:"--background",foreground:"--foreground",surface:"--surface","surface-foreground":"--surface-foreground","primary-foreground":"--primary-foreground","secondary-foreground":"--secondary-foreground","tertiary-foreground":"--tertiary-foreground","info-foreground":"--info-foreground","success-foreground":"--success-foreground","warning-foreground":"--warning-foreground","error-foreground":"--error-foreground","grey-foreground":"--grey-foreground","grey2-foreground":"--grey2-foreground","primary-transparent-8":"--transparent-primary-8","primary-transparent-12":"--transparent-primary-12","primary-transparent-16":"--transparent-primary-16","primary-transparent-24":"--transparent-primary-24","primary-transparent-32":"--transparent-primary-32","primary-transparent-48":"--transparent-primary-48","secondary-transparent-8":"--transparent-secondary-8","secondary-transparent-12":"--transparent-secondary-12","secondary-transparent-16":"--transparent-secondary-16","secondary-transparent-24":"--transparent-secondary-24","secondary-transparent-32":"--transparent-secondary-32","secondary-transparent-48":"--transparent-secondary-48","tertiary-transparent-8":"--transparent-tertiary-8","tertiary-transparent-12":"--transparent-tertiary-12","tertiary-transparent-16":"--transparent-tertiary-16","tertiary-transparent-24":"--transparent-tertiary-24","tertiary-transparent-32":"--transparent-tertiary-32","tertiary-transparent-48":"--transparent-tertiary-48","info-transparent-8":"--transparent-info-8","info-transparent-12":"--transparent-info-12","info-transparent-16":"--transparent-info-16","info-transparent-24":"--transparent-info-24","info-transparent-32":"--transparent-info-32","info-transparent-48":"--transparent-info-48","success-transparent-8":"--transparent-success-8","success-transparent-12":"--transparent-success-12","success-transparent-16":"--transparent-success-16","success-transparent-24":"--transparent-success-24","success-transparent-32":"--transparent-success-32","success-transparent-48":"--transparent-success-48","warning-transparent-8":"--transparent-warning-8","warning-transparent-12":"--transparent-warning-12","warning-transparent-16":"--transparent-warning-16","warning-transparent-24":"--transparent-warning-24","warning-transparent-32":"--transparent-warning-32","warning-transparent-48":"--transparent-warning-48","error-transparent-8":"--transparent-error-8","error-transparent-12":"--transparent-error-12","error-transparent-16":"--transparent-error-16","error-transparent-24":"--transparent-error-24","error-transparent-32":"--transparent-error-32","error-transparent-48":"--transparent-error-48","grey-transparent-8":"--transparent-grey-8","grey-transparent-12":"--transparent-grey-12","grey-transparent-16":"--transparent-grey-16","grey-transparent-24":"--transparent-grey-24","grey-transparent-32":"--transparent-grey-32","grey-transparent-48":"--transparent-grey-48","grey2-transparent-8":"--transparent-grey2-8","grey2-transparent-12":"--transparent-grey2-12","grey2-transparent-16":"--transparent-grey2-16","grey2-transparent-24":"--transparent-grey2-24","grey2-transparent-32":"--transparent-grey2-32","grey2-transparent-48":"--transparent-grey2-48","white-transparent-8":"--transparent-white-8","white-transparent-12":"--transparent-white-12","white-transparent-16":"--transparent-white-16","white-transparent-24":"--transparent-white-24","white-transparent-32":"--transparent-white-32","white-transparent-48":"--transparent-white-48","black-transparent-8":"--transparent-black-8","black-transparent-12":"--transparent-black-12","black-transparent-16":"--transparent-black-16","black-transparent-24":"--transparent-black-24","black-transparent-32":"--transparent-black-32","black-transparent-48":"--transparent-black-48"};function F0(e,t=document){if("undefined"==typeof window)return"";const n=t instanceof Document?t.documentElement:t,r=e in B0?B0[e]:e.startsWith("--")?e:`--${e}`;return getComputedStyle(n).getPropertyValue(r).trim()}function P0(e=Object.keys(B0),t){return e.reduce(((e,n)=>(e[n]=F0(n,t),e)),{})}const H0=e=>{if(e.startsWith("color(")){const t=e.match(/([\d.]+)/g);if(t&&t.length>=3){const[e,n,r]=t.slice(0,3).map((e=>Math.round(255*parseFloat(e))));let o=`#${[e,n,r].map((e=>("0"+e.toString(16)).slice(-2))).join("")}`;if(4===t.length){o+=("0"+Math.round(255*parseFloat(t[3])).toString(16)).slice(-2)}return o}}else{if(e.startsWith("#"))return e;{const t=e.match(/\d+/g);if(t&&t.length>=3)return`#${t.slice(0,3).map((e=>("0"+parseInt(e).toString(16)).slice(-2))).join("")}`}}return e};export{Zk as ActionButton,HU as AlertDialog,KU as AlertDialogAction,XU as AlertDialogCancel,$U as AlertDialogContent,YU as AlertDialogDescription,qU as AlertDialogFooter,UU as AlertDialogHeader,zU as AlertDialogOverlay,WU as AlertDialogPortal,GU as AlertDialogTitle,_U as AlertDialogTrigger,oS as Avatar,aS as AvatarGroup,sS as Badge,NC as Button,Ej as Calendar,LL as Checkbox,yS as Collapsible,A0 as ConfirmDialog,Kz as DataTable,ZV as DatePicker,aU as Dialog,fU as DialogBody,sU as DialogClose,dU as DialogContent,pU as DialogDescription,hU as DialogFooter,uU as DialogHeader,cU as DialogOverlay,lU as DialogPortal,mU as DialogTitle,iU as DialogTrigger,JA as Dropdown,XW as DropdownMenu,lz as DropdownMenuCheckboxItem,az as DropdownMenuContent,JW as DropdownMenuGroup,iz as DropdownMenuItem,cz as DropdownMenuLabel,ez as DropdownMenuPortal,nz as DropdownMenuRadioGroup,sz as DropdownMenuRadioItem,dz as DropdownMenuSeparator,uz as DropdownMenuShortcut,tz as DropdownMenuSub,oz as DropdownMenuSubContent,rz as DropdownMenuSubTrigger,QW as DropdownMenuTrigger,oJ as Field,aJ as FieldMessage,kK as FocusedScrollView,FL as Footer,rJ as Form,L0 as FormDialog,Ek as Icon,TL as Input,eq as InputFilter,ZL as Label,SC as Loading,wk as MaskedTextInput,N0 as Menu,iz as MenuItem,cz as MenuLabel,dz as MenuSeparator,BL as Navbar,kk as NumberInput,TV as OtpInput,BV as OtpInputGroup,Ck as PasswordInput,TZ as Popover,FZ as PopoverContent,BZ as PopoverTrigger,FV as ProgressBar,xX as RadioGroup,EX as RadioGroupItem,IK as ScrollArea,QU as Search,dS as SeverityBadge,Dq as Slider,Iz as Switch,B0 as THEME_COLOR_KEYS,PV as Table,_V as TableBody,qV as TableCaption,UV as TableCell,WV as TableFooter,$V as TableHead,HV as TableHeader,GV as TablePagination,zV as TableRow,Vk as Tabs,jk as Text,Lk as TextArea,mk as TextInput,iK as Toast,lK as ToastAction,sK as ToastClose,dK as ToastDescription,oK as ToastProvider,cK as ToastTitle,aK as ToastViewport,yK as Toaster,$G as Tooltip,qG as TooltipArrow,GG as TooltipContent,zG as TooltipProvider,YG as TooltipSimple,UG as TooltipTrigger,CK as Tree,xK as TreeItem,sJ as ValidationHintList,LC as cn,eJ as createControlledForm,JQ as createYupResolver,Z0 as getEndDateOfDay,bk as getLucideIconNames,D0 as getStartDateOfDay,V0 as getStartEndTimestampOfDay,F0 as getThemeColor,P0 as getThemeColors,T0 as getTimestampUTC,mK as reducer,j0 as resloveTimestamp,H0 as srgbToHex,wK as toast,tJ as useControlledForm,cJ as useOptionBridge,EK as usePrevious,bK as useToast};
55
55
  //# sourceMappingURL=bundle.js.map