eddyter 1.3.81 → 1.4.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 (28) hide show
  1. package/README.md +14 -0
  2. package/dist/api/ai/aiAgentService.d.ts +2 -0
  3. package/dist/assets/style.css +1 -1
  4. package/dist/components/ConfigurableEditorWithAuth.d.ts +2 -0
  5. package/dist/context/EditorThemeContext.d.ts +8 -0
  6. package/dist/context/HtmlViewContext.d.ts +2 -0
  7. package/dist/context/VoiceRecordingContext.d.ts +30 -0
  8. package/dist/editor/components/FloatingToolbarManager.d.ts +8 -0
  9. package/dist/editor/components/FloatingToolbarPortal.d.ts +6 -0
  10. package/dist/editor/components/ToolbarMount.d.ts +9 -0
  11. package/dist/editor/hooks/useFloatingToolbar.d.ts +7 -0
  12. package/dist/{generateDocxThumbnail-DCh0DpQm.js → generateDocxThumbnail-Bh5xHzEB.js} +1 -1
  13. package/dist/{generatePdfThumbnail-D8k_mO4q.js → generatePdfThumbnail-Dlhq91Bf.js} +1 -1
  14. package/dist/{generateXlsxThumbnail-Db5nhXLN.js → generateXlsxThumbnail-DSRkPI7J.js} +1 -1
  15. package/dist/hooks/useVoiceRecording.d.ts +15 -0
  16. package/dist/{html2pdf.bundle.min-CYrTiP9i.js → html2pdf.bundle.min-9HpAwgiB.js} +1 -1
  17. package/dist/index-BO5Zqvun.js +87321 -0
  18. package/dist/{index-CQWxSXxG.js → index-CUZB8Gle.js} +23 -23
  19. package/dist/{index-Bgccl9jH.js → index-CYT6zzrr.js} +538 -502
  20. package/dist/{index-DYduXrLZ.js → index-y3tqAwBk.js} +4 -4
  21. package/dist/index.js +1 -1
  22. package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +1 -0
  23. package/dist/plugins/VoiceTranscriptPlugin.d.ts +2 -16
  24. package/dist/ui/Icons.d.ts +2 -1
  25. package/dist/utils/fontLoader.d.ts +1 -1
  26. package/dist/utils/htmlFormat.d.ts +5 -3
  27. package/package.json +4 -1
  28. package/dist/index-20I04v1t.js +0 -41317
@@ -1,54 +1,55 @@
1
- import { jsx as r, jsxs as f, Fragment as Se } from "react/jsx-runtime";
2
- import { I as Me } from "./ImageResizer-Bt7kgv0a.js";
3
- import { CodeNode as Ot } from "@lexical/code";
4
- import { LinkNode as Ht } from "@lexical/link";
5
- import { AutoFocusPlugin as ze } from "@lexical/react/LexicalAutoFocusPlugin";
6
- import { useCollaborationContext as Ae } from "@lexical/react/LexicalCollaborationContext";
7
- import { useLexicalComposerContext as De } from "@lexical/react/LexicalComposerContext";
8
- import { ContentEditable as Ft } from "@lexical/react/LexicalContentEditable";
9
- import { LexicalErrorBoundary as Xt } from "@lexical/react/LexicalErrorBoundary";
10
- import { HistoryPlugin as Bt } from "@lexical/react/LexicalHistoryPlugin";
11
- import { LexicalNestedComposer as Kt } from "@lexical/react/LexicalNestedComposer";
12
- import { OnChangePlugin as Ut } from "@lexical/react/LexicalOnChangePlugin";
13
- import { RichTextPlugin as Gt } from "@lexical/react/LexicalRichTextPlugin";
14
- import { useLexicalEditable as Le } from "@lexical/react/useLexicalEditable";
15
- import { useLexicalNodeSelection as $e } from "@lexical/react/useLexicalNodeSelection";
16
- import { mergeRegister as Te } from "@lexical/utils";
17
- import { RootNode as qt, TextNode as Vt, LineBreakNode as Jt, ParagraphNode as Qt, $getSelection as st, $isNodeSelection as dt, $isParagraphNode as Et, $setSelection as bt, $isRangeSelection as We, SELECTION_CHANGE_COMMAND as _e, COMMAND_PRIORITY_LOW as U, CLICK_COMMAND as Ye, DRAGSTART_COMMAND as je, KEY_DELETE_COMMAND as Oe, KEY_BACKSPACE_COMMAND as He, KEY_ENTER_COMMAND as Fe, KEY_ESCAPE_COMMAND as Xe, $getNodeByKey as ct, createCommand as Be } from "lexical";
18
- import mt, { useState as P, useRef as G, useMemo as $t, useCallback as S, useEffect as q, useLayoutEffect as Ke, Suspense as Ue } from "react";
19
- import { a as gt, D as Zt, b as te, d as ee, e as re, f as oe, h as ie, B as Tt, L as ae, i as ne, C as yt, I as Ge, u as qe, $ as tt, t as z, j as Ve, k as Je, W as Qe, l as Ze, A as tr, m as er, n as rr, T as or, o as ir, S as ar, E as nr, p as sr, q as dr, r as cr, s as lr } from "./index-20I04v1t.js";
1
+ import { jsx as r, jsxs as f, Fragment as Tt } from "react/jsx-runtime";
2
+ import { I as Ae } from "./ImageResizer-Bt7kgv0a.js";
3
+ import { CodeNode as Xt } from "@lexical/code";
4
+ import { LinkNode as Bt } from "@lexical/link";
5
+ import { AutoFocusPlugin as De } from "@lexical/react/LexicalAutoFocusPlugin";
6
+ import { useCollaborationContext as Le } from "@lexical/react/LexicalCollaborationContext";
7
+ import { useLexicalComposerContext as $e } from "@lexical/react/LexicalComposerContext";
8
+ import { ContentEditable as Ut } from "@lexical/react/LexicalContentEditable";
9
+ import { LexicalErrorBoundary as Kt } from "@lexical/react/LexicalErrorBoundary";
10
+ import { HistoryPlugin as qt } from "@lexical/react/LexicalHistoryPlugin";
11
+ import { LexicalNestedComposer as Gt } from "@lexical/react/LexicalNestedComposer";
12
+ import { OnChangePlugin as Vt } from "@lexical/react/LexicalOnChangePlugin";
13
+ import { RichTextPlugin as Jt } from "@lexical/react/LexicalRichTextPlugin";
14
+ import { useLexicalEditable as We } from "@lexical/react/useLexicalEditable";
15
+ import { useLexicalNodeSelection as Te } from "@lexical/react/useLexicalNodeSelection";
16
+ import { mergeRegister as _e } from "@lexical/utils";
17
+ import { RootNode as Qt, TextNode as Zt, LineBreakNode as te, ParagraphNode as ee, $getSelection as et, $isNodeSelection as ct, $isParagraphNode as Pt, $setSelection as gt, $isRangeSelection as je, SELECTION_CHANGE_COMMAND as Ye, COMMAND_PRIORITY_LOW as K, CLICK_COMMAND as Oe, DRAGSTART_COMMAND as He, KEY_DELETE_COMMAND as Fe, KEY_BACKSPACE_COMMAND as Xe, KEY_ENTER_COMMAND as Be, KEY_ESCAPE_COMMAND as Ue, $getNodeByKey as rt, createCommand as Ke } from "lexical";
18
+ import ht, { useState as S, useRef as G, useMemo as _t, useCallback as I, useEffect as V, useLayoutEffect as qe, Suspense as Ge } from "react";
19
+ import { a as ft, D as re, b as oe, d as ie, e as ae, f as ne, h as se, B as jt, L as de, i as ce, C as xt, I as Ve, S as Je, u as Qe, $ as q, t as z, j as Ze, k as tr, W as er, l as rr, A as or, m as ir, n as ar, T as nr, o as sr, p as dr, E as cr, q as lr, r as ur, s as mr, v as gr } from "./index-BO5Zqvun.js";
20
20
  import "react-dom";
