@ttianqii/takaui 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/takaui.cjs +18 -18
  2. package/dist/takaui.js +4140 -4639
  3. package/package.json +2 -2
package/dist/takaui.cjs CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),Es=require("react-dom");function js(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=js(J),Jt=js(Es);var fn={exports:{}},$t={};var Ro;function Sl(){if(Ro)return $t;Ro=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return $t.Fragment=t,$t.jsx=n,$t.jsxs=n,$t}var Ft={};var Mo;function Cl(){return Mo||(Mo=1,process.env.NODE_ENV!=="production"&&(function(){function e(k){if(k==null)return null;if(typeof k=="function")return k.$$typeof===T?null:k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case x:return"Fragment";case w:return"Profiler";case y:return"StrictMode";case $:return"Suspense";case O:return"SuspenseList";case E:return"Activity"}if(typeof k=="object")switch(typeof k.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),k.$$typeof){case m:return"Portal";case S:return k.displayName||"Context";case C:return(k._context.displayName||"Context")+".Consumer";case D:var z=k.render;return k=k.displayName,k||(k=z.displayName||z.name||"",k=k!==""?"ForwardRef("+k+")":"ForwardRef"),k;case b:return z=k.displayName||null,z!==null?z:e(k.type)||"Memo";case P:z=k._payload,k=k._init;try{return e(k(z))}catch{}}return null}function t(k){return""+k}function n(k){try{t(k);var z=!1}catch{z=!0}if(z){z=console;var K=z.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&k[Symbol.toStringTag]||k.constructor.name||"Object";return K.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(k)}}function r(k){if(k===x)return"<>";if(typeof k=="object"&&k!==null&&k.$$typeof===P)return"<...>";try{var z=e(k);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function o(){var k=R.A;return k===null?null:k.getOwner()}function s(){return Error("react-stack-top-frame")}function i(k){if(W.call(k,"key")){var z=Object.getOwnPropertyDescriptor(k,"key").get;if(z&&z.isReactWarning)return!1}return k.key!==void 0}function l(k,z){function K(){_||(_=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}K.isReactWarning=!0,Object.defineProperty(k,"key",{get:K,configurable:!0})}function u(){var k=e(this.type);return F[k]||(F[k]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),k=this.props.ref,k!==void 0?k:null}function d(k,z,K,X,le,ue){var A=K.ref;return k={$$typeof:v,type:k,key:z,props:K,_owner:X},(A!==void 0?A:null)!==null?Object.defineProperty(k,"ref",{enumerable:!1,get:u}):Object.defineProperty(k,"ref",{enumerable:!1,value:null}),k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(k,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(k,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(k,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k}function p(k,z,K,X,le,ue){var A=z.children;if(A!==void 0)if(X)if(N(A)){for(X=0;X<A.length;X++)f(A[X]);Object.freeze&&Object.freeze(A)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(A);if(W.call(z,"key")){A=e(k);var Q=Object.keys(z).filter(function(ee){return ee!=="key"});X=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",re[A+X]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),gs=require("react-dom");function xs(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=xs(U),qt=xs(gs);var un={exports:{}},Ot={};var So;function al(){if(So)return Ot;So=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return Ot.Fragment=t,Ot.jsx=n,Ot.jsxs=n,Ot}var At={};var Co;function il(){return Co||(Co=1,process.env.NODE_ENV!=="production"&&(function(){function e(j){if(j==null)return null;if(typeof j=="function")return j.$$typeof===D?null:j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case x:return"Fragment";case b:return"Profiler";case y:return"StrictMode";case L:return"Suspense";case k:return"SuspenseList";case E:return"Activity"}if(typeof j=="object")switch(typeof j.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),j.$$typeof){case m:return"Portal";case w:return j.displayName||"Context";case C:return(j._context.displayName||"Context")+".Consumer";case T:var z=j.render;return j=j.displayName,j||(j=z.displayName||z.name||"",j=j!==""?"ForwardRef("+j+")":"ForwardRef"),j;case P:return z=j.displayName||null,z!==null?z:e(j.type)||"Memo";case M:z=j._payload,j=j._init;try{return e(j(z))}catch{}}return null}function t(j){return""+j}function n(j){try{t(j);var z=!1}catch{z=!0}if(z){z=console;var q=z.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&j[Symbol.toStringTag]||j.constructor.name||"Object";return q.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(j)}}function r(j){if(j===x)return"<>";if(typeof j=="object"&&j!==null&&j.$$typeof===M)return"<...>";try{var z=e(j);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function o(){var j=S.A;return j===null?null:j.getOwner()}function s(){return Error("react-stack-top-frame")}function i(j){if(F.call(j,"key")){var z=Object.getOwnPropertyDescriptor(j,"key").get;if(z&&z.isReactWarning)return!1}return j.key!==void 0}function c(j,z){function q(){_||(_=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}q.isReactWarning=!0,Object.defineProperty(j,"key",{get:q,configurable:!0})}function u(){var j=e(this.type);return W[j]||(W[j]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),j=this.props.ref,j!==void 0?j:null}function d(j,z,q,X,ce,le){var I=q.ref;return j={$$typeof:v,type:j,key:z,props:q,_owner:X},(I!==void 0?I:null)!==null?Object.defineProperty(j,"ref",{enumerable:!1,get:u}):Object.defineProperty(j,"ref",{enumerable:!1,value:null}),j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(j,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(j,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(j,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j}function p(j,z,q,X,ce,le){var I=z.children;if(I!==void 0)if(X)if(N(I)){for(X=0;X<I.length;X++)f(I[X]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(I);if(F.call(z,"key")){I=e(j);var Z=Object.keys(z).filter(function(ee){return ee!=="key"});X=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",Q[I+X]||(Z=0<Z.length?"{"+Z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,X,A,Q,A),re[A+X]=!0)}if(A=null,K!==void 0&&(n(K),A=""+K),i(z)&&(n(z.key),A=""+z.key),"key"in z){K={};for(var oe in z)oe!=="key"&&(K[oe]=z[oe])}else K=z;return A&&l(K,typeof k=="function"?k.displayName||k.name||"Unknown":k),d(k,A,K,o(),le,ue)}function f(k){h(k)?k._store&&(k._store.validated=1):typeof k=="object"&&k!==null&&k.$$typeof===P&&(k._payload.status==="fulfilled"?h(k._payload.value)&&k._payload.value._store&&(k._payload.value._store.validated=1):k._store&&(k._store.validated=1))}function h(k){return typeof k=="object"&&k!==null&&k.$$typeof===v}var g=J,v=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),R=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,N=Array.isArray,V=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(k){return k()}};var _,F={},M=g.react_stack_bottom_frame.bind(g,s)(),I=V(r(s)),re={};Ft.Fragment=x,Ft.jsx=function(k,z,K){var X=1e4>R.recentlyCreatedOwnerStacks++;return p(k,z,K,!1,X?Error("react-stack-top-frame"):M,X?V(r(k)):I)},Ft.jsxs=function(k,z,K){var X=1e4>R.recentlyCreatedOwnerStacks++;return p(k,z,K,!0,X?Error("react-stack-top-frame"):M,X?V(r(k)):I)}})()),Ft}var ko;function Nl(){return ko||(ko=1,process.env.NODE_ENV==="production"?fn.exports=Sl():fn.exports=Cl()),fn.exports}var a=Nl();function Do(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fe(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Do(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Do(e[o],null)}}}}function ie(...e){return c.useCallback(fe(...e),e)}var El=Symbol.for("react.lazy"),Nn=c[" use ".trim().toString()];function jl(e){return typeof e=="object"&&e!==null&&"then"in e}function Ps(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===El&&"_payload"in e&&jl(e._payload)}function Rs(e){const t=Rl(e),n=c.forwardRef((r,o)=>{let{children:s,...i}=r;Ps(s)&&typeof Nn=="function"&&(s=Nn(s._payload));const l=c.Children.toArray(s),u=l.find(kl);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Pl=Rs("Slot");function Rl(e){const t=c.forwardRef((n,r)=>{let{children:o,...s}=n;if(Ps(o)&&typeof Nn=="function"&&(o=Nn(o._payload)),c.isValidElement(o)){const i=Tl(o),l=Dl(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ml=Symbol("radix.slottable");function kl(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ml}function Dl(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Tl(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ms(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ms(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ol(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ms(e))&&(r&&(r+=" "),r+=t);return r}const _l=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Al=(e,t)=>({classGroupId:e,validator:t}),ks=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),En="-",To=[],Il="arbitrary..",$l=e=>{const t=Ll(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Fl(i);const l=i.split(En),u=l[0]===""&&l.length>1?1:0;return Ds(l,u,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const u=r[i],d=n[i];return u?d?_l(d,u):u:d||To}return n[i]||To}}},Ds=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const d=Ds(e,t+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=t===0?e.join(En):e.slice(t).join(En),u=i.length;for(let d=0;d<u;d++){const p=i[d];if(p.validator(l))return p.classGroupId}},Fl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Il+r:void 0})(),Ll=e=>{const{theme:t,classGroups:n}=e;return Wl(n,t)},Wl=(e,t)=>{const n=ks();for(const r in e){const o=e[r];Vr(o,n,r,t)}return n},Vr=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Vl(i,t,n,r)}},Vl=(e,t,n,r)=>{if(typeof e=="string"){Bl(e,t,n);return}if(typeof e=="function"){zl(e,t,n,r);return}Hl(e,t,n,r)},Bl=(e,t,n)=>{const r=e===""?t:Ts(t,e);r.classGroupId=n},zl=(e,t,n,r)=>{if(Yl(e)){Vr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Al(n,e))},Hl=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,u]=o[i];Vr(u,Ts(t,l),n,r)}},Ts=(e,t)=>{let n=e;const r=t.split(En),o=r.length;for(let s=0;s<o;s++){const i=r[s];let l=n.nextPart.get(i);l||(l=ks(),n.nextPart.set(i,l)),n=l}return n},Yl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},jr="!",Oo=":",Ul=[],_o=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Kl=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,l=0,u=0,d;const p=o.length;for(let m=0;m<p;m++){const x=o[m];if(i===0&&l===0){if(x===Oo){s.push(o.slice(u,m)),u=m+1;continue}if(x==="/"){d=m;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const f=s.length===0?o:o.slice(u);let h=f,g=!1;f.endsWith(jr)?(h=f.slice(0,-1),g=!0):f.startsWith(jr)&&(h=f.slice(1),g=!0);const v=d&&d>u?d-u:void 0;return _o(s,g,h,v)};if(t){const o=t+Oo,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):_o(Ul,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},ql=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",u=t.has(i);l||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Xl=e=>({cache:Gl(e.cacheSize),parseClassName:Kl(e),sortModifiers:ql(e),...$l(e)}),Jl=/\s+/,Zl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],l=e.trim().split(Jl);let u="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:f,modifiers:h,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}=n(p);if(f){u=p+(u.length>0?" "+u:u);continue}let x=!!m,y=r(x?v.substring(0,m):v);if(!y){if(!x){u=p+(u.length>0?" "+u:u);continue}if(y=r(v),!y){u=p+(u.length>0?" "+u:u);continue}x=!1}const w=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=g?w+jr:w,S=C+y;if(i.indexOf(S)>-1)continue;i.push(S);const D=o(y,x);for(let $=0;$<D.length;++$){const O=D[$];i.push(C+O)}u=p+(u.length>0?" "+u:u)}return u},Ql=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Os(n))&&(o&&(o+=" "),o+=r);return o},Os=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Os(e[r]))&&(n&&(n+=" "),n+=t);return n},eu=(e,...t)=>{let n,r,o,s;const i=u=>{const d=t.reduce((p,f)=>f(p),e());return n=Xl(d),r=n.cache.get,o=n.cache.set,s=l,l(u)},l=u=>{const d=r(u);if(d)return d;const p=Zl(u,n);return o(u,p),p};return s=i,(...u)=>s(Ql(...u))},tu=[],de=e=>{const t=n=>n[e]||tu;return t.isThemeGetter=!0,t},_s=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,As=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nu=/^\d+\/\d+$/,ru=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ou=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,su=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,au=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bt=e=>nu.test(e),ne=e=>!!e&&!Number.isNaN(Number(e)),Ke=e=>!!e&&Number.isInteger(Number(e)),dr=e=>e.endsWith("%")&&ne(e.slice(0,-1)),Be=e=>ru.test(e),cu=()=>!0,lu=e=>ou.test(e)&&!su.test(e),Is=()=>!1,uu=e=>au.test(e),du=e=>iu.test(e),fu=e=>!H(e)&&!Y(e),pu=e=>kt(e,Ls,Is),H=e=>_s.test(e),ut=e=>kt(e,Ws,lu),fr=e=>kt(e,vu,ne),Ao=e=>kt(e,$s,Is),mu=e=>kt(e,Fs,du),pn=e=>kt(e,Vs,uu),Y=e=>As.test(e),Lt=e=>Dt(e,Ws),hu=e=>Dt(e,yu),Io=e=>Dt(e,$s),gu=e=>Dt(e,Ls),xu=e=>Dt(e,Fs),mn=e=>Dt(e,Vs,!0),kt=(e,t,n)=>{const r=_s.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Dt=(e,t,n=!1)=>{const r=As.exec(e);return r?r[1]?t(r[1]):n:!1},$s=e=>e==="position"||e==="percentage",Fs=e=>e==="image"||e==="url",Ls=e=>e==="length"||e==="size"||e==="bg-size",Ws=e=>e==="length",vu=e=>e==="number",yu=e=>e==="family-name",Vs=e=>e==="shadow",bu=()=>{const e=de("color"),t=de("font"),n=de("text"),r=de("font-weight"),o=de("tracking"),s=de("leading"),i=de("breakpoint"),l=de("container"),u=de("spacing"),d=de("radius"),p=de("shadow"),f=de("inset-shadow"),h=de("text-shadow"),g=de("drop-shadow"),v=de("blur"),m=de("perspective"),x=de("aspect"),y=de("ease"),w=de("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...S(),Y,H],$=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],b=()=>[Y,H,u],P=()=>[bt,"full","auto",...b()],E=()=>[Ke,"none","subgrid",Y,H],T=()=>["auto",{span:["full",Ke,Y,H]},Ke,Y,H],R=()=>[Ke,"auto",Y,H],W=()=>["auto","min","max","fr",Y,H],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...b()],F=()=>[bt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],M=()=>[e,Y,H],I=()=>[...S(),Io,Ao,{position:[Y,H]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],k=()=>["auto","cover","contain",gu,pu,{size:[Y,H]}],z=()=>[dr,Lt,ut],K=()=>["","none","full",d,Y,H],X=()=>["",ne,Lt,ut],le=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[ne,dr,Io,Ao],Q=()=>["","none",v,Y,H],oe=()=>["none",ne,Y,H],ee=()=>["none",ne,Y,H],te=()=>[ne,Y,H],j=()=>[bt,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Be],breakpoint:[Be],color:[cu],container:[Be],"drop-shadow":[Be],ease:["in","out","in-out"],font:[fu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Be],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Be],shadow:[Be],spacing:["px",ne],text:[Be],"text-shadow":[Be],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bt,H,Y,x]}],container:["container"],columns:[{columns:[ne,H,Y,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ke,"auto",Y,H]}],basis:[{basis:[bt,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ne,bt,"auto","initial","none",H]}],grow:[{grow:["",ne,Y,H]}],shrink:[{shrink:["",ne,Y,H]}],order:[{order:[Ke,"first","last","none",Y,H]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[l,"screen",...F()]}],"min-w":[{"min-w":[l,"screen","none",...F()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,Lt,ut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y,fr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dr,H]}],"font-family":[{font:[hu,H,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Y,H]}],"line-clamp":[{"line-clamp":[ne,"none",Y,fr]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",Y,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[ne,"from-font","auto",Y,ut]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[ne,"auto",Y,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:k()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ke,Y,H],radial:["",Y,H],conic:[Ke,Y,H]},xu,mu]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ne,Y,H]}],"outline-w":[{outline:["",ne,Lt,ut]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,mn,pn]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",f,mn,pn]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[ne,ut]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",h,mn,pn]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[ne,Y,H]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:k()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,H]}],filter:[{filter:["","none",Y,H]}],blur:[{blur:Q()}],brightness:[{brightness:[ne,Y,H]}],contrast:[{contrast:[ne,Y,H]}],"drop-shadow":[{"drop-shadow":["","none",g,mn,pn]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",ne,Y,H]}],"hue-rotate":[{"hue-rotate":[ne,Y,H]}],invert:[{invert:["",ne,Y,H]}],saturate:[{saturate:[ne,Y,H]}],sepia:[{sepia:["",ne,Y,H]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,H]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[ne,Y,H]}],"backdrop-contrast":[{"backdrop-contrast":[ne,Y,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ne,Y,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ne,Y,H]}],"backdrop-invert":[{"backdrop-invert":["",ne,Y,H]}],"backdrop-opacity":[{"backdrop-opacity":[ne,Y,H]}],"backdrop-saturate":[{"backdrop-saturate":[ne,Y,H]}],"backdrop-sepia":[{"backdrop-sepia":["",ne,Y,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ne,"initial",Y,H]}],ease:[{ease:["linear","initial",y,Y,H]}],delay:[{delay:[ne,Y,H]}],animate:[{animate:["none",w,Y,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Y,H]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[Y,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:j()}],"translate-x":[{"translate-x":j()}],"translate-y":[{"translate-y":j()}],"translate-z":[{"translate-z":j()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y,H]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[ne,Lt,ut,fr]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wu=eu(bu);function L(...e){return wu(Ol(e))}const q=c.forwardRef(({className:e,variant:t="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?Pl:"button";return a.jsx(i,{className:L("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",t==="default"&&"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 active:scale-95",t==="destructive"&&"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 active:scale-95",t==="outline"&&"border border-gray-300 bg-white text-gray-900 hover:bg-gray-50 active:bg-gray-100 active:scale-95",t==="secondary"&&"bg-gray-200 text-gray-900 hover:bg-gray-300 active:bg-gray-400 active:scale-95",t==="ghost"&&"bg-transparent text-gray-900 hover:bg-gray-100 active:bg-gray-200 active:scale-95",t==="link"&&"bg-transparent text-blue-600 underline-offset-4 hover:text-blue-700 hover:underline active:text-blue-800",n==="default"&&"h-9 px-4 py-2",n==="sm"&&"h-8 px-3 text-xs gap-1.5",n==="lg"&&"h-10 px-6",n==="icon"&&"h-9 w-9 p-0",n==="icon-sm"&&"h-8 w-8 p-0",n==="icon-lg"&&"h-10 w-10 p-0",e),ref:s,...o})});q.displayName="Button";function Su(e,t){const n=c.createContext(t),r=s=>{const{children:i,...l}=s,u=c.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ue(e,t=[]){let n=[];function r(s,i){const l=c.createContext(i),u=n.length;n=[...n,i];const d=f=>{const{scope:h,children:g,...v}=f,m=h?.[e]?.[u]||l,x=c.useMemo(()=>v,Object.values(v));return a.jsx(m.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,h){const g=h?.[e]?.[u]||l,v=c.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=n.map(i=>c.createContext(i));return function(l){const u=l?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,Cu(o,...t)]}function Cu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...l,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function G(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var me=globalThis?.document?c.useLayoutEffect:()=>{},Nu=c[" useInsertionEffect ".trim().toString()]||me;function et({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Eu({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:o;{const p=c.useRef(e!==void 0);c.useEffect(()=>{const f=p.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,r])}const d=c.useCallback(p=>{if(l){const f=ju(p)?p(e):p;f!==e&&i.current?.(f)}else s(p)},[l,e,s,i]);return[u,d]}function Eu({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),s=c.useRef(t);return Nu(()=>{s.current=t},[t]),c.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ju(e){return typeof e=="function"}function Bs(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function zs(e){const[t,n]=c.useState(void 0);return me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Pu(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var Oe=e=>{const{present:t,children:n}=e,r=Ru(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),s=ie(r.ref,Mu(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:s}):null};Oe.displayName="Presence";function Ru(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),s=c.useRef("none"),i=e?"mounted":"unmounted",[l,u]=Pu(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const d=hn(r.current);s.current=l==="mounted"?d:"none"},[l]),me(()=>{const d=r.current,p=o.current;if(p!==e){const h=s.current,g=hn(d);e?u("MOUNT"):g==="none"||d?.display==="none"?u("UNMOUNT"):u(p&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),me(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=g=>{const m=hn(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(u("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=g=>{g.target===t&&(s.current=hn(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:c.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function hn(e){return e?.animationName||"none"}function Mu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ku(e){const t=Du(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Ou);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Du(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Au(o),l=_u(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tu=Symbol("radix.slottable");function Ou(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tu}function _u(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Au(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Br=Iu.reduce((e,t)=>{const n=ku(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),In="Checkbox",[$u]=Ue(In),[Fu,zr]=$u(In);function Lu(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:l,onCheckedChange:u,required:d,value:p="on",internal_do_not_use_render:f}=e,[h,g]=et({prop:n,defaultProp:o??!1,onChange:u,caller:In}),[v,m]=c.useState(null),[x,y]=c.useState(null),w=c.useRef(!1),C=v?!!i||!!v.closest("form"):!0,S={checked:h,disabled:s,setChecked:g,control:v,setControl:m,name:l,form:i,value:p,hasConsumerStoppedPropagationRef:w,required:d,defaultChecked:Qe(o)?!1:o,isFormControl:C,bubbleInput:x,setBubbleInput:y};return a.jsx(Fu,{scope:t,...S,children:Wu(f)?f(S):r})}var Hs="CheckboxTrigger",Ys=c.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:l,checked:u,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:v}=zr(Hs,e),m=ie(o,p),x=c.useRef(u);return c.useEffect(()=>{const y=s?.form;if(y){const w=()=>f(x.current);return y.addEventListener("reset",w),()=>y.removeEventListener("reset",w)}},[s,f]),a.jsx(Br.button,{type:"button",role:"checkbox","aria-checked":Qe(u)?"mixed":u,"aria-required":d,"data-state":Xs(u),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:m,onKeyDown:G(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:G(n,y=>{f(w=>Qe(w)?!0:!w),v&&g&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})});Ys.displayName=Hs;var Hr=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:l,value:u,onCheckedChange:d,form:p,...f}=e;return a.jsx(Lu,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:l,required:i,onCheckedChange:d,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:h})=>a.jsxs(a.Fragment,{children:[a.jsx(Ys,{...f,ref:t,__scopeCheckbox:n}),h&&a.jsx(qs,{__scopeCheckbox:n})]})})});Hr.displayName=In;var Gs="CheckboxIndicator",Us=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=zr(Gs,n);return a.jsx(Oe,{present:r||Qe(s.checked)||s.checked===!0,children:a.jsx(Br.span,{"data-state":Xs(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Us.displayName=Gs;var Ks="CheckboxBubbleInput",qs=c.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:l,disabled:u,name:d,value:p,form:f,bubbleInput:h,setBubbleInput:g}=zr(Ks,e),v=ie(n,g),m=Bs(s),x=zs(r);c.useEffect(()=>{const w=h;if(!w)return;const C=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(C,"checked").set,$=!o.current;if(m!==s&&D){const O=new Event("click",{bubbles:$});w.indeterminate=Qe(s),D.call(w,Qe(s)?!1:s),w.dispatchEvent(O)}},[h,m,s,o]);const y=c.useRef(Qe(s)?!1:s);return a.jsx(Br.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??y.current,required:l,disabled:u,name:d,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});qs.displayName=Ks;function Wu(e){return typeof e=="function"}function Qe(e){return e==="indeterminate"}function Xs(e){return Qe(e)?"indeterminate":e?"checked":"unchecked"}const Vu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),$o=e=>{const t=Bu(e);return t.charAt(0).toUpperCase()+t.slice(1)},Js=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),zu=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Hu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Yu=J.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},u)=>J.createElement("svg",{ref:u,...Hu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Js("lucide",o),...!s&&!zu(l)&&{"aria-hidden":"true"},...l},[...i.map(([d,p])=>J.createElement(d,p)),...Array.isArray(s)?s:[s]]));const ge=(e,t)=>{const n=J.forwardRef(({className:r,...o},s)=>J.createElement(Yu,{ref:s,iconNode:t,className:Js(`lucide-${Vu($o(e))}`,`lucide-${e}`,r),...o}));return n.displayName=$o(e),n};const Gu=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Yr=ge("calendar",Gu);const Uu=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Gr=ge("check",Uu);const Ku=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zt=ge("chevron-down",Ku);const qu=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Le=ge("chevron-left",qu);const Xu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ee=ge("chevron-right",Xu);const Ju=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$n=ge("chevron-up",Ju);const Zu=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Qu=ge("chevrons-left",Zu);const ed=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],td=ge("chevrons-right",ed);const nd=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Ur=ge("chevrons-up-down",nd);const rd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],od=ge("circle",rd);const sd=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ad=ge("clock",sd);const id=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fo=ge("plus",id);const cd=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ld=ge("search",cd);const ud=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],dd=ge("trash-2",ud);const fd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pd=ge("x",fd),Fn=c.forwardRef(({className:e,...t},n)=>a.jsx(Hr,{ref:n,className:L("peer h-4 w-4 shrink-0 rounded border border-gray-200 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-900 data-[state=checked]:border-gray-900 data-[state=checked]:text-white transition-colors",e),...t,children:a.jsx(Us,{className:L("flex items-center justify-center text-current"),children:a.jsx(Gr,{className:"h-3.5 w-3.5 stroke-[2.5]"})})}));Fn.displayName=Hr.displayName;const ze=c.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:L("flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:r,...n}));ze.displayName="Input";const Zs=c.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>a.jsx("div",{ref:o,role:n?"none":"separator","aria-orientation":t,className:L("shrink-0 bg-gray-200",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Zs.displayName="Separator";const Qs=c.createContext({variant:"default"});function Ln({className:e,variant:t="default",...n}){return a.jsx(Qs.Provider,{value:{variant:t},children:a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:L("w-full caption-bottom text-sm",e),...n})})})}function Wn({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:L("bg-gray-50 [&_tr]:border-b [&_tr]:border-gray-200",e),...t})}function Vn({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:L("[&_tr:last-child]:border-b-0",e),...t})}function md({className:e,...t}){return a.jsx("tfoot",{"data-slot":"table-footer",className:L("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function $e({className:e,...t}){const{variant:n}=c.useContext(Qs);return a.jsx("tr",{"data-slot":"table-row",className:L("hover:bg-gray-50 data-[state=selected]:bg-gray-50 transition-colors border-b border-gray-200",n==="clean"&&"border-b-0",e),...t})}function Bn({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:L("text-foreground h-auto px-3 py-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function mt({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:L("px-3 py-2 text-left align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function hd({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:L("text-muted-foreground mt-4 text-sm",e),...t})}function gd(e){const t=xd(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(yd);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function xd(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=wd(o),l=bd(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vd=Symbol("radix.slottable");function yd(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vd}function bd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function wd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cd=Sd.reduce((e,t)=>{const n=gd(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lo(e){const t=Nd(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(jd);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Nd(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Rd(o),l=Pd(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ed=Symbol("radix.slottable");function jd(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ed}function Pd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Rd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kr(e){const t=e+"CollectionProvider",[n,r]=Ue(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:x,children:y}=m,w=J.useRef(null),C=J.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:C,collectionRef:w,children:y})};i.displayName=t;const l=e+"CollectionSlot",u=Lo(l),d=J.forwardRef((m,x)=>{const{scope:y,children:w}=m,C=s(l,y),S=ie(x,C.collectionRef);return a.jsx(u,{ref:S,children:w})});d.displayName=l;const p=e+"CollectionItemSlot",f="data-radix-collection-item",h=Lo(p),g=J.forwardRef((m,x)=>{const{scope:y,children:w,...C}=m,S=J.useRef(null),D=ie(x,S),$=s(p,y);return J.useEffect(()=>($.itemMap.set(S,{ref:S,...C}),()=>void $.itemMap.delete(S))),a.jsx(h,{[f]:"",ref:D,children:w})});g.displayName=p;function v(m){const x=s(e+"CollectionConsumer",m);return J.useCallback(()=>{const w=x.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort(($,O)=>C.indexOf($.ref.current)-C.indexOf(O.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},v,r]}var Md=c.createContext(void 0);function qr(e){const t=c.useContext(Md);return e||t||"ltr"}function kd(e){const t=Dd(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Od);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dd(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Ad(o),l=_d(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Td=Symbol("radix.slottable");function Od(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Td}function _d(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ad(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Id=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ea=Id.reduce((e,t)=>{const n=kd(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $d(e,t){e&&Jt.flushSync(()=>e.dispatchEvent(t))}function ke(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}function Fd(e,t=globalThis?.document){const n=ke(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ld="DismissableLayer",Pr="dismissableLayer.update",Wd="dismissableLayer.pointerDownOutside",Vd="dismissableLayer.focusOutside",Wo,ta=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qt=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...u}=e,d=c.useContext(ta),[p,f]=c.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=c.useState({}),v=ie(t,O=>f(O)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),w=p?m.indexOf(p):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,D=Hd(O=>{const b=O.target,P=[...d.branches].some(E=>E.contains(b));!S||P||(o?.(O),i?.(O),O.defaultPrevented||l?.())},h),$=Yd(O=>{const b=O.target;[...d.branches].some(E=>E.contains(b))||(s?.(O),i?.(O),O.defaultPrevented||l?.())},h);return Fd(O=>{w===d.layers.size-1&&(r?.(O),!O.defaultPrevented&&l&&(O.preventDefault(),l()))},h),c.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Wo=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Vo(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Wo)}},[p,h,n,d]),c.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Vo())},[p,d]),c.useEffect(()=>{const O=()=>g({});return document.addEventListener(Pr,O),()=>document.removeEventListener(Pr,O)},[]),a.jsx(ea.div,{...u,ref:v,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,$.onFocusCapture),onBlurCapture:G(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,D.onPointerDownCapture)})});Qt.displayName=Ld;var Bd="DismissableLayerBranch",zd=c.forwardRef((e,t)=>{const n=c.useContext(ta),r=c.useRef(null),o=ie(t,r);return c.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(ea.div,{...e,ref:o})});zd.displayName=Bd;function Hd(e,t=globalThis?.document){const n=ke(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let u=function(){na(Wd,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Yd(e,t=globalThis?.document){const n=ke(e),r=c.useRef(!1);return c.useEffect(()=>{const o=s=>{s.target&&!r.current&&na(Vd,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Vo(){const e=new CustomEvent(Pr);document.dispatchEvent(e)}function na(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?$d(o,s):o.dispatchEvent(s)}var pr=0;function zn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bo()),document.body.insertAdjacentElement("beforeend",e[1]??Bo()),pr++,()=>{pr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pr--}},[])}function Bo(){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}function Gd(e){const t=Ud(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(qd);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Ud(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Jd(o),l=Xd(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kd=Symbol("radix.slottable");function qd(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kd}function Xd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Jd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qd=Zd.reduce((e,t)=>{const n=Gd(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),mr="focusScope.autoFocusOnMount",hr="focusScope.autoFocusOnUnmount",zo={bubbles:!1,cancelable:!0},ef="FocusScope",en=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,u]=c.useState(null),d=ke(o),p=ke(s),f=c.useRef(null),h=ie(t,m=>u(m)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let m=function(C){if(g.paused||!l)return;const S=C.target;l.contains(S)?f.current=S:Xe(f.current,{select:!0})},x=function(C){if(g.paused||!l)return;const S=C.relatedTarget;S!==null&&(l.contains(S)||Xe(f.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const D of C)D.removedNodes.length>0&&Xe(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const w=new MutationObserver(y);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),w.disconnect()}}},[r,l,g.paused]),c.useEffect(()=>{if(l){Yo.add(g);const m=document.activeElement;if(!l.contains(m)){const y=new CustomEvent(mr,zo);l.addEventListener(mr,d),l.dispatchEvent(y),y.defaultPrevented||(tf(af(ra(l)),{select:!0}),document.activeElement===m&&Xe(l))}return()=>{l.removeEventListener(mr,d),setTimeout(()=>{const y=new CustomEvent(hr,zo);l.addEventListener(hr,p),l.dispatchEvent(y),y.defaultPrevented||Xe(m??document.body,{select:!0}),l.removeEventListener(hr,p),Yo.remove(g)},0)}}},[l,d,p,g]);const v=c.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const w=m.currentTarget,[C,S]=nf(w);C&&S?!m.shiftKey&&y===S?(m.preventDefault(),n&&Xe(C,{select:!0})):m.shiftKey&&y===C&&(m.preventDefault(),n&&Xe(S,{select:!0})):y===w&&m.preventDefault()}},[n,r,g.paused]);return a.jsx(Qd.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});en.displayName=ef;function tf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xe(r,{select:t}),document.activeElement!==n)return}function nf(e){const t=ra(e),n=Ho(t,e),r=Ho(t.reverse(),e);return[n,r]}function ra(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ho(e,t){for(const n of e)if(!rf(n,{upTo:t}))return n}function rf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function of(e){return e instanceof HTMLInputElement&&"select"in e}function Xe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&of(e)&&t&&e.select()}}var Yo=sf();function sf(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Go(e,t),e.unshift(t)},remove(t){e=Go(e,t),e[0]?.resume()}}}function Go(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function af(e){return e.filter(t=>t.tagName!=="A")}var cf=c[" useId ".trim().toString()]||(()=>{}),lf=0;function je(e){const[t,n]=c.useState(cf());return me(()=>{n(r=>r??String(lf++))},[e]),e||(t?`radix-${t}`:"")}const uf=["top","right","bottom","left"],tt=Math.min,be=Math.max,jn=Math.round,gn=Math.floor,Fe=e=>({x:e,y:e}),df={left:"right",right:"left",bottom:"top",top:"bottom"},ff={start:"end",end:"start"};function Rr(e,t,n){return be(e,tt(t,n))}function Ye(e,t){return typeof e=="function"?e(t):e}function Ge(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function Xr(e){return e==="x"?"y":"x"}function Jr(e){return e==="y"?"height":"width"}const pf=new Set(["top","bottom"]);function Ie(e){return pf.has(Ge(e))?"y":"x"}function Zr(e){return Xr(Ie(e))}function mf(e,t,n){n===void 0&&(n=!1);const r=Tt(e),o=Zr(e),s=Jr(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Pn(i)),[i,Pn(i)]}function hf(e){const t=Pn(e);return[Mr(e),t,Mr(t)]}function Mr(e){return e.replace(/start|end/g,t=>ff[t])}const Uo=["left","right"],Ko=["right","left"],gf=["top","bottom"],xf=["bottom","top"];function vf(e,t,n){switch(e){case"top":case"bottom":return n?t?Ko:Uo:t?Uo:Ko;case"left":case"right":return t?gf:xf;default:return[]}}function yf(e,t,n,r){const o=Tt(e);let s=vf(Ge(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Mr)))),s}function Pn(e){return e.replace(/left|right|bottom|top/g,t=>df[t])}function bf(e){return{top:0,right:0,bottom:0,left:0,...e}}function oa(e){return typeof e!="number"?bf(e):{top:e,right:e,bottom:e,left:e}}function Rn(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 qo(e,t,n){let{reference:r,floating:o}=e;const s=Ie(t),i=Zr(t),l=Jr(i),u=Ge(t),d=s==="y",p=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let g;switch(u){case"top":g={x:p,y:r.y-o.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Tt(t)){case"start":g[i]-=h*(n&&d?-1:1);break;case"end":g[i]+=h*(n&&d?-1:1);break}return g}const wf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=qo(d,r,u),h=r,g={},v=0;for(let m=0;m<l.length;m++){const{name:x,fn:y}=l[m],{x:w,y:C,data:S,reset:D}=await y({x:p,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});p=w??p,f=C??f,g={...g,[x]:{...g[x],...S}},D&&v<=50&&(v++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(d=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:p,y:f}=qo(d,h,u)),m=-1)}return{x:p,y:f,placement:h,strategy:o,middlewareData:g}};async function Gt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Ye(t,e),v=oa(g),x=l[h?f==="floating"?"reference":"floating":f],y=Rn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:u})),w=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},D=Rn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:u}):w);return{top:(y.top-D.top+v.top)/S.y,bottom:(D.bottom-y.bottom+v.bottom)/S.y,left:(y.left-D.left+v.left)/S.x,right:(D.right-y.right+v.right)/S.x}}const Sf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:u}=t,{element:d,padding:p=0}=Ye(e,t)||{};if(d==null)return{};const f=oa(p),h={x:n,y:r},g=Zr(o),v=Jr(g),m=await i.getDimensions(d),x=g==="y",y=x?"top":"left",w=x?"bottom":"right",C=x?"clientHeight":"clientWidth",S=s.reference[v]+s.reference[g]-h[g]-s.floating[v],D=h[g]-s.reference[g],$=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let O=$?$[C]:0;(!O||!await(i.isElement==null?void 0:i.isElement($)))&&(O=l.floating[C]||s.floating[v]);const b=S/2-D/2,P=O/2-m[v]/2-1,E=tt(f[y],P),T=tt(f[w],P),R=E,W=O-m[v]-T,N=O/2-m[v]/2+b,V=Rr(R,N,W),_=!u.arrow&&Tt(o)!=null&&N!==V&&s.reference[v]/2-(N<R?E:T)-m[v]/2<0,F=_?N<R?N-R:N-W:0;return{[g]:h[g]+F,data:{[g]:V,centerOffset:N-V-F,..._&&{alignmentOffset:F}},reset:_}}}),Cf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=Ye(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Ge(o),w=Ie(l),C=Ge(l)===l,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),D=h||(C||!m?[Pn(l)]:hf(l)),$=v!=="none";!h&&$&&D.push(...yf(l,m,v,S));const O=[l,...D],b=await Gt(t,x),P=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&P.push(b[y]),f){const N=mf(o,i,S);P.push(b[N[0]],b[N[1]])}if(E=[...E,{placement:o,overflows:P}],!P.every(N=>N<=0)){var T,R;const N=(((T=s.flip)==null?void 0:T.index)||0)+1,V=O[N];if(V&&(!(f==="alignment"?w!==Ie(V):!1)||E.every(M=>Ie(M.placement)===w?M.overflows[0]>0:!0)))return{data:{index:N,overflows:E},reset:{placement:V}};let _=(R=E.filter(F=>F.overflows[0]<=0).sort((F,M)=>F.overflows[1]-M.overflows[1])[0])==null?void 0:R.placement;if(!_)switch(g){case"bestFit":{var W;const F=(W=E.filter(M=>{if($){const I=Ie(M.placement);return I===w||I==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(I=>I>0).reduce((I,re)=>I+re,0)]).sort((M,I)=>M[1]-I[1])[0])==null?void 0:W[0];F&&(_=F);break}case"initialPlacement":_=l;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jo(e){return uf.some(t=>e[t]>=0)}const Nf=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ye(e,t);switch(r){case"referenceHidden":{const s=await Gt(t,{...o,elementContext:"reference"}),i=Xo(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Jo(i)}}}case"escaped":{const s=await Gt(t,{...o,altBoundary:!0}),i=Xo(s,n.floating);return{data:{escapedOffsets:i,escaped:Jo(i)}}}default:return{}}}}},sa=new Set(["left","top"]);async function Ef(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ge(n),l=Tt(n),u=Ie(n)==="y",d=sa.has(i)?-1:1,p=s&&u?-1:1,f=Ye(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),u?{x:g*p,y:h*d}:{x:h*d,y:g*p}}const jf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,u=await Ef(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Pf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:x=>{let{x:y,y:w}=x;return{x:y,y:w}}},...u}=Ye(e,t),d={x:n,y:r},p=await Gt(t,u),f=Ie(Ge(o)),h=Xr(f);let g=d[h],v=d[f];if(s){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=g+p[x],C=g-p[y];g=Rr(w,g,C)}if(i){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=v+p[x],C=v-p[y];v=Rr(w,v,C)}const m=l.fn({...t,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[f]:i}}}}}},Rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Ye(e,t),p={x:n,y:r},f=Ie(o),h=Xr(f);let g=p[h],v=p[f];const m=Ye(l,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const C=h==="y"?"height":"width",S=s.reference[h]-s.floating[C]+x.mainAxis,D=s.reference[h]+s.reference[C]-x.mainAxis;g<S?g=S:g>D&&(g=D)}if(d){var y,w;const C=h==="y"?"width":"height",S=sa.has(Ge(o)),D=s.reference[f]-s.floating[C]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:x.crossAxis),$=s.reference[f]+s.reference[C]+(S?0:((w=i.offset)==null?void 0:w[f])||0)-(S?x.crossAxis:0);v<D?v=D:v>$&&(v=$)}return{[h]:g,[f]:v}}}},Mf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:u=()=>{},...d}=Ye(e,t),p=await Gt(t,d),f=Ge(o),h=Tt(o),g=Ie(o)==="y",{width:v,height:m}=s.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,x=h==="end"?"top":"bottom");const w=m-p.top-p.bottom,C=v-p.left-p.right,S=tt(m-p[x],w),D=tt(v-p[y],C),$=!t.middlewareData.shift;let O=S,b=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=w),$&&!h){const E=be(p.left,0),T=be(p.right,0),R=be(p.top,0),W=be(p.bottom,0);g?b=v-2*(E!==0||T!==0?E+T:be(p.left,p.right)):O=m-2*(R!==0||W!==0?R+W:be(p.top,p.bottom))}await u({...t,availableWidth:b,availableHeight:O});const P=await i.getDimensions(l.floating);return v!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Hn(){return typeof window<"u"}function Ot(e){return aa(e)?(e.nodeName||"").toLowerCase():"#document"}function we(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ve(e){var t;return(t=(aa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aa(e){return Hn()?e instanceof Node||e instanceof we(e).Node:!1}function De(e){return Hn()?e instanceof Element||e instanceof we(e).Element:!1}function We(e){return Hn()?e instanceof HTMLElement||e instanceof we(e).HTMLElement:!1}function Zo(e){return!Hn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof we(e).ShadowRoot}const kf=new Set(["inline","contents"]);function tn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kf.has(o)}const Df=new Set(["table","td","th"]);function Tf(e){return Df.has(Ot(e))}const Of=[":popover-open",":modal"];function Yn(e){return Of.some(t=>{try{return e.matches(t)}catch{return!1}})}const _f=["transform","translate","scale","rotate","perspective"],Af=["transform","translate","scale","rotate","perspective","filter"],If=["paint","layout","strict","content"];function Qr(e){const t=eo(),n=De(e)?Te(e):e;return _f.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Af.some(r=>(n.willChange||"").includes(r))||If.some(r=>(n.contain||"").includes(r))}function $f(e){let t=nt(e);for(;We(t)&&!Rt(t);){if(Qr(t))return t;if(Yn(t))return null;t=nt(t)}return null}function eo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ff=new Set(["html","body","#document"]);function Rt(e){return Ff.has(Ot(e))}function Te(e){return we(e).getComputedStyle(e)}function Gn(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nt(e){if(Ot(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zo(e)&&e.host||Ve(e);return Zo(t)?t.host:t}function ia(e){const t=nt(e);return Rt(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&tn(t)?t:ia(t)}function Ut(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ia(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=we(o);if(s){const l=kr(i);return t.concat(i,i.visualViewport||[],tn(o)?o:[],l&&n?Ut(l):[])}return t.concat(o,Ut(o,[],n))}function kr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ca(e){const t=Te(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=We(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=jn(n)!==s||jn(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function to(e){return De(e)?e:e.contextElement}function jt(e){const t=to(e);if(!We(t))return Fe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ca(t);let i=(s?jn(n.width):n.width)/r,l=(s?jn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Lf=Fe(0);function la(e){const t=we(e);return!eo()||!t.visualViewport?Lf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==we(e)?!1:t}function ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=to(e);let i=Fe(1);t&&(r?De(r)&&(i=jt(r)):i=jt(e));const l=Wf(s,n,r)?la(s):Fe(0);let u=(o.left+l.x)/i.x,d=(o.top+l.y)/i.y,p=o.width/i.x,f=o.height/i.y;if(s){const h=we(s),g=r&&De(r)?we(r):r;let v=h,m=kr(v);for(;m&&r&&g!==v;){const x=jt(m),y=m.getBoundingClientRect(),w=Te(m),C=y.left+(m.clientLeft+parseFloat(w.paddingLeft))*x.x,S=y.top+(m.clientTop+parseFloat(w.paddingTop))*x.y;u*=x.x,d*=x.y,p*=x.x,f*=x.y,u+=C,d+=S,v=we(m),m=kr(v)}}return Rn({width:p,height:f,x:u,y:d})}function Un(e,t){const n=Gn(e).scrollLeft;return t?t.left+n:ht(Ve(e)).left+n}function ua(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Un(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Vf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ve(r),l=t?Yn(t.floating):!1;if(r===i||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Fe(1);const p=Fe(0),f=We(r);if((f||!f&&!s)&&((Ot(r)!=="body"||tn(i))&&(u=Gn(r)),We(r))){const g=ht(r);d=jt(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const h=i&&!f&&!s?ua(i,u):Fe(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+h.x,y:n.y*d.y-u.scrollTop*d.y+p.y+h.y}}function Bf(e){return Array.from(e.getClientRects())}function zf(e){const t=Ve(e),n=Gn(e),r=e.ownerDocument.body,o=be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Un(e);const l=-n.scrollTop;return Te(r).direction==="rtl"&&(i+=be(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Qo=25;function Hf(e,t){const n=we(e),r=Ve(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;const p=eo();(!p||p&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const d=Un(r);if(d<=0){const p=r.ownerDocument,f=p.body,h=getComputedStyle(f),g=p.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-g);v<=Qo&&(s-=v)}else d<=Qo&&(s+=d);return{width:s,height:i,x:l,y:u}}const Yf=new Set(["absolute","fixed"]);function Gf(e,t){const n=ht(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=We(e)?jt(e):Fe(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:l,x:u,y:d}}function es(e,t,n){let r;if(t==="viewport")r=Hf(e,n);else if(t==="document")r=zf(Ve(e));else if(De(t))r=Gf(t,n);else{const o=la(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Rn(r)}function da(e,t){const n=nt(e);return n===t||!De(n)||Rt(n)?!1:Te(n).position==="fixed"||da(n,t)}function Uf(e,t){const n=t.get(e);if(n)return n;let r=Ut(e,[],!1).filter(l=>De(l)&&Ot(l)!=="body"),o=null;const s=Te(e).position==="fixed";let i=s?nt(e):e;for(;De(i)&&!Rt(i);){const l=Te(i),u=Qr(i);!u&&l.position==="fixed"&&(o=null),(s?!u&&!o:!u&&l.position==="static"&&!!o&&Yf.has(o.position)||tn(i)&&!u&&da(e,i))?r=r.filter(p=>p!==i):o=l,i=nt(i)}return t.set(e,r),r}function Kf(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Yn(t)?[]:Uf(t,this._c):[].concat(n),r],l=i[0],u=i.reduce((d,p)=>{const f=es(t,p,o);return d.top=be(f.top,d.top),d.right=tt(f.right,d.right),d.bottom=tt(f.bottom,d.bottom),d.left=be(f.left,d.left),d},es(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function qf(e){const{width:t,height:n}=ca(e);return{width:t,height:n}}function Xf(e,t,n){const r=We(t),o=Ve(t),s=n==="fixed",i=ht(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Fe(0);function d(){u.x=Un(o)}if(r||!r&&!s)if((Ot(t)!=="body"||tn(o))&&(l=Gn(t)),r){const g=ht(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&d();s&&!r&&o&&d();const p=o&&!r&&!s?ua(o,l):Fe(0),f=i.left+l.scrollLeft-u.x-p.x,h=i.top+l.scrollTop-u.y-p.y;return{x:f,y:h,width:i.width,height:i.height}}function gr(e){return Te(e).position==="static"}function ts(e,t){if(!We(e)||Te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ve(e)===n&&(n=n.ownerDocument.body),n}function fa(e,t){const n=we(e);if(Yn(e))return n;if(!We(e)){let o=nt(e);for(;o&&!Rt(o);){if(De(o)&&!gr(o))return o;o=nt(o)}return n}let r=ts(e,t);for(;r&&Tf(r)&&gr(r);)r=ts(r,t);return r&&Rt(r)&&gr(r)&&!Qr(r)?n:r||$f(e)||n}const Jf=async function(e){const t=this.getOffsetParent||fa,n=this.getDimensions,r=await n(e.floating);return{reference:Xf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zf(e){return Te(e).direction==="rtl"}const Qf={convertOffsetParentRelativeRectToViewportRelativeRect:Vf,getDocumentElement:Ve,getClippingRect:Kf,getOffsetParent:fa,getElementRects:Jf,getClientRects:Bf,getDimensions:qf,getScale:jt,isElement:De,isRTL:Zf};function pa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ep(e,t){let n=null,r;const o=Ve(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:p,top:f,width:h,height:g}=d;if(l||t(),!h||!g)return;const v=gn(f),m=gn(o.clientWidth-(p+h)),x=gn(o.clientHeight-(f+g)),y=gn(p),C={rootMargin:-v+"px "+-m+"px "+-x+"px "+-y+"px",threshold:be(0,tt(1,u))||1};let S=!0;function D($){const O=$[0].intersectionRatio;if(O!==u){if(!S)return i();O?i(!1,O):r=setTimeout(()=>{i(!1,1e-7)},1e3)}O===1&&!pa(d,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(D,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,C)}n.observe(e)}return i(!0),s}function tp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=to(e),p=o||s?[...d?Ut(d):[],...Ut(t)]:[];p.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=d&&l?ep(d,n):null;let h=-1,g=null;i&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),d&&!u&&g.observe(d),g.observe(t));let v,m=u?ht(e):null;u&&x();function x(){const y=ht(e);m&&!pa(m,y)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;p.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f?.(),(y=g)==null||y.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const np=jf,rp=Pf,op=Cf,sp=Mf,ap=Nf,ns=Sf,ip=Rf,cp=(e,t,n)=>{const r=new Map,o={platform:Qf,...n},s={...o.platform,_c:r};return wf(e,t,{...o,platform:s})};var lp=typeof document<"u",up=function(){},wn=lp?J.useLayoutEffect:up;function Mn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mn(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Mn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ma(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const n=ma(e);return Math.round(t*n)/n}function xr(e){const t=c.useRef(e);return wn(()=>{t.current=e}),t}function dp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=c.useState(r);Mn(h,r)||g(r);const[v,m]=c.useState(null),[x,y]=c.useState(null),w=c.useCallback(M=>{M!==$.current&&($.current=M,m(M))},[]),C=c.useCallback(M=>{M!==O.current&&(O.current=M,y(M))},[]),S=s||v,D=i||x,$=c.useRef(null),O=c.useRef(null),b=c.useRef(p),P=u!=null,E=xr(u),T=xr(o),R=xr(d),W=c.useCallback(()=>{if(!$.current||!O.current)return;const M={placement:t,strategy:n,middleware:h};T.current&&(M.platform=T.current),cp($.current,O.current,M).then(I=>{const re={...I,isPositioned:R.current!==!1};N.current&&!Mn(b.current,re)&&(b.current=re,Jt.flushSync(()=>{f(re)}))})},[h,t,n,T,R]);wn(()=>{d===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[d]);const N=c.useRef(!1);wn(()=>(N.current=!0,()=>{N.current=!1}),[]),wn(()=>{if(S&&($.current=S),D&&(O.current=D),S&&D){if(E.current)return E.current(S,D,W);W()}},[S,D,W,E,P]);const V=c.useMemo(()=>({reference:$,floating:O,setReference:w,setFloating:C}),[w,C]),_=c.useMemo(()=>({reference:S,floating:D}),[S,D]),F=c.useMemo(()=>{const M={position:n,left:0,top:0};if(!_.floating)return M;const I=rs(_.floating,p.x),re=rs(_.floating,p.y);return l?{...M,transform:"translate("+I+"px, "+re+"px)",...ma(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:re}},[n,l,_.floating,p.x,p.y]);return c.useMemo(()=>({...p,update:W,refs:V,elements:_,floatingStyles:F}),[p,W,V,_,F])}const fp=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ns({element:r.current,padding:o}).fn(n):{}:r?ns({element:r,padding:o}).fn(n):{}}}},pp=(e,t)=>({...np(e),options:[e,t]}),mp=(e,t)=>({...rp(e),options:[e,t]}),hp=(e,t)=>({...ip(e),options:[e,t]}),gp=(e,t)=>({...op(e),options:[e,t]}),xp=(e,t)=>({...sp(e),options:[e,t]}),vp=(e,t)=>({...ap(e),options:[e,t]}),yp=(e,t)=>({...fp(e),options:[e,t]});function bp(e){const t=wp(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Cp);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function wp(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Ep(o),l=Np(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sp=Symbol("radix.slottable");function Cp(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sp}function Np(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ep(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pp=jp.reduce((e,t)=>{const n=bp(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Rp="Arrow",ha=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return a.jsx(Pp.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});ha.displayName=Rp;var Mp=ha;function kp(e){const t=Dp(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Op);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Dp(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Ap(o),l=_p(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tp=Symbol("radix.slottable");function Op(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tp}function _p(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ap(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ip=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ga=Ip.reduce((e,t)=>{const n=kp(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),no="Popper",[xa,_t]=Ue(no),[$p,va]=xa(no),ya=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return a.jsx($p,{scope:t,anchor:r,onAnchorChange:o,children:n})};ya.displayName=no;var ba="PopperAnchor",wa=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=va(ba,n),i=c.useRef(null),l=ie(t,i),u=c.useRef(null);return c.useEffect(()=>{const d=u.current;u.current=r?.current||i.current,d!==u.current&&s.onAnchorChange(u.current)}),r?null:a.jsx(ga.div,{...o,ref:l})});wa.displayName=ba;var ro="PopperContent",[Fp,Lp]=xa(ro),Sa=c.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=e,x=va(ro,n),[y,w]=c.useState(null),C=ie(t,A=>w(A)),[S,D]=c.useState(null),$=zs(S),O=$?.width??0,b=$?.height??0,P=r+(s!=="center"?"-"+s:""),E=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},T=Array.isArray(d)?d:[d],R=T.length>0,W={padding:E,boundary:T.filter(Vp),altBoundary:R},{refs:N,floatingStyles:V,placement:_,isPositioned:F,middlewareData:M}=dp({strategy:"fixed",placement:P,whileElementsMounted:(...A)=>tp(...A,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[pp({mainAxis:o+b,alignmentAxis:i}),u&&mp({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?hp():void 0,...W}),u&&gp({...W}),xp({...W,apply:({elements:A,rects:Q,availableWidth:oe,availableHeight:ee})=>{const{width:te,height:j}=Q.reference,U=A.floating.style;U.setProperty("--radix-popper-available-width",`${oe}px`),U.setProperty("--radix-popper-available-height",`${ee}px`),U.setProperty("--radix-popper-anchor-width",`${te}px`),U.setProperty("--radix-popper-anchor-height",`${j}px`)}}),S&&yp({element:S,padding:l}),Bp({arrowWidth:O,arrowHeight:b}),h&&vp({strategy:"referenceHidden",...W})]}),[I,re]=Ea(_),k=ke(v);me(()=>{F&&k?.()},[F,k]);const z=M.arrow?.x,K=M.arrow?.y,X=M.arrow?.centerOffset!==0,[le,ue]=c.useState();return me(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),a.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:F?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Fp,{scope:n,placedSide:I,onArrowChange:D,arrowX:z,arrowY:K,shouldHideArrow:X,children:a.jsx(ga.div,{"data-side":I,"data-align":re,...m,ref:C,style:{...m.style,animation:F?void 0:"none"}})})})});Sa.displayName=ro;var Ca="PopperArrow",Wp={top:"bottom",right:"left",bottom:"top",left:"right"},Na=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Lp(Ca,r),i=Wp[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Mp,{...o,ref:n,style:{...o.style,display:"block"}})})});Na.displayName=Ca;function Vp(e){return e!==null}var Bp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,p]=Ea(n),f={start:"0%",center:"50%",end:"100%"}[p],h=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+u/2;let v="",m="";return d==="bottom"?(v=i?f:`${h}px`,m=`${-u}px`):d==="top"?(v=i?f:`${h}px`,m=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,m=i?f:`${g}px`):d==="left"&&(v=`${r.floating.width+u}px`,m=i?f:`${g}px`),{data:{x:v,y:m}}}});function Ea(e){const[t,n="center"]=e.split("-");return[t,n]}var Kn=ya,qn=wa,oo=Sa,so=Na;function zp(e){const t=Hp(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Gp);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Hp(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=Kp(o),l=Up(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yp=Symbol("radix.slottable");function Gp(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yp}function Up(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Kp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xp=qp.reduce((e,t)=>{const n=zp(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Jp="Portal",nn=c.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=c.useState(!1);me(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Es.createPortal(a.jsx(Xp.div,{...r,ref:t}),i):null});nn.displayName=Jp;function ja(e){const t=Zp(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(em);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Zp(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=nm(o),l=tm(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qp=Symbol("radix.slottable");function em(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qp}function tm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rn=rm.reduce((e,t)=>{const n=ja(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function om(e,t){e&&Jt.flushSync(()=>e.dispatchEvent(t))}function sm(e){const t=am(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(cm);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function am(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=um(o),l=lm(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var im=Symbol("radix.slottable");function cm(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===im}function lm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function um(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pa=dm.reduce((e,t)=>{const n=sm(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vr="rovingFocusGroup.onEntryFocus",fm={bubbles:!1,cancelable:!0},on="RovingFocusGroup",[Dr,Ra,pm]=Kr(on),[mm,Ma]=Ue(on,[pm]),[hm,gm]=mm(on),ka=c.forwardRef((e,t)=>a.jsx(Dr.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Dr.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(xm,{...e,ref:t})})}));ka.displayName=on;var xm=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=c.useRef(null),g=ie(t,h),v=qr(s),[m,x]=et({prop:i,defaultProp:l??null,onChange:u,caller:on}),[y,w]=c.useState(!1),C=ke(d),S=Ra(n),D=c.useRef(!1),[$,O]=c.useState(0);return c.useEffect(()=>{const b=h.current;if(b)return b.addEventListener(vr,C),()=>b.removeEventListener(vr,C)},[C]),a.jsx(hm,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:c.useCallback(b=>x(b),[x]),onItemShiftTab:c.useCallback(()=>w(!0),[]),onFocusableItemAdd:c.useCallback(()=>O(b=>b+1),[]),onFocusableItemRemove:c.useCallback(()=>O(b=>b-1),[]),children:a.jsx(Pa.div,{tabIndex:y||$===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:G(e.onMouseDown,()=>{D.current=!0}),onFocus:G(e.onFocus,b=>{const P=!D.current;if(b.target===b.currentTarget&&P&&!y){const E=new CustomEvent(vr,fm);if(b.currentTarget.dispatchEvent(E),!E.defaultPrevented){const T=S().filter(_=>_.focusable),R=T.find(_=>_.active),W=T.find(_=>_.id===m),V=[R,W,...T].filter(Boolean).map(_=>_.ref.current);Oa(V,p)}}D.current=!1}),onBlur:G(e.onBlur,()=>w(!1))})})}),Da="RovingFocusGroupItem",Ta=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...l}=e,u=je(),d=s||u,p=gm(Da,n),f=p.currentTabStopId===d,h=Ra(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:m}=p;return c.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),a.jsx(Dr.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:a.jsx(Pa.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:G(e.onMouseDown,x=>{r?p.onItemFocus(d):x.preventDefault()}),onFocus:G(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:G(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=bm(x,p.orientation,p.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=h().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const S=C.indexOf(x.currentTarget);C=p.loop?wm(C,S+1):C.slice(S+1)}setTimeout(()=>Oa(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});Ta.displayName=Da;var vm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ym(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bm(e,t,n){const r=ym(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vm[r]}function Oa(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function wm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Sm=ka,Cm=Ta,Nm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wt=new WeakMap,xn=new WeakMap,vn={},yr=0,_a=function(e){return e&&(e.host||_a(e.parentNode))},Em=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_a(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jm=function(e,t,n,r){var o=Em(t,Array.isArray(e)?e:[e]);vn[n]||(vn[n]=new WeakMap);var s=vn[n],i=[],l=new Set,u=new Set(o),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};o.forEach(d);var p=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))p(h);else try{var g=h.getAttribute(r),v=g!==null&&g!=="false",m=(wt.get(h)||0)+1,x=(s.get(h)||0)+1;wt.set(h,m),s.set(h,x),i.push(h),m===1&&v&&xn.set(h,!0),x===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return p(t),l.clear(),yr++,function(){i.forEach(function(f){var h=wt.get(f)-1,g=s.get(f)-1;wt.set(f,h),s.set(f,g),h||(xn.has(f)||f.removeAttribute(r),xn.delete(f)),g||f.removeAttribute(n)}),yr--,yr||(wt=new WeakMap,wt=new WeakMap,xn=new WeakMap,vn={})}},Xn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Nm(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),jm(r,o,n,"aria-hidden")):function(){return null}},Ae=function(){return Ae=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ae.apply(this,arguments)};function Aa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Pm(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Sn="right-scroll-bar-position",Cn="width-before-scroll-bar",Rm="with-scroll-bars-hidden",Mm="--removed-body-scroll-bar-size";function br(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function km(e,t){var n=J.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Dm=typeof window<"u"?c.useLayoutEffect:c.useEffect,os=new WeakMap;function Tm(e,t){var n=km(null,function(r){return e.forEach(function(o){return br(o,r)})});return Dm(function(){var r=os.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(l){s.has(l)||br(l,null)}),s.forEach(function(l){o.has(l)||br(l,i)})}os.set(n,e)},[e]),n}function Om(e){return e}function _m(e,t){t===void 0&&(t=Om);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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var p=i;i=[],p.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),n}}}};return o}function Am(e){e===void 0&&(e={});var t=_m(null);return t.options=Ae({async:!0,ssr:!1},e),t}var Ia=function(e){var t=e.sideCar,n=Aa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,Ae({},n))};Ia.isSideCarExport=!0;function Im(e,t){return e.useMedium(t),Ia}var $a=Am(),wr=function(){},Jn=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:wr,onWheelCapture:wr,onTouchMoveCapture:wr}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,h=e.sideCar,g=e.noRelative,v=e.noIsolation,m=e.inert,x=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,S=Aa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=h,$=Tm([n,t]),O=Ae(Ae({},S),o);return c.createElement(c.Fragment,null,p&&c.createElement(D,{sideCar:$a,removeScrollBar:d,shards:f,noRelative:g,noIsolation:v,inert:m,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:C}),i?c.cloneElement(c.Children.only(l),Ae(Ae({},O),{ref:$})):c.createElement(w,Ae({},O,{className:u,ref:$}),l))});Jn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jn.classNames={fullWidth:Cn,zeroRight:Sn};var $m=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Fm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$m();return t&&e.setAttribute("nonce",t),e}function Lm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Fm())&&(Lm(t,n),Wm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bm=function(){var e=Vm();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fa=function(){var e=Bm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},zm={left:0,top:0,right:0,gap:0},Sr=function(e){return parseInt(e||"",10)||0},Hm=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Sr(n),Sr(r),Sr(o)]},Ym=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zm;var t=Hm(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])}},Gm=Fa(),Pt="data-scroll-locked",Um=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
7
- .`.concat(Rm,` {
6
+ <%s key={someKey} {...props} />`,X,I,Z,I),Q[I+X]=!0)}if(I=null,q!==void 0&&(n(q),I=""+q),i(z)&&(n(z.key),I=""+z.key),"key"in z){q={};for(var ae in z)ae!=="key"&&(q[ae]=z[ae])}else q=z;return I&&c(q,typeof j=="function"?j.displayName||j.name||"Unknown":j),d(j,I,q,o(),ce,le)}function f(j){h(j)?j._store&&(j._store.validated=1):typeof j=="object"&&j!==null&&j.$$typeof===M&&(j._payload.status==="fulfilled"?h(j._payload.value)&&j._payload.value._store&&(j._payload.value._store.validated=1):j._store&&(j._store.validated=1))}function h(j){return typeof j=="object"&&j!==null&&j.$$typeof===v}var g=U,v=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),w=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),S=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,N=Array.isArray,V=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(j){return j()}};var _,W={},A=g.react_stack_bottom_frame.bind(g,s)(),O=V(r(s)),Q={};At.Fragment=x,At.jsx=function(j,z,q){var X=1e4>S.recentlyCreatedOwnerStacks++;return p(j,z,q,!1,X?Error("react-stack-top-frame"):A,X?V(r(j)):O)},At.jsxs=function(j,z,q){var X=1e4>S.recentlyCreatedOwnerStacks++;return p(j,z,q,!0,X?Error("react-stack-top-frame"):A,X?V(r(j)):O)}})()),At}var No;function cl(){return No||(No=1,process.env.NODE_ENV==="production"?un.exports=al():un.exports=il()),un.exports}var a=cl();function Eo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ue(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Eo(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Eo(e[o],null)}}}}function oe(...e){return l.useCallback(ue(...e),e)}var ll=Symbol.for("react.lazy"),bn=l[" use ".trim().toString()];function ul(e){return typeof e=="object"&&e!==null&&"then"in e}function vs(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ll&&"_payload"in e&&ul(e._payload)}function ys(e){const t=fl(e),n=l.forwardRef((r,o)=>{let{children:s,...i}=r;vs(s)&&typeof bn=="function"&&(s=bn(s._payload));const c=l.Children.toArray(s),u=c.find(ml);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var dl=ys("Slot");function fl(e){const t=l.forwardRef((n,r)=>{let{children:o,...s}=n;if(vs(o)&&typeof bn=="function"&&(o=bn(o._payload)),l.isValidElement(o)){const i=gl(o),c=hl(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pl=Symbol("radix.slottable");function ml(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pl}function hl(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function gl(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function bs(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=bs(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=bs(e))&&(r&&(r+=" "),r+=t);return r}const Ar="-",vl=e=>{const t=bl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const c=i.split(Ar);return c[0]===""&&c.length!==1&&c.shift(),ws(c,t)||yl(i)},getConflictingClassGroupIds:(i,c)=>{const u=n[i]||[];return c&&r[i]?[...u,...r[i]]:u}}},ws=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ws(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ar);return t.validators.find(({validator:i})=>i(s))?.classGroupId},jo=/^\[(.+)\]$/,yl=e=>{if(jo.test(e)){const t=jo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bl=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Sl(Object.entries(e.classGroups),n).forEach(([s,i])=>{br(i,r,s,t)}),r},br=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Po(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(wl(o)){br(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{br(i,Po(t,s),n,r)})})},Po=(e,t)=>{let n=e;return t.split(Ar).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},wl=e=>e.isThemeGetter,Sl=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,c])=>[t+i,c])):s);return[n,o]}):e,Cl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Ss="!",Nl=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=c=>{const u=[];let d=0,p=0,f;for(let x=0;x<c.length;x++){let y=c[x];if(d===0){if(y===o&&(r||c.slice(x,x+s)===t)){u.push(c.slice(p,x)),p=x+s;continue}if(y==="/"){f=x;continue}}y==="["?d++:y==="]"&&d--}const h=u.length===0?c:c.substring(p),g=h.startsWith(Ss),v=g?h.substring(1):h,m=f&&f>p?f-p:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}};return n?c=>n({className:c,parseClassName:i}):i},El=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},jl=e=>({cache:Cl(e.cacheSize),parseClassName:Nl(e),...vl(e)}),Pl=/\s+/,Rl=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Pl);let c="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{modifiers:p,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:g}=n(d);let v=!!g,m=r(v?h.substring(0,g):h);if(!m){if(!v){c=d+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=d+(c.length>0?" "+c:c);continue}v=!1}const x=El(p).join(":"),y=f?x+Ss:x,b=y+m;if(s.includes(b))continue;s.push(b);const C=o(m,v);for(let w=0;w<C.length;++w){const T=C[w];s.push(y+T)}c=d+(c.length>0?" "+c:c)}return c};function Ml(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Cs(t))&&(r&&(r+=" "),r+=n);return r}const Cs=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Cs(e[r]))&&(n&&(n+=" "),n+=t);return n};function Dl(e,...t){let n,r,o,s=i;function i(u){const d=t.reduce((p,f)=>f(p),e());return n=jl(d),r=n.cache.get,o=n.cache.set,s=c,c(u)}function c(u){const d=r(u);if(d)return d;const p=Rl(u,n);return o(u,p),p}return function(){return s(Ml.apply(null,arguments))}}const ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ns=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tl=/^\d+\/\d+$/,kl=new Set(["px","full","screen"]),_l=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ol=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Al=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Il=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$l=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,We=e=>Ct(e)||kl.has(e)||Tl.test(e),Ge=e=>Rt(e,"length",Yl),Ct=e=>!!e&&!Number.isNaN(Number(e)),ar=e=>Rt(e,"number",Ct),It=e=>!!e&&Number.isInteger(Number(e)),Fl=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),J=e=>Ns.test(e),Ue=e=>_l.test(e),Ll=new Set(["length","size","percentage"]),Wl=e=>Rt(e,Ll,Es),Vl=e=>Rt(e,"position",Es),Bl=new Set(["image","url"]),Hl=e=>Rt(e,Bl,Ul),zl=e=>Rt(e,"",Gl),$t=()=>!0,Rt=(e,t,n)=>{const r=Ns.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Yl=e=>Ol.test(e)&&!Al.test(e),Es=()=>!1,Gl=e=>Il.test(e),Ul=e=>$l.test(e),Kl=()=>{const e=ie("colors"),t=ie("spacing"),n=ie("blur"),r=ie("brightness"),o=ie("borderColor"),s=ie("borderRadius"),i=ie("borderSpacing"),c=ie("borderWidth"),u=ie("contrast"),d=ie("grayscale"),p=ie("hueRotate"),f=ie("invert"),h=ie("gap"),g=ie("gradientColorStops"),v=ie("gradientColorStopPositions"),m=ie("inset"),x=ie("margin"),y=ie("opacity"),b=ie("padding"),C=ie("saturate"),w=ie("scale"),T=ie("sepia"),L=ie("skew"),k=ie("space"),P=ie("translate"),M=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",J,t],S=()=>[J,t],F=()=>["",We,Ge],N=()=>["auto",Ct,J],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",J],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Ct,J];return{cacheSize:500,separator:":",theme:{colors:[$t],spacing:[We,Ge],blur:["none","",Ue,J],brightness:j(),borderColor:[e],borderRadius:["none","","full",Ue,J],borderSpacing:S(),borderWidth:F(),contrast:j(),grayscale:O(),hueRotate:j(),invert:O(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[Fl,Ge],inset:D(),margin:D(),opacity:j(),padding:S(),saturate:j(),scale:j(),sepia:O(),skew:j(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",J]}],container:["container"],columns:[{columns:[Ue]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),J]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",It,J]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",J]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",It,J]}],"grid-cols":[{"grid-cols":[$t]}],"col-start-end":[{col:["auto",{span:["full",It,J]},J]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[$t]}],"row-start-end":[{row:["auto",{span:[It,J]},J]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",J]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",J]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",J,t]}],"min-w":[{"min-w":[J,t,"min","max","fit"]}],"max-w":[{"max-w":[J,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[J,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[J,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[J,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[J,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,Ge]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ar]}],"font-family":[{font:[$t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",J]}],"line-clamp":[{"line-clamp":["none",Ct,ar]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",We,J]}],"list-image":[{"list-image":["none",J]}],"list-style-type":[{list:["none","disc","decimal",J]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",We,Ge]}],"underline-offset":[{"underline-offset":["auto",We,J]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Vl]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Wl]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hl]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:_()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[We,J]}],"outline-w":[{outline:[We,Ge]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[We,Ge]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,zl]}],"shadow-color":[{shadow:[$t]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ue,J]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",J]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",J]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",J]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[It,J]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",J]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[We,Ge,ar]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ql=Dl(Kl);function $(...e){return ql(xl(e))}const G=l.forwardRef(({className:e,variant:t="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?dl:"button";return a.jsx(i,{className:$("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",t==="default"&&"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 active:scale-95",t==="destructive"&&"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 active:scale-95",t==="outline"&&"border border-gray-300 bg-white text-gray-900 hover:bg-gray-50 active:bg-gray-100 active:scale-95",t==="secondary"&&"bg-gray-200 text-gray-900 hover:bg-gray-300 active:bg-gray-400 active:scale-95",t==="ghost"&&"bg-transparent text-gray-900 hover:bg-gray-100 active:bg-gray-200 active:scale-95",t==="link"&&"bg-transparent text-blue-600 underline-offset-4 hover:text-blue-700 hover:underline active:text-blue-800",n==="default"&&"h-9 px-4 py-2",n==="sm"&&"h-8 px-3 text-xs gap-1.5",n==="lg"&&"h-10 px-6",n==="icon"&&"h-9 w-9 p-0",n==="icon-sm"&&"h-8 w-8 p-0",n==="icon-lg"&&"h-10 w-10 p-0",e),ref:s,...o})});G.displayName="Button";function Xl(e,t){const n=l.createContext(t),r=s=>{const{children:i,...c}=s,u=l.useMemo(()=>c,Object.values(c));return a.jsx(n.Provider,{value:u,children:i})};r.displayName=e+"Provider";function o(s){const i=l.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ye(e,t=[]){let n=[];function r(s,i){const c=l.createContext(i),u=n.length;n=[...n,i];const d=f=>{const{scope:h,children:g,...v}=f,m=h?.[e]?.[u]||c,x=l.useMemo(()=>v,Object.values(v));return a.jsx(m.Provider,{value:x,children:g})};d.displayName=s+"Provider";function p(f,h){const g=h?.[e]?.[u]||c,v=l.useContext(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=n.map(i=>l.createContext(i));return function(c){const u=c?.[e]||s;return l.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,Jl(o,...t)]}function Jl(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((c,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...c,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function H(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var fe=globalThis?.document?l.useLayoutEffect:()=>{},Zl=l[" useInsertionEffect ".trim().toString()]||fe;function Qe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Ql({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const p=l.useRef(e!==void 0);l.useEffect(()=>{const f=p.current;f!==c&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const d=l.useCallback(p=>{if(c){const f=eu(p)?p(e):p;f!==e&&i.current?.(f)}else s(p)},[c,e,s,i]);return[u,d]}function Ql({defaultProp:e,onChange:t}){const[n,r]=l.useState(e),o=l.useRef(n),s=l.useRef(t);return Zl(()=>{s.current=t},[t]),l.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function eu(e){return typeof e=="function"}function js(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ps(e){const[t,n]=l.useState(void 0);return fe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function tu(e,t){return l.useReducer((n,r)=>t[n][r]??n,e)}var Te=e=>{const{present:t,children:n}=e,r=nu(t),o=typeof n=="function"?n({present:r.isPresent}):l.Children.only(n),s=oe(r.ref,ru(o));return typeof n=="function"||r.isPresent?l.cloneElement(o,{ref:s}):null};Te.displayName="Presence";function nu(e){const[t,n]=l.useState(),r=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[c,u]=tu(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=dn(r.current);s.current=c==="mounted"?d:"none"},[c]),fe(()=>{const d=r.current,p=o.current;if(p!==e){const h=s.current,g=dn(d);e?u("MOUNT"):g==="none"||d?.display==="none"?u("UNMOUNT"):u(p&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),fe(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=g=>{const m=dn(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(u("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=g=>{g.target===t&&(s.current=dn(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:l.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function dn(e){return e?.animationName||"none"}function ru(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ou(e){const t=su(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(iu);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function su(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=lu(o),c=cu(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var au=Symbol("radix.slottable");function iu(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===au}function cu(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function lu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ir=uu.reduce((e,t)=>{const n=ou(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Tn="Checkbox",[du]=Ye(Tn),[fu,$r]=du(Tn);function pu(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:c,onCheckedChange:u,required:d,value:p="on",internal_do_not_use_render:f}=e,[h,g]=Qe({prop:n,defaultProp:o??!1,onChange:u,caller:Tn}),[v,m]=l.useState(null),[x,y]=l.useState(null),b=l.useRef(!1),C=v?!!i||!!v.closest("form"):!0,w={checked:h,disabled:s,setChecked:g,control:v,setControl:m,name:c,form:i,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:Ze(o)?!1:o,isFormControl:C,bubbleInput:x,setBubbleInput:y};return a.jsx(fu,{scope:t,...w,children:mu(f)?f(w):r})}var Rs="CheckboxTrigger",Ms=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:c,checked:u,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:v}=$r(Rs,e),m=oe(o,p),x=l.useRef(u);return l.useEffect(()=>{const y=s?.form;if(y){const b=()=>f(x.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[s,f]),a.jsx(Ir.button,{type:"button",role:"checkbox","aria-checked":Ze(u)?"mixed":u,"aria-required":d,"data-state":Os(u),"data-disabled":c?"":void 0,disabled:c,value:i,...r,ref:m,onKeyDown:H(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:H(n,y=>{f(b=>Ze(b)?!0:!b),v&&g&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})});Ms.displayName=Rs;var Fr=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:c,value:u,onCheckedChange:d,form:p,...f}=e;return a.jsx(pu,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:c,required:i,onCheckedChange:d,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:h})=>a.jsxs(a.Fragment,{children:[a.jsx(Ms,{...f,ref:t,__scopeCheckbox:n}),h&&a.jsx(_s,{__scopeCheckbox:n})]})})});Fr.displayName=Tn;var Ds="CheckboxIndicator",Ts=l.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=$r(Ds,n);return a.jsx(Te,{present:r||Ze(s.checked)||s.checked===!0,children:a.jsx(Ir.span,{"data-state":Os(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ts.displayName=Ds;var ks="CheckboxBubbleInput",_s=l.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:c,disabled:u,name:d,value:p,form:f,bubbleInput:h,setBubbleInput:g}=$r(ks,e),v=oe(n,g),m=js(s),x=Ps(r);l.useEffect(()=>{const b=h;if(!b)return;const C=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(C,"checked").set,L=!o.current;if(m!==s&&T){const k=new Event("click",{bubbles:L});b.indeterminate=Ze(s),T.call(b,Ze(s)?!1:s),b.dispatchEvent(k)}},[h,m,s,o]);const y=l.useRef(Ze(s)?!1:s);return a.jsx(Ir.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??y.current,required:c,disabled:u,name:d,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_s.displayName=ks;function mu(e){return typeof e=="function"}function Ze(e){return e==="indeterminate"}function Os(e){return Ze(e)?"indeterminate":e?"checked":"unchecked"}const hu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ro=e=>{const t=gu(e);return t.charAt(0).toUpperCase()+t.slice(1)},As=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),xu=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var vu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const yu=U.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},u)=>U.createElement("svg",{ref:u,...vu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:As("lucide",o),...!s&&!xu(c)&&{"aria-hidden":"true"},...c},[...i.map(([d,p])=>U.createElement(d,p)),...Array.isArray(s)?s:[s]]));const me=(e,t)=>{const n=U.forwardRef(({className:r,...o},s)=>U.createElement(yu,{ref:s,iconNode:t,className:As(`lucide-${hu(Ro(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ro(e),n};const bu=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Lr=me("calendar",bu);const wu=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wr=me("check",wu);const Su=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xt=me("chevron-down",Su);const Cu=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],$e=me("chevron-left",Cu);const Nu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ce=me("chevron-right",Nu);const Eu=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kn=me("chevron-up",Eu);const ju=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Pu=me("chevrons-left",ju);const Ru=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Mu=me("chevrons-right",Ru);const Du=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Vr=me("chevrons-up-down",Du);const Tu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ku=me("circle",Tu);const _u=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ou=me("clock",_u);const Au=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mo=me("plus",Au);const Iu=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$u=me("search",Iu);const Fu=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Lu=me("trash-2",Fu);const Wu=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vu=me("x",Wu),_n=l.forwardRef(({className:e,...t},n)=>a.jsx(Fr,{ref:n,className:$("peer h-4 w-4 shrink-0 rounded border border-gray-200 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-900 data-[state=checked]:border-gray-900 data-[state=checked]:text-white transition-colors",e),...t,children:a.jsx(Ts,{className:$("flex items-center justify-center text-current"),children:a.jsx(Wr,{className:"h-3.5 w-3.5 stroke-[2.5]"})})}));_n.displayName=Fr.displayName;const Ve=l.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:$("flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),ref:r,...n}));Ve.displayName="Input";const Is=l.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>a.jsx("div",{ref:o,role:n?"none":"separator","aria-orientation":t,className:$("shrink-0 bg-gray-200",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Is.displayName="Separator";const $s=l.createContext({variant:"default"});function On({className:e,variant:t="default",...n}){return a.jsx($s.Provider,{value:{variant:t},children:a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:$("w-full caption-bottom text-sm",e),...n})})})}function An({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:$("bg-gray-50 [&_tr]:border-b [&_tr]:border-gray-200",e),...t})}function In({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:$("[&_tr:last-child]:border-b-0",e),...t})}function Bu({className:e,...t}){return a.jsx("tfoot",{"data-slot":"table-footer",className:$("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Ae({className:e,...t}){const{variant:n}=l.useContext($s);return a.jsx("tr",{"data-slot":"table-row",className:$("hover:bg-gray-50 data-[state=selected]:bg-gray-50 transition-colors border-b border-gray-200",n==="clean"&&"border-b-0",e),...t})}function $n({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:$("text-foreground h-auto px-3 py-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ft({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:$("px-3 py-2 text-left align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Hu({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:$("text-muted-foreground mt-4 text-sm",e),...t})}function zu(e){const t=Yu(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Uu);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Yu(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=qu(o),c=Ku(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gu=Symbol("radix.slottable");function Uu(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gu}function Ku(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function qu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ju=Xu.reduce((e,t)=>{const n=zu(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Do(e){const t=Zu(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(ed);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Zu(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=nd(o),c=td(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qu=Symbol("radix.slottable");function ed(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qu}function td(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Br(e){const t=e+"CollectionProvider",[n,r]=Ye(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:x,children:y}=m,b=U.useRef(null),C=U.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:C,collectionRef:b,children:y})};i.displayName=t;const c=e+"CollectionSlot",u=Do(c),d=U.forwardRef((m,x)=>{const{scope:y,children:b}=m,C=s(c,y),w=oe(x,C.collectionRef);return a.jsx(u,{ref:w,children:b})});d.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",h=Do(p),g=U.forwardRef((m,x)=>{const{scope:y,children:b,...C}=m,w=U.useRef(null),T=oe(x,w),L=s(p,y);return U.useEffect(()=>(L.itemMap.set(w,{ref:w,...C}),()=>void L.itemMap.delete(w))),a.jsx(h,{[f]:"",ref:T,children:b})});g.displayName=p;function v(m){const x=s(e+"CollectionConsumer",m);return U.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const C=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((L,k)=>C.indexOf(L.ref.current)-C.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},v,r]}var rd=l.createContext(void 0);function Hr(e){const t=l.useContext(rd);return e||t||"ltr"}function od(e){const t=sd(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(id);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function sd(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=ld(o),c=cd(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ad=Symbol("radix.slottable");function id(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ad}function cd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ld(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ud=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fs=ud.reduce((e,t)=>{const n=od(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function dd(e,t){e&&qt.flushSync(()=>e.dispatchEvent(t))}function Re(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>t.current?.(...n),[])}function fd(e,t=globalThis?.document){const n=Re(e);l.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pd="DismissableLayer",wr="dismissableLayer.update",md="dismissableLayer.pointerDownOutside",hd="dismissableLayer.focusOutside",To,Ls=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jt=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...u}=e,d=l.useContext(Ls),[p,f]=l.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=l.useState({}),v=oe(t,k=>f(k)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=p?m.indexOf(p):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=b>=y,T=vd(k=>{const P=k.target,M=[...d.branches].some(E=>E.contains(P));!w||M||(o?.(k),i?.(k),k.defaultPrevented||c?.())},h),L=yd(k=>{const P=k.target;[...d.branches].some(E=>E.contains(P))||(s?.(k),i?.(k),k.defaultPrevented||c?.())},h);return fd(k=>{b===d.layers.size-1&&(r?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},h),l.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(To=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),ko(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=To)}},[p,h,n,d]),l.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),ko())},[p,d]),l.useEffect(()=>{const k=()=>g({});return document.addEventListener(wr,k),()=>document.removeEventListener(wr,k)},[]),a.jsx(Fs.div,{...u,ref:v,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,L.onFocusCapture),onBlurCapture:H(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,T.onPointerDownCapture)})});Jt.displayName=pd;var gd="DismissableLayerBranch",xd=l.forwardRef((e,t)=>{const n=l.useContext(Ls),r=l.useRef(null),o=oe(t,r);return l.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(Fs.div,{...e,ref:o})});xd.displayName=gd;function vd(e,t=globalThis?.document){const n=Re(e),r=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let u=function(){Ws(md,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yd(e,t=globalThis?.document){const n=Re(e),r=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ws(hd,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ko(){const e=new CustomEvent(wr);document.dispatchEvent(e)}function Ws(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?dd(o,s):o.dispatchEvent(s)}var ir=0;function Fn(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_o()),document.body.insertAdjacentElement("beforeend",e[1]??_o()),ir++,()=>{ir===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ir--}},[])}function _o(){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}function bd(e){const t=wd(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Cd);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function wd(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Ed(o),c=Nd(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sd=Symbol("radix.slottable");function Cd(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sd}function Nd(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ed(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pd=jd.reduce((e,t)=>{const n=bd(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),cr="focusScope.autoFocusOnMount",lr="focusScope.autoFocusOnUnmount",Oo={bubbles:!1,cancelable:!0},Rd="FocusScope",Zt=l.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[c,u]=l.useState(null),d=Re(o),p=Re(s),f=l.useRef(null),h=oe(t,m=>u(m)),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let m=function(C){if(g.paused||!c)return;const w=C.target;c.contains(w)?f.current=w:qe(f.current,{select:!0})},x=function(C){if(g.paused||!c)return;const w=C.relatedTarget;w!==null&&(c.contains(w)||qe(f.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&qe(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,c,g.paused]),l.useEffect(()=>{if(c){Io.add(g);const m=document.activeElement;if(!c.contains(m)){const y=new CustomEvent(cr,Oo);c.addEventListener(cr,d),c.dispatchEvent(y),y.defaultPrevented||(Md(Od(Vs(c)),{select:!0}),document.activeElement===m&&qe(c))}return()=>{c.removeEventListener(cr,d),setTimeout(()=>{const y=new CustomEvent(lr,Oo);c.addEventListener(lr,p),c.dispatchEvent(y),y.defaultPrevented||qe(m??document.body,{select:!0}),c.removeEventListener(lr,p),Io.remove(g)},0)}}},[c,d,p,g]);const v=l.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[C,w]=Dd(b);C&&w?!m.shiftKey&&y===w?(m.preventDefault(),n&&qe(C,{select:!0})):m.shiftKey&&y===C&&(m.preventDefault(),n&&qe(w,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return a.jsx(Pd.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});Zt.displayName=Rd;function Md(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(qe(r,{select:t}),document.activeElement!==n)return}function Dd(e){const t=Vs(e),n=Ao(t,e),r=Ao(t.reverse(),e);return[n,r]}function Vs(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ao(e,t){for(const n of e)if(!Td(n,{upTo:t}))return n}function Td(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kd(e){return e instanceof HTMLInputElement&&"select"in e}function qe(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kd(e)&&t&&e.select()}}var Io=_d();function _d(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$o(e,t),e.unshift(t)},remove(t){e=$o(e,t),e[0]?.resume()}}}function $o(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Od(e){return e.filter(t=>t.tagName!=="A")}var Ad=l[" useId ".trim().toString()]||(()=>{}),Id=0;function Ne(e){const[t,n]=l.useState(Ad());return fe(()=>{n(r=>r??String(Id++))},[e]),e||(t?`radix-${t}`:"")}const $d=["top","right","bottom","left"],et=Math.min,ve=Math.max,wn=Math.round,fn=Math.floor,Ie=e=>({x:e,y:e}),Fd={left:"right",right:"left",bottom:"top",top:"bottom"},Ld={start:"end",end:"start"};function Sr(e,t,n){return ve(e,et(t,n))}function He(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function Mt(e){return e.split("-")[1]}function zr(e){return e==="x"?"y":"x"}function Yr(e){return e==="y"?"height":"width"}const Wd=new Set(["top","bottom"]);function Oe(e){return Wd.has(ze(e))?"y":"x"}function Gr(e){return zr(Oe(e))}function Vd(e,t,n){n===void 0&&(n=!1);const r=Mt(e),o=Gr(e),s=Yr(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Sn(i)),[i,Sn(i)]}function Bd(e){const t=Sn(e);return[Cr(e),t,Cr(t)]}function Cr(e){return e.replace(/start|end/g,t=>Ld[t])}const Fo=["left","right"],Lo=["right","left"],Hd=["top","bottom"],zd=["bottom","top"];function Yd(e,t,n){switch(e){case"top":case"bottom":return n?t?Lo:Fo:t?Fo:Lo;case"left":case"right":return t?Hd:zd;default:return[]}}function Gd(e,t,n,r){const o=Mt(e);let s=Yd(ze(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Cr)))),s}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>Fd[t])}function Ud(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bs(e){return typeof e!="number"?Ud(e):{top:e,right:e,bottom:e,left:e}}function Cn(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 Wo(e,t,n){let{reference:r,floating:o}=e;const s=Oe(t),i=Gr(t),c=Yr(i),u=ze(t),d=s==="y",p=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[c]/2-o[c]/2;let g;switch(u){case"top":g={x:p,y:r.y-o.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(Mt(t)){case"start":g[i]-=h*(n&&d?-1:1);break;case"end":g[i]+=h*(n&&d?-1:1);break}return g}const Kd=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Wo(d,r,u),h=r,g={},v=0;for(let m=0;m<c.length;m++){const{name:x,fn:y}=c[m],{x:b,y:C,data:w,reset:T}=await y({x:p,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});p=b??p,f=C??f,g={...g,[x]:{...g[x],...w}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(d=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:p,y:f}=Wo(d,h,u)),m=-1)}return{x:p,y:f,placement:h,strategy:o,middlewareData:g}};async function zt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=He(t,e),v=Bs(g),x=c[h?f==="floating"?"reference":"floating":f],y=Cn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:u})),b=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},T=Cn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:C,strategy:u}):b);return{top:(y.top-T.top+v.top)/w.y,bottom:(T.bottom-y.bottom+v.bottom)/w.y,left:(y.left-T.left+v.left)/w.x,right:(T.right-y.right+v.right)/w.x}}const qd=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:p=0}=He(e,t)||{};if(d==null)return{};const f=Bs(p),h={x:n,y:r},g=Gr(o),v=Yr(g),m=await i.getDimensions(d),x=g==="y",y=x?"top":"left",b=x?"bottom":"right",C=x?"clientHeight":"clientWidth",w=s.reference[v]+s.reference[g]-h[g]-s.floating[v],T=h[g]-s.reference[g],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let k=L?L[C]:0;(!k||!await(i.isElement==null?void 0:i.isElement(L)))&&(k=c.floating[C]||s.floating[v]);const P=w/2-T/2,M=k/2-m[v]/2-1,E=et(f[y],M),D=et(f[b],M),S=E,F=k-m[v]-D,N=k/2-m[v]/2+P,V=Sr(S,N,F),_=!u.arrow&&Mt(o)!=null&&N!==V&&s.reference[v]/2-(N<S?E:D)-m[v]/2<0,W=_?N<S?N-S:N-F:0;return{[g]:h[g]+W,data:{[g]:V,centerOffset:N-V-W,..._&&{alignmentOffset:W}},reset:_}}}),Xd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=He(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ze(o),b=Oe(c),C=ze(c)===c,w=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=h||(C||!m?[Sn(c)]:Bd(c)),L=v!=="none";!h&&L&&T.push(...Gd(c,m,v,w));const k=[c,...T],P=await zt(t,x),M=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&M.push(P[y]),f){const N=Vd(o,i,w);M.push(P[N[0]],P[N[1]])}if(E=[...E,{placement:o,overflows:M}],!M.every(N=>N<=0)){var D,S;const N=(((D=s.flip)==null?void 0:D.index)||0)+1,V=k[N];if(V&&(!(f==="alignment"?b!==Oe(V):!1)||E.every(A=>Oe(A.placement)===b?A.overflows[0]>0:!0)))return{data:{index:N,overflows:E},reset:{placement:V}};let _=(S=E.filter(W=>W.overflows[0]<=0).sort((W,A)=>W.overflows[1]-A.overflows[1])[0])==null?void 0:S.placement;if(!_)switch(g){case"bestFit":{var F;const W=(F=E.filter(A=>{if(L){const O=Oe(A.placement);return O===b||O==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(O=>O>0).reduce((O,Q)=>O+Q,0)]).sort((A,O)=>A[1]-O[1])[0])==null?void 0:F[0];W&&(_=W);break}case"initialPlacement":_=c;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function Vo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bo(e){return $d.some(t=>e[t]>=0)}const Jd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=He(e,t);switch(r){case"referenceHidden":{const s=await zt(t,{...o,elementContext:"reference"}),i=Vo(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Bo(i)}}}case"escaped":{const s=await zt(t,{...o,altBoundary:!0}),i=Vo(s,n.floating);return{data:{escapedOffsets:i,escaped:Bo(i)}}}default:return{}}}}},Hs=new Set(["left","top"]);async function Zd(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ze(n),c=Mt(n),u=Oe(n)==="y",d=Hs.has(i)?-1:1,p=s&&u?-1:1,f=He(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(g=c==="end"?v*-1:v),u?{x:g*p,y:h*d}:{x:h*d,y:g*p}}const Qd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,u=await Zd(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},ef=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...u}=He(e,t),d={x:n,y:r},p=await zt(t,u),f=Oe(ze(o)),h=zr(f);let g=d[h],v=d[f];if(s){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=g+p[x],C=g-p[y];g=Sr(b,g,C)}if(i){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=v+p[x],C=v-p[y];v=Sr(b,v,C)}const m=c.fn({...t,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[f]:i}}}}}},tf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=He(e,t),p={x:n,y:r},f=Oe(o),h=zr(f);let g=p[h],v=p[f];const m=He(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const C=h==="y"?"height":"width",w=s.reference[h]-s.floating[C]+x.mainAxis,T=s.reference[h]+s.reference[C]-x.mainAxis;g<w?g=w:g>T&&(g=T)}if(d){var y,b;const C=h==="y"?"width":"height",w=Hs.has(ze(o)),T=s.reference[f]-s.floating[C]+(w&&((y=i.offset)==null?void 0:y[f])||0)+(w?0:x.crossAxis),L=s.reference[f]+s.reference[C]+(w?0:((b=i.offset)==null?void 0:b[f])||0)-(w?x.crossAxis:0);v<T?v=T:v>L&&(v=L)}return{[h]:g,[f]:v}}}},nf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...d}=He(e,t),p=await zt(t,d),f=ze(o),h=Mt(o),g=Oe(o)==="y",{width:v,height:m}=s.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,x=h==="end"?"top":"bottom");const b=m-p.top-p.bottom,C=v-p.left-p.right,w=et(m-p[x],b),T=et(v-p[y],C),L=!t.middlewareData.shift;let k=w,P=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),L&&!h){const E=ve(p.left,0),D=ve(p.right,0),S=ve(p.top,0),F=ve(p.bottom,0);g?P=v-2*(E!==0||D!==0?E+D:ve(p.left,p.right)):k=m-2*(S!==0||F!==0?S+F:ve(p.top,p.bottom))}await u({...t,availableWidth:P,availableHeight:k});const M=await i.getDimensions(c.floating);return v!==M.width||m!==M.height?{reset:{rects:!0}}:{}}}};function Ln(){return typeof window<"u"}function Dt(e){return zs(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Le(e){var t;return(t=(zs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zs(e){return Ln()?e instanceof Node||e instanceof ye(e).Node:!1}function Me(e){return Ln()?e instanceof Element||e instanceof ye(e).Element:!1}function Fe(e){return Ln()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function Ho(e){return!Ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}const rf=new Set(["inline","contents"]);function Qt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=De(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rf.has(o)}const of=new Set(["table","td","th"]);function sf(e){return of.has(Dt(e))}const af=[":popover-open",":modal"];function Wn(e){return af.some(t=>{try{return e.matches(t)}catch{return!1}})}const cf=["transform","translate","scale","rotate","perspective"],lf=["transform","translate","scale","rotate","perspective","filter"],uf=["paint","layout","strict","content"];function Ur(e){const t=Kr(),n=Me(e)?De(e):e;return cf.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||lf.some(r=>(n.willChange||"").includes(r))||uf.some(r=>(n.contain||"").includes(r))}function df(e){let t=tt(e);for(;Fe(t)&&!jt(t);){if(Ur(t))return t;if(Wn(t))return null;t=tt(t)}return null}function Kr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ff=new Set(["html","body","#document"]);function jt(e){return ff.has(Dt(e))}function De(e){return ye(e).getComputedStyle(e)}function Vn(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tt(e){if(Dt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ho(e)&&e.host||Le(e);return Ho(t)?t.host:t}function Ys(e){const t=tt(e);return jt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(t)&&Qt(t)?t:Ys(t)}function Yt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ys(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ye(o);if(s){const c=Nr(i);return t.concat(i,i.visualViewport||[],Qt(o)?o:[],c&&n?Yt(c):[])}return t.concat(o,Yt(o,[],n))}function Nr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){const t=De(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Fe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=wn(n)!==s||wn(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function qr(e){return Me(e)?e:e.contextElement}function Nt(e){const t=qr(e);if(!Fe(t))return Ie(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Gs(t);let i=(s?wn(n.width):n.width)/r,c=(s?wn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const pf=Ie(0);function Us(e){const t=ye(e);return!Kr()||!t.visualViewport?pf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ye(e)?!1:t}function pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=qr(e);let i=Ie(1);t&&(r?Me(r)&&(i=Nt(r)):i=Nt(e));const c=mf(s,n,r)?Us(s):Ie(0);let u=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,p=o.width/i.x,f=o.height/i.y;if(s){const h=ye(s),g=r&&Me(r)?ye(r):r;let v=h,m=Nr(v);for(;m&&r&&g!==v;){const x=Nt(m),y=m.getBoundingClientRect(),b=De(m),C=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,w=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;u*=x.x,d*=x.y,p*=x.x,f*=x.y,u+=C,d+=w,v=ye(m),m=Nr(v)}}return Cn({width:p,height:f,x:u,y:d})}function Bn(e,t){const n=Vn(e).scrollLeft;return t?t.left+n:pt(Le(e)).left+n}function Ks(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function hf(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Le(r),c=t?Wn(t.floating):!1;if(r===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Ie(1);const p=Ie(0),f=Fe(r);if((f||!f&&!s)&&((Dt(r)!=="body"||Qt(i))&&(u=Vn(r)),Fe(r))){const g=pt(r);d=Nt(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const h=i&&!f&&!s?Ks(i,u):Ie(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+h.x,y:n.y*d.y-u.scrollTop*d.y+p.y+h.y}}function gf(e){return Array.from(e.getClientRects())}function xf(e){const t=Le(e),n=Vn(e),r=e.ownerDocument.body,o=ve(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ve(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Bn(e);const c=-n.scrollTop;return De(r).direction==="rtl"&&(i+=ve(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const zo=25;function vf(e,t){const n=ye(e),r=Le(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,u=0;if(o){s=o.width,i=o.height;const p=Kr();(!p||p&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const d=Bn(r);if(d<=0){const p=r.ownerDocument,f=p.body,h=getComputedStyle(f),g=p.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-g);v<=zo&&(s-=v)}else d<=zo&&(s+=d);return{width:s,height:i,x:c,y:u}}const yf=new Set(["absolute","fixed"]);function bf(e,t){const n=pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Fe(e)?Nt(e):Ie(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:c,x:u,y:d}}function Yo(e,t,n){let r;if(t==="viewport")r=vf(e,n);else if(t==="document")r=xf(Le(e));else if(Me(t))r=bf(t,n);else{const o=Us(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cn(r)}function qs(e,t){const n=tt(e);return n===t||!Me(n)||jt(n)?!1:De(n).position==="fixed"||qs(n,t)}function wf(e,t){const n=t.get(e);if(n)return n;let r=Yt(e,[],!1).filter(c=>Me(c)&&Dt(c)!=="body"),o=null;const s=De(e).position==="fixed";let i=s?tt(e):e;for(;Me(i)&&!jt(i);){const c=De(i),u=Ur(i);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&yf.has(o.position)||Qt(i)&&!u&&qs(e,i))?r=r.filter(p=>p!==i):o=c,i=tt(i)}return t.set(e,r),r}function Sf(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Wn(t)?[]:wf(t,this._c):[].concat(n),r],c=i[0],u=i.reduce((d,p)=>{const f=Yo(t,p,o);return d.top=ve(f.top,d.top),d.right=et(f.right,d.right),d.bottom=et(f.bottom,d.bottom),d.left=ve(f.left,d.left),d},Yo(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Cf(e){const{width:t,height:n}=Gs(e);return{width:t,height:n}}function Nf(e,t,n){const r=Fe(t),o=Le(t),s=n==="fixed",i=pt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=Ie(0);function d(){u.x=Bn(o)}if(r||!r&&!s)if((Dt(t)!=="body"||Qt(o))&&(c=Vn(t)),r){const g=pt(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&d();s&&!r&&o&&d();const p=o&&!r&&!s?Ks(o,c):Ie(0),f=i.left+c.scrollLeft-u.x-p.x,h=i.top+c.scrollTop-u.y-p.y;return{x:f,y:h,width:i.width,height:i.height}}function ur(e){return De(e).position==="static"}function Go(e,t){if(!Fe(e)||De(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Le(e)===n&&(n=n.ownerDocument.body),n}function Xs(e,t){const n=ye(e);if(Wn(e))return n;if(!Fe(e)){let o=tt(e);for(;o&&!jt(o);){if(Me(o)&&!ur(o))return o;o=tt(o)}return n}let r=Go(e,t);for(;r&&sf(r)&&ur(r);)r=Go(r,t);return r&&jt(r)&&ur(r)&&!Ur(r)?n:r||df(e)||n}const Ef=async function(e){const t=this.getOffsetParent||Xs,n=this.getDimensions,r=await n(e.floating);return{reference:Nf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jf(e){return De(e).direction==="rtl"}const Pf={convertOffsetParentRelativeRectToViewportRelativeRect:hf,getDocumentElement:Le,getClippingRect:Sf,getOffsetParent:Xs,getElementRects:Ef,getClientRects:gf,getDimensions:Cf,getScale:Nt,isElement:Me,isRTL:jf};function Js(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rf(e,t){let n=null,r;const o=Le(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:p,top:f,width:h,height:g}=d;if(c||t(),!h||!g)return;const v=fn(f),m=fn(o.clientWidth-(p+h)),x=fn(o.clientHeight-(f+g)),y=fn(p),C={rootMargin:-v+"px "+-m+"px "+-x+"px "+-y+"px",threshold:ve(0,et(1,u))||1};let w=!0;function T(L){const k=L[0].intersectionRatio;if(k!==u){if(!w)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Js(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,C)}n.observe(e)}return i(!0),s}function Mf(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=qr(e),p=o||s?[...d?Yt(d):[],...Yt(t)]:[];p.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=d&&c?Rf(d,n):null;let h=-1,g=null;i&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),d&&!u&&g.observe(d),g.observe(t));let v,m=u?pt(e):null;u&&x();function x(){const y=pt(e);m&&!Js(m,y)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;p.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(y=g)==null||y.disconnect(),g=null,u&&cancelAnimationFrame(v)}}const Df=Qd,Tf=ef,kf=Xd,_f=nf,Of=Jd,Uo=qd,Af=tf,If=(e,t,n)=>{const r=new Map,o={platform:Pf,...n},s={...o.platform,_c:r};return Kd(e,t,{...o,platform:s})};var $f=typeof document<"u",Ff=function(){},xn=$f?U.useLayoutEffect:Ff;function Nn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nn(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Nn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Zs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ko(e,t){const n=Zs(e);return Math.round(t*n)/n}function dr(e){const t=l.useRef(e);return xn(()=>{t.current=e}),t}function Lf(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=l.useState(r);Nn(h,r)||g(r);const[v,m]=l.useState(null),[x,y]=l.useState(null),b=l.useCallback(A=>{A!==L.current&&(L.current=A,m(A))},[]),C=l.useCallback(A=>{A!==k.current&&(k.current=A,y(A))},[]),w=s||v,T=i||x,L=l.useRef(null),k=l.useRef(null),P=l.useRef(p),M=u!=null,E=dr(u),D=dr(o),S=dr(d),F=l.useCallback(()=>{if(!L.current||!k.current)return;const A={placement:t,strategy:n,middleware:h};D.current&&(A.platform=D.current),If(L.current,k.current,A).then(O=>{const Q={...O,isPositioned:S.current!==!1};N.current&&!Nn(P.current,Q)&&(P.current=Q,qt.flushSync(()=>{f(Q)}))})},[h,t,n,D,S]);xn(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[d]);const N=l.useRef(!1);xn(()=>(N.current=!0,()=>{N.current=!1}),[]),xn(()=>{if(w&&(L.current=w),T&&(k.current=T),w&&T){if(E.current)return E.current(w,T,F);F()}},[w,T,F,E,M]);const V=l.useMemo(()=>({reference:L,floating:k,setReference:b,setFloating:C}),[b,C]),_=l.useMemo(()=>({reference:w,floating:T}),[w,T]),W=l.useMemo(()=>{const A={position:n,left:0,top:0};if(!_.floating)return A;const O=Ko(_.floating,p.x),Q=Ko(_.floating,p.y);return c?{...A,transform:"translate("+O+"px, "+Q+"px)",...Zs(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:Q}},[n,c,_.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:F,refs:V,elements:_,floatingStyles:W}),[p,F,V,_,W])}const Wf=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Uo({element:r.current,padding:o}).fn(n):{}:r?Uo({element:r,padding:o}).fn(n):{}}}},Vf=(e,t)=>({...Df(e),options:[e,t]}),Bf=(e,t)=>({...Tf(e),options:[e,t]}),Hf=(e,t)=>({...Af(e),options:[e,t]}),zf=(e,t)=>({...kf(e),options:[e,t]}),Yf=(e,t)=>({..._f(e),options:[e,t]}),Gf=(e,t)=>({...Of(e),options:[e,t]}),Uf=(e,t)=>({...Wf(e),options:[e,t]});function Kf(e){const t=qf(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Jf);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function qf(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Qf(o),c=Zf(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xf=Symbol("radix.slottable");function Jf(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xf}function Zf(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Qf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ep=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tp=ep.reduce((e,t)=>{const n=Kf(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),np="Arrow",Qs=l.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return a.jsx(tp.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qs.displayName=np;var rp=Qs;function op(e){const t=sp(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(ip);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function sp(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=lp(o),c=cp(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ap=Symbol("radix.slottable");function ip(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ap}function cp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function lp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var up=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ea=up.reduce((e,t)=>{const n=op(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Xr="Popper",[ta,Tt]=Ye(Xr),[dp,na]=ta(Xr),ra=e=>{const{__scopePopper:t,children:n}=e,[r,o]=l.useState(null);return a.jsx(dp,{scope:t,anchor:r,onAnchorChange:o,children:n})};ra.displayName=Xr;var oa="PopperAnchor",sa=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=na(oa,n),i=l.useRef(null),c=oe(t,i),u=l.useRef(null);return l.useEffect(()=>{const d=u.current;u.current=r?.current||i.current,d!==u.current&&s.onAnchorChange(u.current)}),r?null:a.jsx(ea.div,{...o,ref:c})});sa.displayName=oa;var Jr="PopperContent",[fp,pp]=ta(Jr),aa=l.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=e,x=na(Jr,n),[y,b]=l.useState(null),C=oe(t,I=>b(I)),[w,T]=l.useState(null),L=Ps(w),k=L?.width??0,P=L?.height??0,M=r+(s!=="center"?"-"+s:""),E=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},D=Array.isArray(d)?d:[d],S=D.length>0,F={padding:E,boundary:D.filter(hp),altBoundary:S},{refs:N,floatingStyles:V,placement:_,isPositioned:W,middlewareData:A}=Lf({strategy:"fixed",placement:M,whileElementsMounted:(...I)=>Mf(...I,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Vf({mainAxis:o+P,alignmentAxis:i}),u&&Bf({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Hf():void 0,...F}),u&&zf({...F}),Yf({...F,apply:({elements:I,rects:Z,availableWidth:ae,availableHeight:ee})=>{const{width:te,height:R}=Z.reference,Y=I.floating.style;Y.setProperty("--radix-popper-available-width",`${ae}px`),Y.setProperty("--radix-popper-available-height",`${ee}px`),Y.setProperty("--radix-popper-anchor-width",`${te}px`),Y.setProperty("--radix-popper-anchor-height",`${R}px`)}}),w&&Uf({element:w,padding:c}),gp({arrowWidth:k,arrowHeight:P}),h&&Gf({strategy:"referenceHidden",...F})]}),[O,Q]=la(_),j=Re(v);fe(()=>{W&&j?.()},[W,j]);const z=A.arrow?.x,q=A.arrow?.y,X=A.arrow?.centerOffset!==0,[ce,le]=l.useState();return fe(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),a.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:W?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(fp,{scope:n,placedSide:O,onArrowChange:T,arrowX:z,arrowY:q,shouldHideArrow:X,children:a.jsx(ea.div,{"data-side":O,"data-align":Q,...m,ref:C,style:{...m.style,animation:W?void 0:"none"}})})})});aa.displayName=Jr;var ia="PopperArrow",mp={top:"bottom",right:"left",bottom:"top",left:"right"},ca=l.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=pp(ia,r),i=mp[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(rp,{...o,ref:n,style:{...o.style,display:"block"}})})});ca.displayName=ia;function hp(e){return e!==null}var gp=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,p]=la(n),f={start:"0%",center:"50%",end:"100%"}[p],h=(o.arrow?.x??0)+c/2,g=(o.arrow?.y??0)+u/2;let v="",m="";return d==="bottom"?(v=i?f:`${h}px`,m=`${-u}px`):d==="top"?(v=i?f:`${h}px`,m=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,m=i?f:`${g}px`):d==="left"&&(v=`${r.floating.width+u}px`,m=i?f:`${g}px`),{data:{x:v,y:m}}}});function la(e){const[t,n="center"]=e.split("-");return[t,n]}var Hn=ra,zn=sa,Zr=aa,Qr=ca;function xp(e){const t=vp(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(bp);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function vp(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Sp(o),c=wp(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yp=Symbol("radix.slottable");function bp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yp}function wp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Sp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Np=Cp.reduce((e,t)=>{const n=xp(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ep="Portal",en=l.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=l.useState(!1);fe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?gs.createPortal(a.jsx(Np.div,{...r,ref:t}),i):null});en.displayName=Ep;function ua(e){const t=jp(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Rp);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function jp(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Dp(o),c=Mp(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pp=Symbol("radix.slottable");function Rp(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pp}function Mp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Dp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tn=Tp.reduce((e,t)=>{const n=ua(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kp(e,t){e&&qt.flushSync(()=>e.dispatchEvent(t))}function _p(e){const t=Op(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Ip);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Op(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Fp(o),c=$p(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ap=Symbol("radix.slottable");function Ip(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ap}function $p(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Fp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],da=Lp.reduce((e,t)=>{const n=_p(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fr="rovingFocusGroup.onEntryFocus",Wp={bubbles:!1,cancelable:!0},nn="RovingFocusGroup",[Er,fa,Vp]=Br(nn),[Bp,pa]=Ye(nn,[Vp]),[Hp,zp]=Bp(nn),ma=l.forwardRef((e,t)=>a.jsx(Er.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Er.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Yp,{...e,ref:t})})}));ma.displayName=nn;var Yp=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=l.useRef(null),g=oe(t,h),v=Hr(s),[m,x]=Qe({prop:i,defaultProp:c??null,onChange:u,caller:nn}),[y,b]=l.useState(!1),C=Re(d),w=fa(n),T=l.useRef(!1),[L,k]=l.useState(0);return l.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(fr,C),()=>P.removeEventListener(fr,C)},[C]),a.jsx(Hp,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:m,onItemFocus:l.useCallback(P=>x(P),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:l.useCallback(()=>k(P=>P-1),[]),children:a.jsx(da.div,{tabIndex:y||L===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{T.current=!0}),onFocus:H(e.onFocus,P=>{const M=!T.current;if(P.target===P.currentTarget&&M&&!y){const E=new CustomEvent(fr,Wp);if(P.currentTarget.dispatchEvent(E),!E.defaultPrevented){const D=w().filter(_=>_.focusable),S=D.find(_=>_.active),F=D.find(_=>_.id===m),V=[S,F,...D].filter(Boolean).map(_=>_.ref.current);xa(V,p)}}T.current=!1}),onBlur:H(e.onBlur,()=>b(!1))})})}),ha="RovingFocusGroupItem",ga=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...c}=e,u=Ne(),d=s||u,p=zp(ha,n),f=p.currentTabStopId===d,h=fa(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:m}=p;return l.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),a.jsx(Er.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:a.jsx(da.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:H(e.onMouseDown,x=>{r?p.onItemFocus(d):x.preventDefault()}),onFocus:H(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:H(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Kp(x,p.orientation,p.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=h().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const w=C.indexOf(x.currentTarget);C=p.loop?qp(C,w+1):C.slice(w+1)}setTimeout(()=>xa(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});ga.displayName=ha;var Gp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Up(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Kp(e,t,n){const r=Up(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gp[r]}function xa(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xp=ma,Jp=ga,Zp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vt=new WeakMap,pn=new WeakMap,mn={},pr=0,va=function(e){return e&&(e.host||va(e.parentNode))},Qp=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=va(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},em=function(e,t,n,r){var o=Qp(t,Array.isArray(e)?e:[e]);mn[n]||(mn[n]=new WeakMap);var s=mn[n],i=[],c=new Set,u=new Set(o),d=function(f){!f||c.has(f)||(c.add(f),d(f.parentNode))};o.forEach(d);var p=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(c.has(h))p(h);else try{var g=h.getAttribute(r),v=g!==null&&g!=="false",m=(vt.get(h)||0)+1,x=(s.get(h)||0)+1;vt.set(h,m),s.set(h,x),i.push(h),m===1&&v&&pn.set(h,!0),x===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return p(t),c.clear(),pr++,function(){i.forEach(function(f){var h=vt.get(f)-1,g=s.get(f)-1;vt.set(f,h),s.set(f,g),h||(pn.has(f)||f.removeAttribute(r),pn.delete(f)),g||f.removeAttribute(n)}),pr--,pr||(vt=new WeakMap,vt=new WeakMap,pn=new WeakMap,mn={})}},Yn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Zp(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),em(r,o,n,"aria-hidden")):function(){return null}},_e=function(){return _e=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},_e.apply(this,arguments)};function ya(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function tm(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var vn="right-scroll-bar-position",yn="width-before-scroll-bar",nm="with-scroll-bars-hidden",rm="--removed-body-scroll-bar-size";function mr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function om(e,t){var n=U.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var sm=typeof window<"u"?l.useLayoutEffect:l.useEffect,qo=new WeakMap;function am(e,t){var n=om(null,function(r){return e.forEach(function(o){return mr(o,r)})});return sm(function(){var r=qo.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(c){s.has(c)||mr(c,null)}),s.forEach(function(c){o.has(c)||mr(c,i)})}qo.set(n,e)},[e]),n}function im(e){return e}function cm(e,t){t===void 0&&(t=im);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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var u=function(){var p=i;i=[],p.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),n}}}};return o}function lm(e){e===void 0&&(e={});var t=cm(null);return t.options=_e({async:!0,ssr:!1},e),t}var ba=function(e){var t=e.sideCar,n=ya(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return l.createElement(r,_e({},n))};ba.isSideCarExport=!0;function um(e,t){return e.useMedium(t),ba}var wa=lm(),hr=function(){},Gn=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:hr,onWheelCapture:hr,onTouchMoveCapture:hr}),o=r[0],s=r[1],i=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,h=e.sideCar,g=e.noRelative,v=e.noIsolation,m=e.inert,x=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,w=ya(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,L=am([n,t]),k=_e(_e({},w),o);return l.createElement(l.Fragment,null,p&&l.createElement(T,{sideCar:wa,removeScrollBar:d,shards:f,noRelative:g,noIsolation:v,inert:m,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:C}),i?l.cloneElement(l.Children.only(c),_e(_e({},k),{ref:L})):l.createElement(b,_e({},k,{className:u,ref:L}),c))});Gn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gn.classNames={fullWidth:yn,zeroRight:vn};var dm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dm();return t&&e.setAttribute("nonce",t),e}function pm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fm())&&(pm(t,n),mm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gm=function(){var e=hm();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Sa=function(){var e=gm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},xm={left:0,top:0,right:0,gap:0},gr=function(e){return parseInt(e||"",10)||0},vm=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gr(n),gr(r),gr(o)]},ym=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xm;var t=vm(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])}},bm=Sa(),Et="data-scroll-locked",wm=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
7
+ .`.concat(nm,` {
8
8
  overflow: hidden `).concat(r,`;
9
- padding-right: `).concat(l,"px ").concat(r,`;
9
+ padding-right: `).concat(c,"px ").concat(r,`;
10
10
  }
11
- body[`).concat(Pt,`] {
11
+ body[`).concat(Et,`] {
12
12
  overflow: hidden `).concat(r,`;
13
13
  overscroll-behavior: contain;
14
14
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -17,34 +17,34 @@ React keys must be passed directly to JSX without using spread:
17
17
  padding-right: `).concat(i,`px;
18
18
  margin-left:0;
19
19
  margin-top:0;
20
- margin-right: `).concat(l,"px ").concat(r,`;
21
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
20
+ margin-right: `).concat(c,"px ").concat(r,`;
21
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
22
22
  }
23
23
 
24
- .`).concat(Sn,` {
25
- right: `).concat(l,"px ").concat(r,`;
24
+ .`).concat(vn,` {
25
+ right: `).concat(c,"px ").concat(r,`;
26
26
  }
27
27
 
28
- .`).concat(Cn,` {
29
- margin-right: `).concat(l,"px ").concat(r,`;
28
+ .`).concat(yn,` {
29
+ margin-right: `).concat(c,"px ").concat(r,`;
30
30
  }
31
31
 
32
- .`).concat(Sn," .").concat(Sn,` {
32
+ .`).concat(vn," .").concat(vn,` {
33
33
  right: 0 `).concat(r,`;
34
34
  }
35
35
 
36
- .`).concat(Cn," .").concat(Cn,` {
36
+ .`).concat(yn," .").concat(yn,` {
37
37
  margin-right: 0 `).concat(r,`;
38
38
  }
39
39
 
40
- body[`).concat(Pt,`] {
41
- `).concat(Mm,": ").concat(l,`px;
40
+ body[`).concat(Et,`] {
41
+ `).concat(rm,": ").concat(c,`px;
42
42
  }
43
- `)},ss=function(){var e=parseInt(document.body.getAttribute(Pt)||"0",10);return isFinite(e)?e:0},Km=function(){c.useEffect(function(){return document.body.setAttribute(Pt,(ss()+1).toString()),function(){var e=ss()-1;e<=0?document.body.removeAttribute(Pt):document.body.setAttribute(Pt,e.toString())}},[])},qm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Km();var s=c.useMemo(function(){return Ym(o)},[o]);return c.createElement(Gm,{styles:Um(s,!t,o,n?"":"!important")})},Tr=!1;if(typeof window<"u")try{var yn=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener("test",yn,yn),window.removeEventListener("test",yn,yn)}catch{Tr=!1}var St=Tr?{passive:!1}:!1,Xm=function(e){return e.tagName==="TEXTAREA"},La=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xm(e)&&n[t]==="visible")},Jm=function(e){return La(e,"overflowY")},Zm=function(e){return La(e,"overflowX")},as=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Wa(e,r);if(o){var s=Va(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eh=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Wa=function(e,t){return e==="v"?Jm(t):Zm(t)},Va=function(e,t){return e==="v"?Qm(t):eh(t)},th=function(e,t){return e==="h"&&t==="rtl"?-1:1},nh=function(e,t,n,r,o){var s=th(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,u=t.contains(l),d=!1,p=i>0,f=0,h=0;do{if(!l)break;var g=Va(e,l),v=g[0],m=g[1],x=g[2],y=m-x-s*v;(v||y)&&Wa(e,l)&&(f+=y,h+=v);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(p&&Math.abs(f)<1||!p&&Math.abs(h)<1)&&(d=!0),d},bn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},is=function(e){return[e.deltaX,e.deltaY]},cs=function(e){return e&&"current"in e?e.current:e},rh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oh=function(e){return`
43
+ `)},Xo=function(){var e=parseInt(document.body.getAttribute(Et)||"0",10);return isFinite(e)?e:0},Sm=function(){l.useEffect(function(){return document.body.setAttribute(Et,(Xo()+1).toString()),function(){var e=Xo()-1;e<=0?document.body.removeAttribute(Et):document.body.setAttribute(Et,e.toString())}},[])},Cm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Sm();var s=l.useMemo(function(){return ym(o)},[o]);return l.createElement(bm,{styles:wm(s,!t,o,n?"":"!important")})},jr=!1;if(typeof window<"u")try{var hn=Object.defineProperty({},"passive",{get:function(){return jr=!0,!0}});window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{jr=!1}var yt=jr?{passive:!1}:!1,Nm=function(e){return e.tagName==="TEXTAREA"},Ca=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Nm(e)&&n[t]==="visible")},Em=function(e){return Ca(e,"overflowY")},jm=function(e){return Ca(e,"overflowX")},Jo=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Na(e,r);if(o){var s=Ea(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pm=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Rm=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Na=function(e,t){return e==="v"?Em(t):jm(t)},Ea=function(e,t){return e==="v"?Pm(t):Rm(t)},Mm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dm=function(e,t,n,r,o){var s=Mm(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,u=t.contains(c),d=!1,p=i>0,f=0,h=0;do{if(!c)break;var g=Ea(e,c),v=g[0],m=g[1],x=g[2],y=m-x-s*v;(v||y)&&Na(e,c)&&(f+=y,h+=v);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(p&&Math.abs(f)<1||!p&&Math.abs(h)<1)&&(d=!0),d},gn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zo=function(e){return[e.deltaX,e.deltaY]},Qo=function(e){return e&&"current"in e?e.current:e},Tm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},km=function(e){return`
44
44
  .block-interactivity-`.concat(e,` {pointer-events: none;}
45
45
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
46
- `)},sh=0,Ct=[];function ah(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(sh++)[0],s=c.useState(Fa)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Pm([e.lockRef.current],(e.shards||[]).map(cs),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=c.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var y=bn(m),w=n.current,C="deltaX"in m?m.deltaX:w[0]-y[0],S="deltaY"in m?m.deltaY:w[1]-y[1],D,$=m.target,O=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in m&&O==="h"&&$.type==="range")return!1;var b=as(O,$);if(!b)return!0;if(b?D=O:(D=O==="v"?"h":"v",b=as(O,$)),!b)return!1;if(!r.current&&"changedTouches"in m&&(C||S)&&(r.current=D),!D)return!0;var P=r.current||D;return nh(P,x,m,P==="h"?C:S)},[]),u=c.useCallback(function(m){var x=m;if(!(!Ct.length||Ct[Ct.length-1]!==s)){var y="deltaY"in x?is(x):bn(x),w=t.current.filter(function(D){return D.name===x.type&&(D.target===x.target||x.target===D.shadowParent)&&rh(D.delta,y)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var C=(i.current.shards||[]).map(cs).filter(Boolean).filter(function(D){return D.contains(x.target)}),S=C.length>0?l(x,C[0]):!i.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),d=c.useCallback(function(m,x,y,w){var C={name:m,delta:x,target:y,should:w,shadowParent:ih(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),p=c.useCallback(function(m){n.current=bn(m),r.current=void 0},[]),f=c.useCallback(function(m){d(m.type,is(m),m.target,l(m,e.lockRef.current))},[]),h=c.useCallback(function(m){d(m.type,bn(m),m.target,l(m,e.lockRef.current))},[]);c.useEffect(function(){return Ct.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,St),document.addEventListener("touchmove",u,St),document.addEventListener("touchstart",p,St),function(){Ct=Ct.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,St),document.removeEventListener("touchmove",u,St),document.removeEventListener("touchstart",p,St)}},[]);var g=e.removeScrollBar,v=e.inert;return c.createElement(c.Fragment,null,v?c.createElement(s,{styles:oh(o)}):null,g?c.createElement(qm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ih(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ch=Im($a,ah);var sn=c.forwardRef(function(e,t){return c.createElement(Jn,Ae({},e,{ref:t,sideCar:ch}))});sn.classNames=Jn.classNames;var Or=["Enter"," "],lh=["ArrowDown","PageUp","Home"],Ba=["ArrowUp","PageDown","End"],uh=[...lh,...Ba],dh={ltr:[...Or,"ArrowRight"],rtl:[...Or,"ArrowLeft"]},fh={ltr:["ArrowLeft"],rtl:["ArrowRight"]},an="Menu",[Kt,ph,mh]=Kr(an),[yt,za]=Ue(an,[mh,_t,Ma]),cn=_t(),Ha=Ma(),[Ya,rt]=yt(an),[hh,ln]=yt(an),Ga=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,l=cn(t),[u,d]=c.useState(null),p=c.useRef(!1),f=ke(s),h=qr(o);return c.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),a.jsx(Kn,{...l,children:a.jsx(Ya,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(hh,{scope:t,onClose:c.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:i,children:r})})})};Ga.displayName=an;var gh="MenuAnchor",ao=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=cn(n);return a.jsx(qn,{...o,...r,ref:t})});ao.displayName=gh;var io="MenuPortal",[xh,Ua]=yt(io,{forceMount:void 0}),Ka=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=rt(io,t);return a.jsx(xh,{scope:t,forceMount:n,children:a.jsx(Oe,{present:n||s.open,children:a.jsx(nn,{asChild:!0,container:o,children:r})})})};Ka.displayName=io;var Pe="MenuContent",[vh,co]=yt(Pe),qa=c.forwardRef((e,t)=>{const n=Ua(Pe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=rt(Pe,e.__scopeMenu),i=ln(Pe,e.__scopeMenu);return a.jsx(Kt.Provider,{scope:e.__scopeMenu,children:a.jsx(Oe,{present:r||s.open,children:a.jsx(Kt.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(yh,{...o,ref:t}):a.jsx(bh,{...o,ref:t})})})})}),yh=c.forwardRef((e,t)=>{const n=rt(Pe,e.__scopeMenu),r=c.useRef(null),o=ie(t,r);return c.useEffect(()=>{const s=r.current;if(s)return Xn(s)},[]),a.jsx(lo,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bh=c.forwardRef((e,t)=>{const n=rt(Pe,e.__scopeMenu);return a.jsx(lo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),wh=ja("MenuContent.ScrollLock"),lo=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...m}=e,x=rt(Pe,n),y=ln(Pe,n),w=cn(n),C=Ha(n),S=ph(n),[D,$]=c.useState(null),O=c.useRef(null),b=ie(t,O,x.onContentChange),P=c.useRef(0),E=c.useRef(""),T=c.useRef(0),R=c.useRef(null),W=c.useRef("right"),N=c.useRef(0),V=v?sn:c.Fragment,_=v?{as:wh,allowPinchZoom:!0}:void 0,F=I=>{const re=E.current+I,k=S().filter(A=>!A.disabled),z=document.activeElement,K=k.find(A=>A.ref.current===z)?.textValue,X=k.map(A=>A.textValue),le=Oh(X,re,K),ue=k.find(A=>A.textValue===le)?.ref.current;(function A(Q){E.current=Q,window.clearTimeout(P.current),Q!==""&&(P.current=window.setTimeout(()=>A(""),1e3))})(re),ue&&setTimeout(()=>ue.focus())};c.useEffect(()=>()=>window.clearTimeout(P.current),[]),zn();const M=c.useCallback(I=>W.current===R.current?.side&&Ah(I,R.current?.area),[]);return a.jsx(vh,{scope:n,searchRef:E,onItemEnter:c.useCallback(I=>{M(I)&&I.preventDefault()},[M]),onItemLeave:c.useCallback(I=>{M(I)||(O.current?.focus(),$(null))},[M]),onTriggerLeave:c.useCallback(I=>{M(I)&&I.preventDefault()},[M]),pointerGraceTimerRef:T,onPointerGraceIntentChange:c.useCallback(I=>{R.current=I},[]),children:a.jsx(V,{..._,children:a.jsx(en,{asChild:!0,trapped:o,onMountAutoFocus:G(s,I=>{I.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:g,children:a.jsx(Sm,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:$,onEntryFocus:G(u,I=>{y.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(oo,{role:"menu","aria-orientation":"vertical","data-state":fi(x.open),"data-radix-menu-content":"",dir:y.dir,...w,...m,ref:b,style:{outline:"none",...m.style},onKeyDown:G(m.onKeyDown,I=>{const k=I.target.closest("[data-radix-menu-content]")===I.currentTarget,z=I.ctrlKey||I.altKey||I.metaKey,K=I.key.length===1;k&&(I.key==="Tab"&&I.preventDefault(),!z&&K&&F(I.key));const X=O.current;if(I.target!==X||!uh.includes(I.key))return;I.preventDefault();const ue=S().filter(A=>!A.disabled).map(A=>A.ref.current);Ba.includes(I.key)&&ue.reverse(),Dh(ue)}),onBlur:G(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(P.current),E.current="")}),onPointerMove:G(e.onPointerMove,qt(I=>{const re=I.target,k=N.current!==I.clientX;if(I.currentTarget.contains(re)&&k){const z=I.clientX>N.current?"right":"left";W.current=z,N.current=I.clientX}}))})})})})})})});qa.displayName=Pe;var Sh="MenuGroup",uo=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(rn.div,{role:"group",...r,ref:t})});uo.displayName=Sh;var Ch="MenuLabel",Xa=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(rn.div,{...r,ref:t})});Xa.displayName=Ch;var kn="MenuItem",ls="menu.itemSelect",Zn=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=c.useRef(null),i=ln(kn,e.__scopeMenu),l=co(kn,e.__scopeMenu),u=ie(t,s),d=c.useRef(!1),p=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(ls,{bubbles:!0,cancelable:!0});f.addEventListener(ls,g=>r?.(g),{once:!0}),om(f,h),h.defaultPrevented?d.current=!1:i.onClose()}};return a.jsx(Ja,{...o,ref:u,disabled:n,onClick:G(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),d.current=!0},onPointerUp:G(e.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:G(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||Or.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Zn.displayName=kn;var Ja=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=co(kn,n),l=Ha(n),u=c.useRef(null),d=ie(t,u),[p,f]=c.useState(!1),[h,g]=c.useState("");return c.useEffect(()=>{const v=u.current;v&&g((v.textContent??"").trim())},[s.children]),a.jsx(Kt.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:a.jsx(Cm,{asChild:!0,...l,focusable:!r,children:a.jsx(rn.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:G(e.onPointerMove,qt(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,qt(v=>i.onItemLeave(v))),onFocus:G(e.onFocus,()=>f(!0)),onBlur:G(e.onBlur,()=>f(!1))})})})}),Nh="MenuCheckboxItem",Za=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return a.jsx(ri,{scope:e.__scopeMenu,checked:n,children:a.jsx(Zn,{role:"menuitemcheckbox","aria-checked":Dn(n)?"mixed":n,...o,ref:t,"data-state":mo(n),onSelect:G(o.onSelect,()=>r?.(Dn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Za.displayName=Nh;var Qa="MenuRadioGroup",[Eh,jh]=yt(Qa,{value:void 0,onValueChange:()=>{}}),ei=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=ke(r);return a.jsx(Eh,{scope:e.__scopeMenu,value:n,onValueChange:s,children:a.jsx(uo,{...o,ref:t})})});ei.displayName=Qa;var ti="MenuRadioItem",ni=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=jh(ti,e.__scopeMenu),s=n===o.value;return a.jsx(ri,{scope:e.__scopeMenu,checked:s,children:a.jsx(Zn,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":mo(s),onSelect:G(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ni.displayName=ti;var fo="MenuItemIndicator",[ri,Ph]=yt(fo,{checked:!1}),oi=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Ph(fo,n);return a.jsx(Oe,{present:r||Dn(s.checked)||s.checked===!0,children:a.jsx(rn.span,{...o,ref:t,"data-state":mo(s.checked)})})});oi.displayName=fo;var Rh="MenuSeparator",si=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(rn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});si.displayName=Rh;var Mh="MenuArrow",ai=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=cn(n);return a.jsx(so,{...o,...r,ref:t})});ai.displayName=Mh;var po="MenuSub",[kh,ii]=yt(po),ci=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=rt(po,t),i=cn(t),[l,u]=c.useState(null),[d,p]=c.useState(null),f=ke(o);return c.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(Kn,{...i,children:a.jsx(Ya,{scope:t,open:r,onOpenChange:f,content:d,onContentChange:p,children:a.jsx(kh,{scope:t,contentId:je(),triggerId:je(),trigger:l,onTriggerChange:u,children:n})})})};ci.displayName=po;var zt="MenuSubTrigger",li=c.forwardRef((e,t)=>{const n=rt(zt,e.__scopeMenu),r=ln(zt,e.__scopeMenu),o=ii(zt,e.__scopeMenu),s=co(zt,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>p,[p]),c.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),u(null)}},[l,u]),a.jsx(ao,{asChild:!0,...d,children:a.jsx(Ja,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fi(n.open),...e,ref:fe(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,qt(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:G(e.onPointerLeave,qt(f=>{p();const h=n.content?.getBoundingClientRect();if(h){const g=n.content?.dataset.side,v=g==="right",m=v?-5:5,x=h[v?"left":"right"],y=h[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+m,y:f.clientY},{x,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||dh[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});li.displayName=zt;var ui="MenuSubContent",di=c.forwardRef((e,t)=>{const n=Ua(Pe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=rt(Pe,e.__scopeMenu),i=ln(Pe,e.__scopeMenu),l=ii(ui,e.__scopeMenu),u=c.useRef(null),d=ie(t,u);return a.jsx(Kt.Provider,{scope:e.__scopeMenu,children:a.jsx(Oe,{present:r||s.open,children:a.jsx(Kt.Slot,{scope:e.__scopeMenu,children:a.jsx(lo,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{i.isUsingKeyboardRef.current&&u.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:G(e.onFocusOutside,p=>{p.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:G(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),h=fh[i.dir].includes(p.key);f&&h&&(s.onOpenChange(!1),l.trigger?.focus(),p.preventDefault())})})})})})});di.displayName=ui;function fi(e){return e?"open":"closed"}function Dn(e){return e==="indeterminate"}function mo(e){return Dn(e)?"indeterminate":e?"checked":"unchecked"}function Dh(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Th(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Oh(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Th(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function _h(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],u=t[i],d=l.x,p=l.y,f=u.x,h=u.y;p>r!=h>r&&n<(f-d)*(r-p)/(h-p)+d&&(o=!o)}return o}function Ah(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _h(n,t)}function qt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ih=Ga,$h=ao,Fh=Ka,Lh=qa,Wh=uo,Vh=Xa,Bh=Zn,zh=Za,Hh=ei,Yh=ni,Gh=oi,Uh=si,Kh=ai,qh=ci,Xh=li,Jh=di,Qn="DropdownMenu",[Zh]=Ue(Qn,[za]),he=za(),[Qh,pi]=Zh(Qn),mi=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,u=he(t),d=c.useRef(null),[p,f]=et({prop:o,defaultProp:s??!1,onChange:i,caller:Qn});return a.jsx(Qh,{scope:t,triggerId:je(),triggerRef:d,contentId:je(),open:p,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(Ih,{...u,open:p,onOpenChange:f,dir:r,modal:l,children:n})})};mi.displayName=Qn;var hi="DropdownMenuTrigger",gi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=pi(hi,n),i=he(n);return a.jsx($h,{asChild:!0,...i,children:a.jsx(Cd.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:fe(t,s.triggerRef),onPointerDown:G(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:G(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});gi.displayName=hi;var eg="DropdownMenuPortal",xi=e=>{const{__scopeDropdownMenu:t,...n}=e,r=he(t);return a.jsx(Fh,{...r,...n})};xi.displayName=eg;var vi="DropdownMenuContent",yi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pi(vi,n),s=he(n),i=c.useRef(!1);return a.jsx(Lh,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,l=>{i.current||o.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:G(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!o.modal||p)&&(i.current=!0)}),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)"}})});yi.displayName=vi;var tg="DropdownMenuGroup",bi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Wh,{...o,...r,ref:t})});bi.displayName=tg;var ng="DropdownMenuLabel",wi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Vh,{...o,...r,ref:t})});wi.displayName=ng;var rg="DropdownMenuItem",Si=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Bh,{...o,...r,ref:t})});Si.displayName=rg;var og="DropdownMenuCheckboxItem",Ci=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(zh,{...o,...r,ref:t})});Ci.displayName=og;var sg="DropdownMenuRadioGroup",Ni=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Hh,{...o,...r,ref:t})});Ni.displayName=sg;var ag="DropdownMenuRadioItem",Ei=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Yh,{...o,...r,ref:t})});Ei.displayName=ag;var ig="DropdownMenuItemIndicator",ji=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Gh,{...o,...r,ref:t})});ji.displayName=ig;var cg="DropdownMenuSeparator",Pi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Uh,{...o,...r,ref:t})});Pi.displayName=cg;var lg="DropdownMenuArrow",ug=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Kh,{...o,...r,ref:t})});ug.displayName=lg;var dg=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=he(t),[l,u]=et({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return a.jsx(qh,{...i,open:l,onOpenChange:u,children:n})},fg="DropdownMenuSubTrigger",Ri=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Xh,{...o,...r,ref:t})});Ri.displayName=fg;var pg="DropdownMenuSubContent",Mi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=he(n);return a.jsx(Jh,{...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)"}})});Mi.displayName=pg;var mg=mi,hg=gi,ki=xi,gg=yi,xg=bi,vg=wi,yg=Si,bg=Ci,wg=Ni,Sg=Ei,Di=ji,Cg=Pi,Ng=dg,Eg=Ri,jg=Mi;function Pg({...e}){return a.jsx(mg,{"data-slot":"dropdown-menu",...e})}function Rg({...e}){return a.jsx(ki,{"data-slot":"dropdown-menu-portal",...e})}function Mg({...e}){return a.jsx(hg,{"data-slot":"dropdown-menu-trigger",suppressHydrationWarning:!0,...e})}function kg({className:e,sideOffset:t=4,...n}){return a.jsx(ki,{children:a.jsx(gg,{"data-slot":"dropdown-menu-content",sideOffset:t,className:L("bg-white text-gray-900 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 p-2 shadow-lg",e),...n})})}function Dg({...e}){return a.jsx(xg,{"data-slot":"dropdown-menu-group",...e})}function Tg({className:e,inset:t,variant:n="default",...r}){return a.jsx(yg,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:L("focus:bg-gray-100 focus:text-gray-900 data-[variant=destructive]:text-red-600 data-[variant=destructive]:focus:bg-red-50 data-[variant=destructive]:focus:text-red-700 [&_svg:not([class*='text-'])]:text-gray-500 relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Og({className:e,children:t,checked:n,...r}){return a.jsxs(bg,{"data-slot":"dropdown-menu-checkbox-item",className:L("focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[a.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a.jsx(Di,{children:a.jsx(Gr,{className:"size-4 text-blue-600"})})}),t]})}function _g({...e}){return a.jsx(wg,{"data-slot":"dropdown-menu-radio-group",...e})}function Ag({className:e,children:t,...n}){return a.jsxs(Sg,{"data-slot":"dropdown-menu-radio-item",className:L("focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[a.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a.jsx(Di,{children:a.jsx(od,{className:"size-2 fill-blue-600"})})}),t]})}function Ig({className:e,inset:t,...n}){return a.jsx(vg,{"data-slot":"dropdown-menu-label","data-inset":t,className:L("px-2 py-1.5 text-sm font-semibold text-gray-900 data-[inset]:pl-8",e),...n})}function $g({className:e,...t}){return a.jsx(Cg,{"data-slot":"dropdown-menu-separator",className:L("bg-gray-100 my-1 h-px",e),...t})}function Fg({className:e,...t}){return a.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:L("text-gray-500 ml-auto text-xs tracking-widest",e),...t})}function Lg({...e}){return a.jsx(Ng,{"data-slot":"dropdown-menu-sub",...e})}function Wg({className:e,inset:t,children:n,...r}){return a.jsxs(Eg,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:L("focus:bg-gray-100 focus:text-gray-900 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,a.jsx(Ee,{className:"ml-auto size-4"})]})}function Vg({className:e,...t}){return a.jsx(jg,{"data-slot":"dropdown-menu-sub-content",className:L("bg-white text-gray-900 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border border-gray-200 p-2 shadow-lg",e),...t})}function Bg({data:e=[],columns:t,searchPlaceholder:n="Search...",onRowClick:r,className:o="",showPagination:s=!0,showSearch:i=!0,pageSize:l=10,renderToolbar:u,variant:d="default"}){const[p,f]=J.useState(1),[h]=J.useState(l),[g,v]=J.useState(""),[m,x]=J.useState(null),[y,w]=J.useState("asc"),C=J.useMemo(()=>{if(!i||!g.trim())return e;const b=g.toLowerCase();return e.filter(P=>t.some(E=>(E.accessor?E.accessor(P):P[E.key])?.toString().toLowerCase().includes(b)))},[e,g,i,t]),S=J.useMemo(()=>m?[...C].sort((b,P)=>{const E=t.find(N=>N.key===m);if(!E)return 0;const T=E.accessor?E.accessor(b):b[E.key],R=E.accessor?E.accessor(P):P[E.key];if(T===R)return 0;if(T==null)return 1;if(R==null)return-1;const W=T<R?-1:1;return y==="asc"?W:-W}):C,[C,m,y,t]),D=J.useMemo(()=>{if(!s)return S;const b=(p-1)*h;return S.slice(b,b+h)},[S,p,h,s]);J.useEffect(()=>f(1),[g]);const $=b=>{m===b?w(y==="asc"?"desc":"asc"):(x(b),w("asc"))},O=(b,P,E)=>{const T=P.accessor?P.accessor(b):b[P.key];return P.cell?P.cell(T,b,E):T};return a.jsxs("div",{className:L("w-full space-y-4",o),children:[(i||u)&&a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[i&&a.jsxs("div",{className:"relative w-full sm:w-auto",children:[a.jsx(ld,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),a.jsx(ze,{placeholder:n,value:g,onChange:b=>v(b.target.value),className:"pl-10 w-full sm:w-[300px] bg-gray-50 border-gray-300"})]}),u&&a.jsx("div",{className:"w-full sm:w-auto",children:u()})]}),a.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Ln,{variant:d,children:[a.jsx(Wn,{children:a.jsx($e,{children:t.map(b=>a.jsx(Bn,{className:"h-10 px-0 py-0",style:{width:b.width},children:b.align==="center"||!b.align&&typeof b.header!="string"?a.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof b.header!="string"?b.header:a.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:b.header})}):a.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof b.header!="string"?a.jsx("div",{children:b.header}):b.sortable!==!1?a.jsxs(q,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>$(b.key),children:[b.header,m===b.key&&y==="desc"?a.jsx(Zt,{className:"h-4 w-4"}):m===b.key&&y==="asc"?a.jsx($n,{className:"h-4 w-4"}):a.jsx(Ur,{className:"h-4 w-4"})]}):a.jsx("span",{className:"px-3",children:b.header})})},b.key))})}),a.jsx(Vn,{children:D.length===0?a.jsx($e,{children:a.jsx(mt,{colSpan:t.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):D.map((b,P)=>a.jsx($e,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>r?.(b),children:t.map(E=>{const T=E.align==="center"||!E.align&&typeof E.header!="string";return a.jsx(mt,{className:T?"px-0 py-4":"px-3 py-4",style:{width:E.width},children:T?a.jsx("div",{className:"flex items-center justify-center h-full",children:O(b,E,P)}):O(b,E,P)},E.key)})},P))})]})})}),s&&a.jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",D.length," of ",S.length," row(s)"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm text-gray-700",children:["Page ",p," of ",Math.ceil(S.length/h)]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:()=>f(b=>Math.max(1,b-1)),disabled:p===1,className:"h-8 w-8 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsx(q,{variant:"outline",size:"sm",onClick:()=>f(b=>Math.min(Math.ceil(S.length/h),b+1)),disabled:p===Math.ceil(S.length/h),className:"h-8 w-8 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]})]})]})]})}const Ti=J.createContext(null);function At(){const e=J.useContext(Ti);if(!e)throw new Error("useDataGrid must be used within DataGrid");return e}function zg({columns:e,data:t,getRowId:n=i=>i.id||String(Math.random()),onRowClick:r,children:o,recordCount:s}){const[i,l]=J.useState({pageIndex:0,pageSize:5}),[u,d]=J.useState([]),[p,f]=J.useState(new Set),h=J.useMemo(()=>u.length===0?t:[...t].sort((T,R)=>{for(const W of u){const N=e.find(M=>M.id===W.id);if(!N?.accessorKey)continue;const V=T[N.accessorKey],_=R[N.accessorKey];if(V===_)continue;const F=V<_?-1:1;return W.desc?-F:F}return 0}),[t,u,e]),g=J.useMemo(()=>{const E=i.pageIndex*i.pageSize,T=E+i.pageSize;return h.slice(E,T)},[h,i]),v=Math.ceil(h.length/i.pageSize),m=v,x=i.pageIndex>0,y=i.pageIndex<v-1,w=()=>l(E=>({...E,pageIndex:E.pageIndex-1})),C=()=>{l(E=>({...E,pageIndex:Math.min(E.pageIndex+1,m-1)}))},S=E=>{l(()=>({pageIndex:0,pageSize:E}))},D=E=>{l(T=>({...T,pageIndex:Math.max(0,Math.min(E,m-1))}))},$=E=>{f(T=>{const R=new Set(T);return R.has(E)?R.delete(E):R.add(E),R})},O=()=>{p.size===g.length?f(new Set):f(new Set(g.map(E=>n(E))))},b=g.length>0&&p.size===g.length,P={columns:e,data:t,getRowId:n,onRowClick:r,pagination:i,setPagination:l,canPreviousPage:x,canNextPage:y,previousPage:w,nextPage:C,setPageSize:S,goToPage:D,pageCount:m,sorting:u,setSorting:d,selectedRows:p,toggleRow:$,toggleAllRows:O,isAllRowsSelected:b,paginatedData:g,sortedData:h,totalPages:v,recordCount:s??t.length};return a.jsx(Ti.Provider,{value:P,children:o})}function Hg(){const{columns:e,paginatedData:t,getRowId:n,onRowClick:r}=At();return a.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Ln,{children:[a.jsx(Wn,{children:a.jsx($e,{children:e.map(o=>a.jsx(Bn,{className:"h-10 px-0 py-0",style:{width:o.size?`${o.size}px`:void 0},children:o.align==="center"?a.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof o.header!="string"?o.header:a.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:o.header})}):a.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof o.header!="string"?a.jsx("div",{children:o.header}):a.jsx("span",{className:"px-3",children:o.header})})},o.id))})}),a.jsx(Vn,{children:t.length===0?a.jsx($e,{children:a.jsx(mt,{colSpan:e.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):t.map((o,s)=>a.jsx($e,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>r?.(o),children:e.map(i=>{const l=i.align==="center",u=i.cell?i.cell(o,s):i.accessorKey?o[i.accessorKey]:null;return a.jsx(mt,{className:l?"px-0 py-4":"px-3 py-4",style:{width:i.size?`${i.size}px`:void 0},children:l?a.jsx("div",{className:"flex items-center justify-center h-full",children:u}):u},i.id)})},n(o)))})]})})})}function us(e,[t,n]){return Math.min(n,Math.max(t,e))}function Oi(e){const t=Yg(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Ug);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Yg(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=qg(o),l=Kg(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gg=Symbol("radix.slottable");function Ug(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gg}function Kg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function qg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=Xg.reduce((e,t)=>{const n=Oi(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Jg(e){const t=Zg(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(ex);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Zg(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=nx(o),l=tx(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qg=Symbol("radix.slottable");function ex(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qg}function tx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function nx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ox=rx.reduce((e,t)=>{const n=Jg(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),_i=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sx="VisuallyHidden",ax=c.forwardRef((e,t)=>a.jsx(ox.span,{...e,ref:t,style:{..._i,...e.style}}));ax.displayName=sx;var ix=[" ","Enter","ArrowUp","ArrowDown"],cx=[" ","Enter"],gt="Select",[er,tr,lx]=Kr(gt),[It]=Ue(gt,[lx,_t]),nr=_t(),[ux,ot]=It(gt),[dx,fx]=It(gt),Ai=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:h,required:g,form:v}=e,m=nr(t),[x,y]=c.useState(null),[w,C]=c.useState(null),[S,D]=c.useState(!1),$=qr(d),[O,b]=et({prop:r,defaultProp:o??!1,onChange:s,caller:gt}),[P,E]=et({prop:i,defaultProp:l,onChange:u,caller:gt}),T=c.useRef(null),R=x?v||!!x.closest("form"):!0,[W,N]=c.useState(new Set),V=Array.from(W).map(_=>_.props.value).join(";");return a.jsx(Kn,{...m,children:a.jsxs(ux,{required:g,scope:t,trigger:x,onTriggerChange:y,valueNode:w,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:D,contentId:je(),value:P,onValueChange:E,open:O,onOpenChange:b,dir:$,triggerPointerDownPosRef:T,disabled:h,children:[a.jsx(er.Provider,{scope:t,children:a.jsx(dx,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(_=>{N(F=>new Set(F).add(_))},[]),onNativeOptionRemove:c.useCallback(_=>{N(F=>{const M=new Set(F);return M.delete(_),M})},[]),children:n})}),R?a.jsxs(ac,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:f,value:P,onChange:_=>E(_.target.value),disabled:h,form:v,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(W)]},V):null]})})};Ai.displayName=gt;var Ii="SelectTrigger",$i=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=nr(n),i=ot(Ii,n),l=i.disabled||r,u=ie(t,i.onTriggerChange),d=tr(n),p=c.useRef("touch"),[f,h,g]=cc(m=>{const x=d().filter(C=>!C.disabled),y=x.find(C=>C.value===i.value),w=lc(x,m,y);w!==void 0&&i.onValueChange(w.value)}),v=m=>{l||(i.onOpenChange(!0),g()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return a.jsx(qn,{asChild:!0,...s,children:a.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":ic(i.value)?"":void 0,...o,ref:u,onClick:G(o.onClick,m=>{m.currentTarget.focus(),p.current!=="mouse"&&v(m)}),onPointerDown:G(o.onPointerDown,m=>{p.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:G(o.onKeyDown,m=>{const x=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(x&&m.key===" ")&&ix.includes(m.key)&&(v(),m.preventDefault())})})})});$i.displayName=Ii;var Fi="SelectValue",Li=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...l}=e,u=ot(Fi,n),{onValueNodeHasChildrenChange:d}=u,p=s!==void 0,f=ie(t,u.onValueNodeChange);return me(()=>{d(p)},[d,p]),a.jsx(Ce.span,{...l,ref:f,style:{pointerEvents:"none"},children:ic(u.value)?a.jsx(a.Fragment,{children:i}):s})});Li.displayName=Fi;var px="SelectIcon",Wi=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return a.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Wi.displayName=px;var mx="SelectPortal",Vi=e=>a.jsx(nn,{asChild:!0,...e});Vi.displayName=mx;var xt="SelectContent",Bi=c.forwardRef((e,t)=>{const n=ot(xt,e.__scopeSelect),[r,o]=c.useState();if(me(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Jt.createPortal(a.jsx(zi,{scope:e.__scopeSelect,children:a.jsx(er.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Hi,{...e,ref:t})});Bi.displayName=xt;var Me=10,[zi,st]=It(xt),hx="SelectContentImpl",gx=Oi("SelectContent.RemoveScroll"),Hi=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x,...y}=e,w=ot(xt,n),[C,S]=c.useState(null),[D,$]=c.useState(null),O=ie(t,A=>S(A)),[b,P]=c.useState(null),[E,T]=c.useState(null),R=tr(n),[W,N]=c.useState(!1),V=c.useRef(!1);c.useEffect(()=>{if(C)return Xn(C)},[C]),zn();const _=c.useCallback(A=>{const[Q,...oe]=R().map(j=>j.ref.current),[ee]=oe.slice(-1),te=document.activeElement;for(const j of A)if(j===te||(j?.scrollIntoView({block:"nearest"}),j===Q&&D&&(D.scrollTop=0),j===ee&&D&&(D.scrollTop=D.scrollHeight),j?.focus(),document.activeElement!==te))return},[R,D]),F=c.useCallback(()=>_([b,C]),[_,b,C]);c.useEffect(()=>{W&&F()},[W,F]);const{onOpenChange:M,triggerPointerDownPosRef:I}=w;c.useEffect(()=>{if(C){let A={x:0,y:0};const Q=ee=>{A={x:Math.abs(Math.round(ee.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(I.current?.y??0))}},oe=ee=>{A.x<=10&&A.y<=10?ee.preventDefault():C.contains(ee.target)||M(!1),document.removeEventListener("pointermove",Q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",oe,{capture:!0})}}},[C,M,I]),c.useEffect(()=>{const A=()=>M(!1);return window.addEventListener("blur",A),window.addEventListener("resize",A),()=>{window.removeEventListener("blur",A),window.removeEventListener("resize",A)}},[M]);const[re,k]=cc(A=>{const Q=R().filter(te=>!te.disabled),oe=Q.find(te=>te.ref.current===document.activeElement),ee=lc(Q,A,oe);ee&&setTimeout(()=>ee.ref.current.focus())}),z=c.useCallback((A,Q,oe)=>{const ee=!V.current&&!oe;(w.value!==void 0&&w.value===Q||ee)&&(P(A),ee&&(V.current=!0))},[w.value]),K=c.useCallback(()=>C?.focus(),[C]),X=c.useCallback((A,Q,oe)=>{const ee=!V.current&&!oe;(w.value!==void 0&&w.value===Q||ee)&&T(A)},[w.value]),le=r==="popper"?_r:Yi,ue=le===_r?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return a.jsx(zi,{scope:n,content:C,viewport:D,onViewportChange:$,itemRefCallback:z,selectedItem:b,onItemLeave:K,itemTextRefCallback:X,focusSelectedItem:F,selectedItemText:E,position:r,isPositioned:W,searchRef:re,children:a.jsx(sn,{as:gx,allowPinchZoom:!0,children:a.jsx(en,{asChild:!0,trapped:w.open,onMountAutoFocus:A=>{A.preventDefault()},onUnmountAutoFocus:G(o,A=>{w.trigger?.focus({preventScroll:!0}),A.preventDefault()}),children:a.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:A=>A.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:a.jsx(le,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:A=>A.preventDefault(),...y,...ue,onPlaced:()=>N(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:G(y.onKeyDown,A=>{const Q=A.ctrlKey||A.altKey||A.metaKey;if(A.key==="Tab"&&A.preventDefault(),!Q&&A.key.length===1&&k(A.key),["ArrowUp","ArrowDown","Home","End"].includes(A.key)){let ee=R().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(A.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(A.key)){const te=A.target,j=ee.indexOf(te);ee=ee.slice(j+1)}setTimeout(()=>_(ee)),A.preventDefault()}})})})})})})});Hi.displayName=hx;var xx="SelectItemAlignedPosition",Yi=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=ot(xt,n),i=st(xt,n),[l,u]=c.useState(null),[d,p]=c.useState(null),f=ie(t,O=>p(O)),h=tr(n),g=c.useRef(!1),v=c.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:w}=i,C=c.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&m&&x&&y){const O=s.trigger.getBoundingClientRect(),b=d.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const te=E.left-b.left,j=P.left-te,U=O.left-j,se=O.width+U,Z=Math.max(se,b.width),xe=window.innerWidth-Me,pe=us(j,[Me,Math.max(Me,xe-Z)]);l.style.minWidth=se+"px",l.style.left=pe+"px"}else{const te=b.right-E.right,j=window.innerWidth-P.right-te,U=window.innerWidth-O.right-j,se=O.width+U,Z=Math.max(se,b.width),xe=window.innerWidth-Me,pe=us(j,[Me,Math.max(Me,xe-Z)]);l.style.minWidth=se+"px",l.style.right=pe+"px"}const T=h(),R=window.innerHeight-Me*2,W=m.scrollHeight,N=window.getComputedStyle(d),V=parseInt(N.borderTopWidth,10),_=parseInt(N.paddingTop,10),F=parseInt(N.borderBottomWidth,10),M=parseInt(N.paddingBottom,10),I=V+_+W+M+F,re=Math.min(x.offsetHeight*5,I),k=window.getComputedStyle(m),z=parseInt(k.paddingTop,10),K=parseInt(k.paddingBottom,10),X=O.top+O.height/2-Me,le=R-X,ue=x.offsetHeight/2,A=x.offsetTop+ue,Q=V+_+A,oe=I-Q;if(Q<=X){const te=T.length>0&&x===T[T.length-1].ref.current;l.style.bottom="0px";const j=d.clientHeight-m.offsetTop-m.offsetHeight,U=Math.max(le,ue+(te?K:0)+j+F),se=Q+U;l.style.height=se+"px"}else{const te=T.length>0&&x===T[0].ref.current;l.style.top="0px";const U=Math.max(X,V+m.offsetTop+(te?z:0)+ue)+oe;l.style.height=U+"px",m.scrollTop=Q-X+m.offsetTop}l.style.margin=`${Me}px 0`,l.style.minHeight=re+"px",l.style.maxHeight=R+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,s.trigger,s.valueNode,l,d,m,x,y,s.dir,r]);me(()=>C(),[C]);const[S,D]=c.useState();me(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const $=c.useCallback(O=>{O&&v.current===!0&&(C(),w?.(),v.current=!1)},[C,w]);return a.jsx(yx,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:$,children:a.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(Ce.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Yi.displayName=xx;var vx="SelectPopperPosition",_r=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Me,...s}=e,i=nr(n);return a.jsx(oo,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_r.displayName=vx;var[yx,ho]=It(xt,{}),Ar="SelectViewport",Gi=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=st(Ar,n),i=ho(Ar,n),l=ie(t,s.onViewportChange),u=c.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(er.Slot,{scope:n,children:a.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:G(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h?.current&&f){const g=Math.abs(u.current-p.scrollTop);if(g>0){const v=window.innerHeight-Me*2,m=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),y=Math.max(m,x);if(y<v){const w=y+g,C=Math.min(v,w),S=w-C;f.style.height=C+"px",f.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});Gi.displayName=Ar;var Ui="SelectGroup",[bx,wx]=It(Ui),Ki=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=je();return a.jsx(bx,{scope:n,id:o,children:a.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ki.displayName=Ui;var qi="SelectLabel",Xi=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=wx(qi,n);return a.jsx(Ce.div,{id:o.id,...r,ref:t})});Xi.displayName=qi;var Tn="SelectItem",[Sx,Ji]=It(Tn),Zi=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,l=ot(Tn,n),u=st(Tn,n),d=l.value===r,[p,f]=c.useState(s??""),[h,g]=c.useState(!1),v=ie(t,w=>u.itemRefCallback?.(w,r,o)),m=je(),x=c.useRef("touch"),y=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Sx,{scope:n,value:r,disabled:o,textId:m,isSelected:d,onItemTextChange:c.useCallback(w=>{f(C=>C||(w?.textContent??"").trim())},[]),children:a.jsx(er.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:a.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:G(i.onFocus,()=>g(!0)),onBlur:G(i.onBlur,()=>g(!1)),onClick:G(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:G(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:G(i.onPointerDown,w=>{x.current=w.pointerType}),onPointerMove:G(i.onPointerMove,w=>{x.current=w.pointerType,o?u.onItemLeave?.():x.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(i.onPointerLeave,w=>{w.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:G(i.onKeyDown,w=>{u.searchRef?.current!==""&&w.key===" "||(cx.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});Zi.displayName=Tn;var Ht="SelectItemText",Qi=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=ot(Ht,n),l=st(Ht,n),u=Ji(Ht,n),d=fx(Ht,n),[p,f]=c.useState(null),h=ie(t,y=>f(y),u.onItemTextChange,y=>l.itemTextRefCallback?.(y,u.value,u.disabled)),g=p?.textContent,v=c.useMemo(()=>a.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=d;return me(()=>(m(v),()=>x(v)),[m,x,v]),a.jsxs(a.Fragment,{children:[a.jsx(Ce.span,{id:u.textId,...s,ref:h}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Jt.createPortal(s.children,i.valueNode):null]})});Qi.displayName=Ht;var ec="SelectItemIndicator",tc=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ji(ec,n).isSelected?a.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});tc.displayName=ec;var Ir="SelectScrollUpButton",nc=c.forwardRef((e,t)=>{const n=st(Ir,e.__scopeSelect),r=ho(Ir,e.__scopeSelect),[o,s]=c.useState(!1),i=ie(t,r.onScrollButtonChange);return me(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?a.jsx(oc,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});nc.displayName=Ir;var $r="SelectScrollDownButton",rc=c.forwardRef((e,t)=>{const n=st($r,e.__scopeSelect),r=ho($r,e.__scopeSelect),[o,s]=c.useState(!1),i=ie(t,r.onScrollButtonChange);return me(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;s(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?a.jsx(oc,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});rc.displayName=$r;var oc=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=st("SelectScrollButton",n),i=c.useRef(null),l=tr(n),u=c.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return c.useEffect(()=>()=>u(),[u]),me(()=>{l().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:G(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:G(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:G(o.onPointerLeave,()=>{u()})})}),Cx="SelectSeparator",sc=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});sc.displayName=Cx;var Fr="SelectArrow",Nx=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nr(n),s=ot(Fr,n),i=st(Fr,n);return s.open&&i.position==="popper"?a.jsx(so,{...o,...r,ref:t}):null});Nx.displayName=Fr;var Ex="SelectBubbleInput",ac=c.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=c.useRef(null),s=ie(r,o),i=Bs(t);return c.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(l,t),l.dispatchEvent(f)}},[i,t]),a.jsx(Ce.select,{...n,style:{..._i,...n.style},ref:s,defaultValue:t})});ac.displayName=Ex;function ic(e){return e===""||e===void 0}function cc(e){const t=ke(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(i=>{const l=n.current+i;t(l),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(l)},[t]),s=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function lc(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=jx(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function jx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Px=Ai,uc=$i,Rx=Li,Mx=Wi,kx=Vi,dc=Bi,Dx=Gi,Tx=Ki,fc=Xi,pc=Zi,Ox=Qi,_x=tc,mc=nc,hc=rc,gc=sc;const ft=Px,Ax=Tx,pt=Rx,Je=c.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(uc,{ref:r,className:L("flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),...n,children:[t,a.jsx(Mx,{asChild:!0,children:a.jsx(Zt,{className:"h-4 w-4 opacity-50"})})]}));Je.displayName=uc.displayName;const xc=c.forwardRef(({className:e,...t},n)=>a.jsx(mc,{ref:n,className:L("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx($n,{className:"h-4 w-4"})}));xc.displayName=mc.displayName;const vc=c.forwardRef(({className:e,...t},n)=>a.jsx(hc,{ref:n,className:L("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Zt,{className:"h-4 w-4"})}));vc.displayName=hc.displayName;const Ze=c.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>a.jsx(kx,{children:a.jsxs(dc,{ref:o,className:L("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white text-gray-950 shadow-md 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==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(xc,{}),a.jsx(Dx,{className:L("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(vc,{})]})}));Ze.displayName=dc.displayName;const yc=c.forwardRef(({className:e,...t},n)=>a.jsx(fc,{ref:n,className:L("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));yc.displayName=fc.displayName;const He=c.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(pc,{ref:r,className:L("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(_x,{children:a.jsx(Gr,{className:"h-4 w-4"})})}),a.jsx(Ox,{children:t})]}));He.displayName=pc.displayName;const bc=c.forwardRef(({className:e,...t},n)=>a.jsx(gc,{ref:n,className:L("-mx-1 my-1 h-px bg-gray-100",e),...t}));bc.displayName=gc.displayName;function Ix({mode:e="simple",pageSizeOptions:t=[5,10,15,20]}){const{canPreviousPage:n,canNextPage:r,previousPage:o,nextPage:s,pageCount:i,pagination:l,setPageSize:u,goToPage:d}=At(),p=()=>{const f=l.pageIndex,h=i,g=[];if(h<=7)for(let v=0;v<h;v++)g.push(v);else if(f<=3){for(let v=0;v<=4;v++)g.push(v);g.push("..."),g.push(h-1)}else if(f>=h-4){g.push(0),g.push("...");for(let v=h-5;v<h;v++)g.push(v)}else g.push(0),g.push("..."),g.push(f-1),g.push(f),g.push(f+1),g.push("..."),g.push(h-1);return g};return e==="simple"?a.jsx("div",{className:"flex items-center justify-end px-2 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm text-gray-700 hidden sm:block",children:["Page ",l.pageIndex+1," of ",i]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:o,disabled:!n,className:"h-8 w-8 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsx(q,{variant:"outline",size:"sm",onClick:s,disabled:!r,className:"h-8 w-8 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]})]})}):a.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 py-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600 hidden sm:inline",children:"Rows per page:"}),a.jsxs(ft,{value:String(l.pageSize),onValueChange:f=>u(Number(f)),children:[a.jsx(Je,{className:"h-8 w-16",children:a.jsx(pt,{})}),a.jsx(Ze,{children:t.map(f=>a.jsx(He,{value:String(f),children:f},f))})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:o,disabled:!n,className:"h-8 w-8 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsxs("span",{className:"text-sm text-gray-700 sm:hidden px-2",children:[l.pageIndex+1," / ",i]}),a.jsx("div",{className:"hidden sm:flex gap-1",children:p().map((f,h)=>typeof f=="number"?a.jsx(q,{variant:l.pageIndex===f?"default":"outline",size:"sm",onClick:()=>d(f),className:"h-8 w-8 p-0",children:f+1},h):a.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-gray-400",children:f},h))}),a.jsx(q,{variant:"outline",size:"sm",onClick:s,disabled:!r,className:"h-8 w-8 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]})]})}function $x({id:e,title:t}){const{sorting:n,setSorting:r}=At(),o=n.find(u=>u.id===e),s=!!o,i=o?.desc??!1,l=()=>{r(u=>{const d=u.find(p=>p.id===e);return d?d.desc?[]:[{id:e,desc:!0}]:[{id:e,desc:!1}]})};return a.jsxs(q,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:l,children:[t,s&&i?a.jsx(Zt,{className:"h-4 w-4"}):s?a.jsx($n,{className:"h-4 w-4"}):a.jsx(Ur,{className:"h-4 w-4"})]})}function Fx(){const{toggleAllRows:e,isAllRowsSelected:t}=At();return a.jsx(Fn,{checked:t,onCheckedChange:e})}function Lx({row:e}){const{selectedRows:t,toggleRow:n,getRowId:r}=At(),o=r(e);return a.jsx(Fn,{checked:t.has(o),onCheckedChange:()=>n(o)})}const wc=c.createContext(null);function Sc(){const e=c.useContext(wc);if(!e)throw new Error("useTableContext must be used within a TableRoot component");return e}function Wx({table:e,totalRecords:t,children:n}){return a.jsx(wc.Provider,{value:{tableInstance:e,totalRecords:t},children:n})}function Vx({children:e,className:t}){return a.jsx("div",{className:L("rounded-xl border border-gray-200 bg-white overflow-hidden",t),children:e})}function ds(e,t){return e?Bx(e)?c.createElement(e,t):e:null}function Bx(e){return zx(e)||typeof e=="function"||Hx(e)}function zx(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Hx(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Yx(){const{tableInstance:e}=Sc();return a.jsxs(Ln,{children:[a.jsx(Wn,{children:e.getHeaderGroups().map(t=>a.jsx($e,{children:t.headers.map(n=>a.jsx(Bn,{children:n.isPlaceholder?null:ds(n.column.columnDef.header,n.getContext())},n.id))},t.id))}),a.jsx(Vn,{children:e.getRowModel().rows?.length?e.getRowModel().rows.map(t=>a.jsx($e,{"data-state":t.getIsSelected()&&"selected",children:t.getVisibleCells().map(n=>a.jsx(mt,{children:ds(n.column.columnDef.cell,n.getContext())},n.id))},t.id)):a.jsx($e,{children:a.jsx(mt,{colSpan:e.getAllColumns().length,className:"h-24 text-center",children:"No results."})})})]})}function Gx({rowsPerPageOptions:e=[5,10,20,30,50],showPageSelector:t=!0,showRecordInfo:n=!0,showControls:r=!0}={}){const{tableInstance:o,totalRecords:s}=Sc(),i=o.getState().pagination.pageIndex+1,l=o.getPageCount(),u=o.getState().pagination.pageSize,d=i===1?1:(i-1)*u+1,p=Math.min(i*u,s);return a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-3 py-4",children:[t&&a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"text-sm text-gray-700 font-medium",children:"Items per page:"}),a.jsxs(ft,{value:`${u}`,onValueChange:f=>{o.setPageSize(Number(f))},children:[a.jsx(Je,{className:"h-9 w-[75px]",children:a.jsx(pt,{placeholder:u})}),a.jsx(Ze,{side:"top",children:e.map(f=>a.jsx(He,{value:`${f}`,children:f},f))})]})]}),n&&a.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:a.jsxs("span",{children:[d,"–",p," of ",s]})}),r&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs(q,{variant:"outline",size:"sm",onClick:()=>o.setPageIndex(0),disabled:!o.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"First page"}),a.jsx(Qu,{className:"h-4 w-4"})]}),a.jsxs(q,{variant:"outline",size:"sm",onClick:()=>o.previousPage(),disabled:!o.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Previous page"}),a.jsx(Le,{className:"h-4 w-4"})]}),a.jsxs("div",{className:"flex items-center justify-center text-sm font-medium min-w-[110px]",children:["Page ",i," of ",l]}),a.jsxs(q,{variant:"outline",size:"sm",onClick:()=>o.nextPage(),disabled:!o.getCanNextPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Next page"}),a.jsx(Ee,{className:"h-4 w-4"})]}),a.jsxs(q,{variant:"outline",size:"sm",onClick:()=>o.setPageIndex(o.getPageCount()-1),disabled:!o.getCanNextPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Last page"}),a.jsx(td,{className:"h-4 w-4"})]})]})]})}function Ux({column:e,title:t,align:n="left",className:r}){const o=e.getCanSort(),s=e.getIsSorted(),i={left:"",center:"text-center",right:"text-right"},l=()=>s==="asc"?a.jsx(Zt,{className:"h-4 w-4"}):s==="desc"?a.jsx($n,{className:"h-4 w-4"}):a.jsx(Ur,{className:"h-4 w-4"});return o?a.jsx("div",{className:L(i[n]),children:a.jsxs(q,{variant:"ghost",className:"h-auto px-2 py-1 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>e.toggleSorting(s==="asc"),children:[t,l()]})}):a.jsx("div",{className:L("px-2 py-1",r),children:t})}const Kx=e=>new Date(e.getFullYear(),e.getMonth(),1),qx=e=>new Date(e.getFullYear(),e.getMonth()+1,0),Xx=(e,t)=>{const n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r)),r.setDate(r.getDate()+1);return n},fs=(e,t)=>e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),Et=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),ps=e=>Et(e,new Date),Jx=e=>{const t=new Date;return t.setDate(t.getDate()+1),Et(e,t)},ms=(e,t)=>{const n=new Date(e);return n.setMonth(n.getMonth()+t),n},Cr=(e,t)=>{const n=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return t==="MMMM yyyy"?`${n[e.getMonth()]} ${e.getFullYear()}`:t==="MMM d, yyyy"?`${r[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`:t==="d"?e.getDate().toString():e.toLocaleDateString()};function Zx({selected:e,onSelect:t,events:n=[],holidays:r=[],className:o,...s}){const[i,l]=c.useState(new Date),[u,d]=c.useState("calendar"),p=Kx(i),f=qx(i),h=Xx(p,f),g=["January","February","March","April","May","June","July","August","September","October","November","December"],v=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=i.getFullYear(),x=Array.from({length:20},(P,E)=>m-10+E),y=()=>{l(ms(i,-1))},w=()=>{l(ms(i,1))},C=()=>{const P=new Date(i);P.setFullYear(m-1),l(P)},S=()=>{const P=new Date(i);P.setFullYear(m+1),l(P)},D=P=>{const E=new Date(i);E.setMonth(P),l(E),d("calendar")},$=P=>{const E=new Date(i);E.setFullYear(P),l(E),d("calendar")},O=P=>n.filter(E=>Et(E.date,P)),b=P=>r.some(E=>Et(E.date,P));return u==="months"?a.jsxs("div",{className:L("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:C,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsx(q,{variant:"ghost",onClick:()=>d("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:m}),a.jsx(q,{variant:"outline",size:"sm",onClick:S,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Ee,{className:"h-4 w-4"})})]})]})}),a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"grid grid-cols-3 gap-2",children:g.map((P,E)=>a.jsx(q,{variant:"ghost",onClick:()=>D(E),className:L("h-11 w-full text-sm font-medium rounded transition-all duration-200",E===i.getMonth()?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:P},P))})})]}):u==="years"?a.jsxs("div",{className:L("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d("months"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]})}),a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:x.map(P=>a.jsx(q,{variant:"ghost",onClick:()=>$(P),className:L("h-11 w-full text-sm font-medium rounded transition-all duration-200",P===m?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:P},P))})})]}):a.jsxs("div",{className:L("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:y,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsx(q,{variant:"ghost",onClick:()=>d("months"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:Cr(i,"MMMM yyyy")}),a.jsx(q,{variant:"outline",size:"sm",onClick:w,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Ee,{className:"h-4 w-4"})})]})}),a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:v.map((P,E)=>a.jsx("div",{className:"h-10 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:P})},E))}),a.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[Array.from({length:p.getDay()}).map((P,E)=>a.jsx("div",{className:"h-12"},`empty-${E}`)),h.map(P=>{const E=O(P),T=e&&Et(P,e),R=ps(P),W=fs(P,i),N=b(P);return a.jsx("div",{className:"relative",children:a.jsxs(q,{variant:"ghost",size:"sm",className:L("h-12 w-full p-0 text-sm relative rounded transition-all duration-200",!W&&"text-gray-300",W&&!T&&!R&&!N&&"text-gray-700 hover:bg-gray-50",N&&!T&&"text-red-600 font-medium hover:bg-red-50",R&&!T&&"bg-gray-100 text-gray-900 font-medium border border-gray-200",T&&"bg-gray-900 text-white font-medium shadow-sm"),onClick:()=>t?.(P),children:[Cr(P,"d"),E.length>0&&a.jsxs("div",{className:"absolute bottom-1 left-1/2 transform -translate-x-1/2 flex space-x-0.5",children:[E.slice(0,3).map((V,_)=>{const F=M=>{if(T)return"bg-white/80";switch(M){case"class":return"bg-blue-500";case"meeting":return"bg-green-500";case"appointment":return"bg-orange-500";case"deadline":return"bg-red-500";default:return"bg-gray-500"}};return a.jsx("div",{className:L("w-1 h-1 rounded-full",F(V.type))},_)}),E.length>3&&a.jsx("div",{className:L("w-1 h-1 rounded-full",T?"bg-white/60":"bg-gray-400")})]})]})},P.toISOString())})]})]}),e&&a.jsx("div",{className:"border-t border-gray-100",children:a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:ps(e)?"Today":Jx(e)?"Tomorrow":Cr(e,"MMM d, yyyy")})}),(()=>{const P=n.filter(E=>Et(E.date,e));return a.jsxs("div",{className:"space-y-3",children:[P.length>0&&P.map(E=>{const R=(W=>{switch(W){case"class":return{bg:"bg-blue-50",border:"border-blue-100",dot:"bg-blue-500",text:"text-blue-900",subtext:"text-blue-600"};case"meeting":return{bg:"bg-green-50",border:"border-green-100",dot:"bg-green-500",text:"text-green-900",subtext:"text-green-600"};case"appointment":return{bg:"bg-orange-50",border:"border-orange-100",dot:"bg-orange-500",text:"text-orange-900",subtext:"text-orange-600"};case"deadline":return{bg:"bg-red-50",border:"border-red-100",dot:"bg-red-500",text:"text-red-900",subtext:"text-red-600"};default:return{bg:"bg-gray-50",border:"border-gray-100",dot:"bg-gray-500",text:"text-gray-900",subtext:"text-gray-600"}}})(E.type);return a.jsxs("div",{className:`flex items-center space-x-3 p-3 ${R.bg} rounded border ${R.border} hover:shadow-sm transition-shadow cursor-pointer`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${R.dot} flex-shrink-0`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`text-sm font-medium ${R.text} truncate`,children:E.title}),(E.time||E.location)&&a.jsxs("p",{className:`text-xs ${R.subtext} truncate`,children:[E.time,E.time&&E.location&&" • ",E.location]})]})]},E.id||E.title)}),P.length===0&&a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3",children:a.jsx(Yr,{className:"w-5 h-5 text-gray-400"})}),a.jsx("p",{className:"text-sm text-gray-500",children:"No events scheduled"})]})]})})()]})}),!fs(i,new Date)&&a.jsx("div",{className:"p-6 pt-0",children:a.jsx(q,{variant:"outline",size:"sm",onClick:()=>{const P=new Date;l(P),t?.(P),d("calendar")},className:"w-full h-10 text-sm font-medium border-gray-200 hover:bg-gray-50 rounded",children:"Today"})})]})}const Cc=6048e5,Qx=864e5,hs=Symbol.for("constructDateFrom");function Se(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&hs in e?e[hs](t):e instanceof Date?new e.constructor(t):new Date(t)}function ye(e,t){return Se(t||e,e)}function Lr(e,t,n){const r=ye(e,n?.in);if(isNaN(t))return Se(e,NaN);if(!t)return r;const o=r.getDate(),s=Se(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return o>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}let ev={};function rr(){return ev}function Xt(e,t){const n=rr(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=ye(e,t?.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function On(e,t){return Xt(e,{...t,weekStartsOn:1})}function Nc(e,t){const n=ye(e,t?.in),r=n.getFullYear(),o=Se(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=On(o),i=Se(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=On(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function gs(e){const t=ye(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 or(e,...t){const n=Se.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function _n(e,t){const n=ye(e,t?.in);return n.setHours(0,0,0,0),n}function tv(e,t,n){const[r,o]=or(n?.in,e,t),s=_n(r),i=_n(o),l=+s-gs(s),u=+i-gs(i);return Math.round((l-u)/Qx)}function nv(e,t){const n=Nc(e,t),r=Se(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),On(r)}function rv(e){return Se(e,Date.now())}function Yt(e,t,n){const[r,o]=or(n?.in,e,t);return+_n(r)==+_n(o)}function ov(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function sv(e){return!(!ov(e)&&typeof e!="number"||isNaN(+ye(e)))}function xs(e,t){const n=ye(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function av(e,t){const[n,r]=or(e,t.start,t.end);return{start:n,end:r}}function vs(e,t){const{start:n,end:r}=av(t?.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0);let l=1;const u=[];for(;+i<=s;)u.push(Se(n,i)),i.setDate(i.getDate()+l),i.setHours(0,0,0,0);return o?u.reverse():u}function ys(e,t){const n=ye(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function iv(e,t){const n=ye(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const cv={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"}},lv=(e,t,n)=>{let r;const o=cv[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Nr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const uv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:Nr({formats:uv,defaultWidth:"full"}),time:Nr({formats:dv,defaultWidth:"full"}),dateTime:Nr({formats:fv,defaultWidth:"full"})},mv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hv=(e,t,n,r)=>mv[e];function Wt(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):i;o=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const gv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vv={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"]},yv={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"]},bv={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"}},wv={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"}},Sv=(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"},Cv={ordinalNumber:Sv,era:Wt({values:gv,defaultWidth:"wide"}),quarter:Wt({values:xv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Wt({values:vv,defaultWidth:"wide"}),day:Wt({values:yv,defaultWidth:"wide"}),dayPeriod:Wt({values:bv,defaultWidth:"wide",formattingValues:wv,defaultFormattingWidth:"wide"})};function Vt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Ev(l,f=>f.test(i)):Nv(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=t.slice(i.length);return{value:d,rest:p}}}function Nv(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ev(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function jv(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=t.slice(o.length);return{value:i,rest:l}}}const Pv=/^(\d+)(th|st|nd|rd)?/i,Rv=/\d+/i,Mv={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},kv={any:[/^b/i,/^(a|c)/i]},Dv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tv={any:[/1/i,/2/i,/3/i,/4/i]},Ov={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},_v={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]},Av={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},Iv={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]},$v={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},Fv={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}},Lv={ordinalNumber:jv({matchPattern:Pv,parsePattern:Rv,valueCallback:e=>parseInt(e,10)}),era:Vt({matchPatterns:Mv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any"}),quarter:Vt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Tv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vt({matchPatterns:Ov,defaultMatchWidth:"wide",parsePatterns:_v,defaultParseWidth:"any"}),day:Vt({matchPatterns:Av,defaultMatchWidth:"wide",parsePatterns:Iv,defaultParseWidth:"any"}),dayPeriod:Vt({matchPatterns:$v,defaultMatchWidth:"any",parsePatterns:Fv,defaultParseWidth:"any"})},Wv={code:"en-US",formatDistance:lv,formatLong:pv,formatRelative:hv,localize:Cv,match:Lv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Vv(e,t){const n=ye(e,t?.in);return tv(n,iv(n))+1}function Bv(e,t){const n=ye(e,t?.in),r=+On(n)-+nv(n);return Math.round(r/Cc)+1}function Ec(e,t){const n=ye(e,t?.in),r=n.getFullYear(),o=rr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=Se(t?.in||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=Xt(i,t),u=Se(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=Xt(u,t);return+n>=+l?r+1:+n>=+d?r:r-1}function zv(e,t){const n=rr(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Ec(e,t),s=Se(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Xt(s,t)}function Hv(e,t){const n=ye(e,t?.in),r=+Xt(n,t)-+zv(n,t);return Math.round(r/Cc)+1}function ce(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qe={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ce(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ce(n+1,2)},d(e,t){return ce(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];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ce(e.getHours()%12||12,t.length)},H(e,t){return ce(e.getHours(),t.length)},m(e,t){return ce(e.getMinutes(),t.length)},s(e,t){return ce(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ce(o,t.length)}},Nt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bs={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"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return qe.y(e,t)},Y:function(e,t,n,r){const o=Ec(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return ce(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ce(s,t.length)},R:function(e,t){const n=Nc(e);return ce(n,t.length)},u:function(e,t){const n=e.getFullYear();return ce(n,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 ce(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"});case"QQQQ":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 ce(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"});case"qqqq":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 qe.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"});case"MMMM":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 ce(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"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Hv(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ce(o,t.length)},I:function(e,t,n){const r=Bv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ce(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qe.d(e,t)},D:function(e,t,n){const r=Vv(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ce(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"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ce(s,2);case"eo":return n.ordinalNumber(s,{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"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ce(s,t.length);case"co":return n.ordinalNumber(s,{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"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return ce(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"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Nt.noon:r===0?o=Nt.midnight:o=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"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Nt.evening:r>=12?o=Nt.afternoon:r>=4?o=Nt.morning:o=Nt.night,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"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qe.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qe.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ce(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qe.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qe.s(e,t)},S:function(e,t){return qe.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ss(r);case"XXXX":case"XX":return dt(r);case"XXXXX":case"XXX":default:return dt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ss(r);case"xxxx":case"xx":return dt(r);case"xxxxx":case"xxx":default:return dt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ws(r,":");case"OOOO":default:return"GMT"+dt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ws(r,":");case"zzzz":default:return"GMT"+dt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ce(r,t.length)},T:function(e,t,n){return ce(+e,t.length)}};function ws(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+ce(s,2)}function Ss(e,t){return e%60===0?(e>0?"-":"+")+ce(Math.abs(e)/60,2):dt(e,t)}function dt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ce(Math.trunc(r/60),2),s=ce(r%60,2);return n+o+t+s}const Cs=(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"});case"PPPP":default:return t.date({width:"full"})}},jc=(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"});case"pppp":default:return t.time({width:"full"})}},Yv=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Cs(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Cs(r,t)).replace("{{time}}",jc(o,t))},Gv={p:jc,P:Yv},Uv=/^D+$/,Kv=/^Y+$/,qv=["D","DD","YY","YYYY"];function Xv(e){return Uv.test(e)}function Jv(e){return Kv.test(e)}function Zv(e,t,n){const r=Qv(e,t,n);if(console.warn(r),qv.includes(e))throw new RangeError(r)}function Qv(e,t,n){const r=e[0]==="Y"?"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`}const ey=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ty=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ny=/^'([^]*?)'?$/,ry=/''/g,oy=/[a-zA-Z]/;function Bt(e,t,n){const r=rr(),o=r.locale??Wv,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=ye(e,n?.in);if(!sv(l))throw new RangeError("Invalid time value");let u=t.match(ty).map(p=>{const f=p[0];if(f==="p"||f==="P"){const h=Gv[f];return h(p,o.formatLong)}return p}).join("").match(ey).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const f=p[0];if(f==="'")return{isToken:!1,value:sy(p)};if(bs[f])return{isToken:!0,value:p};if(f.match(oy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(u=o.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return u.map(p=>{if(!p.isToken)return p.value;const f=p.value;(Jv(f)||Xv(f))&&Zv(f,t,String(e));const h=bs[f[0]];return h(l,f,o.localize,d)}).join("")}function sy(e){const t=e.match(ny);return t?t[1].replace(ry,"'"):e}function Ns(e,t,n){const[r,o]=or(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function ay(e,t){return Yt(Se(e,e),rv(e))}function iy(e,t,n){return Lr(e,-1,n)}function Pc(e){const t=cy(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(uy);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function cy(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=fy(o),l=dy(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ly=Symbol("radix.slottable");function uy(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ly}function dy(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var py=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rc=py.reduce((e,t)=>{const n=Pc(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sr="Popover",[Mc]=Ue(sr,[_t]),un=_t(),[my,at]=Mc(sr),kc=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=un(t),u=c.useRef(null),[d,p]=c.useState(!1),[f,h]=et({prop:r,defaultProp:o??!1,onChange:s,caller:sr});return a.jsx(Kn,{...l,children:a.jsx(my,{scope:t,contentId:je(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:c.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:d,onCustomAnchorAdd:c.useCallback(()=>p(!0),[]),onCustomAnchorRemove:c.useCallback(()=>p(!1),[]),modal:i,children:n})})};kc.displayName=sr;var Dc="PopoverAnchor",Tc=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=at(Dc,n),s=un(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return c.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(qn,{...s,...r,ref:t})});Tc.displayName=Dc;var Oc="PopoverTrigger",_c=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=at(Oc,n),s=un(n),i=ie(t,o.triggerRef),l=a.jsx(Rc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Lc(o.open),...r,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(qn,{asChild:!0,...s,children:l})});_c.displayName=Oc;var go="PopoverPortal",[hy,gy]=Mc(go,{forceMount:void 0}),Ac=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=at(go,t);return a.jsx(hy,{scope:t,forceMount:n,children:a.jsx(Oe,{present:n||s.open,children:a.jsx(nn,{asChild:!0,container:o,children:r})})})};Ac.displayName=go;var Mt="PopoverContent",Ic=c.forwardRef((e,t)=>{const n=gy(Mt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=at(Mt,e.__scopePopover);return a.jsx(Oe,{present:r||s.open,children:s.modal?a.jsx(vy,{...o,ref:t}):a.jsx(yy,{...o,ref:t})})});Ic.displayName=Mt;var xy=Pc("PopoverContent.RemoveScroll"),vy=c.forwardRef((e,t)=>{const n=at(Mt,e.__scopePopover),r=c.useRef(null),o=ie(t,r),s=c.useRef(!1);return c.useEffect(()=>{const i=r.current;if(i)return Xn(i)},[]),a.jsx(sn,{as:xy,allowPinchZoom:!0,children:a.jsx($c,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),yy=c.forwardRef((e,t)=>{const n=at(Mt,e.__scopePopover),r=c.useRef(!1),o=c.useRef(!1);return a.jsx($c,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),$c=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...f}=e,h=at(Mt,n),g=un(n);return zn(),a.jsx(en,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Qt,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:a.jsx(oo,{"data-state":Lc(h.open),role:"dialog",id:h.contentId,...g,...f,ref:t,style:{...f.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)"}})})})}),Fc="PopoverClose",by=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=at(Fc,n);return a.jsx(Rc.button,{type:"button",...r,ref:t,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});by.displayName=Fc;var wy="PopoverArrow",Sy=c.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=un(n);return a.jsx(so,{...o,...r,ref:t})});Sy.displayName=wy;function Lc(e){return e?"open":"closed"}var Cy=kc,Ny=Tc,Ey=_c,jy=Ac,Wc=Ic;const xo=Cy,vo=Ey,Py=Ny,ar=c.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>a.jsx(jy,{children:a.jsx(Wc,{ref:o,align:t,sideOffset:n,className:L("z-50 w-auto rounded-md border border-gray-200 bg-white p-3 text-gray-950 shadow-lg 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",e),...r})}));ar.displayName=Wc.displayName;function Ry({date:e,onDateChange:t,mode:n="single",dateRange:r,onDateRangeChange:o,placeholder:s="Pick a date",dateFormat:i="PPP",disabled:l=!1,className:u,variant:d="outline",size:p="default",align:f="start",showIcon:h=!0,icon:g,minDate:v,maxDate:m,disabledDates:x,isDateDisabled:y,fullWidth:w=!1,customTrigger:C,numberOfMonths:S=1,holidays:D=[]}){const[$,O]=c.useState(!1),[b,P]=c.useState(e||new Date),[E,T]=c.useState("calendar"),[R,W]=c.useState(r?.from),[N,V]=c.useState(r?.to),[_,F]=c.useState();c.useEffect(()=>{W(r?.from),V(r?.to)},[r]),c.useEffect(()=>{$&&(T("calendar"),n==="single"&&e?P(e):n==="range"&&r?.from&&P(r.from))},[$,e,r,n]);const M=B=>{if(n==="range")if(!R||R&&N)W(B),V(void 0),o?.({from:B,to:void 0});else{const ae=R<B?R:B,Re=R<B?B:R;W(ae),V(Re),o?.({from:ae,to:Re}),O(!1)}else t?.(B),O(!1)},I=B=>!!(x?.some(ae=>ae.toDateString()===B.toDateString())||v&&B<v||m&&B>m||y?.(B)),re=B=>D.some(ae=>Yt(ae.date,B)),k=ys(b),z=xs(b),K=vs({start:k,end:z}),X=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],le=Lr(b,1),ue=ys(le),A=xs(le),Q=vs({start:ue,end:A}),oe=()=>{P(iy(b))},ee=()=>{P(Lr(b,1))},te=(B,ae)=>Bt(B,ae),j=B=>{if(R&&N)return B>=R&&B<=N;if(R&&!N&&_){const ae=R<_?R:_,Re=R<_?_:R;return B>=ae&&B<=Re}return!1},U=B=>R&&Yt(B,R),se=B=>N&&Yt(B,N),Z=()=>{const B=new Date(b);B.setFullYear(it-1),P(B)},xe=()=>{const B=new Date(b);B.setFullYear(it+1),P(B)},pe=B=>{const ae=new Date(b.getFullYear(),B,1);P(ae),T("calendar")},ve=B=>{const ae=new Date(B,b.getMonth(),1);P(ae),T("calendar")},cr=["January","February","March","April","May","June","July","August","September","October","November","December"],it=b.getFullYear(),lr=Array.from({length:20},(B,ae)=>it-10+ae),jo=C||a.jsxs(q,{variant:d,size:p,className:L("justify-start text-left font-normal",!e&&!R&&"text-gray-500",w&&"w-full",u),disabled:l,children:[h&&(g||a.jsx(Yr,{className:"mr-2 h-4 w-4"})),n==="range"?R&&N?a.jsxs("span",{children:[Bt(R,i)," - ",Bt(N,i)]}):R?a.jsxs("span",{children:[Bt(R,i)," - ..."]}):a.jsx("span",{children:s}):e?Bt(e,i):a.jsx("span",{children:s})]}),ct=(B,ae)=>{const Re=n==="single"?e&&Yt(B,e):U(B)||se(B),vl=ay(B),ur=I(B),lt=n==="range"&&j(B),yl=re(B),Po=B.getDay(),bl=U(B),wl=se(B);return a.jsx("div",{className:L("relative p-0.5",lt&&"bg-gray-100",lt&&Po===0&&"rounded-l-md",lt&&Po===6&&"rounded-r-md",lt&&bl&&"rounded-l-md",lt&&wl&&"rounded-r-md"),onMouseEnter:()=>n==="range"&&R&&!N&&F(B),onMouseLeave:()=>F(void 0),children:a.jsx(q,{variant:"ghost",size:"sm",disabled:ur||l,className:L("h-10 w-full p-0 text-sm relative transition-all duration-200 rounded-md text-gray-900",!ae&&"text-gray-300",yl&&!Re&&"text-red-600 font-medium",vl&&!Re&&!lt&&"bg-gray-50 text-gray-900 font-medium border border-gray-200",Re&&"bg-gray-900 text-white font-medium shadow-sm z-10 hover:bg-gray-800",lt&&!Re&&"text-gray-900 bg-gray-100",ur&&"opacity-40 cursor-not-allowed"),onClick:()=>!ur&&M(B),children:te(B,"d")})},B.toISOString())};return a.jsxs(xo,{open:$,onOpenChange:O,children:[a.jsx(vo,{asChild:!0,children:jo}),a.jsx(ar,{className:L("p-0 border-gray-200",S===2?"w-[640px]":"w-80"),align:f,side:"bottom",sideOffset:4,collisionPadding:8,children:a.jsxs("div",{className:"bg-white rounded-lg","data-takaui":"datepicker",children:[a.jsx("div",{className:"border-b border-gray-100 px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:oe,className:"h-9 w-9 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),S===2?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T("months"),className:"h-9 px-3 font-semibold text-base",children:te(b,"MMMM")}),a.jsx("span",{className:"text-gray-400 text-sm",children:"-"}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T("months"),className:"h-9 px-3 font-semibold text-base",children:te(le,"MMMM yyyy")})]}):a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T("months"),className:"h-9 px-4 font-semibold text-lg",children:te(b,"MMMM yyyy")}),a.jsx(q,{variant:"outline",size:"sm",onClick:ee,className:"h-9 w-9 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]})}),a.jsxs("div",{className:"p-6",children:[E==="years"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T("months"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]}),a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:lr.map(B=>a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>ve(B),className:L("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",B===it?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:B},B))})]}),E==="months"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>T("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(q,{variant:"outline",size:"sm",onClick:Z,className:"h-9 w-9 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsx(q,{variant:"ghost",onClick:()=>T("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900",children:it}),a.jsx(q,{variant:"outline",size:"sm",onClick:xe,className:"h-9 w-9 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:cr.map((B,ae)=>a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>pe(ae),className:L("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",ae===b.getMonth()?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:B},B))})]}),E==="calendar"&&a.jsxs("div",{className:L("flex",S===2?"gap-6":"gap-0"),children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:X.map((B,ae)=>a.jsx("div",{className:"h-8 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:B})},ae))}),a.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:k.getDay()}).map((B,ae)=>a.jsx("div",{className:"h-10"},`empty-${ae}`)),K.map(B=>ct(B,Ns(B,b)))]})]}),S===2&&a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:X.map((B,ae)=>a.jsx("div",{className:"h-8 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:B})},ae))}),a.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:ue.getDay()}).map((B,ae)=>a.jsx("div",{className:"h-10"},`next-empty-${ae}`)),Q.map(B=>ct(B,Ns(B,le)))]})]})]})]})]})})]})}const My=({time:e,onTimeChange:t,timezone:n="UTC",format:r="24h",showTimezone:o=!1,minuteStep:s=1,showSeconds:i=!1,placeholder:l="Select time",variant:u="outline",size:d="default",showClockFace:p=!1})=>{const f=r==="24h",h=e?e.getHours():0,g=e?e.getMinutes():0,v=e?e.getSeconds():0,m=h>=12?"PM":"AM",[x,y]=J.useState(h),[w,C]=J.useState(g),[S,D]=J.useState(v),[$,O]=J.useState(m),[b,P]=J.useState(""),[E,T]=J.useState(""),[R,W]=J.useState(""),N=J.useRef(null),V=J.useRef(null),_=J.useRef(null),F=J.useRef(null),M=J.useRef(null),I=J.useRef(null);J.useEffect(()=>{if(e){const j=e.getHours(),U=e.getMinutes(),se=e.getSeconds(),Z=j>=12?"PM":"AM";j!==x&&y(j),U!==w&&C(U),se!==S&&D(se),Z!==$&&O(Z)}},[e]),J.useEffect(()=>{F.current&&F.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),M.current&&M.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),I.current&&I.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"})},[x,w,S,f]);const re=(j,U,se)=>{const Z=new Date;Z.setHours(j),Z.setMinutes(U),Z.setSeconds(se),t(Z)},k=j=>{let U=j;f||($==="PM"&&j!==12?U=j+12:$==="AM"&&j===12&&(U=0)),y(U),re(U,w,S)},z=j=>{C(j),re(x,j,S)},K=j=>{D(j),re(x,w,j)},X=j=>{if($===j)return;O(j);const U=j==="PM"?x%12+12:x%12;y(U),re(U,w,S)},le=()=>{const j=new Date;y(j.getHours()),C(j.getMinutes()),D(j.getSeconds()),O(j.getHours()>=12?"PM":"AM"),t(j)},ue=()=>{if(!e)return l;const j=f?x:x%12||12,U=w.toString().padStart(2,"0"),se=S.toString().padStart(2,"0");let Z=`${j.toString().padStart(2,"0")}:${U}`;return i&&(Z+=`:${se}`),f||(Z+=` ${$}`),o&&(Z+=` ${n}`),Z},A=()=>{const j=f?23:12,U=f?0:1;return Array.from({length:j-U+1},(se,Z)=>U+Z)},Q=()=>Array.from({length:Math.floor(60/s)},(j,U)=>U*s),oe=()=>Array.from({length:60},(j,U)=>U),ee=f?x:x%12||12,te=()=>{const xe=(ee%12*30+w*.5)*(Math.PI/180)-Math.PI/2,pe=w*6*(Math.PI/180)-Math.PI/2,ve=100+50*Math.cos(xe),cr=100+50*Math.sin(xe),it=100+70*Math.cos(pe),lr=100+70*Math.sin(pe);return a.jsxs("svg",{width:200,height:200,className:"mx-auto",children:[a.jsx("circle",{cx:100,cy:100,r:95,fill:"white",stroke:"#e5e7eb",strokeWidth:"2"}),Array.from({length:12},(jo,ct)=>{const B=ct*30*(Math.PI/180)-Math.PI/2,ae=100+80*Math.cos(B),Re=100+80*Math.sin(B);return a.jsx("text",{x:ae,y:Re,textAnchor:"middle",dominantBaseline:"middle",className:"text-sm fill-gray-600",children:ct===0?12:ct},ct)}),a.jsx("line",{x1:100,y1:100,x2:ve,y2:cr,stroke:"#374151",strokeWidth:"6",strokeLinecap:"round"}),a.jsx("line",{x1:100,y1:100,x2:it,y2:lr,stroke:"#ef4444",strokeWidth:"4",strokeLinecap:"round"}),a.jsx("circle",{cx:100,cy:100,r:"6",fill:"#ef4444"})]})};return a.jsxs(xo,{children:[a.jsx(vo,{asChild:!0,children:a.jsxs(q,{variant:u,size:d,className:L("justify-start text-left font-normal",!e&&"text-muted-foreground"),children:[a.jsx(ad,{className:"mr-2 h-4 w-4"}),ue()]})}),a.jsx(ar,{className:"w-auto p-0",align:"start",children:a.jsxs("div",{className:"p-6 space-y-4 min-w-[460px]",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("input",{ref:N,type:"text",inputMode:"numeric",value:b!==""?b.padStart(2,"0"):ee.toString().padStart(2,"0"),onKeyDown:j=>{if(j.key>="0"&&j.key<="9"){j.preventDefault();const U=b+j.key;if(U.length===1)P(j.key);else if(U.length===2){const se=parseInt(U),Z=f?23:12,xe=f?0:1;let pe=se;se<xe&&(pe=xe),se>Z&&(pe=Z),P(""),k(pe),setTimeout(()=>V.current?.focus(),0)}}else j.key==="Backspace"?(j.preventDefault(),b.length>0&&P(b.slice(0,-1))):j.key==="ArrowRight"||j.key==="Tab"?(j.key==="ArrowRight"&&j.preventDefault(),V.current?.focus()):j.key===":"&&(j.preventDefault(),V.current?.focus())},onBlur:()=>{if(b){const j=parseInt(b),U=f?23:12,se=f?0:1;let Z=j;j<se&&(Z=se),j>U&&(Z=U),k(Z)}P("")},onFocus:()=>{P("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0}),a.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),a.jsx("input",{ref:V,type:"text",inputMode:"numeric",value:E!==""?E.padStart(2,"0"):w.toString().padStart(2,"0"),onKeyDown:j=>{if(j.key>="0"&&j.key<="9"){j.preventDefault();const U=E+j.key;if(U.length===1)T(j.key);else if(U.length===2){const se=parseInt(U),Z=Math.min(59,Math.max(0,se));T(""),z(Z),i&&setTimeout(()=>_.current?.focus(),0)}}else j.key==="Backspace"?(j.preventDefault(),E.length>0?T(E.slice(0,-1)):N.current?.focus()):j.key==="ArrowLeft"?(j.preventDefault(),N.current?.focus()):j.key==="ArrowRight"||j.key==="Tab"?(j.key==="ArrowRight"&&j.preventDefault(),i&&_.current?.focus()):j.key===":"&&(j.preventDefault(),i&&_.current?.focus())},onBlur:()=>{if(E){const j=parseInt(E),U=Math.min(59,Math.max(0,j));z(U)}T("")},onFocus:()=>{T("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0}),i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),a.jsx("input",{ref:_,type:"text",inputMode:"numeric",value:R!==""?R.padStart(2,"0"):S.toString().padStart(2,"0"),onKeyDown:j=>{if(j.key>="0"&&j.key<="9"){j.preventDefault();const U=R+j.key;if(U.length===1)W(j.key);else if(U.length===2){const se=parseInt(U),Z=Math.min(59,Math.max(0,se));W(""),K(Z)}}else j.key==="Backspace"?(j.preventDefault(),R.length>0?W(R.slice(0,-1)):V.current?.focus()):j.key==="ArrowLeft"&&(j.preventDefault(),V.current?.focus())},onBlur:()=>{if(R){const j=parseInt(R),U=Math.min(59,Math.max(0,j));K(U)}W("")},onFocus:()=>{W("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0})]})]}),!f&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(q,{size:"sm",variant:$==="AM"?"default":"outline",onClick:()=>X("AM"),className:"h-8 w-12 text-xs font-medium",children:"AM"}),a.jsx(q,{size:"sm",variant:$==="PM"?"default":"outline",onClick:()=>X("PM"),className:"h-8 w-12 text-xs font-medium",children:"PM"})]})]}),o&&a.jsx("div",{className:"text-xs text-gray-500 text-center",children:n})]}),p?a.jsx("div",{className:"space-y-4",children:te()}):a.jsxs("div",{className:"flex gap-2 justify-center items-start",children:[a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Hour"}),a.jsx("div",{ref:F,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:A().map(j=>a.jsx("button",{"data-selected":ee===j,onClick:()=>k(j),className:L("w-full py-2 text-center transition-colors",ee===j?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:j.toString().padStart(2,"0")},j))})]}),a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Min"}),a.jsx("div",{ref:M,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:Q().map(j=>a.jsx("button",{"data-selected":w===j,onClick:()=>z(j),className:L("w-full py-2 text-center transition-colors",w===j?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:j.toString().padStart(2,"0")},j))})]}),i&&a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Sec"}),a.jsx("div",{ref:I,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:oe().map(j=>a.jsx("button",{"data-selected":S===j,onClick:()=>K(j),className:L("w-full py-2 text-center transition-colors",S===j?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:j.toString().padStart(2,"0")},j))})]})]}),a.jsxs("div",{className:"flex gap-2 justify-between pt-2 border-t",children:[a.jsx(q,{size:"sm",variant:"outline",onClick:le,children:"Now"}),a.jsx(q,{size:"sm",onClick:()=>t(e),children:"Done"})]})]})})]})},yo=c.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:L("rounded-lg border border-gray-200 bg-white text-gray-950 shadow-sm",e),...t}));yo.displayName="Card";const bo=c.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:L("flex flex-col space-y-1.5 p-6",e),...t}));bo.displayName="CardHeader";const wo=c.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:L("text-2xl font-semibold leading-none tracking-tight",e),...t}));wo.displayName="CardTitle";const Vc=c.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:L("text-sm text-gray-500",e),...t}));Vc.displayName="CardDescription";const So=c.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:L("p-6 pt-0",e),...t}));So.displayName="CardContent";const Bc=c.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:L("flex items-center p-6 pt-0",e),...t}));Bc.displayName="CardFooter";var ky=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dy=ky.reduce((e,t)=>{const n=Rs(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ty="Label",zc=c.forwardRef((e,t)=>a.jsx(Dy.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));zc.displayName=Ty;var Hc=zc;const Ne=c.forwardRef(({className:e,...t},n)=>a.jsx(Hc,{ref:n,className:L("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Ne.displayName=Hc.displayName;function Yc(e){const t=Oy(e),n=c.forwardRef((r,o)=>{const{children:s,...i}=r,l=c.Children.toArray(s),u=l.find(Ay);if(u){const d=u.props.children,p=l.map(f=>f===u?c.Children.count(d)>1?c.Children.only(null):c.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:c.isValidElement(d)?c.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Oy(e){const t=c.forwardRef((n,r)=>{const{children:o,...s}=n;if(c.isValidElement(o)){const i=$y(o),l=Iy(s,o.props);return o.type!==c.Fragment&&(l.ref=r?fe(r,i):i),c.cloneElement(o,l)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _y=Symbol("radix.slottable");function Ay(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_y}function Iy(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $y(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dn=Fy.reduce((e,t)=>{const n=Yc(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ir="Dialog",[Gc]=Ue(ir),[Ly,_e]=Gc(ir),Uc=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=c.useRef(null),u=c.useRef(null),[d,p]=et({prop:r,defaultProp:o??!1,onChange:s,caller:ir});return a.jsx(Ly,{scope:t,triggerRef:l,contentRef:u,contentId:je(),titleId:je(),descriptionId:je(),open:d,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(f=>!f),[p]),modal:i,children:n})};Uc.displayName=ir;var Kc="DialogTrigger",Wy=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_e(Kc,n),s=ie(t,o.triggerRef);return a.jsx(dn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Eo(o.open),...r,ref:s,onClick:G(e.onClick,o.onOpenToggle)})});Wy.displayName=Kc;var Co="DialogPortal",[Vy,qc]=Gc(Co,{forceMount:void 0}),Xc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=_e(Co,t);return a.jsx(Vy,{scope:t,forceMount:n,children:c.Children.map(r,i=>a.jsx(Oe,{present:n||s.open,children:a.jsx(nn,{asChild:!0,container:o,children:i})}))})};Xc.displayName=Co;var An="DialogOverlay",Jc=c.forwardRef((e,t)=>{const n=qc(An,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=_e(An,e.__scopeDialog);return s.modal?a.jsx(Oe,{present:r||s.open,children:a.jsx(zy,{...o,ref:t})}):null});Jc.displayName=An;var By=Yc("DialogOverlay.RemoveScroll"),zy=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_e(An,n);return a.jsx(sn,{as:By,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(dn.div,{"data-state":Eo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vt="DialogContent",Zc=c.forwardRef((e,t)=>{const n=qc(vt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=_e(vt,e.__scopeDialog);return a.jsx(Oe,{present:r||s.open,children:s.modal?a.jsx(Hy,{...o,ref:t}):a.jsx(Yy,{...o,ref:t})})});Zc.displayName=vt;var Hy=c.forwardRef((e,t)=>{const n=_e(vt,e.__scopeDialog),r=c.useRef(null),o=ie(t,n.contentRef,r);return c.useEffect(()=>{const s=r.current;if(s)return Xn(s)},[]),a.jsx(Qc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault())})}),Yy=c.forwardRef((e,t)=>{const n=_e(vt,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return a.jsx(Qc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Qc=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=_e(vt,n),u=c.useRef(null),d=ie(t,u);return zn(),a.jsxs(a.Fragment,{children:[a.jsx(en,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Qt,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Eo(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Gy,{titleId:l.titleId}),a.jsx(Ky,{contentRef:u,descriptionId:l.descriptionId})]})]})}),No="DialogTitle",el=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_e(No,n);return a.jsx(dn.h2,{id:o.titleId,...r,ref:t})});el.displayName=No;var tl="DialogDescription",nl=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_e(tl,n);return a.jsx(dn.p,{id:o.descriptionId,...r,ref:t})});nl.displayName=tl;var rl="DialogClose",ol=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=_e(rl,n);return a.jsx(dn.button,{type:"button",...r,ref:t,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});ol.displayName=rl;function Eo(e){return e?"open":"closed"}var sl="DialogTitleWarning",[ob,al]=Su(sl,{contentName:vt,titleName:No,docsSlug:"dialog"}),Gy=({titleId:e})=>{const t=al(sl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
46
+ `)},_m=0,bt=[];function Om(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),o=l.useState(_m++)[0],s=l.useState(Sa)[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=tm([e.lockRef.current],(e.shards||[]).map(Qo),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=l.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var y=gn(m),b=n.current,C="deltaX"in m?m.deltaX:b[0]-y[0],w="deltaY"in m?m.deltaY:b[1]-y[1],T,L=m.target,k=Math.abs(C)>Math.abs(w)?"h":"v";if("touches"in m&&k==="h"&&L.type==="range")return!1;var P=Jo(k,L);if(!P)return!0;if(P?T=k:(T=k==="v"?"h":"v",P=Jo(k,L)),!P)return!1;if(!r.current&&"changedTouches"in m&&(C||w)&&(r.current=T),!T)return!0;var M=r.current||T;return Dm(M,x,m,M==="h"?C:w)},[]),u=l.useCallback(function(m){var x=m;if(!(!bt.length||bt[bt.length-1]!==s)){var y="deltaY"in x?Zo(x):gn(x),b=t.current.filter(function(T){return T.name===x.type&&(T.target===x.target||x.target===T.shadowParent)&&Tm(T.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(Qo).filter(Boolean).filter(function(T){return T.contains(x.target)}),w=C.length>0?c(x,C[0]):!i.current.noIsolation;w&&x.cancelable&&x.preventDefault()}}},[]),d=l.useCallback(function(m,x,y,b){var C={name:m,delta:x,target:y,should:b,shadowParent:Am(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(w){return w!==C})},1)},[]),p=l.useCallback(function(m){n.current=gn(m),r.current=void 0},[]),f=l.useCallback(function(m){d(m.type,Zo(m),m.target,c(m,e.lockRef.current))},[]),h=l.useCallback(function(m){d(m.type,gn(m),m.target,c(m,e.lockRef.current))},[]);l.useEffect(function(){return bt.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,yt),document.addEventListener("touchmove",u,yt),document.addEventListener("touchstart",p,yt),function(){bt=bt.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,yt),document.removeEventListener("touchmove",u,yt),document.removeEventListener("touchstart",p,yt)}},[]);var g=e.removeScrollBar,v=e.inert;return l.createElement(l.Fragment,null,v?l.createElement(s,{styles:km(o)}):null,g?l.createElement(Cm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Am(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Im=um(wa,Om);var rn=l.forwardRef(function(e,t){return l.createElement(Gn,_e({},e,{ref:t,sideCar:Im}))});rn.classNames=Gn.classNames;var Pr=["Enter"," "],$m=["ArrowDown","PageUp","Home"],ja=["ArrowUp","PageDown","End"],Fm=[...$m,...ja],Lm={ltr:[...Pr,"ArrowRight"],rtl:[...Pr,"ArrowLeft"]},Wm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},on="Menu",[Gt,Vm,Bm]=Br(on),[xt,Pa]=Ye(on,[Bm,Tt,pa]),sn=Tt(),Ra=pa(),[Ma,nt]=xt(on),[Hm,an]=xt(on),Da=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,c=sn(t),[u,d]=l.useState(null),p=l.useRef(!1),f=Re(s),h=Hr(o);return l.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),a.jsx(Hn,{...c,children:a.jsx(Ma,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:a.jsx(Hm,{scope:t,onClose:l.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:i,children:r})})})};Da.displayName=on;var zm="MenuAnchor",eo=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=sn(n);return a.jsx(zn,{...o,...r,ref:t})});eo.displayName=zm;var to="MenuPortal",[Ym,Ta]=xt(to,{forceMount:void 0}),ka=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=nt(to,t);return a.jsx(Ym,{scope:t,forceMount:n,children:a.jsx(Te,{present:n||s.open,children:a.jsx(en,{asChild:!0,container:o,children:r})})})};ka.displayName=to;var Ee="MenuContent",[Gm,no]=xt(Ee),_a=l.forwardRef((e,t)=>{const n=Ta(Ee,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=nt(Ee,e.__scopeMenu),i=an(Ee,e.__scopeMenu);return a.jsx(Gt.Provider,{scope:e.__scopeMenu,children:a.jsx(Te,{present:r||s.open,children:a.jsx(Gt.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(Um,{...o,ref:t}):a.jsx(Km,{...o,ref:t})})})})}),Um=l.forwardRef((e,t)=>{const n=nt(Ee,e.__scopeMenu),r=l.useRef(null),o=oe(t,r);return l.useEffect(()=>{const s=r.current;if(s)return Yn(s)},[]),a.jsx(ro,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Km=l.forwardRef((e,t)=>{const n=nt(Ee,e.__scopeMenu);return a.jsx(ro,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qm=ua("MenuContent.ScrollLock"),ro=l.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...m}=e,x=nt(Ee,n),y=an(Ee,n),b=sn(n),C=Ra(n),w=Vm(n),[T,L]=l.useState(null),k=l.useRef(null),P=oe(t,k,x.onContentChange),M=l.useRef(0),E=l.useRef(""),D=l.useRef(0),S=l.useRef(null),F=l.useRef("right"),N=l.useRef(0),V=v?rn:l.Fragment,_=v?{as:qm,allowPinchZoom:!0}:void 0,W=O=>{const Q=E.current+O,j=w().filter(I=>!I.disabled),z=document.activeElement,q=j.find(I=>I.ref.current===z)?.textValue,X=j.map(I=>I.textValue),ce=ih(X,Q,q),le=j.find(I=>I.textValue===ce)?.ref.current;(function I(Z){E.current=Z,window.clearTimeout(M.current),Z!==""&&(M.current=window.setTimeout(()=>I(""),1e3))})(Q),le&&setTimeout(()=>le.focus())};l.useEffect(()=>()=>window.clearTimeout(M.current),[]),Fn();const A=l.useCallback(O=>F.current===S.current?.side&&lh(O,S.current?.area),[]);return a.jsx(Gm,{scope:n,searchRef:E,onItemEnter:l.useCallback(O=>{A(O)&&O.preventDefault()},[A]),onItemLeave:l.useCallback(O=>{A(O)||(k.current?.focus(),L(null))},[A]),onTriggerLeave:l.useCallback(O=>{A(O)&&O.preventDefault()},[A]),pointerGraceTimerRef:D,onPointerGraceIntentChange:l.useCallback(O=>{S.current=O},[]),children:a.jsx(V,{..._,children:a.jsx(Zt,{asChild:!0,trapped:o,onMountAutoFocus:H(s,O=>{O.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Jt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:g,children:a.jsx(Xp,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:L,onEntryFocus:H(u,O=>{y.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Zr,{role:"menu","aria-orientation":"vertical","data-state":Xa(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:P,style:{outline:"none",...m.style},onKeyDown:H(m.onKeyDown,O=>{const j=O.target.closest("[data-radix-menu-content]")===O.currentTarget,z=O.ctrlKey||O.altKey||O.metaKey,q=O.key.length===1;j&&(O.key==="Tab"&&O.preventDefault(),!z&&q&&W(O.key));const X=k.current;if(O.target!==X||!Fm.includes(O.key))return;O.preventDefault();const le=w().filter(I=>!I.disabled).map(I=>I.ref.current);ja.includes(O.key)&&le.reverse(),sh(le)}),onBlur:H(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(M.current),E.current="")}),onPointerMove:H(e.onPointerMove,Ut(O=>{const Q=O.target,j=N.current!==O.clientX;if(O.currentTarget.contains(Q)&&j){const z=O.clientX>N.current?"right":"left";F.current=z,N.current=O.clientX}}))})})})})})})});_a.displayName=Ee;var Xm="MenuGroup",oo=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tn.div,{role:"group",...r,ref:t})});oo.displayName=Xm;var Jm="MenuLabel",Oa=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tn.div,{...r,ref:t})});Oa.displayName=Jm;var En="MenuItem",es="menu.itemSelect",Un=l.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=l.useRef(null),i=an(En,e.__scopeMenu),c=no(En,e.__scopeMenu),u=oe(t,s),d=l.useRef(!1),p=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(es,{bubbles:!0,cancelable:!0});f.addEventListener(es,g=>r?.(g),{once:!0}),kp(f,h),h.defaultPrevented?d.current=!1:i.onClose()}};return a.jsx(Aa,{...o,ref:u,disabled:n,onClick:H(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),d.current=!0},onPointerUp:H(e.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:H(e.onKeyDown,f=>{const h=c.searchRef.current!=="";n||h&&f.key===" "||Pr.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Un.displayName=En;var Aa=l.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=no(En,n),c=Ra(n),u=l.useRef(null),d=oe(t,u),[p,f]=l.useState(!1),[h,g]=l.useState("");return l.useEffect(()=>{const v=u.current;v&&g((v.textContent??"").trim())},[s.children]),a.jsx(Gt.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:a.jsx(Jp,{asChild:!0,...c,focusable:!r,children:a.jsx(tn.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:H(e.onPointerMove,Ut(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,Ut(v=>i.onItemLeave(v))),onFocus:H(e.onFocus,()=>f(!0)),onBlur:H(e.onBlur,()=>f(!1))})})})}),Zm="MenuCheckboxItem",Ia=l.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return a.jsx(Va,{scope:e.__scopeMenu,checked:n,children:a.jsx(Un,{role:"menuitemcheckbox","aria-checked":jn(n)?"mixed":n,...o,ref:t,"data-state":io(n),onSelect:H(o.onSelect,()=>r?.(jn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ia.displayName=Zm;var $a="MenuRadioGroup",[Qm,eh]=xt($a,{value:void 0,onValueChange:()=>{}}),Fa=l.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Re(r);return a.jsx(Qm,{scope:e.__scopeMenu,value:n,onValueChange:s,children:a.jsx(oo,{...o,ref:t})})});Fa.displayName=$a;var La="MenuRadioItem",Wa=l.forwardRef((e,t)=>{const{value:n,...r}=e,o=eh(La,e.__scopeMenu),s=n===o.value;return a.jsx(Va,{scope:e.__scopeMenu,checked:s,children:a.jsx(Un,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":io(s),onSelect:H(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Wa.displayName=La;var so="MenuItemIndicator",[Va,th]=xt(so,{checked:!1}),Ba=l.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=th(so,n);return a.jsx(Te,{present:r||jn(s.checked)||s.checked===!0,children:a.jsx(tn.span,{...o,ref:t,"data-state":io(s.checked)})})});Ba.displayName=so;var nh="MenuSeparator",Ha=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tn.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ha.displayName=nh;var rh="MenuArrow",za=l.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=sn(n);return a.jsx(Qr,{...o,...r,ref:t})});za.displayName=rh;var ao="MenuSub",[oh,Ya]=xt(ao),Ga=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=nt(ao,t),i=sn(t),[c,u]=l.useState(null),[d,p]=l.useState(null),f=Re(o);return l.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),a.jsx(Hn,{...i,children:a.jsx(Ma,{scope:t,open:r,onOpenChange:f,content:d,onContentChange:p,children:a.jsx(oh,{scope:t,contentId:Ne(),triggerId:Ne(),trigger:c,onTriggerChange:u,children:n})})})};Ga.displayName=ao;var Vt="MenuSubTrigger",Ua=l.forwardRef((e,t)=>{const n=nt(Vt,e.__scopeMenu),r=an(Vt,e.__scopeMenu),o=Ya(Vt,e.__scopeMenu),s=no(Vt,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),u(null)}},[c,u]),a.jsx(eo,{asChild:!0,...d,children:a.jsx(Aa,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Xa(n.open),...e,ref:ue(t,o.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,Ut(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:H(e.onPointerLeave,Ut(f=>{p();const h=n.content?.getBoundingClientRect();if(h){const g=n.content?.dataset.side,v=g==="right",m=v?-5:5,x=h[v?"left":"right"],y=h[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+m,y:f.clientY},{x,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x,y:h.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||Lm[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});Ua.displayName=Vt;var Ka="MenuSubContent",qa=l.forwardRef((e,t)=>{const n=Ta(Ee,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=nt(Ee,e.__scopeMenu),i=an(Ee,e.__scopeMenu),c=Ya(Ka,e.__scopeMenu),u=l.useRef(null),d=oe(t,u);return a.jsx(Gt.Provider,{scope:e.__scopeMenu,children:a.jsx(Te,{present:r||s.open,children:a.jsx(Gt.Slot,{scope:e.__scopeMenu,children:a.jsx(ro,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{i.isUsingKeyboardRef.current&&u.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:H(e.onFocusOutside,p=>{p.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),h=Wm[i.dir].includes(p.key);f&&h&&(s.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});qa.displayName=Ka;function Xa(e){return e?"open":"closed"}function jn(e){return e==="indeterminate"}function io(e){return jn(e)?"indeterminate":e?"checked":"unchecked"}function sh(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ah(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ih(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=ah(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function ch(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],u=t[i],d=c.x,p=c.y,f=u.x,h=u.y;p>r!=h>r&&n<(f-d)*(r-p)/(h-p)+d&&(o=!o)}return o}function lh(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ch(n,t)}function Ut(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uh=Da,dh=eo,fh=ka,ph=_a,mh=oo,hh=Oa,gh=Un,xh=Ia,vh=Fa,yh=Wa,bh=Ba,wh=Ha,Sh=za,Ch=Ga,Nh=Ua,Eh=qa,Kn="DropdownMenu",[jh]=Ye(Kn,[Pa]),pe=Pa(),[Ph,Ja]=jh(Kn),Za=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=pe(t),d=l.useRef(null),[p,f]=Qe({prop:o,defaultProp:s??!1,onChange:i,caller:Kn});return a.jsx(Ph,{scope:t,triggerId:Ne(),triggerRef:d,contentId:Ne(),open:p,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(h=>!h),[f]),modal:c,children:a.jsx(uh,{...u,open:p,onOpenChange:f,dir:r,modal:c,children:n})})};Za.displayName=Kn;var Qa="DropdownMenuTrigger",ei=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Ja(Qa,n),i=pe(n);return a.jsx(dh,{asChild:!0,...i,children:a.jsx(Ju.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ue(t,s.triggerRef),onPointerDown:H(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:H(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});ei.displayName=Qa;var Rh="DropdownMenuPortal",ti=e=>{const{__scopeDropdownMenu:t,...n}=e,r=pe(t);return a.jsx(fh,{...r,...n})};ti.displayName=Rh;var ni="DropdownMenuContent",ri=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ja(ni,n),s=pe(n),i=l.useRef(!1);return a.jsx(ph,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:H(e.onCloseAutoFocus,c=>{i.current||o.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:H(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!o.modal||p)&&(i.current=!0)}),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)"}})});ri.displayName=ni;var Mh="DropdownMenuGroup",oi=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(mh,{...o,...r,ref:t})});oi.displayName=Mh;var Dh="DropdownMenuLabel",si=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(hh,{...o,...r,ref:t})});si.displayName=Dh;var Th="DropdownMenuItem",ai=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(gh,{...o,...r,ref:t})});ai.displayName=Th;var kh="DropdownMenuCheckboxItem",ii=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(xh,{...o,...r,ref:t})});ii.displayName=kh;var _h="DropdownMenuRadioGroup",ci=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(vh,{...o,...r,ref:t})});ci.displayName=_h;var Oh="DropdownMenuRadioItem",li=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(yh,{...o,...r,ref:t})});li.displayName=Oh;var Ah="DropdownMenuItemIndicator",ui=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(bh,{...o,...r,ref:t})});ui.displayName=Ah;var Ih="DropdownMenuSeparator",di=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(wh,{...o,...r,ref:t})});di.displayName=Ih;var $h="DropdownMenuArrow",Fh=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(Sh,{...o,...r,ref:t})});Fh.displayName=$h;var Lh=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,i=pe(t),[c,u]=Qe({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return a.jsx(Ch,{...i,open:c,onOpenChange:u,children:n})},Wh="DropdownMenuSubTrigger",fi=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(Nh,{...o,...r,ref:t})});fi.displayName=Wh;var Vh="DropdownMenuSubContent",pi=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=pe(n);return a.jsx(Eh,{...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)"}})});pi.displayName=Vh;var Bh=Za,Hh=ei,mi=ti,zh=ri,Yh=oi,Gh=si,Uh=ai,Kh=ii,qh=ci,Xh=li,hi=ui,Jh=di,Zh=Lh,Qh=fi,eg=pi;function tg({...e}){return a.jsx(Bh,{"data-slot":"dropdown-menu",...e})}function ng({...e}){return a.jsx(mi,{"data-slot":"dropdown-menu-portal",...e})}function rg({...e}){return a.jsx(Hh,{"data-slot":"dropdown-menu-trigger",suppressHydrationWarning:!0,...e})}function og({className:e,sideOffset:t=4,...n}){return a.jsx(mi,{children:a.jsx(zh,{"data-slot":"dropdown-menu-content",sideOffset:t,className:$("bg-white text-gray-900 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 p-2 shadow-lg",e),...n})})}function sg({...e}){return a.jsx(Yh,{"data-slot":"dropdown-menu-group",...e})}function ag({className:e,inset:t,variant:n="default",...r}){return a.jsx(Uh,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:$("focus:bg-gray-100 focus:text-gray-900 data-[variant=destructive]:text-red-600 data-[variant=destructive]:focus:bg-red-50 data-[variant=destructive]:focus:text-red-700 [&_svg:not([class*='text-'])]:text-gray-500 relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ig({className:e,children:t,checked:n,...r}){return a.jsxs(Kh,{"data-slot":"dropdown-menu-checkbox-item",className:$("focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[a.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a.jsx(hi,{children:a.jsx(Wr,{className:"size-4 text-blue-600"})})}),t]})}function cg({...e}){return a.jsx(qh,{"data-slot":"dropdown-menu-radio-group",...e})}function lg({className:e,children:t,...n}){return a.jsxs(Xh,{"data-slot":"dropdown-menu-radio-item",className:$("focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[a.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a.jsx(hi,{children:a.jsx(ku,{className:"size-2 fill-blue-600"})})}),t]})}function ug({className:e,inset:t,...n}){return a.jsx(Gh,{"data-slot":"dropdown-menu-label","data-inset":t,className:$("px-2 py-1.5 text-sm font-semibold text-gray-900 data-[inset]:pl-8",e),...n})}function dg({className:e,...t}){return a.jsx(Jh,{"data-slot":"dropdown-menu-separator",className:$("bg-gray-100 my-1 h-px",e),...t})}function fg({className:e,...t}){return a.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:$("text-gray-500 ml-auto text-xs tracking-widest",e),...t})}function pg({...e}){return a.jsx(Zh,{"data-slot":"dropdown-menu-sub",...e})}function mg({className:e,inset:t,children:n,...r}){return a.jsxs(Qh,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:$("focus:bg-gray-100 focus:text-gray-900 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,a.jsx(Ce,{className:"ml-auto size-4"})]})}function hg({className:e,...t}){return a.jsx(eg,{"data-slot":"dropdown-menu-sub-content",className:$("bg-white text-gray-900 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border border-gray-200 p-2 shadow-lg",e),...t})}function gg({data:e=[],columns:t,searchPlaceholder:n="Search...",onRowClick:r,className:o="",showPagination:s=!0,showSearch:i=!0,pageSize:c=10,renderToolbar:u,variant:d="default"}){const[p,f]=U.useState(1),[h]=U.useState(c),[g,v]=U.useState(""),[m,x]=U.useState(null),[y,b]=U.useState("asc"),C=U.useMemo(()=>{if(!i||!g.trim())return e;const P=g.toLowerCase();return e.filter(M=>t.some(E=>(E.accessor?E.accessor(M):M[E.key])?.toString().toLowerCase().includes(P)))},[e,g,i,t]),w=U.useMemo(()=>m?[...C].sort((P,M)=>{const E=t.find(N=>N.key===m);if(!E)return 0;const D=E.accessor?E.accessor(P):P[E.key],S=E.accessor?E.accessor(M):M[E.key];if(D===S)return 0;if(D==null)return 1;if(S==null)return-1;const F=D<S?-1:1;return y==="asc"?F:-F}):C,[C,m,y,t]),T=U.useMemo(()=>{if(!s)return w;const P=(p-1)*h;return w.slice(P,P+h)},[w,p,h,s]);U.useEffect(()=>f(1),[g]);const L=P=>{m===P?b(y==="asc"?"desc":"asc"):(x(P),b("asc"))},k=(P,M,E)=>{const D=M.accessor?M.accessor(P):P[M.key];return M.cell?M.cell(D,P,E):D};return a.jsxs("div",{className:$("w-full space-y-4",o),children:[(i||u)&&a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[i&&a.jsxs("div",{className:"relative w-full sm:w-auto",children:[a.jsx($u,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),a.jsx(Ve,{placeholder:n,value:g,onChange:P=>v(P.target.value),className:"pl-10 w-full sm:w-[300px] bg-gray-50 border-gray-300"})]}),u&&a.jsx("div",{className:"w-full sm:w-auto",children:u()})]}),a.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(On,{variant:d,children:[a.jsx(An,{children:a.jsx(Ae,{children:t.map(P=>a.jsx($n,{className:"h-10 px-0 py-0",style:{width:P.width},children:P.align==="center"||!P.align&&typeof P.header!="string"?a.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof P.header!="string"?P.header:a.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:P.header})}):a.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof P.header!="string"?a.jsx("div",{children:P.header}):P.sortable!==!1?a.jsxs(G,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>L(P.key),children:[P.header,m===P.key&&y==="desc"?a.jsx(Xt,{className:"h-4 w-4"}):m===P.key&&y==="asc"?a.jsx(kn,{className:"h-4 w-4"}):a.jsx(Vr,{className:"h-4 w-4"})]}):a.jsx("span",{className:"px-3",children:P.header})})},P.key))})}),a.jsx(In,{children:T.length===0?a.jsx(Ae,{children:a.jsx(ft,{colSpan:t.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):T.map((P,M)=>a.jsx(Ae,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>r?.(P),children:t.map(E=>{const D=E.align==="center"||!E.align&&typeof E.header!="string";return a.jsx(ft,{className:D?"px-0 py-4":"px-3 py-4",style:{width:E.width},children:D?a.jsx("div",{className:"flex items-center justify-center h-full",children:k(P,E,M)}):k(P,E,M)},E.key)})},M))})]})})}),s&&a.jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",T.length," of ",w.length," row(s)"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm text-gray-700",children:["Page ",p," of ",Math.ceil(w.length/h)]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:()=>f(P=>Math.max(1,P-1)),disabled:p===1,className:"h-8 w-8 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsx(G,{variant:"outline",size:"sm",onClick:()=>f(P=>Math.min(Math.ceil(w.length/h),P+1)),disabled:p===Math.ceil(w.length/h),className:"h-8 w-8 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]})]})]})]})}const gi=U.createContext(null);function kt(){const e=U.useContext(gi);if(!e)throw new Error("useDataGrid must be used within DataGrid");return e}function xg({columns:e,data:t,getRowId:n=i=>i.id||String(Math.random()),onRowClick:r,children:o,recordCount:s}){const[i,c]=U.useState({pageIndex:0,pageSize:5}),[u,d]=U.useState([]),[p,f]=U.useState(new Set),h=U.useMemo(()=>u.length===0?t:[...t].sort((D,S)=>{for(const F of u){const N=e.find(A=>A.id===F.id);if(!N?.accessorKey)continue;const V=D[N.accessorKey],_=S[N.accessorKey];if(V===_)continue;const W=V<_?-1:1;return F.desc?-W:W}return 0}),[t,u,e]),g=U.useMemo(()=>{const E=i.pageIndex*i.pageSize,D=E+i.pageSize;return h.slice(E,D)},[h,i]),v=Math.ceil(h.length/i.pageSize),m=v,x=i.pageIndex>0,y=i.pageIndex<v-1,b=()=>c(E=>({...E,pageIndex:E.pageIndex-1})),C=()=>{c(E=>({...E,pageIndex:Math.min(E.pageIndex+1,m-1)}))},w=E=>{c(()=>({pageIndex:0,pageSize:E}))},T=E=>{c(D=>({...D,pageIndex:Math.max(0,Math.min(E,m-1))}))},L=E=>{f(D=>{const S=new Set(D);return S.has(E)?S.delete(E):S.add(E),S})},k=()=>{p.size===g.length?f(new Set):f(new Set(g.map(E=>n(E))))},P=g.length>0&&p.size===g.length,M={columns:e,data:t,getRowId:n,onRowClick:r,pagination:i,setPagination:c,canPreviousPage:x,canNextPage:y,previousPage:b,nextPage:C,setPageSize:w,goToPage:T,pageCount:m,sorting:u,setSorting:d,selectedRows:p,toggleRow:L,toggleAllRows:k,isAllRowsSelected:P,paginatedData:g,sortedData:h,totalPages:v,recordCount:s??t.length};return a.jsx(gi.Provider,{value:M,children:o})}function vg(){const{columns:e,paginatedData:t,getRowId:n,onRowClick:r}=kt();return a.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(On,{children:[a.jsx(An,{children:a.jsx(Ae,{children:e.map(o=>a.jsx($n,{className:"h-10 px-0 py-0",style:{width:o.size?`${o.size}px`:void 0},children:o.align==="center"?a.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof o.header!="string"?o.header:a.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:o.header})}):a.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof o.header!="string"?a.jsx("div",{children:o.header}):a.jsx("span",{className:"px-3",children:o.header})})},o.id))})}),a.jsx(In,{children:t.length===0?a.jsx(Ae,{children:a.jsx(ft,{colSpan:e.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):t.map((o,s)=>a.jsx(Ae,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>r?.(o),children:e.map(i=>{const c=i.align==="center",u=i.cell?i.cell(o,s):i.accessorKey?o[i.accessorKey]:null;return a.jsx(ft,{className:c?"px-0 py-4":"px-3 py-4",style:{width:i.size?`${i.size}px`:void 0},children:c?a.jsx("div",{className:"flex items-center justify-center h-full",children:u}):u},i.id)})},n(o)))})]})})})}function ts(e,[t,n]){return Math.min(n,Math.max(t,e))}function xi(e){const t=yg(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(wg);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function yg(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Cg(o),c=Sg(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bg=Symbol("radix.slottable");function wg(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bg}function Sg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ng=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=Ng.reduce((e,t)=>{const n=xi(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Eg(e){const t=jg(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Rg);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function jg(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Dg(o),c=Mg(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pg=Symbol("radix.slottable");function Rg(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pg}function Mg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Dg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kg=Tg.reduce((e,t)=>{const n=Eg(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vi=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_g="VisuallyHidden",Og=l.forwardRef((e,t)=>a.jsx(kg.span,{...e,ref:t,style:{...vi,...e.style}}));Og.displayName=_g;var Ag=[" ","Enter","ArrowUp","ArrowDown"],Ig=[" ","Enter"],mt="Select",[qn,Xn,$g]=Br(mt),[_t]=Ye(mt,[$g,Tt]),Jn=Tt(),[Fg,rt]=_t(mt),[Lg,Wg]=_t(mt),yi=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:h,required:g,form:v}=e,m=Jn(t),[x,y]=l.useState(null),[b,C]=l.useState(null),[w,T]=l.useState(!1),L=Hr(d),[k,P]=Qe({prop:r,defaultProp:o??!1,onChange:s,caller:mt}),[M,E]=Qe({prop:i,defaultProp:c,onChange:u,caller:mt}),D=l.useRef(null),S=x?v||!!x.closest("form"):!0,[F,N]=l.useState(new Set),V=Array.from(F).map(_=>_.props.value).join(";");return a.jsx(Hn,{...m,children:a.jsxs(Fg,{required:g,scope:t,trigger:x,onTriggerChange:y,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:Ne(),value:M,onValueChange:E,open:k,onOpenChange:P,dir:L,triggerPointerDownPosRef:D,disabled:h,children:[a.jsx(qn.Provider,{scope:t,children:a.jsx(Lg,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(_=>{N(W=>new Set(W).add(_))},[]),onNativeOptionRemove:l.useCallback(_=>{N(W=>{const A=new Set(W);return A.delete(_),A})},[]),children:n})}),S?a.jsxs(zi,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:f,value:M,onChange:_=>E(_.target.value),disabled:h,form:v,children:[M===void 0?a.jsx("option",{value:""}):null,Array.from(F)]},V):null]})})};yi.displayName=mt;var bi="SelectTrigger",wi=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Jn(n),i=rt(bi,n),c=i.disabled||r,u=oe(t,i.onTriggerChange),d=Xn(n),p=l.useRef("touch"),[f,h,g]=Gi(m=>{const x=d().filter(C=>!C.disabled),y=x.find(C=>C.value===i.value),b=Ui(x,m,y);b!==void 0&&i.onValueChange(b.value)}),v=m=>{c||(i.onOpenChange(!0),g()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return a.jsx(zn,{asChild:!0,...s,children:a.jsx(we.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Yi(i.value)?"":void 0,...o,ref:u,onClick:H(o.onClick,m=>{m.currentTarget.focus(),p.current!=="mouse"&&v(m)}),onPointerDown:H(o.onPointerDown,m=>{p.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:H(o.onKeyDown,m=>{const x=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(x&&m.key===" ")&&Ag.includes(m.key)&&(v(),m.preventDefault())})})})});wi.displayName=bi;var Si="SelectValue",Ci=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...c}=e,u=rt(Si,n),{onValueNodeHasChildrenChange:d}=u,p=s!==void 0,f=oe(t,u.onValueNodeChange);return fe(()=>{d(p)},[d,p]),a.jsx(we.span,{...c,ref:f,style:{pointerEvents:"none"},children:Yi(u.value)?a.jsx(a.Fragment,{children:i}):s})});Ci.displayName=Si;var Vg="SelectIcon",Ni=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return a.jsx(we.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Ni.displayName=Vg;var Bg="SelectPortal",Ei=e=>a.jsx(en,{asChild:!0,...e});Ei.displayName=Bg;var ht="SelectContent",ji=l.forwardRef((e,t)=>{const n=rt(ht,e.__scopeSelect),[r,o]=l.useState();if(fe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?qt.createPortal(a.jsx(Pi,{scope:e.__scopeSelect,children:a.jsx(qn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Ri,{...e,ref:t})});ji.displayName=ht;var Pe=10,[Pi,ot]=_t(ht),Hg="SelectContentImpl",zg=xi("SelectContent.RemoveScroll"),Ri=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x,...y}=e,b=rt(ht,n),[C,w]=l.useState(null),[T,L]=l.useState(null),k=oe(t,I=>w(I)),[P,M]=l.useState(null),[E,D]=l.useState(null),S=Xn(n),[F,N]=l.useState(!1),V=l.useRef(!1);l.useEffect(()=>{if(C)return Yn(C)},[C]),Fn();const _=l.useCallback(I=>{const[Z,...ae]=S().map(R=>R.ref.current),[ee]=ae.slice(-1),te=document.activeElement;for(const R of I)if(R===te||(R?.scrollIntoView({block:"nearest"}),R===Z&&T&&(T.scrollTop=0),R===ee&&T&&(T.scrollTop=T.scrollHeight),R?.focus(),document.activeElement!==te))return},[S,T]),W=l.useCallback(()=>_([P,C]),[_,P,C]);l.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:A,triggerPointerDownPosRef:O}=b;l.useEffect(()=>{if(C){let I={x:0,y:0};const Z=ee=>{I={x:Math.abs(Math.round(ee.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(O.current?.y??0))}},ae=ee=>{I.x<=10&&I.y<=10?ee.preventDefault():C.contains(ee.target)||A(!1),document.removeEventListener("pointermove",Z),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ae,{capture:!0})}}},[C,A,O]),l.useEffect(()=>{const I=()=>A(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[A]);const[Q,j]=Gi(I=>{const Z=S().filter(te=>!te.disabled),ae=Z.find(te=>te.ref.current===document.activeElement),ee=Ui(Z,I,ae);ee&&setTimeout(()=>ee.ref.current.focus())}),z=l.useCallback((I,Z,ae)=>{const ee=!V.current&&!ae;(b.value!==void 0&&b.value===Z||ee)&&(M(I),ee&&(V.current=!0))},[b.value]),q=l.useCallback(()=>C?.focus(),[C]),X=l.useCallback((I,Z,ae)=>{const ee=!V.current&&!ae;(b.value!==void 0&&b.value===Z||ee)&&D(I)},[b.value]),ce=r==="popper"?Rr:Mi,le=ce===Rr?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return a.jsx(Pi,{scope:n,content:C,viewport:T,onViewportChange:L,itemRefCallback:z,selectedItem:P,onItemLeave:q,itemTextRefCallback:X,focusSelectedItem:W,selectedItemText:E,position:r,isPositioned:F,searchRef:Q,children:a.jsx(rn,{as:zg,allowPinchZoom:!0,children:a.jsx(Zt,{asChild:!0,trapped:b.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:H(o,I=>{b.trigger?.focus({preventScroll:!0}),I.preventDefault()}),children:a.jsx(Jt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:a.jsx(ce,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:I=>I.preventDefault(),...y,...le,onPlaced:()=>N(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:H(y.onKeyDown,I=>{const Z=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!Z&&I.key.length===1&&j(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let ee=S().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(I.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const te=I.target,R=ee.indexOf(te);ee=ee.slice(R+1)}setTimeout(()=>_(ee)),I.preventDefault()}})})})})})})});Ri.displayName=Hg;var Yg="SelectItemAlignedPosition",Mi=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=rt(ht,n),i=ot(ht,n),[c,u]=l.useState(null),[d,p]=l.useState(null),f=oe(t,k=>p(k)),h=Xn(n),g=l.useRef(!1),v=l.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=i,C=l.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&m&&x&&y){const k=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(s.dir!=="rtl"){const te=E.left-P.left,R=M.left-te,Y=k.left-R,ne=k.width+Y,K=Math.max(ne,P.width),he=window.innerWidth-Pe,de=ts(R,[Pe,Math.max(Pe,he-K)]);c.style.minWidth=ne+"px",c.style.left=de+"px"}else{const te=P.right-E.right,R=window.innerWidth-M.right-te,Y=window.innerWidth-k.right-R,ne=k.width+Y,K=Math.max(ne,P.width),he=window.innerWidth-Pe,de=ts(R,[Pe,Math.max(Pe,he-K)]);c.style.minWidth=ne+"px",c.style.right=de+"px"}const D=h(),S=window.innerHeight-Pe*2,F=m.scrollHeight,N=window.getComputedStyle(d),V=parseInt(N.borderTopWidth,10),_=parseInt(N.paddingTop,10),W=parseInt(N.borderBottomWidth,10),A=parseInt(N.paddingBottom,10),O=V+_+F+A+W,Q=Math.min(x.offsetHeight*5,O),j=window.getComputedStyle(m),z=parseInt(j.paddingTop,10),q=parseInt(j.paddingBottom,10),X=k.top+k.height/2-Pe,ce=S-X,le=x.offsetHeight/2,I=x.offsetTop+le,Z=V+_+I,ae=O-Z;if(Z<=X){const te=D.length>0&&x===D[D.length-1].ref.current;c.style.bottom="0px";const R=d.clientHeight-m.offsetTop-m.offsetHeight,Y=Math.max(ce,le+(te?q:0)+R+W),ne=Z+Y;c.style.height=ne+"px"}else{const te=D.length>0&&x===D[0].ref.current;c.style.top="0px";const Y=Math.max(X,V+m.offsetTop+(te?z:0)+le)+ae;c.style.height=Y+"px",m.scrollTop=Z-X+m.offsetTop}c.style.margin=`${Pe}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=S+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,s.trigger,s.valueNode,c,d,m,x,y,s.dir,r]);fe(()=>C(),[C]);const[w,T]=l.useState();fe(()=>{d&&T(window.getComputedStyle(d).zIndex)},[d]);const L=l.useCallback(k=>{k&&v.current===!0&&(C(),b?.(),v.current=!1)},[C,b]);return a.jsx(Ug,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:L,children:a.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:a.jsx(we.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Mi.displayName=Yg;var Gg="SelectPopperPosition",Rr=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Pe,...s}=e,i=Jn(n);return a.jsx(Zr,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Gg;var[Ug,co]=_t(ht,{}),Mr="SelectViewport",Di=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=ot(Mr,n),i=co(Mr,n),c=oe(t,s.onViewportChange),u=l.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(qn.Slot,{scope:n,children:a.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:H(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h?.current&&f){const g=Math.abs(u.current-p.scrollTop);if(g>0){const v=window.innerHeight-Pe*2,m=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),y=Math.max(m,x);if(y<v){const b=y+g,C=Math.min(v,b),w=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(p.scrollTop=w>0?w:0,f.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});Di.displayName=Mr;var Ti="SelectGroup",[Kg,qg]=_t(Ti),ki=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ne();return a.jsx(Kg,{scope:n,id:o,children:a.jsx(we.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ki.displayName=Ti;var _i="SelectLabel",Oi=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qg(_i,n);return a.jsx(we.div,{id:o.id,...r,ref:t})});Oi.displayName=_i;var Pn="SelectItem",[Xg,Ai]=_t(Pn),Ii=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,c=rt(Pn,n),u=ot(Pn,n),d=c.value===r,[p,f]=l.useState(s??""),[h,g]=l.useState(!1),v=oe(t,b=>u.itemRefCallback?.(b,r,o)),m=Ne(),x=l.useRef("touch"),y=()=>{o||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Xg,{scope:n,value:r,disabled:o,textId:m,isSelected:d,onItemTextChange:l.useCallback(b=>{f(C=>C||(b?.textContent??"").trim())},[]),children:a.jsx(qn.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:a.jsx(we.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:H(i.onFocus,()=>g(!0)),onBlur:H(i.onBlur,()=>g(!1)),onClick:H(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:H(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:H(i.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:H(i.onPointerMove,b=>{x.current=b.pointerType,o?u.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:H(i.onKeyDown,b=>{u.searchRef?.current!==""&&b.key===" "||(Ig.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});Ii.displayName=Pn;var Bt="SelectItemText",$i=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=rt(Bt,n),c=ot(Bt,n),u=Ai(Bt,n),d=Wg(Bt,n),[p,f]=l.useState(null),h=oe(t,y=>f(y),u.onItemTextChange,y=>c.itemTextRefCallback?.(y,u.value,u.disabled)),g=p?.textContent,v=l.useMemo(()=>a.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=d;return fe(()=>(m(v),()=>x(v)),[m,x,v]),a.jsxs(a.Fragment,{children:[a.jsx(we.span,{id:u.textId,...s,ref:h}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?qt.createPortal(s.children,i.valueNode):null]})});$i.displayName=Bt;var Fi="SelectItemIndicator",Li=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ai(Fi,n).isSelected?a.jsx(we.span,{"aria-hidden":!0,...r,ref:t}):null});Li.displayName=Fi;var Dr="SelectScrollUpButton",Wi=l.forwardRef((e,t)=>{const n=ot(Dr,e.__scopeSelect),r=co(Dr,e.__scopeSelect),[o,s]=l.useState(!1),i=oe(t,r.onScrollButtonChange);return fe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?a.jsx(Bi,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Wi.displayName=Dr;var Tr="SelectScrollDownButton",Vi=l.forwardRef((e,t)=>{const n=ot(Tr,e.__scopeSelect),r=co(Tr,e.__scopeSelect),[o,s]=l.useState(!1),i=oe(t,r.onScrollButtonChange);return fe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;s(p)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),o?a.jsx(Bi,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Vi.displayName=Tr;var Bi=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=ot("SelectScrollButton",n),i=l.useRef(null),c=Xn(n),u=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),fe(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(we.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:H(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:H(o.onPointerLeave,()=>{u()})})}),Jg="SelectSeparator",Hi=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(we.div,{"aria-hidden":!0,...r,ref:t})});Hi.displayName=Jg;var kr="SelectArrow",Zg=l.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jn(n),s=rt(kr,n),i=ot(kr,n);return s.open&&i.position==="popper"?a.jsx(Qr,{...o,...r,ref:t}):null});Zg.displayName=kr;var Qg="SelectBubbleInput",zi=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=l.useRef(null),s=oe(r,o),i=js(t);return l.useEffect(()=>{const c=o.current;if(!c)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(f)}},[i,t]),a.jsx(we.select,{...n,style:{...vi,...n.style},ref:s,defaultValue:t})});zi.displayName=Qg;function Yi(e){return e===""||e===void 0}function Gi(e){const t=Re(e),n=l.useRef(""),r=l.useRef(0),o=l.useCallback(i=>{const c=n.current+i;t(c),(function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=l.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Ui(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=ex(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function ex(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tx=yi,Ki=wi,nx=Ci,rx=Ni,ox=Ei,qi=ji,sx=Di,ax=ki,Xi=Oi,Ji=Ii,ix=$i,cx=Li,Zi=Wi,Qi=Vi,ec=Hi;const ut=tx,lx=ax,dt=nx,Xe=l.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Ki,{ref:r,className:$("flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",e),...n,children:[t,a.jsx(rx,{asChild:!0,children:a.jsx(Xt,{className:"h-4 w-4 opacity-50"})})]}));Xe.displayName=Ki.displayName;const tc=l.forwardRef(({className:e,...t},n)=>a.jsx(Zi,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(kn,{className:"h-4 w-4"})}));tc.displayName=Zi.displayName;const nc=l.forwardRef(({className:e,...t},n)=>a.jsx(Qi,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Xt,{className:"h-4 w-4"})}));nc.displayName=Qi.displayName;const Je=l.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>a.jsx(ox,{children:a.jsxs(qi,{ref:o,className:$("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white text-gray-950 shadow-md 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==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(tc,{}),a.jsx(sx,{className:$("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(nc,{})]})}));Je.displayName=qi.displayName;const rc=l.forwardRef(({className:e,...t},n)=>a.jsx(Xi,{ref:n,className:$("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));rc.displayName=Xi.displayName;const Be=l.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Ji,{ref:r,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(cx,{children:a.jsx(Wr,{className:"h-4 w-4"})})}),a.jsx(ix,{children:t})]}));Be.displayName=Ji.displayName;const oc=l.forwardRef(({className:e,...t},n)=>a.jsx(ec,{ref:n,className:$("-mx-1 my-1 h-px bg-gray-100",e),...t}));oc.displayName=ec.displayName;function ux({mode:e="simple",pageSizeOptions:t=[5,10,15,20]}){const{canPreviousPage:n,canNextPage:r,previousPage:o,nextPage:s,pageCount:i,pagination:c,setPageSize:u,goToPage:d}=kt(),p=()=>{const f=c.pageIndex,h=i,g=[];if(h<=7)for(let v=0;v<h;v++)g.push(v);else if(f<=3){for(let v=0;v<=4;v++)g.push(v);g.push("..."),g.push(h-1)}else if(f>=h-4){g.push(0),g.push("...");for(let v=h-5;v<h;v++)g.push(v)}else g.push(0),g.push("..."),g.push(f-1),g.push(f),g.push(f+1),g.push("..."),g.push(h-1);return g};return e==="simple"?a.jsx("div",{className:"flex items-center justify-end px-2 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm text-gray-700 hidden sm:block",children:["Page ",c.pageIndex+1," of ",i]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:o,disabled:!n,className:"h-8 w-8 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsx(G,{variant:"outline",size:"sm",onClick:s,disabled:!r,className:"h-8 w-8 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]})]})}):a.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 py-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600 hidden sm:inline",children:"Rows per page:"}),a.jsxs(ut,{value:String(c.pageSize),onValueChange:f=>u(Number(f)),children:[a.jsx(Xe,{className:"h-8 w-16",children:a.jsx(dt,{})}),a.jsx(Je,{children:t.map(f=>a.jsx(Be,{value:String(f),children:f},f))})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:o,disabled:!n,className:"h-8 w-8 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsxs("span",{className:"text-sm text-gray-700 sm:hidden px-2",children:[c.pageIndex+1," / ",i]}),a.jsx("div",{className:"hidden sm:flex gap-1",children:p().map((f,h)=>typeof f=="number"?a.jsx(G,{variant:c.pageIndex===f?"default":"outline",size:"sm",onClick:()=>d(f),className:"h-8 w-8 p-0",children:f+1},h):a.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-gray-400",children:f},h))}),a.jsx(G,{variant:"outline",size:"sm",onClick:s,disabled:!r,className:"h-8 w-8 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]})]})}function dx({id:e,title:t}){const{sorting:n,setSorting:r}=kt(),o=n.find(u=>u.id===e),s=!!o,i=o?.desc??!1,c=()=>{r(u=>{const d=u.find(p=>p.id===e);return d?d.desc?[]:[{id:e,desc:!0}]:[{id:e,desc:!1}]})};return a.jsxs(G,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:c,children:[t,s&&i?a.jsx(Xt,{className:"h-4 w-4"}):s?a.jsx(kn,{className:"h-4 w-4"}):a.jsx(Vr,{className:"h-4 w-4"})]})}function fx(){const{toggleAllRows:e,isAllRowsSelected:t}=kt();return a.jsx(_n,{checked:t,onCheckedChange:e})}function px({row:e}){const{selectedRows:t,toggleRow:n,getRowId:r}=kt(),o=r(e);return a.jsx(_n,{checked:t.has(o),onCheckedChange:()=>n(o)})}const sc=l.createContext(null);function ac(){const e=l.useContext(sc);if(!e)throw new Error("useTableContext must be used within a TableRoot component");return e}function mx({table:e,totalRecords:t,children:n}){return a.jsx(sc.Provider,{value:{tableInstance:e,totalRecords:t},children:n})}function hx({children:e,className:t}){return a.jsx("div",{className:$("rounded-xl border border-gray-200 bg-white overflow-hidden",t),children:e})}function ns(e,t){return e?gx(e)?l.createElement(e,t):e:null}function gx(e){return xx(e)||typeof e=="function"||vx(e)}function xx(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function vx(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function yx(){const{tableInstance:e}=ac();return a.jsxs(On,{children:[a.jsx(An,{children:e.getHeaderGroups().map(t=>a.jsx(Ae,{children:t.headers.map(n=>a.jsx($n,{children:n.isPlaceholder?null:ns(n.column.columnDef.header,n.getContext())},n.id))},t.id))}),a.jsx(In,{children:e.getRowModel().rows?.length?e.getRowModel().rows.map(t=>a.jsx(Ae,{"data-state":t.getIsSelected()&&"selected",children:t.getVisibleCells().map(n=>a.jsx(ft,{children:ns(n.column.columnDef.cell,n.getContext())},n.id))},t.id)):a.jsx(Ae,{children:a.jsx(ft,{colSpan:e.getAllColumns().length,className:"h-24 text-center",children:"No results."})})})]})}function bx({rowsPerPageOptions:e=[5,10,20,30,50],showPageSelector:t=!0,showRecordInfo:n=!0,showControls:r=!0}={}){const{tableInstance:o,totalRecords:s}=ac(),i=o.getState().pagination.pageIndex+1,c=o.getPageCount(),u=o.getState().pagination.pageSize,d=i===1?1:(i-1)*u+1,p=Math.min(i*u,s);return a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-3 py-4",children:[t&&a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"text-sm text-gray-700 font-medium",children:"Items per page:"}),a.jsxs(ut,{value:`${u}`,onValueChange:f=>{o.setPageSize(Number(f))},children:[a.jsx(Xe,{className:"h-9 w-[75px]",children:a.jsx(dt,{placeholder:u})}),a.jsx(Je,{side:"top",children:e.map(f=>a.jsx(Be,{value:`${f}`,children:f},f))})]})]}),n&&a.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:a.jsxs("span",{children:[d,"–",p," of ",s]})}),r&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs(G,{variant:"outline",size:"sm",onClick:()=>o.setPageIndex(0),disabled:!o.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"First page"}),a.jsx(Pu,{className:"h-4 w-4"})]}),a.jsxs(G,{variant:"outline",size:"sm",onClick:()=>o.previousPage(),disabled:!o.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Previous page"}),a.jsx($e,{className:"h-4 w-4"})]}),a.jsxs("div",{className:"flex items-center justify-center text-sm font-medium min-w-[110px]",children:["Page ",i," of ",c]}),a.jsxs(G,{variant:"outline",size:"sm",onClick:()=>o.nextPage(),disabled:!o.getCanNextPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Next page"}),a.jsx(Ce,{className:"h-4 w-4"})]}),a.jsxs(G,{variant:"outline",size:"sm",onClick:()=>o.setPageIndex(o.getPageCount()-1),disabled:!o.getCanNextPage(),className:"h-9 w-9 p-0",children:[a.jsx("span",{className:"sr-only",children:"Last page"}),a.jsx(Mu,{className:"h-4 w-4"})]})]})]})}function wx({column:e,title:t,align:n="left",className:r}){const o=e.getCanSort(),s=e.getIsSorted(),i={left:"",center:"text-center",right:"text-right"},c=()=>s==="asc"?a.jsx(Xt,{className:"h-4 w-4"}):s==="desc"?a.jsx(kn,{className:"h-4 w-4"}):a.jsx(Vr,{className:"h-4 w-4"});return o?a.jsx("div",{className:$(i[n]),children:a.jsxs(G,{variant:"ghost",className:"h-auto px-2 py-1 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>e.toggleSorting(s==="asc"),children:[t,c()]})}):a.jsx("div",{className:$("px-2 py-1",r),children:t})}const Sx=e=>new Date(e.getFullYear(),e.getMonth(),1),Cx=e=>new Date(e.getFullYear(),e.getMonth()+1,0),Nx=(e,t)=>{const n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r)),r.setDate(r.getDate()+1);return n},rs=(e,t)=>e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),St=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),os=e=>St(e,new Date),Ex=e=>{const t=new Date;return t.setDate(t.getDate()+1),St(e,t)},ss=(e,t)=>{const n=new Date(e);return n.setMonth(n.getMonth()+t),n},xr=(e,t)=>{const n=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return t==="MMMM yyyy"?`${n[e.getMonth()]} ${e.getFullYear()}`:t==="MMM d, yyyy"?`${r[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`:t==="d"?e.getDate().toString():e.toLocaleDateString()};function jx({selected:e,onSelect:t,events:n=[],holidays:r=[],className:o,...s}){const[i,c]=l.useState(new Date),[u,d]=l.useState("calendar"),p=Sx(i),f=Cx(i),h=Nx(p,f),g=["January","February","March","April","May","June","July","August","September","October","November","December"],v=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=i.getFullYear(),x=Array.from({length:20},(M,E)=>m-10+E),y=()=>{c(ss(i,-1))},b=()=>{c(ss(i,1))},C=()=>{const M=new Date(i);M.setFullYear(m-1),c(M)},w=()=>{const M=new Date(i);M.setFullYear(m+1),c(M)},T=M=>{const E=new Date(i);E.setMonth(M),c(E),d("calendar")},L=M=>{const E=new Date(i);E.setFullYear(M),c(E),d("calendar")},k=M=>n.filter(E=>St(E.date,M)),P=M=>r.some(E=>St(E.date,M));return u==="months"?a.jsxs("div",{className:$("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>d("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:C,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsx(G,{variant:"ghost",onClick:()=>d("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:m}),a.jsx(G,{variant:"outline",size:"sm",onClick:w,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Ce,{className:"h-4 w-4"})})]})]})}),a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"grid grid-cols-3 gap-2",children:g.map((M,E)=>a.jsx(G,{variant:"ghost",onClick:()=>T(E),className:$("h-11 w-full text-sm font-medium rounded transition-all duration-200",E===i.getMonth()?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:M},M))})})]}):u==="years"?a.jsxs("div",{className:$("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>d("months"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]})}),a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:x.map(M=>a.jsx(G,{variant:"ghost",onClick:()=>L(M),className:$("h-11 w-full text-sm font-medium rounded transition-all duration-200",M===m?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:M},M))})})]}):a.jsxs("div",{className:$("bg-white rounded-lg border border-gray-200 w-full",o),...s,children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:y,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsx(G,{variant:"ghost",onClick:()=>d("months"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:xr(i,"MMMM yyyy")}),a.jsx(G,{variant:"outline",size:"sm",onClick:b,className:"h-9 w-9 p-0 border-gray-200 rounded",children:a.jsx(Ce,{className:"h-4 w-4"})})]})}),a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:v.map((M,E)=>a.jsx("div",{className:"h-10 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:M})},E))}),a.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[Array.from({length:p.getDay()}).map((M,E)=>a.jsx("div",{className:"h-12"},`empty-${E}`)),h.map(M=>{const E=k(M),D=e&&St(M,e),S=os(M),F=rs(M,i),N=P(M);return a.jsx("div",{className:"relative",children:a.jsxs(G,{variant:"ghost",size:"sm",className:$("h-12 w-full p-0 text-sm relative rounded transition-all duration-200",!F&&"text-gray-300",F&&!D&&!S&&!N&&"text-gray-700 hover:bg-gray-50",N&&!D&&"text-red-600 font-medium hover:bg-red-50",S&&!D&&"bg-gray-100 text-gray-900 font-medium border border-gray-200",D&&"bg-gray-900 text-white font-medium shadow-sm"),onClick:()=>t?.(M),children:[xr(M,"d"),E.length>0&&a.jsxs("div",{className:"absolute bottom-1 left-1/2 transform -translate-x-1/2 flex space-x-0.5",children:[E.slice(0,3).map((V,_)=>{const W=A=>{if(D)return"bg-white/80";switch(A){case"class":return"bg-blue-500";case"meeting":return"bg-green-500";case"appointment":return"bg-orange-500";case"deadline":return"bg-red-500";default:return"bg-gray-500"}};return a.jsx("div",{className:$("w-1 h-1 rounded-full",W(V.type))},_)}),E.length>3&&a.jsx("div",{className:$("w-1 h-1 rounded-full",D?"bg-white/60":"bg-gray-400")})]})]})},M.toISOString())})]})]}),e&&a.jsx("div",{className:"border-t border-gray-100",children:a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:os(e)?"Today":Ex(e)?"Tomorrow":xr(e,"MMM d, yyyy")})}),(()=>{const M=n.filter(E=>St(E.date,e));return a.jsxs("div",{className:"space-y-3",children:[M.length>0&&M.map(E=>{const S=(F=>{switch(F){case"class":return{bg:"bg-blue-50",border:"border-blue-100",dot:"bg-blue-500",text:"text-blue-900",subtext:"text-blue-600"};case"meeting":return{bg:"bg-green-50",border:"border-green-100",dot:"bg-green-500",text:"text-green-900",subtext:"text-green-600"};case"appointment":return{bg:"bg-orange-50",border:"border-orange-100",dot:"bg-orange-500",text:"text-orange-900",subtext:"text-orange-600"};case"deadline":return{bg:"bg-red-50",border:"border-red-100",dot:"bg-red-500",text:"text-red-900",subtext:"text-red-600"};default:return{bg:"bg-gray-50",border:"border-gray-100",dot:"bg-gray-500",text:"text-gray-900",subtext:"text-gray-600"}}})(E.type);return a.jsxs("div",{className:`flex items-center space-x-3 p-3 ${S.bg} rounded border ${S.border} hover:shadow-sm transition-shadow cursor-pointer`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${S.dot} flex-shrink-0`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`text-sm font-medium ${S.text} truncate`,children:E.title}),(E.time||E.location)&&a.jsxs("p",{className:`text-xs ${S.subtext} truncate`,children:[E.time,E.time&&E.location&&" • ",E.location]})]})]},E.id||E.title)}),M.length===0&&a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3",children:a.jsx(Lr,{className:"w-5 h-5 text-gray-400"})}),a.jsx("p",{className:"text-sm text-gray-500",children:"No events scheduled"})]})]})})()]})}),!rs(i,new Date)&&a.jsx("div",{className:"p-6 pt-0",children:a.jsx(G,{variant:"outline",size:"sm",onClick:()=>{const M=new Date;c(M),t?.(M),d("calendar")},className:"w-full h-10 text-sm font-medium border-gray-200 hover:bg-gray-50 rounded",children:"Today"})})]})}const ic=6048e5,Px=864e5,as=Symbol.for("constructDateFrom");function be(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&as in e?e[as](t):e instanceof Date?new e.constructor(t):new Date(t)}function xe(e,t){return be(t||e,e)}function _r(e,t,n){const r=xe(e,n?.in);if(isNaN(t))return be(e,NaN);if(!t)return r;const o=r.getDate(),s=be(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return o>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),o),r)}let Rx={};function Zn(){return Rx}function Kt(e,t){const n=Zn(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=xe(e,t?.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Rn(e,t){return Kt(e,{...t,weekStartsOn:1})}function cc(e,t){const n=xe(e,t?.in),r=n.getFullYear(),o=be(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Rn(o),i=be(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const c=Rn(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function is(e){const t=xe(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 Qn(e,...t){const n=be.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Mn(e,t){const n=xe(e,t?.in);return n.setHours(0,0,0,0),n}function Mx(e,t,n){const[r,o]=Qn(n?.in,e,t),s=Mn(r),i=Mn(o),c=+s-is(s),u=+i-is(i);return Math.round((c-u)/Px)}function Dx(e,t){const n=cc(e,t),r=be(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Rn(r)}function Tx(e){return be(e,Date.now())}function Ht(e,t,n){const[r,o]=Qn(n?.in,e,t);return+Mn(r)==+Mn(o)}function kx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _x(e){return!(!kx(e)&&typeof e!="number"||isNaN(+xe(e)))}function cs(e,t){const n=xe(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Ox(e,t){const[n,r]=Qn(e,t.start,t.end);return{start:n,end:r}}function ls(e,t){const{start:n,end:r}=Ox(t?.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0);let c=1;const u=[];for(;+i<=s;)u.push(be(n,i)),i.setDate(i.getDate()+c),i.setHours(0,0,0,0);return o?u.reverse():u}function us(e,t){const n=xe(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Ax(e,t){const n=xe(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Ix={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"}},$x=(e,t,n)=>{let r;const o=Ix[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function vr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Fx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vx={date:vr({formats:Fx,defaultWidth:"full"}),time:vr({formats:Lx,defaultWidth:"full"}),dateTime:vr({formats:Wx,defaultWidth:"full"})},Bx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hx=(e,t,n,r)=>Bx[e];function Ft(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):i;o=e.formattingValues[c]||e.formattingValues[i]}else{const i=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const zx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Gx={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"]},Ux={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"]},Kx={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"}},qx={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"}},Xx=(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"},Jx={ordinalNumber:Xx,era:Ft({values:zx,defaultWidth:"wide"}),quarter:Ft({values:Yx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ft({values:Gx,defaultWidth:"wide"}),day:Ft({values:Ux,defaultWidth:"wide"}),dayPeriod:Ft({values:Kx,defaultWidth:"wide",formattingValues:qx,defaultFormattingWidth:"wide"})};function Lt(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?Qx(c,f=>f.test(i)):Zx(c,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=t.slice(i.length);return{value:d,rest:p}}}function Zx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Qx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ev(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const c=t.slice(o.length);return{value:i,rest:c}}}const tv=/^(\d+)(th|st|nd|rd)?/i,nv=/\d+/i,rv={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},ov={any:[/^b/i,/^(a|c)/i]},sv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},av={any:[/1/i,/2/i,/3/i,/4/i]},iv={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},cv={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]},lv={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},uv={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]},dv={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},fv={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}},pv={ordinalNumber:ev({matchPattern:tv,parsePattern:nv,valueCallback:e=>parseInt(e,10)}),era:Lt({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any"}),quarter:Lt({matchPatterns:sv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Lt({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:cv,defaultParseWidth:"any"}),day:Lt({matchPatterns:lv,defaultMatchWidth:"wide",parsePatterns:uv,defaultParseWidth:"any"}),dayPeriod:Lt({matchPatterns:dv,defaultMatchWidth:"any",parsePatterns:fv,defaultParseWidth:"any"})},mv={code:"en-US",formatDistance:$x,formatLong:Vx,formatRelative:Hx,localize:Jx,match:pv,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hv(e,t){const n=xe(e,t?.in);return Mx(n,Ax(n))+1}function gv(e,t){const n=xe(e,t?.in),r=+Rn(n)-+Dx(n);return Math.round(r/ic)+1}function lc(e,t){const n=xe(e,t?.in),r=n.getFullYear(),o=Zn(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=be(t?.in||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const c=Kt(i,t),u=be(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const d=Kt(u,t);return+n>=+c?r+1:+n>=+d?r:r-1}function xv(e,t){const n=Zn(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=lc(e,t),s=be(t?.in||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),Kt(s,t)}function vv(e,t){const n=xe(e,t?.in),r=+Kt(n,t)-+xv(n,t);return Math.round(r/ic)+1}function se(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ke={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return se(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):se(n+1,2)},d(e,t){return se(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];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return se(e.getHours()%12||12,t.length)},H(e,t){return se(e.getHours(),t.length)},m(e,t){return se(e.getMinutes(),t.length)},s(e,t){return se(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return se(o,t.length)}},wt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ds={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"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ke.y(e,t)},Y:function(e,t,n,r){const o=lc(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return se(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):se(s,t.length)},R:function(e,t){const n=cc(e);return se(n,t.length)},u:function(e,t){const n=e.getFullYear();return se(n,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 se(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"});case"QQQQ":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 se(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"});case"qqqq":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 Ke.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"});case"MMMM":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 se(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"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=vv(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):se(o,t.length)},I:function(e,t,n){const r=gv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):se(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ke.d(e,t)},D:function(e,t,n){const r=hv(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):se(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"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return se(s,2);case"eo":return n.ordinalNumber(s,{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"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return se(s,t.length);case"co":return n.ordinalNumber(s,{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"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return se(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"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=wt.noon:r===0?o=wt.midnight:o=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"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=wt.evening:r>=12?o=wt.afternoon:r>=4?o=wt.morning:o=wt.night,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"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ke.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ke.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):se(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):se(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ke.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ke.s(e,t)},S:function(e,t){return Ke.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ps(r);case"XXXX":case"XX":return lt(r);case"XXXXX":case"XXX":default:return lt(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ps(r);case"xxxx":case"xx":return lt(r);case"xxxxx":case"xxx":default:return lt(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fs(r,":");case"OOOO":default:return"GMT"+lt(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fs(r,":");case"zzzz":default:return"GMT"+lt(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return se(r,t.length)},T:function(e,t,n){return se(+e,t.length)}};function fs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+se(s,2)}function ps(e,t){return e%60===0?(e>0?"-":"+")+se(Math.abs(e)/60,2):lt(e,t)}function lt(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=se(Math.trunc(r/60),2),s=se(r%60,2);return n+o+t+s}const ms=(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"});case"PPPP":default:return t.date({width:"full"})}},uc=(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"});case"pppp":default:return t.time({width:"full"})}},yv=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return ms(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ms(r,t)).replace("{{time}}",uc(o,t))},bv={p:uc,P:yv},wv=/^D+$/,Sv=/^Y+$/,Cv=["D","DD","YY","YYYY"];function Nv(e){return wv.test(e)}function Ev(e){return Sv.test(e)}function jv(e,t,n){const r=Pv(e,t,n);if(console.warn(r),Cv.includes(e))throw new RangeError(r)}function Pv(e,t,n){const r=e[0]==="Y"?"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`}const Rv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dv=/^'([^]*?)'?$/,Tv=/''/g,kv=/[a-zA-Z]/;function Wt(e,t,n){const r=Zn(),o=r.locale??mv,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=xe(e,n?.in);if(!_x(c))throw new RangeError("Invalid time value");let u=t.match(Mv).map(p=>{const f=p[0];if(f==="p"||f==="P"){const h=bv[f];return h(p,o.formatLong)}return p}).join("").match(Rv).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const f=p[0];if(f==="'")return{isToken:!1,value:_v(p)};if(ds[f])return{isToken:!0,value:p};if(f.match(kv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return u.map(p=>{if(!p.isToken)return p.value;const f=p.value;(Ev(f)||Nv(f))&&jv(f,t,String(e));const h=ds[f[0]];return h(c,f,o.localize,d)}).join("")}function _v(e){const t=e.match(Dv);return t?t[1].replace(Tv,"'"):e}function hs(e,t,n){const[r,o]=Qn(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function Ov(e,t){return Ht(be(e,e),Tx(e))}function Av(e,t,n){return _r(e,-1,n)}function dc(e){const t=Iv(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(Fv);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Iv(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=Wv(o),c=Lv(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $v=Symbol("radix.slottable");function Fv(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$v}function Lv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Wv(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fc=Vv.reduce((e,t)=>{const n=dc(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),er="Popover",[pc]=Ye(er,[Tt]),cn=Tt(),[Bv,st]=pc(er),mc=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,c=cn(t),u=l.useRef(null),[d,p]=l.useState(!1),[f,h]=Qe({prop:r,defaultProp:o??!1,onChange:s,caller:er});return a.jsx(Hn,{...c,children:a.jsx(Bv,{scope:t,contentId:Ne(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:d,onCustomAnchorAdd:l.useCallback(()=>p(!0),[]),onCustomAnchorRemove:l.useCallback(()=>p(!1),[]),modal:i,children:n})})};mc.displayName=er;var hc="PopoverAnchor",gc=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=st(hc,n),s=cn(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return l.useEffect(()=>(i(),()=>c()),[i,c]),a.jsx(zn,{...s,...r,ref:t})});gc.displayName=hc;var xc="PopoverTrigger",vc=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=st(xc,n),s=cn(n),i=oe(t,o.triggerRef),c=a.jsx(fc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Cc(o.open),...r,ref:i,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:a.jsx(zn,{asChild:!0,...s,children:c})});vc.displayName=xc;var lo="PopoverPortal",[Hv,zv]=pc(lo,{forceMount:void 0}),yc=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=st(lo,t);return a.jsx(Hv,{scope:t,forceMount:n,children:a.jsx(Te,{present:n||s.open,children:a.jsx(en,{asChild:!0,container:o,children:r})})})};yc.displayName=lo;var Pt="PopoverContent",bc=l.forwardRef((e,t)=>{const n=zv(Pt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=st(Pt,e.__scopePopover);return a.jsx(Te,{present:r||s.open,children:s.modal?a.jsx(Gv,{...o,ref:t}):a.jsx(Uv,{...o,ref:t})})});bc.displayName=Pt;var Yv=dc("PopoverContent.RemoveScroll"),Gv=l.forwardRef((e,t)=>{const n=st(Pt,e.__scopePopover),r=l.useRef(null),o=oe(t,r),s=l.useRef(!1);return l.useEffect(()=>{const i=r.current;if(i)return Yn(i)},[]),a.jsx(rn,{as:Yv,allowPinchZoom:!0,children:a.jsx(wc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Uv=l.forwardRef((e,t)=>{const n=st(Pt,e.__scopePopover),r=l.useRef(!1),o=l.useRef(!1);return a.jsx(wc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),wc=l.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...f}=e,h=st(Pt,n),g=cn(n);return Fn(),a.jsx(Zt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Jt,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:a.jsx(Zr,{"data-state":Cc(h.open),role:"dialog",id:h.contentId,...g,...f,ref:t,style:{...f.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)"}})})})}),Sc="PopoverClose",Kv=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=st(Sc,n);return a.jsx(fc.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Kv.displayName=Sc;var qv="PopoverArrow",Xv=l.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cn(n);return a.jsx(Qr,{...o,...r,ref:t})});Xv.displayName=qv;function Cc(e){return e?"open":"closed"}var Jv=mc,Zv=gc,Qv=vc,ey=yc,Nc=bc;const uo=Jv,fo=Qv,ty=Zv,tr=l.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>a.jsx(ey,{children:a.jsx(Nc,{ref:o,align:t,sideOffset:n,className:$("z-50 w-auto rounded-md border border-gray-200 bg-white p-3 text-gray-950 shadow-lg 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",e),...r})}));tr.displayName=Nc.displayName;function ny({date:e,onDateChange:t,mode:n="single",dateRange:r,onDateRangeChange:o,placeholder:s="Pick a date",dateFormat:i="PPP",disabled:c=!1,className:u,variant:d="outline",size:p="default",align:f="start",showIcon:h=!0,icon:g,minDate:v,maxDate:m,disabledDates:x,isDateDisabled:y,fullWidth:b=!1,customTrigger:C,numberOfMonths:w=1,holidays:T=[]}){const[L,k]=l.useState(!1),[P,M]=l.useState(e||new Date),[E,D]=l.useState("calendar"),[S,F]=l.useState(r?.from),[N,V]=l.useState(r?.to),[_,W]=l.useState();l.useEffect(()=>{F(r?.from),V(r?.to)},[r]),l.useEffect(()=>{L&&(D("calendar"),n==="single"&&e?M(e):n==="range"&&r?.from&&M(r.from))},[L,e,r,n]);const A=B=>{if(n==="range")if(!S||S&&N)F(B),V(void 0),o?.({from:B,to:void 0});else{const re=S<B?S:B,je=S<B?B:S;F(re),V(je),o?.({from:re,to:je}),k(!1)}else t?.(B),k(!1)},O=B=>!!(x?.some(re=>re.toDateString()===B.toDateString())||v&&B<v||m&&B>m||y?.(B)),Q=B=>T.some(re=>Ht(re.date,B)),j=us(P),z=cs(P),q=ls({start:j,end:z}),X=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ce=_r(P,1),le=us(ce),I=cs(ce),Z=ls({start:le,end:I}),ae=()=>{M(Av(P))},ee=()=>{M(_r(P,1))},te=(B,re)=>Wt(B,re),R=B=>{if(S&&N)return B>=S&&B<=N;if(S&&!N&&_){const re=S<_?S:_,je=S<_?_:S;return B>=re&&B<=je}return!1},Y=B=>S&&Ht(B,S),ne=B=>N&&Ht(B,N),K=()=>{const B=new Date(P);B.setFullYear(at-1),M(B)},he=()=>{const B=new Date(P);B.setFullYear(at+1),M(B)},de=B=>{const re=new Date(P.getFullYear(),B,1);M(re),D("calendar")},ge=B=>{const re=new Date(B,P.getMonth(),1);M(re),D("calendar")},rr=["January","February","March","April","May","June","July","August","September","October","November","December"],at=P.getFullYear(),or=Array.from({length:20},(B,re)=>at-10+re),bo=C||a.jsxs(G,{variant:d,size:p,className:$("justify-start text-left font-normal",!e&&!S&&"text-gray-500",b&&"w-full",u),disabled:c,children:[h&&(g||a.jsx(Lr,{className:"mr-2 h-4 w-4"})),n==="range"?S&&N?a.jsxs("span",{children:[Wt(S,i)," - ",Wt(N,i)]}):S?a.jsxs("span",{children:[Wt(S,i)," - ..."]}):a.jsx("span",{children:s}):e?Wt(e,i):a.jsx("span",{children:s})]}),it=(B,re)=>{const je=n==="single"?e&&Ht(B,e):Y(B)||ne(B),nl=Ov(B),sr=O(B),ct=n==="range"&&R(B),rl=Q(B),wo=B.getDay(),ol=Y(B),sl=ne(B);return a.jsx("div",{className:$("relative p-0.5",ct&&"bg-gray-100",ct&&wo===0&&"rounded-l-md",ct&&wo===6&&"rounded-r-md",ct&&ol&&"rounded-l-md",ct&&sl&&"rounded-r-md"),onMouseEnter:()=>n==="range"&&S&&!N&&W(B),onMouseLeave:()=>W(void 0),children:a.jsx(G,{variant:"ghost",size:"sm",disabled:sr||c,className:$("h-10 w-full p-0 text-sm relative transition-all duration-200 rounded-md text-gray-900",!re&&"text-gray-300",rl&&!je&&"text-red-600 font-medium",nl&&!je&&!ct&&"bg-gray-50 text-gray-900 font-medium border border-gray-200",je&&"bg-gray-900 text-white font-medium shadow-sm z-10 hover:bg-gray-800",ct&&!je&&"text-gray-900 bg-gray-100",sr&&"opacity-40 cursor-not-allowed"),onClick:()=>!sr&&A(B),children:te(B,"d")})},B.toISOString())};return a.jsxs(uo,{open:L,onOpenChange:k,children:[a.jsx(fo,{asChild:!0,children:bo}),a.jsx(tr,{className:$("p-0 border-gray-200",w===2?"w-[640px]":"w-80"),align:f,side:"bottom",sideOffset:4,collisionPadding:8,children:a.jsxs("div",{className:"bg-white rounded-lg","data-takaui":"datepicker",children:[a.jsx("div",{className:"border-b border-gray-100 px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:ae,className:"h-9 w-9 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),w===2?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>D("months"),className:"h-9 px-3 font-semibold text-base",children:te(P,"MMMM")}),a.jsx("span",{className:"text-gray-400 text-sm",children:"-"}),a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>D("months"),className:"h-9 px-3 font-semibold text-base",children:te(ce,"MMMM yyyy")})]}):a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>D("months"),className:"h-9 px-4 font-semibold text-lg",children:te(P,"MMMM yyyy")}),a.jsx(G,{variant:"outline",size:"sm",onClick:ee,className:"h-9 w-9 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]})}),a.jsxs("div",{className:"p-6",children:[E==="years"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>D("months"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]}),a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:or.map(B=>a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>ge(B),className:$("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",B===at?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:B},B))})]}),E==="months"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>D("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(G,{variant:"outline",size:"sm",onClick:K,className:"h-9 w-9 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsx(G,{variant:"ghost",onClick:()=>D("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900",children:at}),a.jsx(G,{variant:"outline",size:"sm",onClick:he,className:"h-9 w-9 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:rr.map((B,re)=>a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>de(re),className:$("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",re===P.getMonth()?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:B},B))})]}),E==="calendar"&&a.jsxs("div",{className:$("flex",w===2?"gap-6":"gap-0"),children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:X.map((B,re)=>a.jsx("div",{className:"h-8 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:B})},re))}),a.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:j.getDay()}).map((B,re)=>a.jsx("div",{className:"h-10"},`empty-${re}`)),q.map(B=>it(B,hs(B,P)))]})]}),w===2&&a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:X.map((B,re)=>a.jsx("div",{className:"h-8 flex items-center justify-center",children:a.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:B})},re))}),a.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:le.getDay()}).map((B,re)=>a.jsx("div",{className:"h-10"},`next-empty-${re}`)),Z.map(B=>it(B,hs(B,ce)))]})]})]})]})]})})]})}const ry=({time:e,onTimeChange:t,timezone:n="UTC",format:r="24h",showTimezone:o=!1,minuteStep:s=1,showSeconds:i=!1,placeholder:c="Select time",variant:u="outline",size:d="default",showClockFace:p=!1})=>{const f=r==="24h",h=e?e.getHours():0,g=e?e.getMinutes():0,v=e?e.getSeconds():0,m=h>=12?"PM":"AM",[x,y]=U.useState(h),[b,C]=U.useState(g),[w,T]=U.useState(v),[L,k]=U.useState(m),[P,M]=U.useState(""),[E,D]=U.useState(""),[S,F]=U.useState(""),N=U.useRef(null),V=U.useRef(null),_=U.useRef(null),W=U.useRef(null),A=U.useRef(null),O=U.useRef(null);U.useEffect(()=>{if(e){const R=e.getHours(),Y=e.getMinutes(),ne=e.getSeconds(),K=R>=12?"PM":"AM";R!==x&&y(R),Y!==b&&C(Y),ne!==w&&T(ne),K!==L&&k(K)}},[e]),U.useEffect(()=>{W.current&&W.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),A.current&&A.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),O.current&&O.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"})},[x,b,w,f]);const Q=(R,Y,ne)=>{const K=new Date;K.setHours(R),K.setMinutes(Y),K.setSeconds(ne),t(K)},j=R=>{let Y=R;f||(L==="PM"&&R!==12?Y=R+12:L==="AM"&&R===12&&(Y=0)),y(Y),Q(Y,b,w)},z=R=>{C(R),Q(x,R,w)},q=R=>{T(R),Q(x,b,R)},X=R=>{if(L===R)return;k(R);const Y=R==="PM"?x%12+12:x%12;y(Y),Q(Y,b,w)},ce=()=>{const R=new Date;y(R.getHours()),C(R.getMinutes()),T(R.getSeconds()),k(R.getHours()>=12?"PM":"AM"),t(R)},le=()=>{if(!e)return c;const R=f?x:x%12||12,Y=b.toString().padStart(2,"0"),ne=w.toString().padStart(2,"0");let K=`${R.toString().padStart(2,"0")}:${Y}`;return i&&(K+=`:${ne}`),f||(K+=` ${L}`),o&&(K+=` ${n}`),K},I=()=>{const R=f?23:12,Y=f?0:1;return Array.from({length:R-Y+1},(ne,K)=>Y+K)},Z=()=>Array.from({length:Math.floor(60/s)},(R,Y)=>Y*s),ae=()=>Array.from({length:60},(R,Y)=>Y),ee=f?x:x%12||12,te=()=>{const he=(ee%12*30+b*.5)*(Math.PI/180)-Math.PI/2,de=b*6*(Math.PI/180)-Math.PI/2,ge=100+50*Math.cos(he),rr=100+50*Math.sin(he),at=100+70*Math.cos(de),or=100+70*Math.sin(de);return a.jsxs("svg",{width:200,height:200,className:"mx-auto",children:[a.jsx("circle",{cx:100,cy:100,r:95,fill:"white",stroke:"#e5e7eb",strokeWidth:"2"}),Array.from({length:12},(bo,it)=>{const B=it*30*(Math.PI/180)-Math.PI/2,re=100+80*Math.cos(B),je=100+80*Math.sin(B);return a.jsx("text",{x:re,y:je,textAnchor:"middle",dominantBaseline:"middle",className:"text-sm fill-gray-600",children:it===0?12:it},it)}),a.jsx("line",{x1:100,y1:100,x2:ge,y2:rr,stroke:"#374151",strokeWidth:"6",strokeLinecap:"round"}),a.jsx("line",{x1:100,y1:100,x2:at,y2:or,stroke:"#ef4444",strokeWidth:"4",strokeLinecap:"round"}),a.jsx("circle",{cx:100,cy:100,r:"6",fill:"#ef4444"})]})};return a.jsxs(uo,{children:[a.jsx(fo,{asChild:!0,children:a.jsxs(G,{variant:u,size:d,className:$("justify-start text-left font-normal",!e&&"text-muted-foreground"),children:[a.jsx(Ou,{className:"mr-2 h-4 w-4"}),le()]})}),a.jsx(tr,{className:"w-auto p-0",align:"start",children:a.jsxs("div",{className:"p-6 space-y-4 min-w-[460px]",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("input",{ref:N,type:"text",inputMode:"numeric",value:P!==""?P.padStart(2,"0"):ee.toString().padStart(2,"0"),onKeyDown:R=>{if(R.key>="0"&&R.key<="9"){R.preventDefault();const Y=P+R.key;if(Y.length===1)M(R.key);else if(Y.length===2){const ne=parseInt(Y),K=f?23:12,he=f?0:1;let de=ne;ne<he&&(de=he),ne>K&&(de=K),M(""),j(de),setTimeout(()=>V.current?.focus(),0)}}else R.key==="Backspace"?(R.preventDefault(),P.length>0&&M(P.slice(0,-1))):R.key==="ArrowRight"||R.key==="Tab"?(R.key==="ArrowRight"&&R.preventDefault(),V.current?.focus()):R.key===":"&&(R.preventDefault(),V.current?.focus())},onBlur:()=>{if(P){const R=parseInt(P),Y=f?23:12,ne=f?0:1;let K=R;R<ne&&(K=ne),R>Y&&(K=Y),j(K)}M("")},onFocus:()=>{M("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0}),a.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),a.jsx("input",{ref:V,type:"text",inputMode:"numeric",value:E!==""?E.padStart(2,"0"):b.toString().padStart(2,"0"),onKeyDown:R=>{if(R.key>="0"&&R.key<="9"){R.preventDefault();const Y=E+R.key;if(Y.length===1)D(R.key);else if(Y.length===2){const ne=parseInt(Y),K=Math.min(59,Math.max(0,ne));D(""),z(K),i&&setTimeout(()=>_.current?.focus(),0)}}else R.key==="Backspace"?(R.preventDefault(),E.length>0?D(E.slice(0,-1)):N.current?.focus()):R.key==="ArrowLeft"?(R.preventDefault(),N.current?.focus()):R.key==="ArrowRight"||R.key==="Tab"?(R.key==="ArrowRight"&&R.preventDefault(),i&&_.current?.focus()):R.key===":"&&(R.preventDefault(),i&&_.current?.focus())},onBlur:()=>{if(E){const R=parseInt(E),Y=Math.min(59,Math.max(0,R));z(Y)}D("")},onFocus:()=>{D("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0}),i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),a.jsx("input",{ref:_,type:"text",inputMode:"numeric",value:S!==""?S.padStart(2,"0"):w.toString().padStart(2,"0"),onKeyDown:R=>{if(R.key>="0"&&R.key<="9"){R.preventDefault();const Y=S+R.key;if(Y.length===1)F(R.key);else if(Y.length===2){const ne=parseInt(Y),K=Math.min(59,Math.max(0,ne));F(""),q(K)}}else R.key==="Backspace"?(R.preventDefault(),S.length>0?F(S.slice(0,-1)):V.current?.focus()):R.key==="ArrowLeft"&&(R.preventDefault(),V.current?.focus())},onBlur:()=>{if(S){const R=parseInt(S),Y=Math.min(59,Math.max(0,R));q(Y)}F("")},onFocus:()=>{F("")},className:"text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",readOnly:!0})]})]}),!f&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(G,{size:"sm",variant:L==="AM"?"default":"outline",onClick:()=>X("AM"),className:"h-8 w-12 text-xs font-medium",children:"AM"}),a.jsx(G,{size:"sm",variant:L==="PM"?"default":"outline",onClick:()=>X("PM"),className:"h-8 w-12 text-xs font-medium",children:"PM"})]})]}),o&&a.jsx("div",{className:"text-xs text-gray-500 text-center",children:n})]}),p?a.jsx("div",{className:"space-y-4",children:te()}):a.jsxs("div",{className:"flex gap-2 justify-center items-start",children:[a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Hour"}),a.jsx("div",{ref:W,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:I().map(R=>a.jsx("button",{"data-selected":ee===R,onClick:()=>j(R),className:$("w-full py-2 text-center transition-colors",ee===R?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:R.toString().padStart(2,"0")},R))})]}),a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Min"}),a.jsx("div",{ref:A,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:Z().map(R=>a.jsx("button",{"data-selected":b===R,onClick:()=>z(R),className:$("w-full py-2 text-center transition-colors",b===R?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:R.toString().padStart(2,"0")},R))})]}),i&&a.jsxs("div",{className:"flex-1 max-w-[80px]",children:[a.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Sec"}),a.jsx("div",{ref:O,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:ae().map(R=>a.jsx("button",{"data-selected":w===R,onClick:()=>q(R),className:$("w-full py-2 text-center transition-colors",w===R?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:R.toString().padStart(2,"0")},R))})]})]}),a.jsxs("div",{className:"flex gap-2 justify-between pt-2 border-t",children:[a.jsx(G,{size:"sm",variant:"outline",onClick:ce,children:"Now"}),a.jsx(G,{size:"sm",onClick:()=>t(e),children:"Done"})]})]})})]})},po=l.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$("rounded-lg border border-gray-200 bg-white text-gray-950 shadow-sm",e),...t}));po.displayName="Card";const mo=l.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$("flex flex-col space-y-1.5 p-6",e),...t}));mo.displayName="CardHeader";const ho=l.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:$("text-2xl font-semibold leading-none tracking-tight",e),...t}));ho.displayName="CardTitle";const Ec=l.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:$("text-sm text-gray-500",e),...t}));Ec.displayName="CardDescription";const go=l.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$("p-6 pt-0",e),...t}));go.displayName="CardContent";const jc=l.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:$("flex items-center p-6 pt-0",e),...t}));jc.displayName="CardFooter";var oy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sy=oy.reduce((e,t)=>{const n=ys(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ay="Label",Pc=l.forwardRef((e,t)=>a.jsx(sy.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Pc.displayName=ay;var Rc=Pc;const Se=l.forwardRef(({className:e,...t},n)=>a.jsx(Rc,{ref:n,className:$("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Se.displayName=Rc.displayName;function Mc(e){const t=iy(e),n=l.forwardRef((r,o)=>{const{children:s,...i}=r,c=l.Children.toArray(s),u=c.find(ly);if(u){const d=u.props.children,p=c.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return a.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function iy(e){const t=l.forwardRef((n,r)=>{const{children:o,...s}=n;if(l.isValidElement(o)){const i=dy(o),c=uy(s,o.props);return o.type!==l.Fragment&&(c.ref=r?ue(r,i):i),l.cloneElement(o,c)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cy=Symbol("radix.slottable");function ly(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cy}function uy(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function dy(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=fy.reduce((e,t)=>{const n=Mc(`Primitive.${t}`),r=l.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nr="Dialog",[Dc]=Ye(nr),[py,ke]=Dc(nr),Tc=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,p]=Qe({prop:r,defaultProp:o??!1,onChange:s,caller:nr});return a.jsx(py,{scope:t,triggerRef:c,contentRef:u,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(f=>!f),[p]),modal:i,children:n})};Tc.displayName=nr;var kc="DialogTrigger",my=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ke(kc,n),s=oe(t,o.triggerRef);return a.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":yo(o.open),...r,ref:s,onClick:H(e.onClick,o.onOpenToggle)})});my.displayName=kc;var xo="DialogPortal",[hy,_c]=Dc(xo,{forceMount:void 0}),Oc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=ke(xo,t);return a.jsx(hy,{scope:t,forceMount:n,children:l.Children.map(r,i=>a.jsx(Te,{present:n||s.open,children:a.jsx(en,{asChild:!0,container:o,children:i})}))})};Oc.displayName=xo;var Dn="DialogOverlay",Ac=l.forwardRef((e,t)=>{const n=_c(Dn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=ke(Dn,e.__scopeDialog);return s.modal?a.jsx(Te,{present:r||s.open,children:a.jsx(xy,{...o,ref:t})}):null});Ac.displayName=Dn;var gy=Mc("DialogOverlay.RemoveScroll"),xy=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ke(Dn,n);return a.jsx(rn,{as:gy,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(ln.div,{"data-state":yo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),gt="DialogContent",Ic=l.forwardRef((e,t)=>{const n=_c(gt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=ke(gt,e.__scopeDialog);return a.jsx(Te,{present:r||s.open,children:s.modal?a.jsx(vy,{...o,ref:t}):a.jsx(yy,{...o,ref:t})})});Ic.displayName=gt;var vy=l.forwardRef((e,t)=>{const n=ke(gt,e.__scopeDialog),r=l.useRef(null),o=oe(t,n.contentRef,r);return l.useEffect(()=>{const s=r.current;if(s)return Yn(s)},[]),a.jsx($c,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault())})}),yy=l.forwardRef((e,t)=>{const n=ke(gt,e.__scopeDialog),r=l.useRef(!1),o=l.useRef(!1);return a.jsx($c,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),$c=l.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,c=ke(gt,n),u=l.useRef(null),d=oe(t,u);return Fn(),a.jsxs(a.Fragment,{children:[a.jsx(Zt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(Jt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":yo(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(by,{titleId:c.titleId}),a.jsx(Sy,{contentRef:u,descriptionId:c.descriptionId})]})]})}),vo="DialogTitle",Fc=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ke(vo,n);return a.jsx(ln.h2,{id:o.titleId,...r,ref:t})});Fc.displayName=vo;var Lc="DialogDescription",Wc=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ke(Lc,n);return a.jsx(ln.p,{id:o.descriptionId,...r,ref:t})});Wc.displayName=Lc;var Vc="DialogClose",Bc=l.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ke(Vc,n);return a.jsx(ln.button,{type:"button",...r,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Bc.displayName=Vc;function yo(e){return e?"open":"closed"}var Hc="DialogTitleWarning",[ky,zc]=Xl(Hc,{contentName:gt,titleName:vo,docsSlug:"dialog"}),by=({titleId:e})=>{const t=zc(Hc),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
47
47
 
48
48
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
49
49
 
50
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Uy="DialogDescriptionWarning",Ky=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${al(Uy).contentName}}.`;return c.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},qy=Uc,Xy=Xc,il=Jc,cl=Zc,ll=el,ul=nl,Jy=ol;const dl=qy,Zy=Xy,fl=c.forwardRef(({className:e,...t},n)=>a.jsx(il,{ref:n,className:L("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));fl.displayName=il.displayName;const pl=c.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Zy,{children:[a.jsx(fl,{}),a.jsxs(cl,{ref:r,className:L("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 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%] rounded-lg",e),...n,children:[t,a.jsxs(Jy,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100",children:[a.jsx(pd,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pl.displayName=cl.displayName;const ml=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ml.displayName="ModalHeader";const hl=c.forwardRef(({className:e,...t},n)=>a.jsx(ll,{ref:n,className:L("text-lg font-semibold leading-none tracking-tight",e),...t}));hl.displayName=ll.displayName;const gl=c.forwardRef(({className:e,...t},n)=>a.jsx(ul,{ref:n,className:L("text-sm text-gray-500",e),...t}));gl.displayName=ul.displayName;function Qy({isOpen:e,onClose:t,title:n,description:r,children:o,className:s}){return a.jsx(dl,{open:e,onOpenChange:t,children:a.jsxs(pl,{className:s,children:[(n||r)&&a.jsxs(ml,{children:[n&&a.jsx(hl,{children:n}),r&&a.jsx(gl,{children:r})]}),o]})})}const Er=["January","February","March","April","May","June","July","August","September","October","November","December"];function xl({onWeekChange:e,initialDate:t=new Date,className:n,compact:r=!1}){const[o,s]=c.useState(t),[i,l]=c.useState(!1),[u,d]=c.useState(!1),[p,f]=c.useState(!1),[h,g]=c.useState(t.getFullYear()),[v,m]=c.useState(t.getMonth()),[x,y]=c.useState(0),w=c.useRef(null),C=c.useRef(null),S=T=>{const R=[],W=new Date(T),N=W.getDay(),V=N===0?-6:1-N;W.setDate(W.getDate()+V);for(let _=0;_<7;_++){const F=new Date(W);F.setDate(W.getDate()+_),R.push(F)}return R},D=(T,R)=>{const W=new Date(T,R,1),N=new Date(T,R+1,0),V=new Date(W);V.setDate(W.getDate()-(W.getDay()+6)%7);const _=[],F=new Date(V);for(;F<=N||F.getMonth()===R;){const M=new Date(F);if(M.setDate(F.getDate()+6),_.push({start:new Date(F),end:new Date(M)}),F.setDate(F.getDate()+7),_.length>6)break}return _},$=(T,R)=>{const W=T.toLocaleDateString("en-US",{month:"short"}),N=R.toLocaleDateString("en-US",{month:"short"});return W===N?`${W} ${T.getDate()}-${R.getDate()}`:`${W} ${T.getDate()}-${N} ${R.getDate()}`},O=S(o),b=Array.from({length:10},(T,R)=>h-5+R),P=T=>{const R=new Date(o);R.setDate(o.getDate()+(T==="next"?7:-7)),s(R),g(R.getFullYear()),m(R.getMonth()),e?.(R)},E=(T,R)=>{y(R),l(!1),s(T.start),e?.(T.start)};return c.useEffect(()=>{const T=R=>{w.current&&!w.current.contains(R.target)&&C.current&&!C.current.contains(R.target)&&(l(!1),d(!1),f(!1))};return i&&document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[i]),c.useEffect(()=>{const R=D(h,v).findIndex(W=>o>=W.start&&o<=W.end);R!==-1&&y(R)},[o,h,v]),a.jsxs("div",{className:L("flex items-center gap-3",n),children:[a.jsx(q,{variant:"outline",size:"sm",onClick:()=>P("prev"),className:L("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",r?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:a.jsx(Le,{className:L(r?"h-3 w-3":"h-4 w-4","text-gray-600")})}),a.jsxs("div",{className:"relative",children:[a.jsxs("div",{ref:C,className:L("flex items-center gap-2 bg-white rounded-lg border border-gray-200 shadow-sm cursor-pointer hover:bg-gray-50 transition-colors",r?"px-2 py-1":"px-3 py-2"),onClick:()=>l(!i),children:[a.jsx(Yr,{className:L(r?"h-3 w-3":"h-4 w-4","text-gray-500")}),a.jsx("span",{className:L(r?"text-xs":"text-sm","font-medium text-gray-700"),children:O.length>=7&&O[0]&&O[6]&&`${O[0].getDate()}-${O[6].getDate()} ${Er[O[0].getMonth()]} ${O[0].getFullYear()}`}),a.jsx(Ee,{className:L(r?"h-2 w-2":"h-3 w-3","text-gray-400 transition-transform",i&&"rotate-90")})]}),i&&a.jsxs("div",{ref:w,className:"absolute top-full right-0 mt-2 bg-white border border-gray-200 rounded-lg shadow-lg p-4 z-50 w-80 sm:w-96",children:[!u&&!p&&a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{const T=v===0?11:v-1,R=v===0?h-1:h;m(T),g(R)},className:"h-8 w-8 p-0",children:a.jsx(Le,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>d(!u),children:Er[v]}),a.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>f(!p),children:h})]}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>{const T=v===11?0:v+1,R=v===11?h+1:h;m(T),g(R)},className:"h-8 w-8 p-0",children:a.jsx(Ee,{className:"h-4 w-4"})})]}),u?a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"}),a.jsx("span",{className:"text-lg font-semibold",children:h})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:Er.map((T,R)=>a.jsx("button",{className:L("h-11 w-full text-sm font-medium rounded-xl transition-all",v===R?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{m(R),d(!1)},children:T},T))})]}):p?a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-start mb-4",children:a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>f(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"})}),a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:b.map(T=>a.jsx("button",{className:L("h-11 w-full text-sm font-medium rounded-xl transition-all",h===T?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{g(T),f(!1),d(!0)},children:T},T))})]}):a.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto",children:D(h,v).map((T,R)=>{const W=new Date>=T.start&&new Date<=T.end,N=x===R;return a.jsx("button",{className:L("w-full p-3 text-left rounded-lg border transition-all",N?"bg-blue-500 text-white border-blue-500":W?"bg-white text-blue-600 border-blue-500":"bg-white border-gray-200 text-gray-700 hover:border-blue-300"),onClick:()=>E(T,R),children:a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:L("font-medium text-sm",N?"text-white":"text-gray-800"),children:["Week ",R+1]}),a.jsx("div",{className:L("text-xs",N?"text-blue-100":"text-gray-500"),children:$(T.start,T.end)})]})},R)})}),a.jsx("div",{className:"flex gap-2 pt-3 border-t border-gray-100 mt-3",children:a.jsx(q,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>{const T=new Date;s(T),l(!1),d(!1),f(!1),e?.(T)},children:"This Week"})})]})]}),a.jsx(q,{variant:"outline",size:"sm",onClick:()=>P("next"),className:L("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",r?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:a.jsx(Ee,{className:L(r?"h-3 w-3":"h-4 w-4","text-gray-600")})})]})}const Wr={calculateWeekDates:e=>{const t=[],n=new Date(e),r=n.getDay(),o=r===0?-6:1-r;n.setDate(n.getDate()+o);for(let s=0;s<7;s++){const i=new Date(n);i.setDate(n.getDate()+s),t.push(i)}return t},formatDateDisplay:e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric"}),getWeekNumber:e=>{const t=new Date(e.getFullYear(),0,1),n=(e.getTime()-t.getTime())/864e5;return Math.ceil((n+t.getDay()+1)/7)},getWeekOfMonth:e=>{const n=new Date(e.getFullYear(),e.getMonth(),1).getDay(),r=e.getDate()+n-1;return Math.ceil(r/7)}},eb=["08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"],tb=["Monday","Tuesday","Wednesday","Thursday","Friday"],nb=[{name:"Blue",value:"bg-blue-500"},{name:"Green",value:"bg-emerald-500"},{name:"Purple",value:"bg-purple-500"},{name:"Orange",value:"bg-orange-500"},{name:"Pink",value:"bg-pink-500"}];function rb({title:e="Weekly Schedule",subtitle:t,events:n,onEventAdd:r,onEventUpdate:o,onEventDelete:s,className:i,timeSlots:l=eb,daysOfWeek:u=tb,showAddButton:d=!0,eventColors:p=nb,customFields:f=[],showWeekNavigation:h=!1,showHalfHourLines:g=!0,showCurrentTimeIndicator:v=!0,slotHeight:m=85}){const[x,y]=J.useState(!1),[w,C]=J.useState(null),[S,D]=J.useState({title:"",day:"",startTime:"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"}),[$,O]=J.useState(new Date),b=h?Wr.calculateWeekDates($):[],P=(N,V,_)=>{if(_){C(_);const F={title:_.title,day:_.day,startTime:_.startTime,endTime:_.endTime,color:_.color,description:_.description||"",recurrenceType:_.recurrenceType||"none",specificDate:_.specificDate||"",scheduleMode:_.specificDate?"date":"day"};f.forEach(M=>{const I=_[M.key];F[M.key]=I instanceof Date?I.toISOString():I||(M.type==="number"?0:"")}),D(F)}else{C(null);const F={title:"",day:N||"",startTime:V||"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"};f.forEach(M=>{F[M.key]=M.type==="number"?0:""}),D(F)}y(!0)},E=()=>{if(!S.title||!S.day||!S.startTime||!S.endTime)return;const N={...S,id:w?.id||Date.now().toString()};w?o?.(N):r?.(S),y(!1)},T=()=>{w&&(s?.(w.id),y(!1))},R=(N,V)=>n.filter(_=>{if(_.day!==N)return!1;const F=parseInt(_.startTime.replace(":","")),M=parseInt(V.replace(":",""));return F===M}),W=N=>{const[V,_]=N.startTime.split(":").map(Number),[F,M]=N.endTime.split(":").map(Number),I=V*60+_,z=(F*60+M-I)/60,K=Math.max(4,m*.1);return z*m-K};return a.jsxs(a.Fragment,{children:[a.jsxs(yo,{className:L("w-full",i),children:[a.jsx(bo,{className:"pb-6 bg-gradient-to-r from-slate-50 to-gray-50 border-b border-gray-100",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx(wo,{className:"text-2xl",children:e}),t&&a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[h&&a.jsx(xl,{onWeekChange:O,initialDate:$}),d&&a.jsxs(q,{onClick:()=>P(),className:"gap-2",children:[a.jsx(Fo,{className:"h-4 w-4"}),"Add Event"]})]})]})}),a.jsx(So,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[800px]",children:[a.jsxs("div",{className:"grid border-b border-gray-200",style:{gridTemplateColumns:`80px repeat(${u.length}, 1fr)`},children:[a.jsx("div",{className:"p-3 bg-gray-50 border-r border-gray-200",children:a.jsx("span",{className:"text-xs font-medium text-gray-500",children:"Time"})}),u.map((N,V)=>{const _=new Date,F=h&&b[V],M=F&&F.getDate()===_.getDate()&&F.getMonth()===_.getMonth()&&F.getFullYear()===_.getFullYear();return a.jsxs("div",{className:"p-4 text-center border-r border-gray-200 last:border-r-0 bg-gray-50 hover:bg-white/50 transition-colors",children:[a.jsx("div",{className:`font-semibold text-sm ${M?"text-blue-600":"text-gray-800"}`,children:N}),h&&F&&a.jsx("div",{className:`text-xs mt-1 font-medium ${M?"text-blue-600 font-bold":"text-gray-500"}`,children:Wr.formatDateDisplay(F)})]},N)})]}),l.map(N=>{const V=new Date,_=V.getHours(),F=V.getMinutes(),[M,I]=N.split(":"),re=parseInt(I||"0"),z=parseInt(M||"0")*60+re,K=z+60,X=_*60+F,le=X>=z&&X<K,Q=(X-z)/60*m;return a.jsxs("div",{className:"grid border-b border-gray-100 last:border-b-0",style:{gridTemplateColumns:`80px repeat(${u.length}, 1fr)`},children:[a.jsx("div",{className:"p-2 bg-gray-50/50 border-r border-gray-200",children:a.jsx("span",{className:"text-xs text-gray-600",children:N})}),u.map((oe,ee)=>{const te=R(oe,N),j=new Date,U=h&&b[ee],se=U?U.getDate()===j.getDate()&&U.getMonth()===j.getMonth()&&U.getFullYear()===j.getFullYear():!1;return a.jsxs("div",{className:"relative border-r border-gray-200 last:border-r-0 hover:bg-blue-50/30 cursor-pointer transition-colors",style:{minHeight:`${m}px`},onClick:()=>!te.length&&P(oe,N),children:[g&&a.jsx("div",{className:"absolute top-1/2 left-0 right-0 h-px bg-gray-200/60 z-[5]"}),te.map(Z=>{const xe=W(Z),pe=xe<40;return a.jsx("div",{className:L("absolute rounded-md text-white cursor-pointer hover:scale-[1.02] transition-transform overflow-visible",Z.color,pe?"inset-x-1 py-0.5 px-1":"inset-1 p-2"),style:{height:`${xe}px`,zIndex:10,minHeight:pe?"auto":void 0},onClick:ve=>{ve.stopPropagation(),P(void 0,void 0,Z)},children:pe?a.jsxs("div",{className:"flex items-center justify-between gap-1",children:[a.jsx("div",{className:"font-semibold truncate text-[10px] leading-tight flex-1",children:Z.title}),a.jsxs("div",{className:"text-[9px] opacity-80 whitespace-nowrap",children:[Z.startTime,"-",Z.endTime]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-xs font-semibold truncate",children:Z.title}),f.filter(ve=>ve.showInCard&&Z[ve.key]).map(ve=>a.jsxs("div",{className:"text-xs opacity-90 flex items-center gap-1 mt-1",children:[ve.icon,a.jsx("span",{className:"truncate",children:Z[ve.key]instanceof Date?Z[ve.key].toLocaleString():String(Z[ve.key]||"")})]},ve.key)),a.jsx("div",{className:"text-xs opacity-80 mt-1",children:a.jsxs("span",{children:[Z.startTime,"-",Z.endTime]})})]})},Z.id)}),v&&se&&le&&a.jsxs("div",{className:"absolute left-0 right-0 flex items-center z-20",style:{top:`${Q-8}px`},children:[a.jsx("div",{className:"h-[3px] bg-red-500 absolute -left-14 right-0"}),a.jsxs("div",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded font-bold whitespace-nowrap relative z-30 -ml-14",children:[V.getHours(),":",V.getMinutes().toString().padStart(2,"0")]})]}),!te.length&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity",children:a.jsx(Fo,{className:"h-5 w-5 text-gray-400"})})]},`${oe}-${N}`)})]},N)})]})})})]}),a.jsx(Qy,{isOpen:x,onClose:()=>y(!1),title:w?"Edit Event":"Add New Event",children:a.jsxs("div",{className:"space-y-4 p-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{className:"text-sm font-medium",children:"Schedule Type"}),a.jsxs(ft,{value:String(S.scheduleMode),onValueChange:N=>D({...S,scheduleMode:N}),children:[a.jsx(Je,{children:a.jsx(pt,{placeholder:"Select schedule type"})}),a.jsxs(Ze,{children:[a.jsx(He,{value:"day",children:"By Day (Monday, Tuesday, etc.)"}),a.jsx(He,{value:"date",children:"By Date (Specific date)"})]})]}),a.jsx("p",{className:"text-xs text-gray-500",children:S.scheduleMode==="day"?"Schedule by day of the week (e.g., every Monday)":"Schedule by specific date (e.g., January 15, 2025)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{htmlFor:"title",children:"Title *"}),a.jsx(ze,{id:"title",value:String(S.title),onChange:N=>D({...S,title:N.target.value}),placeholder:"Event title"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[S.scheduleMode==="day"?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{children:"Day *"}),a.jsxs(ft,{value:String(S.day),onValueChange:N=>D({...S,day:N}),children:[a.jsx(Je,{children:a.jsx(pt,{placeholder:"Select day"})}),a.jsx(Ze,{children:u.map(N=>a.jsx(He,{value:N,children:N},N))})]})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{htmlFor:"specificDate",children:"Date *"}),a.jsx(ze,{id:"specificDate",type:"date",value:String(S.specificDate),onChange:N=>D({...S,specificDate:N.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{htmlFor:"startTime",children:"Start Time *"}),a.jsx(ze,{id:"startTime",type:"time",value:String(S.startTime),onChange:N=>D({...S,startTime:N.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{htmlFor:"endTime",children:"End Time *"}),a.jsx(ze,{id:"endTime",type:"time",value:String(S.endTime),onChange:N=>D({...S,endTime:N.target.value})})]})]}),f.length>0&&a.jsx("div",{className:"grid grid-cols-2 gap-4",children:f.map(N=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ne,{htmlFor:N.key,children:[N.label," ",N.required&&"*"]}),N.type==="select"?a.jsxs(ft,{value:String(S[N.key]||""),onValueChange:V=>D({...S,[N.key]:V}),children:[a.jsx(Je,{children:a.jsx(pt,{placeholder:N.placeholder||`Select ${N.label}`})}),a.jsx(Ze,{children:N.options?.map(V=>a.jsx(He,{value:V.value,children:V.label},V.value))})]}):a.jsx(ze,{id:N.key,type:N.type,value:N.type==="number"?Number(S[N.key]||0):String(S[N.key]||""),onChange:V=>D({...S,[N.key]:N.type==="number"?parseInt(V.target.value)||0:V.target.value}),placeholder:N.placeholder})]},N.key))}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",id:"isRecurring",checked:S.recurrenceType!=="none",onChange:N=>{N.target.checked?D({...S,recurrenceType:S.scheduleMode==="day"?"weekly":"monthly"}):D({...S,recurrenceType:"none"})},className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"}),a.jsx(Ne,{htmlFor:"isRecurring",className:"text-sm font-medium text-gray-700 cursor-pointer",children:S.scheduleMode==="day"?"Repeat every week on this day":"Repeat every month on this date"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{children:"Color"}),a.jsxs(ft,{value:String(S.color),onValueChange:N=>D({...S,color:N}),children:[a.jsx(Je,{children:a.jsx(pt,{})}),a.jsx(Ze,{children:p.map(N=>a.jsx(He,{value:N.value,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:L("w-4 h-4 rounded",N.value)}),N.name]})},N.value))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ne,{htmlFor:"description",children:"Description"}),a.jsx(ze,{id:"description",value:String(S.description||""),onChange:N=>D({...S,description:N.target.value}),placeholder:"Optional description"})]}),a.jsxs("div",{className:"flex gap-2 pt-4",children:[w&&a.jsxs(q,{variant:"destructive",onClick:T,className:"gap-2",children:[a.jsx(dd,{className:"h-4 w-4"}),"Delete"]}),a.jsx("div",{className:"flex-1"}),a.jsx(q,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),a.jsxs(q,{onClick:E,children:[w?"Update":"Add"," Event"]})]})]})})]})}exports.Button=q;exports.Calendar=Zx;exports.Card=yo;exports.CardContent=So;exports.CardDescription=Vc;exports.CardFooter=Bc;exports.CardHeader=bo;exports.CardTitle=wo;exports.Checkbox=Fn;exports.DataGrid=zg;exports.DataGridColumnHeader=$x;exports.DataGridPagination=Ix;exports.DataGridTable=Hg;exports.DataGridTableRowSelect=Lx;exports.DataGridTableRowSelectAll=Fx;exports.DataTable=Bg;exports.DatePicker=Ry;exports.DropdownMenu=Pg;exports.DropdownMenuCheckboxItem=Og;exports.DropdownMenuContent=kg;exports.DropdownMenuGroup=Dg;exports.DropdownMenuItem=Tg;exports.DropdownMenuLabel=Ig;exports.DropdownMenuPortal=Rg;exports.DropdownMenuRadioGroup=_g;exports.DropdownMenuRadioItem=Ag;exports.DropdownMenuSeparator=$g;exports.DropdownMenuShortcut=Fg;exports.DropdownMenuSub=Lg;exports.DropdownMenuSubContent=Vg;exports.DropdownMenuSubTrigger=Wg;exports.DropdownMenuTrigger=Mg;exports.Input=ze;exports.Label=Ne;exports.Modal=dl;exports.Popover=xo;exports.PopoverAnchor=Py;exports.PopoverContent=ar;exports.PopoverTrigger=vo;exports.Schedule=rb;exports.Select=ft;exports.SelectContent=Ze;exports.SelectGroup=Ax;exports.SelectItem=He;exports.SelectLabel=yc;exports.SelectSeparator=bc;exports.SelectTrigger=Je;exports.SelectValue=pt;exports.Separator=Zs;exports.SortableHeader=Ux;exports.Table=Ln;exports.TableBody=Vn;exports.TableCaption=hd;exports.TableCell=mt;exports.TableContent=Yx;exports.TableFooter=md;exports.TableHead=Bn;exports.TableHeader=Wn;exports.TableNavigator=Gx;exports.TableRoot=Wx;exports.TableRow=$e;exports.TableWrapper=Vx;exports.TimePicker=My;exports.WeekNavigator=xl;exports.cn=L;exports.useDataGrid=At;exports.weekNavigatorUtils=Wr;
50
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wy="DialogDescriptionWarning",Sy=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zc(wy).contentName}}.`;return l.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Cy=Tc,Ny=Oc,Yc=Ac,Gc=Ic,Uc=Fc,Kc=Wc,Ey=Bc;const qc=Cy,jy=Ny,Xc=l.forwardRef(({className:e,...t},n)=>a.jsx(Yc,{ref:n,className:$("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Xc.displayName=Yc.displayName;const Jc=l.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(jy,{children:[a.jsx(Xc,{}),a.jsxs(Gc,{ref:r,className:$("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 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%] rounded-lg",e),...n,children:[t,a.jsxs(Ey,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100",children:[a.jsx(Vu,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jc.displayName=Gc.displayName;const Zc=({className:e,...t})=>a.jsx("div",{className:$("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zc.displayName="ModalHeader";const Qc=l.forwardRef(({className:e,...t},n)=>a.jsx(Uc,{ref:n,className:$("text-lg font-semibold leading-none tracking-tight",e),...t}));Qc.displayName=Uc.displayName;const el=l.forwardRef(({className:e,...t},n)=>a.jsx(Kc,{ref:n,className:$("text-sm text-gray-500",e),...t}));el.displayName=Kc.displayName;function Py({isOpen:e,onClose:t,title:n,description:r,children:o,className:s}){return a.jsx(qc,{open:e,onOpenChange:t,children:a.jsxs(Jc,{className:s,children:[(n||r)&&a.jsxs(Zc,{children:[n&&a.jsx(Qc,{children:n}),r&&a.jsx(el,{children:r})]}),o]})})}const yr=["January","February","March","April","May","June","July","August","September","October","November","December"];function tl({onWeekChange:e,initialDate:t=new Date,className:n,compact:r=!1}){const[o,s]=l.useState(t),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[p,f]=l.useState(!1),[h,g]=l.useState(t.getFullYear()),[v,m]=l.useState(t.getMonth()),[x,y]=l.useState(0),b=l.useRef(null),C=l.useRef(null),w=D=>{const S=[],F=new Date(D),N=F.getDay(),V=N===0?-6:1-N;F.setDate(F.getDate()+V);for(let _=0;_<7;_++){const W=new Date(F);W.setDate(F.getDate()+_),S.push(W)}return S},T=(D,S)=>{const F=new Date(D,S,1),N=new Date(D,S+1,0),V=new Date(F);V.setDate(F.getDate()-(F.getDay()+6)%7);const _=[],W=new Date(V);for(;W<=N||W.getMonth()===S;){const A=new Date(W);if(A.setDate(W.getDate()+6),_.push({start:new Date(W),end:new Date(A)}),W.setDate(W.getDate()+7),_.length>6)break}return _},L=(D,S)=>{const F=D.toLocaleDateString("en-US",{month:"short"}),N=S.toLocaleDateString("en-US",{month:"short"});return F===N?`${F} ${D.getDate()}-${S.getDate()}`:`${F} ${D.getDate()}-${N} ${S.getDate()}`},k=w(o),P=Array.from({length:10},(D,S)=>h-5+S),M=D=>{const S=new Date(o);S.setDate(o.getDate()+(D==="next"?7:-7)),s(S),g(S.getFullYear()),m(S.getMonth()),e?.(S)},E=(D,S)=>{y(S),c(!1),s(D.start),e?.(D.start)};return l.useEffect(()=>{const D=S=>{b.current&&!b.current.contains(S.target)&&C.current&&!C.current.contains(S.target)&&(c(!1),d(!1),f(!1))};return i&&document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[i]),l.useEffect(()=>{const S=T(h,v).findIndex(F=>o>=F.start&&o<=F.end);S!==-1&&y(S)},[o,h,v]),a.jsxs("div",{className:$("flex items-center gap-3",n),children:[a.jsx(G,{variant:"outline",size:"sm",onClick:()=>M("prev"),className:$("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",r?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:a.jsx($e,{className:$(r?"h-3 w-3":"h-4 w-4","text-gray-600")})}),a.jsxs("div",{className:"relative",children:[a.jsxs("div",{ref:C,className:$("flex items-center gap-2 bg-white rounded-lg border border-gray-200 shadow-sm cursor-pointer hover:bg-gray-50 transition-colors",r?"px-2 py-1":"px-3 py-2"),onClick:()=>c(!i),children:[a.jsx(Lr,{className:$(r?"h-3 w-3":"h-4 w-4","text-gray-500")}),a.jsx("span",{className:$(r?"text-xs":"text-sm","font-medium text-gray-700"),children:k.length>=7&&k[0]&&k[6]&&`${k[0].getDate()}-${k[6].getDate()} ${yr[k[0].getMonth()]} ${k[0].getFullYear()}`}),a.jsx(Ce,{className:$(r?"h-2 w-2":"h-3 w-3","text-gray-400 transition-transform",i&&"rotate-90")})]}),i&&a.jsxs("div",{ref:b,className:"absolute top-full right-0 mt-2 bg-white border border-gray-200 rounded-lg shadow-lg p-4 z-50 w-80 sm:w-96",children:[!u&&!p&&a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>{const D=v===0?11:v-1,S=v===0?h-1:h;m(D),g(S)},className:"h-8 w-8 p-0",children:a.jsx($e,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>d(!u),children:yr[v]}),a.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>f(!p),children:h})]}),a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>{const D=v===11?0:v+1,S=v===11?h+1:h;m(D),g(S)},className:"h-8 w-8 p-0",children:a.jsx(Ce,{className:"h-4 w-4"})})]}),u?a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>d(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"}),a.jsx("span",{className:"text-lg font-semibold",children:h})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:yr.map((D,S)=>a.jsx("button",{className:$("h-11 w-full text-sm font-medium rounded-xl transition-all",v===S?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{m(S),d(!1)},children:D},D))})]}):p?a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-start mb-4",children:a.jsx(G,{variant:"ghost",size:"sm",onClick:()=>f(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"})}),a.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:P.map(D=>a.jsx("button",{className:$("h-11 w-full text-sm font-medium rounded-xl transition-all",h===D?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{g(D),f(!1),d(!0)},children:D},D))})]}):a.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto",children:T(h,v).map((D,S)=>{const F=new Date>=D.start&&new Date<=D.end,N=x===S;return a.jsx("button",{className:$("w-full p-3 text-left rounded-lg border transition-all",N?"bg-blue-500 text-white border-blue-500":F?"bg-white text-blue-600 border-blue-500":"bg-white border-gray-200 text-gray-700 hover:border-blue-300"),onClick:()=>E(D,S),children:a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:$("font-medium text-sm",N?"text-white":"text-gray-800"),children:["Week ",S+1]}),a.jsx("div",{className:$("text-xs",N?"text-blue-100":"text-gray-500"),children:L(D.start,D.end)})]})},S)})}),a.jsx("div",{className:"flex gap-2 pt-3 border-t border-gray-100 mt-3",children:a.jsx(G,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>{const D=new Date;s(D),c(!1),d(!1),f(!1),e?.(D)},children:"This Week"})})]})]}),a.jsx(G,{variant:"outline",size:"sm",onClick:()=>M("next"),className:$("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",r?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:a.jsx(Ce,{className:$(r?"h-3 w-3":"h-4 w-4","text-gray-600")})})]})}const Or={calculateWeekDates:e=>{const t=[],n=new Date(e),r=n.getDay(),o=r===0?-6:1-r;n.setDate(n.getDate()+o);for(let s=0;s<7;s++){const i=new Date(n);i.setDate(n.getDate()+s),t.push(i)}return t},formatDateDisplay:e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric"}),getWeekNumber:e=>{const t=new Date(e.getFullYear(),0,1),n=(e.getTime()-t.getTime())/864e5;return Math.ceil((n+t.getDay()+1)/7)},getWeekOfMonth:e=>{const n=new Date(e.getFullYear(),e.getMonth(),1).getDay(),r=e.getDate()+n-1;return Math.ceil(r/7)}},Ry=["08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"],My=["Monday","Tuesday","Wednesday","Thursday","Friday"],Dy=[{name:"Blue",value:"bg-blue-500"},{name:"Green",value:"bg-emerald-500"},{name:"Purple",value:"bg-purple-500"},{name:"Orange",value:"bg-orange-500"},{name:"Pink",value:"bg-pink-500"}];function Ty({title:e="Weekly Schedule",subtitle:t,events:n,onEventAdd:r,onEventUpdate:o,onEventDelete:s,className:i,timeSlots:c=Ry,daysOfWeek:u=My,showAddButton:d=!0,eventColors:p=Dy,customFields:f=[],showWeekNavigation:h=!1,showHalfHourLines:g=!0,showCurrentTimeIndicator:v=!0,slotHeight:m=85}){const[x,y]=U.useState(!1),[b,C]=U.useState(null),[w,T]=U.useState({title:"",day:"",startTime:"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"}),[L,k]=U.useState(new Date),P=h?Or.calculateWeekDates(L):[],M=(N,V,_)=>{if(_){C(_);const W={title:_.title,day:_.day,startTime:_.startTime,endTime:_.endTime,color:_.color,description:_.description||"",recurrenceType:_.recurrenceType||"none",specificDate:_.specificDate||"",scheduleMode:_.specificDate?"date":"day"};f.forEach(A=>{const O=_[A.key];W[A.key]=O instanceof Date?O.toISOString():O||(A.type==="number"?0:"")}),T(W)}else{C(null);const W={title:"",day:N||"",startTime:V||"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"};f.forEach(A=>{W[A.key]=A.type==="number"?0:""}),T(W)}y(!0)},E=()=>{if(!w.title||!w.day||!w.startTime||!w.endTime)return;const N={...w,id:b?.id||Date.now().toString()};b?o?.(N):r?.(w),y(!1)},D=()=>{b&&(s?.(b.id),y(!1))},S=(N,V)=>n.filter(_=>{if(_.day!==N)return!1;const W=parseInt(_.startTime.replace(":","")),A=parseInt(V.replace(":",""));return W===A}),F=N=>{const[V,_]=N.startTime.split(":").map(Number),[W,A]=N.endTime.split(":").map(Number),O=V*60+_,z=(W*60+A-O)/60,q=Math.max(4,m*.1);return z*m-q};return a.jsxs(a.Fragment,{children:[a.jsxs(po,{className:$("w-full",i),children:[a.jsx(mo,{className:"pb-6 bg-gradient-to-r from-slate-50 to-gray-50 border-b border-gray-100",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx(ho,{className:"text-2xl",children:e}),t&&a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[h&&a.jsx(tl,{onWeekChange:k,initialDate:L}),d&&a.jsxs(G,{onClick:()=>M(),className:"gap-2",children:[a.jsx(Mo,{className:"h-4 w-4"}),"Add Event"]})]})]})}),a.jsx(go,{className:"p-0",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[800px]",children:[a.jsxs("div",{className:"grid border-b border-gray-200",style:{gridTemplateColumns:`80px repeat(${u.length}, 1fr)`},children:[a.jsx("div",{className:"p-3 bg-gray-50 border-r border-gray-200",children:a.jsx("span",{className:"text-xs font-medium text-gray-500",children:"Time"})}),u.map((N,V)=>{const _=new Date,W=h&&P[V],A=W&&W.getDate()===_.getDate()&&W.getMonth()===_.getMonth()&&W.getFullYear()===_.getFullYear();return a.jsxs("div",{className:"p-4 text-center border-r border-gray-200 last:border-r-0 bg-gray-50 hover:bg-white/50 transition-colors",children:[a.jsx("div",{className:`font-semibold text-sm ${A?"text-blue-600":"text-gray-800"}`,children:N}),h&&W&&a.jsx("div",{className:`text-xs mt-1 font-medium ${A?"text-blue-600 font-bold":"text-gray-500"}`,children:Or.formatDateDisplay(W)})]},N)})]}),c.map(N=>{const V=new Date,_=V.getHours(),W=V.getMinutes(),[A,O]=N.split(":"),Q=parseInt(O||"0"),z=parseInt(A||"0")*60+Q,q=z+60,X=_*60+W,ce=X>=z&&X<q,Z=(X-z)/60*m;return a.jsxs("div",{className:"grid border-b border-gray-100 last:border-b-0",style:{gridTemplateColumns:`80px repeat(${u.length}, 1fr)`},children:[a.jsx("div",{className:"p-2 bg-gray-50/50 border-r border-gray-200",children:a.jsx("span",{className:"text-xs text-gray-600",children:N})}),u.map((ae,ee)=>{const te=S(ae,N),R=new Date,Y=h&&P[ee],ne=Y?Y.getDate()===R.getDate()&&Y.getMonth()===R.getMonth()&&Y.getFullYear()===R.getFullYear():!1;return a.jsxs("div",{className:"relative border-r border-gray-200 last:border-r-0 hover:bg-blue-50/30 cursor-pointer transition-colors",style:{minHeight:`${m}px`},onClick:()=>!te.length&&M(ae,N),children:[g&&a.jsx("div",{className:"absolute top-1/2 left-0 right-0 h-px bg-gray-200/60 z-[5]"}),te.map(K=>{const he=F(K),de=he<40;return a.jsx("div",{className:$("absolute rounded-md text-white cursor-pointer hover:scale-[1.02] transition-transform overflow-visible",K.color,de?"inset-x-1 py-0.5 px-1":"inset-1 p-2"),style:{height:`${he}px`,zIndex:10,minHeight:de?"auto":void 0},onClick:ge=>{ge.stopPropagation(),M(void 0,void 0,K)},children:de?a.jsxs("div",{className:"flex items-center justify-between gap-1",children:[a.jsx("div",{className:"font-semibold truncate text-[10px] leading-tight flex-1",children:K.title}),a.jsxs("div",{className:"text-[9px] opacity-80 whitespace-nowrap",children:[K.startTime,"-",K.endTime]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-xs font-semibold truncate",children:K.title}),f.filter(ge=>ge.showInCard&&K[ge.key]).map(ge=>a.jsxs("div",{className:"text-xs opacity-90 flex items-center gap-1 mt-1",children:[ge.icon,a.jsx("span",{className:"truncate",children:K[ge.key]instanceof Date?K[ge.key].toLocaleString():String(K[ge.key]||"")})]},ge.key)),a.jsx("div",{className:"text-xs opacity-80 mt-1",children:a.jsxs("span",{children:[K.startTime,"-",K.endTime]})})]})},K.id)}),v&&ne&&ce&&a.jsxs("div",{className:"absolute left-0 right-0 flex items-center z-20",style:{top:`${Z-8}px`},children:[a.jsx("div",{className:"h-[3px] bg-red-500 absolute -left-14 right-0"}),a.jsxs("div",{className:"bg-red-500 text-white text-xs px-2 py-0.5 rounded font-bold whitespace-nowrap relative z-30 -ml-14",children:[V.getHours(),":",V.getMinutes().toString().padStart(2,"0")]})]}),!te.length&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity",children:a.jsx(Mo,{className:"h-5 w-5 text-gray-400"})})]},`${ae}-${N}`)})]},N)})]})})})]}),a.jsx(Py,{isOpen:x,onClose:()=>y(!1),title:b?"Edit Event":"Add New Event",children:a.jsxs("div",{className:"space-y-4 p-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{className:"text-sm font-medium",children:"Schedule Type"}),a.jsxs(ut,{value:String(w.scheduleMode),onValueChange:N=>T({...w,scheduleMode:N}),children:[a.jsx(Xe,{children:a.jsx(dt,{placeholder:"Select schedule type"})}),a.jsxs(Je,{children:[a.jsx(Be,{value:"day",children:"By Day (Monday, Tuesday, etc.)"}),a.jsx(Be,{value:"date",children:"By Date (Specific date)"})]})]}),a.jsx("p",{className:"text-xs text-gray-500",children:w.scheduleMode==="day"?"Schedule by day of the week (e.g., every Monday)":"Schedule by specific date (e.g., January 15, 2025)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{htmlFor:"title",children:"Title *"}),a.jsx(Ve,{id:"title",value:String(w.title),onChange:N=>T({...w,title:N.target.value}),placeholder:"Event title"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[w.scheduleMode==="day"?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{children:"Day *"}),a.jsxs(ut,{value:String(w.day),onValueChange:N=>T({...w,day:N}),children:[a.jsx(Xe,{children:a.jsx(dt,{placeholder:"Select day"})}),a.jsx(Je,{children:u.map(N=>a.jsx(Be,{value:N,children:N},N))})]})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{htmlFor:"specificDate",children:"Date *"}),a.jsx(Ve,{id:"specificDate",type:"date",value:String(w.specificDate),onChange:N=>T({...w,specificDate:N.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{htmlFor:"startTime",children:"Start Time *"}),a.jsx(Ve,{id:"startTime",type:"time",value:String(w.startTime),onChange:N=>T({...w,startTime:N.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{htmlFor:"endTime",children:"End Time *"}),a.jsx(Ve,{id:"endTime",type:"time",value:String(w.endTime),onChange:N=>T({...w,endTime:N.target.value})})]})]}),f.length>0&&a.jsx("div",{className:"grid grid-cols-2 gap-4",children:f.map(N=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Se,{htmlFor:N.key,children:[N.label," ",N.required&&"*"]}),N.type==="select"?a.jsxs(ut,{value:String(w[N.key]||""),onValueChange:V=>T({...w,[N.key]:V}),children:[a.jsx(Xe,{children:a.jsx(dt,{placeholder:N.placeholder||`Select ${N.label}`})}),a.jsx(Je,{children:N.options?.map(V=>a.jsx(Be,{value:V.value,children:V.label},V.value))})]}):a.jsx(Ve,{id:N.key,type:N.type,value:N.type==="number"?Number(w[N.key]||0):String(w[N.key]||""),onChange:V=>T({...w,[N.key]:N.type==="number"?parseInt(V.target.value)||0:V.target.value}),placeholder:N.placeholder})]},N.key))}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",id:"isRecurring",checked:w.recurrenceType!=="none",onChange:N=>{N.target.checked?T({...w,recurrenceType:w.scheduleMode==="day"?"weekly":"monthly"}):T({...w,recurrenceType:"none"})},className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"}),a.jsx(Se,{htmlFor:"isRecurring",className:"text-sm font-medium text-gray-700 cursor-pointer",children:w.scheduleMode==="day"?"Repeat every week on this day":"Repeat every month on this date"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{children:"Color"}),a.jsxs(ut,{value:String(w.color),onValueChange:N=>T({...w,color:N}),children:[a.jsx(Xe,{children:a.jsx(dt,{})}),a.jsx(Je,{children:p.map(N=>a.jsx(Be,{value:N.value,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:$("w-4 h-4 rounded",N.value)}),N.name]})},N.value))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Se,{htmlFor:"description",children:"Description"}),a.jsx(Ve,{id:"description",value:String(w.description||""),onChange:N=>T({...w,description:N.target.value}),placeholder:"Optional description"})]}),a.jsxs("div",{className:"flex gap-2 pt-4",children:[b&&a.jsxs(G,{variant:"destructive",onClick:D,className:"gap-2",children:[a.jsx(Lu,{className:"h-4 w-4"}),"Delete"]}),a.jsx("div",{className:"flex-1"}),a.jsx(G,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),a.jsxs(G,{onClick:E,children:[b?"Update":"Add"," Event"]})]})]})})]})}exports.Button=G;exports.Calendar=jx;exports.Card=po;exports.CardContent=go;exports.CardDescription=Ec;exports.CardFooter=jc;exports.CardHeader=mo;exports.CardTitle=ho;exports.Checkbox=_n;exports.DataGrid=xg;exports.DataGridColumnHeader=dx;exports.DataGridPagination=ux;exports.DataGridTable=vg;exports.DataGridTableRowSelect=px;exports.DataGridTableRowSelectAll=fx;exports.DataTable=gg;exports.DatePicker=ny;exports.DropdownMenu=tg;exports.DropdownMenuCheckboxItem=ig;exports.DropdownMenuContent=og;exports.DropdownMenuGroup=sg;exports.DropdownMenuItem=ag;exports.DropdownMenuLabel=ug;exports.DropdownMenuPortal=ng;exports.DropdownMenuRadioGroup=cg;exports.DropdownMenuRadioItem=lg;exports.DropdownMenuSeparator=dg;exports.DropdownMenuShortcut=fg;exports.DropdownMenuSub=pg;exports.DropdownMenuSubContent=hg;exports.DropdownMenuSubTrigger=mg;exports.DropdownMenuTrigger=rg;exports.Input=Ve;exports.Label=Se;exports.Modal=qc;exports.Popover=uo;exports.PopoverAnchor=ty;exports.PopoverContent=tr;exports.PopoverTrigger=fo;exports.Schedule=Ty;exports.Select=ut;exports.SelectContent=Je;exports.SelectGroup=lx;exports.SelectItem=Be;exports.SelectLabel=rc;exports.SelectSeparator=oc;exports.SelectTrigger=Xe;exports.SelectValue=dt;exports.Separator=Is;exports.SortableHeader=wx;exports.Table=On;exports.TableBody=In;exports.TableCaption=Hu;exports.TableCell=ft;exports.TableContent=yx;exports.TableFooter=Bu;exports.TableHead=$n;exports.TableHeader=An;exports.TableNavigator=bx;exports.TableRoot=mx;exports.TableRow=Ae;exports.TableWrapper=hx;exports.TimePicker=ry;exports.WeekNavigator=tl;exports.cn=$;exports.useDataGrid=kt;exports.weekNavigatorUtils=Or;