@ttianqii/takaui 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/takaui.cjs CHANGED
@@ -1,50 +1,2 @@
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
- let props = %s;
3
- <%s {...props} />
4
- React keys must be passed directly to JSX without using spread:
5
- let props = %s;
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
- overflow: hidden `).concat(r,`;
9
- padding-right: `).concat(c,"px ").concat(r,`;
10
- }
11
- body[`).concat(Et,`] {
12
- overflow: hidden `).concat(r,`;
13
- overscroll-behavior: contain;
14
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
15
- padding-left: `.concat(o,`px;
16
- padding-top: `).concat(s,`px;
17
- padding-right: `).concat(i,`px;
18
- margin-left:0;
19
- margin-top:0;
20
- margin-right: `).concat(c,"px ").concat(r,`;
21
- `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
22
- }
23
-
24
- .`).concat(vn,` {
25
- right: `).concat(c,"px ").concat(r,`;
26
- }
27
-
28
- .`).concat(yn,` {
29
- margin-right: `).concat(c,"px ").concat(r,`;
30
- }
31
-
32
- .`).concat(vn," .").concat(vn,` {
33
- right: 0 `).concat(r,`;
34
- }
35
-
36
- .`).concat(yn," .").concat(yn,` {
37
- margin-right: 0 `).concat(r,`;
38
- }
39
-
40
- body[`).concat(Et,`] {
41
- `).concat(rm,": ").concat(c,`px;
42
- }
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
- .block-interactivity-`.concat(e,` {pointer-events: none;}
45
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
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
-
48
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
49
-
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dt=require("clsx"),Ct=require("tailwind-merge"),e=require("react/jsx-runtime"),z=require("react"),Mt=require("@radix-ui/react-slot"),kt=require("@radix-ui/react-checkbox"),v=require("lucide-react"),Tt=require("@radix-ui/react-dropdown-menu"),Rt=require("@radix-ui/react-select"),Ze=require("@tanstack/react-table"),q=require("date-fns"),Pt=require("@radix-ui/react-popover"),It=require("@radix-ui/react-label"),zt=require("@radix-ui/react-dialog");function Ne(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const w=Ne(z),Le=Ne(kt),J=Ne(Tt),B=Ne(Rt),De=Ne(Pt),st=Ne(It),se=Ne(zt);function d(...t){return Ct.twMerge(Dt.clsx(t))}const y=w.forwardRef(({className:t,variant:s="default",size:a="default",asChild:i=!1,...m},b)=>{const u=i?Mt.Slot:"button";return e.jsx(u,{className:d("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",s==="default"&&"bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 active:scale-95",s==="destructive"&&"bg-red-600 text-white hover:bg-red-700 active:bg-red-800 active:scale-95",s==="outline"&&"border border-gray-300 bg-white text-gray-900 hover:bg-gray-50 active:bg-gray-100 active:scale-95",s==="secondary"&&"bg-gray-200 text-gray-900 hover:bg-gray-300 active:bg-gray-400 active:scale-95",s==="ghost"&&"bg-transparent text-gray-900 hover:bg-gray-100 active:bg-gray-200 active:scale-95",s==="link"&&"bg-transparent text-blue-600 underline-offset-4 hover:text-blue-700 hover:underline active:text-blue-800",a==="default"&&"h-9 px-4 py-2",a==="sm"&&"h-8 px-3 text-xs gap-1.5",a==="lg"&&"h-10 px-6",a==="icon"&&"h-9 w-9 p-0",a==="icon-sm"&&"h-8 w-8 p-0",a==="icon-lg"&&"h-10 w-10 p-0",t),ref:b,...m})});y.displayName="Button";const Re=w.forwardRef(({className:t,...s},a)=>e.jsx(Le.Root,{ref:a,className:d("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",t),...s,children:e.jsx(Le.Indicator,{className:d("flex items-center justify-center text-current"),children:e.jsx(v.Check,{className:"h-3.5 w-3.5 stroke-[2.5]"})})}));Re.displayName=Le.Root.displayName;const ce=w.forwardRef(({className:t,type:s,...a},i)=>e.jsx("input",{type:s,className:d("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",t),ref:i,...a}));ce.displayName="Input";const at=w.forwardRef(({className:t,orientation:s="horizontal",decorative:a=!0,...i},m)=>e.jsx("div",{ref:m,role:a?"none":"separator","aria-orientation":s,className:d("shrink-0 bg-gray-200",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...i}));at.displayName="Separator";const rt=w.createContext({variant:"default"});function Pe({className:t,variant:s="default",...a}){return e.jsx(rt.Provider,{value:{variant:s},children:e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:d("w-full caption-bottom text-sm",t),...a})})})}function Ie({className:t,...s}){return e.jsx("thead",{"data-slot":"table-header",className:d("bg-gray-50 [&_tr]:border-b [&_tr]:border-gray-200",t),...s})}function ze({className:t,...s}){return e.jsx("tbody",{"data-slot":"table-body",className:d("[&_tr:last-child]:border-b-0",t),...s})}function Ht({className:t,...s}){return e.jsx("tfoot",{"data-slot":"table-footer",className:d("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...s})}function ne({className:t,...s}){const{variant:a}=w.useContext(rt);return e.jsx("tr",{"data-slot":"table-row",className:d("hover:bg-gray-50 data-[state=selected]:bg-gray-50 transition-colors border-b border-gray-200",a==="clean"&&"border-b-0",t),...s})}function He({className:t,...s}){return e.jsx("th",{"data-slot":"table-head",className:d("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]",t),...s})}function we({className:t,...s}){return e.jsx("td",{"data-slot":"table-cell",className:d("px-3 py-2 text-left align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function Ft({className:t,...s}){return e.jsx("caption",{"data-slot":"table-caption",className:d("text-muted-foreground mt-4 text-sm",t),...s})}function At({...t}){return e.jsx(J.Root,{"data-slot":"dropdown-menu",...t})}function Et({...t}){return e.jsx(J.Portal,{"data-slot":"dropdown-menu-portal",...t})}function Ot({...t}){return e.jsx(J.Trigger,{"data-slot":"dropdown-menu-trigger",suppressHydrationWarning:!0,...t})}function $t({className:t,sideOffset:s=4,...a}){return e.jsx(J.Portal,{children:e.jsx(J.Content,{"data-slot":"dropdown-menu-content",sideOffset:s,className:d("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",t),...a})})}function Yt({...t}){return e.jsx(J.Group,{"data-slot":"dropdown-menu-group",...t})}function Lt({className:t,inset:s,variant:a="default",...i}){return e.jsx(J.Item,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":a,className:d("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",t),...i})}function _t({className:t,children:s,checked:a,...i}){return e.jsxs(J.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:d("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",t),checked:a,...i,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(J.ItemIndicator,{children:e.jsx(v.CheckIcon,{className:"size-4 text-blue-600"})})}),s]})}function Gt({...t}){return e.jsx(J.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function Wt({className:t,children:s,...a}){return e.jsxs(J.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:d("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",t),...a,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(J.ItemIndicator,{children:e.jsx(v.CircleIcon,{className:"size-2 fill-blue-600"})})}),s]})}function Vt({className:t,inset:s,...a}){return e.jsx(J.Label,{"data-slot":"dropdown-menu-label","data-inset":s,className:d("px-2 py-1.5 text-sm font-semibold text-gray-900 data-[inset]:pl-8",t),...a})}function Bt({className:t,...s}){return e.jsx(J.Separator,{"data-slot":"dropdown-menu-separator",className:d("bg-gray-100 my-1 h-px",t),...s})}function qt({className:t,...s}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:d("text-gray-500 ml-auto text-xs tracking-widest",t),...s})}function Ut({...t}){return e.jsx(J.Sub,{"data-slot":"dropdown-menu-sub",...t})}function Jt({className:t,inset:s,children:a,...i}){return e.jsxs(J.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":s,className:d("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",t),...i,children:[a,e.jsx(v.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Kt({className:t,...s}){return e.jsx(J.SubContent,{"data-slot":"dropdown-menu-sub-content",className:d("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",t),...s})}function Xt({data:t=[],columns:s,searchPlaceholder:a="Search...",onRowClick:i,className:m="",showPagination:b=!0,showSearch:u=!0,pageSize:D=10,renderToolbar:C,variant:F="default"}){const[$,f]=z.useState(1),[N]=z.useState(D),[P,I]=z.useState(""),[A,W]=z.useState(null),[L,H]=z.useState("asc"),U=z.useMemo(()=>{if(!u||!P.trim())return t;const g=P.toLowerCase();return t.filter(h=>s.some(o=>(o.accessor?o.accessor(h):h[o.key])?.toString().toLowerCase().includes(g)))},[t,P,u,s]),p=z.useMemo(()=>A?[...U].sort((g,h)=>{const o=s.find(n=>n.key===A);if(!o)return 0;const c=o.accessor?o.accessor(g):g[o.key],l=o.accessor?o.accessor(h):h[o.key];if(c===l)return 0;if(c==null)return 1;if(l==null)return-1;const T=c<l?-1:1;return L==="asc"?T:-T}):U,[U,A,L,s]),E=z.useMemo(()=>{if(!b)return p;const g=($-1)*N;return p.slice(g,g+N)},[p,$,N,b]);z.useEffect(()=>f(1),[P]);const V=g=>{A===g?H(L==="asc"?"desc":"asc"):(W(g),H("asc"))},_=(g,h,o)=>{const c=h.accessor?h.accessor(g):g[h.key];return h.cell?h.cell(c,g,o):c};return e.jsxs("div",{className:d("w-full space-y-4",m),children:[(u||C)&&e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[u&&e.jsxs("div",{className:"relative w-full sm:w-auto",children:[e.jsx(v.Search,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),e.jsx(ce,{placeholder:a,value:P,onChange:g=>I(g.target.value),className:"pl-10 w-full sm:w-[300px] bg-gray-50 border-gray-300"})]}),C&&e.jsx("div",{className:"w-full sm:w-auto",children:C()})]}),e.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(Pe,{variant:F,children:[e.jsx(Ie,{children:e.jsx(ne,{children:s.map(g=>e.jsx(He,{className:"h-10 px-0 py-0",style:{width:g.width},children:g.align==="center"||!g.align&&typeof g.header!="string"?e.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof g.header!="string"?g.header:e.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:g.header})}):e.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof g.header!="string"?e.jsx("div",{children:g.header}):g.sortable!==!1?e.jsxs(y,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>V(g.key),children:[g.header,A===g.key&&L==="desc"?e.jsx(v.ChevronDown,{className:"h-4 w-4"}):A===g.key&&L==="asc"?e.jsx(v.ChevronUp,{className:"h-4 w-4"}):e.jsx(v.ChevronsUpDown,{className:"h-4 w-4"})]}):e.jsx("span",{className:"px-3",children:g.header})})},g.key))})}),e.jsx(ze,{children:E.length===0?e.jsx(ne,{children:e.jsx(we,{colSpan:s.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):E.map((g,h)=>e.jsx(ne,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>i?.(g),children:s.map(o=>{const c=o.align==="center"||!o.align&&typeof o.header!="string";return e.jsx(we,{className:c?"px-0 py-4":"px-3 py-4",style:{width:o.width},children:c?e.jsx("div",{className:"flex items-center justify-center h-full",children:_(g,o,h)}):_(g,o,h)},o.key)})},h))})]})})}),b&&e.jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[e.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",E.length," of ",p.length," row(s)"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-gray-700",children:["Page ",$," of ",Math.ceil(p.length/N)]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>f(g=>Math.max(1,g-1)),disabled:$===1,className:"h-8 w-8 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>f(g=>Math.min(Math.ceil(p.length/N),g+1)),disabled:$===Math.ceil(p.length/N),className:"h-8 w-8 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}const nt=z.createContext(null);function Ce(){const t=z.useContext(nt);if(!t)throw new Error("useDataGrid must be used within DataGrid");return t}function Zt({columns:t,data:s,getRowId:a=u=>u.id||String(Math.random()),onRowClick:i,children:m,recordCount:b}){const[u,D]=z.useState({pageIndex:0,pageSize:5}),[C,F]=z.useState([]),[$,f]=z.useState(new Set),N=z.useMemo(()=>C.length===0?s:[...s].sort((c,l)=>{for(const T of C){const n=t.find(Y=>Y.id===T.id);if(!n?.accessorKey)continue;const k=c[n.accessorKey],S=l[n.accessorKey];if(k===S)continue;const R=k<S?-1:1;return T.desc?-R:R}return 0}),[s,C,t]),P=z.useMemo(()=>{const o=u.pageIndex*u.pageSize,c=o+u.pageSize;return N.slice(o,c)},[N,u]),I=Math.ceil(N.length/u.pageSize),A=I,W=u.pageIndex>0,L=u.pageIndex<I-1,H=()=>D(o=>({...o,pageIndex:o.pageIndex-1})),U=()=>{D(o=>({...o,pageIndex:Math.min(o.pageIndex+1,A-1)}))},p=o=>{D(()=>({pageIndex:0,pageSize:o}))},E=o=>{D(c=>({...c,pageIndex:Math.max(0,Math.min(o,A-1))}))},V=o=>{f(c=>{const l=new Set(c);return l.has(o)?l.delete(o):l.add(o),l})},_=()=>{$.size===P.length?f(new Set):f(new Set(P.map(o=>a(o))))},g=P.length>0&&$.size===P.length,h={columns:t,data:s,getRowId:a,onRowClick:i,pagination:u,setPagination:D,canPreviousPage:W,canNextPage:L,previousPage:H,nextPage:U,setPageSize:p,goToPage:E,pageCount:A,sorting:C,setSorting:F,selectedRows:$,toggleRow:V,toggleAllRows:_,isAllRowsSelected:g,paginatedData:P,sortedData:N,totalPages:I,recordCount:b??s.length};return e.jsx(nt.Provider,{value:h,children:m})}function Qt(){const{columns:t,paginatedData:s,getRowId:a,onRowClick:i}=Ce();return e.jsx("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(Pe,{children:[e.jsx(Ie,{children:e.jsx(ne,{children:t.map(m=>e.jsx(He,{className:"h-10 px-0 py-0",style:{width:m.size?`${m.size}px`:void 0},children:m.align==="center"?e.jsx("div",{className:"h-10 flex items-center justify-center",children:typeof m.header!="string"?m.header:e.jsx("span",{className:"text-xs font-normal text-gray-500 uppercase tracking-widest",children:m.header})}):e.jsx("div",{className:"h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest",children:typeof m.header!="string"?e.jsx("div",{children:m.header}):e.jsx("span",{className:"px-3",children:m.header})})},m.id))})}),e.jsx(ze,{children:s.length===0?e.jsx(ne,{children:e.jsx(we,{colSpan:t.length,className:"text-center py-8 text-gray-500",children:"No results found."})}):s.map((m,b)=>e.jsx(ne,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>i?.(m),children:t.map(u=>{const D=u.align==="center",C=u.cell?u.cell(m,b):u.accessorKey?m[u.accessorKey]:null;return e.jsx(we,{className:D?"px-0 py-4":"px-3 py-4",style:{width:u.size?`${u.size}px`:void 0},children:D?e.jsx("div",{className:"flex items-center justify-center h-full",children:C}):C},u.id)})},a(m)))})]})})})}const je=B.Root,es=B.Group,ve=B.Value,xe=w.forwardRef(({className:t,children:s,...a},i)=>e.jsxs(B.Trigger,{ref:i,className:d("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",t),...a,children:[s,e.jsx(B.Icon,{asChild:!0,children:e.jsx(v.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));xe.displayName=B.Trigger.displayName;const ot=w.forwardRef(({className:t,...s},a)=>e.jsx(B.ScrollUpButton,{ref:a,className:d("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(v.ChevronUp,{className:"h-4 w-4"})}));ot.displayName=B.ScrollUpButton.displayName;const lt=w.forwardRef(({className:t,...s},a)=>e.jsx(B.ScrollDownButton,{ref:a,className:d("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(v.ChevronDown,{className:"h-4 w-4"})}));lt.displayName=B.ScrollDownButton.displayName;const ge=w.forwardRef(({className:t,children:s,position:a="popper",...i},m)=>e.jsx(B.Portal,{children:e.jsxs(B.Content,{ref:m,className:d("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",a==="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",t),position:a,...i,children:[e.jsx(ot,{}),e.jsx(B.Viewport,{className:d("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(lt,{})]})}));ge.displayName=B.Content.displayName;const it=w.forwardRef(({className:t,...s},a)=>e.jsx(B.Label,{ref:a,className:d("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...s}));it.displayName=B.Label.displayName;const de=w.forwardRef(({className:t,children:s,...a},i)=>e.jsxs(B.Item,{ref:i,className:d("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",t),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(B.ItemIndicator,{children:e.jsx(v.Check,{className:"h-4 w-4"})})}),e.jsx(B.ItemText,{children:s})]}));de.displayName=B.Item.displayName;const ct=w.forwardRef(({className:t,...s},a)=>e.jsx(B.Separator,{ref:a,className:d("-mx-1 my-1 h-px bg-gray-100",t),...s}));ct.displayName=B.Separator.displayName;function ts({mode:t="simple",pageSizeOptions:s=[5,10,15,20]}){const{canPreviousPage:a,canNextPage:i,previousPage:m,nextPage:b,pageCount:u,pagination:D,setPageSize:C,goToPage:F}=Ce(),$=()=>{const f=D.pageIndex,N=u,P=[];if(N<=7)for(let I=0;I<N;I++)P.push(I);else if(f<=3){for(let I=0;I<=4;I++)P.push(I);P.push("..."),P.push(N-1)}else if(f>=N-4){P.push(0),P.push("...");for(let I=N-5;I<N;I++)P.push(I)}else P.push(0),P.push("..."),P.push(f-1),P.push(f),P.push(f+1),P.push("..."),P.push(N-1);return P};return t==="simple"?e.jsx("div",{className:"flex items-center justify-end px-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-gray-700 hidden sm:block",children:["Page ",D.pageIndex+1," of ",u]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:m,disabled:!a,className:"h-8 w-8 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsx(y,{variant:"outline",size:"sm",onClick:b,disabled:!i,className:"h-8 w-8 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})]})}):e.jsxs("div",{className:"flex items-center justify-between gap-3 px-2 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-gray-600 hidden sm:inline",children:"Rows per page:"}),e.jsxs(je,{value:String(D.pageSize),onValueChange:f=>C(Number(f)),children:[e.jsx(xe,{className:"h-8 w-16",children:e.jsx(ve,{})}),e.jsx(ge,{children:s.map(f=>e.jsx(de,{value:String(f),children:f},f))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:m,disabled:!a,className:"h-8 w-8 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-sm text-gray-700 sm:hidden px-2",children:[D.pageIndex+1," / ",u]}),e.jsx("div",{className:"hidden sm:flex gap-1",children:$().map((f,N)=>typeof f=="number"?e.jsx(y,{variant:D.pageIndex===f?"default":"outline",size:"sm",onClick:()=>F(f),className:"h-8 w-8 p-0",children:f+1},N):e.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-gray-400",children:f},N))}),e.jsx(y,{variant:"outline",size:"sm",onClick:b,disabled:!i,className:"h-8 w-8 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})]})}function ss({id:t,title:s}){const{sorting:a,setSorting:i}=Ce(),m=a.find(C=>C.id===t),b=!!m,u=m?.desc??!1,D=()=>{i(C=>{const F=C.find($=>$.id===t);return F?F.desc?[]:[{id:t,desc:!0}]:[{id:t,desc:!1}]})};return e.jsxs(y,{variant:"ghost",className:"h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",onClick:D,children:[s,b&&u?e.jsx(v.ChevronDown,{className:"h-4 w-4"}):b?e.jsx(v.ChevronUp,{className:"h-4 w-4"}):e.jsx(v.ChevronsUpDown,{className:"h-4 w-4"})]})}function as(){const{toggleAllRows:t,isAllRowsSelected:s}=Ce();return e.jsx(Re,{checked:s,onCheckedChange:t})}function rs({row:t}){const{selectedRows:s,toggleRow:a,getRowId:i}=Ce(),m=i(t);return e.jsx(Re,{checked:s.has(m),onCheckedChange:()=>a(m)})}const dt=w.createContext(null);function ut(){const t=w.useContext(dt);if(!t)throw new Error("useTableContext must be used within a TableRoot component");return t}function ns({table:t,totalRecords:s,children:a}){return e.jsx(dt.Provider,{value:{tableInstance:t,totalRecords:s},children:a})}function os({children:t,className:s}){return e.jsx("div",{className:d("rounded-xl border border-gray-200 bg-white overflow-hidden",s),children:t})}function ls(){const{tableInstance:t}=ut();return e.jsxs(Pe,{children:[e.jsx(Ie,{children:t.getHeaderGroups().map(s=>e.jsx(ne,{children:s.headers.map(a=>e.jsx(He,{children:a.isPlaceholder?null:Ze.flexRender(a.column.columnDef.header,a.getContext())},a.id))},s.id))}),e.jsx(ze,{children:t.getRowModel().rows?.length?t.getRowModel().rows.map(s=>e.jsx(ne,{"data-state":s.getIsSelected()&&"selected",children:s.getVisibleCells().map(a=>e.jsx(we,{children:Ze.flexRender(a.column.columnDef.cell,a.getContext())},a.id))},s.id)):e.jsx(ne,{children:e.jsx(we,{colSpan:t.getAllColumns().length,className:"h-24 text-center",children:"No results."})})})]})}function is({rowsPerPageOptions:t=[5,10,20,30,50],showPageSelector:s=!0,showRecordInfo:a=!0,showControls:i=!0}={}){const{tableInstance:m,totalRecords:b}=ut(),u=m.getState().pagination.pageIndex+1,D=m.getPageCount(),C=m.getState().pagination.pageSize,F=u===1?1:(u-1)*C+1,$=Math.min(u*C,b);return e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-3 py-4",children:[s&&e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"text-sm text-gray-700 font-medium",children:"Items per page:"}),e.jsxs(je,{value:`${C}`,onValueChange:f=>{m.setPageSize(Number(f))},children:[e.jsx(xe,{className:"h-9 w-[75px]",children:e.jsx(ve,{placeholder:C})}),e.jsx(ge,{side:"top",children:t.map(f=>e.jsx(de,{value:`${f}`,children:f},f))})]})]}),a&&e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:e.jsxs("span",{children:[F,"–",$," of ",b]})}),i&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>m.setPageIndex(0),disabled:!m.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[e.jsx("span",{className:"sr-only",children:"First page"}),e.jsx(v.ChevronsLeft,{className:"h-4 w-4"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>m.previousPage(),disabled:!m.getCanPreviousPage(),className:"h-9 w-9 p-0",children:[e.jsx("span",{className:"sr-only",children:"Previous page"}),e.jsx(v.ChevronLeft,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"flex items-center justify-center text-sm font-medium min-w-[110px]",children:["Page ",u," of ",D]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>m.nextPage(),disabled:!m.getCanNextPage(),className:"h-9 w-9 p-0",children:[e.jsx("span",{className:"sr-only",children:"Next page"}),e.jsx(v.ChevronRight,{className:"h-4 w-4"})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>m.setPageIndex(m.getPageCount()-1),disabled:!m.getCanNextPage(),className:"h-9 w-9 p-0",children:[e.jsx("span",{className:"sr-only",children:"Last page"}),e.jsx(v.ChevronsRight,{className:"h-4 w-4"})]})]})]})}function cs({column:t,title:s,align:a="left",className:i}){const m=t.getCanSort(),b=t.getIsSorted(),u={left:"",center:"text-center",right:"text-right"},D=()=>b==="asc"?e.jsx(v.ChevronDown,{className:"h-4 w-4"}):b==="desc"?e.jsx(v.ChevronUp,{className:"h-4 w-4"}):e.jsx(v.ChevronsUpDown,{className:"h-4 w-4"});return m?e.jsx("div",{className:d(u[a]),children:e.jsxs(y,{variant:"ghost",className:"h-auto px-2 py-1 font-normal hover:bg-transparent hover:text-gray-900",onClick:()=>t.toggleSorting(b==="asc"),children:[s,D()]})}):e.jsx("div",{className:d("px-2 py-1",i),children:s})}const ds=t=>new Date(t.getFullYear(),t.getMonth(),1),us=t=>new Date(t.getFullYear(),t.getMonth()+1,0),hs=(t,s)=>{const a=[],i=new Date(t);for(;i<=s;)a.push(new Date(i)),i.setDate(i.getDate()+1);return a},Qe=(t,s)=>t.getMonth()===s.getMonth()&&t.getFullYear()===s.getFullYear(),Se=(t,s)=>t.getDate()===s.getDate()&&t.getMonth()===s.getMonth()&&t.getFullYear()===s.getFullYear(),et=t=>Se(t,new Date),ms=t=>{const s=new Date;return s.setDate(s.getDate()+1),Se(t,s)},tt=(t,s)=>{const a=new Date(t);return a.setMonth(a.getMonth()+s),a},$e=(t,s)=>{const a=["January","February","March","April","May","June","July","August","September","October","November","December"],i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return s==="MMMM yyyy"?`${a[t.getMonth()]} ${t.getFullYear()}`:s==="MMM d, yyyy"?`${i[t.getMonth()]} ${t.getDate()}, ${t.getFullYear()}`:s==="d"?t.getDate().toString():t.toLocaleDateString()};function xs({selected:t,onSelect:s,events:a=[],holidays:i=[],className:m,...b}){const[u,D]=w.useState(new Date),[C,F]=w.useState("calendar"),$=ds(u),f=us(u),N=hs($,f),P=["January","February","March","April","May","June","July","August","September","October","November","December"],I=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A=u.getFullYear(),W=Array.from({length:20},(h,o)=>A-10+o),L=()=>{D(tt(u,-1))},H=()=>{D(tt(u,1))},U=()=>{const h=new Date(u);h.setFullYear(A-1),D(h)},p=()=>{const h=new Date(u);h.setFullYear(A+1),D(h)},E=h=>{const o=new Date(u);o.setMonth(h),D(o),F("calendar")},V=h=>{const o=new Date(u);o.setFullYear(h),D(o),F("calendar")},_=h=>a.filter(o=>Se(o.date,h)),g=h=>i.some(o=>Se(o.date,h));return C==="months"?e.jsxs("div",{className:d("bg-white rounded-lg border border-gray-200 w-full",m),...b,children:[e.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>F("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:U,className:"h-9 w-9 p-0 border-gray-200 rounded",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsx(y,{variant:"ghost",onClick:()=>F("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:A}),e.jsx(y,{variant:"outline",size:"sm",onClick:p,className:"h-9 w-9 p-0 border-gray-200 rounded",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-3 gap-2",children:P.map((h,o)=>e.jsx(y,{variant:"ghost",onClick:()=>E(o),className:d("h-11 w-full text-sm font-medium rounded transition-all duration-200",o===u.getMonth()?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:h},h))})})]}):C==="years"?e.jsxs("div",{className:d("bg-white rounded-lg border border-gray-200 w-full",m),...b,children:[e.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>F("months"),className:"h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",children:"← Back"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]})}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:W.map(h=>e.jsx(y,{variant:"ghost",onClick:()=>V(h),className:d("h-11 w-full text-sm font-medium rounded transition-all duration-200",h===A?"bg-gray-900 text-white hover:bg-gray-800 shadow-sm":"text-gray-600 hover:text-gray-900 hover:bg-gray-50"),children:h},h))})})]}):e.jsxs("div",{className:d("bg-white rounded-lg border border-gray-200 w-full",m),...b,children:[e.jsx("div",{className:"px-6 py-4 border-b border-gray-100",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:L,className:"h-9 w-9 p-0 border-gray-200 rounded",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsx(y,{variant:"ghost",onClick:()=>F("months"),className:"h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",children:$e(u,"MMMM yyyy")}),e.jsx(y,{variant:"outline",size:"sm",onClick:H,className:"h-9 w-9 p-0 border-gray-200 rounded",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:I.map((h,o)=>e.jsx("div",{className:"h-10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:h})},o))}),e.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[Array.from({length:$.getDay()}).map((h,o)=>e.jsx("div",{className:"h-12"},`empty-${o}`)),N.map(h=>{const o=_(h),c=t&&Se(h,t),l=et(h),T=Qe(h,u),n=g(h);return e.jsx("div",{className:"relative",children:e.jsxs(y,{variant:"ghost",size:"sm",className:d("h-12 w-full p-0 text-sm relative rounded transition-all duration-200",!T&&"text-gray-300",T&&!c&&!l&&!n&&"text-gray-700 hover:bg-gray-50",n&&!c&&"text-red-600 font-medium hover:bg-red-50",l&&!c&&"bg-gray-100 text-gray-900 font-medium border border-gray-200",c&&"bg-gray-900 text-white font-medium shadow-sm"),onClick:()=>s?.(h),children:[$e(h,"d"),o.length>0&&e.jsxs("div",{className:"absolute bottom-1 left-1/2 transform -translate-x-1/2 flex space-x-0.5",children:[o.slice(0,3).map((k,S)=>{const R=Y=>{if(c)return"bg-white/80";switch(Y){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 e.jsx("div",{className:d("w-1 h-1 rounded-full",R(k.type))},S)}),o.length>3&&e.jsx("div",{className:d("w-1 h-1 rounded-full",c?"bg-white/60":"bg-gray-400")})]})]})},h.toISOString())})]})]}),t&&e.jsx("div",{className:"border-t border-gray-100",children:e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:et(t)?"Today":ms(t)?"Tomorrow":$e(t,"MMM d, yyyy")})}),(()=>{const h=a.filter(o=>Se(o.date,t));return e.jsxs("div",{className:"space-y-3",children:[h.length>0&&h.map(o=>{const l=(T=>{switch(T){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"}}})(o.type);return e.jsxs("div",{className:`flex items-center space-x-3 p-3 ${l.bg} rounded border ${l.border} hover:shadow-sm transition-shadow cursor-pointer`,children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${l.dot} flex-shrink-0`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-sm font-medium ${l.text} truncate`,children:o.title}),(o.time||o.location)&&e.jsxs("p",{className:`text-xs ${l.subtext} truncate`,children:[o.time,o.time&&o.location&&" • ",o.location]})]})]},o.id||o.title)}),h.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx(v.Calendar,{className:"w-5 h-5 text-gray-400"})}),e.jsx("p",{className:"text-sm text-gray-500",children:"No events scheduled"})]})]})})()]})}),!Qe(u,new Date)&&e.jsx("div",{className:"p-6 pt-0",children:e.jsx(y,{variant:"outline",size:"sm",onClick:()=>{const h=new Date;D(h),s?.(h),F("calendar")},className:"w-full h-10 text-sm font-medium border-gray-200 hover:bg-gray-50 rounded",children:"Today"})})]})}const We=De.Root,Ve=De.Trigger,gs=De.Anchor,Fe=w.forwardRef(({className:t,align:s="center",sideOffset:a=4,...i},m)=>e.jsx(De.Portal,{children:e.jsx(De.Content,{ref:m,align:s,sideOffset:a,className:d("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",t),...i})}));Fe.displayName=De.Content.displayName;function ps({date:t,onDateChange:s,mode:a="single",dateRange:i,onDateRangeChange:m,placeholder:b="Pick a date",dateFormat:u="PPP",disabled:D=!1,className:C,variant:F="outline",size:$="default",align:f="start",showIcon:N=!0,icon:P,minDate:I,maxDate:A,disabledDates:W,isDateDisabled:L,fullWidth:H=!1,customTrigger:U,numberOfMonths:p=1,holidays:E=[]}){const[V,_]=w.useState(!1),[g,h]=w.useState(t||new Date),[o,c]=w.useState("calendar"),[l,T]=w.useState(i?.from),[n,k]=w.useState(i?.to),[S,R]=w.useState();w.useEffect(()=>{T(i?.from),k(i?.to)},[i]),w.useEffect(()=>{V&&(c("calendar"),a==="single"&&t?h(t):a==="range"&&i?.from&&h(i.from))},[V,t,i,a]);const Y=x=>{if(a==="range")if(!l||l&&n)T(x),k(void 0),m?.({from:x,to:void 0});else{const O=l<x?l:x,te=l<x?x:l;T(O),k(te),m?.({from:O,to:te}),_(!1)}else s?.(x),_(!1)},X=x=>!!(W?.some(O=>O.toDateString()===x.toDateString())||I&&x<I||A&&x>A||L?.(x)),oe=x=>E.some(O=>q.isSameDay(O.date,x)),ue=q.startOfMonth(g),ee=q.endOfMonth(g),le=q.eachDayOfInterval({start:ue,end:ee}),ie=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],he=q.addMonths(g,1),Me=q.startOfMonth(he),Te=q.endOfMonth(he),ke=q.eachDayOfInterval({start:Me,end:Te}),pe=()=>{h(q.subMonths(g,1))},me=()=>{h(q.addMonths(g,1))},ae=(x,O)=>q.format(x,O),r=x=>{if(l&&n)return x>=l&&x<=n;if(l&&!n&&S){const O=l<S?l:S,te=l<S?S:l;return x>=O&&x<=te}return!1},j=x=>l&&q.isSameDay(x,l),G=x=>n&&q.isSameDay(x,n),M=()=>{const x=new Date(g);x.setFullYear(fe-1),h(x)},re=()=>{const x=new Date(g);x.setFullYear(fe+1),h(x)},Z=x=>{const O=new Date(g.getFullYear(),x,1);h(O),c("calendar")},K=x=>{const O=new Date(x,g.getMonth(),1);h(O),c("calendar")},Ae=["January","February","March","April","May","June","July","August","September","October","November","December"],fe=g.getFullYear(),Ee=Array.from({length:20},(x,O)=>fe-10+O),Ke=U||e.jsxs(y,{variant:F,size:$,className:d("justify-start text-left font-normal",!t&&!l&&"text-gray-500",H&&"w-full",C),disabled:D,children:[N&&(P||e.jsx(v.Calendar,{className:"mr-2 h-4 w-4"})),a==="range"?l&&n?e.jsxs("span",{children:[q.format(l,u)," - ",q.format(n,u)]}):l?e.jsxs("span",{children:[q.format(l,u)," - ..."]}):e.jsx("span",{children:b}):t?q.format(t,u):e.jsx("span",{children:b})]}),ye=(x,O)=>{const te=a==="single"?t&&q.isSameDay(x,t):j(x)||G(x),vt=q.isToday(x),Oe=X(x),be=a==="range"&&r(x),wt=oe(x),Xe=x.getDay(),Nt=j(x),St=G(x);return e.jsx("div",{className:d("relative p-0.5",be&&"bg-gray-100",be&&Xe===0&&"rounded-l-md",be&&Xe===6&&"rounded-r-md",be&&Nt&&"rounded-l-md",be&&St&&"rounded-r-md"),onMouseEnter:()=>a==="range"&&l&&!n&&R(x),onMouseLeave:()=>R(void 0),children:e.jsx(y,{variant:"ghost",size:"sm",disabled:Oe||D,className:d("h-10 w-full p-0 text-sm relative transition-all duration-200 rounded-md text-gray-900",!O&&"text-gray-300",wt&&!te&&"text-red-600 font-medium",vt&&!te&&!be&&"bg-gray-50 text-gray-900 font-medium border border-gray-200",te&&"bg-gray-900 text-white font-medium shadow-sm z-10 hover:bg-gray-800",be&&!te&&"text-gray-900 bg-gray-100",Oe&&"opacity-40 cursor-not-allowed"),onClick:()=>!Oe&&Y(x),children:ae(x,"d")})},x.toISOString())};return e.jsxs(We,{open:V,onOpenChange:_,children:[e.jsx(Ve,{asChild:!0,children:Ke}),e.jsx(Fe,{className:d("p-0 border-gray-200",p===2?"w-[640px]":"w-80"),align:f,side:"bottom",sideOffset:4,collisionPadding:8,children:e.jsxs("div",{className:"bg-white rounded-lg","data-takaui":"datepicker",children:[e.jsx("div",{className:"border-b border-gray-100 px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:pe,className:"h-9 w-9 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),p===2?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>c("months"),className:"h-9 px-3 font-semibold text-base",children:ae(g,"MMMM")}),e.jsx("span",{className:"text-gray-400 text-sm",children:"-"}),e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>c("months"),className:"h-9 px-3 font-semibold text-base",children:ae(he,"MMMM yyyy")})]}):e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>c("months"),className:"h-9 px-4 font-semibold text-lg",children:ae(g,"MMMM yyyy")}),e.jsx(y,{variant:"outline",size:"sm",onClick:me,className:"h-9 w-9 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})}),e.jsxs("div",{className:"p-6",children:[o==="years"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>c("months"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Select Year"})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:Ee.map(x=>e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>K(x),className:d("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",x===fe?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:x},x))})]}),o==="months"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>c("calendar"),className:"h-9 px-3 text-sm font-medium text-gray-600",children:"← Back"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:M,className:"h-9 w-9 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsx(y,{variant:"ghost",onClick:()=>c("years"),className:"h-9 px-4 text-lg font-semibold text-gray-900",children:fe}),e.jsx(y,{variant:"outline",size:"sm",onClick:re,className:"h-9 w-9 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ae.map((x,O)=>e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>Z(O),className:d("h-11 w-full text-sm font-medium rounded-md transition-all duration-200",O===g.getMonth()?"bg-gray-900 text-white shadow-sm hover:bg-gray-800":"text-gray-900 bg-transparent"),children:x},x))})]}),o==="calendar"&&e.jsxs("div",{className:d("flex",p===2?"gap-6":"gap-0"),children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:ie.map((x,O)=>e.jsx("div",{className:"h-8 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:x})},O))}),e.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:ue.getDay()}).map((x,O)=>e.jsx("div",{className:"h-10"},`empty-${O}`)),le.map(x=>ye(x,q.isSameMonth(x,g)))]})]}),p===2&&e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:ie.map((x,O)=>e.jsx("div",{className:"h-8 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase",children:x})},O))}),e.jsxs("div",{className:"grid grid-cols-7",children:[Array.from({length:Me.getDay()}).map((x,O)=>e.jsx("div",{className:"h-10"},`next-empty-${O}`)),ke.map(x=>ye(x,q.isSameMonth(x,he)))]})]})]})]})]})})]})}const fs=({time:t,onTimeChange:s,timezone:a="UTC",format:i="24h",showTimezone:m=!1,minuteStep:b=1,showSeconds:u=!1,placeholder:D="Select time",variant:C="outline",size:F="default",showClockFace:$=!1})=>{const f=i==="24h",N=t?t.getHours():0,P=t?t.getMinutes():0,I=t?t.getSeconds():0,A=N>=12?"PM":"AM",[W,L]=z.useState(N),[H,U]=z.useState(P),[p,E]=z.useState(I),[V,_]=z.useState(A),[g,h]=z.useState(""),[o,c]=z.useState(""),[l,T]=z.useState(""),n=z.useRef(null),k=z.useRef(null),S=z.useRef(null),R=z.useRef(null),Y=z.useRef(null),X=z.useRef(null);z.useEffect(()=>{if(t){const r=t.getHours(),j=t.getMinutes(),G=t.getSeconds(),M=r>=12?"PM":"AM";r!==W&&L(r),j!==H&&U(j),G!==p&&E(G),M!==V&&_(M)}},[t]),z.useEffect(()=>{R.current&&R.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),Y.current&&Y.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"}),X.current&&X.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"center",behavior:"smooth"})},[W,H,p,f]);const oe=(r,j,G)=>{const M=new Date;M.setHours(r),M.setMinutes(j),M.setSeconds(G),s(M)},ue=r=>{let j=r;f||(V==="PM"&&r!==12?j=r+12:V==="AM"&&r===12&&(j=0)),L(j),oe(j,H,p)},ee=r=>{U(r),oe(W,r,p)},le=r=>{E(r),oe(W,H,r)},ie=r=>{if(V===r)return;_(r);const j=r==="PM"?W%12+12:W%12;L(j),oe(j,H,p)},he=()=>{const r=new Date;L(r.getHours()),U(r.getMinutes()),E(r.getSeconds()),_(r.getHours()>=12?"PM":"AM"),s(r)},Me=()=>{if(!t)return D;const r=f?W:W%12||12,j=H.toString().padStart(2,"0"),G=p.toString().padStart(2,"0");let M=`${r.toString().padStart(2,"0")}:${j}`;return u&&(M+=`:${G}`),f||(M+=` ${V}`),m&&(M+=` ${a}`),M},Te=()=>{const r=f?23:12,j=f?0:1;return Array.from({length:r-j+1},(G,M)=>j+M)},ke=()=>Array.from({length:Math.floor(60/b)},(r,j)=>j*b),pe=()=>Array.from({length:60},(r,j)=>j),me=f?W:W%12||12,ae=()=>{const re=(me%12*30+H*.5)*(Math.PI/180)-Math.PI/2,Z=H*6*(Math.PI/180)-Math.PI/2,K=100+50*Math.cos(re),Ae=100+50*Math.sin(re),fe=100+70*Math.cos(Z),Ee=100+70*Math.sin(Z);return e.jsxs("svg",{width:200,height:200,className:"mx-auto",children:[e.jsx("circle",{cx:100,cy:100,r:95,fill:"white",stroke:"#e5e7eb",strokeWidth:"2"}),Array.from({length:12},(Ke,ye)=>{const x=ye*30*(Math.PI/180)-Math.PI/2,O=100+80*Math.cos(x),te=100+80*Math.sin(x);return e.jsx("text",{x:O,y:te,textAnchor:"middle",dominantBaseline:"middle",className:"text-sm fill-gray-600",children:ye===0?12:ye},ye)}),e.jsx("line",{x1:100,y1:100,x2:K,y2:Ae,stroke:"#374151",strokeWidth:"6",strokeLinecap:"round"}),e.jsx("line",{x1:100,y1:100,x2:fe,y2:Ee,stroke:"#ef4444",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("circle",{cx:100,cy:100,r:"6",fill:"#ef4444"})]})};return e.jsxs(We,{children:[e.jsx(Ve,{asChild:!0,children:e.jsxs(y,{variant:C,size:F,className:d("justify-start text-left font-normal",!t&&"text-muted-foreground"),children:[e.jsx(v.Clock,{className:"mr-2 h-4 w-4"}),Me()]})}),e.jsx(Fe,{className:"w-auto p-0",align:"start",children:e.jsxs("div",{className:"p-6 space-y-4 min-w-[460px]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{ref:n,type:"text",inputMode:"numeric",value:g!==""?g.padStart(2,"0"):me.toString().padStart(2,"0"),onKeyDown:r=>{if(r.key>="0"&&r.key<="9"){r.preventDefault();const j=g+r.key;if(j.length===1)h(r.key);else if(j.length===2){const G=parseInt(j),M=f?23:12,re=f?0:1;let Z=G;G<re&&(Z=re),G>M&&(Z=M),h(""),ue(Z),setTimeout(()=>k.current?.focus(),0)}}else r.key==="Backspace"?(r.preventDefault(),g.length>0&&h(g.slice(0,-1))):r.key==="ArrowRight"||r.key==="Tab"?(r.key==="ArrowRight"&&r.preventDefault(),k.current?.focus()):r.key===":"&&(r.preventDefault(),k.current?.focus())},onBlur:()=>{if(g){const r=parseInt(g),j=f?23:12,G=f?0:1;let M=r;r<G&&(M=G),r>j&&(M=j),ue(M)}h("")},onFocus:()=>{h("")},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}),e.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),e.jsx("input",{ref:k,type:"text",inputMode:"numeric",value:o!==""?o.padStart(2,"0"):H.toString().padStart(2,"0"),onKeyDown:r=>{if(r.key>="0"&&r.key<="9"){r.preventDefault();const j=o+r.key;if(j.length===1)c(r.key);else if(j.length===2){const G=parseInt(j),M=Math.min(59,Math.max(0,G));c(""),ee(M),u&&setTimeout(()=>S.current?.focus(),0)}}else r.key==="Backspace"?(r.preventDefault(),o.length>0?c(o.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(),u&&S.current?.focus()):r.key===":"&&(r.preventDefault(),u&&S.current?.focus())},onBlur:()=>{if(o){const r=parseInt(o),j=Math.min(59,Math.max(0,r));ee(j)}c("")},onFocus:()=>{c("")},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}),u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-6xl font-medium leading-none flex items-center px-1",children:":"}),e.jsx("input",{ref:S,type:"text",inputMode:"numeric",value:l!==""?l.padStart(2,"0"):p.toString().padStart(2,"0"),onKeyDown:r=>{if(r.key>="0"&&r.key<="9"){r.preventDefault();const j=l+r.key;if(j.length===1)T(r.key);else if(j.length===2){const G=parseInt(j),M=Math.min(59,Math.max(0,G));T(""),le(M)}}else r.key==="Backspace"?(r.preventDefault(),l.length>0?T(l.slice(0,-1)):k.current?.focus()):r.key==="ArrowLeft"&&(r.preventDefault(),k.current?.focus())},onBlur:()=>{if(l){const r=parseInt(l),j=Math.min(59,Math.max(0,r));le(j)}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})]})]}),!f&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(y,{size:"sm",variant:V==="AM"?"default":"outline",onClick:()=>ie("AM"),className:"h-8 w-12 text-xs font-medium",children:"AM"}),e.jsx(y,{size:"sm",variant:V==="PM"?"default":"outline",onClick:()=>ie("PM"),className:"h-8 w-12 text-xs font-medium",children:"PM"})]})]}),m&&e.jsx("div",{className:"text-xs text-gray-500 text-center",children:a})]}),$?e.jsx("div",{className:"space-y-4",children:ae()}):e.jsxs("div",{className:"flex gap-2 justify-center items-start",children:[e.jsxs("div",{className:"flex-1 max-w-[80px]",children:[e.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Hour"}),e.jsx("div",{ref:R,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:Te().map(r=>e.jsx("button",{"data-selected":me===r,onClick:()=>ue(r),className:d("w-full py-2 text-center transition-colors",me===r?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:r.toString().padStart(2,"0")},r))})]}),e.jsxs("div",{className:"flex-1 max-w-[80px]",children:[e.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Min"}),e.jsx("div",{ref:Y,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:ke().map(r=>e.jsx("button",{"data-selected":H===r,onClick:()=>ee(r),className:d("w-full py-2 text-center transition-colors",H===r?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:r.toString().padStart(2,"0")},r))})]}),u&&e.jsxs("div",{className:"flex-1 max-w-[80px]",children:[e.jsx("div",{className:"text-xs text-center text-gray-500 mb-2",children:"Sec"}),e.jsx("div",{ref:X,className:"h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:pe().map(r=>e.jsx("button",{"data-selected":p===r,onClick:()=>le(r),className:d("w-full py-2 text-center transition-colors",p===r?"bg-blue-500 text-white font-medium":"hover:bg-gray-100 text-gray-700"),children:r.toString().padStart(2,"0")},r))})]})]}),e.jsxs("div",{className:"flex gap-2 justify-between pt-2 border-t",children:[e.jsx(y,{size:"sm",variant:"outline",onClick:he,children:"Now"}),e.jsx(y,{size:"sm",onClick:()=>s(t),children:"Done"})]})]})})]})},Be=w.forwardRef(({className:t,...s},a)=>e.jsx("div",{ref:a,className:d("rounded-lg border border-gray-200 bg-white text-gray-950 shadow-sm",t),...s}));Be.displayName="Card";const qe=w.forwardRef(({className:t,...s},a)=>e.jsx("div",{ref:a,className:d("flex flex-col space-y-1.5 p-6",t),...s}));qe.displayName="CardHeader";const Ue=w.forwardRef(({className:t,...s},a)=>e.jsx("h3",{ref:a,className:d("text-2xl font-semibold leading-none tracking-tight",t),...s}));Ue.displayName="CardTitle";const ht=w.forwardRef(({className:t,...s},a)=>e.jsx("p",{ref:a,className:d("text-sm text-gray-500",t),...s}));ht.displayName="CardDescription";const Je=w.forwardRef(({className:t,...s},a)=>e.jsx("div",{ref:a,className:d("p-6 pt-0",t),...s}));Je.displayName="CardContent";const mt=w.forwardRef(({className:t,...s},a)=>e.jsx("div",{ref:a,className:d("flex items-center p-6 pt-0",t),...s}));mt.displayName="CardFooter";const Q=w.forwardRef(({className:t,...s},a)=>e.jsx(st.Root,{ref:a,className:d("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...s}));Q.displayName=st.Root.displayName;const xt=se.Root,ys=se.Portal,gt=w.forwardRef(({className:t,...s},a)=>e.jsx(se.Overlay,{ref:a,className:d("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",t),...s}));gt.displayName=se.Overlay.displayName;const pt=w.forwardRef(({className:t,children:s,...a},i)=>e.jsxs(ys,{children:[e.jsx(gt,{}),e.jsxs(se.Content,{ref:i,className:d("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",t),...a,children:[s,e.jsxs(se.Close,{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:[e.jsx(v.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pt.displayName=se.Content.displayName;const ft=({className:t,...s})=>e.jsx("div",{className:d("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});ft.displayName="ModalHeader";const yt=w.forwardRef(({className:t,...s},a)=>e.jsx(se.Title,{ref:a,className:d("text-lg font-semibold leading-none tracking-tight",t),...s}));yt.displayName=se.Title.displayName;const bt=w.forwardRef(({className:t,...s},a)=>e.jsx(se.Description,{ref:a,className:d("text-sm text-gray-500",t),...s}));bt.displayName=se.Description.displayName;function bs({isOpen:t,onClose:s,title:a,description:i,children:m,className:b}){return e.jsx(xt,{open:t,onOpenChange:s,children:e.jsxs(pt,{className:b,children:[(a||i)&&e.jsxs(ft,{children:[a&&e.jsx(yt,{children:a}),i&&e.jsx(bt,{children:i})]}),m]})})}const Ye=["January","February","March","April","May","June","July","August","September","October","November","December"];function jt({onWeekChange:t,initialDate:s=new Date,className:a,compact:i=!1}){const[m,b]=w.useState(s),[u,D]=w.useState(!1),[C,F]=w.useState(!1),[$,f]=w.useState(!1),[N,P]=w.useState(s.getFullYear()),[I,A]=w.useState(s.getMonth()),[W,L]=w.useState(0),H=w.useRef(null),U=w.useRef(null),p=c=>{const l=[],T=new Date(c),n=T.getDay(),k=n===0?-6:1-n;T.setDate(T.getDate()+k);for(let S=0;S<7;S++){const R=new Date(T);R.setDate(T.getDate()+S),l.push(R)}return l},E=(c,l)=>{const T=new Date(c,l,1),n=new Date(c,l+1,0),k=new Date(T);k.setDate(T.getDate()-(T.getDay()+6)%7);const S=[],R=new Date(k);for(;R<=n||R.getMonth()===l;){const Y=new Date(R);if(Y.setDate(R.getDate()+6),S.push({start:new Date(R),end:new Date(Y)}),R.setDate(R.getDate()+7),S.length>6)break}return S},V=(c,l)=>{const T=c.toLocaleDateString("en-US",{month:"short"}),n=l.toLocaleDateString("en-US",{month:"short"});return T===n?`${T} ${c.getDate()}-${l.getDate()}`:`${T} ${c.getDate()}-${n} ${l.getDate()}`},_=p(m),g=Array.from({length:10},(c,l)=>N-5+l),h=c=>{const l=new Date(m);l.setDate(m.getDate()+(c==="next"?7:-7)),b(l),P(l.getFullYear()),A(l.getMonth()),t?.(l)},o=(c,l)=>{L(l),D(!1),b(c.start),t?.(c.start)};return w.useEffect(()=>{const c=l=>{H.current&&!H.current.contains(l.target)&&U.current&&!U.current.contains(l.target)&&(D(!1),F(!1),f(!1))};return u&&document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[u]),w.useEffect(()=>{const l=E(N,I).findIndex(T=>m>=T.start&&m<=T.end);l!==-1&&L(l)},[m,N,I]),e.jsxs("div",{className:d("flex items-center gap-3",a),children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>h("prev"),className:d("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",i?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:e.jsx(v.ChevronLeft,{className:d(i?"h-3 w-3":"h-4 w-4","text-gray-600")})}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{ref:U,className:d("flex items-center gap-2 bg-white rounded-lg border border-gray-200 shadow-sm cursor-pointer hover:bg-gray-50 transition-colors",i?"px-2 py-1":"px-3 py-2"),onClick:()=>D(!u),children:[e.jsx(v.Calendar,{className:d(i?"h-3 w-3":"h-4 w-4","text-gray-500")}),e.jsx("span",{className:d(i?"text-xs":"text-sm","font-medium text-gray-700"),children:_.length>=7&&_[0]&&_[6]&&`${_[0].getDate()}-${_[6].getDate()} ${Ye[_[0].getMonth()]} ${_[0].getFullYear()}`}),e.jsx(v.ChevronRight,{className:d(i?"h-2 w-2":"h-3 w-3","text-gray-400 transition-transform",u&&"rotate-90")})]}),u&&e.jsxs("div",{ref:H,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:[!C&&!$&&e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>{const c=I===0?11:I-1,l=I===0?N-1:N;A(c),P(l)},className:"h-8 w-8 p-0",children:e.jsx(v.ChevronLeft,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>F(!C),children:Ye[I]}),e.jsx("button",{className:"text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",onClick:()=>f(!$),children:N})]}),e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>{const c=I===11?0:I+1,l=I===11?N+1:N;A(c),P(l)},className:"h-8 w-8 p-0",children:e.jsx(v.ChevronRight,{className:"h-4 w-4"})})]}),C?e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>F(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"}),e.jsx("span",{className:"text-lg font-semibold",children:N})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ye.map((c,l)=>e.jsx("button",{className:d("h-11 w-full text-sm font-medium rounded-xl transition-all",I===l?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{A(l),F(!1)},children:c},c))})]}):$?e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-start mb-4",children:e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>f(!1),className:"h-9 px-3 text-sm font-medium",children:"← Back"})}),e.jsx("div",{className:"grid grid-cols-4 gap-2 max-h-64 overflow-y-auto",children:g.map(c=>e.jsx("button",{className:d("h-11 w-full text-sm font-medium rounded-xl transition-all",N===c?"bg-blue-500 text-white":"text-gray-600 hover:bg-gray-50"),onClick:()=>{P(c),f(!1),F(!0)},children:c},c))})]}):e.jsx("div",{className:"grid grid-cols-2 gap-2 max-h-64 overflow-y-auto",children:E(N,I).map((c,l)=>{const T=new Date>=c.start&&new Date<=c.end,n=W===l;return e.jsx("button",{className:d("w-full p-3 text-left rounded-lg border transition-all",n?"bg-blue-500 text-white border-blue-500":T?"bg-white text-blue-600 border-blue-500":"bg-white border-gray-200 text-gray-700 hover:border-blue-300"),onClick:()=>o(c,l),children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:d("font-medium text-sm",n?"text-white":"text-gray-800"),children:["Week ",l+1]}),e.jsx("div",{className:d("text-xs",n?"text-blue-100":"text-gray-500"),children:V(c.start,c.end)})]})},l)})}),e.jsx("div",{className:"flex gap-2 pt-3 border-t border-gray-100 mt-3",children:e.jsx(y,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>{const c=new Date;b(c),D(!1),F(!1),f(!1),t?.(c)},children:"This Week"})})]})]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>h("next"),className:d("rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",i?"h-8 w-8 p-0":"h-9 w-9 p-0"),children:e.jsx(v.ChevronRight,{className:d(i?"h-3 w-3":"h-4 w-4","text-gray-600")})})]})}const _e={calculateWeekDates:t=>{const s=[],a=new Date(t),i=a.getDay(),m=i===0?-6:1-i;a.setDate(a.getDate()+m);for(let b=0;b<7;b++){const u=new Date(a);u.setDate(a.getDate()+b),s.push(u)}return s},formatDateDisplay:t=>t.toLocaleDateString("en-US",{month:"short",day:"numeric"}),getWeekNumber:t=>{const s=new Date(t.getFullYear(),0,1),a=(t.getTime()-s.getTime())/864e5;return Math.ceil((a+s.getDay()+1)/7)},getWeekOfMonth:t=>{const a=new Date(t.getFullYear(),t.getMonth(),1).getDay(),i=t.getDate()+a-1;return Math.ceil(i/7)}},js=["08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"],vs=["Monday","Tuesday","Wednesday","Thursday","Friday"],ws=[{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 Ns({title:t="Weekly Schedule",subtitle:s,events:a,onEventAdd:i,onEventUpdate:m,onEventDelete:b,className:u,timeSlots:D=js,daysOfWeek:C=vs,showAddButton:F=!0,eventColors:$=ws,customFields:f=[],showWeekNavigation:N=!1,showHalfHourLines:P=!0,showCurrentTimeIndicator:I=!0,slotHeight:A=85}){const[W,L]=z.useState(!1),[H,U]=z.useState(null),[p,E]=z.useState({title:"",day:"",startTime:"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"}),[V,_]=z.useState(new Date),g=N?_e.calculateWeekDates(V):[],h=(n,k,S)=>{if(S){U(S);const R={title:S.title,day:S.day,startTime:S.startTime,endTime:S.endTime,color:S.color,description:S.description||"",recurrenceType:S.recurrenceType||"none",specificDate:S.specificDate||"",scheduleMode:S.specificDate?"date":"day"};f.forEach(Y=>{const X=S[Y.key];R[Y.key]=X instanceof Date?X.toISOString():X||(Y.type==="number"?0:"")}),E(R)}else{U(null);const R={title:"",day:n||"",startTime:k||"",endTime:"",color:"bg-blue-500",description:"",recurrenceType:"none",specificDate:"",scheduleMode:"day"};f.forEach(Y=>{R[Y.key]=Y.type==="number"?0:""}),E(R)}L(!0)},o=()=>{if(!p.title||!p.day||!p.startTime||!p.endTime)return;const n={...p,id:H?.id||Date.now().toString()};H?m?.(n):i?.(p),L(!1)},c=()=>{H&&(b?.(H.id),L(!1))},l=(n,k)=>a.filter(S=>{if(S.day!==n)return!1;const R=parseInt(S.startTime.replace(":","")),Y=parseInt(k.replace(":",""));return R===Y}),T=n=>{const[k,S]=n.startTime.split(":").map(Number),[R,Y]=n.endTime.split(":").map(Number),X=k*60+S,ee=(R*60+Y-X)/60,le=Math.max(4,A*.1);return ee*A-le};return e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:d("w-full",u),children:[e.jsx(qe,{className:"pb-6 bg-gradient-to-r from-slate-50 to-gray-50 border-b border-gray-100",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx(Ue,{className:"text-2xl",children:t}),s&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[N&&e.jsx(jt,{onWeekChange:_,initialDate:V}),F&&e.jsxs(y,{onClick:()=>h(),className:"gap-2",children:[e.jsx(v.Plus,{className:"h-4 w-4"}),"Add Event"]})]})]})}),e.jsx(Je,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("div",{className:"min-w-[800px]",children:[e.jsxs("div",{className:"grid border-b border-gray-200",style:{gridTemplateColumns:`80px repeat(${C.length}, 1fr)`},children:[e.jsx("div",{className:"p-3 bg-gray-50 border-r border-gray-200",children:e.jsx("span",{className:"text-xs font-medium text-gray-500",children:"Time"})}),C.map((n,k)=>{const S=new Date,R=N&&g[k],Y=R&&R.getDate()===S.getDate()&&R.getMonth()===S.getMonth()&&R.getFullYear()===S.getFullYear();return e.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:[e.jsx("div",{className:`font-semibold text-sm ${Y?"text-blue-600":"text-gray-800"}`,children:n}),N&&R&&e.jsx("div",{className:`text-xs mt-1 font-medium ${Y?"text-blue-600 font-bold":"text-gray-500"}`,children:_e.formatDateDisplay(R)})]},n)})]}),D.map(n=>{const k=new Date,S=k.getHours(),R=k.getMinutes(),[Y,X]=n.split(":"),oe=parseInt(X||"0"),ee=parseInt(Y||"0")*60+oe,le=ee+60,ie=S*60+R,he=ie>=ee&&ie<le,ke=(ie-ee)/60*A;return e.jsxs("div",{className:"grid border-b border-gray-100 last:border-b-0",style:{gridTemplateColumns:`80px repeat(${C.length}, 1fr)`},children:[e.jsx("div",{className:"p-2 bg-gray-50/50 border-r border-gray-200",children:e.jsx("span",{className:"text-xs text-gray-600",children:n})}),C.map((pe,me)=>{const ae=l(pe,n),r=new Date,j=N&&g[me],G=j?j.getDate()===r.getDate()&&j.getMonth()===r.getMonth()&&j.getFullYear()===r.getFullYear():!1;return e.jsxs("div",{className:"relative border-r border-gray-200 last:border-r-0 hover:bg-blue-50/30 cursor-pointer transition-colors",style:{minHeight:`${A}px`},onClick:()=>!ae.length&&h(pe,n),children:[P&&e.jsx("div",{className:"absolute top-1/2 left-0 right-0 h-px bg-gray-200/60 z-[5]"}),ae.map(M=>{const re=T(M),Z=re<40;return e.jsx("div",{className:d("absolute rounded-md text-white cursor-pointer hover:scale-[1.02] transition-transform overflow-visible",M.color,Z?"inset-x-1 py-0.5 px-1":"inset-1 p-2"),style:{height:`${re}px`,zIndex:10,minHeight:Z?"auto":void 0},onClick:K=>{K.stopPropagation(),h(void 0,void 0,M)},children:Z?e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("div",{className:"font-semibold truncate text-[10px] leading-tight flex-1",children:M.title}),e.jsxs("div",{className:"text-[9px] opacity-80 whitespace-nowrap",children:[M.startTime,"-",M.endTime]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs font-semibold truncate",children:M.title}),f.filter(K=>K.showInCard&&M[K.key]).map(K=>e.jsxs("div",{className:"text-xs opacity-90 flex items-center gap-1 mt-1",children:[K.icon,e.jsx("span",{className:"truncate",children:M[K.key]instanceof Date?M[K.key].toLocaleString():String(M[K.key]||"")})]},K.key)),e.jsx("div",{className:"text-xs opacity-80 mt-1",children:e.jsxs("span",{children:[M.startTime,"-",M.endTime]})})]})},M.id)}),I&&G&&he&&e.jsxs("div",{className:"absolute left-0 right-0 flex items-center z-20",style:{top:`${ke-8}px`},children:[e.jsx("div",{className:"h-[3px] bg-red-500 absolute -left-14 right-0"}),e.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:[k.getHours(),":",k.getMinutes().toString().padStart(2,"0")]})]}),!ae.length&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity",children:e.jsx(v.Plus,{className:"h-5 w-5 text-gray-400"})})]},`${pe}-${n}`)})]},n)})]})})})]}),e.jsx(bs,{isOpen:W,onClose:()=>L(!1),title:H?"Edit Event":"Add New Event",children:e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{className:"text-sm font-medium",children:"Schedule Type"}),e.jsxs(je,{value:String(p.scheduleMode),onValueChange:n=>E({...p,scheduleMode:n}),children:[e.jsx(xe,{children:e.jsx(ve,{placeholder:"Select schedule type"})}),e.jsxs(ge,{children:[e.jsx(de,{value:"day",children:"By Day (Monday, Tuesday, etc.)"}),e.jsx(de,{value:"date",children:"By Date (Specific date)"})]})]}),e.jsx("p",{className:"text-xs text-gray-500",children:p.scheduleMode==="day"?"Schedule by day of the week (e.g., every Monday)":"Schedule by specific date (e.g., January 15, 2025)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{htmlFor:"title",children:"Title *"}),e.jsx(ce,{id:"title",value:String(p.title),onChange:n=>E({...p,title:n.target.value}),placeholder:"Event title"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.scheduleMode==="day"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{children:"Day *"}),e.jsxs(je,{value:String(p.day),onValueChange:n=>E({...p,day:n}),children:[e.jsx(xe,{children:e.jsx(ve,{placeholder:"Select day"})}),e.jsx(ge,{children:C.map(n=>e.jsx(de,{value:n,children:n},n))})]})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{htmlFor:"specificDate",children:"Date *"}),e.jsx(ce,{id:"specificDate",type:"date",value:String(p.specificDate),onChange:n=>E({...p,specificDate:n.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{htmlFor:"startTime",children:"Start Time *"}),e.jsx(ce,{id:"startTime",type:"time",value:String(p.startTime),onChange:n=>E({...p,startTime:n.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{htmlFor:"endTime",children:"End Time *"}),e.jsx(ce,{id:"endTime",type:"time",value:String(p.endTime),onChange:n=>E({...p,endTime:n.target.value})})]})]}),f.length>0&&e.jsx("div",{className:"grid grid-cols-2 gap-4",children:f.map(n=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs(Q,{htmlFor:n.key,children:[n.label," ",n.required&&"*"]}),n.type==="select"?e.jsxs(je,{value:String(p[n.key]||""),onValueChange:k=>E({...p,[n.key]:k}),children:[e.jsx(xe,{children:e.jsx(ve,{placeholder:n.placeholder||`Select ${n.label}`})}),e.jsx(ge,{children:n.options?.map(k=>e.jsx(de,{value:k.value,children:k.label},k.value))})]}):e.jsx(ce,{id:n.key,type:n.type,value:n.type==="number"?Number(p[n.key]||0):String(p[n.key]||""),onChange:k=>E({...p,[n.key]:n.type==="number"?parseInt(k.target.value)||0:k.target.value}),placeholder:n.placeholder})]},n.key))}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:"isRecurring",checked:p.recurrenceType!=="none",onChange:n=>{n.target.checked?E({...p,recurrenceType:p.scheduleMode==="day"?"weekly":"monthly"}):E({...p,recurrenceType:"none"})},className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"}),e.jsx(Q,{htmlFor:"isRecurring",className:"text-sm font-medium text-gray-700 cursor-pointer",children:p.scheduleMode==="day"?"Repeat every week on this day":"Repeat every month on this date"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{children:"Color"}),e.jsxs(je,{value:String(p.color),onValueChange:n=>E({...p,color:n}),children:[e.jsx(xe,{children:e.jsx(ve,{})}),e.jsx(ge,{children:$.map(n=>e.jsx(de,{value:n.value,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-4 h-4 rounded",n.value)}),n.name]})},n.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{htmlFor:"description",children:"Description"}),e.jsx(ce,{id:"description",value:String(p.description||""),onChange:n=>E({...p,description:n.target.value}),placeholder:"Optional description"})]}),e.jsxs("div",{className:"flex gap-2 pt-4",children:[H&&e.jsxs(y,{variant:"destructive",onClick:c,className:"gap-2",children:[e.jsx(v.Trash2,{className:"h-4 w-4"}),"Delete"]}),e.jsx("div",{className:"flex-1"}),e.jsx(y,{variant:"outline",onClick:()=>L(!1),children:"Cancel"}),e.jsxs(y,{onClick:o,children:[H?"Update":"Add"," Event"]})]})]})})]})}const Ge=[{label:"UTC",offset:0},{label:"EST",offset:-5},{label:"CST",offset:-6},{label:"MST",offset:-7},{label:"PST",offset:-8},{label:"GMT",offset:0},{label:"CET",offset:1},{label:"EET",offset:2},{label:"IST",offset:5.5},{label:"CST (China)",offset:8},{label:"JST",offset:9},{label:"AEST",offset:10},{label:"NZST",offset:12},{label:"HST",offset:-10},{label:"AKST",offset:-9},{label:"Asia/Bangkok",offset:7}],Ss=(t,s,a)=>{const i=Ge.find(u=>u.label===s)?.offset||0,m=Ge.find(u=>u.label===a)?.offset||0,b=new Date(t);return b.setHours(b.getHours()+(m-i)),b},Ds=(t,s,a="24h",i=!1)=>{const m=a==="12h"?t.getHours()%12||12:t.getHours(),b=t.getMinutes().toString().padStart(2,"0"),u=t.getSeconds().toString().padStart(2,"0"),D=t.getHours()>=12?"PM":"AM";let C=`${m.toString().padStart(2,"0")}:${b}`;return i&&(C+=`:${u}`),a==="12h"&&(C+=` ${D}`),C+=` ${s}`,C};exports.Button=y;exports.Calendar=xs;exports.Card=Be;exports.CardContent=Je;exports.CardDescription=ht;exports.CardFooter=mt;exports.CardHeader=qe;exports.CardTitle=Ue;exports.Checkbox=Re;exports.DataGrid=Zt;exports.DataGridColumnHeader=ss;exports.DataGridPagination=ts;exports.DataGridTable=Qt;exports.DataGridTableRowSelect=rs;exports.DataGridTableRowSelectAll=as;exports.DataTable=Xt;exports.DatePicker=ps;exports.DropdownMenu=At;exports.DropdownMenuCheckboxItem=_t;exports.DropdownMenuContent=$t;exports.DropdownMenuGroup=Yt;exports.DropdownMenuItem=Lt;exports.DropdownMenuLabel=Vt;exports.DropdownMenuPortal=Et;exports.DropdownMenuRadioGroup=Gt;exports.DropdownMenuRadioItem=Wt;exports.DropdownMenuSeparator=Bt;exports.DropdownMenuShortcut=qt;exports.DropdownMenuSub=Ut;exports.DropdownMenuSubContent=Kt;exports.DropdownMenuSubTrigger=Jt;exports.DropdownMenuTrigger=Ot;exports.Input=ce;exports.Label=Q;exports.Modal=xt;exports.Popover=We;exports.PopoverAnchor=gs;exports.PopoverContent=Fe;exports.PopoverTrigger=Ve;exports.Schedule=Ns;exports.Select=je;exports.SelectContent=ge;exports.SelectGroup=es;exports.SelectItem=de;exports.SelectLabel=it;exports.SelectSeparator=ct;exports.SelectTrigger=xe;exports.SelectValue=ve;exports.Separator=at;exports.SortableHeader=cs;exports.TIMEZONES=Ge;exports.Table=Pe;exports.TableBody=ze;exports.TableCaption=Ft;exports.TableCell=we;exports.TableContent=ls;exports.TableFooter=Ht;exports.TableHead=He;exports.TableHeader=Ie;exports.TableNavigator=is;exports.TableRoot=ns;exports.TableRow=ne;exports.TableWrapper=os;exports.TimePicker=fs;exports.WeekNavigator=jt;exports.cn=d;exports.convertTimezone=Ss;exports.formatTimeWithTimezone=Ds;exports.useDataGrid=Ce;exports.weekNavigatorUtils=_e;
2
+ //# sourceMappingURL=takaui.cjs.map