@mdspl/mds-shared-ui 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),a=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 Vr(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var Ve={};var mn;function Hr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===k?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case x:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case E:return"Suspense";case I:return"SuspenseList";case A:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case m:return"Portal";case O:return v.displayName||"Context";case R:return(v._context.displayName||"Context")+".Consumer";case $:var j=v.render;return v=v.displayName,v||(v=j.displayName||j.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case N:return j=v.displayName||null,j!==null?j:e(v.type)||"Memo";case V:j=v._payload,v=v._init;try{return e(v(j))}catch{}}return null}function t(v){return""+v}function n(v){try{t(v);var j=!1}catch{j=!0}if(j){j=console;var P=j.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return P.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(v)}}function r(v){if(v===x)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===V)return"<...>";try{var j=e(v);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function o(){var v=H.A;return v===null?null:v.getOwner()}function s(){return Error("react-stack-top-frame")}function l(v){if(G.call(v,"key")){var j=Object.getOwnPropertyDescriptor(v,"key").get;if(j&&j.isReactWarning)return!1}return v.key!==void 0}function c(v,j){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)",j))}P.isReactWarning=!0,Object.defineProperty(v,"key",{get:P,configurable:!0})}function u(){var v=e(this.type);return _[v]||(_[v]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),v=this.props.ref,v!==void 0?v:null}function d(v,j,P,B,q,X){var W=P.ref;return v={$$typeof:b,type:v,key:j,props:P,_owner:B},(W!==void 0?W:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:u}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function h(v,j,P,B,q,X){var W=j.children;if(W!==void 0)if(B)if(L(W)){for(B=0;B<W.length;B++)f(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 f(W);if(G.call(j,"key")){W=e(v);var K=Object.keys(j).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:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),a=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 Hr(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var He={};var mn;function Vr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===k?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case x:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case T:return"Suspense";case I:return"SuspenseList";case A:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case m:return"Portal";case O:return v.displayName||"Context";case R:return(v._context.displayName||"Context")+".Consumer";case $:var j=v.render;return v=v.displayName,v||(v=j.displayName||j.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case N:return j=v.displayName||null,j!==null?j:e(v.type)||"Memo";case H:j=v._payload,v=v._init;try{return e(v(j))}catch{}}return null}function t(v){return""+v}function n(v){try{t(v);var j=!1}catch{j=!0}if(j){j=console;var P=j.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return P.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),t(v)}}function r(v){if(v===x)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===H)return"<...>";try{var j=e(v);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function o(){var v=V.A;return v===null?null:v.getOwner()}function s(){return Error("react-stack-top-frame")}function l(v){if(G.call(v,"key")){var j=Object.getOwnPropertyDescriptor(v,"key").get;if(j&&j.isReactWarning)return!1}return v.key!==void 0}function c(v,j){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)",j))}P.isReactWarning=!0,Object.defineProperty(v,"key",{get:P,configurable:!0})}function u(){var v=e(this.type);return _[v]||(_[v]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),v=this.props.ref,v!==void 0?v:null}function d(v,j,P,B,q,X){var W=P.ref;return v={$$typeof:b,type:v,key:j,props:P,_owner:B},(W!==void 0?W:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:u}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function h(v,j,P,B,q,X){var W=j.children;if(W!==void 0)if(B)if(L(W)){for(B=0;B<W.length;B++)f(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 f(W);if(G.call(j,"key")){W=e(v);var K=Object.keys(j).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,W,K,W),Y[W+B]=!0)}if(W=null,P!==void 0&&(n(P),W=""+P),l(j)&&(n(j.key),W=""+j.key),"key"in j){P={};for(var J in j)J!=="key"&&(P[J]=j[J])}else P=j;return W&&c(P,typeof v=="function"?v.displayName||v.name||"Unknown":v),d(v,W,P,o(),q,X)}function f(v){S(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===V&&(v._payload.status==="fulfilled"?S(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function S(v){return typeof v=="object"&&v!==null&&v.$$typeof===b}var p=g,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"),R=Symbol.for("react.consumer"),O=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),H=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,L=Array.isArray,D=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(v){return v()}};var C,_={},T=p.react_stack_bottom_frame.bind(p,s)(),z=D(r(s)),Y={};Ve.Fragment=x,Ve.jsx=function(v,j,P){var B=1e4>H.recentlyCreatedOwnerStacks++;return h(v,j,P,!1,B?Error("react-stack-top-frame"):T,B?D(r(v)):z)},Ve.jsxs=function(v,j,P){var B=1e4>H.recentlyCreatedOwnerStacks++;return h(v,j,P,!0,B?Error("react-stack-top-frame"):T,B?D(r(v)):z)}})()),Ve}var bn;function Wr(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Vr():it.exports=Hr()),it.exports}var i=Wr();function Ur(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.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?g.useLayoutEffect:g.useEffect;function en(e){const t=g.useRef(e);return be(()=>{t.current=e}),g.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 Gr(){const e=g.useRef(null),t=g.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function et(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=en(e),n=g.useRef(null),r=g.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Ht(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let $t={};function tt(e,t){return g.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,l)=>{const c=Object.entries(l);for(const[u,d]of c){const h=s[u];h!=null&&(s[u]=h+e*d)}return s},{...t})}}const $e=qn(1),xt=qn(-1);function qr(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 Xr(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(Xr(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 qr(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 Kr(e){return e.matches(xn)?e:e.querySelector(xn)}const Jr={display:"none"};function Zr(e){let{id:t,value:n}=e;return g.createElement("div",{id:t,style:Jr},n)}function Qr(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 g.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function eo(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Xn=g.createContext(null);function to(e){const t=g.useContext(Xn);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function no(){const[e]=g.useState(()=>new Set),t=g.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[g.useCallback(r=>{let{type:o,event:s}=r;e.forEach(l=>{var c;return(c=l[o])==null?void 0:c.call(l,s)})},[e]),t]}const ro={draggable:`
6
+ <%s key={someKey} {...props} />`,B,W,K,W),Y[W+B]=!0)}if(W=null,P!==void 0&&(n(P),W=""+P),l(j)&&(n(j.key),W=""+j.key),"key"in j){P={};for(var J in j)J!=="key"&&(P[J]=j[J])}else P=j;return W&&c(P,typeof v=="function"?v.displayName||v.name||"Unknown":v),d(v,W,P,o(),q,X)}function f(v){y(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===H&&(v._payload.status==="fulfilled"?y(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function y(v){return typeof v=="object"&&v!==null&&v.$$typeof===b}var p=g,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"),R=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"),N=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),V=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,L=Array.isArray,D=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(v){return v()}};var C,_={},E=p.react_stack_bottom_frame.bind(p,s)(),z=D(r(s)),Y={};He.Fragment=x,He.jsx=function(v,j,P){var B=1e4>V.recentlyCreatedOwnerStacks++;return h(v,j,P,!1,B?Error("react-stack-top-frame"):E,B?D(r(v)):z)},He.jsxs=function(v,j,P){var B=1e4>V.recentlyCreatedOwnerStacks++;return h(v,j,P,!0,B?Error("react-stack-top-frame"):E,B?D(r(v)):z)}})()),He}var bn;function Wr(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Hr():it.exports=Vr()),it.exports}var i=Wr();function Ur(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.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?g.useLayoutEffect:g.useEffect;function en(e){const t=g.useRef(e);return be(()=>{t.current=e}),g.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 Gr(){const e=g.useRef(null),t=g.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function et(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=en(e),n=g.useRef(null),r=g.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Vt(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let $t={};function tt(e,t){return g.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,l)=>{const c=Object.entries(l);for(const[u,d]of c){const h=s[u];h!=null&&(s[u]=h+e*d)}return s},{...t})}}const $e=qn(1),xt=qn(-1);function qr(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 Xr(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(Xr(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 qr(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 Kr(e){return e.matches(xn)?e:e.querySelector(xn)}const Jr={display:"none"};function Zr(e){let{id:t,value:n}=e;return g.createElement("div",{id:t,style:Jr},n)}function Qr(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 g.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function eo(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Xn=g.createContext(null);function to(e){const t=g.useContext(Xn);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function no(){const[e]=g.useState(()=>new Set),t=g.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[g.useCallback(r=>{let{type:o,event:s}=r;e.forEach(l=>{var c;return(c=l[o])==null?void 0:c.call(l,s)})},[e]),t]}const ro={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
- `},oo={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 so(e){let{announcements:t=oo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ro}=e;const{announce:s,announcement:l}=eo(),c=tt("DndLiveRegion"),[u,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),to(g.useMemo(()=>({onDragStart(f){let{active:S}=f;s(t.onDragStart({active:S}))},onDragMove(f){let{active:S,over:p}=f;t.onDragMove&&s(t.onDragMove({active:S,over:p}))},onDragOver(f){let{active:S,over:p}=f;s(t.onDragOver({active:S,over:p}))},onDragEnd(f){let{active:S,over:p}=f;s(t.onDragEnd({active:S,over:p}))},onDragCancel(f){let{active:S,over:p}=f;s(t.onDragCancel({active:S,over:p}))}}),[s,t])),!u)return null;const h=g.createElement(g.Fragment,null,g.createElement(Zr,{id:r,value:o.draggable}),g.createElement(Qr,{id:c,announcement:l}));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 io(e,t){return g.useMemo(()=>({sensor:e,options:{}}),[e,t])}function ao(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function co(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function uo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function fo(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 l of r){const{id:c}=l,u=n.get(c);if(u){const d=co(yn(u),o);s.push({id:c,data:{droppableContainer:l,value:d}})}}return s.sort(lo)};function ho(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),l=o-r,c=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,h=l*c,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const go=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=ho(c,t);u>0&&o.push({id:l,data:{droppableContainer:s,value:u}})}}return o.sort(uo)};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}:pe}function vo(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((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const mo=vo(1);function bo(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 xo(e,t,n){const r=bo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:l,y:c}=r,u=e.left-l-(1-o)*parseFloat(n),d=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const yo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=yo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=ae(e).getComputedStyle(e);d&&(n=xo(n,d,h))}const{top:r,left:o,width:s,height:l,bottom:c,right:u}=n;return{top:r,left:o,width:s,height:l,bottom:c,right:u}}function Sn(e){return Ne(e,{ignoreTransform:!0})}function So(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wo(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Co(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&&Co(o,s)&&n.push(o),wo(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,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const Do={x:.2,y:.2};function jo(e,t,n,r,o){let{top:s,left:l,right:c,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Do);const{isTop:d,isBottom:h,isLeft:f,isRight:S}=nr(e),p={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?(p.y=ee.Backward,b.y=r*Math.abs((t.top+m.height-s)/m.height)):!h&&u>=t.bottom-m.height&&(p.y=ee.Forward,b.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!S&&c>=t.right-m.width?(p.x=ee.Forward,b.x=r*Math.abs((t.right-m.width-c)/m.width)):!f&&l<=t.left+m.width&&(p.x=ee.Backward,b.x=r*Math.abs((t.left+m.width-l)/m.width)),{direction:p,speed:b}}function Ro(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:l}=window;return{top:0,left:0,right:s,bottom:l,width:s,height:l}}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)),pe)}function To(e){return e.reduce((t,n)=>t+Qn(n),0)}function Eo(e){return e.reduce((t,n)=>t+er(n),0)}function Mo(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 _o=[["x",["left","right"],To],["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,l,c]of _o)for(const u of l)Object.defineProperty(this,u,{get:()=>{const d=c(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 Oo(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 ko(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]},$o=(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&&Mo(r),n(pe)}handleKeyDown(t){if(tn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=or,coordinateGetter:l=$o,scrollBehavior:c="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}:pe;this.referenceCoordinates||(this.referenceCoordinates=h);const f=l(t,{active:n,context:r.current,currentCoordinates:h});if(f){const S=xt(f,h),p={x:0,y:0},{scrollableAncestors:b}=r.current;for(const m of b){const x=t.code,{isTop:w,isRight:M,isLeft:R,isBottom:O,maxScroll:$,minScroll:E}=nr(m),I=Ro(m),N={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,f.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,f.y))},V=x===U.Right&&!M||x===U.Left&&!R,A=x===U.Down&&!O||x===U.Up&&!w;if(V&&N.x!==f.x){const k=m.scrollLeft+S.x,H=x===U.Right&&k<=$.x||x===U.Left&&k>=E.x;if(H&&!S.y){m.scrollTo({left:k,behavior:c});return}H?p.x=m.scrollLeft-k:p.x=x===U.Right?m.scrollLeft-$.x:m.scrollLeft-E.x,p.x&&m.scrollBy({left:-p.x,behavior:c});break}else if(A&&N.y!==f.y){const k=m.scrollTop+S.y,H=x===U.Down&&k<=$.y||x===U.Up&&k>=E.y;if(H&&!S.x){m.scrollTo({top:k,behavior:c});return}H?p.y=m.scrollTop-k:p.y=x===U.Down?m.scrollTop-$.y:m.scrollTop-E.y,p.y&&m.scrollBy({top:-p.y,behavior:c});break}}this.handleMove(t,$e(xt(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=or,onActivation:o}=t,{active:s}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=s.activatorNode.current;return c&&e.target!==c?!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=Oo(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:l}=s;this.props=t,this.events=n,this.document=Le(l),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(l)),this.initialCoordinates=(o=Wt(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,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,ko,{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:l,options:{activationConstraint:c}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:pe,d=xt(o,u);if(!r&&c){if(Cn(c)){if(c.tolerance!=null&&At(d,c.tolerance))return this.handleCancel();if(At(d,c.distance))return this.handleStart()}if(Dn(c)&&At(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(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 Io={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,Io,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 Ao={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Lo extends on{constructor(t){super(t,Ao,Le(t.event.target))}}Lo.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 No 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(){}}}No.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 zo(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:l=5,order:c=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:S}=e;const p=Yo({delta:f,disabled:!s}),[b,m]=Gr(),x=g.useRef({x:0,y:0}),w=g.useRef({x:0,y:0}),M=g.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]),R=g.useRef(null),O=g.useCallback(()=>{const E=R.current;if(!E)return;const I=x.current.x*w.current.x,N=x.current.y*w.current.y;E.scrollBy(I,N)},[]),$=g.useMemo(()=>c===St.TreeOrder?[...d].reverse():d,[c,d]);g.useEffect(()=>{if(!s||!d.length||!M){m();return}for(const E of $){if(r?.(E)===!1)continue;const I=d.indexOf(E),N=h[I];if(!N)continue;const{direction:V,speed:A}=jo(E,N,M,t,S);for(const k of["x","y"])p[k][V[k]]||(A[k]=0,V[k]=0);if(A.x>0||A.y>0){m(),R.current=E,b(O,l),x.current=A,w.current=V;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,O,r,m,s,l,JSON.stringify(M),JSON.stringify(p),b,d,$,h,JSON.stringify(S)])}const Po={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function Yo(e){let{delta:t,disabled:n}=e;const r=Ht(t);return et(o=>{if(n||!r||!o)return Po;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 Fo(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 Bo(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(l=>({eventName:l.eventName,handler:t(l.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 jn=new Map;function Vo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,l]=g.useState(null),{frequency:c,measure:u,strategy:d}=o,h=g.useRef(e),f=x(),S=Ke(f),p=g.useCallback(function(w){w===void 0&&(w=[]),!S.current&&l(M=>M===null?w:M.concat(w.filter(R=>!M.includes(R))))},[S]),b=g.useRef(null),m=et(w=>{if(f&&!n)return jn;if(!w||w===jn||h.current!==e||s!=null){const M=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){M.set(R.id,R.rect.current);continue}const O=R.node.current,$=O?new rn(u(O),O):null;R.rect.current=$,$&&M.set(R.id,$)}return M}return w},[e,s,n,f,u]);return g.useEffect(()=>{h.current=e},[e]),g.useEffect(()=>{f||p()},[n,f]),g.useEffect(()=>{s&&s.length>0&&l(null)},[JSON.stringify(s)]),g.useEffect(()=>{f||typeof c!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null},c))},[c,f,p,...r]),{droppableRects:m,measureDroppableContainers:p,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 Ho(e,t){return ir(e,t)}function Wo(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function jt(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function Uo(e){return new rn(Ne(e),e)}function Rn(e,t,n){t===void 0&&(t=Uo);const[r,o]=g.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 l=Wo({callback(u){if(e)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),c=jt({callback:s});return be(()=>{s(),e?(c?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),l?.disconnect())},[e]),r}function Go(e){const t=ir(e);return Jn(e,t)}const Tn=[];function qo(e){const t=g.useRef(e),n=et(r=>e?r&&r!==Tn&&e&&t.current&&e.parentNode===t.current.parentNode?r:nn(e):Tn,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function Xo(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(s=>{const l=It(s.target);l&&n(c=>c?(c.set(l,Ut(l)),new Map(c)):null)},[]);return g.useEffect(()=>{const s=r.current;if(e!==s){l(s);const c=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(s)};function l(c){c.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,l)=>$e(s,l),pe):rr(e):pe,[e,t])}function En(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):pe}function Ko(e){g.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 Jo(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=l=>{s(l,t)},n},{}),[e,t])}function ar(e){return g.useMemo(()=>e?So(e):null,[e])}const Mn=[];function Zo(e,t){t===void 0&&(t=Ne);const[n]=e,r=ar(n?ae(n):null),[o,s]=g.useState(Mn);function l(){s(()=>e.length?e.map(u=>tr(u)?r:new rn(t(u),u)):Mn)}const c=jt({callback:l});return be(()=>{c?.disconnect(),l(),e.forEach(u=>c?.observe(u))},[e]),o}function Qo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function es(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(d=>{for(const{target:h}of d)if(Qe(h)){r(f=>{const S=t(h);return f?{...f,width:S.width,height:S.height}:S});break}},[t]),s=jt({callback:o}),l=g.useCallback(d=>{const h=Qo(d);s?.disconnect(),h&&s?.observe(h),r(h?t(h):null)},[t,s]),[c,u]=bt(l);return g.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const ts=[{sensor:sn,options:{}},{sensor:sr,options:{}}],ns={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 rs={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},os={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=g.createContext(os),cr=g.createContext(rs);function ss(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function is(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 l=new Xe(e.droppable.containers);return l.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}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 as(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(Rt),s=Ht(r),l=Ht(n?.id);return g.useEffect(()=>{if(!t&&!r&&s&&l!=null){if(!tn(s)||document.activeElement===s.target)return;const c=o.get(l);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=Kr(h);if(f){f.focus();break}}})}},[r,t,o,l,s]),null}function cs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ls(e){return g.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function us(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=g.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!l&&!c||!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),f=Jn(h,r);if(l||(f.x=0),c||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const S=Zn(d);S&&S.scrollBy({top:f.y,left:f.x})}},[t,l,c,r,n])}const lr=g.createContext({...pe,scaleX:1,scaleY:1});var Re;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Re||(Re={}));const ur=g.memo(function(t){var n,r,o,s;let{id:l,accessibility:c,autoScroll:u=!0,children:d,sensors:h=ts,collisionDetection:f=go,measuring:S,modifiers:p,...b}=t;const m=g.useReducer(is,void 0,ss),[x,w]=m,[M,R]=no(),[O,$]=g.useState(Re.Uninitialized),E=O===Re.Initialized,{draggable:{active:I,nodes:N,translate:V},droppable:{containers:A}}=x,k=I!=null?N.get(I):null,H=g.useRef({initial:null,translated:null}),G=g.useMemo(()=>{var re;return I!=null?{id:I,data:(re=k?.data)!=null?re:ns,rect:H}:null},[I,k]),L=g.useRef(null),[D,C]=g.useState(null),[_,T]=g.useState(null),z=Ke(b,Object.values(b)),Y=tt("DndDescribedBy",l),v=g.useMemo(()=>A.getEnabled(),[A]),j=ls(S),{droppableRects:P,measureDroppableContainers:B,measuringScheduled:q}=Vo(v,{dragging:E,dependencies:[V.x,V.y],config:j.droppable}),X=Fo(N,I),W=g.useMemo(()=>_?Wt(_):null,[_]),K=Br(),J=Ho(X,j.draggable.measure);us({activeNode:I!=null?N.get(I):null,config:K.layoutShiftCompensation,initialRect:J,measure:j.draggable.measure});const F=Rn(X,j.draggable.measure,J),se=Rn(X?X.parentElement:null),ne=g.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=A.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=es({measure:j.dragOverlay.measure}),Ee=(r=xe.nodeRef.current)!=null?r:X,Me=E?(o=xe.rect)!=null?o:F:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=Go(cn?null:F),_t=ar(Ee?ae(Ee):null),Se=qo(E?he??X:null),ot=Zo(Se),st=cs(p,{transform:{x:V.x-ln.x,y:V.y-ln.y,scaleX:1,scaleY:1},activatorEvent:_,active:G,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=Xo(Se),Ar=En(dn),Lr=En(dn,[F]),_e=$e(st,Ar),Oe=Me?mo(Me,st):null,ze=G&&Oe?f({active:G,collisionRect:Oe,droppableRects:P,droppableContainers:v,pointerCoordinates:un}):null,fn=fo(ze,"id"),[we,hn]=g.useState(null),Nr=cn?st:$e(st,Lr),zr=po(Nr,(s=we?.rect)!=null?s:null,F),Ot=g.useRef(null),gn=g.useCallback((re,ce)=>{let{sensor:le,options:Ce}=ce;if(L.current==null)return;const de=N.get(L.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:L.current,activeNode:de,event:ue,options:Ce,context:ne,onAbort(te){if(!N.get(te))return;const{onDragAbort:me}=z.current,ye={id:te};me?.(ye),M({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!N.get(te))return;const{onDragPending:Ye}=z.current,je={id:te,constraint:De,initialCoordinates:me,offset:ye};Ye?.(je),M({type:"onDragPending",event:je})},onStart(te){const De=L.current;if(De==null)return;const me=N.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),$(Re.Initializing),w({type:Q.DragStart,initialCoordinates:te,active:De}),M({type:"onDragStart",event:Pe}),C(Ot.current),T(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 je=null;if(me&&Ye){const{cancelDrop:Fe}=z.current;je={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Q.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(je))&&(te=Q.DragCancel)}L.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),$(Re.Uninitialized),hn(null),C(null),T(null),Ot.current=null;const Fe=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(je){const kt=z.current[Fe];kt?.(je),M({type:Fe,event:je})}})}}},[N]),Pr=g.useCallback((re,ce)=>(le,Ce)=>{const de=le.nativeEvent,ue=N.get(Ce);if(L.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},L.current=Ce,gn(le,ce))},[N,gn]),pn=Bo(h,Pr);Ko(h),be(()=>{F&&O===Re.Initializing&&$(Re.Initialized)},[F,O]),g.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]),g.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:Ce,scrollAdjustedTranslate:de}=ne.current;if(!re||L.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:G,activeNode:X,collisionRect:Oe,collisions:ze,droppableRects:P,draggableNodes:N,draggingNode:Ee,draggingNodeRect:Me,droppableContainers:A,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},H.current={initial:Me,translated:Oe}},[G,X,ze,Oe,N,Ee,Me,P,A,we,Se,_e]),zo({...K,delta:V,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:ot});const Yr=g.useMemo(()=>({active:G,activeNode:X,activeNodeRect:F,activatorEvent:_,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:N,droppableContainers:A,droppableRects:P,over:we,measureDroppableContainers:B,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:j,measuringScheduled:q,windowRect:_t}),[G,X,F,_,ze,se,xe,N,A,P,we,B,Se,ot,j,q,_t]),Fr=g.useMemo(()=>({activatorEvent:_,activators:pn,active:G,activeNodeRect:F,ariaDescribedById:{draggable:Y},dispatch:w,draggableNodes:N,over:we,measureDroppableContainers:B}),[_,pn,G,F,w,Y,N,we,B]);return g.createElement(Xn.Provider,{value:R},g.createElement(Rt.Provider,{value:Fr},g.createElement(cr.Provider,{value:Yr},g.createElement(lr.Provider,{value:zr},d)),g.createElement(as,{disabled:c?.restoreFocus===!1})),g.createElement(so,{...c,hiddenTextDescribedById:Y}));function Br(){const re=D?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=E&&!re&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),ds=g.createContext(null),_n="button",fs="Draggable";function hs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(fs),{activators:l,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:S}=g.useContext(Rt),{role:p=_n,roleDescription:b="draggable",tabIndex:m=0}=o??{},x=u?.id===t,w=g.useContext(x?lr:ds),[M,R]=bt(),[O,$]=bt(),E=Jo(l,t),I=Ke(n);be(()=>(f.set(t,{id:t,key:s,node:M,activatorNode:O,data:I}),()=>{const V=f.get(t);V&&V.key===s&&f.delete(t)}),[f,t]);const N=g.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&p===_n?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[r,p,m,x,b,h.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:N,isDragging:x,listeners:r?void 0:E,node:M,over:S,setNodeRef:R,setActivatorNodeRef:$,transform:w}}function gs(){return g.useContext(cr)}const ps="Droppable",vs={timeout:25};function ms(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(ps),{active:l,dispatch:c,over:u,measureDroppableContainers:d}=g.useContext(Rt),h=g.useRef({disabled:n}),f=g.useRef(!1),S=g.useRef(null),p=g.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:x}={...vs,...o},w=Ke(m??r),M=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),p.current=null},x)},[x]),R=jt({callback:M,disabled:b||!l}),O=g.useCallback((N,V)=>{R&&(V&&(R.unobserve(V),f.current=!1),N&&R.observe(N))},[R]),[$,E]=bt(O),I=Ke(t);return g.useEffect(()=>{!R||!$.current||(R.disconnect(),f.current=!1,R.observe($.current))},[$,R]),g.useEffect(()=>(c({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:S,data:I}}),()=>c({type:Q.UnregisterDroppable,key:s,id:r})),[r]),g.useEffect(()=>{n!==h.current.disabled&&(c({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,c]),{active:l,rect:S,isOver:u?.id===r,node:$,over:u,setNodeRef:E}}function Tt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function bs(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 xs(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 ys(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},Ss=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:l}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const u=ws(n,l,o);if(l===o){const d=n[s];return d?{x:o<s?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...ct}:null}return l>o&&l<=s?{x:-c.width-u,y:0,...ct}:l<o&&l>=s?{x:c.width+u,y:0,...ct}:{x:0,y:0,...ct}};function ws(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=Tt(t,r,n),l=t[o],c=s[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},lt={scaleX:1,scaleY:1},Cs=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:l}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const d=s[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...lt}:null}const u=Ds(s,o,n);return o>n&&o<=l?{x:0,y:-c.height-u,...lt}:o<n&&o>=l?{x:0,y:c.height+u,...lt}:{x:0,y:0,...lt}};function Ds(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=g.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function gr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:s=!1}=e;const{active:l,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:h}=gs(),f=tt(fr,n),S=c.rect!==null,p=g.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),b=l!=null,m=l?p.indexOf(l.id):-1,x=d?p.indexOf(d.id):-1,w=g.useRef(p),M=!xs(p,w.current),R=x!==-1&&m===-1||M,O=ys(s);be(()=>{M&&b&&h(p)},[M,p,b,h]),g.useEffect(()=>{w.current=p},[p]);const $=g.useMemo(()=>({activeIndex:m,containerId:f,disabled:O,disableTransforms:R,items:p,overIndex:x,useDragOverlay:S,sortedRects:bs(p,u),strategy:o}),[m,f,O.draggable,O.droppable,R,p,x,u,S,o]);return g.createElement(hr.Provider,{value:$},t)}const js=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Tt(n,r,o).indexOf(t)},Rs=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:l,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==s&&o===l?!1:n?!0:l!==o&&t===u},Ts={duration:200,easing:"ease"},pr="transform",Es=Ie.Transition.toString({property:pr,duration:0,easing:"linear"}),Ms={roleDescription:"sortable"};function _s(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,l]=g.useState(null),c=g.useRef(n);return be(()=>{if(!t&&n!==c.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)&&l(h)}}n!==c.current&&(c.current=n)},[t,n,r,o]),g.useEffect(()=>{s&&l(null)},[s]),s}function vr(e){let{animateLayoutChanges:t=Rs,attributes:n,disabled:r,data:o,getNewIndex:s=js,id:l,strategy:c,resizeObserverConfig:u,transition:d=Ts}=e;const{items:h,containerId:f,activeIndex:S,disabled:p,disableTransforms:b,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:M}=g.useContext(hr),R=Os(r,p),O=h.indexOf(l),$=g.useMemo(()=>({sortable:{containerId:f,index:O,items:h},...o}),[f,o,O,h]),E=g.useMemo(()=>h.slice(h.indexOf(l)),[h,l]),{rect:I,node:N,isOver:V,setNodeRef:A}=ms({id:l,data:$,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...u}}),{active:k,activatorEvent:H,activeNodeRect:G,attributes:L,setNodeRef:D,listeners:C,isDragging:_,over:T,setActivatorNodeRef:z,transform:Y}=hs({id:l,data:$,attributes:{...Ms,...n},disabled:R.draggable}),v=Ur(A,D),j=!!k,P=j&&!b&&at(S)&&at(x),B=!w&&_,q=B&&P?Y:null,W=P?q??(c??M)({rects:m,activeNodeRect:G,activeIndex:S,overIndex:x,index:O}):null,K=at(S)&&at(x)?s({id:l,items:h,activeIndex:S,overIndex:x}):O,J=k?.id,F=g.useRef({activeId:J,items:h,newIndex:K,containerId:f}),se=h!==F.current.items,ne=t({active:k,containerId:f,isDragging:_,isSorting:j,id:l,index:O,items:h,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=_s({disabled:!ne,index:O,node:N,rect:I});return g.useEffect(()=>{j&&F.current.newIndex!==K&&(F.current.newIndex=K),f!==F.current.containerId&&(F.current.containerId=f),h!==F.current.items&&(F.current.items=h)},[j,K,f,h]),g.useEffect(()=>{if(J===F.current.activeId)return;if(J!=null&&F.current.activeId==null){F.current.activeId=J;return}const Ee=setTimeout(()=>{F.current.activeId=J},50);return()=>clearTimeout(Ee)},[J]),{active:k,activeIndex:S,attributes:L,data:$,rect:I,index:O,newIndex:K,items:h,isOver:V,isSorting:j,isDragging:_,listeners:C,node:N,overIndex:x,over:T,setNodeRef:v,setActivatorNodeRef:z,setDroppableNodeRef:A,setDraggableNodeRef:D,transform:he??W,transition:xe()};function xe(){if(he||se&&F.current.newIndex===O)return Es;if(!(B&&!tn(H)||!d)&&(j||ne))return Ie.Transition.toString({...d,property:pr})}}function Os(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 ks(){if(On)return zt;On=1;var e=g;function t(f,S){return f===S&&(f!==0||1/f===1/S)||f!==f&&S!==S}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(f,S){var p=S(),b=r({inst:{value:p,getSnapshot:S}}),m=b[0].inst,x=b[1];return s(function(){m.value=p,m.getSnapshot=S,u(m)&&x({inst:m})},[f,p,S]),o(function(){return u(m)&&x({inst:m}),f(function(){u(m)&&x({inst:m})})},[f]),l(p),p}function u(f){var S=f.getSnapshot;f=f.value;try{var p=S();return!n(f,p)}catch{return!0}}function d(f,S){return S()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return zt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,zt}var Pt={};var kn;function $s(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}function t(p,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(!f){var x=b();s(m,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}x=l({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})},[p,m,b]),c(function(){return n(w)&&M({inst:w}),p(function(){n(w)&&M({inst:w})})},[p]),d(m),m}function n(p){var b=p.getSnapshot;p=p.value;try{var m=b();return!s(p,m)}catch{return!0}}function r(p,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=g,s=typeof Object.is=="function"?Object.is:e,l=o.useState,c=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,h=!1,f=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Pt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:S,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=ks():dt.exports=$s()),dt.exports}var In;function Is(){if(In)return Nt;In=1;var e=g,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,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Nt.useSyncExternalStoreWithSelector=function(d,h,f,S,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=c(function(){function w(E){if(!M){if(M=!0,R=E,E=S(E),p!==void 0&&m.hasValue){var I=m.value;if(p(I,E))return O=I}return O=E}if(I=O,r(R,E))return I;var N=S(E);return p!==void 0&&p(I,N)?(R=E,I):(R=E,O=N)}var M=!1,R,O,$=f===void 0?null:f;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,f,S,p]);var x=o(d,b[0],b[1]);return l(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},Nt}var Yt={};var An;function As(){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=g,n=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,u=t.useDebugValue;Yt.useSyncExternalStoreWithSelector=function(d,h,f,S,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=c(function(){function w(E){if(!M){if(M=!0,R=E,E=S(E),p!==void 0&&m.hasValue){var I=m.value;if(p(I,E))return O=I}return O=E}if(I=O,r(R,E))return I;var N=S(E);return p!==void 0&&p(I,N)?(R=E,I):(R=E,O=N)}var M=!1,R,O,$=f===void 0?null:f;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,f,S,p]);var x=o(d,b[0],b[1]);return l(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 Ls(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?ut.exports=Is():ut.exports=As()),ut.exports}var Ns=Ls();const Xt=new WeakMap,zs=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=zs.get(t);if(n)for(const r of n){const o=Xt.get(r);o?.length&&br(o)}}}function Ps(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ys(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Fs(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,Ps(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)Ys(o)}}}finally{Ft=!1,wt.current=[],Nn.clear()}}function Bs(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 l=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),l?.()}},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):Bs(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Fs(this)}}function nt(e,t=r=>r,n={}){const r=n.equal??Vs;return Ns.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Vs(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,l=JSON.parse(localStorage.getItem(Cr(s))||"[]"),c=[...l.map(h=>o.find(f=>f.id===h)).filter(Boolean),...o.filter(h=>!l.includes(h.id))],u=JSON.parse(localStorage.getItem(Dr(s))||"{}"),d=c.reduce((h,f)=>(h[f.id]=u[f.id]??!0,h),{});ie.setState(h=>({...h,data:e,columnOrder:c,visibility:d,sortableColumns:c.map(f=>({id:f.id,label:f.label,sortable:!0,backgroundColor:f.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}`,Hs=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 Ws(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Us=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 Gs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=qs(e);return t.charAt(0).toUpperCase()+t.slice(1)},jr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Xs=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ks={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 Js=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},u)=>g.createElement("svg",{ref:u,...Ks,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jr("lucide",o),...!s&&!Xs(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,h])=>g.createElement(d,h)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(Js,{ref:s,iconNode:t,className:jr(`lucide-${Gs(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Zs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=oe("arrow-down",Zs);const ei=[["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"}]],ti=oe("arrow-up-down",ei);const ni=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ri=oe("arrow-up",ni);const oi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],si=oe("bookmark",oi);const ii=[["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",ii);const ai=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ci=oe("chevron-left",ai);const li=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ui=oe("chevron-right",li);const di=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],fi=oe("columns-2",di);const hi=[["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"}]],gi=oe("delete",hi);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"}]],vi=oe("ellipsis",pi);const mi=[["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"}]],bi=oe("funnel",mi);const xi=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Rr=oe("grip-vertical",xi);const yi=[["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"}]],Si=oe("pen",yi);const wi=[["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"}]],Ci=oe("refresh-ccw",wi);const Di=[["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"}]],ji=oe("settings",Di);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"}]],Tr=oe("triangle-alert",Ri);function y(e){return g.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Ti=y(a.Menu.Trigger),Ei=y(a.Menu.Positioner),Mi=y(a.Menu.Content),_i=y(a.Menu.Item),Oi=y(a.Checkbox.Label),ki=y(a.Checkbox.HiddenInput),$i=y(a.Checkbox.Control);function Ii({visibility:e,onToggle:t}){const{sortableColumns:n}=nt(ie);return i.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ti,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(fi,{size:18})})}),i.jsx(a.Portal,{children:i.jsx(Ei,{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(a.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:l}){const{setNodeRef:c,attributes:u,listeners:d,transform:h,transition:f}=vr({id:e});return i.jsx(a.Table.ColumnHeader,{ref:c,onClick:n,backgroundColor:l,w:e==="id"||e==="row_number"?"80px":void 0,style:{transform:Ie.Transform.toString(h),transition:f,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(a.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Rr,{size:12})})]})})}function Li(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=nt(ie),l=e.map(c=>o.find(u=>u.id===c.id)).filter(c=>c!==void 0).filter(c=>t[c.id]);return i.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(a.Table.Row,{height:"28px",children:[l.map(c=>{const u=n===c?.id;return i.jsx(Ai,{id:c?.id,onClick:()=>c?.sortable&&Ws(c?.id),cursor:c?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:c?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[c?.label,c?.sortable&&(u?r==="asc"?i.jsx(ri,{size:14}):i.jsx(Qs,{size:14}):i.jsx(ti,{size:14,opacity:.4}))]})},c?.id)}),s?.showActionColumn&&i.jsx(a.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Ii,{visibility:t,onToggle:Us})})]})})}const Ni=[10,20,50,100],zi=y(a.Select.Positioner),Pi=y(a.Select.Content),Yi=y(a.Select.Item),Fi=y(a.Pagination.PrevTrigger),Bi=y(a.Pagination.NextTrigger),Vi=y(a.Select.HiddenSelect),Hi=y(a.Select.Control),Wi=y(a.Select.Trigger),Ui=y(a.Select.ValueText),Gi=y(a.Select.IndicatorGroup),qi=y(a.Select.Indicator);function Xi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:l=Ni}){const c=a.createListCollection({items:l.map(u=>({label:String(u),value:String(u)}))});return i.jsx(a.Box,{width:"100%",children:i.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(a.HStack,{children:[i.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(a.Select.Root,{collection:c,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(a.Portal,{children:i.jsx(zi,{children:i.jsx(Pi,{children:c.items.map(u=>i.jsxs(Yi,{item:u.value,children:[u.label,i.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]})]}),i.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Fi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Previous page",children:i.jsx(ci,{size:18})})}),i.jsx(a.Pagination.Items,{render:u=>i.jsx(a.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),i.jsx(Bi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Next page",children:i.jsx(ui,{size:18})})})]})})]})})}const Ki=y(a.Menu.Item),Ji=y(a.Menu.Content),Zi=y(a.Menu.Positioner),Qi=y(a.Menu.Trigger);function ea({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=nt(ie);return i.jsx(a.Table.Body,{children:e.map(o=>i.jsxs(a.Table.Row,{_hover:{bg:"blue.50"},children:[n.filter(s=>r[s.id]).map(s=>i.jsx(a.Table.Cell,{children:o[s.id]},s.id)),i.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(a.Menu.Root,{children:[i.jsx(Qi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(vi,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(Zi,{children:i.jsx(Ji,{children:t.filter(s=>typeof s.visible=="function"?s.visible(o.__raw):s.visible!==!1).map(s=>i.jsxs(Ki,{onClick:()=>s.onClick(o.__raw),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})}),i.jsx(a.Table.Cell,{})]},o.__key||o.id))})}function ta({rows:e=6,columns:t}){return i.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(a.Table.Cell,{children:i.jsx(a.Skeleton,{height:"25px"})},s))},r))})}function na({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:l="No data",actions:c,page:u=1,pageSize:d=10,onPageChange:h,onPageSizeChange:f,density:S="sm",totalCount:p=0,paginationMode:b="client",actionConfig:m,pageSizeOptions:x}){g.useEffect(()=>{Sr(e)},[e]),g.useEffect(()=>{yr(t,n)},[t,n]),g.useEffect(()=>{m&&wr(m)},[m]);const{sortColumn:w,sortDirection:M,data:R,columnOrder:O}=nt(ie),$=g.useMemo(()=>{const A=[...R],k=Math.max(1,u||1);if(w&&A.sort((H,G)=>M==="asc"?String(H[w]).localeCompare(String(G[w])):String(G[w]).localeCompare(String(H[w]))),b==="client"){const H=(k-1)*d;return A.slice(H,H+d)}return A},[R,w,M,u,d,b]);g.useEffect(()=>{u<1&&h&&h(1)},[u,h]);const E=A=>{const{active:k,over:H}=A;if(!H||k.id===H.id)return;const G=O.findIndex(C=>C.id===k.id),L=O.findIndex(C=>C.id===H.id),D=Tt(O,G,L);Hs(D)},I=r&&!s,N=s&&!r,V=!r&&!s&&$.length===0;return i.jsx(ur,{collisionDetection:Kn,onDragEnd:E,children:i.jsx(gr,{items:O.map(A=>A.id),strategy:Ss,children:i.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[I&&i.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(a.Spinner,{})}),i.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:S,children:[i.jsx(Li,{}),N?i.jsx(ta,{rows:d,columns:n.length+(c?2:0)}):V?i.jsx(a.Table.Body,{children:i.jsx(a.Table.Row,{children:i.jsx(a.Table.Cell,{colSpan:n.length+(c?1:0),children:i.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:l})})})}):i.jsx(ea,{data:$,actions:c})]})]}),i.jsx(a.Box,{mt:.5,children:i.jsx(Xi,{totalCount:p,pageSize:d,currentPage:u,onPageChange:h,onPageSizeChange:A=>{f?.(A),u>1&&h?.(1)},pageSizeOptions:x})})]})})})}const ra=y(a.Checkbox.Root),oa=y(a.Checkbox.HiddenInput),sa=y(a.Checkbox.Control),ia=y(a.Checkbox.Label),Er=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:l,errorText:c})=>i.jsxs(ra,{value:e,onChange:t,size:n,children:[i.jsx(oa,{}),i.jsx(sa,{disabled:s,required:l,errorText:c,helperText:o}),r&&i.jsx(ia,{children:r})]}),Z=" to ",Fn=10,Te={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>=Te.YEAR_MIN&&r<=Te.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,l=o.substring(0,s);return parseInt(l+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 l,c,u;return n.length===1?(l=parseInt(n[0])||s,c=o,u=r):n.length===2?(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=r):(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=ca(n[2],r)),c=Math.max(1,Math.min(Te.MONTH_MAX,c)),l=Math.max(1,Math.min(Te.DAY_MAX,l)),`${u}-${String(c).padStart(2,"0")}-${String(l).padStart(2,"0")}`},ge=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>Te.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Te.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<Te.YEAR_MIN||n>Te.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=y(a.Popover.Root),da=y(a.Popover.Trigger),fa=y(a.Popover.Content),ha=y(a.Popover.Positioner);function ga({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,l]=g.useState(()=>r&&o?`${ge(r)}${Z}${ge(o)}`:r?ge(r):""),[c,u]=g.useState(!1),d=g.useRef(null);g.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);l(m)},f=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(Z)){const[m,x=""]=b.split(Z).map(R=>R.trim()),w=He(m),M=x?He(x):null;if(w&&M){const[R,O]=M<w?[M,w]:[w,M],$=`${ge(R)}${Z}${ge(O)}`;l($),t(`${R}|${O}`)}else if(w&&!x)l(`${ge(w)}${Z}`),t(void 0);else if(w&&x){const R=aa(),[O,$]=R<w?[R,w]:[w,R],E=`${ge(O)}${Z}${ge($)}`;l(E),t(`${O}|${$}`)}else l(""),t(void 0)}else{const m=He(b);m?(l(`${ge(m)}${Z}`),t(void 0)):(l(""),t(void 0))}},S=b=>{if(b.key!=="Enter")return;b.preventDefault();const m=d.current?.selectionStart||0,x=s.indexOf(Z);if(!s.trim()){l(`${Bn()}${Z}`);return}if(x===-1){const M=He(s.trim());M&&l(`${ge(M)}${Z}`);return}if(m<=x+Z.length){const M=s.substring(0,x).trim(),R=s.substring(x+Z.length),O=He(M);O&&l(`${ge(O)}${Z}${R}`);return}if(s.substring(x+Z.length).trim())f(),d.current?.blur();else{const M=s.substring(0,x+Z.length)+Bn();l(M),setTimeout(()=>{f(),d.current?.blur()},0)}},p=()=>{l(""),t(void 0)};return i.jsx(a.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(a.InputElement,{position:"revert",children:[i.jsxs(ua,{open:c,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(da,{asChild:!0,children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(ha,{children:i.jsxs(fa,{p:4,children:[i.jsx(a.PopoverArrow,{}),i.jsxs(a.VStack,{align:"start",gap:4,children:[i.jsxs(a.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(a.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(a.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(a.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(a.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(a.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(a.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(a.HStack,{children:[i.jsx(a.Kbd,{children:"Ctrl"}),i.jsx(a.Text,{children:"+"}),i.jsx(a.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(a.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>h(b.target.value),onBlur:f,onKeyDown:S,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(a.InputElement,{children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:p,w:"100%"})})]})})})}const pa=y(a.Field.Root),va=y(a.Field.Label),ma=y(a.Field.HelperText),ba=y(a.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:l="100%",label:c,helperText:u,isDisabled:d=!1,required:h=!1,errorText:f,visible:S})=>i.jsxs(pa,{width:l,children:[S&&i.jsx(va,{children:c}),i.jsx(a.InputGroup,{startElement:e,children:i.jsx(a.Input,{value:t,onChange:p=>n?.(p.target.value),placeholder:r,size:o,variant:s,disabled:d,required:h})}),f&&i.jsx(ba,{fontSize:"xs",children:f}),u&&i.jsx(ma,{fontSize:"xs",children:u})]}),xa=y(a.Field.Root),ya=y(a.Field.HelperText),Sa=y(a.Field.ErrorText),wa=y(a.Select.Root),Ca=y(a.Select.Label),Da=y(a.Select.Control),ja=y(a.Select.Trigger),Ra=y(a.Select.ValueText),Ta=y(a.Select.IndicatorGroup),Ea=y(a.Select.Indicator),Ma=y(a.Select.Content),_a=y(a.Select.Item),Oa=y(a.Select.ItemIndicator),ka=y(a.Select.HiddenSelect),$a=y(a.Select.Positioner),Mr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:l="100%",variant:c="outline",helperText:u,isDisabled:d,required:h,errorText:f,visible:S})=>{const p=a.createListCollection({items:e});return i.jsxs(xa,{disabled:d,required:h,children:[i.jsxs(wa,{collection:p,variant:c,size:s,width:l,value:n?[n]:[],onValueChange:b=>r?.(b.value[0]),children:[i.jsx(ka,{}),S&&i.jsx(Ca,{children:t}),i.jsxs(Da,{children:[i.jsx(ja,{children:i.jsx(Ra,{placeholder:o})}),i.jsx(Ta,{children:i.jsx(Ea,{})})]}),i.jsx($a,{children:i.jsx(Ma,{children:p.items.map(b=>i.jsxs(_a,{item:b,children:[b.label,i.jsx(Oa,{})]},b.value))})})]}),u&&i.jsx(ya,{children:u}),f&&i.jsx(Sa,{children:f})]})},_r=(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(_r(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},Et=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(_r(e),JSON.stringify(t))},Or=(e,t)=>{const n=[t,...rt(e)];Et(e,n)},kr=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);Et(e,n)},La=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);Et(e,r)},Na=y(a.Checkbox.Root),za=y(a.Checkbox.HiddenInput),Pa=y(a.Checkbox.Control),Ya=y(a.Slider.Root),Fa=y(a.Slider.Track),Ba=y(a.Slider.Range),Va=y(a.Slider.Thumbs),Ha=y(a.Slider.Control),Wa=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:l,transition:c}=vr({id:e.id}),u={transform:Ie.Transform.toString(l),transition:c};return i.jsxs(a.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Rr,{size:16}),i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(a.HStack,{justify:"space-between",children:[i.jsx(a.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(a.VStack,{align:"stretch",gap:1,children:[i.jsx(a.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=y(a.Drawer.Root),Ga=y(a.Drawer.Trigger),qa=y(a.Drawer.Backdrop),Xa=y(a.Drawer.Positioner),Ka=y(a.Drawer.Content),Ja=y(a.Drawer.Header),Za=y(a.Drawer.Title),Qa=y(a.Drawer.Body),ec=y(a.Drawer.Footer),tc=y(a.Drawer.CloseTrigger),nc=y(a.Tabs.Root),rc=y(a.Tabs.List),Bt=y(a.Tabs.Trigger),Vt=y(a.Tabs.Content),$r=(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(Mr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(ga,{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:l,activePresetName:c,onReorder:u,open:d,onOpenChange:h})=>{const S=nt(Ze)[s]??rt(s),p=()=>{const b=prompt("Preset name?");if(!b)return;const m=o.reduce((x,w)=>(x[w.id]=w.value,x),{});Or(s,{id:crypto.randomUUID(),name:b,date:new Date().toISOString(),values:m})};return i.jsx(a.HStack,{wrap:"wrap",children:i.jsxs(Ua,{size:e,open:d,onOpenChange:h,children:[i.jsx(Ga,{asChild:!0,children:i.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(bi,{size:16}),"Filters"]})}),i.jsxs(a.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(Si,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx(ji,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(si,{size:16}),"Presets"]})]}),i.jsx(Vt,{value:"view",children:o.filter(b=>b.visible).map(b=>i.jsx(a.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:$r(b,d)},b.id))}),i.jsx(Vt,{value:"settings",children:i.jsx(ur,{sensors:ao(io(sn)),collisionDetection:Kn,onDragEnd:({active:b,over:m})=>{if(!m||b.id===m.id)return;const x=o.findIndex(R=>R.id===b.id),w=o.findIndex(R=>R.id===m.id),M=Tt(o,x,w);u?.(M)},children:i.jsx(gr,{items:o.map(b=>b.id),strategy:Cs,children:o.map(b=>i.jsx(Wa,{filter:b,onVisibilityChange:t,onSizeChange:n},b.id))})})}),i.jsx(Vt,{value:"presets",children:i.jsxs(a.VStack,{align:"stretch",mb:3,children:[S.length===0&&i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),S.map(b=>i.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:c===b.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(a.VStack,{align:"start",gap:0,children:[i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:b.name}),i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(b.date).toLocaleDateString()})]}),i.jsxs(a.HStack,{children:[i.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const m=o.map(x=>({...x,value:b.values[x.id]??x.value}));l?.(m,b.name)},children:"Load"}),i.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>kr(s,b.id),children:i.jsx(gi,{size:14})})]})]},b.id)),i.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:p,children:"Save Current Filters"})]})})]})}),i.jsx(ec,{justify:"space-between",children:i.jsx(tc,{asChild:!0,children:i.jsx(a.CloseButton,{})})})]})})]})]})})},sc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,onLoadPreset:u,activePresetName:d,filterDrawerSize:h="sm"})=>{const[f,S]=g.useState(!1);return i.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(a.HStack,{gapX:1,children:[t.filter(p=>p.visible!==!1).map(p=>i.jsx(a.HStack,{flex:p.size??1,minW:`${(p.size??1)*100}px`,alignItems:"center",children:$r(p)},p.id)),i.jsx(oc,{filterDrawerSize:h,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:p=>{S(p.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:l,colorScheme:c,loading:u,loadingText:d,rounded:h,type:f="button"})=>i.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:l,colorPalette:c,loading:u,loadingText:d,rounded:h,type:f,children:i.jsxs(a.HStack,{gap:1,children:[o,r,s]})}),lc=y(a.Combobox.Root);y(a.Combobox.Label);const uc=y(a.Combobox.Control),dc=y(a.Combobox.Input),fc=y(a.Combobox.IndicatorGroup),hc=y(a.Combobox.ClearTrigger),gc=y(a.Combobox.Trigger),pc=y(a.Combobox.Positioner),vc=y(a.Combobox.Content);function mc({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:l,renderItem:c,value:u,loading:d,error:h,errorMessage:f,placeholder:S,helpText:p,onInputChange:b,onSelect:m,rootProps:x,inputProps:w,controlProps:M,contentProps:R,itemProps:O}){const[$,E]=g.useState(""),{collection:I,set:N}=a.useListCollection({initialItems:o,itemToString:s,itemToValue:l}),V=g.useMemo(()=>{if(!$)return o;const A=$.toLowerCase();return o.filter(k=>s(k).toLowerCase().includes(A))},[o,$,s]);return g.useEffect(()=>{N(V)},[V,N]),g.useEffect(()=>{u&&E(s(u))},[u,s]),i.jsxs(lc,{width:n,size:t,variant:r,collection:I,placeholder:S,onInputValueChange:A=>{b?.(A.inputValue),E(A.inputValue)},onValueChange:A=>{const k=A.value?.[0];if(!k)return;const H=I.items.find(G=>l(G)===k);H&&m?.(H)},positioning:{sameWidth:!1,placement:"bottom-start"},...x,children:[e&&i.jsx(a.Text,{fontSize:"sm",children:e}),i.jsxs(uc,{...M,children:[i.jsx(dc,{placeholder:S??"Type to search",...w}),i.jsxs(fc,{children:[i.jsx(hc,{}),i.jsx(gc,{})]})]}),i.jsx(pc,{children:i.jsxs(vc,{minW:"sm",...R,children:[d?i.jsxs(a.HStack,{p:"2",children:[i.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(a.Span,{children:"Loading..."})]}):h?i.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):I.items.map(A=>i.jsxs(a.Combobox.Item,{item:A,...O,children:[c(A),i.jsx(a.Combobox.ItemIndicator,{})]},l(A))),p&&!h&&!d&&i.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:p})]})})]})}const bc=y(a.Dialog.Root),xc=y(a.Dialog.Backdrop),yc=y(a.Dialog.Positioner),Sc=y(a.Dialog.Content),wc=y(a.Dialog.Header),Cc=y(a.Dialog.Body),Dc=y(a.Dialog.Footer),jc=y(a.Dialog.Title),Rc=y(a.Dialog.CloseTrigger);function Tc({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:s="Confirm",cancelLabel:l="Cancel",icon:c,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return i.jsx(bc,{open:e,placement:"center",onOpenChange:h=>!h.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(xc,{}),i.jsx(yc,{children:i.jsxs(Sc,{maxW:"480px",children:[i.jsx(wc,{borderBottom:"1px solid",borderColor:"gray.200",children:i.jsx(jc,{children:r})}),i.jsx(Cc,{p:6,children:i.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[i.jsx(a.Box,{color:"orange.500",children:c??i.jsx(Tr,{size:40})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),i.jsxs(Dc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:l}),i.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:s})]}),i.jsx(Rc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Ec=y(a.Dialog.Root),Mc=y(a.Dialog.Backdrop),_c=y(a.Dialog.Positioner),Oc=y(a.Dialog.Content),kc=y(a.Dialog.Header),$c=y(a.Dialog.Body),Ic=y(a.Dialog.Footer),Ac=y(a.Dialog.Title),Lc=y(a.Dialog.CloseTrigger);function Nc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:l="Delete",isLoading:c=!1}){const[u,d]=g.useState(""),h=u===s;return i.jsx(Ec,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(Mc,{}),i.jsx(_c,{children:i.jsxs(Oc,{maxW:"550px",children:[i.jsx(kc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Ac,{color:"red.600",children:r})}),i.jsx($c,{p:2,style:{padding:"16px"},children:i.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(a.Box,{color:"red.600",mt:"2px",children:i.jsx(Tr,{size:20})}),i.jsxs(a.Box,{children:[i.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(a.Box,{children:[i.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(a.Input,{placeholder:`Type ${s} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(Ic,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(a.Button,{size:"sm",disabled:!h,style:{backgroundColor:"#FF0000"},loading:c,onClick:n,children:l})]}),i.jsx(Lc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}function Ir({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=g.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Ci,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var gt={exports:{}},zc=gt.exports,Vn;function Pc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(zc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",c="minute",u="hour",d="day",h="week",f="month",S="quarter",p="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(L){var D=["th","st","nd","rd"],C=L%100;return"["+L+(D[(C-20)%10]||D[C]||D[0])+"]"}},R=function(L,D,C){var _=String(L);return!_||_.length>=D?L:""+Array(D+1-_.length).join(C)+L},O={s:R,z:function(L){var D=-L.utcOffset(),C=Math.abs(D),_=Math.floor(C/60),T=C%60;return(D<=0?"+":"-")+R(_,2,"0")+":"+R(T,2,"0")},m:function L(D,C){if(D.date()<C.date())return-L(C,D);var _=12*(C.year()-D.year())+(C.month()-D.month()),T=D.clone().add(_,f),z=C-T<0,Y=D.clone().add(_+(z?-1:1),f);return+(-(_+(C-T)/(z?T-Y:Y-T))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:p,w:h,d,D:b,h:u,m:c,s:l,ms:s,Q:S}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},$="en",E={};E[$]=M;var I="$isDayjsObject",N=function(L){return L instanceof H||!(!L||!L[I])},V=function L(D,C,_){var T;if(!D)return $;if(typeof D=="string"){var z=D.toLowerCase();E[z]&&(T=z),C&&(E[z]=C,T=z);var Y=D.split("-");if(!T&&Y.length>1)return L(Y[0])}else{var v=D.name;E[v]=D,T=v}return!_&&T&&($=T),T||!_&&$},A=function(L,D){if(N(L))return L.clone();var C=typeof D=="object"?D:{};return C.date=L,C.args=arguments,new H(C)},k=O;k.l=V,k.i=N,k.w=function(L,D){return A(L,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var H=(function(){function L(C){this.$L=V(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[I]=!0}var D=L.prototype;return D.parse=function(C){this.$d=(function(_){var T=_.date,z=_.utc;if(T===null)return new Date(NaN);if(k.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var Y=T.match(x);if(Y){var v=Y[2]-1||0,j=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)):new Date(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)}}return new Date(T)})(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 T=A(C);return this.startOf(_)<=T&&T<=this.endOf(_)},D.isAfter=function(C,_){return A(C)<this.startOf(_)},D.isBefore=function(C,_){return this.endOf(_)<A(C)},D.$g=function(C,_,T){return k.u(C)?this[_]:this.set(T,C)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(C,_){var T=this,z=!!k.u(_)||_,Y=k.p(C),v=function(J,F){var se=k.w(T.$u?Date.UTC(T.$y,F,J):new Date(T.$y,F,J),T);return z?se:se.endOf(d)},j=function(J,F){return k.w(T.toDate()[J].apply(T.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(F)),T)},P=this.$W,B=this.$M,q=this.$D,X="set"+(this.$u?"UTC":"");switch(Y){case p:return z?v(1,0):v(31,11);case f:return z?v(1,B):v(0,B+1);case h:var W=this.$locale().weekStart||0,K=(P<W?P+7:P)-W;return v(z?q-K:q+(6-K),B);case d:case b:return j(X+"Hours",0);case u:return j(X+"Minutes",1);case c:return j(X+"Seconds",2);case l:return j(X+"Milliseconds",3);default:return this.clone()}},D.endOf=function(C){return this.startOf(C,!1)},D.$set=function(C,_){var T,z=k.p(C),Y="set"+(this.$u?"UTC":""),v=(T={},T[d]=Y+"Date",T[b]=Y+"Date",T[f]=Y+"Month",T[p]=Y+"FullYear",T[u]=Y+"Hours",T[c]=Y+"Minutes",T[l]=Y+"Seconds",T[s]=Y+"Milliseconds",T)[z],j=z===d?this.$D+(_-this.$W):_;if(z===f||z===p){var P=this.clone().set(b,1);P.$d[v](j),P.init(),this.$d=P.set(b,Math.min(this.$D,P.daysInMonth())).$d}else v&&this.$d[v](j);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 T,z=this;C=Number(C);var Y=k.p(_),v=function(B){var q=A(z);return k.w(q.date(q.date()+Math.round(B*C)),z)};if(Y===f)return this.set(f,this.$M+C);if(Y===p)return this.set(p,this.$y+C);if(Y===d)return v(1);if(Y===h)return v(7);var j=(T={},T[c]=r,T[u]=o,T[l]=n,T)[Y]||1,P=this.$d.getTime()+C*j;return k.w(P,this)},D.subtract=function(C,_){return this.add(-1*C,_)},D.format=function(C){var _=this,T=this.$locale();if(!this.isValid())return T.invalidDate||m;var z=C||"YYYY-MM-DDTHH:mm:ssZ",Y=k.z(this),v=this.$H,j=this.$m,P=this.$M,B=T.weekdays,q=T.months,X=T.meridiem,W=function(F,se,ne,he){return F&&(F[se]||F(_,z))||ne[se].slice(0,he)},K=function(F){return k.s(v%12||12,F,"0")},J=X||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(T.monthsShort,P,q,3);case"MMMM":return W(q,P);case"D":return _.$D;case"DD":return k.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return W(T.weekdaysMin,_.$W,B,2);case"ddd":return W(T.weekdaysShort,_.$W,B,3);case"dddd":return B[_.$W];case"H":return String(v);case"HH":return k.s(v,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(v,j,!0);case"A":return J(v,j,!1);case"m":return String(j);case"mm":return k.s(j,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,_,T){var z,Y=this,v=k.p(_),j=A(C),P=(j.utcOffset()-this.utcOffset())*r,B=this-j,q=function(){return k.m(Y,j)};switch(v){case p:z=q()/12;break;case f:z=q();break;case S:z=q()/3;break;case h:z=(B-P)/6048e5;break;case d:z=(B-P)/864e5;break;case u:z=B/o;break;case c:z=B/r;break;case l:z=B/n;break;default:z=B}return T?z:k.a(z)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return E[this.$L]},D.locale=function(C,_){if(!C)return this.$L;var T=this.clone(),z=V(C,_,!0);return z&&(T.$L=z),T},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()},L})(),G=H.prototype;return A.prototype=G,[["$ms",s],["$s",l],["$m",c],["$H",u],["$W",d],["$M",f],["$y",p],["$D",b]].forEach((function(L){G[L[1]]=function(D){return this.$g(D,L[0],L[1])}})),A.extend=function(L,D){return L.$i||(L(D,H,A),L.$i=!0),A},A.locale=V,A.isDayjs=N,A.unix=function(L){return A(1e3*L)},A.en=E[$],A.Ls=E,A.p={},A}))})(gt)),gt.exports}var Yc=Pc();const Mt=Ct(Yc);var pt={exports:{}},Fc=pt.exports,Hn;function Bc(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(Fc,(function(){return function(n,r,o){n=n||{};var s=r.prototype,l={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 c(d,h,f,S){return s.fromToBase(d,h,f,S)}o.en.relativeTime=l,s.fromToBase=function(d,h,f,S,p){for(var b,m,x,w=f.$locale().relativeTime||l,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"}],R=M.length,O=0;O<R;O+=1){var $=M[O];$.d&&(b=S?o(d).diff(f,$.d,!0):f.diff(d,$.d,!0));var E=(n.rounding||Math.round)(Math.abs(b));if(x=b>0,E<=$.r||!$.r){E<=1&&O>0&&($=M[O-1]);var I=w[$.l];p&&(E=p(""+E)),m=typeof I=="string"?I.replace("%d",E):I(E,h,$.l,x);break}}if(h)return m;var N=x?w.future:w.past;return typeof N=="function"?N(m):N.replace("%s",m)},s.to=function(d,h){return c(d,h,this,!0)},s.from=function(d,h){return c(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)}}}))})(pt)),pt.exports}var Vc=Bc();const Hc=Ct(Vc);var vt={exports:{}},Wc=vt.exports,Wn;function Uc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Wc,(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 l=o.prototype,c=l.format;s.en.formats=n,l.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,h=(function(f,S){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,b,m){var x=m&&m.toUpperCase();return b||S[m]||n[m]||S[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,M,R){return M||R.slice(1)}))}))})(u,d===void 0?{}:d);return c.call(this,h)}}}))})(vt)),vt.exports}var Gc=Uc();const qc=Ct(Gc);var mt={exports:{}},Xc=mt.exports,Un;function Kc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Xc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(l){var c=this,u=this.$locale();if(!this.isValid())return s.bind(this)(l);var d=this.$utils(),h=(l||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return d.s(c.week(),f==="w"?1:2,"0");case"W":case"WW":return d.s(c.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return d.s(String(c.$H===0?24:c.$H),f==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return f}}));return s.bind(this)(h)}}}))})(mt)),mt.exports}var Jc=Kc();const Zc=Ct(Jc);Mt.extend(Hc);Mt.extend(qc);Mt.extend(Zc);const Qc={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??Qc[t]):r}function el({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:l="gray.700",dateFontSize:c="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:h="12px",timeFontWeight:f="400"}){return i.jsxs(a.Stack,{gap:.5,align:s,children:[i.jsx(a.Text,{fontSize:c,fontWeight:u,color:l,children:Jt({value:e,variant:t,format:r})}),i.jsx(a.Text,{fontSize:h,fontWeight:f,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.MDSConfirmActionDialog=Tc;exports.MDSConfirmDeleteDialog=Nc;exports.MDSInput=Kt;exports.MDSRefreshButton=Ir;exports.MDSSelectBox=Mr;exports.RefreshButton=Ir;exports.StackedDateTime=el;exports.addPreset=Or;exports.deletePreset=kr;exports.formatDateTime=Jt;exports.getPresets=rt;exports.loadOrder=ac;exports.presetStore=Ze;exports.saveOrder=ic;exports.savePresets=Et;exports.setActionsConfig=wr;exports.setData=yr;exports.setTableId=Sr;exports.tableStore=ie;exports.updatePreset=La;exports.withChildren=y;
10
+ `},oo={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 so(e){let{announcements:t=oo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ro}=e;const{announce:s,announcement:l}=eo(),c=tt("DndLiveRegion"),[u,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),to(g.useMemo(()=>({onDragStart(f){let{active:y}=f;s(t.onDragStart({active:y}))},onDragMove(f){let{active:y,over:p}=f;t.onDragMove&&s(t.onDragMove({active:y,over:p}))},onDragOver(f){let{active:y,over:p}=f;s(t.onDragOver({active:y,over:p}))},onDragEnd(f){let{active:y,over:p}=f;s(t.onDragEnd({active:y,over:p}))},onDragCancel(f){let{active:y,over:p}=f;s(t.onDragCancel({active:y,over:p}))}}),[s,t])),!u)return null;const h=g.createElement(g.Fragment,null,g.createElement(Zr,{id:r,value:o.draggable}),g.createElement(Qr,{id:c,announcement:l}));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 io(e,t){return g.useMemo(()=>({sensor:e,options:{}}),[e,t])}function ao(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function co(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function uo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function fo(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 l of r){const{id:c}=l,u=n.get(c);if(u){const d=co(yn(u),o);s.push({id:c,data:{droppableContainer:l,value:d}})}}return s.sort(lo)};function ho(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),l=o-r,c=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,h=l*c,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const go=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const u=ho(c,t);u>0&&o.push({id:l,data:{droppableContainer:s,value:u}})}}return o.sort(uo)};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}:pe}function vo(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((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const mo=vo(1);function bo(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 xo(e,t,n){const r=bo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:l,y:c}=r,u=e.left-l-(1-o)*parseFloat(n),d=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,f=s?e.height/s:e.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const yo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=yo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=ae(e).getComputedStyle(e);d&&(n=xo(n,d,h))}const{top:r,left:o,width:s,height:l,bottom:c,right:u}=n;return{top:r,left:o,width:s,height:l,bottom:c,right:u}}function Sn(e){return Ne(e,{ignoreTransform:!0})}function So(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wo(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Co(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&&Co(o,s)&&n.push(o),wo(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,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const Do={x:.2,y:.2};function jo(e,t,n,r,o){let{top:s,left:l,right:c,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Do);const{isTop:d,isBottom:h,isLeft:f,isRight:y}=nr(e),p={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?(p.y=ee.Backward,b.y=r*Math.abs((t.top+m.height-s)/m.height)):!h&&u>=t.bottom-m.height&&(p.y=ee.Forward,b.y=r*Math.abs((t.bottom-m.height-u)/m.height)),!y&&c>=t.right-m.width?(p.x=ee.Forward,b.x=r*Math.abs((t.right-m.width-c)/m.width)):!f&&l<=t.left+m.width&&(p.x=ee.Backward,b.x=r*Math.abs((t.left+m.width-l)/m.width)),{direction:p,speed:b}}function Ro(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:l}=window;return{top:0,left:0,right:s,bottom:l,width:s,height:l}}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)),pe)}function Eo(e){return e.reduce((t,n)=>t+Qn(n),0)}function To(e){return e.reduce((t,n)=>t+er(n),0)}function Mo(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 _o=[["x",["left","right"],Eo],["y",["top","bottom"],To]];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,l,c]of _o)for(const u of l)Object.defineProperty(this,u,{get:()=>{const d=c(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 Oo(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 ko(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]},$o=(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&&Mo(r),n(pe)}handleKeyDown(t){if(tn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=or,coordinateGetter:l=$o,scrollBehavior:c="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}:pe;this.referenceCoordinates||(this.referenceCoordinates=h);const f=l(t,{active:n,context:r.current,currentCoordinates:h});if(f){const y=xt(f,h),p={x:0,y:0},{scrollableAncestors:b}=r.current;for(const m of b){const x=t.code,{isTop:w,isRight:M,isLeft:R,isBottom:O,maxScroll:$,minScroll:T}=nr(m),I=Ro(m),N={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,f.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,f.y))},H=x===U.Right&&!M||x===U.Left&&!R,A=x===U.Down&&!O||x===U.Up&&!w;if(H&&N.x!==f.x){const k=m.scrollLeft+y.x,V=x===U.Right&&k<=$.x||x===U.Left&&k>=T.x;if(V&&!y.y){m.scrollTo({left:k,behavior:c});return}V?p.x=m.scrollLeft-k:p.x=x===U.Right?m.scrollLeft-$.x:m.scrollLeft-T.x,p.x&&m.scrollBy({left:-p.x,behavior:c});break}else if(A&&N.y!==f.y){const k=m.scrollTop+y.y,V=x===U.Down&&k<=$.y||x===U.Up&&k>=T.y;if(V&&!y.x){m.scrollTo({top:k,behavior:c});return}V?p.y=m.scrollTop-k:p.y=x===U.Down?m.scrollTop-$.y:m.scrollTop-T.y,p.y&&m.scrollBy({top:-p.y,behavior:c});break}}this.handleMove(t,$e(xt(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=or,onActivation:o}=t,{active:s}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=s.activatorNode.current;return c&&e.target!==c?!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=Oo(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:l}=s;this.props=t,this.events=n,this.document=Le(l),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(l)),this.initialCoordinates=(o=Wt(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,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,ko,{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:l,options:{activationConstraint:c}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:pe,d=xt(o,u);if(!r&&c){if(Cn(c)){if(c.tolerance!=null&&At(d,c.tolerance))return this.handleCancel();if(At(d,c.distance))return this.handleStart()}if(Dn(c)&&At(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(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 Io={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,Io,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 Ao={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Lo extends on{constructor(t){super(t,Ao,Le(t.event.target))}}Lo.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 No 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(){}}}No.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 zo(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:l=5,order:c=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:y}=e;const p=Yo({delta:f,disabled:!s}),[b,m]=Gr(),x=g.useRef({x:0,y:0}),w=g.useRef({x:0,y:0}),M=g.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]),R=g.useRef(null),O=g.useCallback(()=>{const T=R.current;if(!T)return;const I=x.current.x*w.current.x,N=x.current.y*w.current.y;T.scrollBy(I,N)},[]),$=g.useMemo(()=>c===St.TreeOrder?[...d].reverse():d,[c,d]);g.useEffect(()=>{if(!s||!d.length||!M){m();return}for(const T of $){if(r?.(T)===!1)continue;const I=d.indexOf(T),N=h[I];if(!N)continue;const{direction:H,speed:A}=jo(T,N,M,t,y);for(const k of["x","y"])p[k][H[k]]||(A[k]=0,H[k]=0);if(A.x>0||A.y>0){m(),R.current=T,b(O,l),x.current=A,w.current=H;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,O,r,m,s,l,JSON.stringify(M),JSON.stringify(p),b,d,$,h,JSON.stringify(y)])}const Po={x:{[ee.Backward]:!1,[ee.Forward]:!1},y:{[ee.Backward]:!1,[ee.Forward]:!1}};function Yo(e){let{delta:t,disabled:n}=e;const r=Vt(t);return et(o=>{if(n||!r||!o)return Po;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 Fo(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 Bo(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(l=>({eventName:l.eventName,handler:t(l.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 jn=new Map;function Ho(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,l]=g.useState(null),{frequency:c,measure:u,strategy:d}=o,h=g.useRef(e),f=x(),y=Ke(f),p=g.useCallback(function(w){w===void 0&&(w=[]),!y.current&&l(M=>M===null?w:M.concat(w.filter(R=>!M.includes(R))))},[y]),b=g.useRef(null),m=et(w=>{if(f&&!n)return jn;if(!w||w===jn||h.current!==e||s!=null){const M=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){M.set(R.id,R.rect.current);continue}const O=R.node.current,$=O?new rn(u(O),O):null;R.rect.current=$,$&&M.set(R.id,$)}return M}return w},[e,s,n,f,u]);return g.useEffect(()=>{h.current=e},[e]),g.useEffect(()=>{f||p()},[n,f]),g.useEffect(()=>{s&&s.length>0&&l(null)},[JSON.stringify(s)]),g.useEffect(()=>{f||typeof c!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null},c))},[c,f,p,...r]),{droppableRects:m,measureDroppableContainers:p,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 Wo(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function jt(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function Uo(e){return new rn(Ne(e),e)}function Rn(e,t,n){t===void 0&&(t=Uo);const[r,o]=g.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 l=Wo({callback(u){if(e)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),c=jt({callback:s});return be(()=>{s(),e?(c?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),l?.disconnect())},[e]),r}function Go(e){const t=ir(e);return Jn(e,t)}const En=[];function qo(e){const t=g.useRef(e),n=et(r=>e?r&&r!==En&&e&&t.current&&e.parentNode===t.current.parentNode?r:nn(e):En,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function Xo(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(s=>{const l=It(s.target);l&&n(c=>c?(c.set(l,Ut(l)),new Map(c)):null)},[]);return g.useEffect(()=>{const s=r.current;if(e!==s){l(s);const c=e.map(u=>{const d=It(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(s)};function l(c){c.forEach(u=>{const d=It(u);d?.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,l)=>$e(s,l),pe):rr(e):pe,[e,t])}function Tn(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):pe}function Ko(e){g.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 Jo(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=l=>{s(l,t)},n},{}),[e,t])}function ar(e){return g.useMemo(()=>e?So(e):null,[e])}const Mn=[];function Zo(e,t){t===void 0&&(t=Ne);const[n]=e,r=ar(n?ae(n):null),[o,s]=g.useState(Mn);function l(){s(()=>e.length?e.map(u=>tr(u)?r:new rn(t(u),u)):Mn)}const c=jt({callback:l});return be(()=>{c?.disconnect(),l(),e.forEach(u=>c?.observe(u))},[e]),o}function Qo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function es(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(d=>{for(const{target:h}of d)if(Qe(h)){r(f=>{const y=t(h);return f?{...f,width:y.width,height:y.height}:y});break}},[t]),s=jt({callback:o}),l=g.useCallback(d=>{const h=Qo(d);s?.disconnect(),h&&s?.observe(h),r(h?t(h):null)},[t,s]),[c,u]=bt(l);return g.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const ts=[{sensor:sn,options:{}},{sensor:sr,options:{}}],ns={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 rs={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},os={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=g.createContext(os),cr=g.createContext(rs);function ss(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Xe}}}function is(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 l=new Xe(e.droppable.containers);return l.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}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 as(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(Rt),s=Vt(r),l=Vt(n?.id);return g.useEffect(()=>{if(!t&&!r&&s&&l!=null){if(!tn(s)||document.activeElement===s.target)return;const c=o.get(l);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=Kr(h);if(f){f.focus();break}}})}},[r,t,o,l,s]),null}function cs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ls(e){return g.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function us(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=g.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!l&&!c||!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),f=Jn(h,r);if(l||(f.x=0),c||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const y=Zn(d);y&&y.scrollBy({top:f.y,left:f.x})}},[t,l,c,r,n])}const lr=g.createContext({...pe,scaleX:1,scaleY:1});var Re;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Re||(Re={}));const ur=g.memo(function(t){var n,r,o,s;let{id:l,accessibility:c,autoScroll:u=!0,children:d,sensors:h=ts,collisionDetection:f=go,measuring:y,modifiers:p,...b}=t;const m=g.useReducer(is,void 0,ss),[x,w]=m,[M,R]=no(),[O,$]=g.useState(Re.Uninitialized),T=O===Re.Initialized,{draggable:{active:I,nodes:N,translate:H},droppable:{containers:A}}=x,k=I!=null?N.get(I):null,V=g.useRef({initial:null,translated:null}),G=g.useMemo(()=>{var re;return I!=null?{id:I,data:(re=k?.data)!=null?re:ns,rect:V}:null},[I,k]),L=g.useRef(null),[D,C]=g.useState(null),[_,E]=g.useState(null),z=Ke(b,Object.values(b)),Y=tt("DndDescribedBy",l),v=g.useMemo(()=>A.getEnabled(),[A]),j=ls(y),{droppableRects:P,measureDroppableContainers:B,measuringScheduled:q}=Ho(v,{dragging:T,dependencies:[H.x,H.y],config:j.droppable}),X=Fo(N,I),W=g.useMemo(()=>_?Wt(_):null,[_]),K=Br(),J=Vo(X,j.draggable.measure);us({activeNode:I!=null?N.get(I):null,config:K.layoutShiftCompensation,initialRect:J,measure:j.draggable.measure});const F=Rn(X,j.draggable.measure,J),se=Rn(X?X.parentElement:null),ne=g.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=A.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=es({measure:j.dragOverlay.measure}),Te=(r=xe.nodeRef.current)!=null?r:X,Me=T?(o=xe.rect)!=null?o:F:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=Go(cn?null:F),_t=ar(Te?ae(Te):null),Se=qo(T?he??X:null),ot=Zo(Se),st=cs(p,{transform:{x:H.x-ln.x,y:H.y-ln.y,scaleX:1,scaleY:1},activatorEvent:_,active:G,activeNodeRect:F,containerNodeRect:se,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:_t}),un=W?$e(W,H):null,dn=Xo(Se),Ar=Tn(dn),Lr=Tn(dn,[F]),_e=$e(st,Ar),Oe=Me?mo(Me,st):null,ze=G&&Oe?f({active:G,collisionRect:Oe,droppableRects:P,droppableContainers:v,pointerCoordinates:un}):null,fn=fo(ze,"id"),[we,hn]=g.useState(null),Nr=cn?st:$e(st,Lr),zr=po(Nr,(s=we?.rect)!=null?s:null,F),Ot=g.useRef(null),gn=g.useCallback((re,ce)=>{let{sensor:le,options:Ce}=ce;if(L.current==null)return;const de=N.get(L.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:L.current,activeNode:de,event:ue,options:Ce,context:ne,onAbort(te){if(!N.get(te))return;const{onDragAbort:me}=z.current,ye={id:te};me?.(ye),M({type:"onDragAbort",event:ye})},onPending(te,De,me,ye){if(!N.get(te))return;const{onDragPending:Ye}=z.current,je={id:te,constraint:De,initialCoordinates:me,offset:ye};Ye?.(je),M({type:"onDragPending",event:je})},onStart(te){const De=L.current;if(De==null)return;const me=N.get(De);if(!me)return;const{onDragStart:ye}=z.current,Pe={activatorEvent:ue,active:{id:De,data:me.data,rect:V}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),$(Re.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 je=null;if(me&&Ye){const{cancelDrop:Fe}=z.current;je={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Q.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(je))&&(te=Q.DragCancel)}L.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),$(Re.Uninitialized),hn(null),C(null),E(null),Ot.current=null;const Fe=te===Q.DragEnd?"onDragEnd":"onDragCancel";if(je){const kt=z.current[Fe];kt?.(je),M({type:Fe,event:je})}})}}},[N]),Pr=g.useCallback((re,ce)=>(le,Ce)=>{const de=le.nativeEvent,ue=N.get(Ce);if(L.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},L.current=Ce,gn(le,ce))},[N,gn]),pn=Bo(h,Pr);Ko(h),be(()=>{F&&O===Re.Initializing&&$(Re.Initialized)},[F,O]),g.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]),g.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:Ce,scrollAdjustedTranslate:de}=ne.current;if(!re||L.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:G,activeNode:X,collisionRect:Oe,collisions:ze,droppableRects:P,draggableNodes:N,draggingNode:Te,draggingNodeRect:Me,droppableContainers:A,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},V.current={initial:Me,translated:Oe}},[G,X,ze,Oe,N,Te,Me,P,A,we,Se,_e]),zo({...K,delta:H,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:ot});const Yr=g.useMemo(()=>({active:G,activeNode:X,activeNodeRect:F,activatorEvent:_,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:N,droppableContainers:A,droppableRects:P,over:we,measureDroppableContainers:B,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:j,measuringScheduled:q,windowRect:_t}),[G,X,F,_,ze,se,xe,N,A,P,we,B,Se,ot,j,q,_t]),Fr=g.useMemo(()=>({activatorEvent:_,activators:pn,active:G,activeNodeRect:F,ariaDescribedById:{draggable:Y},dispatch:w,draggableNodes:N,over:we,measureDroppableContainers:B}),[_,pn,G,F,w,Y,N,we,B]);return g.createElement(Xn.Provider,{value:R},g.createElement(Rt.Provider,{value:Fr},g.createElement(cr.Provider,{value:Yr},g.createElement(lr.Provider,{value:zr},d)),g.createElement(as,{disabled:c?.restoreFocus===!1})),g.createElement(so,{...c,hiddenTextDescribedById:Y}));function Br(){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}}}),ds=g.createContext(null),_n="button",fs="Draggable";function hs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(fs),{activators:l,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:y}=g.useContext(Rt),{role:p=_n,roleDescription:b="draggable",tabIndex:m=0}=o??{},x=u?.id===t,w=g.useContext(x?lr:ds),[M,R]=bt(),[O,$]=bt(),T=Jo(l,t),I=Ke(n);be(()=>(f.set(t,{id:t,key:s,node:M,activatorNode:O,data:I}),()=>{const H=f.get(t);H&&H.key===s&&f.delete(t)}),[f,t]);const N=g.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&p===_n?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[r,p,m,x,b,h.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:N,isDragging:x,listeners:r?void 0:T,node:M,over:y,setNodeRef:R,setActivatorNodeRef:$,transform:w}}function gs(){return g.useContext(cr)}const ps="Droppable",vs={timeout:25};function ms(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(ps),{active:l,dispatch:c,over:u,measureDroppableContainers:d}=g.useContext(Rt),h=g.useRef({disabled:n}),f=g.useRef(!1),y=g.useRef(null),p=g.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:x}={...vs,...o},w=Ke(m??r),M=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),p.current=null},x)},[x]),R=jt({callback:M,disabled:b||!l}),O=g.useCallback((N,H)=>{R&&(H&&(R.unobserve(H),f.current=!1),N&&R.observe(N))},[R]),[$,T]=bt(O),I=Ke(t);return g.useEffect(()=>{!R||!$.current||(R.disconnect(),f.current=!1,R.observe($.current))},[$,R]),g.useEffect(()=>(c({type:Q.RegisterDroppable,element:{id:r,key:s,disabled:n,node:$,rect:y,data:I}}),()=>c({type:Q.UnregisterDroppable,key:s,id:r})),[r]),g.useEffect(()=>{n!==h.current.disabled&&(c({type:Q.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,c]),{active:l,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 bs(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 xs(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 ys(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},Ss=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:l}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const u=ws(n,l,o);if(l===o){const d=n[s];return d?{x:o<s?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...ct}:null}return l>o&&l<=s?{x:-c.width-u,y:0,...ct}:l<o&&l>=s?{x:c.width+u,y:0,...ct}:{x:0,y:0,...ct}};function ws(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),l=t[o],c=s[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},lt={scaleX:1,scaleY:1},Cs=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:l}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const d=s[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...lt}:null}const u=Ds(s,o,n);return o>n&&o<=l?{x:0,y:-c.height-u,...lt}:o<n&&o>=l?{x:0,y:c.height+u,...lt}:{x:0,y:0,...lt}};function Ds(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=g.createContext({activeIndex:-1,containerId:fr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:dr,disabled:{draggable:!1,droppable:!1}});function gr(e){let{children:t,id:n,items:r,strategy:o=dr,disabled:s=!1}=e;const{active:l,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:h}=gs(),f=tt(fr,n),y=c.rect!==null,p=g.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),b=l!=null,m=l?p.indexOf(l.id):-1,x=d?p.indexOf(d.id):-1,w=g.useRef(p),M=!xs(p,w.current),R=x!==-1&&m===-1||M,O=ys(s);be(()=>{M&&b&&h(p)},[M,p,b,h]),g.useEffect(()=>{w.current=p},[p]);const $=g.useMemo(()=>({activeIndex:m,containerId:f,disabled:O,disableTransforms:R,items:p,overIndex:x,useDragOverlay:y,sortedRects:bs(p,u),strategy:o}),[m,f,O.draggable,O.droppable,R,p,x,u,y,o]);return g.createElement(hr.Provider,{value:$},t)}const js=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:l,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==s&&o===l?!1:n?!0:l!==o&&t===u},Es={duration:200,easing:"ease"},pr="transform",Ts=Ie.Transition.toString({property:pr,duration:0,easing:"linear"}),Ms={roleDescription:"sortable"};function _s(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,l]=g.useState(null),c=g.useRef(n);return be(()=>{if(!t&&n!==c.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)&&l(h)}}n!==c.current&&(c.current=n)},[t,n,r,o]),g.useEffect(()=>{s&&l(null)},[s]),s}function vr(e){let{animateLayoutChanges:t=Rs,attributes:n,disabled:r,data:o,getNewIndex:s=js,id:l,strategy:c,resizeObserverConfig:u,transition:d=Es}=e;const{items:h,containerId:f,activeIndex:y,disabled:p,disableTransforms:b,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:M}=g.useContext(hr),R=Os(r,p),O=h.indexOf(l),$=g.useMemo(()=>({sortable:{containerId:f,index:O,items:h},...o}),[f,o,O,h]),T=g.useMemo(()=>h.slice(h.indexOf(l)),[h,l]),{rect:I,node:N,isOver:H,setNodeRef:A}=ms({id:l,data:$,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...u}}),{active:k,activatorEvent:V,activeNodeRect:G,attributes:L,setNodeRef:D,listeners:C,isDragging:_,over:E,setActivatorNodeRef:z,transform:Y}=hs({id:l,data:$,attributes:{...Ms,...n},disabled:R.draggable}),v=Ur(A,D),j=!!k,P=j&&!b&&at(y)&&at(x),B=!w&&_,q=B&&P?Y:null,W=P?q??(c??M)({rects:m,activeNodeRect:G,activeIndex:y,overIndex:x,index:O}):null,K=at(y)&&at(x)?s({id:l,items:h,activeIndex:y,overIndex:x}):O,J=k?.id,F=g.useRef({activeId:J,items:h,newIndex:K,containerId:f}),se=h!==F.current.items,ne=t({active:k,containerId:f,isDragging:_,isSorting:j,id:l,index:O,items:h,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),he=_s({disabled:!ne,index:O,node:N,rect:I});return g.useEffect(()=>{j&&F.current.newIndex!==K&&(F.current.newIndex=K),f!==F.current.containerId&&(F.current.containerId=f),h!==F.current.items&&(F.current.items=h)},[j,K,f,h]),g.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:L,data:$,rect:I,index:O,newIndex:K,items:h,isOver:H,isSorting:j,isDragging:_,listeners:C,node:N,overIndex:x,over:E,setNodeRef:v,setActivatorNodeRef:z,setDroppableNodeRef:A,setDraggableNodeRef:D,transform:he??W,transition:xe()};function xe(){if(he||se&&F.current.newIndex===O)return Ts;if(!(B&&!tn(V)||!d)&&(j||ne))return Ie.Transition.toString({...d,property:pr})}}function Os(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 ks(){if(On)return zt;On=1;var e=g;function t(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(f,y){var p=y(),b=r({inst:{value:p,getSnapshot:y}}),m=b[0].inst,x=b[1];return s(function(){m.value=p,m.getSnapshot=y,u(m)&&x({inst:m})},[f,p,y]),o(function(){return u(m)&&x({inst:m}),f(function(){u(m)&&x({inst:m})})},[f]),l(p),p}function u(f){var y=f.getSnapshot;f=f.value;try{var p=y();return!n(f,p)}catch{return!0}}function d(f,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return zt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,zt}var Pt={};var kn;function $s(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}function t(p,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(!f){var x=b();s(m,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}x=l({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})},[p,m,b]),c(function(){return n(w)&&M({inst:w}),p(function(){n(w)&&M({inst:w})})},[p]),d(m),m}function n(p){var b=p.getSnapshot;p=p.value;try{var m=b();return!s(p,m)}catch{return!0}}function r(p,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=g,s=typeof Object.is=="function"?Object.is:e,l=o.useState,c=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,h=!1,f=!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=ks():dt.exports=$s()),dt.exports}var In;function Is(){if(In)return Nt;In=1;var e=g,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,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Nt.useSyncExternalStoreWithSelector=function(d,h,f,y,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=c(function(){function w(T){if(!M){if(M=!0,R=T,T=y(T),p!==void 0&&m.hasValue){var I=m.value;if(p(I,T))return O=I}return O=T}if(I=O,r(R,T))return I;var N=y(T);return p!==void 0&&p(I,N)?(R=T,I):(R=T,O=N)}var M=!1,R,O,$=f===void 0?null:f;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,f,y,p]);var x=o(d,b[0],b[1]);return l(function(){m.hasValue=!0,m.value=x},[x]),u(x),x},Nt}var Yt={};var An;function As(){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=g,n=mr(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,u=t.useDebugValue;Yt.useSyncExternalStoreWithSelector=function(d,h,f,y,p){var b=s(null);if(b.current===null){var m={hasValue:!1,value:null};b.current=m}else m=b.current;b=c(function(){function w(T){if(!M){if(M=!0,R=T,T=y(T),p!==void 0&&m.hasValue){var I=m.value;if(p(I,T))return O=I}return O=T}if(I=O,r(R,T))return I;var N=y(T);return p!==void 0&&p(I,N)?(R=T,I):(R=T,O=N)}var M=!1,R,O,$=f===void 0?null:f;return[function(){return w(h())},$===null?void 0:function(){return w($())}]},[h,f,y,p]);var x=o(d,b[0],b[1]);return l(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 Ls(){return Ln||(Ln=1,process.env.NODE_ENV==="production"?ut.exports=Is():ut.exports=As()),ut.exports}var Ns=Ls();const Xt=new WeakMap,zs=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=zs.get(t);if(n)for(const r of n){const o=Xt.get(r);o?.length&&br(o)}}}function Ps(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ys(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Fs(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,Ps(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)Ys(o)}}}finally{Ft=!1,wt.current=[],Nn.clear()}}function Bs(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 l=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),l?.()}},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):Bs(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Fs(this)}}function nt(e,t=r=>r,n={}){const r=n.equal??Hs;return Ns.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Hs(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,l=JSON.parse(localStorage.getItem(Cr(s))||"[]"),c=[...l.map(h=>o.find(f=>f.id===h)).filter(Boolean),...o.filter(h=>!l.includes(h.id))],u=JSON.parse(localStorage.getItem(Dr(s))||"{}"),d=c.reduce((h,f)=>(h[f.id]=u[f.id]??!0,h),{});ie.setState(h=>({...h,data:e,columnOrder:c,visibility:d,sortableColumns:c.map(f=>({id:f.id,label:f.label,sortable:!0,backgroundColor:f.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 Ws(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Us=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 Gs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=qs(e);return t.charAt(0).toUpperCase()+t.slice(1)},jr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Xs=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ks={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 Js=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:l,...c},u)=>g.createElement("svg",{ref:u,...Ks,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jr("lucide",o),...!s&&!Xs(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,h])=>g.createElement(d,h)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(Js,{ref:s,iconNode:t,className:jr(`lucide-${Gs(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Zs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qs=oe("arrow-down",Zs);const ei=[["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"}]],ti=oe("arrow-up-down",ei);const ni=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ri=oe("arrow-up",ni);const oi=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],si=oe("bookmark",oi);const ii=[["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",ii);const ai=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ci=oe("chevron-left",ai);const li=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ui=oe("chevron-right",li);const di=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],fi=oe("columns-2",di);const hi=[["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"}]],gi=oe("delete",hi);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"}]],vi=oe("ellipsis",pi);const mi=[["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"}]],bi=oe("funnel",mi);const xi=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Rr=oe("grip-vertical",xi);const yi=[["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"}]],Si=oe("pen",yi);const wi=[["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"}]],Ci=oe("refresh-ccw",wi);const Di=[["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"}]],ji=oe("settings",Di);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"}]],Er=oe("triangle-alert",Ri);function S(e){return g.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Ei=S(a.Menu.Trigger),Ti=S(a.Menu.Positioner),Mi=S(a.Menu.Content),_i=S(a.Menu.Item),Oi=S(a.Checkbox.Label),ki=S(a.Checkbox.HiddenInput),$i=S(a.Checkbox.Control);function Ii({visibility:e,onToggle:t}){const{sortableColumns:n}=nt(ie);return i.jsxs(a.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ei,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(fi,{size:18})})}),i.jsx(a.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(a.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:l}){const{setNodeRef:c,attributes:u,listeners:d,transform:h,transition:f}=vr({id:e});return i.jsx(a.Table.ColumnHeader,{ref:c,onClick:n,backgroundColor:l,w:e==="id"||e==="row_number"?"80px":void 0,style:{transform:Ie.Transform.toString(h),transition:f,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(a.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Rr,{size:12})})]})})}function Li(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=nt(ie),l=e.map(c=>o.find(u=>u.id===c.id)).filter(c=>c!==void 0).filter(c=>t[c.id]);return i.jsx(a.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsxs(a.Table.Row,{height:"28px",children:[l.map(c=>{const u=n===c?.id;return i.jsx(Ai,{id:c?.id,onClick:()=>c?.sortable&&Ws(c?.id),cursor:c?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:c?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[c?.label,c?.sortable&&(u?r==="asc"?i.jsx(ri,{size:14}):i.jsx(Qs,{size:14}):i.jsx(ti,{size:14,opacity:.4}))]})},c?.id)}),s?.showActionColumn&&i.jsx(a.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(a.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Ii,{visibility:t,onToggle:Us})})]})})}const Ni=[10,20,50,100],zi=S(a.Select.Positioner),Pi=S(a.Select.Content),Yi=S(a.Select.Item),Fi=S(a.Pagination.PrevTrigger),Bi=S(a.Pagination.NextTrigger),Hi=S(a.Select.HiddenSelect),Vi=S(a.Select.Control),Wi=S(a.Select.Trigger),Ui=S(a.Select.ValueText),Gi=S(a.Select.IndicatorGroup),qi=S(a.Select.Indicator);function Xi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:l=Ni}){const c=a.createListCollection({items:l.map(u=>({label:String(u),value:String(u)}))});return i.jsx(a.Box,{width:"100%",children:i.jsxs(a.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(a.HStack,{children:[i.jsx(a.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(a.Select.Root,{collection:c,size:"sm",width:"60px",onValueChange:u=>o?.(Number(u.items[0].value)),value:[String(t)],children:[i.jsx(Hi,{}),i.jsxs(Vi,{children:[i.jsx(Wi,{children:i.jsx(Ui,{placeholder:""})}),i.jsx(Gi,{children:i.jsx(qi,{})})]}),i.jsx(a.Portal,{children:i.jsx(zi,{children:i.jsx(Pi,{children:c.items.map(u=>i.jsxs(Yi,{item:u.value,children:[u.label,i.jsx(a.Select.ItemIndicator,{})]},u.value))})})})]})]}),i.jsx(a.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:u=>r&&r(u.page),children:i.jsxs(a.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Fi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Previous page",children:i.jsx(ci,{size:18})})}),i.jsx(a.Pagination.Items,{render:u=>i.jsx(a.IconButton,{variant:u.type==="page"&&u.value===n?"outline":"ghost","aria-current":u.type==="page"&&u.value===n?"page":void 0,children:u.type==="page"?u.value:"…"},u.value??u.type)}),i.jsx(Bi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Next page",children:i.jsx(ui,{size:18})})})]})})]})})}const Ki=S(a.Menu.Item),Ji=S(a.Menu.Content),Zi=S(a.Menu.Positioner),Qi=S(a.Menu.Trigger);function ea({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=nt(ie);return i.jsx(a.Table.Body,{children:e.map(o=>i.jsxs(a.Table.Row,{_hover:{bg:"blue.50"},children:[n.filter(s=>r[s.id]).map(s=>i.jsx(a.Table.Cell,{children:o[s.id]},s.id)),i.jsx(a.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(a.Menu.Root,{children:[i.jsx(Qi,{asChild:!0,children:i.jsx(a.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(vi,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(Zi,{children:i.jsx(Ji,{children:t.filter(s=>typeof s.visible=="function"?s.visible(o.__raw):s.visible!==!1).map(s=>i.jsxs(Ki,{onClick:()=>s.onClick(o.__raw),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})}),i.jsx(a.Table.Cell,{})]},o.__key||o.id))})}function ta({rows:e=6,columns:t}){return i.jsx(a.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(a.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(a.Table.Cell,{children:i.jsx(a.Skeleton,{height:"25px"})},s))},r))})}function na({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:l="No data",actions:c,page:u=1,pageSize:d=10,onPageChange:h,onPageSizeChange:f,density:y="sm",totalCount:p=0,paginationMode:b="client",actionConfig:m,pageSizeOptions:x}){g.useEffect(()=>{Sr(e)},[e]),g.useEffect(()=>{yr(t,n)},[t,n]),g.useEffect(()=>{m&&wr(m)},[m]);const{sortColumn:w,sortDirection:M,data:R,columnOrder:O}=nt(ie),$=g.useMemo(()=>{const A=[...R],k=Math.max(1,u||1);if(w&&A.sort((V,G)=>M==="asc"?String(V[w]).localeCompare(String(G[w])):String(G[w]).localeCompare(String(V[w]))),b==="client"){const V=(k-1)*d;return A.slice(V,V+d)}return A},[R,w,M,u,d,b]);g.useEffect(()=>{u<1&&h&&h(1)},[u,h]);const T=A=>{const{active:k,over:V}=A;if(!V||k.id===V.id)return;const G=O.findIndex(C=>C.id===k.id),L=O.findIndex(C=>C.id===V.id),D=Et(O,G,L);Vs(D)},I=r&&!s,N=s&&!r,H=!r&&!s&&$.length===0;return i.jsx(ur,{collisionDetection:Kn,onDragEnd:T,children:i.jsx(gr,{items:O.map(A=>A.id),strategy:Ss,children:i.jsxs(a.Box,{flex:"1",minH:0,display:"flex",flexDirection:"column",p:2,children:[i.jsxs(a.Box,{flex:"1",minH:0,position:"relative",overflow:"auto",children:[I&&i.jsx(a.Box,{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,bg:"whiteAlpha.600",children:o??i.jsx(a.Spinner,{})}),i.jsxs(a.Table.Root,{variant:"outline",w:"100%",size:y,children:[i.jsx(Li,{}),N?i.jsx(ta,{rows:d,columns:n.length+(c?2:0)}):H?i.jsx(a.Table.Body,{children:i.jsx(a.Table.Row,{children:i.jsx(a.Table.Cell,{colSpan:n.length+(c?1:0),children:i.jsx(a.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:l})})})}):i.jsx(ea,{data:$,actions:c})]})]}),i.jsx(a.Box,{mt:.5,children:i.jsx(Xi,{totalCount:p,pageSize:d,currentPage:u,onPageChange:h,onPageSizeChange:A=>{f?.(A),u>1&&h?.(1)},pageSizeOptions:x})})]})})})}const ra=S(a.Checkbox.Root),oa=S(a.Checkbox.HiddenInput),sa=S(a.Checkbox.Control),ia=S(a.Checkbox.Label),Tr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:l,errorText:c})=>i.jsxs(ra,{value:e,onChange:t,size:n,children:[i.jsx(oa,{}),i.jsx(sa,{disabled:s,required:l,errorText:c,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,l=o.substring(0,s);return parseInt(l+e)}return t},Ve=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 l,c,u;return n.length===1?(l=parseInt(n[0])||s,c=o,u=r):n.length===2?(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=r):(l=parseInt(n[0])||s,c=parseInt(n[1])||o,u=ca(n[2],r)),c=Math.max(1,Math.min(Ee.MONTH_MAX,c)),l=Math.max(1,Math.min(Ee.DAY_MAX,l)),`${u}-${String(c).padStart(2,"0")}-${String(l).padStart(2,"0")}`},ge=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(a.Popover.Root),da=S(a.Popover.Trigger),fa=S(a.Popover.Content),ha=S(a.Popover.Positioner);function ga({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,l]=g.useState(()=>r&&o?`${ge(r)}${Z}${ge(o)}`:r?ge(r):""),[c,u]=g.useState(!1),d=g.useRef(null);g.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);l(m)},f=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(Z)){const[m,x=""]=b.split(Z).map(R=>R.trim()),w=Ve(m),M=x?Ve(x):null;if(w&&M){const[R,O]=M<w?[M,w]:[w,M],$=`${ge(R)}${Z}${ge(O)}`;l($),t(`${R}|${O}`)}else if(w&&!x)l(`${ge(w)}${Z}`),t(void 0);else if(w&&x){const R=aa(),[O,$]=R<w?[R,w]:[w,R],T=`${ge(O)}${Z}${ge($)}`;l(T),t(`${O}|${$}`)}else l(""),t(void 0)}else{const m=Ve(b);m?(l(`${ge(m)}${Z}`),t(void 0)):(l(""),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()){l(`${Bn()}${Z}`);return}if(x===-1){const M=Ve(s.trim());M&&l(`${ge(M)}${Z}`);return}if(m<=x+Z.length){const M=s.substring(0,x).trim(),R=s.substring(x+Z.length),O=Ve(M);O&&l(`${ge(O)}${Z}${R}`);return}if(s.substring(x+Z.length).trim())f(),d.current?.blur();else{const M=s.substring(0,x+Z.length)+Bn();l(M),setTimeout(()=>{f(),d.current?.blur()},0)}},p=()=>{l(""),t(void 0)};return i.jsx(a.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(a.InputElement,{position:"revert",children:[i.jsxs(ua,{open:c,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(da,{asChild:!0,children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(a.Portal,{children:i.jsx(ha,{children:i.jsxs(fa,{p:4,children:[i.jsx(a.PopoverArrow,{}),i.jsxs(a.VStack,{align:"start",gap:4,children:[i.jsxs(a.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(a.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(a.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",Z,"DD-MM-YYYY"]})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(a.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(a.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(a.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(a.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(a.VStack,{align:"start",gap:1,children:[i.jsx(a.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(a.HStack,{children:[i.jsx(a.Kbd,{children:"Ctrl"}),i.jsx(a.Text,{children:"+"}),i.jsx(a.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(a.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>h(b.target.value),onBlur:f,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(a.InputElement,{children:i.jsx(a.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:p,w:"100%"})})]})})})}const pa=S(a.Field.Root),va=S(a.Field.Label),ma=S(a.Field.HelperText),ba=S(a.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:l="100%",label:c,helperText:u,isDisabled:d=!1,required:h=!1,errorText:f,visible:y})=>i.jsxs(pa,{width:l,children:[y&&i.jsx(va,{children:c}),i.jsx(a.InputGroup,{startElement:e,children:i.jsx(a.Input,{value:t,onChange:p=>n?.(p.target.value),placeholder:r,size:o,variant:s,disabled:d,required:h})}),f&&i.jsx(ba,{fontSize:"xs",children:f}),u&&i.jsx(ma,{fontSize:"xs",children:u})]}),xa=S(a.Field.Root),ya=S(a.Field.HelperText),Sa=S(a.Field.ErrorText),wa=S(a.Select.Root),Ca=S(a.Select.Label),Da=S(a.Select.Control),ja=S(a.Select.Trigger),Ra=S(a.Select.ValueText),Ea=S(a.Select.IndicatorGroup),Ta=S(a.Select.Indicator),Ma=S(a.Select.Content),_a=S(a.Select.Item),Oa=S(a.Select.ItemIndicator),ka=S(a.Select.HiddenSelect),$a=S(a.Select.Positioner),Mr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:l="100%",variant:c="outline",helperText:u,isDisabled:d,required:h,errorText:f,visible:y})=>{const p=a.createListCollection({items:e});return i.jsxs(xa,{disabled:d,required:h,children:[i.jsxs(wa,{collection:p,variant:c,size:s,width:l,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(ja,{children:i.jsx(Ra,{placeholder:o})}),i.jsx(Ea,{children:i.jsx(Ta,{})})]}),i.jsx($a,{children:i.jsx(Ma,{children:p.items.map(b=>i.jsxs(_a,{item:b,children:[b.label,i.jsx(Oa,{})]},b.value))})})]}),u&&i.jsx(ya,{children:u}),f&&i.jsx(Sa,{children:f})]})},_r=(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(_r(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(_r(e),JSON.stringify(t))},Or=(e,t)=>{const n=[t,...rt(e)];Tt(e,n)},kr=(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(a.Checkbox.Root),za=S(a.Checkbox.HiddenInput),Pa=S(a.Checkbox.Control),Ya=S(a.Slider.Root),Fa=S(a.Slider.Track),Ba=S(a.Slider.Range),Ha=S(a.Slider.Thumbs),Va=S(a.Slider.Control),Wa=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:l,transition:c}=vr({id:e.id}),u={transform:Ie.Transform.toString(l),transition:c};return i.jsxs(a.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(a.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Rr,{size:16}),i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(a.HStack,{justify:"space-between",children:[i.jsx(a.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(a.VStack,{align:"stretch",gap:1,children:[i.jsx(a.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(Va,{children:[i.jsx(Fa,{children:i.jsx(Ba,{})}),i.jsx(Ha,{})]})})]})]})},Ua=S(a.Drawer.Root),Ga=S(a.Drawer.Trigger),qa=S(a.Drawer.Backdrop),Xa=S(a.Drawer.Positioner),Ka=S(a.Drawer.Content),Ja=S(a.Drawer.Header),Za=S(a.Drawer.Title),Qa=S(a.Drawer.Body),ec=S(a.Drawer.Footer),tc=S(a.Drawer.CloseTrigger),nc=S(a.Tabs.Root),rc=S(a.Tabs.List),Bt=S(a.Tabs.Trigger),Ht=S(a.Tabs.Content),$r=(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(Tr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Mr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(ga,{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:l,activePresetName:c,onReorder:u,open:d,onOpenChange:h})=>{const y=nt(Ze)[s]??rt(s),p=()=>{const b=prompt("Preset name?");if(!b)return;const m=o.reduce((x,w)=>(x[w.id]=w.value,x),{});Or(s,{id:crypto.randomUUID(),name:b,date:new Date().toISOString(),values:m})};return i.jsx(a.HStack,{wrap:"wrap",children:i.jsxs(Ua,{size:e,open:d,onOpenChange:h,children:[i.jsx(Ga,{asChild:!0,children:i.jsxs(a.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(bi,{size:16}),"Filters"]})}),i.jsxs(a.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(Si,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx(ji,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(si,{size:16}),"Presets"]})]}),i.jsx(Ht,{value:"view",children:o.filter(b=>b.visible).map(b=>i.jsx(a.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:$r(b,d)},b.id))}),i.jsx(Ht,{value:"settings",children:i.jsx(ur,{sensors:ao(io(sn)),collisionDetection:Kn,onDragEnd:({active:b,over:m})=>{if(!m||b.id===m.id)return;const x=o.findIndex(R=>R.id===b.id),w=o.findIndex(R=>R.id===m.id),M=Et(o,x,w);u?.(M)},children:i.jsx(gr,{items:o.map(b=>b.id),strategy:Cs,children:o.map(b=>i.jsx(Wa,{filter:b,onVisibilityChange:t,onSizeChange:n},b.id))})})}),i.jsx(Ht,{value:"presets",children:i.jsxs(a.VStack,{align:"stretch",mb:3,children:[y.length===0&&i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),y.map(b=>i.jsxs(a.HStack,{justify:"space-between",border:"1px solid",borderColor:c===b.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(a.VStack,{align:"start",gap:0,children:[i.jsx(a.Text,{fontWeight:"bold",fontSize:"sm",children:b.name}),i.jsx(a.Text,{fontSize:"xs",color:"gray.500",children:new Date(b.date).toLocaleDateString()})]}),i.jsxs(a.HStack,{children:[i.jsx(a.Button,{size:"xs",variant:"ghost",onClick:()=>{const m=o.map(x=>({...x,value:b.values[x.id]??x.value}));l?.(m,b.name)},children:"Load"}),i.jsx(a.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>kr(s,b.id),children:i.jsx(gi,{size:14})})]})]},b.id)),i.jsx(a.Button,{size:"sm",colorScheme:"blue",onClick:p,children:"Save Current Filters"})]})})]})}),i.jsx(ec,{justify:"space-between",children:i.jsx(tc,{asChild:!0,children:i.jsx(a.CloseButton,{})})})]})})]})]})})},sc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,onLoadPreset:u,activePresetName:d,filterDrawerSize:h="sm"})=>{const[f,y]=g.useState(!1);return i.jsxs(a.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(a.HStack,{gapX:1,children:[t.filter(p=>p.visible!==!1).map(p=>i.jsx(a.HStack,{flex:p.size??1,minW:`${(p.size??1)*100}px`,alignItems:"center",children:$r(p)},p.id)),i.jsx(oc,{filterDrawerSize:h,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:l,pageKey:c,filters:t,onLoadPreset:u,activePresetName:d,open:f,onOpenChange:p=>{y(p.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:l,colorScheme:c,loading:u,loadingText:d,rounded:h,type:f="button"})=>i.jsx(a.Button,{onClick:e,size:t,variant:n,disabled:l,colorPalette:c,loading:u,loadingText:d,rounded:h,type:f,children:i.jsxs(a.HStack,{gap:1,children:[o,r,s]})}),lc=S(a.Combobox.Root),uc=S(a.Combobox.Control),dc=S(a.Combobox.Input),fc=S(a.Combobox.IndicatorGroup),hc=S(a.Combobox.ClearTrigger),gc=S(a.Combobox.Trigger),pc=S(a.Combobox.Positioner),vc=S(a.Combobox.Content);function mc({label:e,size:t="sm",width:n="100%",variant:r="outline",items:o=[],itemToString:s,itemToValue:l,renderItem:c,value:u,loading:d,error:h,errorMessage:f,placeholder:y,helpText:p,onInputChange:b,onSelect:m,rootProps:x,inputProps:w,controlProps:M,contentProps:R,itemProps:O}){const[$,T]=g.useState(""),{collection:I,set:N}=a.useListCollection({initialItems:o,itemToString:s,itemToValue:l}),H=g.useMemo(()=>{if(!$)return o;const A=$.toLowerCase();return o.filter(k=>s(k).toLowerCase().includes(A))},[o,$,s]);return g.useEffect(()=>{N(H)},[H,N]),g.useEffect(()=>{u&&T(s(u))},[u,s]),i.jsxs(lc,{width:n,size:t,variant:r,collection:I,placeholder:y,onInputValueChange:A=>{b?.(A.inputValue),T(A.inputValue)},value:u?[l(u)]:[],onValueChange:A=>{const k=A.value?.[0];if(!k)return;const V=I.items.find(G=>l(G)===k);V&&m?.(V)},positioning:{sameWidth:!1,placement:"bottom-start"},...x,children:[e&&i.jsx(a.Text,{fontSize:"sm",children:e}),i.jsxs(uc,{...M,children:[i.jsx(dc,{placeholder:y??"Type to search",...w}),i.jsxs(fc,{children:[i.jsx(hc,{}),i.jsx(gc,{})]})]}),i.jsx(pc,{children:i.jsxs(vc,{minW:"sm",...R,children:[d?i.jsxs(a.HStack,{p:"2",children:[i.jsx(a.Spinner,{size:"xs",borderWidth:"1px"}),i.jsx(a.Span,{children:"Loading..."})]}):h?i.jsx(a.Text,{p:"2",color:"red.500",fontSize:"sm",children:f||"Something went wrong"}):I.items.map(A=>i.jsxs(a.Combobox.Item,{item:A,...O,children:[c(A),i.jsx(a.Combobox.ItemIndicator,{})]},l(A))),p&&!h&&!d&&i.jsx(a.Text,{p:"2",color:"fg.muted",fontSize:"sm",children:p})]})})]})}const bc=S(a.Dialog.Root),xc=S(a.Dialog.Backdrop),yc=S(a.Dialog.Positioner),Sc=S(a.Dialog.Content),wc=S(a.Dialog.Header),Cc=S(a.Dialog.Body),Dc=S(a.Dialog.Footer),jc=S(a.Dialog.Title),Rc=S(a.Dialog.CloseTrigger);function Ec({open:e,onClose:t,onConfirm:n,title:r="Confirm Action",description:o="Are you sure you want to continue?",confirmLabel:s="Confirm",cancelLabel:l="Cancel",icon:c,isLoading:u=!1,confirmButtonColorScheme:d="#4169e1"}){return i.jsx(bc,{open:e,placement:"center",onOpenChange:h=>!h.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(xc,{}),i.jsx(yc,{children:i.jsxs(Sc,{maxW:"480px",children:[i.jsx(wc,{borderBottom:"1px solid",borderColor:"gray.200",children:i.jsx(jc,{children:r})}),i.jsx(Cc,{p:6,children:i.jsxs(a.Stack,{gap:4,align:"center",textAlign:"center",children:[i.jsx(a.Box,{color:"orange.500",children:c??i.jsx(Er,{size:40})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:o})]})}),i.jsxs(Dc,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"gray.200",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:l}),i.jsx(a.Button,{size:"sm",style:{backgroundColor:d},loading:u,onClick:n,children:s})]}),i.jsx(Rc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}const Tc=S(a.Dialog.Root),Mc=S(a.Dialog.Backdrop),_c=S(a.Dialog.Positioner),Oc=S(a.Dialog.Content),kc=S(a.Dialog.Header),$c=S(a.Dialog.Body),Ic=S(a.Dialog.Footer),Ac=S(a.Dialog.Title),Lc=S(a.Dialog.CloseTrigger);function Nc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:l="Delete",isLoading:c=!1}){const[u,d]=g.useState(""),h=u===s;return i.jsx(Tc,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(a.Portal,{children:[i.jsx(Mc,{}),i.jsx(_c,{children:i.jsxs(Oc,{maxW:"550px",children:[i.jsx(kc,{borderBottom:"1px solid",borderColor:"#d3d3d3",children:i.jsx(Ac,{color:"red.600",children:r})}),i.jsx($c,{p:2,style:{padding:"16px"},children:i.jsxs(a.Stack,{gap:4,borderRadius:"md",p:4,bg:"white",children:[i.jsx(a.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(a.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(a.Box,{color:"red.600",mt:"2px",children:i.jsx(Er,{size:20})}),i.jsxs(a.Box,{children:[i.jsx(a.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(a.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(a.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(a.Box,{children:[i.jsxs(a.Text,{fontSize:"sm",mb:2,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(a.Input,{placeholder:`Type ${s} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(Ic,{justifyContent:"flex-end",gap:2,borderTop:"1px solid",borderColor:"#d3d3d3",children:[i.jsx(a.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(a.Button,{size:"sm",disabled:!h,style:{backgroundColor:"#FF0000"},loading:c,onClick:n,children:l})]}),i.jsx(Lc,{asChild:!0,children:i.jsx(a.CloseButton,{size:"sm"})})]})})]})})}function Ir({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=g.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(a.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Ci,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var gt={exports:{}},zc=gt.exports,Hn;function Pc(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(zc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",c="minute",u="hour",d="day",h="week",f="month",y="quarter",p="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(L){var D=["th","st","nd","rd"],C=L%100;return"["+L+(D[(C-20)%10]||D[C]||D[0])+"]"}},R=function(L,D,C){var _=String(L);return!_||_.length>=D?L:""+Array(D+1-_.length).join(C)+L},O={s:R,z:function(L){var D=-L.utcOffset(),C=Math.abs(D),_=Math.floor(C/60),E=C%60;return(D<=0?"+":"-")+R(_,2,"0")+":"+R(E,2,"0")},m:function L(D,C){if(D.date()<C.date())return-L(C,D);var _=12*(C.year()-D.year())+(C.month()-D.month()),E=D.clone().add(_,f),z=C-E<0,Y=D.clone().add(_+(z?-1:1),f);return+(-(_+(C-E)/(z?E-Y:Y-E))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:p,w:h,d,D:b,h:u,m:c,s:l,ms:s,Q:y}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},$="en",T={};T[$]=M;var I="$isDayjsObject",N=function(L){return L instanceof V||!(!L||!L[I])},H=function L(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 L(Y[0])}else{var v=D.name;T[v]=D,E=v}return!_&&E&&($=E),E||!_&&$},A=function(L,D){if(N(L))return L.clone();var C=typeof D=="object"?D:{};return C.date=L,C.args=arguments,new V(C)},k=O;k.l=H,k.i=N,k.w=function(L,D){return A(L,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var V=(function(){function L(C){this.$L=H(C.locale,null,!0),this.parse(C),this.$x=this.$x||C.x||{},this[I]=!0}var D=L.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 v=Y[2]-1||0,j=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)):new Date(Y[1],v,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,j)}}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=A(C);return this.startOf(_)<=E&&E<=this.endOf(_)},D.isAfter=function(C,_){return A(C)<this.startOf(_)},D.isBefore=function(C,_){return this.endOf(_)<A(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),v=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)},j=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,q=this.$D,X="set"+(this.$u?"UTC":"");switch(Y){case p:return z?v(1,0):v(31,11);case f:return z?v(1,B):v(0,B+1);case h:var W=this.$locale().weekStart||0,K=(P<W?P+7:P)-W;return v(z?q-K:q+(6-K),B);case d:case b:return j(X+"Hours",0);case u:return j(X+"Minutes",1);case c:return j(X+"Seconds",2);case l:return j(X+"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":""),v=(E={},E[d]=Y+"Date",E[b]=Y+"Date",E[f]=Y+"Month",E[p]=Y+"FullYear",E[u]=Y+"Hours",E[c]=Y+"Minutes",E[l]=Y+"Seconds",E[s]=Y+"Milliseconds",E)[z],j=z===d?this.$D+(_-this.$W):_;if(z===f||z===p){var P=this.clone().set(b,1);P.$d[v](j),P.init(),this.$d=P.set(b,Math.min(this.$D,P.daysInMonth())).$d}else v&&this.$d[v](j);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(_),v=function(B){var q=A(z);return k.w(q.date(q.date()+Math.round(B*C)),z)};if(Y===f)return this.set(f,this.$M+C);if(Y===p)return this.set(p,this.$y+C);if(Y===d)return v(1);if(Y===h)return v(7);var j=(E={},E[c]=r,E[u]=o,E[l]=n,E)[Y]||1,P=this.$d.getTime()+C*j;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),v=this.$H,j=this.$m,P=this.$M,B=E.weekdays,q=E.months,X=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(v%12||12,F,"0")},J=X||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,q,3);case"MMMM":return W(q,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(v);case"HH":return k.s(v,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return J(v,j,!0);case"A":return J(v,j,!1);case"m":return String(j);case"mm":return k.s(j,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,v=k.p(_),j=A(C),P=(j.utcOffset()-this.utcOffset())*r,B=this-j,q=function(){return k.m(Y,j)};switch(v){case p:z=q()/12;break;case f:z=q();break;case y:z=q()/3;break;case h:z=(B-P)/6048e5;break;case d:z=(B-P)/864e5;break;case u:z=B/o;break;case c:z=B/r;break;case l:z=B/n;break;default:z=B}return E?z:k.a(z)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return T[this.$L]},D.locale=function(C,_){if(!C)return this.$L;var E=this.clone(),z=H(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()},L})(),G=V.prototype;return A.prototype=G,[["$ms",s],["$s",l],["$m",c],["$H",u],["$W",d],["$M",f],["$y",p],["$D",b]].forEach((function(L){G[L[1]]=function(D){return this.$g(D,L[0],L[1])}})),A.extend=function(L,D){return L.$i||(L(D,V,A),L.$i=!0),A},A.locale=H,A.isDayjs=N,A.unix=function(L){return A(1e3*L)},A.en=T[$],A.Ls=T,A.p={},A}))})(gt)),gt.exports}var Yc=Pc();const Mt=Ct(Yc);var pt={exports:{}},Fc=pt.exports,Vn;function Bc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(Fc,(function(){return function(n,r,o){n=n||{};var s=r.prototype,l={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 c(d,h,f,y){return s.fromToBase(d,h,f,y)}o.en.relativeTime=l,s.fromToBase=function(d,h,f,y,p){for(var b,m,x,w=f.$locale().relativeTime||l,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"}],R=M.length,O=0;O<R;O+=1){var $=M[O];$.d&&(b=y?o(d).diff(f,$.d,!0):f.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];p&&(T=p(""+T)),m=typeof I=="string"?I.replace("%d",T):I(T,h,$.l,x);break}}if(h)return m;var N=x?w.future:w.past;return typeof N=="function"?N(m):N.replace("%s",m)},s.to=function(d,h){return c(d,h,this,!0)},s.from=function(d,h){return c(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)}}}))})(pt)),pt.exports}var Hc=Bc();const Vc=Ct(Hc);var vt={exports:{}},Wc=vt.exports,Wn;function Uc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Wc,(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 l=o.prototype,c=l.format;s.en.formats=n,l.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,h=(function(f,y){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(p,b,m){var x=m&&m.toUpperCase();return b||y[m]||n[m]||y[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,M,R){return M||R.slice(1)}))}))})(u,d===void 0?{}:d);return c.call(this,h)}}}))})(vt)),vt.exports}var Gc=Uc();const qc=Ct(Gc);var mt={exports:{}},Xc=mt.exports,Un;function Kc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Xc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(l){var c=this,u=this.$locale();if(!this.isValid())return s.bind(this)(l);var d=this.$utils(),h=(l||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return d.s(c.week(),f==="w"?1:2,"0");case"W":case"WW":return d.s(c.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return d.s(String(c.$H===0?24:c.$H),f==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return f}}));return s.bind(this)(h)}}}))})(mt)),mt.exports}var Jc=Kc();const Zc=Ct(Jc);Mt.extend(Vc);Mt.extend(qc);Mt.extend(Zc);const Qc={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??Qc[t]):r}function el({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start",dateColor:l="gray.700",dateFontSize:c="16px",dateFontWeight:u="500",timeColor:d="gray.500",timeFontSize:h="12px",timeFontWeight:f="400"}){return i.jsxs(a.Stack,{gap:.5,align:s,children:[i.jsx(a.Text,{fontSize:c,fontWeight:u,color:l,children:Jt({value:e,variant:t,format:r})}),i.jsx(a.Text,{fontSize:h,fontWeight:f,color:d,children:Jt({value:e,variant:n,format:o})})]})}exports.DataTable=na;exports.Filters=sc;exports.MDSButton=cc;exports.MDSCheckbox=Tr;exports.MDSCombobox=mc;exports.MDSConfirmActionDialog=Ec;exports.MDSConfirmDeleteDialog=Nc;exports.MDSInput=Kt;exports.MDSRefreshButton=Ir;exports.MDSSelectBox=Mr;exports.RefreshButton=Ir;exports.StackedDateTime=el;exports.addPreset=Or;exports.deletePreset=kr;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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import re, { useLayoutEffect as mo, useEffect as H, useRef as X, useMemo as G, useCallback as de, useState as oe, createContext as mt, memo as bo, useReducer as xo, useContext as We, forwardRef as Cn, createElement as vn } from "react";
2
- import { Menu as $e, Checkbox as Ee, IconButton as Oe, Portal as Ge, Table as le, HStack as he, Select as Z, Pagination as zt, createListCollection as jr, Box as De, Text as U, ButtonGroup as yo, Skeleton as wo, Spinner as Rr, Popover as Gt, InputGroup as Er, InputElement as Wn, PopoverArrow as So, VStack as Le, Kbd as Bn, Input as Dn, Field as Ue, Slider as bt, Drawer as Ie, Tabs as Ut, Button as Be, CloseButton as jn, Combobox as je, useListCollection as Co, Span as Do, Dialog as ie, Stack as Pt } from "@chakra-ui/react";
2
+ import { Menu as $e, Checkbox as Re, IconButton as Te, Portal as Ge, Table as le, HStack as he, Select as Z, Pagination as zt, createListCollection as jr, Box as De, Text as U, ButtonGroup as yo, Skeleton as wo, Spinner as Rr, Popover as Gt, InputGroup as Er, InputElement as Wn, PopoverArrow as So, VStack as Le, Kbd as Bn, Input as Dn, Field as Ue, Slider as bt, Drawer as Ie, Tabs as Ut, Button as Be, CloseButton as jn, Combobox as Oe, useListCollection as Co, Span as Do, Dialog as ie, Stack as Pt } from "@chakra-ui/react";
3
3
  import { unstable_batchedUpdates as jt, createPortal as jo } from "react-dom";
4
4
  function Xt(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -675,7 +675,7 @@ function Wo() {
675
675
  [...t]
676
676
  );
677
677
  }
678
- const Re = /* @__PURE__ */ Object.freeze({
678
+ const je = /* @__PURE__ */ Object.freeze({
679
679
  x: 0,
680
680
  y: 0
681
681
  });
@@ -785,7 +785,7 @@ function $r(e, t) {
785
785
  return e && t ? {
786
786
  x: e.left - t.left,
787
787
  y: e.top - t.top
788
- } : Re;
788
+ } : je;
789
789
  }
790
790
  function Zo(e) {
791
791
  return function(n) {
@@ -1025,7 +1025,7 @@ function ls(e) {
1025
1025
  };
1026
1026
  }
1027
1027
  function zr(e) {
1028
- return e.reduce((t, n) => Qe(t, xn(n)), Re);
1028
+ return e.reduce((t, n) => Qe(t, xn(n)), je);
1029
1029
  }
1030
1030
  function cs(e) {
1031
1031
  return e.reduce((t, n) => t + kr(n), 0);
@@ -1156,7 +1156,7 @@ class Yr {
1156
1156
  activeNode: t,
1157
1157
  onStart: n
1158
1158
  } = this.props, r = t.node.current;
1159
- r && ds(r), n(Re);
1159
+ r && ds(r), n(je);
1160
1160
  }
1161
1161
  handleKeyDown(t) {
1162
1162
  if (Tn(t)) {
@@ -1184,7 +1184,7 @@ class Yr {
1184
1184
  } = r.current, f = u ? {
1185
1185
  x: u.left,
1186
1186
  y: u.top
1187
- } : Re;
1187
+ } : je;
1188
1188
  this.referenceCoordinates || (this.referenceCoordinates = f);
1189
1189
  const d = l(t, {
1190
1190
  active: n,
@@ -1302,7 +1302,7 @@ class $n {
1302
1302
  } = t, {
1303
1303
  target: l
1304
1304
  } = s;
1305
- this.props = t, this.events = n, this.document = nt(l), this.documentListeners = new ft(this.document), this.listeners = new ft(r), this.windowListeners = new ft(pe(l)), this.initialCoordinates = (o = bn(s)) != null ? o : Re, 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();
1305
+ this.props = t, this.events = n, this.document = nt(l), this.documentListeners = new ft(this.document), this.listeners = new ft(r), this.windowListeners = new ft(pe(l)), this.initialCoordinates = (o = bn(s)) != null ? o : je, 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();
1306
1306
  }
1307
1307
  attach() {
1308
1308
  const {
@@ -1368,7 +1368,7 @@ class $n {
1368
1368
  } = s;
1369
1369
  if (!o)
1370
1370
  return;
1371
- const c = (n = bn(t)) != null ? n : Re, u = Ft(o, c);
1371
+ const c = (n = bn(t)) != null ? n : je, u = Ft(o, c);
1372
1372
  if (!r && a) {
1373
1373
  if (Qn(a)) {
1374
1374
  if (a.tolerance != null && an(u, a.tolerance))
@@ -1862,7 +1862,7 @@ function Ms(e) {
1862
1862
  u?.removeEventListener("scroll", o);
1863
1863
  });
1864
1864
  }
1865
- }, [o, e]), G(() => e.length ? t ? Array.from(t.values()).reduce((s, l) => Qe(s, l), Re) : zr(e) : Re, [e, t]);
1865
+ }, [o, e]), G(() => e.length ? t ? Array.from(t.values()).reduce((s, l) => Qe(s, l), je) : zr(e) : je, [e, t]);
1866
1866
  }
1867
1867
  function or(e, t) {
1868
1868
  t === void 0 && (t = []);
@@ -1874,9 +1874,9 @@ function or(e, t) {
1874
1874
  // eslint-disable-next-line react-hooks/exhaustive-deps
1875
1875
  t
1876
1876
  ), H(() => {
1877
- const r = e !== Re;
1877
+ const r = e !== je;
1878
1878
  r && !n.current && (n.current = e), !r && n.current && (n.current = null);
1879
- }, [e]), n.current ? Ft(e, n.current) : Re;
1879
+ }, [e]), n.current ? Ft(e, n.current) : je;
1880
1880
  }
1881
1881
  function $s(e) {
1882
1882
  H(
@@ -2263,7 +2263,7 @@ function Gs(e) {
2263
2263
  }, [t, l, a, r, n]);
2264
2264
  }
2265
2265
  const Wr = /* @__PURE__ */ mt({
2266
- ...Re,
2266
+ ...je,
2267
2267
  scaleX: 1,
2268
2268
  scaleY: 1
2269
2269
  });
@@ -2369,7 +2369,7 @@ const Br = /* @__PURE__ */ bo(function(t) {
2369
2369
  const ye = A.get(k.current);
2370
2370
  if (!ye)
2371
2371
  return;
2372
- const be = ue.nativeEvent, _e = new me({
2372
+ const be = ue.nativeEvent, Ee = new me({
2373
2373
  active: k.current,
2374
2374
  activeNode: ye,
2375
2375
  event: be,
@@ -2381,16 +2381,16 @@ const Br = /* @__PURE__ */ bo(function(t) {
2381
2381
  if (!A.get(ae))
2382
2382
  return;
2383
2383
  const {
2384
- onDragAbort: Te
2384
+ onDragAbort: _e
2385
2385
  } = L.current, Ae = {
2386
2386
  id: ae
2387
2387
  };
2388
- Te?.(Ae), E({
2388
+ _e?.(Ae), E({
2389
2389
  type: "onDragAbort",
2390
2390
  event: Ae
2391
2391
  });
2392
2392
  },
2393
- onPending(ae, Ye, Te, Ae) {
2393
+ onPending(ae, Ye, _e, Ae) {
2394
2394
  if (!A.get(ae))
2395
2395
  return;
2396
2396
  const {
@@ -2398,7 +2398,7 @@ const Br = /* @__PURE__ */ bo(function(t) {
2398
2398
  } = L.current, Fe = {
2399
2399
  id: ae,
2400
2400
  constraint: Ye,
2401
- initialCoordinates: Te,
2401
+ initialCoordinates: _e,
2402
2402
  offset: Ae
2403
2403
  };
2404
2404
  it?.(Fe), E({
@@ -2410,8 +2410,8 @@ const Br = /* @__PURE__ */ bo(function(t) {
2410
2410
  const Ye = k.current;
2411
2411
  if (Ye == null)
2412
2412
  return;
2413
- const Te = A.get(Ye);
2414
- if (!Te)
2413
+ const _e = A.get(Ye);
2414
+ if (!_e)
2415
2415
  return;
2416
2416
  const {
2417
2417
  onDragStart: Ae
@@ -2419,7 +2419,7 @@ const Br = /* @__PURE__ */ bo(function(t) {
2419
2419
  activatorEvent: be,
2420
2420
  active: {
2421
2421
  id: Ye,
2422
- data: Te.data,
2422
+ data: _e.data,
2423
2423
  rect: V
2424
2424
  }
2425
2425
  };
@@ -2443,23 +2443,23 @@ const Br = /* @__PURE__ */ bo(function(t) {
2443
2443
  onEnd: Ze(ne.DragEnd),
2444
2444
  onCancel: Ze(ne.DragCancel)
2445
2445
  });
2446
- nn.current = _e;
2446
+ nn.current = Ee;
2447
2447
  function Ze(ae) {
2448
2448
  return async function() {
2449
2449
  const {
2450
- active: Te,
2450
+ active: _e,
2451
2451
  collisions: Ae,
2452
2452
  over: st,
2453
2453
  scrollAdjustedTranslate: it
2454
2454
  } = ce.current;
2455
2455
  let Fe = null;
2456
- if (Te && it) {
2456
+ if (_e && it) {
2457
2457
  const {
2458
2458
  cancelDrop: at
2459
2459
  } = L.current;
2460
2460
  Fe = {
2461
2461
  activatorEvent: be,
2462
- active: Te,
2462
+ active: _e,
2463
2463
  collisions: Ae,
2464
2464
  delta: it,
2465
2465
  over: st
@@ -2492,10 +2492,10 @@ const Br = /* @__PURE__ */ bo(function(t) {
2492
2492
  ye.dndKit || ye.defaultPrevented
2493
2493
  )
2494
2494
  return;
2495
- const _e = {
2495
+ const Ee = {
2496
2496
  active: be
2497
2497
  };
2498
- ue(me, ve.options, _e) === !0 && (ye.dndKit = {
2498
+ ue(me, ve.options, Ee) === !0 && (ye.dndKit = {
2499
2499
  capturedBy: ve.sensor
2500
2500
  }, k.current = Pe, Vn(me, ve));
2501
2501
  }, [A, Vn]), Hn = Ds(f, ho);
@@ -2545,11 +2545,11 @@ const Br = /* @__PURE__ */ bo(function(t) {
2545
2545
  return;
2546
2546
  const {
2547
2547
  onDragOver: be
2548
- } = L.current, _e = Pe.get(Yn), Ze = _e && _e.rect.current ? {
2549
- id: _e.id,
2550
- rect: _e.rect.current,
2551
- data: _e.data,
2552
- disabled: _e.disabled
2548
+ } = L.current, Ee = Pe.get(Yn), Ze = Ee && Ee.rect.current ? {
2549
+ id: Ee.id,
2550
+ rect: Ee.rect.current,
2551
+ data: Ee.data,
2552
+ disabled: Ee.disabled
2553
2553
  } : null, ae = {
2554
2554
  active: ue,
2555
2555
  activatorEvent: ve,
@@ -3771,14 +3771,14 @@ function x(e) {
3771
3771
  );
3772
3772
  });
3773
3773
  }
3774
- const fa = x($e.Trigger), ha = x($e.Positioner), ga = x($e.Content), pa = x($e.Item), va = x(Ee.Label), ma = x(Ee.HiddenInput), ba = x(Ee.Control);
3774
+ const fa = x($e.Trigger), ha = x($e.Positioner), ga = x($e.Content), pa = x($e.Item), va = x(Re.Label), ma = x(Re.HiddenInput), ba = x(Re.Control);
3775
3775
  function xa({ visibility: e, onToggle: t }) {
3776
3776
  const { sortableColumns: n } = St(xe);
3777
3777
  return /* @__PURE__ */ i.jsxs($e.Root, { closeOnSelect: !1, children: [
3778
- /* @__PURE__ */ i.jsx(fa, { asChild: !0, children: /* @__PURE__ */ i.jsx(Oe, { "aria-label": "Toggle columns", variant: "ghost", ml: "1", size: "xs", children: /* @__PURE__ */ i.jsx(Ki, { size: 18 }) }) }),
3778
+ /* @__PURE__ */ i.jsx(fa, { asChild: !0, children: /* @__PURE__ */ i.jsx(Te, { "aria-label": "Toggle columns", variant: "ghost", ml: "1", size: "xs", children: /* @__PURE__ */ i.jsx(Ki, { size: 18 }) }) }),
3779
3779
  /* @__PURE__ */ i.jsx(Ge, { children: /* @__PURE__ */ i.jsx(ha, { children: /* @__PURE__ */ i.jsx(ga, { minW: "220px", children: n.map((r) => {
3780
3780
  const o = !!e[r.id];
3781
- return /* @__PURE__ */ i.jsx(pa, { value: r.id, closeOnSelect: !1, children: /* @__PURE__ */ i.jsxs(Ee.Root, { checked: o, onCheckedChange: () => t(r.id), children: [
3781
+ return /* @__PURE__ */ i.jsx(pa, { value: r.id, closeOnSelect: !1, children: /* @__PURE__ */ i.jsxs(Re.Root, { checked: o, onCheckedChange: () => t(r.id), children: [
3782
3782
  /* @__PURE__ */ i.jsx(ma, {}),
3783
3783
  /* @__PURE__ */ i.jsx(ba, {}),
3784
3784
  /* @__PURE__ */ i.jsx(va, { children: r.label })
@@ -3919,12 +3919,12 @@ function ka({
3919
3919
  siblingCount: s,
3920
3920
  onPageChange: (c) => r && r(c.page),
3921
3921
  children: /* @__PURE__ */ i.jsxs(yo, { size: "sm", variant: "ghost", children: [
3922
- /* @__PURE__ */ i.jsx(Ra, { asChild: !0, children: /* @__PURE__ */ i.jsx(Oe, { "aria-label": "Previous page", children: /* @__PURE__ */ i.jsx(Ui, { size: 18 }) }) }),
3922
+ /* @__PURE__ */ i.jsx(Ra, { asChild: !0, children: /* @__PURE__ */ i.jsx(Te, { "aria-label": "Previous page", children: /* @__PURE__ */ i.jsx(Ui, { size: 18 }) }) }),
3923
3923
  /* @__PURE__ */ i.jsx(
3924
3924
  zt.Items,
3925
3925
  {
3926
3926
  render: (c) => /* @__PURE__ */ i.jsx(
3927
- Oe,
3927
+ Te,
3928
3928
  {
3929
3929
  variant: c.type === "page" && c.value === n ? "outline" : "ghost",
3930
3930
  "aria-current": c.type === "page" && c.value === n ? "page" : void 0,
@@ -3934,7 +3934,7 @@ function ka({
3934
3934
  )
3935
3935
  }
3936
3936
  ),
3937
- /* @__PURE__ */ i.jsx(Ea, { asChild: !0, children: /* @__PURE__ */ i.jsx(Oe, { "aria-label": "Next page", children: /* @__PURE__ */ i.jsx(qi, { size: 18 }) }) })
3937
+ /* @__PURE__ */ i.jsx(Ea, { asChild: !0, children: /* @__PURE__ */ i.jsx(Te, { "aria-label": "Next page", children: /* @__PURE__ */ i.jsx(qi, { size: 18 }) }) })
3938
3938
  ] })
3939
3939
  }
3940
3940
  )
@@ -3955,7 +3955,7 @@ function Pa({
3955
3955
  children: [
3956
3956
  n.filter((s) => r[s.id]).map((s) => /* @__PURE__ */ i.jsx(le.Cell, { children: o[s.id] }, s.id)),
3957
3957
  /* @__PURE__ */ i.jsx(le.Cell, { textAlign: "center", display: "flex", gap: 2, children: /* @__PURE__ */ i.jsxs($e.Root, { children: [
3958
- /* @__PURE__ */ i.jsx(za, { asChild: !0, children: /* @__PURE__ */ i.jsx(Oe, { "aria-label": "Open", variant: "ghost", size: "sm", children: /* @__PURE__ */ i.jsx(ta, { size: 16 }) }) }),
3958
+ /* @__PURE__ */ i.jsx(za, { asChild: !0, children: /* @__PURE__ */ i.jsx(Te, { "aria-label": "Open", variant: "ghost", size: "sm", children: /* @__PURE__ */ i.jsx(ta, { size: 16 }) }) }),
3959
3959
  /* @__PURE__ */ i.jsx(Ge, { children: /* @__PURE__ */ i.jsx(Na, { children: /* @__PURE__ */ i.jsx(La, { children: t.filter(
3960
3960
  (s) => typeof s.visible == "function" ? s.visible(o.__raw) : s.visible !== !1
3961
3961
  ).map((s) => /* @__PURE__ */ i.jsxs(
@@ -4081,7 +4081,7 @@ function Nc({
4081
4081
  }
4082
4082
  ) });
4083
4083
  }
4084
- const Fa = x(Ee.Root), Va = x(Ee.HiddenInput), Ha = x(Ee.Control), Wa = x(Ee.Label), Ba = ({
4084
+ const Fa = x(Re.Root), Va = x(Re.HiddenInput), Ha = x(Re.Control), Wa = x(Re.Label), Ba = ({
4085
4085
  value: e,
4086
4086
  onChange: t,
4087
4087
  size: n = "sm",
@@ -4257,7 +4257,7 @@ function Qa({
4257
4257
  },
4258
4258
  children: [
4259
4259
  /* @__PURE__ */ i.jsx(Ja, { asChild: !0, children: /* @__PURE__ */ i.jsx(
4260
- Oe,
4260
+ Te,
4261
4261
  {
4262
4262
  size: "sm",
4263
4263
  variant: "ghost",
@@ -4317,7 +4317,7 @@ function Qa({
4317
4317
  }
4318
4318
  ),
4319
4319
  s && /* @__PURE__ */ i.jsx(Wn, { children: /* @__PURE__ */ i.jsx(
4320
- Oe,
4320
+ Te,
4321
4321
  {
4322
4322
  size: "sm",
4323
4323
  variant: "ghost",
@@ -4435,7 +4435,7 @@ const el = x(Ue.Root), tl = x(Ue.Label), nl = x(Ue.HelperText), rl = x(Ue.ErrorT
4435
4435
  (o) => o.id === t ? n(o) : o
4436
4436
  );
4437
4437
  An(e, r);
4438
- }, Dl = x(Ee.Root), jl = x(Ee.HiddenInput), Rl = x(Ee.Control), El = x(bt.Root), _l = x(bt.Track), Tl = x(bt.Range), Ol = x(bt.Thumbs), Ml = x(bt.Control), $l = ({ filter: e, onVisibilityChange: t, onSizeChange: n }) => {
4438
+ }, Dl = x(Re.Root), jl = x(Re.HiddenInput), Rl = x(Re.Control), El = x(bt.Root), _l = x(bt.Track), Tl = x(bt.Range), Ol = x(bt.Thumbs), Ml = x(bt.Control), $l = ({ filter: e, onVisibilityChange: t, onSizeChange: n }) => {
4439
4439
  const { attributes: r, listeners: o, setNodeRef: s, transform: l, transition: a } = Kr({
4440
4440
  id: e.id
4441
4441
  }), c = {
@@ -4567,7 +4567,7 @@ const el = x(Ue.Root), tl = x(Ue.Label), nl = x(Ue.HelperText), rl = x(Ue.ErrorT
4567
4567
  });
4568
4568
  };
4569
4569
  return /* @__PURE__ */ i.jsx(he, { wrap: "wrap", children: /* @__PURE__ */ i.jsxs(Il, { size: e, open: u, onOpenChange: f, children: [
4570
- /* @__PURE__ */ i.jsx(kl, { asChild: !0, children: /* @__PURE__ */ i.jsxs(Oe, { "aria-label": "Open filters", variant: "outline", size: "xs", ml: 2, p: 2, children: [
4570
+ /* @__PURE__ */ i.jsx(kl, { asChild: !0, children: /* @__PURE__ */ i.jsxs(Te, { "aria-label": "Open filters", variant: "outline", size: "xs", ml: 2, p: 2, children: [
4571
4571
  /* @__PURE__ */ i.jsx(ra, { size: 16 }),
4572
4572
  "Filters"
4573
4573
  ] }) }),
@@ -4665,7 +4665,7 @@ const el = x(Ue.Root), tl = x(Ue.Label), nl = x(Ue.HelperText), rl = x(Ue.ErrorT
4665
4665
  }
4666
4666
  ),
4667
4667
  /* @__PURE__ */ i.jsx(
4668
- Oe,
4668
+ Te,
4669
4669
  {
4670
4670
  size: "xs",
4671
4671
  "aria-label": "Delete preset",
@@ -4773,9 +4773,7 @@ const el = x(Ue.Root), tl = x(Ue.Label), nl = x(Ue.HelperText), rl = x(Ue.ErrorT
4773
4773
  s
4774
4774
  ] })
4775
4775
  }
4776
- ), Gl = x(je.Root);
4777
- x(je.Label);
4778
- const Ul = x(je.Control), Xl = x(je.Input), ql = x(je.IndicatorGroup), Jl = x(je.ClearTrigger), Kl = x(je.Trigger), Zl = x(je.Positioner), Ql = x(je.Content);
4776
+ ), Gl = x(Oe.Root), Ul = x(Oe.Control), Xl = x(Oe.Input), ql = x(Oe.IndicatorGroup), Jl = x(Oe.ClearTrigger), Kl = x(Oe.Trigger), Zl = x(Oe.Positioner), Ql = x(Oe.Content);
4779
4777
  function Hc({
4780
4778
  label: e,
4781
4779
  size: t = "sm",
@@ -4824,6 +4822,7 @@ function Hc({
4824
4822
  onInputValueChange: (I) => {
4825
4823
  v?.(I.inputValue), R(I.inputValue);
4826
4824
  },
4825
+ value: c ? [l(c)] : [],
4827
4826
  onValueChange: (I) => {
4828
4827
  const O = I.value?.[0];
4829
4828
  if (!O) return;
@@ -4845,9 +4844,9 @@ function Hc({
4845
4844
  u ? /* @__PURE__ */ i.jsxs(he, { p: "2", children: [
4846
4845
  /* @__PURE__ */ i.jsx(Rr, { size: "xs", borderWidth: "1px" }),
4847
4846
  /* @__PURE__ */ i.jsx(Do, { children: "Loading..." })
4848
- ] }) : f ? /* @__PURE__ */ i.jsx(U, { p: "2", color: "red.500", fontSize: "sm", children: d || "Something went wrong" }) : $.items.map((I) => /* @__PURE__ */ i.jsxs(je.Item, { item: I, ...T, children: [
4847
+ ] }) : f ? /* @__PURE__ */ i.jsx(U, { p: "2", color: "red.500", fontSize: "sm", children: d || "Something went wrong" }) : $.items.map((I) => /* @__PURE__ */ i.jsxs(Oe.Item, { item: I, ...T, children: [
4849
4848
  a(I),
4850
- /* @__PURE__ */ i.jsx(je.ItemIndicator, {})
4849
+ /* @__PURE__ */ i.jsx(Oe.ItemIndicator, {})
4851
4850
  ] }, l(I))),
4852
4851
  h && !f && !u && /* @__PURE__ */ i.jsx(U, { p: "2", color: "fg.muted", fontSize: "sm", children: h })
4853
4852
  ] }) })
@@ -5002,7 +5001,7 @@ function Gc({
5002
5001
  }
5003
5002
  };
5004
5003
  return /* @__PURE__ */ i.jsx(
5005
- Oe,
5004
+ Te,
5006
5005
  {
5007
5006
  "aria-label": n,
5008
5007
  size: "xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdspl/mds-shared-ui",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Chakra UI v3 DataTable with sorting, pagination, column visibility & drag reorder",
5
5
  "author": "magadh",
6
6
  "license": "MIT",