@snowcone-app/canvas 0.19.1 → 0.21.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 (86) hide show
  1. package/README.md +124 -13
  2. package/STYLING_CONTRACT.md +427 -0
  3. package/dist/{CanvasRenderer-DUc-MOeR.js → CanvasRenderer-CwiYq8qg.js} +3 -3
  4. package/dist/{CanvasRenderer-DUc-MOeR.js.map → CanvasRenderer-CwiYq8qg.js.map} +1 -1
  5. package/dist/{CanvasStateV1-Bq48qhv5.js → CanvasStateV1-BFabcAKC.js} +35 -30
  6. package/dist/{CanvasStateV1-Bq48qhv5.js.map → CanvasStateV1-BFabcAKC.js.map} +1 -1
  7. package/dist/{ContextualToolbars-CkLjHNPn.js → ContextualToolbars--vTtorNg.js} +5 -5
  8. package/dist/{ContextualToolbars-CkLjHNPn.js.map → ContextualToolbars--vTtorNg.js.map} +1 -1
  9. package/dist/{EditorCanvasImpl-_3xCnLkx.js → EditorCanvasImpl-2ZgIUVpK.js} +18 -17
  10. package/dist/{EditorCanvasImpl-_3xCnLkx.js.map → EditorCanvasImpl-2ZgIUVpK.js.map} +1 -1
  11. package/dist/{ImportManager-D--7JnvW.js → ExportManager-DK7CdI-G.js} +24758 -24758
  12. package/dist/ExportManager-DK7CdI-G.js.map +1 -0
  13. package/dist/{FontAnalyzer-DIlqmyuf.js → FontAnalyzer-BpsTYowD.js} +5 -2
  14. package/dist/FontAnalyzer-BpsTYowD.js.map +1 -0
  15. package/dist/SnowconeCanvas-DqZicdxK.js +1172 -0
  16. package/dist/SnowconeCanvas-DqZicdxK.js.map +1 -0
  17. package/dist/{MenuButton-CeoEAtzP.js → UnifiedFontService-B1PGVu8O.js} +3704 -3429
  18. package/dist/UnifiedFontService-B1PGVu8O.js.map +1 -0
  19. package/dist/advanced.mjs +13 -13
  20. package/dist/api/embed.d.ts +3 -1
  21. package/dist/api/stable.d.ts +2 -2
  22. package/dist/components/editor/EditorAdd.d.ts +2 -1
  23. package/dist/components/editor/EditorBuy.d.ts +2 -1
  24. package/dist/components/editor/EditorCanvas.d.ts +2 -1
  25. package/dist/components/editor/EditorControls.d.ts +2 -1
  26. package/dist/components/editor/EditorHistory.d.ts +2 -1
  27. package/dist/components/editor/EditorLayers.d.ts +2 -1
  28. package/dist/components/editor/EditorMenu.d.ts +2 -1
  29. package/dist/components/editor/EditorPreview.d.ts +2 -1
  30. package/dist/components/editor/EditorRoot.d.ts +2 -1
  31. package/dist/components/editor/EditorTextField.d.ts +2 -1
  32. package/dist/components/editor/useProductSelection.d.ts +2 -1
  33. package/dist/components/embed/SnowconeCanvas.d.ts +10 -2
  34. package/dist/components/embed-realtime/context.d.ts +1 -1
  35. package/dist/contexts/EditorContext.d.ts +1 -1
  36. package/dist/core/ArtboardElement.d.ts +2 -1
  37. package/dist/default-editor/SnowconeEditor.d.ts +40 -0
  38. package/dist/design/design-builder.d.ts +46 -21
  39. package/dist/design/template-fields.d.ts +32 -0
  40. package/dist/design-builder-CPF60RU2.js +367 -0
  41. package/dist/design-builder-CPF60RU2.js.map +1 -0
  42. package/dist/{EditorContext-5QpqAhjh.js → editorErrors-CK1RISFa.js} +382 -358
  43. package/dist/editorErrors-CK1RISFa.js.map +1 -0
  44. package/dist/embed-2tp6Ue90.js +1117 -0
  45. package/dist/embed-2tp6Ue90.js.map +1 -0
  46. package/dist/embed.mjs +33 -31
  47. package/dist/hooks/useArtboards.d.ts +2 -1
  48. package/dist/index.mjs +8 -8
  49. package/dist/internals.mjs +5 -5
  50. package/dist/kits/sections.d.ts +11 -7
  51. package/dist/rendering/serialize-for-server.d.ts +3 -0
  52. package/dist/state/CanvasStateV1.d.ts +12 -0
  53. package/dist/template-fields-FgImixyv.js +476 -0
  54. package/dist/template-fields-FgImixyv.js.map +1 -0
  55. package/dist/testing/assertRenders.d.ts +2 -1
  56. package/dist/testing.mjs +8 -8
  57. package/dist/testing.mjs.map +1 -1
  58. package/dist/types/index.d.ts +10 -0
  59. package/dist/{usePieceGuideBundle-DVOISsB1.js → usePieceGuideBundle-Ctnu5k2D.js} +2 -2
  60. package/dist/{usePieceGuideBundle-DVOISsB1.js.map → usePieceGuideBundle-Ctnu5k2D.js.map} +1 -1
  61. package/dist/{validation-0IscSfRb.js → validation-3YEMnKLB.js} +467 -463
  62. package/dist/validation-3YEMnKLB.js.map +1 -0
  63. package/example/README.md +179 -0
  64. package/example/index.html +12 -0
  65. package/example/package.json +24 -0
  66. package/example/src/Widget.tsx +62 -0
  67. package/example/src/main.tsx +9 -0
  68. package/example/tsconfig.json +14 -0
  69. package/example/vite.config.ts +11 -0
  70. package/llms.txt +45 -0
  71. package/package.json +11 -6
  72. package/dist/EditorContext-5QpqAhjh.js.map +0 -1
  73. package/dist/FontAnalyzer-DIlqmyuf.js.map +0 -1
  74. package/dist/ImportManager-D--7JnvW.js.map +0 -1
  75. package/dist/MenuButton-CeoEAtzP.js.map +0 -1
  76. package/dist/SnowconeCanvas-3PA17na3.js +0 -1166
  77. package/dist/SnowconeCanvas-3PA17na3.js.map +0 -1
  78. package/dist/design-builder-v4935TeS.js +0 -343
  79. package/dist/design-builder-v4935TeS.js.map +0 -1
  80. package/dist/editorErrors-DXNfVXtD.js +0 -29
  81. package/dist/editorErrors-DXNfVXtD.js.map +0 -1
  82. package/dist/embed-D2QOpJXG.js +0 -1090
  83. package/dist/embed-D2QOpJXG.js.map +0 -1
  84. package/dist/template-fields-Dr3fMItw.js +0 -329
  85. package/dist/template-fields-Dr3fMItw.js.map +0 -1
  86. package/dist/validation-0IscSfRb.js.map +0 -1
@@ -1,19 +1,19 @@
1
1
  import { jsx as s, jsxs as f, Fragment as Zt } from "react/jsx-runtime";
2
2
  import * as Bn from "react";
3
- import ot, { useState as V, useEffect as Ne, useCallback as ct, useMemo as fs, useContext as Nr, createContext as Pr, useRef as be, useImperativeHandle as lr, forwardRef as Ar } from "react";
4
- import { u as ts, k as Dr, l as Vs, m as Us, a as Ts, s as Br, e as dr, f as zr } from "./EditorContext-5QpqAhjh.js";
5
- import { g as Lr, I as Le, j as Hr, n as Is, q as zn, r as Xr, T as ln, h as dn, i as un, B as rt, t as Or, v as Yr, w as _r, o as ut, x as Ns, f as $r, u as Ps, d as Fr, C as Wr } from "./MenuButton-CeoEAtzP.js";
6
- import { I as Ot, G as De, am as As, a2 as ms, a5 as ur, an as Ks, ao as Vr, ap as bn, aq as Ur, ar as cs, P as vn, c as Tn, as as Jt, at as ds, au as Kr, T as it, al as Gr, av as jn, aw as jr, ax as qr, ay as Zr, az as hr, aA as Jr, aB as Cs, aC as Qr, K as eo, S as qn, R as to, z as An } from "./FontAnalyzer-DIlqmyuf.js";
7
- import { createPortal as no } from "react-dom";
8
- import { g as Yn, f as so, r as ro, h as oo, C as Gs, j as us, T as io, e as co, A as ao, S as lo, I as uo, a as ho } from "./CanvasRenderer-DUc-MOeR.js";
9
- import { u as fo } from "./ThemeContext-Rjz25x9X.js";
10
- import { renderToStaticMarkup as mo } from "react-dom/server";
11
- import { D as Ds, n as Bs, L as xt, o as fr, p as zs, C as po, q as Pt, r as ps, s as Qe, t as as, v as hs } from "./ContextualToolbars-CkLjHNPn.js";
3
+ import ot, { useState as V, useEffect as Ne, useCallback as ct, useMemo as fs, useContext as Pr, createContext as Ar, useRef as be, useImperativeHandle as lr, forwardRef as Dr } from "react";
4
+ import { u as ts, h as Br, o as Vs, q as Us, a as Ts, s as zr, e as dr, f as Lr } from "./editorErrors-CK1RISFa.js";
5
+ import { g as Hr, I as Le, j as Xr, n as Is, y as zn, x as Or, v as Yr, w as _r, t as $r, z as Fr, T as ln, h as dn, i as un, B as rt, A as Wr, F as Vr, G as Ur, H as ut, J as Ns, f as Kr, u as Ps, d as Gr, C as jr } from "./UnifiedFontService-B1PGVu8O.js";
6
+ import { I as Ot, G as De, am as As, a2 as ms, a5 as ur, an as Ks, ao as qr, ap as bn, aq as Zr, ar as cs, P as vn, c as Tn, as as Jt, at as ds, au as Jr, T as it, al as Qr, av as jn, aw as eo, ax as to, ay as no, az as hr, aA as so, aB as Cs, aC as ro, K as oo, S as qn, R as io, z as An } from "./FontAnalyzer-BpsTYowD.js";
7
+ import { createPortal as co } from "react-dom";
8
+ import { g as Yn, f as ao, r as lo, h as uo, C as Gs, j as us, T as ho, e as fo, A as mo, S as po, I as go, a as xo } from "./CanvasRenderer-CwiYq8qg.js";
9
+ import { u as yo } from "./ThemeContext-Rjz25x9X.js";
10
+ import { renderToStaticMarkup as bo } from "react-dom/server";
11
+ import { D as Ds, n as Bs, L as xt, o as fr, p as zs, C as vo, q as Pt, r as ps, s as Qe, t as as, v as hs } from "./ContextualToolbars--vTtorNg.js";
12
12
  import * as Jn from "@radix-ui/react-radio-group";
13
- import { F as go, G as js, H as qs } from "./ImportManager-D--7JnvW.js";
13
+ import { F as wo, G as js, H as qs } from "./ExportManager-DK7CdI-G.js";
14
14
  import { cva as mr } from "class-variance-authority";
15
15
  import { debounce as Zs } from "lodash-es";
