@snowcone-app/canvas 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/ERROR_CONTRACT.md +13 -0
  2. package/dist/{CanvasRenderer-_lFoIoz5.js → CanvasRenderer-BEf0hXeF.js} +4 -4
  3. package/dist/{CanvasRenderer-_lFoIoz5.js.map → CanvasRenderer-BEf0hXeF.js.map} +1 -1
  4. package/dist/{CanvasStateV1-BMxr6xb8.js → CanvasStateV1-BDSyYo4A.js} +868 -843
  5. package/dist/{CanvasStateV1-BMxr6xb8.js.map → CanvasStateV1-BDSyYo4A.js.map} +1 -1
  6. package/dist/ContextualToolbars-C3D_6sep.js +5960 -0
  7. package/dist/ContextualToolbars-C3D_6sep.js.map +1 -0
  8. package/dist/{EditorCanvasImpl-BNz8TPFs.js → EditorCanvasImpl-DXeBz2CX.js} +8 -8
  9. package/dist/{EditorCanvasImpl-BNz8TPFs.js.map → EditorCanvasImpl-DXeBz2CX.js.map} +1 -1
  10. package/dist/{ExportManager-B8Td7uR5.js → ExportManager-DUdis6se.js} +794 -536
  11. package/dist/ExportManager-DUdis6se.js.map +1 -0
  12. package/dist/{FontAnalyzer-D4Sg-P6_.js → FontAnalyzer-DKG5JK0x.js} +823 -808
  13. package/dist/FontAnalyzer-DKG5JK0x.js.map +1 -0
  14. package/dist/{ImagePanel-CN2Bu3hf.js → ImagePanel-CBgGqmVV.js} +53 -53
  15. package/dist/{ImagePanel-CN2Bu3hf.js.map → ImagePanel-CBgGqmVV.js.map} +1 -1
  16. package/dist/SnowconeCanvas-BWPBngvI.js +1192 -0
  17. package/dist/SnowconeCanvas-BWPBngvI.js.map +1 -0
  18. package/dist/{UnifiedFontService-CgYnYTj7.js → UnifiedFontService-Co9tQ59z.js} +869 -826
  19. package/dist/UnifiedFontService-Co9tQ59z.js.map +1 -0
  20. package/dist/advanced.mjs +14 -14
  21. package/dist/api/embed.d.ts +2 -0
  22. package/dist/api/stable.d.ts +2 -0
  23. package/dist/components/CanvasContextMenu.d.ts +15 -0
  24. package/dist/components/CanvasEditor/hooks/useCanvasInteraction.d.ts +27 -0
  25. package/dist/components/CanvasEditor.d.ts +8 -0
  26. package/dist/components/embed/SnowconeCanvas.d.ts +13 -0
  27. package/dist/components/embed/kernel.d.ts +8 -0
  28. package/dist/components/ui/icons.d.ts +2 -0
  29. package/dist/contexts/CanvasServicesContext.d.ts +17 -0
  30. package/dist/contexts/EditorContext.d.ts +7 -0
  31. package/dist/{custom-icons-B5TRC1Ed.js → custom-icons-BIaRovwG.js} +2 -2
  32. package/dist/{custom-icons-B5TRC1Ed.js.map → custom-icons-BIaRovwG.js.map} +1 -1
  33. package/dist/{design-builder-COj0zkxu.js → design-builder-JYLO_Hyi.js} +2 -2
  34. package/dist/{design-builder-COj0zkxu.js.map → design-builder-JYLO_Hyi.js.map} +1 -1
  35. package/dist/{editorErrors-CCvoKj_P.js → editorErrors-WzaNxU1Y.js} +181 -194
  36. package/dist/editorErrors-WzaNxU1Y.js.map +1 -0
  37. package/dist/{embed-BTRtoktw.js → embed-Csez1hui.js} +113 -112
  38. package/dist/{embed-BTRtoktw.js.map → embed-Csez1hui.js.map} +1 -1
  39. package/dist/embed.mjs +51 -45
  40. package/dist/embed.mjs.map +1 -1
  41. package/dist/errors/editorError.d.ts +8 -0
  42. package/dist/{guards-uQtEQJbs.js → guards-BSoX73yg.js} +2 -2
  43. package/dist/{guards-uQtEQJbs.js.map → guards-BSoX73yg.js.map} +1 -1
  44. package/dist/hooks/useKeyboardShortcuts.d.ts +15 -2
  45. package/dist/hooks/useLayers.d.ts +2 -0
  46. package/dist/index.mjs +42 -37
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/internals.mjs +47 -47
  49. package/dist/state/CanvasStateV1.d.ts +31 -3
  50. package/dist/state/index.d.ts +2 -2
  51. package/dist/{template-fields-BLRp84Ny.js → template-fields-DYPW7bVU.js} +40 -40
  52. package/dist/{template-fields-BLRp84Ny.js.map → template-fields-DYPW7bVU.js.map} +1 -1
  53. package/dist/testing.mjs +13 -13
  54. package/dist/{usePieceGuideBundle-CTQszfKA.js → usePieceGuideBundle-CRLY2iQa.js} +2 -2
  55. package/dist/{usePieceGuideBundle-CTQszfKA.js.map → usePieceGuideBundle-CRLY2iQa.js.map} +1 -1
  56. package/dist/utils/custom-fonts.d.ts +99 -0
  57. package/dist/validation-BGEl9rrE.js +8686 -0
  58. package/dist/validation-BGEl9rrE.js.map +1 -0
  59. package/dist/workers/export-protocol.d.ts +13 -0
  60. package/dist/workers/export-worker.bundle.string.d.ts +1 -1
  61. package/example/package.json +1 -1
  62. package/package.json +1 -1
  63. package/dist/ContextualToolbars-0jWvnQgp.js +0 -5833
  64. package/dist/ContextualToolbars-0jWvnQgp.js.map +0 -1
  65. package/dist/ExportManager-B8Td7uR5.js.map +0 -1
  66. package/dist/FontAnalyzer-D4Sg-P6_.js.map +0 -1
  67. package/dist/SnowconeCanvas-CR_LdRFP.js +0 -1173
  68. package/dist/SnowconeCanvas-CR_LdRFP.js.map +0 -1
  69. package/dist/UnifiedFontService-CgYnYTj7.js.map +0 -1
  70. package/dist/editorErrors-CCvoKj_P.js.map +0 -1
  71. package/dist/validation-eCebhplp.js +0 -8402
  72. package/dist/validation-eCebhplp.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { jsx as f, jsxs as j, Fragment as nn } from "react/jsx-runtime";
2
- import * as z from "react";
3
- import te, { useRef as G, useState as B, useCallback as N, useMemo as q, useEffect as W, forwardRef as In, createElement as yn, useLayoutEffect as Nn, memo as Go, useReducer as Wo, useContext as je, createContext as Xe, cloneElement as _o, useId as Lr, useSyncExternalStore as Rr } from "react";
4
- import { u as zn, h as qo, g as Pt, r as Yo, j as Ko, k as Tr, d as Xo } from "./editorErrors-CCvoKj_P.js";
5
- import { G as Ie, c as ot, C as rn } from "./FontAnalyzer-D4Sg-P6_.js";
6
- import { g as Jo, I as on, E as sn } from "./ExportManager-B8Td7uR5.js";
1
+ import { jsx as f, jsxs as P, Fragment as nn } from "react/jsx-runtime";
2
+ import * as O from "react";
3
+ import te, { useRef as G, useState as B, useCallback as N, useMemo as q, useEffect as W, forwardRef as In, createElement as yn, useLayoutEffect as Nn, memo as Go, useReducer as Wo, useContext as $e, createContext as Xe, cloneElement as _o, useId as Lr, useSyncExternalStore as Rr } from "react";
4
+ import { u as zn, g as qo, r as Yo, h as Tr, d as Ko } from "./editorErrors-WzaNxU1Y.js";
5
+ import { G as Oe, c as ot, E as Pt, D as Xo, H as rn } from "./FontAnalyzer-DKG5JK0x.js";
6
+ import { g as Jo, I as on, E as sn } from "./ExportManager-DUdis6se.js";
7
7
  import { createPortal as On, unstable_batchedUpdates as Nt } from "react-dom";
8
8
  import { clsx as Ir } from "clsx";
9
9
  import { extendTailwindMerge as Nr } from "tailwind-merge";
@@ -476,6 +476,11 @@ const Zo = {
476
476
  width: 24,
477
477
  height: 24
478
478
  },
479
+ "lucide:upload": {
480
+ body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>',
481
+ width: 24,
482
+ height: 24
483
+ },
479
484
  "lucide:venetian-mask": {
480
485
  body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M18 11c-1.5 0-2.5.5-3 2"/><path d="M4 6a2 2 0 0 0-2 2v4a5 5 0 0 0 5 5a8 8 0 0 1 5 2a8 8 0 0 1 5-2a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3a8 8 0 0 0-5 2a8 8 0 0 0-5-2z"/><path d="M6 11c1.5 0 2.5.5 3 2"/></g>',
481
486
  width: 24,
@@ -529,7 +534,7 @@ function Pl() {
529
534
  an = !1;
530
535
  }));
531
536
  }
532
- const ie = ot("Layers"), ti = 150;
537
+ const ne = ot("Layers"), ti = 150;
533
538
  async function er(e, t = 64, n = "transparent") {
534
539
  try {
535
540
  const r = Jo();
@@ -540,15 +545,15 @@ async function er(e, t = 64, n = "transparent") {
540
545
  backgroundColor: n
541
546
  }) || null;
542
547
  } catch (r) {
543
- return ie.error("Failed to generate preview:", r), null;
548
+ return ne.error("Failed to generate preview:", r), null;
544
549
  }
545
550
  }
