@nimbus-ds/patterns 1.12.0 → 1.13.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CHANGELOG.md CHANGED
@@ -2,17 +2,23 @@
2
2
 
3
3
  Nimbus is an open-source Design System created by Tiendanube / Nuvesmhop’s team to empower and enhance more stories every day, with simplicity, accessibility, consistency and performance.
4
4
 
5
+ ## 2025-04-25 `1.13.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added `Sortable` component. ([#109](https://github.com/TiendaNube/nimbus-patterns/pull/109) by [@joacotornello](https://github.com/joacotornello))
10
+
5
11
  ## 2025-03-18 `1.12.0`
6
12
 
7
13
  #### 🎉 New features
8
14
 
9
- - Adds `use-client` directive to the build output in order to support NextJS applications. ([#-PULL_REQUEST_NUMBER](https://github.com/TiendaNube/nimbus-design-system/pull/-PULL_REQUEST_NUMBER) by [@joacotornello](https://github.com/joacotornello))
15
+ - Adds `use-client` directive to the build output in order to support NextJS applications. ([#104](https://github.com/TiendaNube/nimbus-patterns/pull/104) by [@joacotornello](https://github.com/joacotornello))
10
16
 
11
- - Implemented new webpack configuration to move useful files into the build output directory and inject the `use client` directive. ([#-PULL_REQUEST_NUMBER](https://github.com/TiendaNube/nimbus-design-system/pull/-PULL_REQUEST_NUMBER) by [@joacotornello](https://github.com/joacotornello))
17
+ - Implemented new webpack configuration to move useful files into the build output directory and inject the `use client` directive. ([#104](https://github.com/TiendaNube/nimbus-patterns/pull/104) by [@joacotornello](https://github.com/joacotornello))
12
18
 
13
19
  ### 💡 Others
14
20
 
15
- - Rebuild after build process changes to add support for modular imports and Server Components. ([#-PULL_REQUEST_NUMBER](https://github.com/TiendaNube/nimbus-design-system/pull/-PULL_REQUEST_NUMBER) by [@joacotornello](https://github.com/joacotornello))
21
+ - Rebuild after build process changes to add support for modular imports and Server Components. ([#104](https://github.com/TiendaNube/nimbus-patterns/pull/104) by [@joacotornello](https://github.com/joacotornello))
16
22
 
17
23
  ## 2025-02-28 `1.11.1`
18
24
 
@@ -0,0 +1,131 @@
1
+ // Generated by dts-bundle-generator v8.0.0
2
+
3
+ import { DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, DraggableAttributes, PointerSensorOptions, UniqueIdentifier } from '@dnd-kit/core';
4
+ import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
5
+ import React from 'react';
6
+ import { CSSProperties, ReactElement, ReactNode } from 'react';
7
+
8
+ declare const orientation: {
9
+ readonly vertical: "vertical";
10
+ readonly horizontal: "horizontal";
11
+ };
12
+ /**
13
+ * Base type for items that can be sorted
14
+ */
15
+ export type SortableItemType = {
16
+ /** Unique identifier for the sortable item */
17
+ id: UniqueIdentifier;
18
+ };
19
+ /**
20
+ * Properties specific to the Sortable component
21
+ */
22
+ export interface SortableProperties<T extends SortableItemType> {
23
+ /** The children components */
24
+ children: ReactNode;
25
+ /** Whether to disable sorting functionality */
26
+ disabled?: boolean;
27
+ /** The items to be sorted */
28
+ items: T[];
29
+ /** Callback fired when items are reordered */
30
+ onReorder: (items: T[]) => void;
31
+ /** Callback fired when drag starts */
32
+ onDragStart?: (event: DragStartEvent) => void;
33
+ /** Callback fired during drag */
34
+ onDragOver?: (event: DragOverEvent) => void;
35
+ /** Callback fired when drag ends */
36
+ onDragEnd?: (event: DragEndEvent) => void;
37
+ /** The orientation of the sortable list */
38
+ orientation?: typeof orientation.vertical | typeof orientation.horizontal;
39
+ /**
40
+ * Custom sensor options for drag detection
41
+ * @example
42
+ * ```tsx
43
+ * <Sortable
44
+ * sensorOptions={{
45
+ * activationConstraint: {
46
+ * distance: 20, // Allow movements up to 20px
47
+ * delay: 150, // Wait 150ms before canceling
48
+ * tolerance: 5 // Tolerate 5px of movement
49
+ * }
50
+ * }}
51
+ * >
52
+ * ```
53
+ */
54
+ sensorOptions?: PointerSensorOptions;
55
+ /** Configuration for the drag overlay appearance and behavior */
56
+ overlaySettings?: Omit<DragOverlayProps, "wrapperElement" | "style">;
57
+ /** Render function for the dragged item overlay */
58
+ renderOverlay?: (item: T) => ReactNode;
59
+ }
60
+ export interface RenderItemProps {
61
+ /** Drag attributes required for drag functionality */
62
+ attributes: DraggableAttributes;
63
+ /** Event listeners for drag functionality */
64
+ listeners: SyntheticListenerMap | undefined;
65
+ /** Reference setter for the draggable node */
66
+ setNodeRef: (node: HTMLElement | null) => void;
67
+ /** Style properties for drag animation */
68
+ style: CSSProperties;
69
+ /** Whether the item is currently being dragged */
70
+ isDragging: boolean;
71
+ }
72
+ export interface SortableItemProperties {
73
+ /** The unique identifier for the item */
74
+ id: UniqueIdentifier;
75
+ /** Whether the item is disabled from being dragged */
76
+ disabled?: boolean;
77
+ /** Custom drag handle selector */
78
+ handle?: boolean;
79
+ /** The children components */
80
+ children?: ReactNode;
81
+ /** Optional render function that receives drag state and handlers, useful for fully customizing the item */
82
+ renderItem?: (props: RenderItemProps) => ReactElement;
83
+ }
84
+ export type SortableItemProps = SortableItemProperties & ({
85
+ children: ReactNode;
86
+ renderItem?: undefined;
87
+ } | {
88
+ children?: undefined;
89
+ renderItem: (props: RenderItemProps) => ReactElement;
90
+ });
91
+ export declare const SortableItem: React.FC<SortableItemProps>;
92
+ export type SortableItemHandleProperties = {
93
+ /**
94
+ * The content of the SortableItemHandle component
95
+ */
96
+ children: ReactNode;
97
+ };
98
+ export declare const SortableItemHandle: {
99
+ ({ children, }: SortableItemHandleProperties): React.ReactElement;
100
+ displayName: string;
101
+ };
102
+ /**
103
+ * A component that provides drag and drop sorting functionality
104
+ * @example
105
+ * ```tsx
106
+ * const [items, setItems] = useState([{ id: '1', content: 'Item 1' }]);
107
+ *
108
+ * return (
109
+ * <Sortable items={items} onReorder={setItems}>
110
+ * <div className="my-sortable-container">
111
+ * {items.map((item) => (
112
+ * <Sortable.Item key={item.id} id={item.id}>
113
+ * {item.content}
114
+ * </Sortable.Item>
115
+ * ))}
116
+ * </div>
117
+ * </Sortable>
118
+ * );
119
+ * ```
120
+ */
121
+ export declare function Sortable<T extends SortableItemType>({ items, onReorder, orientation, sensorOptions, onDragStart, onDragOver, onDragEnd, disabled, children, overlaySettings, renderOverlay, }: SortableProperties<T>): React.ReactElement;
122
+ export declare namespace Sortable {
123
+ var Item: React.FC<SortableItemProps>;
124
+ var ItemHandle: {
125
+ ({ children, }: SortableItemHandleProperties): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
126
+ displayName: string;
127
+ };
128
+ var displayName: string;
129
+ }
130
+
131
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("@nimbus-ds/components")):"function"==typeof define&&define.amd?define(["react","react-dom","@nimbus-ds/components"],t):"object"==typeof exports?exports["@nimbus-ds/patterns"]=t(require("react"),require("react-dom"),require("@nimbus-ds/components")):e["@nimbus-ds/patterns"]=t(e.react,e["react-dom"],e["@nimbus-ds/components"])}(global,((e,t,n)=>(()=>{"use strict";var r={1540:(e,t,n)=>{n.r(t),n.d(t,{AutoScrollActivator:()=>xe,DndContext:()=>Qe,DragOverlay:()=>bt,KeyboardCode:()=>ie,KeyboardSensor:()=>ue,MeasuringFrequency:()=>Re,MeasuringStrategy:()=>De,MouseSensor:()=>me,PointerSensor:()=>ge,TouchSensor:()=>we,TraversalOrder:()=>Se,applyModifiers:()=>qe,closestCenter:()=>O,closestCorners:()=>I,defaultAnnouncements:()=>v,defaultCoordinates:()=>y,defaultDropAnimation:()=>vt,defaultDropAnimationSideEffects:()=>ft,defaultKeyboardCoordinateGetter:()=>ce,defaultScreenReaderInstructions:()=>f,getClientRect:()=>z,getFirstCollision:()=>D,getScrollableAncestors:()=>B,pointerWithin:()=>T,rectIntersection:()=>_,useDndContext:()=>nt,useDndMonitor:()=>d,useDraggable:()=>tt,useDroppable:()=>it,useSensor:()=>b,useSensors:()=>m});var r=n(8156),o=n.n(r),i=n(7111),a=n(2851);const s={display:"none"};function l(e){let{id:t,value:n}=e;return o().createElement("div",{id:t,style:s},n)}function c(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return o().createElement("div",{id:t,style:{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"},role:"status","aria-live":r,"aria-atomic":!0},n)}const u=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(u);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const f={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},v={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 p(e){let{announcements:t=v,container:n,hiddenTextDescribedById:s,screenReaderInstructions:u=f}=e;const{announce:p,announcement:g}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),h=(0,a.useUniqueId)("DndLiveRegion"),[b,m]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{m(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;p(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&p(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;p(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;p(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;p(t.onDragCancel({active:n,over:r}))}})),[p,t])),!b)return null;const y=o().createElement(o().Fragment,null,o().createElement(l,{id:s,value:u.draggable}),o().createElement(c,{id:h,announcement:g}));return n?(0,i.createPortal)(y,n):y}var g;function h(){}function b(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}!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"}(g||(g={}));const y=Object.freeze({x:0,y:0});function w(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x(e,t){const n=(0,a.getEventCoordinates)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function S(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function C(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function E(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 D(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function R(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const O=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=R(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=w(R(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(S)},I=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=E(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=E(r),a=o.reduce(((e,t,r)=>e+w(n[r],t)),0),s=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:s}})}}return i.sort(S)};function M(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),a=o-r,s=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*s;return Number((o/(n+r-o)).toFixed(4))}return 0}const _=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=M(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(C)};function N(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}const T=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const e of t){const{id:t}=e,i=n.get(t);if(i&&N(r,i)){const n=E(i).reduce(((e,t)=>e+w(r,t)),0),a=Number((n/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:a}})}}return o.sort(S)};function L(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function P(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(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const A=P(1);function j(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]}}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}const k={ignoreTransform:!1};function z(e,t){void 0===t&&(t=k);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,a.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=j(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:s}=r,l=e.left-a-(1-o)*parseFloat(n),c=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,t,r))}const{top:r,left:o,width:i,height:s,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:l,right:c}}function F(e){return z(e,{ignoreTransform:!0})}function B(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,a.isDocument)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,a.isHTMLElement)(o)||(0,a.isSVGElement)(o))return n;if(n.includes(o))return n;const i=(0,a.getWindow)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=(0,a.getWindow)(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function K(e){const[t]=B(e,1);return null!=t?t:null}function U(e){return a.canUseDOM&&e?(0,a.isWindow)(e)?e:(0,a.isNode)(e)?(0,a.isDocument)(e)||e===(0,a.getOwnerDocument)(e).scrollingElement?window:(0,a.isHTMLElement)(e)?e:null:null:null}function W(e){return(0,a.isWindow)(e)?e.scrollX:e.scrollLeft}function Y(e){return(0,a.isWindow)(e)?e.scrollY:e.scrollTop}function H(e){return{x:W(e),y:Y(e)}}var X;function V(e){return!(!a.canUseDOM||!e)&&e===document.scrollingElement}function q(e){const t={x:0,y:0},n=V(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(X||(X={}));const G={x:.2,y:.2};function J(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=G);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=q(e),v={x:0,y:0},p={x:0,y:0},g=t.height*o.y,h=t.width*o.x;return!c&&i<=t.top+g?(v.y=X.Backward,p.y=r*Math.abs((t.top+g-i)/g)):!u&&l>=t.bottom-g&&(v.y=X.Forward,p.y=r*Math.abs((t.bottom-g-l)/g)),!f&&s>=t.right-h?(v.x=X.Forward,p.x=r*Math.abs((t.right-h-s)/h)):!d&&a<=t.left+h&&(v.x=X.Backward,p.x=r*Math.abs((t.left+h-a)/h)),{direction:v,speed:p}}function Q(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}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 Z(e){return e.reduce(((e,t)=>(0,a.add)(e,H(t))),y)}function $(e,t){if(void 0===t&&(t=z),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);K(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ee=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+W(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Y(t)),0)}]];class te{constructor(e,t){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 n=B(t),r=Z(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ee)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ne{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function re(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?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}var oe,ie;function ae(e){e.preventDefault()}function se(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(oe||(oe={})),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"}(ie||(ie={}));const le={start:[ie.Space,ie.Enter],cancel:[ie.Esc],end:[ie.Space,ie.Enter,ie.Tab]},ce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ie.Right:return{...n,x:n.x+25};case ie.Left:return{...n,x:n.x-25};case ie.Down:return{...n,y:n.y+25};case ie.Up:return{...n,y:n.y-25}}};class ue{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ne((0,a.getOwnerDocument)(t)),this.windowListeners=new ne((0,a.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(oe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&$(n),t(y)}handleKeyDown(e){if((0,a.isKeyboardEvent)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=le,coordinateGetter:i=ce,scrollBehavior:s="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:y;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=(0,a.subtract)(d,u),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:u,minScroll:f}=q(n),v=Q(n),p={x:Math.min(o===ie.Right?v.right-v.width/2:v.right,Math.max(o===ie.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(o===ie.Down?v.bottom-v.height/2:v.bottom,Math.max(o===ie.Down?v.top:v.top+v.height/2,d.y))},g=o===ie.Right&&!a||o===ie.Left&&!l,h=o===ie.Down&&!c||o===ie.Up&&!i;if(g&&p.x!==d.x){const e=n.scrollLeft+t.x,i=o===ie.Right&&e<=u.x||o===ie.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===ie.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(h&&p.y!==d.y){const e=n.scrollTop+t.y,i=o===ie.Down&&e<=u.y||o===ie.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===ie.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,(0,a.add)((0,a.subtract)(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function de(e){return Boolean(e&&"distance"in e)}function fe(e){return Boolean(e&&"delay"in e)}ue.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=le,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ve{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,a.getWindow)(e);return e instanceof t?e:(0,a.getOwnerDocument)(e)}(e.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=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=(0,a.getOwnerDocument)(i),this.documentListeners=new ne(this.document),this.listeners=new ne(n),this.windowListeners=new ne((0,a.getWindow)(i)),this.initialCoordinates=null!=(r=(0,a.getEventCoordinates)(o))?r:y,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:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,ae),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,ae),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fe(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(de(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(oe.Click,se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const l=null!=(t=(0,a.getEventCoordinates)(e))?t:y,c=(0,a.subtract)(r,l);if(!n&&s){if(de(s)){if(null!=s.tolerance&&re(c,s.tolerance))return this.handleCancel();if(re(c,s.distance))return this.handleStart()}return fe(s)&&re(c,s.tolerance)?this.handleCancel():void this.handlePending(s,c)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===ie.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const pe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ge extends ve{constructor(e){const{event:t}=e,n=(0,a.getOwnerDocument)(t.target);super(e,pe,n)}}ge.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const he={move:{name:"mousemove"},end:{name:"mouseup"}};var be;!function(e){e[e.RightClick=2]="RightClick"}(be||(be={}));class me extends ve{constructor(e){super(e,he,(0,a.getOwnerDocument)(e.event.target))}}me.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==be.RightClick&&(null==r||r({event:n}),!0)}}];const ye={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class we extends ve{constructor(e){super(e,ye)}static setup(){return window.addEventListener(ye.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ye.move.name,e)};function e(){}}}var xe,Se;function Ce(e){let{acceleration:t,activator:n=xe.Pointer,canScroll:o,draggingRect:i,enabled:s,interval:l=5,order:c=Se.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:v,threshold:p}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,a.usePrevious)(t);return(0,a.useLazyMemo)((e=>{if(n||!r||!e)return Ee;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[X.Backward]:e.x[X.Backward]||-1===o.x,[X.Forward]:e.x[X.Forward]||1===o.x},y:{[X.Backward]:e.y[X.Backward]||-1===o.y,[X.Forward]:e.y[X.Forward]||1===o.y}}}),[n,t,r])}({delta:v,disabled:!s}),[h,b]=(0,a.useInterval)(),m=(0,r.useRef)({x:0,y:0}),y=(0,r.useRef)({x:0,y:0}),w=(0,r.useMemo)((()=>{switch(n){case xe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case xe.DraggableRect:return i}}),[n,i,u]),x=(0,r.useRef)(null),S=(0,r.useCallback)((()=>{const e=x.current;if(!e)return;const t=m.current.x*y.current.x,n=m.current.y*y.current.y;e.scrollBy(t,n)}),[]),C=(0,r.useMemo)((()=>c===Se.TreeOrder?[...d].reverse():d),[c,d]);(0,r.useEffect)((()=>{if(s&&d.length&&w){for(const e of C){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:i,speed:a}=J(e,r,w,t,p);for(const e of["x","y"])g[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return b(),x.current=e,h(S,l),m.current=a,void(y.current=i)}m.current={x:0,y:0},y.current={x:0,y:0},b()}else b()}),[t,S,o,b,s,l,JSON.stringify(w),JSON.stringify(g),h,d,C,f,JSON.stringify(p)])}we.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(xe||(xe={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Se||(Se={}));const Ee={x:{[X.Backward]:!1,[X.Forward]:!1},y:{[X.Backward]:!1,[X.Forward]:!1}};var De,Re;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(De||(De={})),function(e){e.Optimized="optimized"}(Re||(Re={}));const Oe=new Map;function Ie(e,t){return(0,a.useLazyMemo)((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Me(e){let{callback:t,disabled:n}=e;const o=(0,a.useEvent)(t),i=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,r.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function _e(e){return new te(z(e),e)}function Ne(e,t,n){void 0===t&&(t=_e);const[o,i]=(0,r.useState)(null);function s(){i((r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i}))}const l=function(e){let{callback:t,disabled:n}=e;const o=(0,a.useEvent)(t),i=(0,r.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,r.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){s();break}}}}),c=Me({callback:s});return(0,a.useIsomorphicLayoutEffect)((()=>{s(),e?(null==c||c.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==l||l.disconnect())}),[e]),o}const Te=[];function Le(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,a.subtract)(e,n.current):y}function Pe(e){return(0,r.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const Ae=[];function je(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,a.isHTMLElement)(t)?t:e}const ke=[{sensor:ge,options:{}},{sensor:ue,options:{}}],ze={current:{}},Fe={draggable:{measure:F},droppable:{measure:F,strategy:De.WhileDragging,frequency:Re.Optimized},dragOverlay:{measure:z}};class Be extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Ke={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Be,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:h},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Fe,measureDroppableContainers:h,windowRect:null,measuringScheduled:!1},Ue={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:h,draggableNodes:new Map,over:null,measureDroppableContainers:h},We=(0,r.createContext)(Ue),Ye=(0,r.createContext)(Ke);function He(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Be}}}function Xe(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Be(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case g.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new Be(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Be(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ve(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:i}=(0,r.useContext)(We),s=(0,a.usePrevious)(o),l=(0,a.usePrevious)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!o&&s&&null!=l){if(!(0,a.isKeyboardEvent)(s))return;if(document.activeElement===s.target)return;const e=i.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=(0,a.findFirstFocusableNode)(e);if(t){t.focus();break}}}))}}),[o,t,i,l,s]),null}function qe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Ge=(0,r.createContext)({...y,scaleX:1,scaleY:1});var Je;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Je||(Je={}));const Qe=(0,r.memo)((function(e){var t,n,s,l;let{id:c,accessibility:d,autoScroll:f=!0,children:v,sensors:h=ke,collisionDetection:b=_,measuring:m,modifiers:w,...x}=e;const S=(0,r.useReducer)(Xe,void 0,He),[C,E]=S,[R,O]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[I,M]=(0,r.useState)(Je.Uninitialized),N=I===Je.Initialized,{draggable:{active:T,nodes:P,translate:j},droppable:{containers:k}}=C,F=null!=T?P.get(T):null,W=(0,r.useRef)({initial:null,translated:null}),Y=(0,r.useMemo)((()=>{var e;return null!=T?{id:T,data:null!=(e=null==F?void 0:F.data)?e:ze,rect:W}:null}),[T,F]),X=(0,r.useRef)(null),[q,G]=(0,r.useState)(null),[J,Q]=(0,r.useState)(null),$=(0,a.useLatestValue)(x,Object.values(x)),ee=(0,a.useUniqueId)("DndDescribedBy",c),ne=(0,r.useMemo)((()=>k.getEnabled()),[k]),re=(oe=m,(0,r.useMemo)((()=>({draggable:{...Fe.draggable,...null==oe?void 0:oe.draggable},droppable:{...Fe.droppable,...null==oe?void 0:oe.droppable},dragOverlay:{...Fe.dragOverlay,...null==oe?void 0:oe.dragOverlay}})),[null==oe?void 0:oe.draggable,null==oe?void 0:oe.droppable,null==oe?void 0:oe.dragOverlay]));var oe;const{droppableRects:ie,measureDroppableContainers:ae,measuringScheduled:se}=function(e,t){let{dragging:n,dependencies:o,config:i}=t;const[s,l]=(0,r.useState)(null),{frequency:c,measure:u,strategy:d}=i,f=(0,r.useRef)(e),v=function(){switch(d){case De.Always:return!1;case De.BeforeDragging:return n;default:return!n}}(),p=(0,a.useLatestValue)(v),g=(0,r.useCallback)((function(e){void 0===e&&(e=[]),p.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[p]),h=(0,r.useRef)(null),b=(0,a.useLazyMemo)((t=>{if(v&&!n)return Oe;if(!t||t===Oe||f.current!==e||null!=s){const t=new Map;for(let n of e){if(!n)continue;if(s&&s.length>0&&!s.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new te(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,s,n,v,u]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{v||g()}),[n,v]),(0,r.useEffect)((()=>{s&&s.length>0&&l(null)}),[JSON.stringify(s)]),(0,r.useEffect)((()=>{v||"number"!=typeof c||null!==h.current||(h.current=setTimeout((()=>{g(),h.current=null}),c))}),[c,v,g,...o]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:null!=s}}(ne,{dragging:N,dependencies:[j.x,j.y],config:re.droppable}),le=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,a.useLazyMemo)((e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(P,T),ce=(0,r.useMemo)((()=>J?(0,a.getEventCoordinates)(J):null),[J]),ue=function(){const e=!1===(null==q?void 0:q.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=N&&!e&&!t;if("object"==typeof f)return{...f,enabled:n};return{enabled:n}}(),de=function(e,t){return Ie(e,t)}(le,re.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:i=!0}=e;const s=(0,r.useRef)(!1),{x:l,y:c}="boolean"==typeof i?{x:i,y:i}:i;(0,a.useIsomorphicLayoutEffect)((()=>{if(!l&&!c||!t)return void(s.current=!1);if(s.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=L(n(e),o);if(l||(r.x=0),c||(r.y=0),s.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=K(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,l,c,o,n])}({activeNode:null!=T?P.get(T):null,config:ue.layoutShiftCompensation,initialRect:de,measure:re.draggable.measure});const fe=Ne(le,re.draggable.measure,de),ve=Ne(le?le.parentElement:null),pe=(0,r.useRef)({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=k.getNodeFor(null==(t=pe.current.over)?void 0:t.id),he=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),i=Me({callback:(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,a.isHTMLElement)(n)){o((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),s=(0,r.useCallback)((e=>{const n=je(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),o(n?t(n):null)}),[t,i]),[l,c]=(0,a.useNodeRef)(s);return(0,r.useMemo)((()=>({nodeRef:l,rect:n,setRef:c})),[n,l,c])}({measure:re.dragOverlay.measure}),be=null!=(n=he.nodeRef.current)?n:le,me=N?null!=(s=he.rect)?s:fe:null,ye=Boolean(he.nodeRef.current&&he.rect),we=L(xe=ye?null:fe,Ie(xe));var xe;const Se=Pe(be?(0,a.getWindow)(be):null),Ee=function(e){const t=(0,r.useRef)(e),n=(0,a.useLazyMemo)((n=>e?n&&n!==Te&&e&&t.current&&e.parentNode===t.current.parentNode?n:B(e):Te),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(N?null!=ge?ge:le:null),Re=function(e,t){void 0===t&&(t=z);const[n]=e,o=Pe(n?(0,a.getWindow)(n):null),[i,s]=(0,r.useState)(Ae);function l(){s((()=>e.length?e.map((e=>V(e)?o:new te(t(e),e))):Ae))}const c=Me({callback:l});return(0,a.useIsomorphicLayoutEffect)((()=>{null==c||c.disconnect(),l(),e.forEach((e=>null==c?void 0:c.observe(e)))}),[e]),i}(Ee),_e=qe(w,{transform:{x:j.x-we.x,y:j.y-we.y,scaleX:1,scaleY:1},activatorEvent:J,active:Y,activeNodeRect:fe,containerNodeRect:ve,draggingNodeRect:me,over:pe.current.over,overlayNodeRect:he.rect,scrollableAncestors:Ee,scrollableAncestorRects:Re,windowRect:Se}),Be=ce?(0,a.add)(ce,j):null,Ke=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),i=(0,r.useCallback)((e=>{const t=U(e.target);t&&n((e=>e?(e.set(t,H(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=o.current;if(e!==t){r(t);const a=e.map((e=>{const t=U(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,H(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=U(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,a.add)(e,t)),y):Z(e):y),[e,t])}(Ee),Ue=Le(Ke),Qe=Le(Ke,[fe]),Ze=(0,a.add)(_e,Ue),$e=me?A(me,_e):null,et=Y&&$e?b({active:Y,collisionRect:$e,droppableRects:ie,droppableContainers:ne,pointerCoordinates:Be}):null,tt=D(et,"id"),[nt,rt]=(0,r.useState)(null),ot=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ye?_e:(0,a.add)(_e,Qe),null!=(l=null==nt?void 0:nt.rect)?l:null,fe),it=(0,r.useRef)(null),at=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==X.current)return;const o=P.get(X.current);if(!o)return;const a=e.nativeEvent,s=new n({active:X.current,activeNode:o,event:a,options:r,context:pe,onAbort(e){if(!P.get(e))return;const{onDragAbort:t}=$.current,n={id:e};null==t||t(n),R({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!P.get(e))return;const{onDragPending:o}=$.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),R({type:"onDragPending",event:i})},onStart(e){const t=X.current;if(null==t)return;const n=P.get(t);if(!n)return;const{onDragStart:r}=$.current,o={activatorEvent:a,active:{id:t,data:n.data,rect:W}};(0,i.unstable_batchedUpdates)((()=>{null==r||r(o),M(Je.Initializing),E({type:g.DragStart,initialCoordinates:e,active:t}),R({type:"onDragStart",event:o}),G(it.current),Q(a)}))},onMove(e){E({type:g.DragMove,coordinates:e})},onEnd:l(g.DragEnd),onCancel:l(g.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=pe.current;let s=null;if(t&&o){const{cancelDrop:i}=$.current;if(s={activatorEvent:a,active:t,collisions:n,delta:o,over:r},e===g.DragEnd&&"function"==typeof i){await Promise.resolve(i(s))&&(e=g.DragCancel)}}X.current=null,(0,i.unstable_batchedUpdates)((()=>{E({type:e}),M(Je.Uninitialized),rt(null),G(null),Q(null),it.current=null;const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=$.current[t];null==e||e(s),R({type:t,event:s})}}))}}it.current=s}),[P]),st=(0,r.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=P.get(r);if(null!==X.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},X.current=r,at(n,t))}),[P,at]),lt=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(h,st);!function(e){(0,r.useEffect)((()=>{if(!a.canUseDOM)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(h),(0,a.useIsomorphicLayoutEffect)((()=>{fe&&I===Je.Initializing&&M(Je.Initialized)}),[fe,I]),(0,r.useEffect)((()=>{const{onDragMove:e}=$.current,{active:t,activatorEvent:n,collisions:r,over:o}=pe.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:Ze.x,y:Ze.y},over:o};(0,i.unstable_batchedUpdates)((()=>{null==e||e(a),R({type:"onDragMove",event:a})}))}),[Ze.x,Ze.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=pe.current;if(!e||null==X.current||!t||!o)return;const{onDragOver:a}=$.current,s=r.get(tt),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,i.unstable_batchedUpdates)((()=>{rt(l),null==a||a(c),R({type:"onDragOver",event:c})}))}),[tt]),(0,a.useIsomorphicLayoutEffect)((()=>{pe.current={activatorEvent:J,active:Y,activeNode:le,collisionRect:$e,collisions:et,droppableRects:ie,draggableNodes:P,draggingNode:be,draggingNodeRect:me,droppableContainers:k,over:nt,scrollableAncestors:Ee,scrollAdjustedTranslate:Ze},W.current={initial:me,translated:$e}}),[Y,le,et,$e,P,be,me,ie,k,nt,Ee,Ze]),Ce({...ue,delta:j,draggingRect:$e,pointerCoordinates:Be,scrollableAncestors:Ee,scrollableAncestorRects:Re});const ct=(0,r.useMemo)((()=>({active:Y,activeNode:le,activeNodeRect:fe,activatorEvent:J,collisions:et,containerNodeRect:ve,dragOverlay:he,draggableNodes:P,droppableContainers:k,droppableRects:ie,over:nt,measureDroppableContainers:ae,scrollableAncestors:Ee,scrollableAncestorRects:Re,measuringConfiguration:re,measuringScheduled:se,windowRect:Se})),[Y,le,fe,J,et,ve,he,P,k,ie,nt,ae,Ee,Re,re,se,Se]),ut=(0,r.useMemo)((()=>({activatorEvent:J,activators:lt,active:Y,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:E,draggableNodes:P,over:nt,measureDroppableContainers:ae})),[J,lt,Y,fe,E,ee,P,nt,ae]);return o().createElement(u.Provider,{value:O},o().createElement(We.Provider,{value:ut},o().createElement(Ye.Provider,{value:ct},o().createElement(Ge.Provider,{value:ot},v)),o().createElement(Ve,{disabled:!1===(null==d?void 0:d.restoreFocus)})),o().createElement(p,{...d,hiddenTextDescribedById:ee}))})),Ze=(0,r.createContext)(null),$e="button",et="Draggable";function tt(e){let{id:t,data:n,disabled:o=!1,attributes:i}=e;const s=(0,a.useUniqueId)(et),{activators:l,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:v,over:p}=(0,r.useContext)(We),{role:g=$e,roleDescription:h="draggable",tabIndex:b=0}=null!=i?i:{},m=(null==u?void 0:u.id)===t,y=(0,r.useContext)(m?Ge:Ze),[w,x]=(0,a.useNodeRef)(),[S,C]=(0,a.useNodeRef)(),E=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(l,t),D=(0,a.useLatestValue)(n);(0,a.useIsomorphicLayoutEffect)((()=>(v.set(t,{id:t,key:s,node:w,activatorNode:S,data:D}),()=>{const e=v.get(t);e&&e.key===s&&v.delete(t)})),[v,t]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:g,tabIndex:b,"aria-disabled":o,"aria-pressed":!(!m||g!==$e)||void 0,"aria-roledescription":h,"aria-describedby":f.draggable})),[o,g,b,m,h,f.draggable]),isDragging:m,listeners:o?void 0:E,node:w,over:p,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function nt(){return(0,r.useContext)(Ye)}const rt="Droppable",ot={timeout:25};function it(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:i}=e;const s=(0,a.useUniqueId)(rt),{active:l,dispatch:c,over:u,measureDroppableContainers:d}=(0,r.useContext)(We),f=(0,r.useRef)({disabled:n}),v=(0,r.useRef)(!1),p=(0,r.useRef)(null),h=(0,r.useRef)(null),{disabled:b,updateMeasurementsFor:m,timeout:y}={...ot,...i},w=(0,a.useLatestValue)(null!=m?m:o),x=Me({callback:(0,r.useCallback)((()=>{v.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(Array.isArray(w.current)?w.current:[w.current]),h.current=null}),y)):v.current=!0}),[y]),disabled:b||!l}),S=(0,r.useCallback)(((e,t)=>{x&&(t&&(x.unobserve(t),v.current=!1),e&&x.observe(e))}),[x]),[C,E]=(0,a.useNodeRef)(S),D=(0,a.useLatestValue)(t);return(0,r.useEffect)((()=>{x&&C.current&&(x.disconnect(),v.current=!1,x.observe(C.current))}),[C,x]),(0,r.useEffect)((()=>(c({type:g.RegisterDroppable,element:{id:o,key:s,disabled:n,node:C,rect:p,data:D}}),()=>c({type:g.UnregisterDroppable,key:s,id:o}))),[o]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(c({type:g.SetDroppableDisabled,id:o,key:s,disabled:n}),f.current.disabled=n)}),[o,s,n,c]),{active:l,rect:p,isOver:(null==u?void 0:u.id)===o,node:C,over:u,setNodeRef:E}}function at(e){let{animation:t,children:n}=e;const[i,s]=(0,r.useState)(null),[l,c]=(0,r.useState)(null),u=(0,a.usePrevious)(n);return n||i||!u||s(u),(0,a.useIsomorphicLayoutEffect)((()=>{if(!l)return;const e=null==i?void 0:i.key,n=null==i?void 0:i.props.id;null!=e&&null!=n?Promise.resolve(t(n,l)).then((()=>{s(null)})):s(null)}),[t,i,l]),o().createElement(o().Fragment,null,n,i?(0,r.cloneElement)(i,{ref:c}):null)}const st={x:0,y:0,scaleX:1,scaleY:1};function lt(e){let{children:t}=e;return o().createElement(We.Provider,{value:Ue},o().createElement(Ge.Provider,{value:st},t))}const ct={position:"fixed",touchAction:"none"},ut=e=>(0,a.isKeyboardEvent)(e)?"transform 250ms ease":void 0,dt=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:l,rect:c,style:u,transform:d,transition:f=ut}=e;if(!c)return null;const v=i?d:{...d,scaleX:1,scaleY:1},p={...ct,width:c.width,height:c.height,top:c.top,left:c.left,transform:a.CSS.Transform.toString(v),transformOrigin:i&&r?x(r,c):void 0,transition:"function"==typeof f?f(r):f,...u};return o().createElement(n,{className:l,style:p,ref:t},s)})),ft=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},vt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:a.CSS.Transform.toString(t)},{transform:a.CSS.Transform.toString(n)}]},sideEffects:ft({styles:{active:{opacity:"0"}}})};function pt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return(0,a.useEvent)(((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const l=s.node.current;if(!l)return;const c=je(i);if(!c)return;const{transform:u}=(0,a.getWindow)(i).getComputedStyle(i),d=j(u);if(!d)return;const f="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...vt,...e};return e=>{let{active:i,dragOverlay:a,transform:s,...l}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:1!==s.scaleX?i.rect.width*s.scaleX/a.rect.width:1,scaleY:1!==s.scaleY?i.rect.height*s.scaleY/a.rect.height:1},d={x:s.x-c.x,y:s.y-c.y,...u},f=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:d}}),[v]=f,p=f[f.length-1];if(JSON.stringify(v)===JSON.stringify(p))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...l}),h=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{h.onfinish=()=>{null==g||g(),e()}}))}}(t);return $(l,o.draggable.measure),f({active:{id:e,data:s.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}let gt=0;function ht(e){return(0,r.useMemo)((()=>{if(null!=e)return gt++,gt}),[e])}const bt=o().memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:s,modifiers:l,wrapperElement:c="div",className:u,zIndex:d=999}=e;const{activatorEvent:f,active:v,activeNodeRect:p,containerNodeRect:g,draggableNodes:h,droppableContainers:b,dragOverlay:m,over:y,measuringConfiguration:w,scrollableAncestors:x,scrollableAncestorRects:S,windowRect:C}=nt(),E=(0,r.useContext)(Ge),D=ht(null==v?void 0:v.id),R=qe(l,{activatorEvent:f,active:v,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:m.rect,over:y,overlayNodeRect:m.rect,scrollableAncestors:x,scrollableAncestorRects:S,transform:E,windowRect:C}),O=Ie(p),I=pt({config:i,draggableNodes:h,droppableContainers:b,measuringConfiguration:w}),M=O?m.setRef:void 0;return o().createElement(lt,null,o().createElement(at,{animation:I},v&&D?o().createElement(dt,{key:D,id:v.id,ref:M,as:c,activatorEvent:f,adjustScale:t,className:u,transition:s,rect:O,style:{zIndex:d,...a},transform:R},n):null))}))},6548:(e,t,n)=>{n.r(t),n.d(t,{SortableContext:()=>y,arrayMove:()=>s,arraySwap:()=>l,defaultAnimateLayoutChanges:()=>x,defaultNewIndexGetter:()=>w,hasSortableData:()=>O,horizontalListSortingStrategy:()=>f,rectSortingStrategy:()=>v,rectSwappingStrategy:()=>p,sortableKeyboardCoordinates:()=>M,useSortable:()=>R,verticalListSortingStrategy:()=>h});var r=n(8156),o=n.n(r),i=n(1540),a=n(2851);function s(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function l(e,t,n){const r=e.slice();return r[t]=e[n],r[n]=e[t],r}function c(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function u(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},f=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:a}=e;const s=null!=(t=n[o])?t:r;if(!s)return null;const l=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r||!o&&!i)return 0;if(n<t)return o?r.left-(o.left+o.width):i.left-(r.left+r.width);return i?i.left-(r.left+r.width):r.left-(o.left+o.width)}(n,a,o);if(a===o){const e=n[i];return e?{x:o<i?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...d}:null}return a>o&&a<=i?{x:-s.width-l,y:0,...d}:a<o&&a>=i?{x:s.width+l,y:0,...d}:{x:0,y:0,...d}};const v=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=s(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},p=e=>{let t,n,{activeIndex:r,index:o,rects:i,overIndex:a}=e;return o===r&&(t=i[o],n=i[a]),o===a&&(t=i[o],n=i[r]),n&&t?{x:n.left-t.left,y:n.top-t.top,scaleX:n.width/t.width,scaleY:n.height/t.height}:null},g={scaleX:1,scaleY:1},h=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const s=null!=(t=i[n])?t:r;if(!s)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(s.top+s.height):e.top-s.top,...g}:null}const l=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];if(!r)return 0;if(n<t)return o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0;return i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0}(i,o,n);return o>n&&o<=a?{x:0,y:-s.height-l,...g}:o<n&&o>=a?{x:0,y:s.height+l,...g}:{x:0,y:0,...g}};const b="Sortable",m=o().createContext({activeIndex:-1,containerId:b,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:v,disabled:{draggable:!1,droppable:!1}});function y(e){let{children:t,id:n,items:s,strategy:l=v,disabled:u=!1}=e;const{active:d,dragOverlay:f,droppableRects:p,over:g,measureDroppableContainers:h}=(0,i.useDndContext)(),y=(0,a.useUniqueId)(b,n),w=Boolean(null!==f.rect),x=(0,r.useMemo)((()=>s.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[s]),S=null!=d,C=d?x.indexOf(d.id):-1,E=g?x.indexOf(g.id):-1,D=(0,r.useRef)(x),R=!function(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}(x,D.current),O=-1!==E&&-1===C||R,I=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(u);(0,a.useIsomorphicLayoutEffect)((()=>{R&&S&&h(x)}),[R,x,S,h]),(0,r.useEffect)((()=>{D.current=x}),[x]);const M=(0,r.useMemo)((()=>({activeIndex:C,containerId:y,disabled:I,disableTransforms:O,items:x,overIndex:E,useDragOverlay:w,sortedRects:c(x,p),strategy:l})),[C,y,I.draggable,I.droppable,O,x,E,p,w,l]);return o().createElement(m.Provider,{value:M},t)}const w=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return s(n,r,o).indexOf(t)},x=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:s,previousContainerId:l,transition:c}=e;return!(!c||!r)&&((s===i||o!==a)&&(!!n||a!==o&&t===l))},S={duration:200,easing:"ease"},C="transform",E=a.CSS.Transition.toString({property:C,duration:0,easing:"linear"}),D={roleDescription:"sortable"};function R(e){let{animateLayoutChanges:t=x,attributes:n,disabled:o,data:s,getNewIndex:l=w,id:c,strategy:d,resizeObserverConfig:f,transition:v=S}=e;const{items:p,containerId:g,activeIndex:h,disabled:b,disableTransforms:y,sortedRects:R,overIndex:O,useDragOverlay:I,strategy:M}=(0,r.useContext)(m),_=function(e,t){var n,r;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,b),N=p.indexOf(c),T=(0,r.useMemo)((()=>({sortable:{containerId:g,index:N,items:p},...s})),[g,s,N,p]),L=(0,r.useMemo)((()=>p.slice(p.indexOf(c))),[p,c]),{rect:P,node:A,isOver:j,setNodeRef:k}=(0,i.useDroppable)({id:c,data:T,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...f}}),{active:z,activatorEvent:F,activeNodeRect:B,attributes:K,setNodeRef:U,listeners:W,isDragging:Y,over:H,setActivatorNodeRef:X,transform:V}=(0,i.useDraggable)({id:c,data:T,attributes:{...D,...n},disabled:_.draggable}),q=(0,a.useCombinedRefs)(k,U),G=Boolean(z),J=G&&!y&&u(h)&&u(O),Q=!I&&Y,Z=Q&&J?V:null,$=J?null!=Z?Z:(null!=d?d:M)({rects:R,activeNodeRect:B,activeIndex:h,overIndex:O,index:N}):null,ee=u(h)&&u(O)?l({id:c,items:p,activeIndex:h,overIndex:O}):N,te=null==z?void 0:z.id,ne=(0,r.useRef)({activeId:te,items:p,newIndex:ee,containerId:g}),re=p!==ne.current.items,oe=t({active:z,containerId:g,isDragging:Y,isSorting:G,id:c,index:N,items:p,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:v,wasDragging:null!=ne.current.activeId}),ie=function(e){let{disabled:t,index:n,node:o,rect:s}=e;const[l,c]=(0,r.useState)(null),u=(0,r.useRef)(n);return(0,a.useIsomorphicLayoutEffect)((()=>{if(!t&&n!==u.current&&o.current){const e=s.current;if(e){const t=(0,i.getClientRect)(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==u.current&&(u.current=n)}),[t,n,o,s]),(0,r.useEffect)((()=>{l&&c(null)}),[l]),l}({disabled:!oe,index:N,node:A,rect:P});return(0,r.useEffect)((()=>{G&&ne.current.newIndex!==ee&&(ne.current.newIndex=ee),g!==ne.current.containerId&&(ne.current.containerId=g),p!==ne.current.items&&(ne.current.items=p)}),[G,ee,g,p]),(0,r.useEffect)((()=>{if(te===ne.current.activeId)return;if(te&&!ne.current.activeId)return void(ne.current.activeId=te);const e=setTimeout((()=>{ne.current.activeId=te}),50);return()=>clearTimeout(e)}),[te]),{active:z,activeIndex:h,attributes:K,data:T,rect:P,index:N,newIndex:ee,items:p,isOver:j,isSorting:G,isDragging:Y,listeners:W,node:A,overIndex:O,over:H,setNodeRef:q,setActivatorNodeRef:X,setDroppableNodeRef:k,setDraggableNodeRef:U,transform:null!=ie?ie:$,transition:function(){if(ie||re&&ne.current.newIndex===N)return E;if(Q&&!(0,a.isKeyboardEvent)(F)||!v)return;if(G||oe)return a.CSS.Transition.toString({...v,property:C});return}()}}function O(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const I=[i.KeyboardCode.Down,i.KeyboardCode.Right,i.KeyboardCode.Up,i.KeyboardCode.Left],M=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:l,scrollableAncestors:c}}=t;if(I.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];s.getEnabled().forEach((n=>{if(!n||null!=n&&n.disabled)return;const a=o.get(n.id);if(a)switch(e.code){case i.KeyboardCode.Down:r.top<a.top&&t.push(n);break;case i.KeyboardCode.Up:r.top>a.top&&t.push(n);break;case i.KeyboardCode.Left:r.left>a.left&&t.push(n);break;case i.KeyboardCode.Right:r.left<a.left&&t.push(n)}}));const u=(0,i.closestCorners)({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let d=(0,i.getFirstCollision)(u,"id");if(d===(null==l?void 0:l.id)&&u.length>1&&(d=u[1].id),null!=d){const e=s.get(n.id),t=s.get(d),l=t?o.get(t.id):null,u=null==t?void 0:t.node.current;if(u&&l&&e&&t){const n=(0,i.getScrollableAncestors)(u).some(((e,t)=>c[t]!==e)),o=_(e,t),s=function(e,t){if(!O(e)||!O(t))return!1;if(!_(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),d=n||!o?{x:0,y:0}:{x:s?r.width-l.width:0,y:s?r.height-l.height:0},f={x:l.left,y:l.top};return d.x&&d.y?f:(0,a.subtract)(f,d)}}}};function _(e,t){return!(!O(e)||!O(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}},2851:(e,t,n)=>{n.r(t),n.d(t,{CSS:()=>M,add:()=>C,canUseDOM:()=>i,findFirstFocusableNode:()=>N,getEventCoordinates:()=>I,getOwnerDocument:()=>f,getWindow:()=>l,hasViewportRelativeCoordinates:()=>D,isDocument:()=>c,isHTMLElement:()=>u,isKeyboardEvent:()=>R,isNode:()=>s,isSVGElement:()=>d,isTouchEvent:()=>O,isWindow:()=>a,subtract:()=>E,useCombinedRefs:()=>o,useEvent:()=>p,useInterval:()=>g,useIsomorphicLayoutEffect:()=>v,useLatestValue:()=>h,useLazyMemo:()=>b,useNodeRef:()=>m,usePrevious:()=>y,useUniqueId:()=>x});var r=n(8156);function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)((()=>e=>{t.forEach((t=>t(e)))}),t)}const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function a(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function s(e){return"nodeType"in e}function l(e){var t,n;return e?a(e)?e:s(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function c(e){const{Document:t}=l(e);return e instanceof t}function u(e){return!a(e)&&e instanceof l(e).HTMLElement}function d(e){return e instanceof l(e).SVGElement}function f(e){return e?a(e)?e.document:s(e)?c(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}const v=i?r.useLayoutEffect:r.useEffect;function p(e){const t=(0,r.useRef)(e);return v((()=>{t.current=e})),(0,r.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function g(){const e=(0,r.useRef)(null);return[(0,r.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,r.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function h(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return v((()=>{n.current!==e&&(n.current=e)}),t),n}function b(e,t){const n=(0,r.useRef)();return(0,r.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function m(e){const t=p(e),n=(0,r.useRef)(null),o=(0,r.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function y(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}let w={};function x(e,t){return(0,r.useMemo)((()=>{if(t)return t;const n=null==w[e]?0:w[e]+1;return w[e]=n,e+"-"+n}),[e,t])}function S(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(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const C=S(1),E=S(-1);function D(e){return"clientX"in e&&"clientY"in e}function R(e){if(!e)return!1;const{KeyboardEvent:t}=l(e.target);return t&&e instanceof t}function O(e){if(!e)return!1;const{TouchEvent:t}=l(e.target);return t&&e instanceof t}function I(e){if(O(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return D(e)?{x:e.clientX,y:e.clientY}:null}const M=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[M.Translate.toString(e),M.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function N(e){return e.matches(_)?e:e.querySelector(_)}},977:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERLAY_SETTINGS=t.orientation=void 0,t.orientation={vertical:"vertical",horizontal:"horizontal"},t.DEFAULT_OVERLAY_SETTINGS={dropAnimation:{duration:0,easing:"ease"}}},8753:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sortable=void 0;const r=n(5163).__importStar(n(8156)),o=n(1540),i=n(6548),a=n(421),s=n(977);function l({items:e,onReorder:t,orientation:n="vertical",sensorOptions:a,onDragStart:l,onDragOver:c,onDragEnd:u,disabled:d=!1,children:f,overlaySettings:v=s.DEFAULT_OVERLAY_SETTINGS,renderOverlay:p}){const[g,h]=(0,r.useState)(null),b=g?e.find((e=>e.id===g)):null,m=(0,o.useSensors)((0,o.useSensor)(o.PointerSensor,{activationConstraint:{distance:8},...a}),(0,o.useSensor)(o.KeyboardSensor,{coordinateGetter:i.sortableKeyboardCoordinates,...a})),y=(0,r.useMemo)((()=>"vertical"===n?i.verticalListSortingStrategy:i.horizontalListSortingStrategy),[n]);return d?r.default.createElement(r.default.Fragment,null,f):r.default.createElement(o.DndContext,{sensors:m,collisionDetection:o.closestCenter,onDragStart:e=>{h(e.active.id),l?.(e)},onDragOver:c,onDragEnd:n=>{const{active:r,over:o}=n;if(o&&r.id!==o.id){const n=e.findIndex((e=>e.id===r.id)),i=e.findIndex((e=>e.id===o.id)),a=[...e],[s]=a.splice(n,1);a.splice(i,0,s),t(a)}h(null),u?.(n)}},r.default.createElement(i.SortableContext,{items:e.map((e=>e.id)),strategy:y},f),r.default.createElement(o.DragOverlay,{...v},b&&p?p(b):null))}t.Sortable=l,l.Item=a.SortableItem,l.ItemHandle=a.SortableItemHandle,l.displayName="Sortable",l.Item.displayName="Sortable.Item",l.ItemHandle.displayName="Sortable.ItemHandle"},4932:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(7880),t),r.__exportStar(n(421),t)},6456:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItem=void 0;const r=n(5163).__importStar(n(8156)),o=n(6548),i=n(2851),a=n(3750);t.SortableItem=({id:e,disabled:t=!1,handle:n=!1,children:s,renderItem:l})=>{const{attributes:c,listeners:u,setNodeRef:d,setActivatorNodeRef:f,transform:v,transition:p,isDragging:g}=(0,o.useSortable)({id:e,disabled:t}),h=(0,r.useMemo)((()=>({transform:i.CSS.Transform.toString(v),transition:p,touchAction:"none"})),[v,p]),b=(0,r.useMemo)((()=>({setActivatorNodeRef:f,attributes:c,listeners:u})),[f,c,u]);return l?l({isDragging:g,attributes:c,listeners:n?void 0:u,setNodeRef:d,style:h}):r.default.createElement(a.SortableItemContext.Provider,{value:b},r.default.createElement("div",{ref:d,style:h,...!n&&{...c,...u}},s))}},3750:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useSortableItemContext=t.SortableItemContext=void 0;const r=n(8156);t.SortableItemContext=(0,r.createContext)(null);t.useSortableItemContext=()=>{const e=(0,r.useContext)(t.SortableItemContext);if(!e)throw new Error("useSortableItemContext must be used within a SortableItem");return e}},1882:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItem=void 0;var r=n(6456);Object.defineProperty(t,"SortableItem",{enumerable:!0,get:function(){return r.SortableItem}})},3429:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItemHandle=void 0;const r=n(5163).__importDefault(n(8156)),o=n(5280),i=n(3750),a=({children:e})=>{const{setActivatorNodeRef:t,attributes:n,listeners:a}=(0,i.useSortableItemContext)();return r.default.createElement(o.Box,{...n,...a,ref:t,cursor:"grab"},e)};t.SortableItemHandle=a,a.displayName="SortableItemHandle"},2595:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortableItemHandle=void 0;var r=n(3429);Object.defineProperty(t,"SortableItemHandle",{enumerable:!0,get:function(){return r.SortableItemHandle}})},421:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(1882),t),r.__exportStar(n(2595),t)},7880:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sortable=void 0;const r=n(8753);var o=n(8753);Object.defineProperty(t,"Sortable",{enumerable:!0,get:function(){return o.Sortable}}),t.default=r.Sortable},5163:(e,t,n)=>{n.r(t),n.d(t,{__assign:()=>i,__asyncDelegator:()=>D,__asyncGenerator:()=>E,__asyncValues:()=>R,__await:()=>C,__awaiter:()=>p,__classPrivateFieldGet:()=>N,__classPrivateFieldIn:()=>L,__classPrivateFieldSet:()=>T,__createBinding:()=>h,__decorate:()=>s,__esDecorate:()=>c,__exportStar:()=>b,__extends:()=>o,__generator:()=>g,__importDefault:()=>_,__importStar:()=>M,__makeTemplateObject:()=>O,__metadata:()=>v,__param:()=>l,__propKey:()=>d,__read:()=>y,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>f,__spread:()=>w,__spreadArray:()=>S,__spreadArrays:()=>x,__values:()=>m});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function s(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f=!1,v=n.length-1;v>=0;v--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var h=(0,n[v])("accessor"===l?{get:d.get,set:d.set}:d[c],p);if("accessor"===l){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(s=a(h.get))&&(d.get=s),(s=a(h.set))&&(d.set=s),(s=a(h.init))&&o.push(s)}else(s=a(h))&&("field"===l?o.push(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),f=!0}function u(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function v(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function g(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var h=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function b(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||h(t,e,n)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function x(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function S(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function E(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof C?Promise.resolve(n.value.v).then(l,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function D(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:C(e[r](t)),done:!1}:o?o(t):t}:o}}function R(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=m(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function O(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&h(t,e,n);return I(t,e),t}function _(e){return e&&e.__esModule?e:{default:e}}function N(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function T(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},5280:e=>{e.exports=n},8156:t=>{t.exports=e},7111:e=>{e.exports=t}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}return i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(4932)})()));
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  // Generated by dts-bundle-generator v8.0.0
2
2
 
3
+ import { DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, DraggableAttributes, PointerSensorOptions, UniqueIdentifier } from '@dnd-kit/core';
4
+ import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
3
5
  import { BoxBaseProps, BoxProperties, BoxProps, ButtonProperties, ButtonProps, CheckboxProperties, CheckboxProps, IconButtonProperties, IconButtonProps, InputProperties, InputProps, PaginationProperties, PaginationProps, PopoverProperties, RadioProps, SelectProperties, SelectProps, SidebarProperties, TableCellProps, TableProperties, TableRowProperties, TextareaProperties, TextareaProps, ThumbnailProperties, ThumbnailProps, ToggleProperties, ToggleProps } from '@nimbus-ds/components';
4
6
  import { IconProps } from '@nimbus-ds/icons';
5
7
  import { PolymorphicForwardRefComponent } from '@nimbus-ds/typings';
6
8
  import React from 'react';
7
- import { ButtonHTMLAttributes, ComponentProps, ComponentPropsWithRef, FC, HTMLAttributes, MouseEventHandler, PropsWithChildren, ReactNode } from 'react';
9
+ import { ButtonHTMLAttributes, CSSProperties, ComponentProps, ComponentPropsWithRef, FC, HTMLAttributes, MouseEventHandler, PropsWithChildren, ReactElement, ReactNode } from 'react';
8
10
  import { DayPicker } from 'react-day-picker';
9
11
 
10
12
  export interface AppShellHeaderProperties {
@@ -977,5 +979,122 @@ export interface PlanDisplayProperties {
977
979
  }
978
980
  export type PlanDisplayProps = PlanDisplayProperties & Omit<BoxProps, "width" | "display" | "flexDirection" | "backgroundColor" | "pb" | "children">;
979
981
  export declare const PlanDisplay: React.FC<PlanDisplayProps> & PlanDisplayComponents;
982
+ declare const orientation: {
983
+ readonly vertical: "vertical";
984
+ readonly horizontal: "horizontal";
985
+ };
986
+ /**
987
+ * Base type for items that can be sorted
988
+ */
989
+ export type SortableItemType = {
990
+ /** Unique identifier for the sortable item */
991
+ id: UniqueIdentifier;
992
+ };
993
+ /**
994
+ * Properties specific to the Sortable component
995
+ */
996
+ export interface SortableProperties<T extends SortableItemType> {
997
+ /** The children components */
998
+ children: ReactNode;
999
+ /** Whether to disable sorting functionality */
1000
+ disabled?: boolean;
1001
+ /** The items to be sorted */
1002
+ items: T[];
1003
+ /** Callback fired when items are reordered */
1004
+ onReorder: (items: T[]) => void;
1005
+ /** Callback fired when drag starts */
1006
+ onDragStart?: (event: DragStartEvent) => void;
1007
+ /** Callback fired during drag */
1008
+ onDragOver?: (event: DragOverEvent) => void;
1009
+ /** Callback fired when drag ends */
1010
+ onDragEnd?: (event: DragEndEvent) => void;
1011
+ /** The orientation of the sortable list */
1012
+ orientation?: typeof orientation.vertical | typeof orientation.horizontal;
1013
+ /**
1014
+ * Custom sensor options for drag detection
1015
+ * @example
1016
+ * ```tsx
1017
+ * <Sortable
1018
+ * sensorOptions={{
1019
+ * activationConstraint: {
1020
+ * distance: 20, // Allow movements up to 20px
1021
+ * delay: 150, // Wait 150ms before canceling
1022
+ * tolerance: 5 // Tolerate 5px of movement
1023
+ * }
1024
+ * }}
1025
+ * >
1026
+ * ```
1027
+ */
1028
+ sensorOptions?: PointerSensorOptions;
1029
+ /** Configuration for the drag overlay appearance and behavior */
1030
+ overlaySettings?: Omit<DragOverlayProps, "wrapperElement" | "style">;
1031
+ /** Render function for the dragged item overlay */
1032
+ renderOverlay?: (item: T) => ReactNode;
1033
+ }
1034
+ export interface RenderItemProps {
1035
+ /** Drag attributes required for drag functionality */
1036
+ attributes: DraggableAttributes;
1037
+ /** Event listeners for drag functionality */
1038
+ listeners: SyntheticListenerMap | undefined;
1039
+ /** Reference setter for the draggable node */
1040
+ setNodeRef: (node: HTMLElement | null) => void;
1041
+ /** Style properties for drag animation */
1042
+ style: CSSProperties;
1043
+ /** Whether the item is currently being dragged */
1044
+ isDragging: boolean;
1045
+ }
1046
+ export interface SortableItemProperties {
1047
+ /** The unique identifier for the item */
1048
+ id: UniqueIdentifier;
1049
+ /** Whether the item is disabled from being dragged */
1050
+ disabled?: boolean;
1051
+ /** Custom drag handle selector */
1052
+ handle?: boolean;
1053
+ /** The children components */
1054
+ children?: ReactNode;
1055
+ /** Optional render function that receives drag state and handlers, useful for fully customizing the item */
1056
+ renderItem?: (props: RenderItemProps) => ReactElement;
1057
+ }
1058
+ export type SortableItemProps = SortableItemProperties & ({
1059
+ children: ReactNode;
1060
+ renderItem?: undefined;
1061
+ } | {
1062
+ children?: undefined;
1063
+ renderItem: (props: RenderItemProps) => ReactElement;
1064
+ });
1065
+ export type SortableItemHandleProperties = {
1066
+ /**
1067
+ * The content of the SortableItemHandle component
1068
+ */
1069
+ children: ReactNode;
1070
+ };
1071
+ /**
1072
+ * A component that provides drag and drop sorting functionality
1073
+ * @example
1074
+ * ```tsx
1075
+ * const [items, setItems] = useState([{ id: '1', content: 'Item 1' }]);
1076
+ *
1077
+ * return (
1078
+ * <Sortable items={items} onReorder={setItems}>
1079
+ * <div className="my-sortable-container">
1080
+ * {items.map((item) => (
1081
+ * <Sortable.Item key={item.id} id={item.id}>
1082
+ * {item.content}
1083
+ * </Sortable.Item>
1084
+ * ))}
1085
+ * </div>
1086
+ * </Sortable>
1087
+ * );
1088
+ * ```
1089
+ */
1090
+ export declare function Sortable<T extends SortableItemType>({ items, onReorder, orientation, sensorOptions, onDragStart, onDragOver, onDragEnd, disabled, children, overlaySettings, renderOverlay, }: SortableProperties<T>): React.ReactElement;
1091
+ export declare namespace Sortable {
1092
+ var Item: React.FC<SortableItemProps>;
1093
+ var ItemHandle: {
1094
+ ({ children, }: SortableItemHandleProperties): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1095
+ displayName: string;
1096
+ };
1097
+ var displayName: string;
1098
+ }
980
1099
 
981
1100
  export {};