16
- const xo = {
16
+ const Co = {
17
17
  elements: ["text", "image", "shape", "path", "group"],
18
18
  transforms: ["custom", "circle", "lean", "arch", "ascend", "wave", "flag", "image", "group", "shape", "path"],
19
19
  effects: ["stroke", "mask", "distress", "knockout"],
@@ -39,7 +39,7 @@ const xo = {
39
39
  undo: !0,
40
40
  keyboardShortcuts: !0
41
41
  }
42
- }, yo = {
42
+ }, So = {
43
43
  name: "compact-customizer",
44
44
  layout: {
45
45
  slots: {
@@ -69,17 +69,22 @@ const xo = {
69
69
  sampleText: "Your Text",
70
70
  defaultFontFamily: "Poppins"
71
71
  }
72
- }, bo = {
72
+ }, Eo = {
73
73
  name: "pro-studio",
74
74
  layout: {
75
75
  slots: {
76
- topbar: ["add-element-menu", "undo-redo-controls", "contextual-toolbar"],
76
+ // D6 (ADR-0085 P4): slots resolve to the public `Editor.*` parts —
77
+ // `add-element-menu` is `Editor.Add` (the ⊕ catalog only), so the
78
+ // save/open/export overflow now comes from `menu-button`
79
+ // (`Editor.Menu`), which this preset previously leaned on
80
+ // `add-element-menu`'s MenuButton hack for.
81
+ topbar: ["add-element-menu", "undo-redo-controls", "menu-button", "contextual-toolbar"],
77
82
  left: ["layers-panel"],
78
83
  canvas: ["canvas"],
79
84
  right: ["effects-panel"]
80
85
  }
81
86
  },
82
- capabilities: xo,
87
+ capabilities: Co,
83
88
  behavior: {
84
89
  toolbar: "contextual",
85
90
  selection: "multi",
@@ -96,7 +101,7 @@ const xo = {
96
101
  sampleText: "New Text",
97
102
  defaultFontFamily: "Poppins"
98
103
  }
99
- }, vo = {
104
+ }, ko = {
100
105
  name: "embed-only",
101
106
  layout: {
102
107
  slots: {
@@ -128,11 +133,11 @@ const xo = {
128
133
  panelVariant: "flush"
129
134
  }
130
135
  }, Js = /* @__PURE__ */ new Map([
131
- ["compact-customizer", yo],
132
- ["pro-studio", bo],
133
- ["embed-only", vo]
136
+ ["compact-customizer", So],
137
+ ["pro-studio", Eo],
138
+ ["embed-only", ko]
134
139
  ]);
135
- function wo(e) {
140
+ function Ro(e) {
136
141
  if (typeof e == "string") {
137
142
  const t = Js.get(e);
138
143
  if (!t) {
@@ -145,14 +150,14 @@ function wo(e) {
145
150
  }
146
151
  return e;
147
152
  }
148
- const gr = Pr(null);
149
- function Uc({ kit: e, children: t }) {
153
+ const gr = Ar(null);
154
+ function Zc({ kit: e, children: t }) {
150
155
  const [n, r] = V(e);
151
156
  Ne(() => {
152
157
  r(e);
153
158
  }, [e]);
154
159
  const o = ct((c) => {
155
- const l = typeof c == "string" ? wo(c) : c;
160
+ const l = typeof c == "string" ? Ro(c) : c;
156
161
  r(l);
157
162
  }, []), i = fs(
158
163
  () => ({ kit: n, setKit: o }),
@@ -160,16 +165,16 @@ function Uc({ kit: e, children: t }) {
160
165
  );
161
166
  return /* @__PURE__ */ s(gr.Provider, { value: i, children: t });
162
167
  }
163
- function Co() {
164
- const e = Nr(gr);
168
+ function Mo() {
169
+ const e = Pr(gr);
165
170
  if (!e) throw new Error("useKit must be used within a KitProvider");
166
171
  return e;
167
172
  }
168
- function Kc() {
169
- const { kit: e } = Co();
173
+ function Jc() {
174
+ const { kit: e } = Mo();
170
175
  return e.capabilities;
171
176
  }
172
- function So(e, t) {
177
+ function To(e, t) {
173
178
  if (t instanceof Ot && t.isCropping || e instanceof Ot && e.isCropping)
174
179
  return !0;
175
180
  if (e instanceof De) {
@@ -179,7 +184,7 @@ function So(e, t) {
179
184
  }
180
185
  return !1;
181
186
  }
182
- function Eo(e) {
187
+ function Io(e) {
183
188
  const t = (e == null ? void 0 : e.enabled) ?? !0, {
184
189
  selectedElement: n,
185
190
  activeChildElement: r,
@@ -197,7 +202,7 @@ function Eo(e) {
197
202
  setHideHandles: g,
198
203
  handleAddElement: y,
199
204
  isToolbarMenuOpen: b
200
- } = ts(), E = Dr(), { duplicateLayer: S } = Lr();
205
+ } = ts(), E = Br(), { duplicateLayer: S } = Hr();
201
206
  Ne(() => {
202
207
  if (!t) return;
203
208
  const k = (v) => {
@@ -235,7 +240,7 @@ function Eo(e) {
235
240
  return;
236
241
  }
237
242
  if (v.key === "Delete" || v.key === "Backspace") {
238
- if (b || So(n, r))
243
+ if (b || To(n, r))
239
244
  return;
240
245
  if (v.preventDefault(), o.length > 0) {
241
246
  i.filter(
@@ -296,8 +301,8 @@ function Eo(e) {
296
301
  E
297
302
  ]);
298
303
  }
299
- const ko = 280, Ro = (e) => 1 - Math.pow(1 - e, 3);
300
- function Mo(e, t = ko) {
304
+ const No = 280, Po = (e) => 1 - Math.pow(1 - e, 3);
305
+ function Ao(e, t = No) {
301
306
  const [n, r] = V(e), o = be(n);
302
307
  o.current = n;
303
308
  const i = be(null), c = e ? `${e.x},${e.y},${e.width},${e.height}` : "none";
@@ -314,7 +319,7 @@ function Mo(e, t = ko) {
314
319
  if (l.x === e.x && l.y === e.y && l.width === e.width && l.height === e.height)
315
320
  return;
316
321
  const a = performance.now(), u = (d) => {
317
- const p = Math.min(1, (d - a) / t), m = Ro(p);
322
+ const p = Math.min(1, (d - a) / t), m = Po(p);
318
323
  r({
319
324
  x: l.x + (e.x - l.x) * m,
320
325
  y: l.y + (e.y - l.y) * m,
@@ -360,7 +365,7 @@ function xr(e, t) {
360
365
  i++;
361
366
  return { start: o, end: i };
362
367
  }
363
- function To(e, t) {
368
+ function Do(e, t) {
364
369
  const { fontSize: n, fontFamily: r, bold: o, italic: i, textAlign: c } = e, l = e.getRichText(), u = e.getVisualBoundingBox().width;
365
370
  let d = u, p = 0;
366
371
  e.transformType === "custom" && (p = ur, d = u - p * 2);
@@ -411,8 +416,8 @@ function To(e, t) {
411
416
  lineStartIndex: w
412
417
  };
413
418
  }
414
- function Io(e, t, n) {
415
- const { fontSize: r } = e, i = r * 1.2, c = To(e, t), l = n === "up" ? Math.max(0, c.lineIndex - 1) : Math.min(c.lineCount - 1, c.lineIndex + 1);
419
+ function Bo(e, t, n) {
420
+ const { fontSize: r } = e, i = r * 1.2, c = Do(e, t), l = n === "up" ? Math.max(0, c.lineIndex - 1) : Math.min(c.lineCount - 1, c.lineIndex + 1);
416
421
  if (l === c.lineIndex)
417
422
  return t;
418
423
  const a = l * i + i / 2;
@@ -479,7 +484,7 @@ function wn(e, t) {
479
484
  }
480
485
  return E + S.length;
481
486
  }
482
- function No() {
487
+ function zo() {
483
488
  const [e, t] = V(!1), [n, r] = V({
484
489
  x: 0,
485
490
  y: 0
@@ -514,7 +519,7 @@ function No() {
514
519
  }
515
520
  };
516
521
  }
517
- class Po {
522
+ class Lo {
518
523
  constructor() {
519
524
  this.state = {
520
525
  active: !1,
@@ -695,7 +700,7 @@ class Po {
695
700
  var c, l, a, u, d, p, m, w;
696
701
  if (!this.state.active || this.state.points.length === 0) return;
697
702
  const { points: r, previewPoint: o, currentPoint: i } = this.state;
698
- if (t.save(), t.translate(n.x, n.y), t.strokeStyle = Vr(), t.lineWidth = 2, t.setLineDash([]), t.beginPath(), r.length > 0) {
703
+ if (t.save(), t.translate(n.x, n.y), t.strokeStyle = qr(), t.lineWidth = 2, t.setLineDash([]), t.beginPath(), r.length > 0) {
699
704
  const g = r[0];
700
705
  t.moveTo(g.x, g.y);
701
706
  for (let b = 1; b < r.length; b++) {
@@ -720,7 +725,7 @@ class Po {
720
725
  t.setLineDash([]);
721
726
  for (let g = 0; g < r.length; g++) {
722
727
  const y = r[g];
723
- if (g === 0 && r.length > 1 && (t.strokeStyle = bn(), t.lineWidth = 2, t.beginPath(), t.arc(y.x, y.y, 8, 0, Math.PI * 2), t.stroke()), t.fillStyle = Ur(), t.strokeStyle = bn(), t.lineWidth = 2, t.beginPath(), t.arc(y.x, y.y, 4, 0, Math.PI * 2), t.fill(), t.stroke(), y.handleIn) {
728
+ if (g === 0 && r.length > 1 && (t.strokeStyle = bn(), t.lineWidth = 2, t.beginPath(), t.arc(y.x, y.y, 8, 0, Math.PI * 2), t.stroke()), t.fillStyle = Zr(), t.strokeStyle = bn(), t.lineWidth = 2, t.beginPath(), t.arc(y.x, y.y, 4, 0, Math.PI * 2), t.fill(), t.stroke(), y.handleIn) {
724
729
  const E = y.x + y.handleIn.x, S = y.y + y.handleIn.y;
725
730
  t.strokeStyle = cs(), t.lineWidth = 1, t.beginPath(), t.moveTo(y.x, y.y), t.lineTo(E, S), t.stroke(), t.fillStyle = cs(), t.beginPath(), t.arc(E, S, 3, 0, Math.PI * 2), t.fill();
726
731
  }
@@ -740,12 +745,12 @@ class Po {
740
745
  t.restore();
741
746
  }
742
747
  }
743
- const Ao = Tn("usePenTool");
744
- function Do({ selectedElement: e }) {
745
- const [t] = V(() => new Po()), [n, r] = V("crosshair");
748
+ const Ho = Tn("usePenTool");
749
+ function Xo({ selectedElement: e }) {
750
+ const [t] = V(() => new Lo()), [n, r] = V("crosshair");
746
751
  return Ne(() => {
747
752
  try {
748
- const o = mo(/* @__PURE__ */ s(Le, { icon: "lucide:pen-tool", width: 24, height: 24 })).replace(
753
+ const o = bo(/* @__PURE__ */ s(Le, { icon: "lucide:pen-tool", width: 24, height: 24 })).replace(
749
754
  /<svg[^>]*>|<\/svg>/g,
750
755
  ""
751
756
  ), i = `
@@ -762,7 +767,7 @@ function Do({ selectedElement: e }) {
762
767
  `.trim(), l = `data:image/svg+xml,${encodeURIComponent(i)}`;
763
768
  r(`url('${l}') 0 0, crosshair`);
764
769
  } catch (o) {
765
- Ao.error("Failed to create pen cursor:", o), r("crosshair");
770
+ Ho.error("Failed to create pen cursor:", o), r("crosshair");
766
771
  }
767
772
  }, []), Ne(() => {
768
773
  e instanceof vn && e.transformData.points.length === 0 && !t.isActive() && t.startPath(e);
@@ -771,7 +776,7 @@ function Do({ selectedElement: e }) {
771
776
  penCursor: n
772
777
  };
773
778
  }
774
- function Bo({
779
+ function Oo({
775
780
  elements: e,
776
781
  selectedElement: t,
777
782
  transformHandles: n,
@@ -795,7 +800,7 @@ function Bo({
795
800
  editingChildIdRef: c
796
801
  };
797
802
  }
798
- function zo({ onHoverChange: e }) {
803
+ function Yo({ onHoverChange: e }) {
799
804
  const [t, n] = V({
800
805
  type: null,
801
806
  data: null,
@@ -892,7 +897,7 @@ class Ls {
892
897
  );
893
898
  }
894
899
  }
895
- class Lo {
900
+ class _o {
896
901
  /**
897
902
  * Handle dragging the image in crop mode
898
903
  */
@@ -970,7 +975,7 @@ class Lo {
970
975
  * @private
971
976
  */
972
977
  _calculateNewCropValues(t, n, r, o, i, c, l) {
973
- const a = Kr;
978
+ const a = Jr;
974
979
  let u = n, d = r, p = o, m = i;
975
980
  return t === "top-left" ? (u = n + c, d = r + l, p = o - c, m = i - l) : t === "top-right" ? (d = r + l, p = o + c, m = i - l) : t === "bottom-left" ? (u = n + c, p = o - c, m = i + l) : t === "bottom-right" ? (p = o + c, m = i + l) : t === "top" ? (d = r + l, m = i - l) : t === "bottom" ? m = i + l : t === "left" ? (u = n + c, p = o - c) : t === "right" && (p = o + c), this._constrainCropValues(
976
981
  t,
@@ -1013,13 +1018,13 @@ class Lo {
1013
1018
  return n.includes("left") ? p = (l - 0.5) * i : n.includes("right") ? p = (l + u - 0.5) * i : p = (l + u / 2 - 0.5) * i, n.includes("top") ? m = (a - 0.5) * c : n.includes("bottom") ? m = (a + d - 0.5) * c : m = (a + d / 2 - 0.5) * c, r.localToWorld(p, m);
1014
1019
  }
1015
1020
  }
1016
- function Ho() {
1017
- const [e] = V(() => new Lo());
1021
+ function $o() {
1022
+ const [e] = V(() => new _o());
1018
1023
  return {
1019
1024
  cropController: e
1020
1025
  };
1021
1026
  }
1022
- function Xo(e) {
1027
+ function Fo(e) {
1023
1028
  const t = be(null), n = be(null);
1024
1029
  return Ne(() => {
1025
1030
  n.current = null;
@@ -1031,7 +1036,7 @@ function Xo(e) {
1031
1036
  function Qs(e) {
1032
1037
  return e != null && e instanceof it;
1033
1038
  }
1034
- function Oo({ selectedElement: e, ref: t }) {
1039
+ function Wo({ selectedElement: e, ref: t }) {
1035
1040
  const [n, r] = V(!1), [o, i] = V(""), [c, l] = V({ x: 0, y: 0, width: 200, height: 50 }), [a, u] = V(0), [d, p] = V(0), [m, w] = V(0), g = be(1), y = be(performance.now()), b = be(0), E = be(!1), [S, k] = V(null), [z, v] = V(null), I = be(null), B = ct(
1036
1041
  (C) => {
1037
1042
  if (!n || !S)
@@ -1103,7 +1108,7 @@ function Oo({ selectedElement: e, ref: t }) {
1103
1108
  toggleFormattingProperty: T
1104
1109
  };
1105
1110
  }
1106
- function Yo({
1111
+ function Vo({
1107
1112
  width: e,
1108
1113
  height: t,
1109
1114
  zoom: n,
@@ -1173,7 +1178,7 @@ function Yo({
1173
1178
  zoomInvariantBorderRadius: oe
1174
1179
  };
1175
1180
  }
1176
- function _o() {
1181
+ function Uo() {
1177
1182
  const [e, t] = V([]), [n, r] = V([]), [o, i] = V(!1), [c, l] = V(!1), [a, u] = V(0), [d, p] = V(0), [, m] = V(0);
1178
1183
  return {
1179
1184
  snapGuides: e,
@@ -1190,11 +1195,11 @@ function _o() {
1190
1195
  setRotatingElementVersion: m
1191
1196
  };
1192
1197
  }
1193
- function $o({ elements: e }) {
1198
+ function Ko({ elements: e }) {
1194
1199
  const [, t] = V({}), [n, r] = V(0), [o, i] = V(0), [c, l] = V(0), a = ct(() => {
1195
1200
  i((u) => u + 1);
1196
1201
  }, []);
1197
- return Ne(() => Gr((d) => {
1202
+ return Ne(() => Qr((d) => {
1198
1203
  e.some((m) => m.id === d) && i((m) => m + 1);
1199
1204
  }), [e]), {
1200
1205
  renderVersion: o,
@@ -1256,7 +1261,7 @@ const Kn = {
1256
1261
  labelHaloColor: "#ffffff"
1257
1262
  };
1258
1263
  let Mn = null;
1259
- function Fo(e) {
1264
+ function Go(e) {
1260
1265
  const t = e.width, n = e.height;
1261
1266
  if (t <= 0 || n <= 0) return null;
1262
1267
  Mn || (Mn = document.createElement("canvas")), Mn.width !== t && (Mn.width = t), Mn.height !== n && (Mn.height = n);
@@ -1269,7 +1274,7 @@ function Ss(e, t) {
1269
1274
  const r = n.slice(4, -1), [o, ...i] = r.split(","), c = o.trim(), l = i.length > 0 ? i.join(",").trim() : "", a = t ?? document.documentElement;
1270
1275
  return getComputedStyle(a).getPropertyValue(c).trim() || l || "#333";
1271
1276
  }
1272
- function Wo(e) {
1277
+ function jo(e) {
1273
1278
  if (typeof document > "u") return !1;
1274
1279
  const t = document.documentElement;
1275
1280
  return !!(t.classList.contains("dark") || t.getAttribute("data-theme") === "dark");
@@ -1309,7 +1314,7 @@ function Zn(e, t) {
1309
1314
  }
1310
1315
  e.beginPath(), ns(e, t), e.stroke();
1311
1316
  }
1312
- function Vo(e, t) {
1317
+ function qo(e, t) {
1313
1318
  t.kind !== "path" && ns(e, t);
1314
1319
  }
1315
1320
  function gs(e, t) {
@@ -1330,7 +1335,7 @@ function gs(e, t) {
1330
1335
  }
1331
1336
  e.addPath(new Path2D(t.d));
1332
1337
  }
1333
- function Uo(e, t, n) {
1338
+ function Zo(e, t, n) {
1334
1339
  return (e == null ? void 0 : e.boundary) ?? {
1335
1340
  kind: "rect",
1336
1341
  x: 0,
@@ -1339,7 +1344,7 @@ function Uo(e, t, n) {
1339
1344
  height: n
1340
1345
  };
1341
1346
  }
1342
- function Ko(e, t, n, r) {
1347
+ function Jo(e, t, n, r) {
1343
1348
  if (e != null && e.safeArea) return e.safeArea;
1344
1349
  if (t.safeAreaInsetPx && t.safeAreaInsetPx > 0) {
1345
1350
  const o = t.safeAreaInsetPx;
@@ -1353,7 +1358,7 @@ function Ko(e, t, n, r) {
1353
1358
  }
1354
1359
  return null;
1355
1360
  }
1356
- function Go(e) {
1361
+ function Qo(e) {
1357
1362
  var E, S, k, z, v, I, B;
1358
1363
  const { ctx: t, pieces: n, pieceGuides: r, artboardOrigin: o, zoom: i } = e;
1359
1364
  if (!n.length) return;
@@ -1363,7 +1368,7 @@ function Go(e) {
1363
1368
  boundary: ((k = e.show) == null ? void 0 : k.boundary) ?? !0,
1364
1369
  safeArea: ((z = e.show) == null ? void 0 : z.safeArea) ?? !0,
1365
1370
  labels: ((v = e.show) == null ? void 0 : v.labels) ?? !0
1366
- }, l = t.canvas, a = l instanceof HTMLCanvasElement ? l : null, u = Wo(), p = { ...{
1371
+ }, l = t.canvas, a = l instanceof HTMLCanvasElement ? l : null, u = jo(), p = { ...{
1367
1372
  ...Kn,
1368
1373
  bleedFill: u ? "#ffffff" : "#000000"
1369
1374
  }, ...e.style };
@@ -1377,7 +1382,7 @@ function Go(e) {
1377
1382
  var T;
1378
1383
  return (((T = r == null ? void 0 : r[N.id]) == null ? void 0 : T.zones) ?? []).some((C) => C.kind === "dieCut");
1379
1384
  }
1380
- ) && a ? Fo(a) : null;
1385
+ ) && a ? Go(a) : null;
1381
1386
  t.save(), t.translate(o.x, o.y);
1382
1387
  for (const N of n) {
1383
1388
  if (e.focusedPieceId != null && N.id !== e.focusedPieceId)
@@ -1386,7 +1391,7 @@ function Go(e) {
1386
1391
  t.save(), t.translate(N.x, N.y);
1387
1392
  const P = N.rotation ?? 0;
1388
1393
  P === 90 ? (t.translate(N.width, 0), t.rotate(Math.PI / 2)) : P === 180 ? (t.translate(N.width, N.height), t.rotate(Math.PI)) : P === 270 && (t.translate(0, N.height), t.rotate(3 * Math.PI / 2));
1389
- const O = P === 90 || P === 270, x = O ? N.height : N.width, K = O ? N.width : N.height, U = Uo(T, x, K), ne = Ko(T, N, x, K), se = !0, D = Math.max(0, (T == null ? void 0 : T.outerRadius) ?? 0), le = D > 0 ? {
1394
+ const O = P === 90 || P === 270, x = O ? N.height : N.width, K = O ? N.width : N.height, U = Zo(T, x, K), ne = Jo(T, N, x, K), se = !0, D = Math.max(0, (T == null ? void 0 : T.outerRadius) ?? 0), le = D > 0 ? {
1390
1395
  kind: "roundedRect",
1391
1396
  x: 0,
1392
1397
  y: 0,
@@ -1401,18 +1406,18 @@ function Go(e) {
1401
1406
  width: x,
1402
1407
  height: K
1403
1408
  };
1404
- if (D > 0 && (t.save(), t.beginPath(), Vo(t, le), t.clip()), c.bleed && p.bleedOpacity > 0) {
1409
+ if (D > 0 && (t.save(), t.beginPath(), qo(t, le), t.clip()), c.bleed && p.bleedOpacity > 0) {
1405
1410
  const Se = p.bleedInnerEdge === "safeArea" && ne ? ne : U;
1406
1411
  if (Se) {
1407
1412
  const me = u ? "screen" : "multiply", ve = p.bleedOpacity;
1408
- p.bleedMode === "solid" ? qo(
1413
+ p.bleedMode === "solid" ? ti(
1409
1414
  t,
1410
1415
  le,
1411
1416
  Se,
1412
1417
  m,
1413
1418
  ve,
1414
1419
  me
1415
- ) : jo(
1420
+ ) : ei(
1416
1421
  t,
1417
1422
  x,
1418
1423
  K,
@@ -1435,7 +1440,7 @@ function Go(e) {
1435
1440
  ), Zn(t, Se.path), t.setLineDash([]), t.restore());
1436
1441
  if (c.zones)
1437
1442
  for (const Se of C)
1438
- Se.kind === "dieCut" && (p.dieCutMode === "knockout" ? ei(
1443
+ Se.kind === "dieCut" && (p.dieCutMode === "knockout" ? oi(
1439
1444
  t,
1440
1445
  Se,
1441
1446
  p.dieCutStroke,
@@ -1444,7 +1449,7 @@ function Go(e) {
1444
1449
  se,
1445
1450
  b,
1446
1451
  p.dieCutBlurPx
1447
- ) : Jo(
1452
+ ) : si(
1448
1453
  t,
1449
1454
  Se,
1450
1455
  b,
@@ -1454,15 +1459,15 @@ function Go(e) {
1454
1459
  p.dieCutStroke,
1455
1460
  p.dieCutStrokeWidthPx
1456
1461
  ));
1457
- c.boundary && g && p.boundaryStrokeWidthPx > 0 && (t.save(), t.strokeStyle = g, jn(t, p.boundaryStrokeWidthPx), Zn(t, U), t.restore()), c.safeArea && ne && p.safeAreaStroke && (t.save(), t.strokeStyle = p.safeAreaStroke, jn(t, p.safeAreaStrokeWidthPx, p.safeAreaDashPx), Zn(t, ne), t.setLineDash([]), t.restore()), c.labels && oe.length > 0 && ti(t, oe, p, i), D > 0 && t.restore(), t.restore();
1462
+ c.boundary && g && p.boundaryStrokeWidthPx > 0 && (t.save(), t.strokeStyle = g, jn(t, p.boundaryStrokeWidthPx), Zn(t, U), t.restore()), c.safeArea && ne && p.safeAreaStroke && (t.save(), t.strokeStyle = p.safeAreaStroke, jn(t, p.safeAreaStrokeWidthPx, p.safeAreaDashPx), Zn(t, ne), t.setLineDash([]), t.restore()), c.labels && oe.length > 0 && ii(t, oe, p, i), D > 0 && t.restore(), t.restore();
1458
1463
  }
1459
1464
  t.restore();
1460
1465
  }
1461
- function jo(e, t, n, r, o, i, c, l, a, u = "source-over") {
1466
+ function ei(e, t, n, r, o, i, c, l, a, u = "source-over") {
1462
1467
  const d = Math.max(
1463
1468
  6,
1464
1469
  Math.round(Math.min(t, n) * l)
1465
- ), p = a > 0 ? d * a : d, m = typeof window < "u" && window.devicePixelRatio || 1, w = d, g = t + 2 * w, y = n + 2 * w, b = Math.max(1, Math.ceil(g * a * m)), E = Math.max(1, Math.ceil(y * a * m)), S = Zo(b, E);
1470
+ ), p = a > 0 ? d * a : d, m = typeof window < "u" && window.devicePixelRatio || 1, w = d, g = t + 2 * w, y = n + 2 * w, b = Math.max(1, Math.ceil(g * a * m)), E = Math.max(1, Math.ceil(y * a * m)), S = ni(b, E);
1466
1471
  if (!S) return;
1467
1472
  const k = S.getContext("2d");
1468
1473
  if (!k) return;
@@ -1474,16 +1479,16 @@ function jo(e, t, n, r, o, i, c, l, a, u = "source-over") {
1474
1479
  const I = e.globalCompositeOperation;
1475
1480
  e.globalCompositeOperation = u, e.drawImage(S, -w, -w, g, y), e.globalCompositeOperation = I;
1476
1481
  }
1477
- function qo(e, t, n, r, o, i = "source-over") {
1482
+ function ti(e, t, n, r, o, i = "source-over") {
1478
1483
  e.save(), e.globalAlpha = e.globalAlpha * o, e.globalCompositeOperation = i, e.fillStyle = r;
1479
1484
  const c = new Path2D();
1480
1485
  gs(c, t), gs(c, n), e.fill(c, "evenodd"), e.restore();
1481
1486
  }
1482
1487
  let Pn = null;
1483
- function Zo(e, t) {
1488
+ function ni(e, t) {
1484
1489
  return typeof document > "u" ? null : (Pn || (Pn = document.createElement("canvas")), Pn.width !== e && (Pn.width = e), Pn.height !== t && (Pn.height = t), Pn);
1485
1490
  }
1486
- function Jo(e, t, n, r, o, i, c, l) {
1491
+ function si(e, t, n, r, o, i, c, l) {
1487
1492
  const a = t.path;
1488
1493
  if (e.save(), e.beginPath(), ns(e, a), e.clip(), n && (e.save(), e.globalCompositeOperation = "destination-out", e.fillStyle = "#000", a.kind === "path" ? Qn(e, a) : e.fillRect(a.x, a.y, a.width, a.height), e.restore(), i > 0)) {
1489
1494
  const u = e.globalAlpha, d = e.getTransform();
@@ -1495,8 +1500,8 @@ function Jo(e, t, n, r, o, i, c, l) {
1495
1500
  }
1496
1501
  e.restore(), c && (e.save(), e.strokeStyle = c, jn(e, l), Zn(e, a), e.restore());
1497
1502
  }
1498
- const Qo = 0.3;
1499
- function ei(e, t, n, r, o, i = !0, c, l = 0) {
1503
+ const ri = 0.3;
1504
+ function oi(e, t, n, r, o, i = !0, c, l = 0) {
1500
1505
  const a = t.path;
1501
1506
  if (i)
1502
1507
  if (o && c && l > 0) {
@@ -1504,25 +1509,25 @@ function ei(e, t, n, r, o, i = !0, c, l = 0) {
1504
1509
  const u = e.globalAlpha, d = e.getTransform();
1505
1510
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.filter = `blur(${l}px)`, e.globalAlpha = u * 0.4, e.drawImage(c, 0, 0), e.filter = "none", e.globalAlpha = u, e.setTransform(d), e.restore(), e.restore();
1506
1511
  } else
1507
- e.save(), e.globalCompositeOperation = "destination-out", e.globalAlpha = o ? 1 - Qo : 1, e.fillStyle = "#000", a.kind === "path" || a.kind === "roundedRect" ? Qn(e, a) : e.fillRect(a.x, a.y, a.width, a.height), e.restore();
1512
+ e.save(), e.globalCompositeOperation = "destination-out", e.globalAlpha = o ? 1 - ri : 1, e.fillStyle = "#000", a.kind === "path" || a.kind === "roundedRect" ? Qn(e, a) : e.fillRect(a.x, a.y, a.width, a.height), e.restore();
1508
1513
  n && (e.save(), e.strokeStyle = n, jn(e, r), Zn(e, a), e.restore());
1509
1514
  }
1510
- function ti(e, t, n, r) {
1515
+ function ii(e, t, n, r) {
1511
1516
  const o = r > 0 ? n.labelFontSizePx / r : n.labelFontSizePx, i = Math.max(2, n.labelFontSizePx * 0.25), c = r > 0 ? i / r : i;
1512
1517
  e.save(), e.font = `${o}px ${n.labelFontFamily}`;
1513
1518
  for (const l of t) {
1514
1519
  const a = l.anchor ?? "c";
1515
- e.textAlign = ni(a), e.textBaseline = si(a), e.lineJoin = "round", e.strokeStyle = n.labelHaloColor, e.lineWidth = c, e.strokeText(l.text, l.x, l.y), e.fillStyle = n.labelColor, e.fillText(l.text, l.x, l.y);
1520
+ e.textAlign = ci(a), e.textBaseline = ai(a), e.lineJoin = "round", e.strokeStyle = n.labelHaloColor, e.lineWidth = c, e.strokeText(l.text, l.x, l.y), e.fillStyle = n.labelColor, e.fillText(l.text, l.x, l.y);
1516
1521
  }
1517
1522
  e.restore();
1518
1523
  }
1519
- function ni(e) {
1524
+ function ci(e) {
1520
1525
  return e.endsWith("l") ? "start" : e.endsWith("r") ? "end" : "center";
1521
1526
  }
1522
- function si(e) {
1527
+ function ai(e) {
1523
1528
  return e.startsWith("t") ? "hanging" : e.startsWith("b") ? "alphabetic" : "middle";
1524
1529
  }
1525
- function ri(e) {
1530
+ function li(e) {
1526
1531
  const {
1527
1532
  ctx: t,
1528
1533
  displaySelection: n,
@@ -1592,7 +1597,7 @@ function ri(e) {
1592
1597
  B = { ...B, centerX: v, centerY: I };
1593
1598
  }
1594
1599
  const C = l && i.getMode() === "rotate" ? B.rotation + a : B.rotation, oe = B.width, P = B.height, O = B.centerX, x = B.centerY, K = O - oe / 2, U = x - P / 2, ne = O + oe / 2, se = x + P / 2;
1595
- let D = O, le = se + jr;
1600
+ let D = O, le = se + eo;
1596
1601
  if (C !== 0) {
1597
1602
  const me = -C * Math.PI / 180, ve = Math.cos(me), ue = Math.sin(me), Re = D - O, Me = le - x;
1598
1603
  D = O + (Re * ve - Me * ue), le = x + (Re * ue + Me * ve);
@@ -1608,7 +1613,7 @@ function ri(e) {
1608
1613
  rotationHandleY: le,
1609
1614
  rotation: C
1610
1615
  };
1611
- return t.save(), t.translate(O, x), t.rotate(-C * Math.PI / 180), t.translate(-O, -x), t.strokeStyle = bn(), t.lineWidth = Yn(d), t.setLineDash(so(d)), t.strokeRect(K, U, oe, P), t.restore(), u || oi(t, {
1616
+ return t.save(), t.translate(O, x), t.rotate(-C * Math.PI / 180), t.translate(-O, -x), t.strokeStyle = bn(), t.lineWidth = Yn(d), t.setLineDash(ao(d)), t.strokeRect(K, U, oe, P), t.restore(), u || di(t, {
1612
1617
  renderMinX: K,
1613
1618
  renderMinY: U,
1614
1619
  renderMaxX: ne,
@@ -1624,7 +1629,7 @@ function ri(e) {
1624
1629
  zoom: d
1625
1630
  }), { updatedOBB: B, groupBounds: Se };
1626
1631
  }
1627
- function oi(e, t) {
1632
+ function di(e, t) {
1628
1633
  var k;
1629
1634
  const {
1630
1635
  renderMinX: n,
@@ -1640,7 +1645,7 @@ function oi(e, t) {
1640
1645
  rotationHandleY: m,
1641
1646
  stateMachine: w,
1642
1647
  zoom: g
1643
- } = t, y = oo(g), b = [
1648
+ } = t, y = uo(g), b = [
1644
1649
  { x: n, y: r, anchor: "top-left" },
1645
1650
  { x: o, y: r, anchor: "top-right" },
1646
1651
  { x: n, y: i, anchor: "bottom-left" },
@@ -1655,23 +1660,23 @@ function oi(e, t) {
1655
1660
  v = c + (C * N - oe * T), I = l + (C * T + oe * N);
1656
1661
  }
1657
1662
  e.save(), e.beginPath(), e.arc(v, I, y, 0, Math.PI * 2), e.fillStyle = "#fff", e.fill(), e.strokeStyle = bn(), e.lineWidth = E && S && z.anchor === S ? Yn(g) * 1.25 : Yn(g), e.stroke(), e.restore();
1658
- }), E || ro(e, p, m, g, bn()), w.getMode() === "resize" && ii(e, c, i, a, u);
1663
+ }), E || lo(e, p, m, g, bn()), w.getMode() === "resize" && ui(e, c, i, a, u);
1659
1664
  }
1660
- function ii(e, t, n, r, o) {
1665
+ function ui(e, t, n, r, o) {
1661
1666
  const i = `${Math.round(r)} × ${Math.round(o)}`, c = t, l = n + 30;
1662
1667
  e.save(), e.font = "10px system-ui, -apple-system, sans-serif";
1663
1668
  const u = e.measureText(i).width + 12, d = 18;
1664
1669
  e.shadowColor = "rgba(0,0,0,0.2)", e.shadowBlur = 4, e.shadowOffsetY = 1, e.fillStyle = "#333", e.beginPath(), e.roundRect(c - u / 2, l - d / 2, u, d, 3), e.fill(), e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetY = 0, e.fillStyle = "#fff", e.textAlign = "center", e.textBaseline = "middle", e.fillText(i, c, l + 0.5), e.restore();
1665
1670
  }
1666
- function ci(e) {
1671
+ function hi(e) {
1667
1672
  const { ctx: t, marqueeStart: n, marqueeEnd: r, zoom: o = 1 } = e, i = Math.min(n.x, r.x), c = Math.max(n.x, r.x), l = Math.min(n.y, r.y), a = Math.max(n.y, r.y);
1668
- t.save(), t.strokeStyle = bn(), t.lineWidth = Yn(o), t.strokeRect(i, l, c - i, a - l), t.fillStyle = qr(0.1), t.fillRect(i, l, c - i, a - l), t.restore();
1673
+ t.save(), t.strokeStyle = bn(), t.lineWidth = Yn(o), t.strokeRect(i, l, c - i, a - l), t.fillStyle = to(0.1), t.fillRect(i, l, c - i, a - l), t.restore();
1669
1674
  }
1670
- function ai(e) {
1675
+ function fi(e) {
1671
1676
  const { ctx: t, hoveredChild: n, zoom: r = 1 } = e, o = n.getVisualBoundingBox();
1672
- t.save(), t.translate(o.x + o.width / 2, o.y + o.height / 2), t.rotate(-n.rotation * Math.PI / 180), t.translate(-(o.x + o.width / 2), -(o.y + o.height / 2)), t.strokeStyle = Zr(), t.lineWidth = Yn(r), t.setLineDash([]), t.strokeRect(o.x, o.y, o.width, o.height), t.restore();
1677
+ t.save(), t.translate(o.x + o.width / 2, o.y + o.height / 2), t.rotate(-n.rotation * Math.PI / 180), t.translate(-(o.x + o.width / 2), -(o.y + o.height / 2)), t.strokeStyle = no(), t.lineWidth = Yn(r), t.setLineDash([]), t.strokeRect(o.x, o.y, o.width, o.height), t.restore();
1673
1678
  }
1674
- const li = 60;
1679
+ const mi = 60;
1675
1680
  class On {
1676
1681
  constructor() {
1677
1682
  this.frameTimes = [], this.metrics = {
@@ -1690,7 +1695,7 @@ class On {
1690
1695
  * of the last 60 values and recomputes the average.
1691
1696
  */
1692
1697
  recordFrameTime(t) {
1693
- this.frameTimes.push(t), this.frameTimes.length > li && this.frameTimes.shift(), this.metrics.frameCount++, this.metrics.frameTime = this._average(this.frameTimes);
1698
+ this.frameTimes.push(t), this.frameTimes.length > mi && this.frameTimes.shift(), this.metrics.frameCount++, this.metrics.frameTime = this._average(this.frameTimes);
1694
1699
  }
1695
1700
  /** Record the duration of an export operation. */
1696
1701
  recordExportDuration(t) {
@@ -1727,7 +1732,7 @@ class On {
1727
1732
  return n / t.length;
1728
1733
  }
1729
1734
  }
1730
- function di(e, t, n) {
1735
+ function pi(e, t, n) {
1731
1736
  if (e.length === 0 || !e.every((c) => {
1732
1737
  var a;
1733
1738
  const l = (a = t == null ? void 0 : t[c.id]) == null ? void 0 : a.boundary;
@@ -1750,7 +1755,7 @@ function di(e, t, n) {
1750
1755
  })
1751
1756
  };
1752
1757
  }
1753
- function ui(e) {
1758
+ function gi(e) {
1754
1759
  const t = be(e);
1755
1760
  t.current = e;
1756
1761
  const n = be(!0), r = be(null), o = be("#0a0a0a");
@@ -1802,14 +1807,14 @@ function ui(e) {
1802
1807
  if (a.startTime !== null && a.type !== null && performance.now() - a.startTime < 150 && (n.current = !0), n.current) {
1803
1808
  n.current = !1;
1804
1809
  const u = performance.now();
1805
- hi(t.current, o, r), On.getInstance().recordFrameTime(performance.now() - u);
1810
+ xi(t.current, o, r), On.getInstance().recordFrameTime(performance.now() - u);
1806
1811
  }
1807
1812
  i = requestAnimationFrame(l);
1808
1813
  };
1809
1814
  return i = requestAnimationFrame(l), () => cancelAnimationFrame(i);
1810
1815
  }, []);
1811
1816
  }
1812
- function hi(e, t, n) {
1817
+ function xi(e, t, n) {
1813
1818
  var et, at, re;
1814
1819
  const {
1815
1820
  canvasRef: r,
@@ -1876,7 +1881,7 @@ function hi(e, t, n) {
1876
1881
  Ze.width = F * Ye, Ze.height = ee * Ye, ie.setTransform(1, 0, 0, 1, 0, 0), ie.clearRect(0, 0, Ze.width, Ze.height);
1877
1882
  const X = t.current;
1878
1883
  ie.scale(Ye, Ye), k !== 1 && ie.scale(k, k), (E !== 0 || S !== 0) && ie.translate(E, S);
1879
- const _ = c.find((he) => he.id === l.getActiveArtboardId()), ft = (_ == null ? void 0 : _.id) ?? null, qe = Ce && _ ? di(
1884
+ const _ = c.find((he) => he.id === l.getActiveArtboardId()), ft = (_ == null ? void 0 : _.id) ?? null, qe = Ce && _ ? pi(
1880
1885
  Ce.pieces,
1881
1886
  Ce.guides,
1882
1887
  e.focusedPieceId ?? null
@@ -2032,7 +2037,7 @@ function hi(e, t, n) {
2032
2037
  _.width,
2033
2038
  _.height,
2034
2039
  dt
2035
- ), ie.clip()), Go({
2040
+ ), ie.clip()), Qo({
2036
2041
  ctx: ie,
2037
2042
  artboardOrigin: { x: _.x, y: _.y },
2038
2043
  artboardWidth: _.width,
@@ -2090,7 +2095,7 @@ function hi(e, t, n) {
2090
2095
  zoom: k,
2091
2096
  paddingOffset: { x: E, y: S }
2092
2097
  });
2093
- const _t = Ue ? yt : Me, zt = new Set(Ct.map((he) => he.id)), { updatedOBB: G, groupBounds: $e } = ri({
2098
+ const _t = Ue ? yt : Me, zt = new Set(Ct.map((he) => he.id)), { updatedOBB: G, groupBounds: $e } = li({
2094
2099
  ctx: ie,
2095
2100
  displaySelection: _t,
2096
2101
  elements: o,
@@ -2102,9 +2107,9 @@ function hi(e, t, n) {
2102
2107
  isMarqueeSelecting: Ue,
2103
2108
  zoom: k
2104
2109
  });
2105
- G && Ve.current !== G && (Ve.current = G), ht.current = $e, Ue && ci({ ctx: ie, marqueeStart: It, marqueeEnd: vt, zoom: k }), T.type === "group-sibling" && T.data && ai({ ctx: ie, hoveredChild: T.data, zoom: k }), wt.isActive() && d instanceof vn && wt.renderPreview(ie, d);
2110
+ G && Ve.current !== G && (Ve.current = G), ht.current = $e, Ue && hi({ ctx: ie, marqueeStart: It, marqueeEnd: vt, zoom: k }), T.type === "group-sibling" && T.data && fi({ ctx: ie, hoveredChild: T.data, zoom: k }), wt.isActive() && d instanceof vn && wt.renderPreview(ie, d);
2106
2111
  }
2107
- class fi {
2112
+ class yi {
2108
2113
  /**
2109
2114
  * Apply the pinch gesture to `element` in place and return it. The
2110
2115
  * element is expected to already be a clone (the state machine
@@ -2127,8 +2132,8 @@ class fi {
2127
2132
  return S = (S % 360 + 360) % 360, S > 180 && (S -= 360), l && (S = l(S, t)), t.setRotation(S), t;
2128
2133
  }
2129
2134
  }
2130
- function mi(e) {
2131
- const { x: t, y: n, bounds: r, zoom: o = 1 } = e, i = Jr / o, c = r.rotation || 0, a = [
2135
+ function bi(e) {
2136
+ const { x: t, y: n, bounds: r, zoom: o = 1 } = e, i = so / o, c = r.rotation || 0, a = [
2132
2137
  { x: r.minX, y: r.minY, anchor: "top-left" },
2133
2138
  { x: r.maxX, y: r.minY, anchor: "top-right" },
2134
2139
  { x: r.minX, y: r.maxY, anchor: "bottom-left" },
@@ -2161,7 +2166,7 @@ function mi(e) {
2161
2166
  }
2162
2167
  return p >= r.minX && p <= r.maxX && m >= r.minY && m <= r.maxY ? { type: "bounds-drag" } : { type: "none" };
2163
2168
  }
2164
- function pi(e) {
2169
+ function vi(e) {
2165
2170
  const { multiSelection: t, elements: n, bounds: r, anchor: o, corner: i, x: c, y: l, stateMachine: a } = e, u = t.map((d) => n.find((p) => p.id === d)).filter((d) => d !== void 0 && !d.locked);
2166
2171
  return u.length === 0 ? !1 : (a._multiSelectionResizeContext = {
2167
2172
  anchor: o,
@@ -2196,7 +2201,7 @@ function pi(e) {
2196
2201
  }
2197
2202
  ), !0);
2198
2203
  }
2199
- function gi(e) {
2204
+ function wi(e) {
2200
2205
  const {
2201
2206
  multiSelection: t,
2202
2207
  elements: n,
@@ -2227,7 +2232,7 @@ function gi(e) {
2227
2232
  // Initial rotation for the group
2228
2233
  ), !0;
2229
2234
  }
2230
- function xi(e) {
2235
+ function Ci(e) {
2231
2236
  const { multiSelection: t, elements: n, x: r, y: o, stateMachine: i, dragOriginalElementsRef: c, setHoverState: l } = e, a = t.map((u) => n.find((d) => d.id === u)).filter((u) => u !== void 0 && !u.locked);
2232
2237
  return a.length === 0 ? !1 : (i._multiSelectionDragContext = {
2233
2238
  startX: r,
@@ -2242,7 +2247,7 @@ function xi(e) {
2242
2247
  c.current.set(u.id, u.clone());
2243
2248
  }), i.startDrag(a[0], r, o), l({ type: null, data: null }), !0);
2244
2249
  }
2245
- function yi(e) {
2250
+ function Si(e) {
2246
2251
  const { selectedElement: t, activeChildElement: n } = e;
2247
2252
  let r = null, o = -1;
2248
2253
  if (n instanceof Ot && n.isCropping)
@@ -2263,14 +2268,14 @@ function yi(e) {
2263
2268
  isChildInGroup: r !== null
2264
2269
  } : null;
2265
2270
  }
2266
- function bi(e) {
2271
+ function Ei(e) {
2267
2272
  const { x: t, y: n, cropContext: r, transformHandles: o, zoom: i = 1 } = e, { croppingImage: c } = r, l = c.hitTestCropHandle(t, n, i);
2268
2273
  if (l)
2269
2274
  return { type: "crop-handle", handle: l };
2270
2275
  const a = o.hitTestResize(t, n, i);
2271
2276
  return a ? { type: "image-handle", handle: a } : c.hitTest(t, n) ? { type: "image-drag" } : { type: "exit-crop" };
2272
2277
  }
2273
- function vi(e) {
2278
+ function ki(e) {
2274
2279
  const { cropContext: t, cropHandle: n, x: r, y: o, selectedElement: i, activeChildElement: c, stateMachine: l } = e, { croppingImage: a, croppingChild: u, croppingChildIndex: d } = t, p = a.getCropBoxBounds();
2275
2280
  p && (l.startResize(
2276
2281
  a,
@@ -2296,7 +2301,7 @@ function vi(e) {
2296
2301
  childIndex: d
2297
2302
  }));
2298
2303
  }
2299
- function wi(e) {
2304
+ function Ri(e) {
2300
2305
  const { cropContext: t, imageHandle: n, x: r, y: o, selectedElement: i, activeChildElement: c, stateMachine: l } = e, { croppingImage: a, croppingChild: u, croppingChildIndex: d } = t, p = a.getBoundingBox(), m = a.getVisualBoundingBox();
2301
2306
  l.startResize(a, n, r, o, p, m), u && (c && c.id === u.id ? l._activeChildContext = {
2302
2307
  group: i,
@@ -2306,7 +2311,7 @@ function wi(e) {
2306
2311
  childIndex: d
2307
2312
  });
2308
2313
  }
2309
- function Ci(e) {
2314
+ function Mi(e) {
2310
2315
  const { cropContext: t, x: n, y: r, selectedElement: o, activeChildElement: i, stateMachine: c, dragOriginalElementsRef: l, setHoverState: a } = e, { croppingImage: u, croppingChild: d, croppingChildIndex: p } = t;
2311
2316
  l.current = /* @__PURE__ */ new Map(), d && o ? l.current.set(o.id, o.clone()) : l.current.set(u.id, u.clone()), c.startDrag(u, n, r, "crop-image-drag"), a({ type: null, data: null }), d && (i && i.id === d.id ? c._activeChildContext = {
2312
2317
  group: o,
@@ -2316,7 +2321,7 @@ function Ci(e) {
2316
2321
  childIndex: p
2317
2322
  });
2318
2323
  }
2319
- function Si(e) {
2324
+ function Ti(e) {
2320
2325
  const { cropContext: t, selectedElement: n, onElementUpdate: r, transformHandles: o, updateActiveChild: i, zoom: c } = e, { croppingImage: l, croppingChild: a, croppingChildIndex: u } = t;
2321
2326
  if (a && n instanceof De) {
2322
2327
  const d = a.clone();
@@ -2328,7 +2333,7 @@ function Si(e) {
2328
2333
  d.exitCropMode(), r(d), o.update(d, c);
2329
2334
  }
2330
2335
  }
2331
- function Ei(e) {
2336
+ function Ii(e) {
2332
2337
  const {
2333
2338
  x: t,
2334
2339
  y: n,
@@ -2357,7 +2362,7 @@ function er(e) {
2357
2362
  const { updateActiveChild: t, selectedElement: n, transformHandles: r, setHandlesVersion: o, zoom: i } = e;
2358
2363
  t(null), n && (r.update(n, i), o((c) => c + 1));
2359
2364
  }
2360
- function ki(e) {
2365
+ function Ni(e) {
2361
2366
  const {
2362
2367
  x: t,
2363
2368
  y: n,
@@ -2405,7 +2410,7 @@ function ki(e) {
2405
2410
  }
2406
2411
  return !1;
2407
2412
  }
2408
- const Ri = 900;
2413
+ const Pi = 900;
2409
2414
  function Es(e, t, n, r) {
2410
2415
  if (!r) return !0;
2411
2416
  const o = e.getVisualBoundingBox(), i = Math.max(o.x, r.x), c = Math.max(o.y, r.y), l = Math.min(
@@ -2415,9 +2420,9 @@ function Es(e, t, n, r) {
2415
2420
  o.y + o.height,
2416
2421
  r.y + r.height
2417
2422
  );
2418
- return Math.max(0, l - i) * Math.max(0, a - c) < Ri ? !0 : t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height;
2423
+ return Math.max(0, l - i) * Math.max(0, a - c) < Pi ? !0 : t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height;
2419
2424
  }
2420
- function Mi(e) {
2425
+ function Ai(e) {
2421
2426
  const {
2422
2427
  canvasRef: t,
2423
2428
  inputRef: n,
@@ -2635,9 +2640,9 @@ function Mi(e) {
2635
2640
  return;
2636
2641
  }
2637
2642
  if (ne.length > 0 && S.current) {
2638
- const R = S.current, $ = mi({ x: J, y: q, bounds: R, zoom: D });
2643
+ const R = S.current, $ = bi({ x: J, y: q, bounds: R, zoom: D });
2639
2644
  if ($.type === "corner-handle") {
2640
- if (pi({
2645
+ if (vi({
2641
2646
  multiSelection: ne,
2642
2647
  elements: U,
2643
2648
  bounds: R,
@@ -2651,7 +2656,7 @@ function Mi(e) {
2651
2656
  return;
2652
2657
  }
2653
2658
  } else if ($.type === "rotation-handle") {
2654
- if (gi({
2659
+ if (wi({
2655
2660
  multiSelection: ne,
2656
2661
  elements: U,
2657
2662
  bounds: R,
@@ -2665,7 +2670,7 @@ function Mi(e) {
2665
2670
  ie({});
2666
2671
  return;
2667
2672
  }
2668
- } else if ($.type === "bounds-drag" && xi({
2673
+ } else if ($.type === "bounds-drag" && Ci({
2669
2674
  multiSelection: ne,
2670
2675
  elements: U,
2671
2676
  x: J,
@@ -2680,11 +2685,11 @@ function Mi(e) {
2680
2685
  }
2681
2686
  const L = K || x;
2682
2687
  if (L && L.visible !== !1 && !L.locked && (ne.length === 0 || K)) {
2683
- const R = yi({ selectedElement: x || null, activeChildElement: K });
2688
+ const R = Si({ selectedElement: x || null, activeChildElement: K });
2684
2689
  if (R) {
2685
- const A = bi({ x: J, y: q, cropContext: R, transformHandles: F, zoom: D });
2690
+ const A = Ei({ x: J, y: q, cropContext: R, transformHandles: F, zoom: D });
2686
2691
  if (A.type === "crop-handle") {
2687
- vi({
2692
+ ki({
2688
2693
  cropContext: R,
2689
2694
  cropHandle: A.handle,
2690
2695
  x: J,
@@ -2695,7 +2700,7 @@ function Mi(e) {
2695
2700
  }), ie({});
2696
2701
  return;
2697
2702
  } else if (A.type === "image-handle") {
2698
- wi({
2703
+ Ri({
2699
2704
  cropContext: R,
2700
2705
  imageHandle: A.handle,
2701
2706
  x: J,
@@ -2706,7 +2711,7 @@ function Mi(e) {
2706
2711
  }), ie({});
2707
2712
  return;
2708
2713
  } else if (A.type === "image-drag") {
2709
- Ci({
2714
+ Mi({
2710
2715
  cropContext: R,
2711
2716
  x: J,
2712
2717
  y: q,
@@ -2718,7 +2723,7 @@ function Mi(e) {
2718
2723
  }), ie({});
2719
2724
  return;
2720
2725
  } else if (A.type === "exit-crop") {
2721
- Si({
2726
+ Ti({
2722
2727
  cropContext: R,
2723
2728
  selectedElement: x || null,
2724
2729
  onElementUpdate: we,
@@ -2768,7 +2773,7 @@ function Mi(e) {
2768
2773
  }
2769
2774
  }
2770
2775
  if (K && x instanceof De) {
2771
- if (Ei({
2776
+ if (Ii({
2772
2777
  x: J,
2773
2778
  y: q,
2774
2779
  activeChildElement: K,
@@ -2830,7 +2835,7 @@ function Mi(e) {
2830
2835
  return;
2831
2836
  }
2832
2837
  const Ae = dt();
2833
- if (ki({
2838
+ if (Ni({
2834
2839
  x: J,
2835
2840
  y: q,
2836
2841
  shiftKey: Y.shiftKey,
@@ -2844,7 +2849,7 @@ function Mi(e) {
2844
2849
  setHoverState: Ce,
2845
2850
  forceUpdate: ie
2846
2851
  })) return;
2847
- const W = Hr.shouldProtectClick(), Z = Br(Y.target);
2852
+ const W = Xr.shouldProtectClick(), Z = zr(Y.target);
2848
2853
  if (!W && !Z)
2849
2854
  if (gn.current > 1.001) {
2850
2855
  _e.current = {
@@ -2938,7 +2943,7 @@ function Mi(e) {
2938
2943
  const { a: L, b: Ae } = He.current, M = ce.current.get(L), W = ce.current.get(Ae);
2939
2944
  if (M && W) {
2940
2945
  const Z = h.updatePinch(M, W), { element: te, startData: pe } = h.getPinchContext();
2941
- fi.calculatePinch({
2946
+ yi.calculatePinch({
2942
2947
  element: te,
2943
2948
  startData: pe,
2944
2949
  scale: Z.scale,
@@ -3267,7 +3272,7 @@ function Mi(e) {
3267
3272
  if (L instanceof Ot && L.isCropping) {
3268
3273
  const M = L.hitTestCropHandle(J, q, D);
3269
3274
  if (M) {
3270
- const Z = Qr(
3275
+ const Z = ro(
3271
3276
  M.worldX,
3272
3277
  M.worldY,
3273
3278
  L.x,
@@ -3395,7 +3400,7 @@ function Mi(e) {
3395
3400
  delete h._activeChildContext;
3396
3401
  }
3397
3402
  if (h._multiSelectionResizeContext && delete h._multiSelectionResizeContext, U.forEach((M) => {
3398
- if (M instanceof eo && M._lockedLineCount !== void 0) {
3403
+ if (M instanceof oo && M._lockedLineCount !== void 0) {
3399
3404
  const W = M.clone();
3400
3405
  W._lockedLineCount = void 0, we(W);
3401
3406
  }
@@ -3614,7 +3619,7 @@ function ls(e) {
3614
3619
  ).join(`
3615
3620
  `);
3616
3621
  }
3617
- function Ti(e) {
3622
+ function Di(e) {
3618
3623
  const {
3619
3624
  canvasRef: t,
3620
3625
  inputRef: n,
@@ -3802,7 +3807,7 @@ function Ti(e) {
3802
3807
  else if (h.key === "ArrowUp" || h.key === "ArrowDown") {
3803
3808
  if (B && B instanceof it) {
3804
3809
  h.preventDefault();
3805
- const ee = h.key === "ArrowUp" ? "up" : "down", xe = Io(B, k, ee);
3810
+ const ee = h.key === "ArrowUp" ? "up" : "down", xe = Bo(B, k, ee);
3806
3811
  U(xe), ne(xe), se(xe), i.current = xe, F.setSelectionRange(xe, xe);
3807
3812
  }
3808
3813
  } else (h.key === "Home" || h.key === "End") && setTimeout(() => {
@@ -3930,7 +3935,7 @@ function Ti(e) {
3930
3935
  getWrappedTextForEditing: ls
3931
3936
  };
3932
3937
  }
3933
- const yr = Ar(
3938
+ const yr = Dr(
3934
3939
  ({
3935
3940
  elements: e,
3936
3941
  artboards: t,
@@ -3965,7 +3970,7 @@ const yr = Ar(
3965
3970
  pieceFocus: x,
3966
3971
  focusedPieceRect: K
3967
3972
  }, U) => {
3968
- const { resolvedTheme: ne } = fo(), se = be(null), D = b || se, le = be(null), Se = be(!1), me = be(0), ve = be(0), ue = be(0), Re = be(!1), Me = be(0), Ve = be(null), ht = be(0), Ue = be(null), It = be({ start: null, end: null }), vt = be(null), yt = be(null), wt = be(null), Ke = be(null), Ce = 400, Ze = 300, ie = 50, h = 200, F = ot.useMemo(() => {
3973
+ const { resolvedTheme: ne } = yo(), se = be(null), D = b || se, le = be(null), Se = be(!1), me = be(0), ve = be(0), ue = be(0), Re = be(!1), Me = be(0), Ve = be(null), ht = be(0), Ue = be(null), It = be({ start: null, end: null }), vt = be(null), yt = be(null), wt = be(null), Ke = be(null), Ce = 400, Ze = 300, ie = 50, h = 200, F = ot.useMemo(() => {
3969
3974
  if (!x || x === "spread") return null;
3970
3975
  const ke = (O == null ? void 0 : O.pieces) ?? [];
3971
3976
  if (ke.length <= 1) return null;
@@ -3989,7 +3994,7 @@ const yr = Ar(
3989
3994
  paddingOffsetX: _,
3990
3995
  paddingOffsetY: ft,
3991
3996
  zoomInvariantBorderRadius: qe
3992
- } = Yo({
3997
+ } = Vo({
3993
3998
  width: E,
3994
3999
  height: S,
3995
4000
  zoom: k,
@@ -4014,7 +4019,7 @@ const yr = Ar(
4014
4019
  currentRotation: at,
4015
4020
  setCurrentRotation: re,
4016
4021
  setRotatingElementVersion: he
4017
- } = _o(), {
4022
+ } = Uo(), {
4018
4023
  renderVersion: ce,
4019
4024
  forceRender: He,
4020
4025
  handlesVersion: We,
@@ -4022,8 +4027,8 @@ const yr = Ar(
4022
4027
  forceUpdate: ze,
4023
4028
  cursorAnimationFrame: Oe,
4024
4029
  setCursorAnimationFrame: nt
4025
- } = $o({ elements: e }), [_e] = V(() => new io()), [Rt] = V(() => new co({ showBorder: !1, showLabel: !1 })), [St] = V(() => new ao({ enabled: !0, showGuides: !0 })), [Qt] = V(() => new lo({ enabled: !0, showLabels: !0 })), [Ut] = V(() => {
4026
- const ke = new uo();
4030
+ } = Ko({ elements: e }), [_e] = V(() => new ho()), [Rt] = V(() => new fo({ showBorder: !1, showLabel: !1 })), [St] = V(() => new mo({ enabled: !0, showGuides: !0 })), [Qt] = V(() => new po({ enabled: !0, showLabels: !0 })), [Ut] = V(() => {
4031
+ const ke = new go();
4027
4032
  return ke.setResizePipeline(us), ke.setSnapHandler(St), ke;
4028
4033
  });
4029
4034
  Ne(() => {
@@ -4063,7 +4068,7 @@ const yr = Ar(
4063
4068
  us.removeHook("afterResize", ke);
4064
4069
  };
4065
4070
  }, [St]);
4066
- const { cropController: $n } = Ho(), { penTool: Y, penCursor: Ie } = Do({ selectedElement: Pe }), {
4071
+ const { cropController: $n } = $o(), { penTool: Y, penCursor: Ie } = Xo({ selectedElement: Pe }), {
4067
4072
  isEditing: tt,
4068
4073
  setIsEditing: J,
4069
4074
  editText: q,
@@ -4085,7 +4090,7 @@ const yr = Ar(
4085
4090
  editRichTextRef: fe,
4086
4091
  currentFormattingStyle: de,
4087
4092
  setCurrentFormattingStyle: Be
4088
- } = Oo({ selectedElement: Pe, ref: U });
4093
+ } = Wo({ selectedElement: Pe, ref: U });
4089
4094
  Ne(() => {
4090
4095
  const ke = Date.now() - Me.current, ge = Ve.current;
4091
4096
  ge && ke < Ze ? (Z !== ge.start || pe !== ge.end) && (W(ge.cursor), te(ge.start), j(ge.end), le.current && le.current.setSelectionRange(ge.start, ge.end)) : ge && ke >= Ze && (Ve.current = null);
@@ -4112,14 +4117,14 @@ const yr = Ar(
4112
4117
  startMarqueeSelection: Mt,
4113
4118
  updateMarqueeSelection: Tt,
4114
4119
  finishMarqueeSelection: en
4115
- } = No(), {
4120
+ } = zo(), {
4116
4121
  multiSelectionGroupBoundsRef: pt,
4117
4122
  multiSelectionOBBRef: Ht
4118
- } = Xo(o), {
4123
+ } = Fo(o), {
4119
4124
  activeChildElement: sn,
4120
4125
  updateActiveChild: rn,
4121
4126
  editingChildIdRef: Xt
4122
- } = Bo({ elements: e, selectedElement: Pe, transformHandles: _e, onActiveChildChange: d }), { hoverState: Kt, setHoverState: Gt } = zo({ onHoverChange: m }), $t = fs(() => {
4127
+ } = Oo({ elements: e, selectedElement: Pe, transformHandles: _e, onActiveChildChange: d }), { hoverState: Kt, setHoverState: Gt } = Yo({ onHoverChange: m }), $t = fs(() => {
4123
4128
  const ke = /* @__PURE__ */ new Map();
4124
4129
  return e.forEach((ge) => {
4125
4130
  const je = n.getArtboardIdForElement(ge.id);
@@ -4212,7 +4217,7 @@ const yr = Ar(
4212
4217
  toggleFormattingProperty: Hn,
4213
4218
  enterTextEditMode: Wn,
4214
4219
  getWrappedTextForEditing: Ft
4215
- } = Ti({
4220
+ } = Di({
4216
4221
  canvasRef: D,
4217
4222
  inputRef: le,
4218
4223
  editingChildIdRef: Xt,
@@ -4260,8 +4265,8 @@ const yr = Ar(
4260
4265
  handlePointerDown: Sn,
4261
4266
  handlePointerMove: En,
4262
4267
  handlePointerUp: Hs,
4263
- handleDoubleClick: Cr
4264
- } = Mi({
4268
+ handleDoubleClick: Sr
4269
+ } = Ai({
4265
4270
  canvasRef: D,
4266
4271
  inputRef: le,
4267
4272
  repositioningCursorRef: Se,
@@ -4340,7 +4345,7 @@ const yr = Ar(
4340
4345
  setCurrentFormattingStyle: Be,
4341
4346
  getWrappedTextForEditing: Ft
4342
4347
  });
4343
- ui({
4348
+ gi({
4344
4349
  canvasRef: D,
4345
4350
  elements: e,
4346
4351
  elementsByArtboard: $t,
@@ -4426,7 +4431,7 @@ const yr = Ar(
4426
4431
  }),
4427
4432
  [os, Hn, tt, G, is, k, He, q, M, Z, pe, Pe, _, ft]
4428
4433
  );
4429
- const Sr = fs(() => {
4434
+ const Er = fs(() => {
4430
4435
  if (!P || P.length === 0) return;
4431
4436
  const ke = Ye * k, ge = X * k, je = `M 0 0 h ${ke} v ${ge} h ${-ke} Z`, Je = P.map((lt) => {
4432
4437
  if (lt.kind === "rect" || lt.kind === "roundedRect") {
@@ -4475,7 +4480,7 @@ const yr = Ar(
4475
4480
  onPointerMove: En,
4476
4481
  onPointerUp: Hs,
4477
4482
  onPointerCancel: Hs,
4478
- onDoubleClick: Cr,
4483
+ onDoubleClick: Sr,
4479
4484
  style: {
4480
4485
  display: "block",
4481
4486
  // When pieceGuides are present (phone cases, anything with
@@ -4497,7 +4502,7 @@ const yr = Ar(
4497
4502
  left: `${z}px`,
4498
4503
  top: `${v}px`,
4499
4504
  touchAction: "none",
4500
- clipPath: Sr
4505
+ clipPath: Er
4501
4506
  }
4502
4507
  }
4503
4508
  ),
@@ -4516,7 +4521,7 @@ const yr = Ar(
4516
4521
  onChange: (st) => {
4517
4522
  const Xe = st.target.value;
4518
4523
  if (!A) {
4519
- const qt = to.fromPlainText(Xe, {});
4524
+ const qt = io.fromPlainText(Xe, {});
4520
4525
  fe.current = qt, H(qt), mt(Xe);
4521
4526
  const Vn = st.target.selectionEnd;
4522
4527
  W(Vn), te(st.target.selectionStart), j(st.target.selectionEnd);
@@ -4564,13 +4569,13 @@ const yr = Ar(
4564
4569
  onPointerMove: (st) => {
4565
4570
  if (st.buttons !== 1) return;
4566
4571
  if (Ue.current && Pe instanceof it && D.current) {
4567
- const Un = D.current.getBoundingClientRect(), fn = (st.clientX - Un.left) / k - _, an = (st.clientY - Un.top) / k - ft, Xs = Pe.getVisualBoundingBox(), Os = Pe.getRotationAnchor(), Ys = Jt.toRadiansInverse(Pe.rotation), _s = fn - Os.x, $s = an - Os.y, Fs = Math.cos(Ys), Ws = Math.sin(Ys), Er = _s * Fs - $s * Ws, kr = _s * Ws + $s * Fs, mn = It.current;
4572
+ const Un = D.current.getBoundingClientRect(), fn = (st.clientX - Un.left) / k - _, an = (st.clientY - Un.top) / k - ft, Xs = Pe.getVisualBoundingBox(), Os = Pe.getRotationAnchor(), Ys = Jt.toRadiansInverse(Pe.rotation), _s = fn - Os.x, $s = an - Os.y, Fs = Math.cos(Ys), Ws = Math.sin(Ys), kr = _s * Fs - $s * Ws, Rr = _s * Ws + $s * Fs, mn = It.current;
4568
4573
  let ws = 0;
4569
4574
  Ue.current === "start" && (mn != null && mn.start) ? ws = mn.start.textEdge.y - mn.start.center.y : Ue.current === "end" && (mn != null && mn.end) && (ws = mn.end.textEdge.y - mn.end.center.y);
4570
- const Rr = Er + Xs.width / 2, Mr = kr + ws + Xs.height / 2, pn = wn(Pe, { x: Rr, y: Mr });
4575
+ const Mr = kr + Xs.width / 2, Tr = Rr + ws + Xs.height / 2, pn = wn(Pe, { x: Mr, y: Tr });
4571
4576
  if (Ue.current === "start" ? pn <= pe ? (te(pn), W(pn)) : (te(pe), j(pn), W(pn), Ue.current = "end") : pn >= Z ? (j(pn), W(pn)) : (j(Z), te(pn), W(pn), Ue.current = "start"), le.current) {
4572
- const Tr = Math.min(Z, pe), Ir = Math.max(Z, pe);
4573
- le.current.setSelectionRange(Tr, Ir);
4577
+ const Ir = Math.min(Z, pe), Nr = Math.max(Z, pe);
4578
+ le.current.setSelectionRange(Ir, Nr);
4574
4579
  }
4575
4580
  return;
4576
4581
  }
@@ -4620,13 +4625,13 @@ const yr = Ar(
4620
4625
  }
4621
4626
  }
4622
4627
  );
4623
- return no(gt, document.body);
4628
+ return co(gt, document.body);
4624
4629
  })()
4625
4630
  ] });
4626
4631
  }
4627
4632
  );
4628
4633
  yr.displayName = "CanvasEditor";
4629
- const Ii = 0.25, Ni = 8, Pi = 0.1, Ai = 4, Di = 1e-3, Gc = ({
4634
+ const Bi = 0.25, zi = 8, Li = 0.1, Hi = 4, Xi = 1e-3, Qc = ({
4630
4635
  className: e,
4631
4636
  style: t,
4632
4637
  width: n,
@@ -4674,26 +4679,26 @@ const Ii = 0.25, Ni = 8, Pi = 0.1, Ai = 4, Di = 1e-3, Gc = ({
4674
4679
  } = dr(), {
4675
4680
  setTextSelectionVersion: ve,
4676
4681
  setExpandedPanelType: ue
4677
- } = zr(), Re = ot.useCallback(() => {
4682
+ } = Lr(), Re = ot.useCallback(() => {
4678
4683
  ue("crop");
4679
4684
  }, [ue]), Me = ot.useRef(null), [Ve, ht] = ot.useState(0), [Ue, It] = ot.useState(0), [vt, yt] = ot.useState(!1), wt = ot.useRef(0), Ke = ot.useRef(!1), [Ce, Ze] = ot.useState(!1), ie = ot.useRef(null);
4680
- Eo({ enabled: p });
4685
+ Io({ enabled: p });
4681
4686
  const h = k.getActiveArtboard(), F = ot.useCallback(
4682
4687
  (re) => {
4683
4688
  if (!(c || re.ctrlKey || re.metaKey)) return;
4684
4689
  re.preventDefault();
4685
4690
  const ce = Me.current;
4686
4691
  if (!ce) return;
4687
- const He = ce.getBoundingClientRect(), We = re.clientX - He.left, Ee = re.clientY - He.top, ze = -re.deltaY * Di;
4692
+ const He = ce.getBoundingClientRect(), We = re.clientX - He.left, Ee = re.clientY - He.top, ze = -re.deltaY * Xi;
4688
4693
  if (c) {
4689
- const Oe = Ve, nt = Math.min(Math.max(Oe * (1 + ze), Pi), Ai);
4694
+ const Oe = Ve, nt = Math.min(Math.max(Oe * (1 + ze), Li), Hi);
4690
4695
  if (nt === Oe) return;
4691
4696
  const _e = nt / Oe, Rt = We - (We - T.x) * _e, St = Ee - (Ee - T.y) * _e;
4692
4697
  ht(nt), C({ x: Rt, y: St });
4693
4698
  } else {
4694
4699
  const Oe = O, nt = Math.min(
4695
- Math.max(Oe * (1 + ze), Ii),
4696
- Ni
4700
+ Math.max(Oe * (1 + ze), Bi),
4701
+ zi
4697
4702
  );
4698
4703
  if (nt === Oe) return;
4699
4704
  const _e = nt / Oe, Rt = We - (We - T.x) * _e, St = Ee - (Ee - T.y) * _e;
@@ -4762,7 +4767,7 @@ const Ii = 0.25, Ni = 8, Pi = 0.1, Ai = 4, Di = 1e-3, Gc = ({
4762
4767
  } : null;
4763
4768
  const he = re.find((ce) => ce.id === g.pieceId);
4764
4769
  return he ? { x: he.x, y: he.y, width: he.width, height: he.height } : null;
4765
- }, [g, w, h]), we = Mo(Te);
4770
+ }, [g, w, h]), we = Ao(Te);
4766
4771
  ot.useEffect(() => {
4767
4772
  if (o !== void 0) {
4768
4773
  ht(o);
@@ -4953,7 +4958,7 @@ const Ii = 0.25, Ni = 8, Pi = 0.1, Ai = 4, Di = 1e-3, Gc = ({
4953
4958
  }
4954
4959
  ) }),
4955
4960
  !c && (O < 0.999 || O > 1.001) && /* @__PURE__ */ s(
4956
- zi,
4961
+ Yi,
4957
4962
  {
4958
4963
  userZoom: O,
4959
4964
  onSetZoom: (re) => {
@@ -4977,8 +4982,8 @@ const Ii = 0.25, Ni = 8, Pi = 0.1, Ai = 4, Di = 1e-3, Gc = ({
4977
4982
  ]
4978
4983
  }
4979
4984
  );
4980
- }, Bi = [1, 2, 4, 8];
4981
- function zi({
4985
+ }, Oi = [1, 2, 4, 8];
4986
+ function Yi({
4982
4987
  userZoom: e,
4983
4988
  onSetZoom: t
4984
4989
  }) {
@@ -5020,7 +5025,7 @@ function zi({
5020
5025
  backdropFilter: "blur(6px)"
5021
5026
  },
5022
5027
  className: "sc:flex sc:flex-col sc:rounded-2xl sc:border sc:border-border/40 sc:bg-popover/95 sc:p-1 sc:shadow-lg",
5023
- children: Bi.map((i) => {
5028
+ children: Oi.map((i) => {
5024
5029
  const c = i * 100, l = Math.abs(e - i) < 0.05;
5025
5030
  return /* @__PURE__ */ f(
5026
5031
  "button",
@@ -5069,153 +5074,7 @@ function zi({
5069
5074
  }
5070
5075
  );
5071
5076
  }
5072
- const ss = /* @__PURE__ */ new Map();
5073
- function At(e, t) {
5074
- ss.set(e, t);
5075
- }
5076
- function jc(e) {
5077
- return ss.get(e);
5078
- }
5079
- function qc() {
5080
- return Array.from(ss.keys());
5081
- }
5082
- function Zc() {
5083
- return Array.from(ss.entries());
5084
- }
5085
- function Jc(e) {
5086
- ss.delete(e);
5087
- }
5088
- let xs = !1;
5089
- async function Qc() {
5090
- if (xs) return;
5091
- xs = !0;
5092
- const [
5093
- { LayersPanel: e },
5094
- { EffectsPanel: t },
5095
- { ExportPanel: n },
5096
- { ImagePanel: r },
5097
- { GlyphPanel: o },
5098
- { ArtboardTabs: i },
5099
- { ContextualToolbars: c },
5100
- { ZoomControls: l },
5101
- { MenuButton: a },
5102
- { CropPanel: u }
5103
- ] = await Promise.all([
5104
- import("./MenuButton-CeoEAtzP.js").then((d) => d.E),
5105
- Promise.resolve().then(() => pc),
5106
- Promise.resolve().then(() => xc),
5107
- Promise.resolve().then(() => Ec),
5108
- Promise.resolve().then(() => Tc),
5109
- Promise.resolve().then(() => Nc),
5110
- import("./ContextualToolbars-CkLjHNPn.js").then((d) => d.x),
5111
- Promise.resolve().then(() => Pc),
5112
- import("./MenuButton-CeoEAtzP.js").then((d) => d.F),
5113
- import("./ContextualToolbars-CkLjHNPn.js").then((d) => d.w)
5114
- ]);
5115
- At("layers-panel", {
5116
- component: e,
5117
- label: "Layers",
5118
- icon: "gravity-ui:layers",
5119
- position: "left"
5120
- }), At("effects-panel", {
5121
- component: t,
5122
- label: "Effects",
5123
- icon: "gravity-ui:sparkles",
5124
- position: "right"
5125
- }), At("export-panel", {
5126
- component: n,
5127
- label: "Export",
5128
- icon: "gravity-ui:arrow-down-to-square",
5129
- position: "right"
5130
- }), At("images-panel", {
5131
- component: r,
5132
- label: "Images",
5133
- icon: "gravity-ui:picture",
5134
- position: "right"
5135
- }), At("glyph-panel", {
5136
- component: o,
5137
- label: "Glyphs",
5138
- icon: "gravity-ui:text",
5139
- position: "right"
5140
- }), At("artboard-tabs", {
5141
- component: i,
5142
- label: "Artboards",
5143
- icon: "gravity-ui:copy",
5144
- position: "topbar"
5145
- }), At("contextual-toolbar", {
5146
- component: c,
5147
- label: "Contextual Toolbar",
5148
- position: "topbar"
5149
- }), At("zoom-controls", {
5150
- component: l,
5151
- label: "Zoom",
5152
- icon: "gravity-ui:magnifier",
5153
- position: "bottombar"
5154
- }), At("menu-button", {
5155
- component: a,
5156
- label: "Menu",
5157
- icon: "gravity-ui:bars",
5158
- position: "topbar"
5159
- }), At("crop-panel", {
5160
- component: u,
5161
- label: "Crop",
5162
- icon: "gravity-ui:scissors",
5163
- position: "right"
5164
- });
5165
- }
5166
- function ea(e) {
5167
- xs || (xs = !0, At("layers-panel", {
5168
- component: e.LayersPanel,
5169
- label: "Layers",
5170
- icon: "gravity-ui:layers",
5171
- position: "left"
5172
- }), At("effects-panel", {
5173
- component: e.EffectsPanel,
5174
- label: "Effects",
5175
- icon: "gravity-ui:sparkles",
5176
- position: "right"
5177
- }), At("export-panel", {
5178
- component: e.ExportPanel,
5179
- label: "Export",
5180
- icon: "gravity-ui:arrow-down-to-square",
5181
- position: "right"
5182
- }), At("images-panel", {
5183
- component: e.ImagePanel,
5184
- label: "Images",
5185
- icon: "gravity-ui:picture",
5186
- position: "right"
5187
- }), At("glyph-panel", {
5188
- component: e.GlyphPanel,
5189
- label: "Glyphs",
5190
- icon: "gravity-ui:text",
5191
- position: "right"
5192
- }), At("artboard-tabs", {
5193
- component: e.ArtboardTabs,
5194
- label: "Artboards",
5195
- icon: "gravity-ui:copy",
5196
- position: "topbar"
5197
- }), At("contextual-toolbar", {
5198
- component: e.ContextualToolbars,
5199
- label: "Contextual Toolbar",
5200
- position: "topbar"
5201
- }), At("zoom-controls", {
5202
- component: e.ZoomControls,
5203
- label: "Zoom",
5204
- icon: "gravity-ui:magnifier",
5205
- position: "bottombar"
5206
- }), At("menu-button", {
5207
- component: e.MenuButton,
5208
- label: "Menu",
5209
- icon: "gravity-ui:bars",
5210
- position: "topbar"
5211
- }), At("crop-panel", {
5212
- component: e.CropPanel,
5213
- label: "Crop",
5214
- icon: "gravity-ui:scissors",
5215
- position: "right"
5216
- }));
5217
- }
5218
- const Li = mr(
5077
+ const _i = mr(
5219
5078
  "sc:inline-flex sc:items-center sc:rounded-badge sc:border sc:px-2.5 sc:py-0.5 sc:text-xs sc:transition-colors sc:focus:outline-none sc:focus:ring-2 sc:focus:ring-ring sc:focus:ring-offset-2 sc:font-caption",
5220
5079
  {
5221
5080
  variants: {
@@ -5267,7 +5126,7 @@ function Xn({
5267
5126
  "div",
5268
5127
  {
5269
5128
  className: zn(
5270
- Li({ variant: w, size: n }),
5129
+ _i({ variant: w, size: n }),
5271
5130
  g.secondary,
5272
5131
  g.outline,
5273
5132
  e
@@ -5326,7 +5185,7 @@ const Dn = Bn.forwardRef(
5326
5185
  )
5327
5186
  );
5328
5187
  Dn.displayName = "Fieldset";
5329
- const Hi = Bn.forwardRef(
5188
+ const $i = Bn.forwardRef(
5330
5189
  ({ className: e, children: t, ...n }, r) => /* @__PURE__ */ s(
5331
5190
  "legend",
5332
5191
  {
@@ -5337,7 +5196,7 @@ const Hi = Bn.forwardRef(
5337
5196
  }
5338
5197
  )
5339
5198
  );
5340
- Hi.displayName = "Legend";
5199
+ $i.displayName = "Legend";
5341
5200
  const es = Bn.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(Jn.Root, { className: zn("sc:grid sc:gap-2", e), ...t, ref: n }));
5342
5201
  es.displayName = Jn.Root.displayName;
5343
5202
  const Ms = Bn.forwardRef(({ className: e, variant: t, ...n }, r) => {
@@ -5376,7 +5235,7 @@ const Vt = Bn.forwardRef(
5376
5235
  ] }) : /* @__PURE__ */ s(Ms, { ref: o, className: t, variant: n, ...r })
5377
5236
  );
5378
5237
  Vt.displayName = "Radio";
5379
- const Xi = mr("sc:pointer-events-none sc:relative sc:origin-center sc:animate-spin sc:size-6 sc:text-primary", {
5238
+ const Fi = mr("sc:pointer-events-none sc:relative sc:origin-center sc:animate-spin sc:size-6 sc:text-primary", {
5380
5239
  variants: {
5381
5240
  size: {
5382
5241
  sm: "sc:size-4",
@@ -5394,14 +5253,14 @@ const Xi = mr("sc:pointer-events-none sc:relative sc:origin-center sc:animate-sp
5394
5253
  }
5395
5254
  }
5396
5255
  });
5397
- function Oi({ className: e, size: t, color: n, label: r = "Loading", ...o }) {
5256
+ function Wi({ className: e, size: t, color: n, label: r = "Loading", ...o }) {
5398
5257
  const i = Bn.useId();
5399
5258
  return /* @__PURE__ */ s(
5400
5259
  "span",
5401
5260
  {
5402
5261
  role: "status",
5403
5262
  "aria-label": r,
5404
- className: zn(Xi({ size: t, color: n }), e),
5263
+ className: zn(Fi({ size: t, color: n }), e),
5405
5264
  ...o,
5406
5265
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 24 24", className: "sc:size-full", "aria-hidden": !0, children: [
5407
5266
  /* @__PURE__ */ f("defs", { children: [
@@ -5468,7 +5327,152 @@ const br = Bn.forwardRef(
5468
5327
  br.displayName = "Textarea";
5469
5328
  const vr = br;
5470
5329
  vr.displayName = "TextArea";
5471
- const Yi = ({ stroke: e, onChange: t }) => {
5330
+ const ss = /* @__PURE__ */ new Map();
5331
+ function At(e, t) {
5332
+ ss.set(e, t);
5333
+ }
5334
+ function ea(e) {
5335
+ return ss.get(e);
5336
+ }
5337
+ function ta() {
5338
+ return Array.from(ss.keys());
5339
+ }
5340
+ function na() {
5341
+ return Array.from(ss.entries());
5342
+ }
5343
+ function sa(e) {
5344
+ ss.delete(e);
5345
+ }
5346
+ let xs = !1;
5347
+ async function ra() {
5348
+ if (xs) return;
5349
+ xs = !0, wr();
5350
+ const [
5351
+ { EffectsPanel: e },
5352
+ { ExportPanel: t },
5353
+ { ImagePanel: n },
5354
+ { GlyphPanel: r },
5355
+ { ArtboardTabs: o },
5356
+ { ContextualToolbars: i },
5357
+ { ZoomControls: c },
5358
+ { CropPanel: l }
5359
+ ] = await Promise.all([
5360
+ Promise.resolve().then(() => vc),
5361
+ Promise.resolve().then(() => Cc),
5362
+ Promise.resolve().then(() => Ic),
5363
+ Promise.resolve().then(() => Dc),
5364
+ Promise.resolve().then(() => zc),
5365
+ import("./ContextualToolbars--vTtorNg.js").then((a) => a.x),
5366
+ Promise.resolve().then(() => Lc),
5367
+ import("./ContextualToolbars--vTtorNg.js").then((a) => a.w)
5368
+ ]);
5369
+ At("effects-panel", {
5370
+ component: e,
5371
+ label: "Effects",
5372
+ icon: "gravity-ui:sparkles",
5373
+ position: "right"
5374
+ }), At("export-panel", {
5375
+ component: t,
5376
+ label: "Export",
5377
+ icon: "gravity-ui:arrow-down-to-square",
5378
+ position: "right"
5379
+ }), At("images-panel", {
5380
+ component: n,
5381
+ label: "Images",
5382
+ icon: "gravity-ui:picture",
5383
+ position: "right"
5384
+ }), At("glyph-panel", {
5385
+ component: r,
5386
+ label: "Glyphs",
5387
+ icon: "gravity-ui:text",
5388
+ position: "right"
5389
+ }), At("artboard-tabs", {
5390
+ component: o,
5391
+ label: "Artboards",
5392
+ icon: "gravity-ui:copy",
5393
+ position: "topbar"
5394
+ }), At("contextual-toolbar", {
5395
+ component: i,
5396
+ label: "Contextual Toolbar",
5397
+ position: "topbar"
5398
+ }), At("zoom-controls", {
5399
+ component: c,
5400
+ label: "Zoom",
5401
+ icon: "gravity-ui:magnifier",
5402
+ position: "bottombar"
5403
+ }), At("crop-panel", {
5404
+ component: l,
5405
+ label: "Crop",
5406
+ icon: "gravity-ui:scissors",
5407
+ position: "right"
5408
+ });
5409
+ }
5410
+ function wr() {
5411
+ At("layers-panel", {
5412
+ component: Or,
5413
+ label: "Layers",
5414
+ icon: "gravity-ui:layers",
5415
+ position: "left"
5416
+ }), At("menu-button", {
5417
+ component: Yr,
5418
+ label: "Menu",
5419
+ icon: "gravity-ui:bars",
5420
+ position: "topbar"
5421
+ }), At("undo-redo-controls", {
5422
+ component: _r,
5423
+ label: "Undo / Redo",
5424
+ icon: "lucide:undo-2",
5425
+ position: "topbar"
5426
+ }), At("add-element-menu", {
5427
+ component: $r,
5428
+ label: "Add Element",
5429
+ icon: "gravity-ui:plus",
5430
+ position: "topbar"
5431
+ });
5432
+ }
5433
+ function oa(e) {
5434
+ xs || (xs = !0, wr(), At("effects-panel", {
5435
+ component: e.EffectsPanel,
5436
+ label: "Effects",
5437
+ icon: "gravity-ui:sparkles",
5438
+ position: "right"
5439
+ }), At("export-panel", {
5440
+ component: e.ExportPanel,
5441
+ label: "Export",
5442
+ icon: "gravity-ui:arrow-down-to-square",
5443
+ position: "right"
5444
+ }), At("images-panel", {
5445
+ component: e.ImagePanel,
5446
+ label: "Images",
5447
+ icon: "gravity-ui:picture",
5448
+ position: "right"
5449
+ }), At("glyph-panel", {
5450
+ component: e.GlyphPanel,
5451
+ label: "Glyphs",
5452
+ icon: "gravity-ui:text",
5453
+ position: "right"
5454
+ }), At("artboard-tabs", {
5455
+ component: e.ArtboardTabs,
5456
+ label: "Artboards",
5457
+ icon: "gravity-ui:copy",
5458
+ position: "topbar"
5459
+ }), At("contextual-toolbar", {
5460
+ component: e.ContextualToolbars,
5461
+ label: "Contextual Toolbar",
5462
+ position: "topbar"
5463
+ }), At("zoom-controls", {
5464
+ component: e.ZoomControls,
5465
+ label: "Zoom",
5466
+ icon: "gravity-ui:magnifier",
5467
+ position: "bottombar"
5468
+ }), At("crop-panel", {
5469
+ component: e.CropPanel,
5470
+ label: "Crop",
5471
+ icon: "gravity-ui:scissors",
5472
+ position: "right"
5473
+ }));
5474
+ }
5475
+ const Vi = ({ stroke: e, onChange: t }) => {
5472
5476
  const [n, r] = V((e == null ? void 0 : e.enabled) || !1), o = (e == null ? void 0 : e.enabled) || !1, i = (e == null ? void 0 : e.color) || "#000000", c = (e == null ? void 0 : e.width) || 5, l = (e == null ? void 0 : e.lineCap) || "butt", a = (e == null ? void 0 : e.lineJoin) || "miter", u = (e == null ? void 0 : e.opacity) !== void 0 ? e.opacity : 1, d = (b) => {
5473
5477
  t(b ? {
5474
5478
  enabled: !0,
@@ -5512,7 +5516,7 @@ const Yi = ({ stroke: e, onChange: t }) => {
5512
5516
  /* @__PURE__ */ f(zs, { className: "sc:flex sc:flex-col sc:gap-lg sc:pt-lg", children: [
5513
5517
  /* @__PURE__ */ s(Dn, { className: "sc:flex sc:flex-col sc:gap-sm", children: /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:justify-between", children: [
5514
5518
  /* @__PURE__ */ s(xt, { children: "Color" }),
5515
- /* @__PURE__ */ s(po, { value: i, onChange: p })
5519
+ /* @__PURE__ */ s(vo, { value: i, onChange: p })
5516
5520
  ] }) }),
5517
5521
  /* @__PURE__ */ f("div", { className: "sc:flex sc:flex-col sc:gap-sm", children: [
5518
5522
  /* @__PURE__ */ s(xt, { children: "Width" }),
@@ -5548,7 +5552,7 @@ const Yi = ({ stroke: e, onChange: t }) => {
5548
5552
  "%"
5549
5553
  ] })
5550
5554
  ] }),
5551
- /* @__PURE__ */ f(Xr, { delayDuration: 300, children: [
5555
+ /* @__PURE__ */ f(Fr, { delayDuration: 300, children: [
5552
5556
  /* @__PURE__ */ f(Dn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
5553
5557
  /* @__PURE__ */ s(xt, { children: "Line Cap" }),
5554
5558
  /* @__PURE__ */ f(es, { value: l, onValueChange: g, orientation: "horizontal", children: [
@@ -5586,7 +5590,7 @@ const Yi = ({ stroke: e, onChange: t }) => {
5586
5590
  ] })
5587
5591
  ] })
5588
5592
  ] });
5589
- }, _i = ({ mask: e, index: t, isFirst: n, isLast: r, onUpdate: o, onRemove: i, onReorder: c }) => {
5593
+ }, Ui = ({ mask: e, index: t, isFirst: n, isLast: r, onUpdate: o, onRemove: i, onReorder: c }) => {
5590
5594
  var z;
5591
5595
  const [l, a] = V(!1), u = (v) => {
5592
5596
  switch (v) {
@@ -5972,12 +5976,12 @@ const Yi = ({ stroke: e, onChange: t }) => {
5972
5976
  ] })
5973
5977
  ] })
5974
5978
  ] });
5975
- }, $i = ({ masks: e = [], onChange: t }) => {
5979
+ }, Ki = ({ masks: e = [], onChange: t }) => {
5976
5980
  const [n, r] = V(e.length > 0), [o, i] = V(!1), c = (d) => {
5977
5981
  const p = {
5978
5982
  id: `mask-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
5979
5983
  type: d,
5980
- maskElement: Fi(d),
5984
+ maskElement: Gi(d),
5981
5985
  inverted: !1,
5982
5986
  feather: 0,
5983
5987
  opacity: 1
@@ -6080,7 +6084,7 @@ const Yi = ({ stroke: e, onChange: t }) => {
6080
6084
  )
6081
6085
  ] }),
6082
6086
  n && e.length > 0 && /* @__PURE__ */ s("div", { className: "sc:mt-xl sc:flex sc:flex-col sc:gap-md", children: e.map((d, p) => /* @__PURE__ */ s(
6083
- _i,
6087
+ Ui,
6084
6088
  {
6085
6089
  mask: d,
6086
6090
  index: p,
@@ -6098,7 +6102,7 @@ const Yi = ({ stroke: e, onChange: t }) => {
6098
6102
  ] })
6099
6103
  ] });
6100
6104
  };
6101
- function Fi(e) {
6105
+ function Gi(e) {
6102
6106
  switch (e) {
6103
6107
  case "clip":
6104
6108
  return {
@@ -6156,7 +6160,7 @@ function Fi(e) {
6156
6160
  };
6157
6161
  }
6158
6162
  }
6159
- const Wi = {
6163
+ const ji = {
6160
6164
  enabled: !0,
6161
6165
  style: "worn",
6162
6166
  intensity: 30,
@@ -6165,7 +6169,7 @@ const Wi = {
6165
6169
  edgeWear: 40,
6166
6170
  seed: void 0
6167
6171
  // Will be generated when applied
6168
- }, Vi = {
6172
+ }, qi = {
6169
6173
  enabled: !0,
6170
6174
  style: "worn",
6171
6175
  intensity: 55,
@@ -6173,7 +6177,7 @@ const Wi = {
6173
6177
  grainAmount: 25,
6174
6178
  edgeWear: 60,
6175
6179
  seed: void 0
6176
- }, Ui = {
6180
+ }, Zi = {
6177
6181
  enabled: !0,
6178
6182
  style: "worn",
6179
6183
  intensity: 75,
@@ -6181,97 +6185,97 @@ const Wi = {
6181
6185
  grainAmount: 40,
6182
6186
  edgeWear: 80,
6183
6187
  seed: void 0
6184
- }, Ki = {
6188
+ }, Ji = {
6185
6189
  enabled: !0,
6186
6190
  style: "cracked",
6187
6191
  intensity: 25,
6188
6192
  scratchAmount: 30,
6189
6193
  edgeWear: 20,
6190
6194
  seed: void 0
6191
- }, Gi = {
6195
+ }, Qi = {
6192
6196
  enabled: !0,
6193
6197
  style: "cracked",
6194
6198
  intensity: 50,
6195
6199
  scratchAmount: 50,
6196
6200
  edgeWear: 35,
6197
6201
  seed: void 0
6198
- }, ji = {
6202
+ }, ec = {
6199
6203
  enabled: !0,
6200
6204
  style: "cracked",
6201
6205
  intensity: 80,
6202
6206
  scratchAmount: 75,
6203
6207
  edgeWear: 60,
6204
6208
  seed: void 0
6205
- }, qi = {
6209
+ }, tc = {
6206
6210
  enabled: !0,
6207
6211
  style: "grunge",
6208
6212
  intensity: 35,
6209
6213
  grainAmount: 40,
6210
6214
  fadeAmount: 25,
6211
6215
  seed: void 0
6212
- }, Zi = {
6216
+ }, nc = {
6213
6217
  enabled: !0,
6214
6218
  style: "grunge",
6215
6219
  intensity: 60,
6216
6220
  grainAmount: 60,
6217
6221
  fadeAmount: 40,
6218
6222
  seed: void 0
6219
- }, Ji = {
6223
+ }, sc = {
6220
6224
  enabled: !0,
6221
6225
  style: "grunge",
6222
6226
  intensity: 85,
6223
6227
  grainAmount: 80,
6224
6228
  fadeAmount: 55,
6225
6229
  seed: void 0
6226
- }, Qi = {
6230
+ }, rc = {
6227
6231
  enabled: !0,
6228
6232
  style: "retro",
6229
6233
  intensity: 30,
6230
6234
  fadeAmount: 30,
6231
6235
  grainAmount: 25,
6232
6236
  seed: void 0
6233
- }, ec = {
6237
+ }, oc = {
6234
6238
  enabled: !0,
6235
6239
  style: "retro",
6236
6240
  intensity: 55,
6237
6241
  fadeAmount: 45,
6238
6242
  grainAmount: 40,
6239
6243
  seed: void 0
6240
- }, tc = {
6244
+ }, ic = {
6241
6245
  enabled: !0,
6242
6246
  style: "retro",
6243
6247
  intensity: 75,
6244
6248
  fadeAmount: 60,
6245
6249
  grainAmount: 55,
6246
6250
  seed: void 0
6247
- }, nc = {
6251
+ }, cc = {
6248
6252
  worn: {
6249
- light: Wi,
6250
- medium: Vi,
6251
- heavy: Ui
6253
+ light: ji,
6254
+ medium: qi,
6255
+ heavy: Zi
6252
6256
  },
6253
6257
  cracked: {
6254
- light: Ki,
6255
- medium: Gi,
6256
- heavy: ji
6258
+ light: Ji,
6259
+ medium: Qi,
6260
+ heavy: ec
6257
6261
  },
6258
6262
  grunge: {
6259
- light: qi,
6260
- medium: Zi,
6261
- heavy: Ji
6263
+ light: tc,
6264
+ medium: nc,
6265
+ heavy: sc
6262
6266
  },
6263
6267
  retro: {
6264
- light: Qi,
6265
- medium: ec,
6266
- heavy: tc
6268
+ light: rc,
6269
+ medium: oc,
6270
+ heavy: ic
6267
6271
  }
6268
6272
  };
6269
- function sc(e, t) {
6270
- const n = { ...nc[e][t] };
6273
+ function ac(e, t) {
6274
+ const n = { ...cc[e][t] };
6271
6275
  return n.seed = Date.now(), n;
6272
6276
  }
6273
- const rc = ({ distressEffect: e, onChange: t }) => {
6274
- go();
6277
+ const lc = ({ distressEffect: e, onChange: t }) => {
6278
+ wo();
6275
6279
  const [n, r] = V(!1), o = (e == null ? void 0 : e.enabled) || !1, i = (e == null ? void 0 : e.style) || "worn", c = (e == null ? void 0 : e.intensity) || 50, l = (e == null ? void 0 : e.fadeAmount) || 30, a = (e == null ? void 0 : e.grainAmount) || 30, u = (e == null ? void 0 : e.scratchAmount) || 30, d = (e == null ? void 0 : e.edgeWear) || 40, p = (I) => {
6276
6280
  t(I ? {
6277
6281
  enabled: !0,
@@ -6284,7 +6288,7 @@ const rc = ({ distressEffect: e, onChange: t }) => {
6284
6288
  seed: Date.now()
6285
6289
  } : void 0);
6286
6290
  }, m = (I, B) => {
6287
- const N = sc(I, B);
6291
+ const N = ac(I, B);
6288
6292
  t(N), r(!1);
6289
6293
  }, w = (I) => {
6290
6294
  if (e)
@@ -6634,24 +6638,24 @@ const rc = ({ distressEffect: e, onChange: t }) => {
6634
6638
  ] })
6635
6639
  ] });
6636
6640
  };
6637
- function wr(e) {
6641
+ function Cr(e) {
6638
6642
  return e ? !!(e.fill || e.stroke) : !1;
6639
6643
  }
6640
- function oc(e) {
6644
+ function dc(e) {
6641
6645
  if (!e) return [];
6642
6646
  const t = [];
6643
6647
  return e.fill && t.push("fill"), e.stroke && t.push("stroke"), t;
6644
6648
  }
6645
- function ic(e, t = "knockout") {
6646
- if (!e || !wr(e))
6649
+ function uc(e, t = "knockout") {
6650
+ if (!e || !Cr(e))
6647
6651
  return "No compositing";
6648
- const n = oc(e), r = e.scope || "group", o = t === "clip" ? "clip" : "knockout";
6652
+ const n = dc(e), r = e.scope || "group", o = t === "clip" ? "clip" : "knockout";
6649
6653
  return n.length === 0 ? "No compositing" : n.length === 1 ? `${n[0]} ${o} (${r})` : `${n.slice(0, -1).join(", ") + " & " + n[n.length - 1]} ${o} (${r})`;
6650
6654
  }
6651
- function cc(e) {
6652
- return !e || !wr(e) ? "No knockout" : ic(e, "knockout");
6655
+ function hc(e) {
6656
+ return !e || !Cr(e) ? "No knockout" : uc(e, "knockout");
6653
6657
  }
6654
- const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6658
+ const fc = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6655
6659
  const r = e === "knockout" || e === "clip", [o, i] = V(r), c = r, l = (t == null ? void 0 : t.fill) || !1, a = (t == null ? void 0 : t.stroke) || !1, u = (t == null ? void 0 : t.scope) || "group", d = (g) => {
6656
6660
  g === "knockout" || g === "clip" ? (n(g, {
6657
6661
  fill: !1,
@@ -6756,7 +6760,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6756
6760
  /* @__PURE__ */ f("div", { className: "sc:flex sc:flex-col sc:gap-md", children: [
6757
6761
  /* @__PURE__ */ f("div", { className: "sc:rounded-lg sc:border sc:border-border-primary sc:bg-bg-tertiary sc:p-md", children: [
6758
6762
  /* @__PURE__ */ s("strong", { className: "sc:text-sm sc:font-semibold sc:uppercase sc:tracking-wide sc:text-accent-primary", children: "Effect:" }),
6759
- /* @__PURE__ */ s("p", { className: "sc:mt-xs sc:text-base sc:text-text-secondary", children: cc(t) })
6763
+ /* @__PURE__ */ s("p", { className: "sc:mt-xs sc:text-base sc:text-text-secondary", children: hc(t) })
6760
6764
  ] }),
6761
6765
  /* @__PURE__ */ s("div", { className: "sc:rounded-sm sc:border-l-2 sc:border-accent-primary sc:bg-accent-light sc:p-md", children: /* @__PURE__ */ f("small", { className: "sc:text-sm sc:leading-relaxed sc:text-text-secondary", children: [
6762
6766
  /* @__PURE__ */ s("strong", { children: "Tip:" }),
@@ -6773,7 +6777,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6773
6777
  ]
6774
6778
  }
6775
6779
  );
6776
- }, lc = Tn("GlyphPicker"), dc = ({
6780
+ }, mc = Tn("GlyphPicker"), pc = ({
6777
6781
  isOpen: e,
6778
6782
  onClose: t,
6779
6783
  character: n,
@@ -6792,7 +6796,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6792
6796
  a ? `No glyphs found in ${o}` : `No alternates found for "${n}" in ${o}`
6793
6797
  ), d(S), m(!1);
6794
6798
  }).catch((S) => {
6795
- lc.error("Error loading glyphs:", S), g(a ? "Failed to load glyphs" : "Failed to load glyph alternates"), m(!1);
6799
+ mc.error("Error loading glyphs:", S), g(a ? "Failed to load glyphs" : "Failed to load glyph alternates"), m(!1);
6796
6800
  });
6797
6801
  }, [e, n, o, i, a]);
6798
6802
  const y = (E) => {
@@ -6803,15 +6807,15 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6803
6807
  alternateName: E.name
6804
6808
  }), t();
6805
6809
  }, b = a ? `Browse All Glyphs - ${o}` : `Alternates for "${n}"`;
6806
- return /* @__PURE__ */ s(Or, { open: e, onOpenChange: (E) => !E && t(), children: /* @__PURE__ */ f(
6807
- Yr,
6810
+ return /* @__PURE__ */ s(Wr, { open: e, onOpenChange: (E) => !E && t(), children: /* @__PURE__ */ f(
6811
+ Vr,
6808
6812
  {
6809
6813
  placement: "bottom",
6810
6814
  overlayOpacity: 0.4,
6811
6815
  className: "sc:flex sc:flex-col sc:overflow-hidden",
6812
6816
  style: { zIndex: "var(--sc-z-drawer, 10002)" },
6813
6817
  children: [
6814
- /* @__PURE__ */ s(_r, { className: "sc:sr-only", children: b }),
6818
+ /* @__PURE__ */ s(Ur, { className: "sc:sr-only", children: b }),
6815
6819
  /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:justify-between sc:px-3xl sc:pb-2xl sc:pt-2xl sc:border-b sc:border-border-primary", children: [
6816
6820
  /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-md", children: [
6817
6821
  /* @__PURE__ */ s(ps, { size: 24, className: "sc:text-text-muted" }),
@@ -6880,7 +6884,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6880
6884
  ]
6881
6885
  }
6882
6886
  ) });
6883
- }, ks = Tn("OpenTypeFeaturesPanel"), uc = [
6887
+ }, ks = Tn("OpenTypeFeaturesPanel"), gc = [
6884
6888
  // Ligatures
6885
6889
  { tag: "liga", label: "Standard Ligatures", description: "Common ligatures like fi, fl", category: "ligatures" },
6886
6890
  {
@@ -6921,7 +6925,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6921
6925
  { tag: "kern", label: "Kerning", description: "Adjust spacing between letter pairs", category: "stylistic" },
6922
6926
  { tag: "mark", label: "Mark Positioning", description: "Position diacritical marks", category: "stylistic" },
6923
6927
  { tag: "mkmk", label: "Mark to Mark", description: "Position marks relative to marks", category: "stylistic" }
6924
- ], hc = ({
6928
+ ], xc = ({
6925
6929
  fontFamily: e,
6926
6930
  fontWeight: t = 400,
6927
6931
  text: n = "",
@@ -6986,7 +6990,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
6986
6990
  } else
6987
6991
  ne = ne.filter((se) => se.charIndex !== y);
6988
6992
  c(ne.length > 0 ? ne : void 0);
6989
- }, O = r ? Object.values(r).filter(Boolean).length : 0, x = o.length, K = uc.reduce(
6993
+ }, O = r ? Object.values(r).filter(Boolean).length : 0, x = o.length, K = gc.reduce(
6990
6994
  (U, ne) => (U[ne.category] || (U[ne.category] = []), U[ne.category].push(ne), U),
6991
6995
  {}
6992
6996
  );
@@ -7087,7 +7091,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7087
7091
  }) })
7088
7092
  ] }),
7089
7093
  e && /* @__PURE__ */ s(
7090
- dc,
7094
+ pc,
7091
7095
  {
7092
7096
  isOpen: w,
7093
7097
  onClose: () => g(!1),
@@ -7101,7 +7105,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7101
7105
  }
7102
7106
  )
7103
7107
  ] });
7104
- }, fc = ({ element: e, onElementUpdate: t, isOpen: n, onClose: r }) => {
7108
+ }, yc = ({ element: e, onElementUpdate: t, isOpen: n, onClose: r }) => {
7105
7109
  var m, w;
7106
7110
  const [o, i] = V("stroke");
7107
7111
  if (!e) return null;
@@ -7157,7 +7161,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7157
7161
  ] }) }),
7158
7162
  /* @__PURE__ */ f(Qe.Panel, { id: "stroke", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
7159
7163
  /* @__PURE__ */ s(
7160
- Yi,
7164
+ Vi,
7161
7165
  {
7162
7166
  stroke: e.stroke,
7163
7167
  onChange: (g) => {
@@ -7173,7 +7177,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7173
7177
  ] }),
7174
7178
  /* @__PURE__ */ f(Qe.Panel, { id: "masks", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
7175
7179
  /* @__PURE__ */ s(
7176
- $i,
7180
+ Ki,
7177
7181
  {
7178
7182
  masks: e.masks,
7179
7183
  onChange: (g) => {
@@ -7189,7 +7193,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7189
7193
  ] }),
7190
7194
  /* @__PURE__ */ f(Qe.Panel, { id: "distress", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
7191
7195
  /* @__PURE__ */ s(
7192
- rc,
7196
+ lc,
7193
7197
  {
7194
7198
  distressEffect: e.distressEffect,
7195
7199
  onChange: (g) => {
@@ -7205,7 +7209,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7205
7209
  ] }),
7206
7210
  /* @__PURE__ */ f(Qe.Panel, { id: "compositing", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
7207
7211
  /* @__PURE__ */ s(
7208
- ac,
7212
+ fc,
7209
7213
  {
7210
7214
  blendMode: e.blendMode,
7211
7215
  knockoutParts: e.knockoutParts,
@@ -7222,7 +7226,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7222
7226
  ] }),
7223
7227
  d && /* @__PURE__ */ f(Qe.Panel, { id: "typography", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
7224
7228
  /* @__PURE__ */ s(
7225
- hc,
7229
+ xc,
7226
7230
  {
7227
7231
  fontFamily: e.fontFamily,
7228
7232
  fontWeight: e.bold ? 700 : 400,
@@ -7249,7 +7253,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7249
7253
  )
7250
7254
  }
7251
7255
  );
7252
- }, mc = ({
7256
+ }, bc = ({
7253
7257
  isOpen: e,
7254
7258
  onClose: t,
7255
7259
  element: n,
@@ -7264,7 +7268,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7264
7268
  [r, l, a]
7265
7269
  );
7266
7270
  return /* @__PURE__ */ s("div", { style: o, className: i, children: /* @__PURE__ */ s(
7267
- fc,
7271
+ yc,
7268
7272
  {
7269
7273
  element: a,
7270
7274
  onElementUpdate: u,
@@ -7272,10 +7276,10 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7272
7276
  onClose: t
7273
7277
  }
7274
7278
  ) });
7275
- }, pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7279
+ }, vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7276
7280
  __proto__: null,
7277
- EffectsPanel: mc
7278
- }, Symbol.toStringTag, { value: "Module" })), tr = Tn("ExportPanel"), gc = ({
7281
+ EffectsPanel: bc
7282
+ }, Symbol.toStringTag, { value: "Module" })), tr = Tn("ExportPanel"), wc = ({
7279
7283
  showContinuousExport: e = !0,
7280
7284
  defaultScale: t = 3,
7281
7285
  defaultFormat: n = "png",
@@ -7293,7 +7297,7 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7293
7297
  progress: m,
7294
7298
  supportsWorkerExport: w,
7295
7299
  workerStats: g
7296
- } = $r(), { artboardsInfo: y, activeArtboardId: b } = Ps(), [E, S] = V(t), [k, z] = V(n), [v, I] = V(500), B = async () => {
7300
+ } = Kr(), { artboardsInfo: y, activeArtboardId: b } = Ps(), [E, S] = V(t), [k, z] = V(n), [v, I] = V(500), B = async () => {
7297
7301
  if (b)
7298
7302
  try {
7299
7303
  const C = await c(b, { scale: E, format: k }), oe = document.createElement("a"), P = y.find((K) => K.id === b), O = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), x = (P == null ? void 0 : P.name) || "artboard";
@@ -7585,15 +7589,15 @@ const ac = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
7585
7589
  ]
7586
7590
  }
7587
7591
  );
7588
- }, xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7592
+ }, Cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7589
7593
  __proto__: null,
7590
- ExportPanel: gc
7591
- }, Symbol.toStringTag, { value: "Module" })), Gn = Tn("ImageBrowser"), yc = "Image search is temporarily unavailable.", nr = "Image generation is temporarily unavailable.", bc = "Vector search is temporarily unavailable.", sr = "Background removal is temporarily unavailable.";
7592
- function vc(e, t) {
7594
+ ExportPanel: wc
7595
+ }, Symbol.toStringTag, { value: "Module" })), Gn = Tn("ImageBrowser"), Sc = "Image search is temporarily unavailable.", nr = "Image generation is temporarily unavailable.", Ec = "Vector search is temporarily unavailable.", sr = "Background removal is temporarily unavailable.";
7596
+ function kc(e, t) {
7593
7597
  const n = e instanceof Error ? e.message : "";
7594
7598
  return !n || /VITE_|NEXT_PUBLIC_|\.env/i.test(n) ? t : n;
7595
7599
  }
7596
- const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n, fixedHeight: r = !1 }) {
7600
+ const Rc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n, fixedHeight: r = !1 }) {
7597
7601
  const [o, i] = V(!1), [c, l] = V(!1), [a, u] = V("top"), d = be(null), p = be(null), m = be(null), w = be(!0), [g, y] = V(!1), b = be(null), E = () => {
7598
7602
  c || n(t);
7599
7603
  }, S = (P) => {
@@ -7804,14 +7808,14 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
7804
7808
  ]
7805
7809
  }
7806
7810
  );
7807
- }), Cc = ({
7811
+ }), Mc = ({
7808
7812
  isOpen: e,
7809
7813
  onToggle: t,
7810
7814
  onImageSelect: n,
7811
7815
  currentImageUrl: r,
7812
7816
  placement: o = "bottom"
7813
7817
  }) => {
7814
- const { imageSearch: i, generate: c, vectors: l, removeBackground: a } = Fr(), u = fs(
7818
+ const { imageSearch: i, generate: c, vectors: l, removeBackground: a } = Gr(), u = fs(
7815
7819
  () => [
7816
7820
  ...i ? ["search"] : [],
7817
7821
  "url",
@@ -7835,7 +7839,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
7835
7839
  const at = await i.search({ query: G, page: $e, perPage: 30 });
7836
7840
  y((re) => et ? [...re, ...at.results] : at.results), B(at.page), T(at.hasMore);
7837
7841
  } catch (at) {
7838
- k(yc), Gn.error("Error searching images:", at);
7842
+ k(Sc), Gn.error("Error searching images:", at);
7839
7843
  } finally {
7840
7844
  E(!1);
7841
7845
  }
@@ -7881,7 +7885,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
7881
7885
  return [...re, ...et.filter((ce) => !he.has(ce.id))];
7882
7886
  } : et), Se(at), ve(at !== null);
7883
7887
  } catch (et) {
7884
- D(bc), Gn.error("Error searching vectors:", et);
7888
+ D(Ec), Gn.error("Error searching vectors:", et);
7885
7889
  } finally {
7886
7890
  ne(!1);
7887
7891
  }
@@ -7972,7 +7976,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
7972
7976
  throw new Error(nr);
7973
7977
  wt(re);
7974
7978
  } catch (at) {
7975
- vt(vc(at, nr)), Gn.error("Error generating AI image:", at);
7979
+ vt(kc(at, nr)), Gn.error("Error generating AI image:", at);
7976
7980
  } finally {
7977
7981
  Ue(!1);
7978
7982
  }
@@ -8112,7 +8116,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8112
8116
  display: "grid",
8113
8117
  gridTemplateColumns: o === "bottom" ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(3, 1fr)",
8114
8118
  gridAutoRows: o === "bottom" ? "200px" : "120px",
8115
- gap: wc
8119
+ gap: Rc
8116
8120
  },
8117
8121
  children: g.map((G, $e) => /* @__PURE__ */ s("div", { className: zt(G, $e), children: /* @__PURE__ */ s(rr, { image: G, onImageSelect: _, fixedHeight: !0 }) }, G.id))
8118
8122
  }
@@ -8415,7 +8419,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8415
8419
  )
8416
8420
  }
8417
8421
  );
8418
- }, Sc = ({
8422
+ }, Tc = ({
8419
8423
  isOpen: e,
8420
8424
  onOpenChange: t,
8421
8425
  onImageAdded: n,
@@ -8435,7 +8439,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8435
8439
  const P = b.current, O = E.current;
8436
8440
  if (z) {
8437
8441
  const me = P.find((ve) => ve.id === z);
8438
- if (me && ho(me)) {
8442
+ if (me && xo(me)) {
8439
8443
  const ve = me, ue = me.clone(), Re = ((le = u.current) == null ? void 0 : le.getZoom()) || 1;
8440
8444
  ue.imageUrl = oe, ue.transformData.width = 300 / Re, ue.transformData.height = 300 / Re, ue.transformData.cropX = 0, ue.transformData.cropY = 0, ue.transformData.cropWidth = 1, ue.transformData.cropHeight = 1, ue.transformData.flipHorizontal = !1, ue.transformData.flipVertical = !1, ue.transformData.borderRadius = 0, ue.imageLoaded = !1, ue.imageElement = null, ue.isCropping = !1, ue.onLoadCallback = (Me) => {
8441
8445
  const Ve = Me;
@@ -8486,7 +8490,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8486
8490
  },
8487
8491
  [t, v]
8488
8492
  ), N = z ? (C = l.find((oe) => oe.id === z)) == null ? void 0 : C.imageUrl : void 0, T = /* @__PURE__ */ s(
8489
- Cc,
8493
+ Mc,
8490
8494
  {
8491
8495
  isOpen: e,
8492
8496
  onToggle: B,
@@ -8494,11 +8498,11 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8494
8498
  currentImageUrl: N
8495
8499
  }
8496
8500
  );
8497
- return c ? /* @__PURE__ */ s(Wr, { services: c, children: T }) : T;
8498
- }, Ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8501
+ return c ? /* @__PURE__ */ s(jr, { services: c, children: T }) : T;
8502
+ }, Ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8499
8503
  __proto__: null,
8500
- ImagePanel: Sc
8501
- }, Symbol.toStringTag, { value: "Module" })), kc = Tn("GlyphBrowserDrawer"), Rc = ({
8504
+ ImagePanel: Tc
8505
+ }, Symbol.toStringTag, { value: "Module" })), Nc = Tn("GlyphBrowserDrawer"), Pc = ({
8502
8506
  isOpen: e,
8503
8507
  onClose: t,
8504
8508
  fontFamily: n,
@@ -8510,7 +8514,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8510
8514
  e && (a(!0), d(null), m(""), An.getAllGlyphs(n, r).then((y) => {
8511
8515
  y.length === 0 && d(`No alternate glyphs found in ${n}`), c(y), a(!1);
8512
8516
  }).catch((y) => {
8513
- kc.error("Error loading glyphs:", y), d("Failed to load glyphs"), a(!1);
8517
+ Nc.error("Error loading glyphs:", y), d("Failed to load glyphs"), a(!1);
8514
8518
  }));
8515
8519
  }, [e, n, r]);
8516
8520
  const w = (y) => {
@@ -8556,7 +8560,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8556
8560
  ] }) }),
8557
8561
  /* @__PURE__ */ f("div", { className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
8558
8562
  l && /* @__PURE__ */ f("div", { className: "sc:py-12 sc:text-center sc:text-muted", children: [
8559
- /* @__PURE__ */ s(Oi, { size: "lg", className: "sc:mx-auto sc:mb-4" }),
8563
+ /* @__PURE__ */ s(Wi, { size: "lg", className: "sc:mx-auto sc:mb-4" }),
8560
8564
  /* @__PURE__ */ s("div", { className: "sc:text-sm", children: "Loading glyphs..." })
8561
8565
  ] }),
8562
8566
  u && /* @__PURE__ */ f("div", { className: "sc:py-12 sc:text-center", children: [
@@ -8604,7 +8608,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8604
8608
  ]
8605
8609
  }
8606
8610
  );
8607
- }, ir = Tn("GlyphPanel"), Mc = ({
8611
+ }, ir = Tn("GlyphPanel"), Ac = ({
8608
8612
  isOpen: e,
8609
8613
  onClose: t,
8610
8614
  fontFamily: n,
@@ -8633,7 +8637,7 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8633
8637
  [o, a, u, d, l]
8634
8638
  );
8635
8639
  return /* @__PURE__ */ s(
8636
- Rc,
8640
+ Pc,
8637
8641
  {
8638
8642
  isOpen: e,
8639
8643
  onClose: t,
@@ -8642,10 +8646,10 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8642
8646
  onInsertGlyph: p
8643
8647
  }
8644
8648
  );
8645
- }, Tc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8649
+ }, Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8646
8650
  __proto__: null,
8647
- GlyphPanel: Mc
8648
- }, Symbol.toStringTag, { value: "Module" })), Ic = ({
8651
+ GlyphPanel: Ac
8652
+ }, Symbol.toStringTag, { value: "Module" })), Bc = ({
8649
8653
  orientation: e = "horizontal",
8650
8654
  showAddButton: t = !0,
8651
8655
  showCloseButtons: n = !1,
@@ -8821,9 +8825,9 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8821
8825
  }
8822
8826
  )
8823
8827
  ] });
8824
- }, Nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8828
+ }, zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8825
8829
  __proto__: null,
8826
- ArtboardTabs: Ic
8830
+ ArtboardTabs: Bc
8827
8831
  }, Symbol.toStringTag, { value: "Module" })), cr = ({
8828
8832
  className: e,
8829
8833
  position: t = "bottom-right",
@@ -8938,23 +8942,23 @@ const wc = "1px", Rs = "1px", rr = ot.memo(function({ image: t, onImageSelect: n
8938
8942
  ]
8939
8943
  }
8940
8944
  );
8941
- }, Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8945
+ }, Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8942
8946
  __proto__: null,
8943
8947
  ZoomControls: cr,
8944
8948
  default: cr
8945
- }, Symbol.toStringTag, { value: "Module" })), ar = Tn("AutoExportManager"), Ac = {
8949
+ }, Symbol.toStringTag, { value: "Module" })), ar = Tn("AutoExportManager"), Hc = {
8946
8950
  enabled: !0,
8947
8951
  debounceMs: 100,
8948
8952
  maxWaitMs: 1e3
8949
8953
  };
8950
- class ta {
8954
+ class ia {
8951
8955
  constructor(t = {}) {
8952
8956
  this.onExportCallback = null, this.onExportScheduledCallback = null, this.revision = 0, this.lastExportedRevision = -1, this.stats = {
8953
8957
  totalExports: 0,
8954
8958
  skippedExports: 0,
8955
8959
  lastExportTime: null,
8956
8960
  avgExportInterval: 0
8957
- }, this.exportTimestamps = [], this.config = { ...Ac, ...t }, this.debouncedExport = Zs(
8961
+ }, this.exportTimestamps = [], this.config = { ...Hc, ...t }, this.debouncedExport = Zs(
8958
8962
  () => this.performExport(),
8959
8963
  this.config.debounceMs,
8960
8964
  {
@@ -9077,7 +9081,7 @@ class ta {
9077
9081
  this.debouncedExport.cancel(), this.onExportCallback = null, this.onExportScheduledCallback = null, this.lastExportedRevision = -1;
9078
9082
  }
9079
9083
  }
9080
- function na({ width: e = 800, height: t = 600, style: n }) {
9084
+ function ca({ width: e = 800, height: t = 600, style: n }) {
9081
9085
  return /* @__PURE__ */ f(
9082
9086
  "div",
9083
9087
  {
@@ -9120,7 +9124,7 @@ function na({ width: e = 800, height: t = 600, style: n }) {
9120
9124
  }
9121
9125
  );
9122
9126
  }
9123
- function sa({ itemCount: e = 5, style: t }) {
9127
+ function aa({ itemCount: e = 5, style: t }) {
9124
9128
  return /* @__PURE__ */ f(
9125
9129
  "div",
9126
9130
  {
@@ -9173,7 +9177,7 @@ function sa({ itemCount: e = 5, style: t }) {
9173
9177
  }
9174
9178
  );
9175
9179
  }
9176
- function ra({ style: e }) {
9180
+ function la({ style: e }) {
9177
9181
  return /* @__PURE__ */ f(
9178
9182
  "div",
9179
9183
  {
@@ -9228,7 +9232,7 @@ function ra({ style: e }) {
9228
9232
  }
9229
9233
  );
9230
9234
  }
9231
- function oa({ size: e = 32, color: t = "var(--primary)" }) {
9235
+ function da({ size: e = 32, color: t = "var(--primary)" }) {
9232
9236
  return /* @__PURE__ */ s(
9233
9237
  "div",
9234
9238
  {
@@ -9249,7 +9253,7 @@ function oa({ size: e = 32, color: t = "var(--primary)" }) {
9249
9253
  }
9250
9254
  );
9251
9255
  }
9252
- function ia(e) {
9256
+ function ua(e) {
9253
9257
  var i;
9254
9258
  const t = [], n = [];
9255
9259
  (!e.name || e.name.trim() === "") && t.push("Kit name is required"), e.behavior.toolbar === "none" && ((i = e.layout.slots.topbar) != null && i.length) && n.push('Toolbar mode is "none" but topbar has sections — topbar sections will be ignored'), e.behavior.selection === "multi" && !e.capabilities.tools.includes("select") && n.push('Multi-selection enabled but "select" tool not in capabilities'), e.capabilities.elements.length === 0 && t.push("At least one element type must be enabled in capabilities.elements"), e.capabilities.transforms.length === 0 && t.push("At least one transform type must be enabled in capabilities.transforms"), e.behavior.autoExport && !e.capabilities.features.export && n.push("autoExport is enabled but features.export is false — exports will not be produced");
@@ -9268,37 +9272,37 @@ function ia(e) {
9268
9272
  return { valid: t.length === 0, errors: t, warnings: n };
9269
9273
  }
9270
9274
  export {
9271
- xo as A,
9272
- yo as C,
9273
- Ac as D,
9274
- vo as E,
9275
- Mc as G,
9276
- Sc as I,
9275
+ Co as A,
9276
+ So as C,
9277
+ Hc as D,
9278
+ ko as E,
9279
+ Ac as G,
9280
+ Tc as I,
9277
9281
  Js as K,
9278
- sa as L,
9282
+ aa as L,
9279
9283
  pr as M,
9280
- bo as P,
9281
- oa as S,
9282
- ra as T,
9284
+ Eo as P,
9285
+ da as S,
9286
+ la as T,
9283
9287
  cr as Z,
9284
- Ic as a,
9285
- ta as b,
9286
- Gc as c,
9287
- na as d,
9288
- mc as e,
9289
- gc as f,
9290
- Uc as g,
9291
- Zc as h,
9292
- jc as i,
9293
- qc as j,
9294
- Qc as k,
9295
- ea as l,
9288
+ Bc as a,
9289
+ ia as b,
9290
+ Qc as c,
9291
+ ca as d,
9292
+ bc as e,
9293
+ wc as f,
9294
+ Zc as g,
9295
+ na as h,
9296
+ ea as i,
9297
+ ta as j,
9298
+ ra as k,
9299
+ oa as l,
9296
9300
  At as m,
9297
- Go as n,
9298
- Kc as o,
9299
- Co as p,
9300
- wo as r,
9301
- Jc as u,
9302
- ia as v
9301
+ Qo as n,
9302
+ Jc as o,
9303
+ Mo as p,
9304
+ Ro as r,
9305
+ sa as u,
9306
+ ua as v
9303
9307
  };
9304
- //# sourceMappingURL=validation-0IscSfRb.js.map
9308
+ //# sourceMappingURL=validation-3YEMnKLB.js.map