@mdspl/mds-shared-ui 0.6.4 → 0.6.6

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 f=require("react"),l=require("@chakra-ui/react"),Ue=require("react-dom");function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}},Be={};var vn;function Br(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var Ve={};var mn;function Vr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===I?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case x:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case O:return"SuspenseList";case z:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case m:return"Portal";case k:return g.displayName||"Context";case E:return(g._context.displayName||"Context")+".Consumer";case $:var R=g.render;return g=g.displayName,g||(g=R.displayName||R.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case L:return R=g.displayName||null,R!==null?R:e(g.type)||"Memo";case V:R=g._payload,g=g._init;try{return e(g(R))}catch{}}return null}function t(g){return""+g}function n(g){try{t(g);var R=!1}catch{R=!0}if(R){R=console;var P=R.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return P.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(g)}}function r(g){if(g===x)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===V)return"<...>";try{var R=e(g);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function o(){var g=U.A;return g===null?null:g.getOwner()}function s(){return Error("react-stack-top-frame")}function c(g){if(X.call(g,"key")){var R=Object.getOwnPropertyDescriptor(g,"key").get;if(R&&R.isReactWarning)return!1}return g.key!==void 0}function a(g,R){function P(){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)",R))}P.isReactWarning=!0,Object.defineProperty(g,"key",{get:P,configurable:!0})}function u(){var g=e(this.type);return _[g]||(_[g]=!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.")),g=this.props.ref,g!==void 0?g:null}function d(g,R,P,B,G,q){var H=P.ref;return g={$$typeof:b,type:g,key:R,props:P,_owner:B},(H!==void 0?H:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function h(g,R,P,B,G,q){var H=R.children;if(H!==void 0)if(B)if(A(H)){for(B=0;B<H.length;B++)p(H[B]);Object.freeze&&Object.freeze(H)}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 p(H);if(X.call(R,"key")){H=e(g);var K=Object.keys(R).filter(function(F){return F!=="key"});B=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Y[H+B]||(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 p=require("react"),l=require("@chakra-ui/react"),Ue=require("react-dom");function Ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}},Be={};var vn;function Br(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var Ve={};var mn;function Vr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===k?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case x:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case T:return"Suspense";case I:return"SuspenseList";case N:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case m:return"Portal";case O:return g.displayName||"Context";case j:return(g._context.displayName||"Context")+".Consumer";case $:var R=g.render;return g=g.displayName,g||(g=R.displayName||R.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case L:return R=g.displayName||null,R!==null?R:e(g.type)||"Memo";case V:R=g._payload,g=g._init;try{return e(g(R))}catch{}}return null}function t(g){return""+g}function n(g){try{t(g);var R=!1}catch{R=!0}if(R){R=console;var P=R.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return P.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(g)}}function r(g){if(g===x)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===V)return"<...>";try{var R=e(g);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function o(){var g=H.A;return g===null?null:g.getOwner()}function s(){return Error("react-stack-top-frame")}function c(g){if(X.call(g,"key")){var R=Object.getOwnPropertyDescriptor(g,"key").get;if(R&&R.isReactWarning)return!1}return g.key!==void 0}function a(g,R){function P(){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)",R))}P.isReactWarning=!0,Object.defineProperty(g,"key",{get:P,configurable:!0})}function u(){var g=e(this.type);return _[g]||(_[g]=!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.")),g=this.props.ref,g!==void 0?g:null}function d(g,R,P,B,G,q){var W=P.ref;return g={$$typeof:b,type:g,key:R,props:P,_owner:B},(W!==void 0?W:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function f(g,R,P,B,G,q){var W=R.children;if(W!==void 0)if(B)if(A(W)){for(B=0;B<W.length;B++)h(W[B]);Object.freeze&&Object.freeze(W)}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 h(W);if(X.call(R,"key")){W=e(g);var K=Object.keys(R).filter(function(F){return F!=="key"});B=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Y[W+B]||(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} />`,B,H,K,H),Y[H+B]=!0)}if(H=null,P!==void 0&&(n(P),H=""+P),c(R)&&(n(R.key),H=""+R.key),"key"in R){P={};for(var J in R)J!=="key"&&(P[J]=R[J])}else P=R;return H&&a(P,typeof g=="function"?g.displayName||g.name||"Unknown":g),d(g,H,P,o(),G,q)}function p(g){y(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===V&&(g._payload.status==="fulfilled"?y(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function y(g){return typeof g=="object"&&g!==null&&g.$$typeof===b}var v=f,b=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),k=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),U=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,A=Array.isArray,D=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(g){return g()}};var C,_={},j=v.react_stack_bottom_frame.bind(v,s)(),N=D(r(s)),Y={};Ve.Fragment=x,Ve.jsx=function(g,R,P){var B=1e4>U.recentlyCreatedOwnerStacks++;return h(g,R,P,!1,B?Error("react-stack-top-frame"):j,B?D(r(g)):N)},Ve.jsxs=function(g,R,P){var B=1e4>U.recentlyCreatedOwnerStacks++;return h(g,R,P,!0,B?Error("react-stack-top-frame"):j,B?D(r(g)):N)}})()),Ve}var bn;function Hr(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Br():it.exports=Vr()),it.exports}var i=Hr();function Wr(){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 Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Zt(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:Zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Qt(e){const{Document:t}=ae(e);return e instanceof t}function Qe(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function Gn(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:Zt(e)?Qt(e)?e:Qe(e)||Gn(e)?e.ownerDocument:document:document:document}const be=Dt?f.useLayoutEffect:f.useEffect;function en(e){const t=f.useRef(e);return be(()=>{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 Ur(){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 Ke(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function et(e,t){const n=f.useRef();return f.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=en(e),n=f.useRef(null),r=f.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Ht(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let $t={};function tt(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 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((s,c)=>{const a=Object.entries(c);for(const[u,d]of a){const h=s[u];h!=null&&(s[u]=h+e*d)}return s},{...t})}}const $e=qn(1),xt=qn(-1);function Gr(e){return"clientX"in e&&"clientY"in e}function tn(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function qr(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(qr(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 Gr(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}}}),xn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xr(e){return e.matches(xn)?e:e.querySelector(xn)}const Kr={display:"none"};function Jr(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:Kr},n)}function Zr(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 Qr(){const[e,t]=f.useState("");return{announce:f.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Xn=f.createContext(null);function eo(e){const t=f.useContext(Xn);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function to(){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(c=>{var a;return(a=c[o])==null?void 0:a.call(c,s)})},[e]),t]}const no={draggable:`
6
+ <%s key={someKey} {...props} />`,B,W,K,W),Y[W+B]=!0)}if(W=null,P!==void 0&&(n(P),W=""+P),c(R)&&(n(R.key),W=""+R.key),"key"in R){P={};for(var J in R)J!=="key"&&(P[J]=R[J])}else P=R;return W&&a(P,typeof g=="function"?g.displayName||g.name||"Unknown":g),d(g,W,P,o(),G,q)}function h(g){y(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===V&&(g._payload.status==="fulfilled"?y(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function y(g){return typeof g=="object"&&g!==null&&g.$$typeof===b}var v=p,b=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),O=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),H=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,A=Array.isArray,D=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(g){return g()}};var C,_={},E=v.react_stack_bottom_frame.bind(v,s)(),z=D(r(s)),Y={};Ve.Fragment=x,Ve.jsx=function(g,R,P){var B=1e4>H.recentlyCreatedOwnerStacks++;return f(g,R,P,!1,B?Error("react-stack-top-frame"):E,B?D(r(g)):z)},Ve.jsxs=function(g,R,P){var B=1e4>H.recentlyCreatedOwnerStacks++;return f(g,R,P,!0,B?Error("react-stack-top-frame"):E,B?D(r(g)):z)}})()),Ve}var bn;function Hr(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Br():it.exports=Vr()),it.exports}var i=Hr();function Wr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Zt(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:Zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Qt(e){const{Document:t}=ae(e);return e instanceof t}function Qe(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function Gn(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:Zt(e)?Qt(e)?e:Qe(e)||Gn(e)?e.ownerDocument:document:document:document}const be=Dt?p.useLayoutEffect:p.useEffect;function en(e){const t=p.useRef(e);return be(()=>{t.current=e}),p.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 Ur(){const e=p.useRef(null),t=p.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function et(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=en(e),n=p.useRef(null),r=p.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Ht(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let $t={};function tt(e,t){return p.useMemo(()=>{if(t)return t;const n=$t[e]==null?0:$t[e]+1;return $t[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((s,c)=>{const a=Object.entries(c);for(const[u,d]of a){const f=s[u];f!=null&&(s[u]=f+e*d)}return s},{...t})}}const $e=qn(1),xt=qn(-1);function Gr(e){return"clientX"in e&&"clientY"in e}function tn(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function qr(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(qr(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 Gr(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}}}),xn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Xr(e){return e.matches(xn)?e:e.querySelector(xn)}const Kr={display:"none"};function Jr(e){let{id:t,value:n}=e;return p.createElement("div",{id:t,style:Kr},n)}function Zr(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 p.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Qr(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Xn=p.createContext(null);function eo(e){const t=p.useContext(Xn);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function to(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:o,event:s}=r;e.forEach(c=>{var a;return(a=c[o])==null?void 0:a.call(c,s)})},[e]),t]}const no={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
- `},ro={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 oo(e){let{announcements:t=ro,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=no}=e;const{announce:s,announcement:c}=Qr(),a=tt("DndLiveRegion"),[u,d]=f.useState(!1);if(f.useEffect(()=>{d(!0)},[]),eo(f.useMemo(()=>({onDragStart(p){let{active:y}=p;s(t.onDragStart({active:y}))},onDragMove(p){let{active:y,over:v}=p;t.onDragMove&&s(t.onDragMove({active:y,over:v}))},onDragOver(p){let{active:y,over:v}=p;s(t.onDragOver({active:y,over:v}))},onDragEnd(p){let{active:y,over:v}=p;s(t.onDragEnd({active:y,over:v}))},onDragCancel(p){let{active:y,over:v}=p;s(t.onDragCancel({active:y,over:v}))}}),[s,t])),!u)return null;const h=f.createElement(f.Fragment,null,f.createElement(Jr,{id:r,value:o.draggable}),f.createElement(Zr,{id:a,announcement:c}));return n?Ue.createPortal(h,n):h}var Q;(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"})(Q||(Q={}));function yt(){}function so(e,t){return f.useMemo(()=>({sensor:e,options:{}}),[e,t])}function io(){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 ge=Object.freeze({x:0,y:0});function ao(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function co(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function lo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uo(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),s=[];for(const c of r){const{id:a}=c,u=n.get(a);if(u){const d=ao(yn(u),o);s.push({id:a,data:{droppableContainer:c,value:d}})}}return s.sort(co)};function fo(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),c=o-r,a=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,h=c*a,p=h/(u+d-h);return Number(p.toFixed(4))}return 0}const ho=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:c}=s,a=n.get(c);if(a){const u=fo(a,t);u>0&&o.push({id:c,data:{droppableContainer:s,value:u}})}}return o.sort(lo)};function po(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 go(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((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.x}),{...n})}}const vo=go(1);function mo(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 bo(e,t,n){const r=mo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:c,y:a}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,p=s?e.height/s:e.height;return{width:h,height:p,top:d,right:u+h,bottom:d+p,left:u}}const xo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=xo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=ae(e).getComputedStyle(e);d&&(n=bo(n,d,h))}const{top:r,left:o,width:s,height:c,bottom:a,right:u}=n;return{top:r,left:o,width:s,height:c,bottom:a,right:u}}function Sn(e){return Ne(e,{ignoreTransform:!0})}function yo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function So(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function wo(e,t){t===void 0&&(t=ae(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 nn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Qt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Qe(o)||Gn(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&wo(o,s)&&n.push(o),So(o,s)?n:r(o.parentNode)}return e?r(e):n}function Zn(e){const[t]=nn(e,1);return t??null}function It(e){return!Dt||!e?null:Ae(e)?e:Zt(e)?Qt(e)||e===Le(e).scrollingElement?window:Qe(e)?e:null:null}function Qn(e){return Ae(e)?e.scrollX:e.scrollLeft}function er(e){return Ae(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:Qn(e),y:er(e)}}var ee;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ee||(ee={}));function tr(e){return!Dt||!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,s=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:c,isRight:a,maxScroll:r,minScroll:t}}const Co={x:.2,y:.2};function Do(e,t,n,r,o){let{top:s,left:c,right:a,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Co);const{isTop:d,isBottom:h,isLeft:p,isRight:y}=nr(e),v={x:0,y:0},b={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+m.height?(v.y=ee.Backward,b.y=r*Math.abs((t.top+m.height-s)/m.height)):!h&&u>=t.bottom-m.height&&(v.y=ee.Forward,b.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!y&&a>=t.right-m.width?(v.x=ee.Forward,b.x=r*Math.abs((t.right-m.width-a)/m.width)):!p&&c<=t.left+m.width&&(v.x=ee.Backward,b.x=r*Math.abs((t.left+m.width-c)/m.width)),{direction:v,speed:b}}function Ro(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,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)=>$e(t,Ut(n)),ge)}function Eo(e){return e.reduce((t,n)=>t+Qn(n),0)}function jo(e){return e.reduce((t,n)=>t+er(n),0)}function To(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Zn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mo=[["x",["left","right"],Eo],["y",["top","bottom"],jo]];class rn{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=nn(n),o=rr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,a]of Mo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=a(r),h=o[s]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ge{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 _o(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function At(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 Oo(e){e.stopPropagation()}var W;(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"})(W||(W={}));const or={start:[W.Space,W.Enter],cancel:[W.Esc],end:[W.Space,W.Enter,W.Tab]},ko=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case W.Right:return{...n,x:n.x+25};case W.Left:return{...n,x:n.x-25};case W.Down:return{...n,y:n.y+25};case W.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 Ge(Le(n)),this.windowListeners=new Ge(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&&To(r),n(ge)}handleKeyDown(t){if(tn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=or,coordinateGetter:c=ko,scrollBehavior:a="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,h=d?{x:d.left,y:d.top}:ge;this.referenceCoordinates||(this.referenceCoordinates=h);const p=c(t,{active:n,context:r.current,currentCoordinates:h});if(p){const y=xt(p,h),v={x:0,y:0},{scrollableAncestors:b}=r.current;for(const m of b){const x=t.code,{isTop:w,isRight:T,isLeft:E,isBottom:k,maxScroll:$,minScroll:M}=nr(m),O=Ro(m),L={x:Math.min(x===W.Right?O.right-O.width/2:O.right,Math.max(x===W.Right?O.left:O.left+O.width/2,p.x)),y:Math.min(x===W.Down?O.bottom-O.height/2:O.bottom,Math.max(x===W.Down?O.top:O.top+O.height/2,p.y))},V=x===W.Right&&!T||x===W.Left&&!E,z=x===W.Down&&!k||x===W.Up&&!w;if(V&&L.x!==p.x){const I=m.scrollLeft+y.x,U=x===W.Right&&I<=$.x||x===W.Left&&I>=M.x;if(U&&!y.y){m.scrollTo({left:I,behavior:a});return}U?v.x=m.scrollLeft-I:v.x=x===W.Right?m.scrollLeft-$.x:m.scrollLeft-M.x,v.x&&m.scrollBy({left:-v.x,behavior:a});break}else if(z&&L.y!==p.y){const I=m.scrollTop+y.y,U=x===W.Down&&I<=$.y||x===W.Up&&I>=M.y;if(U&&!y.x){m.scrollTo({top:I,behavior:a});return}U?v.y=m.scrollTop-I:v.y=x===W.Down?m.scrollTop-$.y:m.scrollTop-M.y,v.y&&m.scrollBy({top:-v.y,behavior:a});break}}this.handleMove(t,$e(xt(p,this.referenceCoordinates),v))}}}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:s}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const a=s.activatorNode.current;return a&&e.target!==a?!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 on{constructor(t,n,r){var o;r===void 0&&(r=_o(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:c}=s;this.props=t,this.events=n,this.document=Le(c),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(c)),this.initialCoordinates=(o=Wt(s))!=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,Oo,{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:c,options:{activationConstraint:a}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:ge,d=xt(o,u);if(!r&&a){if(Cn(a)){if(a.tolerance!=null&&At(d,a.tolerance))return this.handleCancel();if(At(d,a.distance))return this.handleStart()}if(Dn(a)&&At(d,a.tolerance))return this.handleCancel();this.handlePending(a,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===W.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $o={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sn extends on{constructor(t){const{event:n}=t,r=Le(n.target);super(t,$o,r)}}sn.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 Io={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Ao extends on{constructor(t){super(t,Io,Le(t.event.target))}}Ao.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Gt.RightClick?!1:(r?.({event:n}),!0)}}];const Lt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Lo extends on{constructor(t){super(t,Lt)}static setup(){return window.addEventListener(Lt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Lt.move.name,t)};function t(){}}}Lo.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 qe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(qe||(qe={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function No(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:a=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:p,threshold:y}=e;const v=Po({delta:p,disabled:!s}),[b,m]=Ur(),x=f.useRef({x:0,y:0}),w=f.useRef({x:0,y:0}),T=f.useMemo(()=>{switch(n){case qe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case qe.DraggableRect:return o}},[n,o,u]),E=f.useRef(null),k=f.useCallback(()=>{const M=E.current;if(!M)return;const O=x.current.x*w.current.x,L=x.current.y*w.current.y;M.scrollBy(O,L)},[]),$=f.useMemo(()=>a===St.TreeOrder?[...d].reverse():d,[a,d]);f.useEffect(()=>{if(!s||!d.length||!T){m();return}for(const M of $){if(r?.(M)===!1)continue;const O=d.indexOf(M),L=h[O];if(!L)continue;const{direction:V,speed:z}=Do(M,L,T,t,y);for(const I of["x","y"])v[I][V[I]]||(z[I]=0,V[I]=0);if(z.x>0||z.y>0){m(),E.current=M,b(k,c),x.current=z,w.current=V;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,k,r,m,s,c,JSON.stringify(T),JSON.stringify(v),b,d,$,h,JSON.stringify(y)])}const zo={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function Po(e){let{delta:t,disabled:n}=e;const r=Ht(t);return et(o=>{if(n||!r||!o)return zo;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ee.Backward]:o.x[ee.Backward]||s.x===-1,[ee.Forward]:o.x[ee.Forward]||s.x===1},y:{[ee.Backward]:o.y[ee.Backward]||s.y===-1,[ee.Forward]:o.y[ee.Forward]||s.y===1}}},[n,t,r])}function Yo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return et(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Fo(e,t){return f.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...s]},[]),[e,t])}var Je;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Je||(Je={}));var qt;(function(e){e.Optimized="optimized"})(qt||(qt={}));const Rn=new Map;function Bo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,c]=f.useState(null),{frequency:a,measure:u,strategy:d}=o,h=f.useRef(e),p=x(),y=Ke(p),v=f.useCallback(function(w){w===void 0&&(w=[]),!y.current&&c(T=>T===null?w:T.concat(w.filter(E=>!T.includes(E))))},[y]),b=f.useRef(null),m=et(w=>{if(p&&!n)return Rn;if(!w||w===Rn||h.current!==e||s!=null){const T=new Map;for(let E of e){if(!E)continue;if(s&&s.length>0&&!s.includes(E.id)&&E.rect.current){T.set(E.id,E.rect.current);continue}const k=E.node.current,$=k?new rn(u(k),k):null;E.rect.current=$,$&&T.set(E.id,$)}return T}return w},[e,s,n,p,u]);return f.useEffect(()=>{h.current=e},[e]),f.useEffect(()=>{p||v()},[n,p]),f.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),f.useEffect(()=>{p||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{v(),b.current=null},a))},[a,p,v,...r]),{droppableRects:m,measureDroppableContainers:v,measuringScheduled:s!=null};function x(){switch(d){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function ir(e,t){return et(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vo(e,t){return ir(e,t)}function Ho(e){let{callback:t,disabled:n}=e;const r=en(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 Rt(e){let{callback:t,disabled:n}=e;const r=en(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 Wo(e){return new rn(Ne(e),e)}function En(e,t,n){t===void 0&&(t=Wo);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 h=t(e);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const c=Ho({callback(u){if(e)for(const d of u){const{type:h,target:p}=d;if(h==="childList"&&p instanceof HTMLElement&&p.contains(e)){s();break}}}}),a=Rt({callback:s});return be(()=>{s(),e?(a?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),c?.disconnect())},[e]),r}function Uo(e){const t=ir(e);return Jn(e,t)}const jn=[];function Go(e){const t=f.useRef(e),n=et(r=>e?r&&r!==jn&&e&&t.current&&e.parentNode===t.current.parentNode?r:nn(e):jn,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function qo(e){const[t,n]=f.useState(null),r=f.useRef(e),o=f.useCallback(s=>{const c=It(s.target);c&&n(a=>a?(a.set(c,Ut(c)),new Map(a)):null)},[]);return f.useEffect(()=>{const s=r.current;if(e!==s){c(s);const a=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),r.current=e}return()=>{c(e),c(s)};function c(a){a.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>$e(s,c),ge):rr(e):ge,[e,t])}function Tn(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const r=e!==ge;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):ge}function Xo(e){f.useEffect(()=>{if(!Dt)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 Ko(e,t){return f.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=c=>{s(c,t)},n},{}),[e,t])}function ar(e){return f.useMemo(()=>e?yo(e):null,[e])}const Mn=[];function Jo(e,t){t===void 0&&(t=Ne);const[n]=e,r=ar(n?ae(n):null),[o,s]=f.useState(Mn);function c(){s(()=>e.length?e.map(u=>tr(u)?r:new rn(t(u),u)):Mn)}const a=Rt({callback:c});return be(()=>{a?.disconnect(),c(),e.forEach(u=>a?.observe(u))},[e]),o}function Zo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function Qo(e){let{measure:t}=e;const[n,r]=f.useState(null),o=f.useCallback(d=>{for(const{target:h}of d)if(Qe(h)){r(p=>{const y=t(h);return p?{...p,width:y.width,height:y.height}:y});break}},[t]),s=Rt({callback:o}),c=f.useCallback(d=>{const h=Zo(d);s?.disconnect(),h&&s?.observe(h),r(h?t(h):null)},[t,s]),[a,u]=bt(c);return f.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const es=[{sensor:sn,options:{}},{sensor:sr,options:{}}],ts={current:{}},ht={draggable:{measure:Sn},droppable:{measure:Sn,strategy:Je.WhileDragging,frequency:qt.Optimized},dragOverlay:{measure:Ne}};class Xe 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 ns={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:yt,windowRect:null,measuringScheduled:!1},rs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Et=f.createContext(rs),cr=f.createContext(ns);function os(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function ss(e,t){switch(t.type){case Q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Q.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 Q.DragEnd:case Q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Xe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const c=new Xe(e.droppable.containers);return c.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Xe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function is(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=f.useContext(Et),s=Ht(r),c=Ht(n?.id);return f.useEffect(()=>{if(!t&&!r&&s&&c!=null){if(!tn(s)||document.activeElement===s.target)return;const a=o.get(c);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const p=Xr(h);if(p){p.focus();break}}})}},[r,t,o,c,s]),null}function as(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function cs(e){return f.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ls(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=f.useRef(!1),{x:c,y:a}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!c&&!a||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),p=Jn(h,r);if(c||(p.x=0),a||(p.y=0),s.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const y=Zn(d);y&&y.scrollBy({top:p.y,left:p.x})}},[t,c,a,r,n])}const lr=f.createContext({...ge,scaleX:1,scaleY:1});var Ee;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ee||(Ee={}));const ur=f.memo(function(t){var n,r,o,s;let{id:c,accessibility:a,autoScroll:u=!0,children:d,sensors:h=es,collisionDetection:p=ho,measuring:y,modifiers:v,...b}=t;const m=f.useReducer(ss,void 0,os),[x,w]=m,[T,E]=to(),[k,$]=f.useState(Ee.Uninitialized),M=k===Ee.Initialized,{draggable:{active:O,nodes:L,translate:V},droppable:{containers:z}}=x,I=O!=null?L.get(O):null,U=f.useRef({initial:null,translated:null}),X=f.useMemo(()=>{var re;return O!=null?{id:O,data:(re=I?.data)!=null?re:ts,rect:U}:null},[O,I]),A=f.useRef(null),[D,C]=f.useState(null),[_,j]=f.useState(null),N=Ke(b,Object.values(b)),Y=tt("DndDescribedBy",c),g=f.useMemo(()=>z.getEnabled(),[z]),R=cs(y),{droppableRects:P,measureDroppableContainers:B,measuringScheduled:G}=Bo(g,{dragging:M,dependencies:[V.x,V.y],config:R.droppable}),q=Yo(L,O),H=f.useMemo(()=>_?Wt(_):null,[_]),K=Fr(),J=Vo(q,R.draggable.measure);ls({activeNode:O!=null?L.get(O):null,config:K.layoutShiftCompensation,initialRect:J,measure:R.draggable.measure});const F=En(q,R.draggable.measure,J),se=En(q?q.parentElement:null),ne=f.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=z.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=Qo({measure:R.dragOverlay.measure}),Te=(r=xe.nodeRef.current)!=null?r:q,Me=M?(o=xe.rect)!=null?o:F:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=Uo(cn?null:F),_t=ar(Te?ae(Te):null),Se=Go(M?he??q:null),ot=Jo(Se),st=as(v,{transform:{x:V.x-ln.x,y:V.y-ln.y,scaleX:1,scaleY:1},activatorEvent:_,active:X,activeNodeRect:F,containerNodeRect:se,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:_t}),un=H?$e(H,V):null,dn=qo(Se),Ir=Tn(dn),Ar=Tn(dn,[F]),_e=$e(st,Ir),Oe=Me?vo(Me,st):null,ze=X&&Oe?p({active:X,collisionRect:Oe,droppableRects:P,droppableContainers:g,pointerCoordinates:un}):null,fn=uo(ze,"id"),[we,hn]=f.useState(null),Lr=cn?st:$e(st,Ar),Nr=po(Lr,(s=we?.rect)!=null?s:null,F),Ot=f.useRef(null),pn=f.useCallback((re,ce)=>{let{sensor:le,options:Ce}=ce;if(A.current==null)return;const de=L.get(A.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:A.current,activeNode:de,event:ue,options:Ce,context:ne,onAbort(te){if(!L.get(te))return;const{onDragAbort:me}=N.current,ye={id:te};me?.(ye),T({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!L.get(te))return;const{onDragPending:Ye}=N.current,Re={id:te,constraint:De,initialCoordinates:me,offset:ye};Ye?.(Re),T({type:"onDragPending",event:Re})},onStart(te){const De=A.current;if(De==null)return;const me=L.get(De);if(!me)return;const{onDragStart:ye}=N.current,Pe={activatorEvent:ue,active:{id:De,data:me.data,rect:U}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),$(Ee.Initializing),w({type:Q.DragStart,initialCoordinates:te,active:De}),T({type:"onDragStart",event:Pe}),C(Ot.current),j(ue)})},onMove(te){w({type:Q.DragMove,coordinates:te})},onEnd:ke(Q.DragEnd),onCancel:ke(Q.DragCancel)});Ot.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:Pe,scrollAdjustedTranslate:Ye}=ne.current;let Re=null;if(me&&Ye){const{cancelDrop:Fe}=N.current;Re={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Q.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(Re))&&(te=Q.DragCancel)}A.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),$(Ee.Uninitialized),hn(null),C(null),j(null),Ot.current=null;const Fe=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(Re){const kt=N.current[Fe];kt?.(Re),T({type:Fe,event:Re})}})}}},[L]),zr=f.useCallback((re,ce)=>(le,Ce)=>{const de=le.nativeEvent,ue=L.get(Ce);if(A.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},A.current=Ce,pn(le,ce))},[L,pn]),gn=Fo(h,zr);Xo(h),be(()=>{F&&k===Ee.Initializing&&$(Ee.Initialized)},[F,k]),f.useEffect(()=>{const{onDragMove:re}=N.current,{active:ce,activatorEvent:le,collisions:Ce,over:de}=ne.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:Ce,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(ue),T({type:"onDragMove",event:ue})})},[_e.x,_e.y]),f.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:Ce,scrollAdjustedTranslate:de}=ne.current;if(!re||A.current==null||!ce||!de)return;const{onDragOver:ue}=N.current,ve=Ce.get(fn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:re,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{hn(ke),ue?.(te),T({type:"onDragOver",event:te})})},[fn]),be(()=>{ne.current={activatorEvent:_,active:X,activeNode:q,collisionRect:Oe,collisions:ze,droppableRects:P,draggableNodes:L,draggingNode:Te,draggingNodeRect:Me,droppableContainers:z,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},U.current={initial:Me,translated:Oe}},[X,q,ze,Oe,L,Te,Me,P,z,we,Se,_e]),No({...K,delta:V,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:ot});const Pr=f.useMemo(()=>({active:X,activeNode:q,activeNodeRect:F,activatorEvent:_,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:L,droppableContainers:z,droppableRects:P,over:we,measureDroppableContainers:B,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:R,measuringScheduled:G,windowRect:_t}),[X,q,F,_,ze,se,xe,L,z,P,we,B,Se,ot,R,G,_t]),Yr=f.useMemo(()=>({activatorEvent:_,activators:gn,active:X,activeNodeRect:F,ariaDescribedById:{draggable:Y},dispatch:w,draggableNodes:L,over:we,measureDroppableContainers:B}),[_,gn,X,F,w,Y,L,we,B]);return f.createElement(Xn.Provider,{value:E},f.createElement(Et.Provider,{value:Yr},f.createElement(cr.Provider,{value:Pr},f.createElement(lr.Provider,{value:Nr},d)),f.createElement(is,{disabled:a?.restoreFocus===!1})),f.createElement(oo,{...a,hiddenTextDescribedById:Y}));function Fr(){const re=D?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=M&&!re&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),us=f.createContext(null),_n="button",ds="Draggable";function fs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(ds),{activators:c,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:p,over:y}=f.useContext(Et),{role:v=_n,roleDescription:b="draggable",tabIndex:m=0}=o??{},x=u?.id===t,w=f.useContext(x?lr:us),[T,E]=bt(),[k,$]=bt(),M=Ko(c,t),O=Ke(n);be(()=>(p.set(t,{id:t,key:s,node:T,activatorNode:k,data:O}),()=>{const V=p.get(t);V&&V.key===s&&p.delete(t)}),[p,t]);const L=f.useMemo(()=>({role:v,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&v===_n?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[r,v,m,x,b,h.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:L,isDragging:x,listeners:r?void 0:M,node:T,over:y,setNodeRef:E,setActivatorNodeRef:$,transform:w}}function hs(){return f.useContext(cr)}const ps="Droppable",gs={timeout:25};function vs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(ps),{active:c,dispatch:a,over:u,measureDroppableContainers:d}=f.useContext(Et),h=f.useRef({disabled:n}),p=f.useRef(!1),y=f.useRef(null),v=f.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:x}={...gs,...o},w=Ke(m??r),T=f.useCallback(()=>{if(!p.current){p.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),v.current=null},x)},[x]),E=Rt({callback:T,disabled:b||!c}),k=f.useCallback((L,V)=>{E&&(V&&(E.unobserve(V),p.current=!1),L&&E.observe(L))},[E]),[$,M]=bt(k),O=Ke(t);return f.useEffect(()=>{!E||!$.current||(E.disconnect(),p.current=!1,E.observe($.current))},[$,E]),f.useEffect(()=>(a({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:y,data:O}}),()=>a({type:Q.UnregisterDroppable,key:s,id:r})),[r]),f.useEffect(()=>{n!==h.current.disabled&&(a({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,a]),{active:c,rect:y,isOver:u?.id===r,node:$,over:u,setNodeRef:M}}function jt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ms(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function at(e){return e!==null&&e>=0}function bs(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 xs(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},ys=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:c}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const u=Ss(n,c,o);if(c===o){const d=n[s];return d?{x:o<s?d.left+d.width-(a.left+a.width):d.left-a.left,y:0,...ct}:null}return c>o&&c<=s?{x:-a.width-u,y:0,...ct}:c<o&&c>=s?{x:a.width+u,y:0,...ct}:{x:0,y:0,...ct}};function Ss(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 dr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=jt(t,r,n),c=t[o],a=s[o];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},lt={scaleX:1,scaleY:1},ws=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:c}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(o===n){const d=s[c];return d?{x:0,y:n<c?d.top+d.height-(a.top+a.height):d.top-a.top,...lt}:null}const u=Cs(s,o,n);return o>n&&o<=c?{x:0,y:-a.height-u,...lt}:o<n&&o>=c?{x:0,y:a.height+u,...lt}:{x:0,y:0,...lt}};function Cs(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 fr="Sortable",hr=f.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function pr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:s=!1}=e;const{active:c,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:h}=hs(),p=tt(fr,n),y=a.rect!==null,v=f.useMemo(()=>r.map(M=>typeof M=="object"&&"id"in M?M.id:M),[r]),b=c!=null,m=c?v.indexOf(c.id):-1,x=d?v.indexOf(d.id):-1,w=f.useRef(v),T=!bs(v,w.current),E=x!==-1&&m===-1||T,k=xs(s);be(()=>{T&&b&&h(v)},[T,v,b,h]),f.useEffect(()=>{w.current=v},[v]);const $=f.useMemo(()=>({activeIndex:m,containerId:p,disabled:k,disableTransforms:E,items:v,overIndex:x,useDragOverlay:y,sortedRects:ms(v,u),strategy:o}),[m,p,k.draggable,k.droppable,E,v,x,u,y,o]);return f.createElement(hr.Provider,{value:$},t)}const Ds=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return jt(n,r,o).indexOf(t)},Rs=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:c,previousItems:a,previousContainerId:u,transition:d}=e;return!d||!r||a!==s&&o===c?!1:n?!0:c!==o&&t===u},Es={duration:200,easing:"ease"},gr="transform",js=Ie.Transition.toString({property:gr,duration:0,easing:"linear"}),Ts={roleDescription:"sortable"};function Ms(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,c]=f.useState(null),a=f.useRef(n);return be(()=>{if(!t&&n!==a.current&&r.current){const u=o.current;if(u){const d=Ne(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&c(h)}}n!==a.current&&(a.current=n)},[t,n,r,o]),f.useEffect(()=>{s&&c(null)},[s]),s}function vr(e){let{animateLayoutChanges:t=Rs,attributes:n,disabled:r,data:o,getNewIndex:s=Ds,id:c,strategy:a,resizeObserverConfig:u,transition:d=Es}=e;const{items:h,containerId:p,activeIndex:y,disabled:v,disableTransforms:b,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:T}=f.useContext(hr),E=_s(r,v),k=h.indexOf(c),$=f.useMemo(()=>({sortable:{containerId:p,index:k,items:h},...o}),[p,o,k,h]),M=f.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:O,node:L,isOver:V,setNodeRef:z}=vs({id:c,data:$,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...u}}),{active:I,activatorEvent:U,activeNodeRect:X,attributes:A,setNodeRef:D,listeners:C,isDragging:_,over:j,setActivatorNodeRef:N,transform:Y}=fs({id:c,data:$,attributes:{...Ts,...n},disabled:E.draggable}),g=Wr(z,D),R=!!I,P=R&&!b&&at(y)&&at(x),B=!w&&_,G=B&&P?Y:null,H=P?G??(a??T)({rects:m,activeNodeRect:X,activeIndex:y,overIndex:x,index:k}):null,K=at(y)&&at(x)?s({id:c,items:h,activeIndex:y,overIndex:x}):k,J=I?.id,F=f.useRef({activeId:J,items:h,newIndex:K,containerId:p}),se=h!==F.current.items,ne=t({active:I,containerId:p,isDragging:_,isSorting:R,id:c,index:k,items:h,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=Ms({disabled:!ne,index:k,node:L,rect:O});return f.useEffect(()=>{R&&F.current.newIndex!==K&&(F.current.newIndex=K),p!==F.current.containerId&&(F.current.containerId=p),h!==F.current.items&&(F.current.items=h)},[R,K,p,h]),f.useEffect(()=>{if(J===F.current.activeId)return;if(J!=null&&F.current.activeId==null){F.current.activeId=J;return}const Te=setTimeout(()=>{F.current.activeId=J},50);return()=>clearTimeout(Te)},[J]),{active:I,activeIndex:y,attributes:A,data:$,rect:O,index:k,newIndex:K,items:h,isOver:V,isSorting:R,isDragging:_,listeners:C,node:L,overIndex:x,over:j,setNodeRef:g,setActivatorNodeRef:N,setDroppableNodeRef:z,setDraggableNodeRef:D,transform:he??H,transition:xe()};function xe(){if(he||se&&F.current.newIndex===k)return js;if(!(B&&!tn(U)||!d)&&(R||ne))return Ie.Transition.toString({...d,property:gr})}}function _s(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}}W.Down,W.Right,W.Up,W.Left;var ut={exports:{}},Nt={},dt={exports:{}},zt={};var On;function Os(){if(On)return zt;On=1;var e=f;function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function a(p,y){var v=y(),b=r({inst:{value:v,getSnapshot:y}}),m=b[0].inst,x=b[1];return s(function(){m.value=v,m.getSnapshot=y,u(m)&&x({inst:m})},[p,v,y]),o(function(){return u(m)&&x({inst:m}),p(function(){u(m)&&x({inst:m})})},[p]),c(v),v}function u(p){var y=p.getSnapshot;p=p.value;try{var v=y();return!n(p,v)}catch{return!0}}function d(p,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return zt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,zt}var Pt={};var kn;function ks(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}function t(v,b){h||o.startTransition===void 0||(h=!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 m=b();if(!p){var x=b();s(m,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}x=c({inst:{value:m,getSnapshot:b}});var w=x[0].inst,T=x[1];return u(function(){w.value=m,w.getSnapshot=b,n(w)&&T({inst:w})},[v,m,b]),a(function(){return n(w)&&T({inst:w}),v(function(){n(w)&&T({inst:w})})},[v]),d(m),m}function n(v){var b=v.getSnapshot;v=v.value;try{var m=b();return!s(v,m)}catch{return!0}}function r(v,b){return b()}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,c=o.useState,a=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,h=!1,p=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Pt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Pt}var $n;function mr(){return $n||($n=1,process.env.NODE_ENV==="production"?dt.exports=Os():dt.exports=ks()),dt.exports}var In;function $s(){if(In)return Nt;In=1;var e=f,t=mr();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Nt.useSyncExternalStoreWithSelector=function(d,h,p,y,v){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=a(function(){function w(M){if(!T){if(T=!0,E=M,M=y(M),v!==void 0&&m.hasValue){var O=m.value;if(v(O,M))return k=O}return k=M}if(O=k,r(E,M))return O;var L=y(M);return v!==void 0&&v(O,L)?(E=M,O):(E=M,k=L)}var T=!1,E,k,$=p===void 0?null:p;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,p,y,v]);var x=o(d,b[0],b[1]);return c(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},Nt}var Yt={};var An;function Is(){return An||(An=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=f,n=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,a=t.useMemo,u=t.useDebugValue;Yt.useSyncExternalStoreWithSelector=function(d,h,p,y,v){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=a(function(){function w(M){if(!T){if(T=!0,E=M,M=y(M),v!==void 0&&m.hasValue){var O=m.value;if(v(O,M))return k=O}return k=M}if(O=k,r(E,M))return O;var L=y(M);return v!==void 0&&v(O,L)?(E=M,O):(E=M,k=L)}var T=!1,E,k,$=p===void 0?null:p;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,p,y,v]);var x=o(d,b[0],b[1]);return c(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Yt}var Ln;function As(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?ut.exports=$s():ut.exports=Is()),ut.exports}var Ls=As();const Xt=new WeakMap,Ns=new WeakMap,wt={current:[]};let Ft=!1;const ft=new Set,Nn=new Map;function br(e){for(const t of e){if(wt.current.includes(t))continue;wt.current.push(t),t.recompute();const n=Ns.get(t);if(n)for(const r of n){const o=Xt.get(r);o?.length&&br(o)}}}function zs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ps(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ys(e){if(ft.add(e),!Ft)try{for(Ft=!0;ft.size>0;){const t=Array.from(ft);ft.clear();for(const n of t){const r=Nn.get(n)??n.prevState;n.prevState=r,zs(n)}for(const n of t){const r=Xt.get(n);r&&(wt.current.push(n),br(r))}for(const n of t){const r=Xt.get(n);if(r)for(const o of r)Ps(o)}}}finally{Ft=!1,wt.current=[],Nn.clear()}}function Fs(e){return typeof e=="function"}class xr{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const c=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.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):Fs(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Ys(this)}}function nt(e,t=r=>r,n={}){const r=n.equal??Bs;return Ls.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Bs(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 ie=new xr({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}});function yr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(h=>({id:h,label:h}))).filter(h=>Object.prototype.hasOwnProperty.call(n,h.id)),{tableId:s}=ie.state,c=JSON.parse(localStorage.getItem(Cr(s))||"[]"),a=[...c.map(h=>o.find(p=>p.id===h)).filter(Boolean),...o.filter(h=>!c.includes(h.id))],u=JSON.parse(localStorage.getItem(Dr(s))||"{}"),d=a.reduce((h,p)=>(h[p.id]=u[p.id]??!0,h),{});ie.setState(h=>({...h,data:e,columnOrder:a,visibility:d,sortableColumns:a.map(p=>({id:p.id,label:p.label,sortable:!0,backgroundColor:p.backgroundColor}))}))}function Sr(e){ie.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const wr=e=>{ie.setState(t=>({...t,actionsConfig:e}))},Cr=e=>`table_column_order_v1:${e}`,Dr=e=>`table_column_visibility_v1:${e}`,Vs=e=>{const{tableId:t}=ie.state;localStorage.setItem(Cr(t),JSON.stringify(e.map(n=>n.id))),ie.setState(n=>({...n,columnOrder:e})),ie.setState(n=>({...n,columnOrder:e}))};function Hs(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Ws=e=>{ie.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Dr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};const Us=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=Gs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Rr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),qs=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Xs={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 Ks=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...a},u)=>f.createElement("svg",{ref:u,...Xs,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Rr("lucide",o),...!s&&!qs(a)&&{"aria-hidden":"true"},...a},[...c.map(([d,h])=>f.createElement(d,h)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=f.forwardRef(({className:r,...o},s)=>f.createElement(Ks,{ref:s,iconNode:t,className:Rr(`lucide-${Us(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Js=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Zs=oe("arrow-down",Js);const Qs=[["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"}]],ei=oe("arrow-up-down",Qs);const ti=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ni=oe("arrow-up",ti);const ri=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],oi=oe("bookmark",ri);const si=[["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"}]],Yn=oe("calendar",si);const ii=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ai=oe("chevron-left",ii);const ci=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],li=oe("chevron-right",ci);const ui=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],di=oe("columns-2",ui);const fi=[["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"}]],hi=oe("delete",fi);const pi=[["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"}]],gi=oe("ellipsis",pi);const vi=[["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"}]],mi=oe("funnel",vi);const bi=[["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=oe("grip-vertical",bi);const xi=[["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"}]],yi=oe("pen",xi);const Si=[["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"}]],wi=oe("refresh-ccw",Si);const Ci=[["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"}]],Di=oe("settings",Ci);const Ri=[["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"}]],Ei=oe("triangle-alert",Ri);function S(e){return f.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const ji=S(l.Menu.Trigger),Ti=S(l.Menu.Positioner),Mi=S(l.Menu.Content),_i=S(l.Menu.Item),Oi=S(l.Checkbox.Label),ki=S(l.Checkbox.HiddenInput),$i=S(l.Checkbox.Control);function Ii({visibility:e,onToggle:t}){const{sortableColumns:n}=nt(ie);return i.jsxs(l.Menu.Root,{closeOnSelect:!1,children:[i.jsx(ji,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(di,{size:18})})}),i.jsx(l.Portal,{children:i.jsx(Ti,{children:i.jsx(Mi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(_i,{value:r.id,closeOnSelect:!1,children:i.jsxs(l.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(ki,{}),i.jsx($i,{}),i.jsx(Oi,{children:r.label})]})},r.id)})})})})]})}function Ai({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:c}){const{setNodeRef:a,attributes:u,listeners:d,transform:h,transition:p}=vr({id:e});return i.jsx(l.Table.ColumnHeader,{ref:a,onClick:n,backgroundColor:c,w:e==="id"?"80px":void 0,style:{transform:Ie.Transform.toString(h),transition:p,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(l.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Er,{size:12})})]})})}function Li(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=nt(ie),c=e.map(a=>o.find(u=>u.id===a.id)).filter(a=>a!==void 0).filter(a=>t[a.id]);return i.jsx(l.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(l.Table.Row,{height:"28px",children:[c.map(a=>{const u=n===a?.id;return i.jsx(Ai,{id:a?.id,onClick:()=>a?.sortable&&Hs(a?.id),cursor:a?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:a?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[a?.label,a?.sortable&&(u?r==="asc"?i.jsx(ni,{size:14}):i.jsx(Zs,{size:14}):i.jsx(ei,{size:14,opacity:.4}))]})},a?.id)}),s?.showActionColumn&&i.jsx(l.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(l.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Ii,{visibility:t,onToggle:Ws})})]})})}const Ni=[10,20,50,100],zi=S(l.Select.Positioner),Pi=S(l.Select.Content),Yi=S(l.Select.Item),Fi=S(l.Pagination.PrevTrigger),Bi=S(l.Pagination.NextTrigger),Vi=S(l.Select.HiddenSelect),Hi=S(l.Select.Control),Wi=S(l.Select.Trigger),Ui=S(l.Select.ValueText),Gi=S(l.Select.IndicatorGroup),qi=S(l.Select.Indicator);function Xi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:c=Ni}){const a=l.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return i.jsx(l.Box,{width:"100%",children:i.jsxs(l.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(l.HStack,{children:[i.jsx(l.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(l.Select.Root,{collection:a,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(Vi,{}),i.jsxs(Hi,{children:[i.jsx(Wi,{children:i.jsx(Ui,{placeholder:""})}),i.jsx(Gi,{children:i.jsx(qi,{})})]}),i.jsx(l.Portal,{children:i.jsx(zi,{children:i.jsx(Pi,{children:a.items.map(u=>i.jsxs(Yi,{item:u.value,children:[u.label,i.jsx(l.Select.ItemIndicator,{})]},u.value))})})})]})]}),i.jsx(l.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(l.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Fi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Previous page",children:i.jsx(ai,{size:18})})}),i.jsx(l.Pagination.Items,{render:u=>i.jsx(l.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(Bi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Next page",children:i.jsx(li,{size:18})})})]})})]})})}const Ki=S(l.Menu.Item),Ji=S(l.Menu.Content),Zi=S(l.Menu.Positioner),Qi=S(l.Menu.Trigger);function ea({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=nt(ie);return i.jsx(l.Table.Body,{children:e.map(o=>i.jsxs(l.Table.Row,{_hover:{bg:"blue.50"},children:[n.filter(s=>r[s.id]).map(s=>i.jsx(l.Table.Cell,{children:o[s.id]},s.id)),i.jsx(l.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(l.Menu.Root,{children:[i.jsx(Qi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(gi,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(Zi,{children:i.jsx(Ji,{children:t.filter(s=>typeof s.visible=="function"?s.visible(o):s.visible!==!1).map(s=>i.jsxs(Ki,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})}),i.jsx(l.Table.Cell,{})]},o.id))})}function ta({rows:e=6,columns:t}){return i.jsx(l.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(l.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(l.Table.Cell,{children:i.jsx(l.Skeleton,{height:"25px"})},s))},r))})}function na({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:c="No data",actions:a,page:u=1,pageSize:d=10,onPageChange:h,onPageSizeChange:p,density:y="sm",totalCount:v=0,paginationMode:b="client",actionConfig:m,pageSizeOptions:x}){f.useEffect(()=>{Sr(e)},[e]),f.useEffect(()=>{yr(t,n)},[t,n]),f.useEffect(()=>{m&&wr(m)},[m]);const{sortColumn:w,sortDirection:T,data:E,columnOrder:k}=nt(ie),$=f.useMemo(()=>{const z=[...E],I=Math.max(1,u||1);if(w&&z.sort((U,X)=>T==="asc"?String(U[w]).localeCompare(String(X[w])):String(X[w]).localeCompare(String(U[w]))),b==="client"){const U=(I-1)*d;return z.slice(U,U+d)}return z},[E,w,T,u,d,b]);f.useEffect(()=>{u<1&&h&&h(1)},[u,h]);const M=z=>{const{active:I,over:U}=z;if(!U||I.id===U.id)return;const X=k.findIndex(C=>C.id===I.id),A=k.findIndex(C=>C.id===U.id),D=jt(k,X,A);Vs(D)},O=r&&!s,L=s&&!r,V=!r&&!s&&$.length===0;return i.jsx(ur,{collisionDetection:Kn,onDragEnd:M,children:i.jsx(pr,{items:k.map(z=>z.id),strategy:ys,children:i.jsxs(l.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(l.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[O&&i.jsx(l.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(l.Spinner,{})}),i.jsxs(l.Table.Root,{variant:"outline",w:"100%",size:y,children:[i.jsx(Li,{}),L?i.jsx(ta,{rows:d,columns:n.length+(a?2:0)}):V?i.jsx(l.Table.Body,{children:i.jsx(l.Table.Row,{children:i.jsx(l.Table.Cell,{colSpan:n.length+(a?1:0),children:i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):i.jsx(ea,{data:$,actions:a})]})]}),i.jsx(l.Box,{mt:.5,children:i.jsx(Xi,{totalCount:v,pageSize:d,currentPage:u,onPageChange:h,onPageSizeChange:z=>{p?.(z),u>1&&h?.(1)},pageSizeOptions:x})})]})})})}const ra=S(l.Checkbox.Root),oa=S(l.Checkbox.HiddenInput),sa=S(l.Checkbox.Control),ia=S(l.Checkbox.Label),jr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:c,errorText:a})=>i.jsxs(ra,{value:e,onChange:t,size:n,children:[i.jsx(oa,{}),i.jsx(sa,{disabled:s,required:c,errorText:a,helperText:o}),r&&i.jsx(ia,{children:r})]}),Z=" to ",Fn=10,je={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},an=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Bn=()=>{const{year:e,month:t,day:n}=an();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},aa=()=>{const{year:e,month:t,day:n}=an();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},ca=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=je.YEAR_MIN&&r<=je.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,c=o.substring(0,s);return parseInt(c+e)}return t},He=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=an();let c,a,u;return n.length===1?(c=parseInt(n[0])||s,a=o,u=r):n.length===2?(c=parseInt(n[0])||s,a=parseInt(n[1])||o,u=r):(c=parseInt(n[0])||s,a=parseInt(n[1])||o,u=ca(n[2],r)),a=Math.max(1,Math.min(je.MONTH_MAX,a)),c=Math.max(1,Math.min(je.DAY_MAX,c)),`${u}-${String(a).padStart(2,"0")}-${String(c).padStart(2,"0")}`},pe=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},la=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>je.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>je.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<je.YEAR_MIN||n>je.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Fn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Fn),la(n,e)||t},ua=S(l.Popover.Root),da=S(l.Popover.Trigger),fa=S(l.Popover.Content),ha=S(l.Popover.Positioner);function pa({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,c]=f.useState(()=>r&&o?`${pe(r)}${Z}${pe(o)}`:r?pe(r):""),[a,u]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{const b=m=>{m.ctrlKey&&m.key==="d"&&!m.shiftKey&&!m.metaKey&&(m.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const h=b=>{let m=b;if(m.includes(Z)){const[x,w=""]=m.split(Z);m=`${We(x.trim())}${Z}${We(w.trim())}`}else if(m.toLowerCase().includes(" to ")){const[x,w=""]=m.split(/\s+to\s+/i);m=`${We(x.trim())} to ${We(w.trim())}`}else m=We(m);c(m)},p=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(Z)){const[m,x=""]=b.split(Z).map(E=>E.trim()),w=He(m),T=x?He(x):null;if(w&&T){const[E,k]=T<w?[T,w]:[w,T],$=`${pe(E)}${Z}${pe(k)}`;c($),t(`${E}|${k}`)}else if(w&&!x)c(`${pe(w)}${Z}`),t(void 0);else if(w&&x){const E=aa(),[k,$]=E<w?[E,w]:[w,E],M=`${pe(k)}${Z}${pe($)}`;c(M),t(`${k}|${$}`)}else c(""),t(void 0)}else{const m=He(b);m?(c(`${pe(m)}${Z}`),t(void 0)):(c(""),t(void 0))}},y=b=>{if(b.key!=="Enter")return;b.preventDefault();const m=d.current?.selectionStart||0,x=s.indexOf(Z);if(!s.trim()){c(`${Bn()}${Z}`);return}if(x===-1){const T=He(s.trim());T&&c(`${pe(T)}${Z}`);return}if(m<=x+Z.length){const T=s.substring(0,x).trim(),E=s.substring(x+Z.length),k=He(T);k&&c(`${pe(k)}${Z}${E}`);return}if(s.substring(x+Z.length).trim())p(),d.current?.blur();else{const T=s.substring(0,x+Z.length)+Bn();c(T),setTimeout(()=>{p(),d.current?.blur()},0)}},v=()=>{c(""),t(void 0)};return i.jsx(l.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(l.InputElement,{position:"revert",children:[i.jsxs(ua,{open:a,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(da,{asChild:!0,children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(ha,{children:i.jsxs(fa,{p:4,children:[i.jsx(l.PopoverArrow,{}),i.jsxs(l.VStack,{align:"start",gap:4,children:[i.jsxs(l.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(l.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(l.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(l.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(l.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(l.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(l.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(l.HStack,{children:[i.jsx(l.Kbd,{children:"Ctrl"}),i.jsx(l.Text,{children:"+"}),i.jsx(l.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(l.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>h(b.target.value),onBlur:p,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(l.InputElement,{children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const ga=S(l.Field.Root),va=S(l.Field.Label),ma=S(l.Field.HelperText),ba=S(l.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:c="100%",label:a,helperText:u,isDisabled:d=!1,required:h=!1,errorText:p,visible:y})=>i.jsxs(ga,{width:c,children:[y&&i.jsx(va,{children:a}),i.jsx(l.InputGroup,{startElement:e,children:i.jsx(l.Input,{value:t,onChange:v=>n?.(v.target.value),placeholder:r,size:o,variant:s,disabled:d,required:h})}),p&&i.jsx(ba,{fontSize:"xs",children:p}),u&&i.jsx(ma,{fontSize:"xs",children:u})]}),xa=S(l.Field.Root),ya=S(l.Field.HelperText),Sa=S(l.Field.ErrorText),wa=S(l.Select.Root),Ca=S(l.Select.Label),Da=S(l.Select.Control),Ra=S(l.Select.Trigger),Ea=S(l.Select.ValueText),ja=S(l.Select.IndicatorGroup),Ta=S(l.Select.Indicator),Ma=S(l.Select.Content),_a=S(l.Select.Item),Oa=S(l.Select.ItemIndicator),ka=S(l.Select.HiddenSelect),$a=S(l.Select.Positioner),Tr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:c="100%",variant:a="outline",helperText:u,isDisabled:d,required:h,errorText:p,visible:y})=>{const v=l.createListCollection({items:e});return i.jsxs(xa,{disabled:d,required:h,children:[i.jsxs(wa,{collection:v,variant:a,size:s,width:c,value:n?[n]:[],onValueChange:b=>r?.(b.value[0]),children:[i.jsx(ka,{}),y&&i.jsx(Ca,{children:t}),i.jsxs(Da,{children:[i.jsx(Ra,{children:i.jsx(Ea,{placeholder:o})}),i.jsx(ja,{children:i.jsx(Ta,{})})]}),i.jsx($a,{children:i.jsx(Ma,{children:v.items.map(b=>i.jsxs(_a,{item:b,children:[b.label,i.jsx(Oa,{})]},b.value))})})]}),u&&i.jsx(ya,{children:u}),p&&i.jsx(Sa,{children:p})]})},Mr=(e="default")=>`FILTER_PRESETS_${e}`,Ia=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},Aa=e=>typeof window>"u"?[]:Ia(localStorage.getItem(Mr(e))),Ze=new xr({}),rt=e=>{const t=Ze.state;if(e in t)return t[e];const n=Aa(e);return Ze.setState(r=>({...r,[e]:n})),n},Tt=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(Mr(e),JSON.stringify(t))},_r=(e,t)=>{const n=[t,...rt(e)];Tt(e,n)},Or=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);Tt(e,n)},La=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);Tt(e,r)},Na=S(l.Checkbox.Root),za=S(l.Checkbox.HiddenInput),Pa=S(l.Checkbox.Control),Ya=S(l.Slider.Root),Fa=S(l.Slider.Track),Ba=S(l.Slider.Range),Va=S(l.Slider.Thumbs),Ha=S(l.Slider.Control),Wa=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:c,transition:a}=vr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:a};return i.jsxs(l.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(l.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Er,{size:16}),i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(l.HStack,{justify:"space-between",children:[i.jsx(l.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(Na,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(za,{}),i.jsx(Pa,{})]})]}),i.jsxs(l.VStack,{align:"stretch",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",children:"Size"}),i.jsx(Ya,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(Ha,{children:[i.jsx(Fa,{children:i.jsx(Ba,{})}),i.jsx(Va,{})]})})]})]})},Ua=S(l.Drawer.Root),Ga=S(l.Drawer.Trigger),qa=S(l.Drawer.Backdrop),Xa=S(l.Drawer.Positioner),Ka=S(l.Drawer.Content),Ja=S(l.Drawer.Header),Za=S(l.Drawer.Title),Qa=S(l.Drawer.Body),ec=S(l.Drawer.Footer),tc=S(l.Drawer.CloseTrigger),nc=S(l.Tabs.Root),rc=S(l.Tabs.List),Bt=S(l.Tabs.Trigger),Vt=S(l.Tabs.Content),kr=(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(jr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(pa,{value:e.value,onChange:e.onChange});default:return null}},oc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",onLoadPreset:c,activePresetName:a,onReorder:u,open:d,onOpenChange:h})=>{const y=nt(Ze)[s]??rt(s),v=()=>{const b=prompt("Preset name?");if(!b)return;const m=o.reduce((x,w)=>(x[w.id]=w.value,x),{});_r(s,{id:crypto.randomUUID(),name:b,date:new Date().toISOString(),values:m})};return i.jsx(l.HStack,{wrap:"wrap",children:i.jsxs(Ua,{size:e,open:d,onOpenChange:h,children:[i.jsx(Ga,{asChild:!0,children:i.jsxs(l.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(mi,{size:16}),"Filters"]})}),i.jsxs(l.Portal,{children:[i.jsx(qa,{}),i.jsx(Xa,{children:i.jsxs(Ka,{children:[i.jsx(Ja,{children:i.jsx(Za,{children:"Filters"})}),i.jsx(Qa,{overflowY:"auto",pt:1,children:i.jsxs(nc,{defaultValue:"view",children:[i.jsxs(rc,{mb:4,children:[i.jsxs(Bt,{value:"view",children:[i.jsx(yi,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx(Di,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(oi,{size:16}),"Presets"]})]}),i.jsx(Vt,{value:"view",children:o.filter(b=>b.visible).map(b=>i.jsx(l.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:b.size??1,minW:`${(b.size??1)*100}px`,rounded:"md",p:3,mb:3,children:kr(b,d)},b.id))}),i.jsx(Vt,{value:"settings",children:i.jsx(ur,{sensors:io(so(sn)),collisionDetection:Kn,onDragEnd:({active:b,over:m})=>{if(!m||b.id===m.id)return;const x=o.findIndex(E=>E.id===b.id),w=o.findIndex(E=>E.id===m.id),T=jt(o,x,w);u?.(T)},children:i.jsx(pr,{items:o.map(b=>b.id),strategy:ws,children:o.map(b=>i.jsx(Wa,{filter:b,onVisibilityChange:t,onSizeChange:n},b.id))})})}),i.jsx(Vt,{value:"presets",children:i.jsxs(l.VStack,{align:"stretch",mb:3,children:[y.length===0&&i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),y.map(b=>i.jsxs(l.HStack,{justify:"space-between",border:"1px solid",borderColor:a===b.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(l.VStack,{align:"start",gap:0,children:[i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:b.name}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:new Date(b.date).toLocaleDateString()})]}),i.jsxs(l.HStack,{children:[i.jsx(l.Button,{size:"xs",variant:"ghost",onClick:()=>{const m=o.map(x=>({...x,value:b.values[x.id]??x.value}));c?.(m,b.name)},children:"Load"}),i.jsx(l.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Or(s,b.id),children:i.jsx(hi,{size:14})})]})]},b.id)),i.jsx(l.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(ec,{justify:"space-between",children:i.jsx(tc,{asChild:!0,children:i.jsx(l.CloseButton,{})})})]})})]})]})})},sc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:a,onLoadPreset:u,activePresetName:d,filterDrawerSize:h="sm"})=>{const[p,y]=f.useState(!1);return i.jsxs(l.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(l.HStack,{gapX:1,children:[t.filter(v=>v.visible!==!1).map(v=>i.jsx(l.HStack,{flex:v.size??1,minW:`${(v.size??1)*100}px`,alignItems:"center",children:kr(v)},v.id)),i.jsx(oc,{filterDrawerSize:h,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:a,filters:t,onLoadPreset:u,activePresetName:d,open:p,onOpenChange:v=>{y(v.open)}})]})]})},ic=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},ac=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},cc=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:c,colorScheme:a,loading:u,loadingText:d,rounded:h,type:p="button"})=>i.jsx(l.Button,{onClick:e,size:t,variant:n,disabled:c,colorPalette:a,loading:u,loadingText:d,rounded:h,type:p,children:i.jsxs(l.HStack,{gap:1,children:[o,r,s]})}),lc=S(l.Combobox.Root),uc=S(l.Combobox.Label),dc=S(l.Combobox.Control),fc=S(l.Combobox.Input),hc=S(l.Combobox.IndicatorGroup),pc=S(l.Combobox.ClearTrigger),gc=S(l.Combobox.Trigger),vc=S(l.Combobox.Positioner),mc=S(l.Combobox.Content);function bc({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:c,renderItem:a,loading:u,error:d,placeholder:h,onInputChange:p,onSelect:y,rootProps:v,inputProps:b,controlProps:m,contentProps:x,itemProps:w}){const[T,E]=f.useState(""),{collection:k,set:$}=l.useListCollection({initialItems:o,itemToString:s,itemToValue:c}),M=f.useMemo(()=>{if(!T)return o;const O=T.toLowerCase();return o.filter(L=>s(L).toLowerCase().includes(O))},[o,T,s]);return f.useEffect(()=>{$(M)},[M,$]),i.jsxs(lc,{width:n,size:t,variant:r,collection:k,placeholder:h,onInputValueChange:O=>{p?.(O.inputValue),E(O.inputValue)},onValueChange:O=>{const L=O.value?.[0];if(!L)return;const V=k.items.find(z=>c(z)===L);V&&y?.(V)},positioning:{sameWidth:!1,placement:"bottom-start"},...v,children:[e&&i.jsx(uc,{children:e}),i.jsxs(dc,{...m,children:[i.jsx(fc,{placeholder:h??"Type to search",...b}),i.jsxs(hc,{children:[i.jsx(pc,{}),i.jsx(gc,{})]})]}),i.jsx(vc,{children:i.jsx(mc,{minW:"sm",...x,children:u?i.jsxs(l.HStack,{p:"2",children:[i.jsx(l.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(l.Span,{children:"Loading..."})]}):d?i.jsx(l.Span,{p:"2",color:"fg.error",children:"Error fetching"}):k.items.map(O=>i.jsxs(l.Combobox.Item,{item:O,...w,children:[a(O),i.jsx(l.Combobox.ItemIndicator,{})]},c(O)))})})]})}const xc=S(l.Dialog.Root),yc=S(l.Dialog.Backdrop),Sc=S(l.Dialog.Positioner),wc=S(l.Dialog.Content),Cc=S(l.Dialog.Header),Dc=S(l.Dialog.Body),Rc=S(l.Dialog.Footer),Ec=S(l.Dialog.Title),jc=S(l.Dialog.CloseTrigger);function Tc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:c="Delete",isLoading:a=!1}){const[u,d]=f.useState("");return i.jsx(xc,{open:e,placement:"center",onOpenChange:h=>!h.open&&t(),children:i.jsxs(l.Portal,{children:[i.jsx(yc,{}),i.jsx(Sc,{children:i.jsxs(wc,{maxW:"550px",children:[i.jsx(Cc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Ec,{color:"red.600",children:r})}),i.jsx(Dc,{p:2,style:{padding:"16px"},children:i.jsxs(l.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(l.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(l.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(l.Box,{color:"red.600",mt:"2px",children:i.jsx(Ei,{size:20})}),i.jsxs(l.Box,{children:[i.jsx(l.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(l.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(l.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(l.Box,{children:[i.jsxs(l.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(l.Input,{placeholder:`Type ${s} here`,value:u,onChange:h=>d(h.target.value),size:"xs"})]})]})}),i.jsxs(Rc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(l.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(l.Button,{size:"sm",style:{backgroundColor:"#FF0000"},loading:a,onClick:n,children:c})]}),i.jsx(jc,{asChild:!0,children:i.jsx(l.CloseButton,{size:"sm"})})]})})]})})}function $r({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(l.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(wi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var pt={exports:{}},Mc=pt.exports,Vn;function _c(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(Mc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",c="second",a="minute",u="hour",d="day",h="week",p="month",y="quarter",v="year",b="date",m="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,T={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(A){var D=["th","st","nd","rd"],C=A%100;return"["+A+(D[(C-20)%10]||D[C]||D[0])+"]"}},E=function(A,D,C){var _=String(A);return!_||_.length>=D?A:""+Array(D+1-_.length).join(C)+A},k={s:E,z:function(A){var D=-A.utcOffset(),C=Math.abs(D),_=Math.floor(C/60),j=C%60;return(D<=0?"+":"-")+E(_,2,"0")+":"+E(j,2,"0")},m:function A(D,C){if(D.date()<C.date())return-A(C,D);var _=12*(C.year()-D.year())+(C.month()-D.month()),j=D.clone().add(_,p),N=C-j<0,Y=D.clone().add(_+(N?-1:1),p);return+(-(_+(C-j)/(N?j-Y:Y-j))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:p,y:v,w:h,d,D:b,h:u,m:a,s:c,ms:s,Q:y}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},$="en",M={};M[$]=T;var O="$isDayjsObject",L=function(A){return A instanceof U||!(!A||!A[O])},V=function A(D,C,_){var j;if(!D)return $;if(typeof D=="string"){var N=D.toLowerCase();M[N]&&(j=N),C&&(M[N]=C,j=N);var Y=D.split("-");if(!j&&Y.length>1)return A(Y[0])}else{var g=D.name;M[g]=D,j=g}return!_&&j&&($=j),j||!_&&$},z=function(A,D){if(L(A))return A.clone();var C=typeof D=="object"?D:{};return C.date=A,C.args=arguments,new U(C)},I=k;I.l=V,I.i=L,I.w=function(A,D){return z(A,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var U=(function(){function A(C){this.$L=V(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[O]=!0}var D=A.prototype;return D.parse=function(C){this.$d=(function(_){var j=_.date,N=_.utc;if(j===null)return new Date(NaN);if(I.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(x);if(Y){var g=Y[2]-1||0,R=(Y[7]||"0").substring(0,3);return N?new Date(Date.UTC(Y[1],g,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,R)):new Date(Y[1],g,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,R)}}return new Date(j)})(C),this.init()},D.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()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(C,_){var j=z(C);return this.startOf(_)<=j&&j<=this.endOf(_)},D.isAfter=function(C,_){return z(C)<this.startOf(_)},D.isBefore=function(C,_){return this.endOf(_)<z(C)},D.$g=function(C,_,j){return I.u(C)?this[_]:this.set(j,C)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(C,_){var j=this,N=!!I.u(_)||_,Y=I.p(C),g=function(J,F){var se=I.w(j.$u?Date.UTC(j.$y,F,J):new Date(j.$y,F,J),j);return N?se:se.endOf(d)},R=function(J,F){return I.w(j.toDate()[J].apply(j.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(F)),j)},P=this.$W,B=this.$M,G=this.$D,q="set"+(this.$u?"UTC":"");switch(Y){case v:return N?g(1,0):g(31,11);case p:return N?g(1,B):g(0,B+1);case h:var H=this.$locale().weekStart||0,K=(P<H?P+7:P)-H;return g(N?G-K:G+(6-K),B);case d:case b:return R(q+"Hours",0);case u:return R(q+"Minutes",1);case a:return R(q+"Seconds",2);case c:return R(q+"Milliseconds",3);default:return this.clone()}},D.endOf=function(C){return this.startOf(C,!1)},D.$set=function(C,_){var j,N=I.p(C),Y="set"+(this.$u?"UTC":""),g=(j={},j[d]=Y+"Date",j[b]=Y+"Date",j[p]=Y+"Month",j[v]=Y+"FullYear",j[u]=Y+"Hours",j[a]=Y+"Minutes",j[c]=Y+"Seconds",j[s]=Y+"Milliseconds",j)[N],R=N===d?this.$D+(_-this.$W):_;if(N===p||N===v){var P=this.clone().set(b,1);P.$d[g](R),P.init(),this.$d=P.set(b,Math.min(this.$D,P.daysInMonth())).$d}else g&&this.$d[g](R);return this.init(),this},D.set=function(C,_){return this.clone().$set(C,_)},D.get=function(C){return this[I.p(C)]()},D.add=function(C,_){var j,N=this;C=Number(C);var Y=I.p(_),g=function(B){var G=z(N);return I.w(G.date(G.date()+Math.round(B*C)),N)};if(Y===p)return this.set(p,this.$M+C);if(Y===v)return this.set(v,this.$y+C);if(Y===d)return g(1);if(Y===h)return g(7);var R=(j={},j[a]=r,j[u]=o,j[c]=n,j)[Y]||1,P=this.$d.getTime()+C*R;return I.w(P,this)},D.subtract=function(C,_){return this.add(-1*C,_)},D.format=function(C){var _=this,j=this.$locale();if(!this.isValid())return j.invalidDate||m;var N=C||"YYYY-MM-DDTHH:mm:ssZ",Y=I.z(this),g=this.$H,R=this.$m,P=this.$M,B=j.weekdays,G=j.months,q=j.meridiem,H=function(F,se,ne,he){return F&&(F[se]||F(_,N))||ne[se].slice(0,he)},K=function(F){return I.s(g%12||12,F,"0")},J=q||function(F,se,ne){var he=F<12?"AM":"PM";return ne?he.toLowerCase():he};return N.replace(w,(function(F,se){return se||(function(ne){switch(ne){case"YY":return String(_.$y).slice(-2);case"YYYY":return I.s(_.$y,4,"0");case"M":return P+1;case"MM":return I.s(P+1,2,"0");case"MMM":return H(j.monthsShort,P,G,3);case"MMMM":return H(G,P);case"D":return _.$D;case"DD":return I.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return H(j.weekdaysMin,_.$W,B,2);case"ddd":return H(j.weekdaysShort,_.$W,B,3);case"dddd":return B[_.$W];case"H":return String(g);case"HH":return I.s(g,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(g,R,!0);case"A":return J(g,R,!1);case"m":return String(R);case"mm":return I.s(R,2,"0");case"s":return String(_.$s);case"ss":return I.s(_.$s,2,"0");case"SSS":return I.s(_.$ms,3,"0");case"Z":return Y}return null})(F)||Y.replace(":","")}))},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(C,_,j){var N,Y=this,g=I.p(_),R=z(C),P=(R.utcOffset()-this.utcOffset())*r,B=this-R,G=function(){return I.m(Y,R)};switch(g){case v:N=G()/12;break;case p:N=G();break;case y:N=G()/3;break;case h:N=(B-P)/6048e5;break;case d:N=(B-P)/864e5;break;case u:N=B/o;break;case a:N=B/r;break;case c:N=B/n;break;default:N=B}return j?N:I.a(N)},D.daysInMonth=function(){return this.endOf(p).$D},D.$locale=function(){return M[this.$L]},D.locale=function(C,_){if(!C)return this.$L;var j=this.clone(),N=V(C,_,!0);return N&&(j.$L=N),j},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},A})(),X=U.prototype;return z.prototype=X,[["$ms",s],["$s",c],["$m",a],["$H",u],["$W",d],["$M",p],["$y",v],["$D",b]].forEach((function(A){X[A[1]]=function(D){return this.$g(D,A[0],A[1])}})),z.extend=function(A,D){return A.$i||(A(D,U,z),A.$i=!0),z},z.locale=V,z.isDayjs=L,z.unix=function(A){return z(1e3*A)},z.en=M[$],z.Ls=M,z.p={},z}))})(pt)),pt.exports}var Oc=_c();const Mt=Ct(Oc);var gt={exports:{}},kc=gt.exports,Hn;function $c(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(kc,(function(){return function(n,r,o){n=n||{};var s=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 a(d,h,p,y){return s.fromToBase(d,h,p,y)}o.en.relativeTime=c,s.fromToBase=function(d,h,p,y,v){for(var b,m,x,w=p.$locale().relativeTime||c,T=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"}],E=T.length,k=0;k<E;k+=1){var $=T[k];$.d&&(b=y?o(d).diff(p,$.d,!0):p.diff(d,$.d,!0));var M=(n.rounding||Math.round)(Math.abs(b));if(x=b>0,M<=$.r||!$.r){M<=1&&k>0&&($=T[k-1]);var O=w[$.l];v&&(M=v(""+M)),m=typeof O=="string"?O.replace("%d",M):O(M,h,$.l,x);break}}if(h)return m;var L=x?w.future:w.past;return typeof L=="function"?L(m):L.replace("%s",m)},s.to=function(d,h){return a(d,h,this,!0)},s.from=function(d,h){return a(d,h,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)}}}))})(gt)),gt.exports}var Ic=$c();const Ac=Ct(Ic);var vt={exports:{}},Lc=vt.exports,Wn;function Nc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Lc,(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 c=o.prototype,a=c.format;s.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,h=(function(p,y){return p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,b,m){var x=m&&m.toUpperCase();return b||y[m]||n[m]||y[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,T,E){return T||E.slice(1)}))}))})(u,d===void 0?{}:d);return a.call(this,h)}}}))})(vt)),vt.exports}var zc=Nc();const Pc=Ct(zc);var mt={exports:{}},Yc=mt.exports,Un;function Fc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Yc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(c){var a=this,u=this.$locale();if(!this.isValid())return s.bind(this)(c);var d=this.$utils(),h=(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(p){switch(p){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return u.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return u.ordinal(a.week(),"W");case"w":case"ww":return d.s(a.week(),p==="w"?1:2,"0");case"W":case"WW":return d.s(a.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return d.s(String(a.$H===0?24:a.$H),p==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return p}}));return s.bind(this)(h)}}}))})(mt)),mt.exports}var Bc=Fc();const Vc=Ct(Bc);Mt.extend(Ac);Mt.extend(Pc);Mt.extend(Vc);const Hc={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=Mt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Hc[t]):r}function Wc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start"}){return i.jsxs(l.Stack,{gap:.5,align:s,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"500",children:Jt({value:e,variant:t,format:r})}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:Jt({value:e,variant:n,format:o})})]})}exports.DataTable=na;exports.Filters=sc;exports.MDSButton=cc;exports.MDSCheckbox=jr;exports.MDSCombobox=bc;exports.MDSConfirmDeleteDialog=Tc;exports.MDSInput=Kt;exports.MDSRefreshButton=$r;exports.MDSSelectBox=Tr;exports.RefreshButton=$r;exports.StackedDateTime=Wc;exports.addPreset=_r;exports.deletePreset=Or;exports.formatDateTime=Jt;exports.getPresets=rt;exports.loadOrder=ac;exports.presetStore=Ze;exports.saveOrder=ic;exports.savePresets=Tt;exports.setActionsConfig=wr;exports.setData=yr;exports.setTableId=Sr;exports.tableStore=ie;exports.updatePreset=La;exports.withChildren=S;
10
+ `},ro={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 oo(e){let{announcements:t=ro,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=no}=e;const{announce:s,announcement:c}=Qr(),a=tt("DndLiveRegion"),[u,d]=p.useState(!1);if(p.useEffect(()=>{d(!0)},[]),eo(p.useMemo(()=>({onDragStart(h){let{active:y}=h;s(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:v}=h;t.onDragMove&&s(t.onDragMove({active:y,over:v}))},onDragOver(h){let{active:y,over:v}=h;s(t.onDragOver({active:y,over:v}))},onDragEnd(h){let{active:y,over:v}=h;s(t.onDragEnd({active:y,over:v}))},onDragCancel(h){let{active:y,over:v}=h;s(t.onDragCancel({active:y,over:v}))}}),[s,t])),!u)return null;const f=p.createElement(p.Fragment,null,p.createElement(Jr,{id:r,value:o.draggable}),p.createElement(Zr,{id:a,announcement:c}));return n?Ue.createPortal(f,n):f}var Q;(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"})(Q||(Q={}));function yt(){}function so(e,t){return p.useMemo(()=>({sensor:e,options:{}}),[e,t])}function io(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ge=Object.freeze({x:0,y:0});function ao(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function co(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function lo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uo(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),s=[];for(const c of r){const{id:a}=c,u=n.get(a);if(u){const d=ao(yn(u),o);s.push({id:a,data:{droppableContainer:c,value:d}})}}return s.sort(co)};function fo(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),c=o-r,a=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,f=c*a,h=f/(u+d-f);return Number(h.toFixed(4))}return 0}const ho=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:c}=s,a=n.get(c);if(a){const u=fo(a,t);u>0&&o.push({id:c,data:{droppableContainer:s,value:u}})}}return o.sort(lo)};function po(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 go(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((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.x}),{...n})}}const vo=go(1);function mo(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 bo(e,t,n){const r=mo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:c,y:a}=r,u=e.left-c-(1-o)*parseFloat(n),d=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u}}const xo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=xo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=ae(e).getComputedStyle(e);d&&(n=bo(n,d,f))}const{top:r,left:o,width:s,height:c,bottom:a,right:u}=n;return{top:r,left:o,width:s,height:c,bottom:a,right:u}}function Sn(e){return Ne(e,{ignoreTransform:!0})}function yo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function So(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function wo(e,t){t===void 0&&(t=ae(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 nn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Qt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Qe(o)||Gn(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&wo(o,s)&&n.push(o),So(o,s)?n:r(o.parentNode)}return e?r(e):n}function Zn(e){const[t]=nn(e,1);return t??null}function It(e){return!Dt||!e?null:Ae(e)?e:Zt(e)?Qt(e)||e===Le(e).scrollingElement?window:Qe(e)?e:null:null}function Qn(e){return Ae(e)?e.scrollX:e.scrollLeft}function er(e){return Ae(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:Qn(e),y:er(e)}}var ee;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ee||(ee={}));function tr(e){return!Dt||!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,s=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:c,isRight:a,maxScroll:r,minScroll:t}}const Co={x:.2,y:.2};function Do(e,t,n,r,o){let{top:s,left:c,right:a,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Co);const{isTop:d,isBottom:f,isLeft:h,isRight:y}=nr(e),v={x:0,y:0},b={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+m.height?(v.y=ee.Backward,b.y=r*Math.abs((t.top+m.height-s)/m.height)):!f&&u>=t.bottom-m.height&&(v.y=ee.Forward,b.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!y&&a>=t.right-m.width?(v.x=ee.Forward,b.x=r*Math.abs((t.right-m.width-a)/m.width)):!h&&c<=t.left+m.width&&(v.x=ee.Backward,b.x=r*Math.abs((t.left+m.width-c)/m.width)),{direction:v,speed:b}}function Ro(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,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)=>$e(t,Ut(n)),ge)}function jo(e){return e.reduce((t,n)=>t+Qn(n),0)}function Eo(e){return e.reduce((t,n)=>t+er(n),0)}function To(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Zn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mo=[["x",["left","right"],jo],["y",["top","bottom"],Eo]];class rn{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=nn(n),o=rr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,a]of Mo)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=a(r),f=o[s]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ge{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 _o(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function At(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 Oo(e){e.stopPropagation()}var U;(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"})(U||(U={}));const or={start:[U.Space,U.Enter],cancel:[U.Esc],end:[U.Space,U.Enter,U.Tab]},ko=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case U.Right:return{...n,x:n.x+25};case U.Left:return{...n,x:n.x-25};case U.Down:return{...n,y:n.y+25};case U.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 Ge(Le(n)),this.windowListeners=new Ge(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&&To(r),n(ge)}handleKeyDown(t){if(tn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=or,coordinateGetter:c=ko,scrollBehavior:a="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,f=d?{x:d.left,y:d.top}:ge;this.referenceCoordinates||(this.referenceCoordinates=f);const h=c(t,{active:n,context:r.current,currentCoordinates:f});if(h){const y=xt(h,f),v={x:0,y:0},{scrollableAncestors:b}=r.current;for(const m of b){const x=t.code,{isTop:w,isRight:M,isLeft:j,isBottom:O,maxScroll:$,minScroll:T}=nr(m),I=Ro(m),L={x:Math.min(x===U.Right?I.right-I.width/2:I.right,Math.max(x===U.Right?I.left:I.left+I.width/2,h.x)),y:Math.min(x===U.Down?I.bottom-I.height/2:I.bottom,Math.max(x===U.Down?I.top:I.top+I.height/2,h.y))},V=x===U.Right&&!M||x===U.Left&&!j,N=x===U.Down&&!O||x===U.Up&&!w;if(V&&L.x!==h.x){const k=m.scrollLeft+y.x,H=x===U.Right&&k<=$.x||x===U.Left&&k>=T.x;if(H&&!y.y){m.scrollTo({left:k,behavior:a});return}H?v.x=m.scrollLeft-k:v.x=x===U.Right?m.scrollLeft-$.x:m.scrollLeft-T.x,v.x&&m.scrollBy({left:-v.x,behavior:a});break}else if(N&&L.y!==h.y){const k=m.scrollTop+y.y,H=x===U.Down&&k<=$.y||x===U.Up&&k>=T.y;if(H&&!y.x){m.scrollTo({top:k,behavior:a});return}H?v.y=m.scrollTop-k:v.y=x===U.Down?m.scrollTop-$.y:m.scrollTop-T.y,v.y&&m.scrollBy({top:-v.y,behavior:a});break}}this.handleMove(t,$e(xt(h,this.referenceCoordinates),v))}}}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:s}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const a=s.activatorNode.current;return a&&e.target!==a?!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 on{constructor(t,n,r){var o;r===void 0&&(r=_o(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:c}=s;this.props=t,this.events=n,this.document=Le(c),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(c)),this.initialCoordinates=(o=Wt(s))!=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,Oo,{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:c,options:{activationConstraint:a}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:ge,d=xt(o,u);if(!r&&a){if(Cn(a)){if(a.tolerance!=null&&At(d,a.tolerance))return this.handleCancel();if(At(d,a.distance))return this.handleStart()}if(Dn(a)&&At(d,a.tolerance))return this.handleCancel();this.handlePending(a,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===U.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $o={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sn extends on{constructor(t){const{event:n}=t,r=Le(n.target);super(t,$o,r)}}sn.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 Io={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Ao extends on{constructor(t){super(t,Io,Le(t.event.target))}}Ao.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Gt.RightClick?!1:(r?.({event:n}),!0)}}];const Lt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Lo extends on{constructor(t){super(t,Lt)}static setup(){return window.addEventListener(Lt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Lt.move.name,t)};function t(){}}}Lo.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 qe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(qe||(qe={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function No(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:c=5,order:a=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:y}=e;const v=Po({delta:h,disabled:!s}),[b,m]=Ur(),x=p.useRef({x:0,y:0}),w=p.useRef({x:0,y:0}),M=p.useMemo(()=>{switch(n){case qe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case qe.DraggableRect:return o}},[n,o,u]),j=p.useRef(null),O=p.useCallback(()=>{const T=j.current;if(!T)return;const I=x.current.x*w.current.x,L=x.current.y*w.current.y;T.scrollBy(I,L)},[]),$=p.useMemo(()=>a===St.TreeOrder?[...d].reverse():d,[a,d]);p.useEffect(()=>{if(!s||!d.length||!M){m();return}for(const T of $){if(r?.(T)===!1)continue;const I=d.indexOf(T),L=f[I];if(!L)continue;const{direction:V,speed:N}=Do(T,L,M,t,y);for(const k of["x","y"])v[k][V[k]]||(N[k]=0,V[k]=0);if(N.x>0||N.y>0){m(),j.current=T,b(O,c),x.current=N,w.current=V;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,O,r,m,s,c,JSON.stringify(M),JSON.stringify(v),b,d,$,f,JSON.stringify(y)])}const zo={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function Po(e){let{delta:t,disabled:n}=e;const r=Ht(t);return et(o=>{if(n||!r||!o)return zo;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ee.Backward]:o.x[ee.Backward]||s.x===-1,[ee.Forward]:o.x[ee.Forward]||s.x===1},y:{[ee.Backward]:o.y[ee.Backward]||s.y===-1,[ee.Forward]:o.y[ee.Forward]||s.y===1}}},[n,t,r])}function Yo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return et(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Fo(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...s]},[]),[e,t])}var Je;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Je||(Je={}));var qt;(function(e){e.Optimized="optimized"})(qt||(qt={}));const Rn=new Map;function Bo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,c]=p.useState(null),{frequency:a,measure:u,strategy:d}=o,f=p.useRef(e),h=x(),y=Ke(h),v=p.useCallback(function(w){w===void 0&&(w=[]),!y.current&&c(M=>M===null?w:M.concat(w.filter(j=>!M.includes(j))))},[y]),b=p.useRef(null),m=et(w=>{if(h&&!n)return Rn;if(!w||w===Rn||f.current!==e||s!=null){const M=new Map;for(let j of e){if(!j)continue;if(s&&s.length>0&&!s.includes(j.id)&&j.rect.current){M.set(j.id,j.rect.current);continue}const O=j.node.current,$=O?new rn(u(O),O):null;j.rect.current=$,$&&M.set(j.id,$)}return M}return w},[e,s,n,h,u]);return p.useEffect(()=>{f.current=e},[e]),p.useEffect(()=>{h||v()},[n,h]),p.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),p.useEffect(()=>{h||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{v(),b.current=null},a))},[a,h,v,...r]),{droppableRects:m,measureDroppableContainers:v,measuringScheduled:s!=null};function x(){switch(d){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function ir(e,t){return et(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vo(e,t){return ir(e,t)}function Ho(e){let{callback:t,disabled:n}=e;const r=en(t),o=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return p.useEffect(()=>()=>o?.disconnect(),[o]),o}function Rt(e){let{callback:t,disabled:n}=e;const r=en(t),o=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return p.useEffect(()=>()=>o?.disconnect(),[o]),o}function Wo(e){return new rn(Ne(e),e)}function jn(e,t,n){t===void 0&&(t=Wo);const[r,o]=p.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const f=t(e);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const c=Ho({callback(u){if(e)for(const d of u){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),a=Rt({callback:s});return be(()=>{s(),e?(a?.observe(e),c?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),c?.disconnect())},[e]),r}function Uo(e){const t=ir(e);return Jn(e,t)}const En=[];function Go(e){const t=p.useRef(e),n=et(r=>e?r&&r!==En&&e&&t.current&&e.parentNode===t.current.parentNode?r:nn(e):En,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function qo(e){const[t,n]=p.useState(null),r=p.useRef(e),o=p.useCallback(s=>{const c=It(s.target);c&&n(a=>a?(a.set(c,Ut(c)),new Map(a)):null)},[]);return p.useEffect(()=>{const s=r.current;if(e!==s){c(s);const a=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),r.current=e}return()=>{c(e),c(s)};function c(a){a.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>$e(s,c),ge):rr(e):ge,[e,t])}function Tn(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==ge;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):ge}function Xo(e){p.useEffect(()=>{if(!Dt)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 Ko(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=c=>{s(c,t)},n},{}),[e,t])}function ar(e){return p.useMemo(()=>e?yo(e):null,[e])}const Mn=[];function Jo(e,t){t===void 0&&(t=Ne);const[n]=e,r=ar(n?ae(n):null),[o,s]=p.useState(Mn);function c(){s(()=>e.length?e.map(u=>tr(u)?r:new rn(t(u),u)):Mn)}const a=Rt({callback:c});return be(()=>{a?.disconnect(),c(),e.forEach(u=>a?.observe(u))},[e]),o}function Zo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function Qo(e){let{measure:t}=e;const[n,r]=p.useState(null),o=p.useCallback(d=>{for(const{target:f}of d)if(Qe(f)){r(h=>{const y=t(f);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),s=Rt({callback:o}),c=p.useCallback(d=>{const f=Zo(d);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[a,u]=bt(c);return p.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const es=[{sensor:sn,options:{}},{sensor:sr,options:{}}],ts={current:{}},ht={draggable:{measure:Sn},droppable:{measure:Sn,strategy:Je.WhileDragging,frequency:qt.Optimized},dragOverlay:{measure:Ne}};class Xe 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 ns={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Xe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:yt,windowRect:null,measuringScheduled:!1},rs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},jt=p.createContext(rs),cr=p.createContext(ns);function os(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function ss(e,t){switch(t.type){case Q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Q.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 Q.DragEnd:case Q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Q.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Xe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Q.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const c=new Xe(e.droppable.containers);return c.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case Q.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Xe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function is(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=p.useContext(jt),s=Ht(r),c=Ht(n?.id);return p.useEffect(()=>{if(!t&&!r&&s&&c!=null){if(!tn(s)||document.activeElement===s.target)return;const a=o.get(c);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const h=Xr(f);if(h){h.focus();break}}})}},[r,t,o,c,s]),null}function as(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function cs(e){return p.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ls(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=p.useRef(!1),{x:c,y:a}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!c&&!a||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),h=Jn(f,r);if(c||(h.x=0),a||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=Zn(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,c,a,r,n])}const lr=p.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=p.memo(function(t){var n,r,o,s;let{id:c,accessibility:a,autoScroll:u=!0,children:d,sensors:f=es,collisionDetection:h=ho,measuring:y,modifiers:v,...b}=t;const m=p.useReducer(ss,void 0,os),[x,w]=m,[M,j]=to(),[O,$]=p.useState(je.Uninitialized),T=O===je.Initialized,{draggable:{active:I,nodes:L,translate:V},droppable:{containers:N}}=x,k=I!=null?L.get(I):null,H=p.useRef({initial:null,translated:null}),X=p.useMemo(()=>{var re;return I!=null?{id:I,data:(re=k?.data)!=null?re:ts,rect:H}:null},[I,k]),A=p.useRef(null),[D,C]=p.useState(null),[_,E]=p.useState(null),z=Ke(b,Object.values(b)),Y=tt("DndDescribedBy",c),g=p.useMemo(()=>N.getEnabled(),[N]),R=cs(y),{droppableRects:P,measureDroppableContainers:B,measuringScheduled:G}=Bo(g,{dragging:T,dependencies:[V.x,V.y],config:R.droppable}),q=Yo(L,I),W=p.useMemo(()=>_?Wt(_):null,[_]),K=Fr(),J=Vo(q,R.draggable.measure);ls({activeNode:I!=null?L.get(I):null,config:K.layoutShiftCompensation,initialRect:J,measure:R.draggable.measure});const F=jn(q,R.draggable.measure,J),se=jn(q?q.parentElement:null),ne=p.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=N.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=Qo({measure:R.dragOverlay.measure}),Te=(r=xe.nodeRef.current)!=null?r:q,Me=T?(o=xe.rect)!=null?o:F:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=Uo(cn?null:F),_t=ar(Te?ae(Te):null),Se=Go(T?he??q:null),ot=Jo(Se),st=as(v,{transform:{x:V.x-ln.x,y:V.y-ln.y,scaleX:1,scaleY:1},activatorEvent:_,active:X,activeNodeRect:F,containerNodeRect:se,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:_t}),un=W?$e(W,V):null,dn=qo(Se),Ir=Tn(dn),Ar=Tn(dn,[F]),_e=$e(st,Ir),Oe=Me?vo(Me,st):null,ze=X&&Oe?h({active:X,collisionRect:Oe,droppableRects:P,droppableContainers:g,pointerCoordinates:un}):null,fn=uo(ze,"id"),[we,hn]=p.useState(null),Lr=cn?st:$e(st,Ar),Nr=po(Lr,(s=we?.rect)!=null?s:null,F),Ot=p.useRef(null),pn=p.useCallback((re,ce)=>{let{sensor:le,options:Ce}=ce;if(A.current==null)return;const de=L.get(A.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:A.current,activeNode:de,event:ue,options:Ce,context:ne,onAbort(te){if(!L.get(te))return;const{onDragAbort:me}=z.current,ye={id:te};me?.(ye),M({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!L.get(te))return;const{onDragPending:Ye}=z.current,Re={id:te,constraint:De,initialCoordinates:me,offset:ye};Ye?.(Re),M({type:"onDragPending",event:Re})},onStart(te){const De=A.current;if(De==null)return;const me=L.get(De);if(!me)return;const{onDragStart:ye}=z.current,Pe={activatorEvent:ue,active:{id:De,data:me.data,rect:H}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),$(je.Initializing),w({type:Q.DragStart,initialCoordinates:te,active:De}),M({type:"onDragStart",event:Pe}),C(Ot.current),E(ue)})},onMove(te){w({type:Q.DragMove,coordinates:te})},onEnd:ke(Q.DragEnd),onCancel:ke(Q.DragCancel)});Ot.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:Pe,scrollAdjustedTranslate:Ye}=ne.current;let Re=null;if(me&&Ye){const{cancelDrop:Fe}=z.current;Re={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Q.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(Re))&&(te=Q.DragCancel)}A.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),$(je.Uninitialized),hn(null),C(null),E(null),Ot.current=null;const Fe=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(Re){const kt=z.current[Fe];kt?.(Re),M({type:Fe,event:Re})}})}}},[L]),zr=p.useCallback((re,ce)=>(le,Ce)=>{const de=le.nativeEvent,ue=L.get(Ce);if(A.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},A.current=Ce,pn(le,ce))},[L,pn]),gn=Fo(f,zr);Xo(f),be(()=>{F&&O===je.Initializing&&$(je.Initialized)},[F,O]),p.useEffect(()=>{const{onDragMove:re}=z.current,{active:ce,activatorEvent:le,collisions:Ce,over:de}=ne.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:Ce,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(ue),M({type:"onDragMove",event:ue})})},[_e.x,_e.y]),p.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:Ce,scrollAdjustedTranslate:de}=ne.current;if(!re||A.current==null||!ce||!de)return;const{onDragOver:ue}=z.current,ve=Ce.get(fn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:re,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{hn(ke),ue?.(te),M({type:"onDragOver",event:te})})},[fn]),be(()=>{ne.current={activatorEvent:_,active:X,activeNode:q,collisionRect:Oe,collisions:ze,droppableRects:P,draggableNodes:L,draggingNode:Te,draggingNodeRect:Me,droppableContainers:N,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},H.current={initial:Me,translated:Oe}},[X,q,ze,Oe,L,Te,Me,P,N,we,Se,_e]),No({...K,delta:V,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:ot});const Pr=p.useMemo(()=>({active:X,activeNode:q,activeNodeRect:F,activatorEvent:_,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:L,droppableContainers:N,droppableRects:P,over:we,measureDroppableContainers:B,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:R,measuringScheduled:G,windowRect:_t}),[X,q,F,_,ze,se,xe,L,N,P,we,B,Se,ot,R,G,_t]),Yr=p.useMemo(()=>({activatorEvent:_,activators:gn,active:X,activeNodeRect:F,ariaDescribedById:{draggable:Y},dispatch:w,draggableNodes:L,over:we,measureDroppableContainers:B}),[_,gn,X,F,w,Y,L,we,B]);return p.createElement(Xn.Provider,{value:j},p.createElement(jt.Provider,{value:Yr},p.createElement(cr.Provider,{value:Pr},p.createElement(lr.Provider,{value:Nr},d)),p.createElement(is,{disabled:a?.restoreFocus===!1})),p.createElement(oo,{...a,hiddenTextDescribedById:Y}));function Fr(){const re=D?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=T&&!re&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),us=p.createContext(null),_n="button",ds="Draggable";function fs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(ds),{activators:c,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:y}=p.useContext(jt),{role:v=_n,roleDescription:b="draggable",tabIndex:m=0}=o??{},x=u?.id===t,w=p.useContext(x?lr:us),[M,j]=bt(),[O,$]=bt(),T=Ko(c,t),I=Ke(n);be(()=>(h.set(t,{id:t,key:s,node:M,activatorNode:O,data:I}),()=>{const V=h.get(t);V&&V.key===s&&h.delete(t)}),[h,t]);const L=p.useMemo(()=>({role:v,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&v===_n?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[r,v,m,x,b,f.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:L,isDragging:x,listeners:r?void 0:T,node:M,over:y,setNodeRef:j,setActivatorNodeRef:$,transform:w}}function hs(){return p.useContext(cr)}const ps="Droppable",gs={timeout:25};function vs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(ps),{active:c,dispatch:a,over:u,measureDroppableContainers:d}=p.useContext(jt),f=p.useRef({disabled:n}),h=p.useRef(!1),y=p.useRef(null),v=p.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:x}={...gs,...o},w=Ke(m??r),M=p.useCallback(()=>{if(!h.current){h.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),v.current=null},x)},[x]),j=Rt({callback:M,disabled:b||!c}),O=p.useCallback((L,V)=>{j&&(V&&(j.unobserve(V),h.current=!1),L&&j.observe(L))},[j]),[$,T]=bt(O),I=Ke(t);return p.useEffect(()=>{!j||!$.current||(j.disconnect(),h.current=!1,j.observe($.current))},[$,j]),p.useEffect(()=>(a({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:y,data:I}}),()=>a({type:Q.UnregisterDroppable,key:s,id:r})),[r]),p.useEffect(()=>{n!==f.current.disabled&&(a({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,a]),{active:c,rect:y,isOver:u?.id===r,node:$,over:u,setNodeRef:T}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ms(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function at(e){return e!==null&&e>=0}function bs(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 xs(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},ys=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:c}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const u=Ss(n,c,o);if(c===o){const d=n[s];return d?{x:o<s?d.left+d.width-(a.left+a.width):d.left-a.left,y:0,...ct}:null}return c>o&&c<=s?{x:-a.width-u,y:0,...ct}:c<o&&c>=s?{x:a.width+u,y:0,...ct}:{x:0,y:0,...ct}};function Ss(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 dr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Et(t,r,n),c=t[o],a=s[o];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},lt={scaleX:1,scaleY:1},ws=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:c}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(o===n){const d=s[c];return d?{x:0,y:n<c?d.top+d.height-(a.top+a.height):d.top-a.top,...lt}:null}const u=Cs(s,o,n);return o>n&&o<=c?{x:0,y:-a.height-u,...lt}:o<n&&o>=c?{x:0,y:a.height+u,...lt}:{x:0,y:0,...lt}};function Cs(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 fr="Sortable",hr=p.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function pr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:s=!1}=e;const{active:c,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:f}=hs(),h=tt(fr,n),y=a.rect!==null,v=p.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),b=c!=null,m=c?v.indexOf(c.id):-1,x=d?v.indexOf(d.id):-1,w=p.useRef(v),M=!bs(v,w.current),j=x!==-1&&m===-1||M,O=xs(s);be(()=>{M&&b&&f(v)},[M,v,b,f]),p.useEffect(()=>{w.current=v},[v]);const $=p.useMemo(()=>({activeIndex:m,containerId:h,disabled:O,disableTransforms:j,items:v,overIndex:x,useDragOverlay:y,sortedRects:ms(v,u),strategy:o}),[m,h,O.draggable,O.droppable,j,v,x,u,y,o]);return p.createElement(hr.Provider,{value:$},t)}const Ds=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},Rs=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:c,previousItems:a,previousContainerId:u,transition:d}=e;return!d||!r||a!==s&&o===c?!1:n?!0:c!==o&&t===u},js={duration:200,easing:"ease"},gr="transform",Es=Ie.Transition.toString({property:gr,duration:0,easing:"linear"}),Ts={roleDescription:"sortable"};function Ms(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,c]=p.useState(null),a=p.useRef(n);return be(()=>{if(!t&&n!==a.current&&r.current){const u=o.current;if(u){const d=Ne(r.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&c(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),p.useEffect(()=>{s&&c(null)},[s]),s}function vr(e){let{animateLayoutChanges:t=Rs,attributes:n,disabled:r,data:o,getNewIndex:s=Ds,id:c,strategy:a,resizeObserverConfig:u,transition:d=js}=e;const{items:f,containerId:h,activeIndex:y,disabled:v,disableTransforms:b,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:M}=p.useContext(hr),j=_s(r,v),O=f.indexOf(c),$=p.useMemo(()=>({sortable:{containerId:h,index:O,items:f},...o}),[h,o,O,f]),T=p.useMemo(()=>f.slice(f.indexOf(c)),[f,c]),{rect:I,node:L,isOver:V,setNodeRef:N}=vs({id:c,data:$,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...u}}),{active:k,activatorEvent:H,activeNodeRect:X,attributes:A,setNodeRef:D,listeners:C,isDragging:_,over:E,setActivatorNodeRef:z,transform:Y}=fs({id:c,data:$,attributes:{...Ts,...n},disabled:j.draggable}),g=Wr(N,D),R=!!k,P=R&&!b&&at(y)&&at(x),B=!w&&_,G=B&&P?Y:null,W=P?G??(a??M)({rects:m,activeNodeRect:X,activeIndex:y,overIndex:x,index:O}):null,K=at(y)&&at(x)?s({id:c,items:f,activeIndex:y,overIndex:x}):O,J=k?.id,F=p.useRef({activeId:J,items:f,newIndex:K,containerId:h}),se=f!==F.current.items,ne=t({active:k,containerId:h,isDragging:_,isSorting:R,id:c,index:O,items:f,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=Ms({disabled:!ne,index:O,node:L,rect:I});return p.useEffect(()=>{R&&F.current.newIndex!==K&&(F.current.newIndex=K),h!==F.current.containerId&&(F.current.containerId=h),f!==F.current.items&&(F.current.items=f)},[R,K,h,f]),p.useEffect(()=>{if(J===F.current.activeId)return;if(J!=null&&F.current.activeId==null){F.current.activeId=J;return}const Te=setTimeout(()=>{F.current.activeId=J},50);return()=>clearTimeout(Te)},[J]),{active:k,activeIndex:y,attributes:A,data:$,rect:I,index:O,newIndex:K,items:f,isOver:V,isSorting:R,isDragging:_,listeners:C,node:L,overIndex:x,over:E,setNodeRef:g,setActivatorNodeRef:z,setDroppableNodeRef:N,setDraggableNodeRef:D,transform:he??W,transition:xe()};function xe(){if(he||se&&F.current.newIndex===O)return Es;if(!(B&&!tn(H)||!d)&&(R||ne))return Ie.Transition.toString({...d,property:gr})}}function _s(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}}U.Down,U.Right,U.Up,U.Left;var ut={exports:{}},Nt={},dt={exports:{}},zt={};var On;function Os(){if(On)return zt;On=1;var e=p;function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function a(h,y){var v=y(),b=r({inst:{value:v,getSnapshot:y}}),m=b[0].inst,x=b[1];return s(function(){m.value=v,m.getSnapshot=y,u(m)&&x({inst:m})},[h,v,y]),o(function(){return u(m)&&x({inst:m}),h(function(){u(m)&&x({inst:m})})},[h]),c(v),v}function u(h){var y=h.getSnapshot;h=h.value;try{var v=y();return!n(h,v)}catch{return!0}}function d(h,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return zt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,zt}var Pt={};var kn;function ks(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}function t(v,b){f||o.startTransition===void 0||(f=!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 m=b();if(!h){var x=b();s(m,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}x=c({inst:{value:m,getSnapshot:b}});var w=x[0].inst,M=x[1];return u(function(){w.value=m,w.getSnapshot=b,n(w)&&M({inst:w})},[v,m,b]),a(function(){return n(w)&&M({inst:w}),v(function(){n(w)&&M({inst:w})})},[v]),d(m),m}function n(v){var b=v.getSnapshot;v=v.value;try{var m=b();return!s(v,m)}catch{return!0}}function r(v,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=p,s=typeof Object.is=="function"?Object.is:e,c=o.useState,a=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,f=!1,h=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Pt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Pt}var $n;function mr(){return $n||($n=1,process.env.NODE_ENV==="production"?dt.exports=Os():dt.exports=ks()),dt.exports}var In;function $s(){if(In)return Nt;In=1;var e=p,t=mr();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Nt.useSyncExternalStoreWithSelector=function(d,f,h,y,v){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=a(function(){function w(T){if(!M){if(M=!0,j=T,T=y(T),v!==void 0&&m.hasValue){var I=m.value;if(v(I,T))return O=I}return O=T}if(I=O,r(j,T))return I;var L=y(T);return v!==void 0&&v(I,L)?(j=T,I):(j=T,O=L)}var M=!1,j,O,$=h===void 0?null:h;return[function(){return w(f())},$===null?void 0:function(){return w($())}]},[f,h,y,v]);var x=o(d,b[0],b[1]);return c(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},Nt}var Yt={};var An;function Is(){return An||(An=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=p,n=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,a=t.useMemo,u=t.useDebugValue;Yt.useSyncExternalStoreWithSelector=function(d,f,h,y,v){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=a(function(){function w(T){if(!M){if(M=!0,j=T,T=y(T),v!==void 0&&m.hasValue){var I=m.value;if(v(I,T))return O=I}return O=T}if(I=O,r(j,T))return I;var L=y(T);return v!==void 0&&v(I,L)?(j=T,I):(j=T,O=L)}var M=!1,j,O,$=h===void 0?null:h;return[function(){return w(f())},$===null?void 0:function(){return w($())}]},[f,h,y,v]);var x=o(d,b[0],b[1]);return c(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Yt}var Ln;function As(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?ut.exports=$s():ut.exports=Is()),ut.exports}var Ls=As();const Xt=new WeakMap,Ns=new WeakMap,wt={current:[]};let Ft=!1;const ft=new Set,Nn=new Map;function br(e){for(const t of e){if(wt.current.includes(t))continue;wt.current.push(t),t.recompute();const n=Ns.get(t);if(n)for(const r of n){const o=Xt.get(r);o?.length&&br(o)}}}function zs(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ps(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ys(e){if(ft.add(e),!Ft)try{for(Ft=!0;ft.size>0;){const t=Array.from(ft);ft.clear();for(const n of t){const r=Nn.get(n)??n.prevState;n.prevState=r,zs(n)}for(const n of t){const r=Xt.get(n);r&&(wt.current.push(n),br(r))}for(const n of t){const r=Xt.get(n);if(r)for(const o of r)Ps(o)}}}finally{Ft=!1,wt.current=[],Nn.clear()}}function Fs(e){return typeof e=="function"}class xr{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const c=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.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):Fs(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Ys(this)}}function nt(e,t=r=>r,n={}){const r=n.equal??Bs;return Ls.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Bs(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 ie=new xr({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}});function yr(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:s}=ie.state,c=JSON.parse(localStorage.getItem(Cr(s))||"[]"),a=[...c.map(f=>o.find(h=>h.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],u=JSON.parse(localStorage.getItem(Dr(s))||"{}"),d=a.reduce((f,h)=>(f[h.id]=u[h.id]??!0,f),{});ie.setState(f=>({...f,data:e,columnOrder:a,visibility:d,sortableColumns:a.map(h=>({id:h.id,label:h.label,sortable:!0,backgroundColor:h.backgroundColor}))}))}function Sr(e){ie.setState(t=>({...t,tableId:e,sortColumn:null,sortDirection:"asc",columnOrder:[],visibility:{}}))}const wr=e=>{ie.setState(t=>({...t,actionsConfig:e}))},Cr=e=>`table_column_order_v1:${e}`,Dr=e=>`table_column_visibility_v1:${e}`,Vs=e=>{const{tableId:t}=ie.state;localStorage.setItem(Cr(t),JSON.stringify(e.map(n=>n.id))),ie.setState(n=>({...n,columnOrder:e})),ie.setState(n=>({...n,columnOrder:e}))};function Hs(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Ws=e=>{ie.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Dr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})};const Us=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=Gs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Rr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),qs=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Xs={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 Ks=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...a},u)=>p.createElement("svg",{ref:u,...Xs,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Rr("lucide",o),...!s&&!qs(a)&&{"aria-hidden":"true"},...a},[...c.map(([d,f])=>p.createElement(d,f)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=p.forwardRef(({className:r,...o},s)=>p.createElement(Ks,{ref:s,iconNode:t,className:Rr(`lucide-${Us(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Js=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Zs=oe("arrow-down",Js);const Qs=[["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"}]],ei=oe("arrow-up-down",Qs);const ti=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ni=oe("arrow-up",ti);const ri=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],oi=oe("bookmark",ri);const si=[["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"}]],Yn=oe("calendar",si);const ii=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ai=oe("chevron-left",ii);const ci=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],li=oe("chevron-right",ci);const ui=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],di=oe("columns-2",ui);const fi=[["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"}]],hi=oe("delete",fi);const pi=[["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"}]],gi=oe("ellipsis",pi);const vi=[["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"}]],mi=oe("funnel",vi);const bi=[["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"}]],jr=oe("grip-vertical",bi);const xi=[["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"}]],yi=oe("pen",xi);const Si=[["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"}]],wi=oe("refresh-ccw",Si);const Ci=[["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"}]],Di=oe("settings",Ci);const Ri=[["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"}]],ji=oe("triangle-alert",Ri);function S(e){return p.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Ei=S(l.Menu.Trigger),Ti=S(l.Menu.Positioner),Mi=S(l.Menu.Content),_i=S(l.Menu.Item),Oi=S(l.Checkbox.Label),ki=S(l.Checkbox.HiddenInput),$i=S(l.Checkbox.Control);function Ii({visibility:e,onToggle:t}){const{sortableColumns:n}=nt(ie);return i.jsxs(l.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ei,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(di,{size:18})})}),i.jsx(l.Portal,{children:i.jsx(Ti,{children:i.jsx(Mi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(_i,{value:r.id,closeOnSelect:!1,children:i.jsxs(l.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(ki,{}),i.jsx($i,{}),i.jsx(Oi,{children:r.label})]})},r.id)})})})})]})}function Ai({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:c}){const{setNodeRef:a,attributes:u,listeners:d,transform:f,transition:h}=vr({id:e});return i.jsx(l.Table.ColumnHeader,{ref:a,onClick:n,backgroundColor:c,w:e==="id"?"80px":void 0,style:{transform:Ie.Transform.toString(f),transition:h,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(l.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(jr,{size:12})})]})})}function Li(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=nt(ie),c=e.map(a=>o.find(u=>u.id===a.id)).filter(a=>a!==void 0).filter(a=>t[a.id]);return i.jsx(l.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(l.Table.Row,{height:"28px",children:[c.map(a=>{const u=n===a?.id;return i.jsx(Ai,{id:a?.id,onClick:()=>a?.sortable&&Hs(a?.id),cursor:a?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:a?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[a?.label,a?.sortable&&(u?r==="asc"?i.jsx(ni,{size:14}):i.jsx(Zs,{size:14}):i.jsx(ei,{size:14,opacity:.4}))]})},a?.id)}),s?.showActionColumn&&i.jsx(l.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(l.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Ii,{visibility:t,onToggle:Ws})})]})})}const Ni=[10,20,50,100],zi=S(l.Select.Positioner),Pi=S(l.Select.Content),Yi=S(l.Select.Item),Fi=S(l.Pagination.PrevTrigger),Bi=S(l.Pagination.NextTrigger),Vi=S(l.Select.HiddenSelect),Hi=S(l.Select.Control),Wi=S(l.Select.Trigger),Ui=S(l.Select.ValueText),Gi=S(l.Select.IndicatorGroup),qi=S(l.Select.Indicator);function Xi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:c=Ni}){const a=l.createListCollection({items:c.map(u=>({label:String(u),value:String(u)}))});return i.jsx(l.Box,{width:"100%",children:i.jsxs(l.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(l.HStack,{children:[i.jsx(l.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(l.Select.Root,{collection:a,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(Vi,{}),i.jsxs(Hi,{children:[i.jsx(Wi,{children:i.jsx(Ui,{placeholder:""})}),i.jsx(Gi,{children:i.jsx(qi,{})})]}),i.jsx(l.Portal,{children:i.jsx(zi,{children:i.jsx(Pi,{children:a.items.map(u=>i.jsxs(Yi,{item:u.value,children:[u.label,i.jsx(l.Select.ItemIndicator,{})]},u.value))})})})]})]}),i.jsx(l.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(l.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Fi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Previous page",children:i.jsx(ai,{size:18})})}),i.jsx(l.Pagination.Items,{render:u=>i.jsx(l.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(Bi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Next page",children:i.jsx(li,{size:18})})})]})})]})})}const Ki=S(l.Menu.Item),Ji=S(l.Menu.Content),Zi=S(l.Menu.Positioner),Qi=S(l.Menu.Trigger);function ea({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=nt(ie);return i.jsx(l.Table.Body,{children:e.map(o=>i.jsxs(l.Table.Row,{_hover:{bg:"blue.50"},children:[n.filter(s=>r[s.id]).map(s=>i.jsx(l.Table.Cell,{children:o[s.id]},s.id)),i.jsx(l.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(l.Menu.Root,{children:[i.jsx(Qi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(gi,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(Zi,{children:i.jsx(Ji,{children:t.filter(s=>typeof s.visible=="function"?s.visible(o.__row):s.visible!==!1).map(s=>i.jsxs(Ki,{onClick:()=>s.onClick(o.__row),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})}),i.jsx(l.Table.Cell,{})]},o.id))})}function ta({rows:e=6,columns:t}){return i.jsx(l.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(l.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(l.Table.Cell,{children:i.jsx(l.Skeleton,{height:"25px"})},s))},r))})}function na({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:c="No data",actions:a,page:u=1,pageSize:d=10,onPageChange:f,onPageSizeChange:h,density:y="sm",totalCount:v=0,paginationMode:b="client",actionConfig:m,pageSizeOptions:x}){p.useEffect(()=>{Sr(e)},[e]),p.useEffect(()=>{yr(t,n)},[t,n]),p.useEffect(()=>{m&&wr(m)},[m]);const{sortColumn:w,sortDirection:M,data:j,columnOrder:O}=nt(ie),$=p.useMemo(()=>{const N=[...j],k=Math.max(1,u||1);if(w&&N.sort((H,X)=>M==="asc"?String(H[w]).localeCompare(String(X[w])):String(X[w]).localeCompare(String(H[w]))),b==="client"){const H=(k-1)*d;return N.slice(H,H+d)}return N},[j,w,M,u,d,b]);p.useEffect(()=>{u<1&&f&&f(1)},[u,f]);const T=N=>{const{active:k,over:H}=N;if(!H||k.id===H.id)return;const X=O.findIndex(C=>C.id===k.id),A=O.findIndex(C=>C.id===H.id),D=Et(O,X,A);Vs(D)},I=r&&!s,L=s&&!r,V=!r&&!s&&$.length===0;return i.jsx(ur,{collisionDetection:Kn,onDragEnd:T,children:i.jsx(pr,{items:O.map(N=>N.id),strategy:ys,children:i.jsxs(l.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(l.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[I&&i.jsx(l.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(l.Spinner,{})}),i.jsxs(l.Table.Root,{variant:"outline",w:"100%",size:y,children:[i.jsx(Li,{}),L?i.jsx(ta,{rows:d,columns:n.length+(a?2:0)}):V?i.jsx(l.Table.Body,{children:i.jsx(l.Table.Row,{children:i.jsx(l.Table.Cell,{colSpan:n.length+(a?1:0),children:i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:c})})})}):i.jsx(ea,{data:$,actions:a})]})]}),i.jsx(l.Box,{mt:.5,children:i.jsx(Xi,{totalCount:v,pageSize:d,currentPage:u,onPageChange:f,onPageSizeChange:N=>{h?.(N),u>1&&f?.(1)},pageSizeOptions:x})})]})})})}const ra=S(l.Checkbox.Root),oa=S(l.Checkbox.HiddenInput),sa=S(l.Checkbox.Control),ia=S(l.Checkbox.Label),Er=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:c,errorText:a})=>i.jsxs(ra,{value:e,onChange:t,size:n,children:[i.jsx(oa,{}),i.jsx(sa,{disabled:s,required:c,errorText:a,helperText:o}),r&&i.jsx(ia,{children:r})]}),Z=" to ",Fn=10,Ee={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},an=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Bn=()=>{const{year:e,month:t,day:n}=an();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},aa=()=>{const{year:e,month:t,day:n}=an();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},ca=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Ee.YEAR_MIN&&r<=Ee.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,c=o.substring(0,s);return parseInt(c+e)}return t},He=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=an();let c,a,u;return n.length===1?(c=parseInt(n[0])||s,a=o,u=r):n.length===2?(c=parseInt(n[0])||s,a=parseInt(n[1])||o,u=r):(c=parseInt(n[0])||s,a=parseInt(n[1])||o,u=ca(n[2],r)),a=Math.max(1,Math.min(Ee.MONTH_MAX,a)),c=Math.max(1,Math.min(Ee.DAY_MAX,c)),`${u}-${String(a).padStart(2,"0")}-${String(c).padStart(2,"0")}`},pe=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},la=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Ee.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Ee.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<Ee.YEAR_MIN||n>Ee.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Fn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Fn),la(n,e)||t},ua=S(l.Popover.Root),da=S(l.Popover.Trigger),fa=S(l.Popover.Content),ha=S(l.Popover.Positioner);function pa({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,c]=p.useState(()=>r&&o?`${pe(r)}${Z}${pe(o)}`:r?pe(r):""),[a,u]=p.useState(!1),d=p.useRef(null);p.useEffect(()=>{const b=m=>{m.ctrlKey&&m.key==="d"&&!m.shiftKey&&!m.metaKey&&(m.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const f=b=>{let m=b;if(m.includes(Z)){const[x,w=""]=m.split(Z);m=`${We(x.trim())}${Z}${We(w.trim())}`}else if(m.toLowerCase().includes(" to ")){const[x,w=""]=m.split(/\s+to\s+/i);m=`${We(x.trim())} to ${We(w.trim())}`}else m=We(m);c(m)},h=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(Z)){const[m,x=""]=b.split(Z).map(j=>j.trim()),w=He(m),M=x?He(x):null;if(w&&M){const[j,O]=M<w?[M,w]:[w,M],$=`${pe(j)}${Z}${pe(O)}`;c($),t(`${j}|${O}`)}else if(w&&!x)c(`${pe(w)}${Z}`),t(void 0);else if(w&&x){const j=aa(),[O,$]=j<w?[j,w]:[w,j],T=`${pe(O)}${Z}${pe($)}`;c(T),t(`${O}|${$}`)}else c(""),t(void 0)}else{const m=He(b);m?(c(`${pe(m)}${Z}`),t(void 0)):(c(""),t(void 0))}},y=b=>{if(b.key!=="Enter")return;b.preventDefault();const m=d.current?.selectionStart||0,x=s.indexOf(Z);if(!s.trim()){c(`${Bn()}${Z}`);return}if(x===-1){const M=He(s.trim());M&&c(`${pe(M)}${Z}`);return}if(m<=x+Z.length){const M=s.substring(0,x).trim(),j=s.substring(x+Z.length),O=He(M);O&&c(`${pe(O)}${Z}${j}`);return}if(s.substring(x+Z.length).trim())h(),d.current?.blur();else{const M=s.substring(0,x+Z.length)+Bn();c(M),setTimeout(()=>{h(),d.current?.blur()},0)}},v=()=>{c(""),t(void 0)};return i.jsx(l.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(l.InputElement,{position:"revert",children:[i.jsxs(ua,{open:a,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(da,{asChild:!0,children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(ha,{children:i.jsxs(fa,{p:4,children:[i.jsx(l.PopoverArrow,{}),i.jsxs(l.VStack,{align:"start",gap:4,children:[i.jsxs(l.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(l.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(l.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(l.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(l.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(l.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(l.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(l.HStack,{children:[i.jsx(l.Kbd,{children:"Ctrl"}),i.jsx(l.Text,{children:"+"}),i.jsx(l.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(l.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>f(b.target.value),onBlur:h,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(l.InputElement,{children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const ga=S(l.Field.Root),va=S(l.Field.Label),ma=S(l.Field.HelperText),ba=S(l.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:c="100%",label:a,helperText:u,isDisabled:d=!1,required:f=!1,errorText:h,visible:y})=>i.jsxs(ga,{width:c,children:[y&&i.jsx(va,{children:a}),i.jsx(l.InputGroup,{startElement:e,children:i.jsx(l.Input,{value:t,onChange:v=>n?.(v.target.value),placeholder:r,size:o,variant:s,disabled:d,required:f})}),h&&i.jsx(ba,{fontSize:"xs",children:h}),u&&i.jsx(ma,{fontSize:"xs",children:u})]}),xa=S(l.Field.Root),ya=S(l.Field.HelperText),Sa=S(l.Field.ErrorText),wa=S(l.Select.Root),Ca=S(l.Select.Label),Da=S(l.Select.Control),Ra=S(l.Select.Trigger),ja=S(l.Select.ValueText),Ea=S(l.Select.IndicatorGroup),Ta=S(l.Select.Indicator),Ma=S(l.Select.Content),_a=S(l.Select.Item),Oa=S(l.Select.ItemIndicator),ka=S(l.Select.HiddenSelect),$a=S(l.Select.Positioner),Tr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:c="100%",variant:a="outline",helperText:u,isDisabled:d,required:f,errorText:h,visible:y})=>{const v=l.createListCollection({items:e});return i.jsxs(xa,{disabled:d,required:f,children:[i.jsxs(wa,{collection:v,variant:a,size:s,width:c,value:n?[n]:[],onValueChange:b=>r?.(b.value[0]),children:[i.jsx(ka,{}),y&&i.jsx(Ca,{children:t}),i.jsxs(Da,{children:[i.jsx(Ra,{children:i.jsx(ja,{placeholder:o})}),i.jsx(Ea,{children:i.jsx(Ta,{})})]}),i.jsx($a,{children:i.jsx(Ma,{children:v.items.map(b=>i.jsxs(_a,{item:b,children:[b.label,i.jsx(Oa,{})]},b.value))})})]}),u&&i.jsx(ya,{children:u}),h&&i.jsx(Sa,{children:h})]})},Mr=(e="default")=>`FILTER_PRESETS_${e}`,Ia=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},Aa=e=>typeof window>"u"?[]:Ia(localStorage.getItem(Mr(e))),Ze=new xr({}),rt=e=>{const t=Ze.state;if(e in t)return t[e];const n=Aa(e);return Ze.setState(r=>({...r,[e]:n})),n},Tt=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(Mr(e),JSON.stringify(t))},_r=(e,t)=>{const n=[t,...rt(e)];Tt(e,n)},Or=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);Tt(e,n)},La=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);Tt(e,r)},Na=S(l.Checkbox.Root),za=S(l.Checkbox.HiddenInput),Pa=S(l.Checkbox.Control),Ya=S(l.Slider.Root),Fa=S(l.Slider.Track),Ba=S(l.Slider.Range),Va=S(l.Slider.Thumbs),Ha=S(l.Slider.Control),Wa=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:c,transition:a}=vr({id:e.id}),u={transform:Ie.Transform.toString(c),transition:a};return i.jsxs(l.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(l.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(jr,{size:16}),i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(l.HStack,{justify:"space-between",children:[i.jsx(l.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(Na,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(za,{}),i.jsx(Pa,{})]})]}),i.jsxs(l.VStack,{align:"stretch",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",children:"Size"}),i.jsx(Ya,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(Ha,{children:[i.jsx(Fa,{children:i.jsx(Ba,{})}),i.jsx(Va,{})]})})]})]})},Ua=S(l.Drawer.Root),Ga=S(l.Drawer.Trigger),qa=S(l.Drawer.Backdrop),Xa=S(l.Drawer.Positioner),Ka=S(l.Drawer.Content),Ja=S(l.Drawer.Header),Za=S(l.Drawer.Title),Qa=S(l.Drawer.Body),ec=S(l.Drawer.Footer),tc=S(l.Drawer.CloseTrigger),nc=S(l.Tabs.Root),rc=S(l.Tabs.List),Bt=S(l.Tabs.Trigger),Vt=S(l.Tabs.Content),kr=(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(Er,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(pa,{value:e.value,onChange:e.onChange});default:return null}},oc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",onLoadPreset:c,activePresetName:a,onReorder:u,open:d,onOpenChange:f})=>{const y=nt(Ze)[s]??rt(s),v=()=>{const b=prompt("Preset name?");if(!b)return;const m=o.reduce((x,w)=>(x[w.id]=w.value,x),{});_r(s,{id:crypto.randomUUID(),name:b,date:new Date().toISOString(),values:m})};return i.jsx(l.HStack,{wrap:"wrap",children:i.jsxs(Ua,{size:e,open:d,onOpenChange:f,children:[i.jsx(Ga,{asChild:!0,children:i.jsxs(l.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(mi,{size:16}),"Filters"]})}),i.jsxs(l.Portal,{children:[i.jsx(qa,{}),i.jsx(Xa,{children:i.jsxs(Ka,{children:[i.jsx(Ja,{children:i.jsx(Za,{children:"Filters"})}),i.jsx(Qa,{overflowY:"auto",pt:1,children:i.jsxs(nc,{defaultValue:"view",children:[i.jsxs(rc,{mb:4,children:[i.jsxs(Bt,{value:"view",children:[i.jsx(yi,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx(Di,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(oi,{size:16}),"Presets"]})]}),i.jsx(Vt,{value:"view",children:o.filter(b=>b.visible).map(b=>i.jsx(l.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:b.size??1,minW:`${(b.size??1)*100}px`,rounded:"md",p:3,mb:3,children:kr(b,d)},b.id))}),i.jsx(Vt,{value:"settings",children:i.jsx(ur,{sensors:io(so(sn)),collisionDetection:Kn,onDragEnd:({active:b,over:m})=>{if(!m||b.id===m.id)return;const x=o.findIndex(j=>j.id===b.id),w=o.findIndex(j=>j.id===m.id),M=Et(o,x,w);u?.(M)},children:i.jsx(pr,{items:o.map(b=>b.id),strategy:ws,children:o.map(b=>i.jsx(Wa,{filter:b,onVisibilityChange:t,onSizeChange:n},b.id))})})}),i.jsx(Vt,{value:"presets",children:i.jsxs(l.VStack,{align:"stretch",mb:3,children:[y.length===0&&i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),y.map(b=>i.jsxs(l.HStack,{justify:"space-between",border:"1px solid",borderColor:a===b.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(l.VStack,{align:"start",gap:0,children:[i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:b.name}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:new Date(b.date).toLocaleDateString()})]}),i.jsxs(l.HStack,{children:[i.jsx(l.Button,{size:"xs",variant:"ghost",onClick:()=>{const m=o.map(x=>({...x,value:b.values[x.id]??x.value}));c?.(m,b.name)},children:"Load"}),i.jsx(l.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Or(s,b.id),children:i.jsx(hi,{size:14})})]})]},b.id)),i.jsx(l.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(ec,{justify:"space-between",children:i.jsx(tc,{asChild:!0,children:i.jsx(l.CloseButton,{})})})]})})]})]})})},sc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:a,onLoadPreset:u,activePresetName:d,filterDrawerSize:f="sm"})=>{const[h,y]=p.useState(!1);return i.jsxs(l.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(l.HStack,{gapX:1,children:[t.filter(v=>v.visible!==!1).map(v=>i.jsx(l.HStack,{flex:v.size??1,minW:`${(v.size??1)*100}px`,alignItems:"center",children:kr(v)},v.id)),i.jsx(oc,{filterDrawerSize:f,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:c,pageKey:a,filters:t,onLoadPreset:u,activePresetName:d,open:h,onOpenChange:v=>{y(v.open)}})]})]})},ic=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},ac=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},cc=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:c,colorScheme:a,loading:u,loadingText:d,rounded:f,type:h="button"})=>i.jsx(l.Button,{onClick:e,size:t,variant:n,disabled:c,colorPalette:a,loading:u,loadingText:d,rounded:f,type:h,children:i.jsxs(l.HStack,{gap:1,children:[o,r,s]})}),lc=S(l.Combobox.Root);S(l.Combobox.Label);const uc=S(l.Combobox.Control),dc=S(l.Combobox.Input),fc=S(l.Combobox.IndicatorGroup),hc=S(l.Combobox.ClearTrigger),pc=S(l.Combobox.Trigger),gc=S(l.Combobox.Positioner),vc=S(l.Combobox.Content);function mc({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:c,renderItem:a,loading:u,error:d,errorMessage:f,placeholder:h,helpText:y,onInputChange:v,onSelect:b,rootProps:m,inputProps:x,controlProps:w,contentProps:M,itemProps:j}){const[O,$]=p.useState(""),{collection:T,set:I}=l.useListCollection({initialItems:o,itemToString:s,itemToValue:c}),L=p.useMemo(()=>{if(!O)return o;const V=O.toLowerCase();return o.filter(N=>s(N).toLowerCase().includes(V))},[o,O,s]);return p.useEffect(()=>{I(L)},[L,I]),i.jsxs(lc,{width:n,size:t,variant:r,collection:T,placeholder:h,onInputValueChange:V=>{v?.(V.inputValue),$(V.inputValue)},onValueChange:V=>{const N=V.value?.[0];if(!N)return;const k=T.items.find(H=>c(H)===N);k&&b?.(k)},positioning:{sameWidth:!1,placement:"bottom-start"},...m,children:[e&&i.jsx(l.Text,{fontSize:"sm",children:e}),i.jsxs(uc,{...w,children:[i.jsx(dc,{placeholder:h??"Type to search",...x}),i.jsxs(fc,{children:[i.jsx(hc,{}),i.jsx(pc,{})]})]}),i.jsx(gc,{children:i.jsxs(vc,{minW:"sm",...M,children:[u?i.jsxs(l.HStack,{p:"2",children:[i.jsx(l.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(l.Span,{children:"Loading..."})]}):d?i.jsx(l.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):T.items.map(V=>i.jsxs(l.Combobox.Item,{item:V,...j,children:[a(V),i.jsx(l.Combobox.ItemIndicator,{})]},c(V))),y&&!d&&!u&&i.jsx(l.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:y})]})})]})}const bc=S(l.Dialog.Root),xc=S(l.Dialog.Backdrop),yc=S(l.Dialog.Positioner),Sc=S(l.Dialog.Content),wc=S(l.Dialog.Header),Cc=S(l.Dialog.Body),Dc=S(l.Dialog.Footer),Rc=S(l.Dialog.Title),jc=S(l.Dialog.CloseTrigger);function Ec({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:c="Delete",isLoading:a=!1}){const[u,d]=p.useState("");return i.jsx(bc,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(l.Portal,{children:[i.jsx(xc,{}),i.jsx(yc,{children:i.jsxs(Sc,{maxW:"550px",children:[i.jsx(wc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Rc,{color:"red.600",children:r})}),i.jsx(Cc,{p:2,style:{padding:"16px"},children:i.jsxs(l.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(l.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(l.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(l.Box,{color:"red.600",mt:"2px",children:i.jsx(ji,{size:20})}),i.jsxs(l.Box,{children:[i.jsx(l.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(l.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(l.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(l.Box,{children:[i.jsxs(l.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(l.Input,{placeholder:`Type ${s} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(Dc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(l.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(l.Button,{size:"sm",style:{backgroundColor:"#FF0000"},loading:a,onClick:n,children:c})]}),i.jsx(jc,{asChild:!0,children:i.jsx(l.CloseButton,{size:"sm"})})]})})]})})}function $r({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=p.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(l.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(wi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var pt={exports:{}},Tc=pt.exports,Vn;function Mc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(Tc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",c="second",a="minute",u="hour",d="day",f="week",h="month",y="quarter",v="year",b="date",m="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,M={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(A){var D=["th","st","nd","rd"],C=A%100;return"["+A+(D[(C-20)%10]||D[C]||D[0])+"]"}},j=function(A,D,C){var _=String(A);return!_||_.length>=D?A:""+Array(D+1-_.length).join(C)+A},O={s:j,z:function(A){var D=-A.utcOffset(),C=Math.abs(D),_=Math.floor(C/60),E=C%60;return(D<=0?"+":"-")+j(_,2,"0")+":"+j(E,2,"0")},m:function A(D,C){if(D.date()<C.date())return-A(C,D);var _=12*(C.year()-D.year())+(C.month()-D.month()),E=D.clone().add(_,h),z=C-E<0,Y=D.clone().add(_+(z?-1:1),h);return+(-(_+(C-E)/(z?E-Y:Y-E))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:h,y:v,w:f,d,D:b,h:u,m:a,s:c,ms:s,Q:y}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},$="en",T={};T[$]=M;var I="$isDayjsObject",L=function(A){return A instanceof H||!(!A||!A[I])},V=function A(D,C,_){var E;if(!D)return $;if(typeof D=="string"){var z=D.toLowerCase();T[z]&&(E=z),C&&(T[z]=C,E=z);var Y=D.split("-");if(!E&&Y.length>1)return A(Y[0])}else{var g=D.name;T[g]=D,E=g}return!_&&E&&($=E),E||!_&&$},N=function(A,D){if(L(A))return A.clone();var C=typeof D=="object"?D:{};return C.date=A,C.args=arguments,new H(C)},k=O;k.l=V,k.i=L,k.w=function(A,D){return N(A,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var H=(function(){function A(C){this.$L=V(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[I]=!0}var D=A.prototype;return D.parse=function(C){this.$d=(function(_){var E=_.date,z=_.utc;if(E===null)return new Date(NaN);if(k.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(x);if(Y){var g=Y[2]-1||0,R=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],g,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,R)):new Date(Y[1],g,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,R)}}return new Date(E)})(C),this.init()},D.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()},D.$utils=function(){return k},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(C,_){var E=N(C);return this.startOf(_)<=E&&E<=this.endOf(_)},D.isAfter=function(C,_){return N(C)<this.startOf(_)},D.isBefore=function(C,_){return this.endOf(_)<N(C)},D.$g=function(C,_,E){return k.u(C)?this[_]:this.set(E,C)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(C,_){var E=this,z=!!k.u(_)||_,Y=k.p(C),g=function(J,F){var se=k.w(E.$u?Date.UTC(E.$y,F,J):new Date(E.$y,F,J),E);return z?se:se.endOf(d)},R=function(J,F){return k.w(E.toDate()[J].apply(E.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(F)),E)},P=this.$W,B=this.$M,G=this.$D,q="set"+(this.$u?"UTC":"");switch(Y){case v:return z?g(1,0):g(31,11);case h:return z?g(1,B):g(0,B+1);case f:var W=this.$locale().weekStart||0,K=(P<W?P+7:P)-W;return g(z?G-K:G+(6-K),B);case d:case b:return R(q+"Hours",0);case u:return R(q+"Minutes",1);case a:return R(q+"Seconds",2);case c:return R(q+"Milliseconds",3);default:return this.clone()}},D.endOf=function(C){return this.startOf(C,!1)},D.$set=function(C,_){var E,z=k.p(C),Y="set"+(this.$u?"UTC":""),g=(E={},E[d]=Y+"Date",E[b]=Y+"Date",E[h]=Y+"Month",E[v]=Y+"FullYear",E[u]=Y+"Hours",E[a]=Y+"Minutes",E[c]=Y+"Seconds",E[s]=Y+"Milliseconds",E)[z],R=z===d?this.$D+(_-this.$W):_;if(z===h||z===v){var P=this.clone().set(b,1);P.$d[g](R),P.init(),this.$d=P.set(b,Math.min(this.$D,P.daysInMonth())).$d}else g&&this.$d[g](R);return this.init(),this},D.set=function(C,_){return this.clone().$set(C,_)},D.get=function(C){return this[k.p(C)]()},D.add=function(C,_){var E,z=this;C=Number(C);var Y=k.p(_),g=function(B){var G=N(z);return k.w(G.date(G.date()+Math.round(B*C)),z)};if(Y===h)return this.set(h,this.$M+C);if(Y===v)return this.set(v,this.$y+C);if(Y===d)return g(1);if(Y===f)return g(7);var R=(E={},E[a]=r,E[u]=o,E[c]=n,E)[Y]||1,P=this.$d.getTime()+C*R;return k.w(P,this)},D.subtract=function(C,_){return this.add(-1*C,_)},D.format=function(C){var _=this,E=this.$locale();if(!this.isValid())return E.invalidDate||m;var z=C||"YYYY-MM-DDTHH:mm:ssZ",Y=k.z(this),g=this.$H,R=this.$m,P=this.$M,B=E.weekdays,G=E.months,q=E.meridiem,W=function(F,se,ne,he){return F&&(F[se]||F(_,z))||ne[se].slice(0,he)},K=function(F){return k.s(g%12||12,F,"0")},J=q||function(F,se,ne){var he=F<12?"AM":"PM";return ne?he.toLowerCase():he};return z.replace(w,(function(F,se){return se||(function(ne){switch(ne){case"YY":return String(_.$y).slice(-2);case"YYYY":return k.s(_.$y,4,"0");case"M":return P+1;case"MM":return k.s(P+1,2,"0");case"MMM":return W(E.monthsShort,P,G,3);case"MMMM":return W(G,P);case"D":return _.$D;case"DD":return k.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return W(E.weekdaysMin,_.$W,B,2);case"ddd":return W(E.weekdaysShort,_.$W,B,3);case"dddd":return B[_.$W];case"H":return String(g);case"HH":return k.s(g,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(g,R,!0);case"A":return J(g,R,!1);case"m":return String(R);case"mm":return k.s(R,2,"0");case"s":return String(_.$s);case"ss":return k.s(_.$s,2,"0");case"SSS":return k.s(_.$ms,3,"0");case"Z":return Y}return null})(F)||Y.replace(":","")}))},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(C,_,E){var z,Y=this,g=k.p(_),R=N(C),P=(R.utcOffset()-this.utcOffset())*r,B=this-R,G=function(){return k.m(Y,R)};switch(g){case v:z=G()/12;break;case h:z=G();break;case y:z=G()/3;break;case f:z=(B-P)/6048e5;break;case d:z=(B-P)/864e5;break;case u:z=B/o;break;case a:z=B/r;break;case c:z=B/n;break;default:z=B}return E?z:k.a(z)},D.daysInMonth=function(){return this.endOf(h).$D},D.$locale=function(){return T[this.$L]},D.locale=function(C,_){if(!C)return this.$L;var E=this.clone(),z=V(C,_,!0);return z&&(E.$L=z),E},D.clone=function(){return k.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},A})(),X=H.prototype;return N.prototype=X,[["$ms",s],["$s",c],["$m",a],["$H",u],["$W",d],["$M",h],["$y",v],["$D",b]].forEach((function(A){X[A[1]]=function(D){return this.$g(D,A[0],A[1])}})),N.extend=function(A,D){return A.$i||(A(D,H,N),A.$i=!0),N},N.locale=V,N.isDayjs=L,N.unix=function(A){return N(1e3*A)},N.en=T[$],N.Ls=T,N.p={},N}))})(pt)),pt.exports}var _c=Mc();const Mt=Ct(_c);var gt={exports:{}},Oc=gt.exports,Hn;function kc(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(Oc,(function(){return function(n,r,o){n=n||{};var s=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 a(d,f,h,y){return s.fromToBase(d,f,h,y)}o.en.relativeTime=c,s.fromToBase=function(d,f,h,y,v){for(var b,m,x,w=h.$locale().relativeTime||c,M=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"}],j=M.length,O=0;O<j;O+=1){var $=M[O];$.d&&(b=y?o(d).diff(h,$.d,!0):h.diff(d,$.d,!0));var T=(n.rounding||Math.round)(Math.abs(b));if(x=b>0,T<=$.r||!$.r){T<=1&&O>0&&($=M[O-1]);var I=w[$.l];v&&(T=v(""+T)),m=typeof I=="string"?I.replace("%d",T):I(T,f,$.l,x);break}}if(f)return m;var L=x?w.future:w.past;return typeof L=="function"?L(m):L.replace("%s",m)},s.to=function(d,f){return a(d,f,this,!0)},s.from=function(d,f){return a(d,f,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)}}}))})(gt)),gt.exports}var $c=kc();const Ic=Ct($c);var vt={exports:{}},Ac=vt.exports,Wn;function Lc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Ac,(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 c=o.prototype,a=c.format;s.en.formats=n,c.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,f=(function(h,y){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,b,m){var x=m&&m.toUpperCase();return b||y[m]||n[m]||y[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,M,j){return M||j.slice(1)}))}))})(u,d===void 0?{}:d);return a.call(this,f)}}}))})(vt)),vt.exports}var Nc=Lc();const zc=Ct(Nc);var mt={exports:{}},Pc=mt.exports,Un;function Yc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Pc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(c){var a=this,u=this.$locale();if(!this.isValid())return s.bind(this)(c);var d=this.$utils(),f=(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(h){switch(h){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return u.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return u.ordinal(a.week(),"W");case"w":case"ww":return d.s(a.week(),h==="w"?1:2,"0");case"W":case"WW":return d.s(a.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return d.s(String(a.$H===0?24:a.$H),h==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return h}}));return s.bind(this)(f)}}}))})(mt)),mt.exports}var Fc=Yc();const Bc=Ct(Fc);Mt.extend(Ic);Mt.extend(zc);Mt.extend(Bc);const Vc={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=Mt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Vc[t]):r}function Hc({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:c="gray.700",dateFontSize:a="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:f="12px",timeFontWeight:h="400"}){return i.jsxs(l.Stack,{gap:.5,align:s,children:[i.jsx(l.Text,{fontSize:a,fontWeight:u,color:c,children:Jt({value:e,variant:t,format:r})}),i.jsx(l.Text,{fontSize:f,fontWeight:h,color:d,children:Jt({value:e,variant:n,format:o})})]})}exports.DataTable=na;exports.Filters=sc;exports.MDSButton=cc;exports.MDSCheckbox=Er;exports.MDSCombobox=mc;exports.MDSConfirmDeleteDialog=Ec;exports.MDSInput=Kt;exports.MDSRefreshButton=$r;exports.MDSSelectBox=Tr;exports.RefreshButton=$r;exports.StackedDateTime=Hc;exports.addPreset=_r;exports.deletePreset=Or;exports.formatDateTime=Jt;exports.getPresets=rt;exports.loadOrder=ac;exports.presetStore=Ze;exports.saveOrder=ic;exports.savePresets=Tt;exports.setActionsConfig=wr;exports.setData=yr;exports.setTableId=Sr;exports.tableStore=ie;exports.updatePreset=La;exports.withChildren=S;
package/dist/index.d.ts CHANGED
@@ -170,6 +170,8 @@ export declare interface IMDSComboboxTypes<T> {
170
170
  loading?: boolean;
171
171
  error?: boolean;
172
172
  placeholder?: string;
173
+ helpText?: string;
174
+ errorMessage?: string;
173
175
  itemToString: (item: T) => string;
174
176
  itemToValue: (item: T) => string;
175
177
  renderItem: (item: T) => React.ReactNode;
@@ -223,7 +225,7 @@ export declare const MDSButton: ({ onClick, size, variant, label, leftIcon, righ
223
225
 
224
226
  export declare const MDSCheckbox: ({ value, onChange, size, label, helperText, isDisabled, required, errorText, }: IMDSCheckboxTypes) => JSX_2.Element;
225
227
 
226
- export declare function MDSCombobox<T>({ label, size, width, variant, items, itemToString, itemToValue, renderItem, loading, error, placeholder, onInputChange, onSelect, rootProps, inputProps, controlProps, contentProps, itemProps, }: IMDSComboboxTypes<T>): JSX_2.Element;
228
+ export declare function MDSCombobox<T>({ label, size, width, variant, items, itemToString, itemToValue, renderItem, loading, error, errorMessage, placeholder, helpText, onInputChange, onSelect, rootProps, inputProps, controlProps, contentProps, itemProps, }: IMDSComboboxTypes<T>): JSX_2.Element;
227
229
 
228
230
  export declare function MDSConfirmDeleteDialog({ open, onClose, onConfirm, title, entityName, confirmText, confirmLabel, isLoading, }: ConfirmDeleteDialogProps): JSX_2.Element;
229
231
 
@@ -264,7 +266,7 @@ export declare function setTableId(tableId: string): void;
264
266
 
265
267
  export declare type SortOrder = 'asc' | 'desc';
266
268
 
267
- export declare function StackedDateTime({ value, dateVariant, timeVariant, dateFormat, timeFormat, align, }: StackedDateTimeProps): JSX_2.Element;
269
+ export declare function StackedDateTime({ value, dateVariant, timeVariant, dateFormat, timeFormat, align, dateColor, dateFontSize, dateFontWeight, timeColor, timeFontSize, timeFontWeight, }: StackedDateTimeProps): JSX_2.Element;
268
270
 
269
271
  declare interface StackedDateTimeProps {
270
272
  value: string | Date | number | null | undefined;
@@ -273,6 +275,12 @@ declare interface StackedDateTimeProps {
273
275
  dateFormat?: string;
274
276
  timeFormat?: string;
275
277
  align?: 'start' | 'center' | 'end';
278
+ dateColor?: string;
279
+ dateFontSize?: string | number;
280
+ dateFontWeight?: string | number;
281
+ timeFontSize?: string | number;
282
+ timeFontWeight?: string | number;
283
+ timeColor?: string;
276
284
  }
277
285
 
278
286
  declare interface TableState {