546
551
  function Fr(e, t, n, r, o, i = 0, s = null) {
547
552
  return (i > 0 ? e : e.filter((l) => {
548
553
  const c = l.parentId ?? null;
549
- return l instanceof Ie, c === null;
554
+ return l instanceof Oe, c === null;
550
555
  })).map((l) => {
551
- const c = l instanceof Ie, u = t === l.id || n.includes(l.id), d = {
556
+ const c = l instanceof Oe, u = t === l.id || n.includes(l.id), d = {
552
557
  id: l.id,
553
558
  name: l.name || `Layer ${l.id.slice(0, 8)}`,
554
559
  type: l.transformType,
@@ -563,7 +568,7 @@ function Fr(e, t, n, r, o, i = 0, s = null) {
563
568
  await o(l.id);
564
569
  }
565
570
  };
566
- return c && l instanceof Ie && (d.children = Fr(
571
+ return c && l instanceof Oe && (d.children = Fr(
567
572
  l.children,
568
573
  t,
569
574
  n,
@@ -581,7 +586,7 @@ function Pr(e) {
581
586
  return t;
582
587
  }
583
588
  function ni(e = {}) {
584
- var ce;
589
+ var ze;
585
590
  const {
586
591
  artboardId: t,
587
592
  includeHidden: n = !0,
@@ -597,279 +602,307 @@ function ni(e = {}) {
597
602
  handleElementUpdate: d,
598
603
  setMultiSelection: h,
599
604
  executeAddElement: g,
600
- executeRemoveElement: x,
605
+ executeRemoveElement: C,
601
606
  executeReorderElement: w
602
- } = zn(), p = G(/* @__PURE__ */ new Map()), [m, E] = B(0), A = c.getActiveArtboardId(), D = t !== void 0 ? t : A, T = D ? (ce = c.getArtboard) == null ? void 0 : ce.call(c, D) : null, y = o ?? (T == null ? void 0 : T.backgroundColor) ?? "transparent", S = N(async (C) => {
603
- const k = s.find((O) => O.id === C);
607
+ } = zn(), p = G(/* @__PURE__ */ new Map()), [m, E] = B(0), A = c.getActiveArtboardId(), D = t !== void 0 ? t : A, T = D ? (ze = c.getArtboard) == null ? void 0 : ze.call(c, D) : null, y = o ?? (T == null ? void 0 : T.backgroundColor) ?? "transparent", S = N(async (b) => {
608
+ const k = s.find((z) => z.id === b);
604
609
  if (!k) return;
605
610
  const I = await er(k, r, y);
606
- p.current.set(C, I), E((O) => O + 1);
611
+ p.current.set(b, I), E((z) => z + 1);
607
612
  }, [s, r, y]), v = q(() => {
608
- let C = s;
613
+ let b = s;
609
614
  if (D) {
610
615
  const k = c.getElementsOnArtboard(D);
611
- C = C.filter((I) => k.includes(I.id));
616
+ b = b.filter((I) => k.includes(I.id));
612
617
  }
613
- return n || (C = C.filter((k) => k.visible !== !1)), C;
618
+ return n || (b = b.filter((k) => k.visible !== !1)), b;
614
619
  }, [s, D, n, c]), L = q(() => Fr(
615
620
  v,
616
621
  a,
617
622
  l,
618
623
  p.current,
619
624
  S
620
- ), [v, a, l, S, m]), b = q(() => Pr(L), [L]), M = q(() => b.filter((C) => C.isSelected), [b]), R = N((C, k = !1) => {
621
- k ? l.includes(C) ? h(l.filter((I) => I !== C)) : h([...l, C]) : u(C);
622
- }, [l, h, u]), F = N((C) => {
623
- h(C);
624
- }, [h]), X = N(() => {
625
+ ), [v, a, l, S, m]), x = q(() => Pr(L), [L]), M = q(() => x.filter((b) => b.isSelected), [x]), R = N((b, k = !1) => {
626
+ k ? l.includes(b) ? h(l.filter((I) => I !== b)) : h([...l, b]) : u(b);
627
+ }, [l, h, u]), F = N((b) => {
628
+ h(b);
629
+ }, [h]), J = N(() => {
625
630
  u(null), h([]);
626
- }, [u, h]), pe = N((C) => {
627
- const k = s.find((O) => O.id === C);
631
+ }, [u, h]), pe = N((b) => {
632
+ const k = s.find((z) => z.id === b);
628
633
  if (!k) return;
629
634
  const I = k.clone();
630
635
  I.visible = !(k.visible ?? !0), d(I);
631
- }, [s, d]), J = N((C) => {
632
- const k = s.find((O) => O.id === C);
636
+ }, [s, d]), Q = N((b) => {
637
+ const k = s.find((z) => z.id === b);
633
638
  if (!k) return;
634
639
  const I = k.clone();
635
640
  I.locked = !(k.locked ?? !1), d(I);
636
- }, [s, d]), re = N((C, k) => {
637
- const I = s.find((K) => K.id === C);
641
+ }, [s, d]), oe = N((b, k) => {
642
+ const I = s.find((X) => X.id === b);
638
643
  if (!I) return;
639
- const O = I.clone();
640
- O.name = k, d(O);
641
- }, [s, d]), Y = N((C) => {
642
- const k = s.find((I) => I.id === C);
644
+ const z = I.clone();
645
+ z.name = k, d(z);
646
+ }, [s, d]), Y = N((b) => {
647
+ const k = s.find((I) => I.id === b);
643
648
  if (!k) {
644
- ie.warn(`Element ${C} not found for deletion`);
649
+ ne.warn(`Element ${b} not found for deletion`);
645
650
  return;
646
651
  }
647
- x(k), (a === C || l.includes(C)) && (u(null), h(l.filter((I) => I !== C)));
648
- }, [s, x, a, l, u, h]), ee = N((C) => {
649
- const k = s.find((ae) => ae.id === C);
652
+ C(k), (a === b || l.includes(b)) && (u(null), h(l.filter((I) => I !== b)));
653
+ }, [s, C, a, l, u, h]), ee = N((b) => {
654
+ const k = s.find((ue) => ue.id === b);
650
655
  if (!k) {
651
- ie.warn(`Element ${C} not found for duplication`);
656
+ ne.warn(`Element ${b} not found for duplication`);
652
657
  return;
653
658
  }
654
- const O = k.clone().toJSON();
655
- delete O.id;
656
- const K = k.constructor, P = new K(O);
657
- P.x = k.x + 20, P.y = k.y + 20;
658
- const Z = c.getArtboardIdForElement(C);
659
- if (!Z) {
660
- ie.warn(`Element ${C} not associated with any artboard`);
659
+ const z = k.clone().toJSON();
660
+ delete z.id;
661
+ const X = k.constructor, $ = new X(z);
662
+ $.x = k.x + 20, $.y = k.y + 20;
663
+ const K = c.getArtboardIdForElement(b);
664
+ if (!K) {
665
+ ne.warn(`Element ${b} not associated with any artboard`);
661
666
  return;
662
667
  }
663
- g(P, Z, C), u(P.id);
664
- }, [s, c, g, u]), ge = N((C, k) => {
665
- if (C === k) return;
666
- if (C < 0 || C >= v.length) {
667
- ie.warn(`Invalid fromIndex: ${C}`);
668
+ g($, K, b), u($.id);
669
+ }, [s, c, g, u]), ge = N((b, k) => {
670
+ if (b === k) return;
671
+ if (b < 0 || b >= v.length) {
672
+ ne.warn(`Invalid fromIndex: ${b}`);
668
673
  return;
669
674
  }
670
675
  if (k < 0 || k >= v.length) {
671
- ie.warn(`Invalid toIndex: ${k}`);
676
+ ne.warn(`Invalid toIndex: ${k}`);
672
677
  return;
673
678
  }
674
- const I = v[C], O = v[k], K = C < k ? "after" : "before";
675
- w(I.id, O.id, K);
676
- }, [v, w]), we = N((C) => {
677
- const k = b.findIndex((I) => I.id === C);
679
+ const I = v[b], z = v[k], X = b < k ? "after" : "before";
680
+ w(I.id, z.id, X);
681
+ }, [v, w]), xe = N((b) => {
682
+ const k = x.findIndex((I) => I.id === b);
678
683
  if (k < 0) {
679
- ie.warn(`Layer ${C} not found`);
684
+ ne.warn(`Layer ${b} not found`);
680
685
  return;
681
686
  }
682
- k >= b.length - 1 || ge(k, k + 1);
683
- }, [b, ge]), oe = N((C) => {
684
- const k = b.findIndex((I) => I.id === C);
687
+ k >= x.length - 1 || ge(k, k + 1);
688
+ }, [x, ge]), ie = N((b) => {
689
+ const k = x.findIndex((I) => I.id === b);
685
690
  if (k < 0) {
686
- ie.warn(`Layer ${C} not found`);
691
+ ne.warn(`Layer ${b} not found`);
687
692
  return;
688
693
  }
689
694
  k <= 0 || ge(k, k - 1);
690
- }, [b, ge]), ue = N((C) => {
691
- if (C.length < 2) {
692
- ie.warn("Need at least 2 elements to create a group");
695
+ }, [x, ge]), ce = N((b) => {
696
+ const k = v[v.length - 1];
697
+ if (!k) {
698
+ ne.warn(`Layer ${b} not found`);
699
+ return;
700
+ }
701
+ if (k.id !== b) {
702
+ if (!v.some((I) => I.id === b)) {
703
+ ne.warn(`Layer ${b} not found`);
704
+ return;
705
+ }
706
+ w(b, k.id, "after");
707
+ }
708
+ }, [v, w]), Pe = N((b) => {
709
+ const k = v[0];
710
+ if (!k) {
711
+ ne.warn(`Layer ${b} not found`);
712
+ return;
713
+ }
714
+ if (k.id !== b) {
715
+ if (!v.some((I) => I.id === b)) {
716
+ ne.warn(`Layer ${b} not found`);
717
+ return;
718
+ }
719
+ w(b, k.id, "before");
720
+ }
721
+ }, [v, w]), Ne = N((b) => {
722
+ if (b.length < 2) {
723
+ ne.warn("Need at least 2 elements to create a group");
693
724
  return;
694
725
  }
695
726
  const k = s.filter(
696
- (ne) => C.includes(ne.id) && ne.transformType !== "shape"
727
+ (re) => b.includes(re.id) && re.transformType !== "shape"
697
728
  );
698
729
  if (k.length < 2) {
699
- ie.warn("Need at least 2 groupable elements (shapes cannot be grouped)");
730
+ ne.warn("Need at least 2 groupable elements (shapes cannot be grouped)");
700
731
  return;
701
732
  }
702
- const I = k.map((ne) => c.getArtboardIdForElement(ne.id)), O = [...new Set(I)];
703
- if (O.length !== 1 || !O[0]) {
704
- ie.warn("All elements must be on the same artboard to group");
733
+ const I = k.map((re) => c.getArtboardIdForElement(re.id)), z = [...new Set(I)];
734
+ if (z.length !== 1 || !z[0]) {
735
+ ne.warn("All elements must be on the same artboard to group");
705
736
  return;
706
737
  }
707
- const K = O[0], P = k.map((ne) => ne.getBoundingBox()).filter(Boolean);
708
- if (P.length === 0) {
709
- ie.warn("Could not calculate bounding boxes for group");
738
+ const X = z[0], $ = k.map((re) => re.getBoundingBox()).filter(Boolean);
739
+ if ($.length === 0) {
740
+ ne.warn("Could not calculate bounding boxes for group");
710
741
  return;
711
742
  }
712
- const Z = Math.min(...P.map((ne) => ne.x)), ae = Math.min(...P.map((ne) => ne.y)), me = new Ie({
713
- x: Z,
714
- y: ae
743
+ const K = Math.min(...$.map((re) => re.x)), ue = Math.min(...$.map((re) => re.y)), Le = new Oe({
744
+ x: K,
745
+ y: ue
715
746
  });
716
- me.children = k.map((ne) => {
717
- const He = ne.clone();
718
- return He.x = ne.x - Z, He.y = ne.y - ae, He;
719
- }), k.forEach((ne) => x(ne)), g(me, K), u(me.id), h([]);
720
- }, [s, c, x, g, u, h]), ze = N((C) => {
721
- const k = s.find((P) => P.id === C);
747
+ Le.children = k.map((re) => {
748
+ const Se = re.clone();
749
+ return Se.x = re.x - K, Se.y = re.y - ue, Se;
750
+ }), k.forEach((re) => C(re)), g(Le, X), u(Le.id), h([]);
751
+ }, [s, c, C, g, u, h]), ae = N((b) => {
752
+ const k = s.find(($) => $.id === b);
722
753
  if (!k) {
723
- ie.warn(`Element ${C} not found for ungrouping`);
754
+ ne.warn(`Element ${b} not found for ungrouping`);
724
755
  return;
725
756
  }
726
- if (!(k instanceof Ie)) {
727
- ie.warn(`Element ${C} is not a group`);
757
+ if (!(k instanceof Oe)) {
758
+ ne.warn(`Element ${b} is not a group`);
728
759
  return;
729
760
  }
730
761
  const I = k;
731
762
  if (!I.children || I.children.length === 0) {
732
- ie.warn(`Group ${C} has no children`);
763
+ ne.warn(`Group ${b} has no children`);
733
764
  return;
734
765
  }
735
- const O = c.getArtboardIdForElement(C);
736
- if (!O) {
737
- ie.warn(`Group ${C} not associated with any artboard`);
766
+ const z = c.getArtboardIdForElement(b);
767
+ if (!z) {
768
+ ne.warn(`Group ${b} not associated with any artboard`);
738
769
  return;
739
770
  }
740
- const K = I.children.map((P) => {
741
- const Z = P.clone();
742
- return Z.x = P.x + I.x, Z.y = P.y + I.y, Z;
771
+ const X = I.children.map(($) => {
772
+ const K = $.clone();
773
+ return K.x = $.x + I.x, K.y = $.y + I.y, K;
743
774
  });
744
- x(I), K.forEach((P) => g(P, O)), K.length > 0 && u(K[0].id), h([]);
745
- }, [s, c, x, g, u, h]), Se = N(async (C = r) => {
775
+ C(I), X.forEach(($) => g($, z)), X.length > 0 && u(X[0].id), h([]);
776
+ }, [s, c, C, g, u, h]), De = N(async (b = r) => {
746
777
  const k = async (I) => {
747
- for (const O of I) {
748
- const K = await er(O, C, y);
749
- p.current.set(O.id, K), O instanceof Ie && O.children.length > 0 && await k(O.children);
778
+ for (const z of I) {
779
+ const X = await er(z, b, y);
780
+ p.current.set(z.id, X), z instanceof Oe && z.children.length > 0 && await k(z.children);
750
781
  }
751
782
  };
752
783
  await k(v), E((I) => I + 1);
753
784
  }, [r, y, v]);
754
785
  W(() => {
755
786
  if (!i) return;
756
- const C = setTimeout(() => {
757
- Se();
787
+ const b = setTimeout(() => {
788
+ De();
758
789
  }, ti);
759
- return () => clearTimeout(C);
760
- }, [i, Se]);
761
- const le = N(() => {
790
+ return () => clearTimeout(b);
791
+ }, [i, De]);
792
+ const Z = N(() => {
762
793
  p.current.clear();
763
- }, []), Oe = N(
764
- (C, k, I) => {
765
- w(C, k, I);
794
+ }, []), se = N(
795
+ (b, k, I) => {
796
+ w(b, k, I);
766
797
  },
767
798
  [w]
768
- ), Q = N(
769
- (C, k, I, O) => {
770
- const K = s.find((Te) => Te.id === O);
771
- if (!K || !(K instanceof Ie)) {
772
- ie.warn(`Group ${O} not found for reorder`);
799
+ ), j = N(
800
+ (b, k, I, z) => {
801
+ const X = s.find((ye) => ye.id === z);
802
+ if (!X || !(X instanceof Oe)) {
803
+ ne.warn(`Group ${z} not found for reorder`);
773
804
  return;
774
805
  }
775
- const P = K.clone(), Z = P.children.findIndex((Te) => Te.id === C), ae = P.children.findIndex((Te) => Te.id === k);
776
- if (Z === -1 || ae === -1) {
777
- ie.warn(`Children not found in group for reorder: ${C}, ${k}`);
806
+ const $ = X.clone(), K = $.children.findIndex((ye) => ye.id === b), ue = $.children.findIndex((ye) => ye.id === k);
807
+ if (K === -1 || ue === -1) {
808
+ ne.warn(`Children not found in group for reorder: ${b}, ${k}`);
778
809
  return;
779
810
  }
780
- const [me] = P.children.splice(Z, 1), ne = P.children.findIndex((Te) => Te.id === k), He = I === "before" ? ne : ne + 1;
781
- P.children.splice(He, 0, me), d(P);
811
+ const [Le] = $.children.splice(K, 1), re = $.children.findIndex((ye) => ye.id === k), Se = I === "before" ? re : re + 1;
812
+ $.children.splice(Se, 0, Le), d($);
782
813
  },
783
814
  [s, d]
784
- ), se = N(
785
- (C) => {
815
+ ), ke = N(
816
+ (b) => {
786
817
  for (const k of s) {
787
- if (k.id === C) return k;
788
- if (k instanceof Ie) {
789
- const I = k.children.find((O) => O.id === C);
818
+ if (k.id === b) return k;
819
+ if (k instanceof Oe) {
820
+ const I = k.children.find((z) => z.id === b);
790
821
  if (I) return I;
791
822
  }
792
823
  }
793
824
  return null;
794
825
  },
795
826
  [s]
796
- ), H = N(
797
- (C) => {
827
+ ), ve = N(
828
+ (b) => {
798
829
  for (const k of s)
799
- if (k instanceof Ie && k.children.some((I) => I.id === C))
830
+ if (k instanceof Oe && k.children.some((I) => I.id === b))
800
831
  return k;
801
832
  return null;
802
833
  },
803
834
  [s]
804
- ), xe = N(
805
- (C, k) => {
806
- const I = s.find((ae) => ae.id === C), O = s.find((ae) => ae.id === k);
807
- if (!I || !O || !(O instanceof Ie)) {
808
- ie.warn(`Cannot add ${C} to group ${k}`);
835
+ ), Je = N(
836
+ (b, k) => {
837
+ const I = s.find((ue) => ue.id === b), z = s.find((ue) => ue.id === k);
838
+ if (!I || !z || !(z instanceof Oe)) {
839
+ ne.warn(`Cannot add ${b} to group ${k}`);
809
840
  return;
810
841
  }
811
- if (!c.getArtboardIdForElement(C)) return;
812
- const P = O.clone(), Z = I.clone();
813
- Z.x = I.x, Z.y = I.y, P.addChild(Z), x(I), d(P);
842
+ if (!c.getArtboardIdForElement(b)) return;
843
+ const $ = z.clone(), K = I.clone();
844
+ K.x = I.x, K.y = I.y, $.addChild(K), C(I), d($);
814
845
  },
815
- [s, c, x, d]
816
- ), ke = N(
817
- (C, k, I) => {
818
- const O = H(C);
819
- if (!O) {
820
- ie.warn(`Element ${C} is not inside a group`);
846
+ [s, c, C, d]
847
+ ), de = N(
848
+ (b, k, I) => {
849
+ const z = ve(b);
850
+ if (!z) {
851
+ ne.warn(`Element ${b} is not inside a group`);
821
852
  return;
822
853
  }
823
- const K = O.children.find((me) => me.id === C);
824
- if (!K) return;
825
- const P = c.getArtboardIdForElement(O.id);
826
- if (!P) return;
827
- const Z = K.clone(), ae = O.clone();
828
- ae.removeChild(C), d(ae), k && I ? g(Z, P, I === "after" ? k : void 0, I === "before" ? k : void 0) : g(Z, P, void 0, O.id), u(Z.id);
854
+ const X = z.children.find((Le) => Le.id === b);
855
+ if (!X) return;
856
+ const $ = c.getArtboardIdForElement(z.id);
857
+ if (!$) return;
858
+ const K = X.clone(), ue = z.clone();
859
+ ue.removeChild(b), d(ue), k && I ? g(K, $, I === "after" ? k : void 0, I === "before" ? k : void 0) : g(K, $, void 0, z.id), u(K.id);
829
860
  },
830
- [H, c, x, d, g, u]
831
- ), Je = N(() => {
832
- const C = c.getActiveArtboardId();
833
- if (!C) {
834
- ie.warn("No active artboard for creating a group");
861
+ [ve, c, C, d, g, u]
862
+ ), Be = N(() => {
863
+ const b = c.getActiveArtboardId();
864
+ if (!b) {
865
+ ne.warn("No active artboard for creating a group");
835
866
  return;
836
867
  }
837
- const k = new Ie({
868
+ const k = new Oe({
838
869
  x: 0,
839
870
  y: 0,
840
871
  name: "New Group"
841
872
  });
842
- g(k, C), u(k.id);
873
+ g(k, b), u(k.id);
843
874
  }, [c, g, u]);
844
875
  return {
845
876
  layers: L,
846
- flatLayers: b,
877
+ flatLayers: x,
847
878
  selectedLayers: M,
848
879
  selectLayer: R,
849
880
  selectMultipleLayers: F,
850
- clearSelection: X,
881
+ clearSelection: J,
851
882
  toggleVisibility: pe,
852
- toggleLock: J,
853
- renameLayer: re,
883
+ toggleLock: Q,
884
+ renameLayer: oe,
854
885
  deleteLayer: Y,
855
886
  duplicateLayer: ee,
856
887
  reorderLayers: ge,
857
- reorderById: Oe,
858
- reorderWithinGroup: Q,
859
- moveLayerForward: we,
860
- moveLayerBackward: oe,
861
- groupLayers: ue,
862
- ungroupLayer: ze,
863
- addToGroup: xe,
864
- removeFromGroup: ke,
865
- createEmptyGroup: Je,
866
- findElementById: se,
867
- findParentGroup: H,
868
- generateAllPreviews: Se,
869
- clearPreviewCache: le,
888
+ reorderById: se,
889
+ reorderWithinGroup: j,
890
+ moveLayerForward: xe,
891
+ moveLayerBackward: ie,
892
+ bringToFront: ce,
893
+ sendToBack: Pe,
894
+ groupLayers: Ne,
895
+ ungroupLayer: ae,
896
+ addToGroup: Je,
897
+ removeFromGroup: de,
898
+ createEmptyGroup: Be,
899
+ findElementById: ke,
900
+ findParentGroup: ve,
901
+ generateAllPreviews: De,
902
+ clearPreviewCache: Z,
870
903
  artboardId: D,
871
904
  artboardManager: c,
872
- layerCount: b.length
905
+ layerCount: x.length
873
906
  };
874
907
  }
875
908
  function ri(e, t) {
@@ -1139,15 +1172,15 @@ function Yr(e, t) {
1139
1172
  pi(p) || (h[w] = p.toString());
1140
1173
  };
1141
1174
  g("width", u), g("height", d);
1142
- const x = [
1175
+ const C = [
1143
1176
  o.left,
1144
1177
  o.top,
1145
1178
  l,
1146
1179
  c
1147
1180
  ];
1148
- return h.viewBox = x.join(" "), {
1181
+ return h.viewBox = C.join(" "), {
1149
1182
  attributes: h,
1150
- viewBox: x,
1183
+ viewBox: C,
1151
1184
  body: i
1152
1185
  };
1153
1186
  }
@@ -1168,7 +1201,7 @@ const xn = /* @__PURE__ */ Object.create(null);
1168
1201
  function yi(e, t) {
1169
1202
  xn[e] = t;
1170
1203
  }
1171
- function Cn(e) {
1204
+ function kn(e) {
1172
1205
  return xn[e] || xn[""];
1173
1206
  }
1174
1207
  function Pn(e) {
@@ -1222,7 +1255,7 @@ function wi(e, t) {
1222
1255
  function xi(e) {
1223
1256
  return e === 404;
1224
1257
  }
1225
- const Ci = (e, t, n) => {
1258
+ const ki = (e, t, n) => {
1226
1259
  const r = [], o = wi(e, t), i = "icons";
1227
1260
  let s = {
1228
1261
  type: i,
@@ -1239,7 +1272,7 @@ const Ci = (e, t, n) => {
1239
1272
  }, a = l.length), s.icons.push(l);
1240
1273
  }), r.push(s), r;
1241
1274
  };
1242
- function ki(e) {
1275
+ function Ci(e) {
1243
1276
  if (typeof e == "string") {
1244
1277
  const t = Hn(e);
1245
1278
  if (t) return t.path;
@@ -1251,7 +1284,7 @@ const Si = (e, t, n) => {
1251
1284
  n("abort", 424);
1252
1285
  return;
1253
1286
  }
1254
- let r = ki(t.provider);
1287
+ let r = Ci(t.provider);
1255
1288
  switch (t.type) {
1256
1289
  case "icons": {
1257
1290
  const i = t.prefix, a = t.icons.join(","), l = new URLSearchParams({ icons: a });
@@ -1291,7 +1324,7 @@ const Si = (e, t, n) => {
1291
1324
  n("next", o);
1292
1325
  });
1293
1326
  }, Ei = {
1294
- prepare: Ci,
1327
+ prepare: ki,
1295
1328
  send: Si
1296
1329
  };
1297
1330
  function Jr(e, t) {
@@ -1398,11 +1431,11 @@ function Ii(e, t, n, r) {
1398
1431
  const a = Date.now();
1399
1432
  let l = "pending", c = 0, u, d = null, h = [], g = [];
1400
1433
  typeof r == "function" && g.push(r);
1401
- function x() {
1434
+ function C() {
1402
1435
  d && (clearTimeout(d), d = null);
1403
1436
  }
1404
1437
  function w() {
1405
- l === "pending" && (l = "aborted"), x(), h.forEach((y) => {
1438
+ l === "pending" && (l = "aborted"), C(), h.forEach((y) => {
1406
1439
  y.status === "pending" && (y.status = "aborted");
1407
1440
  }), h = [];
1408
1441
  }
@@ -1432,7 +1465,7 @@ function Ii(e, t, n, r) {
1432
1465
  }
1433
1466
  function D(y, S, v) {
1434
1467
  const L = S !== "success";
1435
- switch (h = h.filter((b) => b !== y), l) {
1468
+ switch (h = h.filter((x) => x !== y), l) {
1436
1469
  case "pending":
1437
1470
  break;
1438
1471
  case "failed":
@@ -1449,22 +1482,22 @@ function Ii(e, t, n, r) {
1449
1482
  u = v, h.length || (s.length ? T() : E());
1450
1483
  return;
1451
1484
  }
1452
- if (x(), A(), !e.random) {
1453
- const b = e.resources.indexOf(y.resource);
1454
- b !== -1 && b !== e.index && (e.index = b);
1485
+ if (C(), A(), !e.random) {
1486
+ const x = e.resources.indexOf(y.resource);
1487
+ x !== -1 && x !== e.index && (e.index = x);
1455
1488
  }
1456
- l = "completed", g.forEach((b) => {
1457
- b(v);
1489
+ l = "completed", g.forEach((x) => {
1490
+ x(v);
1458
1491
  });
1459
1492
  }
1460
1493
  function T() {
1461
1494
  if (l !== "pending") return;
1462
- x();
1495
+ C();
1463
1496
  const y = s.shift();
1464
1497
  if (y === void 0) {
1465
1498
  if (h.length) {
1466
1499
  d = setTimeout(() => {
1467
- x(), l === "pending" && (A(), E());
1500
+ C(), l === "pending" && (A(), E());
1468
1501
  }, e.timeout);
1469
1502
  return;
1470
1503
  }
@@ -1528,7 +1561,7 @@ function Ni(e) {
1528
1561
  function zi(e, t, n) {
1529
1562
  let r, o;
1530
1563
  if (typeof e == "string") {
1531
- const i = Cn(e);
1564
+ const i = kn(e);
1532
1565
  if (!i)
1533
1566
  return n(void 0, 424), ir;
1534
1567
  o = i.send;
@@ -1538,7 +1571,7 @@ function zi(e, t, n) {
1538
1571
  const i = Pn(e);
1539
1572
  if (i) {
1540
1573
  r = Qr(i);
1541
- const s = e.resources ? e.resources[0] : "", a = Cn(s);
1574
+ const s = e.resources ? e.resources[0] : "", a = kn(s);
1542
1575
  a && (o = a.send);
1543
1576
  }
1544
1577
  }
@@ -1611,7 +1644,7 @@ function Pi(e, t) {
1611
1644
  }
1612
1645
  const { valid: s, invalid: a } = Fi(o);
1613
1646
  if (a.length && ft(e, a, null), !s.length) return;
1614
- const l = r.match(Vr) ? Cn(n) : null;
1647
+ const l = r.match(Vr) ? kn(n) : null;
1615
1648
  if (!l) {
1616
1649
  ft(e, s, null);
1617
1650
  return;
@@ -1730,7 +1763,7 @@ const eo = {
1730
1763
  role: "img"
1731
1764
  }, Ki = {
1732
1765
  display: "inline-block"
1733
- }, kn = {
1766
+ }, Cn = {
1734
1767
  backgroundColor: "currentColor"
1735
1768
  }, to = {
1736
1769
  backgroundColor: "transparent"
@@ -1739,8 +1772,8 @@ const eo = {
1739
1772
  Repeat: "no-repeat",
1740
1773
  Size: "100% 100%"
1741
1774
  }, cr = {
1742
- WebkitMask: kn,
1743
- mask: kn,
1775
+ WebkitMask: Cn,
1776
+ mask: Cn,
1744
1777
  background: to
1745
1778
  };
1746
1779
  for (const e in cr) {
@@ -1831,7 +1864,7 @@ const Ji = (e, t, n) => {
1831
1864
  __html: qi(Kr(c.body, m ? () => m + "ID" + p++ : "iconifyReact"))
1832
1865
  }, yn("svg", l);
1833
1866
  }
1834
- const { body: d, width: h, height: g } = e, x = i === "mask" || (i === "bg" ? !1 : d.indexOf("currentColor") !== -1), w = Vi(d, {
1867
+ const { body: d, width: h, height: g } = e, C = i === "mask" || (i === "bg" ? !1 : d.indexOf("currentColor") !== -1), w = Vi(d, {
1835
1868
  ...u,
1836
1869
  width: h + "",
1837
1870
  height: g + ""
@@ -1842,7 +1875,7 @@ const Ji = (e, t, n) => {
1842
1875
  width: dr(u.width),
1843
1876
  height: dr(u.height),
1844
1877
  ...Ki,
1845
- ...x ? kn : to,
1878
+ ...C ? Cn : to,
1846
1879
  ...a
1847
1880
  }, yn("span", l);
1848
1881
  };
@@ -1883,16 +1916,16 @@ function no(e) {
1883
1916
  const [t, n] = B(!!e.ssr), [r, o] = B({});
1884
1917
  function i(g) {
1885
1918
  if (g) {
1886
- const x = e.icon;
1887
- if (typeof x == "object")
1919
+ const C = e.icon;
1920
+ if (typeof C == "object")
1888
1921
  return {
1889
1922
  name: "",
1890
- data: x
1923
+ data: C
1891
1924
  };
1892
- const w = rr(x);
1925
+ const w = rr(C);
1893
1926
  if (w)
1894
1927
  return {
1895
- name: x,
1928
+ name: C,
1896
1929
  data: w
1897
1930
  };
1898
1931
  }
@@ -1911,25 +1944,25 @@ function no(e) {
1911
1944
  }
1912
1945
  function u() {
1913
1946
  var g;
1914
- const x = e.icon;
1915
- if (typeof x == "object") {
1947
+ const C = e.icon;
1948
+ if (typeof C == "object") {
1916
1949
  c({
1917
1950
  name: "",
1918
- data: x
1951
+ data: C
1919
1952
  });
1920
1953
  return;
1921
1954
  }
1922
- const w = rr(x);
1955
+ const w = rr(C);
1923
1956
  if (c({
1924
- name: x,
1957
+ name: C,
1925
1958
  data: w
1926
1959
  }))
1927
1960
  if (w === void 0) {
1928
- const p = Zr([x], u);
1961
+ const p = Zr([C], u);
1929
1962
  o({
1930
1963
  callback: p
1931
1964
  });
1932
- } else w && ((g = e.onLoad) === null || g === void 0 || g.call(e, x));
1965
+ } else w && ((g = e.onLoad) === null || g === void 0 || g.call(e, C));
1933
1966
  }
1934
1967
  W(() => (n(!0), l), []), W(() => {
1935
1968
  t && u();
@@ -1940,7 +1973,7 @@ function no(e) {
1940
1973
  ...h
1941
1974
  }, e, d) : e.children ? e.children : e.fallback ? e.fallback : yn("span", {});
1942
1975
  }
1943
- const $ = In((e, t) => no({
1976
+ const H = In((e, t) => no({
1944
1977
  ...e,
1945
1978
  _ref: t
1946
1979
  }));
@@ -1951,7 +1984,7 @@ In((e, t) => no({
1951
1984
  }));
1952
1985
  const Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1953
1986
  __proto__: null,
1954
- Icon: $,
1987
+ Icon: H,
1955
1988
  addAPIProvider: Xr,
1956
1989
  addCollection: Wr,
1957
1990
  addIcon: Gr,
@@ -1997,12 +2030,12 @@ class Zi {
1997
2030
  }
1998
2031
  }
1999
2032
  const es = new Zi(), ts = Nr({ prefix: "sc" });
2000
- function Le(...e) {
2033
+ function Te(...e) {
2001
2034
  return ts(Ir(e));
2002
2035
  }
2003
- const ro = z.createContext({ variant: "transparent" });
2036
+ const ro = O.createContext({ variant: "transparent" });
2004
2037
  function ns() {
2005
- return z.useContext(ro);
2038
+ return O.useContext(ro);
2006
2039
  }
2007
2040
  const rs = zr("", {
2008
2041
  variants: {
@@ -2015,10 +2048,10 @@ const rs = zr("", {
2015
2048
  defaultVariants: {
2016
2049
  variant: "default"
2017
2050
  }
2018
- }), oo = z.forwardRef(
2051
+ }), oo = O.forwardRef(
2019
2052
  ({ className: e, variant: t = "default", asChild: n = !1, children: r, ...o }, i) => {
2020
2053
  const s = n ? Qo : "div";
2021
- return /* @__PURE__ */ f(ro.Provider, { value: { variant: t ?? "default" }, children: /* @__PURE__ */ f(s, { ref: i, className: Le(rs({ variant: t }), e), ...o, children: r }) });
2054
+ return /* @__PURE__ */ f(ro.Provider, { value: { variant: t ?? "default" }, children: /* @__PURE__ */ f(s, { ref: i, className: Te(rs({ variant: t }), e), ...o, children: r }) });
2022
2055
  }
2023
2056
  );
2024
2057
  oo.displayName = "Surface";
@@ -2067,9 +2100,9 @@ const os = zr(
2067
2100
  size: "default"
2068
2101
  }
2069
2102
  }
2070
- ), rt = z.forwardRef(
2103
+ ), rt = O.forwardRef(
2071
2104
  ({ className: e, variant: t, size: n, onPress: r, isPending: o, onClick: i, disabled: s, selected: a, children: l, ...c }, u) => {
2072
- const { variant: d } = ns(), h = d === "default", g = d === "secondary", x = (p) => {
2105
+ const { variant: d } = ns(), h = d === "default", g = d === "secondary", C = (p) => {
2073
2106
  r && r(p), i && i(p);
2074
2107
  }, w = {
2075
2108
  secondary: t === "secondary" && (g ? "sc:bg-[var(--color-default-on-surface)] sc:hover:bg-[var(--color-default-on-surface)]/80" : h ? "sc:dark:bg-[var(--color-default-on-surface)] sc:dark:hover:bg-[var(--color-default-on-surface)]/80" : !1),
@@ -2080,7 +2113,7 @@ const os = zr(
2080
2113
  return /* @__PURE__ */ f(
2081
2114
  "button",
2082
2115
  {
2083
- className: Le(
2116
+ className: Te(
2084
2117
  os({ variant: t, size: n }),
2085
2118
  w.secondary,
2086
2119
  w.field,
@@ -2089,7 +2122,7 @@ const os = zr(
2089
2122
  e
2090
2123
  ),
2091
2124
  ref: u,
2092
- onClick: x,
2125
+ onClick: C,
2093
2126
  disabled: s || o,
2094
2127
  "data-selected": a,
2095
2128
  ...c,
@@ -2099,9 +2132,9 @@ const os = zr(
2099
2132
  }
2100
2133
  );
2101
2134
  rt.displayName = "Button";
2102
- const io = z.createContext(null);
2135
+ const io = O.createContext(null);
2103
2136
  function $n() {
2104
- const e = z.useContext(io);
2137
+ const e = O.useContext(io);
2105
2138
  if (!e)
2106
2139
  throw new Error("Drawer components must be used within a Drawer");
2107
2140
  return e;
@@ -2112,13 +2145,13 @@ function so({
2112
2145
  onOpenChange: n,
2113
2146
  children: r
2114
2147
  }) {
2115
- const [o, i] = z.useState(t), s = e !== void 0, a = s ? e : o, l = z.useCallback(
2148
+ const [o, i] = O.useState(t), s = e !== void 0, a = s ? e : o, l = O.useCallback(
2116
2149
  (d) => {
2117
2150
  s || i(d), n == null || n(d);
2118
2151
  },
2119
2152
  [s, n]
2120
- ), c = 10, u = z.useRef(!1);
2121
- return z.useLayoutEffect(() => {
2153
+ ), c = 10, u = O.useRef(!1);
2154
+ return O.useLayoutEffect(() => {
2122
2155
  if (a) {
2123
2156
  u.current = !0, document.documentElement.setAttribute("data-drawer-open", "true");
2124
2157
  const d = setTimeout(() => {
@@ -2129,12 +2162,12 @@ function so({
2129
2162
  }, [a]), /* @__PURE__ */ f(io.Provider, { value: { open: a, onOpenChange: l }, children: r });
2130
2163
  }
2131
2164
  so.displayName = "Drawer";
2132
- const is = z.forwardRef(
2165
+ const is = O.forwardRef(
2133
2166
  ({ asChild: e, onClick: t, children: n, ...r }, o) => {
2134
2167
  const { onOpenChange: i } = $n(), s = (a) => {
2135
2168
  t == null || t(a), i(!0);
2136
2169
  };
2137
- return e && z.isValidElement(n) ? z.cloneElement(
2170
+ return e && O.isValidElement(n) ? O.cloneElement(
2138
2171
  n,
2139
2172
  {
2140
2173
  onClick: s
@@ -2143,12 +2176,12 @@ const is = z.forwardRef(
2143
2176
  }
2144
2177
  );
2145
2178
  is.displayName = "DrawerTrigger";
2146
- const ss = z.forwardRef(
2179
+ const ss = O.forwardRef(
2147
2180
  ({ asChild: e, onClick: t, children: n, ...r }, o) => {
2148
2181
  const { onOpenChange: i } = $n(), s = (a) => {
2149
2182
  t == null || t(a), i(!1);
2150
2183
  };
2151
- return e && z.isValidElement(n) ? z.cloneElement(
2184
+ return e && O.isValidElement(n) ? O.cloneElement(
2152
2185
  n,
2153
2186
  {
2154
2187
  onClick: s
@@ -2157,7 +2190,7 @@ const ss = z.forwardRef(
2157
2190
  }
2158
2191
  );
2159
2192
  ss.displayName = "DrawerClose";
2160
- const ao = z.forwardRef(
2193
+ const ao = O.forwardRef(
2161
2194
  ({
2162
2195
  className: e,
2163
2196
  children: t,
@@ -2173,120 +2206,120 @@ const ao = z.forwardRef(
2173
2206
  useDialogRole: d = !0,
2174
2207
  disableSwipeGestures: h = !1,
2175
2208
  animationDuration: g = 500,
2176
- showScrollFade: x = !0,
2209
+ showScrollFade: C = !0,
2177
2210
  scrollFadeColor: w,
2178
2211
  heightRatio: p,
2179
2212
  safeAreaPadding: m = !1,
2180
2213
  ...E
2181
2214
  }, A) => {
2182
- const { open: D, onOpenChange: T } = $n(), [y, S] = z.useState(!1), [v, L] = z.useState(0), [b, M] = z.useState(!1), [R, F] = z.useState(!1), [X, pe] = z.useState(!1), [J, re] = z.useState(!1), Y = z.useRef(null), ee = z.useRef(null), ge = z.useRef(0), we = z.useRef(0), [oe, ue] = z.useState(!1), [ze, Se] = z.useState(!1), le = z.useRef(!1), Oe = z.useRef(!0), Q = z.useRef(null), se = 120;
2183
- z.useEffect(() => {
2215
+ const { open: D, onOpenChange: T } = $n(), [y, S] = O.useState(!1), [v, L] = O.useState(0), [x, M] = O.useState(!1), [R, F] = O.useState(!1), [J, pe] = O.useState(!1), [Q, oe] = O.useState(!1), Y = O.useRef(null), ee = O.useRef(null), ge = O.useRef(0), xe = O.useRef(0), [ie, ce] = O.useState(!1), [Pe, Ne] = O.useState(!1), ae = O.useRef(!1), De = O.useRef(!0), Z = O.useRef(null), se = 120;
2216
+ O.useEffect(() => {
2184
2217
  if (D) {
2185
- const _ = setTimeout(() => re(!0), se);
2218
+ const _ = setTimeout(() => oe(!0), se);
2186
2219
  return () => clearTimeout(_);
2187
2220
  } else
2188
- re(!1);
2221
+ oe(!1);
2189
2222
  }, [D]);
2190
- const H = z.useCallback(
2223
+ const j = O.useCallback(
2191
2224
  (_) => {
2192
- const fe = _.target, ye = fe.scrollHeight - fe.scrollTop - fe.clientHeight < 20;
2193
- pe(ye);
2225
+ const fe = _.target, be = fe.scrollHeight - fe.scrollTop - fe.clientHeight < 20;
2226
+ pe(be);
2194
2227
  },
2195
2228
  []
2196
2229
  );
2197
- z.useImperativeHandle(A, () => Y.current), z.useEffect(() => {
2230
+ O.useImperativeHandle(A, () => Y.current), O.useEffect(() => {
2198
2231
  S(!0), L(document.body.clientHeight);
2199
2232
  const _ = () => L(document.body.clientHeight);
2200
2233
  return window.addEventListener("resize", _), () => {
2201
2234
  window.removeEventListener("resize", _);
2202
2235
  };
2203
- }, []), z.useEffect(() => (D && u ? document.body.style.overflow = "hidden" : u && (document.body.style.overflow = ""), () => {
2236
+ }, []), O.useEffect(() => (D && u ? document.body.style.overflow = "hidden" : u && (document.body.style.overflow = ""), () => {
2204
2237
  u && (document.body.style.overflow = "");
2205
- }), [D, u]), z.useLayoutEffect(() => {
2238
+ }), [D, u]), O.useLayoutEffect(() => {
2206
2239
  if (!D) {
2207
- le.current = !1, Oe.current = !0, ue(!1);
2240
+ ae.current = !1, De.current = !0, ce(!1);
2208
2241
  return;
2209
2242
  }
2210
2243
  const _ = setTimeout(() => {
2211
- le.current = !0, Oe.current = !1;
2244
+ ae.current = !0, De.current = !1;
2212
2245
  }, 200), fe = () => {
2213
- !le.current || Oe.current || (Q.current && clearTimeout(Q.current), Se(!0), ue(!0), Q.current = setTimeout(() => {
2214
- Se(!1), Q.current = null;
2246
+ !ae.current || De.current || (Z.current && clearTimeout(Z.current), Ne(!0), ce(!0), Z.current = setTimeout(() => {
2247
+ Ne(!1), Z.current = null;
2215
2248
  }, 60));
2216
- }, ye = () => {
2217
- le.current && ue(!1);
2249
+ }, be = () => {
2250
+ ae.current && ce(!1);
2218
2251
  };
2219
- return window.addEventListener("drawer-open", fe), window.addEventListener("drawer-close", ye), () => {
2220
- clearTimeout(_), Q.current && (clearTimeout(Q.current), Q.current = null), window.removeEventListener("drawer-open", fe), window.removeEventListener("drawer-close", ye);
2252
+ return window.addEventListener("drawer-open", fe), window.addEventListener("drawer-close", be), () => {
2253
+ clearTimeout(_), Z.current && (clearTimeout(Z.current), Z.current = null), window.removeEventListener("drawer-open", fe), window.removeEventListener("drawer-close", be);
2221
2254
  };
2222
2255
  }, [D]);
2223
- const xe = oe ? 10 : 0, ke = 50, Je = 10, ce = z.useRef(null), C = z.useCallback(
2256
+ const ke = ie ? 10 : 0, ve = 50, Je = 10, de = O.useRef(null), Be = O.useCallback(
2224
2257
  (_, fe) => {
2225
- const ye = window.scrollY, Dt = _ - ye, en = performance.now(), Lt = (at) => {
2258
+ const be = window.scrollY, Dt = _ - be, en = performance.now(), Lt = (at) => {
2226
2259
  const Rt = at - en, Tt = Math.min(Rt / fe, 1), It = 1 - Math.pow(1 - Tt, 3);
2227
- window.scrollTo(0, ye + Dt * It), Tt < 1 && requestAnimationFrame(Lt);
2260
+ window.scrollTo(0, be + Dt * It), Tt < 1 && requestAnimationFrame(Lt);
2228
2261
  };
2229
2262
  requestAnimationFrame(Lt);
2230
2263
  },
2231
2264
  []
2232
- ), k = 10;
2233
- z.useEffect(() => {
2234
- if (D && !b) {
2235
- if (ce.current = document.documentElement.scrollTop, ce.current > ke)
2265
+ ), ze = 10;
2266
+ O.useEffect(() => {
2267
+ if (D && !x) {
2268
+ if (de.current = document.documentElement.scrollTop, de.current > ve)
2236
2269
  return;
2237
2270
  const _ = setTimeout(() => {
2238
- C(
2239
- ce.current + ke,
2271
+ Be(
2272
+ de.current + ve,
2240
2273
  Je
2241
2274
  );
2242
- }, k);
2275
+ }, ze);
2243
2276
  return () => clearTimeout(_);
2244
2277
  }
2245
- }, [D, b, C]), z.useEffect(() => {
2246
- if (!D && !b && ce.current !== null) {
2247
- const _ = ce.current;
2248
- ce.current = null, document.body.style.overflow = "", window.scrollTo(0, _);
2278
+ }, [D, x, Be]), O.useEffect(() => {
2279
+ if (!D && !x && de.current !== null) {
2280
+ const _ = de.current;
2281
+ de.current = null, document.body.style.overflow = "", window.scrollTo(0, _);
2249
2282
  }
2250
- }, [D, b]);
2251
- const I = 300, O = 200, K = 250, P = 150, Z = K + P, ae = 50, me = z.useCallback(() => {
2283
+ }, [D, x]);
2284
+ const b = 300, k = 200, I = 250, z = 150, X = I + z, $ = 50, K = O.useCallback(() => {
2252
2285
  setTimeout(() => {
2253
2286
  M(!0), setTimeout(() => {
2254
2287
  document.body.style.overflow = "";
2255
- const fe = ce.current;
2256
- fe !== null && (ce.current = null, window.scrollTo(0, fe));
2288
+ const fe = de.current;
2289
+ fe !== null && (de.current = null, window.scrollTo(0, fe));
2257
2290
  }, 150), setTimeout(() => {
2258
2291
  document.documentElement.removeAttribute("data-drawer-open"), window.dispatchEvent(new CustomEvent("drawer-close"));
2259
- }, O), setTimeout(() => {
2292
+ }, k), setTimeout(() => {
2260
2293
  F(!0);
2261
- }, K), setTimeout(() => {
2294
+ }, I), setTimeout(() => {
2262
2295
  M(!1), F(!1), T(!1);
2263
- }, Z);
2264
- }, ae);
2296
+ }, X);
2297
+ }, $);
2265
2298
  }, [T]);
2266
- z.useEffect(() => {
2299
+ O.useEffect(() => {
2267
2300
  const _ = (fe) => {
2268
- fe.key === "Escape" && D && !b && me();
2301
+ fe.key === "Escape" && D && !x && K();
2269
2302
  };
2270
2303
  return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
2271
- }, [D, b, me]);
2272
- const ne = z.useCallback(
2304
+ }, [D, x, K]);
2305
+ const ue = O.useCallback(
2273
2306
  (_) => {
2274
- h || (ge.current = _.touches[0].clientY, we.current = 0, Y.current && (Y.current.style.transition = "none"));
2307
+ h || (ge.current = _.touches[0].clientY, xe.current = 0, Y.current && (Y.current.style.transition = "none"));
2275
2308
  },
2276
2309
  [h]
2277
- ), He = z.useCallback(
2310
+ ), Le = O.useCallback(
2278
2311
  (_) => {
2279
2312
  if (h) return;
2280
2313
  const fe = _.touches[0].clientY - ge.current;
2281
- we.current = Math.max(0, fe), Y.current && (Y.current.style.transform = `translateY(${we.current}px)`);
2314
+ xe.current = Math.max(0, fe), Y.current && (Y.current.style.transform = `translateY(${xe.current}px)`);
2282
2315
  },
2283
2316
  [h]
2284
- ), Te = z.useCallback(() => {
2317
+ ), re = O.useCallback(() => {
2285
2318
  if (h) return;
2286
- Y.current && (Y.current.style.transition = `transform ${g}ms cubic-bezier(0.32, 0.72, 0, 1)`, Y.current.style.transform = ""), we.current > 100 && me();
2287
- }, [h, me, g]);
2288
- if (!y || !D && !b) return null;
2289
- const Ue = J || b, Ge = {
2319
+ Y.current && (Y.current.style.transition = `transform ${g}ms cubic-bezier(0.32, 0.72, 0, 1)`, Y.current.style.transform = ""), xe.current > 100 && K();
2320
+ }, [h, K, g]);
2321
+ if (!y || !D && !x) return null;
2322
+ const Se = Q || x, ye = {
2290
2323
  "--animation-duration": `${g}ms`
2291
2324
  };
2292
2325
  return On(
@@ -2294,7 +2327,7 @@ const ao = z.forwardRef(
2294
2327
  // editor's .sc-root scope, so without it every scoped theme token
2295
2328
  // (--sc-spacing-*, --sc-color-*, --sc-z-*) inside the drawer resolves
2296
2329
  // to nothing. display:contents keeps it box-less.
2297
- /* @__PURE__ */ f("div", { className: "sc-root", style: { display: "contents" }, children: /* @__PURE__ */ j(
2330
+ /* @__PURE__ */ f("div", { className: "sc-root", style: { display: "contents" }, children: /* @__PURE__ */ P(
2298
2331
  "div",
2299
2332
  {
2300
2333
  style: {
@@ -2310,34 +2343,34 @@ const ao = z.forwardRef(
2310
2343
  a && /* @__PURE__ */ f(
2311
2344
  "div",
2312
2345
  {
2313
- onClick: me,
2314
- className: Le(
2346
+ onClick: K,
2347
+ className: Te(
2315
2348
  "sc:absolute sc:inset-0 sc:backdrop-blur-lg",
2316
2349
  R && "sc:animate-out sc:fade-out"
2317
2350
  ),
2318
2351
  style: {
2319
2352
  backgroundColor: `rgba(0,0,0,${c})`,
2320
- animationDuration: R ? `${P}ms` : void 0
2353
+ animationDuration: R ? `${z}ms` : void 0
2321
2354
  },
2322
2355
  "aria-hidden": "true"
2323
2356
  }
2324
2357
  ),
2325
- ze && /* @__PURE__ */ f(
2358
+ Pe && /* @__PURE__ */ f(
2326
2359
  "div",
2327
2360
  {
2328
2361
  className: "sc:fixed sc:w-full sc:bg-surface",
2329
2362
  style: {
2330
2363
  top: 0,
2331
2364
  left: 0,
2332
- height: xe || 10,
2365
+ height: ke || 10,
2333
2366
  zIndex: 10000001
2334
2367
  }
2335
2368
  }
2336
2369
  ),
2337
- Ue && /* @__PURE__ */ f(
2370
+ Se && /* @__PURE__ */ f(
2338
2371
  "div",
2339
2372
  {
2340
- className: Le(
2373
+ className: Te(
2341
2374
  "sc:sticky sc:left-0 sc:w-full sc:flex sc:pointer-events-none",
2342
2375
  n === "bottom" && "sc:items-end sc:justify-center",
2343
2376
  // Side drawers: stretch to full height unless custom height is set (then top-align with padding)
@@ -2346,25 +2379,25 @@ const ao = z.forwardRef(
2346
2379
  ),
2347
2380
  style: {
2348
2381
  height: "100dvh",
2349
- top: n === "bottom" ? xe : 0,
2382
+ top: n === "bottom" ? ke : 0,
2350
2383
  transition: "top 10ms ease-out"
2351
2384
  },
2352
- children: /* @__PURE__ */ f(oo, { asChild: !0, variant: "default", children: /* @__PURE__ */ j(
2385
+ children: /* @__PURE__ */ f(oo, { asChild: !0, variant: "default", children: /* @__PURE__ */ P(
2353
2386
  "div",
2354
2387
  {
2355
2388
  ref: Y,
2356
- className: Le(
2389
+ className: Te(
2357
2390
  "sc:flex sc:flex-col sc:shadow-2xl sc:pointer-events-auto",
2358
2391
  // Bottom drawer: rounded top, full width
2359
2392
  n === "bottom" && "sc:rounded-t-3xl sc:w-full",
2360
2393
  // Left drawer: rounded right side, full height unless custom height
2361
- n === "left" && Le("sc:rounded-r-2xl", !r && "sc:h-full"),
2394
+ n === "left" && Te("sc:rounded-r-2xl", !r && "sc:h-full"),
2362
2395
  // Right drawer: rounded left side, full height unless custom height
2363
- n === "right" && Le("sc:rounded-l-2xl", !r && "sc:h-full"),
2396
+ n === "right" && Te("sc:rounded-l-2xl", !r && "sc:h-full"),
2364
2397
  // Animations based on placement
2365
- n === "bottom" && (b ? "sc:animate-out sc:slide-out-to-bottom" : "sc:animate-in sc:slide-in-from-bottom"),
2366
- n === "left" && (b ? "sc:animate-out sc:slide-out-to-left" : "sc:animate-in sc:slide-in-from-left"),
2367
- n === "right" && (b ? "sc:animate-out sc:slide-out-to-right" : "sc:animate-in sc:slide-in-from-right"),
2398
+ n === "bottom" && (x ? "sc:animate-out sc:slide-out-to-bottom" : "sc:animate-in sc:slide-in-from-bottom"),
2399
+ n === "left" && (x ? "sc:animate-out sc:slide-out-to-left" : "sc:animate-in sc:slide-in-from-left"),
2400
+ n === "right" && (x ? "sc:animate-out sc:slide-out-to-right" : "sc:animate-in sc:slide-in-from-right"),
2368
2401
  e
2369
2402
  ),
2370
2403
  style: {
@@ -2379,10 +2412,10 @@ const ao = z.forwardRef(
2379
2412
  maxWidth: s,
2380
2413
  height: r || "100%"
2381
2414
  } : {},
2382
- animationDuration: b ? `${I}ms` : `${g}ms`,
2383
- animationTimingFunction: b ? "ease-in" : "cubic-bezier(0.32, 0.72, 0, 1)",
2415
+ animationDuration: x ? `${b}ms` : `${g}ms`,
2416
+ animationTimingFunction: x ? "ease-in" : "cubic-bezier(0.32, 0.72, 0, 1)",
2384
2417
  animationFillMode: "forwards",
2385
- ...Ge
2418
+ ...ye
2386
2419
  },
2387
2420
  onClick: (_) => _.stopPropagation(),
2388
2421
  ...E,
@@ -2390,10 +2423,10 @@ const ao = z.forwardRef(
2390
2423
  n === "bottom" && !h && /* @__PURE__ */ f(
2391
2424
  "div",
2392
2425
  {
2393
- onTouchStart: ne,
2394
- onTouchMove: He,
2395
- onTouchEnd: Te,
2396
- className: Le(
2426
+ onTouchStart: ue,
2427
+ onTouchMove: Le,
2428
+ onTouchEnd: re,
2429
+ className: Te(
2397
2430
  "sc:cursor-grab sc:active:cursor-grabbing sc:flex-shrink-0",
2398
2431
  l && "sc:absolute sc:top-0 sc:left-0 sc:right-0 sc:h-8 sc:z-10"
2399
2432
  ),
@@ -2407,7 +2440,7 @@ const ao = z.forwardRef(
2407
2440
  ) })
2408
2441
  }
2409
2442
  ),
2410
- /* @__PURE__ */ j("div", { className: "sc:flex-1 sc:overflow-hidden sc:flex sc:flex-col sc:relative sc:min-h-0", children: [
2443
+ /* @__PURE__ */ P("div", { className: "sc:flex-1 sc:overflow-hidden sc:flex sc:flex-col sc:relative sc:min-h-0", children: [
2411
2444
  /* @__PURE__ */ f(
2412
2445
  "div",
2413
2446
  {
@@ -2417,16 +2450,16 @@ const ao = z.forwardRef(
2417
2450
  WebkitOverflowScrolling: "touch",
2418
2451
  overscrollBehavior: "contain"
2419
2452
  },
2420
- onScroll: H,
2453
+ onScroll: j,
2421
2454
  children: t
2422
2455
  }
2423
2456
  ),
2424
- x && /* @__PURE__ */ f(
2457
+ C && /* @__PURE__ */ f(
2425
2458
  "div",
2426
2459
  {
2427
- className: Le(
2460
+ className: Te(
2428
2461
  "sc:absolute sc:bottom-0 sc:left-0 sc:right-0 sc:h-20 sc:pointer-events-none sc:transition-opacity sc:duration-300 sc:z-10",
2429
- X ? "sc:opacity-0" : "sc:opacity-100"
2462
+ J ? "sc:opacity-0" : "sc:opacity-100"
2430
2463
  ),
2431
2464
  style: {
2432
2465
  background: w ? `linear-gradient(to top, ${w}, transparent)` : "linear-gradient(to top, var(--color-drawer-bg, var(--surface)), transparent)"
@@ -2455,11 +2488,11 @@ const ao = z.forwardRef(
2455
2488
  }
2456
2489
  );
2457
2490
  ao.displayName = "DrawerContent";
2458
- const lo = z.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
2491
+ const lo = O.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
2459
2492
  "h2",
2460
2493
  {
2461
2494
  ref: n,
2462
- className: Le(
2495
+ className: Te(
2463
2496
  "sc:text-lg sc:font-semibold sc:leading-none sc:tracking-tight",
2464
2497
  e
2465
2498
  ),
@@ -2467,21 +2500,21 @@ const lo = z.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
2467
2500
  }
2468
2501
  ));
2469
2502
  lo.displayName = "DrawerTitle";
2470
- const co = z.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
2503
+ const co = O.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ f(
2471
2504
  "p",
2472
2505
  {
2473
2506
  ref: n,
2474
- className: Le("sc:text-sm sc:text-muted-foreground", e),
2507
+ className: Te("sc:text-sm sc:text-muted-foreground", e),
2475
2508
  ...t
2476
2509
  }
2477
2510
  ));
2478
2511
  co.displayName = "DrawerDescription";
2479
- const as = tt.Provider, ls = tt.Root, _t = tt.Trigger, kt = z.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ f(tt.Portal, { children: /* @__PURE__ */ f(
2512
+ const as = tt.Provider, ls = tt.Root, _t = tt.Trigger, Ct = O.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ f(tt.Portal, { children: /* @__PURE__ */ f(
2480
2513
  tt.Content,
2481
2514
  {
2482
2515
  ref: r,
2483
2516
  sideOffset: t,
2484
- className: Le(
2517
+ className: Te(
2485
2518
  "sc:z-tooltip sc:overflow-hidden sc:rounded-tooltip sc:bg-popover sc:px-3 sc:py-1.5 sc:text-xs sc:text-popover-foreground sc:shadow-md sc:animate-in sc:fade-in-0 sc:zoom-in-95 sc:font-caption",
2486
2519
  "sc:data-[state=closed]:animate-out sc:data-[state=closed]:fade-out-0 sc:data-[state=closed]:zoom-out-95",
2487
2520
  "sc:data-[side=bottom]:slide-in-from-top-2 sc:data-[side=left]:slide-in-from-right-2 sc:data-[side=right]:slide-in-from-left-2 sc:data-[side=top]:slide-in-from-bottom-2",
@@ -2490,10 +2523,10 @@ const as = tt.Provider, ls = tt.Root, _t = tt.Trigger, kt = z.forwardRef(({ clas
2490
2523
  ...n
2491
2524
  }
2492
2525
  ) }));
2493
- kt.displayName = tt.Content.displayName;
2526
+ Ct.displayName = tt.Content.displayName;
2494
2527
  const cs = ({ children: e, delayDuration: t, delay: n, ...r }) => /* @__PURE__ */ f(as, { children: /* @__PURE__ */ f(ls, { delayDuration: n ?? t ?? 200, ...r, children: e }) }), Bn = Object.assign(cs, {
2495
2528
  Trigger: _t,
2496
- Content: kt
2529
+ Content: Ct
2497
2530
  }), ds = Nr({ prefix: "sc" });
2498
2531
  function Sn(...e) {
2499
2532
  return ds(Ir(e));
@@ -2564,7 +2597,7 @@ const uo = ({
2564
2597
  height: `${l}px`
2565
2598
  },
2566
2599
  children: /* @__PURE__ */ f(
2567
- $,
2600
+ H,
2568
2601
  {
2569
2602
  icon: e,
2570
2603
  width: "100%",
@@ -2585,7 +2618,7 @@ const uo = ({
2585
2618
  className: Sn("sc:inline-flex", n),
2586
2619
  style: { width: `${s}px`, height: `${s}px` },
2587
2620
  children: /* @__PURE__ */ f(
2588
- $,
2621
+ H,
2589
2622
  {
2590
2623
  icon: e,
2591
2624
  width: "100%",
@@ -2628,9 +2661,9 @@ const En = te.forwardRef(
2628
2661
  children: typeof e == "string" ? /* @__PURE__ */ f(uo, { icon: e, size: "toolbar" }) : e
2629
2662
  }
2630
2663
  );
2631
- return !r || i ? h : /* @__PURE__ */ j(Bn, { delay: o, children: [
2664
+ return !r || i ? h : /* @__PURE__ */ P(Bn, { delay: o, children: [
2632
2665
  /* @__PURE__ */ f(_t, { asChild: !0, children: h }),
2633
- /* @__PURE__ */ f(kt, { children: r })
2666
+ /* @__PURE__ */ f(Ct, { children: r })
2634
2667
  ] });
2635
2668
  }
2636
2669
  );
@@ -2651,6 +2684,8 @@ const U = {
2651
2684
  // Actions
2652
2685
  trash: "lucide:trash-2",
2653
2686
  copy: "lucide:copy",
2687
+ paste: "lucide:clipboard-paste",
2688
+ selectAll: "lucide:box-select",
2654
2689
  pencil: "lucide:pencil",
2655
2690
  scissors: "lucide:scissors",
2656
2691
  // File operations
@@ -2684,15 +2719,53 @@ const U = {
2684
2719
  // Misc
2685
2720
  grip: "lucide:grip-vertical",
2686
2721
  fileText: "lucide:file-text",
2722
+ // Layer operations
2723
+ layerForward: "lucide:bring-to-front",
2724
+ layerBackward: "lucide:send-to-back",
2687
2725
  group: "lucide:group",
2726
+ ungroup: "lucide:ungroup",
2688
2727
  // Undo/Redo
2689
2728
  undo: "lucide:undo-2",
2690
2729
  redo: "lucide:redo-2",
2691
2730
  fitScreen: "lucide:scan",
2692
2731
  maximize: "lucide:maximize",
2693
2732
  alertCircle: "lucide:alert-circle",
2733
+ arrowUp: "lucide:arrow-up",
2734
+ arrowDown: "lucide:arrow-down",
2694
2735
  // Special purpose
2695
2736
  wand: "lucide:wand-2"
2737
+ }, Ke = ({
2738
+ icon: e,
2739
+ label: t,
2740
+ shortcut: n,
2741
+ active: r = !1,
2742
+ disabled: o = !1,
2743
+ onClick: i,
2744
+ className: s = "",
2745
+ children: a,
2746
+ ...l
2747
+ }) => {
2748
+ const c = [
2749
+ "sc:flex sc:items-center sc:gap-md",
2750
+ "sc:px-lg sc:py-md",
2751
+ "sc:bg-transparent sc:border-none",
2752
+ "sc:rounded-lg",
2753
+ "sc:text-text-primary sc:text-base sc:font-normal",
2754
+ "sc:cursor-pointer",
2755
+ "sc:transition-all sc:duration-fast",
2756
+ "sc:text-left sc:w-full"
2757
+ ], u = [
2758
+ r ? "sc:bg-accent-light sc:font-medium" : "",
2759
+ o ? "sc:opacity-disabled sc:cursor-not-allowed" : "sc:hover:bg-bg-hover"
2760
+ ], d = [...c, ...u, s].filter(Boolean).join(" ");
2761
+ return /* @__PURE__ */ P("button", { role: "menuitem", className: d, onClick: () => {
2762
+ !o && i && i();
2763
+ }, disabled: o, type: "button", ...l, children: [
2764
+ e && /* @__PURE__ */ f("span", { className: "sc:flex sc:shrink-0 sc:items-center", children: e }),
2765
+ /* @__PURE__ */ f("span", { className: "sc:flex-1", children: a || t }),
2766
+ n && /* @__PURE__ */ f("span", { className: "sc:ml-auto sc:text-sm sc:text-text-muted", children: n }),
2767
+ r && !n && /* @__PURE__ */ f("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "sc:ml-auto sc:shrink-0", children: /* @__PURE__ */ f("path", { d: "M13 4L6 11L3 8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
2768
+ ] });
2696
2769
  }, un = ot("useArtboards"), ys = () => {
2697
2770
  const {
2698
2771
  artboards: e,
@@ -2765,7 +2838,7 @@ const U = {
2765
2838
  return;
2766
2839
  }
2767
2840
  m.name !== void 0 && (E.name = m.name), m.width !== void 0 && (E.width = m.width), m.height !== void 0 && (E.height = m.height), m.backgroundColor !== void 0 && (E.backgroundColor = m.backgroundColor), m.clipShape !== void 0 && (E.clipShape = m.clipShape), "distressTexture" in m && (E.distressTexture = m.distressTexture ? { ...m.distressTexture } : void 0), n();
2768
- }, [e, n]), x = N((p) => {
2841
+ }, [e, n]), C = N((p) => {
2769
2842
  r(null), o([]), t.setActiveArtboard(p), n();
2770
2843
  }, [t, n, r, o]), w = N((p, m) => {
2771
2844
  p !== m && (p < 0 || p >= e.length || m < 0 || m >= e.length || ([...e], t.reorderArtboards(p, m), n()));
@@ -2781,7 +2854,7 @@ const U = {
2781
2854
  duplicateArtboard: d,
2782
2855
  renameArtboard: h,
2783
2856
  updateArtboard: g,
2784
- selectArtboard: x,
2857
+ selectArtboard: C,
2785
2858
  reorderArtboards: w,
2786
2859
  count: e.length
2787
2860
  };
@@ -2813,10 +2886,10 @@ function fo(e) {
2813
2886
  function st(e) {
2814
2887
  return e ? it(e) ? e.document : Vn(e) ? Un(e) ? e : St(e) || fo(e) ? e.ownerDocument : document : document : document;
2815
2888
  }
2816
- const Ve = qt ? Nn : W;
2889
+ const Ge = qt ? Nn : W;
2817
2890
  function Yt(e) {
2818
2891
  const t = G(e);
2819
- return Ve(() => {
2892
+ return Ge(() => {
2820
2893
  t.current = e;
2821
2894
  }), N(function() {
2822
2895
  for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
@@ -2835,7 +2908,7 @@ function bs() {
2835
2908
  function bt(e, t) {
2836
2909
  t === void 0 && (t = [e]);
2837
2910
  const n = G(e);
2838
- return Ve(() => {
2911
+ return Ge(() => {
2839
2912
  n.current !== e && (n.current = e);
2840
2913
  }, t), n;
2841
2914
  }
@@ -2978,10 +3051,10 @@ const xt = /* @__PURE__ */ Object.freeze({
2978
3051
  }
2979
3052
  }
2980
3053
  }), ur = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
2981
- function Cs(e) {
3054
+ function ks(e) {
2982
3055
  return e.matches(ur) ? e : e.querySelector(ur);
2983
3056
  }
2984
- const ks = {
3057
+ const Cs = {
2985
3058
  display: "none"
2986
3059
  };
2987
3060
  function Ss(e) {
@@ -2991,7 +3064,7 @@ function Ss(e) {
2991
3064
  } = e;
2992
3065
  return te.createElement("div", {
2993
3066
  id: t,
2994
- style: ks
3067
+ style: Cs
2995
3068
  }, n);
2996
3069
  }
2997
3070
  function Es(e) {
@@ -3033,7 +3106,7 @@ function As() {
3033
3106
  }
3034
3107
  const po = /* @__PURE__ */ Xe(null);
3035
3108
  function Ms(e) {
3036
- const t = je(po);
3109
+ const t = $e(po);
3037
3110
  W(() => {
3038
3111
  if (!t)
3039
3112
  throw new Error("useDndMonitor must be used within a children of <DndContext>");
@@ -3160,10 +3233,10 @@ function Ts(e) {
3160
3233
  }));
3161
3234
  return n ? On(u, n) : u;
3162
3235
  }
3163
- var de;
3236
+ var le;
3164
3237
  (function(e) {
3165
3238
  e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
3166
- })(de || (de = {}));
3239
+ })(le || (le = {}));
3167
3240
  function Vt() {
3168
3241
  }
3169
3242
  function fr(e, t) {
@@ -3185,7 +3258,7 @@ function Is() {
3185
3258
  [...t]
3186
3259
  );
3187
3260
  }
3188
- const Ne = /* @__PURE__ */ Object.freeze({
3261
+ const Fe = /* @__PURE__ */ Object.freeze({
3189
3262
  x: 0,
3190
3263
  y: 0
3191
3264
  });
@@ -3294,7 +3367,7 @@ const Os = (e) => {
3294
3367
  id: a
3295
3368
  } = s, l = n.get(a);
3296
3369
  if (l) {
3297
- const c = An(l), u = o.reduce((h, g, x) => h + Wn(c[x], g), 0), d = Number((u / 4).toFixed(4));
3370
+ const c = An(l), u = o.reduce((h, g, C) => h + Wn(c[C], g), 0), d = Number((u / 4).toFixed(4));
3298
3371
  i.push({
3299
3372
  id: a,
3300
3373
  data: {
@@ -3384,7 +3457,7 @@ function mo(e, t) {
3384
3457
  return e && t ? {
3385
3458
  x: e.left - t.left,
3386
3459
  y: e.top - t.top
3387
- } : Ne;
3460
+ } : Fe;
3388
3461
  }
3389
3462
  function Vs(e) {
3390
3463
  return function(n) {
@@ -3538,7 +3611,7 @@ var he;
3538
3611
  function xo(e) {
3539
3612
  return !qt || !e ? !1 : e === document.scrollingElement;
3540
3613
  }
3541
- function Co(e) {
3614
+ function ko(e) {
3542
3615
  const t = {
3543
3616
  x: 0,
3544
3617
  y: 0
@@ -3578,19 +3651,19 @@ function Xs(e, t, n, r, o) {
3578
3651
  isBottom: u,
3579
3652
  isLeft: d,
3580
3653
  isRight: h
3581
- } = Co(e), g = {
3654
+ } = ko(e), g = {
3582
3655
  x: 0,
3583
3656
  y: 0
3584
- }, x = {
3657
+ }, C = {
3585
3658
  x: 0,
3586
3659
  y: 0
3587
3660
  }, w = {
3588
3661
  height: t.height * o.y,
3589
3662
  width: t.width * o.x
3590
3663
  };
3591
- return !c && i <= t.top + w.height ? (g.y = he.Backward, x.y = r * Math.abs((t.top + w.height - i) / w.height)) : !u && l >= t.bottom - w.height && (g.y = he.Forward, x.y = r * Math.abs((t.bottom - w.height - l) / w.height)), !h && a >= t.right - w.width ? (g.x = he.Forward, x.x = r * Math.abs((t.right - w.width - a) / w.width)) : !d && s <= t.left + w.width && (g.x = he.Backward, x.x = r * Math.abs((t.left + w.width - s) / w.width)), {
3664
+ return !c && i <= t.top + w.height ? (g.y = he.Backward, C.y = r * Math.abs((t.top + w.height - i) / w.height)) : !u && l >= t.bottom - w.height && (g.y = he.Forward, C.y = r * Math.abs((t.bottom - w.height - l) / w.height)), !h && a >= t.right - w.width ? (g.x = he.Forward, C.x = r * Math.abs((t.right - w.width - a) / w.width)) : !d && s <= t.left + w.width && (g.x = he.Backward, C.x = r * Math.abs((t.left + w.width - s) / w.width)), {
3592
3665
  direction: g,
3593
- speed: x
3666
+ speed: C
3594
3667
  };
3595
3668
  }
3596
3669
  function Js(e) {
@@ -3623,8 +3696,8 @@ function Js(e) {
3623
3696
  height: e.clientHeight
3624
3697
  };
3625
3698
  }
3626
- function ko(e) {
3627
- return e.reduce((t, n) => et(t, Mn(n)), Ne);
3699
+ function Co(e) {
3700
+ return e.reduce((t, n) => et(t, Mn(n)), Fe);
3628
3701
  }
3629
3702
  function Qs(e) {
3630
3703
  return e.reduce((t, n) => t + bo(n), 0);
@@ -3650,7 +3723,7 @@ const ea = [["x", ["left", "right"], Qs], ["y", ["top", "bottom"], Zs]];
3650
3723
  class qn {
3651
3724
  constructor(t, n) {
3652
3725
  this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
3653
- const r = Xt(n), o = ko(r);
3726
+ const r = Xt(n), o = Co(r);
3654
3727
  this.rect = {
3655
3728
  ...t
3656
3729
  }, this.width = t.width, this.height = t.height;
@@ -3692,10 +3765,10 @@ function pn(e, t) {
3692
3765
  const n = Math.abs(e.x), r = Math.abs(e.y);
3693
3766
  return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
3694
3767
  }
3695
- var Re;
3768
+ var Ie;
3696
3769
  (function(e) {
3697
3770
  e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
3698
- })(Re || (Re = {}));
3771
+ })(Ie || (Ie = {}));
3699
3772
  function gr(e) {
3700
3773
  e.preventDefault();
3701
3774
  }
@@ -3748,14 +3821,14 @@ class Yn {
3748
3821
  this.props = t, this.listeners = new gt(st(n)), this.windowListeners = new gt(Ce(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
3749
3822
  }
3750
3823
  attach() {
3751
- this.handleStart(), this.windowListeners.add(Re.Resize, this.handleCancel), this.windowListeners.add(Re.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Re.Keydown, this.handleKeyDown));
3824
+ this.handleStart(), this.windowListeners.add(Ie.Resize, this.handleCancel), this.windowListeners.add(Ie.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Ie.Keydown, this.handleKeyDown));
3752
3825
  }
3753
3826
  handleStart() {
3754
3827
  const {
3755
3828
  activeNode: t,
3756
3829
  onStart: n
3757
3830
  } = this.props, r = t.node.current;
3758
- r && So(r), n(Ne);
3831
+ r && So(r), n(Fe);
3759
3832
  }
3760
3833
  handleKeyDown(t) {
3761
3834
  if (Gn(t)) {
@@ -3783,7 +3856,7 @@ class Yn {
3783
3856
  } = r.current, u = c ? {
3784
3857
  x: c.left,
3785
3858
  y: c.top
3786
- } : Ne;
3859
+ } : Fe;
3787
3860
  this.referenceCoordinates || (this.referenceCoordinates = u);
3788
3861
  const d = s(t, {
3789
3862
  active: n,
@@ -3795,9 +3868,9 @@ class Yn {
3795
3868
  x: 0,
3796
3869
  y: 0
3797
3870
  }, {
3798
- scrollableAncestors: x
3871
+ scrollableAncestors: C
3799
3872
  } = r.current;
3800
- for (const w of x) {
3873
+ for (const w of C) {
3801
3874
  const p = t.code, {
3802
3875
  isTop: m,
3803
3876
  isRight: E,
@@ -3805,10 +3878,10 @@ class Yn {
3805
3878
  isBottom: D,
3806
3879
  maxScroll: T,
3807
3880
  minScroll: y
3808
- } = Co(w), S = Js(w), v = {
3881
+ } = ko(w), S = Js(w), v = {
3809
3882
  x: Math.min(p === V.Right ? S.right - S.width / 2 : S.right, Math.max(p === V.Right ? S.left : S.left + S.width / 2, d.x)),
3810
3883
  y: Math.min(p === V.Down ? S.bottom - S.height / 2 : S.bottom, Math.max(p === V.Down ? S.top : S.top + S.height / 2, d.y))
3811
- }, L = p === V.Right && !E || p === V.Left && !A, b = p === V.Down && !D || p === V.Up && !m;
3884
+ }, L = p === V.Right && !E || p === V.Left && !A, x = p === V.Down && !D || p === V.Up && !m;
3812
3885
  if (L && v.x !== d.x) {
3813
3886
  const M = w.scrollLeft + h.x, R = p === V.Right && M <= T.x || p === V.Left && M >= y.x;
3814
3887
  if (R && !h.y) {
@@ -3823,7 +3896,7 @@ class Yn {
3823
3896
  behavior: a
3824
3897
  });
3825
3898
  break;
3826
- } else if (b && v.y !== d.y) {
3899
+ } else if (x && v.y !== d.y) {
3827
3900
  const M = w.scrollTop + h.y, R = p === V.Down && M <= T.y || p === V.Up && M >= y.y;
3828
3901
  if (R && !h.x) {
3829
3902
  w.scrollTo({
@@ -3901,7 +3974,7 @@ class Kn {
3901
3974
  } = t, {
3902
3975
  target: s
3903
3976
  } = i;
3904
- this.props = t, this.events = n, this.document = st(s), this.documentListeners = new gt(this.document), this.listeners = new gt(r), this.windowListeners = new gt(Ce(s)), this.initialCoordinates = (o = Bt(i)) != null ? o : Ne, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
3977
+ this.props = t, this.events = n, this.document = st(s), this.documentListeners = new gt(this.document), this.listeners = new gt(r), this.windowListeners = new gt(Ce(s)), this.initialCoordinates = (o = Bt(i)) != null ? o : Fe, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
3905
3978
  }
3906
3979
  attach() {
3907
3980
  const {
@@ -3915,7 +3988,7 @@ class Kn {
3915
3988
  } = this;
3916
3989
  if (this.listeners.add(t.move.name, this.handleMove, {
3917
3990
  passive: !1
3918
- }), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(Re.Resize, this.handleCancel), this.windowListeners.add(Re.DragStart, gr), this.windowListeners.add(Re.VisibilityChange, this.handleCancel), this.windowListeners.add(Re.ContextMenu, gr), this.documentListeners.add(Re.Keydown, this.handleKeydown), n) {
3991
+ }), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(Ie.Resize, this.handleCancel), this.windowListeners.add(Ie.DragStart, gr), this.windowListeners.add(Ie.VisibilityChange, this.handleCancel), this.windowListeners.add(Ie.ContextMenu, gr), this.documentListeners.add(Ie.Keydown, this.handleKeydown), n) {
3919
3992
  if (r != null && r({
3920
3993
  event: this.props.event,
3921
3994
  activeNode: this.props.activeNode,
@@ -3949,9 +4022,9 @@ class Kn {
3949
4022
  } = this, {
3950
4023
  onStart: n
3951
4024
  } = this.props;
3952
- t && (this.activated = !0, this.documentListeners.add(Re.Click, na, {
4025
+ t && (this.activated = !0, this.documentListeners.add(Ie.Click, na, {
3953
4026
  capture: !0
3954
- }), this.removeTextSelection(), this.documentListeners.add(Re.SelectionChange, this.removeTextSelection), n(t));
4027
+ }), this.removeTextSelection(), this.documentListeners.add(Ie.SelectionChange, this.removeTextSelection), n(t));
3955
4028
  }
3956
4029
  handleMove(t) {
3957
4030
  var n;
@@ -3967,7 +4040,7 @@ class Kn {
3967
4040
  } = i;
3968
4041
  if (!o)
3969
4042
  return;
3970
- const l = (n = Bt(t)) != null ? n : Ne, c = wt(o, l);
4043
+ const l = (n = Bt(t)) != null ? n : Fe, c = wt(o, l);
3971
4044
  if (!r && a) {
3972
4045
  if (mr(a)) {
3973
4046
  if (a.tolerance != null && pn(c, a.tolerance))
@@ -4134,7 +4207,7 @@ function la(e) {
4134
4207
  const g = da({
4135
4208
  delta: d,
4136
4209
  disabled: !i
4137
- }), [x, w] = bs(), p = G({
4210
+ }), [C, w] = bs(), p = G({
4138
4211
  x: 0,
4139
4212
  y: 0
4140
4213
  }), m = G({
@@ -4173,12 +4246,12 @@ function la(e) {
4173
4246
  continue;
4174
4247
  const {
4175
4248
  direction: L,
4176
- speed: b
4249
+ speed: x
4177
4250
  } = Xs(y, v, E, t, h);
4178
4251
  for (const M of ["x", "y"])
4179
- g[M][L[M]] || (b[M] = 0, L[M] = 0);
4180
- if (b.x > 0 || b.y > 0) {
4181
- w(), A.current = y, x(D, s), p.current = b, m.current = L;
4252
+ g[M][L[M]] || (x[M] = 0, L[M] = 0);
4253
+ if (x.x > 0 || x.y > 0) {
4254
+ w(), A.current = y, C(D, s), p.current = x, m.current = L;
4182
4255
  return;
4183
4256
  }
4184
4257
  }
@@ -4202,7 +4275,7 @@ function la(e) {
4202
4275
  JSON.stringify(E),
4203
4276
  // eslint-disable-next-line react-hooks/exhaustive-deps
4204
4277
  JSON.stringify(g),
4205
- x,
4278
+ C,
4206
4279
  c,
4207
4280
  T,
4208
4281
  u,
@@ -4264,10 +4337,10 @@ function fa(e, t) {
4264
4337
  return [...n, ...i];
4265
4338
  }, []), [e, t]);
4266
4339
  }
4267
- var Ct;
4340
+ var kt;
4268
4341
  (function(e) {
4269
4342
  e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
4270
- })(Ct || (Ct = {}));
4343
+ })(kt || (kt = {}));
4271
4344
  var Ln;
4272
4345
  (function(e) {
4273
4346
  e.Optimized = "optimized";
@@ -4285,7 +4358,7 @@ function ha(e, t) {
4285
4358
  strategy: c
4286
4359
  } = o, u = G(e), d = p(), h = bt(d), g = N(function(m) {
4287
4360
  m === void 0 && (m = []), !h.current && s((E) => E === null ? m : E.concat(m.filter((A) => !E.includes(A))));
4288
- }, [h]), x = G(null), w = Et((m) => {
4361
+ }, [h]), C = G(null), w = Et((m) => {
4289
4362
  if (d && !n)
4290
4363
  return yr;
4291
4364
  if (!m || m === yr || u.current !== e || i != null) {
@@ -4320,8 +4393,8 @@ function ha(e, t) {
4320
4393
  [JSON.stringify(i)]
4321
4394
  ), W(
4322
4395
  () => {
4323
- d || typeof a != "number" || x.current !== null || (x.current = setTimeout(() => {
4324
- g(), x.current = null;
4396
+ d || typeof a != "number" || C.current !== null || (C.current = setTimeout(() => {
4397
+ g(), C.current = null;
4325
4398
  }, a));
4326
4399
  },
4327
4400
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -4333,9 +4406,9 @@ function ha(e, t) {
4333
4406
  };
4334
4407
  function p() {
4335
4408
  switch (c) {
4336
- case Ct.Always:
4409
+ case kt.Always:
4337
4410
  return !1;
4338
- case Ct.BeforeDragging:
4411
+ case kt.BeforeDragging:
4339
4412
  return n;
4340
4413
  default:
4341
4414
  return !n;
@@ -4417,7 +4490,7 @@ function br(e, t, n) {
4417
4490
  }), a = Jt({
4418
4491
  callback: i
4419
4492
  });
4420
- return Ve(() => {
4493
+ return Ge(() => {
4421
4494
  i(), e ? (a == null || a.observe(e), s == null || s.observe(document.body, {
4422
4495
  childList: !0,
4423
4496
  subtree: !0
@@ -4461,7 +4534,7 @@ function ba(e) {
4461
4534
  c == null || c.removeEventListener("scroll", o);
4462
4535
  });
4463
4536
  }
4464
- }, [o, e]), q(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => et(i, s), Ne) : ko(e) : Ne, [e, t]);
4537
+ }, [o, e]), q(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => et(i, s), Fe) : Co(e) : Fe, [e, t]);
4465
4538
  }
4466
4539
  function xr(e, t) {
4467
4540
  t === void 0 && (t = []);
@@ -4473,9 +4546,9 @@ function xr(e, t) {
4473
4546
  // eslint-disable-next-line react-hooks/exhaustive-deps
4474
4547
  t
4475
4548
  ), W(() => {
4476
- const r = e !== Ne;
4549
+ const r = e !== Fe;
4477
4550
  r && !n.current && (n.current = e), !r && n.current && (n.current = null);
4478
- }, [e]), n.current ? wt(e, n.current) : Ne;
4551
+ }, [e]), n.current ? wt(e, n.current) : Fe;
4479
4552
  }
4480
4553
  function wa(e) {
4481
4554
  W(
@@ -4517,17 +4590,17 @@ function xa(e, t) {
4517
4590
  function Ao(e) {
4518
4591
  return q(() => e ? _s(e) : null, [e]);
4519
4592
  }
4520
- const Cr = [];
4521
- function Ca(e, t) {
4593
+ const kr = [];
4594
+ function ka(e, t) {
4522
4595
  t === void 0 && (t = At);
4523
- const [n] = e, r = Ao(n ? Ce(n) : null), [o, i] = B(Cr);
4596
+ const [n] = e, r = Ao(n ? Ce(n) : null), [o, i] = B(kr);
4524
4597
  function s() {
4525
- i(() => e.length ? e.map((l) => xo(l) ? r : new qn(t(l), l)) : Cr);
4598
+ i(() => e.length ? e.map((l) => xo(l) ? r : new qn(t(l), l)) : kr);
4526
4599
  }
4527
4600
  const a = Jt({
4528
4601
  callback: s
4529
4602
  });
4530
- return Ve(() => {
4603
+ return Ge(() => {
4531
4604
  a == null || a.disconnect(), s(), e.forEach((l) => a == null ? void 0 : a.observe(l));
4532
4605
  }, [e]), o;
4533
4606
  }
@@ -4539,7 +4612,7 @@ function Mo(e) {
4539
4612
  const t = e.children[0];
4540
4613
  return St(t) ? t : e;
4541
4614
  }
4542
- function ka(e) {
4615
+ function Ca(e) {
4543
4616
  let {
4544
4617
  measure: t
4545
4618
  } = e;
@@ -4584,7 +4657,7 @@ const Sa = [{
4584
4657
  },
4585
4658
  droppable: {
4586
4659
  measure: pr,
4587
- strategy: Ct.WhileDragging,
4660
+ strategy: kt.WhileDragging,
4588
4661
  frequency: Ln.Optimized
4589
4662
  },
4590
4663
  dragOverlay: {
@@ -4670,7 +4743,7 @@ function Ma() {
4670
4743
  }
4671
4744
  function Da(e, t) {
4672
4745
  switch (t.type) {
4673
- case de.DragStart:
4746
+ case le.DragStart:
4674
4747
  return {
4675
4748
  ...e,
4676
4749
  draggable: {
@@ -4679,7 +4752,7 @@ function Da(e, t) {
4679
4752
  active: t.active
4680
4753
  }
4681
4754
  };
4682
- case de.DragMove:
4755
+ case le.DragMove:
4683
4756
  return e.draggable.active == null ? e : {
4684
4757
  ...e,
4685
4758
  draggable: {
@@ -4690,8 +4763,8 @@ function Da(e, t) {
4690
4763
  }
4691
4764
  }
4692
4765
  };
4693
- case de.DragEnd:
4694
- case de.DragCancel:
4766
+ case le.DragEnd:
4767
+ case le.DragCancel:
4695
4768
  return {
4696
4769
  ...e,
4697
4770
  draggable: {
@@ -4707,7 +4780,7 @@ function Da(e, t) {
4707
4780
  }
4708
4781
  }
4709
4782
  };
4710
- case de.RegisterDroppable: {
4783
+ case le.RegisterDroppable: {
4711
4784
  const {
4712
4785
  element: n
4713
4786
  } = t, {
@@ -4721,7 +4794,7 @@ function Da(e, t) {
4721
4794
  }
4722
4795
  };
4723
4796
  }
4724
- case de.SetDroppableDisabled: {
4797
+ case le.SetDroppableDisabled: {
4725
4798
  const {
4726
4799
  id: n,
4727
4800
  key: r,
@@ -4741,7 +4814,7 @@ function Da(e, t) {
4741
4814
  }
4742
4815
  };
4743
4816
  }
4744
- case de.UnregisterDroppable: {
4817
+ case le.UnregisterDroppable: {
4745
4818
  const {
4746
4819
  id: n,
4747
4820
  key: r
@@ -4769,7 +4842,7 @@ function La(e) {
4769
4842
  active: n,
4770
4843
  activatorEvent: r,
4771
4844
  draggableNodes: o
4772
- } = je(Mt), i = $t(r), s = $t(n == null ? void 0 : n.id);
4845
+ } = $e(Mt), i = $t(r), s = $t(n == null ? void 0 : n.id);
4773
4846
  return W(() => {
4774
4847
  if (!t && !r && i && s != null) {
4775
4848
  if (!Gn(i) || document.activeElement === i.target)
@@ -4787,7 +4860,7 @@ function La(e) {
4787
4860
  for (const u of [l.current, c.current]) {
4788
4861
  if (!u)
4789
4862
  continue;
4790
- const d = Cs(u);
4863
+ const d = ks(u);
4791
4864
  if (d) {
4792
4865
  d.focus();
4793
4866
  break;
@@ -4841,7 +4914,7 @@ function Ta(e) {
4841
4914
  x: o,
4842
4915
  y: o
4843
4916
  } : o;
4844
- Ve(() => {
4917
+ Ge(() => {
4845
4918
  if (!s && !a || !t) {
4846
4919
  i.current = !1;
4847
4920
  return;
@@ -4862,7 +4935,7 @@ function Ta(e) {
4862
4935
  }, [t, s, a, r, n]);
4863
4936
  }
4864
4937
  const Qt = /* @__PURE__ */ Xe({
4865
- ...Ne,
4938
+ ...Fe,
4866
4939
  scaleX: 1,
4867
4940
  scaleY: 1
4868
4941
  });
@@ -4881,7 +4954,7 @@ const Ia = /* @__PURE__ */ Go(function(t) {
4881
4954
  collisionDetection: d = js,
4882
4955
  measuring: h,
4883
4956
  modifiers: g,
4884
- ...x
4957
+ ...C
4885
4958
  } = t;
4886
4959
  const w = Wo(Da, void 0, Ma), [p, m] = w, [E, A] = Ds(), [D, T] = B(Ye.Uninitialized), y = D === Ye.Initialized, {
4887
4960
  draggable: {
@@ -4890,185 +4963,185 @@ const Ia = /* @__PURE__ */ Go(function(t) {
4890
4963
  translate: L
4891
4964
  },
4892
4965
  droppable: {
4893
- containers: b
4966
+ containers: x
4894
4967
  }
4895
4968
  } = p, M = S != null ? v.get(S) : null, R = G({
4896
4969
  initial: null,
4897
4970
  translated: null
4898
4971
  }), F = q(() => {
4899
- var be;
4972
+ var we;
4900
4973
  return S != null ? {
4901
4974
  id: S,
4902
4975
  // It's possible for the active node to unmount while dragging
4903
- data: (be = M == null ? void 0 : M.data) != null ? be : Ea,
4976
+ data: (we = M == null ? void 0 : M.data) != null ? we : Ea,
4904
4977
  rect: R
4905
4978
  } : null;
4906
- }, [S, M]), X = G(null), [pe, J] = B(null), [re, Y] = B(null), ee = bt(x, Object.values(x)), ge = Kt("DndDescribedBy", s), we = q(() => b.getEnabled(), [b]), oe = Ra(h), {
4907
- droppableRects: ue,
4908
- measureDroppableContainers: ze,
4909
- measuringScheduled: Se
4910
- } = ha(we, {
4979
+ }, [S, M]), J = G(null), [pe, Q] = B(null), [oe, Y] = B(null), ee = bt(C, Object.values(C)), ge = Kt("DndDescribedBy", s), xe = q(() => x.getEnabled(), [x]), ie = Ra(h), {
4980
+ droppableRects: ce,
4981
+ measureDroppableContainers: Pe,
4982
+ measuringScheduled: Ne
4983
+ } = ha(xe, {
4911
4984
  dragging: y,
4912
4985
  dependencies: [L.x, L.y],
4913
- config: oe.droppable
4914
- }), le = ua(v, S), Oe = q(() => re ? Bt(re) : null, [re]), Q = Uo(), se = pa(le, oe.draggable.measure);
4986
+ config: ie.droppable
4987
+ }), ae = ua(v, S), De = q(() => oe ? Bt(oe) : null, [oe]), Z = Uo(), se = pa(ae, ie.draggable.measure);
4915
4988
  Ta({
4916
4989
  activeNode: S != null ? v.get(S) : null,
4917
- config: Q.layoutShiftCompensation,
4990
+ config: Z.layoutShiftCompensation,
4918
4991
  initialRect: se,
4919
- measure: oe.draggable.measure
4992
+ measure: ie.draggable.measure
4920
4993
  });
4921
- const H = br(le, oe.draggable.measure, se), xe = br(le ? le.parentElement : null), ke = G({
4994
+ const j = br(ae, ie.draggable.measure, se), ke = br(ae ? ae.parentElement : null), ve = G({
4922
4995
  activatorEvent: null,
4923
4996
  active: null,
4924
- activeNode: le,
4997
+ activeNode: ae,
4925
4998
  collisionRect: null,
4926
4999
  collisions: null,
4927
- droppableRects: ue,
5000
+ droppableRects: ce,
4928
5001
  draggableNodes: v,
4929
5002
  draggingNode: null,
4930
5003
  draggingNodeRect: null,
4931
- droppableContainers: b,
5004
+ droppableContainers: x,
4932
5005
  over: null,
4933
5006
  scrollableAncestors: [],
4934
5007
  scrollAdjustedTranslate: null
4935
- }), Je = b.getNodeFor((n = ke.current.over) == null ? void 0 : n.id), ce = ka({
4936
- measure: oe.dragOverlay.measure
4937
- }), C = (r = ce.nodeRef.current) != null ? r : le, k = y ? (o = ce.rect) != null ? o : H : null, I = !!(ce.nodeRef.current && ce.rect), O = va(I ? null : H), K = Ao(C ? Ce(C) : null), P = ya(y ? Je ?? le : null), Z = Ca(P), ae = Ro(g, {
5008
+ }), Je = x.getNodeFor((n = ve.current.over) == null ? void 0 : n.id), de = Ca({
5009
+ measure: ie.dragOverlay.measure
5010
+ }), Be = (r = de.nodeRef.current) != null ? r : ae, ze = y ? (o = de.rect) != null ? o : j : null, b = !!(de.nodeRef.current && de.rect), k = va(b ? null : j), I = Ao(Be ? Ce(Be) : null), z = ya(y ? Je ?? ae : null), X = ka(z), $ = Ro(g, {
4938
5011
  transform: {
4939
- x: L.x - O.x,
4940
- y: L.y - O.y,
5012
+ x: L.x - k.x,
5013
+ y: L.y - k.y,
4941
5014
  scaleX: 1,
4942
5015
  scaleY: 1
4943
5016
  },
4944
- activatorEvent: re,
5017
+ activatorEvent: oe,
4945
5018
  active: F,
4946
- activeNodeRect: H,
4947
- containerNodeRect: xe,
4948
- draggingNodeRect: k,
4949
- over: ke.current.over,
4950
- overlayNodeRect: ce.rect,
4951
- scrollableAncestors: P,
4952
- scrollableAncestorRects: Z,
4953
- windowRect: K
4954
- }), me = Oe ? et(Oe, L) : null, ne = ba(P), He = xr(ne), Te = xr(ne, [H]), Ue = et(ae, He), Ge = k ? Us(k, ae) : null, _ = F && Ge ? d({
5019
+ activeNodeRect: j,
5020
+ containerNodeRect: ke,
5021
+ draggingNodeRect: ze,
5022
+ over: ve.current.over,
5023
+ overlayNodeRect: de.rect,
5024
+ scrollableAncestors: z,
5025
+ scrollableAncestorRects: X,
5026
+ windowRect: I
5027
+ }), K = De ? et(De, L) : null, ue = ba(z), Le = xr(ue), re = xr(ue, [j]), Se = et($, Le), ye = ze ? Us(ze, $) : null, _ = F && ye ? d({
4955
5028
  active: F,
4956
- collisionRect: Ge,
4957
- droppableRects: ue,
4958
- droppableContainers: we,
4959
- pointerCoordinates: me
4960
- }) : null, fe = go(_, "id"), [ye, Dt] = B(null), en = I ? ae : et(ae, Te), Lt = Bs(en, (i = ye == null ? void 0 : ye.rect) != null ? i : null, H), at = G(null), Rt = N(
4961
- (be, Ee) => {
5029
+ collisionRect: ye,
5030
+ droppableRects: ce,
5031
+ droppableContainers: xe,
5032
+ pointerCoordinates: K
5033
+ }) : null, fe = go(_, "id"), [be, Dt] = B(null), en = b ? $ : et($, re), Lt = Bs(en, (i = be == null ? void 0 : be.rect) != null ? i : null, j), at = G(null), Rt = N(
5034
+ (we, Ee) => {
4962
5035
  let {
4963
5036
  sensor: Ae,
4964
5037
  options: We
4965
5038
  } = Ee;
4966
- if (X.current == null)
5039
+ if (J.current == null)
4967
5040
  return;
4968
- const De = v.get(X.current);
4969
- if (!De)
5041
+ const Re = v.get(J.current);
5042
+ if (!Re)
4970
5043
  return;
4971
- const Me = be.nativeEvent, Fe = new Ae({
4972
- active: X.current,
4973
- activeNode: De,
5044
+ const Me = we.nativeEvent, je = new Ae({
5045
+ active: J.current,
5046
+ activeNode: Re,
4974
5047
  event: Me,
4975
5048
  options: We,
4976
5049
  // Sensors need to be instantiated with refs for arguments that change over time
4977
5050
  // otherwise they are frozen in time with the stale arguments
4978
- context: ke,
4979
- onAbort(ve) {
4980
- if (!v.get(ve))
5051
+ context: ve,
5052
+ onAbort(me) {
5053
+ if (!v.get(me))
4981
5054
  return;
4982
5055
  const {
4983
- onDragAbort: Pe
4984
- } = ee.current, $e = {
4985
- id: ve
5056
+ onDragAbort: He
5057
+ } = ee.current, Ve = {
5058
+ id: me
4986
5059
  };
4987
- Pe == null || Pe($e), E({
5060
+ He == null || He(Ve), E({
4988
5061
  type: "onDragAbort",
4989
- event: $e
5062
+ event: Ve
4990
5063
  });
4991
5064
  },
4992
- onPending(ve, _e, Pe, $e) {
4993
- if (!v.get(ve))
5065
+ onPending(me, _e, He, Ve) {
5066
+ if (!v.get(me))
4994
5067
  return;
4995
5068
  const {
4996
5069
  onDragPending: ct
4997
5070
  } = ee.current, qe = {
4998
- id: ve,
5071
+ id: me,
4999
5072
  constraint: _e,
5000
- initialCoordinates: Pe,
5001
- offset: $e
5073
+ initialCoordinates: He,
5074
+ offset: Ve
5002
5075
  };
5003
5076
  ct == null || ct(qe), E({
5004
5077
  type: "onDragPending",
5005
5078
  event: qe
5006
5079
  });
5007
5080
  },
5008
- onStart(ve) {
5009
- const _e = X.current;
5081
+ onStart(me) {
5082
+ const _e = J.current;
5010
5083
  if (_e == null)
5011
5084
  return;
5012
- const Pe = v.get(_e);
5013
- if (!Pe)
5085
+ const He = v.get(_e);
5086
+ if (!He)
5014
5087
  return;
5015
5088
  const {
5016
- onDragStart: $e
5089
+ onDragStart: Ve
5017
5090
  } = ee.current, lt = {
5018
5091
  activatorEvent: Me,
5019
5092
  active: {
5020
5093
  id: _e,
5021
- data: Pe.data,
5094
+ data: He.data,
5022
5095
  rect: R
5023
5096
  }
5024
5097
  };
5025
5098
  Nt(() => {
5026
- $e == null || $e(lt), T(Ye.Initializing), m({
5027
- type: de.DragStart,
5028
- initialCoordinates: ve,
5099
+ Ve == null || Ve(lt), T(Ye.Initializing), m({
5100
+ type: le.DragStart,
5101
+ initialCoordinates: me,
5029
5102
  active: _e
5030
5103
  }), E({
5031
5104
  type: "onDragStart",
5032
5105
  event: lt
5033
- }), J(at.current), Y(Me);
5106
+ }), Q(at.current), Y(Me);
5034
5107
  });
5035
5108
  },
5036
- onMove(ve) {
5109
+ onMove(me) {
5037
5110
  m({
5038
- type: de.DragMove,
5039
- coordinates: ve
5111
+ type: le.DragMove,
5112
+ coordinates: me
5040
5113
  });
5041
5114
  },
5042
- onEnd: Qe(de.DragEnd),
5043
- onCancel: Qe(de.DragCancel)
5115
+ onEnd: Qe(le.DragEnd),
5116
+ onCancel: Qe(le.DragCancel)
5044
5117
  });
5045
- at.current = Fe;
5046
- function Qe(ve) {
5118
+ at.current = je;
5119
+ function Qe(me) {
5047
5120
  return async function() {
5048
5121
  const {
5049
- active: Pe,
5050
- collisions: $e,
5122
+ active: He,
5123
+ collisions: Ve,
5051
5124
  over: lt,
5052
5125
  scrollAdjustedTranslate: ct
5053
- } = ke.current;
5126
+ } = ve.current;
5054
5127
  let qe = null;
5055
- if (Pe && ct) {
5128
+ if (He && ct) {
5056
5129
  const {
5057
5130
  cancelDrop: dt
5058
5131
  } = ee.current;
5059
5132
  qe = {
5060
5133
  activatorEvent: Me,
5061
- active: Pe,
5062
- collisions: $e,
5134
+ active: He,
5135
+ collisions: Ve,
5063
5136
  delta: ct,
5064
5137
  over: lt
5065
- }, ve === de.DragEnd && typeof dt == "function" && await Promise.resolve(dt(qe)) && (ve = de.DragCancel);
5138
+ }, me === le.DragEnd && typeof dt == "function" && await Promise.resolve(dt(qe)) && (me = le.DragCancel);
5066
5139
  }
5067
- X.current = null, Nt(() => {
5140
+ J.current = null, Nt(() => {
5068
5141
  m({
5069
- type: ve
5070
- }), T(Ye.Uninitialized), Dt(null), J(null), Y(null), at.current = null;
5071
- const dt = ve === de.DragEnd ? "onDragEnd" : "onDragCancel";
5142
+ type: me
5143
+ }), T(Ye.Uninitialized), Dt(null), Q(null), Y(null), at.current = null;
5144
+ const dt = me === le.DragEnd ? "onDragEnd" : "onDragCancel";
5072
5145
  if (qe) {
5073
5146
  const tn = ee.current[dt];
5074
5147
  tn == null || tn(qe), E({
@@ -5082,34 +5155,34 @@ const Ia = /* @__PURE__ */ Go(function(t) {
5082
5155
  },
5083
5156
  // eslint-disable-next-line react-hooks/exhaustive-deps
5084
5157
  [v]
5085
- ), Tt = N((be, Ee) => (Ae, We) => {
5086
- const De = Ae.nativeEvent, Me = v.get(We);
5158
+ ), Tt = N((we, Ee) => (Ae, We) => {
5159
+ const Re = Ae.nativeEvent, Me = v.get(We);
5087
5160
  if (
5088
5161
  // Another sensor is already instantiating
5089
- X.current !== null || // No active draggable
5162
+ J.current !== null || // No active draggable
5090
5163
  !Me || // Event has already been captured
5091
- De.dndKit || De.defaultPrevented
5164
+ Re.dndKit || Re.defaultPrevented
5092
5165
  )
5093
5166
  return;
5094
- const Fe = {
5167
+ const je = {
5095
5168
  active: Me
5096
5169
  };
5097
- be(Ae, Ee.options, Fe) === !0 && (De.dndKit = {
5170
+ we(Ae, Ee.options, je) === !0 && (Re.dndKit = {
5098
5171
  capturedBy: Ee.sensor
5099
- }, X.current = We, Rt(Ae, Ee));
5172
+ }, J.current = We, Rt(Ae, Ee));
5100
5173
  }, [v, Rt]), It = fa(u, Tt);
5101
- wa(u), Ve(() => {
5102
- H && D === Ye.Initializing && T(Ye.Initialized);
5103
- }, [H, D]), W(
5174
+ wa(u), Ge(() => {
5175
+ j && D === Ye.Initializing && T(Ye.Initialized);
5176
+ }, [j, D]), W(
5104
5177
  () => {
5105
5178
  const {
5106
- onDragMove: be
5179
+ onDragMove: we
5107
5180
  } = ee.current, {
5108
5181
  active: Ee,
5109
5182
  activatorEvent: Ae,
5110
5183
  collisions: We,
5111
- over: De
5112
- } = ke.current;
5184
+ over: Re
5185
+ } = ve.current;
5113
5186
  if (!Ee || !Ae)
5114
5187
  return;
5115
5188
  const Me = {
@@ -5117,115 +5190,115 @@ const Ia = /* @__PURE__ */ Go(function(t) {
5117
5190
  activatorEvent: Ae,
5118
5191
  collisions: We,
5119
5192
  delta: {
5120
- x: Ue.x,
5121
- y: Ue.y
5193
+ x: Se.x,
5194
+ y: Se.y
5122
5195
  },
5123
- over: De
5196
+ over: Re
5124
5197
  };
5125
5198
  Nt(() => {
5126
- be == null || be(Me), E({
5199
+ we == null || we(Me), E({
5127
5200
  type: "onDragMove",
5128
5201
  event: Me
5129
5202
  });
5130
5203
  });
5131
5204
  },
5132
5205
  // eslint-disable-next-line react-hooks/exhaustive-deps
5133
- [Ue.x, Ue.y]
5206
+ [Se.x, Se.y]
5134
5207
  ), W(
5135
5208
  () => {
5136
5209
  const {
5137
- active: be,
5210
+ active: we,
5138
5211
  activatorEvent: Ee,
5139
5212
  collisions: Ae,
5140
5213
  droppableContainers: We,
5141
- scrollAdjustedTranslate: De
5142
- } = ke.current;
5143
- if (!be || X.current == null || !Ee || !De)
5214
+ scrollAdjustedTranslate: Re
5215
+ } = ve.current;
5216
+ if (!we || J.current == null || !Ee || !Re)
5144
5217
  return;
5145
5218
  const {
5146
5219
  onDragOver: Me
5147
- } = ee.current, Fe = We.get(fe), Qe = Fe && Fe.rect.current ? {
5148
- id: Fe.id,
5149
- rect: Fe.rect.current,
5150
- data: Fe.data,
5151
- disabled: Fe.disabled
5152
- } : null, ve = {
5153
- active: be,
5220
+ } = ee.current, je = We.get(fe), Qe = je && je.rect.current ? {
5221
+ id: je.id,
5222
+ rect: je.rect.current,
5223
+ data: je.data,
5224
+ disabled: je.disabled
5225
+ } : null, me = {
5226
+ active: we,
5154
5227
  activatorEvent: Ee,
5155
5228
  collisions: Ae,
5156
5229
  delta: {
5157
- x: De.x,
5158
- y: De.y
5230
+ x: Re.x,
5231
+ y: Re.y
5159
5232
  },
5160
5233
  over: Qe
5161
5234
  };
5162
5235
  Nt(() => {
5163
- Dt(Qe), Me == null || Me(ve), E({
5236
+ Dt(Qe), Me == null || Me(me), E({
5164
5237
  type: "onDragOver",
5165
- event: ve
5238
+ event: me
5166
5239
  });
5167
5240
  });
5168
5241
  },
5169
5242
  // eslint-disable-next-line react-hooks/exhaustive-deps
5170
5243
  [fe]
5171
- ), Ve(() => {
5172
- ke.current = {
5173
- activatorEvent: re,
5244
+ ), Ge(() => {
5245
+ ve.current = {
5246
+ activatorEvent: oe,
5174
5247
  active: F,
5175
- activeNode: le,
5176
- collisionRect: Ge,
5248
+ activeNode: ae,
5249
+ collisionRect: ye,
5177
5250
  collisions: _,
5178
- droppableRects: ue,
5251
+ droppableRects: ce,
5179
5252
  draggableNodes: v,
5180
- draggingNode: C,
5181
- draggingNodeRect: k,
5182
- droppableContainers: b,
5183
- over: ye,
5184
- scrollableAncestors: P,
5185
- scrollAdjustedTranslate: Ue
5253
+ draggingNode: Be,
5254
+ draggingNodeRect: ze,
5255
+ droppableContainers: x,
5256
+ over: be,
5257
+ scrollableAncestors: z,
5258
+ scrollAdjustedTranslate: Se
5186
5259
  }, R.current = {
5187
- initial: k,
5188
- translated: Ge
5260
+ initial: ze,
5261
+ translated: ye
5189
5262
  };
5190
- }, [F, le, _, Ge, v, C, k, ue, b, ye, P, Ue]), la({
5191
- ...Q,
5263
+ }, [F, ae, _, ye, v, Be, ze, ce, x, be, z, Se]), la({
5264
+ ...Z,
5192
5265
  delta: L,
5193
- draggingRect: Ge,
5194
- pointerCoordinates: me,
5195
- scrollableAncestors: P,
5196
- scrollableAncestorRects: Z
5266
+ draggingRect: ye,
5267
+ pointerCoordinates: K,
5268
+ scrollableAncestors: z,
5269
+ scrollableAncestorRects: X
5197
5270
  });
5198
5271
  const Bo = q(() => ({
5199
5272
  active: F,
5200
- activeNode: le,
5201
- activeNodeRect: H,
5202
- activatorEvent: re,
5273
+ activeNode: ae,
5274
+ activeNodeRect: j,
5275
+ activatorEvent: oe,
5203
5276
  collisions: _,
5204
- containerNodeRect: xe,
5205
- dragOverlay: ce,
5277
+ containerNodeRect: ke,
5278
+ dragOverlay: de,
5206
5279
  draggableNodes: v,
5207
- droppableContainers: b,
5208
- droppableRects: ue,
5209
- over: ye,
5210
- measureDroppableContainers: ze,
5211
- scrollableAncestors: P,
5212
- scrollableAncestorRects: Z,
5213
- measuringConfiguration: oe,
5214
- measuringScheduled: Se,
5215
- windowRect: K
5216
- }), [F, le, H, re, _, xe, ce, v, b, ue, ye, ze, P, Z, oe, Se, K]), Vo = q(() => ({
5217
- activatorEvent: re,
5280
+ droppableContainers: x,
5281
+ droppableRects: ce,
5282
+ over: be,
5283
+ measureDroppableContainers: Pe,
5284
+ scrollableAncestors: z,
5285
+ scrollableAncestorRects: X,
5286
+ measuringConfiguration: ie,
5287
+ measuringScheduled: Ne,
5288
+ windowRect: I
5289
+ }), [F, ae, j, oe, _, ke, de, v, x, ce, be, Pe, z, X, ie, Ne, I]), Vo = q(() => ({
5290
+ activatorEvent: oe,
5218
5291
  activators: It,
5219
5292
  active: F,
5220
- activeNodeRect: H,
5293
+ activeNodeRect: j,
5221
5294
  ariaDescribedById: {
5222
5295
  draggable: ge
5223
5296
  },
5224
5297
  dispatch: m,
5225
5298
  draggableNodes: v,
5226
- over: ye,
5227
- measureDroppableContainers: ze
5228
- }), [re, It, F, H, m, ge, v, ye, ze]);
5299
+ over: be,
5300
+ measureDroppableContainers: Pe
5301
+ }), [oe, It, F, j, m, ge, v, be, Pe]);
5229
5302
  return te.createElement(po.Provider, {
5230
5303
  value: A
5231
5304
  }, te.createElement(Mt.Provider, {
@@ -5241,7 +5314,7 @@ const Ia = /* @__PURE__ */ Go(function(t) {
5241
5314
  hiddenTextDescribedById: ge
5242
5315
  }));
5243
5316
  function Uo() {
5244
- const be = (pe == null ? void 0 : pe.autoScrollEnabled) === !1, Ee = typeof l == "object" ? l.enabled === !1 : l === !1, Ae = y && !be && !Ee;
5317
+ const we = (pe == null ? void 0 : pe.autoScrollEnabled) === !1, Ee = typeof l == "object" ? l.enabled === !1 : l === !1, Ae = y && !we && !Ee;
5245
5318
  return typeof l == "object" ? {
5246
5319
  ...l,
5247
5320
  enabled: Ae
@@ -5249,7 +5322,7 @@ const Ia = /* @__PURE__ */ Go(function(t) {
5249
5322
  enabled: Ae
5250
5323
  };
5251
5324
  }
5252
- }), Na = /* @__PURE__ */ Xe(null), kr = "button", za = "Draggable";
5325
+ }), Na = /* @__PURE__ */ Xe(null), Cr = "button", za = "Draggable";
5253
5326
  function Oa(e) {
5254
5327
  let {
5255
5328
  id: t,
@@ -5265,12 +5338,12 @@ function Oa(e) {
5265
5338
  ariaDescribedById: u,
5266
5339
  draggableNodes: d,
5267
5340
  over: h
5268
- } = je(Mt), {
5269
- role: g = kr,
5270
- roleDescription: x = "draggable",
5341
+ } = $e(Mt), {
5342
+ role: g = Cr,
5343
+ roleDescription: C = "draggable",
5271
5344
  tabIndex: w = 0
5272
- } = o ?? {}, p = (l == null ? void 0 : l.id) === t, m = je(p ? Qt : Na), [E, A] = Ht(), [D, T] = Ht(), y = xa(s, t), S = bt(n);
5273
- Ve(
5345
+ } = o ?? {}, p = (l == null ? void 0 : l.id) === t, m = $e(p ? Qt : Na), [E, A] = Ht(), [D, T] = Ht(), y = xa(s, t), S = bt(n);
5346
+ Ge(
5274
5347
  () => (d.set(t, {
5275
5348
  id: t,
5276
5349
  key: i,
@@ -5288,10 +5361,10 @@ function Oa(e) {
5288
5361
  role: g,
5289
5362
  tabIndex: w,
5290
5363
  "aria-disabled": r,
5291
- "aria-pressed": p && g === kr ? !0 : void 0,
5292
- "aria-roledescription": x,
5364
+ "aria-pressed": p && g === Cr ? !0 : void 0,
5365
+ "aria-roledescription": C,
5293
5366
  "aria-describedby": u.draggable
5294
- }), [r, g, w, p, x, u.draggable]);
5367
+ }), [r, g, w, p, C, u.draggable]);
5295
5368
  return {
5296
5369
  active: l,
5297
5370
  activatorEvent: a,
@@ -5307,7 +5380,7 @@ function Oa(e) {
5307
5380
  };
5308
5381
  }
5309
5382
  function Fa() {
5310
- return je(Lo);
5383
+ return $e(Lo);
5311
5384
  }
5312
5385
  const Pa = "Droppable", ja = {
5313
5386
  timeout: 25
@@ -5324,10 +5397,10 @@ function To(e) {
5324
5397
  dispatch: a,
5325
5398
  over: l,
5326
5399
  measureDroppableContainers: c
5327
- } = je(Mt), u = G({
5400
+ } = $e(Mt), u = G({
5328
5401
  disabled: n
5329
5402
  }), d = G(!1), h = G(null), g = G(null), {
5330
- disabled: x,
5403
+ disabled: C,
5331
5404
  updateMeasurementsFor: w,
5332
5405
  timeout: p
5333
5406
  } = {
@@ -5347,7 +5420,7 @@ function To(e) {
5347
5420
  [p]
5348
5421
  ), A = Jt({
5349
5422
  callback: E,
5350
- disabled: x || !s
5423
+ disabled: C || !s
5351
5424
  }), D = N((v, L) => {
5352
5425
  A && (L && (A.unobserve(L), d.current = !1), v && A.observe(v));
5353
5426
  }, [A]), [T, y] = Ht(D), S = bt(t);
@@ -5355,7 +5428,7 @@ function To(e) {
5355
5428
  !A || !T.current || (A.disconnect(), d.current = !1, A.observe(T.current));
5356
5429
  }, [T, A]), W(
5357
5430
  () => (a({
5358
- type: de.RegisterDroppable,
5431
+ type: le.RegisterDroppable,
5359
5432
  element: {
5360
5433
  id: r,
5361
5434
  key: i,
@@ -5365,7 +5438,7 @@ function To(e) {
5365
5438
  data: S
5366
5439
  }
5367
5440
  }), () => a({
5368
- type: de.UnregisterDroppable,
5441
+ type: le.UnregisterDroppable,
5369
5442
  key: i,
5370
5443
  id: r
5371
5444
  })),
@@ -5373,7 +5446,7 @@ function To(e) {
5373
5446
  [r]
5374
5447
  ), W(() => {
5375
5448
  n !== u.current.disabled && (a({
5376
- type: de.SetDroppableDisabled,
5449
+ type: le.SetDroppableDisabled,
5377
5450
  id: r,
5378
5451
  key: i,
5379
5452
  disabled: n
@@ -5393,7 +5466,7 @@ function Ha(e) {
5393
5466
  children: n
5394
5467
  } = e;
5395
5468
  const [r, o] = B(null), [i, s] = B(null), a = $t(n);
5396
- return !n && !r && a && o(a), Ve(() => {
5469
+ return !n && !r && a && o(a), Ge(() => {
5397
5470
  if (!i)
5398
5471
  return;
5399
5472
  const l = r == null ? void 0 : r.key, c = r == null ? void 0 : r.props.id;
@@ -5585,8 +5658,8 @@ function Ka(e) {
5585
5658
  initial: l,
5586
5659
  final: h
5587
5660
  }
5588
- }), [x] = g, w = g[g.length - 1];
5589
- if (JSON.stringify(x) === JSON.stringify(w))
5661
+ }), [C] = g, w = g[g.length - 1];
5662
+ if (JSON.stringify(C) === JSON.stringify(w))
5590
5663
  return;
5591
5664
  const p = r == null ? void 0 : r({
5592
5665
  active: s,
@@ -5628,7 +5701,7 @@ const Ja = /* @__PURE__ */ te.memo((e) => {
5628
5701
  active: d,
5629
5702
  activeNodeRect: h,
5630
5703
  containerNodeRect: g,
5631
- draggableNodes: x,
5704
+ draggableNodes: C,
5632
5705
  droppableContainers: w,
5633
5706
  dragOverlay: p,
5634
5707
  over: m,
@@ -5636,7 +5709,7 @@ const Ja = /* @__PURE__ */ te.memo((e) => {
5636
5709
  scrollableAncestors: A,
5637
5710
  scrollableAncestorRects: D,
5638
5711
  windowRect: T
5639
- } = Fa(), y = je(Qt), S = Xa(d == null ? void 0 : d.id), v = Ro(s, {
5712
+ } = Fa(), y = $e(Qt), S = Xa(d == null ? void 0 : d.id), v = Ro(s, {
5640
5713
  activatorEvent: u,
5641
5714
  active: d,
5642
5715
  activeNodeRect: h,
@@ -5648,14 +5721,14 @@ const Ja = /* @__PURE__ */ te.memo((e) => {
5648
5721
  scrollableAncestorRects: D,
5649
5722
  transform: y,
5650
5723
  windowRect: T
5651
- }), L = Jn(h), b = Ya({
5724
+ }), L = Jn(h), x = Ya({
5652
5725
  config: r,
5653
- draggableNodes: x,
5726
+ draggableNodes: C,
5654
5727
  droppableContainers: w,
5655
5728
  measuringConfiguration: E
5656
5729
  }), M = L ? p.setRef : void 0;
5657
5730
  return te.createElement(Ba, null, te.createElement(Ha, {
5658
- animation: b
5731
+ animation: x
5659
5732
  }, d && S ? te.createElement(Ga, {
5660
5733
  key: S,
5661
5734
  id: d.id,
@@ -5721,9 +5794,9 @@ const Qa = [V.Down, V.Right, V.Up, V.Left], Za = (e, t) => {
5721
5794
  });
5722
5795
  let u = go(c, "id");
5723
5796
  if (u === (s == null ? void 0 : s.id) && c.length > 1 && (u = c[1].id), u != null) {
5724
- const d = i.get(n.id), h = i.get(u), g = h ? o.get(h.id) : null, x = h == null ? void 0 : h.node.current;
5725
- if (x && g && d && h) {
5726
- const p = Xt(x).some((y, S) => a[S] !== y), m = Io(d, h), E = el(d, h), A = p || !m ? {
5797
+ const d = i.get(n.id), h = i.get(u), g = h ? o.get(h.id) : null, C = h == null ? void 0 : h.node.current;
5798
+ if (C && g && d && h) {
5799
+ const p = Xt(C).some((y, S) => a[S] !== y), m = Io(d, h), E = el(d, h), A = p || !m ? {
5727
5800
  x: 0,
5728
5801
  y: 0
5729
5802
  } : {
@@ -5758,7 +5831,7 @@ function tl(e) {
5758
5831
  onDropIntoGroupAtPosition: o,
5759
5832
  onRemoveFromGroup: i,
5760
5833
  findParentGroup: s
5761
- } = e, [a, l] = B(null), [c, u] = B(null), [d, h] = B(null), g = G(null), x = Is(
5834
+ } = e, [a, l] = B(null), [c, u] = B(null), [d, h] = B(null), g = G(null), C = Is(
5762
5835
  fr(Xn, {
5763
5836
  activationConstraint: {
5764
5837
  distance: 5
@@ -5792,17 +5865,17 @@ function tl(e) {
5792
5865
  E();
5793
5866
  return;
5794
5867
  }
5795
- const L = String(y.id), b = String(S.id);
5796
- if (b.startsWith("group-footer::")) {
5797
- const M = b.replace("group-footer::", ""), R = s == null ? void 0 : s(L);
5868
+ const L = String(y.id), x = String(S.id);
5869
+ if (x.startsWith("group-footer::")) {
5870
+ const M = x.replace("group-footer::", ""), R = s == null ? void 0 : s(L);
5798
5871
  R && R.id === M ? i == null || i(L) : t(L, M, "before"), E();
5799
5872
  return;
5800
5873
  }
5801
5874
  if (v === "into")
5802
- r == null || r(L, b);
5875
+ r == null || r(L, x);
5803
5876
  else {
5804
- const M = v === "before" ? "after" : "before", R = s == null ? void 0 : s(L), F = s == null ? void 0 : s(b);
5805
- R && F && R.id === F.id ? n == null || n(L, b, M, R.id) : !R && F && o ? o(L, F.id, b, M) : t(L, b, M);
5877
+ const M = v === "before" ? "after" : "before", R = s == null ? void 0 : s(L), F = s == null ? void 0 : s(x);
5878
+ R && F && R.id === F.id ? n == null || n(L, x, M, R.id) : !R && F && o ? o(L, F.id, x, M) : t(L, x, M);
5806
5879
  }
5807
5880
  E();
5808
5881
  },
@@ -5822,7 +5895,7 @@ function tl(e) {
5822
5895
  activeId: a,
5823
5896
  overId: c,
5824
5897
  dropPosition: d,
5825
- sensors: x,
5898
+ sensors: C,
5826
5899
  onDragStart: w,
5827
5900
  onDragMove: m,
5828
5901
  onDragOver: p,
@@ -5840,7 +5913,7 @@ const nl = (e) => {
5840
5913
  return [{ ...i, data: { ...i.data, zone: "after" } }];
5841
5914
  const s = r.get(i.id);
5842
5915
  if (!s) return o;
5843
- const a = t.y - s.top, l = s.height, c = n.find((x) => x.id === i.id), u = ((g = (h = c == null ? void 0 : c.data) == null ? void 0 : h.current) == null ? void 0 : g.isGroup) === !0;
5916
+ const a = t.y - s.top, l = s.height, c = n.find((C) => C.id === i.id), u = ((g = (h = c == null ? void 0 : c.data) == null ? void 0 : h.current) == null ? void 0 : g.isGroup) === !0;
5844
5917
  let d;
5845
5918
  return u ? a < l * 0.25 ? d = "before" : a > l * 0.75 ? d = "after" : d = "into" : d = a < l / 2 ? "before" : "after", [{
5846
5919
  ...i,
@@ -5860,9 +5933,9 @@ const nl = (e) => {
5860
5933
  onDelete: u,
5861
5934
  deleteSuppressed: d
5862
5935
  }) => {
5863
- const { attributes: h, listeners: g, setNodeRef: x, isDragging: w } = Oa({ id: e.id }), { setNodeRef: p } = To({ id: e.id, data: { isGroup: !!e.isGroup } }), m = N((L) => {
5864
- x(L), p(L);
5865
- }, [x, p]), E = e.isGroup, A = e.depth > 0, D = A ? e.depth * 24 : 0, T = {
5936
+ const { attributes: h, listeners: g, setNodeRef: C, isDragging: w } = Oa({ id: e.id }), { setNodeRef: p } = To({ id: e.id, data: { isGroup: !!e.isGroup } }), m = N((L) => {
5937
+ C(L), p(L);
5938
+ }, [C, p]), E = e.isGroup, A = e.depth > 0, D = A ? e.depth * 24 : 0, T = {
5866
5939
  opacity: w ? 0.3 : 1,
5867
5940
  paddingLeft: D + 8,
5868
5941
  paddingRight: 8,
@@ -5904,13 +5977,13 @@ const nl = (e) => {
5904
5977
  color: "var(--text-secondary, #888)",
5905
5978
  opacity: 0.6
5906
5979
  },
5907
- children: /* @__PURE__ */ f($, { icon: "lucide:grip-vertical", style: { fontSize: 24 } })
5980
+ children: /* @__PURE__ */ f(H, { icon: "lucide:grip-vertical", style: { fontSize: 24 } })
5908
5981
  }
5909
5982
  );
5910
- return E ? /* @__PURE__ */ j("div", { ref: m, style: T, ...h, children: [
5983
+ return E ? /* @__PURE__ */ P("div", { ref: m, style: T, ...h, children: [
5911
5984
  v,
5912
5985
  /* @__PURE__ */ f(
5913
- $,
5986
+ H,
5914
5987
  {
5915
5988
  icon: "lucide:folder-open",
5916
5989
  style: { fontSize: 18, color: "var(--text-secondary, #888)", flexShrink: 0 }
@@ -5934,15 +6007,15 @@ const nl = (e) => {
5934
6007
  }
5935
6008
  ),
5936
6009
  !r && !d && (!e.children || e.children.length === 0) && /* @__PURE__ */ f("div", { style: { display: "flex", gap: 4, flexShrink: 0 }, children: /* @__PURE__ */ f(
5937
- Be,
6010
+ Ue,
5938
6011
  {
5939
6012
  title: "Delete Group",
5940
6013
  onClick: () => u(e.id),
5941
6014
  style: { color: "var(--error, #ef4444)" },
5942
- children: /* @__PURE__ */ f($, { icon: U.trash, className: "sc:size-6" })
6015
+ children: /* @__PURE__ */ f(H, { icon: U.trash, className: "sc:size-6" })
5943
6016
  }
5944
6017
  ) })
5945
- ] }) : /* @__PURE__ */ j("div", { ref: m, style: T, ...h, children: [
6018
+ ] }) : /* @__PURE__ */ P("div", { ref: m, style: T, ...h, children: [
5946
6019
  v,
5947
6020
  o && e.previewUrl ? /* @__PURE__ */ f(
5948
6021
  "img",
@@ -5979,42 +6052,42 @@ const nl = (e) => {
5979
6052
  ...y
5980
6053
  },
5981
6054
  onClick: S,
5982
- children: /* @__PURE__ */ f($, { icon: U.fileText })
6055
+ children: /* @__PURE__ */ f(H, { icon: U.fileText })
5983
6056
  }
5984
6057
  ),
5985
6058
  /* @__PURE__ */ f("div", { style: { flex: 1, minWidth: 0 }, onClick: S }),
5986
- !r && /* @__PURE__ */ j("div", { style: { display: "flex", gap: 4, flexShrink: 0 }, children: [
6059
+ !r && /* @__PURE__ */ P("div", { style: { display: "flex", gap: 4, flexShrink: 0 }, children: [
5987
6060
  /* @__PURE__ */ f(
5988
- Be,
6061
+ Ue,
5989
6062
  {
5990
6063
  title: e.visible ? "Hide" : "Show",
5991
6064
  onClick: () => a(e.id),
5992
6065
  style: { opacity: e.visible ? 1 : 0.4 },
5993
- children: /* @__PURE__ */ f($, { icon: e.visible ? U.eye : U.eyeOff, className: "sc:size-6" })
6066
+ children: /* @__PURE__ */ f(H, { icon: e.visible ? U.eye : U.eyeOff, className: "sc:size-6" })
5994
6067
  }
5995
6068
  ),
5996
6069
  /* @__PURE__ */ f(
5997
- Be,
6070
+ Ue,
5998
6071
  {
5999
6072
  title: e.locked ? "Unlock" : "Lock",
6000
6073
  onClick: () => l(e.id),
6001
6074
  style: { opacity: e.locked ? 1 : 0.4 },
6002
- children: /* @__PURE__ */ f($, { icon: e.locked ? U.lock : U.lockOpen, className: "sc:size-6" })
6075
+ children: /* @__PURE__ */ f(H, { icon: e.locked ? U.lock : U.lockOpen, className: "sc:size-6" })
6003
6076
  }
6004
6077
  ),
6005
- /* @__PURE__ */ f(Be, { title: "Duplicate", onClick: () => c(e.id), children: /* @__PURE__ */ f($, { icon: U.copy, className: "sc:size-6" }) }),
6078
+ /* @__PURE__ */ f(Ue, { title: "Duplicate", onClick: () => c(e.id), children: /* @__PURE__ */ f(H, { icon: U.copy, className: "sc:size-6" }) }),
6006
6079
  !d && /* @__PURE__ */ f(
6007
- Be,
6080
+ Ue,
6008
6081
  {
6009
6082
  title: "Delete",
6010
6083
  onClick: () => u(e.id),
6011
6084
  style: { color: "var(--error, #ef4444)" },
6012
- children: /* @__PURE__ */ f($, { icon: U.trash, className: "sc:size-6" })
6085
+ children: /* @__PURE__ */ f(H, { icon: U.trash, className: "sc:size-6" })
6013
6086
  }
6014
6087
  )
6015
6088
  ] })
6016
6089
  ] });
6017
- }, Be = ({ title: e, onClick: t, style: n, children: r }) => /* @__PURE__ */ f(
6090
+ }, Ue = ({ title: e, onClick: t, style: n, children: r }) => /* @__PURE__ */ f(
6018
6091
  "button",
6019
6092
  {
6020
6093
  onClick: (o) => {
@@ -6047,7 +6120,7 @@ const nl = (e) => {
6047
6120
  }
6048
6121
  }
6049
6122
  );
6050
- }, il = ({ layer: e, showPreviewImages: t, previewDisplaySize: n }) => /* @__PURE__ */ j(
6123
+ }, il = ({ layer: e, showPreviewImages: t, previewDisplaySize: n }) => /* @__PURE__ */ P(
6051
6124
  "div",
6052
6125
  {
6053
6126
  style: {
@@ -6064,7 +6137,7 @@ const nl = (e) => {
6064
6137
  opacity: 0.9
6065
6138
  },
6066
6139
  children: [
6067
- e.isGroup ? /* @__PURE__ */ f($, { icon: "lucide:folder-open", style: { fontSize: 18, color: "var(--text-secondary, #888)" } }) : t && e.previewUrl ? /* @__PURE__ */ f(
6140
+ e.isGroup ? /* @__PURE__ */ f(H, { icon: "lucide:folder-open", style: { fontSize: 18, color: "var(--text-secondary, #888)" } }) : t && e.previewUrl ? /* @__PURE__ */ f(
6068
6141
  "img",
6069
6142
  {
6070
6143
  src: e.previewUrl,
@@ -6091,7 +6164,7 @@ const nl = (e) => {
6091
6164
  border: "1px solid var(--border-primary, #e5e5e5)",
6092
6165
  borderRadius: 4
6093
6166
  },
6094
- children: /* @__PURE__ */ f($, { icon: U.fileText })
6167
+ children: /* @__PURE__ */ f(H, { icon: U.fileText })
6095
6168
  }
6096
6169
  ),
6097
6170
  /* @__PURE__ */ f("span", { style: { fontSize: 13, color: "var(--foreground, #333)" }, children: e.name })
@@ -6110,7 +6183,7 @@ const nl = (e) => {
6110
6183
  }) => {
6111
6184
  const { activeArtboard: c } = ys(), u = (c == null ? void 0 : c.previewBackgroundColor) || (c == null ? void 0 : c.backgroundColor) || "transparent", d = 80, h = 160, {
6112
6185
  layers: g,
6113
- flatLayers: x,
6186
+ flatLayers: C,
6114
6187
  selectLayer: w,
6115
6188
  toggleVisibility: p,
6116
6189
  toggleLock: m,
@@ -6122,7 +6195,7 @@ const nl = (e) => {
6122
6195
  removeFromGroup: S,
6123
6196
  createEmptyGroup: v,
6124
6197
  findElementById: L,
6125
- findParentGroup: b,
6198
+ findParentGroup: x,
6126
6199
  generateAllPreviews: M
6127
6200
  } = ni({
6128
6201
  ...l,
@@ -6130,41 +6203,41 @@ const nl = (e) => {
6130
6203
  previewBackgroundColor: u
6131
6204
  });
6132
6205
  W(() => {
6133
- n && x.length > 0 && M();
6134
- }, [n, x.length, u, M]);
6206
+ n && C.length > 0 && M();
6207
+ }, [n, C.length, u, M]);
6135
6208
  const R = qo(), F = N(
6136
- (Q) => {
6209
+ (Z) => {
6137
6210
  var se;
6138
- return R((se = L(Q.id)) == null ? void 0 : se.name);
6211
+ return R((se = L(Z.id)) == null ? void 0 : se.name);
6139
6212
  },
6140
6213
  [R, L]
6141
- ), X = q(() => {
6142
- const Q = /* @__PURE__ */ new Map(), se = (H) => {
6143
- for (const xe of H)
6144
- Q.set(xe.id, xe), xe.children && se(xe.children);
6214
+ ), J = q(() => {
6215
+ const Z = /* @__PURE__ */ new Map(), se = (j) => {
6216
+ for (const ke of j)
6217
+ Z.set(ke.id, ke), ke.children && se(ke.children);
6145
6218
  };
6146
- return se(g), Q;
6219
+ return se(g), Z;
6147
6220
  }, [g]), pe = N(
6148
- (Q, se, H) => {
6149
- const xe = b(Q), ke = b(se);
6150
- xe && !ke ? S(Q, se, H) : D(Q, se, H);
6221
+ (Z, se, j) => {
6222
+ const ke = x(Z), ve = x(se);
6223
+ ke && !ve ? S(Z, se, j) : D(Z, se, j);
6151
6224
  },
6152
- [b, S, D]
6153
- ), J = tl({
6225
+ [x, S, D]
6226
+ ), Q = tl({
6154
6227
  onReorder: pe,
6155
6228
  onDropIntoGroup: y,
6156
- onDropIntoGroupAtPosition: (Q, se) => y(Q, se),
6229
+ onDropIntoGroupAtPosition: (Z, se) => y(Z, se),
6157
6230
  onGroupReorder: T,
6158
6231
  onRemoveFromGroup: S,
6159
- findParentGroup: b
6160
- }), re = (Q) => [...Q].reverse().map((H) => /* @__PURE__ */ j(te.Fragment, { children: [
6232
+ findParentGroup: x
6233
+ }), oe = (Z) => [...Z].reverse().map((j) => /* @__PURE__ */ P(te.Fragment, { children: [
6161
6234
  /* @__PURE__ */ f(
6162
6235
  rl,
6163
6236
  {
6164
- layer: H,
6165
- isOver: J.overId === H.id,
6166
- dropPosition: J.overId === H.id ? J.dropPosition : null,
6167
- isDragActive: !!J.activeId,
6237
+ layer: j,
6238
+ isOver: Q.overId === j.id,
6239
+ dropPosition: Q.overId === j.id ? Q.dropPosition : null,
6240
+ isDragActive: !!Q.activeId,
6168
6241
  showPreviewImages: n,
6169
6242
  previewDisplaySize: d,
6170
6243
  onSelect: w,
@@ -6172,23 +6245,23 @@ const nl = (e) => {
6172
6245
  onToggleLock: m,
6173
6246
  onDuplicate: A,
6174
6247
  onDelete: E,
6175
- deleteSuppressed: F(H)
6248
+ deleteSuppressed: F(j)
6176
6249
  }
6177
6250
  ),
6178
- H.children && re(H.children),
6179
- H.isGroup && /* @__PURE__ */ f(
6251
+ j.children && oe(j.children),
6252
+ j.isGroup && /* @__PURE__ */ f(
6180
6253
  ol,
6181
6254
  {
6182
- groupId: H.id,
6183
- isOver: J.overId === `group-footer::${H.id}`,
6184
- depth: H.depth
6255
+ groupId: j.id,
6256
+ isOver: Q.overId === `group-footer::${j.id}`,
6257
+ depth: j.depth
6185
6258
  }
6186
6259
  )
6187
- ] }, H.id)), Y = (Q) => [...Q].reverse().map((H) => /* @__PURE__ */ j(te.Fragment, { children: [
6260
+ ] }, j.id)), Y = (Z) => [...Z].reverse().map((j) => /* @__PURE__ */ P(te.Fragment, { children: [
6188
6261
  /* @__PURE__ */ f(
6189
6262
  al,
6190
6263
  {
6191
- layer: H,
6264
+ layer: j,
6192
6265
  showPreviewImages: n,
6193
6266
  previewDisplaySize: d,
6194
6267
  onSelect: w,
@@ -6196,27 +6269,27 @@ const nl = (e) => {
6196
6269
  onToggleLock: m,
6197
6270
  onDuplicate: A,
6198
6271
  onDelete: E,
6199
- deleteSuppressed: F(H)
6272
+ deleteSuppressed: F(j)
6200
6273
  }
6201
6274
  ),
6202
- H.children && Y(H.children)
6203
- ] }, H.id)), ee = J.activeId ? X.get(J.activeId) : null, { width: ge, height: we, flex: oe, ...ue } = i, ze = ge || (s.includes("w-full") ? "100%" : e ? `${e}px` : void 0), Se = t || we || void 0, Oe = oe !== void 0 ? oe : Se === "100%" || Se === "100vh" ? 1 : void 0;
6204
- return /* @__PURE__ */ j(
6275
+ j.children && Y(j.children)
6276
+ ] }, j.id)), ee = Q.activeId ? J.get(Q.activeId) : null, { width: ge, height: xe, flex: ie, ...ce } = i, Pe = ge || (s.includes("w-full") ? "100%" : e ? `${e}px` : void 0), Ne = t || xe || void 0, De = ie !== void 0 ? ie : Ne === "100%" || Ne === "100vh" ? 1 : void 0;
6277
+ return /* @__PURE__ */ P(
6205
6278
  "div",
6206
6279
  {
6207
6280
  className: `sc-layers-panel ${s}`,
6208
6281
  style: {
6209
- width: ze,
6210
- height: Se,
6211
- flex: Oe,
6282
+ width: Pe,
6283
+ height: Ne,
6284
+ flex: De,
6212
6285
  display: "flex",
6213
6286
  flexDirection: "column",
6214
6287
  backgroundColor: "transparent",
6215
6288
  minHeight: 0,
6216
- ...ue
6289
+ ...ce
6217
6290
  },
6218
6291
  children: [
6219
- (a || o) && /* @__PURE__ */ j(
6292
+ (a || o) && /* @__PURE__ */ P(
6220
6293
  "div",
6221
6294
  {
6222
6295
  style: {
@@ -6231,13 +6304,13 @@ const nl = (e) => {
6231
6304
  justifyContent: "space-between"
6232
6305
  },
6233
6306
  children: [
6234
- a && /* @__PURE__ */ j("span", { children: [
6307
+ a && /* @__PURE__ */ P("span", { children: [
6235
6308
  "Layers (",
6236
- x.length,
6309
+ C.length,
6237
6310
  ")"
6238
6311
  ] }),
6239
6312
  !a && /* @__PURE__ */ f("span", {}),
6240
- o && /* @__PURE__ */ j(
6313
+ o && /* @__PURE__ */ P(
6241
6314
  "button",
6242
6315
  {
6243
6316
  onClick: v,
@@ -6253,7 +6326,7 @@ const nl = (e) => {
6253
6326
  gap: 4
6254
6327
  },
6255
6328
  children: [
6256
- /* @__PURE__ */ f($, { icon: "lucide:folder-plus", style: { fontSize: 16 } }),
6329
+ /* @__PURE__ */ f(H, { icon: "lucide:folder-plus", style: { fontSize: 16 } }),
6257
6330
  "Add Group"
6258
6331
  ]
6259
6332
  }
@@ -6261,19 +6334,19 @@ const nl = (e) => {
6261
6334
  ]
6262
6335
  }
6263
6336
  ),
6264
- /* @__PURE__ */ j("div", { style: { flex: 1, overflow: "auto", minHeight: 0 }, children: [
6265
- g.length > 0 ? r ? /* @__PURE__ */ j(
6337
+ /* @__PURE__ */ P("div", { style: { flex: 1, overflow: "auto", minHeight: 0 }, children: [
6338
+ g.length > 0 ? r ? /* @__PURE__ */ P(
6266
6339
  Ia,
6267
6340
  {
6268
- sensors: J.sensors,
6341
+ sensors: Q.sensors,
6269
6342
  collisionDetection: nl,
6270
- onDragStart: J.onDragStart,
6271
- onDragMove: J.onDragMove,
6272
- onDragOver: J.onDragOver,
6273
- onDragEnd: J.onDragEnd,
6274
- onDragCancel: J.onDragCancel,
6343
+ onDragStart: Q.onDragStart,
6344
+ onDragMove: Q.onDragMove,
6345
+ onDragOver: Q.onDragOver,
6346
+ onDragEnd: Q.onDragEnd,
6347
+ onDragCancel: Q.onDragCancel,
6275
6348
  children: [
6276
- re(g),
6349
+ oe(g),
6277
6350
  /* @__PURE__ */ f(Ja, { dropAnimation: null, children: ee ? /* @__PURE__ */ f(
6278
6351
  il,
6279
6352
  {
@@ -6324,10 +6397,10 @@ const nl = (e) => {
6324
6397
  gap: 8,
6325
6398
  cursor: "pointer"
6326
6399
  };
6327
- return (c || e.isGroup) && (h.backgroundColor = "var(--surface-secondary, rgba(0,0,0,0.04))"), e.isGroup ? /* @__PURE__ */ j("div", { style: h, children: [
6328
- /* @__PURE__ */ f($, { icon: "lucide:folder-open", style: { fontSize: 18, color: "var(--text-secondary, #888)" } }),
6400
+ return (c || e.isGroup) && (h.backgroundColor = "var(--surface-secondary, rgba(0,0,0,0.04))"), e.isGroup ? /* @__PURE__ */ P("div", { style: h, children: [
6401
+ /* @__PURE__ */ f(H, { icon: "lucide:folder-open", style: { fontSize: 18, color: "var(--text-secondary, #888)" } }),
6329
6402
  /* @__PURE__ */ f("span", { onClick: () => r(e.id), style: { fontSize: 13, fontWeight: 600, flex: 1 }, children: e.name })
6330
- ] }, e.id) : /* @__PURE__ */ j("div", { style: h, children: [
6403
+ ] }, e.id) : /* @__PURE__ */ P("div", { style: h, children: [
6331
6404
  t && e.previewUrl ? /* @__PURE__ */ f(
6332
6405
  "img",
6333
6406
  {
@@ -6361,37 +6434,37 @@ const nl = (e) => {
6361
6434
  ...d
6362
6435
  },
6363
6436
  onClick: () => r(e.id),
6364
- children: /* @__PURE__ */ f($, { icon: U.fileText })
6437
+ children: /* @__PURE__ */ f(H, { icon: U.fileText })
6365
6438
  }
6366
6439
  ),
6367
6440
  /* @__PURE__ */ f("div", { style: { flex: 1 }, onClick: () => r(e.id) }),
6368
- /* @__PURE__ */ j("div", { style: { display: "flex", gap: 4 }, children: [
6441
+ /* @__PURE__ */ P("div", { style: { display: "flex", gap: 4 }, children: [
6369
6442
  /* @__PURE__ */ f(
6370
- Be,
6443
+ Ue,
6371
6444
  {
6372
6445
  title: e.visible ? "Hide" : "Show",
6373
6446
  onClick: () => o(e.id),
6374
6447
  style: { opacity: e.visible ? 1 : 0.4 },
6375
- children: /* @__PURE__ */ f($, { icon: e.visible ? U.eye : U.eyeOff, className: "sc:size-6" })
6448
+ children: /* @__PURE__ */ f(H, { icon: e.visible ? U.eye : U.eyeOff, className: "sc:size-6" })
6376
6449
  }
6377
6450
  ),
6378
6451
  /* @__PURE__ */ f(
6379
- Be,
6452
+ Ue,
6380
6453
  {
6381
6454
  title: e.locked ? "Unlock" : "Lock",
6382
6455
  onClick: () => i(e.id),
6383
6456
  style: { opacity: e.locked ? 1 : 0.4 },
6384
- children: /* @__PURE__ */ f($, { icon: e.locked ? U.lock : U.lockOpen, className: "sc:size-6" })
6457
+ children: /* @__PURE__ */ f(H, { icon: e.locked ? U.lock : U.lockOpen, className: "sc:size-6" })
6385
6458
  }
6386
6459
  ),
6387
- /* @__PURE__ */ f(Be, { title: "Duplicate", onClick: () => s(e.id), children: /* @__PURE__ */ f($, { icon: U.copy, className: "sc:size-6" }) }),
6460
+ /* @__PURE__ */ f(Ue, { title: "Duplicate", onClick: () => s(e.id), children: /* @__PURE__ */ f(H, { icon: U.copy, className: "sc:size-6" }) }),
6388
6461
  !l && /* @__PURE__ */ f(
6389
- Be,
6462
+ Ue,
6390
6463
  {
6391
6464
  title: "Delete",
6392
6465
  onClick: () => a(e.id),
6393
6466
  style: { color: "var(--error, #ef4444)" },
6394
- children: /* @__PURE__ */ f($, { icon: U.trash, className: "sc:size-6" })
6467
+ children: /* @__PURE__ */ f(H, { icon: U.trash, className: "sc:size-6" })
6395
6468
  }
6396
6469
  )
6397
6470
  ] })
@@ -6500,7 +6573,7 @@ class jl {
6500
6573
  }
6501
6574
  const No = Xe(null);
6502
6575
  function Qn(e) {
6503
- const t = je(No);
6576
+ const t = $e(No);
6504
6577
  if (!t)
6505
6578
  throw new Pt(
6506
6579
  "E_OUTSIDE_ROOT",
@@ -6517,7 +6590,7 @@ function Zn(e) {
6517
6590
  );
6518
6591
  }
6519
6592
  function Zt(e, t) {
6520
- const n = je(No), r = (n == null ? void 0 : n.registry) ?? null, o = Lr(), i = t == null ? void 0 : t.mockupId, s = t == null ? void 0 : t.floatingToolbar, a = q(
6593
+ const n = $e(No), r = (n == null ? void 0 : n.registry) ?? null, o = Lr(), i = t == null ? void 0 : t.mockupId, s = t == null ? void 0 : t.floatingToolbar, a = q(
6521
6594
  () => ({
6522
6595
  ...i !== void 0 ? { mockupId: i } : {},
6523
6596
  ...s !== void 0 ? { floatingToolbar: s } : {}
@@ -6532,7 +6605,7 @@ function Zt(e, t) {
6532
6605
  function Hl(e) {
6533
6606
  return {
6534
6607
  reportInvariant(t) {
6535
- if (Ko()) throw t;
6608
+ if (Xo()) throw t;
6536
6609
  e(t);
6537
6610
  },
6538
6611
  reportRuntimeError(t) {
@@ -6577,7 +6650,7 @@ function ul({
6577
6650
  flexDirection: t === "horizontal" ? "row" : "column",
6578
6651
  gap: 4
6579
6652
  },
6580
- children: r.length === 0 ? /* @__PURE__ */ f("div", { style: { padding: 12, fontSize: 12, color: "var(--text-secondary, #999)" }, children: "No layers" }) : r.map((o) => /* @__PURE__ */ j(
6653
+ children: r.length === 0 ? /* @__PURE__ */ f("div", { style: { padding: 12, fontSize: 12, color: "var(--text-secondary, #999)" }, children: "No layers" }) : r.map((o) => /* @__PURE__ */ P(
6581
6654
  "div",
6582
6655
  {
6583
6656
  "data-sc-part": "layers-item",
@@ -6592,7 +6665,7 @@ function ul({
6592
6665
  opacity: o.visible ? 1 : 0.4
6593
6666
  },
6594
6667
  children: [
6595
- /* @__PURE__ */ f($, { icon: dl(o.kind), style: { fontSize: 18, color: "var(--text-secondary, #888)", flexShrink: 0 } }),
6668
+ /* @__PURE__ */ f(H, { icon: dl(o.kind), style: { fontSize: 18, color: "var(--text-secondary, #888)", flexShrink: 0 } }),
6596
6669
  /* @__PURE__ */ f(
6597
6670
  "span",
6598
6671
  {
@@ -6639,7 +6712,7 @@ const zo = ({
6639
6712
  className: l = "",
6640
6713
  contentClassName: c = ""
6641
6714
  }) => {
6642
- const u = G(null), d = G(null), h = G(null), [g, x] = B({}), [w, p] = B(!1), m = (A) => {
6715
+ const u = G(null), d = G(null), h = G(null), [g, C] = B({}), [w, p] = B(!1), m = (A) => {
6643
6716
  A.stopPropagation(), !n && a && es.protectNextClick(), r(!n);
6644
6717
  };
6645
6718
  W(() => {
@@ -6648,8 +6721,8 @@ const zo = ({
6648
6721
  };
6649
6722
  const D = setTimeout(() => {
6650
6723
  const T = (y) => {
6651
- var b, M;
6652
- const S = y.target, v = (b = u.current) == null ? void 0 : b.contains(S), L = (M = h.current) == null ? void 0 : M.contains(S);
6724
+ var x, M;
6725
+ const S = y.target, v = (x = u.current) == null ? void 0 : x.contains(S), L = (M = h.current) == null ? void 0 : M.contains(S);
6653
6726
  !v && !L && r(!1);
6654
6727
  };
6655
6728
  document.addEventListener("mousedown", T), A = () => document.removeEventListener("mousedown", T);
@@ -6677,15 +6750,15 @@ const zo = ({
6677
6750
  requestAnimationFrame(() => {
6678
6751
  const D = d.current, T = h.current;
6679
6752
  if (!D || !T) return;
6680
- const y = D.getBoundingClientRect(), S = T.getBoundingClientRect(), v = window.innerWidth, L = window.innerHeight, b = 16;
6753
+ const y = D.getBoundingClientRect(), S = T.getBoundingClientRect(), v = window.innerWidth, L = window.innerHeight, x = 16;
6681
6754
  let M = 0, R = 0;
6682
- if (o === "bottom" || o === "top" ? (o === "bottom" ? M = y.bottom + s : M = y.top - S.height - s, i === "start" ? R = y.left : i === "end" ? R = y.right - S.width : i === "center" && (R = y.left + (y.width - S.width) / 2)) : (o === "left" || o === "right") && (o === "left" ? R = y.left - S.width - s : R = y.right + s, i === "start" ? M = y.top : i === "end" ? M = y.bottom - S.height : i === "center" && (M = y.top + (y.height - S.height) / 2)), i !== "end" && R + S.width > v - b && (R = v - S.width - b), R < b && (R = b), M + S.height > L - b) {
6683
- const X = y.top, pe = L - y.bottom;
6684
- X > pe && (M = y.top - S.height - s);
6755
+ if (o === "bottom" || o === "top" ? (o === "bottom" ? M = y.bottom + s : M = y.top - S.height - s, i === "start" ? R = y.left : i === "end" ? R = y.right - S.width : i === "center" && (R = y.left + (y.width - S.width) / 2)) : (o === "left" || o === "right") && (o === "left" ? R = y.left - S.width - s : R = y.right + s, i === "start" ? M = y.top : i === "end" ? M = y.bottom - S.height : i === "center" && (M = y.top + (y.height - S.height) / 2)), i !== "end" && R + S.width > v - x && (R = v - S.width - x), R < x && (R = x), M + S.height > L - x) {
6756
+ const J = y.top, pe = L - y.bottom;
6757
+ J > pe && (M = y.top - S.height - s);
6685
6758
  }
6686
- M < b && (M = b);
6687
- const F = v - b * 2;
6688
- p(!0), x({
6759
+ M < x && (M = x);
6760
+ const F = v - x * 2;
6761
+ p(!0), C({
6689
6762
  position: "fixed",
6690
6763
  top: `${M}px`,
6691
6764
  left: `${R}px`,
@@ -6710,7 +6783,7 @@ const zo = ({
6710
6783
  children: t
6711
6784
  }
6712
6785
  );
6713
- return /* @__PURE__ */ j("div", { className: `sc:relative sc:inline-flex ${l}`.trim(), ref: u, children: [
6786
+ return /* @__PURE__ */ P("div", { className: `sc:relative sc:inline-flex ${l}`.trim(), ref: u, children: [
6714
6787
  /* @__PURE__ */ f("div", { ref: d, onClick: m, children: e }),
6715
6788
  E && On(
6716
6789
  /* @__PURE__ */ f("div", { className: "sc-root", style: { display: "contents" }, children: E }),
@@ -6728,45 +6801,13 @@ const zo = ({
6728
6801
  children: e
6729
6802
  }
6730
6803
  );
6731
- }, Ke = ({
6732
- icon: e,
6733
- label: t,
6734
- shortcut: n,
6735
- active: r = !1,
6736
- disabled: o = !1,
6737
- onClick: i,
6738
- className: s = "",
6739
- children: a,
6740
- ...l
6741
- }) => {
6742
- const c = [
6743
- "sc:flex sc:items-center sc:gap-md",
6744
- "sc:px-lg sc:py-md",
6745
- "sc:bg-transparent sc:border-none",
6746
- "sc:rounded-lg",
6747
- "sc:text-text-primary sc:text-base sc:font-normal",
6748
- "sc:cursor-pointer",
6749
- "sc:transition-all sc:duration-fast",
6750
- "sc:text-left sc:w-full"
6751
- ], u = [
6752
- r ? "sc:bg-accent-light sc:font-medium" : "",
6753
- o ? "sc:opacity-disabled sc:cursor-not-allowed" : "sc:hover:bg-bg-hover"
6754
- ], d = [...c, ...u, s].filter(Boolean).join(" ");
6755
- return /* @__PURE__ */ j("button", { role: "menuitem", className: d, onClick: () => {
6756
- !o && i && i();
6757
- }, disabled: o, type: "button", ...l, children: [
6758
- e && /* @__PURE__ */ f("span", { className: "sc:flex sc:shrink-0 sc:items-center", children: e }),
6759
- /* @__PURE__ */ f("span", { className: "sc:flex-1", children: a || t }),
6760
- n && /* @__PURE__ */ f("span", { className: "sc:ml-auto sc:text-sm sc:text-text-muted", children: n }),
6761
- r && !n && /* @__PURE__ */ f("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", className: "sc:ml-auto sc:shrink-0", children: /* @__PURE__ */ f("path", { d: "M13 4L6 11L3 8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
6762
- ] });
6763
6804
  }, Oo = [
6764
- { type: "custom", label: "Text", icon: /* @__PURE__ */ f($, { icon: U.text, className: "sc:size-[18px]" }) },
6765
- { type: "image", label: "Image", icon: /* @__PURE__ */ f($, { icon: U.image, className: "sc:size-[18px]" }) },
6766
- { type: "shape", label: "Shape", icon: /* @__PURE__ */ f($, { icon: U.shapes, className: "sc:size-[18px]" }) },
6767
- { type: "circle", label: "Circle Text", icon: /* @__PURE__ */ f($, { icon: "lucide:circle", className: "sc:size-[18px]" }) },
6768
- { type: "wave", label: "Wave Text", icon: /* @__PURE__ */ f($, { icon: "lucide:waves", className: "sc:size-[18px]" }) },
6769
- { type: "arch", label: "Arch Text", icon: /* @__PURE__ */ f($, { icon: "lucide:arrow-up-from-dot", className: "sc:size-[18px]" }) }
6805
+ { type: "custom", label: "Text", icon: /* @__PURE__ */ f(H, { icon: U.text, className: "sc:size-[18px]" }) },
6806
+ { type: "image", label: "Image", icon: /* @__PURE__ */ f(H, { icon: U.image, className: "sc:size-[18px]" }) },
6807
+ { type: "shape", label: "Shape", icon: /* @__PURE__ */ f(H, { icon: U.shapes, className: "sc:size-[18px]" }) },
6808
+ { type: "circle", label: "Circle Text", icon: /* @__PURE__ */ f(H, { icon: "lucide:circle", className: "sc:size-[18px]" }) },
6809
+ { type: "wave", label: "Wave Text", icon: /* @__PURE__ */ f(H, { icon: "lucide:waves", className: "sc:size-[18px]" }) },
6810
+ { type: "arch", label: "Arch Text", icon: /* @__PURE__ */ f(H, { icon: "lucide:arrow-up-from-dot", className: "sc:size-[18px]" }) }
6770
6811
  ];
6771
6812
  function fl() {
6772
6813
  const [e, t] = te.useState(!1);
@@ -6796,7 +6837,7 @@ const hl = ({
6796
6837
  headerActions: d,
6797
6838
  hideVisibleTitle: h = !1,
6798
6839
  hideHandle: g = !1,
6799
- disableScrollWrapper: x = !1,
6840
+ disableScrollWrapper: C = !1,
6800
6841
  disableOverflowHidden: w = !1,
6801
6842
  "data-testid": p
6802
6843
  }) => {
@@ -6806,7 +6847,7 @@ const hl = ({
6806
6847
  {
6807
6848
  open: e,
6808
6849
  onOpenChange: (D) => !D && t(),
6809
- children: /* @__PURE__ */ j(
6850
+ children: /* @__PURE__ */ P(
6810
6851
  ao,
6811
6852
  {
6812
6853
  placement: i,
@@ -6827,12 +6868,12 @@ const hl = ({
6827
6868
  children: [
6828
6869
  /* @__PURE__ */ f(lo, { className: "sc:sr-only", children: n }),
6829
6870
  r && /* @__PURE__ */ f(co, { className: "sc:sr-only", children: r }),
6830
- x ? (
6871
+ C ? (
6831
6872
  // Custom scroll control - children manage their own scrolling
6832
- /* @__PURE__ */ j("div", { className: "sc:flex sc:flex-col sc:flex-1 sc:min-h-0", children: [
6833
- (!h || d || u) && /* @__PURE__ */ j("div", { className: "sc:border-border-primary sc:flex sc:shrink-0 sc:items-center sc:justify-between sc:gap-4 sc:border-b sc:px-6 sc:py-4", children: [
6873
+ /* @__PURE__ */ P("div", { className: "sc:flex sc:flex-col sc:flex-1 sc:min-h-0", children: [
6874
+ (!h || d || u) && /* @__PURE__ */ P("div", { className: "sc:border-border-primary sc:flex sc:shrink-0 sc:items-center sc:justify-between sc:gap-4 sc:border-b sc:px-6 sc:py-4", children: [
6834
6875
  !h && /* @__PURE__ */ f("h2", { className: "sc:text-foreground sc:text-lg sc:font-semibold", children: n }),
6835
- /* @__PURE__ */ j("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
6876
+ /* @__PURE__ */ P("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
6836
6877
  d,
6837
6878
  u && /* @__PURE__ */ f(
6838
6879
  rt,
@@ -6842,7 +6883,7 @@ const hl = ({
6842
6883
  onClick: t,
6843
6884
  className: "sc:min-w-8 sc:px-2",
6844
6885
  "aria-label": "Close drawer",
6845
- children: /* @__PURE__ */ f($, { icon: U.close, className: "sc:size-6" })
6886
+ children: /* @__PURE__ */ f(H, { icon: U.close, className: "sc:size-6" })
6846
6887
  }
6847
6888
  )
6848
6889
  ] })
@@ -6851,10 +6892,10 @@ const hl = ({
6851
6892
  ] })
6852
6893
  ) : (
6853
6894
  // Default: built-in overflow-y-auto wrapper
6854
- /* @__PURE__ */ j("div", { className: "sc:flex-1 sc:overflow-y-auto sc:min-h-0", children: [
6855
- (!h || d || u) && /* @__PURE__ */ j("div", { className: "sc:border-border-primary sc:flex sc:shrink-0 sc:items-center sc:justify-between sc:gap-4 sc:border-b sc:px-6 sc:py-4", children: [
6895
+ /* @__PURE__ */ P("div", { className: "sc:flex-1 sc:overflow-y-auto sc:min-h-0", children: [
6896
+ (!h || d || u) && /* @__PURE__ */ P("div", { className: "sc:border-border-primary sc:flex sc:shrink-0 sc:items-center sc:justify-between sc:gap-4 sc:border-b sc:px-6 sc:py-4", children: [
6856
6897
  !h && /* @__PURE__ */ f("h2", { className: "sc:text-foreground sc:text-lg sc:font-semibold", children: n }),
6857
- /* @__PURE__ */ j("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
6898
+ /* @__PURE__ */ P("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
6858
6899
  d,
6859
6900
  u && /* @__PURE__ */ f(
6860
6901
  rt,
@@ -6864,7 +6905,7 @@ const hl = ({
6864
6905
  onClick: t,
6865
6906
  className: "sc:min-w-8 sc:px-2",
6866
6907
  "aria-label": "Close drawer",
6867
- children: /* @__PURE__ */ f($, { icon: U.close, className: "sc:size-6" })
6908
+ children: /* @__PURE__ */ f(H, { icon: U.close, className: "sc:size-6" })
6868
6909
  }
6869
6910
  )
6870
6911
  ] })
@@ -6918,7 +6959,7 @@ const hl = ({
6918
6959
  const o = r ? "Change Shape" : "Select Shape", i = r ? "Select a new shape type" : "Choose a shape to add", s = (a) => {
6919
6960
  n(a), t();
6920
6961
  };
6921
- return /* @__PURE__ */ j(
6962
+ return /* @__PURE__ */ P(
6922
6963
  hl,
6923
6964
  {
6924
6965
  isOpen: e,
@@ -6931,7 +6972,7 @@ const hl = ({
6931
6972
  showCloseButton: !1,
6932
6973
  "data-testid": "shape-type-drawer",
6933
6974
  children: [
6934
- /* @__PURE__ */ j("div", { className: "sc:px-6 sc:pt-1 sc:pb-2 sc:flex sc:items-center sc:justify-between", children: [
6975
+ /* @__PURE__ */ P("div", { className: "sc:px-6 sc:pt-1 sc:pb-2 sc:flex sc:items-center sc:justify-between", children: [
6935
6976
  /* @__PURE__ */ f("h3", { className: "sc:text-lg sc:font-semibold sc:tracking-tight sc:text-foreground", children: o }),
6936
6977
  /* @__PURE__ */ f(
6937
6978
  "button",
@@ -6939,7 +6980,7 @@ const hl = ({
6939
6980
  onClick: t,
6940
6981
  className: "sc:size-11 sc:rounded-full sc:hover:bg-foreground/[0.06] sc:flex sc:items-center sc:justify-center sc:text-foreground/70 sc:-mr-2",
6941
6982
  "aria-label": "Close",
6942
- children: /* @__PURE__ */ f($, { icon: U.close, className: "sc:size-5" })
6983
+ children: /* @__PURE__ */ f(H, { icon: U.close, className: "sc:size-5" })
6943
6984
  }
6944
6985
  )
6945
6986
  ] }),
@@ -6950,7 +6991,7 @@ const hl = ({
6950
6991
  "data-testid": "shape-type-list",
6951
6992
  children: ml.map((a) => {
6952
6993
  const l = a.id === r;
6953
- return /* @__PURE__ */ j(
6994
+ return /* @__PURE__ */ P(
6954
6995
  "button",
6955
6996
  {
6956
6997
  type: "button",
@@ -6963,7 +7004,7 @@ const hl = ({
6963
7004
  "span",
6964
7005
  {
6965
7006
  className: l ? "sc:text-primary" : "sc:text-foreground/85",
6966
- children: a.reactIcon ? a.reactIcon : /* @__PURE__ */ f($, { icon: a.icon, className: Tn })
7007
+ children: a.reactIcon ? a.reactIcon : /* @__PURE__ */ f(H, { icon: a.icon, className: Tn })
6967
7008
  }
6968
7009
  ),
6969
7010
  /* @__PURE__ */ f(
@@ -6988,24 +7029,24 @@ const hl = ({
6988
7029
  onToggleLayersPanel: t,
6989
7030
  onOpenImageBrowser: n,
6990
7031
  additionalItems: r,
6991
- icon: o = /* @__PURE__ */ f($, { icon: U.menu, className: "sc:size-6" }),
7032
+ icon: o = /* @__PURE__ */ f(H, { icon: U.menu, className: "sc:size-6" }),
6992
7033
  tooltip: i = "Menu",
6993
7034
  className: s
6994
7035
  }) => {
6995
7036
  var S;
6996
- const { get: a } = Tr(), [l, c] = B(!1), [u, d] = B(!1), [h, g] = B(!1), x = G(null), w = async () => {
7037
+ const { get: a } = Tr(), [l, c] = B(!1), [u, d] = B(!1), [h, g] = B(!1), C = G(null), w = async () => {
6997
7038
  try {
6998
- const { ExportManager: v } = await import("./ExportManager-B8Td7uR5.js").then((R) => R.S), { artboardManager: L, elements: b } = a(), M = L.getAllArtboards();
6999
- v.exportToJSON(M, b, L), c(!1);
7039
+ const { ExportManager: v } = await import("./ExportManager-DUdis6se.js").then((R) => R.Y), { artboardManager: L, elements: x } = a(), M = L.getAllArtboards();
7040
+ v.exportToJSON(M, x, L), c(!1);
7000
7041
  } catch (v) {
7001
7042
  mn.error("Failed to save workspace:", v), alert("Failed to save workspace. Please try again.");
7002
7043
  }
7003
7044
  }, p = () => {
7004
7045
  var v;
7005
- (v = x.current) == null || v.click(), c(!1);
7046
+ (v = C.current) == null || v.click(), c(!1);
7006
7047
  }, m = async (v) => {
7007
- var b;
7008
- const L = (b = v.target.files) == null ? void 0 : b[0];
7048
+ var x;
7049
+ const L = (x = v.target.files) == null ? void 0 : x[0];
7009
7050
  if (L) {
7010
7051
  try {
7011
7052
  const M = await on.importFromJSON(L);
@@ -7035,11 +7076,11 @@ This will replace your current workspace. Continue?`
7035
7076
  } catch (M) {
7036
7077
  mn.error("Failed to load workspace:", M), alert("Failed to load workspace. Please check the file and try again.");
7037
7078
  }
7038
- x.current && (x.current.value = "");
7079
+ C.current && (C.current.value = "");
7039
7080
  }
7040
7081
  }, E = async () => {
7041
- const { artboardManager: v, elements: L, canvasRef: b } = a();
7042
- if (!(b != null && b.current)) {
7082
+ const { artboardManager: v, elements: L, canvasRef: x } = a();
7083
+ if (!(x != null && x.current)) {
7043
7084
  alert("Canvas not available for export");
7044
7085
  return;
7045
7086
  }
@@ -7049,8 +7090,8 @@ This will replace your current workspace. Continue?`
7049
7090
  return;
7050
7091
  }
7051
7092
  try {
7052
- const { ExportManager: R } = await import("./ExportManager-B8Td7uR5.js").then((F) => F.S);
7053
- await R.exportArtboardToImage(M, L, b.current, {
7093
+ const { ExportManager: R } = await import("./ExportManager-DUdis6se.js").then((F) => F.Y);
7094
+ await R.exportArtboardToImage(M, L, x.current, {
7054
7095
  format: "png",
7055
7096
  scale: 2,
7056
7097
  transparentBackground: !1
@@ -7071,11 +7112,11 @@ This will replace your current workspace. Continue?`
7071
7112
  }, D = async (v) => {
7072
7113
  g(!1), await a().handleAddElement("shape", { shapeType: v });
7073
7114
  }, T = Oo, y = () => /* @__PURE__ */ f("div", { className: "sc:my-xs sc:h-px sc:bg-border-primary" });
7074
- return /* @__PURE__ */ j(nn, { children: [
7115
+ return /* @__PURE__ */ P(nn, { children: [
7075
7116
  /* @__PURE__ */ f(
7076
7117
  zo,
7077
7118
  {
7078
- trigger: /* @__PURE__ */ j(Bn, { delayDuration: 0, children: [
7119
+ trigger: /* @__PURE__ */ P(Bn, { delayDuration: 0, children: [
7079
7120
  /* @__PURE__ */ f(_t, { asChild: !0, children: /* @__PURE__ */ f(
7080
7121
  rt,
7081
7122
  {
@@ -7086,21 +7127,21 @@ This will replace your current workspace. Continue?`
7086
7127
  children: o
7087
7128
  }
7088
7129
  ) }),
7089
- /* @__PURE__ */ f(kt, { children: /* @__PURE__ */ f("p", { children: i }) })
7130
+ /* @__PURE__ */ f(Ct, { children: /* @__PURE__ */ f("p", { children: i }) })
7090
7131
  ] }),
7091
7132
  isOpen: l,
7092
7133
  onToggle: c,
7093
7134
  position: "bottom",
7094
7135
  align: "end",
7095
- children: /* @__PURE__ */ j(Rn, { minWidth: "200px", children: [
7096
- /* @__PURE__ */ j(
7136
+ children: /* @__PURE__ */ P(Rn, { minWidth: "200px", children: [
7137
+ /* @__PURE__ */ P(
7097
7138
  "div",
7098
7139
  {
7099
7140
  style: { position: "relative" },
7100
7141
  onMouseEnter: () => d(!0),
7101
7142
  onMouseLeave: () => d(!1),
7102
7143
  children: [
7103
- /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f($, { icon: U.plus, className: "sc:size-[18px]" }), label: "Add Element" }),
7144
+ /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f(H, { icon: U.plus, className: "sc:size-[18px]" }), label: "Add Element" }),
7104
7145
  u && /* @__PURE__ */ f(
7105
7146
  "div",
7106
7147
  {
@@ -7125,23 +7166,23 @@ This will replace your current workspace. Continue?`
7125
7166
  }
7126
7167
  ),
7127
7168
  /* @__PURE__ */ f(y, {}),
7128
- /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f($, { icon: U.save, className: "sc:size-[18px]" }), label: "Save", onClick: w }),
7129
- /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f($, { icon: U.folderOpen, className: "sc:size-[18px]" }), label: "Open", onClick: p }),
7169
+ /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f(H, { icon: U.save, className: "sc:size-[18px]" }), label: "Save", onClick: w }),
7170
+ /* @__PURE__ */ f(Ke, { icon: /* @__PURE__ */ f(H, { icon: U.folderOpen, className: "sc:size-[18px]" }), label: "Open", onClick: p }),
7130
7171
  /* @__PURE__ */ f(
7131
7172
  Ke,
7132
7173
  {
7133
- icon: /* @__PURE__ */ f($, { icon: U.download, className: "sc:size-[18px]" }),
7174
+ icon: /* @__PURE__ */ f(H, { icon: U.download, className: "sc:size-[18px]" }),
7134
7175
  label: "Export Image",
7135
7176
  onClick: E,
7136
7177
  disabled: !((S = a().canvasRef) != null && S.current)
7137
7178
  }
7138
7179
  ),
7139
- t && /* @__PURE__ */ j(nn, { children: [
7180
+ t && /* @__PURE__ */ P(nn, { children: [
7140
7181
  /* @__PURE__ */ f(y, {}),
7141
7182
  /* @__PURE__ */ f(
7142
7183
  Ke,
7143
7184
  {
7144
- icon: /* @__PURE__ */ f($, { icon: U.layers, className: "sc:size-[18px]" }),
7185
+ icon: /* @__PURE__ */ f(H, { icon: U.layers, className: "sc:size-[18px]" }),
7145
7186
  label: `${e ? "Hide" : "Show"} Layers`,
7146
7187
  onClick: () => {
7147
7188
  t(), c(!1);
@@ -7149,7 +7190,7 @@ This will replace your current workspace. Continue?`
7149
7190
  }
7150
7191
  )
7151
7192
  ] }),
7152
- r && /* @__PURE__ */ j(nn, { children: [
7193
+ r && /* @__PURE__ */ P(nn, { children: [
7153
7194
  /* @__PURE__ */ f(y, {}),
7154
7195
  r
7155
7196
  ] })
@@ -7159,7 +7200,7 @@ This will replace your current workspace. Continue?`
7159
7200
  /* @__PURE__ */ f(
7160
7201
  "input",
7161
7202
  {
7162
- ref: x,
7203
+ ref: C,
7163
7204
  type: "file",
7164
7205
  accept: ".json",
7165
7206
  style: { display: "none" },
@@ -7185,7 +7226,7 @@ function Po({
7185
7226
  return W(() => {
7186
7227
  if (!t || o) return;
7187
7228
  let s = !1;
7188
- return import("./ImagePanel-CN2Bu3hf.js").then(
7229
+ return import("./ImagePanel-CBgGqmVV.js").then(
7189
7230
  (a) => {
7190
7231
  s || i(() => a.ImagePanel);
7191
7232
  },
@@ -7206,7 +7247,7 @@ function Po({
7206
7247
  function Bl({ className: e, style: t }) {
7207
7248
  Zn("Editor.Menu"), Zt("Editor.Menu");
7208
7249
  const [n, r] = B(!1);
7209
- return /* @__PURE__ */ j("div", { "data-sc-part": "menu", className: e, style: t, children: [
7250
+ return /* @__PURE__ */ P("div", { "data-sc-part": "menu", className: e, style: t, children: [
7210
7251
  /* @__PURE__ */ f(vl, { onOpenImageBrowser: () => r(!0) }),
7211
7252
  /* @__PURE__ */ f(
7212
7253
  Po,
@@ -7219,8 +7260,8 @@ function Bl({ className: e, style: t }) {
7219
7260
  ] });
7220
7261
  }
7221
7262
  const yl = () => {
7222
- const { undo: e, redo: t, canUndo: n, canRedo: r } = Xo();
7223
- return /* @__PURE__ */ j("div", { className: "sc-undo-redo", style: { display: "inline-flex", gap: 4 }, children: [
7263
+ const { undo: e, redo: t, canUndo: n, canRedo: r } = Ko();
7264
+ return /* @__PURE__ */ P("div", { className: "sc-undo-redo", style: { display: "inline-flex", gap: 4 }, children: [
7224
7265
  /* @__PURE__ */ f(
7225
7266
  En,
7226
7267
  {
@@ -7261,13 +7302,13 @@ function Ul({ className: e, style: t }) {
7261
7302
  }, u = async (d) => {
7262
7303
  s(!1), await n().handleAddElement("shape", { shapeType: d });
7263
7304
  };
7264
- return /* @__PURE__ */ j("div", { "data-sc-part": "add", className: e, style: t, children: [
7305
+ return /* @__PURE__ */ P("div", { "data-sc-part": "add", className: e, style: t, children: [
7265
7306
  /* @__PURE__ */ f(
7266
7307
  zo,
7267
7308
  {
7268
- trigger: /* @__PURE__ */ j(Bn, { delayDuration: 0, children: [
7269
- /* @__PURE__ */ f(_t, { asChild: !0, children: /* @__PURE__ */ f(rt, { variant: "ghost", size: "icon", "aria-label": "Add element", children: /* @__PURE__ */ f($, { icon: U.plus, className: "sc:size-6" }) }) }),
7270
- /* @__PURE__ */ f(kt, { children: /* @__PURE__ */ f("p", { children: "Add element" }) })
7309
+ trigger: /* @__PURE__ */ P(Bn, { delayDuration: 0, children: [
7310
+ /* @__PURE__ */ f(_t, { asChild: !0, children: /* @__PURE__ */ f(rt, { variant: "ghost", size: "icon", "aria-label": "Add element", children: /* @__PURE__ */ f(H, { icon: U.plus, className: "sc:size-6" }) }) }),
7311
+ /* @__PURE__ */ f(Ct, { children: /* @__PURE__ */ f("p", { children: "Add element" }) })
7271
7312
  ] }),
7272
7313
  isOpen: r,
7273
7314
  onToggle: o,
@@ -7313,24 +7354,24 @@ function Gl() {
7313
7354
  totalExports: 0,
7314
7355
  avgExportTime: 0,
7315
7356
  isWorkerActive: !1
7316
- }), x = G(0), w = G(null), p = sn.supportsWorkerExport(), m = N(async (v, L = {}) => {
7317
- const b = e.find((R) => R.id === v);
7318
- if (!b)
7357
+ }), C = G(0), w = G(null), p = sn.supportsWorkerExport(), m = N(async (v, L = {}) => {
7358
+ const x = e.find((R) => R.id === v);
7359
+ if (!x)
7319
7360
  throw new Error(`[useExport] Artboard ${v} not found`);
7320
7361
  if (!r.current)
7321
7362
  throw new Error("[useExport] Canvas ref not available");
7322
7363
  i(!0);
7323
7364
  const M = {
7324
7365
  artboardId: v,
7325
- artboardName: b.name,
7366
+ artboardName: x.name,
7326
7367
  status: "rendering",
7327
7368
  progress: 0,
7328
7369
  timestamp: Date.now()
7329
7370
  };
7330
7371
  c((R) => [...R, M]);
7331
7372
  try {
7332
- const R = Date.now(), F = A.current, X = t.getElementsOnArtboard(v), pe = F.filter((Y) => X.includes(Y.id)), J = await sn.exportArtboardToDataURL(
7333
- b,
7373
+ const R = Date.now(), F = A.current, J = t.getElementsOnArtboard(v), pe = F.filter((Y) => J.includes(Y.id)), Q = await sn.exportArtboardToDataURL(
7374
+ x,
7334
7375
  pe,
7335
7376
  r.current,
7336
7377
  {
@@ -7339,17 +7380,17 @@ function Gl() {
7339
7380
  transparentBackground: L.transparentBackground ?? !0,
7340
7381
  ...L
7341
7382
  }
7342
- ), re = Date.now() - R;
7383
+ ), oe = Date.now() - R;
7343
7384
  return c((Y) => Y.map(
7344
- (ee) => ee.artboardId === v ? { ...ee, status: "complete", progress: 100, dataUrl: J, timestamp: Date.now() } : ee
7345
- )), d((Y) => ({ ...Y, [v]: J })), g((Y) => ({
7385
+ (ee) => ee.artboardId === v ? { ...ee, status: "complete", progress: 100, dataUrl: Q, timestamp: Date.now() } : ee
7386
+ )), d((Y) => ({ ...Y, [v]: Q })), g((Y) => ({
7346
7387
  totalExports: Y.totalExports + 1,
7347
- avgExportTime: (Y.avgExportTime * Y.totalExports + re) / (Y.totalExports + 1),
7388
+ avgExportTime: (Y.avgExportTime * Y.totalExports + oe) / (Y.totalExports + 1),
7348
7389
  isWorkerActive: p
7349
- })), J;
7390
+ })), Q;
7350
7391
  } catch (R) {
7351
7392
  throw c((F) => F.map(
7352
- (X) => X.artboardId === v ? { ...X, status: "error", error: R, timestamp: Date.now() } : X
7393
+ (J) => J.artboardId === v ? { ...J, status: "error", error: R, timestamp: Date.now() } : J
7353
7394
  )), R;
7354
7395
  } finally {
7355
7396
  i(!1);
@@ -7360,8 +7401,8 @@ function Gl() {
7360
7401
  const L = e.map(async (R) => {
7361
7402
  const F = await m(R.id, v);
7362
7403
  return { id: R.id, dataUrl: F };
7363
- }), b = await Promise.all(L), M = {};
7364
- for (const { id: R, dataUrl: F } of b)
7404
+ }), x = await Promise.all(L), M = {};
7405
+ for (const { id: R, dataUrl: F } of x)
7365
7406
  M[R] = F;
7366
7407
  return M;
7367
7408
  } finally {
@@ -7370,8 +7411,8 @@ function Gl() {
7370
7411
  }, [e, m]), A = G(n);
7371
7412
  A.current = n;
7372
7413
  const D = N(async (v, L = {}) => {
7373
- const b = e.find((M) => M.id === v);
7374
- if (!b)
7414
+ const x = e.find((M) => M.id === v);
7415
+ if (!x)
7375
7416
  throw new Error(`[useExport] Artboard ${v} not found`);
7376
7417
  if (!r.current)
7377
7418
  throw new Error("[useExport] Canvas ref not available");
@@ -7379,7 +7420,7 @@ function Gl() {
7379
7420
  try {
7380
7421
  const M = A.current, R = t.getElementsOnArtboard(v), F = M.filter((pe) => R.includes(pe.id));
7381
7422
  return await sn.exportArtboardToBlob(
7382
- b,
7423
+ x,
7383
7424
  F,
7384
7425
  r.current,
7385
7426
  {
@@ -7398,45 +7439,45 @@ function Gl() {
7398
7439
  const L = e.map(async (R) => {
7399
7440
  const F = await D(R.id, v);
7400
7441
  return { id: R.id, blob: F };
7401
- }), b = await Promise.all(L), M = {};
7402
- for (const { id: R, blob: F } of b)
7442
+ }), x = await Promise.all(L), M = {};
7443
+ for (const { id: R, blob: F } of x)
7403
7444
  M[R] = F;
7404
7445
  return M;
7405
7446
  } finally {
7406
7447
  i(!1);
7407
7448
  }
7408
7449
  }, [e, D]), y = N(() => {
7409
- x.current++, a(!1), w.current = null;
7450
+ C.current++, a(!1), w.current = null;
7410
7451
  }, []), S = N((v) => {
7411
- x.current++;
7412
- const L = x.current;
7452
+ C.current++;
7453
+ const L = C.current;
7413
7454
  w.current = v, a(!0);
7414
7455
  const {
7415
- artboardIds: b,
7456
+ artboardIds: x,
7416
7457
  interval: M = 500,
7417
7458
  scale: R = 3,
7418
7459
  format: F = "png",
7419
- onChange: X
7420
- } = v, pe = b ? e.filter((ee) => b.includes(ee.id)) : e, J = () => x.current === L, re = async () => {
7460
+ onChange: J
7461
+ } = v, pe = x ? e.filter((ee) => x.includes(ee.id)) : e, Q = () => C.current === L, oe = async () => {
7421
7462
  try {
7422
- const ee = pe.map(async (oe) => {
7423
- const ue = await m(oe.id, {
7463
+ const ee = pe.map(async (ie) => {
7464
+ const ce = await m(ie.id, {
7424
7465
  scale: R,
7425
7466
  format: F,
7426
7467
  transparentBackground: !0
7427
7468
  });
7428
- return { id: oe.id, dataUrl: ue };
7429
- }), ge = await Promise.all(ee), we = {};
7430
- for (const { id: oe, dataUrl: ue } of ge)
7431
- we[oe] = ue;
7432
- d((oe) => ({ ...oe, ...we })), X && X(we);
7469
+ return { id: ie.id, dataUrl: ce };
7470
+ }), ge = await Promise.all(ee), xe = {};
7471
+ for (const { id: ie, dataUrl: ce } of ge)
7472
+ xe[ie] = ce;
7473
+ d((ie) => ({ ...ie, ...xe })), J && J(xe);
7433
7474
  } catch (ee) {
7434
7475
  bl.error("[useExport] Continuous export error:", ee);
7435
7476
  }
7436
7477
  };
7437
7478
  (async () => {
7438
- for (await re(); J() && (await new Promise((ee) => setTimeout(ee, M)), !!J()); )
7439
- await re();
7479
+ for (await oe(); Q() && (await new Promise((ee) => setTimeout(ee, M)), !!Q()); )
7480
+ await oe();
7440
7481
  })();
7441
7482
  }, [e, m]);
7442
7483
  return W(() => () => {
@@ -7515,7 +7556,7 @@ function xl(e) {
7515
7556
  }
7516
7557
  };
7517
7558
  }
7518
- function Cl(e) {
7559
+ function kl(e) {
7519
7560
  const t = "/api/image-proxy?url=";
7520
7561
  if (!e || !e.startsWith(t)) return e;
7521
7562
  try {
@@ -7524,9 +7565,9 @@ function Cl(e) {
7524
7565
  return e;
7525
7566
  }
7526
7567
  }
7527
- function kl(e) {
7568
+ function Cl(e) {
7528
7569
  return async function(n) {
7529
- const r = Cl(n);
7570
+ const r = kl(n);
7530
7571
  if (!/^https?:\/\//.test(r))
7531
7572
  throw new Error("Background removal isn't available for this image yet");
7532
7573
  const o = await fetch(e, {
@@ -7546,7 +7587,8 @@ function Wl({ services: e, children: t }) {
7546
7587
  imageSearch: e.imageSearch ?? (e.imageSearchUrl ? wl(e.imageSearchUrl) : void 0),
7547
7588
  generate: e.generate ?? (e.generateUrl ? xl(e.generateUrl) : void 0),
7548
7589
  vectors: e.vectors,
7549
- removeBackground: e.removeBackground ?? (e.bgRemoveUrl ? kl(e.bgRemoveUrl) : void 0)
7590
+ removeBackground: e.removeBackground ?? (e.bgRemoveUrl ? Cl(e.bgRemoveUrl) : void 0),
7591
+ onFontUpload: e.onFontUpload
7550
7592
  } : Ho, [
7551
7593
  e == null ? void 0 : e.imageSearch,
7552
7594
  e == null ? void 0 : e.imageSearchUrl,
@@ -7554,12 +7596,13 @@ function Wl({ services: e, children: t }) {
7554
7596
  e == null ? void 0 : e.generateUrl,
7555
7597
  e == null ? void 0 : e.vectors,
7556
7598
  e == null ? void 0 : e.bgRemoveUrl,
7557
- e == null ? void 0 : e.removeBackground
7599
+ e == null ? void 0 : e.removeBackground,
7600
+ e == null ? void 0 : e.onFontUpload
7558
7601
  ]);
7559
7602
  return /* @__PURE__ */ f($o.Provider, { value: n, children: t });
7560
7603
  }
7561
7604
  function _l() {
7562
- return je($o);
7605
+ return $e($o);
7563
7606
  }
7564
7607
  const Ar = ot("GoogleFontsService");
7565
7608
  let Ze = [], ht = null;
@@ -7799,16 +7842,16 @@ class Al {
7799
7842
  }
7800
7843
  const ql = new Al();
7801
7844
  export {
7802
- as as A,
7845
+ U as A,
7803
7846
  rt as B,
7804
7847
  Wl as C,
7805
7848
  zo as D,
7806
7849
  jl as E,
7807
- so as F,
7808
- ao as G,
7809
- lo as H,
7810
- $ as I,
7811
- U as J,
7850
+ as as F,
7851
+ so as G,
7852
+ ao as H,
7853
+ H as I,
7854
+ lo as J,
7812
7855
  hl as K,
7813
7856
  sl as L,
7814
7857
  vl as M,
@@ -7820,13 +7863,13 @@ export {
7820
7863
  ql as U,
7821
7864
  xl as a,
7822
7865
  wl as b,
7823
- kl as c,
7866
+ Cl as c,
7824
7867
  _l as d,
7825
7868
  Pl as e,
7826
7869
  Gl as f,
7827
7870
  ni as g,
7828
7871
  _t as h,
7829
- kt as i,
7872
+ Ct as i,
7830
7873
  es as j,
7831
7874
  Rn as k,
7832
7875
  Ke as l,
@@ -7843,6 +7886,6 @@ export {
7843
7886
  Bl as w,
7844
7887
  Vl as x,
7845
7888
  $l as y,
7846
- Le as z
7889
+ Te as z
7847
7890
  };
7848
- //# sourceMappingURL=UnifiedFontService-CgYnYTj7.js.map
7891
+ //# sourceMappingURL=UnifiedFontService-Co9tQ59z.js.map