fluid-dnd 1.1.0-beta.0 → 1.1.1-beta.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.
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-BUdB26zt.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
1
+ "use strict";var d=Object.defineProperty;var n=(e,s,l)=>s in e?d(e,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[s]=l;var a=(e,s,l)=>n(e,typeof s!="symbol"?s+"":s,l);const r=require("./index-BqVW-8HC.cjs");class h{constructor(){a(this,"handlers");this.handlers=[]}addSubscriber(s){this.handlers.includes(s)||(this.handlers.push(s),r.addClass(s,r.GRAB_CLASS))}toggleGrabClass(s){for(const l of this.handlers)r.toggleClass(l,r.GRAB_CLASS,s)}}exports.HandlerPublisher=h;
@@ -1,7 +1,7 @@
1
1
  var d = Object.defineProperty;
2
2
  var e = (a, s, l) => s in a ? d(a, s, { enumerable: !0, configurable: !0, writable: !0, value: l }) : a[s] = l;
3
3
  var r = (a, s, l) => e(a, typeof s != "symbol" ? s + "" : s, l);
4
- import { a as h, t as n, G as t } from "./index-Cj5Hg1w9.js";
4
+ import { a as h, t as n, G as t } from "./index-ANSOhcfo.js";
5
5
  class c {
6
6
  constructor() {
7
7
  r(this, "handlers");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BUdB26zt.cjs");exports.dragAndDrop=e.dragAndDrop;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BqVW-8HC.cjs");exports.dragAndDrop=e.dragAndDrop;
@@ -1,4 +1,4 @@
1
- import { d as o } from "../index-Cj5Hg1w9.js";
1
+ import { d as o } from "../index-ANSOhcfo.js";
2
2
  export {
3
3
  o as dragAndDrop
4
4
  };
@@ -5,25 +5,25 @@ const Q = "draggable", It = "droppable", Ot = "handler-class", Ht = "dragging",
5
5
  t.classList.toggle(e, n);
6
6
  }, nt = (t, e) => {
7
7
  t.classList.add(e);
8
- }, yt = (t, e) => {
8
+ }, Ct = (t, e) => {
9
9
  t.classList.remove(e);
10
- }, be = (t, e) => Ct(e).every(
10
+ }, be = (t, e) => yt(e).every(
11
11
  (n) => et(t, n)
12
- ), dt = (t) => t ? `.${Ct(t).join(".")}` : "", Te = (t, e) => {
12
+ ), gt = (t) => t ? `.${yt(t).join(".")}` : "", Te = (t, e) => {
13
13
  if (!e)
14
14
  return;
15
- const n = Ct(e);
15
+ const n = yt(e);
16
16
  t.classList.add(...n);
17
- }, Ct = (t) => t ? t.split(" ").filter((e) => e) : [], _ = "horizontal", U = "vertical", Ee = () => {
17
+ }, yt = (t) => t ? t.split(" ").filter((e) => e) : [], _ = "horizontal", U = "vertical", Ee = () => {
18
18
  const { scrollX: t, scrollY: e } = window;
19
19
  return { scrollX: t, scrollY: e };
20
- }, qt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), ye = (t) => t ? parseInt(t) : -1, Ce = (t) => {
20
+ }, qt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), Ce = (t) => t ? parseInt(t) : -1, ye = (t) => {
21
21
  const e = getComputedStyle(t), n = new DOMMatrixReadOnly(e.transform);
22
22
  return {
23
23
  x: n.m41,
24
24
  y: n.m42
25
25
  };
26
- }, oe = (t, e) => t.x1 > e.x1 ? oe(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, gt = (t, e) => !Ae(t, e), Ae = (t, e) => {
26
+ }, oe = (t, e) => t.x1 > e.x1 ? oe(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, pt = (t, e) => !Ae(t, e), Ae = (t, e) => {
27
27
  const n = Mt(t), s = Mt(e), o = Jt(n, s, U), r = Jt(n, s, _);
28
28
  return o >= Math.min(n.height, s.height) / 2 && r >= Math.min(n.width, s.width) / 2;
29
29
  }, Jt = (t, e, n) => {
@@ -215,7 +215,7 @@ function Et(t, e, n, s, o = t.previousElementSibling, r = t.nextElementSibling)
215
215
  o,
216
216
  r
217
217
  );
218
- return gt(t, s) && e == Ft && (c = 0, l = 0), { height: c, width: l };
218
+ return pt(t, s) && e == Ft && (c = 0, l = 0), { height: c, width: l };
219
219
  }
220
220
  const ze = (t, e, n, s) => {
221
221
  const {
@@ -230,14 +230,14 @@ const ze = (t, e, n, s) => {
230
230
  ), N = u(e)[c];
231
231
  if (O)
232
232
  return Qt(N, m, d, B, 0, t);
233
- const [h, S, C] = je(
233
+ const [h, S, y] = je(
234
234
  n,
235
235
  v,
236
236
  d,
237
237
  m,
238
238
  o
239
239
  );
240
- return Qt(N, S, h, 0, C, t);
240
+ return Qt(N, S, h, 0, y, t);
241
241
  }, je = (t, e, n, s, o) => {
242
242
  const r = Math.max(e, n);
243
243
  let c = s, l = e;
@@ -282,7 +282,7 @@ function Je(t, e, n, s, o, r, c, l, u) {
282
282
  }
283
283
  const {
284
284
  scrollElement: S,
285
- beforeMargin: C,
285
+ beforeMargin: y,
286
286
  afterMargin: R,
287
287
  distance: I,
288
288
  gap: Y
@@ -291,7 +291,7 @@ function Je(t, e, n, s, o, r, c, l, u) {
291
291
  H,
292
292
  F
293
293
  ] = en(
294
- C,
294
+ y,
295
295
  R,
296
296
  B,
297
297
  O == null ? void 0 : O.previousElementSibling,
@@ -299,7 +299,7 @@ function Je(t, e, n, s, o, r, c, l, u) {
299
299
  P,
300
300
  v
301
301
  ), [Z, q, z] = tn(
302
- C,
302
+ y,
303
303
  R,
304
304
  I,
305
305
  N,
@@ -455,7 +455,7 @@ const Ke = (t, e, n) => {
455
455
  }), gn = (t, e, n, s, o = !0) => {
456
456
  if (n) {
457
457
  var r = document.querySelectorAll(
458
- `${dt(n)} > .${at}`
458
+ `${gt(n)} > .${at}`
459
459
  );
460
460
  r.forEach((c) => {
461
461
  const l = c.parentElement;
@@ -485,7 +485,7 @@ function hn(t, e, n, s, o, r) {
485
485
  animationDuration: m,
486
486
  delayBeforeInsert: v,
487
487
  draggingClass: B
488
- } = t, O = (i, f, g, D, y) => {
488
+ } = t, O = (i, f, g, D, C) => {
489
489
  if (!D)
490
490
  return;
491
491
  const { droppable: b, config: T } = D, A = Et(
@@ -500,14 +500,14 @@ function hn(t, e, n, s, o, r) {
500
500
  A,
501
501
  g,
502
502
  D,
503
- y
504
- ) : C(
503
+ C
504
+ ) : y(
505
505
  i,
506
506
  f,
507
507
  A,
508
508
  D
509
509
  );
510
- }, N = (i, f, g, D, y) => {
510
+ }, N = (i, f, g, D, C) => {
511
511
  const b = Et(
512
512
  f,
513
513
  "insert",
@@ -516,20 +516,20 @@ function hn(t, e, n, s, o, r) {
516
516
  ), { onInsertEvent: T } = t, A = re(g);
517
517
  for (const [M, x] of A.entries())
518
518
  et(x, Q) && M >= i && W(x, b);
519
- y(), setTimeout(() => {
519
+ C(), setTimeout(() => {
520
520
  T(i, D), vt(n, 0, !0), he(i, g, t), tt(f), V(f, n);
521
521
  }, v);
522
522
  }, h = (i, f, g, D) => {
523
523
  if (!g || !g.droppable || !g.config)
524
524
  return;
525
- const { droppable: y, config: b } = g;
526
- let [T] = Rt(f, y);
525
+ const { droppable: C, config: b } = g;
526
+ let [T] = Rt(f, C);
527
527
  T = [f, ...T].toReversed();
528
528
  const A = Et(
529
529
  f,
530
530
  "remove",
531
531
  b.direction,
532
- y
532
+ C
533
533
  );
534
534
  for (const [M, x] of T.entries())
535
535
  M >= i && (Y(x, A), setTimeout(() => {
@@ -539,19 +539,19 @@ function hn(t, e, n, s, o, r) {
539
539
  vt(n, m, !0), setTimeout(() => {
540
540
  tt(i), V(i, n);
541
541
  }, m);
542
- }, C = (i, f, g, D) => {
543
- const { config: y, droppable: b } = D, [T] = Rt(i, b), A = gt(i, b);
542
+ }, y = (i, f, g, D) => {
543
+ const { config: C, droppable: b } = D, [T] = Rt(i, b), A = pt(i, b);
544
544
  T.length == 0 && I(
545
545
  g,
546
546
  1,
547
- y.direction,
547
+ C.direction,
548
548
  T
549
549
  );
550
550
  for (const [M, x] of T.entries()) {
551
551
  if (!et(x, Q))
552
552
  continue;
553
553
  const G = R(
554
- y.direction,
554
+ C.direction,
555
555
  i,
556
556
  x,
557
557
  g
@@ -564,30 +564,30 @@ function hn(t, e, n, s, o, r) {
564
564
  I(
565
565
  g,
566
566
  J,
567
- y.direction,
567
+ C.direction,
568
568
  T
569
569
  ), f === ue ? Y(x, g) : f === Ft && W(x, g);
570
570
  }
571
571
  }, R = (i, f, g, D) => {
572
- const { before: y, distance: b, axis: T, getRect: A } = w(i), M = A(f), x = A(g), G = M[y], J = x[y], ut = x[b], mt = J + ut / 2, St = Ce(g)[T], ct = mt - St;
572
+ const { before: C, distance: b, axis: T, getRect: A } = w(i), M = A(f), x = A(g), G = M[C], J = x[C], ft = x[b], mt = J + ft / 2, St = ye(g)[T], ct = mt - St;
573
573
  return G > ct ? { height: 0, width: 0 } : D;
574
574
  }, I = (i, f, g, D) => {
575
- const y = D.filter(
575
+ const C = D.filter(
576
576
  (T) => et(T, Q)
577
577
  ).length, { distance: b } = w(g);
578
- i[b] == 0 ? c = Math.max(c, f) : c = Math.min(c, f - 1), c = Math.min(c, y);
578
+ i[b] == 0 ? c = Math.max(c, f) : c = Math.min(c, f - 1), c = Math.min(c, C);
579
579
  }, Y = (i, f) => {
580
580
  const { width: g, height: D } = f;
581
581
  Tt(i, D, g);
582
582
  }, W = (i, f) => {
583
583
  const { width: g, height: D } = f;
584
584
  Tt(i, D, g), Nt(i, m, fe);
585
- }, P = (i, f, g, D, y, b) => {
586
- const { droppable: T, scroll: A, config: M } = y, [x, G] = Rt(
585
+ }, P = (i, f, g, D, C, b) => {
586
+ const { droppable: T, scroll: A, config: M } = C, [x, G] = Rt(
587
587
  i,
588
588
  T
589
- ), J = x.toReversed(), ut = G === -1 ? J.length : G;
590
- J.splice(ut, 0, i);
589
+ ), J = x.toReversed(), ft = G === -1 ? J.length : G;
590
+ J.splice(ft, 0, i);
591
591
  const [mt, St, ct] = st(
592
592
  i,
593
593
  G,
@@ -636,7 +636,7 @@ function hn(t, e, n, s, o, r) {
636
636
  b
637
637
  );
638
638
  }, st = (i, f, g, D) => {
639
- const b = gt(i, D) ? f : c, T = () => f < b ? [b, b + 1] : f > b ? [b - 1, b] : [b - 1, b + 1], [A, M] = T(), x = g[A] ?? null, G = g[M] ?? null;
639
+ const b = pt(i, D) ? f : c, T = () => f < b ? [b, b + 1] : f > b ? [b - 1, b] : [b - 1, b + 1], [A, M] = T(), x = g[A] ?? null, G = g[M] ?? null;
640
640
  return [
641
641
  x,
642
642
  G,
@@ -648,25 +648,25 @@ function hn(t, e, n, s, o, r) {
648
648
  D.height,
649
649
  D.width
650
650
  );
651
- }, F = (i, f, g, D, y) => {
651
+ }, F = (i, f, g, D, C) => {
652
652
  const { onInsertEvent: b, onDragEnd: T } = g;
653
653
  nt(f, Wt), z(f, n, D, () => {
654
- if (yt(f, Wt), y != null) {
655
- const A = d(y);
654
+ if (Ct(f, Wt), C != null) {
655
+ const A = d(C);
656
656
  A != null && (b(i, A), T({ value: A, index: i })), q(f), Z();
657
657
  }
658
658
  });
659
659
  }, Z = () => {
660
660
  if (s) {
661
661
  var i = document.querySelectorAll(
662
- `${dt(s)} > .${Q}`
662
+ `${gt(s)} > .${Q}`
663
663
  );
664
664
  for (const f of i)
665
665
  $(f);
666
666
  }
667
667
  }, q = (i) => {
668
668
  setTimeout(() => {
669
- yt(i, B);
669
+ Ct(i, B);
670
670
  }, pn);
671
671
  }, z = (i, f, g, D) => {
672
672
  setTimeout(() => {
@@ -689,14 +689,14 @@ function hn(t, e, n, s, o, r) {
689
689
  }, $ = (i) => {
690
690
  it(i) && (i.style.transition = "", i.style.transform = "");
691
691
  }, tt = (i) => {
692
- r(), lt(i, !1), i.style.transform = "", i.style.transition = "", i.style.top = "", i.style.left = "", le(i, {
692
+ r(), ut(i, !1), i.style.transform = "", i.style.transition = "", i.style.top = "", i.style.left = "", le(i, {
693
693
  fixedHeight: "",
694
694
  fixedWidth: ""
695
695
  });
696
696
  }, ot = (i, f) => {
697
697
  const g = f.querySelector(u);
698
698
  bt(document.body, se, i), bt(g || f, Yt, i);
699
- }, lt = (i, f) => {
699
+ }, ut = (i, f) => {
700
700
  bt(i, Ht, f), ot(f, i), o.toggleGrabClass(!f);
701
701
  };
702
702
  return [
@@ -704,14 +704,14 @@ function hn(t, e, n, s, o, r) {
704
704
  h,
705
705
  N,
706
706
  S,
707
- lt
707
+ ut
708
708
  ];
709
709
  }
710
710
  const he = (t, e, n) => {
711
711
  const { insertingFromClass: s, animationDuration: o } = n, r = kt(() => {
712
712
  const l = re(e)[t];
713
713
  nt(l, s), nt(l, Zt), setTimeout(() => {
714
- yt(l, Zt), yt(l, s), r.disconnect();
714
+ Ct(l, Zt), Ct(l, s), r.disconnect();
715
715
  }, o);
716
716
  }, e, {
717
717
  childList: !0
@@ -769,7 +769,7 @@ const he = (t, e, n) => {
769
769
  const B = (h) => {
770
770
  const {
771
771
  beforeMargin: S,
772
- borderBeforeWidth: C,
772
+ borderBeforeWidth: y,
773
773
  before: R,
774
774
  offset: I,
775
775
  scroll: Y,
@@ -778,17 +778,17 @@ const he = (t, e, n) => {
778
778
  distance: st,
779
779
  axis: H,
780
780
  getRect: F
781
- } = w(h), Z = m[W], q = window[Y], z = window[P], X = F(u)[st], j = L(u, C), V = L(u, S), $ = Z - e[I], tt = ie(u, h);
781
+ } = w(h), Z = m[W], q = window[Y], z = window[P], X = F(u)[st], j = L(u, y), V = L(u, S), $ = Z - e[I], tt = ie(u, h);
782
782
  if ($ >= q - X / 2 && $ <= q + z) {
783
- const lt = $ - n[R] - j - V - q - tt;
784
- return O(h), lt;
783
+ const ut = $ - n[R] - j - V - q - tt;
784
+ return O(h), ut;
785
785
  }
786
786
  return s[H];
787
787
  }, O = (h) => {
788
788
  if (u && et(u, Ht) && h === v) {
789
- const { before: S, distance: C, axis: R, getRect: I } = w(v), Y = I(u)[C], W = I(d), P = n[S] - W[S] + s[R], H = W[C] - Y, F = P / H, Z = Y / H, q = 0.1, z = 0.2, X = 0.8;
789
+ const { before: S, distance: y, axis: R, getRect: I } = w(v), Y = I(u)[y], W = I(d), P = n[S] - W[S] + s[R], H = W[y] - Y, F = P / H, Z = Y / H, q = 0.1, z = 0.2, X = 0.8;
790
790
  let j = 0;
791
- const V = gt(u, d);
791
+ const V = pt(u, d);
792
792
  !V && F < z && F > -Z ? j = F / z - 1 : !V && F > X && F < 1 + Z && (j = 1 / (1 - X) * (F - X));
793
793
  const $ = q * Y * j;
794
794
  sn(d, v, $);
@@ -867,7 +867,7 @@ k(K, "configs", []), k(K, "removeObsoleteConfigs", () => {
867
867
  );
868
868
  K.configs = e;
869
869
  });
870
- let pt = K;
870
+ let lt = K;
871
871
  class En {
872
872
  constructor(e, n, s, o, r, c) {
873
873
  k(this, "initial");
@@ -878,7 +878,7 @@ class En {
878
878
  k(this, "dragEvent");
879
879
  k(this, "changeDroppable");
880
880
  k(this, "mapFrom");
881
- this.parent = s, this.draggableElement = e, this.groupClass = n, this.dragEvent = o, this.mapFrom = c, this.initial = s ? this.getConfigFrom(s) : void 0, this.changeDroppable = r;
881
+ this.parent = s, this.draggableElement = e, this.groupClass = n, this.dragEvent = o, this.mapFrom = c, this.initial = s ? lt.getConfig(s) : void 0, this.changeDroppable = r;
882
882
  }
883
883
  getDraggableAncestor(e, n, s) {
884
884
  return document.elementsFromPoint(e, n).filter((o) => !o.isSameNode(s));
@@ -898,18 +898,18 @@ class En {
898
898
  getCurrent(e, n, s = !0) {
899
899
  const o = this.getElementBelow(e, n, s);
900
900
  return !this.groupClass || !o ? void 0 : o.closest(
901
- dt(this.groupClass)
901
+ gt(this.groupClass)
902
902
  );
903
903
  }
904
904
  isOutsideOfAllDroppables(e) {
905
905
  return (this.groupClass ? Array.from(
906
- document.querySelectorAll(dt(this.groupClass))
906
+ document.querySelectorAll(gt(this.groupClass))
907
907
  ) : [this.parent]).every(
908
- (s) => gt(e, s)
908
+ (s) => pt(e, s)
909
909
  );
910
910
  }
911
911
  isNotInsideAnotherDroppable(e, n) {
912
- return !gt(e, n) || this.isOutsideOfAllDroppables(e);
912
+ return !pt(e, n) || this.isOutsideOfAllDroppables(e);
913
913
  }
914
914
  onScrollEvent() {
915
915
  this.dragEvent();
@@ -920,7 +920,7 @@ class En {
920
920
  });
921
921
  }
922
922
  getConfigFrom(e) {
923
- const n = pt.getConfig(e);
923
+ const n = lt.getConfig(e);
924
924
  if (n)
925
925
  return {
926
926
  ...n,
@@ -947,7 +947,7 @@ class En {
947
947
  return !this.getCurrent(s, e, n);
948
948
  }
949
949
  }
950
- function yn(t, e, n, s, o) {
950
+ function Cn(t, e, n, s, o) {
951
951
  const {
952
952
  handlerSelector: r,
953
953
  isDraggable: c,
@@ -959,8 +959,8 @@ function yn(t, e, n, s, o) {
959
959
  onRemoveAtEvent: B,
960
960
  droppableClass: O,
961
961
  onDragStart: N
962
- } = n, h = Ct(l).map((a) => `droppable-group-${a}`).join(" ");
963
- let S = 0, C = {
962
+ } = n, h = yt(l).map((a) => `droppable-group-${a}`).join(" ");
963
+ let S = 0, y = {
964
964
  scrollX: 0,
965
965
  scrollY: 0
966
966
  }, R = { pageX: 0, pageY: 0 }, I;
@@ -1028,14 +1028,14 @@ function yn(t, e, n, s, o) {
1028
1028
  Y(t, a, R, p.direction), P(
1029
1029
  t,
1030
1030
  Ft,
1031
- C,
1031
+ y,
1032
1032
  i.current
1033
1033
  );
1034
- }, lt = (a, p) => {
1034
+ }, ut = (a, p) => {
1035
1035
  p && S == 2 && !(a != null && a.droppable.isSameNode(p.droppable)) && P(
1036
1036
  t,
1037
1037
  Ft,
1038
- C,
1038
+ y,
1039
1039
  p
1040
1040
  );
1041
1041
  }, i = new En(
@@ -1043,13 +1043,13 @@ function yn(t, e, n, s, o) {
1043
1043
  h,
1044
1044
  s,
1045
1045
  ot,
1046
- lt,
1046
+ ut,
1047
1047
  n.mapFrom
1048
1048
  ), f = (a) => {
1049
1049
  if (!i.current)
1050
1050
  return;
1051
1051
  const p = h ? Array.from(
1052
- document.querySelectorAll(dt(h))
1052
+ document.querySelectorAll(gt(h))
1053
1053
  ) : [s];
1054
1054
  for (const E of p)
1055
1055
  E.classList.toggle(
@@ -1059,7 +1059,7 @@ function yn(t, e, n, s, o) {
1059
1059
  }, g = (a) => {
1060
1060
  i.updateConfig(a);
1061
1061
  const p = i.isOutside(a);
1062
- f(p), S === 1 ? ut(a) : S === 2 && (D(p), St(a));
1062
+ f(p), S === 1 ? ft(a) : S === 2 && (D(p), St(a));
1063
1063
  }, D = (a = !0) => {
1064
1064
  if (!i.current)
1065
1065
  return;
@@ -1076,7 +1076,7 @@ function yn(t, e, n, s, o) {
1076
1076
  S == 1,
1077
1077
  i.current
1078
1078
  );
1079
- }, y = (a) => {
1079
+ }, C = (a) => {
1080
1080
  if (Xt(a) && a.cancelable)
1081
1081
  a.preventDefault();
1082
1082
  else if (Xt(a))
@@ -1088,7 +1088,7 @@ function yn(t, e, n, s, o) {
1088
1088
  p();
1089
1089
  }, 200) : p();
1090
1090
  }, T = (a, p) => {
1091
- const { clientX: E, clientY: ft } = a, rt = document.elementFromPoint(E, ft), Dt = rt == null ? void 0 : rt.closest(`.${Q}`);
1091
+ const { clientX: E, clientY: dt } = a, rt = document.elementFromPoint(E, dt), Dt = rt == null ? void 0 : rt.closest(`.${Q}`);
1092
1092
  return rt && p && Dt && !p.isSameNode(Dt);
1093
1093
  }, A = (a) => {
1094
1094
  const p = n.onGetValue(e);
@@ -1096,13 +1096,13 @@ function yn(t, e, n, s, o) {
1096
1096
  }, M = (a, p) => (E) => {
1097
1097
  if (T(E, t))
1098
1098
  return;
1099
- pt.updateScrolls(s, h);
1100
- const { scrollX: ft, scrollY: rt } = window;
1101
- if (C = { scrollX: ft, scrollY: rt }, S === 0) {
1099
+ lt.updateScrolls(s, h);
1100
+ const { scrollX: dt, scrollY: rt } = window;
1101
+ if (y = { scrollX: dt, scrollY: rt }, S === 0) {
1102
1102
  S = 1;
1103
1103
  const Dt = A(t);
1104
1104
  Dt && N(Dt), b(a, () => {
1105
- a == "touchmove" && (i.updateConfig(E), f(i.isOutside(E)), ut(E)), document.addEventListener(a, y, {
1105
+ a == "touchmove" && (i.updateConfig(E), f(i.isOutside(E)), ft(E)), document.addEventListener(a, C, {
1106
1106
  passive: !1
1107
1107
  });
1108
1108
  }), ct(s), document.addEventListener(p, G(a), {
@@ -1112,10 +1112,10 @@ function yn(t, e, n, s, o) {
1112
1112
  }, x = (a) => i.updateConfig(a), G = (a) => (p) => {
1113
1113
  f(!0);
1114
1114
  const E = Vt(p);
1115
- clearTimeout(I), At(i.isOutside(E, !1)), document.removeEventListener(a, y), i.updateConfig(E);
1116
- const ft = i.getCurrentConfig(E);
1117
- if (ft) {
1118
- const { droppable: rt } = ft;
1115
+ clearTimeout(I), At(i.isOutside(E, !1)), document.removeEventListener(a, C), i.updateConfig(E);
1116
+ const dt = i.getCurrentConfig(E);
1117
+ if (dt) {
1118
+ const { droppable: rt } = dt;
1119
1119
  J(rt);
1120
1120
  }
1121
1121
  s.onscroll = null;
@@ -1123,11 +1123,11 @@ function yn(t, e, n, s, o) {
1123
1123
  if (a.onscroll = null, !h)
1124
1124
  return;
1125
1125
  const p = Array.from(
1126
- document.querySelectorAll(dt(h))
1126
+ document.querySelectorAll(gt(h))
1127
1127
  );
1128
1128
  for (const E of p)
1129
1129
  it(E) && (E.onscroll = null);
1130
- }, ut = (a) => {
1130
+ }, ft = (a) => {
1131
1131
  Gt(
1132
1132
  t,
1133
1133
  s,
@@ -1136,7 +1136,7 @@ function yn(t, e, n, s, o) {
1136
1136
  ), mt(), P(
1137
1137
  t,
1138
1138
  ue,
1139
- C,
1139
+ y,
1140
1140
  i.current
1141
1141
  ), wt(t), W(a, t);
1142
1142
  }, mt = () => {
@@ -1152,7 +1152,7 @@ function yn(t, e, n, s, o) {
1152
1152
  S = 3, xt(t), P(
1153
1153
  t,
1154
1154
  zt,
1155
- C,
1155
+ y,
1156
1156
  a ? i.initial : i.current,
1157
1157
  e
1158
1158
  );
@@ -1169,7 +1169,7 @@ function yn(t, e, n, s, o) {
1169
1169
  return;
1170
1170
  const p = i.initial;
1171
1171
  a == e && (nt(t, v), setTimeout(() => {
1172
- B(e), yt(t, v), Gt(
1172
+ B(e), Ct(t, v), Gt(
1173
1173
  t,
1174
1174
  s,
1175
1175
  S == 1,
@@ -1200,7 +1200,7 @@ function yn(t, e, n, s, o) {
1200
1200
  };
1201
1201
  return j(), $(t), [Bt, me];
1202
1202
  }
1203
- const Cn = (t, e) => {
1203
+ const yn = (t, e) => {
1204
1204
  t && Te(e, t);
1205
1205
  };
1206
1206
  function An(t, e, n, s = "index") {
@@ -1212,12 +1212,12 @@ function An(t, e, n, s = "index") {
1212
1212
  r,
1213
1213
  c
1214
1214
  ];
1215
- const u = Ct(l).map((d) => `droppable-group-${d}`).join(" ");
1216
- Cn(u, n);
1215
+ const u = yt(l).map((d) => `droppable-group-${d}`).join(" ");
1216
+ yn(u, n);
1217
1217
  for (const d of n.children) {
1218
- const m = d.getAttribute(o), v = ye(m), B = d;
1218
+ const m = d.getAttribute(o), v = Ce(m), B = d;
1219
1219
  if (B && v >= 0) {
1220
- const [O, N] = yn(
1220
+ const [O, N] = Cn(
1221
1221
  B,
1222
1222
  v,
1223
1223
  t,
@@ -1244,11 +1244,11 @@ function Bn(t, e, n, s = "index") {
1244
1244
  for (const R of r)
1245
1245
  R(h, S);
1246
1246
  }, d = (h) => {
1247
- const [S, C] = An(c, e, h, s);
1248
- o = S, r = C;
1247
+ const [S, y] = An(c, e, h, s);
1248
+ o = S, r = y;
1249
1249
  }, m = (h) => {
1250
- const S = h.addedNodes.values().filter((R) => !ee(R)).toArray(), C = h.removedNodes.values().filter((R) => !ee(R)).toArray();
1251
- return S.length > 0 || C.length > 0;
1250
+ const S = h.addedNodes.values().filter((R) => !ee(R)).toArray(), y = h.removedNodes.values().filter((R) => !ee(R)).toArray();
1251
+ return S.length > 0 || y.length > 0;
1252
1252
  }, v = (h) => {
1253
1253
  kt(
1254
1254
  () => {
@@ -1261,13 +1261,13 @@ function Bn(t, e, n, s = "index") {
1261
1261
  }, B = (h) => {
1262
1262
  nt(h, It);
1263
1263
  }, O = (h) => {
1264
- pt.addConfig(
1264
+ lt.addConfig(
1265
1265
  h,
1266
1266
  c
1267
1267
  );
1268
1268
  };
1269
1269
  return [l, u, (h) => {
1270
- h && (B(h), O(h), v(h), d(h), pt.removeObsoleteConfigs());
1270
+ h && (B(h), O(h), v(h), d(h), lt.removeObsoleteConfigs());
1271
1271
  }];
1272
1272
  }
1273
1273
  export {
@@ -1 +1 @@
1
- "use strict";var De=Object.defineProperty;var ve=(t,e,n)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var k=(t,e,n)=>ve(t,typeof e!="symbol"?e+"":e,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Yt="dragging-handler-class",Wt="dropping",se="grabbing",oe="grab",Zt="disable-transition",nt=(t,e)=>t.classList.contains(e),dt=(t,e,n=!1)=>{t.classList.toggle(e,n)},U=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},be=(t,e)=>yt(e).every(n=>nt(t,n)),gt=t=>t?`.${yt(t).join(".")}`:"",Te=(t,e)=>{if(!e)return;const n=yt(e);t.classList.add(...n)},yt=t=>t?t.split(" ").filter(e=>e):[],V="horizontal",tt="vertical",Ee=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},qt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Ce=t=>t?parseInt(t):-1,ye=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},re=(t,e)=>t.x1>e.x1?re(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,pt=(t,e)=>!Ae(t,e),Ae=(t,e)=>{const n=Mt(t),s=Mt(e),o=Jt(n,s,tt),r=Jt(n,s,V);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Jt=(t,e,n)=>{const{before:s,distance:o}=w(n);return re({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},L=(t,e)=>t?qt(getComputedStyle(t)[e]):0,Kt=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=t=>t.getBoundingClientRect(),w=t=>{const e=t==V;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",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",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Mt}},Rt=(t,e)=>xe(t,e),ie=t=>[...t.children].filter(n=>nt(n,Q)),xe=(t,e)=>{const n=[...e.children].filter(o=>nt(o,Q)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},we=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ce=(t,e)=>{const{before:n,borderBeforeWidth:s}=w(e),o=we(t);return o?Mt(o)[n]+L(o,s):0},Xt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,ae=t=>t instanceof MouseEvent,Be=["onmouseup","onmousedown","onmousemove"],Re=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Tt=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Le=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=_t(s);n(o)}},$t=(t,e,n)=>{n&&(Oe(e)?t[e]=n:Le(t,e,n))},Oe=t=>Be.includes(t),Me=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Fe=(t,e)=>{const n=(s,o)=>Pe(e,window,o,s);if(ae(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,V),n(s,tt)]}},_t=t=>{const e=Ne(t);if(!e)return Me(t);const[n,s]=Fe(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m,offsetX:n,offsetY:s}},Ne=t=>{if(Xt(t))return t.touches[0]??t.changedTouches[0];if(ae(t))return t},Pe=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:u}=w(n),d=u(s);return t[o]-e[r]-d[c]-L(s,l)},Nt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},le=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},$e=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Ge=(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},Ie=(t,e)=>{e.forEach(n=>{Ye(t,n)})},Ye=(t,e)=>{var s;var n=$e(t);n.sheet&&(Ge(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},ue=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&We(t,`--${n}`,s)}},We=(t,e,n)=>t&&t.style.setProperty(e,n),fe="startDrag",Ft="drag",zt="startDrop",Xe="drop",at="temp-child",de="cubic-bezier(0.2, 0, 0, 1)",_e=t=>t===Xe||t===zt,Vt=t=>!t||t.length==0?0:qt(t.replace("px","")),Ve=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=qt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Vt(n)},jt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ve(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},He=t=>{const{top:e,left:n}=getComputedStyle(t);return[Vt(e),Vt(n)]},qe=(t,e)=>{const{gap:n}=w(e),[s,o]=jt(t,n);return o?s:0};function Et(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=ze(n,t,o,r);return pt(t,s)&&e==Ft&&(c=0,l=0),{height:c,width:l}}const ze=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:u}=w(t),d=L(e,o),m=L(e,r),v=L(s,r),[B,O]=jt(e.parentElement,l),N=u(e)[c];if(O)return Qt(N,m,d,B,0,t);const[h,S,y]=je(n,v,d,m,o);return Qt(N,S,h,0,y,t)},je=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const u=L(t,o);c=Math.max(u,s),l=Math.max(l,u)}return[r,c,l]},Qt=(t,e,n,s,o,r)=>ke(r,t+e+n+s-o),ke=(t,e)=>t==V?{width:e,height:0}:{width:0,height:e},Ut=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=w(t),c=L(e,n),l=L(e,s),u=r(e)[o];return c+l+u},Ze=(t,e)=>{const[n,s]=He(e),o=Ut(tt,t);return[Ut(V,t)-s,o-n]};function Je(t,e,n,s,o,r,c,l,u){let d=0,m=0;const v=!!(n<0&&u);if(n===s&&!v)return te({height:d,width:m},t,o,c,v);const[B,O,N,h]=Ue(e,n,s,u);if(v){const[et,ot]=Ze(l,u);d+=ot,m+=et}const{scrollElement:S,beforeMargin:y,afterMargin:R,distance:I,gap:Y}=w(t),[W,P]=jt(l,Y),[st,H,F]=en(y,R,B,O==null?void 0:O.previousElementSibling,h,P,v),[Z,q,z]=tn(y,R,I,N,W,P),X=Qe(q,Z,z,H,st,W),j=v?l[S]:Ke(S,l,r),$=(h?X-F:F-X)-j;return t===tt?d+=$:t===V&&(m+=$),te({height:d,width:m},t,o,c,v)}const Ke=(t,e,n)=>{const s=e[t],o=n[t];return s-o},Qe=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},Ue=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,v)=>m-v),l=t[e]??s,u=t[n];let d=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(d=t.slice(r+1,c)),[l,u,d,o]},tn=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=L(s[0],t);let l=0,u=-c;for(const[d,m]of s.entries()){const v=m.getBoundingClientRect()[n],B=L(m,t);r&&(l+=B),r&&d>0?l+=o:l=Math.max(l,B),u+=l+v,l=L(m,e)}return[c,u,l]},te=(t,e,n,s,o)=>{const{scroll:r,distance:c}=w(e),l=window[r],u=n[r],d=o?0:u-2*l+s[r];return t[c]+=d,t},en=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return nn(t,e,l,n,r,c)},nn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=L(r?null:n,e),l=L(s,t);let u=Math.max(c,l);return[c,l,u]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},sn=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},on=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=w(t);return n[r]/(e[s]-e[o])},rn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",pe=50,ee=t=>it(t)?t.classList.contains(at):!1,cn=(t,e,n)=>{let s=Et(e,rn,n,t);const o=qe(t,n),{distance:r}=w(n);s[r]-=o;const[c,l]=an(n,e);return s[l]=c,s},an=(t,e)=>{const n=t==V?tt:V,{distance:s,getRect:o}=w(n);return[o(e)[s],s]},mt=(t,e,n)=>{Re(t,e,n),t.style.minWidth=`${n}px`},ln=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},un=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=on(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:u,scrollElement:d}=w(r);c&&(n[d]=n[l]-n[u])},he=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(un(n,e),o.querySelector(`.${at}`)||!t)return;var u=t.tagName=="LI"?"DIV":t.tagName,d=document.createElement(u);U(d,at),mt(d,0,0);const m=cn(o,t,c);return Nt(d,l,ge,"width, min-width, height"),[d,m,o]},Gt=(t,e,n,s,o)=>{const r=he(t,n,s);if(!r)return;const[c,l,u]=r;e.isSameNode(u)&&mt(c,l.height,l.width),kt(ln(c,u,l),u,{childList:!0,subtree:!0}),u.appendChild(c)},fn=(t,e,n)=>{const s=he(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),dn(o,r)},dn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Nt(t,0,ge,"width, min-width, height")})}),gn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${gt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var d;(d=c.parentNode)==null||d.removeChild(c)},s+pe)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+pe)):t.removeChild(o)})},pn=50;function hn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:u,onRemoveAtEvent:d,animationDuration:m,delayBeforeInsert:v,draggingClass:B}=t,O=(i,f,g,D,C)=>{if(!D)return;const{droppable:b,config:T}=D,A=Et(i,f,T.direction,b);_e(f)?P(i,f,A,g,D,C):y(i,f,A,D)},N=(i,f,g,D,C)=>{const b=Et(f,"insert",t.direction,g),{onInsertEvent:T}=t,A=ie(g);for(const[M,x]of A.entries())nt(x,Q)&&M>=i&&W(x,b);C(),setTimeout(()=>{T(i,D),bt(n,0,!0),me(i,g,t),et(f),_(f,n)},v)},h=(i,f,g,D)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:b}=g;let[T]=Rt(f,C);T=[f,...T].toReversed();const A=Et(f,"remove",b.direction,C);for(const[M,x]of T.entries())M>=i&&(Y(x,A),setTimeout(()=>{D(x)},m))},S=i=>{bt(n,m,!0),setTimeout(()=>{et(i),_(i,n)},m)},y=(i,f,g,D)=>{const{config:C,droppable:b}=D,[T]=Rt(i,b),A=pt(i,b);T.length==0&&I(g,1,C.direction,T);for(const[M,x]of T.entries()){if(!nt(x,Q))continue;const G=R(C.direction,i,x,g);if(!A&&G)g=G;else if(!A)continue;const J=T.length-M;I(g,J,C.direction,T),f===fe?Y(x,g):f===Ft&&W(x,g)}},R=(i,f,g,D)=>{const{before:C,distance:b,axis:T,getRect:A}=w(i),M=A(f),x=A(g),G=M[C],J=x[C],ut=x[b],St=J+ut/2,Dt=ye(g)[T],ct=St-Dt;return G>ct?{height:0,width:0}:D},I=(i,f,g,D)=>{const C=D.filter(T=>nt(T,Q)).length,{distance:b}=w(g);i[b]==0?c=Math.max(c,f):c=Math.min(c,f-1),c=Math.min(c,C)},Y=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g)},W=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g),Nt(i,m,de)},P=(i,f,g,D,C,b)=>{const{droppable:T,scroll:A,config:M}=C,[x,G]=Rt(i,T),J=x.toReversed(),ut=G===-1?J.length:G;J.splice(ut,0,i);const[St,Dt,ct]=st(i,G,J,T);g=Et(i,f,M.direction,n,St,Dt);const Pt=Ee(),At=Je(M.direction,J,G,ct,Pt,A,D,T,i);x.length==0&&H(void 0,g,i,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),f===zt&&!nt(wt,at)&&H(wt,Bt,i,At)}F(ct,i,M,T,b)},st=(i,f,g,D)=>{const b=pt(i,D)?f:c,T=()=>f<b?[b,b+1]:f>b?[b-1,b]:[b-1,b+1],[A,M]=T(),x=g[A]??null,G=g[M]??null;return[x,G,b]},H=(i,f,g,D)=>{Tt(i,f.height,f.width),Tt(g,D.height,D.width)},F=(i,f,g,D,C)=>{const{onInsertEvent:b,onDragEnd:T}=g;U(f,Wt),z(f,n,D,()=>{if(Ct(f,Wt),C!=null){const A=d(C);A!=null&&(b(i,A),T({value:A,index:i})),q(f),Z()}})},Z=()=>{if(s){var i=document.querySelectorAll(`${gt(s)} > .${Q}`);for(const f of i)$(f)}},q=i=>{setTimeout(()=>{Ct(i,B)},pn)},z=(i,f,g,D)=>{setTimeout(()=>{D&&D(),X(f,g),j(g),et(i),_(i,f),_(i,g)},m)},X=(i,f)=>{i.isSameNode(f)?bt(i,m):(bt(i,m,!0),bt(f,m))},j=i=>{if(n.isSameNode(i))return;var[f]=n.querySelectorAll(`.${at}`);if(!f)return;const{distance:g}=w(l);it(f)&&(f.style[g]="0px")},_=(i,f)=>{const[g]=Rt(i,f);for(const D of[...g,i])$(D)},$=i=>{it(i)&&(i.style.transition="",i.style.transform="")},et=i=>{r(),lt(i,!1),i.style.transform="",i.style.transition="",i.style.top="",i.style.left="",ue(i,{fixedHeight:"",fixedWidth:""})},ot=(i,f)=>{const g=f.querySelector(u);dt(document.body,se,i),dt(g||f,Yt,i)},lt=(i,f)=>{dt(i,Ht,f),ot(f,i),o.toggleGrabClass(!f)};return[O,h,N,S,lt]}const me=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ie(e)[t];U(l,s),U(l,Zt),setTimeout(()=>{Ct(l,Zt),Ct(l,s),r.disconnect()},o)},e,{childList:!0})},mn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),me(n,e,t)},r)},Sn=(t,e)=>{const n=l=>t.removeAtEvent(l),s=(l,u)=>t.insertEvent(l,u),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??tt,handlerSelector:(e==null?void 0:e.handlerSelector)??Q,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)??c}},Dn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:u=>{const{index:d,value:m}=u;r({index:d,value:e(m,s)})},onInsertEvent:(u,d)=>o(u,e(d,s))}},vn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=u=>{t.style.transform=`translate( ${u.x}px, ${u.y}px)`},r=u=>{t.style.top=`${u.top}px`,t.style.left=`${u.left}px`};return[(u,d,m,v)=>{const B=h=>{const{beforeMargin:S,borderBeforeWidth:y,before:R,offset:I,scroll:Y,page:W,inner:P,distance:st,axis:H,getRect:F}=w(h),Z=m[W],q=window[Y],z=window[P],X=F(u)[st],j=L(u,y),_=L(u,S),$=Z-e[I],et=ce(u,h);if($>=q-X/2&&$<=q+z){const lt=$-n[R]-j-_-q-et;return O(h),lt}return s[H]},O=h=>{if(u&&nt(u,Ht)&&h===v){const{before:S,distance:y,axis:R,getRect:I}=w(v),Y=I(u)[y],W=I(d),P=n[S]-W[S]+s[R],H=W[y]-Y,F=P/H,Z=Y/H,q=.1,z=.2,X=.8;let j=0;const _=pt(u,d);!_&&F<z&&F>-Z?j=F/z-1:!_&&F>X&&F<1+Z&&(j=1/(1-X)*(F-X));const $=q*Y*j;sn(d,v,$)}},N=h=>{const{axis:S}=w(h);s[S]=B(h),o(s)};N(V),N(tt)},(u,d)=>{const[m,v,B,O]=En(u,d,t);n={top:m,left:v},r(n),e={offsetX:B,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=w(t);return r(e)[o]-r(n)[o]-L(n,s)},bn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Tn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(V,c,r),s+=Lt(tt,c,r)),r&&e!=o&&(n+=Lt(V,r,e),s+=Lt(tt,r,e)),[n,s]},Tn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},ne=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:u}=w(t),d=ce(n,t);return e[c]-s[o]-L(n,r)-L(n,l)-window[u]-d},En=(t,e,n)=>{const[s,o]=bn(t,n);return[ne(tt,t,e,{offsetX:s,offsetY:o}),ne(V,t,e,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(e,n){const s=K.configs.filter(r=>!r.droppable.isSameNode(e)),o=Kt(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&be(o,n)||o.isSameNode(e))&&(s.scroll=Kt(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};k(K,"configs",[]),k(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let ht=K;class Cn{constructor(e,n,s,o,r,c){k(this,"initial");k(this,"current");k(this,"parent");k(this,"draggableElement");k(this,"groupClass");k(this,"dragEvent");k(this,"changeDroppable");k(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?this.getConfigFrom(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(gt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(gt(this.groupClass))):[this.parent]).every(s=>pt(e,s))}isNotInsideAnotherDroppable(e,n){return!pt(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){le(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=ht.getConfig(e);if(n)return{...n,config:Dn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(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,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function yn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:u,delayBeforeRemove:d,draggingClass:m,removingClass:v,onRemoveAtEvent:B,droppableClass:O,onDragStart:N}=n,h=yt(l).map(a=>`droppable-group-${a}`).join(" ");let S=0,y={scrollX:0,scrollY:0},R={pageX:0,pageY:0},I;const[Y,W]=vn(t),[P,st,H,F,Z]=hn(n,e,s,h,o,()=>S=0),q=()=>{U(t,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},X=()=>{if(c(t)){const a=t.querySelector(r);z(a||t)}},j=()=>{Ie(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${oe}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Yt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${se}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),X(),q()},_=a=>{const p=a==null?void 0:a.querySelector(`.${Ot}`),E=p==null?void 0:p.parentElement;return p&&E&&nt(E,It)&&!E.isSameNode(s)?null:p},$=a=>{const p=_(a)??a;p&&c(a)&&($t(p,"onmousedown",M("mousemove","mouseup")),$t(p,"ontouchstart",M("touchmove","touchend")),et(p)),a!=null&&a.isSameNode(p)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const p=a.querySelectorAll("img");Array.from(p).forEach(E=>{E.onmousedown=()=>!1})},ot=()=>{if(R.pageX==0&&R.pageY==0||!i.current)return;const{droppable:a,config:p}=i.current;Y(t,a,R,p.direction),P(t,Ft,y,i.current)},lt=(a,p)=>{p&&S==2&&!(a!=null&&a.droppable.isSameNode(p.droppable))&&P(t,Ft,y,p)},i=new Cn(t,h,s,ot,lt,n.mapFrom),f=a=>{if(!i.current)return;const p=h?Array.from(document.querySelectorAll(gt(h))):[s];for(const E of p)E.classList.toggle(O,!a&&E.isSameNode(i.current.droppable))},g=a=>{i.updateConfig(a);const p=i.isOutside(a);f(p),S===1?ut(a):S===2&&(D(p),Dt(a))},D=(a=!0)=>{if(!i.current)return;const{droppable:p}=i.current;gn(p,s,h,u,a),!a&&Gt(t,s,S==1,i.current)},C=a=>{if(Xt(a)&&a.cancelable)a.preventDefault();else if(Xt(a))return;const p=_t(a);g(p)},b=(a,p)=>{a=="touchmove"?I=setTimeout(()=>{p()},200):p()},T=(a,p)=>{const{clientX:E,clientY:ft}=a,rt=document.elementFromPoint(E,ft),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&p&&vt&&!p.isSameNode(vt)},A=a=>{const p=n.onGetValue(e);return{index:e,element:a,value:p}},M=(a,p)=>E=>{if(T(E,t))return;ht.updateScrolls(s,h);const{scrollX:ft,scrollY:rt}=window;if(y={scrollX:ft,scrollY:rt},S===0){S=1;const vt=A(t);vt&&N(vt),b(a,()=>{a=="touchmove"&&(i.updateConfig(E),f(i.isOutside(E)),ut(E)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(p,G(a),{once:!0})}},x=a=>i.updateConfig(a),G=a=>p=>{f(!0);const E=_t(p);clearTimeout(I),At(i.isOutside(E,!1)),document.removeEventListener(a,C),i.updateConfig(E);const ft=i.getCurrentConfig(E);if(ft){const{droppable:rt}=ft;J(rt)}s.onscroll=null},J=a=>{if(a.onscroll=null,!h)return;const p=Array.from(document.querySelectorAll(gt(h)));for(const E of p)it(E)&&(E.onscroll=null)},ut=a=>{Gt(t,s,S==1,i.current),St(),P(t,fe,y,i.current),wt(t),W(a,t)},St=()=>{S=2},Dt=a=>{const{pageX:p,pageY:E}=a;R={pageX:p,pageY:E},ot()},ct=a=>le(a,"onscroll",Pt),Pt=()=>ot(),At=a=>{if(S!==2){S=0;return}S=3,xt(t),P(t,zt,y,a?i.initial:i.current,e)},xt=a=>{Nt(a,u,de),Tt(a,0,0)},wt=a=>{const{height:p,width:E}=a.getBoundingClientRect();ue(a,{fixedHeight:`${p}px`,fixedWidth:`${E}px`}),Z(a,!0),dt(a,m,!0),a.style.transition=""},Bt=a=>{if(!i.initial)return;const p=i.initial;a==e&&(U(t,v),setTimeout(()=>{B(e),Ct(t,v),Gt(t,s,S==1,i.initial),st(a,t,p,E=>{xt(E),F(t)})},d))},Se=(a,p)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&H(a,t,s,p,()=>{fn(t,S==1,i.initial)})};return j(),$(t),[Bt,Se]}const An=(t,e)=>{t&&Te(e,t)};function xn(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const u=yt(l).map(d=>`droppable-group-${d}`).join(" ");An(u,n);for(const d of n.children){const m=d.getAttribute(o),v=Ce(m),B=d;if(B&&v>=0){const[O,N]=yn(B,v,t,n,e);r.push(O),c.push(N)}}return[r,c]}function wn(t,e,n,s="index"){let o=[],r=[];const c=Sn(t,n),l=h=>{for(const S of o)S(h)},u=(h,S)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,h,S);else for(const R of r)R(h,S)},d=h=>{const[S,y]=xn(c,e,h,s);o=S,r=y},m=h=>{const S=h.addedNodes.values().filter(R=>!ee(R)).toArray(),y=h.removedNodes.values().filter(R=>!ee(R)).toArray();return S.length>0||y.length>0},v=h=>{kt(()=>{d(h)},h,{childList:!0},m)},B=h=>{U(h,It)},O=h=>{ht.addConfig(h,c)};return[l,u,h=>{h&&(B(h),O(h),v(h),d(h),ht.removeObsoleteConfigs())}]}exports.GRAB_CLASS=oe;exports.addClass=U;exports.dragAndDrop=wn;exports.insertToListEmpty=mn;exports.toggleClass=dt;
1
+ "use strict";var De=Object.defineProperty;var ve=(t,e,n)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var k=(t,e,n)=>ve(t,typeof e!="symbol"?e+"":e,n);const Q="draggable",It="droppable",Ot="handler-class",Ht="dragging",Yt="dragging-handler-class",Wt="dropping",se="grabbing",oe="grab",Zt="disable-transition",nt=(t,e)=>t.classList.contains(e),gt=(t,e,n=!1)=>{t.classList.toggle(e,n)},U=(t,e)=>{t.classList.add(e)},Ct=(t,e)=>{t.classList.remove(e)},be=(t,e)=>yt(e).every(n=>nt(t,n)),pt=t=>t?`.${yt(t).join(".")}`:"",Te=(t,e)=>{if(!e)return;const n=yt(e);t.classList.add(...n)},yt=t=>t?t.split(" ").filter(e=>e):[],V="horizontal",tt="vertical",Ee=()=>{const{scrollX:t,scrollY:e}=window;return{scrollX:t,scrollY:e}},qt=t=>!t||t.trim().length==0||t=="normal"?0:parseFloat(t),Ce=t=>t?parseInt(t):-1,ye=t=>{const e=getComputedStyle(t),n=new DOMMatrixReadOnly(e.transform);return{x:n.m41,y:n.m42}},re=(t,e)=>t.x1>e.x1?re(e,t):t.x2<e.x1?0:t.x2>=e.x2?t.x2-t.x1:t.x2-e.x1,ht=(t,e)=>!Ae(t,e),Ae=(t,e)=>{const n=Mt(t),s=Mt(e),o=Jt(n,s,tt),r=Jt(n,s,V);return o>=Math.min(n.height,s.height)/2&&r>=Math.min(n.width,s.width)/2},Jt=(t,e,n)=>{const{before:s,distance:o}=w(n);return re({x1:t[s],x2:t[s]+t[o]},{x1:e[s],x2:e[s]+e[o]})},L=(t,e)=>t?qt(getComputedStyle(t)[e]):0,Kt=t=>{const{scrollLeft:e,scrollTop:n}=t;return{scrollLeft:e,scrollTop:n}},Mt=t=>t.getBoundingClientRect(),w=t=>{const e=t==V;return{beforeMargin:e?"marginLeft":"marginTop",afterMargin:e?"marginRight":"marginBottom",borderBeforeWidth:e?"borderLeftWidth":"borderTopWidth",before:e?"left":"top",after:e?"right":"down",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",offsetElement:e?"offsetLeft":"offsetTop",scrollDistance:e?"scrollWidth":"scrollHeight",clientDistance:e?"clientWidth":"clientHeight",paddingBefore:e?"paddingLeft":"paddingTop",getRect:Mt}},Rt=(t,e)=>xe(t,e),ie=t=>[...t.children].filter(n=>nt(n,Q)),xe=(t,e)=>{const n=[...e.children].filter(o=>nt(o,Q)&&!o.isEqualNode(t)).toReversed(),s=[...e.children].findLastIndex(o=>o.isEqualNode(t));return[n,s,e]},we=t=>{let e=t.parentElement;for(;e;){if(window.getComputedStyle(e).position==="fixed")return e;e=e.parentElement}return null},ce=(t,e)=>{const{before:n,borderBeforeWidth:s}=w(e),o=we(t);return o?Mt(o)[n]+L(o,s):0},Xt=t=>window.TouchEvent&&t instanceof TouchEvent,it=t=>t instanceof HTMLElement,ae=t=>t instanceof MouseEvent,Be=["onmouseup","onmousedown","onmousemove"],Re=(t,e,n)=>{t&&(t.style.height=`${e}px`,t.style.width=`${n}px`)},Tt=(t,e,n)=>{!t||!it(t)||(n==0&&e==0?t.style.transform="":t.style.transform=`translate(${n}px,${e}px)`)},Le=(t,e,n)=>{t[e]=s=>{if(s.defaultPrevented)return;const o=_t(s);n(o)}},$t=(t,e,n)=>{n&&(Oe(e)?t[e]=n:Le(t,e,n))},Oe=t=>Be.includes(t),Me=t=>{const{target:e}=t;return{clientX:0,clientY:0,pageX:0,pageY:0,screenX:0,screenY:0,target:e,offsetX:0,offsetY:0}},Fe=(t,e)=>{const n=(s,o)=>Pe(e,window,o,s);if(ae(t)){const{offsetX:s,offsetY:o}=t;return[s,o]}else{const s=t.target;return[n(s,V),n(s,tt)]}},_t=t=>{const e=Ne(t);if(!e)return Me(t);const[n,s]=Fe(t,e),{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m}=e;return{clientX:o,clientY:r,pageX:c,pageY:l,screenX:u,screenY:d,target:m,offsetX:n,offsetY:s}},Ne=t=>{if(Xt(t))return t.touches[0]??t.changedTouches[0];if(ae(t))return t},Pe=(t,e,n,s)=>{const{page:o,scroll:r,before:c,borderBeforeWidth:l,getRect:u}=w(n),d=u(s);return t[o]-e[r]-d[c]-L(s,l)},Nt=(t,e,n="ease-out",s="transform")=>{it(t)&&(t.style.transitionDuration=`${e}ms`,t.style.transitionTimingFunction=`${n}`,t.style.transitionProperty=`${s}`)},le=(t,e,n)=>{!t||!it(t)||(t[e]=()=>{n()})},$e=t=>{var e=t.querySelector("style");if(!e){var n=document.createElement("style");return t.appendChild(n),n}return e},Ge=(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},Ie=(t,e)=>{e.forEach(n=>{Ye(t,n)})},Ye=(t,e)=>{var s;var n=$e(t);n.sheet&&(Ge(n.sheet,e)||(s=n.sheet)==null||s.insertRule(e,n.sheet.cssRules.length))},ue=(t,e={})=>{for(const n of Object.keys(e)){const s=e[n];s!=null&&We(t,`--${n}`,s)}},We=(t,e,n)=>t&&t.style.setProperty(e,n),fe="startDrag",Ft="drag",zt="startDrop",Xe="drop",at="temp-child",de="cubic-bezier(0.2, 0, 0, 1)",_e=t=>t===Xe||t===zt,Vt=t=>!t||t.length==0?0:qt(t.replace("px","")),Ve=(t,e)=>{const n=getComputedStyle(t)[e];if(n.match("%")){const o=qt(n.replace("%","")),{width:r}=t.getBoundingClientRect();return r*(o/100)}return Vt(n)},jt=(t,e)=>{if(!(t instanceof Element))return[0,!1];const n=Ve(t,e),s=getComputedStyle(t).display,o=n>0||s==="flex";return[n,o]},He=t=>{const{top:e,left:n}=getComputedStyle(t);return[Vt(e),Vt(n)]},qe=(t,e)=>{const{gap:n}=w(e),[s,o]=jt(t,n);return o?s:0};function Et(t,e,n,s,o=t.previousElementSibling,r=t.nextElementSibling){let{height:c,width:l}=ze(n,t,o,r);return ht(t,s)&&e==Ft&&(c=0,l=0),{height:c,width:l}}const ze=(t,e,n,s)=>{const{afterMargin:o,beforeMargin:r,distance:c,gap:l,getRect:u}=w(t),d=L(e,o),m=L(e,r),v=L(s,r),[B,O]=jt(e.parentElement,l),N=u(e)[c];if(O)return Qt(N,m,d,B,0,t);const[h,S,y]=je(n,v,d,m,o);return Qt(N,S,h,0,y,t)},je=(t,e,n,s,o)=>{const r=Math.max(e,n);let c=s,l=e;if(t){const u=L(t,o);c=Math.max(u,s),l=Math.max(l,u)}return[r,c,l]},Qt=(t,e,n,s,o,r)=>ke(r,t+e+n+s-o),ke=(t,e)=>t==V?{width:e,height:0}:{width:0,height:e},Ut=(t,e)=>{const{borderBeforeWidth:n,paddingBefore:s,axis:o,getRect:r}=w(t),c=L(e,n),l=L(e,s),u=r(e)[o];return c+l+u},Ze=(t,e)=>{const[n,s]=He(e),o=Ut(tt,t);return[Ut(V,t)-s,o-n]};function Je(t,e,n,s,o,r,c,l,u){let d=0,m=0;const v=!!(n<0&&u);if(n===s&&!v)return te({height:d,width:m},t,o,c,v);const[B,O,N,h]=Ue(e,n,s,u);if(v){const[et,ot]=Ze(l,u);d+=ot,m+=et}const{scrollElement:S,beforeMargin:y,afterMargin:R,distance:I,gap:Y}=w(t),[W,P]=jt(l,Y),[st,H,F]=en(y,R,B,O==null?void 0:O.previousElementSibling,h,P,v),[Z,q,z]=tn(y,R,I,N,W,P),X=Qe(q,Z,z,H,st,W),j=v?l[S]:Ke(S,l,r),$=(h?X-F:F-X)-j;return t===tt?d+=$:t===V&&(m+=$),te({height:d,width:m},t,o,c,v)}const Ke=(t,e,n)=>{const s=e[t],o=n[t];return s-o},Qe=(t,e,n,s,o,r)=>{const c=Math.max(e,o);return Math.max(n,s)+t+c+r},Ue=(t,e,n,s)=>{const o=e<n,[r,c]=[e,n].toSorted((m,v)=>m-v),l=t[e]??s,u=t[n];let d=o?t.slice(r+1,c+1):t.slice(r,c);return r<0&&s&&(d=t.slice(r+1,c)),[l,u,d,o]},tn=(t,e,n,s,o,r)=>{if(s.length==0)return[0,0,0];const c=L(s[0],t);let l=0,u=-c;for(const[d,m]of s.entries()){const v=m.getBoundingClientRect()[n],B=L(m,t);r&&(l+=B),r&&d>0?l+=o:l=Math.max(l,B),u+=l+v,l=L(m,e)}return[c,u,l]},te=(t,e,n,s,o)=>{const{scroll:r,distance:c}=w(e),l=window[r],u=n[r],d=o?0:u-2*l+s[r];return t[c]+=d,t},en=(t,e,n,s,o,r,c)=>{const l=o?n.previousElementSibling:s;return nn(t,e,l,n,r,c)},nn=(t,e,n,s,o,r)=>{if(o)return[0,0,0];const c=L(r?null:n,e),l=L(s,t);let u=Math.max(c,l);return[c,l,u]},kt=(t,e,n,s=()=>!0)=>{const o=new MutationObserver(r=>{if(r=r.filter(s),r.length>0){const c=r[0];t(o,c)}});return o.observe(e,n),o},sn=(t,e,n)=>{n!=0&&(e==="vertical"?t.scrollBy(0,n):t.scrollBy(n,0))},on=(t,e,n)=>{const{scrollDistance:s,clientDistance:o,scrollElement:r}=w(t);return n[r]/(e[s]-e[o])},rn="startDrag",ge="cubic-bezier(0.2, 0, 0, 1)",pe=50,ee=t=>it(t)?t.classList.contains(at):!1,cn=(t,e,n)=>{let s=Et(e,rn,n,t);const o=qe(t,n),{distance:r}=w(n);s[r]-=o;const[c,l]=an(n,e);return s[l]=c,s},an=(t,e)=>{const n=t==V?tt:V,{distance:s,getRect:o}=w(n);return[o(e)[s],s]},mt=(t,e,n)=>{Re(t,e,n),t.style.minWidth=`${n}px`},ln=(t,e,n)=>s=>{e.contains(t)&&(mt(t,n.height,n.width),s.disconnect())},un=(t,e)=>{if(!e)return;const{droppable:n,config:s,scroll:o}=t,{direction:r}=s,c=on(s.direction,n,o)>.99,{scrollDistance:l,clientDistance:u,scrollElement:d}=w(r);c&&(n[d]=n[l]-n[u])},he=(t,e,n,s)=>{if(!n)return;const{droppable:o,config:r}=n,{direction:c,animationDuration:l}=r;if(un(n,e),o.querySelector(`.${at}`)||!t)return;var u=t.tagName=="LI"?"DIV":t.tagName,d=document.createElement(u);U(d,at),mt(d,0,0);const m=cn(o,t,c);return Nt(d,l,ge,"width, min-width, height"),[d,m,o]},Gt=(t,e,n,s,o)=>{const r=he(t,n,s);if(!r)return;const[c,l,u]=r;e.isSameNode(u)&&mt(c,l.height,l.width),kt(ln(c,u,l),u,{childList:!0,subtree:!0}),u.appendChild(c)},fn=(t,e,n)=>{const s=he(t,e,n);if(!s)return;const[o,r,c]=s;c.appendChild(o),dn(o,r)},dn=(t,e)=>requestAnimationFrame(()=>{mt(t,e.height,e.width),requestAnimationFrame(()=>{Nt(t,0,ge,"width, min-width, height")})}),gn=(t,e,n,s,o=!0)=>{if(n){var r=document.querySelectorAll(`${pt(n)} > .${at}`);r.forEach(c=>{const l=c.parentElement;if(l!=null&&l.isSameNode(e)||!o&&(l!=null&&l.isSameNode(t)))return;mt(c,0,0),setTimeout(()=>{var d;(d=c.parentNode)==null||d.removeChild(c)},s+pe)})}},bt=(t,e,n=!1)=>{var s=t.querySelectorAll(`.${at}`);s.forEach(o=>{const r=o;n?(mt(r,0,0),setTimeout(()=>{t.contains(r)&&t.removeChild(r)},e+pe)):t.removeChild(o)})},pn=50;function hn(t,e,n,s,o,r){let c=e;const{direction:l,handlerSelector:u,onRemoveAtEvent:d,animationDuration:m,delayBeforeInsert:v,draggingClass:B}=t,O=(i,f,g,D,C)=>{if(!D)return;const{droppable:b,config:T}=D,A=Et(i,f,T.direction,b);_e(f)?P(i,f,A,g,D,C):y(i,f,A,D)},N=(i,f,g,D,C)=>{const b=Et(f,"insert",t.direction,g),{onInsertEvent:T}=t,A=ie(g);for(const[M,x]of A.entries())nt(x,Q)&&M>=i&&W(x,b);C(),setTimeout(()=>{T(i,D),bt(n,0,!0),me(i,g,t),et(f),_(f,n)},v)},h=(i,f,g,D)=>{if(!g||!g.droppable||!g.config)return;const{droppable:C,config:b}=g;let[T]=Rt(f,C);T=[f,...T].toReversed();const A=Et(f,"remove",b.direction,C);for(const[M,x]of T.entries())M>=i&&(Y(x,A),setTimeout(()=>{D(x)},m))},S=i=>{bt(n,m,!0),setTimeout(()=>{et(i),_(i,n)},m)},y=(i,f,g,D)=>{const{config:C,droppable:b}=D,[T]=Rt(i,b),A=ht(i,b);T.length==0&&I(g,1,C.direction,T);for(const[M,x]of T.entries()){if(!nt(x,Q))continue;const G=R(C.direction,i,x,g);if(!A&&G)g=G;else if(!A)continue;const J=T.length-M;I(g,J,C.direction,T),f===fe?Y(x,g):f===Ft&&W(x,g)}},R=(i,f,g,D)=>{const{before:C,distance:b,axis:T,getRect:A}=w(i),M=A(f),x=A(g),G=M[C],J=x[C],ft=x[b],St=J+ft/2,Dt=ye(g)[T],ct=St-Dt;return G>ct?{height:0,width:0}:D},I=(i,f,g,D)=>{const C=D.filter(T=>nt(T,Q)).length,{distance:b}=w(g);i[b]==0?c=Math.max(c,f):c=Math.min(c,f-1),c=Math.min(c,C)},Y=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g)},W=(i,f)=>{const{width:g,height:D}=f;Tt(i,D,g),Nt(i,m,de)},P=(i,f,g,D,C,b)=>{const{droppable:T,scroll:A,config:M}=C,[x,G]=Rt(i,T),J=x.toReversed(),ft=G===-1?J.length:G;J.splice(ft,0,i);const[St,Dt,ct]=st(i,G,J,T);g=Et(i,f,M.direction,n,St,Dt);const Pt=Ee(),At=Je(M.direction,J,G,ct,Pt,A,D,T,i);x.length==0&&H(void 0,g,i,At);for(const[xt,wt]of x.toReversed().entries()){let Bt=g;ct-1>=xt&&(Bt={height:0,width:0}),f===zt&&!nt(wt,at)&&H(wt,Bt,i,At)}F(ct,i,M,T,b)},st=(i,f,g,D)=>{const b=ht(i,D)?f:c,T=()=>f<b?[b,b+1]:f>b?[b-1,b]:[b-1,b+1],[A,M]=T(),x=g[A]??null,G=g[M]??null;return[x,G,b]},H=(i,f,g,D)=>{Tt(i,f.height,f.width),Tt(g,D.height,D.width)},F=(i,f,g,D,C)=>{const{onInsertEvent:b,onDragEnd:T}=g;U(f,Wt),z(f,n,D,()=>{if(Ct(f,Wt),C!=null){const A=d(C);A!=null&&(b(i,A),T({value:A,index:i})),q(f),Z()}})},Z=()=>{if(s){var i=document.querySelectorAll(`${pt(s)} > .${Q}`);for(const f of i)$(f)}},q=i=>{setTimeout(()=>{Ct(i,B)},pn)},z=(i,f,g,D)=>{setTimeout(()=>{D&&D(),X(f,g),j(g),et(i),_(i,f),_(i,g)},m)},X=(i,f)=>{i.isSameNode(f)?bt(i,m):(bt(i,m,!0),bt(f,m))},j=i=>{if(n.isSameNode(i))return;var[f]=n.querySelectorAll(`.${at}`);if(!f)return;const{distance:g}=w(l);it(f)&&(f.style[g]="0px")},_=(i,f)=>{const[g]=Rt(i,f);for(const D of[...g,i])$(D)},$=i=>{it(i)&&(i.style.transition="",i.style.transform="")},et=i=>{r(),ut(i,!1),i.style.transform="",i.style.transition="",i.style.top="",i.style.left="",ue(i,{fixedHeight:"",fixedWidth:""})},ot=(i,f)=>{const g=f.querySelector(u);gt(document.body,se,i),gt(g||f,Yt,i)},ut=(i,f)=>{gt(i,Ht,f),ot(f,i),o.toggleGrabClass(!f)};return[O,h,N,S,ut]}const me=(t,e,n)=>{const{insertingFromClass:s,animationDuration:o}=n,r=kt(()=>{const l=ie(e)[t];U(l,s),U(l,Zt),setTimeout(()=>{Ct(l,Zt),Ct(l,s),r.disconnect()},o)},e,{childList:!0})},mn=(t,e,n,s)=>{if(!e)return;const{onInsertEvent:o,delayBeforeInsert:r}=t;setTimeout(()=>{o(n,s),me(n,e,t)},r)},Sn=(t,e)=>{const n=l=>t.removeAtEvent(l),s=(l,u)=>t.insertEvent(l,u),o=()=>t.getLength(),r=l=>t.getValue(l),c=l=>l;return{direction:(e==null?void 0:e.direction)??tt,handlerSelector:(e==null?void 0:e.handlerSelector)??Q,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)??c}},Dn=(t,e)=>{const{config:n,droppable:s}=t,{onInsertEvent:o,onDragEnd:r}=n;return{...n,onDragEnd:u=>{const{index:d,value:m}=u;r({index:d,value:e(m,s)})},onInsertEvent:(u,d)=>o(u,e(d,s))}},vn=t=>{let e={offsetX:0,offsetY:0},n={top:0,left:0},s={x:0,y:0};const o=u=>{t.style.transform=`translate( ${u.x}px, ${u.y}px)`},r=u=>{t.style.top=`${u.top}px`,t.style.left=`${u.left}px`};return[(u,d,m,v)=>{const B=h=>{const{beforeMargin:S,borderBeforeWidth:y,before:R,offset:I,scroll:Y,page:W,inner:P,distance:st,axis:H,getRect:F}=w(h),Z=m[W],q=window[Y],z=window[P],X=F(u)[st],j=L(u,y),_=L(u,S),$=Z-e[I],et=ce(u,h);if($>=q-X/2&&$<=q+z){const ut=$-n[R]-j-_-q-et;return O(h),ut}return s[H]},O=h=>{if(u&&nt(u,Ht)&&h===v){const{before:S,distance:y,axis:R,getRect:I}=w(v),Y=I(u)[y],W=I(d),P=n[S]-W[S]+s[R],H=W[y]-Y,F=P/H,Z=Y/H,q=.1,z=.2,X=.8;let j=0;const _=ht(u,d);!_&&F<z&&F>-Z?j=F/z-1:!_&&F>X&&F<1+Z&&(j=1/(1-X)*(F-X));const $=q*Y*j;sn(d,v,$)}},N=h=>{const{axis:S}=w(h);s[S]=B(h),o(s)};N(V),N(tt)},(u,d)=>{const[m,v,B,O]=En(u,d,t);n={top:m,left:v},r(n),e={offsetX:B,offsetY:O}}]},Lt=(t,e,n)=>{const{borderBeforeWidth:s,before:o,getRect:r}=w(t);return r(e)[o]-r(n)[o]-L(n,s)},bn=(t,e)=>{let{offsetX:n,offsetY:s,target:o}=t,r=Tn(o,e);const c=o;return c&&r&&!c.isSameNode(r)&&(n+=Lt(V,c,r),s+=Lt(tt,c,r)),r&&e!=o&&(n+=Lt(V,r,e),s+=Lt(tt,r,e)),[n,s]},Tn=(t,e)=>{const n=t==null?void 0:t.closest(`.${Ot}`);return n&&n.isSameNode(e)?t:n},ne=(t,e,n,s)=>{const{offset:o,beforeMargin:r,page:c,borderBeforeWidth:l,scroll:u}=w(t),d=ce(n,t);return e[c]-s[o]-L(n,r)-L(n,l)-window[u]-d},En=(t,e,n)=>{const[s,o]=bn(t,n);return[ne(tt,t,e,{offsetX:s,offsetY:o}),ne(V,t,e,{offsetX:s,offsetY:o}),s,o]},K=class K{static addConfig(e,n){const s=K.configs.filter(r=>!r.droppable.isSameNode(e)),o=Kt(e);s.push({droppable:e,config:n,scroll:o}),K.configs=s}static updateScrolls(e,n){for(const s of K.configs){const{droppable:o}=s;(n&&be(o,n)||o.isSameNode(e))&&(s.scroll=Kt(o))}}static getConfig(e){return K.configs.find(({droppable:s})=>s.isSameNode(e))}};k(K,"configs",[]),k(K,"removeObsoleteConfigs",()=>{const e=K.configs.filter(({droppable:n})=>document.contains(n));K.configs=e});let lt=K;class Cn{constructor(e,n,s,o,r,c){k(this,"initial");k(this,"current");k(this,"parent");k(this,"draggableElement");k(this,"groupClass");k(this,"dragEvent");k(this,"changeDroppable");k(this,"mapFrom");this.parent=s,this.draggableElement=e,this.groupClass=n,this.dragEvent=o,this.mapFrom=c,this.initial=s?lt.getConfig(s):void 0,this.changeDroppable=r}getDraggableAncestor(e,n,s){return document.elementsFromPoint(e,n).filter(o=>!o.isSameNode(s))}getElementBelow(e,n,s=!0){const o=c=>{const[l]=c.getDraggableAncestor(n.clientX,n.clientY,e);return l};let r=null;return s?(e.hidden=!0,r=o(this),e.hidden=!1):r=o(this),r}getCurrent(e,n,s=!0){const o=this.getElementBelow(e,n,s);return!this.groupClass||!o?void 0:o.closest(pt(this.groupClass))}isOutsideOfAllDroppables(e){return(this.groupClass?Array.from(document.querySelectorAll(pt(this.groupClass))):[this.parent]).every(s=>ht(e,s))}isNotInsideAnotherDroppable(e,n){return!ht(e,n)||this.isOutsideOfAllDroppables(e)}onScrollEvent(){this.dragEvent()}setOnScroll(e){le(e,"onscroll",()=>{this.onScrollEvent()})}getConfigFrom(e){const n=lt.getConfig(e);if(n)return{...n,config:Dn(n,this.mapFrom)}}getCurrentConfig(e){var o;const n=this.draggableElement;if(this.current&&this.isNotInsideAnotherDroppable(n,(o=this.current)==null?void 0:o.droppable))return this.current;const s=this.getCurrent(n,e);return s?(it(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,n=!0){const s=this.draggableElement;return!this.getCurrent(s,e,n)}}function yn(t,e,n,s,o){const{handlerSelector:r,isDraggable:c,droppableGroup:l,animationDuration:u,delayBeforeRemove:d,draggingClass:m,removingClass:v,onRemoveAtEvent:B,droppableClass:O,onDragStart:N}=n,h=yt(l).map(a=>`droppable-group-${a}`).join(" ");let S=0,y={scrollX:0,scrollY:0},R={pageX:0,pageY:0},I;const[Y,W]=vn(t),[P,st,H,F,Z]=hn(n,e,s,h,o,()=>S=0),q=()=>{U(t,Q)},z=a=>{U(a,Ot),o.addSubscriber(a)},X=()=>{if(c(t)){const a=t.querySelector(r);z(a||t)}},j=()=>{Ie(document.body,[`.${Q}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,`.${Ot}{pointer-events:auto!important;}`,`.${oe}{cursor:grab;}`,".temp-child{touch-action:none;pointer-events:none;box-sizing:border-box!important;}",".droppable{box-sizing:border-box!important;}",`.${Ht}{position:fixed;z-index:5000;width:var(--fixedWidth)!important;height:var(--fixedHeight)!important;}`,`.${Yt}{pointer-events:none!important;}`,`.${Wt}{pointer-events:none!important;}`,`.${se}{cursor:grabbing;}`,".disable-transition{transition:none!important;}"]),X(),q()},_=a=>{const p=a==null?void 0:a.querySelector(`.${Ot}`),E=p==null?void 0:p.parentElement;return p&&E&&nt(E,It)&&!E.isSameNode(s)?null:p},$=a=>{const p=_(a)??a;p&&c(a)&&($t(p,"onmousedown",M("mousemove","mouseup")),$t(p,"ontouchstart",M("touchmove","touchend")),et(p)),a!=null&&a.isSameNode(p)||$t(a,"onmousedown",x),U(s,It)},et=a=>{const p=a.querySelectorAll("img");Array.from(p).forEach(E=>{E.onmousedown=()=>!1})},ot=()=>{if(R.pageX==0&&R.pageY==0||!i.current)return;const{droppable:a,config:p}=i.current;Y(t,a,R,p.direction),P(t,Ft,y,i.current)},ut=(a,p)=>{p&&S==2&&!(a!=null&&a.droppable.isSameNode(p.droppable))&&P(t,Ft,y,p)},i=new Cn(t,h,s,ot,ut,n.mapFrom),f=a=>{if(!i.current)return;const p=h?Array.from(document.querySelectorAll(pt(h))):[s];for(const E of p)E.classList.toggle(O,!a&&E.isSameNode(i.current.droppable))},g=a=>{i.updateConfig(a);const p=i.isOutside(a);f(p),S===1?ft(a):S===2&&(D(p),Dt(a))},D=(a=!0)=>{if(!i.current)return;const{droppable:p}=i.current;gn(p,s,h,u,a),!a&&Gt(t,s,S==1,i.current)},C=a=>{if(Xt(a)&&a.cancelable)a.preventDefault();else if(Xt(a))return;const p=_t(a);g(p)},b=(a,p)=>{a=="touchmove"?I=setTimeout(()=>{p()},200):p()},T=(a,p)=>{const{clientX:E,clientY:dt}=a,rt=document.elementFromPoint(E,dt),vt=rt==null?void 0:rt.closest(`.${Q}`);return rt&&p&&vt&&!p.isSameNode(vt)},A=a=>{const p=n.onGetValue(e);return{index:e,element:a,value:p}},M=(a,p)=>E=>{if(T(E,t))return;lt.updateScrolls(s,h);const{scrollX:dt,scrollY:rt}=window;if(y={scrollX:dt,scrollY:rt},S===0){S=1;const vt=A(t);vt&&N(vt),b(a,()=>{a=="touchmove"&&(i.updateConfig(E),f(i.isOutside(E)),ft(E)),document.addEventListener(a,C,{passive:!1})}),ct(s),document.addEventListener(p,G(a),{once:!0})}},x=a=>i.updateConfig(a),G=a=>p=>{f(!0);const E=_t(p);clearTimeout(I),At(i.isOutside(E,!1)),document.removeEventListener(a,C),i.updateConfig(E);const dt=i.getCurrentConfig(E);if(dt){const{droppable:rt}=dt;J(rt)}s.onscroll=null},J=a=>{if(a.onscroll=null,!h)return;const p=Array.from(document.querySelectorAll(pt(h)));for(const E of p)it(E)&&(E.onscroll=null)},ft=a=>{Gt(t,s,S==1,i.current),St(),P(t,fe,y,i.current),wt(t),W(a,t)},St=()=>{S=2},Dt=a=>{const{pageX:p,pageY:E}=a;R={pageX:p,pageY:E},ot()},ct=a=>le(a,"onscroll",Pt),Pt=()=>ot(),At=a=>{if(S!==2){S=0;return}S=3,xt(t),P(t,zt,y,a?i.initial:i.current,e)},xt=a=>{Nt(a,u,de),Tt(a,0,0)},wt=a=>{const{height:p,width:E}=a.getBoundingClientRect();ue(a,{fixedHeight:`${p}px`,fixedWidth:`${E}px`}),Z(a,!0),gt(a,m,!0),a.style.transition=""},Bt=a=>{if(!i.initial)return;const p=i.initial;a==e&&(U(t,v),setTimeout(()=>{B(e),Ct(t,v),Gt(t,s,S==1,i.initial),st(a,t,p,E=>{xt(E),F(t)})},d))},Se=(a,p)=>{(a===e||a===n.onGetLegth()&&e===a-1)&&H(a,t,s,p,()=>{fn(t,S==1,i.initial)})};return j(),$(t),[Bt,Se]}const An=(t,e)=>{t&&Te(e,t)};function xn(t,e,n,s="index"){const o=s;let r=[],c=[];const{droppableGroup:l}=t;if(!n)return[r,c];const u=yt(l).map(d=>`droppable-group-${d}`).join(" ");An(u,n);for(const d of n.children){const m=d.getAttribute(o),v=Ce(m),B=d;if(B&&v>=0){const[O,N]=yn(B,v,t,n,e);r.push(O),c.push(N)}}return[r,c]}function wn(t,e,n,s="index"){let o=[],r=[];const c=Sn(t,n),l=h=>{for(const S of o)S(h)},u=(h,S)=>{if(c.onGetLegth()===0)t.insertToListEmpty(c,h,S);else for(const R of r)R(h,S)},d=h=>{const[S,y]=xn(c,e,h,s);o=S,r=y},m=h=>{const S=h.addedNodes.values().filter(R=>!ee(R)).toArray(),y=h.removedNodes.values().filter(R=>!ee(R)).toArray();return S.length>0||y.length>0},v=h=>{kt(()=>{d(h)},h,{childList:!0},m)},B=h=>{U(h,It)},O=h=>{lt.addConfig(h,c)};return[l,u,h=>{h&&(B(h),O(h),v(h),d(h),lt.removeObsoleteConfigs())}]}exports.GRAB_CLASS=oe;exports.addClass=U;exports.dragAndDrop=wn;exports.insertToListEmpty=mn;exports.toggleClass=gt;
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-CaFG_170.cjs"),o=require("../index-BUdB26zt.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
1
+ "use strict";var u=Object.defineProperty;var d=(n,t,e)=>t in n?u(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../HandlerPublisher-B4UrbCPW.cjs"),o=require("../index-BqVW-8HC.cjs");class g{constructor(t){s(this,"items");s(this,"parent");this.items=t}setParent(t){this.parent=t}removeAtEvent(t){const e=this.items;if(e.length<=0)return;const[r]=e.splice(t,1);return r}insertEvent(t,e){this.items.splice(t,0,e)}getLength(){return this.items.length}getValue(t){return this.items[t]}insertToListEmpty(t,e,r){o.insertToListEmpty(t,this.parent,e,r)}}const h=new c.HandlerPublisher;function m(n,t){const e=new g(n),[r,l,a]=o.dragAndDrop(e,h,t,"data-index");return[i=>(e.setParent(i),a(i),{destroy(){}}),l,r]}exports.useDragAndDrop=m;
@@ -1,8 +1,8 @@
1
1
  var l = Object.defineProperty;
2
2
  var d = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => d(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { H as c } from "../HandlerPublisher-CdjuhrMS.js";
5
- import { i as m, d as u } from "../index-Cj5Hg1w9.js";
4
+ import { H as c } from "../HandlerPublisher-CCy7USuZ.js";
5
+ import { i as m, d as u } from "../index-ANSOhcfo.js";
6
6
  class h {
7
7
  constructor(t) {
8
8
  r(this, "items");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-CaFG_170.cjs"),u=require("../index-BUdB26zt.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
1
+ "use strict";var c=Object.defineProperty;var h=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("../HandlerPublisher-B4UrbCPW.cjs"),u=require("../index-BqVW-8HC.cjs"),v=(n,e)=>{const t=n.value;if(t.length<=0)return;const[r]=t.splice(e,1);return r},d=(n,e,t)=>{n.value.splice(e,0,t)},m=n=>n.value.length,p=(n,e)=>n.value[e];class V{constructor(e,t){s(this,"items");s(this,"parent");this.items=e,this.parent=t}removeAtEvent(e){return v(this.items,e)}insertEvent(e,t){return d(this.items,e,t)}getLength(){return m(this.items)}getValue(e){return p(this.items,e)}insertToListEmpty(e,t,r){u.insertToListEmpty(e,this.parent.value,t,r)}}const A=new g.HandlerPublisher;function L(n,e){const t=i.ref();var r=new V(n,t);const[l,o,a]=u.dragAndDrop(r,A,e);return i.watch(t,()=>{a(t.value)}),[t,o,l]}exports.useDragAndDrop=L;
@@ -2,8 +2,8 @@ var l = Object.defineProperty;
2
2
  var u = (n, t, e) => t in n ? l(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var r = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { ref as c, watch as m } from "vue";
5
- import { H as h } from "../HandlerPublisher-CdjuhrMS.js";
6
- import { i as p, d as v } from "../index-Cj5Hg1w9.js";
5
+ import { H as h } from "../HandlerPublisher-CCy7USuZ.js";
6
+ import { i as p, d as v } from "../index-ANSOhcfo.js";
7
7
  const g = (n, t) => {
8
8
  const e = n.value;
9
9
  if (e.length <= 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-dnd",
3
- "version": "1.1.0-beta.0",
3
+ "version": "1.1.1-beta.0",
4
4
  "description": "An agnostic drag and drop library to sort all kind of lists. With current support for vue 3 and svelte",
5
5
  "type": "module",
6
6
  "homepage": "https://fluid-dnd.netlify.app",