fluid-dnd 2.4.0 → 2.5.0

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 (51) hide show
  1. package/README.md +14 -15
  2. package/dist/{HandlerPublisher-B68XPAcH.cjs → HandlerPublisher-1MmlNkG3.cjs} +1 -1
  3. package/dist/{HandlerPublisher-pcX0Zmas.js → HandlerPublisher-DBjPMiyO.js} +1 -1
  4. package/dist/core/config/configHandler.js +4 -4
  5. package/dist/core/config/droppableConfigurator.d.ts +2 -1
  6. package/dist/core/config/droppableConfigurator.js +17 -21
  7. package/dist/core/events/changeDraggableStyles.js +3 -5
  8. package/dist/core/events/dragAndDrop/dragAndDrop.js +28 -40
  9. package/dist/core/events/dragAndDrop/getTranslateBeforeDropping.js +30 -30
  10. package/dist/core/events/dragAndDrop/getTranslationByDraggingAndEvent.js +10 -11
  11. package/dist/core/events/insert.d.ts +2 -1
  12. package/dist/core/events/insert.js +4 -10
  13. package/dist/core/events/remove.d.ts +2 -2
  14. package/dist/core/events/remove.js +28 -13
  15. package/dist/core/index.d.ts +6 -0
  16. package/dist/core/index.js +7 -0
  17. package/dist/core/positioning/autoScroll.js +6 -5
  18. package/dist/core/positioning/usePositioning.js +20 -23
  19. package/dist/core/tempChildren.js +32 -28
  20. package/dist/core/useDraggable.js +39 -50
  21. package/dist/core/useDroppable.d.ts +2 -2
  22. package/dist/core/useDroppable.js +10 -16
  23. package/dist/core/utils/GetStyles.d.ts +24 -3
  24. package/dist/core/utils/GetStyles.js +53 -5
  25. package/dist/core/utils/ParseStyles.d.ts +3 -2
  26. package/dist/core/utils/ParseStyles.js +12 -12
  27. package/dist/core/utils/SetStyles.d.ts +4 -3
  28. package/dist/core/utils/SetStyles.js +19 -14
  29. package/dist/core/utils/index.d.ts +5 -1
  30. package/dist/core/utils/index.js +7 -6
  31. package/dist/fluid-dnd-logo.png +0 -0
  32. package/dist/index-BdOAK6C7.cjs +1 -0
  33. package/dist/index-HczUoMBK.js +1131 -0
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.mjs +2 -2
  36. package/dist/insert-Dd8savAS.js +51 -0
  37. package/dist/insert-T4Y6rI_j.cjs +1 -0
  38. package/dist/react/index.cjs +1 -1
  39. package/dist/react/index.mjs +32 -30
  40. package/dist/react/utils/ReactLilstConfig.js +3 -2
  41. package/dist/remove-BC4sUY1o.cjs +1 -0
  42. package/dist/remove-M01dmTvo.js +48 -0
  43. package/dist/svelte/index.cjs +1 -1
  44. package/dist/svelte/index.mjs +18 -16
  45. package/dist/svelte/utils/SvelteListCondig.js +3 -2
  46. package/dist/vue/index.cjs +1 -1
  47. package/dist/vue/index.mjs +26 -24
  48. package/dist/vue/utils/VueListCondig.js +3 -2
  49. package/package.json +1 -1
  50. package/dist/index-2hBSSK9_.cjs +0 -1
  51. package/dist/index-DFXw7kYo.js +0 -1223
@@ -1,5 +1,5 @@
1
1
  import { Direction } from '..';
