likec4 1.42.0 → 1.43.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.
@@ -793,9 +793,9 @@ function useClickOutside(callback, events, nodes) {
793
793
  const listener = (event) => {
794
794
  const { target } = event ?? {};
795
795
  if (Array.isArray(nodes)) {
796
- const shouldIgnore = !document.body.contains(target) && target.tagName !== "HTML";
797
- nodes.every((node2) => !!node2 && !event.composedPath().includes(node2)) && !shouldIgnore && callback();
798
- } else ref.current && !ref.current.contains(target) && callback();
796
+ const shouldIgnore = !document.body.contains(target) && target?.tagName !== "HTML";
797
+ nodes.every((node2) => !!node2 && !event.composedPath().includes(node2)) && !shouldIgnore && callback(event);
798
+ } else ref.current && !ref.current.contains(target) && callback(event);
799
799
  };
800
800
  return eventsList.forEach((fn) => document.addEventListener(fn, listener)), () => {
801
801
  eventsList.forEach((fn) => document.removeEventListener(fn, listener));
@@ -1059,8 +1059,8 @@ function createStorage(type2, hookName) {
1059
1059
  },
1060
1060
  [key2]
1061
1061
  ), removeStorageValue = useCallback(() => {
1062
- removeItem2(key2), window.dispatchEvent(new CustomEvent(eventName, { detail: { key: key2, value: defaultValue } }));
1063
- }, []);
1062
+ removeItem2(key2), setValue(defaultValue), window.dispatchEvent(new CustomEvent(eventName, { detail: { key: key2, value: defaultValue } }));
1063
+ }, [key2, defaultValue]);
1064
1064
  return useWindowEvent("storage", (event) => {
1065
1065
  sync && event.storageArea === window[type2] && event.key === key2 && setValue(deserialize2(event.newValue ?? void 0));
1066
1066
  }), useWindowEvent(eventName, (event) => {
@@ -6866,7 +6866,6 @@ function getTransitionStyles({
6866
6866
  }) {
6867
6867
  const shared = {
6868
6868
  WebkitBackfaceVisibility: "hidden",
6869
- willChange: "transform, opacity",
6870
6869
  transitionDuration: `${duration2}ms`,
6871
6870
  transitionTimingFunction: timingFunction
6872
6871
  };
@@ -7326,8 +7325,8 @@ function Popover(_props) {
7326
7325
  },
7327
7326
  [popover.floating.refs.setFloating]
7328
7327
  ), onExited = useCallback(() => {
7329
- transitionProps?.onExited?.(), onExitTransitionEnd?.(), setDropdownVisible(!1), positionRef.current = position2;
7330
- }, [transitionProps?.onExited, onExitTransitionEnd]), onEntered = useCallback(() => {
7328
+ transitionProps?.onExited?.(), onExitTransitionEnd?.(), setDropdownVisible(!1), preventPositionChangeWhenVisible || (positionRef.current = position2);
7329
+ }, [transitionProps?.onExited, onExitTransitionEnd, preventPositionChangeWhenVisible, position2]), onEntered = useCallback(() => {
7331
7330
  transitionProps?.onEntered?.(), onEnterTransitionEnd?.();
7332
7331
  }, [transitionProps?.onEntered, onEnterTransitionEnd]);
7333
7332
  return /* @__PURE__ */ jsxs(
@@ -8119,7 +8118,7 @@ function InputClearSection({
8119
8118
  rightSection || __defaultRightSection
8120
8119
  ]
8121
8120
  }
8122
- ) : rightSection || clearSection || __defaultRightSection;
8121
+ ) : rightSection === null ? null : rightSection || clearSection || __defaultRightSection;
8123
8122
  }
