@hotelrank/raw-grids 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),a=require("@chakra-ui/react"),Ve=require("react-dom");function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tt={exports:{}},Ye={};var vn;function Jr(){if(vn)return Ye;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var c=null;if(i!==void 0&&(c=""+i),o.key!==void 0&&(c=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:i}}return Ye.Fragment=t,Ye.jsx=n,Ye.jsxs=n,Ye}var Be={};var mn;function Zr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===A?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case S:return"Fragment";case R:return"Profiler";case _:return"StrictMode";case O:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case b:return"Portal";case k:return v.displayName||"Context";case M:return(v._context.displayName||"Context")+".Consumer";case I:var T=v.render;return v=v.displayName,v||(v=T.displayName||T.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case N:return T=v.displayName||null,T!==null?T:e(v.type)||"Memo";case H:T=v._payload,v=v._init;try{return e(v(T))}catch{}}return null}function t(v){return""+v}function n(v){try{t(v);var T=!1}catch{T=!0}if(T){T=console;var F=T.error,V=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return F.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),t(v)}}function r(v){if(v===S)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===H)return"<...>";try{var T=e(v);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var v=L.A;return v===null?null:v.getOwner()}function i(){return Error("react-stack-top-frame")}function c(v){if(P.call(v,"key")){var T=Object.getOwnPropertyDescriptor(v,"key").get;if(T&&T.isReactWarning)return!1}return v.key!==void 0}function l(v,T){function F(){C||(C=!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)",T))}F.isReactWarning=!0,Object.defineProperty(v,"key",{get:F,configurable:!0})}function u(){var v=e(this.type);return j[v]||(j[v]=!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.")),v=this.props.ref,v!==void 0?v:null}function d(v,T,F,V,q,X){var U=F.ref;return v={$$typeof:m,type:v,key:T,props:F,_owner:V},(U!==void 0?U:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:u}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function g(v,T,F,V,q,X){var U=T.children;if(U!==void 0)if(V)if(D(U)){for(V=0;V<U.length;V++)f(U[V]);Object.freeze&&Object.freeze(U)}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(U);if(P.call(T,"key")){U=e(v);var K=Object.keys(T).filter(function(W){return W!=="key"});V=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Y[U+V]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),c=require("@chakra-ui/react"),He=require("react-dom");function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rt={exports:{}},We={};var bn;function Jr(){if(bn)return We;bn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return We.Fragment=t,We.jsx=n,We.jsxs=n,We}var Ve={};var yn;function Zr(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===A?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case y:return"Fragment";case E:return"Profiler";case _:return"StrictMode";case O:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case x:return"Portal";case k:return m.displayName||"Context";case M:return(m._context.displayName||"Context")+".Consumer";case I:var T=m.render;return m=m.displayName,m||(m=T.displayName||T.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case N:return T=m.displayName||null,T!==null?T:e(m.type)||"Memo";case H:T=m._payload,m=m._init;try{return e(m(T))}catch{}}return null}function t(m){return""+m}function n(m){try{t(m);var T=!1}catch{T=!0}if(T){T=console;var z=T.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return z.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),t(m)}}function r(m){if(m===y)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===H)return"<...>";try{var T=e(m);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function o(){var m=Y.A;return m===null?null:m.getOwner()}function s(){return Error("react-stack-top-frame")}function a(m){if(L.call(m,"key")){var T=Object.getOwnPropertyDescriptor(m,"key").get;if(T&&T.isReactWarning)return!1}return m.key!==void 0}function l(m,T){function z(){D||(D=!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)",T))}z.isReactWarning=!0,Object.defineProperty(m,"key",{get:z,configurable:!0})}function u(){var m=e(this.type);return j[m]||(j[m]=!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.")),m=this.props.ref,m!==void 0?m:null}function d(m,T,z,W,q,X){var U=z.ref;return m={$$typeof:S,type:m,key:T,props:z,_owner:W},(U!==void 0?U:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:u}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function p(m,T,z,W,q,X){var U=T.children;if(U!==void 0)if(W)if(C(U)){for(W=0;W<U.length;W++)g(U[W]);Object.freeze&&Object.freeze(U)}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 g(U);if(L.call(T,"key")){U=e(m);var K=Object.keys(T).filter(function(V){return V!=="key"});W=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",F[U+W]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,V,U,K,U),Y[U+V]=!0)}if(U=null,F!==void 0&&(n(F),U=""+F),c(T)&&(n(T.key),U=""+T.key),"key"in T){F={};for(var J in T)J!=="key"&&(F[J]=T[J])}else F=T;return U&&l(F,typeof v=="function"?v.displayName||v.name||"Unknown":v),d(v,U,F,o(),q,X)}function f(v){x(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===H&&(v._payload.status==="fulfilled"?x(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function x(v){return typeof v=="object"&&v!==null&&v.$$typeof===m}var p=h,m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),k=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),L=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,D=Array.isArray,w=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(v){return v()}};var C,j={},E=p.react_stack_bottom_frame.bind(p,i)(),z=w(r(i)),Y={};Be.Fragment=S,Be.jsx=function(v,T,F){var V=1e4>L.recentlyCreatedOwnerStacks++;return g(v,T,F,!1,V?Error("react-stack-top-frame"):E,V?w(r(v)):z)},Be.jsxs=function(v,T,F){var V=1e4>L.recentlyCreatedOwnerStacks++;return g(v,T,F,!0,V?Error("react-stack-top-frame"):E,V?w(r(v)):z)}})()),Be}var xn;function Qr(){return xn||(xn=1,process.env.NODE_ENV==="production"?tt.exports=Jr():tt.exports=Zr()),tt.exports}var s=Qr();function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const bt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Jt(e){return"nodeType"in e}function ae(e){var t,n;return e?$e(e)?e:Jt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Zt(e){const{Document:t}=ae(e);return e instanceof t}function Xe(e){return $e(e)?!1:e instanceof ae(e).HTMLElement}function Gn(e){return e instanceof ae(e).SVGElement}function Ae(e){return e?$e(e)?e.document:Jt(e)?Zt(e)?e:Xe(e)||Gn(e)?e.ownerDocument:document:document:document}const me=bt?h.useLayoutEffect:h.useEffect;function Qt(e){const t=h.useRef(e);return me(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function to(){const e=h.useRef(null),t=h.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ge(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return me(()=>{n.current!==e&&(n.current=e)},t),n}function Ke(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ht(e){const t=Qt(e),n=h.useRef(null),r=h.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Yt(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let Tt={};function Je(e,t){return h.useMemo(()=>{if(t)return t;const n=Tt[e]==null?0:Tt[e]+1;return Tt[e]=n,e+"-"+n},[e,t])}function qn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,c)=>{const l=Object.entries(c);for(const[u,d]of l){const g=i[u];g!=null&&(i[u]=g+e*d)}return i},{...t})}}const ke=qn(1),gt=qn(-1);function no(e){return"clientX"in e&&"clientY"in e}function en(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function ro(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Bt(e){if(ro(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return no(e)?{x:e.clientX,y:e.clientY}:null}const Ie=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ie.Translate.toString(e),Ie.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),bn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function oo(e){return e.matches(bn)?e:e.querySelector(bn)}const so={display:"none"};function io(e){let{id:t,value:n}=e;return h.createElement("div",{id:t,style:so},n)}function ao(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function lo(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Xn=h.createContext(null);function co(e){const t=h.useContext(Xn);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uo(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.useCallback(r=>{let{type:o,event:i}=r;e.forEach(c=>{var l;return(l=c[o])==null?void 0:l.call(c,i)})},[e]),t]}const fo={draggable:`
6
+ <%s key={someKey} {...props} />`,W,U,K,U),F[U+W]=!0)}if(U=null,z!==void 0&&(n(z),U=""+z),a(T)&&(n(T.key),U=""+T.key),"key"in T){z={};for(var J in T)J!=="key"&&(z[J]=T[J])}else z=T;return U&&l(z,typeof m=="function"?m.displayName||m.name||"Unknown":m),d(m,U,z,o(),q,X)}function g(m){v(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===H&&(m._payload.status==="fulfilled"?v(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function v(m){return typeof m=="object"&&m!==null&&m.$$typeof===S}var h=f,S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),k=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),Y=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,C=Array.isArray,w=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(m){return m()}};var D,j={},R=h.react_stack_bottom_frame.bind(h,s)(),P=w(r(s)),F={};Ve.Fragment=y,Ve.jsx=function(m,T,z){var W=1e4>Y.recentlyCreatedOwnerStacks++;return p(m,T,z,!1,W?Error("react-stack-top-frame"):R,W?w(r(m)):P)},Ve.jsxs=function(m,T,z){var W=1e4>Y.recentlyCreatedOwnerStacks++;return p(m,T,z,!0,W?Error("react-stack-top-frame"):R,W?w(r(m)):P)}})()),Ve}var Sn;function Qr(){return Sn||(Sn=1,process.env.NODE_ENV==="production"?rt.exports=Jr():rt.exports=Zr()),rt.exports}var i=Qr();function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const St=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Le(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function en(e){return"nodeType"in e}function ie(e){var t,n;return e?Le(e)?e:en(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function tn(e){const{Document:t}=ie(e);return e instanceof t}function Je(e){return Le(e)?!1:e instanceof ie(e).HTMLElement}function Kn(e){return e instanceof ie(e).SVGElement}function Pe(e){return e?Le(e)?e.document:en(e)?tn(e)?e:Je(e)||Kn(e)?e.ownerDocument:document:document:document}const xe=St?f.useLayoutEffect:f.useEffect;function nn(e){const t=f.useRef(e);return xe(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function to(){const e=f.useRef(null),t=f.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Xe(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return xe(()=>{n.current!==e&&(n.current=e)},t),n}function Ze(e,t){const n=f.useRef();return f.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function pt(e){const t=nn(e),n=f.useRef(null),r=f.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Wt(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let _t={};function Qe(e,t){return f.useMemo(()=>{if(t)return t;const n=_t[e]==null?0:_t[e]+1;return _t[e]=n,e+"-"+n},[e,t])}function Jn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const l=Object.entries(a);for(const[u,d]of l){const p=s[u];p!=null&&(s[u]=p+e*d)}return s},{...t})}}const ke=Jn(1),vt=Jn(-1);function no(e){return"clientX"in e&&"clientY"in e}function rn(e){if(!e)return!1;const{KeyboardEvent:t}=ie(e.target);return t&&e instanceof t}function ro(e){if(!e)return!1;const{TouchEvent:t}=ie(e.target);return t&&e instanceof t}function Vt(e){if(ro(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return no(e)?{x:e.clientX,y:e.clientY}:null}const Ae=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ae.Translate.toString(e),Ae.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),wn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function oo(e){return e.matches(wn)?e:e.querySelector(wn)}const so={display:"none"};function io(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:so},n)}function ao(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return f.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function co(){const[e,t]=f.useState("");return{announce:f.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Zn=f.createContext(null);function lo(e){const t=f.useContext(Zn);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uo(){const[e]=f.useState(()=>new Set),t=f.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[f.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var l;return(l=a[o])==null?void 0:l.call(a,s)})},[e]),t]}const fo={draggable:`
7
7
  To pick up a draggable item, press the space bar.
8
8
  While dragging, use the arrow keys to move the item.
9
9
  Press space again to drop the item in its new position, or press escape to cancel.
10
- `},ho={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function go(e){let{announcements:t=ho,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=fo}=e;const{announce:i,announcement:c}=lo(),l=Je("DndLiveRegion"),[u,d]=h.useState(!1);if(h.useEffect(()=>{d(!0)},[]),co(h.useMemo(()=>({onDragStart(f){let{active:x}=f;i(t.onDragStart({active:x}))},onDragMove(f){let{active:x,over:p}=f;t.onDragMove&&i(t.onDragMove({active:x,over:p}))},onDragOver(f){let{active:x,over:p}=f;i(t.onDragOver({active:x,over:p}))},onDragEnd(f){let{active:x,over:p}=f;i(t.onDragEnd({active:x,over:p}))},onDragCancel(f){let{active:x,over:p}=f;i(t.onDragCancel({active:x,over:p}))}}),[i,t])),!u)return null;const g=h.createElement(h.Fragment,null,h.createElement(io,{id:r,value:o.draggable}),h.createElement(ao,{id:l,announcement:c}));return n?Ve.createPortal(g,n):g}var Z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Z||(Z={}));function pt(){}function po(e,t){return h.useMemo(()=>({sensor:e,options:{}}),[e,t])}function vo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ge=Object.freeze({x:0,y:0});function mo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function bo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function yo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function yn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Kn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=yn(t,t.left,t.top),i=[];for(const c of r){const{id:l}=c,u=n.get(l);if(u){const d=mo(yn(u),o);i.push({id:l,data:{droppableContainer:c,value:d}})}}return i.sort(xo)};function So(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),c=o-r,l=i-n;if(r<o&&n<i){const u=t.width*t.height,d=e.width*e.height,g=c*l,f=g/(u+d-g);return Number(f.toFixed(4))}return 0}const wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:c}=i,l=n.get(c);if(l){const u=So(l,t);u>0&&o.push({id:c,data:{droppableContainer:i,value:u}})}}return o.sort(bo)};function Co(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Jn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ge}function Do(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((c,l)=>({...c,top:c.top+e*l.y,bottom:c.bottom+e*l.y,left:c.left+e*l.x,right:c.right+e*l.x}),{...n})}}const jo=Do(1);function Ro(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Mo(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:i,x:c,y:l}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:g,height:f,top:d,right:u+g,bottom:d+f,left:u}}const Eo={ignoreTransform:!1};function Le(e,t){t===void 0&&(t=Eo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:g}=ae(e).getComputedStyle(e);d&&(n=Mo(n,d,g))}const{top:r,left:o,width:i,height:c,bottom:l,right:u}=n;return{top:r,left:o,width:i,height:c,bottom:l,right:u}}function Sn(e){return Le(e,{ignoreTransform:!0})}function To(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function _o(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Oo(e,t){t===void 0&&(t=ae(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function tn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Zt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Xe(o)||Gn(o)||n.includes(o))return n;const i=ae(e).getComputedStyle(o);return o!==e&&Oo(o,i)&&n.push(o),_o(o,i)?n:r(o.parentNode)}return e?r(e):n}function Zn(e){const[t]=tn(e,1);return t??null}function _t(e){return!bt||!e?null:$e(e)?e:Jt(e)?Zt(e)||e===Ae(e).scrollingElement?window:Xe(e)?e:null:null}function Qn(e){return $e(e)?e.scrollX:e.scrollLeft}function er(e){return $e(e)?e.scrollY:e.scrollTop}function Vt(e){return{x:Qn(e),y:er(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function tr(e){return!bt||!e?!1:e===document.scrollingElement}function nr(e){const t={x:0,y:0},n=tr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:c,isRight:l,maxScroll:r,minScroll:t}}const ko={x:.2,y:.2};function Io(e,t,n,r,o){let{top:i,left:c,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=ko);const{isTop:d,isBottom:g,isLeft:f,isRight:x}=nr(e),p={x:0,y:0},m={x:0,y:0},b={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+b.height?(p.y=Q.Backward,m.y=r*Math.abs((t.top+b.height-i)/b.height)):!g&&u>=t.bottom-b.height&&(p.y=Q.Forward,m.y=r*Math.abs((t.bottom-b.height-u)/b.height)),!x&&l>=t.right-b.width?(p.x=Q.Forward,m.x=r*Math.abs((t.right-b.width-l)/b.width)):!f&&c<=t.left+b.width&&(p.x=Q.Backward,m.x=r*Math.abs((t.left+b.width-c)/b.width)),{direction:p,speed:m}}function $o(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function rr(e){return e.reduce((t,n)=>ke(t,Vt(n)),ge)}function Ao(e){return e.reduce((t,n)=>t+Qn(n),0)}function Lo(e){return e.reduce((t,n)=>t+er(n),0)}function Po(e,t){if(t===void 0&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Zn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zo=[["x",["left","right"],Ao],["y",["top","bottom"],Lo]];class nn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=tn(n),o=rr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,l]of zo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),g=o[i]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class We{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function No(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Ae(e)}function Ot(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function wn(e){e.preventDefault()}function Fo(e){e.stopPropagation()}var G;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(G||(G={}));const or={start:[G.Space,G.Enter],cancel:[G.Esc],end:[G.Space,G.Enter,G.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case G.Right:return{...n,x:n.x+25};case G.Left:return{...n,x:n.x-25};case G.Down:return{...n,y:n.y+25};case G.Up:return{...n,y:n.y-25}}};class sr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new We(Ae(n)),this.windowListeners=new We(ae(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Po(r),n(ge)}handleKeyDown(t){if(en(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=or,coordinateGetter:c=Yo,scrollBehavior:l="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,g=d?{x:d.left,y:d.top}:ge;this.referenceCoordinates||(this.referenceCoordinates=g);const f=c(t,{active:n,context:r.current,currentCoordinates:g});if(f){const x=gt(f,g),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const b of m){const S=t.code,{isTop:_,isRight:R,isLeft:M,isBottom:k,maxScroll:I,minScroll:O}=nr(b),$=$o(b),N={x:Math.min(S===G.Right?$.right-$.width/2:$.right,Math.max(S===G.Right?$.left:$.left+$.width/2,f.x)),y:Math.min(S===G.Down?$.bottom-$.height/2:$.bottom,Math.max(S===G.Down?$.top:$.top+$.height/2,f.y))},H=S===G.Right&&!R||S===G.Left&&!M,B=S===G.Down&&!k||S===G.Up&&!_;if(H&&N.x!==f.x){const A=b.scrollLeft+x.x,L=S===G.Right&&A<=I.x||S===G.Left&&A>=O.x;if(L&&!x.y){b.scrollTo({left:A,behavior:l});return}L?p.x=b.scrollLeft-A:p.x=S===G.Right?b.scrollLeft-I.x:b.scrollLeft-O.x,p.x&&b.scrollBy({left:-p.x,behavior:l});break}else if(B&&N.y!==f.y){const A=b.scrollTop+x.y,L=S===G.Down&&A<=I.y||S===G.Up&&A>=O.y;if(L&&!x.x){b.scrollTo({top:A,behavior:l});return}L?p.y=b.scrollTop-A:p.y=S===G.Down?b.scrollTop-I.y:b.scrollTop-O.y,p.y&&b.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,ke(gt(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=or,onActivation:o}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Cn(e){return!!(e&&"distance"in e)}function Dn(e){return!!(e&&"delay"in e)}class rn{constructor(t,n,r){var o;r===void 0&&(r=No(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=Ae(c),this.documentListeners=new We(this.document),this.listeners=new We(r),this.windowListeners=new We(ae(c)),this.initialCoordinates=(o=Bt(i))!=null?o:ge,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,wn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,wn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Cn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Fo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:c,options:{activationConstraint:l}}=i;if(!o)return;const u=(n=Bt(t))!=null?n:ge,d=gt(o,u);if(!r&&l){if(Cn(l)){if(l.tolerance!=null&&Ot(d,l.tolerance))return this.handleCancel();if(Ot(d,l.distance))return this.handleStart()}if(Dn(l)&&Ot(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),c(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===G.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Bo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class on extends rn{constructor(t){const{event:n}=t,r=Ae(n.target);super(t,Bo,r)}}on.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Vo={move:{name:"mousemove"},end:{name:"mouseup"}};var Wt;(function(e){e[e.RightClick=2]="RightClick"})(Wt||(Wt={}));class Wo extends rn{constructor(t){super(t,Vo,Ae(t.event.target))}}Wo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Wt.RightClick?!1:(r?.({event:n}),!0)}}];const kt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ho extends rn{constructor(t){super(t,kt)}static setup(){return window.addEventListener(kt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(kt.move.name,t)};function t(){}}}Ho.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var He;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(He||(He={}));var vt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(vt||(vt={}));function Uo(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:c=5,order:l=vt.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:f,threshold:x}=e;const p=qo({delta:f,disabled:!i}),[m,b]=to(),S=h.useRef({x:0,y:0}),_=h.useRef({x:0,y:0}),R=h.useMemo(()=>{switch(n){case He.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case He.DraggableRect:return o}},[n,o,u]),M=h.useRef(null),k=h.useCallback(()=>{const O=M.current;if(!O)return;const $=S.current.x*_.current.x,N=S.current.y*_.current.y;O.scrollBy($,N)},[]),I=h.useMemo(()=>l===vt.TreeOrder?[...d].reverse():d,[l,d]);h.useEffect(()=>{if(!i||!d.length||!R){b();return}for(const O of I){if(r?.(O)===!1)continue;const $=d.indexOf(O),N=g[$];if(!N)continue;const{direction:H,speed:B}=Io(O,N,R,t,x);for(const A of["x","y"])p[A][H[A]]||(B[A]=0,H[A]=0);if(B.x>0||B.y>0){b(),M.current=O,m(k,c),S.current=B,_.current=H;return}}S.current={x:0,y:0},_.current={x:0,y:0},b()},[t,k,r,b,i,c,JSON.stringify(R),JSON.stringify(p),m,d,I,g,JSON.stringify(x)])}const Go={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Yt(t);return Ke(o=>{if(n||!r||!o)return Go;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||i.x===-1,[Q.Forward]:o.x[Q.Forward]||i.x===1},y:{[Q.Backward]:o.y[Q.Backward]||i.y===-1,[Q.Forward]:o.y[Q.Forward]||i.y===1}}},[n,t,r])}function Xo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ke(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Ko(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var Ht;(function(e){e.Optimized="optimized"})(Ht||(Ht={}));const jn=new Map;function Jo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,c]=h.useState(null),{frequency:l,measure:u,strategy:d}=o,g=h.useRef(e),f=S(),x=Ge(f),p=h.useCallback(function(_){_===void 0&&(_=[]),!x.current&&c(R=>R===null?_:R.concat(_.filter(M=>!R.includes(M))))},[x]),m=h.useRef(null),b=Ke(_=>{if(f&&!n)return jn;if(!_||_===jn||g.current!==e||i!=null){const R=new Map;for(let M of e){if(!M)continue;if(i&&i.length>0&&!i.includes(M.id)&&M.rect.current){R.set(M.id,M.rect.current);continue}const k=M.node.current,I=k?new nn(u(k),k):null;M.rect.current=I,I&&R.set(M.id,I)}return R}return _},[e,i,n,f,u]);return h.useEffect(()=>{g.current=e},[e]),h.useEffect(()=>{f||p()},[n,f]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{f||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:i!=null};function S(){switch(d){case qe.Always:return!1;case qe.BeforeDragging:return n;default:return!n}}}function ir(e,t){return Ke(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zo(e,t){return ir(e,t)}function Qo(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function yt(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>o?.disconnect(),[o]),o}function es(e){return new nn(Le(e),e)}function Rn(e,t,n){t===void 0&&(t=es);const[r,o]=h.useState(null);function i(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const g=t(e);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const c=Qo({callback(u){if(e)for(const d of u){const{type:g,target:f}=d;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=yt({callback:i});return me(()=>{i(),e?(l?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),c?.disconnect())},[e]),r}function ts(e){const t=ir(e);return Jn(e,t)}const Mn=[];function ns(e){const t=h.useRef(e),n=Ke(r=>e?r&&r!==Mn&&e&&t.current&&e.parentNode===t.current.parentNode?r:tn(e):Mn,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function rs(e){const[t,n]=h.useState(null),r=h.useRef(e),o=h.useCallback(i=>{const c=_t(i.target);c&&n(l=>l?(l.set(c,Vt(c)),new Map(l)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const l=e.map(u=>{const d=_t(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Vt(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{c(e),c(i)};function c(l){l.forEach(u=>{const d=_t(u);d?.removeEventListener("scroll",o)})}},[o,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>ke(i,c),ge):rr(e):ge,[e,t])}function En(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==ge;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?gt(e,n.current):ge}function os(e){h.useEffect(()=>{if(!bt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function ss(e,t){return h.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=c=>{i(c,t)},n},{}),[e,t])}function ar(e){return h.useMemo(()=>e?To(e):null,[e])}const Tn=[];function is(e,t){t===void 0&&(t=Le);const[n]=e,r=ar(n?ae(n):null),[o,i]=h.useState(Tn);function c(){i(()=>e.length?e.map(u=>tr(u)?r:new nn(t(u),u)):Tn)}const l=yt({callback:c});return me(()=>{l?.disconnect(),c(),e.forEach(u=>l?.observe(u))},[e]),o}function as(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xe(t)?t:e}function ls(e){let{measure:t}=e;const[n,r]=h.useState(null),o=h.useCallback(d=>{for(const{target:g}of d)if(Xe(g)){r(f=>{const x=t(g);return f?{...f,width:x.width,height:x.height}:x});break}},[t]),i=yt({callback:o}),c=h.useCallback(d=>{const g=as(d);i?.disconnect(),g&&i?.observe(g),r(g?t(g):null)},[t,i]),[l,u]=ht(c);return h.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const cs=[{sensor:on,options:{}},{sensor:sr,options:{}}],us={current:{}},lt={draggable:{measure:Sn},droppable:{measure:Sn,strategy:qe.WhileDragging,frequency:Ht.Optimized},dragOverlay:{measure:Le}};class Ue extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ds={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ue,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:pt,windowRect:null,measuringScheduled:!1},fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pt,draggableNodes:new Map,over:null,measureDroppableContainers:pt},St=h.createContext(fs),lr=h.createContext(ds);function hs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ue}}}function gs(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ue(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new Ue(e.droppable.containers);return c.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ue(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ps(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=h.useContext(St),i=Yt(r),c=Yt(n?.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!en(i)||document.activeElement===i.target)return;const l=o.get(c);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[u.current,d.current]){if(!g)continue;const f=oo(g);if(f){f.focus();break}}})}},[r,t,o,c,i]),null}function vs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function ms(e){return h.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function xs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=h.useRef(!1),{x:c,y:l}=typeof o=="boolean"?{x:o,y:o}:o;me(()=>{if(!c&&!l||!t){i.current=!1;return}if(i.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const g=n(d),f=Jn(g,r);if(c||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const x=Zn(d);x&&x.scrollBy({top:f.y,left:f.x})}},[t,c,l,r,n])}const cr=h.createContext({...ge,scaleX:1,scaleY:1});var je;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(je||(je={}));const ur=h.memo(function(t){var n,r,o,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:g=cs,collisionDetection:f=wo,measuring:x,modifiers:p,...m}=t;const b=h.useReducer(gs,void 0,hs),[S,_]=b,[R,M]=uo(),[k,I]=h.useState(je.Uninitialized),O=k===je.Initialized,{draggable:{active:$,nodes:N,translate:H},droppable:{containers:B}}=S,A=$!=null?N.get($):null,L=h.useRef({initial:null,translated:null}),P=h.useMemo(()=>{var se;return $!=null?{id:$,data:(se=A?.data)!=null?se:us,rect:L}:null},[$,A]),D=h.useRef(null),[w,C]=h.useState(null),[j,E]=h.useState(null),z=Ge(m,Object.values(m)),Y=Je("DndDescribedBy",c),v=h.useMemo(()=>B.getEnabled(),[B]),T=ms(x),{droppableRects:F,measureDroppableContainers:V,measuringScheduled:q}=Jo(v,{dragging:O,dependencies:[H.x,H.y],config:T.droppable}),X=Xo(N,$),U=h.useMemo(()=>j?Bt(j):null,[j]),K=Kr(),J=Zo(X,T.draggable.measure);xs({activeNode:$!=null?N.get($):null,config:K.layoutShiftCompensation,initialRect:J,measure:T.draggable.measure});const W=Rn(X,T.draggable.measure,J),ie=Rn(X?X.parentElement:null),oe=h.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=oe.current.over)==null?void 0:n.id),xe=ls({measure:T.dragOverlay.measure}),Me=(r=xe.nodeRef.current)!=null?r:X,Ee=O?(o=xe.rect)!=null?o:W:null,ln=!!(xe.nodeRef.current&&xe.rect),cn=ts(ln?null:W),Rt=ar(Me?ae(Me):null),ye=ns(O?he??X:null),Qe=is(ye),et=vs(p,{transform:{x:H.x-cn.x,y:H.y-cn.y,scaleX:1,scaleY:1},activatorEvent:j,active:P,activeNodeRect:W,containerNodeRect:ie,draggingNodeRect:Ee,over:oe.current.over,overlayNodeRect:xe.rect,scrollableAncestors:ye,scrollableAncestorRects:Qe,windowRect:Rt}),un=U?ke(U,H):null,dn=rs(ye),Vr=En(dn),Wr=En(dn,[W]),Te=ke(et,Vr),_e=Ee?jo(Ee,et):null,Pe=P&&_e?f({active:P,collisionRect:_e,droppableRects:F,droppableContainers:v,pointerCoordinates:un}):null,fn=yo(Pe,"id"),[Se,hn]=h.useState(null),Hr=ln?et:ke(et,Wr),Ur=Co(Hr,(i=Se?.rect)!=null?i:null,W),Mt=h.useRef(null),gn=h.useCallback((se,le)=>{let{sensor:ce,options:we}=le;if(D.current==null)return;const de=N.get(D.current);if(!de)return;const ue=se.nativeEvent,pe=new ce({active:D.current,activeNode:de,event:ue,options:we,context:oe,onAbort(te){if(!N.get(te))return;const{onDragAbort:ve}=z.current,be={id:te};ve?.(be),R({type:"onDragAbort",event:be})},onPending(te,Ce,ve,be){if(!N.get(te))return;const{onDragPending:Ne}=z.current,De={id:te,constraint:Ce,initialCoordinates:ve,offset:be};Ne?.(De),R({type:"onDragPending",event:De})},onStart(te){const Ce=D.current;if(Ce==null)return;const ve=N.get(Ce);if(!ve)return;const{onDragStart:be}=z.current,ze={activatorEvent:ue,active:{id:Ce,data:ve.data,rect:L}};Ve.unstable_batchedUpdates(()=>{be?.(ze),I(je.Initializing),_({type:Z.DragStart,initialCoordinates:te,active:Ce}),R({type:"onDragStart",event:ze}),C(Mt.current),E(ue)})},onMove(te){_({type:Z.DragMove,coordinates:te})},onEnd:Oe(Z.DragEnd),onCancel:Oe(Z.DragCancel)});Mt.current=pe;function Oe(te){return async function(){const{active:ve,collisions:be,over:ze,scrollAdjustedTranslate:Ne}=oe.current;let De=null;if(ve&&Ne){const{cancelDrop:Fe}=z.current;De={activatorEvent:ue,active:ve,collisions:be,delta:Ne,over:ze},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(De))&&(te=Z.DragCancel)}D.current=null,Ve.unstable_batchedUpdates(()=>{_({type:te}),I(je.Uninitialized),hn(null),C(null),E(null),Mt.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(De){const Et=z.current[Fe];Et?.(De),R({type:Fe,event:De})}})}}},[N]),Gr=h.useCallback((se,le)=>(ce,we)=>{const de=ce.nativeEvent,ue=N.get(we);if(D.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const pe={active:ue};se(ce,le.options,pe)===!0&&(de.dndKit={capturedBy:le.sensor},D.current=we,gn(ce,le))},[N,gn]),pn=Ko(g,Gr);os(g),me(()=>{W&&k===je.Initializing&&I(je.Initialized)},[W,k]),h.useEffect(()=>{const{onDragMove:se}=z.current,{active:le,activatorEvent:ce,collisions:we,over:de}=oe.current;if(!le||!ce)return;const ue={active:le,activatorEvent:ce,collisions:we,delta:{x:Te.x,y:Te.y},over:de};Ve.unstable_batchedUpdates(()=>{se?.(ue),R({type:"onDragMove",event:ue})})},[Te.x,Te.y]),h.useEffect(()=>{const{active:se,activatorEvent:le,collisions:ce,droppableContainers:we,scrollAdjustedTranslate:de}=oe.current;if(!se||D.current==null||!le||!de)return;const{onDragOver:ue}=z.current,pe=we.get(fn),Oe=pe&&pe.rect.current?{id:pe.id,rect:pe.rect.current,data:pe.data,disabled:pe.disabled}:null,te={active:se,activatorEvent:le,collisions:ce,delta:{x:de.x,y:de.y},over:Oe};Ve.unstable_batchedUpdates(()=>{hn(Oe),ue?.(te),R({type:"onDragOver",event:te})})},[fn]),me(()=>{oe.current={activatorEvent:j,active:P,activeNode:X,collisionRect:_e,collisions:Pe,droppableRects:F,draggableNodes:N,draggingNode:Me,draggingNodeRect:Ee,droppableContainers:B,over:Se,scrollableAncestors:ye,scrollAdjustedTranslate:Te},L.current={initial:Ee,translated:_e}},[P,X,Pe,_e,N,Me,Ee,F,B,Se,ye,Te]),Uo({...K,delta:H,draggingRect:_e,pointerCoordinates:un,scrollableAncestors:ye,scrollableAncestorRects:Qe});const qr=h.useMemo(()=>({active:P,activeNode:X,activeNodeRect:W,activatorEvent:j,collisions:Pe,containerNodeRect:ie,dragOverlay:xe,draggableNodes:N,droppableContainers:B,droppableRects:F,over:Se,measureDroppableContainers:V,scrollableAncestors:ye,scrollableAncestorRects:Qe,measuringConfiguration:T,measuringScheduled:q,windowRect:Rt}),[P,X,W,j,Pe,ie,xe,N,B,F,Se,V,ye,Qe,T,q,Rt]),Xr=h.useMemo(()=>({activatorEvent:j,activators:pn,active:P,activeNodeRect:W,ariaDescribedById:{draggable:Y},dispatch:_,draggableNodes:N,over:Se,measureDroppableContainers:V}),[j,pn,P,W,_,Y,N,Se,V]);return h.createElement(Xn.Provider,{value:M},h.createElement(St.Provider,{value:Xr},h.createElement(lr.Provider,{value:qr},h.createElement(cr.Provider,{value:Ur},d)),h.createElement(ps,{disabled:l?.restoreFocus===!1})),h.createElement(go,{...l,hiddenTextDescribedById:Y}));function Kr(){const se=w?.autoScrollEnabled===!1,le=typeof u=="object"?u.enabled===!1:u===!1,ce=O&&!se&&!le;return typeof u=="object"?{...u,enabled:ce}:{enabled:ce}}}),bs=h.createContext(null),_n="button",ys="Draggable";function Ss(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Je(ys),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:f,over:x}=h.useContext(St),{role:p=_n,roleDescription:m="draggable",tabIndex:b=0}=o??{},S=u?.id===t,_=h.useContext(S?cr:bs),[R,M]=ht(),[k,I]=ht(),O=ss(c,t),$=Ge(n);me(()=>(f.set(t,{id:t,key:i,node:R,activatorNode:k,data:$}),()=>{const H=f.get(t);H&&H.key===i&&f.delete(t)}),[f,t]);const N=h.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":S&&p===_n?!0:void 0,"aria-roledescription":m,"aria-describedby":g.draggable}),[r,p,b,S,m,g.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:N,isDragging:S,listeners:r?void 0:O,node:R,over:x,setNodeRef:M,setActivatorNodeRef:I,transform:_}}function ws(){return h.useContext(lr)}const Cs="Droppable",Ds={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Je(Cs),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=h.useContext(St),g=h.useRef({disabled:n}),f=h.useRef(!1),x=h.useRef(null),p=h.useRef(null),{disabled:m,updateMeasurementsFor:b,timeout:S}={...Ds,...o},_=Ge(b??r),R=h.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(_.current)?_.current:[_.current]),p.current=null},S)},[S]),M=yt({callback:R,disabled:m||!c}),k=h.useCallback((N,H)=>{M&&(H&&(M.unobserve(H),f.current=!1),N&&M.observe(N))},[M]),[I,O]=ht(k),$=Ge(t);return h.useEffect(()=>{!M||!I.current||(M.disconnect(),f.current=!1,M.observe(I.current))},[I,M]),h.useEffect(()=>(l({type:Z.RegisterDroppable,element:{id:r,key:i,disabled:n,node:I,rect:x,data:$}}),()=>l({type:Z.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==g.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:i,disabled:n}),g.current.disabled=n)},[r,i,n,l]),{active:c,rect:x,isOver:u?.id===r,node:I,over:u,setNodeRef:O}}function wt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rs(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function nt(e){return e!==null&&e>=0}function Ms(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Es(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const rt={scaleX:1,scaleY:1},Ts=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:c}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=_s(n,c,o);if(c===o){const d=n[i];return d?{x:o<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...rt}:null}return c>o&&c<=i?{x:-l.width-u,y:0,...rt}:c<o&&c>=i?{x:l.width+u,y:0,...rt}:{x:0,y:0,...rt}};function _s(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const dr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=wt(t,r,n),c=t[o],l=i[o];return!l||!c?null:{x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height}},ot={scaleX:1,scaleY:1},Os=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:c}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const d=i[c];return d?{x:0,y:n<c?d.top+d.height-(l.top+l.height):d.top-l.top,...ot}:null}const u=ks(i,o,n);return o>n&&o<=c?{x:0,y:-l.height-u,...ot}:o<n&&o>=c?{x:0,y:l.height+u,...ot}:{x:0,y:0,...ot}};function ks(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const fr="Sortable",hr=h.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function gr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:i=!1}=e;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:g}=ws(),f=Je(fr,n),x=l.rect!==null,p=h.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),m=c!=null,b=c?p.indexOf(c.id):-1,S=d?p.indexOf(d.id):-1,_=h.useRef(p),R=!Ms(p,_.current),M=S!==-1&&b===-1||R,k=Es(i);me(()=>{R&&m&&g(p)},[R,p,m,g]),h.useEffect(()=>{_.current=p},[p]);const I=h.useMemo(()=>({activeIndex:b,containerId:f,disabled:k,disableTransforms:M,items:p,overIndex:S,useDragOverlay:x,sortedRects:Rs(p,u),strategy:o}),[b,f,k.draggable,k.droppable,M,p,S,u,x,o]);return h.createElement(hr.Provider,{value:I},t)}const Is=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return wt(n,r,o).indexOf(t)},$s=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=e;return!d||!r||l!==i&&o===c?!1:n?!0:c!==o&&t===u},As={duration:200,easing:"ease"},pr="transform",Ls=Ie.Transition.toString({property:pr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function zs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,c]=h.useState(null),l=h.useRef(n);return me(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const d=Le(r.current,{ignoreTransform:!0}),g={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(g.x||g.y)&&c(g)}}n!==l.current&&(l.current=n)},[t,n,r,o]),h.useEffect(()=>{i&&c(null)},[i]),i}function vr(e){let{animateLayoutChanges:t=$s,attributes:n,disabled:r,data:o,getNewIndex:i=Is,id:c,strategy:l,resizeObserverConfig:u,transition:d=As}=e;const{items:g,containerId:f,activeIndex:x,disabled:p,disableTransforms:m,sortedRects:b,overIndex:S,useDragOverlay:_,strategy:R}=h.useContext(hr),M=Ns(r,p),k=g.indexOf(c),I=h.useMemo(()=>({sortable:{containerId:f,index:k,items:g},...o}),[f,o,k,g]),O=h.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:$,node:N,isOver:H,setNodeRef:B}=js({id:c,data:I,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...u}}),{active:A,activatorEvent:L,activeNodeRect:P,attributes:D,setNodeRef:w,listeners:C,isDragging:j,over:E,setActivatorNodeRef:z,transform:Y}=Ss({id:c,data:I,attributes:{...Ps,...n},disabled:M.draggable}),v=eo(B,w),T=!!A,F=T&&!m&&nt(x)&&nt(S),V=!_&&j,q=V&&F?Y:null,U=F?q??(l??R)({rects:b,activeNodeRect:P,activeIndex:x,overIndex:S,index:k}):null,K=nt(x)&&nt(S)?i({id:c,items:g,activeIndex:x,overIndex:S}):k,J=A?.id,W=h.useRef({activeId:J,items:g,newIndex:K,containerId:f}),ie=g!==W.current.items,oe=t({active:A,containerId:f,isDragging:j,isSorting:T,id:c,index:k,items:g,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:d,wasDragging:W.current.activeId!=null}),he=zs({disabled:!oe,index:k,node:N,rect:$});return h.useEffect(()=>{T&&W.current.newIndex!==K&&(W.current.newIndex=K),f!==W.current.containerId&&(W.current.containerId=f),g!==W.current.items&&(W.current.items=g)},[T,K,f,g]),h.useEffect(()=>{if(J===W.current.activeId)return;if(J!=null&&W.current.activeId==null){W.current.activeId=J;return}const Me=setTimeout(()=>{W.current.activeId=J},50);return()=>clearTimeout(Me)},[J]),{active:A,activeIndex:x,attributes:D,data:I,rect:$,index:k,newIndex:K,items:g,isOver:H,isSorting:T,isDragging:j,listeners:C,node:N,overIndex:S,over:E,setNodeRef:v,setActivatorNodeRef:z,setDroppableNodeRef:B,setDraggableNodeRef:w,transform:he??U,transition:xe()};function xe(){if(he||ie&&W.current.newIndex===k)return Ls;if(!(V&&!en(L)||!d)&&(T||oe))return Ie.Transition.toString({...d,property:pr})}}function Ns(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}G.Down,G.Right,G.Up,G.Left;var st={exports:{}},It={},it={exports:{}},$t={};var On;function Fs(){if(On)return $t;On=1;var e=h;function t(f,x){return f===x&&(f!==0||1/f===1/x)||f!==f&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,c=e.useDebugValue;function l(f,x){var p=x(),m=r({inst:{value:p,getSnapshot:x}}),b=m[0].inst,S=m[1];return i(function(){b.value=p,b.getSnapshot=x,u(b)&&S({inst:b})},[f,p,x]),o(function(){return u(b)&&S({inst:b}),f(function(){u(b)&&S({inst:b})})},[f]),c(p),p}function u(f){var x=f.getSnapshot;f=f.value;try{var p=x();return!n(f,p)}catch{return!0}}function d(f,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,$t}var At={};var kn;function Ys(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}function t(p,m){g||o.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=m();if(!f){var S=m();i(b,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}S=c({inst:{value:b,getSnapshot:m}});var _=S[0].inst,R=S[1];return u(function(){_.value=b,_.getSnapshot=m,n(_)&&R({inst:_})},[p,b,m]),l(function(){return n(_)&&R({inst:_}),p(function(){n(_)&&R({inst:_})})},[p]),d(b),b}function n(p){var m=p.getSnapshot;p=p.value;try{var b=m();return!i(p,b)}catch{return!0}}function r(p,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=h,i=typeof Object.is=="function"?Object.is:e,c=o.useState,l=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,g=!1,f=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;At.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var In;function mr(){return In||(In=1,process.env.NODE_ENV==="production"?it.exports=Fs():it.exports=Ys()),it.exports}var $n;function Bs(){if($n)return It;$n=1;var e=h,t=mr();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,c=e.useEffect,l=e.useMemo,u=e.useDebugValue;return It.useSyncExternalStoreWithSelector=function(d,g,f,x,p){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=l(function(){function _(O){if(!R){if(R=!0,M=O,O=x(O),p!==void 0&&b.hasValue){var $=b.value;if(p($,O))return k=$}return k=O}if($=k,r(M,O))return $;var N=x(O);return p!==void 0&&p($,N)?(M=O,$):(M=O,k=N)}var R=!1,M,k,I=f===void 0?null:f;return[function(){return _(g())},I===null?void 0:function(){return _(I())}]},[g,f,x,p]);var S=o(d,m[0],m[1]);return c(function(){b.hasValue=!0,b.value=S},[S]),u(S),S},It}var Lt={};var An;function Vs(){return An||(An=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,n=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;Lt.useSyncExternalStoreWithSelector=function(d,g,f,x,p){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=l(function(){function _(O){if(!R){if(R=!0,M=O,O=x(O),p!==void 0&&b.hasValue){var $=b.value;if(p($,O))return k=$}return k=O}if($=k,r(M,O))return $;var N=x(O);return p!==void 0&&p($,N)?(M=O,$):(M=O,k=N)}var R=!1,M,k,I=f===void 0?null:f;return[function(){return _(g())},I===null?void 0:function(){return _(I())}]},[g,f,x,p]);var S=o(d,m[0],m[1]);return c(function(){b.hasValue=!0,b.value=S},[S]),u(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Lt}var Ln;function Ws(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?st.exports=Bs():st.exports=Vs()),st.exports}var Hs=Ws();const Ut=new WeakMap,Us=new WeakMap,mt={current:[]};let Pt=!1;const at=new Set,Pn=new Map;function xr(e){for(const t of e){if(mt.current.includes(t))continue;mt.current.push(t),t.recompute();const n=Us.get(t);if(n)for(const r of n){const o=Ut.get(r);o?.length&&xr(o)}}}function Gs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Xs(e){if(at.add(e),!Pt)try{for(Pt=!0;at.size>0;){const t=Array.from(at);at.clear();for(const n of t){const r=Pn.get(n)??n.prevState;n.prevState=r,Gs(n)}for(const n of t){const r=Ut.get(n);r&&(mt.current.push(n),xr(r))}for(const n of t){const r=Ut.get(n);if(r)for(const o of r)qs(o)}}}finally{Pt=!1,mt.current=[],Pn.clear()}}function Ks(e){return typeof e=="function"}class Js{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,i;this.listeners.add(r);const c=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,r,this);return()=>{this.listeners.delete(r),c?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Ks(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Xs(this)}}function Ze(e,t=r=>r,n={}){const r=n.equal??Zs;return Hs.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=zn(e);if(n.length!==zn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function zn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const re=new Js({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],columnWidths:{},data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}}),Ct=e=>`datatable:${e}:column-widths`;function br(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(f=>({id:f,label:f}))).filter(f=>Object.prototype.hasOwnProperty.call(n,f.id)),{tableId:i}=re.state,c=JSON.parse(localStorage.getItem(wr(i))||"[]"),l=[...c.map(f=>o.find(x=>x.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],u=JSON.parse(localStorage.getItem(Cr(i))||"{}"),d=l.reduce((f,x)=>(f[x.id]=u[x.id]??!0,f),{}),g=JSON.parse(localStorage.getItem(Ct(i))||"{}");re.setState(f=>({...f,data:e,columnOrder:l,visibility:d,columnWidths:g,sortableColumns:l.map(x=>({id:x.id,label:x.label,sortable:!0,backgroundColor:x.backgroundColor}))}))}function yr(e){re.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const Sr=e=>{re.setState(t=>({...t,actionsConfig:e}))};function Qs(e,t){re.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const wr=e=>`table_column_order_v1:${e}`,Cr=e=>`table_column_visibility_v1:${e}`,ei=e=>{const{tableId:t}=re.state;localStorage.setItem(wr(t),JSON.stringify(e.map(n=>n.id))),re.setState(n=>({...n,columnOrder:e})),re.setState(n=>({...n,columnOrder:e}))};function ti(e){re.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const ni=e=>{re.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Cr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};function ri(e,t){re.setState(n=>{const r={...n.columnWidths,[e]:Math.max(60,t)};return localStorage.setItem(Ct(n.tableId),JSON.stringify(r)),{...n,columnWidths:r}})}const oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),si=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Nn=e=>{const t=si(e);return t.charAt(0).toUpperCase()+t.slice(1)},Dr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ii=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ai={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 li=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:c,...l},u)=>h.createElement("svg",{ref:u,...ai,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Dr("lucide",o),...!i&&!ii(l)&&{"aria-hidden":"true"},...l},[...c.map(([d,g])=>h.createElement(d,g)),...Array.isArray(i)?i:[i]]));const ee=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(li,{ref:i,iconNode:t,className:Dr(`lucide-${oi(Nn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Nn(e),n};const ci=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ui=ee("arrow-down",ci);const di=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],fi=ee("arrow-left-right",di);const hi=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],gi=ee("arrow-up-down",hi);const pi=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],vi=ee("arrow-up",pi);const mi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],xi=ee("bookmark",mi);const bi=[["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"}]],jr=ee("calendar",bi);const yi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Si=ee("chevron-left",yi);const wi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ci=ee("chevron-right",wi);const Di=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ji=ee("columns-2",Di);const Ri=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],Mi=ee("delete",Ri);const Ei=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Ti=ee("ellipsis",Ei);const _i=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Oi=ee("funnel",_i);const ki=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Rr=ee("grip-vertical",ki);const Ii=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],$i=ee("pen",Ii);const Ai=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Li=ee("refresh-ccw",Ai);const Pi=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],zi=ee("settings",Pi);const Ni=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mr=ee("triangle-alert",Ni);const Fi=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Er=ee("x",Fi);function y(e){return h.forwardRef((t,n)=>{const{children:r,...o}=t;return s.jsx(e,{ref:n,...o,children:r})})}const Yi=y(a.Menu.Trigger),Bi=y(a.Menu.Positioner),Vi=y(a.Menu.Content),Wi=y(a.Menu.Item),Hi=y(a.Checkbox.Label),Ui=y(a.Checkbox.HiddenInput),Gi=y(a.Checkbox.Control);function qi({visibility:e,onToggle:t}){const{sortableColumns:n}=Ze(re);return s.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[s.jsx(Yi,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:s.jsx(ji,{size:18})})}),s.jsx(a.Portal,{children:s.jsx(Bi,{children:s.jsx(Vi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return s.jsx(Wi,{value:r.id,closeOnSelect:!1,children:s.jsxs(a.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[s.jsx(Ui,{}),s.jsx(Gi,{}),s.jsx(Hi,{children:r.label})]})},r.id)})})})})]})}function Xi({id:e,children:t,onClick:n,cursor:r,borderRight:o,backgroundColor:i}){const{columnWidths:c}=Ze(re),l=c[e],u=h.useRef(0),d=h.useRef(0),{setNodeRef:g,attributes:f,listeners:x,transform:p,transition:m}=vr({id:e}),b=R=>{R.stopPropagation(),u.current=R.clientX,d.current=l??150;const M=I=>{ri(e,d.current+(I.clientX-u.current))},k=()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",M),document.addEventListener("mouseup",k)},[S,_]=h.useState(!1);return s.jsx(a.Table.ColumnHeader,{ref:g,onClick:n,backgroundColor:i,w:l?`${l}px`:void 0,minW:"60px",style:{transform:Ie.Transform.toString(p),transition:m,cursor:r,borderRight:o},...f,children:s.jsxs(a.HStack,{position:"relative",onMouseDown:b,children:[s.jsx("span",{...x,children:s.jsx(Rr,{size:12,style:{cursor:"grab"}})}),t,s.jsx(a.Box,{position:"absolute",right:0,top:0,h:"100%",w:"10px",cursor:"col-resize",onMouseDown:b,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,children:S&&s.jsx(fi,{size:14,style:{pointerEvents:"none",opacity:.8}})})]})})}function Ki(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:i}=Ze(re),c=e.map(l=>o.find(u=>u.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]);return s.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:s.jsxs(a.Table.Row,{height:"28px",children:[i?.showSNo&&s.jsx(a.Table.ColumnHeader,{width:"20px",textAlign:"center",backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.indexChildren||"S.No"}),c.map(l=>{const u=n===l?.id;return s.jsx(Xi,{id:l?.id,onClick:()=>l?.sortable&&ti(l?.id),borderRight:"2px solid #dcdcdc",backgroundColor:l?.backgroundColor,children:s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l.label,l?.sortable&&(u?r==="asc"?s.jsx(vi,{size:14}):s.jsx(ui,{size:14}):s.jsx(gi,{size:14,opacity:.4}))]})},l?.id)}),i?.showActionColumn&&s.jsx(a.Table.ColumnHeader,{width:i.width,backgroundColor:i.backgroundColor,borderRight:"2px solid #dcdcdc",children:i.children||"Actions"}),i?.showColumnVisibilityMenu&&s.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:i.backgroundColorColumnVisibilityMenu,children:s.jsx(qi,{visibility:t,onToggle:ni})})]})})}const Ji=[10,20,50,100],Zi=y(a.Select.Positioner),Qi=y(a.Select.Content),ea=y(a.Select.Item),ta=y(a.Pagination.PrevTrigger),na=y(a.Pagination.NextTrigger),ra=y(a.Select.HiddenSelect),oa=y(a.Select.Control),sa=y(a.Select.Trigger),ia=y(a.Select.ValueText),aa=y(a.Select.IndicatorGroup),la=y(a.Select.Indicator);function ca({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:i=2,pageSizeOptions:c=Ji}){const l=a.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return s.jsx(a.Box,{width:"100%",children:s.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[s.jsxs(a.HStack,{children:[s.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),s.jsxs(a.Select.Root,{collection:l,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[s.jsx(ra,{}),s.jsxs(oa,{children:[s.jsx(sa,{children:s.jsx(ia,{placeholder:""})}),s.jsx(aa,{children:s.jsx(la,{})})]}),s.jsx(a.Portal,{children:s.jsx(Zi,{children:s.jsx(Qi,{children:l.items.map(u=>s.jsxs(ea,{item:u.value,children:[u.label,s.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]}),s.jsxs(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),s.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:i,onPageChange:u=>r&&r(u.page),children:s.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[s.jsx(ta,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Previous page",children:s.jsx(Si,{size:18})})}),s.jsx(a.Pagination.Items,{render:u=>s.jsx(a.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),s.jsx(na,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Next page",children:s.jsx(Ci,{size:18})})})]})})]})})}const ua=y(a.Menu.Item),da=y(a.Menu.Content),fa=y(a.Menu.Positioner),ha=y(a.Menu.Trigger);function ga({data:e=[],actions:t=[],actionConfig:n,onRowSelect:r,onRowSelectEvent:o="left",startIndex:i=0}){const{columnOrder:c,visibility:l,columnWidths:u}=Ze(re);return s.jsx(a.Table.Body,{children:e.map((d,g)=>s.jsxs(a.Table.Row,{onClick:()=>o==="left"&&r?.(d.__raw),_hover:{bg:"blue.50"},onContextMenu:o==="right"?f=>{f.preventDefault(),r?.(d.__raw,f)}:void 0,children:[n?.showSNo&&s.jsx(a.Table.Cell,{textAlign:"center",fontWeight:"medium",children:i+g+1}),c.filter(f=>l[f.id]).map(f=>s.jsx(a.Table.Cell,{w:u[f.id]?u[f.id]+"px":void 0,children:d[f.id]},f.id)),n?.showActionColumn&&s.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:s.jsxs(a.Menu.Root,{children:[s.jsx(ha,{asChild:!0,children:s.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:s.jsx(Ti,{size:16})})}),s.jsx(fa,{children:s.jsx(da,{children:t.filter(f=>typeof f.visible=="function"?f.visible(d.__raw):f.visible!==!1).map(f=>s.jsxs(ua,{onClick:()=>f.onClick(d.__raw),colorScheme:f.colorScheme,value:f.label,children:[f.icon,f.label]},f.label))})})]})}),n?.showColumnVisibilityMenu&&s.jsx(a.Table.Cell,{})]},d.__key||d.id))})}function pa({rows:e=6,columns:t}){return s.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>s.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,i)=>s.jsx(a.Table.Cell,{children:s.jsx(a.Skeleton,{height:"25px"})},i))},r))})}function va({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:i=!1,emptyMessage:c="No data",actions:l,page:u=1,pageSize:d=10,onPageChange:g,onPageSizeChange:f,density:x="sm",totalCount:p=0,actionConfig:m,pageSizeOptions:b,onRowSelect:S,onRowSelectEvent:_="left"}){h.useEffect(()=>{yr(e)},[e]),h.useEffect(()=>{br(t,n)},[t,n]),h.useEffect(()=>{m&&Sr(m)},[m]);const{sortColumn:R,sortDirection:M,data:k,columnOrder:I}=Ze(re),O=h.useMemo(()=>{const L=[...k];return R&&L.sort((P,D)=>M==="asc"?String(P[R]).localeCompare(String(D[R])):String(D[R]).localeCompare(String(P[R]))),L},[k,R,M,u,d]),$=h.useMemo(()=>(Math.max(1,u||1)-1)*d,[u,d]);h.useEffect(()=>{u<1&&g&&g(1)},[u,g]);const N=L=>{const{active:P,over:D}=L;if(!D||P.id===D.id)return;const w=I.findIndex(E=>E.id===P.id),C=I.findIndex(E=>E.id===D.id),j=wt(I,w,C);ei(j)},H=r&&!i,B=i&&!r,A=!r&&!i&&O.length===0;return s.jsx(ur,{collisionDetection:Kn,onDragEnd:N,children:s.jsx(gr,{items:I.map(L=>L.id),strategy:Ts,children:s.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[s.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[H&&s.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??s.jsx(a.Spinner,{})}),s.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:x,children:[s.jsx(Ki,{}),B?s.jsx(pa,{rows:d,columns:n.length+(l?2:0)}):A?s.jsx(a.Table.Body,{children:s.jsx(a.Table.Row,{children:s.jsx(a.Table.Cell,{colSpan:n.length+(l?1:0),children:s.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):s.jsx(ga,{data:O,actions:l,actionConfig:m,onRowSelect:S,startIndex:$,onRowSelectEvent:_})]},e)]}),s.jsx(a.Box,{mt:.5,children:s.jsx(ca,{totalCount:p,pageSize:d,currentPage:u,onPageChange:g,onPageSizeChange:L=>{f?.(L),u>1&&g?.(1)},pageSizeOptions:b})})]})})})}const ne=[];for(let e=0;e<256;++e)ne.push((e+256).toString(16).slice(1));function ma(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}let zt;const xa=new Uint8Array(16);function ba(){if(!zt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zt=crypto.getRandomValues.bind(crypto)}return zt(xa)}const ya=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fn={randomUUID:ya};function Sa(e,t,n){e=e||{};const r=e.random??e.rng?.()??ba();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ma(r)}function wa(e,t,n){return Fn.randomUUID&&!e?Fn.randomUUID():Sa(e)}const Ca=y(a.Checkbox.Root),Da=y(a.Checkbox.HiddenInput),ja=y(a.Checkbox.Control),Ra=y(a.Checkbox.Label),Tr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:i,required:c,errorText:l})=>s.jsxs(Ca,{value:e,onChange:t,size:n,children:[s.jsx(Da,{}),s.jsx(ja,{disabled:i,required:c,errorText:l,helperText:o}),r&&s.jsx(Ra,{children:r})]}),Ma=y(a.Combobox.Root),Ea=y(a.Combobox.Control),Ta=y(a.Combobox.Input),_a=y(a.Combobox.IndicatorGroup),Oa=y(a.Combobox.ClearTrigger),ka=y(a.Combobox.Trigger),Ia=y(a.Combobox.Positioner),$a=y(a.Combobox.Content);function _r({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:i,itemToValue:c,renderItem:l,value:u,loading:d,error:g,errorMessage:f,placeholder:x,helpText:p,onInputChange:m,onSelect:b,visible:S=!0,rootProps:_,inputProps:R,controlProps:M,contentProps:k,itemProps:I}){const[O,$]=h.useState(""),N=h.useMemo(()=>Array.isArray(o)?o:[],[o]),{collection:H,set:B}=a.useListCollection({initialItems:N,itemToString:i,itemToValue:c}),A=h.useMemo(()=>{if(!O)return N;const L=O.toLowerCase();return N.filter(P=>i(P).toLowerCase().includes(L))},[o,O,i]);return h.useEffect(()=>{B(A)},[A,B]),h.useEffect(()=>{u&&$(i(u))},[u,i]),s.jsxs(Ma,{width:n,size:t,variant:r,collection:H,placeholder:x,onInputValueChange:L=>{m?.(L.inputValue),$(L.inputValue)},value:u?[c(u)]:[],onValueChange:L=>{const P=L.value?.[0];if(!P)return;const D=H.items.find(w=>c(w)===P);D&&b?.(D)},positioning:{sameWidth:!1,placement:"bottom-start"},..._,children:[S&&e&&s.jsx(a.Text,{fontSize:"sm",children:e}),s.jsxs(Ea,{...M,children:[s.jsx(Ta,{placeholder:x??"Type to search",...R}),s.jsxs(_a,{children:[s.jsx(Oa,{}),s.jsx(ka,{})]})]}),s.jsx(Ia,{children:s.jsxs($a,{minW:"sm",...k,children:[d?s.jsxs(a.HStack,{p:"2",children:[s.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),s.jsx(a.Span,{children:"Loading..."})]}):g?s.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):H.items.map(L=>s.jsxs(a.Combobox.Item,{item:L,...I,children:[l(L),s.jsx(a.Combobox.ItemIndicator,{})]},c(L))),p&&!g&&!d&&s.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:p})]})})]})}const Aa=y(a.Popover.Root),La=y(a.Popover.Content),Pa=y(a.Popover.Arrow),za=y(a.Popover.Trigger),Na=y(a.Popover.Positioner);function Re(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Yn(e){const t=e.split(/\s+to\s+/i),n=t[0],r=t[1],o=l=>{if(!l)return null;const u=l.trim().split("-");if(u.length!==3)return null;const[d,g,f]=u,x=parseInt(d),p=parseInt(g)-1,m=parseInt(f);if(isNaN(x)||isNaN(p)||isNaN(m)||f.length!==4)return null;const b=new Date(m,p,x);return b.getDate()===x&&b.getMonth()===p?b:null},i=o(n),c=o(r);return{start:i,end:c}}function Or({startDate:e,endDate:t,onChange:n,width:r="280px",showLabel:o=!0,label:i="Select date range",visible:c=!0}){const[l,u]=h.useState(!1),[d,g]=h.useState(e||new Date),[f,x]=h.useState(null),[p,m]=h.useState(e||null),[b,S]=h.useState(t||null),_=(L,P)=>L&&P?`${Re(L)} to ${Re(P)}`:L?`${Re(L)}`:"",[R,M]=h.useState(_(e,t));h.useEffect(()=>{m(e||null),S(t||null)},[e,t]);const k=new Date(d.getFullYear(),d.getMonth()+1,0).getDate(),I=new Date(d.getFullYear(),d.getMonth(),1).getDay(),O=()=>{g(new Date(d.getFullYear(),d.getMonth()-1,1))},$=()=>{g(new Date(d.getFullYear(),d.getMonth()+1,1))},N=L=>{const P=new Date(d.getFullYear(),d.getMonth(),L);if(!p||p&&b){m(P),S(null),n(P,null),M(Re(P));return}if(p&&!b){const D=P<p?P:p,w=P<p?p:P;m(D),S(w),n(D,w),M(`${Re(D)} to ${Re(w)}`),u(!1)}},H=L=>{const P=L.target.value;M(P);const{start:D,end:w}=Yn(P);if(D&&w){const C=D<w?D:w,j=D<w?w:D;n(C,j),g(C)}else D&&!P.toLowerCase().includes("to")&&n(D,null)},B=L=>{if(L.key!=="Enter")return;const{start:P,end:D}=Yn(R);if(P&&!D&&!R.toLowerCase().includes("to")){const w=`${Re(P)} to `;M(w),m(P),S(null),n(P,null),requestAnimationFrame(()=>{L.target.setSelectionRange(w.length,w.length)});return}if(P&&D){const w=P<D?P:D,C=P<D?D:P;m(w),S(C),n(w,C),u(!1)}},A=()=>{m(null),S(null),M(""),n(null,null)};return s.jsxs(a.Box,{width:r,onKeyDown:B,children:[o&&!c&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:i}),s.jsxs(Aa,{open:l,onOpenChange:L=>u(L.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[s.jsx(a.Input,{placeholder:"DD-MM-YYYY to DD-MM-YYYY",value:R,onChange:H,size:"sm",autoComplete:"off"}),R&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:A,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",children:s.jsx(Er,{size:14})}),s.jsx(za,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Na,{children:s.jsxs(La,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Pa,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:O,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:d.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:$,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((L,P)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:L},`${L}-${P}`)),Array(I).fill(null).map((L,P)=>s.jsx(a.Box,{},`empty-${P}`)),Array.from({length:k},(L,P)=>{const D=P+1,w=new Date(d.getFullYear(),d.getMonth(),D);let C=e,j=t;if(C&&j&&f)if(e&&t){const V=e.getTime()+(t.getTime()-e.getTime())/2;f.getTime()<=V?C=f:j=f,C>j&&([C,j]=[j,C])}else e&&!t&&(C=f<e?f:e,j=f<e?e:f);const E=C&&w.getTime()===C.getTime(),z=j&&w.getTime()===j.getTime(),Y=C&&j&&w>C&&w<j;let v="transparent",T="gray";E||z?T="blue":Y&&(v="blue.100");let F="md";return Y&&(F="0"),E&&j&&(F=z?"md":"md 0 0 md"),z&&C&&(F=E?"md":"0 md md 0"),s.jsx(a.Button,{size:"xs",variant:"ghost",colorPalette:T,bg:v!=="transparent"?v:void 0,onClick:()=>N(D),onMouseEnter:()=>x(w),onMouseLeave:()=>x(null),minW:"32px",h:"32px",fontSize:"xs",borderRadius:F,_hover:{bg:E||z?void 0:"gray.100"},children:D},D)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Select Start Date then End Date"})]})})]})]})}const Fa=y(a.Popover.Root),Ya=y(a.Popover.Content),Ba=y(a.Popover.Arrow),Va=y(a.Popover.Trigger),Wa=y(a.Popover.Positioner);function Bn(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Ha(e){const t=e.split("-");if(t.length!==3)return null;const[n,r,o]=t,i=parseInt(n),c=parseInt(r)-1,l=parseInt(o);if(isNaN(i)||isNaN(c)||isNaN(l)||o.length!==4)return null;const u=new Date(l,c,i);return u.getDate()===i&&u.getMonth()===c?u:null}function kr({value:e,onChange:t,width:n="220px",visible:r=!0,label:o="Select date"}){const[i,c]=h.useState(!1),[l,u]=h.useState(e||new Date),[d,g]=h.useState(Bn(e));h.useEffect(()=>{g(Bn(e))},[e]);const f=new Date(l.getFullYear(),l.getMonth()+1,0).getDate(),x=new Date(l.getFullYear(),l.getMonth(),1).getDay(),p=()=>{u(new Date(l.getFullYear(),l.getMonth()-1,1))},m=()=>{u(new Date(l.getFullYear(),l.getMonth()+1,1))},b=R=>{const M=new Date(l.getFullYear(),l.getMonth(),R);t(M),c(!1)},S=R=>{if(i)switch(R.key){case"ArrowLeft":p();break;case"ArrowRight":m();break;case"Escape":c(!1);break}},_=()=>{g(""),t(null)};return s.jsxs(a.Box,{width:n,onKeyDown:S,children:[!r&&s.jsx(a.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:o}),s.jsxs(Fa,{open:i,onOpenChange:R=>c(R.open),positioning:{placement:"bottom-start",gutter:4},children:[s.jsxs(a.Group,{attached:!0,w:"full",position:"relative",children:[d&&s.jsx(a.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:_,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",zIndex:1,children:s.jsx(Er,{size:14})}),s.jsx(a.Input,{placeholder:"DD-MM-YYYY",value:d,onChange:R=>{const M=R.target.value;g(M);const k=Ha(M);k&&(t(k),u(k))},size:"sm",autoComplete:"off"}),s.jsx(Va,{asChild:!0,children:s.jsx(a.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:s.jsx(jr,{size:16})})})]}),s.jsx(Wa,{children:s.jsxs(Ya,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[s.jsx(Ba,{}),s.jsxs(a.HStack,{justify:"space-between",mb:4,children:[s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:p,"aria-label":"Previous month",children:"‹"}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:l.toLocaleString("default",{month:"long",year:"numeric"})}),s.jsx(a.IconButton,{size:"xs",variant:"ghost",onClick:m,"aria-label":"Next month",children:"›"})]}),s.jsxs(a.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((R,M)=>s.jsx(a.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:R},`${R}-${M}`)),Array(x).fill(null).map((R,M)=>s.jsx(a.Box,{},`empty-${M}`)),Array.from({length:f},(R,M)=>{const k=M+1,I=e&&e.getDate()===k&&e.getMonth()===l.getMonth()&&e.getFullYear()===l.getFullYear();return s.jsx(a.Button,{size:"xs",variant:I?"solid":"ghost",colorPalette:I?"blue":"gray",onClick:()=>b(k),minW:"32px",h:"32px",fontSize:"xs",borderRadius:"md",children:k},k)})]}),s.jsx(a.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Use Arrow Keys to change months • Esc to close"})]})})]})]})}const Ua=y(a.Field.Root),Ga=y(a.Field.Label),qa=y(a.Field.HelperText),Xa=y(a.Field.ErrorText),Gt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:i="outline",width:c="100%",label:l,helperText:u,isDisabled:d=!1,required:g=!1,errorText:f,visible:x,type:p="text",min:m=0,max:b=100,step:S=1})=>s.jsxs(Ua,{width:c,children:[x&&s.jsx(Ga,{children:l}),s.jsx(a.InputGroup,{startElement:e,children:s.jsx(a.Input,{value:t,onChange:_=>n?.(_.target.value),placeholder:r,size:o,type:p,variant:i,disabled:d,required:g,min:m,max:b,step:S})}),f&&s.jsx(Xa,{fontSize:"xs",children:f}),u&&s.jsx(qa,{fontSize:"xs",children:u})]}),Ka=y(a.Field.Root),Ja=y(a.Field.HelperText),Za=y(a.Field.ErrorText),Qa=y(a.Select.Root),el=y(a.Select.Label),tl=y(a.Select.Control),nl=y(a.Select.Trigger),rl=y(a.Select.ValueText),ol=y(a.Select.IndicatorGroup),sl=y(a.Select.Indicator),il=y(a.Select.Content),al=y(a.Select.Item),ll=y(a.Select.ItemIndicator),cl=y(a.Select.HiddenSelect),ul=y(a.Select.Positioner),Ir=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:i="xs",width:c="100%",variant:l="outline",helperText:u,isDisabled:d,required:g,errorText:f,visible:x})=>{const p=h.useMemo(()=>a.createListCollection({items:e}),[e]),m=e.find(S=>S.value===n),b=S=>{S.preventDefault(),S.stopPropagation(),r?.(void 0)};return s.jsxs(Ka,{disabled:d,required:g,children:[s.jsxs(Qa,{collection:p,variant:l,size:i,width:c,value:n?[n]:[],onValueChange:S=>{r?.(S.value[0])},children:[s.jsx(cl,{}),x&&s.jsx(el,{children:t}),s.jsxs(tl,{children:[s.jsx(nl,{children:s.jsx(rl,{placeholder:o,children:m?.displayValue??m?.label})}),s.jsxs(ol,{children:[n&&!d&&s.jsx("div",{style:{pointerEvents:"auto",display:"flex",alignItems:"center"},onPointerDown:S=>S.stopPropagation(),onClick:S=>S.stopPropagation(),children:s.jsx(a.CloseButton,{size:"sm",variant:"ghost",onPointerDown:b,onClick:b,position:"relative",zIndex:10})}),s.jsx(sl,{})]})]}),s.jsx(ul,{children:s.jsx(il,{children:p.items.map((S,_)=>s.jsxs(al,{item:S,children:[S.label,s.jsx(ll,{})]},_))})})]}),u&&s.jsx(Ja,{children:u}),f&&s.jsx(Za,{children:f})]})},dl="FILTER_PRESETS_",$r=e=>`${dl}${e}`,Dt=e=>{if(typeof window>"u")return[];const t=localStorage.getItem($r(e));try{return t?JSON.parse(t):[]}catch(n){return console.error("Failed to parse presets",n),[]}},sn=(e,t)=>{typeof window>"u"||(localStorage.setItem($r(e),JSON.stringify(t)),window.dispatchEvent(new Event("storage_updated")))},Ar=(e,t)=>{const n=Dt(e);sn(e,[t,...n])},Lr=(e,t)=>{const n=Dt(e).filter(r=>r.id!==t);sn(e,n)},fl=y(a.Checkbox.Root),hl=y(a.Checkbox.HiddenInput),gl=y(a.Checkbox.Control),pl=y(a.Slider.Root),vl=y(a.Slider.Track),ml=y(a.Slider.Range),xl=y(a.Slider.Thumbs),bl=y(a.Slider.Control),yl=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:i,transform:c,transition:l}=vr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:l};return s.jsxs(a.VStack,{ref:i,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[s.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[s.jsx(Rr,{size:16}),s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),s.jsxs(a.HStack,{justify:"space-between",children:[s.jsx(a.Text,{fontSize:"sm",children:"Visible"}),s.jsxs(fl,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[s.jsx(hl,{}),s.jsx(gl,{})]})]}),s.jsxs(a.VStack,{align:"stretch",gap:1,children:[s.jsx(a.Text,{fontSize:"sm",children:"Size"}),s.jsx(pl,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:s.jsxs(bl,{children:[s.jsx(vl,{children:s.jsx(ml,{})}),s.jsx(xl,{})]})})]})]})},Sl=y(a.Drawer.Root),wl=y(a.Drawer.Trigger),Cl=y(a.Drawer.Backdrop),Dl=y(a.Drawer.Positioner),jl=y(a.Drawer.Content),Rl=y(a.Drawer.Header),Ml=y(a.Drawer.Title),El=y(a.Drawer.Body),Tl=y(a.Drawer.Footer),_l=y(a.Drawer.CloseTrigger),Ol=y(a.Tabs.Root),kl=y(a.Tabs.List),Nt=y(a.Tabs.Trigger),Ft=y(a.Tabs.Content),Pr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return s.jsx(Gt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return s.jsx(Gt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return s.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return s.jsx(Ir,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return s.jsx(kr,{value:e.value,onChange:e.onChange,visible:t,label:e.label});case"date-range":return s.jsx(Or,{startDate:e.startDate?new Date(e.startDate):void 0,endDate:e.endDate?new Date(e.endDate):void 0,onChange:e.onChange,visible:t,label:e.label});case"combobox":return s.jsx(_r,{visible:!0,label:e.label,itemToString:n=>String(n.label),itemToValue:n=>n.value,renderItem:n=>s.jsx("span",{children:n.label})});default:return null}},Il=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:i="default",onLoadPreset:c,activePresetName:l,onReorder:u,open:d,onOpenChange:g})=>{const[f,x]=h.useState([]);h.useEffect(()=>{const m=()=>{x(Dt(i))};return m(),window.addEventListener("storage",m),window.addEventListener("storage_updated",m),()=>{window.removeEventListener("storage",m),window.removeEventListener("storage_updated",m)}},[i]);const p=()=>{const m=prompt("Preset name?");if(!m)return;const b=o.reduce((S,_)=>(S[_.id]=_.value,S),{});Ar(i,{id:wa(),name:m,date:new Date().toISOString(),values:b})};return s.jsx(a.HStack,{wrap:"wrap",children:s.jsxs(Sl,{size:e,open:d,onOpenChange:g,children:[s.jsx(wl,{asChild:!0,children:s.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[s.jsx(Oi,{size:16}),"Filters"]})}),s.jsxs(a.Portal,{children:[s.jsx(Cl,{}),s.jsx(Dl,{children:s.jsxs(jl,{children:[s.jsx(Rl,{children:s.jsx(Ml,{children:"Filters"})}),s.jsx(El,{overflowY:"auto",pt:1,children:s.jsxs(Ol,{defaultValue:"view",children:[s.jsxs(kl,{mb:4,children:[s.jsxs(Nt,{value:"view",children:[s.jsx($i,{size:16}),"Edit"]}),s.jsxs(Nt,{value:"settings",children:[s.jsx(zi,{size:16}),"Settings"]}),s.jsxs(Nt,{value:"presets",children:[s.jsx(xi,{size:16}),"Presets"]})]}),s.jsx(Ft,{value:"view",children:o.filter(m=>m.visible).map(m=>s.jsx(a.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:m.size??1,minW:`${(m.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Pr(m,d)},m.id))}),s.jsx(Ft,{value:"settings",children:s.jsx(ur,{sensors:vo(po(on)),collisionDetection:Kn,onDragEnd:({active:m,over:b})=>{if(!b||m.id===b.id)return;const S=o.findIndex(M=>M.id===m.id),_=o.findIndex(M=>M.id===b.id),R=wt(o,S,_);u?.(R)},children:s.jsx(gr,{items:o.map(m=>m.id),strategy:Os,children:o.map(m=>s.jsx(yl,{filter:m,onVisibilityChange:t,onSizeChange:n},m.id))})})}),s.jsx(Ft,{value:"presets",children:s.jsxs(a.VStack,{align:"stretch",mb:3,children:[f.length===0&&s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),f.map(m=>s.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:l===m.name?"blue.300":"gray.200",rounded:"md",p:2,children:[s.jsxs(a.VStack,{align:"start",gap:0,children:[s.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:m.name}),s.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(m.date).toLocaleDateString()})]}),s.jsxs(a.HStack,{children:[s.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const b=o.map(S=>({...S,value:m.values[S.id]??S.value}));c?.(b,m.name)},children:"Load"}),s.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Lr(i,m.id),children:s.jsx(Mi,{size:14})})]})]},m.id)),s.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:p,children:"Save Current Filters"})]})})]})}),s.jsx(Tl,{justify:"space-between",children:s.jsx(_l,{asChild:!0,children:s.jsx(a.CloseButton,{})})})]})})]})]})})},$l=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,onLoadPreset:u,activePresetName:d,filterDrawerSize:g="sm"})=>{const[f,x]=h.useState(!1);return s.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,s.jsxs(a.HStack,{gapX:1,children:[t.filter(p=>p.visible!==!1).map(p=>s.jsx(a.HStack,{flex:p.size??1,minW:`${(p.size??1)*100}px`,alignItems:"center",children:Pr(p)},p.id)),s.jsx(Il,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:i,maxToolbarUnits:c,pageKey:l,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:p=>{x(p.open)}})]})]})},Al=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Ll=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Pl=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:i,isDisabled:c,colorScheme:l,loading:u,loadingText:d,rounded:g,type:f="button",textColor:x="white",borderColor:p})=>s.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:c,loading:u,loadingText:d,rounded:g,type:f,background:l,color:x,border:p,children:s.jsxs(a.HStack,{gap:1,children:[o,r,i]})}),zl=y(a.Dialog.Root),Nl=y(a.Dialog.Backdrop),Fl=y(a.Dialog.Positioner),Yl=y(a.Dialog.Content),Bl=y(a.Dialog.Header),Vl=y(a.Dialog.Body),Wl=y(a.Dialog.Footer),Hl=y(a.Dialog.Title),Ul=y(a.Dialog.CloseTrigger);function Gl({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:i="Confirm",cancelLabel:c="Cancel",icon:l,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return s.jsx(zl,{open:e,placement:"center",onOpenChange:g=>!g.open&&t(),children:s.jsxs(a.Portal,{children:[s.jsx(Nl,{}),s.jsx(Fl,{children:s.jsxs(Yl,{maxW:"480px",children:[s.jsx(Bl,{borderBottom:"1px solid",borderColor:"gray.200",children:s.jsx(Hl,{children:r})}),s.jsx(Vl,{p:6,children:s.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[s.jsx(a.Box,{color:"orange.500",children:l??s.jsx(Mr,{size:40})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),s.jsxs(Wl,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:c}),s.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:i})]}),s.jsx(Ul,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const ql=y(a.Dialog.Root),Xl=y(a.Dialog.Backdrop),Kl=y(a.Dialog.Positioner),Jl=y(a.Dialog.Content),Zl=y(a.Dialog.Header),Ql=y(a.Dialog.Body),ec=y(a.Dialog.Footer),tc=y(a.Dialog.Title),nc=y(a.Dialog.CloseTrigger);function rc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:i="DELETE",confirmLabel:c="Delete",isLoading:l=!1}){const[u,d]=h.useState(""),g=u===i;return s.jsx(ql,{open:e,placement:"center",onOpenChange:f=>{!f.open&&t(),d("")},children:s.jsxs(a.Portal,{children:[s.jsx(Xl,{}),s.jsx(Kl,{children:s.jsxs(Jl,{maxW:"550px",children:[s.jsx(Zl,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:s.jsx(tc,{color:"red.600",children:r})}),s.jsx(Ql,{p:2,style:{padding:"16px"},children:s.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[s.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:s.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[s.jsx(a.Box,{color:"red.600",mt:"2px",children:s.jsx(Mr,{size:20})}),s.jsxs(a.Box,{children:[s.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),s.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",s.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),s.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),s.jsxs(a.Box,{children:[s.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",s.jsx("b",{children:i})," to continue"]}),s.jsx(a.Input,{placeholder:`Type ${i} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),s.jsxs(ec,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[s.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),s.jsx(a.Button,{size:"sm",disabled:!g,style:{backgroundColor:"#FF0000"},loading:l,onClick:n,children:c})]}),s.jsx(nc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const zr=({children:e})=>s.jsx(s.Fragment,{children:e}),Nr=({children:e})=>s.jsx(s.Fragment,{children:e}),oc=a.Button,sc=y(a.Dialog.Root),ic=y(a.Dialog.Backdrop),ac=y(a.Dialog.Positioner),lc=y(a.Dialog.Content),cc=y(a.Dialog.Header),uc=y(a.Dialog.Body),dc=y(a.Dialog.Footer),fc=y(a.Dialog.Title),hc=y(a.Dialog.CloseTrigger);function gc(e){let t=null,n=null;return h.Children.forEach(e,r=>{h.isValidElement(r)&&(r.type===zr&&(t=r.props.children),r.type===Nr&&(n=r.props.children))}),{body:t,actions:n}}const pc=({open:e,onClose:t,title:n,children:r,width:o,position:i,refetch:c,loading:l=!1})=>{const{body:u,actions:d}=gc(r);return s.jsx(sc,{open:e,onOpenChange:g=>!g.open&&t(),placement:i??"center",children:s.jsxs(a.Portal,{children:[s.jsx(ic,{bg:"blackAlpha.400"}),s.jsx(ac,{children:s.jsxs(lc,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[s.jsx(cc,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:s.jsxs(a.Flex,{align:"center",justify:"space-between",children:[s.jsx(fc,{fontSize:"16px",fontWeight:"600",children:n}),s.jsx(hc,{asChild:!0,children:s.jsx(a.CloseButton,{size:"sm"})}),c&&s.jsx(an,{label:"Refresh",refetch:c,isLoading:l})]})}),u&&s.jsx(uc,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:s.jsx(a.Flex,{direction:"column",gap:"16px",children:u})}),d&&s.jsx(dc,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:s.jsx(a.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},vc=y(a.Field.Root),mc=y(a.Field.Label),xc=y(a.Field.HelperText),bc=y(a.Field.ErrorText),yc=y(a.PinInput.Input),Sc=y(a.PinInput.Control),wc=y(a.PinInput.HiddenInput),Cc=y(a.PinInput.Root),Dc=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:i,helperText:c,errorText:l,required:u=!1,visible:d=!0})=>{const g=Array.from({length:n}).map((f,x)=>e?.[x]??"");return s.jsxs(vc,{children:[d&&i&&s.jsxs(mc,{children:[i,u&&" *"]}),s.jsxs(Cc,{value:g,onValueChange:f=>t?.(f.value.join("")),disabled:o,size:r,children:[s.jsx(wc,{}),s.jsx(Sc,{children:s.jsx(a.HStack,{children:Array.from({length:n}).map((f,x)=>s.jsx(yc,{index:x},x))})})]}),l&&s.jsx(bc,{fontSize:"xs",children:l}),c&&!l&&s.jsx(xc,{fontSize:"xs",children:c})]})};function an({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=h.useState(!1),i=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return s.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:i,ml:2,children:s.jsx(Li,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var ct={exports:{}},jc=ct.exports,Vn;function Rc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(jc,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",c="second",l="minute",u="hour",d="day",g="week",f="month",x="quarter",p="year",m="date",b="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var w=["th","st","nd","rd"],C=D%100;return"["+D+(w[(C-20)%10]||w[C]||w[0])+"]"}},M=function(D,w,C){var j=String(D);return!j||j.length>=w?D:""+Array(w+1-j.length).join(C)+D},k={s:M,z:function(D){var w=-D.utcOffset(),C=Math.abs(w),j=Math.floor(C/60),E=C%60;return(w<=0?"+":"-")+M(j,2,"0")+":"+M(E,2,"0")},m:function D(w,C){if(w.date()<C.date())return-D(C,w);var j=12*(C.year()-w.year())+(C.month()-w.month()),E=w.clone().add(j,f),z=C-E<0,Y=w.clone().add(j+(z?-1:1),f);return+(-(j+(C-E)/(z?E-Y:Y-E))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:p,w:g,d,D:m,h:u,m:l,s:c,ms:i,Q:x}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},I="en",O={};O[I]=R;var $="$isDayjsObject",N=function(D){return D instanceof L||!(!D||!D[$])},H=function D(w,C,j){var E;if(!w)return I;if(typeof w=="string"){var z=w.toLowerCase();O[z]&&(E=z),C&&(O[z]=C,E=z);var Y=w.split("-");if(!E&&Y.length>1)return D(Y[0])}else{var v=w.name;O[v]=w,E=v}return!j&&E&&(I=E),E||!j&&I},B=function(D,w){if(N(D))return D.clone();var C=typeof w=="object"?w:{};return C.date=D,C.args=arguments,new L(C)},A=k;A.l=H,A.i=N,A.w=function(D,w){return B(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var L=(function(){function D(C){this.$L=H(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[$]=!0}var w=D.prototype;return w.parse=function(C){this.$d=(function(j){var E=j.date,z=j.utc;if(E===null)return new Date(NaN);if(A.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var Y=E.match(S);if(Y){var v=Y[2]-1||0,T=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,T)):new Date(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,T)}}return new Date(E)})(C),this.init()},w.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},w.$utils=function(){return A},w.isValid=function(){return this.$d.toString()!==b},w.isSame=function(C,j){var E=B(C);return this.startOf(j)<=E&&E<=this.endOf(j)},w.isAfter=function(C,j){return B(C)<this.startOf(j)},w.isBefore=function(C,j){return this.endOf(j)<B(C)},w.$g=function(C,j,E){return A.u(C)?this[j]:this.set(E,C)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(C,j){var E=this,z=!!A.u(j)||j,Y=A.p(C),v=function(J,W){var ie=A.w(E.$u?Date.UTC(E.$y,W,J):new Date(E.$y,W,J),E);return z?ie:ie.endOf(d)},T=function(J,W){return A.w(E.toDate()[J].apply(E.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(W)),E)},F=this.$W,V=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(Y){case p:return z?v(1,0):v(31,11);case f:return z?v(1,V):v(0,V+1);case g:var U=this.$locale().weekStart||0,K=(F<U?F+7:F)-U;return v(z?q-K:q+(6-K),V);case d:case m:return T(X+"Hours",0);case u:return T(X+"Minutes",1);case l:return T(X+"Seconds",2);case c:return T(X+"Milliseconds",3);default:return this.clone()}},w.endOf=function(C){return this.startOf(C,!1)},w.$set=function(C,j){var E,z=A.p(C),Y="set"+(this.$u?"UTC":""),v=(E={},E[d]=Y+"Date",E[m]=Y+"Date",E[f]=Y+"Month",E[p]=Y+"FullYear",E[u]=Y+"Hours",E[l]=Y+"Minutes",E[c]=Y+"Seconds",E[i]=Y+"Milliseconds",E)[z],T=z===d?this.$D+(j-this.$W):j;if(z===f||z===p){var F=this.clone().set(m,1);F.$d[v](T),F.init(),this.$d=F.set(m,Math.min(this.$D,F.daysInMonth())).$d}else v&&this.$d[v](T);return this.init(),this},w.set=function(C,j){return this.clone().$set(C,j)},w.get=function(C){return this[A.p(C)]()},w.add=function(C,j){var E,z=this;C=Number(C);var Y=A.p(j),v=function(V){var q=B(z);return A.w(q.date(q.date()+Math.round(V*C)),z)};if(Y===f)return this.set(f,this.$M+C);if(Y===p)return this.set(p,this.$y+C);if(Y===d)return v(1);if(Y===g)return v(7);var T=(E={},E[l]=r,E[u]=o,E[c]=n,E)[Y]||1,F=this.$d.getTime()+C*T;return A.w(F,this)},w.subtract=function(C,j){return this.add(-1*C,j)},w.format=function(C){var j=this,E=this.$locale();if(!this.isValid())return E.invalidDate||b;var z=C||"YYYY-MM-DDTHH:mm:ssZ",Y=A.z(this),v=this.$H,T=this.$m,F=this.$M,V=E.weekdays,q=E.months,X=E.meridiem,U=function(W,ie,oe,he){return W&&(W[ie]||W(j,z))||oe[ie].slice(0,he)},K=function(W){return A.s(v%12||12,W,"0")},J=X||function(W,ie,oe){var he=W<12?"AM":"PM";return oe?he.toLowerCase():he};return z.replace(_,(function(W,ie){return ie||(function(oe){switch(oe){case"YY":return String(j.$y).slice(-2);case"YYYY":return A.s(j.$y,4,"0");case"M":return F+1;case"MM":return A.s(F+1,2,"0");case"MMM":return U(E.monthsShort,F,q,3);case"MMMM":return U(q,F);case"D":return j.$D;case"DD":return A.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return U(E.weekdaysMin,j.$W,V,2);case"ddd":return U(E.weekdaysShort,j.$W,V,3);case"dddd":return V[j.$W];case"H":return String(v);case"HH":return A.s(v,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(v,T,!0);case"A":return J(v,T,!1);case"m":return String(T);case"mm":return A.s(T,2,"0");case"s":return String(j.$s);case"ss":return A.s(j.$s,2,"0");case"SSS":return A.s(j.$ms,3,"0");case"Z":return Y}return null})(W)||Y.replace(":","")}))},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(C,j,E){var z,Y=this,v=A.p(j),T=B(C),F=(T.utcOffset()-this.utcOffset())*r,V=this-T,q=function(){return A.m(Y,T)};switch(v){case p:z=q()/12;break;case f:z=q();break;case x:z=q()/3;break;case g:z=(V-F)/6048e5;break;case d:z=(V-F)/864e5;break;case u:z=V/o;break;case l:z=V/r;break;case c:z=V/n;break;default:z=V}return E?z:A.a(z)},w.daysInMonth=function(){return this.endOf(f).$D},w.$locale=function(){return O[this.$L]},w.locale=function(C,j){if(!C)return this.$L;var E=this.clone(),z=H(C,j,!0);return z&&(E.$L=z),E},w.clone=function(){return A.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D})(),P=L.prototype;return B.prototype=P,[["$ms",i],["$s",c],["$m",l],["$H",u],["$W",d],["$M",f],["$y",p],["$D",m]].forEach((function(D){P[D[1]]=function(w){return this.$g(w,D[0],D[1])}})),B.extend=function(D,w){return D.$i||(D(w,L,B),D.$i=!0),B},B.locale=H,B.isDayjs=N,B.unix=function(D){return B(1e3*D)},B.en=O[I],B.Ls=O,B.p={},B}))})(ct)),ct.exports}var Mc=Rc();const jt=xt(Mc);var ut={exports:{}},Ec=ut.exports,Wn;function Tc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Ec,(function(){return function(n,r,o){n=n||{};var i=r.prototype,c={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(d,g,f,x){return i.fromToBase(d,g,f,x)}o.en.relativeTime=c,i.fromToBase=function(d,g,f,x,p){for(var m,b,S,_=f.$locale().relativeTime||c,R=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],M=R.length,k=0;k<M;k+=1){var I=R[k];I.d&&(m=x?o(d).diff(f,I.d,!0):f.diff(d,I.d,!0));var O=(n.rounding||Math.round)(Math.abs(m));if(S=m>0,O<=I.r||!I.r){O<=1&&k>0&&(I=R[k-1]);var $=_[I.l];p&&(O=p(""+O)),b=typeof $=="string"?$.replace("%d",O):$(O,g,I.l,S);break}}if(g)return b;var N=S?_.future:_.past;return typeof N=="function"?N(b):N.replace("%s",b)},i.to=function(d,g){return l(d,g,this,!0)},i.from=function(d,g){return l(d,g,this)};var u=function(d){return d.$u?o.utc():o()};i.toNow=function(d){return this.to(u(this),d)},i.fromNow=function(d){return this.from(u(this),d)}}}))})(ut)),ut.exports}var _c=Tc();const Oc=xt(_c);var dt={exports:{}},kc=dt.exports,Hn;function Ic(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(kc,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var c=o.prototype,l=c.format;i.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,g=(function(f,x){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,m,b){var S=b&&b.toUpperCase();return m||x[b]||n[b]||x[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,R,M){return R||M.slice(1)}))}))})(u,d===void 0?{}:d);return l.call(this,g)}}}))})(dt)),dt.exports}var $c=Ic();const Ac=xt($c);var ft={exports:{}},Lc=ft.exports,Un;function Pc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Lc,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(c){var l=this,u=this.$locale();if(!this.isValid())return i.bind(this)(c);var d=this.$utils(),g=(c||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return d.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return d.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return d.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return i.bind(this)(g)}}}))})(ft)),ft.exports}var zc=Pc();const Nc=xt(zc);jt.extend(Oc);jt.extend(Ac);jt.extend(Nc);const Fc={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function qt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=jt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Fc[t]):r}function Yc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:i="start",dateColor:c="gray.700",dateFontSize:l="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:g="12px",timeFontWeight:f="400",showTime:x=!0}){return s.jsxs(a.Stack,{gap:.5,align:i,children:[s.jsx(a.Text,{fontSize:l,fontWeight:u,color:c,children:qt({value:e,variant:t,format:r})}),x&&s.jsx(a.Text,{fontSize:g,fontWeight:f,color:d,children:qt({value:e,variant:n,format:o})})]})}class Fr{state=new Map;listeners=new Map;get(t){return this.state.get(t)}set(t){this.state.set(t.key,t),this.notify(t.key)}setMany(t){t.forEach(n=>this.set(n))}subscribe(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),n(this.state.get(t)),()=>{this.listeners.get(t)?.delete(n)}}notify(t){this.listeners.get(t)?.forEach(n=>n(this.state.get(t)))}clear(){this.state.clear()}}class Xt{constructor(t){this.baseUrl=t}async fetchLatest(t){const n=new URLSearchParams;return n.set("keys",t.join(",")),(await(await fetch(`${this.baseUrl}/options?${n}`)).json()).data}}class Kt{constructor(t){this.api=t}store=new Fr;inflight=new Map;getRaw(t){return this.store.get(t)}async getKey(t){const n=this.store.get(t);return n?n.value:(await this.fetchMissing([t]),this.store.get(t)?.value)}async getMultiKey(t){const n={},r=[];for(const o of t){const i=this.store.get(o);i?n[o]=i.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const i=this.store.get(o);i&&(n[o]=i.value)})),n}subscribe(t,n){return this.store.subscribe(t,n)}hydrate(t){this.store.setMany(t)}clear(){this.store.clear()}async fetchMissing(t){const n=t.filter(o=>!this.inflight.has(o));if(!n.length)return;const r=this.api.fetchLatest(n).then(o=>{this.store.setMany(o),n.forEach(i=>this.inflight.delete(i))});n.forEach(o=>this.inflight.set(o,r)),await r}}const Yr=h.createContext(null);function Br(){const e=h.useContext(Yr);if(!e)throw new Error("OptionsProvider is missing. Wrap your app with <OptionsProvider />");return e}function Bc({client:{apiUrl:e},children:t}){const n=h.useRef(new Kt(new Xt(e)));return n.current||(n.current=new Kt(new Xt(e))),s.jsx(Yr.Provider,{value:n.current,children:t})}function Vc(e){const t=Br(),[n,r]=h.useState(t.getRaw(e)?.value);return h.useEffect(()=>{let o=!0;t.getKey(e).then(c=>{o&&r(c)});const i=t.subscribe(e,c=>{r(c?.value)});return()=>{o=!1,i()}},[e,t]),n}function Wc(e){const t=Br(),[n,r]=h.useState({});return h.useEffect(()=>{let o=!0;t.getMultiKey(e).then(c=>{o&&r(c)});const i=e.map(c=>t.subscribe(c,l=>{r(u=>({...u,[c]:l?.value}))}));return()=>{o=!1,i.forEach(c=>c())}},[e.join("|"),t]),n}async function Hc(e,t){return e.getKey(t)}async function Uc(e,t){await e.getMultiKey(t)}function Gc(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=h.useState(t),[i,c]=h.useState(n),l=h.useCallback(x=>{o(Math.max(1,x))},[]),u=h.useCallback(x=>{c(Math.max(1,x)),o(1)},[]),d=h.useCallback(()=>{o(x=>x+1)},[]),g=h.useCallback(()=>{o(x=>Math.max(1,x-1))},[]),f=h.useCallback(()=>{o(t),c(n)},[t,n]);return{page:r,limit:i,setPage:l,setLimit:u,nextPage:d,prevPage:g,reset:f}}function qc(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=h.useState(t),i=Xc(r,n),c=h.useCallback(u=>{o(u)},[]),l=h.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:i,onSearchChange:c,reset:l}}function Xc(e,t=300){const[n,r]=h.useState(e);return h.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}exports.DataTable=va;exports.Filters=$l;exports.HttpOptionsApi=Xt;exports.MDSButton=Pl;exports.MDSCheckbox=Tr;exports.MDSCombobox=_r;exports.MDSConfirmActionDialog=Gl;exports.MDSConfirmDeleteDialog=rc;exports.MDSDatePicker=kr;exports.MDSDateRangePicker=Or;exports.MDSDialogAction=oc;exports.MDSDialogActions=Nr;exports.MDSDialogBody=zr;exports.MDSDialogWrapper=pc;exports.MDSInput=Gt;exports.MDSPinInput=Dc;exports.MDSRefreshButton=an;exports.MDSSelectBox=Ir;exports.OptionsClientImpl=Kt;exports.OptionsProvider=Bc;exports.OptionsStore=Fr;exports.RefreshButton=an;exports.StackedDateTime=Yc;exports.addPreset=Ar;exports.deletePreset=Lr;exports.formatDateTime=qt;exports.getColumnWidthKey=Ct;exports.getOption=Hc;exports.getPresets=Dt;exports.loadOrder=Ll;exports.prefetchOptions=Uc;exports.saveOrder=Al;exports.savePresets=sn;exports.setActionsConfig=Sr;exports.setColumnWidth=Qs;exports.setData=br;exports.setTableId=yr;exports.tableStore=re;exports.useDebouncedSearch=qc;exports.useOption=Vc;exports.useOptions=Wc;exports.usePagination=Gc;exports.withChildren=y;
10
+ `},ho={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function go(e){let{announcements:t=ho,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=fo}=e;const{announce:s,announcement:a}=co(),l=Qe("DndLiveRegion"),[u,d]=f.useState(!1);if(f.useEffect(()=>{d(!0)},[]),lo(f.useMemo(()=>({onDragStart(g){let{active:v}=g;s(t.onDragStart({active:v}))},onDragMove(g){let{active:v,over:h}=g;t.onDragMove&&s(t.onDragMove({active:v,over:h}))},onDragOver(g){let{active:v,over:h}=g;s(t.onDragOver({active:v,over:h}))},onDragEnd(g){let{active:v,over:h}=g;s(t.onDragEnd({active:v,over:h}))},onDragCancel(g){let{active:v,over:h}=g;s(t.onDragCancel({active:v,over:h}))}}),[s,t])),!u)return null;const p=f.createElement(f.Fragment,null,f.createElement(io,{id:r,value:o.draggable}),f.createElement(ao,{id:l,announcement:a}));return n?He.createPortal(p,n):p}var Z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Z||(Z={}));function mt(){}function po(e,t){return f.useMemo(()=>({sensor:e,options:{}}),[e,t])}function vo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function mo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function bo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function yo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Dn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Dn(t,t.left,t.top),s=[];for(const a of r){const{id:l}=a,u=n.get(l);if(u){const d=mo(Dn(u),o);s.push({id:l,data:{droppableContainer:a,value:d}})}}return s.sort(xo)};function So(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,p=a*l,g=p/(u+d-p);return Number(g.toFixed(4))}return 0}const wo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=So(l,t);u>0&&o.push({id:a,data:{droppableContainer:s,value:u}})}}return o.sort(bo)};function Do(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function Co(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const jo=Co(1);function Ro(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Eo(e,t,n){const r=Ro(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:l}=r,u=e.left-a-(1-o)*parseFloat(n),d=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),p=o?e.width/o:e.width,g=s?e.height/s:e.height;return{width:p,height:g,top:d,right:u+p,bottom:d+g,left:u}}const Mo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=Mo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:p}=ie(e).getComputedStyle(e);d&&(n=Eo(n,d,p))}const{top:r,left:o,width:s,height:a,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:a,bottom:l,right:u}}function Cn(e){return Ne(e,{ignoreTransform:!0})}function To(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Oo(e,t){return t===void 0&&(t=ie(e).getComputedStyle(e)),t.position==="fixed"}function _o(e,t){t===void 0&&(t=ie(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function on(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(tn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Je(o)||Kn(o)||n.includes(o))return n;const s=ie(e).getComputedStyle(o);return o!==e&&_o(o,s)&&n.push(o),Oo(o,s)?n:r(o.parentNode)}return e?r(e):n}function tr(e){const[t]=on(e,1);return t??null}function It(e){return!St||!e?null:Le(e)?e:en(e)?tn(e)||e===Pe(e).scrollingElement?window:Je(e)?e:null:null}function nr(e){return Le(e)?e.scrollX:e.scrollLeft}function rr(e){return Le(e)?e.scrollY:e.scrollTop}function Ht(e){return{x:nr(e),y:rr(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function or(e){return!St||!e?!1:e===document.scrollingElement}function sr(e){const t={x:0,y:0},n=or(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const Io={x:.2,y:.2};function ko(e,t,n,r,o){let{top:s,left:a,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Io);const{isTop:d,isBottom:p,isLeft:g,isRight:v}=sr(e),h={x:0,y:0},S={x:0,y:0},x={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+x.height?(h.y=Q.Backward,S.y=r*Math.abs((t.top+x.height-s)/x.height)):!p&&u>=t.bottom-x.height&&(h.y=Q.Forward,S.y=r*Math.abs((t.bottom-x.height-u)/x.height)),!v&&l>=t.right-x.width?(h.x=Q.Forward,S.x=r*Math.abs((t.right-x.width-l)/x.width)):!g&&a<=t.left+x.width&&(h.x=Q.Backward,S.x=r*Math.abs((t.left+x.width-a)/x.width)),{direction:h,speed:S}}function $o(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ir(e){return e.reduce((t,n)=>ke(t,Ht(n)),pe)}function Ao(e){return e.reduce((t,n)=>t+nr(n),0)}function Lo(e){return e.reduce((t,n)=>t+rr(n),0)}function Po(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);tr(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const No=[["x",["left","right"],Ao],["y",["top","bottom"],Lo]];class sn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=on(n),o=ir(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,l]of No)for(const u of a)Object.defineProperty(this,u,{get:()=>{const d=l(r),p=o[s]-d;return this.rect[u]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ue{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function zo(e){const{EventTarget:t}=ie(e);return e instanceof t?e:Pe(e)}function kt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function jn(e){e.preventDefault()}function Fo(e){e.stopPropagation()}var G;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(G||(G={}));const ar={start:[G.Space,G.Enter],cancel:[G.Esc],end:[G.Space,G.Enter,G.Tab]},Yo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case G.Right:return{...n,x:n.x+25};case G.Left:return{...n,x:n.x-25};case G.Down:return{...n,y:n.y+25};case G.Up:return{...n,y:n.y-25}}};class cr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ue(Pe(n)),this.windowListeners=new Ue(ie(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Po(r),n(pe)}handleKeyDown(t){if(rn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=ar,coordinateGetter:a=Yo,scrollBehavior:l="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,p=d?{x:d.left,y:d.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=p);const g=a(t,{active:n,context:r.current,currentCoordinates:p});if(g){const v=vt(g,p),h={x:0,y:0},{scrollableAncestors:S}=r.current;for(const x of S){const y=t.code,{isTop:_,isRight:E,isLeft:M,isBottom:k,maxScroll:I,minScroll:O}=sr(x),$=$o(x),N={x:Math.min(y===G.Right?$.right-$.width/2:$.right,Math.max(y===G.Right?$.left:$.left+$.width/2,g.x)),y:Math.min(y===G.Down?$.bottom-$.height/2:$.bottom,Math.max(y===G.Down?$.top:$.top+$.height/2,g.y))},H=y===G.Right&&!E||y===G.Left&&!M,B=y===G.Down&&!k||y===G.Up&&!_;if(H&&N.x!==g.x){const A=x.scrollLeft+v.x,Y=y===G.Right&&A<=I.x||y===G.Left&&A>=O.x;if(Y&&!v.y){x.scrollTo({left:A,behavior:l});return}Y?h.x=x.scrollLeft-A:h.x=y===G.Right?x.scrollLeft-I.x:x.scrollLeft-O.x,h.x&&x.scrollBy({left:-h.x,behavior:l});break}else if(B&&N.y!==g.y){const A=x.scrollTop+v.y,Y=y===G.Down&&A<=I.y||y===G.Up&&A>=O.y;if(Y&&!v.x){x.scrollTo({top:A,behavior:l});return}Y?h.y=x.scrollTop-A:h.y=y===G.Down?x.scrollTop-I.y:x.scrollTop-O.y,h.y&&x.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,ke(vt(g,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}cr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ar,onActivation:o}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Rn(e){return!!(e&&"distance"in e)}function En(e){return!!(e&&"delay"in e)}class an{constructor(t,n,r){var o;r===void 0&&(r=zo(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Pe(a),this.documentListeners=new Ue(this.document),this.listeners=new Ue(r),this.windowListeners=new Ue(ie(a)),this.initialCoordinates=(o=Vt(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,jn),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,jn),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(En(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Rn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Fo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=Vt(t))!=null?n:pe,d=vt(o,u);if(!r&&l){if(Rn(l)){if(l.tolerance!=null&&kt(d,l.tolerance))return this.handleCancel();if(kt(d,l.distance))return this.handleStart()}if(En(l)&&kt(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===G.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Bo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cn extends an{constructor(t){const{event:n}=t,r=Pe(n.target);super(t,Bo,r)}}cn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Wo={move:{name:"mousemove"},end:{name:"mouseup"}};var Ut;(function(e){e[e.RightClick=2]="RightClick"})(Ut||(Ut={}));class Vo extends an{constructor(t){super(t,Wo,Pe(t.event.target))}}Vo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ut.RightClick?!1:(r?.({event:n}),!0)}}];const $t={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Ho extends an{constructor(t){super(t,$t)}static setup(){return window.addEventListener($t.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener($t.move.name,t)};function t(){}}}Ho.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Ge;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ge||(Ge={}));var xt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(xt||(xt={}));function Uo(e){let{acceleration:t,activator:n=Ge.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:l=xt.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:p,delta:g,threshold:v}=e;const h=qo({delta:g,disabled:!s}),[S,x]=to(),y=f.useRef({x:0,y:0}),_=f.useRef({x:0,y:0}),E=f.useMemo(()=>{switch(n){case Ge.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Ge.DraggableRect:return o}},[n,o,u]),M=f.useRef(null),k=f.useCallback(()=>{const O=M.current;if(!O)return;const $=y.current.x*_.current.x,N=y.current.y*_.current.y;O.scrollBy($,N)},[]),I=f.useMemo(()=>l===xt.TreeOrder?[...d].reverse():d,[l,d]);f.useEffect(()=>{if(!s||!d.length||!E){x();return}for(const O of I){if(r?.(O)===!1)continue;const $=d.indexOf(O),N=p[$];if(!N)continue;const{direction:H,speed:B}=ko(O,N,E,t,v);for(const A of["x","y"])h[A][H[A]]||(B[A]=0,H[A]=0);if(B.x>0||B.y>0){x(),M.current=O,S(k,a),y.current=B,_.current=H;return}}y.current={x:0,y:0},_.current={x:0,y:0},x()},[t,k,r,x,s,a,JSON.stringify(E),JSON.stringify(h),S,d,I,p,JSON.stringify(v)])}const Go={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function qo(e){let{delta:t,disabled:n}=e;const r=Wt(t);return Ze(o=>{if(n||!r||!o)return Go;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||s.x===-1,[Q.Forward]:o.x[Q.Forward]||s.x===1},y:{[Q.Backward]:o.y[Q.Backward]||s.y===-1,[Q.Forward]:o.y[Q.Forward]||s.y===1}}},[n,t,r])}function Xo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ze(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Ko(e,t){return f.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Ke;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ke||(Ke={}));var Gt;(function(e){e.Optimized="optimized"})(Gt||(Gt={}));const Mn=new Map;function Jo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=f.useState(null),{frequency:l,measure:u,strategy:d}=o,p=f.useRef(e),g=y(),v=Xe(g),h=f.useCallback(function(_){_===void 0&&(_=[]),!v.current&&a(E=>E===null?_:E.concat(_.filter(M=>!E.includes(M))))},[v]),S=f.useRef(null),x=Ze(_=>{if(g&&!n)return Mn;if(!_||_===Mn||p.current!==e||s!=null){const E=new Map;for(let M of e){if(!M)continue;if(s&&s.length>0&&!s.includes(M.id)&&M.rect.current){E.set(M.id,M.rect.current);continue}const k=M.node.current,I=k?new sn(u(k),k):null;M.rect.current=I,I&&E.set(M.id,I)}return E}return _},[e,s,n,g,u]);return f.useEffect(()=>{p.current=e},[e]),f.useEffect(()=>{g||h()},[n,g]),f.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),f.useEffect(()=>{g||typeof l!="number"||S.current!==null||(S.current=setTimeout(()=>{h(),S.current=null},l))},[l,g,h,...r]),{droppableRects:x,measureDroppableContainers:h,measuringScheduled:s!=null};function y(){switch(d){case Ke.Always:return!1;case Ke.BeforeDragging:return n;default:return!n}}}function lr(e,t){return Ze(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zo(e,t){return lr(e,t)}function Qo(e){let{callback:t,disabled:n}=e;const r=nn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return f.useEffect(()=>()=>o?.disconnect(),[o]),o}function wt(e){let{callback:t,disabled:n}=e;const r=nn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return f.useEffect(()=>()=>o?.disconnect(),[o]),o}function es(e){return new sn(Ne(e),e)}function Tn(e,t,n){t===void 0&&(t=es);const[r,o]=f.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const p=t(e);return JSON.stringify(u)===JSON.stringify(p)?u:p})}const a=Qo({callback(u){if(e)for(const d of u){const{type:p,target:g}=d;if(p==="childList"&&g instanceof HTMLElement&&g.contains(e)){s();break}}}}),l=wt({callback:s});return xe(()=>{s(),e?(l?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[e]),r}function ts(e){const t=lr(e);return er(e,t)}const On=[];function ns(e){const t=f.useRef(e),n=Ze(r=>e?r&&r!==On&&e&&t.current&&e.parentNode===t.current.parentNode?r:on(e):On,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function rs(e){const[t,n]=f.useState(null),r=f.useRef(e),o=f.useCallback(s=>{const a=It(s.target);a&&n(l=>l?(l.set(a,Ht(a)),new Map(l)):null)},[]);return f.useEffect(()=>{const s=r.current;if(e!==s){a(s);const l=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ht(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(s)};function a(l){l.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>ke(s,a),pe):ir(e):pe,[e,t])}function _n(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?vt(e,n.current):pe}function os(e){f.useEffect(()=>{if(!St)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function ss(e,t){return f.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function ur(e){return f.useMemo(()=>e?To(e):null,[e])}const In=[];function is(e,t){t===void 0&&(t=Ne);const[n]=e,r=ur(n?ie(n):null),[o,s]=f.useState(In);function a(){s(()=>e.length?e.map(u=>or(u)?r:new sn(t(u),u)):In)}const l=wt({callback:a});return xe(()=>{l?.disconnect(),a(),e.forEach(u=>l?.observe(u))},[e]),o}function as(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Je(t)?t:e}function cs(e){let{measure:t}=e;const[n,r]=f.useState(null),o=f.useCallback(d=>{for(const{target:p}of d)if(Je(p)){r(g=>{const v=t(p);return g?{...g,width:v.width,height:v.height}:v});break}},[t]),s=wt({callback:o}),a=f.useCallback(d=>{const p=as(d);s?.disconnect(),p&&s?.observe(p),r(p?t(p):null)},[t,s]),[l,u]=pt(a);return f.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const ls=[{sensor:cn,options:{}},{sensor:cr,options:{}}],us={current:{}},ut={draggable:{measure:Cn},droppable:{measure:Cn,strategy:Ke.WhileDragging,frequency:Gt.Optimized},dragOverlay:{measure:Ne}};class qe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ds={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ut,measureDroppableContainers:mt,windowRect:null,measuringScheduled:!1},fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mt,draggableNodes:new Map,over:null,measureDroppableContainers:mt},Dt=f.createContext(fs),dr=f.createContext(ds);function hs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function gs(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new qe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new qe(e.droppable.containers);return a.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new qe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ps(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=f.useContext(Dt),s=Wt(r),a=Wt(n?.id);return f.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!rn(s)||document.activeElement===s.target)return;const l=o.get(a);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const p of[u.current,d.current]){if(!p)continue;const g=oo(p);if(g){g.focus();break}}})}},[r,t,o,a,s]),null}function vs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ms(e){return f.useMemo(()=>({draggable:{...ut.draggable,...e?.draggable},droppable:{...ut.droppable,...e?.droppable},dragOverlay:{...ut.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function xs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=f.useRef(!1),{x:a,y:l}=typeof o=="boolean"?{x:o,y:o}:o;xe(()=>{if(!a&&!l||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const p=n(d),g=er(p,r);if(a||(g.x=0),l||(g.y=0),s.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const v=tr(d);v&&v.scrollBy({top:g.y,left:g.x})}},[t,a,l,r,n])}const fr=f.createContext({...pe,scaleX:1,scaleY:1});var Re;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Re||(Re={}));const hr=f.memo(function(t){var n,r,o,s;let{id:a,accessibility:l,autoScroll:u=!0,children:d,sensors:p=ls,collisionDetection:g=wo,measuring:v,modifiers:h,...S}=t;const x=f.useReducer(gs,void 0,hs),[y,_]=x,[E,M]=uo(),[k,I]=f.useState(Re.Uninitialized),O=k===Re.Initialized,{draggable:{active:$,nodes:N,translate:H},droppable:{containers:B}}=y,A=$!=null?N.get($):null,Y=f.useRef({initial:null,translated:null}),L=f.useMemo(()=>{var re;return $!=null?{id:$,data:(re=A?.data)!=null?re:us,rect:Y}:null},[$,A]),C=f.useRef(null),[w,D]=f.useState(null),[j,R]=f.useState(null),P=Xe(S,Object.values(S)),F=Qe("DndDescribedBy",a),m=f.useMemo(()=>B.getEnabled(),[B]),T=ms(v),{droppableRects:z,measureDroppableContainers:W,measuringScheduled:q}=Jo(m,{dragging:O,dependencies:[H.x,H.y],config:T.droppable}),X=Xo(N,$),U=f.useMemo(()=>j?Vt(j):null,[j]),K=Kr(),J=Zo(X,T.draggable.measure);xs({activeNode:$!=null?N.get($):null,config:K.layoutShiftCompensation,initialRect:J,measure:T.draggable.measure});const V=Tn(X,T.draggable.measure,J),se=Tn(X?X.parentElement:null),ne=f.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=B.getNodeFor((n=ne.current.over)==null?void 0:n.id),be=cs({measure:T.dragOverlay.measure}),Me=(r=be.nodeRef.current)!=null?r:X,Te=O?(o=be.rect)!=null?o:V:null,dn=!!(be.nodeRef.current&&be.rect),fn=ts(dn?null:V),Mt=ur(Me?ie(Me):null),Se=ns(O?ge??X:null),tt=is(Se),nt=vs(h,{transform:{x:H.x-fn.x,y:H.y-fn.y,scaleX:1,scaleY:1},activatorEvent:j,active:L,activeNodeRect:V,containerNodeRect:se,draggingNodeRect:Te,over:ne.current.over,overlayNodeRect:be.rect,scrollableAncestors:Se,scrollableAncestorRects:tt,windowRect:Mt}),hn=U?ke(U,H):null,gn=rs(Se),Wr=_n(gn),Vr=_n(gn,[V]),Oe=ke(nt,Wr),_e=Te?jo(Te,nt):null,ze=L&&_e?g({active:L,collisionRect:_e,droppableRects:z,droppableContainers:m,pointerCoordinates:hn}):null,pn=yo(ze,"id"),[we,vn]=f.useState(null),Hr=dn?nt:ke(nt,Vr),Ur=Do(Hr,(s=we?.rect)!=null?s:null,V),Tt=f.useRef(null),mn=f.useCallback((re,ce)=>{let{sensor:le,options:De}=ce;if(C.current==null)return;const de=N.get(C.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:C.current,activeNode:de,event:ue,options:De,context:ne,onAbort(ee){if(!N.get(ee))return;const{onDragAbort:me}=P.current,ye={id:ee};me?.(ye),E({type:"onDragAbort",event:ye})},onPending(ee,Ce,me,ye){if(!N.get(ee))return;const{onDragPending:Ye}=P.current,je={id:ee,constraint:Ce,initialCoordinates:me,offset:ye};Ye?.(je),E({type:"onDragPending",event:je})},onStart(ee){const Ce=C.current;if(Ce==null)return;const me=N.get(Ce);if(!me)return;const{onDragStart:ye}=P.current,Fe={activatorEvent:ue,active:{id:Ce,data:me.data,rect:Y}};He.unstable_batchedUpdates(()=>{ye?.(Fe),I(Re.Initializing),_({type:Z.DragStart,initialCoordinates:ee,active:Ce}),E({type:"onDragStart",event:Fe}),D(Tt.current),R(ue)})},onMove(ee){_({type:Z.DragMove,coordinates:ee})},onEnd:Ie(Z.DragEnd),onCancel:Ie(Z.DragCancel)});Tt.current=ve;function Ie(ee){return async function(){const{active:me,collisions:ye,over:Fe,scrollAdjustedTranslate:Ye}=ne.current;let je=null;if(me&&Ye){const{cancelDrop:Be}=P.current;je={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Fe},ee===Z.DragEnd&&typeof Be=="function"&&await Promise.resolve(Be(je))&&(ee=Z.DragCancel)}C.current=null,He.unstable_batchedUpdates(()=>{_({type:ee}),I(Re.Uninitialized),vn(null),D(null),R(null),Tt.current=null;const Be=ee===Z.DragEnd?"onDragEnd":"onDragCancel";if(je){const Ot=P.current[Be];Ot?.(je),E({type:Be,event:je})}})}}},[N]),Gr=f.useCallback((re,ce)=>(le,De)=>{const de=le.nativeEvent,ue=N.get(De);if(C.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},C.current=De,mn(le,ce))},[N,mn]),xn=Ko(p,Gr);os(p),xe(()=>{V&&k===Re.Initializing&&I(Re.Initialized)},[V,k]),f.useEffect(()=>{const{onDragMove:re}=P.current,{active:ce,activatorEvent:le,collisions:De,over:de}=ne.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:De,delta:{x:Oe.x,y:Oe.y},over:de};He.unstable_batchedUpdates(()=>{re?.(ue),E({type:"onDragMove",event:ue})})},[Oe.x,Oe.y]),f.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:De,scrollAdjustedTranslate:de}=ne.current;if(!re||C.current==null||!ce||!de)return;const{onDragOver:ue}=P.current,ve=De.get(pn),Ie=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,ee={active:re,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:Ie};He.unstable_batchedUpdates(()=>{vn(Ie),ue?.(ee),E({type:"onDragOver",event:ee})})},[pn]),xe(()=>{ne.current={activatorEvent:j,active:L,activeNode:X,collisionRect:_e,collisions:ze,droppableRects:z,draggableNodes:N,draggingNode:Me,draggingNodeRect:Te,droppableContainers:B,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:Oe},Y.current={initial:Te,translated:_e}},[L,X,ze,_e,N,Me,Te,z,B,we,Se,Oe]),Uo({...K,delta:H,draggingRect:_e,pointerCoordinates:hn,scrollableAncestors:Se,scrollableAncestorRects:tt});const qr=f.useMemo(()=>({active:L,activeNode:X,activeNodeRect:V,activatorEvent:j,collisions:ze,containerNodeRect:se,dragOverlay:be,draggableNodes:N,droppableContainers:B,droppableRects:z,over:we,measureDroppableContainers:W,scrollableAncestors:Se,scrollableAncestorRects:tt,measuringConfiguration:T,measuringScheduled:q,windowRect:Mt}),[L,X,V,j,ze,se,be,N,B,z,we,W,Se,tt,T,q,Mt]),Xr=f.useMemo(()=>({activatorEvent:j,activators:xn,active:L,activeNodeRect:V,ariaDescribedById:{draggable:F},dispatch:_,draggableNodes:N,over:we,measureDroppableContainers:W}),[j,xn,L,V,_,F,N,we,W]);return f.createElement(Zn.Provider,{value:M},f.createElement(Dt.Provider,{value:Xr},f.createElement(dr.Provider,{value:qr},f.createElement(fr.Provider,{value:Ur},d)),f.createElement(ps,{disabled:l?.restoreFocus===!1})),f.createElement(go,{...l,hiddenTextDescribedById:F}));function Kr(){const re=w?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=O&&!re&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),bs=f.createContext(null),kn="button",ys="Draggable";function Ss(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Qe(ys),{activators:a,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:p,draggableNodes:g,over:v}=f.useContext(Dt),{role:h=kn,roleDescription:S="draggable",tabIndex:x=0}=o??{},y=u?.id===t,_=f.useContext(y?fr:bs),[E,M]=pt(),[k,I]=pt(),O=ss(a,t),$=Xe(n);xe(()=>(g.set(t,{id:t,key:s,node:E,activatorNode:k,data:$}),()=>{const H=g.get(t);H&&H.key===s&&g.delete(t)}),[g,t]);const N=f.useMemo(()=>({role:h,tabIndex:x,"aria-disabled":r,"aria-pressed":y&&h===kn?!0:void 0,"aria-roledescription":S,"aria-describedby":p.draggable}),[r,h,x,y,S,p.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:N,isDragging:y,listeners:r?void 0:O,node:E,over:v,setNodeRef:M,setActivatorNodeRef:I,transform:_}}function ws(){return f.useContext(dr)}const Ds="Droppable",Cs={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Qe(Ds),{active:a,dispatch:l,over:u,measureDroppableContainers:d}=f.useContext(Dt),p=f.useRef({disabled:n}),g=f.useRef(!1),v=f.useRef(null),h=f.useRef(null),{disabled:S,updateMeasurementsFor:x,timeout:y}={...Cs,...o},_=Xe(x??r),E=f.useCallback(()=>{if(!g.current){g.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(_.current)?_.current:[_.current]),h.current=null},y)},[y]),M=wt({callback:E,disabled:S||!a}),k=f.useCallback((N,H)=>{M&&(H&&(M.unobserve(H),g.current=!1),N&&M.observe(N))},[M]),[I,O]=pt(k),$=Xe(t);return f.useEffect(()=>{!M||!I.current||(M.disconnect(),g.current=!1,M.observe(I.current))},[I,M]),f.useEffect(()=>(l({type:Z.RegisterDroppable,element:{id:r,key:s,disabled:n,node:I,rect:v,data:$}}),()=>l({type:Z.UnregisterDroppable,key:s,id:r})),[r]),f.useEffect(()=>{n!==p.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:s,disabled:n}),p.current.disabled=n)},[r,s,n,l]),{active:a,rect:v,isOver:u?.id===r,node:I,over:u,setNodeRef:O}}function Ct(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rs(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function ot(e){return e!==null&&e>=0}function Es(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ms(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const st={scaleX:1,scaleY:1},Ts=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=Os(n,a,o);if(a===o){const d=n[s];return d?{x:o<s?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...st}:null}return a>o&&a<=s?{x:-l.width-u,y:0,...st}:a<o&&a>=s?{x:l.width+u,y:0,...st}:{x:0,y:0,...st}};function Os(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const gr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Ct(t,r,n),a=t[o],l=s[o];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},it={scaleX:1,scaleY:1},_s=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(o===n){const d=s[a];return d?{x:0,y:n<a?d.top+d.height-(l.top+l.height):d.top-l.top,...it}:null}const u=Is(s,o,n);return o>n&&o<=a?{x:0,y:-l.height-u,...it}:o<n&&o>=a?{x:0,y:l.height+u,...it}:{x:0,y:0,...it}};function Is(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const pr="Sortable",vr=f.createContext({activeIndex:-1,containerId:pr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:gr,disabled:{draggable:!1,droppable:!1}});function mr(e){let{children:t,id:n,items:r,strategy:o=gr,disabled:s=!1}=e;const{active:a,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:p}=ws(),g=Qe(pr,n),v=l.rect!==null,h=f.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),S=a!=null,x=a?h.indexOf(a.id):-1,y=d?h.indexOf(d.id):-1,_=f.useRef(h),E=!Es(h,_.current),M=y!==-1&&x===-1||E,k=Ms(s);xe(()=>{E&&S&&p(h)},[E,h,S,p]),f.useEffect(()=>{_.current=h},[h]);const I=f.useMemo(()=>({activeIndex:x,containerId:g,disabled:k,disableTransforms:M,items:h,overIndex:y,useDragOverlay:v,sortedRects:Rs(h,u),strategy:o}),[x,g,k.draggable,k.droppable,M,h,y,u,v,o]);return f.createElement(vr.Provider,{value:I},t)}const ks=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Ct(n,r,o).indexOf(t)},$s=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:l,previousContainerId:u,transition:d}=e;return!d||!r||l!==s&&o===a?!1:n?!0:a!==o&&t===u},As={duration:200,easing:"ease"},xr="transform",Ls=Ae.Transition.toString({property:xr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function Ns(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=f.useState(null),l=f.useRef(n);return xe(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const d=Ne(r.current,{ignoreTransform:!0}),p={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(p.x||p.y)&&a(p)}}n!==l.current&&(l.current=n)},[t,n,r,o]),f.useEffect(()=>{s&&a(null)},[s]),s}function br(e){let{animateLayoutChanges:t=$s,attributes:n,disabled:r,data:o,getNewIndex:s=ks,id:a,strategy:l,resizeObserverConfig:u,transition:d=As}=e;const{items:p,containerId:g,activeIndex:v,disabled:h,disableTransforms:S,sortedRects:x,overIndex:y,useDragOverlay:_,strategy:E}=f.useContext(vr),M=zs(r,h),k=p.indexOf(a),I=f.useMemo(()=>({sortable:{containerId:g,index:k,items:p},...o}),[g,o,k,p]),O=f.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:$,node:N,isOver:H,setNodeRef:B}=js({id:a,data:I,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...u}}),{active:A,activatorEvent:Y,activeNodeRect:L,attributes:C,setNodeRef:w,listeners:D,isDragging:j,over:R,setActivatorNodeRef:P,transform:F}=Ss({id:a,data:I,attributes:{...Ps,...n},disabled:M.draggable}),m=eo(B,w),T=!!A,z=T&&!S&&ot(v)&&ot(y),W=!_&&j,q=W&&z?F:null,U=z?q??(l??E)({rects:x,activeNodeRect:L,activeIndex:v,overIndex:y,index:k}):null,K=ot(v)&&ot(y)?s({id:a,items:p,activeIndex:v,overIndex:y}):k,J=A?.id,V=f.useRef({activeId:J,items:p,newIndex:K,containerId:g}),se=p!==V.current.items,ne=t({active:A,containerId:g,isDragging:j,isSorting:T,id:a,index:k,items:p,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:d,wasDragging:V.current.activeId!=null}),ge=Ns({disabled:!ne,index:k,node:N,rect:$});return f.useEffect(()=>{T&&V.current.newIndex!==K&&(V.current.newIndex=K),g!==V.current.containerId&&(V.current.containerId=g),p!==V.current.items&&(V.current.items=p)},[T,K,g,p]),f.useEffect(()=>{if(J===V.current.activeId)return;if(J!=null&&V.current.activeId==null){V.current.activeId=J;return}const Me=setTimeout(()=>{V.current.activeId=J},50);return()=>clearTimeout(Me)},[J]),{active:A,activeIndex:v,attributes:C,data:I,rect:$,index:k,newIndex:K,items:p,isOver:H,isSorting:T,isDragging:j,listeners:D,node:N,overIndex:y,over:R,setNodeRef:m,setActivatorNodeRef:P,setDroppableNodeRef:B,setDraggableNodeRef:w,transform:ge??U,transition:be()};function be(){if(ge||se&&V.current.newIndex===k)return Ls;if(!(W&&!rn(Y)||!d)&&(T||ne))return Ae.Transition.toString({...d,property:xr})}}function zs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}G.Down,G.Right,G.Up,G.Left;var at={exports:{}},At={},ct={exports:{}},Lt={};var $n;function Fs(){if($n)return Lt;$n=1;var e=f;function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function l(g,v){var h=v(),S=r({inst:{value:h,getSnapshot:v}}),x=S[0].inst,y=S[1];return s(function(){x.value=h,x.getSnapshot=v,u(x)&&y({inst:x})},[g,h,v]),o(function(){return u(x)&&y({inst:x}),g(function(){u(x)&&y({inst:x})})},[g]),a(h),h}function u(g){var v=g.getSnapshot;g=g.value;try{var h=v();return!n(g,h)}catch{return!0}}function d(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Lt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Lt}var Pt={};var An;function Ys(){return An||(An=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,S){return h===S&&(h!==0||1/h===1/S)||h!==h&&S!==S}function t(h,S){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var x=S();if(!g){var y=S();s(x,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}y=a({inst:{value:x,getSnapshot:S}});var _=y[0].inst,E=y[1];return u(function(){_.value=x,_.getSnapshot=S,n(_)&&E({inst:_})},[h,x,S]),l(function(){return n(_)&&E({inst:_}),h(function(){n(_)&&E({inst:_})})},[h]),d(x),x}function n(h){var S=h.getSnapshot;h=h.value;try{var x=S();return!s(h,x)}catch{return!0}}function r(h,S){return S()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=f,s=typeof Object.is=="function"?Object.is:e,a=o.useState,l=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,p=!1,g=!1,v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Pt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Pt}var Ln;function yr(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?ct.exports=Fs():ct.exports=Ys()),ct.exports}var Pn;function Bs(){if(Pn)return At;Pn=1;var e=f,t=yr();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,l=e.useMemo,u=e.useDebugValue;return At.useSyncExternalStoreWithSelector=function(d,p,g,v,h){var S=s(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=l(function(){function _(O){if(!E){if(E=!0,M=O,O=v(O),h!==void 0&&x.hasValue){var $=x.value;if(h($,O))return k=$}return k=O}if($=k,r(M,O))return $;var N=v(O);return h!==void 0&&h($,N)?(M=O,$):(M=O,k=N)}var E=!1,M,k,I=g===void 0?null:g;return[function(){return _(p())},I===null?void 0:function(){return _(I())}]},[p,g,v,h]);var y=o(d,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=y},[y]),u(y),y},At}var Nt={};var Nn;function Ws(){return Nn||(Nn=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=f,n=yr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,l=t.useMemo,u=t.useDebugValue;Nt.useSyncExternalStoreWithSelector=function(d,p,g,v,h){var S=s(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=l(function(){function _(O){if(!E){if(E=!0,M=O,O=v(O),h!==void 0&&x.hasValue){var $=x.value;if(h($,O))return k=$}return k=O}if($=k,r(M,O))return $;var N=v(O);return h!==void 0&&h($,N)?(M=O,$):(M=O,k=N)}var E=!1,M,k,I=g===void 0?null:g;return[function(){return _(p())},I===null?void 0:function(){return _(I())}]},[p,g,v,h]);var y=o(d,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=y},[y]),u(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Nt}var zn;function Vs(){return zn||(zn=1,process.env.NODE_ENV==="production"?at.exports=Bs():at.exports=Ws()),at.exports}var Hs=Vs();const qt=new WeakMap,Us=new WeakMap,bt={current:[]};let zt=!1;const lt=new Set,Fn=new Map;function Sr(e){for(const t of e){if(bt.current.includes(t))continue;bt.current.push(t),t.recompute();const n=Us.get(t);if(n)for(const r of n){const o=qt.get(r);o?.length&&Sr(o)}}}function Gs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function qs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Xs(e){if(lt.add(e),!zt)try{for(zt=!0;lt.size>0;){const t=Array.from(lt);lt.clear();for(const n of t){const r=Fn.get(n)??n.prevState;n.prevState=r,Gs(n)}for(const n of t){const r=qt.get(n);r&&(bt.current.push(n),Sr(r))}for(const n of t){const r=qt.get(n);if(r)for(const o of r)qs(o)}}}finally{zt=!1,bt.current=[],Fn.clear()}}function Ks(e){return typeof e=="function"}class Js{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const a=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),a?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Ks(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Xs(this)}}function et(e,t=r=>r,n={}){const r=n.equal??Zs;return Hs.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Zs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Yn(e);if(n.length!==Yn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Yn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const $e="__actions__",he="__visibility__",oe=new Js({tableId:"",sortColumn:null,sortDirection:null,visibility:{},columnOrder:[],columnWidths:{},data:[],sortableColumns:[],enableColumnVisibility:!0}),jt=e=>`datatable:${e}:column-widths`;function wr(e,t,n=!0){const r=e[0]??{},s=(t&&t.length?t:Object.keys(r).map(v=>({id:v,label:v}))).filter(v=>v.id===$e||Object.prototype.hasOwnProperty.call(r,v.id)),{tableId:a}=oe.state,l=JSON.parse(localStorage.getItem(Cr(a))||"[]");let u=[...l.map(v=>s.find(h=>h.id===v)).filter(Boolean),...s.filter(v=>!l.includes(v.id))];n?u.some(h=>h.id===he)||(u=[...u,{type:"visibility",id:he,label:"",minWidth:50}]):u=u.filter(v=>v.id!==he);const d=JSON.parse(localStorage.getItem(Xt(a))||"{}"),p={};if(n){for(const v of u)v.id===he||v.id===$e?p[v.id]=!0:p[v.id]=d[v.id]??!0;localStorage.setItem(Xt(a),JSON.stringify(p))}const g=JSON.parse(localStorage.getItem(jt(a))||"{}");oe.setState(v=>({...v,data:e,columnOrder:u,visibility:p,columnWidths:g,enableColumnVisibility:n,sortableColumns:u.filter(h=>h.id!==he).map(h=>({id:h.id,label:h.label,sortable:h.id!==$e,minWidth:h.minWidth}))}))}function Dr(e){oe.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc"}))}function Qs(e,t){oe.setState(n=>{const r=typeof n.columnOrder.find(s=>s.id===e)?.minWidth=="number"?n.columnOrder.find(s=>s.id===e)?.minWidth:120,o={...n.columnWidths,[e]:Math.max(r,t)};return localStorage.setItem(jt(n.tableId),JSON.stringify(o)),{...n,columnWidths:o}})}const Cr=e=>`table_column_order_v1:${e}`,Xt=e=>`table_column_visibility_v1:${e}`,ei=e=>{const{tableId:t}=oe.state;localStorage.setItem(Cr(t),JSON.stringify(e.map(n=>n.id))),oe.setState(n=>({...n,columnOrder:e})),oe.setState(n=>({...n,columnOrder:e}))};function ti(e){oe.setState(t=>{if(t.sortColumn===e){if(t.sortDirection==="asc")return{...t,sortDirection:"desc"};if(t.sortDirection==="desc")return{...t,sortColumn:null,sortDirection:null}}return{...t,sortColumn:e,sortDirection:"asc"}})}const ni=e=>{oe.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Xt(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};function ri(e,t){oe.setState(n=>{const r=n.columnOrder.find(a=>a.id===e),o=typeof r?.minWidth=="number"?r.minWidth:120,s={...n.columnWidths,[e]:Math.max(o,t)};return localStorage.setItem(jt(n.tableId),JSON.stringify(s)),{...n,columnWidths:s}})}const oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),si=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Bn=e=>{const t=si(e);return t.charAt(0).toUpperCase()+t.slice(1)},jr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),ii=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ai={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 ci=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...l},u)=>f.createElement("svg",{ref:u,...ai,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jr("lucide",o),...!s&&!ii(l)&&{"aria-hidden":"true"},...l},[...a.map(([d,p])=>f.createElement(d,p)),...Array.isArray(s)?s:[s]]));const ae=(e,t)=>{const n=f.forwardRef(({className:r,...o},s)=>f.createElement(ci,{ref:s,iconNode:t,className:jr(`lucide-${oi(Bn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Bn(e),n};const li=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],ui=ae("arrow-left-right",li);const di=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],fi=ae("bookmark",di);const hi=[["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"}]],Rr=ae("calendar",hi);const gi=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pi=ae("chevron-left",gi);const vi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mi=ae("chevron-right",vi);const xi=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],bi=ae("delete",xi);const yi=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Si=ae("funnel",yi);const wi=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Er=ae("grip-vertical",wi);const Di=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ci=ae("pen",Di);const ji=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Ri=ae("refresh-ccw",ji);const Ei=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mi=ae("settings",Ei);const Ti=[["rect",{width:"20",height:"6",x:"2",y:"4",rx:"2",key:"qdearl"}],["rect",{width:"20",height:"6",x:"2",y:"14",rx:"2",key:"1xrn6j"}]],Oi=ae("stretch-horizontal",Ti);const _i=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mr=ae("triangle-alert",_i);const Ii=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Tr=ae("x",Ii);function b(e){return f.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const ki=b(c.Menu.Trigger),$i=b(c.Menu.Positioner),Ai=b(c.Menu.Content),Li=b(c.Menu.Item),Pi=b(c.Checkbox.Label),Ni=b(c.Checkbox.HiddenInput),zi=b(c.Checkbox.Control);function Fi({visibility:e}){const{sortableColumns:t}=et(oe);return i.jsxs(c.Menu.Root,{closeOnSelect:!1,children:[i.jsx(ki,{asChild:!0,children:i.jsx(c.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(Oi,{size:18})})}),i.jsx(c.Portal,{children:i.jsx($i,{children:i.jsx(Ai,{minW:"220px",children:t.map(n=>{const r=!!e[n.id];return i.jsx(Li,{value:n.id,closeOnSelect:!1,children:i.jsxs(c.Checkbox.Root,{checked:r,onCheckedChange:()=>ni(n.id),children:[i.jsx(Ni,{}),i.jsx(zi,{}),i.jsx(Pi,{children:n.label})]})},n.id)})})})})]})}function Yi({id:e,children:t,onClick:n,cursor:r,borderRight:o,backgroundColor:s,minW:a}){const{columnWidths:l}=et(oe),u=l[e],d=f.useRef(0),p=f.useRef(0),{setNodeRef:g,attributes:v,listeners:h,transform:S,transition:x}=br({id:e}),y=M=>{M.stopPropagation(),d.current=M.clientX,p.current=u??150;const k=O=>{ri(e,p.current+(O.clientX-d.current))},I=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",k),document.addEventListener("mouseup",I)},[_,E]=f.useState(!1);return i.jsx(c.Table.ColumnHeader,{ref:g,onClick:n,backgroundColor:s,w:u?`${u}px`:void 0,minW:a,style:{transform:Ae.Transform.toString(S),transition:x,cursor:r,borderRight:o},...v,children:i.jsxs(c.HStack,{position:"relative",children:[i.jsx("span",{...h,children:i.jsx(Er,{size:12,style:{cursor:"grab"}})}),t,i.jsx(c.Box,{position:"absolute",right:0,top:0,h:"100%",w:"10px",cursor:"col-resize",onMouseDown:y,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,children:_&&i.jsx(ui,{size:14,style:{pointerEvents:"none",opacity:.8}})})]})})}function Bi(){const{columnOrder:e,visibility:t,enableColumnVisibility:n,sortColumn:r,sortDirection:o}=et(oe),s=e.filter(a=>!n&&a.id===he?!1:a.id===he||a.id===$e?!0:t[a.id]!==!1).sort((a,l)=>a.id===he?1:l.id===he?-1:0);return i.jsx(c.Table.Header,{position:"sticky",top:0,zIndex:1,children:i.jsx(c.Table.Row,{height:"28px",children:s.map(a=>{if(a.id===he)return i.jsx(c.Table.ColumnHeader,{width:"50px",children:i.jsx(Fi,{visibility:t})},a.id);const l=a.type!=="actions"&&a.type!=="visibility"&&a.sortable!==!1,u=r===a.id;return i.jsx(Yi,{id:a.id,minW:a.minWidth,onClick:l?()=>ti(a.id):void 0,cursor:l?"pointer":"default",borderRight:"2px solid #dcdcdc",children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[a.label,l&&(u?o==="asc"?" ▲":" ▼":i.jsx("span",{style:{opacity:.4},children:" ⇅"}))]})},a.id)})})})}const Wi=[10,20,50,100],Vi=b(c.Select.Positioner),Hi=b(c.Select.Content),Ui=b(c.Select.Item),Gi=b(c.Pagination.PrevTrigger),qi=b(c.Pagination.NextTrigger),Xi=b(c.Select.HiddenSelect),Ki=b(c.Select.Control),Ji=b(c.Select.Trigger),Zi=b(c.Select.ValueText),Qi=b(c.Select.IndicatorGroup),ea=b(c.Select.Indicator);function ta({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:a=Wi}){const l=c.createListCollection({items:a.map(u=>({label:String(u),value:String(u)}))});return i.jsx(c.Box,{width:"100%",children:i.jsxs(c.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(c.HStack,{children:[i.jsx(c.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(c.Select.Root,{collection:l,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(Xi,{}),i.jsxs(Ki,{children:[i.jsx(Ji,{children:i.jsx(Zi,{placeholder:""})}),i.jsx(Qi,{children:i.jsx(ea,{})})]}),i.jsx(c.Portal,{children:i.jsx(Vi,{children:i.jsx(Hi,{children:l.items.map(u=>i.jsxs(Ui,{item:u.value,children:[u.label,i.jsx(c.Select.ItemIndicator,{})]},u.value))})})})]}),i.jsxs(c.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:["of ",e]})]}),i.jsx(c.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(c.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Gi,{asChild:!0,children:i.jsx(c.IconButton,{"aria-label":"Previous page",children:i.jsx(pi,{size:18})})}),i.jsx(c.Pagination.Items,{render:u=>i.jsx(c.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),i.jsx(qi,{asChild:!0,children:i.jsx(c.IconButton,{"aria-label":"Next page",children:i.jsx(mi,{size:18})})})]})})]})})}function na({data:e,columns:t,onRowSelect:n,onRowSelectEvent:r="left"}){const{visibility:o}=et(oe);return i.jsx(c.Table.Body,{children:e.map(s=>i.jsx(c.Table.Row,{onClick:a=>r==="left"&&n?.(s,a),children:t.filter(a=>a.id===he?!1:a.id===$e?!0:o[a.id]!==!1).map(a=>i.jsx(c.Table.Cell,{children:"render"in a&&a.render?a.render(s):String(s[a.id]??"—")},a.id))},s.id))})}function ra({rows:e=6,columns:t}){return i.jsx(c.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(c.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(c.Table.Cell,{children:i.jsx(c.Skeleton,{height:"25px"})},s))},r))})}function oa(e,t,n){if(!t||!n||t.type==="actions"||t.type==="visibility")return e;const r="sortAccessor"in t&&t.sortAccessor?t.sortAccessor:s=>s[t.id],o="sortComparator"in t&&t.sortComparator?t.sortComparator:(s,a,l)=>{const u=r(s),d=r(a);return u==null&&d==null?0:u==null?1:d==null?-1:typeof u=="number"&&typeof d=="number"?l==="asc"?u-d:d-u:u instanceof Date&&d instanceof Date?l==="asc"?u.getTime()-d.getTime():d.getTime()-u.getTime():l==="asc"?String(u).localeCompare(String(d)):String(d).localeCompare(String(u))};return[...e].sort((s,a)=>o(s,a,n))}function sa({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:a="No data",page:l=1,pageSize:u=10,onPageChange:d,onPageSizeChange:p,density:g="sm",totalCount:v=0,pageSizeOptions:h,onRowSelect:S,onRowSelectEvent:x="left",enableColumnVisibility:y=!0}){f.useEffect(()=>{Dr(e)},[e]),f.useEffect(()=>{wr(t,n,y)},[t,n,y]);const{sortColumn:_,sortDirection:E,data:M,columnOrder:k}=et(oe),I=f.useMemo(()=>k.length?k:n,[k,n]),O=f.useMemo(()=>{if(!_||!E)return M;const L=I.find(C=>C.id===_);return oa(M,L,E)},[M,_,E,I]),$=f.useMemo(()=>(Math.max(1,l)-1)*u,[l,u]),N=f.useMemo(()=>O.slice($,$+u),[O,$,u]),H=L=>{const{active:C,over:w}=L;if(!w||C.id===w.id)return;const D=I.findIndex(R=>R.id===C.id),j=I.findIndex(R=>R.id===w.id);ei(Ct(I,D,j))},B=r&&!s,A=s&&!r,Y=!r&&!s&&O.length===0;return i.jsx(hr,{collisionDetection:Qn,onDragEnd:H,children:i.jsx(mr,{items:I.map(L=>L.id),strategy:Ts,children:i.jsxs(c.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(c.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[B&&i.jsx(c.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(c.Spinner,{})}),i.jsxs(c.Table.Root,{variant:"outline",w:"100%",size:g,tableLayout:"fixed",minW:"max-content",children:[i.jsx(Bi,{}),A?i.jsx(ra,{rows:u,columns:I.length}):Y?i.jsx(c.Table.Body,{children:i.jsx(c.Table.Row,{children:i.jsx(c.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",w:"100%",children:a})})}):i.jsx(na,{data:N,columns:I,onRowSelect:S,onRowSelectEvent:x})]})]}),i.jsx(c.Box,{mt:.5,children:i.jsx(ta,{totalCount:v,pageSize:u,currentPage:l,onPageChange:d,onPageSizeChange:L=>{p?.(L),l>1&&d?.(1)},pageSizeOptions:h})})]})})})}const te=[];for(let e=0;e<256;++e)te.push((e+256).toString(16).slice(1));function ia(e,t=0){return(te[e[t+0]]+te[e[t+1]]+te[e[t+2]]+te[e[t+3]]+"-"+te[e[t+4]]+te[e[t+5]]+"-"+te[e[t+6]]+te[e[t+7]]+"-"+te[e[t+8]]+te[e[t+9]]+"-"+te[e[t+10]]+te[e[t+11]]+te[e[t+12]]+te[e[t+13]]+te[e[t+14]]+te[e[t+15]]).toLowerCase()}let Ft;const aa=new Uint8Array(16);function ca(){if(!Ft){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ft=crypto.getRandomValues.bind(crypto)}return Ft(aa)}const la=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wn={randomUUID:la};function ua(e,t,n){e=e||{};const r=e.random??e.rng?.()??ca();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ia(r)}function da(e,t,n){return Wn.randomUUID&&!e?Wn.randomUUID():ua(e)}const fa="FILTER_PRESETS_",Or=e=>`${fa}${e}`,Rt=e=>{if(typeof window>"u")return[];const t=localStorage.getItem(Or(e));try{return t?JSON.parse(t):[]}catch(n){return console.error("Failed to parse presets",n),[]}},ln=(e,t)=>{typeof window>"u"||(localStorage.setItem(Or(e),JSON.stringify(t)),window.dispatchEvent(new Event("storage_updated")))},_r=(e,t)=>{const n=Rt(e);ln(e,[t,...n])},Ir=(e,t)=>{const n=Rt(e).filter(r=>r.id!==t);ln(e,n)},ha=b(c.Checkbox.Root),ga=b(c.Checkbox.HiddenInput),pa=b(c.Checkbox.Control),va=b(c.Checkbox.Label),kr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:a,errorText:l})=>i.jsxs(ha,{value:e,onChange:t,size:n,children:[i.jsx(ga,{}),i.jsx(pa,{disabled:s,required:a,errorText:l,helperText:o}),r&&i.jsx(va,{children:r})]}),ma=b(c.Popover.Root),xa=b(c.Popover.Content),ba=b(c.Popover.Arrow),ya=b(c.Popover.Trigger),Sa=b(c.Popover.Positioner);function Ee(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Vn(e){const t=e.split(/\s+to\s+/i),n=t[0],r=t[1],o=l=>{if(!l)return null;const u=l.trim().split("-");if(u.length!==3)return null;const[d,p,g]=u,v=parseInt(d),h=parseInt(p)-1,S=parseInt(g);if(isNaN(v)||isNaN(h)||isNaN(S)||g.length!==4)return null;const x=new Date(S,h,v);return x.getDate()===v&&x.getMonth()===h?x:null},s=o(n),a=o(r);return{start:s,end:a}}function $r({startDate:e,endDate:t,onChange:n,width:r="280px",showLabel:o=!0,label:s="Select date range",visible:a=!0}){const[l,u]=f.useState(!1),[d,p]=f.useState(e||new Date),[g,v]=f.useState(null),[h,S]=f.useState(e||null),[x,y]=f.useState(t||null),_=(Y,L)=>Y&&L?`${Ee(Y)} to ${Ee(L)}`:Y?`${Ee(Y)}`:"",[E,M]=f.useState(_(e,t));f.useEffect(()=>{S(e||null),y(t||null)},[e,t]);const k=new Date(d.getFullYear(),d.getMonth()+1,0).getDate(),I=new Date(d.getFullYear(),d.getMonth(),1).getDay(),O=()=>{p(new Date(d.getFullYear(),d.getMonth()-1,1))},$=()=>{p(new Date(d.getFullYear(),d.getMonth()+1,1))},N=Y=>{const L=new Date(d.getFullYear(),d.getMonth(),Y);if(!h||h&&x){S(L),y(null),n(L,null),M(Ee(L));return}if(h&&!x){const C=L<h?L:h,w=L<h?h:L;S(C),y(w),n(C,w),M(`${Ee(C)} to ${Ee(w)}`),u(!1)}},H=Y=>{const L=Y.target.value;M(L);const{start:C,end:w}=Vn(L);if(C&&w){const D=C<w?C:w,j=C<w?w:C;n(D,j),p(D)}else C&&!L.toLowerCase().includes("to")&&n(C,null)},B=Y=>{if(Y.key!=="Enter")return;const{start:L,end:C}=Vn(E);if(L&&!C&&!E.toLowerCase().includes("to")){const w=`${Ee(L)} to `;M(w),S(L),y(null),n(L,null),requestAnimationFrame(()=>{Y.target.setSelectionRange(w.length,w.length)});return}if(L&&C){const w=L<C?L:C,D=L<C?C:L;S(w),y(D),n(w,D),u(!1)}},A=()=>{S(null),y(null),M(""),n(null,null)};return i.jsxs(c.Box,{width:r,onKeyDown:B,children:[o&&!a&&i.jsx(c.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:s}),i.jsxs(ma,{open:l,onOpenChange:Y=>u(Y.open),positioning:{placement:"bottom-start",gutter:4},children:[i.jsxs(c.Group,{attached:!0,w:"full",position:"relative",children:[i.jsx(c.Input,{placeholder:"DD-MM-YYYY to DD-MM-YYYY",value:E,onChange:H,size:"sm",autoComplete:"off"}),E&&i.jsx(c.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:A,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",children:i.jsx(Tr,{size:14})}),i.jsx(ya,{asChild:!0,children:i.jsx(c.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:i.jsx(Rr,{size:16})})})]}),i.jsx(Sa,{children:i.jsxs(xa,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[i.jsx(ba,{}),i.jsxs(c.HStack,{justify:"space-between",mb:4,children:[i.jsx(c.IconButton,{size:"xs",variant:"ghost",onClick:O,"aria-label":"Previous month",children:"‹"}),i.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:d.toLocaleString("default",{month:"long",year:"numeric"})}),i.jsx(c.IconButton,{size:"xs",variant:"ghost",onClick:$,"aria-label":"Next month",children:"›"})]}),i.jsxs(c.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((Y,L)=>i.jsx(c.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:Y},`${Y}-${L}`)),Array(I).fill(null).map((Y,L)=>i.jsx(c.Box,{},`empty-${L}`)),Array.from({length:k},(Y,L)=>{const C=L+1,w=new Date(d.getFullYear(),d.getMonth(),C);let D=e,j=t;if(D&&j&&g)if(e&&t){const W=e.getTime()+(t.getTime()-e.getTime())/2;g.getTime()<=W?D=g:j=g,D>j&&([D,j]=[j,D])}else e&&!t&&(D=g<e?g:e,j=g<e?e:g);const R=D&&w.getTime()===D.getTime(),P=j&&w.getTime()===j.getTime(),F=D&&j&&w>D&&w<j;let m="transparent",T="gray";R||P?T="blue":F&&(m="blue.100");let z="md";return F&&(z="0"),R&&j&&(z=P?"md":"md 0 0 md"),P&&D&&(z=R?"md":"0 md md 0"),i.jsx(c.Button,{size:"xs",variant:"ghost",colorPalette:T,bg:m!=="transparent"?m:void 0,onClick:()=>N(C),onMouseEnter:()=>v(w),onMouseLeave:()=>v(null),minW:"32px",h:"32px",fontSize:"xs",borderRadius:z,_hover:{bg:R||P?void 0:"gray.100"},children:C},C)})]}),i.jsx(c.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Select Start Date then End Date"})]})})]})]})}const wa=b(c.Popover.Root),Da=b(c.Popover.Content),Ca=b(c.Popover.Arrow),ja=b(c.Popover.Trigger),Ra=b(c.Popover.Positioner);function Hn(e){if(!e)return"";const t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return`${t}-${n}-${r}`}function Ea(e){const t=e.split("-");if(t.length!==3)return null;const[n,r,o]=t,s=parseInt(n),a=parseInt(r)-1,l=parseInt(o);if(isNaN(s)||isNaN(a)||isNaN(l)||o.length!==4)return null;const u=new Date(l,a,s);return u.getDate()===s&&u.getMonth()===a?u:null}function Ar({value:e,onChange:t,width:n="220px",visible:r=!0,label:o="Select date"}){const[s,a]=f.useState(!1),[l,u]=f.useState(e||new Date),[d,p]=f.useState(Hn(e));f.useEffect(()=>{p(Hn(e))},[e]);const g=new Date(l.getFullYear(),l.getMonth()+1,0).getDate(),v=new Date(l.getFullYear(),l.getMonth(),1).getDay(),h=()=>{u(new Date(l.getFullYear(),l.getMonth()-1,1))},S=()=>{u(new Date(l.getFullYear(),l.getMonth()+1,1))},x=E=>{const M=new Date(l.getFullYear(),l.getMonth(),E);t(M),a(!1)},y=E=>{if(s)switch(E.key){case"ArrowLeft":h();break;case"ArrowRight":S();break;case"Escape":a(!1);break}},_=()=>{p(""),t(null)};return i.jsxs(c.Box,{width:n,onKeyDown:y,children:[!r&&i.jsx(c.Text,{fontSize:"xs",color:"fg.muted",mb:1,fontWeight:"medium",children:o}),i.jsxs(wa,{open:s,onOpenChange:E=>a(E.open),positioning:{placement:"bottom-start",gutter:4},children:[i.jsxs(c.Group,{attached:!0,w:"full",position:"relative",children:[d&&i.jsx(c.IconButton,{size:"xs",variant:"ghost","aria-label":"Clear date",onClick:_,position:"absolute",right:"32px",top:"50%",transform:"translateY(-50%)",zIndex:1,children:i.jsx(Tr,{size:14})}),i.jsx(c.Input,{placeholder:"DD-MM-YYYY",value:d,onChange:E=>{const M=E.target.value;p(M);const k=Ea(M);k&&(t(k),u(k))},size:"sm",autoComplete:"off"}),i.jsx(ja,{asChild:!0,children:i.jsx(c.InputAddon,{cursor:"pointer",px:2,_hover:{bg:"gray.100"},transition:"background 0.2s",children:i.jsx(Rr,{size:16})})})]}),i.jsx(Ra,{children:i.jsxs(Da,{width:"300px",p:4,boxShadow:"xl",zIndex:1e3,borderRadius:"md",outline:"none",children:[i.jsx(Ca,{}),i.jsxs(c.HStack,{justify:"space-between",mb:4,children:[i.jsx(c.IconButton,{size:"xs",variant:"ghost",onClick:h,"aria-label":"Previous month",children:"‹"}),i.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:l.toLocaleString("default",{month:"long",year:"numeric"})}),i.jsx(c.IconButton,{size:"xs",variant:"ghost",onClick:S,"aria-label":"Next month",children:"›"})]}),i.jsxs(c.Grid,{templateColumns:"repeat(7, 1fr)",gap:1,textAlign:"center",children:[["S","M","T","W","T","F","S"].map((E,M)=>i.jsx(c.Text,{fontSize:"xs",fontWeight:"bold",color:"fg.subtle",py:1,children:E},`${E}-${M}`)),Array(v).fill(null).map((E,M)=>i.jsx(c.Box,{},`empty-${M}`)),Array.from({length:g},(E,M)=>{const k=M+1,I=e&&e.getDate()===k&&e.getMonth()===l.getMonth()&&e.getFullYear()===l.getFullYear();return i.jsx(c.Button,{size:"xs",variant:I?"solid":"ghost",colorPalette:I?"blue":"gray",onClick:()=>x(k),minW:"32px",h:"32px",fontSize:"xs",borderRadius:"md",children:k},k)})]}),i.jsx(c.Text,{fontSize:"10px",color:"fg.muted",mt:3,textAlign:"center",children:"Use Arrow Keys to change months • Esc to close"})]})})]})]})}const Ma=b(c.Field.Root),Ta=b(c.Field.Label),Oa=b(c.Field.HelperText),_a=b(c.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:a="100%",label:l,helperText:u,isDisabled:d=!1,required:p=!1,errorText:g,visible:v,type:h="text",min:S=0,max:x=100,step:y=1})=>i.jsxs(Ma,{width:a,children:[v&&i.jsx(Ta,{children:l}),i.jsx(c.InputGroup,{startElement:e,children:i.jsx(c.Input,{value:t,onChange:_=>n?.(_.target.value),placeholder:r,size:o,type:h,variant:s,disabled:d,required:p,min:S,max:x,step:y})}),g&&i.jsx(_a,{fontSize:"xs",children:g}),u&&i.jsx(Oa,{fontSize:"xs",children:u})]}),Ia=b(c.Field.Root),ka=b(c.Field.HelperText),$a=b(c.Field.ErrorText),Aa=b(c.Select.Root),La=b(c.Select.Label),Pa=b(c.Select.Control),Na=b(c.Select.Trigger),za=b(c.Select.ValueText),Fa=b(c.Select.IndicatorGroup),Ya=b(c.Select.Indicator),Ba=b(c.Select.Content),Wa=b(c.Select.Item),Va=b(c.Select.ItemIndicator),Ha=b(c.Select.HiddenSelect),Ua=b(c.Select.Positioner),Lr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:a="100%",variant:l="outline",helperText:u,isDisabled:d,required:p,errorText:g,visible:v})=>{const h=f.useMemo(()=>c.createListCollection({items:e}),[e]),S=e.find(y=>y.value===n),x=y=>{y.preventDefault(),y.stopPropagation(),r?.(void 0)};return i.jsxs(Ia,{disabled:d,required:p,children:[i.jsxs(Aa,{collection:h,variant:l,size:s,width:a,value:n?[n]:[],onValueChange:y=>{r?.(y.value[0])},children:[i.jsx(Ha,{}),v&&i.jsx(La,{children:t}),i.jsxs(Pa,{children:[i.jsx(Na,{children:i.jsx(za,{placeholder:o,children:S?.displayValue??S?.label})}),i.jsxs(Fa,{children:[n&&!d&&i.jsx("div",{style:{pointerEvents:"auto",display:"flex",alignItems:"center"},onPointerDown:y=>y.stopPropagation(),onClick:y=>y.stopPropagation(),children:i.jsx(c.CloseButton,{size:"sm",variant:"ghost",onPointerDown:x,onClick:x,position:"relative",zIndex:10})}),i.jsx(Ya,{})]})]}),i.jsx(Ua,{children:i.jsx(Ba,{children:h.items.map((y,_)=>i.jsxs(Wa,{item:y,children:[y.label,i.jsx(Va,{})]},_))})})]}),u&&i.jsx(ka,{children:u}),g&&i.jsx($a,{children:g})]})},Pr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return i.jsx(Kt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return i.jsx(Kt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return i.jsx(kr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Lr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t,placeholder:e.placeholder});case"date":return i.jsx(Ar,{value:e.value,onChange:e.onChange,visible:t,label:e.label});case"date-range":return i.jsx($r,{startDate:e.startDate?new Date(e.startDate):void 0,endDate:e.endDate?new Date(e.endDate):void 0,onChange:e.onChange,visible:t,label:e.label});case"combobox":return i.jsx(i.Fragment,{});default:return null}},Ga=b(c.Checkbox.Root),qa=b(c.Checkbox.HiddenInput),Xa=b(c.Checkbox.Control),Ka=b(c.Slider.Root),Ja=b(c.Slider.Track),Za=b(c.Slider.Range),Qa=b(c.Slider.Thumbs),ec=b(c.Slider.Control),tc=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:a,transition:l}=br({id:e.id}),u={transform:Ae.Transform.toString(a),transition:l};return i.jsxs(c.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(c.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Er,{size:16}),i.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(c.HStack,{justify:"space-between",children:[i.jsx(c.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(Ga,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(qa,{}),i.jsx(Xa,{})]})]}),i.jsxs(c.VStack,{align:"stretch",gap:1,children:[i.jsx(c.Text,{fontSize:"sm",children:"Size"}),i.jsx(Ka,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(ec,{children:[i.jsx(Ja,{children:i.jsx(Za,{})}),i.jsx(Qa,{})]})})]})]})},nc=b(c.Drawer.Root),rc=b(c.Drawer.Trigger),oc=b(c.Drawer.Backdrop),sc=b(c.Drawer.Positioner),ic=b(c.Drawer.Content),ac=b(c.Drawer.Header),cc=b(c.Drawer.Title),lc=b(c.Drawer.Body),uc=b(c.Drawer.Footer),dc=b(c.Drawer.CloseTrigger),fc=b(c.Tabs.Root),hc=b(c.Tabs.List),Yt=b(c.Tabs.Trigger),Bt=b(c.Tabs.Content),gc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,filters:r,pageKey:o="default",onLoadPreset:s,activePresetName:a,onReorder:l,open:u,onOpenChange:d})=>{const[p,g]=f.useState([]);f.useEffect(()=>{const h=()=>{g(Rt(o))};return h(),window.addEventListener("storage",h),window.addEventListener("storage_updated",h),()=>{window.removeEventListener("storage",h),window.removeEventListener("storage_updated",h)}},[o]);const v=()=>{const h=prompt("Preset name?");if(!h)return;const S=r.reduce((x,y)=>(x[y.id]=y.value,x),{});_r(o,{id:da(),name:h,date:new Date().toISOString(),values:S})};return i.jsx(c.HStack,{wrap:"wrap",children:i.jsxs(nc,{size:e,open:u,onOpenChange:d,children:[i.jsx(rc,{asChild:!0,children:i.jsxs(c.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(Si,{size:16}),"Filters"]})}),i.jsxs(c.Portal,{children:[i.jsx(oc,{}),i.jsx(sc,{children:i.jsxs(ic,{children:[i.jsx(ac,{children:i.jsx(cc,{children:"Filters"})}),i.jsx(lc,{overflowY:"auto",pt:1,children:i.jsxs(fc,{defaultValue:"view",children:[i.jsxs(hc,{mb:4,children:[i.jsxs(Yt,{value:"view",children:[i.jsx(Ci,{size:16}),"Edit"]}),i.jsxs(Yt,{value:"settings",children:[i.jsx(Mi,{size:16}),"Settings"]}),i.jsxs(Yt,{value:"presets",children:[i.jsx(fi,{size:16}),"Presets"]})]}),i.jsx(Bt,{value:"view",children:r.filter(h=>h.visible).map(h=>i.jsx(c.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:h.size??1,minW:`${(h.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Pr(h,u)},h.id))}),i.jsx(Bt,{value:"settings",children:i.jsx(hr,{sensors:vo(po(cn)),collisionDetection:Qn,onDragEnd:({active:h,over:S})=>{if(!S||h.id===S.id)return;const x=r.findIndex(E=>E.id===h.id),y=r.findIndex(E=>E.id===S.id),_=Ct(r,x,y);l?.(_)},children:i.jsx(mr,{items:r.map(h=>h.id),strategy:_s,children:r.map(h=>i.jsx(tc,{filter:h,onVisibilityChange:t,onSizeChange:n},h.id))})})}),i.jsx(Bt,{value:"presets",children:i.jsxs(c.VStack,{align:"stretch",mb:3,children:[p.length===0&&i.jsx(c.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),p.map(h=>i.jsxs(c.HStack,{justify:"space-between",border:"1px solid",borderColor:a===h.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(c.VStack,{align:"start",gap:0,children:[i.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:h.name}),i.jsx(c.Text,{fontSize:"xs",color:"gray.500",children:new Date(h.date).toLocaleDateString()})]}),i.jsxs(c.HStack,{children:[i.jsx(c.Button,{size:"xs",variant:"ghost",onClick:()=>{const S=r.map(x=>({...x,value:h.values[x.id]??x.value}));s?.(S,h.name)},children:"Load"}),i.jsx(c.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Ir(o,h.id),children:i.jsx(bi,{size:14})})]})]},h.id)),i.jsx(c.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(uc,{justify:"space-between",children:i.jsx(dc,{asChild:!0,children:i.jsx(c.CloseButton,{})})})]})})]})]})})},pc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:l,onLoadPreset:u,activePresetName:d,filterDrawerSize:p="sm"})=>{const[g,v]=f.useState(!1);return i.jsxs(c.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(c.HStack,{gapX:1,children:[t.filter(h=>h.visible!==!1).map(h=>i.jsx(c.HStack,{flex:h.size??1,minW:`${(h.size??1)*100}px`,alignItems:"center",children:Pr(h)},h.id)),i.jsx(gc,{filterDrawerSize:p,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:l,filters:t,onLoadPreset:u,activePresetName:d,open:g,onOpenChange:h=>{v(h.open)}})]})]})},vc=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},mc=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},xc=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:a,colorScheme:l,loading:u,loadingText:d,rounded:p,type:g="button",textColor:v="white",borderColor:h})=>i.jsx(c.Button,{onClick:e,size:t,variant:n,disabled:a,loading:u,loadingText:d,rounded:p,type:g,background:l,color:v,border:h,children:i.jsxs(c.HStack,{gap:1,children:[o,r,s]})}),bc=b(c.Combobox.Root),yc=b(c.Combobox.Control),Sc=b(c.Combobox.Input),wc=b(c.Combobox.IndicatorGroup),Dc=b(c.Combobox.ClearTrigger),Cc=b(c.Combobox.Trigger),jc=b(c.Combobox.Positioner),Rc=b(c.Combobox.Content);function Ec({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:a,renderItem:l,value:u,loading:d,error:p,errorMessage:g,placeholder:v,helpText:h,onInputChange:S,onSelect:x,visible:y=!0,rootProps:_,inputProps:E,controlProps:M,contentProps:k,itemProps:I}){const[O,$]=f.useState(""),N=f.useMemo(()=>Array.isArray(o)?o:[],[o]),{collection:H,set:B}=c.useListCollection({initialItems:N,itemToString:s,itemToValue:a}),A=f.useMemo(()=>{if(!O)return N;const Y=O.toLowerCase();return N.filter(L=>s(L).toLowerCase().includes(Y))},[o,O,s]);return f.useEffect(()=>{B(A)},[A,B]),f.useEffect(()=>{u&&$(s(u))},[u,s]),i.jsxs(bc,{width:n,size:t,variant:r,collection:H,placeholder:v,onInputValueChange:Y=>{S?.(Y.inputValue),$(Y.inputValue)},value:u?[a(u)]:[],onValueChange:Y=>{const L=Y.value?.[0];if(!L)return;const C=H.items.find(w=>a(w)===L);C&&x?.(C)},positioning:{sameWidth:!1,placement:"bottom-start"},..._,children:[y&&e&&i.jsx(c.Text,{fontSize:"sm",children:e}),i.jsxs(yc,{...M,children:[i.jsx(Sc,{placeholder:v??"Type to search",...E}),i.jsxs(wc,{children:[i.jsx(Dc,{}),i.jsx(Cc,{})]})]}),i.jsx(jc,{children:i.jsxs(Rc,{minW:"sm",...k,children:[d?i.jsxs(c.HStack,{p:"2",children:[i.jsx(c.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(c.Span,{children:"Loading..."})]}):p?i.jsx(c.Text,{p:"2",color:"red.500",fontSize:"sm",children:g||"Something went wrong"}):H.items.map(Y=>i.jsxs(c.Combobox.Item,{item:Y,...I,children:[l(Y),i.jsx(c.Combobox.ItemIndicator,{})]},a(Y))),h&&!p&&!d&&i.jsx(c.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:h})]})})]})}const Mc=b(c.Dialog.Root),Tc=b(c.Dialog.Backdrop),Oc=b(c.Dialog.Positioner),_c=b(c.Dialog.Content),Ic=b(c.Dialog.Header),kc=b(c.Dialog.Body),$c=b(c.Dialog.Footer),Ac=b(c.Dialog.Title),Lc=b(c.Dialog.CloseTrigger);function Pc({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:s="Confirm",cancelLabel:a="Cancel",icon:l,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return i.jsx(Mc,{open:e,placement:"center",onOpenChange:p=>!p.open&&t(),children:i.jsxs(c.Portal,{children:[i.jsx(Tc,{}),i.jsx(Oc,{children:i.jsxs(_c,{maxW:"480px",children:[i.jsx(Ic,{borderBottom:"1px solid",borderColor:"gray.200",children:i.jsx(Ac,{children:r})}),i.jsx(kc,{p:6,children:i.jsxs(c.Stack,{gap:4,align:"center",textAlign:"center",children:[i.jsx(c.Box,{color:"orange.500",children:l??i.jsx(Mr,{size:40})}),i.jsx(c.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),i.jsxs($c,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[i.jsx(c.Button,{variant:"outline",size:"sm",onClick:t,children:a}),i.jsx(c.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:s})]}),i.jsx(Lc,{asChild:!0,children:i.jsx(c.CloseButton,{size:"sm"})})]})})]})})}const Nc=b(c.Dialog.Root),zc=b(c.Dialog.Backdrop),Fc=b(c.Dialog.Positioner),Yc=b(c.Dialog.Content),Bc=b(c.Dialog.Header),Wc=b(c.Dialog.Body),Vc=b(c.Dialog.Footer),Hc=b(c.Dialog.Title),Uc=b(c.Dialog.CloseTrigger);function Gc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:a="Delete",isLoading:l=!1}){const[u,d]=f.useState(""),p=u===s;return i.jsx(Nc,{open:e,placement:"center",onOpenChange:g=>{!g.open&&t(),d("")},children:i.jsxs(c.Portal,{children:[i.jsx(zc,{}),i.jsx(Fc,{children:i.jsxs(Yc,{maxW:"550px",children:[i.jsx(Bc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Hc,{color:"red.600",children:r})}),i.jsx(Wc,{p:2,style:{padding:"16px"},children:i.jsxs(c.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(c.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(c.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(c.Box,{color:"red.600",mt:"2px",children:i.jsx(Mr,{size:20})}),i.jsxs(c.Box,{children:[i.jsx(c.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(c.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(c.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(c.Box,{children:[i.jsxs(c.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(c.Input,{placeholder:`Type ${s} here`,value:u,onChange:g=>d(g.target.value),size:"xs"})]})]})}),i.jsxs(Vc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(c.Button,{variant:"outline",size:"sm",onClick:()=>{t(),d("")},children:"Cancel"}),i.jsx(c.Button,{size:"sm",disabled:!p,style:{backgroundColor:"#FF0000"},loading:l,onClick:n,children:a})]}),i.jsx(Uc,{asChild:!0,children:i.jsx(c.CloseButton,{size:"sm"})})]})})]})})}const Nr=({children:e})=>i.jsx(i.Fragment,{children:e}),zr=({children:e})=>i.jsx(i.Fragment,{children:e}),qc=c.Button,Xc=b(c.Dialog.Root),Kc=b(c.Dialog.Backdrop),Jc=b(c.Dialog.Positioner),Zc=b(c.Dialog.Content),Qc=b(c.Dialog.Header),el=b(c.Dialog.Body),tl=b(c.Dialog.Footer),nl=b(c.Dialog.Title),rl=b(c.Dialog.CloseTrigger);function ol(e){let t=null,n=null;return f.Children.forEach(e,r=>{f.isValidElement(r)&&(r.type===Nr&&(t=r.props.children),r.type===zr&&(n=r.props.children))}),{body:t,actions:n}}const sl=({open:e,onClose:t,title:n,children:r,width:o,position:s,refetch:a,loading:l=!1})=>{const{body:u,actions:d}=ol(r);return i.jsx(Xc,{open:e,onOpenChange:p=>!p.open&&t(),placement:s??"center",children:i.jsxs(c.Portal,{children:[i.jsx(Kc,{bg:"blackAlpha.400"}),i.jsx(Jc,{children:i.jsxs(Zc,{w:o??"560px",maxW:o??"560px",borderRadius:"6px",overflow:"hidden",boxShadow:"lg",children:[i.jsx(Qc,{px:"20px",py:"16px",bg:"white",borderBottom:"1px solid",borderColor:"gray.200",children:i.jsxs(c.Flex,{align:"center",justify:"space-between",children:[i.jsx(nl,{fontSize:"16px",fontWeight:"600",children:n}),i.jsx(rl,{asChild:!0,children:i.jsx(c.CloseButton,{size:"sm"})}),a&&i.jsx(un,{label:"Refresh",refetch:a,isLoading:l})]})}),u&&i.jsx(el,{px:"20px",py:"16px",bg:"#F8FAFC",type:"submit",children:i.jsx(c.Flex,{direction:"column",gap:"16px",children:u})}),d&&i.jsx(tl,{px:"20px",py:"16px",bg:"white",borderTop:"1px solid",borderColor:"gray.200",children:i.jsx(c.Flex,{ml:"auto",gap:"12px",children:d})})]})})]})})},il=b(c.Field.Root),al=b(c.Field.Label),cl=b(c.Field.HelperText),ll=b(c.Field.ErrorText),ul=b(c.PinInput.Input),dl=b(c.PinInput.Control),fl=b(c.PinInput.HiddenInput),hl=b(c.PinInput.Root),gl=({value:e,onChange:t,length:n=4,size:r="xs",isDisabled:o=!1,label:s,helperText:a,errorText:l,required:u=!1,visible:d=!0})=>{const p=Array.from({length:n}).map((g,v)=>e?.[v]??"");return i.jsxs(il,{children:[d&&s&&i.jsxs(al,{children:[s,u&&" *"]}),i.jsxs(hl,{value:p,onValueChange:g=>t?.(g.value.join("")),disabled:o,size:r,children:[i.jsx(fl,{}),i.jsx(dl,{children:i.jsx(c.HStack,{children:Array.from({length:n}).map((g,v)=>i.jsx(ul,{index:v},v))})})]}),l&&i.jsx(ll,{fontSize:"xs",children:l}),a&&!l&&i.jsx(cl,{fontSize:"xs",children:a})]})};function un({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=f.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(c.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Ri,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var dt={exports:{}},pl=dt.exports,Un;function vl(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(pl,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",l="minute",u="hour",d="day",p="week",g="month",v="quarter",h="year",S="date",x="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(C){var w=["th","st","nd","rd"],D=C%100;return"["+C+(w[(D-20)%10]||w[D]||w[0])+"]"}},M=function(C,w,D){var j=String(C);return!j||j.length>=w?C:""+Array(w+1-j.length).join(D)+C},k={s:M,z:function(C){var w=-C.utcOffset(),D=Math.abs(w),j=Math.floor(D/60),R=D%60;return(w<=0?"+":"-")+M(j,2,"0")+":"+M(R,2,"0")},m:function C(w,D){if(w.date()<D.date())return-C(D,w);var j=12*(D.year()-w.year())+(D.month()-w.month()),R=w.clone().add(j,g),P=D-R<0,F=w.clone().add(j+(P?-1:1),g);return+(-(j+(D-R)/(P?R-F:F-R))||0)},a:function(C){return C<0?Math.ceil(C)||0:Math.floor(C)},p:function(C){return{M:g,y:h,w:p,d,D:S,h:u,m:l,s:a,ms:s,Q:v}[C]||String(C||"").toLowerCase().replace(/s$/,"")},u:function(C){return C===void 0}},I="en",O={};O[I]=E;var $="$isDayjsObject",N=function(C){return C instanceof Y||!(!C||!C[$])},H=function C(w,D,j){var R;if(!w)return I;if(typeof w=="string"){var P=w.toLowerCase();O[P]&&(R=P),D&&(O[P]=D,R=P);var F=w.split("-");if(!R&&F.length>1)return C(F[0])}else{var m=w.name;O[m]=w,R=m}return!j&&R&&(I=R),R||!j&&I},B=function(C,w){if(N(C))return C.clone();var D=typeof w=="object"?w:{};return D.date=C,D.args=arguments,new Y(D)},A=k;A.l=H,A.i=N,A.w=function(C,w){return B(C,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var Y=(function(){function C(D){this.$L=H(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[$]=!0}var w=C.prototype;return w.parse=function(D){this.$d=(function(j){var R=j.date,P=j.utc;if(R===null)return new Date(NaN);if(A.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var F=R.match(y);if(F){var m=F[2]-1||0,T=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],m,F[3]||1,F[4]||0,F[5]||0,F[6]||0,T)):new Date(F[1],m,F[3]||1,F[4]||0,F[5]||0,F[6]||0,T)}}return new Date(R)})(D),this.init()},w.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},w.$utils=function(){return A},w.isValid=function(){return this.$d.toString()!==x},w.isSame=function(D,j){var R=B(D);return this.startOf(j)<=R&&R<=this.endOf(j)},w.isAfter=function(D,j){return B(D)<this.startOf(j)},w.isBefore=function(D,j){return this.endOf(j)<B(D)},w.$g=function(D,j,R){return A.u(D)?this[j]:this.set(R,D)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(D,j){var R=this,P=!!A.u(j)||j,F=A.p(D),m=function(J,V){var se=A.w(R.$u?Date.UTC(R.$y,V,J):new Date(R.$y,V,J),R);return P?se:se.endOf(d)},T=function(J,V){return A.w(R.toDate()[J].apply(R.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(V)),R)},z=this.$W,W=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(F){case h:return P?m(1,0):m(31,11);case g:return P?m(1,W):m(0,W+1);case p:var U=this.$locale().weekStart||0,K=(z<U?z+7:z)-U;return m(P?q-K:q+(6-K),W);case d:case S:return T(X+"Hours",0);case u:return T(X+"Minutes",1);case l:return T(X+"Seconds",2);case a:return T(X+"Milliseconds",3);default:return this.clone()}},w.endOf=function(D){return this.startOf(D,!1)},w.$set=function(D,j){var R,P=A.p(D),F="set"+(this.$u?"UTC":""),m=(R={},R[d]=F+"Date",R[S]=F+"Date",R[g]=F+"Month",R[h]=F+"FullYear",R[u]=F+"Hours",R[l]=F+"Minutes",R[a]=F+"Seconds",R[s]=F+"Milliseconds",R)[P],T=P===d?this.$D+(j-this.$W):j;if(P===g||P===h){var z=this.clone().set(S,1);z.$d[m](T),z.init(),this.$d=z.set(S,Math.min(this.$D,z.daysInMonth())).$d}else m&&this.$d[m](T);return this.init(),this},w.set=function(D,j){return this.clone().$set(D,j)},w.get=function(D){return this[A.p(D)]()},w.add=function(D,j){var R,P=this;D=Number(D);var F=A.p(j),m=function(W){var q=B(P);return A.w(q.date(q.date()+Math.round(W*D)),P)};if(F===g)return this.set(g,this.$M+D);if(F===h)return this.set(h,this.$y+D);if(F===d)return m(1);if(F===p)return m(7);var T=(R={},R[l]=r,R[u]=o,R[a]=n,R)[F]||1,z=this.$d.getTime()+D*T;return A.w(z,this)},w.subtract=function(D,j){return this.add(-1*D,j)},w.format=function(D){var j=this,R=this.$locale();if(!this.isValid())return R.invalidDate||x;var P=D||"YYYY-MM-DDTHH:mm:ssZ",F=A.z(this),m=this.$H,T=this.$m,z=this.$M,W=R.weekdays,q=R.months,X=R.meridiem,U=function(V,se,ne,ge){return V&&(V[se]||V(j,P))||ne[se].slice(0,ge)},K=function(V){return A.s(m%12||12,V,"0")},J=X||function(V,se,ne){var ge=V<12?"AM":"PM";return ne?ge.toLowerCase():ge};return P.replace(_,(function(V,se){return se||(function(ne){switch(ne){case"YY":return String(j.$y).slice(-2);case"YYYY":return A.s(j.$y,4,"0");case"M":return z+1;case"MM":return A.s(z+1,2,"0");case"MMM":return U(R.monthsShort,z,q,3);case"MMMM":return U(q,z);case"D":return j.$D;case"DD":return A.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return U(R.weekdaysMin,j.$W,W,2);case"ddd":return U(R.weekdaysShort,j.$W,W,3);case"dddd":return W[j.$W];case"H":return String(m);case"HH":return A.s(m,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(m,T,!0);case"A":return J(m,T,!1);case"m":return String(T);case"mm":return A.s(T,2,"0");case"s":return String(j.$s);case"ss":return A.s(j.$s,2,"0");case"SSS":return A.s(j.$ms,3,"0");case"Z":return F}return null})(V)||F.replace(":","")}))},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(D,j,R){var P,F=this,m=A.p(j),T=B(D),z=(T.utcOffset()-this.utcOffset())*r,W=this-T,q=function(){return A.m(F,T)};switch(m){case h:P=q()/12;break;case g:P=q();break;case v:P=q()/3;break;case p:P=(W-z)/6048e5;break;case d:P=(W-z)/864e5;break;case u:P=W/o;break;case l:P=W/r;break;case a:P=W/n;break;default:P=W}return R?P:A.a(P)},w.daysInMonth=function(){return this.endOf(g).$D},w.$locale=function(){return O[this.$L]},w.locale=function(D,j){if(!D)return this.$L;var R=this.clone(),P=H(D,j,!0);return P&&(R.$L=P),R},w.clone=function(){return A.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},C})(),L=Y.prototype;return B.prototype=L,[["$ms",s],["$s",a],["$m",l],["$H",u],["$W",d],["$M",g],["$y",h],["$D",S]].forEach((function(C){L[C[1]]=function(w){return this.$g(w,C[0],C[1])}})),B.extend=function(C,w){return C.$i||(C(w,Y,B),C.$i=!0),B},B.locale=H,B.isDayjs=N,B.unix=function(C){return B(1e3*C)},B.en=O[I],B.Ls=O,B.p={},B}))})(dt)),dt.exports}var ml=vl();const Et=yt(ml);var ft={exports:{}},xl=ft.exports,Gn;function bl(){return Gn||(Gn=1,(function(e,t){(function(n,r){e.exports=r()})(xl,(function(){return function(n,r,o){n=n||{};var s=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(d,p,g,v){return s.fromToBase(d,p,g,v)}o.en.relativeTime=a,s.fromToBase=function(d,p,g,v,h){for(var S,x,y,_=g.$locale().relativeTime||a,E=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],M=E.length,k=0;k<M;k+=1){var I=E[k];I.d&&(S=v?o(d).diff(g,I.d,!0):g.diff(d,I.d,!0));var O=(n.rounding||Math.round)(Math.abs(S));if(y=S>0,O<=I.r||!I.r){O<=1&&k>0&&(I=E[k-1]);var $=_[I.l];h&&(O=h(""+O)),x=typeof $=="string"?$.replace("%d",O):$(O,p,I.l,y);break}}if(p)return x;var N=y?_.future:_.past;return typeof N=="function"?N(x):N.replace("%s",x)},s.to=function(d,p){return l(d,p,this,!0)},s.from=function(d,p){return l(d,p,this)};var u=function(d){return d.$u?o.utc():o()};s.toNow=function(d){return this.to(u(this),d)},s.fromNow=function(d){return this.from(u(this),d)}}}))})(ft)),ft.exports}var yl=bl();const Sl=yt(yl);var ht={exports:{}},wl=ht.exports,qn;function Dl(){return qn||(qn=1,(function(e,t){(function(n,r){e.exports=r()})(wl,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var a=o.prototype,l=a.format;s.en.formats=n,a.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,p=(function(g,v){return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(h,S,x){var y=x&&x.toUpperCase();return S||v[x]||n[x]||v[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,E,M){return E||M.slice(1)}))}))})(u,d===void 0?{}:d);return l.call(this,p)}}}))})(ht)),ht.exports}var Cl=Dl();const jl=yt(Cl);var gt={exports:{}},Rl=gt.exports,Xn;function El(){return Xn||(Xn=1,(function(e,t){(function(n,r){e.exports=r()})(Rl,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(a){var l=this,u=this.$locale();if(!this.isValid())return s.bind(this)(a);var d=this.$utils(),p=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(g){switch(g){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return d.s(l.week(),g==="w"?1:2,"0");case"W":case"WW":return d.s(l.isoWeek(),g==="W"?1:2,"0");case"k":case"kk":return d.s(String(l.$H===0?24:l.$H),g==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return g}}));return s.bind(this)(p)}}}))})(gt)),gt.exports}var Ml=El();const Tl=yt(Ml);Et.extend(Sl);Et.extend(jl);Et.extend(Tl);const Ol={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function Jt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=Et(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Ol[t]):r}function _l({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:a="gray.700",dateFontSize:l="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:p="12px",timeFontWeight:g="400",showTime:v=!0}){return i.jsxs(c.Stack,{gap:.5,align:s,children:[i.jsx(c.Text,{fontSize:l,fontWeight:u,color:a,children:Jt({value:e,variant:t,format:r})}),v&&i.jsx(c.Text,{fontSize:p,fontWeight:g,color:d,children:Jt({value:e,variant:n,format:o})})]})}class Fr{state=new Map;listeners=new Map;get(t){return this.state.get(t)}set(t){this.state.set(t.key,t),this.notify(t.key)}setMany(t){t.forEach(n=>this.set(n))}subscribe(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),n(this.state.get(t)),()=>{this.listeners.get(t)?.delete(n)}}notify(t){this.listeners.get(t)?.forEach(n=>n(this.state.get(t)))}clear(){this.state.clear()}}class Zt{constructor(t){this.baseUrl=t}async fetchLatest(t){const n=new URLSearchParams;return n.set("keys",t.join(",")),(await(await fetch(`${this.baseUrl}/options?${n}`)).json()).data}}class Qt{constructor(t){this.api=t}store=new Fr;inflight=new Map;getRaw(t){return this.store.get(t)}async getKey(t){const n=this.store.get(t);return n?n.value:(await this.fetchMissing([t]),this.store.get(t)?.value)}async getMultiKey(t){const n={},r=[];for(const o of t){const s=this.store.get(o);s?n[o]=s.value:r.push(o)}return r.length&&(await this.fetchMissing(r),r.forEach(o=>{const s=this.store.get(o);s&&(n[o]=s.value)})),n}subscribe(t,n){return this.store.subscribe(t,n)}hydrate(t){this.store.setMany(t)}clear(){this.store.clear()}async fetchMissing(t){const n=t.filter(o=>!this.inflight.has(o));if(!n.length)return;const r=this.api.fetchLatest(n).then(o=>{this.store.setMany(o),n.forEach(s=>this.inflight.delete(s))});n.forEach(o=>this.inflight.set(o,r)),await r}}const Yr=f.createContext(null);function Br(){const e=f.useContext(Yr);if(!e)throw new Error("OptionsProvider is missing. Wrap your app with <OptionsProvider />");return e}function Il({client:{apiUrl:e},children:t}){const n=f.useRef(new Qt(new Zt(e)));return n.current||(n.current=new Qt(new Zt(e))),i.jsx(Yr.Provider,{value:n.current,children:t})}function kl(e){const t=Br(),[n,r]=f.useState(t.getRaw(e)?.value);return f.useEffect(()=>{let o=!0;t.getKey(e).then(a=>{o&&r(a)});const s=t.subscribe(e,a=>{r(a?.value)});return()=>{o=!1,s()}},[e,t]),n}function $l(e){const t=Br(),[n,r]=f.useState({});return f.useEffect(()=>{let o=!0;t.getMultiKey(e).then(a=>{o&&r(a)});const s=e.map(a=>t.subscribe(a,l=>{r(u=>({...u,[a]:l?.value}))}));return()=>{o=!1,s.forEach(a=>a())}},[e.join("|"),t]),n}async function Al(e,t){return e.getKey(t)}async function Ll(e,t){await e.getMultiKey(t)}function Pl(e={}){const{initialPage:t=1,initialLimit:n=20}=e,[r,o]=f.useState(t),[s,a]=f.useState(n),l=f.useCallback(v=>{o(Math.max(1,v))},[]),u=f.useCallback(v=>{a(Math.max(1,v)),o(1)},[]),d=f.useCallback(()=>{o(v=>v+1)},[]),p=f.useCallback(()=>{o(v=>Math.max(1,v-1))},[]),g=f.useCallback(()=>{o(t),a(n)},[t,n]);return{page:r,limit:s,setPage:l,setLimit:u,nextPage:d,prevPage:p,reset:g}}function Nl(e={}){const{initialValue:t="",delay:n=300}=e,[r,o]=f.useState(t),s=zl(r,n),a=f.useCallback(u=>{o(u)},[]),l=f.useCallback(()=>{o(t)},[t]);return{search:r,debouncedSearch:s,onSearchChange:a,reset:l}}function zl(e,t=300){const[n,r]=f.useState(e);return f.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>clearTimeout(o)},[e,t]),n}exports.ACTIONS_COLUMN_ID=$e;exports.DataTable=sa;exports.Filters=pc;exports.HttpOptionsApi=Zt;exports.MDSButton=xc;exports.MDSCheckbox=kr;exports.MDSCombobox=Ec;exports.MDSConfirmActionDialog=Pc;exports.MDSConfirmDeleteDialog=Gc;exports.MDSDatePicker=Ar;exports.MDSDateRangePicker=$r;exports.MDSDialogAction=qc;exports.MDSDialogActions=zr;exports.MDSDialogBody=Nr;exports.MDSDialogWrapper=sl;exports.MDSInput=Kt;exports.MDSPinInput=gl;exports.MDSRefreshButton=un;exports.MDSSelectBox=Lr;exports.OptionsClientImpl=Qt;exports.OptionsProvider=Il;exports.OptionsStore=Fr;exports.RefreshButton=un;exports.StackedDateTime=_l;exports.VISIBILITY_COLUMN_ID=he;exports.addPreset=_r;exports.deletePreset=Ir;exports.formatDateTime=Jt;exports.getColumnWidthKey=jt;exports.getOption=Al;exports.getPresets=Rt;exports.loadOrder=mc;exports.prefetchOptions=Ll;exports.saveOrder=vc;exports.savePresets=ln;exports.setColumnWidth=Qs;exports.setData=wr;exports.setTableId=Dr;exports.tableStore=oe;exports.useDebouncedSearch=Nl;exports.useOption=kl;exports.useOptions=$l;exports.usePagination=Pl;exports.withChildren=b;