2
- import { BeforeMargin, AfterMargin, BorderWidth, PaddingBefore, Before } from '../../../index';
2
+ import { BeforeMargin, AfterMargin, BorderWidth, PaddingBefore, Before, Translate, Coordinate, ElementPosition, ElementScroll, WindowScroll } from '../../../index';
3
3
  export declare const getWindowScroll: () => {
4
4
  scrollX: number;
5
5
  scrollY: number;
@@ -17,12 +17,33 @@ export declare const getScrollElement: (element: HTMLElement) => {
17
17
  scrollLeft: number;
18
18
  scrollTop: number;
19
19
  };
20
+ export declare const getRect: (element: Element) => DOMRect;
21
+ export declare const getDistanceValue: (direction: Direction, translation: Translate) => readonly [number, "width" | "height"];
22
+ export declare const getAxisValue: (direction: Direction, coordinate: Coordinate) => number;
23
+ export declare const getBorderBeforeWidthValue: (direction: Direction, element: Element) => number;
24
+ export declare const getBeforeMarginValue: (direction: Direction, element: Element | null) => number;
25
+ export declare const getBeforeMargin: (direction: Direction, element: Element | null) => number;
26
+ export declare const getAfterMargin: (direction: Direction, element: Element | null) => number;
27
+ export declare const getBefore: (direction: Direction, elementPosition: ElementPosition) => number;
28
+ export declare const getScrollElementValue: (direction: Direction, element: ElementScroll) => readonly [number, "scrollLeft" | "scrollTop"];
29
+ export declare const getScrollValue: (direction: Direction, elementScroll: WindowScroll) => number;
30
+ export declare const getInnerDistance: (direction: Direction, innerElement: {
31
+ innerWidth: number;
32
+ innerHeight: number;
33
+ }) => number;
34
+ export declare const getPageValue: (direction: Direction, event: {
35
+ pageX: number;
36
+ pageY: number;
37
+ }) => number;
38
+ export declare const getOffsetValue: (direction: Direction, event: {
39
+ offsetX: number;
40
+ offsetY: number;
41
+ }) => number;
20
42
  export declare const getPropByDirection: (direction: Direction) => {
21
43
  readonly beforeMargin: "marginTop" | "marginLeft";
22
44
  readonly afterMargin: "marginBottom" | "marginRight";
23
45
  readonly borderBeforeWidth: "borderTopWidth" | "borderLeftWidth";
24
46
  readonly before: "left" | "top";
25
- readonly after: "right" | "down";
26
47
  readonly gap: "columnGap" | "rowGap";
27
48
  readonly distance: "width" | "height";
28
49
  readonly axis: "x" | "y";
@@ -31,7 +52,6 @@ export declare const getPropByDirection: (direction: Direction) => {
31
52
  readonly scrollElement: "scrollLeft" | "scrollTop";
32
53
  readonly page: "pageX" | "pageY";
33
54
  readonly inner: "innerWidth" | "innerHeight";
34
- readonly offsetElement: "offsetLeft" | "offsetTop";
35
55
  readonly scrollDistance: "scrollWidth" | "scrollHeight";
36
56
  readonly clientDistance: "clientWidth" | "clientHeight";
37
57
  readonly paddingBefore: "paddingLeft" | "paddingTop";
@@ -42,3 +62,4 @@ export declare const getGroupDroppables: (currentDroppable: HTMLElement, droppab
42
62
  export declare const getParentDraggableChildren: (parent: HTMLElement) => Element[];
43
63
  export declare const getSiblingsByParent: (current: HTMLElement, parent: HTMLElement) => readonly [Element[], number, HTMLElement];
44
64
  export declare const getNearestFixedParentPosition: (element: Element, direction: Direction) => number;
65
+ export declare const isSameNode: (element1: Element | null | undefined, element2: Element | null) => boolean | undefined;
@@ -84,9 +84,57 @@ export const getScrollElement = (element) => {
84
84
  const { scrollLeft, scrollTop } = element;
85
85
  return { scrollLeft, scrollTop };
86
86
  };
87
- const getRect = (element) => {
87
+ export const getRect = (element) => {
88
88
  return element.getBoundingClientRect();
89
89
  };
90
+ export const getDistanceValue = (direction, translation) => {
91
+ const { distance } = getPropByDirection(direction);
92
+ return [translation[distance], distance];
93
+ };
94
+ export const getAxisValue = (direction, coordinate) => {
95
+ const { axis } = getPropByDirection(direction);
96
+ return coordinate[axis];
97
+ };
98
+ export const getBorderBeforeWidthValue = (direction, element) => {
99
+ const { borderBeforeWidth } = getPropByDirection(direction);
100
+ return getValueFromProperty(element, borderBeforeWidth);
101
+ };
102
+ export const getBeforeMarginValue = (direction, element) => {
103
+ const { beforeMargin } = getPropByDirection(direction);
104
+ return getValueFromProperty(element, beforeMargin);
105
+ };
106
+ export const getBeforeMargin = (direction, element) => {
107
+ const { beforeMargin } = getPropByDirection(direction);
108
+ return getValueFromProperty(element, beforeMargin);
109
+ };
110
+ export const getAfterMargin = (direction, element) => {
111
+ const { afterMargin } = getPropByDirection(direction);
112
+ return getValueFromProperty(element, afterMargin);
113
+ };
114
+ export const getBefore = (direction, elementPosition) => {
115
+ const { before } = getPropByDirection(direction);
116
+ return elementPosition[before];
117
+ };
118
+ export const getScrollElementValue = (direction, element) => {
119
+ const { scrollElement } = getPropByDirection(direction);
120
+ return [element[scrollElement], scrollElement];
121
+ };
122
+ export const getScrollValue = (direction, elementScroll) => {
123
+ const { scroll } = getPropByDirection(direction);
124
+ return elementScroll[scroll];
125
+ };
126
+ export const getInnerDistance = (direction, innerElement) => {
127
+ const { inner } = getPropByDirection(direction);
128
+ return innerElement[inner];
129
+ };
130
+ export const getPageValue = (direction, event) => {
131
+ const { page } = getPropByDirection(direction);
132
+ return event[page];
133
+ };
134
+ export const getOffsetValue = (direction, event) => {
135
+ const { offset } = getPropByDirection(direction);
136
+ return event[offset];
137
+ };
90
138
  export const getPropByDirection = (direction) => {
91
139
  const ifHorizontal = direction == HORIZONTAL;
92
140
  return {
@@ -94,7 +142,6 @@ export const getPropByDirection = (direction) => {
94
142
  afterMargin: ifHorizontal ? 'marginRight' : 'marginBottom',
95
143
  borderBeforeWidth: ifHorizontal ? 'borderLeftWidth' : 'borderTopWidth',
96
144
  before: ifHorizontal ? 'left' : 'top',
97
- after: ifHorizontal ? 'right' : 'down',
98
145
  gap: ifHorizontal ? 'columnGap' : 'rowGap',
99
146
  distance: ifHorizontal ? 'width' : 'height',
100
147
  axis: ifHorizontal ? 'x' : 'y',
@@ -103,7 +150,6 @@ export const getPropByDirection = (direction) => {
103
150
  scrollElement: ifHorizontal ? 'scrollLeft' : 'scrollTop',
104
151
  page: ifHorizontal ? 'pageX' : 'pageY',
105
152
  inner: ifHorizontal ? 'innerWidth' : 'innerHeight',
106
- offsetElement: ifHorizontal ? 'offsetLeft' : 'offsetTop',
107
153
  scrollDistance: ifHorizontal ? 'scrollWidth' : 'scrollHeight',
108
154
  clientDistance: ifHorizontal ? 'clientWidth' : 'clientHeight',
109
155
  paddingBefore: ifHorizontal ? 'paddingLeft' : 'paddingTop',
@@ -142,9 +188,11 @@ const getNearestFixedParent = (element) => {
142
188
  return null; // No fixed parent found
143
189
  };
144
190
  export const getNearestFixedParentPosition = (element, direction) => {
145
- const { before, borderBeforeWidth } = getPropByDirection(direction);
146
191
  const fixedParent = getNearestFixedParent(element);
147
192
  return fixedParent
148
- ? getRect(fixedParent)[before] + getValueFromProperty(fixedParent, borderBeforeWidth)
193
+ ? getBefore(direction, getRect(fixedParent)) + getBorderBeforeWidthValue(direction, fixedParent)
149
194
  : 0;
150
195
  };
196
+ export const isSameNode = (element1, element2) => {
197
+ return element1?.isSameNode(element2);
198
+ };
@@ -1,7 +1,8 @@
1
- import { GapStyle } from "../../../index";
2
- import { Direction } from "..";
1
+ import { GapStyle } from '../../../index';
2
+ import { Direction } from '..';
3
3
  export declare const getNumberFromPixels: (pixels: string | undefined) => number;
4
4
  export declare const computeGapPixels: (element: Element, gapType: GapStyle) => number;
5
5
  export declare const gapAndDisplayInformation: (element: Element | null, gapStyle: GapStyle) => [number, boolean];
6
6
  export declare const getBeforeStyles: (element: HTMLElement) => [number, number];
7
+ export declare const getGapInfo: (element: HTMLElement | null, direction: Direction) => [number, boolean];
7
8
  export declare const getGapPixels: (element: HTMLElement, direction: Direction) => number;
@@ -1,15 +1,15 @@
1
- import { getPropByDirection, parseFloatEmpty } from "./GetStyles";
1
+ import { getPropByDirection, getRect, parseFloatEmpty } from './GetStyles';
2
2
  export const getNumberFromPixels = (pixels) => {
3
3
  if (!pixels || pixels.length == 0) {
4
4
  return 0;
5
5
  }
6
- return parseFloatEmpty(pixels.replace("px", ""));
6
+ return parseFloatEmpty(pixels.replace('px', ''));
7
7
  };
8
8
  export const computeGapPixels = (element, gapType) => {
9
9
  const gap = getComputedStyle(element)[gapType];
10
- if (gap.match("%")) {
11
- const gap_percent = parseFloatEmpty(gap.replace("%", ""));
12
- const { width } = element.getBoundingClientRect();
10
+ if (gap.match('%')) {
11
+ const gap_percent = parseFloatEmpty(gap.replace('%', ''));
12
+ const { width } = getRect(element);
13
13
  return width * (gap_percent / 100);
14
14
  }
15
15
  const gap_px = getNumberFromPixels(gap);
@@ -17,22 +17,22 @@ export const computeGapPixels = (element, gapType) => {
17
17
  };
18
18
  export const gapAndDisplayInformation = (element, gapStyle) => {
19
19
  if (!(element instanceof Element))
20
- return [
21
- 0,
22
- false,
23
- ];
20
+ return [0, false];
24
21
  const gap = computeGapPixels(element, gapStyle);
25
22
  const display = getComputedStyle(element).display;
26
- const hasGaps = gap > 0 || display === "flex";
23
+ const hasGaps = gap > 0 || display === 'flex';
27
24
  return [gap, hasGaps];
28
25
  };
29
26
  export const getBeforeStyles = (element) => {
30
27
  const { top, left } = getComputedStyle(element);
31
28
  return [getNumberFromPixels(top), getNumberFromPixels(left)];
32
29
  };
33
- export const getGapPixels = (element, direction) => {
30
+ export const getGapInfo = (element, direction) => {
34
31
  const { gap: gapStyle } = getPropByDirection(direction);
35
- const [gap, hasGaps] = gapAndDisplayInformation(element, gapStyle);
32
+ return gapAndDisplayInformation(element, gapStyle);
33
+ };
34
+ export const getGapPixels = (element, direction) => {
35
+ const [gap, hasGaps] = getGapInfo(element, direction);
36
36
  if (hasGaps) {
37
37
  return gap;
38
38
  }
@@ -1,4 +1,4 @@
1
- import { DragMouseTouchEvent, fixedSize } from '../../../index';
1
+ import { DragMouseTouchEvent, fixedSize, Translate } from '../../../index';
2
2
  type onTouchEvent = 'ontouchstart' | 'ontouchmove' | 'ontouchend';
3
3
  declare const onMouseEvents: readonly ["onmouseup", "onmousedown", "onmousemove"];
4
4
  type onMouseEvent = (typeof onMouseEvents)[number];
@@ -7,9 +7,9 @@ declare const mouseEvents: readonly ["mouseup", "mousedown", "mousemove"];
7
7
  type MouseEventType = (typeof mouseEvents)[number];
8
8
  type DragEventCallback = (event: DragMouseTouchEvent) => void;
9
9
  type TouchEventCallback = (event: TouchEvent) => void;
10
- export declare const setSizeStyles: (element: HTMLElement | undefined | null, height: number, width: number) => void;
10
+ export declare const setSizeStyles: (element: HTMLElement | undefined | null, translate: Translate) => void;
11
11
  export declare const fixSizeStyle: (element: HTMLElement | undefined | null) => void;
12
- export declare const moveTranslate: (element: Element | undefined | null, height: number, width: number) => void;
12
+ export declare const moveTranslate: (element: Element | undefined | null, translation?: Translate) => void;
13
13
  export declare const assignDraggingEvent: (element: HTMLElement, onEvent: onMouseEvent | onTouchEvent, callback: DragEventCallback | null, touchCallback?: TouchEventCallback) => void;
14
14
  export declare const addDragMouseToucEventListener: (event: TouchEventType | MouseEventType, callback: DragEventCallback | null) => void;
15
15
  export declare const convetEventToDragMouseTouchEvent: (event: MouseEvent | TouchEvent) => DragMouseTouchEvent;
@@ -17,4 +17,5 @@ export declare const setTranistion: (element: Element | undefined, duration: num
17
17
  export declare const setEventWithInterval: (element: Element | undefined, eventName: "onscroll", callback: () => void) => void;
18
18
  export declare const AddCssStylesToElement: (node: ParentNode, cssCodes: string[]) => void;
19
19
  export declare const setCustomFixedSize: (element: HTMLElement | undefined, fixedProps?: fixedSize) => void;
20
+ export declare const removeTranslateWhitoutTransition: (element?: Element) => void;
20
21
  export {};
@@ -1,31 +1,31 @@
1
+ import { NONE_TRANSLATE } from '.';
1
2
  import { HORIZONTAL, VERTICAL } from '..';
2
- import { getPropByDirection, getValueFromProperty } from './GetStyles';
3
+ import { getBefore, getBorderBeforeWidthValue, getPageValue, getRect, getScrollValue } from './GetStyles';
3
4
  import { IsHTMLElement, IsMouseEvent, isTouchEvent } from './typesCheckers';
4
5
  const onMouseEvents = ['onmouseup', 'onmousedown', 'onmousemove'];
5
6
  const mouseEvents = ['mouseup', 'mousedown', 'mousemove'];
6
- export const setSizeStyles = (element, height, width) => {
7
+ export const setSizeStyles = (element, translate) => {
7
8
  if (!element) {
8
9
  return;
9
10
  }
10
- element.style.height = `${height}px`;
11
- element.style.width = `${width}px`;
11
+ element.style.height = `${translate.height}px`;
12
+ element.style.width = `${translate.width}px`;
12
13
  };
13
14
  export const fixSizeStyle = (element) => {
14
15
  if (!element) {
15
16
  return;
16
17
  }
17
- const { height, width } = element.getBoundingClientRect();
18
- setSizeStyles(element, height, width);
18
+ setSizeStyles(element, getRect(element));
19
19
  };
20
- export const moveTranslate = (element, height, width) => {
20
+ export const moveTranslate = (element, translation = NONE_TRANSLATE) => {
21
21
  if (!element || !IsHTMLElement(element)) {
22
22
  return;
23
23
  }
24
- if (width == 0 && height == 0) {
24
+ if (translation.width == 0 && translation.height == 0) {
25
25
  element.style.transform = '';
26
26
  }
27
27
  else {
28
- element.style.transform = `translate(${width}px,${height}px)`;
28
+ element.style.transform = `translate(${translation.width}px,${translation.height}px)`;
29
29
  }
30
30
  };
31
31
  const assignDraggingTouchEvent = (element, onEvent, callback, touchCallback) => {
@@ -123,12 +123,11 @@ const getEvent = (event) => {
123
123
  }
124
124
  };
125
125
  const getOffset = (event, window, direction, element) => {
126
- const { page, scroll, before, borderBeforeWidth, getRect } = getPropByDirection(direction);
127
126
  const boundingClientRect = getRect(element);
128
- return (event[page] -
129
- window[scroll] -
130
- boundingClientRect[before] -
131
- getValueFromProperty(element, borderBeforeWidth));
127
+ return (getPageValue(direction, event) -
128
+ getScrollValue(direction, window) -
129
+ getBefore(direction, boundingClientRect) -
130
+ getBorderBeforeWidthValue(direction, element));
132
131
  };
133
132
  export const setTranistion = (element, duration, timingFunction = 'ease-out', types = 'transform') => {
134
133
  if (IsHTMLElement(element)) {
@@ -190,3 +189,9 @@ export const setCustomFixedSize = (element, fixedProps = {}) => {
190
189
  const setCustomProperty = (element, fixedProp, newFixedSize) => {
191
190
  return element && element.style.setProperty(fixedProp, newFixedSize);
192
191
  };
192
+ export const removeTranslateWhitoutTransition = (element) => {
193
+ if (IsHTMLElement(element)) {
194
+ element.style.transition = '';
195
+ element.style.transform = '';
196
+ }
197
+ };
@@ -6,5 +6,9 @@ export declare const TEMP_CHILD_CLASS = "temp-child";
6
6
  export declare const draggableTargetTimingFunction = "cubic-bezier(0.2, 0, 0, 1)";
7
7
  export type DraggingEvent = typeof DRAG_EVENT | typeof START_DRAG_EVENT;
8
8
  export type DropEvent = typeof DROP_EVENT | typeof START_DROP_EVENT;
9
- export type DragAndDropEvent = DraggingEvent | DropEvent | "remove" | "insert";
9
+ export type DragAndDropEvent = DraggingEvent | DropEvent | 'remove' | 'insert';
10
10
  export declare const IsDropEvent: (event: DragAndDropEvent) => event is DropEvent;
11
+ export declare const NONE_TRANSLATE: {
12
+ height: number;
13
+ width: number;
14
+ };
@@ -1,9 +1,10 @@
1
- export const START_DRAG_EVENT = "startDrag";
2
- export const DRAG_EVENT = "drag";
3
- export const START_DROP_EVENT = "startDrop";
4
- export const DROP_EVENT = "drop";
5
- export const TEMP_CHILD_CLASS = "temp-child";
6
- export const draggableTargetTimingFunction = "cubic-bezier(0.2, 0, 0, 1)";
1
+ export const START_DRAG_EVENT = 'startDrag';
2
+ export const DRAG_EVENT = 'drag';
3
+ export const START_DROP_EVENT = 'startDrop';
4
+ export const DROP_EVENT = 'drop';
5
+ export const TEMP_CHILD_CLASS = 'temp-child';
6
+ export const draggableTargetTimingFunction = 'cubic-bezier(0.2, 0, 0, 1)';
7
7
  export const IsDropEvent = (event) => {
8
8
  return event === DROP_EVENT || event === START_DROP_EVENT;
9
9
  };
10
+ export const NONE_TRANSLATE = { height: 0, width: 0 };
Binary file
@@ -0,0 +1 @@
1
+ "use strict";var _e=Object.defineProperty;var $e=(t,e,n)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var X=(t,e,n)=>$e(t,typeof e!="symbol"?e+"":e,n);const Y="horizontal",z="vertical";var L=(t=>(t[t.NOT_DRAGGING=0]="NOT_DRAGGING",t[t.START_DRAGGING=1]="START_DRAGGING",t[t.DRAGING=2]="DRAGING",t[t.END_DRAGGING=3]="END_DRAGGING",t))(L||{});const W="draggable",Yt="droppable",Mt="handler-class",Lt="dragging",Xt="dragging-handler-class",Wt="dropping",le="grabbing",ue="grab",Ve="disable-transition",U=(t,e)=>t.classList.contains(e),at=(t,e,n=!1)=>{t.classList.toggle(e,n)},ot=(t,e)=>{t.classList.add(e)},qt=(t,e)=>{t.classList.remove(e)},Ye=(t,e)=>vt(e).every(n=>U(t,n)),ut=t=>t?`.${vt(t).join(".")}`:"",Xe=(t,e)=>{if(!e)return;const n=vt(e);t.classList.add(...n)},vt=t=>t?t.split(" ").filter(e=>e):[],We=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},kt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),qe=t=>t?parseInt(t):-1,He=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},ge=(t,e)=>t.x1>e.x1?ge(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,Tt=(t,e)=>!ze(t,e),ze=(t,e)=>{const{intersectionX:n,intersectionY:s,rect1:o,rect2:r}=fe(t,e);return s>=Math.min(o.height,r.height)/2&&n>=Math.min(o.width,r.width)/2},je=(t,e)=>!Ze(t,e),Ze=(t,e)=>{const{intersectionX:n,intersectionY:s}=fe(t,e);return s>=0&&n>=0},fe=(t,e)=>{const n=B(t),s=B(e),o=ne(n,s,z),r=ne(n,s,Y);return{rect1:n,rect2:s,intersectionX:r,intersectionY:o}},ne=(t,e,n)=>{const{before:s,distance:o}=P(n);return ge({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},Et=(t,e)=>t?kt(getComputedStyle(t)[e]):0,se=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},B=t=>t.getBoundingClientRect(),j=(t,e)=>{const{distance:n}=P(t);return[e[n],n]},Pt=(t,e)=>{const{axis:n}=P(t);return e[n]},gt=(t,e)=>{const{borderBeforeWidth:n}=P(t);return Et(e,n)},Nt=(t,e)=>{const{beforeMargin:n}=P(t);return Et(e,n)},pe=(t,e)=>{const{beforeMargin:n}=P(t);return Et(e,n)},St=(t,e)=>{const{afterMargin:n}=P(t);return Et(e,n)},J=(t,e)=>{const{before:n}=P(t);return e[n]},At=(t,e)=>{const{scrollElement:n}=P(t);return[e[n],n]},lt=(t,e)=>{const{scroll:n}=P(t);return e[n]},ke=(t,e)=>{const{inner:n}=P(t);return e[n]},Ut=(t,e)=>{const{page:n}=P(t);return e[n]},de=(t,e)=>{const{offset:n}=P(t);return e[n]},P=t=>{const e=t==Y;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",gap:e?"columnGap":"rowGap",distance:e?"width":"height",axis:e?"x":"y",offset:e?"offsetX":"offsetY",scroll:e?"scrollX":"scrollY",scrollElement:e?"scrollLeft":"scrollTop",page:e?"pageX":"pageY",inner:e?"innerWidth":"innerHeight",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:B}},Rt=(t,e)=>Je(t,e),Ue=t=>[...t.children].filter(n=>U(n,W)),Je=(t,e)=>{const n=[...e.children].filter(o=>U(o,W)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},Ke=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},he=(t,e)=>{const n=Ke(t);return n?J(e,B(n))+gt(e,n):0},N=(t,e)=>t==null?void 0:t.isSameNode(e),me="startDrag",Bt="drag",De="startDrop",ct="temp-child",Jt="cubic-bezier(0.2, 0, 0, 1)",It={height:0,width:0},mt=t=>window.TouchEvent&&t instanceof TouchEvent,Q=t=>t instanceof HTMLElement,Te=t=>t instanceof MouseEvent,Qe=["onmouseup","onmousedown","onmousemove"],tn=(t,e)=>{t&&(t.style.height=`${e.height}px`,t.style.width=`${e.width}px`)},rt=(t,e=It)=>{!t||!Q(t)||(e.width==0&&e.height==0?t.style.transform="":t.style.transform=`translate(${e.width}px,${e.height}px)`)},en=(t,e,n,s)=>{t[e]=o=>{if(o.defaultPrevented)return;s&&s(o);const r=Ht(o);n(r)}},Vt=(t,e,n,s)=>{n&&(nn(e)?t[e]=n:en(t,e,n,s))},nn=t=>Qe.includes(t),sn=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},on=(t,e)=>{const n=(s,o)=>cn(e,window,o,s);if(Te(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,Y),n(s,z)]}},Ht=t=>{const e=rn(t);if(!e)return sn(t);const[n,s]=on(t,e),{clientX:o,clientY:r,pageX:i,pageY:a,screenX:f,screenY:l,target:h}=e;return{clientX:o,clientY:r,pageX:i,pageY:a,screenX:f,screenY:l,target:h,offsetX:n,offsetY:s}},rn=t=>{if(mt(t))return t.touches[0]??t.changedTouches[0];if(Te(t))return t},cn=(t,e,n,s)=>{const o=B(s);return Ut(n,t)-lt(n,e)-J(n,o)-gt(n,s)},Ct=(t,e,n="ease-out",s="transform")=>{Q(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},Se=(t,e,n)=>{!t||!Q(t)||(t[e]=()=>{n()})},an=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},ln=(t,e)=>{const n=/\.-?[_a-zA-Z0-9-*\s<>():]+/g,[s]=e.match(n)||[];for(const o of t.cssRules){const[r]=o.cssText.match(n)||[];if(s===r)return!0}return!1},un=(t,e)=>{e.forEach(n=>{gn(t,n)})},gn=(t,e)=>{var s;var n=an(t);n.sheet&&(ln(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},Ae=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&fn(t,`--${n}`,s)}},fn=(t,e,n)=>t&&t.style.setProperty(e,n),wt=t=>{Q(t)&&(t.style.transition="",t.style.transform="")},pn=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},dn=t=>{let e=.5;const n=.03,s=(i,a,f,l)=>{const[h]=j(i,B(t)),p=B(a),R=J(i,f)-J(i,p)+Pt(i,l),[I]=j(i,p),y=I-h,A=R/y,D=h/y,b=.25,v=.2,G=.8;let F=0;const q=je(t,a);!q&&A<v&&A>-D?F=o(A<0?0:A,v):!q&&A>G&&A<1+D&&(F=r(A,G));const _=b*h*F;e=Math.sign(_)*Math.min(Math.abs(_),Math.abs(e)+n),pn(a,i,e)},o=(i,a)=>Math.pow(i/a,1/3)-1,r=(i,a)=>Math.pow(1/(1-a)*(i-a),3);return[s]},hn=(t,e)=>{let n={offsetX:0,offsetY:0},s={top:0,left:0},o={x:0,y:0};const[r]=dn(t),i=p=>{t.style.transform=`translate( ${p.x}px, ${p.y}px)`},a=p=>{t.style.top=`${p.top}px`,t.style.left=`${p.left}px`},f=(p,R,I,y)=>{const A=v=>{const G=Ut(v,I),F=lt(v,window),q=ke(v,window),[_]=j(v,B(p)),Z=gt(v,p),K=Nt(v,p),k=G-de(v,n),tt=he(p,v);if(k>=F-_/2&&k<=F+q){const u=k-J(v,s)-Z-K-F-tt;return D(v),u}return Pt(v,o)},D=v=>{p&&U(p,Lt)&&v===y&&r(y,R,s,o)},b=v=>{const{axis:G}=P(v);o[G]=A(v),i(l())};b(Y),b(z)},l=()=>{let p=o;for(const R of e)p=R(p,t);return p};return[f,(p,R)=>{const[I,y,A,D]=Tn(p,R,t);s={top:I,left:y},a(s),n={offsetX:A,offsetY:D}}]},xt=(t,e,n)=>J(t,B(e))-J(t,B(n))-gt(t,n),mn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Dn(o,e);const i=o;return i&&r&&!N(i,r)&&(n+=xt(Y,i,r),s+=xt(z,i,r)),r&&e!=o&&(n+=xt(Y,r,e),s+=xt(z,r,e)),[n,s]},Dn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Mt}`);return n&&N(e,n)?t:n},oe=(t,e,n,s)=>{const o=he(n,t);return Ut(t,e)-de(t,s)-Nt(t,n)-gt(t,n)-lt(t,window)-o},Tn=(t,e,n)=>{const[s,o]=mn(t,n);return[oe(z,t,e,{offsetX:s,offsetY:o}),oe(Y,t,e,{offsetX:s,offsetY:o}),s,o]},H=class H{static addConfig(e,n){const s=H.configs.filter(r=>!N(r.droppable,e)),o=se(e);s.push({droppable:e,config:n,scroll:o}),H.configs=s}static updateScrolls(e,n){for(const s of H.configs){const{droppable:o}=s;(n&&Ye(o,n)||N(e,o))&&(s.scroll=se(o))}}static getConfig(e){return H.configs.find(({droppable:s})=>N(e,s))}};X(H,"configs",[]),X(H,"removeObsoleteConfigs",()=>{const e=H.configs.filter(({droppable:n})=>document.contains(n));H.configs=e});let it=H;const zt=t=>!t||t.length==0?0:kt(t.replace("px","")),Sn=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=kt(n.replace("%","")),{width:r}=B(t);return r*(o/100)}return zt(n)},An=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Sn(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},vn=t=>{const{top:e,left:n}=getComputedStyle(t);return[zt(e),zt(n)]},Kt=(t,e)=>{const{gap:n}=P(e);return An(t,n)},En=(t,e)=>{const[n,s]=Kt(t,e);return s?n:0},Qt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const i=r[0];t(o,i)}});return o.observe(e,n),o},jt=t=>Q(t)?t.classList.contains(ct):!1;function Dt(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:i,width:a}=Cn(n,t,o,r);return Tt(t,s)&&e==Bt&&(i=0,a=0),{height:i,width:a}}const Cn=(t,e,n,s)=>{const o=St(t,e),r=Nt(t,e),i=Nt(t,s),[a,f]=Kt(e.parentElement,t),[l]=j(t,B(e));if(f)return re(l,r,o,a,0,t);const[h,p,R]=yn(n,i,o,r,t);return re(l,p,h,0,R,t)},yn=(t,e,n,s,o)=>{const r=Math.max(e,n);let i=s,a=e;if(t){const f=St(o,t);i=Math.max(f,s),a=Math.max(a,f)}return[r,i,a]},re=(t,e,n,s,o,r)=>bn(r,t+e+n+s-o),bn=(t,e)=>t==Y?{width:e,height:0}:{width:0,height:e},Gn="startDrag",ve="cubic-bezier(0.2, 0, 0, 1)",Ee=50,Ce="width, min-width, height",xn=(t,e,n)=>{let s=Dt(e,Gn,n,t);const o=En(t,n),[,r]=j(n,s);s[r]-=o;const[i,a]=Rn(n,e);return s[a]=i,s},Rn=(t,e)=>{const n=t==Y?z:Y;return j(n,B(e))},ft=(t,e=It)=>{tn(t,e),t.style.minWidth=`${e.width}px`},On=(t,e,n)=>s=>{e.contains(t)&&(ft(t,n),s.disconnect())},ye=(t,e)=>{const{scrollDistance:n,clientDistance:s}=P(e);return t[n]-t[s]},Mn=(t,e,n)=>{const[s]=At(t,n);return s/ye(e,t)},Nn=(t,e,n,s)=>{if(!s)return;const{direction:o}=e,r=Mn(o,t,n)>.99,[,i]=At(o,t);r&&(t[i]=ye(t,o))},be=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r,scroll:i}=n,{direction:a,animationDuration:f}=r;if(Nn(o,r,i,e),o.querySelector(`.${ct}`)||!t)return;var l=t.tagName=="LI"?"DIV":t.tagName,h=document.createElement(l);ot(h,ct),ft(h);const p=xn(o,t,a);return Ct(h,f,ve,Ce),[h,p,o]},Zt=(t,e,n,s,o)=>{const r=be(t,n,s);if(!r)return;const[i,a,f]=r;N(e,f)&&ft(i,a),Qt(On(i,f,a),f,{childList:!0,subtree:!0}),f.appendChild(i)},Bn=(t,e,n)=>{const s=be(t,e,n);if(!s)return;const[o,r,i]=s;i.appendChild(o),In(o,r)},In=(t,e)=>requestAnimationFrame(()=>{ft(t,e),requestAnimationFrame(()=>{Ct(t,0,ve,Ce)})}),wn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${ut(n)} > .${ct}`);r.forEach(i=>{const a=i.parentElement;if(N(e,a)||!o&&N(t,a))return;ft(i),setTimeout(()=>{var l;(l=i.parentNode)==null||l.removeChild(i)},s+Ee)})}},Ot=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${ct}`);s.forEach(o=>{const r=o;n?(ft(r),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+Ee)):t.removeChild(o)})},Ln=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:f=>{const{index:l,value:h}=f;r({index:l,value:e(h,s)})},onInsertEvent:(f,l)=>o(f,e(l,s),!0)}};class Pn{constructor(e,n,s,o,r,i){X(this,"initial");X(this,"current");X(this,"parent");X(this,"draggableElement");X(this,"groupClass");X(this,"dragEvent");X(this,"changeDroppable");X(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=i,this.initial=it.getConfig(s),this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!N(s,o))}getElementBelow(e,n){return(o=>{const[r]=o.getDraggableAncestor(n.clientX,n.clientY,e);return r})(this)}getCurrent(e,n){const s=this.getElementBelow(e,n);return!this.groupClass||!s?void 0:s.closest(ut(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(ut(this.groupClass))):[this.parent]).every(s=>Tt(e,s))}isNotInsideAnotherDroppable(e,n){return!Tt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){Se(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=it.getConfig(e);if(n)return N(this.parent,e)?n:{...n,config:Ln(n,this.mapFrom)}}droppableIfInsideCurrent(e,n){return e&&!N(n,e)&&n.contains(e)}getCurrentConfig(e){var o,r;const n=this.draggableElement,s=this.getCurrent(n,e);return this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable)&&!this.droppableIfInsideCurrent(s,(r=this.current)==null?void 0:r.droppable)?this.current:s?(Q(s)&&!s.onscroll&&this.setOnScroll(s),this.getConfigFrom(s)):this.getConfigFrom(this.parent)}updateConfig(e){const n=this.current;this.current=this.getCurrentConfig(e),this.changeDroppable(this.current,n)}isOutside(e){const n=this.draggableElement;return!this.getCurrent(n,e)}}const ce=(t,e)=>{const{paddingBefore:n}=P(t),s=gt(t,e),o=Et(e,n),r=Pt(t,B(e));return s+o+r},Fn=(t,e)=>{const[n,s]=vn(e),o=ce(z,t);return[ce(Y,t)-s,o-n]};function _n(t,e,n,s,o,r,i,a,f){let l=0,h=0;const p=!!(n<0&&f);if(n===s&&!p)return ie({height:l,width:h},t,o,i,p);const[R,I,y,A]=Yn(e,n,s,f);if(p){const[d,m]=Fn(a,f);l+=m,h+=d}const[D,b]=Kt(a,t),[v,G,F]=Wn(R,I==null?void 0:I.previousElementSibling,A,b,p,t),[q,_,Z]=Xn(y,D,b,t),K=Vn(_,q,Z,G,v,D),[k]=At(t,a),tt=p?k:$n(a,r,t),u=(A?K-F:F-K)-tt;return t===z?l+=u:t===Y&&(h+=u),ie({height:l,width:h},t,o,i,p)}const $n=(t,e,n)=>{const[s]=At(n,t),[o]=At(n,e);return s-o},Vn=(t,e,n,s,o,r)=>{const i=Math.max(e,o);return Math.max(n,s)+t+i+r},Yn=(t,e,n,s)=>{const o=e<n,[r,i]=[e,n].toSorted((h,p)=>h-p),a=t[e]??s,f=t[n];let l=o?t.slice(r+1,i+1):t.slice(r,i);return r<0&&s&&(l=t.slice(r+1,i)),[a,f,l,o]},Xn=(t,e,n,s)=>{if(t.length==0)return[0,0,0];const o=St(s,t[0]);let r=0,i=-o;for(const[a,f]of t.entries()){const[l]=j(s,B(f)),h=pe(s,f);n&&(r+=h),n&&a>0?r+=e:r=Math.max(r,h),i+=r+l,r=St(s,f)}return[o,i,r]},ie=(t,e,n,s,o)=>{const r=lt(e,window),i=lt(e,n),a=o?0:i-2*r+lt(e,s),[,f]=j(e,t);return t[f]+=a,t},Wn=(t,e,n,s,o,r)=>{const i=n?t.previousElementSibling:e;return qn(i,t,s,o,r)},qn=(t,e,n,s,o)=>{if(n)return[0,0,0];const r=St(o,s?null:t),i=pe(o,e);let a=Math.max(r,i);return[r,i,a]},Ge=(t,e,n)=>{const{handlerSelector:s,animationDuration:o}=t,r=l=>{n(),i(l,!1),wt(l),l.style.top="",l.style.left="",Ae(l,{fixedHeight:"",fixedWidth:""})},i=(l,h)=>{at(l,Lt,h),a(h,l),e.toggleGrabClass(!h)},a=(l,h)=>{const p=h.querySelector(s);at(document.body,le,l),at(p||h,Xt,l)};return[r,i,(l,h)=>{Ct(l,o,Jt),rt(l,h)}]},Hn=50;function zn(t,e,n,s,o,r){let i=e;const{onRemoveAtEvent:a,animationDuration:f,draggingClass:l}=t,[h,p,R]=Ge(t,o,r),I=(u,d,m)=>{if(!m)return;const{droppable:C,config:x}=m,E=Dt(u,d,x.direction,C);A(u,d,E,C,x)},y=(u,d,m,C,x)=>{if(!m)return;const{droppable:E,scroll:O,config:M}=m,S=Dt(u,d,M.direction,E);v(u,d,S,C,E,O,M,x)},A=(u,d,m,C,x)=>{const[E]=Rt(u,C),O=Tt(u,C),{direction:M}=x;E.length==0&&b(m,1,M,E);for(const[S,w]of E.entries()){if(!U(w,W))continue;const $=D(M,u,w,m);if(!O&&$)m=$;else if(!O)continue;const nt=E.length-S;b(m,nt,M,E),d===me?rt(w,m):d===Bt&&R(w,m)}},D=(u,d,m,C)=>{const x=B(d),E=B(m),O=J(u,x),M=J(u,E),[S]=j(u,E),w=M+S/2,$=Pt(u,He(m)),nt=w-$;return O>nt?It:C},b=(u,d,m,C)=>{const x=C.filter(O=>U(O,W)).length,[E]=j(m,u);E==0?i=Math.max(i,d):i=Math.min(i,d-1),i=Math.min(i,x)},v=(u,d,m,C,x,E,O,M)=>{const[S,w]=Rt(u,x),$=S.toReversed(),nt=w===-1?$.length:w;$.splice(nt,0,u);const[Ft,yt,pt]=G(u,w,$,x);m=Dt(u,d,O.direction,n,Ft,yt);const _t=We(),bt=_n(O.direction,$,w,pt,_t,E,C,x,u);S.length==0&&F(void 0,m,u,bt);for(const[$t,dt]of S.toReversed().entries()){let Gt=m;pt-1>=$t&&(Gt=It),d===De&&!U(dt,ct)&&F(dt,Gt,u,bt)}q(pt,u,O,x,M)},G=(u,d,m,C)=>{const E=Tt(u,C)?d:i,O=()=>d<E?[E,E+1]:d>E?[E-1,E]:[E-1,E+1],[M,S]=O(),w=m[M]??null,$=m[S]??null;return[w,$,E]},F=(u,d,m,C)=>{rt(u,d),rt(m,C)},q=(u,d,m,C,x)=>{const{onInsertEvent:E,onDragEnd:O}=m;ot(d,Wt),K(d,n,C,()=>{if(qt(d,Wt),x!=null){const M=a(x,!0);M!=null&&(E(u,M,!0),O({value:M,index:u})),Z(d),_()}})},_=()=>{if(s){var u=document.querySelectorAll(`${ut(s)} > .${W}`);for(const d of u)wt(d)}},Z=u=>{setTimeout(()=>{qt(u,l)},Hn)},K=(u,d,m,C)=>{setTimeout(()=>{C&&C(),k(d,m),tt(m),h(u),et(u,d),et(u,m)},f)},k=(u,d)=>{N(u,d)?Ot(u,f):(Ot(u,f,!0),Ot(d,f))},tt=u=>{if(!N(n,u)){var[d]=n.querySelectorAll(`.${ct}`);d&&Q(d)&&(d.style.height="0px",d.style.width="0px")}},et=(u,d)=>{const[m]=Rt(u,d);for(const C of[...m,u])wt(C)};return[I,y,p]}const ae="onmousedown";function jn(t,e,n,s,o){const{handlerSelector:r,isDraggable:i,droppableGroup:a,animationDuration:f,draggingClass:l,droppableClass:h,onDragStart:p,delayBeforeTouchMoveEvent:R,coordinateTransform:I}=n,y=vt(a).map(c=>`droppable-group-${c}`).join(" ");let A=L.NOT_DRAGGING,D={scrollX:0,scrollY:0},b={pageX:0,pageY:0},v,G;const[F,q]=hn(t,I),_=()=>{A=L.NOT_DRAGGING},[Z,K,k]=zn(n,e,s,y,o,_),tt=()=>{ot(t,W)},et=c=>{ot(c,Mt),o.addSubscriber(c)},u=()=>{if(i(t)){const c=t.querySelector(r);et(c||t)}},d=()=>{u(),tt()},m=c=>{const g=c==null?void 0:c.querySelector(`.${Mt}`),T=g==null?void 0:g.parentElement;return g&&T&&U(T,Yt)&&!N(s,T)?null:g},C=c=>{const g=m(c)??c;g&&i(c)&&(Vt(g,ae,dt("mousemove","mouseup")),Vt(g,"ontouchstart",dt("touchmove","touchend"),T=>{const V=T.touches[0];G={x:V.clientX,y:V.clientY}}),x(g)),N(c,g)||Vt(c,ae,Gt),ot(s,Yt)},x=c=>{const g=c.querySelectorAll("img");Array.from(g).forEach(T=>{T.onmousedown=()=>!1})},E=()=>{if(b.pageX==0&&b.pageY==0||!S.current)return;const{droppable:c,config:g}=S.current;F(t,c,b,g.direction),Z(t,Bt,S.current)},O=c=>{const g=c.querySelectorAll(`.${W}`);for(const T of g)rt(T)},M=(c,g)=>{g&&A==L.DRAGING&&!N(c==null?void 0:c.droppable,g.droppable)&&(Z(t,Bt,g),O(g.droppable))},S=new Pn(t,y,s,E,M,n.mapFrom),w=c=>{if(!S.current)return;const g=y?Array.from(document.querySelectorAll(ut(y))):[s];for(const T of g)T.classList.toggle(h,!c&&N(T,S.current.droppable))},$=(c,g=!1)=>{S.updateConfig(c);const T=S.isOutside(c);w(T),A===L.START_DRAGGING&&!g?ee(c):A===L.DRAGING&&(nt(T),Me(c))},nt=(c=!0)=>{if(!S.current)return;const{droppable:g}=S.current;wn(g,s,y,f,c),!c&&Zt(t,s,A==L.START_DRAGGING,S.current)},Ft=c=>{if(mt(c)&&G&&A==L.START_DRAGGING){const g=c.touches[0],T=Math.abs(g.clientX-G.x),V=Math.abs(g.clientY-G.y);if(Math.abs(T)>5&&Math.abs(V)>5)return clearTimeout(v),!1}return!0},yt=c=>{clearTimeout(v);const g=Ht(c);if(mt(c)&&c.cancelable&&A==L.DRAGING&&c.preventDefault(),mt(c)&&!c.cancelable||!Ft(c)){te("touchmove",c);return}$(g,mt(c))},pt=(c,g)=>{c=="touchmove"?v=setTimeout(()=>{g()},R):g()},_t=(c,g)=>{const{clientX:T,clientY:V}=c,st=document.elementFromPoint(T,V),ht=st==null?void 0:st.closest(`.${W}`);return ht&&N(g,ht)},bt=c=>{const g=n.onGetValue(e);return{index:e,element:c,value:g}},$t=c=>{S.updateConfig(c),w(S.isOutside(c)),ee(c)},dt=(c,g)=>T=>{if(!_t(T,t))return;it.updateScrolls(s,y);const{scrollX:V,scrollY:st}=window;if(D={scrollX:V,scrollY:st},A===L.NOT_DRAGGING){A=L.START_DRAGGING;const ht=bt(t);ht&&p(ht),pt(c,()=>{c=="touchmove"&&$t(T)}),document.addEventListener(c,yt,{passive:!1}),Ne(s),document.addEventListener(g,xe(c),{once:!0})}},Gt=c=>S.updateConfig(c),xe=c=>g=>{te(c,g)},te=(c,g)=>{w(!0);const T=Ht(g);Ie(S.isOutside(T)),clearTimeout(v),document.removeEventListener(c,yt),S.updateConfig(T);const V=S.getCurrentConfig(T);if(V){const{droppable:st}=V;Re(st)}s.onscroll=null,_()},Re=c=>{if(c.onscroll=null,!y)return;const g=Array.from(document.querySelectorAll(ut(y)));for(const T of g)Q(T)&&(T.onscroll=null)},ee=c=>{Zt(t,s,A==L.START_DRAGGING,S.current),Oe(),Z(t,me,S.current),Le(t),q(c,t)},Oe=()=>{A=L.DRAGING},Me=c=>{const{pageX:g,pageY:T}=c;b={pageX:g,pageY:T},E()},Ne=c=>Se(c,"onscroll",Be),Be=()=>E(),Ie=c=>{if(A!==L.DRAGING&&A!==L.START_DRAGGING){_();return}A=L.END_DRAGGING,we(t),t.classList.contains(Lt)&&K(t,De,c?S.initial:S.current,D,e)},we=c=>{Ct(c,f,Jt),rt(c)},Le=c=>{const{height:g,width:T}=B(c);Ae(c,{fixedHeight:`${g}px`,fixedWidth:`${T}px`}),k(c,!0),at(c,l,!0),c.style.transition=""},Pe=c=>{Promise.resolve().then(()=>require("./remove-BC4sUY1o.cjs")).then(g=>{const[T]=g.default(n,s,o,_);S.initial&&T(e,c,t,A,S.initial)})},Fe=(c,g)=>{(c===e||c===n.onGetLegth()&&e===c-1)&&Promise.resolve().then(()=>require("./insert-T4Y6rI_j.cjs")).then(T=>{const[V]=T.default(n,s,o,_);V(c,t,s,g,S.initial)})};return d(),C(t),[Pe,Fe]}const Zn=(t,e)=>{t&&Xe(e,t)},kn=()=>{un(document.body,[`.${W}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Mt}{pointer-events:auto!important;}`,`.${ue}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Lt}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Xt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${le}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"])};function Un(t,e,n,s="index"){const o=s;let r=[],i=[];const{droppableGroup:a}=t;if(!n)return[r,i];const f=vt(a).map(l=>`droppable-group-${l}`).join(" ");kn(),Zn(f,n);for(const l of n.children){const h=l.getAttribute(o),p=qe(h),R=l;if(R&&p>=0){const[I,y]=jn(R,p,t,n,e);r.push(I),i.push(y)}}return[r,i]}const Jn=(t,e)=>{const n=(a,f)=>t.removeAtEvent(a,f),s=(a,f,l)=>t.insertEvent(a,f,l),o=()=>t.getLength(),r=a=>t.getValue(a),i=a=>a;return{direction:(e==null?void 0:e.direction)??z,handlerSelector:(e==null?void 0:e.handlerSelector)??W,draggingClass:(e==null?void 0:e.draggingClass)??"dragging",droppableClass:(e==null?void 0:e.droppableClass)??"droppable-hover",isDraggable:(e==null?void 0:e.isDraggable)??(()=>!0),onDragStart:(e==null?void 0:e.onDragStart)??(()=>{}),onDragEnd:(e==null?void 0:e.onDragEnd)??(()=>{}),droppableGroup:e==null?void 0:e.droppableGroup,onRemoveAtEvent:n,onInsertEvent:s,onGetLegth:o,onGetValue:r,animationDuration:(e==null?void 0:e.animationDuration)??200,removingClass:(e==null?void 0:e.removingClass)??"removing",insertingFromClass:(e==null?void 0:e.insertingFromClass)??"from-inserting",delayBeforeRemove:(e==null?void 0:e.delayBeforeRemove)??200,delayBeforeInsert:(e==null?void 0:e.delayBeforeInsert)??200,mapFrom:(e==null?void 0:e.mapFrom)??i,delayBeforeTouchMoveEvent:(e==null?void 0:e.delayBeforeTouchMoveEvent)??150,coordinateTransform:(e==null?void 0:e.coordinateTransform)??[a=>a]}};function Kn(t,e,n,s="index"){let o=[],r=[],i;const a=Jn(t,n),f=D=>{for(const b of o)b(D)},l=(D,b)=>{if(a.onGetLegth()===0)t.insertToListEmpty(a,D,b);else for(const G of r)G(D,b)},h=D=>{const[b,v]=Un(a,e,D,s);o=b,r=v},p=D=>{const b=D.addedNodes.values().filter(G=>!jt(G)).toArray(),v=D.removedNodes.values().filter(G=>!jt(G)).toArray();return b.length>0||v.length>0},R=D=>{i=Qt(()=>{h(D)},D,{childList:!0},p)},I=D=>{ot(D,Yt)},y=D=>{it.addConfig(D,a)};return[f,l,D=>{if(D)return I(D),y(D),R(D),h(D),it.removeObsoleteConfigs(),i}]}exports.DISABLE_TRANSITION=Ve;exports.DRAGGABLE_CLASS=W;exports.DraggingState=L;exports.GRAB_CLASS=ue;exports.addClass=ot;exports.addTempChild=Zt;exports.addTempChildOnInsert=Bn;exports.containClass=U;exports.dragAndDrop=Kn;exports.draggableTargetTimingFunction=Jt;exports.getParentDraggableChildren=Ue;exports.getSiblings=Rt;exports.getTranslationByDraggingAndEvent=Dt;exports.isTempElement=jt;exports.moveTranslate=rt;exports.observeMutation=Qt;exports.removeClass=qt;exports.removeTempChild=Ot;exports.removeTranslateWhitoutTransition=wt;exports.setTranistion=Ct;exports.toggleClass=at;exports.useChangeDraggableStyles=Ge;