django-admin-react 1.4.2__tar.gz → 1.4.3__tar.gz

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.
Files changed (27) hide show
  1. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/PKG-INFO +1 -1
  2. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/static/admin_react/.vite/manifest.json +3 -3
  3. django_admin_react-1.4.2/django_admin_react/static/admin_react/assets/ColumnLayoutModal-CDBehtvD.js → django_admin_react-1.4.3/django_admin_react/static/admin_react/assets/ColumnLayoutModal-DwY9cxn9.js +2 -2
  4. django_admin_react-1.4.2/django_admin_react/static/admin_react/assets/JsonViewer-C_gM_oEt.js → django_admin_react-1.4.3/django_admin_react/static/admin_react/assets/JsonViewer-Dpmbm5nH.js +1 -1
  5. django_admin_react-1.4.2/django_admin_react/static/admin_react/assets/index-_FJkJVGi.js → django_admin_react-1.4.3/django_admin_react/static/admin_react/assets/index-BLXojb04.js +1 -1
  6. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/static/admin_react/index.html +1 -1
  7. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/pyproject.toml +1 -1
  8. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/LICENSE +0 -0
  9. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/README.md +0 -0
  10. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/README.md +0 -0
  11. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/__init__.py +0 -0
  12. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/apps.py +0 -0
  13. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/audit.py +0 -0
  14. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/conf.py +0 -0
  15. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/pwa.py +0 -0
  16. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/static/admin_react/assets/index-CN1EPHGl.css +0 -0
  17. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/README.md +0 -0
  18. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/admin/base_site.html +0 -0
  19. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/admin_react/README.md +0 -0
  20. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/admin_react/index.html +0 -0
  21. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/admin_react/login.html +0 -0
  22. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/admin_react/sw.js +0 -0
  23. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templates/django_admin_react/_experience_toggle_strip.html +0 -0
  24. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templatetags/__init__.py +0 -0
  25. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/templatetags/experience_toggle.py +0 -0
  26. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/urls.py +0 -0
  27. {django_admin_react-1.4.2 → django_admin_react-1.4.3}/django_admin_react/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: django-admin-react
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: A drop-in React single-page admin for Django, driven entirely by ModelAdmin.
5
5
  License: MIT
