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