8124
8123
  const [InputWrapperProvider, useInputWrapperContext] = createOptionalContext({
8125
8124
  offsetBottom: !1,
@@ -8962,8 +8961,8 @@ const varsResolver$w = (theme, { radius, color: color2, variant, autoContrast })
8962
8961
  ref,
8963
8962
  ...others,
8964
8963
  role: "alert",
8965
- "aria-describedby": bodyId,
8966
- "aria-labelledby": titleId,
8964
+ "aria-describedby": children2 ? bodyId : void 0,
8965
+ "aria-labelledby": title ? titleId : void 0,
8967
8966
  children: /* @__PURE__ */ jsxs("div", { ...getStyles2("wrapper"), children: [
8968
8967
  icon && /* @__PURE__ */ jsx("div", { ...getStyles2("icon"), children: icon }),
8969
8968
  /* @__PURE__ */ jsxs("div", { ...getStyles2("body"), children: [
@@ -11526,7 +11525,7 @@ function MenuSub(_props) {
11526
11525
  }, 16),
11527
11526
  parentContext: ctx
11528
11527
  },
11529
- children: /* @__PURE__ */ jsx(Popover, { opened, ...others, withinPortal: !1, withArrow: !1, id: id2, children: children2 })
11528
+ children: /* @__PURE__ */ jsx(Popover, { opened, withinPortal: !1, withArrow: !1, id: id2, ...others, children: children2 })
11530
11529
  }
11531
11530
  );
11532
11531
  }
@@ -11953,6 +11952,8 @@ const varsResolver$a = (theme, { variant, color: color2, childrenOffset, autoCon
11953
11952
  autoContrast,
11954
11953
  mod,
11955
11954
  attributes,
11955
+ onClick,
11956
+ onKeyDown,
11956
11957
  ...others
11957
11958
  } = props2, getStyles2 = useStyles({
11958
11959
  name: "NavLink",
@@ -11972,7 +11973,7 @@ const varsResolver$a = (theme, { variant, color: color2, childrenOffset, autoCon
11972
11973
  finalValue: !1,
11973
11974
  onChange
11974
11975
  }), withChildren = !!children2, handleClick = (event) => {
11975
- others.onClick?.(event), withChildren && (event.preventDefault(), setOpened(!_opened));
11976
+ onClick?.(event), withChildren && (event.preventDefault(), setOpened(!_opened));
11976
11977
  };
11977
11978
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
11978
11979
  /* @__PURE__ */ jsxs(
@@ -11983,7 +11984,7 @@ const varsResolver$a = (theme, { variant, color: color2, childrenOffset, autoCon
11983
11984
  ref,
11984
11985
  onClick: handleClick,
11985
11986
  onKeyDown: (event) => {
11986
- others.onKeyDown?.(event), event.nativeEvent.code === "Space" && withChildren && (event.preventDefault(), setOpened(!_opened));
11987
+ onKeyDown?.(event), event.nativeEvent.code === "Space" && withChildren && (event.preventDefault(), setOpened(!_opened));
11987
11988
  },
11988
11989
  unstyled,
11989
11990
  mod: [{ disabled, active, expanded: _opened }, mod],
@@ -13545,7 +13546,6 @@ const TabsTab = factory((_props, ref) => {
13545
13546
  return /* @__PURE__ */ jsxs(
13546
13547
  UnstyledButton,
13547
13548
  {
13548
- ...others,
13549
13549
  ...ctx.getStyles("tab", { className, style: style2, variant: ctx.variant, ...stylesApiProps }),
13550
13550
  disabled,
13551
13551
  unstyled: ctx.unstyled,
@@ -13577,6 +13577,7 @@ const TabsTab = factory((_props, ref) => {
13577
13577
  dir,
13578
13578
  onKeyDown
13579
13579
  }),
13580
+ ...others,
13580
13581
  children: [
13581
13582
  leftSection && /* @__PURE__ */ jsx("span", { ...ctx.getStyles("tabSection", stylesApiProps), "data-position": "left", children: leftSection }),
13582
13583
  children2 && /* @__PURE__ */ jsx("span", { ...ctx.getStyles("tabLabel", stylesApiProps), children: children2 }),
@@ -17461,43 +17462,43 @@ function e$i(e2, t2, n2) {
17461
17462
  let r2 = (n3) => e2(n3, ...t2);
17462
17463
  return n2 === void 0 ? r2 : Object.assign(r2, { lazy: n2, lazyArgs: t2 });
17463
17464
  }
17464
- function t$z(t2, n2, r2) {
17465
+ function t$A(t2, n2, r2) {
17465
17466
  let i2 = t2.length - n2.length;
17466
17467
  if (i2 === 0) return t2(...n2);
17467
17468
  if (i2 === 1) return e$i(t2, n2, r2);
17468
17469
  throw Error("Wrong number of arguments");
17469
17470
  }
17470
- function t$y(...t2) {
17471
- return t$z(n$w, t2);
17471
+ function t$z(...t2) {
17472
+ return t$A(n$x, t2);
17472
17473
  }
17473
- const n$w = (e2, t2) => t2.every((t3) => t3(e2));
17474
- function t$x(...t2) {
17475
- return t$z(n$v, t2);
17474
+ const n$x = (e2, t2) => t2.every((t3) => t3(e2));
17475
+ function t$y(...t2) {
17476
+ return t$A(n$w, t2);
17476
17477
  }
17477
- const n$v = (e2, t2) => t2.some((t3) => t3(e2)), e$h = (e2) => (n2, r2) => {
17478
+ const n$w = (e2, t2) => t2.some((t3) => t3(e2)), e$h = (e2) => (n2, r2) => {
17478
17479
  if (r2 === 0) return e2(n2);
17479
17480
  if (!Number.isInteger(r2)) throw TypeError(`precision must be an integer: ${r2.toString()}`);
17480
17481
  if (r2 > 15 || r2 < -15) throw RangeError("precision must be between -15 and 15");
17481
17482
  if (Number.isNaN(n2) || !Number.isFinite(n2)) return e2(n2);
17482
- let i2 = t$w(n2, r2), a2 = e2(i2);
17483
- return t$w(a2, -r2);
17483
+ let i2 = t$x(n2, r2), a2 = e2(i2);
17484
+ return t$x(a2, -r2);
17484
17485
  };
17485
- function t$w(e2, t2) {
17486
+ function t$x(e2, t2) {
17486
17487
  let [n2, r2] = e2.toString().split("e"), i2 = (r2 === void 0 ? 0 : Number.parseInt(r2, 10)) + t2, a2 = `${n2}e${i2.toString()}`;
17487
17488
  return Number.parseFloat(a2);
17488
17489
  }
17489
- function n$u(...n2) {
17490
- return t$z(e$h(Math.ceil), n2);
17490
+ function n$v(...n2) {
17491
+ return t$A(e$h(Math.ceil), n2);
17491
17492
  }
17492
- function t$v(...t2) {
17493
- return t$z(n$t, t2);
17493
+ function t$w(...t2) {
17494
+ return t$A(n$u, t2);
17494
17495
  }
17495
- const n$t = (e2, { min: t2, max: n2 }) => t2 !== void 0 && e2 < t2 ? t2 : n2 !== void 0 && e2 > n2 ? n2 : e2;
17496
- function t$u(...t2) {
17497
- return t$z(n$s, t2);
17496
+ const n$u = (e2, { min: t2, max: n2 }) => t2 !== void 0 && e2 < t2 ? t2 : n2 !== void 0 && e2 > n2 ? n2 : e2;
17497
+ function t$v(...t2) {
17498
+ return t$A(n$t, t2);
17498
17499
  }
17499
- const n$s = (e2, t2) => [...e2, ...t2], t$t = { done: !1, hasNext: !1 };
17500
- function t$s(e2, ...t2) {
17500
+ const n$t = (e2, t2) => [...e2, ...t2], t$u = { done: !1, hasNext: !1 };
17501
+ function t$t(e2, ...t2) {
17501
17502
  let a2 = e2, o = t2.map((e3) => "lazy" in e3 ? r$b(e3) : void 0), s2 = 0;
17502
17503
  for (; s2 < t2.length; ) {
17503
17504
  if (o[s2] === void 0 || !i$5(a2)) {
@@ -17511,20 +17512,20 @@ function t$s(e2, ...t2) {
17511
17512
  if (t3 === void 0 || (e3.push(t3), t3.isSingle)) break;
17512
17513
  }
17513
17514
  let r2 = [];
17514
- for (let t3 of a2) if (n$r(t3, r2, e3)) break;
17515
+ for (let t3 of a2) if (n$s(t3, r2, e3)) break;
17515
17516
  let { isSingle: c } = e3.at(-1);
17516
17517
  a2 = c ? r2[0] : r2, s2 += e3.length;
17517
17518
  }
17518
17519
  return a2;
17519
17520
  }
17520
- function n$r(t2, r2, i2) {
17521
+ function n$s(t2, r2, i2) {
17521
17522
  if (i2.length === 0) return r2.push(t2), !1;
17522
- let a2 = t2, o = t$t, s2 = !1;
17523
+ let a2 = t2, o = t$u, s2 = !1;
17523
17524
  for (let [e2, t3] of i2.entries()) {
17524
17525
  let { index: c, items: l } = t3;
17525
17526
  if (l.push(a2), o = t3(a2, c, l), t3.index += 1, o.hasNext) {
17526
17527
  if (o.hasMany ?? !1) {
17527
- for (let t4 of o.next) if (n$r(t4, r2, i2.slice(e2 + 1))) return !0;
17528
+ for (let t4 of o.next) if (n$s(t4, r2, i2.slice(e2 + 1))) return !0;
17528
17529
  return s2;
17529
17530
  }
17530
17531
  a2 = o.next;
@@ -17541,23 +17542,23 @@ function r$b(e2) {
17541
17542
  function i$5(e2) {
17542
17543
  return typeof e2 == "string" || typeof e2 == "object" && !!e2 && Symbol.iterator in e2;
17543
17544
  }
17544
- function t$r(t2, n2) {
17545
+ function t$s(t2, n2) {
17545
17546
  let r2 = n2.length - t2.length;
17546
17547
  if (r2 === 1) {
17547
17548
  let [r3, ...i2] = n2;
17548
- return t$s(r3, { lazy: t2, lazyArgs: i2 });
17549
+ return t$t(r3, { lazy: t2, lazyArgs: i2 });
17549
17550
  }
17550
17551
  if (r2 === 0) {
17551
17552
  let r3 = { lazy: t2, lazyArgs: n2 };
17552
- return Object.assign((t3) => t$s(t3, r3), r3);
17553
+ return Object.assign((t3) => t$t(t3, r3), r3);
17553
17554
  }
17554
17555
  throw Error("Wrong number of arguments");
17555
17556
  }
17556
- function t$q(...t2) {
17557
- return t$z(n$q, t2);
17557
+ function t$r(...t2) {
17558
+ return t$A(n$r, t2);
17558
17559
  }
17559
- const n$q = (e2, t2) => e2.length >= t2, e$g = { asc: (e2, t2) => e2 > t2, desc: (e2, t2) => e2 < t2 };
17560
- function t$p(e2, t2) {
17560
+ const n$r = (e2, t2) => e2.length >= t2, e$g = { asc: (e2, t2) => e2 > t2, desc: (e2, t2) => e2 < t2 };
17561
+ function t$q(e2, t2) {
17561
17562
  let [n2, ...a2] = t2;
17562
17563
  if (!i$4(n2)) {
17563
17564
  let t3 = r$a(...a2);
@@ -17580,47 +17581,47 @@ function i$4(t2) {
17580
17581
  return a$3(n2) && typeof r2 == "string" && r2 in e$g && i2.length === 0;
17581
17582
  }
17582
17583
  const a$3 = (e2) => typeof e2 == "function" && e2.length === 1;
17583
- function t$o(...t2) {
17584
- return t$z(Object.entries, t2);
17584
+ function t$p(...t2) {
17585
+ return t$A(Object.entries, t2);
17585
17586
  }
17586
- function n$p(...t2) {
17587
- return t$z(r$9, t2, i$3);
17587
+ function n$q(...t2) {
17588
+ return t$A(r$9, t2, i$3);
17588
17589
  }
17589
- const r$9 = (e2, t2) => e2.filter(t2), i$3 = (e2) => (n2, r2, i2) => e2(n2, r2, i2) ? { done: !1, hasNext: !0, next: n2 } : t$t, e$f = (e2) => Object.assign(e2, { single: !0 });
17590
+ const r$9 = (e2, t2) => e2.filter(t2), i$3 = (e2) => (n2, r2, i2) => e2(n2, r2, i2) ? { done: !1, hasNext: !0, next: n2 } : t$u, e$f = (e2) => Object.assign(e2, { single: !0 });
17590
17591
  function r$8(...t2) {
17591
- return t$z(i$2, t2, e$f(a$2));
17592
+ return t$A(i$2, t2, e$f(a$2));
17592
17593
  }
17593
- const i$2 = (e2, t2) => e2.find(t2), a$2 = (e2) => (n2, r2, i2) => e2(n2, r2, i2) ? { done: !0, hasNext: !0, next: n2 } : t$t;
17594
- function n$o(...n2) {
17595
- return t$z(r$7, n2, e$f(i$1));
17594
+ const i$2 = (e2, t2) => e2.find(t2), a$2 = (e2) => (n2, r2, i2) => e2(n2, r2, i2) ? { done: !0, hasNext: !0, next: n2 } : t$u;
17595
+ function n$p(...n2) {
17596
+ return t$A(r$7, n2, e$f(i$1));
17596
17597
  }
17597
17598
  const r$7 = ([e2]) => e2, i$1 = () => a$1, a$1 = (e2) => ({ hasNext: !0, next: e2, done: !0 });
17598
- function t$n(...t2) {
17599
- return t$z(n$n, t2, r$6);
17599
+ function t$o(...t2) {
17600
+ return t$A(n$o, t2, r$6);
17600
17601
  }
17601
- const n$n = (e2, t2) => e2.flatMap(t2), r$6 = (e2) => (t2, n2, r2) => {
17602
+ const n$o = (e2, t2) => e2.flatMap(t2), r$6 = (e2) => (t2, n2, r2) => {
17602
17603
  let i2 = e2(t2, n2, r2);
17603
17604
  return Array.isArray(i2) ? { done: !1, hasNext: !0, hasMany: !0, next: i2 } : { done: !1, hasNext: !0, next: i2 };
17604
17605
  };
17605
- function t$m(...t2) {
17606
- return t$z(n$m, t2);
17606
+ function t$n(...t2) {
17607
+ return t$A(n$n, t2);
17607
17608
  }
17608
- function n$m(e2, t2) {
17609
+ function n$n(e2, t2) {
17609
17610
  for (let [n2, r2] of Object.entries(e2)) t2(r2, n2, e2);
17610
17611
  return e2;
17611
17612
  }
17612
- function t$l(...t2) {
17613
- return t$z(n$l, t2);
17613
+ function t$m(...t2) {
17614
+ return t$A(n$m, t2);
17614
17615
  }
17615
- function n$l(e2, t2) {
17616
+ function n$m(e2, t2) {
17616
17617
  let n2 = {};
17617
17618
  for (let [r2, i2] of e2.entries()) n2[i2] = t2(i2, r2, e2);
17618
17619
  return n2;
17619
17620
  }
17620
- function t$k(...t2) {
17621
- return t$z(n$k, t2);
17621
+ function t$l(...t2) {
17622
+ return t$A(n$l, t2);
17622
17623
  }
17623
- const n$k = (e2, t2) => {
17624
+ const n$l = (e2, t2) => {
17624
17625
  let n2 = /* @__PURE__ */ Object.create(null);
17625
17626
  for (let r2 = 0; r2 < e2.length; r2++) {
17626
17627
  let i2 = e2[r2], a2 = t2(i2, r2, e2);
@@ -17631,10 +17632,10 @@ const n$k = (e2, t2) => {
17631
17632
  }
17632
17633
  return Object.setPrototypeOf(n2, Object.prototype), n2;
17633
17634
  };
17634
- function t$j(...t2) {
17635
- return t$z(n$j, t2);
17635
+ function t$k(...t2) {
17636
+ return t$A(n$k, t2);
17636
17637
  }
17637
- function n$j(e2, t2) {
17638
+ function n$k(e2, t2) {
17638
17639
  if (e2 === t2 || Object.is(e2, t2)) return !0;
17639
17640
  if (typeof e2 != "object" || typeof t2 != "object" || e2 === null || t2 === null || Object.getPrototypeOf(e2) !== Object.getPrototypeOf(t2)) return !1;
17640
17641
  if (Array.isArray(e2)) return r$5(e2, t2);
@@ -17643,17 +17644,17 @@ function n$j(e2, t2) {
17643
17644
  if (e2 instanceof Date) return e2.getTime() === t2.getTime();
17644
17645
  if (e2 instanceof RegExp) return e2.toString() === t2.toString();
17645
17646
  if (Object.keys(e2).length !== Object.keys(t2).length) return !1;
17646
- for (let [r2, i2] of Object.entries(e2)) if (!(r2 in t2) || !n$j(i2, t2[r2])) return !1;
17647
+ for (let [r2, i2] of Object.entries(e2)) if (!(r2 in t2) || !n$k(i2, t2[r2])) return !1;
17647
17648
  return !0;
17648
17649
  }
17649
17650
  function r$5(e2, t2) {
17650
17651
  if (e2.length !== t2.length) return !1;
17651
- for (let [r2, i2] of e2.entries()) if (!n$j(i2, t2[r2])) return !1;
17652
+ for (let [r2, i2] of e2.entries()) if (!n$k(i2, t2[r2])) return !1;
17652
17653
  return !0;
17653
17654
  }
17654
17655
  function i(e2, t2) {
17655
17656
  if (e2.size !== t2.size) return !1;
17656
- for (let [r2, i2] of e2.entries()) if (!t2.has(r2) || !n$j(i2, t2.get(r2))) return !1;
17657
+ for (let [r2, i2] of e2.entries()) if (!t2.has(r2) || !n$k(i2, t2.get(r2))) return !1;
17657
17658
  return !0;
17658
17659
  }
17659
17660
  function a(e2, t2) {
@@ -17661,7 +17662,7 @@ function a(e2, t2) {
17661
17662
  let r2 = [...t2];
17662
17663
  for (let t3 of e2) {
17663
17664
  let e3 = !1;
17664
- for (let [i2, a2] of r2.entries()) if (n$j(t3, a2)) {
17665
+ for (let [i2, a2] of r2.entries()) if (n$k(t3, a2)) {
17665
17666
  e3 = !0, r2.splice(i2, 1);
17666
17667
  break;
17667
17668
  }
@@ -17669,11 +17670,11 @@ function a(e2, t2) {
17669
17670
  }
17670
17671
  return !0;
17671
17672
  }
17672
- function n$i(...t2) {
17673
- return t$z(r$4, t2);
17673
+ function n$j(...t2) {
17674
+ return t$A(r$4, t2);
17674
17675
  }
17675
17676
  function r$4(e2, n2) {
17676
- for (let [r2, i2] of Object.entries(n2)) if (!Object.hasOwn(e2, r2) || !t$j(i2, e2[r2])) return !1;
17677
+ for (let [r2, i2] of Object.entries(n2)) if (!Object.hasOwn(e2, r2) || !t$k(i2, e2[r2])) return !1;
17677
17678
  return !0;
17678
17679
  }
17679
17680
  function e$e(e2) {
@@ -17715,25 +17716,25 @@ function e$3(e2) {
17715
17716
  function e$2(e2) {
17716
17717
  return !!e2;
17717
17718
  }
17719
+ function t$j(...t2) {
17720
+ return t$A(n$i, t2);
17721
+ }
17722
+ const n$i = (e2, t2) => e2.join(t2);
17718
17723
  function t$i(...t2) {
17719
- return t$z(n$h, t2);
17724
+ return t$A(Object.keys, t2);
17720
17725
  }
17721
- const n$h = (e2, t2) => e2.join(t2);
17722
17726
  function t$h(...t2) {
17723
- return t$z(Object.keys, t2);
17727
+ return t$A(n$h, t2);
17724
17728
  }
17729
+ const n$h = (e2) => e2.at(-1);
17725
17730
  function t$g(...t2) {
17726
- return t$z(n$g, t2);
17731
+ return t$A(n$g, t2, r$3);
17727
17732
  }
17728
- const n$g = (e2) => e2.at(-1);
17733
+ const n$g = (e2, t2) => e2.map(t2), r$3 = (e2) => (t2, n2, r2) => ({ done: !1, hasNext: !0, next: e2(t2, n2, r2) });
17729
17734
  function t$f(...t2) {
17730
- return t$z(n$f, t2, r$3);
17731
- }
17732
- const n$f = (e2, t2) => e2.map(t2), r$3 = (e2) => (t2, n2, r2) => ({ done: !1, hasNext: !0, next: e2(t2, n2, r2) });
17733
- function t$e(...t2) {
17734
- return t$z(n$e, t2);
17735
+ return t$A(n$f, t2);
17735
17736
  }
17736
- function n$e(e2, t2) {
17737
+ function n$f(e2, t2) {
17737
17738
  let n2 = {};
17738
17739
  for (let [r2, i2] of e2.entries()) {
17739
17740
  let [a2, o] = t2(i2, r2, e2);
@@ -17741,8 +17742,16 @@ function n$e(e2, t2) {
17741
17742
  }
17742
17743
  return n2;
17743
17744
  }
17745
+ function t$e(...t2) {
17746
+ return t$A(n$e, t2);
17747
+ }
17748
+ function n$e(e2, t2) {
17749
+ let n2 = {};
17750
+ for (let [r2, i2] of Object.entries(e2)) n2[r2] = t2(i2, r2, e2);
17751
+ return n2;
17752
+ }
17744
17753
  function n$d(...t2) {
17745
- return t$z(r$2, t2);
17754
+ return t$A(r$2, t2);
17746
17755
  }
17747
17756
  function r$2(e2, n2) {
17748
17757
  let i2 = { ...e2, ...n2 };
@@ -17756,11 +17765,11 @@ function r$2(e2, n2) {
17756
17765
  return i2;
17757
17766
  }
17758
17767
  function n$c(...t2) {
17759
- return t$z(r$1, t2);
17768
+ return t$A(r$1, t2);
17760
17769
  }
17761
17770
  function r$1(e2, n2) {
17762
- if (!t$q(n2, 1)) return { ...e2 };
17763
- if (!t$q(n2, 2)) {
17771
+ if (!t$r(n2, 1)) return { ...e2 };
17772
+ if (!t$r(n2, 2)) {
17764
17773
  let { [n2[0]]: t2, ...r3 } = e2;
17765
17774
  return r3;
17766
17775
  }
@@ -17769,7 +17778,7 @@ function r$1(e2, n2) {
17769
17778
  return r2;
17770
17779
  }
17771
17780
  function t$d(...t2) {
17772
- return t$z(n$b, t2);
17781
+ return t$A(n$b, t2);
17773
17782
  }
17774
17783
  function n$b(e2, t2) {
17775
17784
  let n2 = { ...e2 };
@@ -17777,11 +17786,11 @@ function n$b(e2, t2) {
17777
17786
  return n2;
17778
17787
  }
17779
17788
  function t$c(...t2) {
17780
- return t$z(n$a, t2);
17789
+ return t$A(n$a, t2);
17781
17790
  }
17782
17791
  const n$a = (e2) => e2.length === 1 ? e2[0] : void 0;
17783
17792
  function t$b(...t2) {
17784
- return t$z(n$9, t2);
17793
+ return t$A(n$9, t2);
17785
17794
  }
17786
17795
  const n$9 = (e2, t2) => {
17787
17796
  let n2 = [[], []];
@@ -17789,7 +17798,7 @@ const n$9 = (e2, t2) => {
17789
17798
  return n2;
17790
17799
  };
17791
17800
  function t$a(...t2) {
17792
- return t$z(n$8, t2);
17801
+ return t$A(n$8, t2);
17793
17802
  }
17794
17803
  function n$8(e2, t2) {
17795
17804
  let n2 = {};
@@ -17797,7 +17806,7 @@ function n$8(e2, t2) {
17797
17806
  return n2;
17798
17807
  }
17799
17808
  function t$9(...t2) {
17800
- return t$z(n$7, t2);
17809
+ return t$A(n$7, t2);
17801
17810
  }
17802
17811
  function n$7(e2, t2) {
17803
17812
  let n2 = {};
@@ -17821,7 +17830,7 @@ function e(e2, t2) {
17821
17830
  return Math.floor(Math.random() * (r2 - n2 + 1) + n2);
17822
17831
  }
17823
17832
  function t$7(...t2) {
17824
- return t$z(n$6, t2);
17833
+ return t$A(n$6, t2);
17825
17834
  }
17826
17835
  function n$6(e2, t2) {
17827
17836
  let n2 = [];
@@ -17829,41 +17838,208 @@ function n$6(e2, t2) {
17829
17838
  return n2;
17830
17839
  }
17831
17840
  function t$6(...t2) {
17832
- return t$z(n$5, t2);
17841
+ return t$A(n$5, t2);
17833
17842
  }
17834
17843
  const n$5 = (e2, t2, n2) => e2.reduce(t2, n2);
17835
17844
  function t$5(...t2) {
17836
- return t$z(n$4, t2);
17845
+ return t$A(n$4, t2);
17837
17846
  }
17838
17847
  function n$4(e2) {
17839
17848
  return [...e2].reverse();
17840
17849
  }
17841
17850
  function t$4(...t2) {
17842
- return t$z(n$3, t2);
17851
+ return t$A(n$3, t2);
17843
17852
  }
17844
17853
  function n$3(e2, t2) {
17845
17854
  let n2 = [...e2];
17846
17855
  return n2.sort(t2), n2;
17847
17856
  }
17848
17857
  function t$3(...t2) {
17849
- return t$p(n$2, t2);
17858
+ return t$q(n$2, t2);
17850
17859
  }
17851
17860
  const n$2 = (e2, t2) => [...e2].sort(t2);
17852
17861
  function t$2(...t2) {
17853
- return t$z(n$1, t2);
17862
+ return t$A(n$1, t2);
17854
17863
  }
17855
17864
  function n$1(e2, t2) {
17856
17865
  return t2(e2), e2;
17857
17866
  }
17858
17867
  function n(...e2) {
17859
- return t$r(r, e2);
17868
+ return t$s(r, e2);
17860
17869
  }
17861
17870
  function r() {
17862
17871
  let t2 = /* @__PURE__ */ new Set();
17863
- return (n2) => t2.has(n2) ? t$t : (t2.add(n2), { done: !1, hasNext: !0, next: n2 });
17872
+ return (n2) => t2.has(n2) ? t$u : (t2.add(n2), { done: !1, hasNext: !0, next: n2 });
17864
17873
  }
17865
17874
  function t$1(...t2) {
17866
- return t$z(Object.values, t2);
17875
+ return t$A(Object.values, t2);
17876
+ }
17877
+ function useSyncedRef(value) {
17878
+ const ref = useRef(value);
17879
+ return ref.current = value, useMemo(() => Object.freeze({
17880
+ get current() {
17881
+ return ref.current;
17882
+ }
17883
+ }), []);
17884
+ }
17885
+ function useUnmountEffect(effect) {
17886
+ const effectRef = useSyncedRef(effect);
17887
+ useEffect(
17888
+ () => () => {
17889
+ effectRef.current();
17890
+ },
17891
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17892
+ []
17893
+ );
17894
+ }
17895
+ function useDebouncedCallback(callback, deps, delay2, maxWait = 0) {
17896
+ const timeout2 = useRef(void 0), waitTimeout = useRef(void 0), cb = useRef(callback), lastCall = useRef(void 0), clear = () => {
17897
+ timeout2.current && (clearTimeout(timeout2.current), timeout2.current = void 0), waitTimeout.current && (clearTimeout(waitTimeout.current), waitTimeout.current = void 0);
17898
+ };
17899
+ return useUnmountEffect(clear), useEffect(() => {
17900
+ cb.current = callback;
17901
+ }, deps), useMemo(() => {
17902
+ const execute = () => {
17903
+ if (clear(), !lastCall.current)
17904
+ return;
17905
+ const context = lastCall.current;
17906
+ lastCall.current = void 0, cb.current.apply(context.this, context.args);
17907
+ }, wrapped = function(...args) {
17908
+ timeout2.current && clearTimeout(timeout2.current), lastCall.current = { args, this: this }, timeout2.current = setTimeout(execute, delay2), maxWait > 0 && !waitTimeout.current && (waitTimeout.current = setTimeout(execute, maxWait));
17909
+ };
17910
+ return Object.defineProperties(wrapped, {
17911
+ length: { value: callback.length },
17912
+ name: { value: `${callback.name || "anonymous"}__debounced__${delay2}` }
17913
+ }), wrapped;
17914
+ }, [delay2, maxWait, ...deps]);
17915
+ }
17916
+ const noop$2 = () => {
17917
+ }, isBrowser$2 = typeof globalThis < "u" && typeof navigator < "u" && typeof document < "u";
17918
+ function useRafCallback(cb) {
17919
+ const cbRef = useSyncedRef(cb), frame2 = useRef(0), cancel = useCallback(() => {
17920
+ isBrowser$2 && frame2.current && (cancelAnimationFrame(frame2.current), frame2.current = 0);
17921
+ }, []);
17922
+ return useUnmountEffect(cancel), [
17923
+ useMemo(() => {
17924
+ const wrapped = (...args) => {
17925
+ isBrowser$2 && (cancel(), frame2.current = requestAnimationFrame(() => {
17926
+ cbRef.current(...args), frame2.current = 0;
17927
+ }));
17928
+ };
17929
+ return Object.defineProperties(wrapped, {
17930
+ length: { value: cb.length },
17931
+ name: { value: `${cb.name || "anonymous"}__raf` }
17932
+ }), wrapped;
17933
+ }, []),
17934
+ cancel
17935
+ ];
17936
+ }
17937
+ const basicDepsComparator = (d1, d2) => {
17938
+ if (d1 === d2)
17939
+ return !0;
17940
+ if (d1.length !== d2.length)
17941
+ return !1;
17942
+ for (const [i2, element2] of d1.entries())
17943
+ if (element2 !== d2[i2])
17944
+ return !1;
17945
+ return !0;
17946
+ };
17947
+ function useCustomCompareEffect(callback, deps, comparator = basicDepsComparator, effectHook = useEffect, ...effectHookRestArgs) {
17948
+ const dependencies = useRef(void 0);
17949
+ (dependencies.current === void 0 || isBrowser$2 && !comparator(dependencies.current, deps)) && (dependencies.current = deps), effectHook(callback, dependencies.current, ...effectHookRestArgs);
17950
+ }
17951
+ function useDebouncedEffect(callback, deps, delay2, maxWait = 0) {
17952
+ useEffect(useDebouncedCallback(callback, deps, delay2, maxWait), deps);
17953
+ }
17954
+ function useFirstMountState() {
17955
+ const isFirstMount = useRef(!0);
17956
+ return useEffect(() => {
17957
+ isFirstMount.current = !1;
17958
+ }, []), isFirstMount.current;
17959
+ }
17960
+ const useIsomorphicLayoutEffect$3 = isBrowser$2 ? useLayoutEffect$1 : useEffect;
17961
+ function useMountEffect(effect) {
17962
+ useEffect(() => {
17963
+ effect();
17964
+ }, []);
17965
+ }
17966
+ function useRafEffect(callback, deps) {
17967
+ const [rafCallback, cancelRaf] = useRafCallback(callback);
17968
+ useEffect(
17969
+ () => (rafCallback(), cancelRaf),
17970
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17971
+ deps
17972
+ );
17973
+ }
17974
+ const stateChanger = (state) => (state + 1) % Number.MAX_SAFE_INTEGER;
17975
+ function useRerender() {
17976
+ const [, setState] = useState(0);
17977
+ return useCallback(() => {
17978
+ setState(stateChanger);
17979
+ }, []);
17980
+ }
17981
+ function useUpdateEffect(effect, deps) {
17982
+ const isFirstMount = useFirstMountState();
17983
+ useEffect(isFirstMount ? noop$2 : effect, deps);
17984
+ }
17985
+ const cancelTimeout = (id2) => {
17986
+ id2 && clearTimeout(id2);
17987
+ };
17988
+ function useTimeoutEffect(callback, ms) {
17989
+ const cbRef = useSyncedRef(callback), msRef = useSyncedRef(ms), timeoutIdRef = useRef(null), cancel = useCallback(() => {
17990
+ cancelTimeout(timeoutIdRef.current);
17991
+ }, []), reset = useCallback(() => {
17992
+ msRef.current !== void 0 && (cancel(), timeoutIdRef.current = setTimeout(() => {
17993
+ cbRef.current();
17994
+ }, msRef.current));
17995
+ }, []);
17996
+ return useEffect(() => (reset(), cancel), [ms]), [cancel, reset];
17997
+ }
17998
+ const useCustomCompareMemo = (factory2, deps, comparator) => {
17999
+ const dependencies = useRef(void 0);
18000
+ return (dependencies.current === void 0 || !comparator(dependencies.current, deps)) && (dependencies.current = deps), useMemo(factory2, dependencies.current);
18001
+ };
18002
+ function useAsync(asyncFn, initialValue) {
18003
+ const [state, setState] = useState({
18004
+ status: "not-executed",
18005
+ error: void 0,
18006
+ result: initialValue
18007
+ }), promiseRef = useRef(void 0), argsRef = useRef(void 0), methods = useSyncedRef({
18008
+ execute(...params) {
18009
+ argsRef.current = params;
18010
+ const promise = asyncFn(...params);
18011
+ return promiseRef.current = promise, setState((s2) => ({ ...s2, status: "loading" })), promise.then(
18012
+ (result) => {
18013
+ promise === promiseRef.current && setState((s2) => ({ ...s2, status: "success", error: void 0, result }));
18014
+ },
18015
+ // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable
18016
+ (error) => {
18017
+ promise === promiseRef.current && setState((previousState) => ({ ...previousState, status: "error", error }));
18018
+ }
18019
+ ), promise;
18020
+ },
18021
+ reset() {
18022
+ setState({
18023
+ status: "not-executed",
18024
+ error: void 0,
18025
+ result: initialValue
18026
+ }), promiseRef.current = void 0, argsRef.current = void 0;
18027
+ }
18028
+ });
18029
+ return [
18030
+ state,
18031
+ useMemo(
18032
+ () => ({
18033
+ reset() {
18034
+ methods.current.reset();
18035
+ },
18036
+ execute: (...params) => methods.current.execute(...params)
18037
+ }),
18038
+ // eslint-disable-next-line react-hooks/exhaustive-deps
18039
+ []
18040
+ ),
18041
+ { promise: promiseRef.current, lastArgs: argsRef.current }
18042
+ ];
17867
18043
  }
17868
18044
  function cc(names) {
17869
18045
  if (typeof names == "string" || typeof names == "number") return "" + names;
@@ -17876,7 +18052,7 @@ function cc(names) {
17876
18052
  names[k] && (out += (out && " ") + k);
17877
18053
  return out;
17878
18054
  }
17879
- var noop$2 = { value: () => {
18055
+ var noop$1 = { value: () => {
17880
18056
  } };
17881
18057
  function dispatch() {
17882
18058
  for (var i2 = 0, n2 = arguments.length, _ = {}, t2; i2 < n2; ++i2) {
@@ -17932,7 +18108,7 @@ function get$1(type2, name) {
17932
18108
  function set$2(type2, name, callback) {
17933
18109
  for (var i2 = 0, n2 = type2.length; i2 < n2; ++i2)
17934
18110
  if (type2[i2].name === name) {
17935
- type2[i2] = noop$2, type2 = type2.slice(0, i2).concat(type2.slice(i2 + 1));
18111
+ type2[i2] = noop$1, type2 = type2.slice(0, i2).concat(type2.slice(i2 + 1));
17936
18112
  break;
17937
18113
  }
17938
18114
  return callback != null && type2.push({ name, value: callback }), type2;
@@ -20145,15 +20321,10 @@ const isEdgeBase = (element2) => "id" in element2 && "source" in element2 && "ta
20145
20321
  }, { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 });
20146
20322
  return boxToRect(box);
20147
20323
  }, getInternalNodesBounds = (nodeLookup, params = {}) => {
20148
- if (nodeLookup.size === 0)
20149
- return { x: 0, y: 0, width: 0, height: 0 };
20150
- let box = { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 };
20324
+ let box = { x: 1 / 0, y: 1 / 0, x2: -1 / 0, y2: -1 / 0 }, hasVisibleNodes = !1;
20151
20325
  return nodeLookup.forEach((node2) => {
20152
- if (params.filter === void 0 || params.filter(node2)) {
20153
- const nodeBox = nodeToBox(node2);
20154
- box = getBoundsOfBoxes(box, nodeBox);
20155
- }
20156
- }), boxToRect(box);
20326
+ (params.filter === void 0 || params.filter(node2)) && (box = getBoundsOfBoxes(box, nodeToBox(node2)), hasVisibleNodes = !0);
20327
+ }), hasVisibleNodes ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };
20157
20328
  }, getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = !1, excludeNonSelectableNodes = !1) => {
20158
20329
  const paneRect = {
20159
20330
  ...pointToRendererPoint(rect, [tx, ty, tScale]),
@@ -20488,7 +20659,7 @@ function getEdgeCenter({ sourceX, sourceY, targetX, targetY }) {
20488
20659
  function getElevatedEdgeZIndex({ sourceNode, targetNode, selected: selected2 = !1, zIndex, elevateOnSelect = !1 }) {
20489
20660
  if (zIndex !== void 0)
20490
20661
  return zIndex;
20491
- const edgeZ = elevateOnSelect && selected2 ? 1e3 : 0, nodeZ = Math.max(sourceNode.parentId ? sourceNode.internals.z : 0, targetNode.parentId ? targetNode.internals.z : 0);
20662
+ const edgeZ = elevateOnSelect && selected2 ? 1e3 : 0, nodeZ = Math.max(sourceNode.parentId || elevateOnSelect && sourceNode.selected ? sourceNode.internals.z : 0, targetNode.parentId || elevateOnSelect && targetNode.selected ? targetNode.internals.z : 0);
20492
20663
  return edgeZ + nodeZ;
20493
20664
  }
20494
20665
  function isEdgeVisible({ sourceNode, targetNode, width, height, transform: transform2 }) {
@@ -20694,7 +20865,7 @@ function getNodeToolbarTransform(nodeRect, viewport, position2, offset2, align)
20694
20865
  }
20695
20866
  return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift2[0]}%, ${shift2[1]}%)`;
20696
20867
  }
20697
- const defaultOptions = {
20868
+ const SELECTED_NODE_Z = 1e3, ROOT_PARENT_Z_INCREMENT = 10, defaultOptions = {
20698
20869
  nodeOrigin: [0, 0],
20699
20870
  nodeExtent: infiniteExtent,
20700
20871
  elevateNodesOnSelect: !0,
@@ -20719,10 +20890,32 @@ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
20719
20890
  node2.internals.positionAbsolute = clampedPosition;
20720
20891
  }
20721
20892
  }
20893
+ function parseHandles(userNode, internalNode) {
20894
+ if (!userNode.handles)
20895
+ return userNode.measured ? internalNode?.internals.handleBounds : void 0;
20896
+ const source = [], target = [];
20897
+ for (const handle2 of userNode.handles) {
20898
+ const handleBounds = {
20899
+ id: handle2.id,
20900
+ width: handle2.width ?? 1,
20901
+ height: handle2.height ?? 1,
20902
+ nodeId: userNode.id,
20903
+ x: handle2.x,
20904
+ y: handle2.y,
20905
+ position: handle2.position,
20906
+ type: handle2.type
20907
+ };
20908
+ handle2.type === "source" ? source.push(handleBounds) : handle2.type === "target" && target.push(handleBounds);
20909
+ }
20910
+ return {
20911
+ source,
20912
+ target
20913
+ };
20914
+ }
20722
20915
  function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
20723
20916
  const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
20724
- let nodesInitialized = nodes.length > 0;
20725
- const tmpLookup = new Map(nodeLookup), selectedNodeZ = _options?.elevateNodesOnSelect ? 1e3 : 0;
20917
+ let rootParentIndex = { i: -1 }, nodesInitialized = nodes.length > 0;
20918
+ const tmpLookup = new Map(nodeLookup), selectedNodeZ = _options?.elevateNodesOnSelect ? SELECTED_NODE_Z : 0;
20726
20919
  nodeLookup.clear(), parentLookup.clear();
20727
20920
  for (const userNode of nodes) {
20728
20921
  let internalNode = tmpLookup.get(userNode.id);
@@ -20740,13 +20933,13 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options) {
20740
20933
  internals: {
20741
20934
  positionAbsolute: clampedPosition,
20742
20935
  // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
20743
- handleBounds: userNode.measured ? internalNode?.internals.handleBounds : void 0,
20936
+ handleBounds: parseHandles(userNode, internalNode),
20744
20937
  z: calculateZ(userNode, selectedNodeZ),
20745
20938
  userNode
20746
20939
  }
20747
20940
  }, nodeLookup.set(userNode.id, internalNode);
20748
20941
  }
20749
- (internalNode.measured === void 0 || internalNode.measured.width === void 0 || internalNode.measured.height === void 0) && !internalNode.hidden && (nodesInitialized = !1), userNode.parentId && updateChildNode(internalNode, nodeLookup, parentLookup, options);
20942
+ (internalNode.measured === void 0 || internalNode.measured.width === void 0 || internalNode.measured.height === void 0) && !internalNode.hidden && (nodesInitialized = !1), userNode.parentId && updateChildNode(internalNode, nodeLookup, parentLookup, options, rootParentIndex);
20750
20943
  }
20751
20944
  return nodesInitialized;
20752
20945
  }
@@ -20756,14 +20949,14 @@ function updateParentLookup(node2, parentLookup) {
20756
20949
  const childNodes = parentLookup.get(node2.parentId);
20757
20950
  childNodes ? childNodes.set(node2.id, node2) : parentLookup.set(node2.parentId, /* @__PURE__ */ new Map([[node2.id, node2]]));
20758
20951
  }
20759
- function updateChildNode(node2, nodeLookup, parentLookup, options) {
20952
+ function updateChildNode(node2, nodeLookup, parentLookup, options, rootParentIndex) {
20760
20953
  const { elevateNodesOnSelect, nodeOrigin, nodeExtent } = mergeObjects(defaultOptions, options), parentId = node2.parentId, parentNode = nodeLookup.get(parentId);
20761
20954
  if (!parentNode) {
20762
20955
  console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);
20763
20956
  return;
20764
20957
  }
20765
- updateParentLookup(node2, parentLookup);
20766
- const selectedNodeZ = elevateNodesOnSelect ? 1e3 : 0, { x: x2, y: y2, z } = calculateChildXYZ(node2, parentNode, nodeOrigin, nodeExtent, selectedNodeZ), { positionAbsolute } = node2.internals, positionChanged = x2 !== positionAbsolute.x || y2 !== positionAbsolute.y;
20958
+ updateParentLookup(node2, parentLookup), rootParentIndex && !parentNode.parentId && parentNode.internals.rootParentIndex === void 0 && (parentNode.internals.rootParentIndex = ++rootParentIndex.i, parentNode.internals.z = parentNode.internals.z + rootParentIndex.i * ROOT_PARENT_Z_INCREMENT), rootParentIndex && parentNode.internals.rootParentIndex !== void 0 && (rootParentIndex.i = parentNode.internals.rootParentIndex);
20959
+ const selectedNodeZ = elevateNodesOnSelect ? SELECTED_NODE_Z : 0, { x: x2, y: y2, z } = calculateChildXYZ(node2, parentNode, nodeOrigin, nodeExtent, selectedNodeZ), { positionAbsolute } = node2.internals, positionChanged = x2 !== positionAbsolute.x || y2 !== positionAbsolute.y;
20767
20960
  (positionChanged || z !== node2.internals.z) && nodeLookup.set(node2.id, {
20768
20961
  ...node2,
20769
20962
  internals: {
@@ -21070,7 +21263,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
21070
21263
  if (dragEvent = event.sourceEvent, (event.sourceEvent.type === "touchmove" && event.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
21071
21264
  nodeId && !nodeLookup.has(nodeId)) && (abortDrag = !0), !abortDrag) {
21072
21265
  if (!autoPanStarted && autoPanOnNodeDrag && dragStarted && (autoPanStarted = !0, autoPan()), !dragStarted) {
21073
- const x2 = pointerPos.xSnapped - (lastPos.x ?? 0), y2 = pointerPos.ySnapped - (lastPos.y ?? 0);
21266
+ const currentMousePosition = getEventPosition(event.sourceEvent, containerBounds), x2 = currentMousePosition.x - mousePosition.x, y2 = currentMousePosition.y - mousePosition.y;
21074
21267
  Math.sqrt(x2 * x2 + y2 * y2) > nodeDragThreshold && startDrag(event);
21075
21268
  }
21076
21269
  (lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted && (mousePosition = getEventPosition(event.sourceEvent, containerBounds), updateNodes(pointerPos));
@@ -21226,15 +21419,17 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
21226
21419
  isValid && closestHandle && previousConnection.toHandle && newConnection.toHandle && previousConnection.toHandle.type === newConnection.toHandle.type && previousConnection.toHandle.nodeId === newConnection.toHandle.nodeId && previousConnection.toHandle.id === newConnection.toHandle.id && previousConnection.to.x === newConnection.to.x && previousConnection.to.y === newConnection.to.y || (updateConnection(newConnection), previousConnection = newConnection);
21227
21420
  }
21228
21421
  function onPointerUp(event2) {
21229
- if (connectionStarted) {
21230
- (closestHandle || resultHandleDomNode) && connection && isValid && onConnect?.(connection);
21231
- const { inProgress, ...connectionState } = previousConnection, finalConnectionState = {
21232
- ...connectionState,
21233
- toPosition: previousConnection.toHandle ? previousConnection.toPosition : null
21234
- };
21235
- onConnectEnd?.(event2, finalConnectionState), edgeUpdaterType && onReconnectEnd?.(event2, finalConnectionState);
21422
+ if (!("touches" in event2 && event2.touches.length > 0)) {
21423
+ if (connectionStarted) {
21424
+ (closestHandle || resultHandleDomNode) && connection && isValid && onConnect?.(connection);
21425
+ const { inProgress, ...connectionState } = previousConnection, finalConnectionState = {
21426
+ ...connectionState,
21427
+ toPosition: previousConnection.toHandle ? previousConnection.toPosition : null
21428
+ };
21429
+ onConnectEnd?.(event2, finalConnectionState), edgeUpdaterType && onReconnectEnd?.(event2, finalConnectionState);
21430
+ }
21431
+ cancelConnection(), cancelAnimationFrame(autoPanId), autoPanStarted = !1, isValid = !1, connection = null, resultHandleDomNode = null, doc.removeEventListener("mousemove", onPointerMove), doc.removeEventListener("mouseup", onPointerUp), doc.removeEventListener("touchmove", onPointerMove), doc.removeEventListener("touchend", onPointerUp);
21236
21432
  }
21237
- cancelConnection(), cancelAnimationFrame(autoPanId), autoPanStarted = !1, isValid = !1, connection = null, resultHandleDomNode = null, doc.removeEventListener("mousemove", onPointerMove), doc.removeEventListener("mouseup", onPointerUp), doc.removeEventListener("touchmove", onPointerMove), doc.removeEventListener("touchend", onPointerUp);
21238
21433
  }
21239
21434
  doc.addEventListener("mousemove", onPointerMove), doc.addEventListener("mouseup", onPointerUp), doc.addEventListener("touchmove", onPointerMove), doc.addEventListener("touchend", onPointerUp);
21240
21435
  }
@@ -21313,7 +21508,7 @@ function XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {
21313
21508
  pointer
21314
21509
  };
21315
21510
  }
21316
- const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventViewport.x || prevViewport.y !== eventViewport.y || prevViewport.zoom !== eventViewport.k, transformToViewport = (transform2) => ({
21511
+ const transformToViewport = (transform2) => ({
21317
21512
  x: transform2.x,
21318
21513
  y: transform2.y,
21319
21514
  zoom: transform2.k
@@ -21328,7 +21523,7 @@ const viewChanged = (prevViewport, eventViewport) => prevViewport.x !== eventVie
21328
21523
  function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd }) {
21329
21524
  return (event) => {
21330
21525
  if (isWrappedWithClass(event, noWheelClassName))
21331
- return !1;
21526
+ return event.ctrlKey && event.preventDefault(), !1;
21332
21527
  event.preventDefault(), event.stopImmediatePropagation();
21333
21528
  const currentZoom = d3Selection.property("__zoom").k || 1;
21334
21529
  if (event.ctrlKey && zoomOnPinch) {
@@ -21346,9 +21541,9 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
21346
21541
  { internal: !0 }
21347
21542
  );
21348
21543
  const nextViewport = transformToViewport(d3Selection.property("__zoom"));
21349
- clearTimeout(zoomPanValues.panScrollTimeout), zoomPanValues.isPanScrolling || (zoomPanValues.isPanScrolling = !0, onPanZoomStart?.(event, nextViewport)), zoomPanValues.isPanScrolling && (onPanZoom?.(event, nextViewport), zoomPanValues.panScrollTimeout = setTimeout(() => {
21544
+ clearTimeout(zoomPanValues.panScrollTimeout), zoomPanValues.isPanScrolling ? (onPanZoom?.(event, nextViewport), zoomPanValues.panScrollTimeout = setTimeout(() => {
21350
21545
  onPanZoomEnd?.(event, nextViewport), zoomPanValues.isPanScrolling = !1;
21351
- }, 150));
21546
+ }, 150)) : (zoomPanValues.isPanScrolling = !0, onPanZoomStart?.(event, nextViewport));
21352
21547
  };
21353
21548
  }
21354
21549
  function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {
@@ -21374,7 +21569,7 @@ function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onT
21374
21569
  }
21375
21570
  function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu }) {
21376
21571
  return (event) => {
21377
- if (!event.sourceEvent?.internal && (zoomPanValues.isZoomingOrPanning = !1, onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) && !zoomPanValues.usedRightMouseButton && event.sourceEvent && onPaneContextMenu(event.sourceEvent), zoomPanValues.usedRightMouseButton = !1, onDraggingChange(!1), onPanZoomEnd && viewChanged(zoomPanValues.prevViewport, event.transform))) {
21572
+ if (!event.sourceEvent?.internal && (zoomPanValues.isZoomingOrPanning = !1, onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) && !zoomPanValues.usedRightMouseButton && event.sourceEvent && onPaneContextMenu(event.sourceEvent), zoomPanValues.usedRightMouseButton = !1, onDraggingChange(!1), onPanZoomEnd)) {
21378
21573
  const viewport = transformToViewport(event.transform);
21379
21574
  zoomPanValues.prevViewport = viewport, clearTimeout(zoomPanValues.timerId), zoomPanValues.timerId = setTimeout(
21380
21575
  () => {
@@ -21386,26 +21581,26 @@ function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDrag
21386
21581
  }
21387
21582
  };
21388
21583
  }
21389
- function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib: lib2 }) {
21584
+ function createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib: lib2, connectionInProgress }) {
21390
21585
  return (event) => {
21391
- const zoomScroll = zoomActivationKeyPressed || zoomOnScroll, pinchZoom = zoomOnPinch && event.ctrlKey;
21586
+ const zoomScroll = zoomActivationKeyPressed || zoomOnScroll, pinchZoom = zoomOnPinch && event.ctrlKey, isWheelEvent = event.type === "wheel";
21392
21587
  if (event.button === 1 && event.type === "mousedown" && (isWrappedWithClass(event, `${lib2}-flow__node`) || isWrappedWithClass(event, `${lib2}-flow__edge`)))
21393
21588
  return !0;
21394
- if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch || userSelectionActive || isWrappedWithClass(event, noWheelClassName) && event.type === "wheel" || isWrappedWithClass(event, noPanClassName) && (event.type !== "wheel" || panOnScroll && event.type === "wheel" && !zoomActivationKeyPressed) || !zoomOnPinch && event.ctrlKey && event.type === "wheel")
21589
+ if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch || userSelectionActive || connectionInProgress && !isWheelEvent || isWrappedWithClass(event, noWheelClassName) && isWheelEvent || isWrappedWithClass(event, noPanClassName) && (!isWheelEvent || panOnScroll && isWheelEvent && !zoomActivationKeyPressed) || !zoomOnPinch && event.ctrlKey && isWheelEvent)
21395
21590
  return !1;
21396
21591
  if (!zoomOnPinch && event.type === "touchstart" && event.touches?.length > 1)
21397
21592
  return event.preventDefault(), !1;
21398
- if (!zoomScroll && !panOnScroll && !pinchZoom && event.type === "wheel" || !panOnDrag && (event.type === "mousedown" || event.type === "touchstart") || Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === "mousedown")
21593
+ if (!zoomScroll && !panOnScroll && !pinchZoom && isWheelEvent || !panOnDrag && (event.type === "mousedown" || event.type === "touchstart") || Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === "mousedown")
21399
21594
  return !1;
21400
21595
  const buttonAllowed = Array.isArray(panOnDrag) && panOnDrag.includes(event.button) || !event.button || event.button <= 1;
21401
- return (!event.ctrlKey || event.type === "wheel") && buttonAllowed;
21596
+ return (!event.ctrlKey || isWheelEvent) && buttonAllowed;
21402
21597
  };
21403
21598
  }
21404
21599
  function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange }) {
21405
21600
  const zoomPanValues = {
21406
21601
  isZoomingOrPanning: !1,
21407
21602
  usedRightMouseButton: !1,
21408
- prevViewport: { x: 0, y: 0, zoom: 0 },
21603
+ prevViewport: {},
21409
21604
  mouseButton: 0,
21410
21605
  timerId: void 0,
21411
21606
  panScrollTimeout: void 0,
@@ -21426,7 +21621,7 @@ function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExte
21426
21621
  d3ZoomInstance?.interpolate(options?.interpolate === "linear" ? interpolate$2 : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(!0)), transform2);
21427
21622
  }) : Promise.resolve(!1);
21428
21623
  }
21429
- function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib: lib2, onTransformChange }) {
21624
+ function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib: lib2, onTransformChange, connectionInProgress }) {
21430
21625
  userSelectionActive && !zoomPanValues.isZoomingOrPanning && destroy();
21431
21626
  const wheelHandler = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive ? createPanOnScrollHandler({
21432
21627
  zoomPanValues,
@@ -21479,7 +21674,8 @@ function XYPanZoom({ domNode, minZoom, maxZoom, paneClickDistance, translateExte
21479
21674
  userSelectionActive,
21480
21675
  noPanClassName,
21481
21676
  noWheelClassName,
21482
- lib: lib2
21677
+ lib: lib2,
21678
+ connectionInProgress
21483
21679
  });
21484
21680
  d3ZoomInstance.filter(filter2), zoomOnDoubleClick ? d3Selection.on("dblclick.zoom", d3DblClickZoomHandler) : d3Selection.on("dblclick.zoom", null);
21485
21681
  }
@@ -21635,10 +21831,26 @@ function nodeToChildExtent(child, parent, nodeOrigin) {
21635
21831
  }
21636
21832
  function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
21637
21833
  const selection2 = select(domNode);
21834
+ let params = {
21835
+ controlDirection: getControlDirection("bottom-right"),
21836
+ boundaries: {
21837
+ minWidth: 0,
21838
+ minHeight: 0,
21839
+ maxWidth: Number.MAX_VALUE,
21840
+ maxHeight: Number.MAX_VALUE
21841
+ },
21842
+ resizeDirection: void 0,
21843
+ keepAspectRatio: !1
21844
+ };
21638
21845
  function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize }) {
21639
21846
  let prevValues = { ...initPrevValues$1 }, startValues = { ...initStartValues };
21640
- const controlDirection = getControlDirection(controlPosition);
21641
- let node2, containerBounds = null, childNodes = [], parentNode, parentExtent, childExtent;
21847
+ params = {
21848
+ boundaries,
21849
+ resizeDirection,
21850
+ keepAspectRatio,
21851
+ controlDirection: getControlDirection(controlPosition)
21852
+ };
21853
+ let node2, containerBounds = null, childNodes = [], parentNode, parentExtent, childExtent, resizeDetected = !1;
21642
21854
  const dragHandler = drag$1().on("start", (event) => {
21643
21855
  const { nodeLookup, transform: transform2, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();
21644
21856
  if (node2 = nodeLookup.get(nodeId), !node2)
@@ -21683,7 +21895,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
21683
21895
  }), childChanges = [];
21684
21896
  if (!node2)
21685
21897
  return;
21686
- const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change2 = {}, nodeOrigin = node2.origin ?? storeNodeOrigin, { width, height, x: x2, y: y2 } = getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, parentExtent, childExtent), isWidthChange = width !== prevWidth, isHeightChange = height !== prevHeight, isXPosChange = x2 !== prevX && isWidthChange, isYPosChange = y2 !== prevY && isHeightChange;
21898
+ const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues, change2 = {}, nodeOrigin = node2.origin ?? storeNodeOrigin, { width, height, x: x2, y: y2 } = getDimensionsAfterResize(startValues, params.controlDirection, pointerPosition, params.boundaries, params.keepAspectRatio, nodeOrigin, parentExtent, childExtent), isWidthChange = width !== prevWidth, isHeightChange = height !== prevHeight, isXPosChange = x2 !== prevX && isWidthChange, isYPosChange = y2 !== prevY && isHeightChange;
21687
21899
  if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange)
21688
21900
  return;
21689
21901
  if ((isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) && (change2.x = isXPosChange ? x2 : prevValues.x, change2.y = isYPosChange ? y2 : prevValues.y, prevValues.x = change2.x, prevValues.y = change2.y, childNodes.length > 0)) {
@@ -21694,7 +21906,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
21694
21906
  y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight)
21695
21907
  }, childChanges.push(childNode);
21696
21908
  }
21697
- if ((isWidthChange || isHeightChange) && (change2.width = isWidthChange && (!resizeDirection || resizeDirection === "horizontal") ? width : prevValues.width, change2.height = isHeightChange && (!resizeDirection || resizeDirection === "vertical") ? height : prevValues.height, prevValues.width = change2.width, prevValues.height = change2.height), parentNode && node2.expandParent) {
21909
+ if ((isWidthChange || isHeightChange) && (change2.width = isWidthChange && (!params.resizeDirection || params.resizeDirection === "horizontal") ? width : prevValues.width, change2.height = isHeightChange && (!params.resizeDirection || params.resizeDirection === "vertical") ? height : prevValues.height, prevValues.width = change2.width, prevValues.height = change2.height), parentNode && node2.expandParent) {
21698
21910
  const xLimit = nodeOrigin[0] * (change2.width ?? 0);
21699
21911
  change2.x && change2.x < xLimit && (prevValues.x = xLimit, startValues.x = startValues.x - (change2.x - xLimit));
21700
21912
  const yLimit = nodeOrigin[1] * (change2.height ?? 0);
@@ -21705,12 +21917,12 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
21705
21917
  prevWidth,
21706
21918
  height: prevValues.height,
21707
21919
  prevHeight,
21708
- affectsX: controlDirection.affectsX,
21709
- affectsY: controlDirection.affectsY
21920
+ affectsX: params.controlDirection.affectsX,
21921
+ affectsY: params.controlDirection.affectsY
21710
21922
  }), nextValues = { ...prevValues, direction };
21711
- shouldResize?.(event, nextValues) !== !1 && (onResize?.(event, nextValues), onChange(change2, childChanges));
21923
+ shouldResize?.(event, nextValues) !== !1 && (resizeDetected = !0, onResize?.(event, nextValues), onChange(change2, childChanges));
21712
21924
  }).on("end", (event) => {
21713
- onResizeEnd?.(event, { ...prevValues }), onEnd?.({ ...prevValues });
21925
+ resizeDetected && (onResizeEnd?.(event, { ...prevValues }), onEnd?.({ ...prevValues }), resizeDetected = !1);
21714
21926
  });
21715
21927
  selection2.call(dragHandler);
21716
21928
  }
@@ -22155,10 +22367,10 @@ const isNode = (element2) => isNodeBase(element2), isEdge = (element2) => isEdge
22155
22367
  function fixedForwardRef(render) {
22156
22368
  return forwardRef(render);
22157
22369
  }
22158
- const useIsomorphicLayoutEffect$3 = typeof window < "u" ? useLayoutEffect$1 : useEffect;
22370
+ const useIsomorphicLayoutEffect$2 = typeof window < "u" ? useLayoutEffect$1 : useEffect;
22159
22371
  function useQueue(runQueue) {
22160
22372
  const [serial, setSerial] = useState(BigInt(0)), [queue2] = useState(() => createQueue(() => setSerial((n2) => n2 + BigInt(1))));
22161
- return useIsomorphicLayoutEffect$3(() => {
22373
+ return useIsomorphicLayoutEffect$2(() => {
22162
22374
  const queueItems = queue2.get();
22163
22375
  queueItems.length && (runQueue(queueItems), queue2.reset());
22164
22376
  }, [serial]), queue2;
@@ -22289,6 +22501,11 @@ function useReactFlow() {
22289
22501
  }
22290
22502
  return (hasMatchingNodes || hasMatchingEdges) && onDelete?.({ nodes: matchingNodes, edges: matchingEdges }), { deletedNodes: matchingNodes, deletedEdges: matchingEdges };
22291
22503
  },
22504
+ /**
22505
+ * Partial is defined as "the 2 nodes/areas are intersecting partially".
22506
+ * If a is contained in b or b is contained in a, they are both
22507
+ * considered fully intersecting.
22508
+ */
22292
22509
  getIntersectingNodes: (nodeOrRect, partially = !0, nodes) => {
22293
22510
  const isRect = isRectObject(nodeOrRect), nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect), hasNodesOption = nodes !== void 0;
22294
22511
  return nodeRect ? (nodes || store.getState().nodes).filter((n2) => {
@@ -22304,7 +22521,7 @@ function useReactFlow() {
22304
22521
  if (!nodeRect)
22305
22522
  return !1;
22306
22523
  const overlappingArea = getOverlappingArea(nodeRect, area);
22307
- return partially && overlappingArea > 0 || overlappingArea >= nodeRect.width * nodeRect.height;
22524
+ return partially && overlappingArea > 0 || overlappingArea >= area.width * area.height || overlappingArea >= nodeRect.width * nodeRect.height;
22308
22525
  },
22309
22526
  updateNode,
22310
22527
  updateNodeData: (id2, dataUpdate, options = { replace: !1 }) => {
@@ -22354,7 +22571,7 @@ function useResizeHandler(domNode) {
22354
22571
  const store = useStoreApi();
22355
22572
  useEffect(() => {
22356
22573
  const updateDimensions = () => {
22357
- if (!domNode.current)
22574
+ if (!domNode.current || !(domNode.current.checkVisibility?.() ?? !0))
22358
22575
  return !1;
22359
22576
  const size2 = getDimensions(domNode.current);
22360
22577
  (size2.height === 0 || size2.width === 0) && store.getState().onError?.("004", errorMessages.error004()), store.setState({ width: size2.width || 500, height: size2.height || 500 });
@@ -22376,10 +22593,11 @@ const containerStyle = {
22376
22593
  left: 0
22377
22594
  }, selector$j = (s2) => ({
22378
22595
  userSelectionActive: s2.userSelectionActive,
22379
- lib: s2.lib
22596
+ lib: s2.lib,
22597
+ connectionInProgress: s2.connection.inProgress
22380
22598
  });
22381
22599
  function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panOnScroll = !1, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = !0, panOnDrag = !0, defaultViewport: defaultViewport2, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = !0, children: children2, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance }) {
22382
- const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib: lib2 } = useStore$1(selector$j, shallow$1), zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode), panZoom = useRef();
22600
+ const store = useStoreApi(), zoomPane = useRef(null), { userSelectionActive, lib: lib2, connectionInProgress } = useStore$1(selector$j, shallow$1), zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode), panZoom = useRef();
22383
22601
  useResizeHandler(zoomPane);
22384
22602
  const onTransformChange = useCallback((transform2) => {
22385
22603
  onViewportChange?.({ x: transform2[0], y: transform2[1], zoom: transform2[2] }), isControlledViewport || store.setState({ transform: transform2 });
@@ -22432,7 +22650,8 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
22432
22650
  userSelectionActive,
22433
22651
  noWheelClassName,
22434
22652
  lib: lib2,
22435
- onTransformChange
22653
+ onTransformChange,
22654
+ connectionInProgress
22436
22655
  });
22437
22656
  }, [
22438
22657
  onPaneContextMenu,
@@ -22449,7 +22668,8 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = !0, zoomOnPinch = !0, panO
22449
22668
  userSelectionActive,
22450
22669
  noWheelClassName,
22451
22670
  lib2,
22452
- onTransformChange
22671
+ onTransformChange,
22672
+ connectionInProgress
22453
22673
  ]), jsx("div", { className: "react-flow__renderer", ref: zoomPane, style: containerStyle, children: children2 });
22454
22674
  }
22455
22675
  const selector$i = (s2) => ({
@@ -22485,11 +22705,15 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
22485
22705
  return;
22486
22706
  }
22487
22707
  onPaneContextMenu?.(event);
22488
- }, onWheel = onPaneScroll ? (event) => onPaneScroll(event) : void 0, onPointerDown2 = (event) => {
22708
+ }, onWheel = onPaneScroll ? (event) => onPaneScroll(event) : void 0, onClickCapture = (event) => {
22709
+ (selectionOnDrag && container.current === event.target || !selectionOnDrag || selectionKeyPressed) && event.stopPropagation();
22710
+ }, onPointerDownCapture = (event) => {
22489
22711
  const { resetSelectedElements, domNode } = store.getState();
22490
- if (containerBounds.current = domNode?.getBoundingClientRect(), !elementsSelectable || !isSelecting || event.button !== 0 || event.target !== container.current || !containerBounds.current)
22712
+ containerBounds.current = domNode?.getBoundingClientRect();
22713
+ const isNoKeyEvent = event.target !== container.current && !!event.target.closest(".nokey"), isSelectionActive = selectionOnDrag && container.current === event.target || !selectionOnDrag || selectionKeyPressed;
22714
+ if (!elementsSelectable || !isSelecting || event.button !== 0 || !containerBounds.current || isNoKeyEvent || !isSelectionActive || !event.isPrimary)
22491
22715
  return;
22492
- event.target?.setPointerCapture?.(event.pointerId), selectionStarted.current = !0, selectionInProgress.current = !1;
22716
+ event.stopPropagation(), event.preventDefault(), event.target?.setPointerCapture?.(event.pointerId), selectionStarted.current = !0, selectionInProgress.current = !1;
22493
22717
  const { x: x2, y: y2 } = getEventPosition(event.nativeEvent, containerBounds.current);
22494
22718
  resetSelectedElements(), store.setState({
22495
22719
  userSelectionRect: {
@@ -22548,7 +22772,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
22548
22772
  nodesSelectionActive: selectedNodeIds.current.size > 0
22549
22773
  }), onSelectionEnd?.(event), (selectionKeyPressed || selectionOnDrag) && (selectionInProgress.current = !1), selectionStarted.current = !1;
22550
22774
  }, draggable = panOnDrag === !0 || Array.isArray(panOnDrag) && panOnDrag.includes(0);
22551
- return jsxs("div", { className: cc(["react-flow__pane", { draggable, dragging, selection: isSelecting }]), onClick: hasActiveSelection ? void 0 : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: hasActiveSelection ? void 0 : onPaneMouseEnter, onPointerDown: hasActiveSelection ? onPointerDown2 : onPaneMouseMove, onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove, onPointerUp: hasActiveSelection ? onPointerUp : void 0, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children2, jsx(UserSelection, {})] });
22775
+ return jsxs("div", { className: cc(["react-flow__pane", { draggable, dragging, selection: isSelecting }]), onClick: hasActiveSelection ? void 0 : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: hasActiveSelection ? void 0 : onPaneMouseEnter, onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove, onPointerUp: hasActiveSelection ? onPointerUp : void 0, onPointerDownCapture: hasActiveSelection ? onPointerDownCapture : void 0, onClickCapture: hasActiveSelection ? onClickCapture : void 0, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children2, jsx(UserSelection, {})] });
22552
22776
  }
22553
22777
  function handleNodeClick({ id: id2, store, unselect = !1, nodeRef }) {
22554
22778
  const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState(), node2 = nodeLookup.get(id2);
@@ -22932,6 +23156,7 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
22932
23156
  ...inlineDimensions
22933
23157
  }, "data-id": id2, "data-testid": `rf__node-${id2}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, onFocus: isFocusable ? onFocus : void 0, role: node2.ariaRole ?? (isFocusable ? "group" : void 0), "aria-roledescription": "node", "aria-describedby": disableKeyboardA11y ? void 0 : `${ARIA_NODE_DESC_KEY}-${rfId}`, "aria-label": node2.ariaLabel, ...node2.domAttributes, children: jsx(Provider, { value: id2, children: jsx(NodeComponent, { id: id2, data: node2.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node2.selected ?? !1, selectable: isSelectable, draggable: isDraggable, deletable: node2.deletable ?? !0, isConnectable, sourcePosition: node2.sourcePosition, targetPosition: node2.targetPosition, dragging, dragHandle: node2.dragHandle, zIndex: internals.z, parentId: node2.parentId, ...nodeDimensions }) }) });
22934
23158
  }
23159
+ var NodeWrapper$1 = memo$1(NodeWrapper);
22935
23160
  const selector$b = (s2) => ({
22936
23161
  nodesDraggable: s2.nodesDraggable,
22937
23162
  nodesConnectable: s2.nodesConnectable,
@@ -22967,7 +23192,7 @@ function NodeRendererComponent(props2) {
22967
23192
  * memorized – so if `NodeRenderer` *has* to rerender, it only
22968
23193
  * needs to regenerate the list of nodes, nothing else.
22969
23194
  */
22970
- jsx(NodeWrapper, { id: nodeId, nodeTypes: props2.nodeTypes, nodeExtent: props2.nodeExtent, onClick: props2.onNodeClick, onMouseEnter: props2.onNodeMouseEnter, onMouseMove: props2.onNodeMouseMove, onMouseLeave: props2.onNodeMouseLeave, onContextMenu: props2.onNodeContextMenu, onDoubleClick: props2.onNodeDoubleClick, noDragClassName: props2.noDragClassName, noPanClassName: props2.noPanClassName, rfId: props2.rfId, disableKeyboardA11y: props2.disableKeyboardA11y, resizeObserver, nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, nodeClickDistance: props2.nodeClickDistance, onError }, nodeId)
23195
+ jsx(NodeWrapper$1, { id: nodeId, nodeTypes: props2.nodeTypes, nodeExtent: props2.nodeExtent, onClick: props2.onNodeClick, onMouseEnter: props2.onNodeMouseEnter, onMouseMove: props2.onNodeMouseMove, onMouseLeave: props2.onNodeMouseLeave, onContextMenu: props2.onNodeContextMenu, onDoubleClick: props2.onNodeDoubleClick, noDragClassName: props2.noDragClassName, noPanClassName: props2.noPanClassName, rfId: props2.rfId, disableKeyboardA11y: props2.disableKeyboardA11y, resizeObserver, nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, nodeClickDistance: props2.nodeClickDistance, onError }, nodeId)
22971
23196
  )) });
22972
23197
  }
22973
23198
  NodeRendererComponent.displayName = "NodeRenderer";
@@ -23270,6 +23495,7 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
23270
23495
  }
23271
23496
  ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : void 0, tabIndex: isFocusable ? 0 : void 0, role: edge.ariaRole ?? (isFocusable ? "group" : "img"), "aria-roledescription": "edge", "data-id": id2, "data-testid": `rf__edge-${id2}`, "aria-label": edge.ariaLabel === null ? void 0 : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, "aria-describedby": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : void 0, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && jsx(EdgeComponent, { id: id2, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? !0, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: "pathOptions" in edge ? edge.pathOptions : void 0, interactionWidth: edge.interactionWidth }), isReconnectable && jsx(EdgeUpdateAnchors, { edge, isReconnectable, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, setUpdateHover, setReconnecting })] }) });
23272
23497
  }
23498
+ var EdgeWrapper$1 = memo$1(EdgeWrapper);
23273
23499
  const selector$a = (s2) => ({
23274
23500
  edgesFocusable: s2.edgesFocusable,
23275
23501
  edgesReconnectable: s2.edgesReconnectable,
@@ -23279,7 +23505,7 @@ const selector$a = (s2) => ({
23279
23505
  });
23280
23506
  function EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y }) {
23281
23507
  const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore$1(selector$a, shallow$1), edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);
23282
- return jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId }), edgeIds.map((id2) => jsx(EdgeWrapper, { id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, noPanClassName, onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart, onReconnectEnd, rfId, onError, edgeTypes, disableKeyboardA11y }, id2))] });
23508
+ return jsxs("div", { className: "react-flow__edges", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId }), edgeIds.map((id2) => jsx(EdgeWrapper$1, { id: id2, edgesFocusable, edgesReconnectable, elementsSelectable, noPanClassName, onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart, onReconnectEnd, rfId, onError, edgeTypes, disableKeyboardA11y }, id2))] });
23283
23509
  }
23284
23510
  EdgeRendererComponent.displayName = "EdgeRenderer";
23285
23511
  const EdgeRenderer = memo$1(EdgeRendererComponent), selector$9 = (s2) => `translate(${s2.transform[0]}px,${s2.transform[1]}px) scale(${s2.transform[2]})`;
@@ -23388,8 +23614,8 @@ const GraphView = memo$1(GraphViewComponent), getInitialState = ({ nodes, edges,
23388
23614
  }
23389
23615
  return {
23390
23616
  rfId: "1",
23391
- width: 0,
23392
- height: 0,
23617
+ width: width ?? 0,
23618
+ height: height ?? 0,
23393
23619
  transform: transform2,
23394
23620
  nodes: storeNodes,
23395
23621
  nodesInitialized,
@@ -24051,168 +24277,6 @@ function NodeToolbar({ nodeId, children: children2, className, style: style2, is
24051
24277
  };
24052
24278
  return jsx(NodeToolbarPortal, { children: jsx("div", { style: wrapperStyle2, className: cc(["react-flow__node-toolbar", className]), ...rest, "data-id": nodesArray.reduce((acc, node2) => `${acc}${node2.id} `, "").trim(), children: children2 }) });
24053
24279
  }
24054
- function useSyncedRef(value) {
24055
- const ref = useRef(value);
24056
- return ref.current = value, useMemo(() => Object.freeze({
24057
- get current() {
24058
- return ref.current;
24059
- }
24060
- }), []);
24061
- }
24062
- function useUnmountEffect(effect) {
24063
- const effectRef = useSyncedRef(effect);
24064
- useEffect(
24065
- () => () => {
24066
- effectRef.current();
24067
- },
24068
- // eslint-disable-next-line react-hooks/exhaustive-deps
24069
- []
24070
- );
24071
- }
24072
- function useDebouncedCallback(callback, deps, delay2, maxWait = 0) {
24073
- const timeout2 = useRef(void 0), waitTimeout = useRef(void 0), cb = useRef(callback), lastCall = useRef(void 0), clear = () => {
24074
- timeout2.current && (clearTimeout(timeout2.current), timeout2.current = void 0), waitTimeout.current && (clearTimeout(waitTimeout.current), waitTimeout.current = void 0);
24075
- };
24076
- return useUnmountEffect(clear), useEffect(() => {
24077
- cb.current = callback;
24078
- }, deps), useMemo(() => {
24079
- const execute = () => {
24080
- if (clear(), !lastCall.current)
24081
- return;
24082
- const context = lastCall.current;
24083
- lastCall.current = void 0, cb.current.apply(context.this, context.args);
24084
- }, wrapped = function(...args) {
24085
- timeout2.current && clearTimeout(timeout2.current), lastCall.current = { args, this: this }, timeout2.current = setTimeout(execute, delay2), maxWait > 0 && !waitTimeout.current && (waitTimeout.current = setTimeout(execute, maxWait));
24086
- };
24087
- return Object.defineProperties(wrapped, {
24088
- length: { value: callback.length },
24089
- name: { value: `${callback.name || "anonymous"}__debounced__${delay2}` }
24090
- }), wrapped;
24091
- }, [delay2, maxWait, ...deps]);
24092
- }
24093
- const noop$1 = () => {
24094
- }, isBrowser$2 = typeof globalThis < "u" && typeof navigator < "u" && typeof document < "u";
24095
- function useRafCallback(cb) {
24096
- const cbRef = useSyncedRef(cb), frame2 = useRef(0), cancel = useCallback(() => {
24097
- isBrowser$2 && frame2.current && (cancelAnimationFrame(frame2.current), frame2.current = 0);
24098
- }, []);
24099
- return useUnmountEffect(cancel), [
24100
- useMemo(() => {
24101
- const wrapped = (...args) => {
24102
- isBrowser$2 && (cancel(), frame2.current = requestAnimationFrame(() => {
24103
- cbRef.current(...args), frame2.current = 0;
24104
- }));
24105
- };
24106
- return Object.defineProperties(wrapped, {
24107
- length: { value: cb.length },
24108
- name: { value: `${cb.name || "anonymous"}__raf` }
24109
- }), wrapped;
24110
- }, []),
24111
- cancel
24112
- ];
24113
- }
24114
- const basicDepsComparator = (d1, d2) => {
24115
- if (d1 === d2)
24116
- return !0;
24117
- if (d1.length !== d2.length)
24118
- return !1;
24119
- for (const [i2, element2] of d1.entries())
24120
- if (element2 !== d2[i2])
24121
- return !1;
24122
- return !0;
24123
- };
24124
- function useCustomCompareEffect(callback, deps, comparator = basicDepsComparator, effectHook = useEffect, ...effectHookRestArgs) {
24125
- const dependencies = useRef(void 0);
24126
- (dependencies.current === void 0 || isBrowser$2 && !comparator(dependencies.current, deps)) && (dependencies.current = deps), effectHook(callback, dependencies.current, ...effectHookRestArgs);
24127
- }
24128
- function useDebouncedEffect(callback, deps, delay2, maxWait = 0) {
24129
- useEffect(useDebouncedCallback(callback, deps, delay2, maxWait), deps);
24130
- }
24131
- function useFirstMountState() {
24132
- const isFirstMount = useRef(!0);
24133
- return useEffect(() => {
24134
- isFirstMount.current = !1;
24135
- }, []), isFirstMount.current;
24136
- }
24137
- const useIsomorphicLayoutEffect$2 = isBrowser$2 ? useLayoutEffect$1 : useEffect;
24138
- function useRafEffect(callback, deps) {
24139
- const [rafCallback, cancelRaf] = useRafCallback(callback);
24140
- useEffect(
24141
- () => (rafCallback(), cancelRaf),
24142
- // eslint-disable-next-line react-hooks/exhaustive-deps
24143
- deps
24144
- );
24145
- }
24146
- const stateChanger = (state) => (state + 1) % Number.MAX_SAFE_INTEGER;
24147
- function useRerender() {
24148
- const [, setState] = useState(0);
24149
- return useCallback(() => {
24150
- setState(stateChanger);
24151
- }, []);
24152
- }
24153
- function useUpdateEffect(effect, deps) {
24154
- const isFirstMount = useFirstMountState();
24155
- useEffect(isFirstMount ? noop$1 : effect, deps);
24156
- }
24157
- const cancelTimeout = (id2) => {
24158
- id2 && clearTimeout(id2);
24159
- };
24160
- function useTimeoutEffect(callback, ms) {
24161
- const cbRef = useSyncedRef(callback), msRef = useSyncedRef(ms), timeoutIdRef = useRef(null), cancel = useCallback(() => {
24162
- cancelTimeout(timeoutIdRef.current);
24163
- }, []), reset = useCallback(() => {
24164
- msRef.current !== void 0 && (cancel(), timeoutIdRef.current = setTimeout(() => {
24165
- cbRef.current();
24166
- }, msRef.current));
24167
- }, []);
24168
- return useEffect(() => (reset(), cancel), [ms]), [cancel, reset];
24169
- }
24170
- const useCustomCompareMemo = (factory2, deps, comparator) => {
24171
- const dependencies = useRef(void 0);
24172
- return (dependencies.current === void 0 || !comparator(dependencies.current, deps)) && (dependencies.current = deps), useMemo(factory2, dependencies.current);
24173
- };
24174
- function useAsync(asyncFn, initialValue) {
24175
- const [state, setState] = useState({
24176
- status: "not-executed",
24177
- error: void 0,
24178
- result: initialValue
24179
- }), promiseRef = useRef(void 0), argsRef = useRef(void 0), methods = useSyncedRef({
24180
- execute(...params) {
24181
- argsRef.current = params;
24182
- const promise = asyncFn(...params);
24183
- return promiseRef.current = promise, setState((s2) => ({ ...s2, status: "loading" })), promise.then(
24184
- (result) => {
24185
- promise === promiseRef.current && setState((s2) => ({ ...s2, status: "success", error: void 0, result }));
24186
- },
24187
- // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable
24188
- (error) => {
24189
- promise === promiseRef.current && setState((previousState) => ({ ...previousState, status: "error", error }));
24190
- }
24191
- ), promise;
24192
- },
24193
- reset() {
24194
- setState({
24195
- status: "not-executed",
24196
- error: void 0,
24197
- result: initialValue
24198
- }), promiseRef.current = void 0, argsRef.current = void 0;
24199
- }
24200
- });
24201
- return [
24202
- state,
24203
- useMemo(
24204
- () => ({
24205
- reset() {
24206
- methods.current.reset();
24207
- },
24208
- execute: (...params) => methods.current.execute(...params)
24209
- }),
24210
- // eslint-disable-next-line react-hooks/exhaustive-deps
24211
- []
24212
- ),
24213
- { promise: promiseRef.current, lastArgs: argsRef.current }
24214
- ];
24215
- }
24216
24280
  var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty$1 = Object.prototype.hasOwnProperty;
24217
24281
  function combineComparators(comparatorA, comparatorB) {
24218
24282
  return function(a2, b, state) {
@@ -24231,6 +24295,9 @@ function createIsCircular(areItemsEqual) {
24231
24295
  return cache2.delete(a2), cache2.delete(b), result;
24232
24296
  };
24233
24297
  }
24298
+ function getShortTag(value) {
24299
+ return value?.[Symbol.toStringTag];
24300
+ }
24234
24301
  function getStrictProperties(object2) {
24235
24302
  return getOwnPropertyNames(object2).concat(getOwnPropertySymbols(object2));
24236
24303
  }
@@ -24345,7 +24412,7 @@ function isPropertyEqual(a2, b, state, property) {
24345
24412
  }
24346
24413
  var ARGUMENTS_TAG = "[object Arguments]", BOOLEAN_TAG = "[object Boolean]", DATE_TAG = "[object Date]", ERROR_TAG = "[object Error]", MAP_TAG = "[object Map]", NUMBER_TAG = "[object Number]", OBJECT_TAG = "[object Object]", REG_EXP_TAG = "[object RegExp]", SET_TAG = "[object Set]", STRING_TAG = "[object String]", URL_TAG = "[object URL]", isArray = Array.isArray, isTypedArray = typeof ArrayBuffer == "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null, assign = Object.assign, getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
24347
24414
  function createEqualityComparator(_a2) {
24348
- var areArraysEqual2 = _a2.areArraysEqual, areDatesEqual2 = _a2.areDatesEqual, areErrorsEqual2 = _a2.areErrorsEqual, areFunctionsEqual2 = _a2.areFunctionsEqual, areMapsEqual2 = _a2.areMapsEqual, areNumbersEqual2 = _a2.areNumbersEqual, areObjectsEqual2 = _a2.areObjectsEqual, arePrimitiveWrappersEqual2 = _a2.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a2.areRegExpsEqual, areSetsEqual2 = _a2.areSetsEqual, areTypedArraysEqual2 = _a2.areTypedArraysEqual, areUrlsEqual2 = _a2.areUrlsEqual;
24415
+ var areArraysEqual2 = _a2.areArraysEqual, areDatesEqual2 = _a2.areDatesEqual, areErrorsEqual2 = _a2.areErrorsEqual, areFunctionsEqual2 = _a2.areFunctionsEqual, areMapsEqual2 = _a2.areMapsEqual, areNumbersEqual2 = _a2.areNumbersEqual, areObjectsEqual2 = _a2.areObjectsEqual, arePrimitiveWrappersEqual2 = _a2.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a2.areRegExpsEqual, areSetsEqual2 = _a2.areSetsEqual, areTypedArraysEqual2 = _a2.areTypedArraysEqual, areUrlsEqual2 = _a2.areUrlsEqual, unknownTagComparators = _a2.unknownTagComparators;
24349
24416
  return function(a2, b, state) {
24350
24417
  if (a2 === b)
24351
24418
  return !0;
@@ -24374,7 +24441,34 @@ function createEqualityComparator(_a2) {
24374
24441
  if (constructor === Set)
24375
24442
  return areSetsEqual2(a2, b, state);
24376
24443
  var tag = getTag(a2);
24377
- return tag === DATE_TAG ? areDatesEqual2(a2, b, state) : tag === REG_EXP_TAG ? areRegExpsEqual2(a2, b, state) : tag === MAP_TAG ? areMapsEqual2(a2, b, state) : tag === SET_TAG ? areSetsEqual2(a2, b, state) : tag === OBJECT_TAG ? typeof a2.then != "function" && typeof b.then != "function" && areObjectsEqual2(a2, b, state) : tag === URL_TAG ? areUrlsEqual2(a2, b, state) : tag === ERROR_TAG ? areErrorsEqual2(a2, b, state) : tag === ARGUMENTS_TAG ? areObjectsEqual2(a2, b, state) : tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG ? arePrimitiveWrappersEqual2(a2, b, state) : !1;
24444
+ if (tag === DATE_TAG)
24445
+ return areDatesEqual2(a2, b, state);
24446
+ if (tag === REG_EXP_TAG)
24447
+ return areRegExpsEqual2(a2, b, state);
24448
+ if (tag === MAP_TAG)
24449
+ return areMapsEqual2(a2, b, state);
24450
+ if (tag === SET_TAG)
24451
+ return areSetsEqual2(a2, b, state);
24452
+ if (tag === OBJECT_TAG)
24453
+ return typeof a2.then != "function" && typeof b.then != "function" && areObjectsEqual2(a2, b, state);
24454
+ if (tag === URL_TAG)
24455
+ return areUrlsEqual2(a2, b, state);
24456
+ if (tag === ERROR_TAG)
24457
+ return areErrorsEqual2(a2, b, state);
24458
+ if (tag === ARGUMENTS_TAG)
24459
+ return areObjectsEqual2(a2, b, state);
24460
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG)
24461
+ return arePrimitiveWrappersEqual2(a2, b, state);
24462
+ if (unknownTagComparators) {
24463
+ var unknownTagComparator = unknownTagComparators[tag];
24464
+ if (!unknownTagComparator) {
24465
+ var shortTag = getShortTag(a2);
24466
+ shortTag && (unknownTagComparator = unknownTagComparators[shortTag]);
24467
+ }
24468
+ if (unknownTagComparator)
24469
+ return unknownTagComparator(a2, b, state);
24470
+ }
24471
+ return !1;
24378
24472
  };
24379
24473
  }
24380
24474
  function createEqualityComparatorConfig(_a2) {
@@ -24390,7 +24484,8 @@ function createEqualityComparatorConfig(_a2) {
24390
24484
  areRegExpsEqual,
24391
24485
  areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
24392
24486
  areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
24393
- areUrlsEqual
24487
+ areUrlsEqual,
24488
+ unknownTagComparators: void 0
24394
24489
  };
24395
24490
  if (createCustomConfig && (config2 = assign({}, config2, createCustomConfig(config2))), circular) {
24396
24491
  var areArraysEqual$1 = createIsCircular(config2.areArraysEqual), areMapsEqual$1 = createIsCircular(config2.areMapsEqual), areObjectsEqual$1 = createIsCircular(config2.areObjectsEqual), areSetsEqual$12 = createIsCircular(config2.areSetsEqual);
@@ -49738,7 +49833,7 @@ function createAnimationState(visualElement) {
49738
49833
  setAnimateFunction,
49739
49834
  getState: () => state,
49740
49835
  reset: () => {
49741
- state = createState(), isInitialRender = !0;
49836
+ state = createState();
49742
49837
  }
49743
49838
  };
49744
49839
  }
@@ -51689,7 +51784,7 @@ function hasArrayChanged() {
51689
51784
  let a2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
51690
51785
  return a2.length !== b.length || a2.some((item, index2) => !Object.is(item, b[index2]));
51691
51786
  }
51692
- var xstateReact_cjs = {}, xstate_cjs = {}, xstateActors_cjs = {}, raiseB4a670a0_cjs = {}, xstateDev_cjs = {}, hasRequiredXstateDev_cjs;
51787
+ var xstateReact_cjs = {}, xstate_cjs = {}, xstateActors_cjs = {}, raiseDa5b247f_cjs = {}, xstateDev_cjs = {}, hasRequiredXstateDev_cjs;
51693
51788
  function requireXstateDev_cjs() {
51694
51789
  if (hasRequiredXstateDev_cjs) return xstateDev_cjs;
51695
51790
  hasRequiredXstateDev_cjs = 1, Object.defineProperty(xstateDev_cjs, "__esModule", { value: !0 });
@@ -51722,10 +51817,10 @@ function requireXstateDev_cjs() {
51722
51817
  };
51723
51818
  return xstateDev_cjs.devToolsAdapter = devToolsAdapter, xstateDev_cjs.getGlobal = getGlobal, xstateDev_cjs.registerService = registerService, xstateDev_cjs;
51724
51819
  }
51725
- var hasRequiredRaiseB4a670a0_cjs;
51726
- function requireRaiseB4a670a0_cjs() {
51727
- if (hasRequiredRaiseB4a670a0_cjs) return raiseB4a670a0_cjs;
51728
- hasRequiredRaiseB4a670a0_cjs = 1;
51820
+ var hasRequiredRaiseDa5b247f_cjs;
51821
+ function requireRaiseDa5b247f_cjs() {
51822
+ if (hasRequiredRaiseDa5b247f_cjs) return raiseDa5b247f_cjs;
51823
+ hasRequiredRaiseDa5b247f_cjs = 1;
51729
51824
  var dev_dist_xstateDev = requireXstateDev_cjs();
51730
51825
  class Mailbox {
51731
51826
  constructor(_process) {
@@ -51951,6 +52046,7 @@ function requireRaiseB4a670a0_cjs() {
51951
52046
  systemId !== void 0 && (keyedActors.delete(systemId), reverseKeyedActors.delete(actorRef));
51952
52047
  },
51953
52048
  get: (systemId) => keyedActors.get(systemId),
52049
+ getAll: () => Object.fromEntries(keyedActors.entries()),
51954
52050
  _set: (systemId, actorRef) => {
51955
52051
  const existing = keyedActors.get(systemId);
51956
52052
  if (existing && existing !== actorRef)
@@ -52021,7 +52117,7 @@ function requireRaiseB4a670a0_cjs() {
52021
52117
  * @param options Actor options
52022
52118
  */
52023
52119
  constructor(logic, options) {
52024
- this.logic = logic, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new Mailbox(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = ProcessingStatus.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
52120
+ this.logic = logic, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new Mailbox(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = ProcessingStatus.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this.systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
52025
52121
  const resolvedOptions = {
52026
52122
  ...defaultOptions2,
52027
52123
  ...options
@@ -52086,7 +52182,7 @@ function requireRaiseB4a670a0_cjs() {
52086
52182
  }, this.send = this.send.bind(this), this.system._sendInspectionEvent({
52087
52183
  type: "@xstate.actor",
52088
52184
  actorRef: this
52089
- }), systemId && (this._systemId = systemId, this.system._set(systemId, this)), this._initState(options?.snapshot ?? options?.state), systemId && this._snapshot.status !== "active" && this.system._unregister(this);
52185
+ }), systemId && (this.systemId = systemId, this.system._set(systemId, this)), this._initState(options?.snapshot ?? options?.state), systemId && this._snapshot.status !== "active" && this.system._unregister(this);
52090
52186
  }
52091
52187
  _initState(persistedState) {
52092
52188
  try {
@@ -52255,7 +52351,7 @@ function requireRaiseB4a670a0_cjs() {
52255
52351
  },
52256
52352
  error: () => {
52257
52353
  }
52258
- }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = ProcessingStatus.Running;
52354
+ }), this.system._register(this.sessionId, this), this.systemId && this.system._set(this.systemId, this), this._processingStatus = ProcessingStatus.Running;
52259
52355
  const initEvent = createInitEvent(this.options.input);
52260
52356
  switch (this.system._sendInspectionEvent({
52261
52357
  type: "@xstate.event",
@@ -53325,7 +53421,7 @@ ${err.message}`);
53325
53421
  childrenJson[id2] = {
53326
53422
  snapshot: child.getPersistedSnapshot(options),
53327
53423
  src: child.src,
53328
- systemId: child._systemId,
53424
+ systemId: child.systemId,
53329
53425
  syncSnapshot: child._syncSnapshot
53330
53426
  };
53331
53427
  }
@@ -53402,13 +53498,13 @@ ${err.message}`);
53402
53498
  }
53403
53499
  return raise3.type = "xstate.raise", raise3.event = eventOrExpr, raise3.id = options?.id, raise3.delay = options?.delay, raise3.resolve = resolveRaise, raise3.execute = executeRaise, raise3;
53404
53500
  }
53405
- return raiseB4a670a0_cjs.$$ACTOR_TYPE = $$ACTOR_TYPE, raiseB4a670a0_cjs.Actor = Actor, raiseB4a670a0_cjs.NULL_EVENT = NULL_EVENT, raiseB4a670a0_cjs.ProcessingStatus = ProcessingStatus, raiseB4a670a0_cjs.STATE_DELIMITER = STATE_DELIMITER, raiseB4a670a0_cjs.XSTATE_ERROR = XSTATE_ERROR, raiseB4a670a0_cjs.XSTATE_STOP = XSTATE_STOP, raiseB4a670a0_cjs.and = and, raiseB4a670a0_cjs.cancel = cancel, raiseB4a670a0_cjs.cloneMachineSnapshot = cloneMachineSnapshot, raiseB4a670a0_cjs.createActor = createActor, raiseB4a670a0_cjs.createErrorActorEvent = createErrorActorEvent, raiseB4a670a0_cjs.createInitEvent = createInitEvent, raiseB4a670a0_cjs.createInvokeId = createInvokeId, raiseB4a670a0_cjs.createMachineSnapshot = createMachineSnapshot, raiseB4a670a0_cjs.evaluateGuard = evaluateGuard, raiseB4a670a0_cjs.formatInitialTransition = formatInitialTransition, raiseB4a670a0_cjs.formatTransition = formatTransition, raiseB4a670a0_cjs.formatTransitions = formatTransitions, raiseB4a670a0_cjs.getAllOwnEventDescriptors = getAllOwnEventDescriptors, raiseB4a670a0_cjs.getAllStateNodes = getAllStateNodes, raiseB4a670a0_cjs.getCandidates = getCandidates, raiseB4a670a0_cjs.getDelayedTransitions = getDelayedTransitions, raiseB4a670a0_cjs.getInitialStateNodes = getInitialStateNodes, raiseB4a670a0_cjs.getPersistedSnapshot = getPersistedSnapshot, raiseB4a670a0_cjs.getStateNodeByPath = getStateNodeByPath, raiseB4a670a0_cjs.getStateNodes = getStateNodes, raiseB4a670a0_cjs.interpret = interpret, raiseB4a670a0_cjs.isInFinalState = isInFinalState, raiseB4a670a0_cjs.isMachineSnapshot = isMachineSnapshot, raiseB4a670a0_cjs.isStateId = isStateId, raiseB4a670a0_cjs.macrostep = macrostep, raiseB4a670a0_cjs.mapValues = mapValues, raiseB4a670a0_cjs.matchesState = matchesState, raiseB4a670a0_cjs.microstep = microstep, raiseB4a670a0_cjs.not = not, raiseB4a670a0_cjs.or = or, raiseB4a670a0_cjs.pathToStateValue = pathToStateValue, raiseB4a670a0_cjs.raise = raise2, raiseB4a670a0_cjs.resolveActionsAndContext = resolveActionsAndContext, raiseB4a670a0_cjs.resolveReferencedActor = resolveReferencedActor, raiseB4a670a0_cjs.resolveStateValue = resolveStateValue, raiseB4a670a0_cjs.spawnChild = spawnChild, raiseB4a670a0_cjs.stateIn = stateIn, raiseB4a670a0_cjs.stop = stop, raiseB4a670a0_cjs.stopChild = stopChild, raiseB4a670a0_cjs.toArray = toArray2, raiseB4a670a0_cjs.toObserver = toObserver, raiseB4a670a0_cjs.toStatePath = toStatePath, raiseB4a670a0_cjs.toTransitionConfigArray = toTransitionConfigArray, raiseB4a670a0_cjs.transitionNode = transitionNode, raiseB4a670a0_cjs;
53501
+ return raiseDa5b247f_cjs.$$ACTOR_TYPE = $$ACTOR_TYPE, raiseDa5b247f_cjs.Actor = Actor, raiseDa5b247f_cjs.NULL_EVENT = NULL_EVENT, raiseDa5b247f_cjs.ProcessingStatus = ProcessingStatus, raiseDa5b247f_cjs.STATE_DELIMITER = STATE_DELIMITER, raiseDa5b247f_cjs.XSTATE_ERROR = XSTATE_ERROR, raiseDa5b247f_cjs.XSTATE_STOP = XSTATE_STOP, raiseDa5b247f_cjs.and = and, raiseDa5b247f_cjs.cancel = cancel, raiseDa5b247f_cjs.cloneMachineSnapshot = cloneMachineSnapshot, raiseDa5b247f_cjs.createActor = createActor, raiseDa5b247f_cjs.createErrorActorEvent = createErrorActorEvent, raiseDa5b247f_cjs.createInitEvent = createInitEvent, raiseDa5b247f_cjs.createInvokeId = createInvokeId, raiseDa5b247f_cjs.createMachineSnapshot = createMachineSnapshot, raiseDa5b247f_cjs.evaluateGuard = evaluateGuard, raiseDa5b247f_cjs.formatInitialTransition = formatInitialTransition, raiseDa5b247f_cjs.formatTransition = formatTransition, raiseDa5b247f_cjs.formatTransitions = formatTransitions, raiseDa5b247f_cjs.getAllOwnEventDescriptors = getAllOwnEventDescriptors, raiseDa5b247f_cjs.getAllStateNodes = getAllStateNodes, raiseDa5b247f_cjs.getCandidates = getCandidates, raiseDa5b247f_cjs.getDelayedTransitions = getDelayedTransitions, raiseDa5b247f_cjs.getInitialStateNodes = getInitialStateNodes, raiseDa5b247f_cjs.getPersistedSnapshot = getPersistedSnapshot, raiseDa5b247f_cjs.getStateNodeByPath = getStateNodeByPath, raiseDa5b247f_cjs.getStateNodes = getStateNodes, raiseDa5b247f_cjs.interpret = interpret, raiseDa5b247f_cjs.isInFinalState = isInFinalState, raiseDa5b247f_cjs.isMachineSnapshot = isMachineSnapshot, raiseDa5b247f_cjs.isStateId = isStateId, raiseDa5b247f_cjs.macrostep = macrostep, raiseDa5b247f_cjs.mapValues = mapValues, raiseDa5b247f_cjs.matchesState = matchesState, raiseDa5b247f_cjs.microstep = microstep, raiseDa5b247f_cjs.not = not, raiseDa5b247f_cjs.or = or, raiseDa5b247f_cjs.pathToStateValue = pathToStateValue, raiseDa5b247f_cjs.raise = raise2, raiseDa5b247f_cjs.resolveActionsAndContext = resolveActionsAndContext, raiseDa5b247f_cjs.resolveReferencedActor = resolveReferencedActor, raiseDa5b247f_cjs.resolveStateValue = resolveStateValue, raiseDa5b247f_cjs.spawnChild = spawnChild, raiseDa5b247f_cjs.stateIn = stateIn, raiseDa5b247f_cjs.stop = stop, raiseDa5b247f_cjs.stopChild = stopChild, raiseDa5b247f_cjs.toArray = toArray2, raiseDa5b247f_cjs.toObserver = toObserver, raiseDa5b247f_cjs.toStatePath = toStatePath, raiseDa5b247f_cjs.toTransitionConfigArray = toTransitionConfigArray, raiseDa5b247f_cjs.transitionNode = transitionNode, raiseDa5b247f_cjs;
53406
53502
  }
53407
53503
  var hasRequiredXstateActors_cjs;
53408
53504
  function requireXstateActors_cjs() {
53409
53505
  if (hasRequiredXstateActors_cjs) return xstateActors_cjs;
53410
53506
  hasRequiredXstateActors_cjs = 1, Object.defineProperty(xstateActors_cjs, "__esModule", { value: !0 });
53411
- var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseB4a670a0_cjs();
53507
+ var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseDa5b247f_cjs();
53412
53508
  requireXstateDev_cjs();
53413
53509
  function fromTransition(transition, initialContext) {
53414
53510
  return {
@@ -53715,11 +53811,11 @@ function requireXstateActors_cjs() {
53715
53811
  }
53716
53812
  return xstateActors_cjs.createEmptyActor = createEmptyActor, xstateActors_cjs.fromCallback = fromCallback, xstateActors_cjs.fromEventObservable = fromEventObservable, xstateActors_cjs.fromObservable = fromObservable, xstateActors_cjs.fromPromise = fromPromise, xstateActors_cjs.fromTransition = fromTransition, xstateActors_cjs;
53717
53813
  }
53718
- var StateMachine865e00e8_cjs = {}, assign381d0341_cjs = {}, hasRequiredAssign381d0341_cjs;
53719
- function requireAssign381d0341_cjs() {
53720
- if (hasRequiredAssign381d0341_cjs) return assign381d0341_cjs;
53721
- hasRequiredAssign381d0341_cjs = 1;
53722
- var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseB4a670a0_cjs();
53814
+ var StateMachine30081029_cjs = {}, assignDea9f7c8_cjs = {}, hasRequiredAssignDea9f7c8_cjs;
53815
+ function requireAssignDea9f7c8_cjs() {
53816
+ if (hasRequiredAssignDea9f7c8_cjs) return assignDea9f7c8_cjs;
53817
+ hasRequiredAssignDea9f7c8_cjs = 1;
53818
+ var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseDa5b247f_cjs();
53723
53819
  function createSpawner(actorScope, {
53724
53820
  machine,
53725
53821
  context
@@ -53793,13 +53889,13 @@ function requireAssign381d0341_cjs() {
53793
53889
  }
53794
53890
  return assign3.type = "xstate.assign", assign3.assignment = assignment, assign3.resolve = resolveAssign, assign3;
53795
53891
  }
53796
- return assign381d0341_cjs.assign = assign2, assign381d0341_cjs;
53892
+ return assignDea9f7c8_cjs.assign = assign2, assignDea9f7c8_cjs;
53797
53893
  }
53798
- var hasRequiredStateMachine865e00e8_cjs;
53799
- function requireStateMachine865e00e8_cjs() {
53800
- if (hasRequiredStateMachine865e00e8_cjs) return StateMachine865e00e8_cjs;
53801
- hasRequiredStateMachine865e00e8_cjs = 1;
53802
- var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseB4a670a0_cjs(), assign2 = /* @__PURE__ */ requireAssign381d0341_cjs();
53894
+ var hasRequiredStateMachine30081029_cjs;
53895
+ function requireStateMachine30081029_cjs() {
53896
+ if (hasRequiredStateMachine30081029_cjs) return StateMachine30081029_cjs;
53897
+ hasRequiredStateMachine30081029_cjs = 1;
53898
+ var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseDa5b247f_cjs(), assign2 = /* @__PURE__ */ requireAssignDea9f7c8_cjs();
53803
53899
  const cache2 = /* @__PURE__ */ new WeakMap();
53804
53900
  function memo2(object2, key2, fn) {
53805
53901
  let memoizedData = cache2.get(object2);
@@ -54166,13 +54262,13 @@ ${err.message}`);
54166
54262
  return reviveContext(restoredSnapshot.context, children2), restoredSnapshot;
54167
54263
  }
54168
54264
  }
54169
- return StateMachine865e00e8_cjs.StateMachine = StateMachine, StateMachine865e00e8_cjs.StateNode = StateNode, StateMachine865e00e8_cjs;
54265
+ return StateMachine30081029_cjs.StateMachine = StateMachine, StateMachine30081029_cjs.StateNode = StateNode, StateMachine30081029_cjs;
54170
54266
  }
54171
- var log63c8f21f_cjs = {}, hasRequiredLog63c8f21f_cjs;
54172
- function requireLog63c8f21f_cjs() {
54173
- if (hasRequiredLog63c8f21f_cjs) return log63c8f21f_cjs;
54174
- hasRequiredLog63c8f21f_cjs = 1;
54175
- var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseB4a670a0_cjs(), assign2 = /* @__PURE__ */ requireAssign381d0341_cjs();
54267
+ var logEc8d4df4_cjs = {}, hasRequiredLogEc8d4df4_cjs;
54268
+ function requireLogEc8d4df4_cjs() {
54269
+ if (hasRequiredLogEc8d4df4_cjs) return logEc8d4df4_cjs;
54270
+ hasRequiredLogEc8d4df4_cjs = 1;
54271
+ var guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseDa5b247f_cjs(), assign2 = /* @__PURE__ */ requireAssignDea9f7c8_cjs();
54176
54272
  function resolveEmit(_, snapshot, args, actionParams, {
54177
54273
  event: eventOrExpr
54178
54274
  }) {
@@ -54329,13 +54425,13 @@ function requireLog63c8f21f_cjs() {
54329
54425
  }
54330
54426
  return log3.type = "xstate.log", log3.value = value, log3.label = label, log3.resolve = resolveLog, log3.execute = executeLog, log3;
54331
54427
  }
54332
- return log63c8f21f_cjs.SpecialTargets = SpecialTargets, log63c8f21f_cjs.emit = emit2, log63c8f21f_cjs.enqueueActions = enqueueActions, log63c8f21f_cjs.forwardTo = forwardTo, log63c8f21f_cjs.log = log2, log63c8f21f_cjs.sendParent = sendParent, log63c8f21f_cjs.sendTo = sendTo, log63c8f21f_cjs;
54428
+ return logEc8d4df4_cjs.SpecialTargets = SpecialTargets, logEc8d4df4_cjs.emit = emit2, logEc8d4df4_cjs.enqueueActions = enqueueActions, logEc8d4df4_cjs.forwardTo = forwardTo, logEc8d4df4_cjs.log = log2, logEc8d4df4_cjs.sendParent = sendParent, logEc8d4df4_cjs.sendTo = sendTo, logEc8d4df4_cjs;
54333
54429
  }
54334
54430
  var hasRequiredXstate_cjs;
54335
54431
  function requireXstate_cjs() {
54336
54432
  if (hasRequiredXstate_cjs) return xstate_cjs;
54337
54433
  hasRequiredXstate_cjs = 1, Object.defineProperty(xstate_cjs, "__esModule", { value: !0 });
54338
- var actors_dist_xstateActors = requireXstateActors_cjs(), guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseB4a670a0_cjs(), StateMachine = /* @__PURE__ */ requireStateMachine865e00e8_cjs(), log2 = /* @__PURE__ */ requireLog63c8f21f_cjs(), assign2 = /* @__PURE__ */ requireAssign381d0341_cjs();
54434
+ var actors_dist_xstateActors = requireXstateActors_cjs(), guards_dist_xstateGuards = /* @__PURE__ */ requireRaiseDa5b247f_cjs(), StateMachine = /* @__PURE__ */ requireStateMachine30081029_cjs(), assign2 = /* @__PURE__ */ requireAssignDea9f7c8_cjs(), log2 = /* @__PURE__ */ requireLogEc8d4df4_cjs();
54339
54435
  requireXstateDev_cjs();
54340
54436
  function assertEvent(event, type2) {
54341
54437
  const types2 = guards_dist_xstateGuards.toArray(type2);
@@ -54382,6 +54478,17 @@ function requireXstate_cjs() {
54382
54478
  delays
54383
54479
  }) {
54384
54480
  return {
54481
+ assign: assign2.assign,
54482
+ sendTo: log2.sendTo,
54483
+ raise: guards_dist_xstateGuards.raise,
54484
+ log: log2.log,
54485
+ cancel: guards_dist_xstateGuards.cancel,
54486
+ stopChild: guards_dist_xstateGuards.stopChild,
54487
+ enqueueActions: log2.enqueueActions,
54488
+ emit: log2.emit,
54489
+ spawnChild: guards_dist_xstateGuards.spawnChild,
54490
+ createStateConfig: (config2) => config2,
54491
+ createAction: (fn) => fn,
54385
54492
  createMachine: (config2) => createMachine({
54386
54493
  ...config2,
54387
54494
  schemas
@@ -54505,7 +54612,7 @@ function requireXstate_cjs() {
54505
54612
  }), done && sub.unsubscribe());
54506
54613
  });
54507
54614
  }
54508
- return xstate_cjs.createEmptyActor = actors_dist_xstateActors.createEmptyActor, xstate_cjs.fromCallback = actors_dist_xstateActors.fromCallback, xstate_cjs.fromEventObservable = actors_dist_xstateActors.fromEventObservable, xstate_cjs.fromObservable = actors_dist_xstateActors.fromObservable, xstate_cjs.fromPromise = actors_dist_xstateActors.fromPromise, xstate_cjs.fromTransition = actors_dist_xstateActors.fromTransition, xstate_cjs.Actor = guards_dist_xstateGuards.Actor, xstate_cjs.__unsafe_getAllOwnEventDescriptors = guards_dist_xstateGuards.getAllOwnEventDescriptors, xstate_cjs.and = guards_dist_xstateGuards.and, xstate_cjs.cancel = guards_dist_xstateGuards.cancel, xstate_cjs.createActor = guards_dist_xstateGuards.createActor, xstate_cjs.getStateNodes = guards_dist_xstateGuards.getStateNodes, xstate_cjs.interpret = guards_dist_xstateGuards.interpret, xstate_cjs.isMachineSnapshot = guards_dist_xstateGuards.isMachineSnapshot, xstate_cjs.matchesState = guards_dist_xstateGuards.matchesState, xstate_cjs.not = guards_dist_xstateGuards.not, xstate_cjs.or = guards_dist_xstateGuards.or, xstate_cjs.pathToStateValue = guards_dist_xstateGuards.pathToStateValue, xstate_cjs.raise = guards_dist_xstateGuards.raise, xstate_cjs.spawnChild = guards_dist_xstateGuards.spawnChild, xstate_cjs.stateIn = guards_dist_xstateGuards.stateIn, xstate_cjs.stop = guards_dist_xstateGuards.stop, xstate_cjs.stopChild = guards_dist_xstateGuards.stopChild, xstate_cjs.toObserver = guards_dist_xstateGuards.toObserver, xstate_cjs.StateMachine = StateMachine.StateMachine, xstate_cjs.StateNode = StateMachine.StateNode, xstate_cjs.SpecialTargets = log2.SpecialTargets, xstate_cjs.emit = log2.emit, xstate_cjs.enqueueActions = log2.enqueueActions, xstate_cjs.forwardTo = log2.forwardTo, xstate_cjs.log = log2.log, xstate_cjs.sendParent = log2.sendParent, xstate_cjs.sendTo = log2.sendTo, xstate_cjs.assign = assign2.assign, xstate_cjs.SimulatedClock = SimulatedClock, xstate_cjs.assertEvent = assertEvent, xstate_cjs.createMachine = createMachine, xstate_cjs.getInitialSnapshot = getInitialSnapshot, xstate_cjs.getNextSnapshot = getNextSnapshot, xstate_cjs.initialTransition = initialTransition, xstate_cjs.setup = setup, xstate_cjs.toPromise = toPromise, xstate_cjs.transition = transition, xstate_cjs.waitFor = waitFor, xstate_cjs;
54615
+ return xstate_cjs.createEmptyActor = actors_dist_xstateActors.createEmptyActor, xstate_cjs.fromCallback = actors_dist_xstateActors.fromCallback, xstate_cjs.fromEventObservable = actors_dist_xstateActors.fromEventObservable, xstate_cjs.fromObservable = actors_dist_xstateActors.fromObservable, xstate_cjs.fromPromise = actors_dist_xstateActors.fromPromise, xstate_cjs.fromTransition = actors_dist_xstateActors.fromTransition, xstate_cjs.Actor = guards_dist_xstateGuards.Actor, xstate_cjs.__unsafe_getAllOwnEventDescriptors = guards_dist_xstateGuards.getAllOwnEventDescriptors, xstate_cjs.and = guards_dist_xstateGuards.and, xstate_cjs.cancel = guards_dist_xstateGuards.cancel, xstate_cjs.createActor = guards_dist_xstateGuards.createActor, xstate_cjs.getStateNodes = guards_dist_xstateGuards.getStateNodes, xstate_cjs.interpret = guards_dist_xstateGuards.interpret, xstate_cjs.isMachineSnapshot = guards_dist_xstateGuards.isMachineSnapshot, xstate_cjs.matchesState = guards_dist_xstateGuards.matchesState, xstate_cjs.not = guards_dist_xstateGuards.not, xstate_cjs.or = guards_dist_xstateGuards.or, xstate_cjs.pathToStateValue = guards_dist_xstateGuards.pathToStateValue, xstate_cjs.raise = guards_dist_xstateGuards.raise, xstate_cjs.spawnChild = guards_dist_xstateGuards.spawnChild, xstate_cjs.stateIn = guards_dist_xstateGuards.stateIn, xstate_cjs.stop = guards_dist_xstateGuards.stop, xstate_cjs.stopChild = guards_dist_xstateGuards.stopChild, xstate_cjs.toObserver = guards_dist_xstateGuards.toObserver, xstate_cjs.StateMachine = StateMachine.StateMachine, xstate_cjs.StateNode = StateMachine.StateNode, xstate_cjs.assign = assign2.assign, xstate_cjs.SpecialTargets = log2.SpecialTargets, xstate_cjs.emit = log2.emit, xstate_cjs.enqueueActions = log2.enqueueActions, xstate_cjs.forwardTo = log2.forwardTo, xstate_cjs.log = log2.log, xstate_cjs.sendParent = log2.sendParent, xstate_cjs.sendTo = log2.sendTo, xstate_cjs.SimulatedClock = SimulatedClock, xstate_cjs.assertEvent = assertEvent, xstate_cjs.createMachine = createMachine, xstate_cjs.getInitialSnapshot = getInitialSnapshot, xstate_cjs.getNextSnapshot = getNextSnapshot, xstate_cjs.initialTransition = initialTransition, xstate_cjs.setup = setup, xstate_cjs.toPromise = toPromise, xstate_cjs.transition = transition, xstate_cjs.waitFor = waitFor, xstate_cjs;
54509
54616
  }
54510
54617
  var hasRequiredXstateReact_cjs;
54511
54618
  function requireXstateReact_cjs() {
@@ -61759,11 +61866,11 @@ const stringbool = (...args) => _stringbool({
61759
61866
  }, ...args);
61760
61867
  export {
61761
61868
  MotionConfig as $,
61762
- t$j as A,
61763
- t$l as B,
61869
+ t$k as A,
61870
+ t$m as B,
61764
61871
  t$d as C,
61765
- t$x as D,
61766
- t$y as E,
61872
+ t$y as D,
61873
+ t$z as E,
61767
61874
  e$7 as F,
61768
61875
  e$6 as G,
61769
61876
  defu as H,
@@ -61772,97 +61879,97 @@ export {
61772
61879
  getNodeDimensions as K,
61773
61880
  Background as L,
61774
61881
  BackgroundVariant as M,
61775
- n$i as N,
61882
+ n$j as N,
61776
61883
  useMantineColorScheme as O,
61777
61884
  index$2 as P,
61778
- atom as Q,
61779
- createSafeContext as R,
61780
- useIsomorphicLayoutEffect$2 as S,
61885
+ createSafeContext as Q,
61886
+ atom as R,
61887
+ useIsomorphicLayoutEffect$3 as S,
61781
61888
  useSyncedRef as T,
61782
- t$h as U,
61783
- t$e as V,
61889
+ t$i as U,
61890
+ t$f as V,
61784
61891
  MantineContext as W,
61785
61892
  MantineProvider as X,
61786
61893
  useMantineStyleNonce as Y,
61787
61894
  LazyMotion as Z,
61788
61895
  domMax as _,
61789
61896
  useCustomCompareEffect as a,
61790
- rem as a$,
61791
- createOptionalContext as a0,
61792
- deepEqual as a1,
61793
- e$b as a2,
61794
- t$s as a3,
61795
- t$i as a4,
61796
- t$n as a5,
61797
- t$o as a6,
61798
- useId$2 as a7,
61799
- ErrorBoundary as a8,
61800
- Notification as a9,
61801
- useMergedRef as aA,
61802
- HoverCard as aB,
61803
- HoverCardTarget as aC,
61804
- HoverCardDropdown as aD,
61805
- TooltipGroup as aE,
61806
- AnimatePresence as aF,
61807
- MotionDiv as aG,
61808
- isMacOs as aH,
61809
- useDebouncedValue as aI,
61810
- e$2 as aJ,
61811
- EdgeLabelRenderer as aK,
61812
- e$5 as aL,
61813
- useDebouncedState as aM,
61814
- NodeToolbar as aN,
61815
- Position as aO,
61816
- Handle as aP,
61817
- Badge as aQ,
61818
- CopyButton as aR,
61819
- SegmentedControl as aS,
61820
- MotionSpan as aT,
61821
- Portal as aU,
61822
- NavLink as aV,
61823
- ColorSwatch as aW,
61824
- Space as aX,
61825
- Divider as aY,
61826
- Stack as aZ,
61827
- CheckIcon as a_,
61828
- ScrollAreaAutosize as aa,
61829
- Code as ab,
61830
- Group as ac,
61831
- Button as ad,
61832
- getNodesBounds as ae,
61833
- getEdgePosition as af,
61834
- xstateReact_cjsExports as ag,
61835
- xstate_cjsExports as ah,
61836
- ActionIcon as ai,
61837
- MotionButton as aj,
61838
- ThemeIcon as ak,
61839
- Tooltip as al,
61840
- Breadcrumbs as am,
61841
- useHover$1 as an,
61842
- Popover as ao,
61843
- PopoverTarget as ap,
61844
- PopoverDropdown as aq,
61845
- Box as ar,
61846
- FloatingIndicator as as,
61847
- Text as at,
61848
- Flex as au,
61849
- UnstyledButton as av,
61850
- useDebouncedCallback as aw,
61851
- useUncontrolled as ax,
61852
- clampUseMovePosition as ay,
61853
- useMove as az,
61897
+ useUpdateEffect as a$,
61898
+ deepEqual as a0,
61899
+ e$b as a1,
61900
+ t$t as a2,
61901
+ t$j as a3,
61902
+ t$o as a4,
61903
+ t$p as a5,
61904
+ useId$2 as a6,
61905
+ ErrorBoundary as a7,
61906
+ Notification as a8,
61907
+ ScrollAreaAutosize as a9,
61908
+ HoverCard as aA,
61909
+ HoverCardTarget as aB,
61910
+ HoverCardDropdown as aC,
61911
+ TooltipGroup as aD,
61912
+ AnimatePresence as aE,
61913
+ MotionDiv as aF,
61914
+ isMacOs as aG,
61915
+ useDebouncedValue as aH,
61916
+ e$2 as aI,
61917
+ EdgeLabelRenderer as aJ,
61918
+ e$5 as aK,
61919
+ useDebouncedState as aL,
61920
+ NodeToolbar as aM,
61921
+ Position as aN,
61922
+ Handle as aO,
61923
+ Badge as aP,
61924
+ CopyButton as aQ,
61925
+ SegmentedControl as aR,
61926
+ MotionSpan as aS,
61927
+ Portal as aT,
61928
+ NavLink as aU,
61929
+ ColorSwatch as aV,
61930
+ Space as aW,
61931
+ Divider as aX,
61932
+ Stack as aY,
61933
+ CheckIcon as aZ,
61934
+ rem as a_,
61935
+ Code as aa,
61936
+ Group as ab,
61937
+ Button as ac,
61938
+ getNodesBounds as ad,
61939
+ getEdgePosition as ae,
61940
+ xstateReact_cjsExports as af,
61941
+ xstate_cjsExports as ag,
61942
+ ActionIcon as ah,
61943
+ MotionButton as ai,
61944
+ ThemeIcon as aj,
61945
+ Tooltip as ak,
61946
+ Breadcrumbs as al,
61947
+ useHover$1 as am,
61948
+ Popover as an,
61949
+ PopoverTarget as ao,
61950
+ PopoverDropdown as ap,
61951
+ Box as aq,
61952
+ FloatingIndicator as ar,
61953
+ Text as as,
61954
+ Flex as at,
61955
+ UnstyledButton as au,
61956
+ useDebouncedCallback as av,
61957
+ useUncontrolled as aw,
61958
+ clampUseMovePosition as ax,
61959
+ useMove as ay,
61960
+ useMergedRef as az,
61854
61961
  useStoreApi as b,
61855
61962
  useFocusWithin as b$,
61856
- useUpdateEffect as b0,
61857
- Slider as b1,
61858
- Paper as b2,
61859
- Menu as b3,
61860
- MenuTarget as b4,
61861
- MenuDropdown as b5,
61862
- MenuItem as b6,
61863
- useFocusTrap as b7,
61864
- useReducedMotionConfig as b8,
61865
- useTimeoutEffect as b9,
61963
+ Slider as b0,
61964
+ Paper as b1,
61965
+ Menu as b2,
61966
+ MenuTarget as b3,
61967
+ MenuDropdown as b4,
61968
+ MenuItem as b5,
61969
+ useFocusTrap as b6,
61970
+ useReducedMotionConfig as b7,
61971
+ useTimeoutEffect as b8,
61972
+ m as b9,
61866
61973
  t$2 as bA,
61867
61974
  t$3 as bB,
61868
61975
  ReactFlowProvider as bC,
@@ -61886,17 +61993,17 @@ export {
61886
61993
  animate as bU,
61887
61994
  e$8 as bV,
61888
61995
  VisuallyHidden as bW,
61889
- n$o as bX,
61996
+ n$p as bX,
61890
61997
  useWindowEvent as bY,
61891
61998
  FocusTrap as bZ,
61892
61999
  Title as b_,
61893
- m as ba,
61894
- ReactRemoveScroll as bb,
61895
- useThrottledCallback as bc,
61896
- createScopedKeydownHandler as bd,
61897
- Input as be,
61898
- t$4 as bf,
61899
- Highlight as bg,
62000
+ ReactRemoveScroll as ba,
62001
+ useThrottledCallback as bb,
62002
+ createScopedKeydownHandler as bc,
62003
+ Input as bd,
62004
+ t$4 as be,
62005
+ Highlight as bf,
62006
+ useMountEffect as bg,
61900
62007
  e$9 as bh,
61901
62008
  LayoutGroup as bi,
61902
62009
  useTree as bj,
@@ -61904,12 +62011,12 @@ export {
61904
62011
  Tree as bl,
61905
62012
  getBezierPath as bm,
61906
62013
  DefaultMap as bn,
61907
- t$m as bo,
61908
- t$k as bp,
62014
+ t$n as bo,
62015
+ t$l as bp,
61909
62016
  e$1 as bq,
61910
- t$f as br,
61911
- t$u as bs,
61912
- n$p as bt,
62017
+ t$g as br,
62018
+ t$v as bs,
62019
+ n$q as bt,
61913
62020
  n$c as bu,
61914
62021
  r$8 as bv,
61915
62022
  t$c as bw,
@@ -61917,7 +62024,7 @@ export {
61917
62024
  dagre as by,
61918
62025
  t$6 as bz,
61919
62026
  useStore$1 as c,
61920
- useInViewport as c$,
62027
+ useParams as c$,
61921
62028
  useCombobox as c0,
61922
62029
  ComboboxOption as c1,
61923
62030
  Combobox as c2,
@@ -61939,22 +62046,22 @@ export {
61939
62046
  mix as cI,
61940
62047
  toHex as cJ,
61941
62048
  scale as cK,
61942
- useRouter as cL,
61943
- isNotFound as cM,
61944
- Container as cN,
61945
- Link as cO,
61946
- useNavigate as cP,
61947
- createRootRouteWithContext as cQ,
61948
- stripSearchParams as cR,
61949
- Outlet as cS,
61950
- createFileRoute as cT,
61951
- useDocumentTitle as cU,
61952
- Loader as cV,
61953
- useStore as cW,
61954
- Navigate as cX,
61955
- t$1 as cY,
61956
- useParams as cZ,
61957
- SimpleGrid as c_,
62049
+ e$4 as cL,
62050
+ t$e as cM,
62051
+ useRouter as cN,
62052
+ isNotFound as cO,
62053
+ Container as cP,
62054
+ Link as cQ,
62055
+ useNavigate as cR,
62056
+ createRootRouteWithContext as cS,
62057
+ stripSearchParams as cT,
62058
+ Outlet as cU,
62059
+ createFileRoute as cV,
62060
+ useDocumentTitle as cW,
62061
+ Loader as cX,
62062
+ useStore as cY,
62063
+ Navigate as cZ,
62064
+ t$1 as c_,
61958
62065
  autoUpdate as ca,
61959
62066
  computePosition as cb,
61960
62067
  offset$1 as cc,
@@ -61963,11 +62070,11 @@ export {
61963
62070
  hide$1 as cf,
61964
62071
  useLocalStorage as cg,
61965
62072
  Card as ch,
61966
- n$u as ci,
62073
+ n$v as ci,
61967
62074
  useRerender as cj,
61968
62075
  d3line as ck,
61969
62076
  curveCatmullRomOpen as cl,
61970
- t$g as cm,
62077
+ t$h as cm,
61971
62078
  useDebouncedEffect as cn,
61972
62079
  getSmoothStepPath as co,
61973
62080
  useTimeout as cp,
@@ -61982,46 +62089,48 @@ export {
61982
62089
  t$5 as cy,
61983
62090
  getHotkeyHandler as cz,
61984
62091
  useCallbackRef as d,
61985
- notFound as d0,
61986
- useComputedColorScheme as d1,
61987
- onMount as d2,
61988
- Drawer as d3,
61989
- Select as d4,
61990
- ModalRoot as d5,
61991
- ModalOverlay as d6,
61992
- ModalContent as d7,
61993
- ModalBody as d8,
61994
- useMatches as d9,
61995
- useMantineTheme as da,
61996
- useMediaQuery as db,
61997
- useDisclosure as dc,
61998
- useParentMatches as dd,
61999
- MenuLabel as de,
62000
- useSearch as df,
62001
- LoadingOverlay as dg,
62002
- toBlob as dh,
62003
- useAsync as di,
62004
- PanelGroup as dj,
62005
- Panel as dk,
62006
- PanelResizeHandle as dl,
62007
- Burger as dm,
62008
- RouterProvider as dn,
62009
- createRouter as dp,
62010
- createHashHistory as dq,
62011
- createBrowserHistory as dr,
62012
- createTheme as ds,
62013
- object as dt,
62014
- literal as du,
62015
- stringbool as dv,
62016
- string as dw,
62017
- formatError as dx,
62092
+ SimpleGrid as d0,
62093
+ useInViewport as d1,
62094
+ notFound as d2,
62095
+ useComputedColorScheme as d3,
62096
+ onMount as d4,
62097
+ Drawer as d5,
62098
+ Select as d6,
62099
+ ModalRoot as d7,
62100
+ ModalOverlay as d8,
62101
+ ModalContent as d9,
62102
+ ModalBody as da,
62103
+ useMatches as db,
62104
+ useMantineTheme as dc,
62105
+ useMediaQuery as dd,
62106
+ useDisclosure as de,
62107
+ useParentMatches as df,
62108
+ MenuLabel as dg,
62109
+ useSearch as dh,
62110
+ LoadingOverlay as di,
62111
+ toBlob as dj,
62112
+ useAsync as dk,
62113
+ PanelGroup as dl,
62114
+ Panel as dm,
62115
+ PanelResizeHandle as dn,
62116
+ Burger as dp,
62117
+ RouterProvider as dq,
62118
+ createRouter as dr,
62119
+ createHashHistory as ds,
62120
+ createBrowserHistory as dt,
62121
+ createTheme as du,
62122
+ object as dv,
62123
+ literal as dw,
62124
+ stringbool as dx,
62125
+ string as dy,
62126
+ formatError as dz,
62018
62127
  useReactFlow as e,
62019
62128
  useInternalNode as f,
62020
62129
  e$3 as g,
62021
62130
  compare$1 as h,
62022
62131
  e$a as i,
62023
62132
  e as j,
62024
- t$q as k,
62133
+ t$r as k,
62025
62134
  setExports as l,
62026
62135
  unified as m,
62027
62136
  remarkGfm as n,
@@ -62030,7 +62139,7 @@ export {
62030
62139
  rehypeSanitize as q,
62031
62140
  remarkParse as r,
62032
62141
  shallowEqual as s,
62033
- t$v as t,
62142
+ t$w as t,
62034
62143
  useFirstMountState as u,
62035
62144
  rehypeStringify as v,
62036
62145
  toString as w,