6
6
  Keywords: django,admin,react,spa,tailwind
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "../../packages/details/src/JsonViewer.tsx": {
3
- "file": "assets/JsonViewer-C_gM_oEt.js",
3
+ "file": "assets/JsonViewer-Dpmbm5nH.js",
4
4
  "name": "JsonViewer",
5
5
  "src": "../../packages/details/src/JsonViewer.tsx",
6
6
  "isDynamicEntry": true,
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "index.html": {
12
- "file": "assets/index-_FJkJVGi.js",
12
+ "file": "assets/index-BLXojb04.js",
13
13
  "name": "index",
14
14
  "src": "index.html",
15
15
  "isEntry": true,
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
  "src/ColumnLayoutModal.tsx": {
25
- "file": "assets/ColumnLayoutModal-CDBehtvD.js",
25
+ "file": "assets/ColumnLayoutModal-DwY9cxn9.js",
26
26
  "name": "ColumnLayoutModal",
27
27
  "src": "src/ColumnLayoutModal.tsx",
28
28
  "isDynamicEntry": true,
@@ -1,5 +1,5 @@
1
- import{c as tt,d as c,R as $,r as ke,j as I,M as Nn,b as kn,a as Jt}from"./index-_FJkJVGi.js";const On=[["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"}]],Tn=tt("grip-vertical",On);const Ln=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],jn=tt("lock-open",Ln);const zn=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jt=tt("lock",zn);const $n=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Bn=tt("rotate-ccw",$n);function Pn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function B(e){var t,n;return e?xe(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=B(e);return e instanceof t}function Pe(e){return xe(e)?!1:e instanceof B(e).HTMLElement}function Qt(e){return e instanceof B(e).SVGElement}function we(e){return e?xe(e)?e.document:mt(e)?yt(e)?e:Pe(e)||Qt(e)?e.ownerDocument:document:document:document}const Z=nt?c.useLayoutEffect:c.useEffect;function xt(e){const t=c.useRef(e);return Z(()=>{t.current=e}),c.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 Fn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function je(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Z(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=xt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ht(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let lt={};function Xe(e,t){return c.useMemo(()=>{if(t)return t;const n=lt[e]==null?0:lt[e]+1;return lt[e]=n,e+"-"+n},[e,t])}function Zt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const ye=Zt(1),ze=Zt(-1);function Xn(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Un(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function gt(e){if(Un(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 Xn(e)?{x:e.clientX,y:e.clientY}:null}const $e=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[$e.Translate.toString(e),$e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),zt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Yn(e){return e.matches(zt)?e:e.querySelector(zt)}const Wn={display:"none"};function Vn(e){let{id:t,value:n}=e;return $.createElement("div",{id:t,style:Wn},n)}function Hn(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 $.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Kn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const en=c.createContext(null);function _n(e){const t=c.useContext(en);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Gn={draggable:`
1
+ import{c as tt,d as c,R as $,r as ke,j as I,M as kn,b as On,a as Jt}from"./index-BLXojb04.js";const Tn=[["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"}]],Qt=tt("grip-vertical",Tn);const Ln=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],jn=tt("lock-open",Ln);const zn=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jt=tt("lock",zn);const $n=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Bn=tt("rotate-ccw",$n);function Pn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function B(e){var t,n;return e?xe(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=B(e);return e instanceof t}function Pe(e){return xe(e)?!1:e instanceof B(e).HTMLElement}function Zt(e){return e instanceof B(e).SVGElement}function we(e){return e?xe(e)?e.document:mt(e)?yt(e)?e:Pe(e)||Zt(e)?e.ownerDocument:document:document:document}const Z=nt?c.useLayoutEffect:c.useEffect;function xt(e){const t=c.useRef(e);return Z(()=>{t.current=e}),c.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 Fn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function je(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Z(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=xt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ht(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let lt={};function Xe(e,t){return c.useMemo(()=>{if(t)return t;const n=lt[e]==null?0:lt[e]+1;return lt[e]=n,e+"-"+n},[e,t])}function en(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const ye=en(1),ze=en(-1);function Xn(e){return"clientX"in e&&"clientY"in e}function wt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Un(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function gt(e){if(Un(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 Xn(e)?{x:e.clientX,y:e.clientY}:null}const $e=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[$e.Translate.toString(e),$e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),zt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Yn(e){return e.matches(zt)?e:e.querySelector(zt)}const Wn={display:"none"};function Vn(e){let{id:t,value:n}=e;return $.createElement("div",{id:t,style:Wn},n)}function Hn(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 $.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Kn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const tn=c.createContext(null);function _n(e){const t=c.useContext(tn);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Gn={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
5
- `},Jn={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 Qn(e){let{announcements:t=Jn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Gn}=e;const{announce:i,announcement:s}=Kn(),a=Xe("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),_n(c.useMemo(()=>({onDragStart(d){let{active:g}=d;i(t.onDragStart({active:g}))},onDragMove(d){let{active:g,over:h}=d;t.onDragMove&&i(t.onDragMove({active:g,over:h}))},onDragOver(d){let{active:g,over:h}=d;i(t.onDragOver({active:g,over:h}))},onDragEnd(d){let{active:g,over:h}=d;i(t.onDragEnd({active:g,over:h}))},onDragCancel(d){let{active:g,over:h}=d;i(t.onDragCancel({active:g,over:h}))}}),[i,t])),!l)return null;const f=$.createElement($.Fragment,null,$.createElement(Vn,{id:r,value:o.draggable}),$.createElement(Hn,{id:a,announcement:s}));return n?ke.createPortal(f,n):f}var k;(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"})(k||(k={}));function Qe(){}function $t(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Zn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const _=Object.freeze({x:0,y:0});function tn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function er(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Bt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function rn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Pt(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 tr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=tn(Pt(l),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(nn)},nr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Bt(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Bt(l),f=o.reduce((g,h,x)=>g+tn(u[x],h),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(nn)};function rr(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,u=e.width*e.height,f=s*a,d=f/(l+u-f);return Number(d.toFixed(4))}return 0}const or=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=rr(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(er)};function ir(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function on(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:_}function sr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const ar=sr(1);function cr(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 lr(e,t,n){const r=cr(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const ur={ignoreTransform:!1};function De(e,t){t===void 0&&(t=ur);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=B(e).getComputedStyle(e);u&&(n=lr(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function Ft(e){return De(e,{ignoreTransform:!0})}function dr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fr(e,t){return t===void 0&&(t=B(e).getComputedStyle(e)),t.position==="fixed"}function hr(e,t){t===void 0&&(t=B(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function rt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pe(o)||Qt(o)||n.includes(o))return n;const i=B(e).getComputedStyle(o);return o!==e&&hr(o,i)&&n.push(o),fr(o,i)?n:r(o.parentNode)}return e?r(e):n}function sn(e){const[t]=rt(e,1);return t??null}function ut(e){return!nt||!e?null:xe(e)?e:mt(e)?yt(e)||e===we(e).scrollingElement?window:Pe(e)?e:null:null}function an(e){return xe(e)?e.scrollX:e.scrollLeft}function cn(e){return xe(e)?e.scrollY:e.scrollTop}function vt(e){return{x:an(e),y:cn(e)}}var T;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(T||(T={}));function ln(e){return!nt||!e?!1:e===document.scrollingElement}function un(e){const t={x:0,y:0},n=ln(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const gr={x:.2,y:.2};function vr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=gr);const{isTop:u,isBottom:f,isLeft:d,isRight:g}=un(e),h={x:0,y:0},x={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+p.height?(h.y=T.Backward,x.y=r*Math.abs((t.top+p.height-i)/p.height)):!f&&l>=t.bottom-p.height&&(h.y=T.Forward,x.y=r*Math.abs((t.bottom-p.height-l)/p.height)),!g&&a>=t.right-p.width?(h.x=T.Forward,x.x=r*Math.abs((t.right-p.width-a)/p.width)):!d&&s<=t.left+p.width&&(h.x=T.Backward,x.x=r*Math.abs((t.left+p.width-s)/p.width)),{direction:h,speed:x}}function pr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}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 dn(e){return e.reduce((t,n)=>ye(t,vt(n)),_)}function br(e){return e.reduce((t,n)=>t+an(n),0)}function mr(e){return e.reduce((t,n)=>t+cn(n),0)}function yr(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);sn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const xr=[["x",["left","right"],br],["y",["top","bottom"],mr]];class Dt{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=rt(n),o=dn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of xr)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oe{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 wr(e){const{EventTarget:t}=B(e);return e instanceof t?e:we(e)}function dt(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 V;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(V||(V={}));function Xt(e){e.preventDefault()}function Dr(e){e.stopPropagation()}var D;(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"})(D||(D={}));const fn={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},Rr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case D.Right:return{...n,x:n.x+25};case D.Left:return{...n,x:n.x-25};case D.Down:return{...n,y:n.y+25};case D.Up:return{...n,y:n.y-25}}};class Rt{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 Oe(we(n)),this.windowListeners=new Oe(B(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(V.Resize,this.handleCancel),this.windowListeners.add(V.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(V.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&yr(r),n(_)}handleKeyDown(t){if(wt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=fn,coordinateGetter:s=Rr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:_;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const g=ze(d,f),h={x:0,y:0},{scrollableAncestors:x}=r.current;for(const p of x){const m=t.code,{isTop:w,isRight:v,isLeft:b,isBottom:y,maxScroll:S,minScroll:C}=un(p),R=pr(p),E={x:Math.min(m===D.Right?R.right-R.width/2:R.right,Math.max(m===D.Right?R.left:R.left+R.width/2,d.x)),y:Math.min(m===D.Down?R.bottom-R.height/2:R.bottom,Math.max(m===D.Down?R.top:R.top+R.height/2,d.y))},N=m===D.Right&&!v||m===D.Left&&!b,O=m===D.Down&&!y||m===D.Up&&!w;if(N&&E.x!==d.x){const A=p.scrollLeft+g.x,H=m===D.Right&&A<=S.x||m===D.Left&&A>=C.x;if(H&&!g.y){p.scrollTo({left:A,behavior:a});return}H?h.x=p.scrollLeft-A:h.x=m===D.Right?p.scrollLeft-S.x:p.scrollLeft-C.x,h.x&&p.scrollBy({left:-h.x,behavior:a});break}else if(O&&E.y!==d.y){const A=p.scrollTop+g.y,H=m===D.Down&&A<=S.y||m===D.Up&&A>=C.y;if(H&&!g.x){p.scrollTo({top:A,behavior:a});return}H?h.y=p.scrollTop-A:h.y=m===D.Down?p.scrollTop-S.y:p.scrollTop-C.y,h.y&&p.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,ye(ze(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Rt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=fn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Ut(e){return!!(e&&"distance"in e)}function Yt(e){return!!(e&&"delay"in e)}class St{constructor(t,n,r){var o;r===void 0&&(r=wr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=we(s),this.documentListeners=new Oe(this.document),this.listeners=new Oe(r),this.windowListeners=new Oe(B(s)),this.initialCoordinates=(o=gt(i))!=null?o:_,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(V.Resize,this.handleCancel),this.windowListeners.add(V.DragStart,Xt),this.windowListeners.add(V.VisibilityChange,this.handleCancel),this.windowListeners.add(V.ContextMenu,Xt),this.documentListeners.add(V.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ut(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(V.Click,Dr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(V.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=gt(t))!=null?n:_,u=ze(o,l);if(!r&&a){if(Ut(a)){if(a.tolerance!=null&&dt(u,a.tolerance))return this.handleCancel();if(dt(u,a.distance))return this.handleStart()}if(Yt(a)&&dt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}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===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Sr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ct extends St{constructor(t){const{event:n}=t,r=we(n.target);super(t,Sr,r)}}Ct.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 Cr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class Er extends St{constructor(t){super(t,Cr,we(t.event.target))}}Er.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r?.({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mr extends St{constructor(t){super(t,ft)}static setup(){return window.addEventListener(ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,t)};function t(){}}}Mr.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 Te;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Te||(Te={}));var Ze;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ze||(Ze={}));function Ir(e){let{acceleration:t,activator:n=Te.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Ze.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:g}=e;const h=Nr({delta:d,disabled:!i}),[x,p]=Fn(),m=c.useRef({x:0,y:0}),w=c.useRef({x:0,y:0}),v=c.useMemo(()=>{switch(n){case Te.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Te.DraggableRect:return o}},[n,o,l]),b=c.useRef(null),y=c.useCallback(()=>{const C=b.current;if(!C)return;const R=m.current.x*w.current.x,E=m.current.y*w.current.y;C.scrollBy(R,E)},[]),S=c.useMemo(()=>a===Ze.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!i||!u.length||!v){p();return}for(const C of S){if(r?.(C)===!1)continue;const R=u.indexOf(C),E=f[R];if(!E)continue;const{direction:N,speed:O}=vr(C,E,v,t,g);for(const A of["x","y"])h[A][N[A]]||(O[A]=0,N[A]=0);if(O.x>0||O.y>0){p(),b.current=C,x(y,s),m.current=O,w.current=N;return}}m.current={x:0,y:0},w.current={x:0,y:0},p()},[t,y,r,p,i,s,JSON.stringify(v),JSON.stringify(h),x,u,S,f,JSON.stringify(g)])}const Ar={x:{[T.Backward]:!1,[T.Forward]:!1},y:{[T.Backward]:!1,[T.Forward]:!1}};function Nr(e){let{delta:t,disabled:n}=e;const r=ht(t);return Fe(o=>{if(n||!r||!o)return Ar;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[T.Backward]:o.x[T.Backward]||i.x===-1,[T.Forward]:o.x[T.Forward]||i.x===1},y:{[T.Backward]:o.y[T.Backward]||i.y===-1,[T.Forward]:o.y[T.Forward]||i.y===1}}},[n,t,r])}function kr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Or(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Be;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Be||(Be={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Wt=new Map;function Tr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,f=c.useRef(e),d=m(),g=je(d),h=c.useCallback(function(w){w===void 0&&(w=[]),!g.current&&s(v=>v===null?w:v.concat(w.filter(b=>!v.includes(b))))},[g]),x=c.useRef(null),p=Fe(w=>{if(d&&!n)return Wt;if(!w||w===Wt||f.current!==e||i!=null){const v=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){v.set(b.id,b.rect.current);continue}const y=b.node.current,S=y?new Dt(l(y),y):null;b.rect.current=S,S&&v.set(b.id,S)}return v}return w},[e,i,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||h()},[n,d]),c.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),c.useEffect(()=>{d||typeof a!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},a))},[a,d,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:i!=null};function m(){switch(u){case Be.Always:return!1;case Be.BeforeDragging:return n;default:return!n}}}function hn(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Lr(e,t){return hn(e,t)}function jr(e){let{callback:t,disabled:n}=e;const r=xt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function ot(e){let{callback:t,disabled:n}=e;const r=xt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function zr(e){return new Dt(De(e),e)}function Vt(e,t,n){t===void 0&&(t=zr);const[r,o]=c.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const s=jr({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=ot({callback:i});return Z(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function $r(e){const t=hn(e);return on(e,t)}const Ht=[];function Br(e){const t=c.useRef(e),n=Fe(r=>e?r&&r!==Ht&&e&&t.current&&e.parentNode===t.current.parentNode?r:rt(e):Ht,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Pr(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(i=>{const s=ut(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const u=ut(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const u=ut(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),_):dn(e):_,[e,t])}function Kt(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==_;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):_}function Fr(e){c.useEffect(()=>{if(!nt)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 Xr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function gn(e){return c.useMemo(()=>e?dr(e):null,[e])}const _t=[];function Ur(e,t){t===void 0&&(t=De);const[n]=e,r=gn(n?B(n):null),[o,i]=c.useState(_t);function s(){i(()=>e.length?e.map(l=>ln(l)?r:new Dt(t(l),l)):_t)}const a=ot({callback:s});return Z(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),o}function Yr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pe(t)?t:e}function Wr(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if(Pe(f)){r(d=>{const g=t(f);return d?{...d,width:g.width,height:g.height}:g});break}},[t]),i=ot({callback:o}),s=c.useCallback(u=>{const f=Yr(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,l]=Je(s);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Vr=[{sensor:Ct,options:{}},{sensor:Rt,options:{}}],Hr={current:{}},Ge={draggable:{measure:Ft},droppable:{measure:Ft,strategy:Be.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:De}};class Le 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 Kr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:Qe,windowRect:null,measuringScheduled:!1},_r={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qe,draggableNodes:new Map,over:null,measureDroppableContainers:Qe},it=c.createContext(_r),vn=c.createContext(Kr);function qr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Gr(e,t){switch(t.type){case k.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case k.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 k.DragEnd:case k.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case k.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case k.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case k.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Jr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(it),i=ht(r),s=ht(n?.id);return c.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!wt(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=Yn(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function Qr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Zr(e){return c.useMemo(()=>({draggable:{...Ge.draggable,...e?.draggable},droppable:{...Ge.droppable,...e?.droppable},dragOverlay:{...Ge.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function eo(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=c.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Z(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=on(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=sn(u);g&&g.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const pn=c.createContext({..._,scaleX:1,scaleY:1});var de;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(de||(de={}));const to=c.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:f=Vr,collisionDetection:d=or,measuring:g,modifiers:h,...x}=t;const p=c.useReducer(Gr,void 0,qr),[m,w]=p,[v,b]=qn(),[y,S]=c.useState(de.Uninitialized),C=y===de.Initialized,{draggable:{active:R,nodes:E,translate:N},droppable:{containers:O}}=m,A=R!=null?E.get(R):null,H=c.useRef({initial:null,translated:null}),K=c.useMemo(()=>{var j;return R!=null?{id:R,data:(j=A?.data)!=null?j:Hr,rect:H}:null},[R,A]),q=c.useRef(null),[Re,Ue]=c.useState(null),[P,Ye]=c.useState(null),ee=je(x,Object.values(x)),Se=Xe("DndDescribedBy",s),We=c.useMemo(()=>O.getEnabled(),[O]),z=Zr(g),{droppableRects:te,measureDroppableContainers:fe,measuringScheduled:Ce}=Tr(We,{dragging:C,dependencies:[N.x,N.y],config:z.droppable}),Y=kr(E,R),Ve=c.useMemo(()=>P?gt(P):null,[P]),ie=An(),ne=Lr(Y,z.draggable.measure);eo({activeNode:R!=null?E.get(R):null,config:ie.layoutShiftCompensation,initialRect:ne,measure:z.draggable.measure});const M=Vt(Y,z.draggable.measure,ne),Ee=Vt(Y?Y.parentElement:null),G=c.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=O.getNodeFor((n=G.current.over)==null?void 0:n.id),re=Wr({measure:z.dragOverlay.measure}),ge=(r=re.nodeRef.current)!=null?r:Y,ve=C?(o=re.rect)!=null?o:M:null,Mt=!!(re.nodeRef.current&&re.rect),It=$r(Mt?null:M),st=gn(ge?B(ge):null),se=Br(C?he??Y:null),He=Ur(se),Ke=Qr(h,{transform:{x:N.x-It.x,y:N.y-It.y,scaleX:1,scaleY:1},activatorEvent:P,active:K,activeNodeRect:M,containerNodeRect:Ee,draggingNodeRect:ve,over:G.current.over,overlayNodeRect:re.rect,scrollableAncestors:se,scrollableAncestorRects:He,windowRect:st}),At=Ve?ye(Ve,N):null,Nt=Pr(se),Dn=Kt(Nt),Rn=Kt(Nt,[M]),pe=ye(Ke,Dn),be=ve?ar(ve,Ke):null,Me=K&&be?d({active:K,collisionRect:be,droppableRects:te,droppableContainers:We,pointerCoordinates:At}):null,kt=rn(Me,"id"),[ae,Ot]=c.useState(null),Sn=Mt?Ke:ye(Ke,Rn),Cn=ir(Sn,(i=ae?.rect)!=null?i:null,M),at=c.useRef(null),Tt=c.useCallback((j,F)=>{let{sensor:X,options:ce}=F;if(q.current==null)return;const W=E.get(q.current);if(!W)return;const U=j.nativeEvent,J=new X({active:q.current,activeNode:W,event:U,options:ce,context:G,onAbort(L){if(!E.get(L))return;const{onDragAbort:Q}=ee.current,oe={id:L};Q?.(oe),v({type:"onDragAbort",event:oe})},onPending(L,le,Q,oe){if(!E.get(L))return;const{onDragPending:Ae}=ee.current,ue={id:L,constraint:le,initialCoordinates:Q,offset:oe};Ae?.(ue),v({type:"onDragPending",event:ue})},onStart(L){const le=q.current;if(le==null)return;const Q=E.get(le);if(!Q)return;const{onDragStart:oe}=ee.current,Ie={activatorEvent:U,active:{id:le,data:Q.data,rect:H}};ke.unstable_batchedUpdates(()=>{oe?.(Ie),S(de.Initializing),w({type:k.DragStart,initialCoordinates:L,active:le}),v({type:"onDragStart",event:Ie}),Ue(at.current),Ye(U)})},onMove(L){w({type:k.DragMove,coordinates:L})},onEnd:me(k.DragEnd),onCancel:me(k.DragCancel)});at.current=J;function me(L){return async function(){const{active:Q,collisions:oe,over:Ie,scrollAdjustedTranslate:Ae}=G.current;let ue=null;if(Q&&Ae){const{cancelDrop:Ne}=ee.current;ue={activatorEvent:U,active:Q,collisions:oe,delta:Ae,over:Ie},L===k.DragEnd&&typeof Ne=="function"&&await Promise.resolve(Ne(ue))&&(L=k.DragCancel)}q.current=null,ke.unstable_batchedUpdates(()=>{w({type:L}),S(de.Uninitialized),Ot(null),Ue(null),Ye(null),at.current=null;const Ne=L===k.DragEnd?"onDragEnd":"onDragCancel";if(ue){const ct=ee.current[Ne];ct?.(ue),v({type:Ne,event:ue})}})}}},[E]),En=c.useCallback((j,F)=>(X,ce)=>{const W=X.nativeEvent,U=E.get(ce);if(q.current!==null||!U||W.dndKit||W.defaultPrevented)return;const J={active:U};j(X,F.options,J)===!0&&(W.dndKit={capturedBy:F.sensor},q.current=ce,Tt(X,F))},[E,Tt]),Lt=Or(f,En);Fr(f),Z(()=>{M&&y===de.Initializing&&S(de.Initialized)},[M,y]),c.useEffect(()=>{const{onDragMove:j}=ee.current,{active:F,activatorEvent:X,collisions:ce,over:W}=G.current;if(!F||!X)return;const U={active:F,activatorEvent:X,collisions:ce,delta:{x:pe.x,y:pe.y},over:W};ke.unstable_batchedUpdates(()=>{j?.(U),v({type:"onDragMove",event:U})})},[pe.x,pe.y]),c.useEffect(()=>{const{active:j,activatorEvent:F,collisions:X,droppableContainers:ce,scrollAdjustedTranslate:W}=G.current;if(!j||q.current==null||!F||!W)return;const{onDragOver:U}=ee.current,J=ce.get(kt),me=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:j,activatorEvent:F,collisions:X,delta:{x:W.x,y:W.y},over:me};ke.unstable_batchedUpdates(()=>{Ot(me),U?.(L),v({type:"onDragOver",event:L})})},[kt]),Z(()=>{G.current={activatorEvent:P,active:K,activeNode:Y,collisionRect:be,collisions:Me,droppableRects:te,draggableNodes:E,draggingNode:ge,draggingNodeRect:ve,droppableContainers:O,over:ae,scrollableAncestors:se,scrollAdjustedTranslate:pe},H.current={initial:ve,translated:be}},[K,Y,Me,be,E,ge,ve,te,O,ae,se,pe]),Ir({...ie,delta:N,draggingRect:be,pointerCoordinates:At,scrollableAncestors:se,scrollableAncestorRects:He});const Mn=c.useMemo(()=>({active:K,activeNode:Y,activeNodeRect:M,activatorEvent:P,collisions:Me,containerNodeRect:Ee,dragOverlay:re,draggableNodes:E,droppableContainers:O,droppableRects:te,over:ae,measureDroppableContainers:fe,scrollableAncestors:se,scrollableAncestorRects:He,measuringConfiguration:z,measuringScheduled:Ce,windowRect:st}),[K,Y,M,P,Me,Ee,re,E,O,te,ae,fe,se,He,z,Ce,st]),In=c.useMemo(()=>({activatorEvent:P,activators:Lt,active:K,activeNodeRect:M,ariaDescribedById:{draggable:Se},dispatch:w,draggableNodes:E,over:ae,measureDroppableContainers:fe}),[P,Lt,K,M,w,Se,E,ae,fe]);return $.createElement(en.Provider,{value:b},$.createElement(it.Provider,{value:In},$.createElement(vn.Provider,{value:Mn},$.createElement(pn.Provider,{value:Cn},u)),$.createElement(Jr,{disabled:a?.restoreFocus===!1})),$.createElement(Qn,{...a,hiddenTextDescribedById:Se}));function An(){const j=Re?.autoScrollEnabled===!1,F=typeof l=="object"?l.enabled===!1:l===!1,X=C&&!j&&!F;return typeof l=="object"?{...l,enabled:X}:{enabled:X}}}),no=c.createContext(null),qt="button",ro="Draggable";function oo(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe(ro),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:g}=c.useContext(it),{role:h=qt,roleDescription:x="draggable",tabIndex:p=0}=o??{},m=l?.id===t,w=c.useContext(m?pn:no),[v,b]=Je(),[y,S]=Je(),C=Xr(s,t),R=je(n);Z(()=>(d.set(t,{id:t,key:i,node:v,activatorNode:y,data:R}),()=>{const N=d.get(t);N&&N.key===i&&d.delete(t)}),[d,t]);const E=c.useMemo(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":m&&h===qt?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[r,h,p,m,x,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:E,isDragging:m,listeners:r?void 0:C,node:v,over:g,setNodeRef:b,setActivatorNodeRef:S,transform:w}}function io(){return c.useContext(vn)}const so="Droppable",ao={timeout:25};function co(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xe(so),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(it),f=c.useRef({disabled:n}),d=c.useRef(!1),g=c.useRef(null),h=c.useRef(null),{disabled:x,updateMeasurementsFor:p,timeout:m}={...ao,...o},w=je(p??r),v=c.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),h.current=null},m)},[m]),b=ot({callback:v,disabled:x||!s}),y=c.useCallback((E,N)=>{b&&(N&&(b.unobserve(N),d.current=!1),E&&b.observe(E))},[b]),[S,C]=Je(y),R=je(t);return c.useEffect(()=>{!b||!S.current||(b.disconnect(),d.current=!1,b.observe(S.current))},[S,b]),c.useEffect(()=>(a({type:k.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:g,data:R}}),()=>a({type:k.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(a({type:k.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:g,isOver:l?.id===r,node:S,over:l,setNodeRef:C}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function lo(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function _e(e){return e!==null&&e>=0}function uo(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 fo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const bn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Et(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},qe={scaleX:1,scaleY:1},ho=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...qe}:null}const l=go(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...qe}:o<n&&o>=s?{x:0,y:a.height+l,...qe}:{x:0,y:0,...qe}};function go(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const mn="Sortable",yn=$.createContext({activeIndex:-1,containerId:mn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bn,disabled:{draggable:!1,droppable:!1}});function vo(e){let{children:t,id:n,items:r,strategy:o=bn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:f}=io(),d=Xe(mn,n),g=a.rect!==null,h=c.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),x=s!=null,p=s?h.indexOf(s.id):-1,m=u?h.indexOf(u.id):-1,w=c.useRef(h),v=!uo(h,w.current),b=m!==-1&&p===-1||v,y=fo(i);Z(()=>{v&&x&&f(h)},[v,h,x,f]),c.useEffect(()=>{w.current=h},[h]);const S=c.useMemo(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:b,items:h,overIndex:m,useDragOverlay:g,sortedRects:lo(h,l),strategy:o}),[p,d,y.draggable,y.droppable,b,h,m,l,g,o]);return $.createElement(yn.Provider,{value:S},t)}const po=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},bo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},mo={duration:200,easing:"ease"},xn="transform",yo=$e.Transition.toString({property:xn,duration:0,easing:"linear"}),xo={roleDescription:"sortable"};function wo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=c.useState(null),a=c.useRef(n);return Z(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=De(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{i&&s(null)},[i]),i}function Do(e){let{animateLayoutChanges:t=bo,attributes:n,disabled:r,data:o,getNewIndex:i=po,id:s,strategy:a,resizeObserverConfig:l,transition:u=mo}=e;const{items:f,containerId:d,activeIndex:g,disabled:h,disableTransforms:x,sortedRects:p,overIndex:m,useDragOverlay:w,strategy:v}=c.useContext(yn),b=Ro(r,h),y=f.indexOf(s),S=c.useMemo(()=>({sortable:{containerId:d,index:y,items:f},...o}),[d,o,y,f]),C=c.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:R,node:E,isOver:N,setNodeRef:O}=co({id:s,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:A,activatorEvent:H,activeNodeRect:K,attributes:q,setNodeRef:Re,listeners:Ue,isDragging:P,over:Ye,setActivatorNodeRef:ee,transform:Se}=oo({id:s,data:S,attributes:{...xo,...n},disabled:b.draggable}),We=Pn(O,Re),z=!!A,te=z&&!x&&_e(g)&&_e(m),fe=!w&&P,Ce=fe&&te?Se:null,Ve=te?Ce??(a??v)({rects:p,activeNodeRect:K,activeIndex:g,overIndex:m,index:y}):null,ie=_e(g)&&_e(m)?i({id:s,items:f,activeIndex:g,overIndex:m}):y,ne=A?.id,M=c.useRef({activeId:ne,items:f,newIndex:ie,containerId:d}),Ee=f!==M.current.items,G=t({active:A,containerId:d,isDragging:P,isSorting:z,id:s,index:y,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),he=wo({disabled:!G,index:y,node:E,rect:R});return c.useEffect(()=>{z&&M.current.newIndex!==ie&&(M.current.newIndex=ie),d!==M.current.containerId&&(M.current.containerId=d),f!==M.current.items&&(M.current.items=f)},[z,ie,d,f]),c.useEffect(()=>{if(ne===M.current.activeId)return;if(ne&&!M.current.activeId){M.current.activeId=ne;return}const ge=setTimeout(()=>{M.current.activeId=ne},50);return()=>clearTimeout(ge)},[ne]),{active:A,activeIndex:g,attributes:q,data:S,rect:R,index:y,newIndex:ie,items:f,isOver:N,isSorting:z,isDragging:P,listeners:Ue,node:E,overIndex:m,over:Ye,setNodeRef:We,setActivatorNodeRef:ee,setDroppableNodeRef:O,setDraggableNodeRef:Re,transform:he??Ve,transition:re()};function re(){if(he||Ee&&M.current.newIndex===y)return yo;if(!(fe&&!wt(H)||!u)&&(z||G))return $e.Transition.toString({...u,property:xn})}}function Ro(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}}function et(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const So=[D.Down,D.Right,D.Up,D.Left],Co=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(So.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(e.code){case D.Down:r.top<g.top&&l.push(d);break;case D.Up:r.top>g.top&&l.push(d);break;case D.Left:r.left>g.left&&l.push(d);break;case D.Right:r.left<g.left&&l.push(d);break}});const u=nr({collisionRect:r,droppableRects:o,droppableContainers:l});let f=rn(u,"id");if(f===s?.id&&u.length>1&&(f=u[1].id),f!=null){const d=i.get(n.id),g=i.get(f),h=g?o.get(g.id):null,x=g?.node.current;if(x&&h&&d&&g){const m=rt(x).some((C,R)=>a[R]!==C),w=wn(d,g),v=Eo(d,g),b=m||!w?{x:0,y:0}:{x:v?r.width-h.width:0,y:v?r.height-h.height:0},y={x:h.left,y:h.top};return b.x&&b.y?y:ze(y,b)}}}};function wn(e,t){return!et(e)||!et(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Eo(e,t){return!et(e)||!et(t)||!wn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Mo(e,t){const n=e.indexOf(t);return n===-1?new Set:new Set(e.slice(0,n+1))}function Io(e,t,n){const r=e.indexOf(n);if(r===-1)return new Set(t);const o=new Set;for(let i=0;i<r;i+=1){const s=e[i];s!==void 0&&t.has(s)&&o.add(s)}return o}function ko({onClose:e,orderedDescriptors:t,isPk:n,hiddenCols:r,lockedCols:o,visibleColumnCount:i,onToggle:s,onReorder:a,onSetLocked:l,isCustomised:u,onReset:f}){const d=Zn($t(Ct,{activationConstraint:{distance:4}}),$t(Rt,{coordinateGetter:Co})),g=t.find(v=>n(v.name)),h=t.filter(v=>!n(v.name)),x=h.map(v=>v.name),p=x.filter(v=>!o.has(v));function m(v){const{active:b,over:y}=v;if(!y||b.id===y.id)return;const S=x.indexOf(String(b.id)),C=x.indexOf(String(y.id));S===-1||C===-1||a(Et(x,S,C))}function w(v){const b=o.has(v)?Io(x,o,v):Mo(x,v);l(b)}return I.jsxs(Nn,{title:"Layout",onClose:e,children:[I.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[I.jsx("p",{className:"text-xs text-gray-500",children:"Toggle to show or hide. Lock to freeze a column to the left (frozen columns must be contiguous from the id). Drag the handle to reorder (keyboard: Tab to a handle, then Space + arrow keys + Space to drop)."}),I.jsx(kn,{isDirty:u,onReset:f,label:"Reset",disabledHint:"Layout is already at default",icon:I.jsx(Bn,{className:"h-4 w-4","aria-hidden":!0}),title:"Reset to the default layout"})]}),I.jsxs("ul",{className:"space-y-1",children:[g?I.jsx(Gt,{label:g.label,tooltip:"The primary-key column always shows first and is always frozen."}):null,h.filter(v=>o.has(v.name)).map(v=>{const b=!r.has(v.name),y=b&&i<=1;return I.jsx(Gt,{label:v.label,tooltip:"Locked. Unlock to drag or hide this column. Unlocking auto-unlocks every column to its right.",checked:b,checkboxDisabled:y,onToggle:()=>s(v.name,i),onUnlock:()=>w(v.name)},v.name)}),I.jsx(to,{sensors:d,collisionDetection:tr,onDragEnd:m,children:I.jsx(vo,{items:p,strategy:ho,children:h.filter(v=>!o.has(v.name)).map(v=>{const b=!r.has(v.name),y=b&&i<=1;return I.jsx(Ao,{id:v.name,label:v.label,visible:b,disabled:y,onToggle:()=>s(v.name,i),onLock:()=>w(v.name)},v.name)})})})]})]})}function Gt({label:e,tooltip:t,checked:n,checkboxDisabled:r,onToggle:o,onUnlock:i}){return I.jsxs("li",{className:"flex items-center gap-2 rounded border border-transparent bg-gray-50 px-1 py-1","aria-label":`${e} (locked)`,children:[i?I.jsx("button",{type:"button",onClick:i,"aria-label":`Unlock ${e}`,title:t,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:I.jsx(jt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):I.jsx("span",{className:"inline-flex h-5 w-5 shrink-0 items-center justify-center text-gray-400",title:t,children:I.jsx(jt,{className:"h-3.5 w-3.5","aria-hidden":!0})}),I.jsxs("label",{className:`flex flex-1 items-center gap-2 text-sm ${n===!1?"text-gray-400":"text-gray-500"}`,children:[I.jsx(Jt,{checked:n??!0,disabled:o===void 0||(r??!1),onChange:o??(()=>{})}),I.jsx("span",{title:t,children:e})]})]})}function Ao({id:e,label:t,visible:n,disabled:r,onToggle:o,onLock:i}){const{attributes:s,listeners:a,setNodeRef:l,setActivatorNodeRef:u,transform:f,transition:d,isDragging:g}=Do({id:e}),h={transform:$e.Transform.toString(f),transition:d};return I.jsxs("li",{ref:l,style:h,className:["flex items-center gap-2 rounded border px-1 py-1",g?"z-10 border-blue-300 bg-white shadow-lg":"border-transparent hover:border-gray-200"].join(" "),children:[I.jsx("button",{ref:u,type:"button","aria-label":`Reorder ${t}`,title:`Drag to reorder ${t}`,className:"cursor-grab touch-none rounded p-0.5 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:cursor-grabbing",...s,...a,children:I.jsx(Tn,{className:"h-4 w-4 shrink-0","aria-hidden":!0})}),I.jsx("button",{type:"button",onClick:i,"aria-label":`Lock ${t}`,title:"Lock to freeze this column to the left. Locked columns must be contiguous, so this also locks every column above it.",className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:I.jsx(jn,{className:"h-3.5 w-3.5","aria-hidden":!0})}),I.jsxs("label",{className:`flex flex-1 items-center gap-2 text-sm ${r?"text-gray-400":"text-gray-800"}`,children:[I.jsx(Jt,{checked:n,disabled:r,onChange:o}),t]})]})}export{ko as default,Mo as lockThrough,Io as unlockFrom};
5
+ `},Jn={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 Qn(e){let{announcements:t=Jn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Gn}=e;const{announce:i,announcement:s}=Kn(),a=Xe("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),_n(c.useMemo(()=>({onDragStart(d){let{active:g}=d;i(t.onDragStart({active:g}))},onDragMove(d){let{active:g,over:h}=d;t.onDragMove&&i(t.onDragMove({active:g,over:h}))},onDragOver(d){let{active:g,over:h}=d;i(t.onDragOver({active:g,over:h}))},onDragEnd(d){let{active:g,over:h}=d;i(t.onDragEnd({active:g,over:h}))},onDragCancel(d){let{active:g,over:h}=d;i(t.onDragCancel({active:g,over:h}))}}),[i,t])),!l)return null;const f=$.createElement($.Fragment,null,$.createElement(Vn,{id:r,value:o.draggable}),$.createElement(Hn,{id:a,announcement:s}));return n?ke.createPortal(f,n):f}var k;(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"})(k||(k={}));function Qe(){}function $t(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Zn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const _=Object.freeze({x:0,y:0});function nn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function er(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Bt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function on(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Pt(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 tr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=nn(Pt(l),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(rn)},nr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Bt(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Bt(l),f=o.reduce((g,h,x)=>g+nn(u[x],h),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(rn)};function rr(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,u=e.width*e.height,f=s*a,d=f/(l+u-f);return Number(d.toFixed(4))}return 0}const or=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=rr(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(er)};function ir(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function sn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:_}function sr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const ar=sr(1);function cr(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 lr(e,t,n){const r=cr(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const ur={ignoreTransform:!1};function De(e,t){t===void 0&&(t=ur);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=B(e).getComputedStyle(e);u&&(n=lr(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function Ft(e){return De(e,{ignoreTransform:!0})}function dr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fr(e,t){return t===void 0&&(t=B(e).getComputedStyle(e)),t.position==="fixed"}function hr(e,t){t===void 0&&(t=B(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function rt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pe(o)||Zt(o)||n.includes(o))return n;const i=B(e).getComputedStyle(o);return o!==e&&hr(o,i)&&n.push(o),fr(o,i)?n:r(o.parentNode)}return e?r(e):n}function an(e){const[t]=rt(e,1);return t??null}function ut(e){return!nt||!e?null:xe(e)?e:mt(e)?yt(e)||e===we(e).scrollingElement?window:Pe(e)?e:null:null}function cn(e){return xe(e)?e.scrollX:e.scrollLeft}function ln(e){return xe(e)?e.scrollY:e.scrollTop}function vt(e){return{x:cn(e),y:ln(e)}}var T;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(T||(T={}));function un(e){return!nt||!e?!1:e===document.scrollingElement}function dn(e){const t={x:0,y:0},n=un(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const gr={x:.2,y:.2};function vr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=gr);const{isTop:u,isBottom:f,isLeft:d,isRight:g}=dn(e),h={x:0,y:0},x={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+p.height?(h.y=T.Backward,x.y=r*Math.abs((t.top+p.height-i)/p.height)):!f&&l>=t.bottom-p.height&&(h.y=T.Forward,x.y=r*Math.abs((t.bottom-p.height-l)/p.height)),!g&&a>=t.right-p.width?(h.x=T.Forward,x.x=r*Math.abs((t.right-p.width-a)/p.width)):!d&&s<=t.left+p.width&&(h.x=T.Backward,x.x=r*Math.abs((t.left+p.width-s)/p.width)),{direction:h,speed:x}}function pr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}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 fn(e){return e.reduce((t,n)=>ye(t,vt(n)),_)}function br(e){return e.reduce((t,n)=>t+cn(n),0)}function mr(e){return e.reduce((t,n)=>t+ln(n),0)}function yr(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);an(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const xr=[["x",["left","right"],br],["y",["top","bottom"],mr]];class Dt{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=rt(n),o=fn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of xr)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oe{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 wr(e){const{EventTarget:t}=B(e);return e instanceof t?e:we(e)}function dt(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 V;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(V||(V={}));function Xt(e){e.preventDefault()}function Dr(e){e.stopPropagation()}var D;(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"})(D||(D={}));const hn={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},Rr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case D.Right:return{...n,x:n.x+25};case D.Left:return{...n,x:n.x-25};case D.Down:return{...n,y:n.y+25};case D.Up:return{...n,y:n.y-25}}};class Rt{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 Oe(we(n)),this.windowListeners=new Oe(B(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(V.Resize,this.handleCancel),this.windowListeners.add(V.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(V.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&yr(r),n(_)}handleKeyDown(t){if(wt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=hn,coordinateGetter:s=Rr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:_;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const g=ze(d,f),h={x:0,y:0},{scrollableAncestors:x}=r.current;for(const p of x){const m=t.code,{isTop:w,isRight:v,isLeft:b,isBottom:y,maxScroll:S,minScroll:C}=dn(p),R=pr(p),E={x:Math.min(m===D.Right?R.right-R.width/2:R.right,Math.max(m===D.Right?R.left:R.left+R.width/2,d.x)),y:Math.min(m===D.Down?R.bottom-R.height/2:R.bottom,Math.max(m===D.Down?R.top:R.top+R.height/2,d.y))},A=m===D.Right&&!v||m===D.Left&&!b,O=m===D.Down&&!y||m===D.Up&&!w;if(A&&E.x!==d.x){const N=p.scrollLeft+g.x,H=m===D.Right&&N<=S.x||m===D.Left&&N>=C.x;if(H&&!g.y){p.scrollTo({left:N,behavior:a});return}H?h.x=p.scrollLeft-N:h.x=m===D.Right?p.scrollLeft-S.x:p.scrollLeft-C.x,h.x&&p.scrollBy({left:-h.x,behavior:a});break}else if(O&&E.y!==d.y){const N=p.scrollTop+g.y,H=m===D.Down&&N<=S.y||m===D.Up&&N>=C.y;if(H&&!g.x){p.scrollTo({top:N,behavior:a});return}H?h.y=p.scrollTop-N:h.y=m===D.Down?p.scrollTop-S.y:p.scrollTop-C.y,h.y&&p.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,ye(ze(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Rt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=hn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Ut(e){return!!(e&&"distance"in e)}function Yt(e){return!!(e&&"delay"in e)}class St{constructor(t,n,r){var o;r===void 0&&(r=wr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=we(s),this.documentListeners=new Oe(this.document),this.listeners=new Oe(r),this.windowListeners=new Oe(B(s)),this.initialCoordinates=(o=gt(i))!=null?o:_,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(V.Resize,this.handleCancel),this.windowListeners.add(V.DragStart,Xt),this.windowListeners.add(V.VisibilityChange,this.handleCancel),this.windowListeners.add(V.ContextMenu,Xt),this.documentListeners.add(V.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ut(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(V.Click,Dr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(V.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=gt(t))!=null?n:_,u=ze(o,l);if(!r&&a){if(Ut(a)){if(a.tolerance!=null&&dt(u,a.tolerance))return this.handleCancel();if(dt(u,a.distance))return this.handleStart()}if(Yt(a)&&dt(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}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===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Sr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ct extends St{constructor(t){const{event:n}=t,r=we(n.target);super(t,Sr,r)}}Ct.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 Cr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class Er extends St{constructor(t){super(t,Cr,we(t.event.target))}}Er.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r?.({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mr extends St{constructor(t){super(t,ft)}static setup(){return window.addEventListener(ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,t)};function t(){}}}Mr.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 Te;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Te||(Te={}));var Ze;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ze||(Ze={}));function Ir(e){let{acceleration:t,activator:n=Te.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Ze.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:g}=e;const h=Ar({delta:d,disabled:!i}),[x,p]=Fn(),m=c.useRef({x:0,y:0}),w=c.useRef({x:0,y:0}),v=c.useMemo(()=>{switch(n){case Te.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Te.DraggableRect:return o}},[n,o,l]),b=c.useRef(null),y=c.useCallback(()=>{const C=b.current;if(!C)return;const R=m.current.x*w.current.x,E=m.current.y*w.current.y;C.scrollBy(R,E)},[]),S=c.useMemo(()=>a===Ze.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!i||!u.length||!v){p();return}for(const C of S){if(r?.(C)===!1)continue;const R=u.indexOf(C),E=f[R];if(!E)continue;const{direction:A,speed:O}=vr(C,E,v,t,g);for(const N of["x","y"])h[N][A[N]]||(O[N]=0,A[N]=0);if(O.x>0||O.y>0){p(),b.current=C,x(y,s),m.current=O,w.current=A;return}}m.current={x:0,y:0},w.current={x:0,y:0},p()},[t,y,r,p,i,s,JSON.stringify(v),JSON.stringify(h),x,u,S,f,JSON.stringify(g)])}const Nr={x:{[T.Backward]:!1,[T.Forward]:!1},y:{[T.Backward]:!1,[T.Forward]:!1}};function Ar(e){let{delta:t,disabled:n}=e;const r=ht(t);return Fe(o=>{if(n||!r||!o)return Nr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[T.Backward]:o.x[T.Backward]||i.x===-1,[T.Forward]:o.x[T.Forward]||i.x===1},y:{[T.Backward]:o.y[T.Backward]||i.y===-1,[T.Forward]:o.y[T.Forward]||i.y===1}}},[n,t,r])}function kr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Or(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Be;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Be||(Be={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Wt=new Map;function Tr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,f=c.useRef(e),d=m(),g=je(d),h=c.useCallback(function(w){w===void 0&&(w=[]),!g.current&&s(v=>v===null?w:v.concat(w.filter(b=>!v.includes(b))))},[g]),x=c.useRef(null),p=Fe(w=>{if(d&&!n)return Wt;if(!w||w===Wt||f.current!==e||i!=null){const v=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){v.set(b.id,b.rect.current);continue}const y=b.node.current,S=y?new Dt(l(y),y):null;b.rect.current=S,S&&v.set(b.id,S)}return v}return w},[e,i,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||h()},[n,d]),c.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),c.useEffect(()=>{d||typeof a!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},a))},[a,d,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:i!=null};function m(){switch(u){case Be.Always:return!1;case Be.BeforeDragging:return n;default:return!n}}}function gn(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Lr(e,t){return gn(e,t)}function jr(e){let{callback:t,disabled:n}=e;const r=xt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function ot(e){let{callback:t,disabled:n}=e;const r=xt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function zr(e){return new Dt(De(e),e)}function Vt(e,t,n){t===void 0&&(t=zr);const[r,o]=c.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const s=jr({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=ot({callback:i});return Z(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function $r(e){const t=gn(e);return sn(e,t)}const Ht=[];function Br(e){const t=c.useRef(e),n=Fe(r=>e?r&&r!==Ht&&e&&t.current&&e.parentNode===t.current.parentNode?r:rt(e):Ht,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Pr(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(i=>{const s=ut(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const u=ut(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const u=ut(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),_):fn(e):_,[e,t])}function Kt(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==_;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):_}function Fr(e){c.useEffect(()=>{if(!nt)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 Xr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function vn(e){return c.useMemo(()=>e?dr(e):null,[e])}const _t=[];function Ur(e,t){t===void 0&&(t=De);const[n]=e,r=vn(n?B(n):null),[o,i]=c.useState(_t);function s(){i(()=>e.length?e.map(l=>un(l)?r:new Dt(t(l),l)):_t)}const a=ot({callback:s});return Z(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),o}function Yr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pe(t)?t:e}function Wr(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if(Pe(f)){r(d=>{const g=t(f);return d?{...d,width:g.width,height:g.height}:g});break}},[t]),i=ot({callback:o}),s=c.useCallback(u=>{const f=Yr(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,l]=Je(s);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Vr=[{sensor:Ct,options:{}},{sensor:Rt,options:{}}],Hr={current:{}},Ge={draggable:{measure:Ft},droppable:{measure:Ft,strategy:Be.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:De}};class Le 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 Kr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:Qe,windowRect:null,measuringScheduled:!1},_r={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qe,draggableNodes:new Map,over:null,measureDroppableContainers:Qe},it=c.createContext(_r),pn=c.createContext(Kr);function qr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Gr(e,t){switch(t.type){case k.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case k.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 k.DragEnd:case k.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case k.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case k.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case k.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Jr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(it),i=ht(r),s=ht(n?.id);return c.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!wt(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=Yn(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function Qr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Zr(e){return c.useMemo(()=>({draggable:{...Ge.draggable,...e?.draggable},droppable:{...Ge.droppable,...e?.droppable},dragOverlay:{...Ge.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function eo(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=c.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Z(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=sn(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=an(u);g&&g.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const bn=c.createContext({..._,scaleX:1,scaleY:1});var de;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(de||(de={}));const to=c.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:f=Vr,collisionDetection:d=or,measuring:g,modifiers:h,...x}=t;const p=c.useReducer(Gr,void 0,qr),[m,w]=p,[v,b]=qn(),[y,S]=c.useState(de.Uninitialized),C=y===de.Initialized,{draggable:{active:R,nodes:E,translate:A},droppable:{containers:O}}=m,N=R!=null?E.get(R):null,H=c.useRef({initial:null,translated:null}),K=c.useMemo(()=>{var j;return R!=null?{id:R,data:(j=N?.data)!=null?j:Hr,rect:H}:null},[R,N]),q=c.useRef(null),[Re,Ue]=c.useState(null),[P,Ye]=c.useState(null),ee=je(x,Object.values(x)),Se=Xe("DndDescribedBy",s),We=c.useMemo(()=>O.getEnabled(),[O]),z=Zr(g),{droppableRects:te,measureDroppableContainers:fe,measuringScheduled:Ce}=Tr(We,{dragging:C,dependencies:[A.x,A.y],config:z.droppable}),Y=kr(E,R),Ve=c.useMemo(()=>P?gt(P):null,[P]),ie=An(),ne=Lr(Y,z.draggable.measure);eo({activeNode:R!=null?E.get(R):null,config:ie.layoutShiftCompensation,initialRect:ne,measure:z.draggable.measure});const M=Vt(Y,z.draggable.measure,ne),Ee=Vt(Y?Y.parentElement:null),G=c.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=O.getNodeFor((n=G.current.over)==null?void 0:n.id),re=Wr({measure:z.dragOverlay.measure}),ge=(r=re.nodeRef.current)!=null?r:Y,ve=C?(o=re.rect)!=null?o:M:null,Mt=!!(re.nodeRef.current&&re.rect),It=$r(Mt?null:M),st=vn(ge?B(ge):null),se=Br(C?he??Y:null),He=Ur(se),Ke=Qr(h,{transform:{x:A.x-It.x,y:A.y-It.y,scaleX:1,scaleY:1},activatorEvent:P,active:K,activeNodeRect:M,containerNodeRect:Ee,draggingNodeRect:ve,over:G.current.over,overlayNodeRect:re.rect,scrollableAncestors:se,scrollableAncestorRects:He,windowRect:st}),Nt=Ve?ye(Ve,A):null,At=Pr(se),Rn=Kt(At),Sn=Kt(At,[M]),pe=ye(Ke,Rn),be=ve?ar(ve,Ke):null,Me=K&&be?d({active:K,collisionRect:be,droppableRects:te,droppableContainers:We,pointerCoordinates:Nt}):null,kt=on(Me,"id"),[ae,Ot]=c.useState(null),Cn=Mt?Ke:ye(Ke,Sn),En=ir(Cn,(i=ae?.rect)!=null?i:null,M),at=c.useRef(null),Tt=c.useCallback((j,F)=>{let{sensor:X,options:ce}=F;if(q.current==null)return;const W=E.get(q.current);if(!W)return;const U=j.nativeEvent,J=new X({active:q.current,activeNode:W,event:U,options:ce,context:G,onAbort(L){if(!E.get(L))return;const{onDragAbort:Q}=ee.current,oe={id:L};Q?.(oe),v({type:"onDragAbort",event:oe})},onPending(L,le,Q,oe){if(!E.get(L))return;const{onDragPending:Ne}=ee.current,ue={id:L,constraint:le,initialCoordinates:Q,offset:oe};Ne?.(ue),v({type:"onDragPending",event:ue})},onStart(L){const le=q.current;if(le==null)return;const Q=E.get(le);if(!Q)return;const{onDragStart:oe}=ee.current,Ie={activatorEvent:U,active:{id:le,data:Q.data,rect:H}};ke.unstable_batchedUpdates(()=>{oe?.(Ie),S(de.Initializing),w({type:k.DragStart,initialCoordinates:L,active:le}),v({type:"onDragStart",event:Ie}),Ue(at.current),Ye(U)})},onMove(L){w({type:k.DragMove,coordinates:L})},onEnd:me(k.DragEnd),onCancel:me(k.DragCancel)});at.current=J;function me(L){return async function(){const{active:Q,collisions:oe,over:Ie,scrollAdjustedTranslate:Ne}=G.current;let ue=null;if(Q&&Ne){const{cancelDrop:Ae}=ee.current;ue={activatorEvent:U,active:Q,collisions:oe,delta:Ne,over:Ie},L===k.DragEnd&&typeof Ae=="function"&&await Promise.resolve(Ae(ue))&&(L=k.DragCancel)}q.current=null,ke.unstable_batchedUpdates(()=>{w({type:L}),S(de.Uninitialized),Ot(null),Ue(null),Ye(null),at.current=null;const Ae=L===k.DragEnd?"onDragEnd":"onDragCancel";if(ue){const ct=ee.current[Ae];ct?.(ue),v({type:Ae,event:ue})}})}}},[E]),Mn=c.useCallback((j,F)=>(X,ce)=>{const W=X.nativeEvent,U=E.get(ce);if(q.current!==null||!U||W.dndKit||W.defaultPrevented)return;const J={active:U};j(X,F.options,J)===!0&&(W.dndKit={capturedBy:F.sensor},q.current=ce,Tt(X,F))},[E,Tt]),Lt=Or(f,Mn);Fr(f),Z(()=>{M&&y===de.Initializing&&S(de.Initialized)},[M,y]),c.useEffect(()=>{const{onDragMove:j}=ee.current,{active:F,activatorEvent:X,collisions:ce,over:W}=G.current;if(!F||!X)return;const U={active:F,activatorEvent:X,collisions:ce,delta:{x:pe.x,y:pe.y},over:W};ke.unstable_batchedUpdates(()=>{j?.(U),v({type:"onDragMove",event:U})})},[pe.x,pe.y]),c.useEffect(()=>{const{active:j,activatorEvent:F,collisions:X,droppableContainers:ce,scrollAdjustedTranslate:W}=G.current;if(!j||q.current==null||!F||!W)return;const{onDragOver:U}=ee.current,J=ce.get(kt),me=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:j,activatorEvent:F,collisions:X,delta:{x:W.x,y:W.y},over:me};ke.unstable_batchedUpdates(()=>{Ot(me),U?.(L),v({type:"onDragOver",event:L})})},[kt]),Z(()=>{G.current={activatorEvent:P,active:K,activeNode:Y,collisionRect:be,collisions:Me,droppableRects:te,draggableNodes:E,draggingNode:ge,draggingNodeRect:ve,droppableContainers:O,over:ae,scrollableAncestors:se,scrollAdjustedTranslate:pe},H.current={initial:ve,translated:be}},[K,Y,Me,be,E,ge,ve,te,O,ae,se,pe]),Ir({...ie,delta:A,draggingRect:be,pointerCoordinates:Nt,scrollableAncestors:se,scrollableAncestorRects:He});const In=c.useMemo(()=>({active:K,activeNode:Y,activeNodeRect:M,activatorEvent:P,collisions:Me,containerNodeRect:Ee,dragOverlay:re,draggableNodes:E,droppableContainers:O,droppableRects:te,over:ae,measureDroppableContainers:fe,scrollableAncestors:se,scrollableAncestorRects:He,measuringConfiguration:z,measuringScheduled:Ce,windowRect:st}),[K,Y,M,P,Me,Ee,re,E,O,te,ae,fe,se,He,z,Ce,st]),Nn=c.useMemo(()=>({activatorEvent:P,activators:Lt,active:K,activeNodeRect:M,ariaDescribedById:{draggable:Se},dispatch:w,draggableNodes:E,over:ae,measureDroppableContainers:fe}),[P,Lt,K,M,w,Se,E,ae,fe]);return $.createElement(tn.Provider,{value:b},$.createElement(it.Provider,{value:Nn},$.createElement(pn.Provider,{value:In},$.createElement(bn.Provider,{value:En},u)),$.createElement(Jr,{disabled:a?.restoreFocus===!1})),$.createElement(Qn,{...a,hiddenTextDescribedById:Se}));function An(){const j=Re?.autoScrollEnabled===!1,F=typeof l=="object"?l.enabled===!1:l===!1,X=C&&!j&&!F;return typeof l=="object"?{...l,enabled:X}:{enabled:X}}}),no=c.createContext(null),qt="button",ro="Draggable";function oo(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe(ro),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:g}=c.useContext(it),{role:h=qt,roleDescription:x="draggable",tabIndex:p=0}=o??{},m=l?.id===t,w=c.useContext(m?bn:no),[v,b]=Je(),[y,S]=Je(),C=Xr(s,t),R=je(n);Z(()=>(d.set(t,{id:t,key:i,node:v,activatorNode:y,data:R}),()=>{const A=d.get(t);A&&A.key===i&&d.delete(t)}),[d,t]);const E=c.useMemo(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":m&&h===qt?!0:void 0,"aria-roledescription":x,"aria-describedby":f.draggable}),[r,h,p,m,x,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:E,isDragging:m,listeners:r?void 0:C,node:v,over:g,setNodeRef:b,setActivatorNodeRef:S,transform:w}}function io(){return c.useContext(pn)}const so="Droppable",ao={timeout:25};function co(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xe(so),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(it),f=c.useRef({disabled:n}),d=c.useRef(!1),g=c.useRef(null),h=c.useRef(null),{disabled:x,updateMeasurementsFor:p,timeout:m}={...ao,...o},w=je(p??r),v=c.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),h.current=null},m)},[m]),b=ot({callback:v,disabled:x||!s}),y=c.useCallback((E,A)=>{b&&(A&&(b.unobserve(A),d.current=!1),E&&b.observe(E))},[b]),[S,C]=Je(y),R=je(t);return c.useEffect(()=>{!b||!S.current||(b.disconnect(),d.current=!1,b.observe(S.current))},[S,b]),c.useEffect(()=>(a({type:k.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:g,data:R}}),()=>a({type:k.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(a({type:k.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:g,isOver:l?.id===r,node:S,over:l,setNodeRef:C}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function lo(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function _e(e){return e!==null&&e>=0}function uo(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 fo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const mn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Et(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},qe={scaleX:1,scaleY:1},ho=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...qe}:null}const l=go(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...qe}:o<n&&o>=s?{x:0,y:a.height+l,...qe}:{x:0,y:0,...qe}};function go(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const yn="Sortable",xn=$.createContext({activeIndex:-1,containerId:yn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mn,disabled:{draggable:!1,droppable:!1}});function vo(e){let{children:t,id:n,items:r,strategy:o=mn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:f}=io(),d=Xe(yn,n),g=a.rect!==null,h=c.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),x=s!=null,p=s?h.indexOf(s.id):-1,m=u?h.indexOf(u.id):-1,w=c.useRef(h),v=!uo(h,w.current),b=m!==-1&&p===-1||v,y=fo(i);Z(()=>{v&&x&&f(h)},[v,h,x,f]),c.useEffect(()=>{w.current=h},[h]);const S=c.useMemo(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:b,items:h,overIndex:m,useDragOverlay:g,sortedRects:lo(h,l),strategy:o}),[p,d,y.draggable,y.droppable,b,h,m,l,g,o]);return $.createElement(xn.Provider,{value:S},t)}const po=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},bo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},mo={duration:200,easing:"ease"},wn="transform",yo=$e.Transition.toString({property:wn,duration:0,easing:"linear"}),xo={roleDescription:"sortable"};function wo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=c.useState(null),a=c.useRef(n);return Z(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=De(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{i&&s(null)},[i]),i}function Do(e){let{animateLayoutChanges:t=bo,attributes:n,disabled:r,data:o,getNewIndex:i=po,id:s,strategy:a,resizeObserverConfig:l,transition:u=mo}=e;const{items:f,containerId:d,activeIndex:g,disabled:h,disableTransforms:x,sortedRects:p,overIndex:m,useDragOverlay:w,strategy:v}=c.useContext(xn),b=Ro(r,h),y=f.indexOf(s),S=c.useMemo(()=>({sortable:{containerId:d,index:y,items:f},...o}),[d,o,y,f]),C=c.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:R,node:E,isOver:A,setNodeRef:O}=co({id:s,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:N,activatorEvent:H,activeNodeRect:K,attributes:q,setNodeRef:Re,listeners:Ue,isDragging:P,over:Ye,setActivatorNodeRef:ee,transform:Se}=oo({id:s,data:S,attributes:{...xo,...n},disabled:b.draggable}),We=Pn(O,Re),z=!!N,te=z&&!x&&_e(g)&&_e(m),fe=!w&&P,Ce=fe&&te?Se:null,Ve=te?Ce??(a??v)({rects:p,activeNodeRect:K,activeIndex:g,overIndex:m,index:y}):null,ie=_e(g)&&_e(m)?i({id:s,items:f,activeIndex:g,overIndex:m}):y,ne=N?.id,M=c.useRef({activeId:ne,items:f,newIndex:ie,containerId:d}),Ee=f!==M.current.items,G=t({active:N,containerId:d,isDragging:P,isSorting:z,id:s,index:y,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),he=wo({disabled:!G,index:y,node:E,rect:R});return c.useEffect(()=>{z&&M.current.newIndex!==ie&&(M.current.newIndex=ie),d!==M.current.containerId&&(M.current.containerId=d),f!==M.current.items&&(M.current.items=f)},[z,ie,d,f]),c.useEffect(()=>{if(ne===M.current.activeId)return;if(ne&&!M.current.activeId){M.current.activeId=ne;return}const ge=setTimeout(()=>{M.current.activeId=ne},50);return()=>clearTimeout(ge)},[ne]),{active:N,activeIndex:g,attributes:q,data:S,rect:R,index:y,newIndex:ie,items:f,isOver:A,isSorting:z,isDragging:P,listeners:Ue,node:E,overIndex:m,over:Ye,setNodeRef:We,setActivatorNodeRef:ee,setDroppableNodeRef:O,setDraggableNodeRef:Re,transform:he??Ve,transition:re()};function re(){if(he||Ee&&M.current.newIndex===y)return yo;if(!(fe&&!wt(H)||!u)&&(z||G))return $e.Transition.toString({...u,property:wn})}}function Ro(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}}function et(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const So=[D.Down,D.Right,D.Up,D.Left],Co=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(So.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(e.code){case D.Down:r.top<g.top&&l.push(d);break;case D.Up:r.top>g.top&&l.push(d);break;case D.Left:r.left>g.left&&l.push(d);break;case D.Right:r.left<g.left&&l.push(d);break}});const u=nr({collisionRect:r,droppableRects:o,droppableContainers:l});let f=on(u,"id");if(f===s?.id&&u.length>1&&(f=u[1].id),f!=null){const d=i.get(n.id),g=i.get(f),h=g?o.get(g.id):null,x=g?.node.current;if(x&&h&&d&&g){const m=rt(x).some((C,R)=>a[R]!==C),w=Dn(d,g),v=Eo(d,g),b=m||!w?{x:0,y:0}:{x:v?r.width-h.width:0,y:v?r.height-h.height:0},y={x:h.left,y:h.top};return b.x&&b.y?y:ze(y,b)}}}};function Dn(e,t){return!et(e)||!et(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Eo(e,t){return!et(e)||!et(t)||!Dn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Mo(e,t){const n=e.indexOf(t);return n===-1?new Set:new Set(e.slice(0,n+1))}function Io(e,t,n){const r=e.indexOf(n);if(r===-1)return new Set(t);const o=new Set;for(let i=0;i<r;i+=1){const s=e[i];s!==void 0&&t.has(s)&&o.add(s)}return o}function ko({onClose:e,orderedDescriptors:t,isPk:n,hiddenCols:r,lockedCols:o,visibleColumnCount:i,onToggle:s,onReorder:a,onSetLocked:l,isCustomised:u,onReset:f}){const d=Zn($t(Ct,{activationConstraint:{distance:4}}),$t(Rt,{coordinateGetter:Co})),g=t.find(v=>n(v.name)),h=t.filter(v=>!n(v.name)),x=h.map(v=>v.name),p=x.filter(v=>!o.has(v));function m(v){const{active:b,over:y}=v;if(!y||b.id===y.id)return;const S=x.indexOf(String(b.id)),C=x.indexOf(String(y.id));S===-1||C===-1||a(Et(x,S,C))}function w(v){const b=o.has(v)?Io(x,o,v):Mo(x,v);l(b)}return I.jsxs(kn,{title:"Layout",onClose:e,children:[I.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[I.jsx("p",{className:"text-xs text-gray-500",children:"Toggle to show or hide. Lock to freeze a column to the left (frozen columns must be contiguous from the id). Drag the handle to reorder (keyboard: Tab to a handle, then Space + arrow keys + Space to drop)."}),I.jsx(On,{isDirty:u,onReset:f,label:"Reset",disabledHint:"Layout is already at default",icon:I.jsx(Bn,{className:"h-4 w-4","aria-hidden":!0}),title:"Reset to the default layout"})]}),I.jsxs("ul",{className:"space-y-1",children:[g?I.jsx(Gt,{label:g.label,tooltip:"The primary-key column always shows first and is always frozen."}):null,h.filter(v=>o.has(v.name)).map(v=>{const b=!r.has(v.name),y=b&&i<=1;return I.jsx(Gt,{label:v.label,tooltip:"Locked. Unlock to drag or hide this column. Unlocking auto-unlocks every column to its right.",checked:b,checkboxDisabled:y,onToggle:()=>s(v.name,i),onUnlock:()=>w(v.name)},v.name)}),I.jsx(to,{sensors:d,collisionDetection:tr,onDragEnd:m,children:I.jsx(vo,{items:p,strategy:ho,children:h.filter(v=>!o.has(v.name)).map(v=>{const b=!r.has(v.name),y=b&&i<=1;return I.jsx(No,{id:v.name,label:v.label,visible:b,disabled:y,onToggle:()=>s(v.name,i),onLock:()=>w(v.name)},v.name)})})})]})]})}function Gt({label:e,tooltip:t,checked:n,checkboxDisabled:r,onToggle:o,onUnlock:i}){return I.jsxs("li",{className:"flex items-center gap-2 rounded border border-transparent bg-gray-50 px-1 py-1","aria-label":`${e} (locked)`,children:[I.jsx("span",{"aria-hidden":!0,className:"inline-flex h-5 w-5 shrink-0 cursor-not-allowed items-center justify-center p-0.5 text-gray-300",children:I.jsx(Qt,{className:"h-4 w-4","aria-hidden":!0})}),i?I.jsx("button",{type:"button",onClick:i,"aria-label":`Unlock ${e}`,title:t,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:I.jsx(jt,{className:"h-3.5 w-3.5","aria-hidden":!0})}):I.jsx("span",{className:"inline-flex h-5 w-5 shrink-0 items-center justify-center text-gray-400",title:t,children:I.jsx(jt,{className:"h-3.5 w-3.5","aria-hidden":!0})}),I.jsxs("label",{className:`flex flex-1 items-center gap-2 text-sm ${n===!1?"text-gray-400":"text-gray-500"}`,children:[I.jsx(Jt,{checked:n??!0,disabled:o===void 0||(r??!1),onChange:o??(()=>{})}),I.jsx("span",{title:t,children:e})]})]})}function No({id:e,label:t,visible:n,disabled:r,onToggle:o,onLock:i}){const{attributes:s,listeners:a,setNodeRef:l,setActivatorNodeRef:u,transform:f,transition:d,isDragging:g}=Do({id:e}),h={transform:$e.Transform.toString(f),transition:d};return I.jsxs("li",{ref:l,style:h,className:["flex items-center gap-2 rounded border px-1 py-1",g?"z-10 border-blue-300 bg-white shadow-lg":"border-transparent hover:border-gray-200"].join(" "),children:[I.jsx("button",{ref:u,type:"button","aria-label":`Reorder ${t}`,title:`Drag to reorder ${t}`,className:"cursor-grab touch-none rounded p-0.5 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:cursor-grabbing",...s,...a,children:I.jsx(Qt,{className:"h-4 w-4 shrink-0","aria-hidden":!0})}),I.jsx("button",{type:"button",onClick:i,"aria-label":`Lock ${t}`,title:"Lock to freeze this column to the left. Locked columns must be contiguous, so this also locks every column above it.",className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:I.jsx(jn,{className:"h-3.5 w-3.5","aria-hidden":!0})}),I.jsxs("label",{className:`flex flex-1 items-center gap-2 text-sm ${r?"text-gray-400":"text-gray-800"}`,children:[I.jsx(Jt,{checked:n,disabled:r,onChange:o}),t]})]})}export{ko as default,Mo as lockThrough,Io as unlockFrom};
@@ -1 +1 @@
1
- import{c as d,d as l,j as e,C as h}from"./index-_FJkJVGi.js";const p=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g=d("chevron-right",p);const y=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],j=d("copy",y);function N({raw:t,parsed:r}){const[s,c]=l.useState(!1);async function a(){try{await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3)}catch{}}return e.jsxs("div",{className:"relative w-full overflow-x-auto rounded border border-gray-200 bg-gray-50 p-3 font-mono text-xs leading-relaxed text-gray-800 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200",children:[e.jsx("button",{type:"button",onClick:a,"aria-label":"Copy JSON",title:s?"Copied":"Copy",className:"absolute right-2 top-2 inline-flex h-6 w-6 items-center justify-center rounded border border-gray-300 bg-white text-gray-600 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",children:s?e.jsx(h,{className:"h-3.5 w-3.5 text-green-600","aria-hidden":!0}):e.jsx(j,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsx(o,{value:r,depth:0})]})}function o({value:t,depth:r}){return t===null?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"null"}):typeof t=="boolean"?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:t?"true":"false"}):typeof t=="number"?e.jsx("span",{className:"text-blue-700",children:String(t)}):typeof t=="string"?e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:['"',t,'"']}):Array.isArray(t)?e.jsx(u,{value:t,depth:r}):typeof t=="object"?e.jsx(m,{value:t,depth:r}):e.jsx("span",{className:"text-gray-500",children:String(t)})}function m({value:t,depth:r}){const s=Object.keys(t),[c,a]=l.useState(r<2);return s.length===0?e.jsx("span",{className:"text-gray-500",children:"{}"}):e.jsx(x,{open:c,onToggle:()=>a(n=>!n),collapsedLabel:`{…} ${s.length} ${s.length===1?"key":"keys"}`,openBracket:"{",closeBracket:"}",depth:r,children:s.map((n,i)=>e.jsxs("div",{className:"pl-4",children:[e.jsxs("span",{className:"text-rose-700 dark:text-rose-400",children:['"',n,'"']}),e.jsx("span",{className:"text-gray-500",children:": "}),e.jsx(o,{value:t[n],depth:r+1}),i<s.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function u({value:t,depth:r}){const[s,c]=l.useState(r<2);return t.length===0?e.jsx("span",{className:"text-gray-500",children:"[]"}):e.jsx(x,{open:s,onToggle:()=>c(a=>!a),collapsedLabel:`[…] ${t.length} ${t.length===1?"item":"items"}`,openBracket:"[",closeBracket:"]",depth:r,children:t.map((a,n)=>e.jsxs("div",{className:"pl-4",children:[e.jsx(o,{value:a,depth:r+1}),n<t.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function x({open:t,onToggle:r,collapsedLabel:s,openBracket:c,closeBracket:a,depth:n,children:i}){return e.jsxs("span",{children:[e.jsx("button",{type:"button",onClick:r,"aria-expanded":t,className:"inline-flex items-center align-baseline text-gray-500 hover:text-gray-800 dark:hover:text-gray-200",children:e.jsx(g,{className:`h-3 w-3 shrink-0 transition-transform ${t?"rotate-90":""}`,"aria-hidden":!0})}),e.jsx("span",{className:"text-gray-500",children:c}),t?e.jsxs(e.Fragment,{children:[i,e.jsx("div",{className:n===0?"":"pl-0",children:e.jsx("span",{className:"text-gray-500",children:a})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-gray-500",children:s}),e.jsx("span",{className:"text-gray-500",children:a})]})]})}export{N as default};
1
+ import{c as d,d as l,j as e,C as h}from"./index-BLXojb04.js";const p=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g=d("chevron-right",p);const y=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],j=d("copy",y);function N({raw:t,parsed:r}){const[s,c]=l.useState(!1);async function a(){try{await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3)}catch{}}return e.jsxs("div",{className:"relative w-full overflow-x-auto rounded border border-gray-200 bg-gray-50 p-3 font-mono text-xs leading-relaxed text-gray-800 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200",children:[e.jsx("button",{type:"button",onClick:a,"aria-label":"Copy JSON",title:s?"Copied":"Copy",className:"absolute right-2 top-2 inline-flex h-6 w-6 items-center justify-center rounded border border-gray-300 bg-white text-gray-600 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",children:s?e.jsx(h,{className:"h-3.5 w-3.5 text-green-600","aria-hidden":!0}):e.jsx(j,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsx(o,{value:r,depth:0})]})}function o({value:t,depth:r}){return t===null?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"null"}):typeof t=="boolean"?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:t?"true":"false"}):typeof t=="number"?e.jsx("span",{className:"text-blue-700",children:String(t)}):typeof t=="string"?e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:['"',t,'"']}):Array.isArray(t)?e.jsx(u,{value:t,depth:r}):typeof t=="object"?e.jsx(m,{value:t,depth:r}):e.jsx("span",{className:"text-gray-500",children:String(t)})}function m({value:t,depth:r}){const s=Object.keys(t),[c,a]=l.useState(r<2);return s.length===0?e.jsx("span",{className:"text-gray-500",children:"{}"}):e.jsx(x,{open:c,onToggle:()=>a(n=>!n),collapsedLabel:`{…} ${s.length} ${s.length===1?"key":"keys"}`,openBracket:"{",closeBracket:"}",depth:r,children:s.map((n,i)=>e.jsxs("div",{className:"pl-4",children:[e.jsxs("span",{className:"text-rose-700 dark:text-rose-400",children:['"',n,'"']}),e.jsx("span",{className:"text-gray-500",children:": "}),e.jsx(o,{value:t[n],depth:r+1}),i<s.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function u({value:t,depth:r}){const[s,c]=l.useState(r<2);return t.length===0?e.jsx("span",{className:"text-gray-500",children:"[]"}):e.jsx(x,{open:s,onToggle:()=>c(a=>!a),collapsedLabel:`[…] ${t.length} ${t.length===1?"item":"items"}`,openBracket:"[",closeBracket:"]",depth:r,children:t.map((a,n)=>e.jsxs("div",{className:"pl-4",children:[e.jsx(o,{value:a,depth:r+1}),n<t.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function x({open:t,onToggle:r,collapsedLabel:s,openBracket:c,closeBracket:a,depth:n,children:i}){return e.jsxs("span",{children:[e.jsx("button",{type:"button",onClick:r,"aria-expanded":t,className:"inline-flex items-center align-baseline text-gray-500 hover:text-gray-800 dark:hover:text-gray-200",children:e.jsx(g,{className:`h-3 w-3 shrink-0 transition-transform ${t?"rotate-90":""}`,"aria-hidden":!0})}),e.jsx("span",{className:"text-gray-500",children:c}),t?e.jsxs(e.Fragment,{children:[i,e.jsx("div",{className:n===0?"":"pl-0",children:e.jsx("span",{className:"text-gray-500",children:a})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-gray-500",children:s}),e.jsx("span",{className:"text-gray-500",children:a})]})]})}export{N as default};