21
- const se = gt("Crop", [
21
+ const le = ft("Crop", [
22
22
  ["path", { d: "M6 2v14a2 2 0 0 0 2 2h14", key: "ron5a4" }],
23
23
  ["path", { d: "M18 22V8a2 2 0 0 0-2-2H2", key: "7s9ehn" }]
24
24
  ]);
25
- const ur = gt("Link2", [
25
+ const hr = ft("Link2", [
26
26
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
27
27
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
28
28
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
29
29
  ]);
30
- const Wt = gt("RectangleHorizontal", [
30
+ const Yt = ft("RectangleHorizontal", [
31
31
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
32
32
  ]);
33
- const _t = gt("RectangleVertical", [
33
+ const Ot = ft("RectangleVertical", [
34
34
  ["rect", { width: "12", height: "20", x: "6", y: "2", rx: "2", key: "1oxtiu" }]
35
35
  ]);
36
- const mr = gt("Square", [
37
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
38
- ]), gr = ({
36
+ const fr = ft("RotateCcw", [
37
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
38
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
39
+ ]), pr = ({
39
40
  open: i,
40
41
  onOpenChange: o,
41
42
  oldImageUrl: e,
42
43
  newImageUrl: d,
43
- onReplace: R,
44
+ onReplace: C,
44
45
  onCancel: y
45
- }) => /* @__PURE__ */ r(Zt, { open: i, onOpenChange: o, children: /* @__PURE__ */ f(te, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
46
- /* @__PURE__ */ f(ee, { children: [
47
- /* @__PURE__ */ f(re, { className: "flex items-center gap-2 text-xl", children: [
46
+ }) => /* @__PURE__ */ r(re, { open: i, onOpenChange: o, children: /* @__PURE__ */ f(oe, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
47
+ /* @__PURE__ */ f(ie, { children: [
48
+ /* @__PURE__ */ f(ae, { className: "flex items-center gap-2 text-xl", children: [
48
49
  /* @__PURE__ */ r("span", { className: "text-2xl", children: "🔄" }),
49
50
  "Compare Images"
50
51
  ] }),
51
- /* @__PURE__ */ r(oe, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
52
+ /* @__PURE__ */ r(ne, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
52
53
  ] }),
53
54
  /* @__PURE__ */ f("div", { className: "space-y-4 py-4", children: [
54
55
  /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ f("div", { className: "space-y-2", children: [
@@ -70,9 +71,9 @@ const mr = gt("Square", [
70
71
  ' Clicking "Replace" will update the image in your document. This action cannot be undone.'
71
72
  ] }) })
72
73
  ] }),
73
- /* @__PURE__ */ f(ie, { className: "gap-2", children: [
74
+ /* @__PURE__ */ f(se, { className: "gap-2", children: [
74
75
  /* @__PURE__ */ r(
75
- Tt,
76
+ jt,
76
77
  {
77
78
  variant: "outline",
78
79
  onClick: y,
@@ -80,9 +81,9 @@ const mr = gt("Square", [
80
81
  }
81
82
  ),
82
83
  /* @__PURE__ */ f(
83
- Tt,
84
+ jt,
84
85
  {
85
- onClick: R,
86
+ onClick: C,
86
87
  className: "bg-blue-500 hover:bg-blue-600 text-white",
87
88
  children: [
88
89
  /* @__PURE__ */ r("span", { className: "mr-2", children: "✓" }),
@@ -92,27 +93,27 @@ const mr = gt("Square", [
92
93
  )
93
94
  ] })
94
95
  ] }) });
95
- function hr({
96
+ function br({
96
97
  caption: i
97
98
  }) {
98
99
  return /* @__PURE__ */ r("div", { className: "signature-caption-container", children: /* @__PURE__ */ f(
99
- Kt,
100
+ Gt,
100
101
  {
101
102
  initialEditor: i,
102
103
  initialNodes: [
103
- qt,
104
- Vt,
105
- Jt,
106
104
  Qt,
107
- Ht,
108
- Ot
105
+ Zt,
106
+ te,
107
+ ee,
108
+ Bt,
109
+ Xt
109
110
  ],
110
111
  children: [
111
112
  /* @__PURE__ */ r(
112
- Gt,
113
+ Jt,
113
114
  {
114
115
  contentEditable: /* @__PURE__ */ r(
115
- Ft,
116
+ Ut,
116
117
  {
117
118
  "aria-placeholder": "Enter signature name...",
118
119
  placeholder: /* @__PURE__ */ r("div", { style: {
@@ -128,30 +129,30 @@ function hr({
128
129
  className: "signature-caption-editable"
129
130
  }
130
131
  ),
131
- ErrorBoundary: Xt
132
+ ErrorBoundary: Kt
132
133
  }
133
134
  ),
134
- /* @__PURE__ */ r(Ut, { onChange: () => {
135
+ /* @__PURE__ */ r(Vt, { onChange: () => {
135
136
  } }),
136
- /* @__PURE__ */ r(Bt, {}),
137
- /* @__PURE__ */ r(ae, { namespace: ne.namespace })
137
+ /* @__PURE__ */ r(qt, {}),
138
+ /* @__PURE__ */ r(de, { namespace: ce.namespace })
138
139
  ]
139
140
  }
140
141
  ) });
141
142
  }
142
- const fr = "/transform-image/";
143
- function ht(i) {
144
- if (!yt || i.startsWith("data:") || i.toLowerCase().endsWith(".svg"))
143
+ const yr = "/transform-image/";
144
+ function lt(i) {
145
+ if (!xt || i.startsWith("data:") || i.toLowerCase().endsWith(".svg"))
145
146
  return !1;
146
147
  try {
147
- const o = new URL(i).origin, e = new URL(yt).origin;
148
+ const o = new URL(i).origin, e = new URL(xt).origin;
148
149
  return o === e;
149
150
  } catch {
150
151
  return !1;
151
152
  }
152
153
  }
153
- function de(i) {
154
- if (!ht(i))
154
+ function ue(i) {
155
+ if (!lt(i))
155
156
  return null;
156
157
  try {
157
158
  const e = new URL(i).pathname.replace(/^\//, ""), d = "transform-image/";
@@ -160,17 +161,17 @@ function de(i) {
160
161
  return null;
161
162
  }
162
163
  }
163
- function pr(i, o) {
164
- if (!ht(i))
164
+ function xr(i, o) {
165
+ if (!lt(i))
165
166
  return i;
166
- const e = de(i);
167
+ const e = ue(i);
167
168
  if (!e)
168
169
  return i;
169
170
  const d = `${o.x},${o.y},${o.width},${o.height}`;
170
- return `${yt.replace(/\/$/, "")}${fr}${e}?crop=${d}`;
171
+ return `${xt.replace(/\/$/, "")}${yr}${e}?crop=${d}`;
171
172
  }
172
- function Yt(i) {
173
- if (!ht(i))
173
+ function Ht(i) {
174
+ if (!lt(i))
174
175
  return i;
175
176
  try {
176
177
  const o = new URL(i);
@@ -179,21 +180,21 @@ function Yt(i) {
179
180
  return i;
180
181
  }
181
182
  }
182
- function ce(i) {
183
- if (!ht(i))
184
- return Yt(i);
185
- const o = de(i);
186
- return o ? `${yt.replace(/\/$/, "")}/${o}` : Yt(i);
183
+ function yt(i) {
184
+ if (!lt(i))
185
+ return Ht(i);
186
+ const o = ue(i);
187
+ return o ? `${xt.replace(/\/$/, "")}/${o}` : Ht(i);
187
188
  }
188
- function br(i) {
189
+ function vr(i) {
189
190
  if (typeof document > "u")
190
191
  return;
191
192
  let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
192
193
  e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = i : e.appendChild(document.createTextNode(i));
193
194
  }
194
195
  Array(12).fill(0);
195
- let It = 1;
196
- class yr {
196
+ let St = 1;
197
+ class wr {
197
198
  constructor() {
198
199
  this.subscribe = (o) => (this.subscribers.push(o), () => {
199
200
  const e = this.subscribers.indexOf(o);
@@ -207,22 +208,22 @@ class yr {
207
208
  ];
208
209
  }, this.create = (o) => {
209
210
  var e;
210
- const { message: d, ...R } = o, y = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : It++, D = this.toasts.find((C) => C.id === y), I = o.dismissible === void 0 ? !0 : o.dismissible;
211
- return this.dismissedToasts.has(y) && this.dismissedToasts.delete(y), D ? this.toasts = this.toasts.map((C) => C.id === y ? (this.publish({
212
- ...C,
211
+ const { message: d, ...C } = o, y = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : St++, L = this.toasts.find((k) => k.id === y), P = o.dismissible === void 0 ? !0 : o.dismissible;
212
+ return this.dismissedToasts.has(y) && this.dismissedToasts.delete(y), L ? this.toasts = this.toasts.map((k) => k.id === y ? (this.publish({
213
+ ...k,
213
214
  ...o,
214
215
  id: y,
215
216
  title: d
216
217
  }), {
217
- ...C,
218
+ ...k,
218
219
  ...o,
219
220
  id: y,
220
- dismissible: I,
221
+ dismissible: P,
221
222
  title: d
222
- }) : C) : this.addToast({
223
+ }) : k) : this.addToast({
223
224
  title: d,
224
- ...R,
225
- dismissible: I,
225
+ ...C,
226
+ dismissible: P,
226
227
  id: y
227
228
  }), y;
228
229
  }, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
@@ -267,78 +268,78 @@ class yr {
267
268
  message: e.loading,
268
269
  description: typeof e.description != "function" ? e.description : void 0
269
270
  }));
270
- const R = Promise.resolve(o instanceof Function ? o() : o);
271
- let y = d !== void 0, D;
272
- const I = R.then(async (v) => {
273
- if (D = [
271
+ const C = Promise.resolve(o instanceof Function ? o() : o);
272
+ let y = d !== void 0, L;
273
+ const P = C.then(async (w) => {
274
+ if (L = [
274
275
  "resolve",
275
- v
276
- ], mt.isValidElement(v))
276
+ w
277
+ ], ht.isValidElement(w))
277
278
  y = !1, this.create({
278
279
  id: d,
279
280
  type: "default",
280
- message: v
281
+ message: w
281
282
  });
282
- else if (vr(v) && !v.ok) {
283
+ else if (kr(w) && !w.ok) {
283
284
  y = !1;
284
- const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${v.status}`) : e.error, k = typeof e.description == "function" ? await e.description(`HTTP error! status: ${v.status}`) : e.description, A = typeof c == "object" && !mt.isValidElement(c) ? c : {
285
+ const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${w.status}`) : e.error, N = typeof e.description == "function" ? await e.description(`HTTP error! status: ${w.status}`) : e.description, A = typeof c == "object" && !ht.isValidElement(c) ? c : {
285
286
  message: c
286
287
  };
287
288
  this.create({
288
289
  id: d,
289
290
  type: "error",
290
- description: k,
291
+ description: N,
291
292
  ...A
292
293
  });
293
- } else if (v instanceof Error) {
294
+ } else if (w instanceof Error) {
294
295
  y = !1;
295
- const c = typeof e.error == "function" ? await e.error(v) : e.error, k = typeof e.description == "function" ? await e.description(v) : e.description, A = typeof c == "object" && !mt.isValidElement(c) ? c : {
296
+ const c = typeof e.error == "function" ? await e.error(w) : e.error, N = typeof e.description == "function" ? await e.description(w) : e.description, A = typeof c == "object" && !ht.isValidElement(c) ? c : {
296
297
  message: c
297
298
  };
298
299
  this.create({
299
300
  id: d,
300
301
  type: "error",
301
- description: k,
302
+ description: N,
302
303
  ...A
303
304
  });
304
305
  } else if (e.success !== void 0) {
305
306
  y = !1;
306
- const c = typeof e.success == "function" ? await e.success(v) : e.success, k = typeof e.description == "function" ? await e.description(v) : e.description, A = typeof c == "object" && !mt.isValidElement(c) ? c : {
307
+ const c = typeof e.success == "function" ? await e.success(w) : e.success, N = typeof e.description == "function" ? await e.description(w) : e.description, A = typeof c == "object" && !ht.isValidElement(c) ? c : {
307
308
  message: c
308
309
  };
309
310
  this.create({
310
311
  id: d,
311
312
  type: "success",
312
- description: k,
313
+ description: N,
313
314
  ...A
314
315
  });
315
316
  }
316
- }).catch(async (v) => {
317
- if (D = [
317
+ }).catch(async (w) => {
318
+ if (L = [
318
319
  "reject",
319
- v
320
+ w
320
321
  ], e.error !== void 0) {
321
322
  y = !1;
322
- const E = typeof e.error == "function" ? await e.error(v) : e.error, c = typeof e.description == "function" ? await e.description(v) : e.description, x = typeof E == "object" && !mt.isValidElement(E) ? E : {
323
+ const E = typeof e.error == "function" ? await e.error(w) : e.error, c = typeof e.description == "function" ? await e.description(w) : e.description, v = typeof E == "object" && !ht.isValidElement(E) ? E : {
323
324
  message: E
324
325
  };
325
326
  this.create({
326
327
  id: d,
327
328
  type: "error",
328
329
  description: c,
329
- ...x
330
+ ...v
330
331
  });
331
332
  }
332
333
  }).finally(() => {
333
334
  y && (this.dismiss(d), d = void 0), e.finally == null || e.finally.call(e);
334
- }), C = () => new Promise((v, E) => I.then(() => D[0] === "reject" ? E(D[1]) : v(D[1])).catch(E));
335
+ }), k = () => new Promise((w, E) => P.then(() => L[0] === "reject" ? E(L[1]) : w(L[1])).catch(E));
335
336
  return typeof d != "string" && typeof d != "number" ? {
336
- unwrap: C
337
+ unwrap: k
337
338
  } : Object.assign(d, {
338
- unwrap: C
339
+ unwrap: k
339
340
  });
340
341
  }, this.custom = (o, e) => {
341
- const d = e?.id || It++;
342
+ const d = e?.id || St++;
342
343
  return this.create({
343
344
  jsx: o(d),
344
345
  id: d,
@@ -347,14 +348,14 @@ class yr {
347
348
  }, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
348
349
  }
349
350
  }
350
- const T = new yr(), xr = (i, o) => {
351
- const e = o?.id || It++;
351
+ const T = new wr(), Cr = (i, o) => {
352
+ const e = o?.id || St++;
352
353
  return T.addToast({
353
354
  title: i,
354
355
  ...o,
355
356
  id: e
356
357
  }), e;
357
- }, vr = (i) => i && typeof i == "object" && "ok" in i && typeof i.ok == "boolean" && "status" in i && typeof i.status == "number", wr = xr, Cr = () => T.toasts, kr = () => T.getActiveToasts(), Nr = Object.assign(wr, {
358
+ }, kr = (i) => i && typeof i == "object" && "ok" in i && typeof i.ok == "boolean" && "status" in i && typeof i.status == "number", Nr = Cr, Rr = () => T.toasts, Er = () => T.getActiveToasts(), Pr = Object.assign(Nr, {
358
359
  success: T.success,
359
360
  info: T.info,
360
361
  warning: T.warning,
@@ -365,23 +366,23 @@ const T = new yr(), xr = (i, o) => {
365
366
  dismiss: T.dismiss,
366
367
  loading: T.loading
367
368
  }, {
368
- getHistory: Cr,
369
- getToasts: kr
369
+ getHistory: Rr,
370
+ getToasts: Er
370
371
  });
371
- br("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
372
- function Er({
372
+ vr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
373
+ function Ir({
373
374
  open: i,
374
375
  onOpenChange: o,
375
376
  src: e,
376
377
  altText: d,
377
- width: R,
378
+ width: C,
378
379
  height: y,
379
- onCropApply: D
380
+ onCropApply: L
380
381
  }) {
381
- const [I, C] = P("freeform"), [v, E] = P(e), [c, k] = P(!1), x = G(null), A = G(null), [n, $] = P({ x: 0, y: 0, width: 0, height: 0 }), [N, L] = P({ x: 0, y: 0, width: 0, height: 0 }), V = G(null), et = $t(() => typeof R == "number" && typeof y == "number" && y > 0 ? R / y : n.width > 0 && n.height > 0 ? n.width / n.height : null, [n.height, n.width, y, R]), lt = $t(() => {
382
- switch (I) {
382
+ const [P, k] = S("freeform"), [w, E] = S(e), [c, N] = S(!1), v = G(null), A = G(null), [n, W] = S({ x: 0, y: 0, width: 0, height: 0 }), [R, $] = S({ x: 0, y: 0, width: 0, height: 0 }), J = G(null), ot = _t(() => typeof C == "number" && typeof y == "number" && y > 0 ? C / y : n.width > 0 && n.height > 0 ? n.width / n.height : null, [n.height, n.width, y, C]), ut = _t(() => {
383
+ switch (P) {
383
384
  case "original":
384
- return et;
385
+ return ot;
385
386
  case "1:1":
386
387
  return 1;
387
388
  case "4:3":
@@ -395,19 +396,19 @@ function Er({
395
396
  default:
396
397
  return null;
397
398
  }
398
- }, [et, I]), m = 24, Y = S(
399
+ }, [ot, P]), l = 24, Y = I(
399
400
  (s) => {
400
- let { x: g, y: p, width: l, height: b } = s;
401
- const j = n.width, ot = n.height;
402
- return g = Math.max(0, Math.min(g, j - m)), p = Math.max(0, Math.min(p, ot - m)), l = Math.max(m, Math.min(l, j - g)), b = Math.max(m, Math.min(b, ot - p)), { x: g, y: p, width: l, height: b };
401
+ let { x: g, y: p, width: u, height: b } = s;
402
+ const O = n.width, at = n.height;
403
+ return g = Math.max(0, Math.min(g, O - l)), p = Math.max(0, Math.min(p, at - l)), u = Math.max(l, Math.min(u, O - g)), b = Math.max(l, Math.min(b, at - p)), { x: g, y: p, width: u, height: b };
403
404
  },
404
405
  [n.height, n.width]
405
- ), ut = S(
406
+ ), mt = I(
406
407
  (s) => {
407
408
  if (n.width <= 0 || n.height <= 0)
408
409
  return;
409
410
  if (s == null) {
410
- L({
411
+ $({
411
412
  x: 0,
412
413
  y: 0,
413
414
  width: n.width,
@@ -416,114 +417,114 @@ function Er({
416
417
  return;
417
418
  }
418
419
  const g = n.width * 0.9, p = n.height * 0.9;
419
- let l = g, b = l / s;
420
- b > p && (b = p, l = b * s), L(
420
+ let u = g, b = u / s;
421
+ b > p && (b = p, u = b * s), $(
421
422
  Y({
422
- x: (n.width - l) / 2,
423
+ x: (n.width - u) / 2,
423
424
  y: (n.height - b) / 2,
424
- width: l,
425
+ width: u,
425
426
  height: b
426
427
  })
427
428
  );
428
429
  },
429
430
  [n.height, n.width, Y]
430
- ), J = S(() => {
431
- const s = x.current, g = A.current;
431
+ ), Q = I(() => {
432
+ const s = v.current, g = A.current;
432
433
  if (!s || !g)
433
434
  return;
434
- let p = 0, l = 0, b = g;
435
+ let p = 0, u = 0, b = g;
435
436
  for (; b && b !== s; )
436
- p += b.offsetLeft, l += b.offsetTop, b = b.offsetParent;
437
- $({
437
+ p += b.offsetLeft, u += b.offsetTop, b = b.offsetParent;
438
+ W({
438
439
  x: p,
439
- y: l,
440
+ y: u,
440
441
  width: g.offsetWidth,
441
442
  height: g.offsetHeight
442
443
  });
443
- }, []), rt = S(
444
+ }, []), it = I(
444
445
  (s) => {
445
- n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), V.current = {
446
+ n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), J.current = {
446
447
  mode: "move",
447
448
  startX: s.clientX,
448
449
  startY: s.clientY,
449
- initialRect: { ...N }
450
+ initialRect: { ...R }
450
451
  });
451
452
  },
452
- [n.height, n.width, N]
453
- ), xt = S(
453
+ [n.height, n.width, R]
454
+ ), vt = I(
454
455
  (s, g) => {
455
- n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), V.current = {
456
+ n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), J.current = {
456
457
  mode: g,
457
458
  startX: s.clientX,
458
459
  startY: s.clientY,
459
- initialRect: { ...N }
460
+ initialRect: { ...R }
460
461
  });
461
462
  },
462
- [n.height, n.width, N]
463
- ), vt = S(async () => {
463
+ [n.height, n.width, R]
464
+ ), wt = I(async () => {
464
465
  if (n.width <= 0 || n.height <= 0) {
465
466
  o(!1);
466
467
  return;
467
468
  }
468
469
  const s = A.current;
469
470
  if (!s || !s.naturalWidth || !s.naturalHeight) {
470
- Nr.error("Could not read image dimensions");
471
+ Pr.error("Could not read image dimensions");
471
472
  return;
472
473
  }
473
- const g = s.naturalWidth / n.width, p = s.naturalHeight / n.height, l = {
474
- x: Math.max(0, Math.round(N.x * g)),
475
- y: Math.max(0, Math.round(N.y * p)),
476
- width: Math.max(1, Math.round(N.width * g)),
477
- height: Math.max(1, Math.round(N.height * p)),
474
+ const g = s.naturalWidth / n.width, p = s.naturalHeight / n.height, u = {
475
+ x: Math.max(0, Math.round(R.x * g)),
476
+ y: Math.max(0, Math.round(R.y * p)),
477
+ width: Math.max(1, Math.round(R.width * g)),
478
+ height: Math.max(1, Math.round(R.height * p)),
478
479
  naturalWidth: s.naturalWidth,
479
480
  naturalHeight: s.naturalHeight
480
481
  };
481
- l.width = Math.min(l.width, s.naturalWidth - l.x), l.height = Math.min(l.height, s.naturalHeight - l.y), await Promise.resolve(D(l)), o(!1);
482
- }, [n, N, D, o]);
483
- return q(() => {
484
- i && ($({ x: 0, y: 0, width: 0, height: 0 }), L({ x: 0, y: 0, width: 0, height: 0 }), k(!1), E(ce(e)));
485
- }, [i, e]), q(() => {
482
+ u.width = Math.min(u.width, s.naturalWidth - u.x), u.height = Math.min(u.height, s.naturalHeight - u.y), await Promise.resolve(L(u)), o(!1);
483
+ }, [n, R, L, o]);
484
+ return V(() => {
485
+ i && (W({ x: 0, y: 0, width: 0, height: 0 }), $({ x: 0, y: 0, width: 0, height: 0 }), N(!1), E(yt(e)));
486
+ }, [i, e]), V(() => {
486
487
  if (!i)
487
488
  return;
488
- const s = x.current;
489
+ const s = v.current;
489
490
  if (!s)
490
491
  return;
491
492
  const g = new ResizeObserver(() => {
492
- J();
493
+ Q();
493
494
  });
494
495
  g.observe(s);
495
496
  const p = A.current;
496
497
  p && g.observe(p);
497
- const l = () => J();
498
- return window.addEventListener("resize", l), () => {
499
- g.disconnect(), window.removeEventListener("resize", l);
498
+ const u = () => Q();
499
+ return window.addEventListener("resize", u), () => {
500
+ g.disconnect(), window.removeEventListener("resize", u);
500
501
  };
501
- }, [i, J]), q(() => {
502
+ }, [i, Q]), V(() => {
502
503
  if (!i)
503
504
  return;
504
505
  const s = (p) => {
505
- const l = V.current;
506
- if (!l)
506
+ const u = J.current;
507
+ if (!u)
507
508
  return;
508
509
  p.preventDefault();
509
- const b = p.clientX - l.startX, j = p.clientY - l.startY, ot = n.width, it = n.height, K = lt ?? null, { x: X, y: Q, width: W, height: B } = l.initialRect;
510
- if (l.mode === "move") {
511
- const at = Math.max(0, ot - W), Pt = Math.max(0, it - B);
512
- L(
510
+ const b = p.clientX - u.startX, O = p.clientY - u.startY, at = n.width, nt = n.height, U = ut ?? null, { x: X, y: Z, width: _, height: B } = u.initialRect;
511
+ if (u.mode === "move") {
512
+ const st = Math.max(0, at - _), zt = Math.max(0, nt - B);
513
+ $(
513
514
  Y({
514
- x: Math.max(0, Math.min(at, X + b)),
515
- y: Math.max(0, Math.min(Pt, Q + j)),
516
- width: W,
515
+ x: Math.max(0, Math.min(st, X + b)),
516
+ y: Math.max(0, Math.min(zt, Z + O)),
517
+ width: _,
517
518
  height: B
518
519
  })
519
520
  );
520
521
  return;
521
522
  }
522
- const M = l.mode;
523
- let _ = X, Z = Q, O = W, H = B;
524
- M.includes("e") && (O = W + b), M.includes("w") && (_ = X + b, O = W - b), M.includes("s") && (H = B + j), M.includes("n") && (Z = Q + j, H = B - j), K != null && K > 0 && (M === "e" || M === "w" ? (H = O / K, M.includes("n") && (Z = Q + B - H)) : M === "n" || M === "s" ? (O = H * K, M.includes("w") && (_ = X + W - O)) : (H = O / K, M.includes("n") && (Z = Q + B - H), M.includes("w") && (_ = X + W - O))), L(Y({ x: _, y: Z, width: O, height: H }));
523
+ const M = u.mode;
524
+ let j = X, tt = Z, H = _, F = B;
525
+ M.includes("e") && (H = _ + b), M.includes("w") && (j = X + b, H = _ - b), M.includes("s") && (F = B + O), M.includes("n") && (tt = Z + O, F = B - O), U != null && U > 0 && (M === "e" || M === "w" ? (F = H / U, M.includes("n") && (tt = Z + B - F)) : M === "n" || M === "s" ? (H = F * U, M.includes("w") && (j = X + _ - H)) : (F = H / U, M.includes("n") && (tt = Z + B - F), M.includes("w") && (j = X + _ - H))), $(Y({ x: j, y: tt, width: H, height: F }));
525
526
  }, g = () => {
526
- V.current = null;
527
+ J.current = null;
527
528
  };
528
529
  return window.addEventListener("pointermove", s), window.addEventListener("pointerup", g), () => {
529
530
  window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", g);
@@ -532,12 +533,12 @@ function Er({
532
533
  i,
533
534
  n.width,
534
535
  n.height,
535
- lt,
536
+ ut,
536
537
  Y
537
- ]), q(() => {
538
- i && ut(lt);
539
- }, [i, lt, n, ut]), /* @__PURE__ */ r(Zt, { open: i, onOpenChange: o, children: /* @__PURE__ */ r(
540
- te,
538
+ ]), V(() => {
539
+ i && mt(ut);
540
+ }, [i, ut, n, mt]), /* @__PURE__ */ r(re, { open: i, onOpenChange: o, children: /* @__PURE__ */ r(
541
+ oe,
541
542
  {
542
543
  className: "sm:cteditor-max-w-[860px] cteditor-max-w-[calc(100%-2rem)] cteditor-rounded-xl cteditor-overflow-hidden cteditor-p-0",
543
544
  onClick: (s) => s.stopPropagation(),
@@ -546,22 +547,22 @@ function Er({
546
547
  /* @__PURE__ */ r("div", { className: "cteditor-bg-muted/20 cteditor-p-4 md:cteditor-p-6", children: /* @__PURE__ */ f(
547
548
  "div",
548
549
  {
549
- ref: x,
550
+ ref: v,
550
551
  className: "cteditor-relative cteditor-min-h-[340px] cteditor-rounded-lg cteditor-bg-black/70 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-select-none cteditor-touch-none",
551
552
  children: [
552
553
  /* @__PURE__ */ r("div", { className: "cteditor-overflow-hidden cteditor-rounded-lg cteditor-flex cteditor-items-center cteditor-justify-center cteditor-w-full", children: c ? /* @__PURE__ */ r("div", { className: "cteditor-text-sm cteditor-text-muted-foreground", children: "Failed to load image preview" }) : /* @__PURE__ */ r(
553
554
  "img",
554
555
  {
555
556
  ref: A,
556
- src: v,
557
+ src: w,
557
558
  alt: d || "Crop preview",
558
559
  className: "cteditor-max-w-full cteditor-max-h-[460px] cteditor-w-auto cteditor-h-auto cteditor-select-none cteditor-block",
559
560
  draggable: !1,
560
561
  onLoad: () => {
561
- k(!1), J();
562
+ N(!1), Q();
562
563
  },
563
564
  onError: () => {
564
- k(!0);
565
+ N(!0);
565
566
  }
566
567
  }
567
568
  ) }),
@@ -570,10 +571,10 @@ function Er({
570
571
  {
571
572
  className: "cteditor-absolute cteditor-border-2 cteditor-border-blue-500 cteditor-shadow-[0_0_0_9999px_rgba(0,0,0,0.45)] cteditor-cursor-move cteditor-select-none",
572
573
  style: {
573
- left: n.x + N.x,
574
- top: n.y + N.y,
575
- width: N.width,
576
- height: N.height
574
+ left: n.x + R.x,
575
+ top: n.y + R.y,
576
+ width: R.width,
577
+ height: R.height
577
578
  },
578
579
  children: [
579
580
  /* @__PURE__ */ r(
@@ -594,7 +595,7 @@ function Er({
594
595
  "div",
595
596
  {
596
597
  className: "cteditor-absolute cteditor-inset-0 cteditor-pointer-events-auto",
597
- onPointerDown: rt,
598
+ onPointerDown: it,
598
599
  "aria-label": "Move crop area"
599
600
  }
600
601
  ),
@@ -607,11 +608,11 @@ function Er({
607
608
  ["ne", "cteditor-right-0 cteditor-top-0 cteditor-translate-x-1/2 cteditor--translate-y-1/2", "cteditor-cursor-ne-resize", "cteditor-size-4"],
608
609
  ["sw", "cteditor-left-0 cteditor-bottom-0 cteditor--translate-x-1/2 cteditor-translate-y-1/2", "cteditor-cursor-sw-resize", "cteditor-size-4"],
609
610
  ["se", "cteditor-right-0 cteditor-bottom-0 cteditor-translate-x-1/2 cteditor-translate-y-1/2", "cteditor-cursor-se-resize", "cteditor-size-4"]
610
- ].map(([s, g, p, l]) => /* @__PURE__ */ r(
611
+ ].map(([s, g, p, u]) => /* @__PURE__ */ r(
611
612
  "div",
612
613
  {
613
- className: `cteditor-absolute cteditor-border-2 cteditor-border-white cteditor-bg-blue-500 cteditor-rounded-sm cteditor-pointer-events-auto cteditor-shadow ${g} ${p} ${l}`,
614
- onPointerDown: (b) => xt(b, s),
614
+ className: `cteditor-absolute cteditor-border-2 cteditor-border-white cteditor-bg-blue-500 cteditor-rounded-sm cteditor-pointer-events-auto cteditor-shadow ${g} ${p} ${u}`,
615
+ onPointerDown: (b) => vt(b, s),
615
616
  "aria-label": `Resize ${s}`
616
617
  },
617
618
  s
@@ -623,29 +624,29 @@ function Er({
623
624
  }
624
625
  ) }),
625
626
  /* @__PURE__ */ f("div", { className: "cteditor-p-4 md:cteditor-p-5 cteditor-border-l cteditor-border-border cteditor-bg-background", children: [
626
- /* @__PURE__ */ f(ee, { className: "cteditor-mb-4 cteditor-space-y-1", children: [
627
- /* @__PURE__ */ r(re, { children: "Crop" }),
628
- /* @__PURE__ */ r(oe, { children: "Choose an aspect ratio and adjust the crop area, then click Apply." })
627
+ /* @__PURE__ */ f(ie, { className: "cteditor-mb-4 cteditor-space-y-1", children: [
628
+ /* @__PURE__ */ r(ae, { children: "Crop" }),
629
+ /* @__PURE__ */ r(ne, { children: "Choose an aspect ratio and adjust the crop area, then click Apply." })
629
630
  ] }),
630
631
  /* @__PURE__ */ f("div", { className: "cteditor-space-y-4", children: [
631
632
  /* @__PURE__ */ f("div", { children: [
632
633
  /* @__PURE__ */ r("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-mb-2", children: "Aspect ratio" }),
633
634
  /* @__PURE__ */ r("div", { className: "cteditor-grid cteditor-grid-cols-3 cteditor-gap-2", children: [
634
- { id: "freeform", label: "Freeform", icon: se },
635
- { id: "original", label: "Original", icon: Ge },
636
- { id: "1:1", label: "1:1", icon: mr },
637
- { id: "4:3", label: "4:3", icon: Wt },
638
- { id: "16:9", label: "16:9", icon: Wt },
639
- { id: "3:4", label: "3:4", icon: _t },
640
- { id: "9:16", label: "9:16", icon: _t }
635
+ { id: "freeform", label: "Freeform", icon: le },
636
+ { id: "original", label: "Original", icon: Ve },
637
+ { id: "1:1", label: "1:1", icon: Je },
638
+ { id: "4:3", label: "4:3", icon: Yt },
639
+ { id: "16:9", label: "16:9", icon: Yt },
640
+ { id: "3:4", label: "3:4", icon: Ot },
641
+ { id: "9:16", label: "9:16", icon: Ot }
641
642
  ].map((s) => {
642
- const g = s.icon, p = I === s.id;
643
+ const g = s.icon, p = P === s.id;
643
644
  return /* @__PURE__ */ f(
644
645
  "button",
645
646
  {
646
647
  type: "button",
647
648
  onClick: () => {
648
- C(s.id);
649
+ k(s.id);
649
650
  },
650
651
  className: `cteditor-h-20 cteditor-rounded-md cteditor-border cteditor-text-sm cteditor-transition-colors cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-gap-1.5 ${p ? "cteditor-border-primary cteditor-bg-primary/10 cteditor-text-primary" : "cteditor-border-border hover:cteditor-bg-accent"}`,
651
652
  children: [
@@ -661,25 +662,25 @@ function Er({
661
662
  /* @__PURE__ */ f("div", { children: [
662
663
  /* @__PURE__ */ r("p", { className: "cteditor-text-xs cteditor-text-muted-foreground cteditor-mb-0.5", children: "Crop size" }),
663
664
  /* @__PURE__ */ f("p", { className: "cteditor-text-sm cteditor-font-medium", children: [
664
- Math.round(N.width),
665
+ Math.round(R.width),
665
666
  " × ",
666
- Math.round(N.height),
667
+ Math.round(R.height),
667
668
  " px"
668
669
  ] })
669
670
  ] }),
670
671
  /* @__PURE__ */ f("div", { children: [
671
672
  /* @__PURE__ */ r("p", { className: "cteditor-text-xs cteditor-text-muted-foreground cteditor-mb-0.5", children: "Aspect ratio" }),
672
- /* @__PURE__ */ r("p", { className: "cteditor-text-sm", children: I === "freeform" ? "Free" : I === "original" ? "Original" : I })
673
+ /* @__PURE__ */ r("p", { className: "cteditor-text-sm", children: P === "freeform" ? "Free" : P === "original" ? "Original" : P })
673
674
  ] })
674
675
  ] })
675
676
  ] }),
676
- /* @__PURE__ */ f(ie, { className: "cteditor-gap-2 cteditor-mt-4", children: [
677
+ /* @__PURE__ */ f(se, { className: "cteditor-gap-2 cteditor-mt-4", children: [
677
678
  /* @__PURE__ */ r(
678
679
  "button",
679
680
  {
680
681
  type: "button",
681
682
  onClick: () => {
682
- C("freeform"), ut(null);
683
+ k("freeform"), mt(null);
683
684
  },
684
685
  className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent cteditor-transition-colors",
685
686
  children: "Reset"
@@ -698,7 +699,7 @@ function Er({
698
699
  "button",
699
700
  {
700
701
  type: "button",
701
- onClick: vt,
702
+ onClick: wt,
702
703
  className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors",
703
704
  children: "Apply"
704
705
  }
@@ -709,31 +710,31 @@ function Er({
709
710
  }
710
711
  ) });
711
712
  }
712
- const Rt = /* @__PURE__ */ new Set(), jt = Be("RIGHT_CLICK_IMAGE_COMMAND");
713
- function Rr(i) {
714
- if (!Rt.has(i))
713
+ const It = /* @__PURE__ */ new Set(), Ft = Ke("RIGHT_CLICK_IMAGE_COMMAND");
714
+ function Sr(i) {
715
+ if (!It.has(i))
715
716
  throw new Promise((o) => {
716
717
  const e = new Image();
717
718
  e.src = i, e.onload = () => {
718
- Rt.add(i), o(null);
719
+ It.add(i), o(null);
719
720
  }, e.onerror = () => {
720
- Rt.add(i);
721
+ It.add(i);
721
722
  };
722
723
  });
723
724
  }
724
- function Ir({
725
+ function zr({
725
726
  altText: i,
726
727
  className: o,
727
728
  imageRef: e,
728
729
  src: d,
729
- width: R,
730
+ width: C,
730
731
  height: y,
731
- maxWidth: D,
732
- onError: I,
733
- onLoad: C
732
+ maxWidth: L,
733
+ onError: P,
734
+ onLoad: k
734
735
  }) {
735
- Rr(d);
736
- const v = typeof R == "number" && typeof y == "number", E = typeof R == "number" ? R : "auto";
736
+ Sr(d);
737
+ const w = typeof C == "number" && typeof y == "number", E = typeof C == "number" ? C : "auto";
737
738
  return /* @__PURE__ */ r(
738
739
  "img",
739
740
  {
@@ -741,7 +742,7 @@ function Ir({
741
742
  src: d,
742
743
  alt: i,
743
744
  ref: e,
744
- style: v ? {
745
+ style: w ? {
745
746
  width: E,
746
747
  // Use height: auto + aspect-ratio so the image scales
747
748
  // proportionally when max-width constrains on small screens.
@@ -755,13 +756,13 @@ function Ir({
755
756
  // max-width from CSS rule prevents overflow.
756
757
  height: "auto"
757
758
  },
758
- onError: I,
759
- onLoad: C,
759
+ onError: P,
760
+ onLoad: k,
760
761
  draggable: "false"
761
762
  }
762
763
  );
763
764
  }
764
- function Pr() {
765
+ function Mr() {
765
766
  return /* @__PURE__ */ r(
766
767
  "img",
767
768
  {
@@ -775,174 +776,174 @@ function Pr() {
775
776
  }
776
777
  );
777
778
  }
778
- function Zr({
779
+ function eo({
779
780
  src: i,
780
781
  altText: o,
781
782
  nodeKey: e,
782
783
  width: d,
783
- height: R,
784
+ height: C,
784
785
  maxWidth: y,
785
- resizable: D,
786
- showCaption: I,
787
- caption: C,
788
- captionsEnabled: v,
786
+ resizable: L,
787
+ showCaption: P,
788
+ caption: k,
789
+ captionsEnabled: w,
789
790
  originalPrompt: E,
790
791
  position: c = "none",
791
- linkUrl: k
792
+ linkUrl: N
792
793
  }) {
793
- const x = G(null), A = G(null), [n, $, N] = $e(e), [L, V] = P(!1), et = G(!1), { isCollabActive: lt } = Ae(), [m] = De(), [Y, ut] = P(null), J = G(null), [rt, xt] = P(!1), vt = Le(), [s, g] = P(!1), [p, l] = P(""), [b, j] = P(!1), [ot, it] = P(!1), [K, X] = P(""), [Q, W] = P(""), [B, M] = P(!1), _ = G(null), [Z, O] = P(0), [H, at] = P(!1), ft = qe()?.apiKey, le = Z > 0 && Z < 350;
794
- q(() => {
795
- if (x.current) {
794
+ const v = G(null), A = G(null), [n, W, R] = Te(e), [$, J] = S(!1), ot = G(!1), { isCollabActive: ut } = Le(), [l] = $e(), [Y, mt] = S(null), Q = G(null), [it, vt] = S(!1), wt = We(), [s, g] = S(!1), [p, u] = S(""), [b, O] = S(!1), [at, nt] = S(!1), [U, X] = S(""), [Z, _] = S(""), [B, M] = S(!1), j = G(null), [tt, H] = S(0), [F, st] = S(!1), pt = Qe()?.apiKey, me = tt > 0 && tt < 350;
795
+ V(() => {
796
+ if (v.current) {
796
797
  const t = () => {
797
- et.current || x.current && O(x.current.offsetWidth);
798
+ ot.current || v.current && H(v.current.offsetWidth);
798
799
  };
799
800
  t();
800
801
  const a = new ResizeObserver(t);
801
- return a.observe(x.current), () => a.disconnect();
802
+ return a.observe(v.current), () => a.disconnect();
802
803
  }
803
- }, [d, R, n]), Ke(() => {
804
- if ((c === "left" || c === "right") && typeof d == "number" && x.current) {
805
- const t = x.current.closest(".editor-image"), a = t?.parentElement, u = m.getRootElement(), h = u ? u.getBoundingClientRect().width : d + 32, w = `${Math.min(d + 32, h)}px`;
806
- return t && (t.style.removeProperty("display"), t.style.setProperty("max-width", w, "important")), a && a.style.setProperty("max-width", w, "important"), () => {
804
+ }, [d, C, n]), qe(() => {
805
+ if ((c === "left" || c === "right") && typeof d == "number" && v.current) {
806
+ const t = v.current.closest(".editor-image"), a = t?.parentElement, m = l.getRootElement(), h = m ? m.getBoundingClientRect().width : d + 32, x = `${Math.min(d + 32, h)}px`;
807
+ return t && (t.style.removeProperty("display"), t.style.setProperty("max-width", x, "important")), a && a.style.setProperty("max-width", x, "important"), () => {
807
808
  t && (t.style.removeProperty("max-width"), t.style.removeProperty("display")), a && a.style.removeProperty("max-width");
808
809
  };
809
810
  }
810
- }, [c, d, m]);
811
- const wt = S(
811
+ }, [c, d, l]);
812
+ const Ct = I(
812
813
  (t) => {
813
- const a = st();
814
- return n && dt(a) && (t.preventDefault(), m.update(() => {
814
+ const a = et();
815
+ return n && ct(a) && (t.preventDefault(), l.update(() => {
815
816
  a.getNodes().forEach((h) => {
816
- if (tt(h)) {
817
- const w = h.getParent();
818
- h.remove(), w && Et(w) && w.getChildrenSize() === 0 && w.setFormat("left");
817
+ if (q(h)) {
818
+ const x = h.getParent();
819
+ h.remove(), x && Pt(x) && x.getChildrenSize() === 0 && x.setFormat("left");
819
820
  }
820
821
  });
821
822
  })), !1;
822
823
  },
823
- [m, n]
824
- ), St = S(
824
+ [l, n]
825
+ ), Mt = I(
825
826
  (t) => {
826
- const a = st(), u = A.current;
827
- if (n && dt(a) && a.getNodes().length === 1) {
828
- if (I)
829
- return bt(null), t.preventDefault(), C.focus(), !0;
830
- if (u !== null && u !== document.activeElement)
831
- return t.preventDefault(), u.focus(), !0;
827
+ const a = et(), m = A.current;
828
+ if (n && ct(a) && a.getNodes().length === 1) {
829
+ if (P)
830
+ return gt(null), t.preventDefault(), k.focus(), !0;
831
+ if (m !== null && m !== document.activeElement)
832
+ return t.preventDefault(), m.focus(), !0;
832
833
  }
833
834
  return !1;
834
835
  },
835
- [C, n, I]
836
- ), Mt = S(
837
- (t) => J.current === C || A.current === t.target ? (bt(null), m.update(() => {
838
- $(!0);
839
- const a = m.getRootElement();
836
+ [k, n, P]
837
+ ), At = I(
838
+ (t) => Q.current === k || A.current === t.target ? (gt(null), l.update(() => {
839
+ W(!0);
840
+ const a = l.getRootElement();
840
841
  a !== null && a.focus();
841
842
  }), !0) : !1,
842
- [C, m, $]
843
- ), Ct = S(
843
+ [k, l, W]
844
+ ), kt = I(
844
845
  (t) => {
845
846
  const a = t;
846
- if (L)
847
+ if ($)
847
848
  return !0;
848
- const u = a.target;
849
- if (u.closest("button") && x.current && u.closest(".editor-image") === x.current.closest(".editor-image"))
849
+ const m = a.target;
850
+ if (m.closest("button") && v.current && m.closest(".editor-image") === v.current.closest(".editor-image"))
850
851
  return !0;
851
- const h = u === x.current;
852
- let w = !1;
853
- if (!h && x.current) {
854
- const F = x.current.getBoundingClientRect();
855
- w = a.clientX >= F.left && a.clientX <= F.right && a.clientY >= F.top && a.clientY <= F.bottom;
852
+ const h = m === v.current;
853
+ let x = !1;
854
+ if (!h && v.current) {
855
+ const D = v.current.getBoundingClientRect();
856
+ x = a.clientX >= D.left && a.clientX <= D.right && a.clientY >= D.top && a.clientY <= D.bottom;
856
857
  }
857
- return h || w ? (a.shiftKey ? $(!n) : (N(), $(!0)), !0) : !1;
858
+ return h || x ? (a.shiftKey ? W(!n) : (R(), W(!0)), !0) : !1;
858
859
  },
859
- [L, n, $, N]
860
- ), kt = S(
860
+ [$, n, W, R]
861
+ ), Nt = I(
861
862
  (t) => {
862
- m.getEditorState().read(() => {
863
- const a = st();
864
- t.target.tagName === "IMG" && We(a) && a.getNodes().length === 1 && m.dispatchCommand(
865
- jt,
863
+ l.getEditorState().read(() => {
864
+ const a = et();
865
+ t.target.tagName === "IMG" && je(a) && a.getNodes().length === 1 && l.dispatchCommand(
866
+ Ft,
866
867
  t
867
868
  );
868
869
  });
869
870
  },
870
- [m]
871
+ [l]
871
872
  );
872
- q(() => {
873
+ V(() => {
873
874
  let t = !0;
874
- const a = m.getRootElement(), u = Te(
875
- m.registerUpdateListener(({ editorState: h }) => {
876
- t && ut(h.read(() => st()));
875
+ const a = l.getRootElement(), m = _e(
876
+ l.registerUpdateListener(({ editorState: h }) => {
877
+ t && mt(h.read(() => et()));
877
878
  }),
878
- m.registerCommand(
879
- _e,
880
- (h, w) => (J.current = w, !1),
881
- U
882
- ),
883
- m.registerCommand(
879
+ l.registerCommand(
884
880
  Ye,
885
- Ct,
886
- U
887
- ),
888
- m.registerCommand(
889
- jt,
890
- Ct,
891
- U
892
- ),
893
- m.registerCommand(
894
- je,
895
- (h) => h.target === x.current ? (h.preventDefault(), !0) : !1,
896
- U
881
+ (h, x) => (Q.current = x, !1),
882
+ K
897
883
  ),
898
- m.registerCommand(
884
+ l.registerCommand(
899
885
  Oe,
900
- wt,
901
- U
886
+ kt,
887
+ K
902
888
  ),
903
- m.registerCommand(
889
+ l.registerCommand(
890
+ Ft,
891
+ kt,
892
+ K
893
+ ),
894
+ l.registerCommand(
904
895
  He,
905
- wt,
906
- U
896
+ (h) => h.target === v.current ? (h.preventDefault(), !0) : !1,
897
+ K
898
+ ),
899
+ l.registerCommand(
900
+ Fe,
901
+ Ct,
902
+ K
907
903
  ),
908
- m.registerCommand(Fe, St, U),
909
- m.registerCommand(
904
+ l.registerCommand(
910
905
  Xe,
911
- Mt,
912
- U
906
+ Ct,
907
+ K
908
+ ),
909
+ l.registerCommand(Be, Mt, K),
910
+ l.registerCommand(
911
+ Ue,
912
+ At,
913
+ K
913
914
  )
914
915
  );
915
- return a?.addEventListener("contextmenu", kt), () => {
916
- t = !1, u(), a?.removeEventListener("contextmenu", kt);
916
+ return a?.addEventListener("contextmenu", Nt), () => {
917
+ t = !1, m(), a?.removeEventListener("contextmenu", Nt);
917
918
  };
918
919
  }, [
919
- N,
920
- m,
921
- L,
920
+ R,
921
+ l,
922
+ $,
922
923
  n,
923
924
  e,
924
- wt,
925
- St,
926
- Mt,
927
925
  Ct,
926
+ Mt,
927
+ At,
928
928
  kt,
929
- $
929
+ Nt,
930
+ W
930
931
  ]);
931
- const ue = () => {
932
- m.update(() => {
933
- const t = ct(e);
934
- tt(t) && t.setShowCaption(!0);
932
+ const ge = () => {
933
+ l.update(() => {
934
+ const t = rt(e);
935
+ q(t) && t.setShowCaption(!0);
935
936
  });
936
- }, me = (t, a) => {
937
- et.current = !1, setTimeout(() => {
938
- V(!1);
939
- }, 200), m.update(() => {
940
- const u = ct(e);
941
- tt(u) && u.setWidthAndHeight(t, a);
937
+ }, he = (t, a) => {
938
+ ot.current = !1, setTimeout(() => {
939
+ J(!1);
940
+ }, 200), l.update(() => {
941
+ const m = rt(e);
942
+ q(m) && m.setWidthAndHeight(t, a);
942
943
  });
943
- }, ge = () => {
944
- et.current = !0, V(!0);
945
- }, he = (t) => {
944
+ }, fe = () => {
945
+ ot.current = !0, J(!0);
946
+ }, pe = (t) => {
946
947
  if (t.preventDefault(), t.stopPropagation(), i.startsWith("data:")) {
947
948
  const a = window.open("", "_blank");
948
949
  a && (a.document.write(`
@@ -973,89 +974,112 @@ function Zr({
973
974
  `), a.document.close());
974
975
  } else
975
976
  window.open(i, "_blank");
976
- }, fe = (t) => {
977
- t.preventDefault(), t.stopPropagation(), m.update(() => {
978
- const a = ct(e);
979
- if (tt(a)) {
980
- const u = a.getParent();
981
- a.remove(), u && Et(u) && u.getChildrenSize() === 0 && u.setFormat("left");
977
+ }, be = (t) => {
978
+ t.preventDefault(), t.stopPropagation(), l.update(() => {
979
+ const a = rt(e);
980
+ if (q(a)) {
981
+ const m = a.getParent();
982
+ a.remove(), m && Pt(m) && m.getChildrenSize() === 0 && m.setFormat("left");
982
983
  }
983
984
  });
984
- }, nt = (t, a) => {
985
- t.preventDefault(), t.stopPropagation(), m.update(() => {
986
- const u = ct(e);
987
- if (tt(u)) {
988
- u.setPosition(a);
989
- const h = u.getParent();
990
- h && Et(h) && (a === "left" ? h.setFormat("left") : a === "right" ? h.setFormat("right") : h.setFormat(""));
985
+ }, dt = (t, a) => {
986
+ t.preventDefault(), t.stopPropagation(), l.update(() => {
987
+ const m = rt(e);
988
+ if (q(m)) {
989
+ m.setPosition(a);
990
+ const h = m.getParent();
991
+ h && Pt(h) && (a === "left" ? h.setFormat("left") : a === "right" ? h.setFormat("right") : h.setFormat(""));
991
992
  }
992
993
  });
993
- }, pe = (t) => {
994
+ }, ye = (t) => {
994
995
  t.preventDefault(), t.stopPropagation(), g(!s);
995
- }, be = S((t) => {
996
- t.preventDefault(), t.stopPropagation(), at(!0);
997
- }, []), ye = S(
996
+ }, xe = I((t) => {
997
+ t.preventDefault(), t.stopPropagation(), st(!0);
998
+ }, []), ve = I(
999
+ (t) => {
1000
+ t.preventDefault(), t.stopPropagation();
1001
+ const a = yt(i);
1002
+ if (!(lt(i) && i !== a) && !(typeof d == "number" || typeof C == "number"))
1003
+ return;
1004
+ l.update(
1005
+ () => {
1006
+ const D = rt(e);
1007
+ if (!q(D))
1008
+ return;
1009
+ D.setSrc(a), D.setWidthAndHeight("inherit", "inherit");
1010
+ const Rt = et();
1011
+ Rt && gt(Rt.clone());
1012
+ },
1013
+ { tag: "image-reset" }
1014
+ );
1015
+ const x = v.current;
1016
+ x && requestAnimationFrame(() => {
1017
+ x.src = a, x.style.removeProperty("width"), x.style.removeProperty("height");
1018
+ }), z.success("Image reset to original size and crop");
1019
+ },
1020
+ [l, e, i, d, C]
1021
+ ), we = I(
998
1022
  async (t) => {
999
1023
  let a = i;
1000
- if (ht(i))
1001
- a = ce(i);
1024
+ if (lt(i))
1025
+ a = yt(i);
1002
1026
  else {
1003
- if (!ft) {
1027
+ if (!pt) {
1004
1028
  z.error("API key is required to upload and crop external images.");
1005
1029
  return;
1006
1030
  }
1007
1031
  const h = z.loading("Uploading image…");
1008
1032
  try {
1009
- a = (await Ve.post(
1010
- Je.project.fileUploadFromUrl,
1033
+ a = (await Ze.post(
1034
+ tr.project.fileUploadFromUrl,
1011
1035
  { url: i, prefix: "uploads" },
1012
- { headers: { "x-api-key": ft } }
1036
+ { headers: { "x-api-key": pt } }
1013
1037
  )).data.fileUrl, z.dismiss(h);
1014
1038
  } catch {
1015
1039
  z.dismiss(h), z.error("Failed to upload image. Try again.");
1016
1040
  return;
1017
1041
  }
1018
1042
  }
1019
- const u = pr(a, t);
1020
- if (u === a) {
1043
+ const m = xr(a, t);
1044
+ if (m === a) {
1021
1045
  z.error("Cropping is only supported for images hosted on the CDN.");
1022
1046
  return;
1023
1047
  }
1024
- m.update(() => {
1025
- const h = ct(e);
1026
- if (!tt(h))
1048
+ l.update(() => {
1049
+ const h = rt(e);
1050
+ if (!q(h))
1027
1051
  return;
1028
- h.setSrc(u), h.setWidthAndHeight(t.width, t.height);
1029
- const w = st();
1030
- w && bt(w.clone());
1052
+ h.setSrc(m), h.setWidthAndHeight(t.width, t.height);
1053
+ const x = et();
1054
+ x && gt(x.clone());
1031
1055
  }), z.success("Image cropped");
1032
1056
  },
1033
- [m, e, i, ft]
1034
- ), xe = S(() => {
1035
- k && !n && (_.current = setTimeout(() => {
1057
+ [l, e, i, pt]
1058
+ ), Ce = I(() => {
1059
+ N && !n && (j.current = setTimeout(() => {
1036
1060
  M(!0);
1037
1061
  }, 300));
1038
- }, [k, n]), ve = S(() => {
1039
- _.current && (clearTimeout(_.current), _.current = null), M(!1);
1040
- }, []), zt = S((t) => {
1041
- t.preventDefault(), t.stopPropagation(), k && window.open(k, "_blank", "noopener,noreferrer");
1042
- }, [k]);
1043
- q(() => () => {
1044
- _.current && clearTimeout(_.current);
1045
- }, []), q(() => {
1046
- n || at(!1);
1062
+ }, [N, n]), ke = I(() => {
1063
+ j.current && (clearTimeout(j.current), j.current = null), M(!1);
1064
+ }, []), Dt = I((t) => {
1065
+ t.preventDefault(), t.stopPropagation(), N && window.open(N, "_blank", "noopener,noreferrer");
1066
+ }, [N]);
1067
+ V(() => () => {
1068
+ j.current && clearTimeout(j.current);
1069
+ }, []), V(() => {
1070
+ n || st(!1);
1047
1071
  }, [n]);
1048
- const At = async () => {
1072
+ const Lt = async () => {
1049
1073
  if (!p.trim() || b)
1050
1074
  return;
1051
- j(!0);
1075
+ O(!0);
1052
1076
  const t = z.loading("Refining image...", {
1053
1077
  description: "This may take 10-30 seconds. Please wait."
1054
1078
  });
1055
1079
  try {
1056
1080
  let a = p.trim();
1057
- const h = p.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim(), w = (pt) => {
1058
- const Ie = pt.toLowerCase();
1081
+ const h = p.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim(), x = (bt) => {
1082
+ const ze = bt.toLowerCase();
1059
1083
  return [
1060
1084
  "article",
1061
1085
  "write",
@@ -1072,59 +1096,59 @@ function Zr({
1072
1096
  "add some images",
1073
1097
  "include images",
1074
1098
  "include pictures"
1075
- ].some((Pe) => Ie.includes(Pe));
1099
+ ].some((Me) => ze.includes(Me));
1076
1100
  };
1077
- let F = "";
1101
+ let D = "";
1078
1102
  if (E && E.trim()) {
1079
- const pt = E.trim();
1080
- w(pt) && o && o !== "Generated image" && o.trim() ? F = o.trim() : F = pt;
1103
+ const bt = E.trim();
1104
+ x(bt) && o && o !== "Generated image" && o.trim() ? D = o.trim() : D = bt;
1081
1105
  } else
1082
- o && o !== "Generated image" && o.trim() && (F = o.trim());
1083
- F ? a = `${F} with ${h}` : a = h;
1084
- const Lt = (await dr({
1106
+ o && o !== "Generated image" && o.trim() && (D = o.trim());
1107
+ D ? a = `${D} with ${h}` : a = h;
1108
+ const Wt = (await ur({
1085
1109
  content: `Generate Image: ${a}`,
1086
- apiKey: ft || void 0
1110
+ apiKey: pt || void 0
1087
1111
  }))?.data;
1088
- if (!Lt)
1112
+ if (!Wt)
1089
1113
  throw new Error("Failed to generate image - empty response");
1090
- const Nt = new DOMParser().parseFromString(Lt, "text/html").querySelector("img");
1091
- if (!Nt || !Nt.src)
1114
+ const Et = new DOMParser().parseFromString(Wt, "text/html").querySelector("img");
1115
+ if (!Et || !Et.src)
1092
1116
  throw new Error("No image found in response");
1093
- const Re = Nt.src;
1117
+ const Se = Et.src;
1094
1118
  z.dismiss(t), z.success("Image refined successfully!", {
1095
1119
  description: "Compare the images and choose which to keep."
1096
- }), X(Re), W(a), it(!0), l(""), g(!1);
1120
+ }), X(Se), _(a), nt(!0), u(""), g(!1);
1097
1121
  } catch (a) {
1098
- if (z.dismiss(t), a instanceof cr) {
1099
- const u = a.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
1100
- z.error(u, {
1122
+ if (z.dismiss(t), a instanceof mr) {
1123
+ const m = a.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
1124
+ z.error(m, {
1101
1125
  description: a.message,
1102
1126
  duration: 8e3
1103
1127
  });
1104
1128
  } else
1105
- a instanceof lr ? z.error("Credits Issue", {
1129
+ a instanceof gr ? z.error("Credits Issue", {
1106
1130
  description: a.message,
1107
1131
  duration: 8e3
1108
1132
  }) : z.error("Failed to refine image", {
1109
1133
  description: a instanceof Error ? a.message : "Unknown error. Please try again."
1110
1134
  });
1111
1135
  } finally {
1112
- j(!1);
1136
+ O(!1);
1113
1137
  }
1114
- }, we = () => {
1115
- m.update(() => {
1116
- const t = ct(e);
1117
- if (tt(t)) {
1118
- t.setSrc(K), t.setOriginalPrompt(Q);
1119
- const a = st();
1120
- a && bt(a.clone());
1138
+ }, Ne = () => {
1139
+ l.update(() => {
1140
+ const t = rt(e);
1141
+ if (q(t)) {
1142
+ t.setSrc(U), t.setOriginalPrompt(Z);
1143
+ const a = et();
1144
+ a && gt(a.clone());
1121
1145
  }
1122
- }), it(!1), X(""), W(""), z.success("Image replaced successfully!", {
1146
+ }), nt(!1), X(""), _(""), z.success("Image replaced successfully!", {
1123
1147
  description: "The image has been updated with the refined version."
1124
1148
  });
1125
- }, Ce = () => {
1126
- it(!1), X(""), W("");
1127
- }, ke = n && dt(Y) && !L, Dt = (n || L) && vt, Ne = () => c === "left" || c === "right" ? {
1149
+ }, Re = () => {
1150
+ nt(!1), X(""), _("");
1151
+ }, Ee = n && ct(Y) && !$, $t = (n || $) && wt, Pe = () => c === "left" || c === "right" ? {
1128
1152
  position: "relative",
1129
1153
  display: "block",
1130
1154
  width: "100%"
@@ -1152,55 +1176,55 @@ function Zr({
1152
1176
  } : {
1153
1177
  position: "relative",
1154
1178
  display: "inline-block"
1155
- }, Ee = S(
1179
+ }, Ie = I(
1156
1180
  (t) => {
1157
- if (L || t.target.closest("button"))
1181
+ if ($ || t.target.closest("button"))
1158
1182
  return;
1159
- const u = t.target === x.current;
1183
+ const m = t.target === v.current;
1160
1184
  let h = !1;
1161
- if (!u && x.current) {
1162
- const w = x.current.getBoundingClientRect();
1163
- h = t.clientX >= w.left && t.clientX <= w.right && t.clientY >= w.top && t.clientY <= w.bottom;
1185
+ if (!m && v.current) {
1186
+ const x = v.current.getBoundingClientRect();
1187
+ h = t.clientX >= x.left && t.clientX <= x.right && t.clientY >= x.top && t.clientY <= x.bottom;
1164
1188
  }
1165
- !u && !h || (t.stopPropagation(), t.shiftKey ? $(!n) : (N(), $(!0)));
1189
+ !m && !h || (t.stopPropagation(), t.shiftKey ? W(!n) : (R(), W(!0)));
1166
1190
  },
1167
- [L, n, $, N]
1191
+ [$, n, W, R]
1168
1192
  );
1169
- return /* @__PURE__ */ r(Ue, { fallback: null, children: /* @__PURE__ */ f(Se, { children: [
1193
+ return /* @__PURE__ */ r(Ge, { fallback: null, children: /* @__PURE__ */ f(Tt, { children: [
1170
1194
  /* @__PURE__ */ f(
1171
1195
  "div",
1172
1196
  {
1173
- draggable: ke,
1174
- style: Ne(),
1175
- onClick: Ee,
1176
- onMouseEnter: xe,
1177
- onMouseLeave: ve,
1197
+ draggable: Ee,
1198
+ style: Pe(),
1199
+ onClick: Ie,
1200
+ onMouseEnter: Ce,
1201
+ onMouseLeave: ke,
1178
1202
  children: [
1179
- rt ? /* @__PURE__ */ r(Pr, {}) : /* @__PURE__ */ r(
1180
- Ir,
1203
+ it ? /* @__PURE__ */ r(Mr, {}) : /* @__PURE__ */ r(
1204
+ zr,
1181
1205
  {
1182
- className: Dt ? `focused ${dt(Y) ? "draggable" : ""}` : k ? "cteditor-cursor-pointer" : null,
1206
+ className: $t ? `focused ${ct(Y) ? "draggable" : ""}` : N ? "cteditor-cursor-pointer" : null,
1183
1207
  src: i,
1184
1208
  altText: o,
1185
- imageRef: x,
1209
+ imageRef: v,
1186
1210
  width: d,
1187
- height: R,
1211
+ height: C,
1188
1212
  maxWidth: y,
1189
- onError: () => xt(!0)
1213
+ onError: () => vt(!0)
1190
1214
  }
1191
1215
  ),
1192
- B && k && !n && /* @__PURE__ */ f(
1216
+ B && N && !n && /* @__PURE__ */ f(
1193
1217
  "div",
1194
1218
  {
1195
1219
  className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-lg cteditor-border cteditor-border-border cteditor-p-2 cteditor-flex cteditor-items-center cteditor-gap-2",
1196
1220
  style: { zIndex: 10 },
1197
1221
  children: [
1198
- /* @__PURE__ */ r(ur, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
1199
- /* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: k }),
1222
+ /* @__PURE__ */ r(hr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
1223
+ /* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: N }),
1200
1224
  /* @__PURE__ */ r(
1201
1225
  "button",
1202
1226
  {
1203
- onClick: zt,
1227
+ onClick: Dt,
1204
1228
  className: "cteditor-px-2 cteditor-py-1.5 cteditor-text-xs cteditor-rounded cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors cteditor-flex-shrink-0",
1205
1229
  children: "Open"
1206
1230
  }
@@ -1208,136 +1232,148 @@ function Zr({
1208
1232
  ]
1209
1233
  }
1210
1234
  ),
1211
- n && dt(Y) && !rt && /* @__PURE__ */ f(
1235
+ n && ct(Y) && !it && /* @__PURE__ */ f(
1212
1236
  "div",
1213
1237
  {
1214
- className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${le ? "cteditor-left-1/2 cteditor--translate-x-1/2 cteditor-bottom-0 cteditor-translate-y-full cteditor-mt-1" : "cteditor-top-2 cteditor-right-2"}`,
1238
+ className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${me ? "cteditor-left-1/2 cteditor--translate-x-1/2 cteditor-bottom-0 cteditor-translate-y-full cteditor-mt-1" : "cteditor-top-2 cteditor-right-2"}`,
1215
1239
  children: [
1216
1240
  /* @__PURE__ */ f("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-background/80 cteditor-rounded-md cteditor-shadow-md cteditor-border cteditor-border-border cteditor-p-0.5", children: [
1217
1241
  /* @__PURE__ */ r(
1218
1242
  "button",
1219
1243
  {
1220
- onClick: (t) => nt(t, "left"),
1244
+ onClick: (t) => dt(t, "left"),
1221
1245
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "left" ? "cteditor-bg-accent" : ""}`,
1222
1246
  "aria-label": "Wrap text left",
1223
1247
  title: "Wrap text left",
1224
- children: /* @__PURE__ */ r(Qe, {})
1248
+ children: /* @__PURE__ */ r(er, {})
1225
1249
  }
1226
1250
  ),
1227
1251
  /* @__PURE__ */ r(
1228
1252
  "button",
1229
1253
  {
1230
- onClick: (t) => nt(t, "right"),
1254
+ onClick: (t) => dt(t, "right"),
1231
1255
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "right" ? "cteditor-bg-accent" : ""}`,
1232
1256
  "aria-label": "Wrap text right",
1233
1257
  title: "Wrap text right",
1234
- children: /* @__PURE__ */ r(Ze, {})
1258
+ children: /* @__PURE__ */ r(rr, {})
1235
1259
  }
1236
1260
  ),
1237
1261
  /* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
1238
1262
  /* @__PURE__ */ r(
1239
1263
  "button",
1240
1264
  {
1241
- onClick: (t) => nt(t, "inline-left"),
1265
+ onClick: (t) => dt(t, "inline-left"),
1242
1266
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "inline-left" ? "cteditor-bg-accent" : ""}`,
1243
1267
  "aria-label": "Align left",
1244
1268
  title: "Align left (no text wrap)",
1245
- children: /* @__PURE__ */ r(tr, {})
1269
+ children: /* @__PURE__ */ r(or, {})
1246
1270
  }
1247
1271
  ),
1248
1272
  /* @__PURE__ */ r(
1249
1273
  "button",
1250
1274
  {
1251
- onClick: (t) => nt(t, "inline-center"),
1275
+ onClick: (t) => dt(t, "inline-center"),
1252
1276
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "inline-center" || c === "full" ? "cteditor-bg-accent" : ""}`,
1253
1277
  "aria-label": "Align center",
1254
1278
  title: "Align center (no text wrap)",
1255
- children: /* @__PURE__ */ r(er, {})
1279
+ children: /* @__PURE__ */ r(ir, {})
1256
1280
  }
1257
1281
  ),
1258
1282
  /* @__PURE__ */ r(
1259
1283
  "button",
1260
1284
  {
1261
- onClick: (t) => nt(t, "inline-right"),
1285
+ onClick: (t) => dt(t, "inline-right"),
1262
1286
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "inline-right" ? "cteditor-bg-accent" : ""}`,
1263
1287
  "aria-label": "Align right",
1264
1288
  title: "Align right (no text wrap)",
1265
- children: /* @__PURE__ */ r(rr, {})
1289
+ children: /* @__PURE__ */ r(ar, {})
1266
1290
  }
1267
1291
  ),
1268
1292
  /* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
1269
1293
  /* @__PURE__ */ r(
1270
1294
  "button",
1271
1295
  {
1272
- onClick: (t) => nt(t, "none"),
1296
+ onClick: (t) => dt(t, "none"),
1273
1297
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${c === "none" ? "cteditor-bg-accent" : ""}`,
1274
1298
  "aria-label": "Inline",
1275
1299
  title: "Inline with text",
1276
- children: /* @__PURE__ */ r(or, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1300
+ children: /* @__PURE__ */ r(nr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1277
1301
  }
1278
1302
  ),
1279
1303
  /* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
1280
- !i.startsWith("data:") && !i.toLowerCase().endsWith(".svg") && /* @__PURE__ */ r(
1281
- "button",
1282
- {
1283
- onClick: be,
1284
- className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors",
1285
- "aria-label": "Crop image",
1286
- title: "Crop image",
1287
- children: /* @__PURE__ */ r(se, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1288
- }
1289
- )
1304
+ !i.startsWith("data:") && !i.toLowerCase().endsWith(".svg") && /* @__PURE__ */ f(Tt, { children: [
1305
+ /* @__PURE__ */ r(
1306
+ "button",
1307
+ {
1308
+ onClick: xe,
1309
+ className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors",
1310
+ "aria-label": "Crop image",
1311
+ title: "Crop image",
1312
+ children: /* @__PURE__ */ r(le, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1313
+ }
1314
+ ),
1315
+ (yt(i) !== i || typeof d == "number" || typeof C == "number") && /* @__PURE__ */ r(
1316
+ "button",
1317
+ {
1318
+ onClick: ve,
1319
+ className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors",
1320
+ "aria-label": "Reset image to original size and crop",
1321
+ title: "Reset to original size and crop",
1322
+ children: /* @__PURE__ */ r(fr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1323
+ }
1324
+ )
1325
+ ] })
1290
1326
  ] }),
1291
- k && /* @__PURE__ */ r(
1327
+ N && /* @__PURE__ */ r(
1292
1328
  "button",
1293
1329
  {
1294
- onClick: zt,
1330
+ onClick: Dt,
1295
1331
  className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
1296
1332
  "aria-label": "Visit link",
1297
- title: `Visit: ${k}`,
1298
- children: /* @__PURE__ */ r(ir, {})
1333
+ title: `Visit: ${N}`,
1334
+ children: /* @__PURE__ */ r(sr, {})
1299
1335
  }
1300
1336
  ),
1301
1337
  E && /* @__PURE__ */ r(
1302
1338
  "button",
1303
1339
  {
1304
1340
  onClick: (t) => {
1305
- t.stopPropagation(), pe(t);
1341
+ t.stopPropagation(), ye(t);
1306
1342
  },
1307
1343
  className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
1308
1344
  "aria-label": "Refine image",
1309
1345
  title: "Refine image",
1310
- children: /* @__PURE__ */ r(ar, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1346
+ children: /* @__PURE__ */ r(dr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
1311
1347
  }
1312
1348
  ),
1313
1349
  /* @__PURE__ */ r(
1314
1350
  "button",
1315
1351
  {
1316
1352
  onClick: (t) => {
1317
- t.stopPropagation(), he(t);
1353
+ t.stopPropagation(), pe(t);
1318
1354
  },
1319
1355
  className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-accent cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
1320
1356
  "aria-label": "Open image in new tab",
1321
1357
  title: "Open in new tab",
1322
- children: /* @__PURE__ */ r(nr, {})
1358
+ children: /* @__PURE__ */ r(cr, {})
1323
1359
  }
1324
1360
  ),
1325
1361
  /* @__PURE__ */ r(
1326
1362
  "button",
1327
1363
  {
1328
1364
  onClick: (t) => {
1329
- t.stopPropagation(), fe(t);
1365
+ t.stopPropagation(), be(t);
1330
1366
  },
1331
1367
  className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-background/80 hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-border",
1332
1368
  "aria-label": "Delete image",
1333
1369
  title: "Delete image",
1334
- children: /* @__PURE__ */ r(sr, {})
1370
+ children: /* @__PURE__ */ r(lr, {})
1335
1371
  }
1336
1372
  )
1337
1373
  ]
1338
1374
  }
1339
1375
  ),
1340
- s && n && !rt && E && /* @__PURE__ */ r(
1376
+ s && n && !it && E && /* @__PURE__ */ r(
1341
1377
  "div",
1342
1378
  {
1343
1379
  className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-border cteditor-p-3",
@@ -1352,9 +1388,9 @@ function Zr({
1352
1388
  {
1353
1389
  type: "text",
1354
1390
  value: p,
1355
- onChange: (t) => l(t.target.value),
1391
+ onChange: (t) => u(t.target.value),
1356
1392
  onKeyDown: (t) => {
1357
- t.stopPropagation(), t.key === "Enter" && p.trim() && !b && At(), t.key === "Escape" && (g(!1), l(""));
1393
+ t.stopPropagation(), t.key === "Enter" && p.trim() && !b && Lt(), t.key === "Escape" && (g(!1), u(""));
1358
1394
  },
1359
1395
  onKeyUp: (t) => {
1360
1396
  t.stopPropagation();
@@ -1373,7 +1409,7 @@ function Zr({
1373
1409
  "button",
1374
1410
  {
1375
1411
  onClick: (t) => {
1376
- t.stopPropagation(), At();
1412
+ t.stopPropagation(), Lt();
1377
1413
  },
1378
1414
  disabled: b || !p.trim(),
1379
1415
  className: "cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-blue-500 cteditor-text-white hover:cteditor-bg-blue-600 disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
@@ -1387,7 +1423,7 @@ function Zr({
1387
1423
  "button",
1388
1424
  {
1389
1425
  onClick: (t) => {
1390
- t.stopPropagation(), g(!1), l("");
1426
+ t.stopPropagation(), g(!1), u("");
1391
1427
  },
1392
1428
  disabled: b,
1393
1429
  className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
@@ -1398,24 +1434,24 @@ function Zr({
1398
1434
  ] })
1399
1435
  }
1400
1436
  ),
1401
- D && dt(Y) && Dt && /* @__PURE__ */ r(
1402
- Me,
1437
+ L && ct(Y) && $t && /* @__PURE__ */ r(
1438
+ Ae,
1403
1439
  {
1404
- showCaption: I,
1405
- setShowCaption: ue,
1406
- editor: m,
1440
+ showCaption: P,
1441
+ setShowCaption: ge,
1442
+ editor: l,
1407
1443
  buttonRef: A,
1408
- imageRef: x,
1444
+ imageRef: v,
1409
1445
  maxWidth: y,
1410
- onResizeStart: ge,
1411
- onResizeEnd: me,
1412
- captionsEnabled: !rt && v
1446
+ onResizeStart: fe,
1447
+ onResizeEnd: he,
1448
+ captionsEnabled: !it && w
1413
1449
  }
1414
1450
  )
1415
1451
  ]
1416
1452
  }
1417
1453
  ),
1418
- I && (o.startsWith("Signature by") ? /* @__PURE__ */ r(hr, { caption: C }) : /* @__PURE__ */ r(
1454
+ P && (o.startsWith("Signature by") ? /* @__PURE__ */ r(br, { caption: k }) : /* @__PURE__ */ r(
1419
1455
  "div",
1420
1456
  {
1421
1457
  className: "image-caption-container",
@@ -1426,73 +1462,73 @@ function Zr({
1426
1462
  ...c === "inline-center" || c === "full" ? { margin: "0 auto" } : c === "inline-right" ? { marginLeft: "auto" } : c === "left" ? { float: "left", clear: "left" } : c === "right" ? { float: "right", clear: "right" } : {}
1427
1463
  },
1428
1464
  children: /* @__PURE__ */ f(
1429
- Kt,
1465
+ Gt,
1430
1466
  {
1431
- initialEditor: C,
1467
+ initialEditor: k,
1432
1468
  initialNodes: [
1433
- qt,
1434
- Vt,
1435
- Jt,
1436
1469
  Qt,
1437
- Ht,
1438
- Ot
1470
+ Zt,
1471
+ te,
1472
+ ee,
1473
+ Bt,
1474
+ Xt
1439
1475
  ],
1440
1476
  children: [
1441
- /* @__PURE__ */ r(ze, {}),
1477
+ /* @__PURE__ */ r(De, {}),
1442
1478
  /* @__PURE__ */ r(
1443
- Gt,
1479
+ Jt,
1444
1480
  {
1445
1481
  contentEditable: /* @__PURE__ */ r(
1446
- Ft,
1482
+ Ut,
1447
1483
  {
1448
1484
  "aria-placeholder": "Enter a caption...",
1449
1485
  placeholder: () => /* @__PURE__ */ r("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
1450
1486
  className: " cteditor-outline-none !cteditor-shadow-none cteditor-bg-foreground/10 cteditor-border !cteditor-border-foreground/15 cteditor-py-1 cteditor-px-2 cteditor-rounded-sm cteditor-text-xs"
1451
1487
  }
1452
1488
  ),
1453
- ErrorBoundary: Xt
1489
+ ErrorBoundary: Kt
1454
1490
  }
1455
1491
  ),
1456
1492
  /* @__PURE__ */ r(
1457
- Ut,
1493
+ Vt,
1458
1494
  {
1459
1495
  onChange: () => {
1460
1496
  }
1461
1497
  }
1462
1498
  ),
1463
- /* @__PURE__ */ r(Bt, {}),
1464
- /* @__PURE__ */ r(ae, { namespace: ne.namespace })
1499
+ /* @__PURE__ */ r(qt, {}),
1500
+ /* @__PURE__ */ r(de, { namespace: ce.namespace })
1465
1501
  ]
1466
1502
  }
1467
1503
  )
1468
1504
  }
1469
1505
  )),
1470
1506
  /* @__PURE__ */ r(
1471
- Er,
1507
+ Ir,
1472
1508
  {
1473
- open: H,
1474
- onOpenChange: at,
1509
+ open: F,
1510
+ onOpenChange: st,
1475
1511
  src: i,
1476
1512
  altText: o,
1477
1513
  width: d,
1478
- height: R,
1479
- onCropApply: ye
1514
+ height: C,
1515
+ onCropApply: we
1480
1516
  }
1481
1517
  ),
1482
1518
  /* @__PURE__ */ r(
1483
- gr,
1519
+ pr,
1484
1520
  {
1485
- open: ot,
1486
- onOpenChange: it,
1521
+ open: at,
1522
+ onOpenChange: nt,
1487
1523
  oldImageUrl: i,
1488
- newImageUrl: K,
1489
- onReplace: we,
1490
- onCancel: Ce
1524
+ newImageUrl: U,
1525
+ onReplace: Ne,
1526
+ onCancel: Re
1491
1527
  }
1492
1528
  )
1493
1529
  ] }) });
1494
1530
  }
1495
1531
  export {
1496
- jt as RIGHT_CLICK_IMAGE_COMMAND,
1497
- Zr as default
1532
+ Ft as RIGHT_CLICK_IMAGE_COMMAND,
1533
+ eo as default
1498
1534
  };