eddyter 1.3.59 → 1.3.61

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 (44) hide show
  1. package/dist/api/ai/aiAgentService.d.ts +44 -0
  2. package/dist/api/ai/index.d.ts +12 -12
  3. package/dist/assets/index.css +1 -0
  4. package/dist/babel-19rkKi7e.js +7157 -0
  5. package/dist/components/FileUpload/InsertFileDialog.d.ts +0 -1
  6. package/dist/components/LinkPreviewHover/index.d.ts +0 -1
  7. package/dist/components/ScopedEditor.d.ts +0 -1
  8. package/dist/components/TextEnhanceDialog/index.d.ts +1 -1
  9. package/dist/components/ui/dropdown-menu.d.ts +3 -3
  10. package/dist/components/ui/skeleton.d.ts +0 -1
  11. package/dist/context/ToolbarContext.d.ts +6 -2
  12. package/dist/editorConfig.d.ts +1 -0
  13. package/dist/estree-DmlwiAu4.js +4453 -0
  14. package/dist/hooks/useModal.d.ts +0 -1
  15. package/dist/{html-3f297a3a.js → html-DtcgJGeD.js} +1097 -1358
  16. package/dist/html2pdf.bundle-BP8K5ERw.js +32961 -0
  17. package/dist/html2pdf.bundle.min-BrDn1HSi.js +20244 -0
  18. package/dist/{index-25fd6b76.js → index-CFq39nnT.js} +17746 -18306
  19. package/dist/{index-940faa12.js → index-CnBHpreC.js} +347 -377
  20. package/dist/{index-1da728d1.js → index-DnHnFalw.js} +8 -38
  21. package/dist/index.js +13 -46
  22. package/dist/{markdown-08edd93b.js → markdown-C2JcxpgA.js} +1374 -1836
  23. package/dist/plugins/AIChatPlugin.d.ts +1 -2
  24. package/dist/plugins/AutocompletePlugin.d.ts +0 -1
  25. package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +0 -1
  26. package/dist/plugins/HtmlSyncPlugin.d.ts +0 -1
  27. package/dist/plugins/LinkPreviewPlugin/index.d.ts +0 -1
  28. package/dist/plugins/PasteOptionsPlugin/index.d.ts +0 -1
  29. package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +0 -1
  30. package/dist/plugins/SlashCommandPlugin/index.d.ts +0 -1
  31. package/dist/plugins/UsageTrackingPlugin.d.ts +0 -1
  32. package/dist/plugins/VoiceTranscriptPlugin.d.ts +1 -1
  33. package/dist/postcss-Banlrd6S.js +4703 -0
  34. package/dist/{standalone-83d5947a.js → standalone-JqHlnZSs.js} +975 -1274
  35. package/dist/types.d.ts +2 -0
  36. package/dist/typescript-D_phonMq.js +12929 -0
  37. package/package.json +7 -5
  38. package/dist/assets/style.css +0 -1
  39. package/dist/babel-2d5b260f.js +0 -7770
  40. package/dist/estree-28f5912a.js +0 -4920
  41. package/dist/html2pdf.bundle-eacf777f.js +0 -34001
  42. package/dist/html2pdf.bundle.min-d9ce156b.js +0 -21964
  43. package/dist/postcss-0e22bc25.js +0 -5187
  44. package/dist/typescript-0559ee85.js +0 -13660
@@ -1,65 +1,39 @@
1
- import { jsx as t, jsxs as h, Fragment as it } from "react/jsx-runtime";
2
- import { CodeNode as ve } from "@lexical/code";
1
+ import { jsx as t, jsxs as h, Fragment as ot } from "react/jsx-runtime";
2
+ import { CodeNode as Ee } from "@lexical/code";
3
3
  import { LinkNode as ke } from "@lexical/link";
4
- import { AutoFocusPlugin as ot } from "@lexical/react/LexicalAutoFocusPlugin";
5
- import { useCollaborationContext as nt } from "@lexical/react/LexicalCollaborationContext";
6
- import { useLexicalComposerContext as ct } from "@lexical/react/LexicalComposerContext";
7
- import { ContentEditable as Ee } from "@lexical/react/LexicalContentEditable";
8
- import { LexicalErrorBoundary as Ie } from "@lexical/react/LexicalErrorBoundary";
9
- import { HistoryPlugin as Pe } from "@lexical/react/LexicalHistoryPlugin";
10
- import { LexicalNestedComposer as Re } from "@lexical/react/LexicalNestedComposer";
11
- import { OnChangePlugin as De } from "@lexical/react/LexicalOnChangePlugin";
12
- import { RichTextPlugin as ze } from "@lexical/react/LexicalRichTextPlugin";
13
- import { useLexicalEditable as at } from "@lexical/react/useLexicalEditable";
14
- import { useLexicalNodeSelection as st } from "@lexical/react/useLexicalNodeSelection";
15
- import { calculateZoomLevel as xe, mergeRegister as dt } from "@lexical/utils";
16
- import { RootNode as Se, TextNode as Le, LineBreakNode as We, ParagraphNode as Ae, $getSelection as J, $isNodeSelection as X, $isParagraphNode as we, $setSelection as ce, $isRangeSelection as lt, SELECTION_CHANGE_COMMAND as mt, COMMAND_PRIORITY_LOW as M, CLICK_COMMAND as ut, DRAGSTART_COMMAND as gt, KEY_DELETE_COMMAND as ht, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as ft, KEY_ESCAPE_COMMAND as bt, createCommand as yt, $getNodeByKey as U } from "lexical";
17
- import { useRef as T, useState as R, useEffect as ae, useCallback as W, Suspense as xt } from "react";
18
- import { a as wt, D as Ct, b as Nt, d as vt, e as kt, f as Et, h as It, B as Ce, L as Me, i as $e, $ as F, W as Pt, j as Rt, A as Dt, k as zt, l as St, T as Lt, m as Wt, S as At, E as Mt, n as $t, t as $, o as _t, p as Ot, C as Ht } from "./index-25fd6b76.js";
19
- import "axios";
20
- import "react-dom";
21
- import "@emotion/styled";
22
- import "@lexical/html";
23
- import "@lexical/react/LexicalCheckListPlugin";
24
- import "@lexical/react/LexicalComposer";
25
- import "@lexical/react/LexicalHorizontalRulePlugin";
26
- import "@lexical/react/LexicalListPlugin";
27
- import "@lexical/react/LexicalTablePlugin";
28
- import "@lexical/table";
29
- import "@lexical/list";
30
- import "@lexical/rich-text";
31
- import "@lexical/selection";
32
- import "@lexical/react/LexicalHorizontalRuleNode";
33
- import "@lexical/react/LexicalDecoratorBlockNode";
34
- import "emoji-picker-react";
35
- import "@lexical/react/LexicalLinkPlugin";
36
- import "@lexical/react/LexicalTypeaheadMenuPlugin";
37
- import "@lexical/react/LexicalDraggableBlockPlugin";
38
- /**
39
- * @license lucide-react v0.344.0 - ISC
40
- *
41
- * This source code is licensed under the ISC license.
42
- * See the LICENSE file in the root directory of this source tree.
43
- */
44
- const Tt = wt("Link2", [
4
+ import { AutoFocusPlugin as nt } from "@lexical/react/LexicalAutoFocusPlugin";
5
+ import { useCollaborationContext as ct } from "@lexical/react/LexicalCollaborationContext";
6
+ import { useLexicalComposerContext as at } from "@lexical/react/LexicalComposerContext";
7
+ import { ContentEditable as Ie } from "@lexical/react/LexicalContentEditable";
8
+ import { LexicalErrorBoundary as Pe } from "@lexical/react/LexicalErrorBoundary";
9
+ import { HistoryPlugin as Re } from "@lexical/react/LexicalHistoryPlugin";
10
+ import { LexicalNestedComposer as De } from "@lexical/react/LexicalNestedComposer";
11
+ import { OnChangePlugin as ze } from "@lexical/react/LexicalOnChangePlugin";
12
+ import { RichTextPlugin as Se } from "@lexical/react/LexicalRichTextPlugin";
13
+ import { useLexicalEditable as st } from "@lexical/react/useLexicalEditable";
14
+ import { useLexicalNodeSelection as dt } from "@lexical/react/useLexicalNodeSelection";
15
+ import { calculateZoomLevel as we, mergeRegister as lt } from "@lexical/utils";
16
+ import { RootNode as Le, TextNode as We, LineBreakNode as Ae, ParagraphNode as Me, $getSelection as V, $isNodeSelection as K, $isParagraphNode as Ce, $setSelection as ae, $isRangeSelection as ut, SELECTION_CHANGE_COMMAND as mt, COMMAND_PRIORITY_LOW as $, CLICK_COMMAND as gt, DRAGSTART_COMMAND as ht, KEY_DELETE_COMMAND as ft, KEY_BACKSPACE_COMMAND as pt, KEY_ENTER_COMMAND as bt, KEY_ESCAPE_COMMAND as yt, createCommand as xt, $getNodeByKey as J } from "lexical";
17
+ import { useRef as H, useState as R, useEffect as se, useCallback as A, Suspense as wt } from "react";
18
+ import { a as Ct, D as Nt, b as vt, d as Et, e as kt, f as It, h as Pt, B as Ne, L as $e, i as _e, $ as X, W as Rt, j as Dt, A as zt, k as St, l as Lt, T as Wt, m as At, S as Mt, E as $t, n as _t, t as _, o as Ot, p as Ht, C as Tt } from "./index-CFq39nnT.js";
19
+ const jt = Ct("Link2", [
45
20
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
46
21
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
47
22
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
48
- ]);
49
- const jt = ({
23
+ ]), Bt = ({
50
24
  open: u,
51
- onOpenChange: f,
25
+ onOpenChange: p,
52
26
  oldImageUrl: b,
53
27
  newImageUrl: N,
54
- onReplace: z,
55
- onCancel: v
56
- }) => /* @__PURE__ */ t(Ct, { open: u, onOpenChange: f, children: /* @__PURE__ */ h(Nt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
57
- /* @__PURE__ */ h(vt, { children: [
28
+ onReplace: S,
29
+ onCancel: E
30
+ }) => /* @__PURE__ */ t(Nt, { open: u, onOpenChange: p, children: /* @__PURE__ */ h(vt, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
31
+ /* @__PURE__ */ h(Et, { children: [
58
32
  /* @__PURE__ */ h(kt, { className: "flex items-center gap-2 text-xl", children: [
59
33
  /* @__PURE__ */ t("span", { className: "text-2xl", children: "🔄" }),
60
34
  "Compare Images"
61
35
  ] }),
62
- /* @__PURE__ */ t(Et, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
36
+ /* @__PURE__ */ t(It, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
63
37
  ] }),
64
38
  /* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
65
39
  /* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
@@ -81,19 +55,19 @@ const jt = ({
81
55
  ' Clicking "Replace" will update the image in your document. This action cannot be undone.'
82
56
  ] }) })
83
57
  ] }),
84
- /* @__PURE__ */ h(It, { className: "gap-2", children: [
58
+ /* @__PURE__ */ h(Pt, { className: "gap-2", children: [
85
59
  /* @__PURE__ */ t(
86
- Ce,
60
+ Ne,
87
61
  {
88
62
  variant: "outline",
89
- onClick: v,
63
+ onClick: E,
90
64
  children: "Keep Original"
91
65
  }
92
66
  ),
93
67
  /* @__PURE__ */ h(
94
- Ce,
68
+ Ne,
95
69
  {
96
- onClick: z,
70
+ onClick: S,
97
71
  className: "bg-blue-500 hover:bg-blue-600 text-white",
98
72
  children: [
99
73
  /* @__PURE__ */ t("span", { className: "mr-2", children: "✓" }),
@@ -103,27 +77,27 @@ const jt = ({
103
77
  )
104
78
  ] })
105
79
  ] }) });
106
- function Bt({
80
+ function Yt({
107
81
  caption: u
108
82
  }) {
109
83
  return /* @__PURE__ */ t("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
110
- Re,
84
+ De,
111
85
  {
112
86
  initialEditor: u,
113
87
  initialNodes: [
114
- Se,
115
88
  Le,
116
89
  We,
117
90
  Ae,
91
+ Me,
118
92
  ke,
119
- ve
93
+ Ee
120
94
  ],
121
95
  children: [
122
96
  /* @__PURE__ */ t(
123
- ze,
97
+ Se,
124
98
  {
125
99
  contentEditable: /* @__PURE__ */ t(
126
- Ee,
100
+ Ie,
127
101
  {
128
102
  "aria-placeholder": "Enter signature name...",
129
103
  placeholder: /* @__PURE__ */ t("div", { style: {
@@ -139,41 +113,41 @@ function Bt({
139
113
  className: "signature-caption-editable"
140
114
  }
141
115
  ),
142
- ErrorBoundary: Ie
116
+ ErrorBoundary: Pe
143
117
  }
144
118
  ),
145
- /* @__PURE__ */ t(De, { onChange: () => {
119
+ /* @__PURE__ */ t(ze, { onChange: () => {
146
120
  } }),
147
- /* @__PURE__ */ t(Pe, {}),
148
- /* @__PURE__ */ t(Me, { namespace: $e.namespace })
121
+ /* @__PURE__ */ t(Re, {}),
122
+ /* @__PURE__ */ t($e, { namespace: _e.namespace })
149
123
  ]
150
124
  }
151
125
  ) });
152
126
  }
153
- function se(u, f, b) {
154
- return Math.min(Math.max(u, f), b);
127
+ function de(u, p, b) {
128
+ return Math.min(Math.max(u, p), b);
155
129
  }
156
- const s = {
130
+ const c = {
157
131
  east: 1,
158
132
  north: 8,
159
133
  south: 2,
160
134
  west: 4
161
135
  };
162
- function Yt({
136
+ function Kt({
163
137
  onResizeStart: u,
164
- onResizeEnd: f,
138
+ onResizeEnd: p,
165
139
  buttonRef: b,
166
140
  imageRef: N,
167
- maxWidth: z,
168
- editor: v,
169
- showCaption: G,
170
- setShowCaption: A,
171
- captionsEnabled: S
141
+ maxWidth: S,
142
+ editor: E,
143
+ showCaption: F,
144
+ setShowCaption: M,
145
+ captionsEnabled: L
172
146
  }) {
173
- const j = T(null), k = T({
147
+ const T = H(null), k = H({
174
148
  priority: "",
175
149
  value: "default"
176
- }), l = T({
150
+ }), l = H({
177
151
  currentHeight: 0,
178
152
  currentWidth: 0,
179
153
  direction: 0,
@@ -183,9 +157,9 @@ function Yt({
183
157
  startWidth: 0,
184
158
  startX: 0,
185
159
  startY: 0
186
- }), p = v.getRootElement(), x = p !== null ? p.getBoundingClientRect().width - 20 : 100, q = p !== null ? p.getBoundingClientRect().height - 20 : 100, g = 100, E = 100, _ = (i) => {
187
- const d = i === s.east || i === s.west, o = i === s.north || i === s.south, D = i & s.north && i & s.west || i & s.south && i & s.east, C = d ? "ew" : o ? "ns" : D ? "nwse" : "nesw";
188
- p !== null && p.style.setProperty(
160
+ }), f = E.getRootElement(), x = f !== null ? f.getBoundingClientRect().width - 20 : 100, G = f !== null ? f.getBoundingClientRect().height - 20 : 100, m = 100, I = 100, O = (i) => {
161
+ const a = i === c.east || i === c.west, o = i === c.north || i === c.south, v = i & c.north && i & c.west || i & c.south && i & c.east, C = a ? "ew" : o ? "ns" : v ? "nwse" : "nesw";
162
+ f !== null && f.style.setProperty(
189
163
  "cursor",
190
164
  `${C}-resize`,
191
165
  "important"
@@ -202,69 +176,69 @@ function Yt({
202
176
  "none",
203
177
  "important"
204
178
  ));
205
- }, L = () => {
206
- p !== null && p.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
179
+ }, W = () => {
180
+ f !== null && f.style.setProperty("cursor", "text"), document.body !== null && (document.body.style.setProperty("cursor", "default"), document.body.style.setProperty(
207
181
  "-webkit-user-select",
208
182
  k.current.value,
209
183
  k.current.priority
210
184
  ));
211
- }, I = (i, d) => {
212
- if (!v.isEditable())
185
+ }, P = (i, a) => {
186
+ if (!E.isEditable())
213
187
  return;
214
- const o = N.current, D = j.current;
215
- if (o !== null && D !== null) {
188
+ const o = N.current, v = T.current;
189
+ if (o !== null && v !== null) {
216
190
  i.preventDefault();
217
- const { width: C, height: P } = o.getBoundingClientRect(), m = xe(o), a = l.current;
218
- a.startWidth = C, a.startHeight = P, a.ratio = C / P, a.currentWidth = C, a.currentHeight = P, a.startX = i.clientX / m, a.startY = i.clientY / m, a.isResizing = !0, a.direction = d, _(d), u(), D.classList.add("image-control-wrapper--resizing"), o.style.height = `${P}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", n), document.addEventListener("pointerup", O);
191
+ const { width: C, height: D } = o.getBoundingClientRect(), g = we(o), d = l.current;
192
+ d.startWidth = C, d.startHeight = D, d.ratio = C / D, d.currentWidth = C, d.currentHeight = D, d.startX = i.clientX / g, d.startY = i.clientY / g, d.isResizing = !0, d.direction = a, O(a), u(), v.classList.add("image-control-wrapper--resizing"), o.style.height = `${D}px`, o.style.width = `${C}px`, document.addEventListener("pointermove", Q), document.addEventListener("pointerup", n);
219
193
  }
220
- }, n = (i) => {
221
- const d = N.current, o = l.current, D = o.direction & (s.east | s.west), C = o.direction & (s.south | s.north);
222
- if (d !== null && o.isResizing) {
223
- const P = xe(d);
224
- if (D && C) {
225
- let m = Math.floor(o.startX - i.clientX / P);
226
- m = o.direction & s.east ? -m : m;
227
- const a = se(
228
- o.startWidth + m,
229
- g,
194
+ }, Q = (i) => {
195
+ const a = N.current, o = l.current, v = o.direction & (c.east | c.west), C = o.direction & (c.south | c.north);
196
+ if (a !== null && o.isResizing) {
197
+ const D = we(a);
198
+ if (v && C) {
199
+ let g = Math.floor(o.startX - i.clientX / D);
200
+ g = o.direction & c.east ? -g : g;
201
+ const d = de(
202
+ o.startWidth + g,
203
+ m,
230
204
  x
231
- ), H = a / o.ratio;
232
- d.style.width = `${a}px`, d.style.height = `${H}px`, o.currentHeight = H, o.currentWidth = a;
205
+ ), z = d / o.ratio;
206
+ a.style.width = `${d}px`, a.style.height = `${z}px`, o.currentHeight = z, o.currentWidth = d;
233
207
  } else if (C) {
234
- let m = Math.floor(o.startY - i.clientY / P);
235
- m = o.direction & s.south ? -m : m;
236
- const a = se(
237
- o.startHeight + m,
238
- E,
239
- q
208
+ let g = Math.floor(o.startY - i.clientY / D);
209
+ g = o.direction & c.south ? -g : g;
210
+ const d = de(
211
+ o.startHeight + g,
212
+ I,
213
+ G
240
214
  );
241
- d.style.height = `${a}px`, o.currentHeight = a;
215
+ a.style.height = `${d}px`, o.currentHeight = d;
242
216
  } else {
243
- let m = Math.floor(o.startX - i.clientX / P);
244
- m = o.direction & s.east ? -m : m;
245
- const a = se(
246
- o.startWidth + m,
247
- g,
217
+ let g = Math.floor(o.startX - i.clientX / D);
218
+ g = o.direction & c.east ? -g : g;
219
+ const d = de(
220
+ o.startWidth + g,
221
+ m,
248
222
  x
249
223
  );
250
- d.style.width = `${a}px`, o.currentWidth = a;
224
+ a.style.width = `${d}px`, o.currentWidth = d;
251
225
  }
252
226
  }
253
- }, O = () => {
254
- const i = N.current, d = l.current, o = j.current;
255
- if (i !== null && o !== null && d.isResizing) {
256
- const D = d.currentWidth, C = d.currentHeight;
257
- d.startWidth = 0, d.startHeight = 0, d.ratio = 0, d.startX = 0, d.startY = 0, d.currentWidth = 0, d.currentHeight = 0, d.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), L(), f(D, C), document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", O);
227
+ }, n = () => {
228
+ const i = N.current, a = l.current, o = T.current;
229
+ if (i !== null && o !== null && a.isResizing) {
230
+ const v = a.currentWidth, C = a.currentHeight;
231
+ a.startWidth = 0, a.startHeight = 0, a.ratio = 0, a.startX = 0, a.startY = 0, a.currentWidth = 0, a.currentHeight = 0, a.isResizing = !1, o.classList.remove("image-control-wrapper--resizing"), W(), p(v, C), document.removeEventListener("pointermove", Q), document.removeEventListener("pointerup", n);
258
232
  }
259
233
  };
260
- return /* @__PURE__ */ h("div", { ref: j, children: [
261
- !G && S && /* @__PURE__ */ t(
234
+ return /* @__PURE__ */ h("div", { ref: T, children: [
235
+ !F && L && /* @__PURE__ */ t(
262
236
  "button",
263
237
  {
264
238
  className: "image-caption-button",
265
239
  ref: b,
266
240
  onClick: () => {
267
- A(!G);
241
+ M(!F);
268
242
  },
269
243
  children: "Add Caption"
270
244
  }
@@ -274,7 +248,7 @@ function Yt({
274
248
  {
275
249
  className: "image-resizer image-resizer-n",
276
250
  onPointerDown: (i) => {
277
- I(i, s.north);
251
+ P(i, c.north);
278
252
  }
279
253
  }
280
254
  ),
@@ -283,7 +257,7 @@ function Yt({
283
257
  {
284
258
  className: "image-resizer image-resizer-ne",
285
259
  onPointerDown: (i) => {
286
- I(i, s.north | s.east);
260
+ P(i, c.north | c.east);
287
261
  }
288
262
  }
289
263
  ),
@@ -292,7 +266,7 @@ function Yt({
292
266
  {
293
267
  className: "image-resizer image-resizer-e",
294
268
  onPointerDown: (i) => {
295
- I(i, s.east);
269
+ P(i, c.east);
296
270
  }
297
271
  }
298
272
  ),
@@ -301,7 +275,7 @@ function Yt({
301
275
  {
302
276
  className: "image-resizer image-resizer-se",
303
277
  onPointerDown: (i) => {
304
- I(i, s.south | s.east);
278
+ P(i, c.south | c.east);
305
279
  }
306
280
  }
307
281
  ),
@@ -310,7 +284,7 @@ function Yt({
310
284
  {
311
285
  className: "image-resizer image-resizer-s",
312
286
  onPointerDown: (i) => {
313
- I(i, s.south);
287
+ P(i, c.south);
314
288
  }
315
289
  }
316
290
  ),
@@ -319,7 +293,7 @@ function Yt({
319
293
  {
320
294
  className: "image-resizer image-resizer-sw",
321
295
  onPointerDown: (i) => {
322
- I(i, s.south | s.west);
296
+ P(i, c.south | c.west);
323
297
  }
324
298
  }
325
299
  ),
@@ -328,7 +302,7 @@ function Yt({
328
302
  {
329
303
  className: "image-resizer image-resizer-w",
330
304
  onPointerDown: (i) => {
331
- I(i, s.west);
305
+ P(i, c.west);
332
306
  }
333
307
  }
334
308
  ),
@@ -337,57 +311,57 @@ function Yt({
337
311
  {
338
312
  className: "image-resizer image-resizer-nw",
339
313
  onPointerDown: (i) => {
340
- I(i, s.north | s.west);
314
+ P(i, c.north | c.west);
341
315
  }
342
316
  }
343
317
  )
344
318
  ] });
345
319
  }
346
- const de = /* @__PURE__ */ new Set(), Ne = yt("RIGHT_CLICK_IMAGE_COMMAND");
347
- function Kt(u) {
348
- if (!de.has(u))
349
- throw new Promise((f) => {
320
+ const le = /* @__PURE__ */ new Set(), ve = xt("RIGHT_CLICK_IMAGE_COMMAND");
321
+ function Xt(u) {
322
+ if (!le.has(u))
323
+ throw new Promise((p) => {
350
324
  const b = new Image();
351
325
  b.src = u, b.onload = () => {
352
- de.add(u), f(null);
326
+ le.add(u), p(null);
353
327
  }, b.onerror = () => {
354
- de.add(u);
328
+ le.add(u);
355
329
  };
356
330
  });
357
331
  }
358
- function Xt({
332
+ function Ft({
359
333
  altText: u,
360
- className: f,
334
+ className: p,
361
335
  imageRef: b,
362
336
  src: N,
363
- width: z,
364
- height: v,
365
- maxWidth: G,
366
- onError: A
337
+ width: S,
338
+ height: E,
339
+ maxWidth: F,
340
+ onError: M
367
341
  }) {
368
- return Kt(N), /* @__PURE__ */ t(
342
+ return Xt(N), /* @__PURE__ */ t(
369
343
  "img",
370
344
  {
371
- className: f || void 0,
345
+ className: p || void 0,
372
346
  src: N,
373
347
  alt: u,
374
348
  ref: b,
375
- style: typeof z == "number" && typeof v == "number" ? {
349
+ style: typeof S == "number" && typeof E == "number" ? {
376
350
  // User has set a numeric size or original dimensions are provided
377
- width: typeof z == "number" ? z : "auto",
378
- height: typeof v == "number" ? v : "auto",
351
+ width: typeof S == "number" ? S : "auto",
352
+ height: typeof E == "number" ? E : "auto",
379
353
  maxWidth: "100%"
380
354
  } : {
381
355
  // No dimensions specified - use original image size
382
356
  maxWidth: "100%",
383
357
  height: "auto"
384
358
  },
385
- onError: A,
359
+ onError: M,
386
360
  draggable: "false"
387
361
  }
388
362
  );
389
363
  }
390
- function Ft() {
364
+ function Gt() {
391
365
  return /* @__PURE__ */ t(
392
366
  "img",
393
367
  {
@@ -401,173 +375,171 @@ function Ft() {
401
375
  }
402
376
  );
403
377
  }
404
- function Sr({
378
+ function gr({
405
379
  src: u,
406
- altText: f,
380
+ altText: p,
407
381
  nodeKey: b,
408
382
  width: N,
409
- height: z,
410
- maxWidth: v,
411
- resizable: G,
412
- showCaption: A,
413
- caption: S,
414
- captionsEnabled: j,
383
+ height: S,
384
+ maxWidth: E,
385
+ resizable: F,
386
+ showCaption: M,
387
+ caption: L,
388
+ captionsEnabled: T,
415
389
  originalPrompt: k,
416
390
  position: l = "none",
417
- linkUrl: p
391
+ linkUrl: f
418
392
  }) {
419
- const x = T(null), q = T(null), [g, E, _] = st(b), [L, I] = R(!1);
420
- nt();
421
- const [n] = ct(), [O, i] = R(null), d = T(null), [o, D] = R(!1), C = at(), [P, m] = R(!1), [a, H] = R(""), [B, le] = R(!1), [_e, Z] = R(!1), [me, Q] = R(""), [Oe, ee] = R(""), [He, ue] = R(!1), Y = T(null), [ge, Te] = R(0), je = ge > 0 && ge < 350;
422
- ae(() => {
393
+ const x = H(null), G = H(null), [m, I, O] = dt(b), [W, P] = R(!1), { isCollabActive: Q } = ct(), [n] = at(), [i, a] = R(null), o = H(null), [v, C] = R(!1), D = st(), [g, d] = R(!1), [z, U] = R(""), [j, ue] = R(!1), [Oe, Z] = R(!1), [me, ee] = R(""), [He, te] = R(""), [Te, ge] = R(!1), B = H(null), [he, je] = R(0), Be = he > 0 && he < 350;
394
+ se(() => {
423
395
  if (x.current) {
424
396
  const e = () => {
425
- x.current && Te(x.current.offsetWidth);
397
+ x.current && je(x.current.offsetWidth);
426
398
  };
427
399
  e();
428
400
  const r = new ResizeObserver(e);
429
401
  return r.observe(x.current), () => r.disconnect();
430
402
  }
431
- }, [N, z, g]);
432
- const te = W(
403
+ }, [N, S, m]);
404
+ const re = A(
433
405
  (e) => {
434
- const r = J();
435
- return g && X(r) && (e.preventDefault(), n.update(() => {
406
+ const r = V();
407
+ return m && K(r) && (e.preventDefault(), n.update(() => {
436
408
  r.getNodes().forEach((y) => {
437
- if (F(y)) {
409
+ if (X(y)) {
438
410
  const w = y.getParent();
439
- y.remove(), w && we(w) && w.getChildrenSize() === 0 && w.setFormat("left");
411
+ y.remove(), w && Ce(w) && w.getChildrenSize() === 0 && w.setFormat("left");
440
412
  }
441
413
  });
442
414
  })), !1;
443
415
  },
444
- [n, g]
445
- ), he = W(
416
+ [n, m]
417
+ ), fe = A(
446
418
  (e) => {
447
- const r = J(), c = q.current;
448
- if (g && X(r) && r.getNodes().length === 1) {
449
- if (A)
450
- return ce(null), e.preventDefault(), S.focus(), !0;
451
- if (c !== null && c !== document.activeElement)
452
- return e.preventDefault(), c.focus(), !0;
419
+ const r = V(), s = G.current;
420
+ if (m && K(r) && r.getNodes().length === 1) {
421
+ if (M)
422
+ return ae(null), e.preventDefault(), L.focus(), !0;
423
+ if (s !== null && s !== document.activeElement)
424
+ return e.preventDefault(), s.focus(), !0;
453
425
  }
454
426
  return !1;
455
427
  },
456
- [S, g, A]
457
- ), pe = W(
458
- (e) => d.current === S || q.current === e.target ? (ce(null), n.update(() => {
459
- E(!0);
428
+ [L, m, M]
429
+ ), pe = A(
430
+ (e) => o.current === L || G.current === e.target ? (ae(null), n.update(() => {
431
+ I(!0);
460
432
  const r = n.getRootElement();
461
433
  r !== null && r.focus();
462
434
  }), !0) : !1,
463
- [S, n, E]
464
- ), re = W(
435
+ [L, n, I]
436
+ ), ie = A(
465
437
  (e) => {
466
438
  const r = e;
467
- if (L)
439
+ if (W)
468
440
  return !0;
469
441
  const y = r.target === x.current;
470
442
  let w = !1;
471
443
  if (!y && x.current) {
472
- const V = x.current.getBoundingClientRect();
473
- w = r.clientX >= V.left && r.clientX <= V.right && r.clientY >= V.top && r.clientY <= V.bottom;
444
+ const q = x.current.getBoundingClientRect();
445
+ w = r.clientX >= q.left && r.clientX <= q.right && r.clientY >= q.top && r.clientY <= q.bottom;
474
446
  }
475
- return y || w ? (r.shiftKey ? E(!g) : (_(), E(!0)), !0) : !1;
447
+ return y || w ? (r.shiftKey ? I(!m) : (O(), I(!0)), !0) : !1;
476
448
  },
477
- [L, g, E, _]
478
- ), ie = W(
449
+ [W, m, I, O]
450
+ ), oe = A(
479
451
  (e) => {
480
452
  n.getEditorState().read(() => {
481
- const r = J();
482
- e.target.tagName === "IMG" && lt(r) && r.getNodes().length === 1 && n.dispatchCommand(
483
- Ne,
453
+ const r = V();
454
+ e.target.tagName === "IMG" && ut(r) && r.getNodes().length === 1 && n.dispatchCommand(
455
+ ve,
484
456
  e
485
457
  );
486
458
  });
487
459
  },
488
460
  [n]
489
461
  );
490
- ae(() => {
462
+ se(() => {
491
463
  let e = !0;
492
- const r = n.getRootElement(), c = dt(
464
+ const r = n.getRootElement(), s = lt(
493
465
  n.registerUpdateListener(({ editorState: y }) => {
494
- e && i(y.read(() => J()));
466
+ e && a(y.read(() => V()));
495
467
  }),
496
468
  n.registerCommand(
497
469
  mt,
498
- (y, w) => (d.current = w, !1),
499
- M
470
+ (y, w) => (o.current = w, !1),
471
+ $
500
472
  ),
501
473
  n.registerCommand(
502
- ut,
503
- re,
504
- M
474
+ gt,
475
+ ie,
476
+ $
505
477
  ),
506
478
  n.registerCommand(
507
- Ne,
508
- re,
509
- M
479
+ ve,
480
+ ie,
481
+ $
510
482
  ),
511
483
  n.registerCommand(
512
- gt,
484
+ ht,
513
485
  (y) => y.target === x.current ? (y.preventDefault(), !0) : !1,
514
- M
486
+ $
515
487
  ),
516
488
  n.registerCommand(
517
- ht,
518
- te,
519
- M
489
+ ft,
490
+ re,
491
+ $
520
492
  ),
521
493
  n.registerCommand(
522
494
  pt,
523
- te,
524
- M
495
+ re,
496
+ $
525
497
  ),
526
- n.registerCommand(ft, he, M),
498
+ n.registerCommand(bt, fe, $),
527
499
  n.registerCommand(
528
- bt,
500
+ yt,
529
501
  pe,
530
- M
502
+ $
531
503
  )
532
504
  );
533
- return r == null || r.addEventListener("contextmenu", ie), () => {
534
- e = !1, c(), r == null || r.removeEventListener("contextmenu", ie);
505
+ return r?.addEventListener("contextmenu", oe), () => {
506
+ e = !1, s(), r?.removeEventListener("contextmenu", oe);
535
507
  };
536
508
  }, [
537
- _,
509
+ O,
538
510
  n,
539
- L,
540
- g,
511
+ W,
512
+ m,
541
513
  b,
542
- te,
543
- he,
544
- pe,
545
514
  re,
515
+ fe,
516
+ pe,
546
517
  ie,
547
- E
518
+ oe,
519
+ I
548
520
  ]);
549
- const Be = () => {
521
+ const Ye = () => {
550
522
  n.update(() => {
551
- const e = U(b);
552
- F(e) && e.setShowCaption(!0);
523
+ const e = J(b);
524
+ X(e) && e.setShowCaption(!0);
553
525
  });
554
- }, Ye = (e, r) => {
526
+ }, Ke = (e, r) => {
555
527
  setTimeout(() => {
556
- I(!1);
528
+ P(!1);
557
529
  }, 200), n.update(() => {
558
- const c = U(b);
559
- F(c) && c.setWidthAndHeight(e, r);
530
+ const s = J(b);
531
+ X(s) && s.setWidthAndHeight(e, r);
560
532
  });
561
- }, Ke = () => {
562
- I(!0);
563
- }, Xe = (e) => {
533
+ }, Xe = () => {
534
+ P(!0);
535
+ }, Fe = (e) => {
564
536
  if (e.preventDefault(), e.stopPropagation(), u.startsWith("data:")) {
565
537
  const r = window.open("", "_blank");
566
538
  r && (r.document.write(`
567
539
  <!DOCTYPE html>
568
540
  <html>
569
541
  <head>
570
- <title>${f || "Image"}</title>
542
+ <title>${p || "Image"}</title>
571
543
  <style>
572
544
  body {
573
545
  margin: 0;
@@ -585,98 +557,96 @@ function Sr({
585
557
  </style>
586
558
  </head>
587
559
  <body>
588
- <img src="${u}" alt="${f || "Image"}" />
560
+ <img src="${u}" alt="${p || "Image"}" />
589
561
  </body>
590
562
  </html>
591
563
  `), r.document.close());
592
564
  } else
593
565
  window.open(u, "_blank");
594
- }, Fe = (e) => {
566
+ }, Ge = (e) => {
595
567
  e.preventDefault(), e.stopPropagation(), n.update(() => {
596
- const r = U(b);
597
- if (F(r)) {
598
- const c = r.getParent();
599
- r.remove(), c && we(c) && c.getChildrenSize() === 0 && c.setFormat("left");
568
+ const r = J(b);
569
+ if (X(r)) {
570
+ const s = r.getParent();
571
+ r.remove(), s && Ce(s) && s.getChildrenSize() === 0 && s.setFormat("left");
600
572
  }
601
573
  });
602
- }, K = (e, r) => {
574
+ }, Y = (e, r) => {
603
575
  e.preventDefault(), e.stopPropagation(), n.update(() => {
604
- const c = U(b);
605
- F(c) && c.setPosition(r);
576
+ const s = J(b);
577
+ X(s) && s.setPosition(r);
606
578
  });
607
- }, Ge = (e) => {
608
- e.preventDefault(), e.stopPropagation(), m(!P);
609
- }, qe = W(() => {
610
- p && !g && (Y.current = setTimeout(() => {
611
- ue(!0);
579
+ }, qe = (e) => {
580
+ e.preventDefault(), e.stopPropagation(), d(!g);
581
+ }, Ve = A(() => {
582
+ f && !m && (B.current = setTimeout(() => {
583
+ ge(!0);
612
584
  }, 300));
613
- }, [p, g]), Ve = W(() => {
614
- Y.current && (clearTimeout(Y.current), Y.current = null), ue(!1);
615
- }, []), fe = W((e) => {
616
- e.preventDefault(), e.stopPropagation(), p && window.open(p, "_blank", "noopener,noreferrer");
617
- }, [p]);
618
- ae(() => () => {
619
- Y.current && clearTimeout(Y.current);
585
+ }, [f, m]), Je = A(() => {
586
+ B.current && (clearTimeout(B.current), B.current = null), ge(!1);
587
+ }, []), be = A((e) => {
588
+ e.preventDefault(), e.stopPropagation(), f && window.open(f, "_blank", "noopener,noreferrer");
589
+ }, [f]);
590
+ se(() => () => {
591
+ B.current && clearTimeout(B.current);
620
592
  }, []);
621
- const be = async () => {
622
- if (!a.trim() || B)
623
- return;
624
- le(!0);
625
- const e = $.loading("Refining image...", {
593
+ const ye = async () => {
594
+ if (!z.trim() || j) return;
595
+ ue(!0);
596
+ const e = _.loading("Refining image...", {
626
597
  description: "This may take 10-30 seconds. Please wait."
627
598
  });
628
599
  try {
629
- let r = a.trim();
600
+ let r = z.trim();
630
601
  if (k && k.trim()) {
631
- const ne = k.trim(), rt = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
632
- r = `${ne} with ${rt}`;
633
- } else if (f && f !== "Generated image" && f.trim()) {
634
- const ne = a.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
635
- r = `${f} with ${ne}`;
602
+ const ce = k.trim(), it = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
603
+ r = `${ce} with ${it}`;
604
+ } else if (p && p !== "Generated image" && p.trim()) {
605
+ const ce = z.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim();
606
+ r = `${p} with ${ce}`;
636
607
  }
637
- const c = await _t({
608
+ const y = (await Ot({
638
609
  content: `Generate Image: ${r}`
639
- }), y = c == null ? void 0 : c.data;
610
+ }))?.data;
640
611
  if (!y)
641
612
  throw new Error("Failed to generate image - empty response");
642
- const oe = new DOMParser().parseFromString(y, "text/html").querySelector("img");
643
- if (!oe || !oe.src)
613
+ const ne = new DOMParser().parseFromString(y, "text/html").querySelector("img");
614
+ if (!ne || !ne.src)
644
615
  throw new Error("No image found in response");
645
- const tt = oe.src;
646
- $.dismiss(e), $.success("Image refined successfully!", {
616
+ const rt = ne.src;
617
+ _.dismiss(e), _.success("Image refined successfully!", {
647
618
  description: "Compare the images and choose which to keep."
648
- }), Q(tt), ee(r), Z(!0), H(""), m(!1);
619
+ }), ee(rt), te(r), Z(!0), U(""), d(!1);
649
620
  } catch (r) {
650
- if ($.dismiss(e), r instanceof Ot) {
651
- const c = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
652
- $.error(c, {
653
- description: r.message,
654
- duration: 8e3
655
- });
656
- } else
657
- r instanceof Ht ? $.error("Credits Issue", {
621
+ if (_.dismiss(e), r instanceof Ht) {
622
+ const s = r.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
623
+ _.error(s, {
658
624
  description: r.message,
659
625
  duration: 8e3
660
- }) : $.error("Failed to refine image", {
661
- description: r instanceof Error ? r.message : "Unknown error. Please try again."
662
626
  });
627
+ } else r instanceof Tt ? _.error("Credits Issue", {
628
+ description: r.message,
629
+ duration: 8e3
630
+ }) : _.error("Failed to refine image", {
631
+ description: r instanceof Error ? r.message : "Unknown error. Please try again."
632
+ });
663
633
  } finally {
664
- le(!1);
634
+ ue(!1);
665
635
  }
666
- }, Je = () => {
636
+ }, Ue = () => {
667
637
  n.update(() => {
668
- const e = U(b);
669
- if (F(e)) {
670
- e.setSrc(me), e.setOriginalPrompt(Oe);
671
- const r = J();
672
- r && ce(r.clone());
638
+ const e = J(b);
639
+ if (X(e)) {
640
+ e.setSrc(me), e.setOriginalPrompt(He);
641
+ const r = V();
642
+ r && ae(r.clone());
673
643
  }
674
- }), Z(!1), Q(""), ee(""), $.success("Image replaced successfully!", {
644
+ }), Z(!1), ee(""), te(""), _.success("Image replaced successfully!", {
675
645
  description: "The image has been updated with the refined version."
676
646
  });
677
- }, Ue = () => {
678
- Z(!1), Q(""), ee("");
679
- }, Ze = g && X(O) && !L, ye = (g || L) && C, Qe = () => l === "left" || l === "right" ? {
647
+ }, Ze = () => {
648
+ Z(!1), ee(""), te("");
649
+ }, Qe = m && K(i) && !W, xe = (m || W) && D, et = () => l === "left" || l === "right" ? {
680
650
  position: "relative",
681
651
  display: "block",
682
652
  width: "100%"
@@ -692,55 +662,55 @@ function Sr({
692
662
  } : {
693
663
  position: "relative",
694
664
  display: "inline-block"
695
- }, et = W(
665
+ }, tt = A(
696
666
  (e) => {
697
- if (L || e.target.closest("button"))
667
+ if (W || e.target.closest("button"))
698
668
  return;
699
- const c = e.target === x.current;
669
+ const s = e.target === x.current;
700
670
  let y = !1;
701
- if (!c && x.current) {
671
+ if (!s && x.current) {
702
672
  const w = x.current.getBoundingClientRect();
703
673
  y = e.clientX >= w.left && e.clientX <= w.right && e.clientY >= w.top && e.clientY <= w.bottom;
704
674
  }
705
- !c && !y || (e.stopPropagation(), e.shiftKey ? E(!g) : (_(), E(!0)));
675
+ !s && !y || (e.stopPropagation(), e.shiftKey ? I(!m) : (O(), I(!0)));
706
676
  },
707
- [L, g, E, _]
677
+ [W, m, I, O]
708
678
  );
709
- return /* @__PURE__ */ t(xt, { fallback: null, children: /* @__PURE__ */ h(it, { children: [
679
+ return /* @__PURE__ */ t(wt, { fallback: null, children: /* @__PURE__ */ h(ot, { children: [
710
680
  /* @__PURE__ */ h(
711
681
  "div",
712
682
  {
713
- draggable: Ze,
714
- style: Qe(),
715
- onClick: et,
716
- onMouseEnter: qe,
717
- onMouseLeave: Ve,
683
+ draggable: Qe,
684
+ style: et(),
685
+ onClick: tt,
686
+ onMouseEnter: Ve,
687
+ onMouseLeave: Je,
718
688
  children: [
719
- o ? /* @__PURE__ */ t(Ft, {}) : /* @__PURE__ */ t(
720
- Xt,
689
+ v ? /* @__PURE__ */ t(Gt, {}) : /* @__PURE__ */ t(
690
+ Ft,
721
691
  {
722
- className: ye ? `focused ${X(O) ? "draggable" : ""}` : p ? "cteditor-cursor-pointer" : null,
692
+ className: xe ? `focused ${K(i) ? "draggable" : ""}` : f ? "cteditor-cursor-pointer" : null,
723
693
  src: u,
724
- altText: f,
694
+ altText: p,
725
695
  imageRef: x,
726
696
  width: N,
727
- height: z,
728
- maxWidth: v,
729
- onError: () => D(!0)
697
+ height: S,
698
+ maxWidth: E,
699
+ onError: () => C(!0)
730
700
  }
731
701
  ),
732
- He && p && !g && /* @__PURE__ */ h(
702
+ Te && f && !m && /* @__PURE__ */ h(
733
703
  "div",
734
704
  {
735
705
  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",
736
706
  style: { zIndex: 10 },
737
707
  children: [
738
- /* @__PURE__ */ t(Tt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
739
- /* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: p }),
708
+ /* @__PURE__ */ t(jt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
709
+ /* @__PURE__ */ t("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: f }),
740
710
  /* @__PURE__ */ t(
741
711
  "button",
742
712
  {
743
- onClick: fe,
713
+ onClick: be,
744
714
  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",
745
715
  children: "Open"
746
716
  }
@@ -748,125 +718,125 @@ function Sr({
748
718
  ]
749
719
  }
750
720
  ),
751
- g && X(O) && !o && /* @__PURE__ */ h(
721
+ m && K(i) && !v && /* @__PURE__ */ h(
752
722
  "div",
753
723
  {
754
- className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${je ? "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"}`,
724
+ className: `cteditor-absolute cteditor-flex cteditor-gap-1 z-10 ${Be ? "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"}`,
755
725
  children: [
756
726
  /* @__PURE__ */ h("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: [
757
727
  /* @__PURE__ */ t(
758
728
  "button",
759
729
  {
760
- onClick: (e) => K(e, "left"),
730
+ onClick: (e) => Y(e, "left"),
761
731
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "left" ? "cteditor-bg-accent" : ""}`,
762
732
  "aria-label": "Wrap text left",
763
733
  title: "Wrap text left",
764
- children: /* @__PURE__ */ t(Pt, {})
734
+ children: /* @__PURE__ */ t(Rt, {})
765
735
  }
766
736
  ),
767
737
  /* @__PURE__ */ t(
768
738
  "button",
769
739
  {
770
- onClick: (e) => K(e, "right"),
740
+ onClick: (e) => Y(e, "right"),
771
741
  className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "right" ? "cteditor-bg-accent" : ""}`,
772
742
  "aria-label": "Wrap text right",
773
743
  title: "Wrap text right",
774
- children: /* @__PURE__ */ t(Rt, {})
744
+ children: /* @__PURE__ */ t(Dt, {})
775
745
  }
776
746
  ),
777
747
  /* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
778
748
  /* @__PURE__ */ t(
779
749
  "button",
780
750
  {
781
- onClick: (e) => K(e, "inline-left"),
751
+ onClick: (e) => Y(e, "inline-left"),
782
752
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-left" ? "cteditor-bg-accent" : ""}`,
783
753
  "aria-label": "Align left",
784
754
  title: "Align left (no text wrap)",
785
- children: /* @__PURE__ */ t(Dt, {})
755
+ children: /* @__PURE__ */ t(zt, {})
786
756
  }
787
757
  ),
788
758
  /* @__PURE__ */ t(
789
759
  "button",
790
760
  {
791
- onClick: (e) => K(e, "inline-center"),
761
+ onClick: (e) => Y(e, "inline-center"),
792
762
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-center" || l === "full" ? "cteditor-bg-accent" : ""}`,
793
763
  "aria-label": "Align center",
794
764
  title: "Align center (no text wrap)",
795
- children: /* @__PURE__ */ t(zt, {})
765
+ children: /* @__PURE__ */ t(St, {})
796
766
  }
797
767
  ),
798
768
  /* @__PURE__ */ t(
799
769
  "button",
800
770
  {
801
- onClick: (e) => K(e, "inline-right"),
771
+ onClick: (e) => Y(e, "inline-right"),
802
772
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "inline-right" ? "cteditor-bg-accent" : ""}`,
803
773
  "aria-label": "Align right",
804
774
  title: "Align right (no text wrap)",
805
- children: /* @__PURE__ */ t(St, {})
775
+ children: /* @__PURE__ */ t(Lt, {})
806
776
  }
807
777
  ),
808
778
  /* @__PURE__ */ t("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-border cteditor-mx-0.5" }),
809
779
  /* @__PURE__ */ t(
810
780
  "button",
811
781
  {
812
- onClick: (e) => K(e, "none"),
782
+ onClick: (e) => Y(e, "none"),
813
783
  className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-accent cteditor-transition-colors ${l === "none" ? "cteditor-bg-accent" : ""}`,
814
784
  "aria-label": "Inline",
815
785
  title: "Inline with text",
816
- children: /* @__PURE__ */ t(Lt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
786
+ children: /* @__PURE__ */ t(Wt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
817
787
  }
818
788
  )
819
789
  ] }),
820
- p && /* @__PURE__ */ t(
790
+ f && /* @__PURE__ */ t(
821
791
  "button",
822
792
  {
823
- onClick: fe,
793
+ onClick: be,
824
794
  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",
825
795
  "aria-label": "Visit link",
826
- title: `Visit: ${p}`,
827
- children: /* @__PURE__ */ t(Wt, {})
796
+ title: `Visit: ${f}`,
797
+ children: /* @__PURE__ */ t(At, {})
828
798
  }
829
799
  ),
830
800
  k && /* @__PURE__ */ t(
831
801
  "button",
832
802
  {
833
803
  onClick: (e) => {
834
- e.stopPropagation(), Ge(e);
804
+ e.stopPropagation(), qe(e);
835
805
  },
836
806
  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",
837
807
  "aria-label": "Refine image",
838
808
  title: "Refine image",
839
- children: /* @__PURE__ */ t(At, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
809
+ children: /* @__PURE__ */ t(Mt, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
840
810
  }
841
811
  ),
842
812
  /* @__PURE__ */ t(
843
813
  "button",
844
814
  {
845
815
  onClick: (e) => {
846
- e.stopPropagation(), Xe(e);
816
+ e.stopPropagation(), Fe(e);
847
817
  },
848
818
  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",
849
819
  "aria-label": "Open image in new tab",
850
820
  title: "Open in new tab",
851
- children: /* @__PURE__ */ t(Mt, {})
821
+ children: /* @__PURE__ */ t($t, {})
852
822
  }
853
823
  ),
854
824
  /* @__PURE__ */ t(
855
825
  "button",
856
826
  {
857
827
  onClick: (e) => {
858
- e.stopPropagation(), Fe(e);
828
+ e.stopPropagation(), Ge(e);
859
829
  },
860
830
  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",
861
831
  "aria-label": "Delete image",
862
832
  title: "Delete image",
863
- children: /* @__PURE__ */ t($t, {})
833
+ children: /* @__PURE__ */ t(_t, {})
864
834
  }
865
835
  )
866
836
  ]
867
837
  }
868
838
  ),
869
- P && g && !o && k && /* @__PURE__ */ t(
839
+ g && m && !v && k && /* @__PURE__ */ t(
870
840
  "div",
871
841
  {
872
842
  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",
@@ -880,10 +850,10 @@ function Sr({
880
850
  "input",
881
851
  {
882
852
  type: "text",
883
- value: a,
884
- onChange: (e) => H(e.target.value),
853
+ value: z,
854
+ onChange: (e) => U(e.target.value),
885
855
  onKeyDown: (e) => {
886
- e.stopPropagation(), e.key === "Enter" && a.trim() && !B && be(), e.key === "Escape" && (m(!1), H(""));
856
+ e.stopPropagation(), e.key === "Enter" && z.trim() && !j && ye(), e.key === "Escape" && (d(!1), U(""));
887
857
  },
888
858
  onKeyUp: (e) => {
889
859
  e.stopPropagation();
@@ -893,7 +863,7 @@ function Sr({
893
863
  },
894
864
  placeholder: "e.g., flying birds, golden sunset, stormy clouds...",
895
865
  className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-border cteditor-rounded-md cteditor-bg-background cteditor-text-foreground focus:cteditor-outline-none focus:cteditor-ring-2 focus:cteditor-ring-blue-500",
896
- disabled: B,
866
+ disabled: j,
897
867
  autoFocus: !0
898
868
  }
899
869
  ),
@@ -902,11 +872,11 @@ function Sr({
902
872
  "button",
903
873
  {
904
874
  onClick: (e) => {
905
- e.stopPropagation(), be();
875
+ e.stopPropagation(), ye();
906
876
  },
907
- disabled: B || !a.trim(),
877
+ disabled: j || !z.trim(),
908
878
  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",
909
- children: B ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
879
+ children: j ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
910
880
  /* @__PURE__ */ t("span", { className: "cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2 cteditor-border-white cteditor-border-t-transparent cteditor-rounded-full cteditor-animate-spin" }),
911
881
  "Refining..."
912
882
  ] }) : "Refine Image"
@@ -916,9 +886,9 @@ function Sr({
916
886
  "button",
917
887
  {
918
888
  onClick: (e) => {
919
- e.stopPropagation(), m(!1), H("");
889
+ e.stopPropagation(), d(!1), U("");
920
890
  },
921
- disabled: B,
891
+ disabled: j,
922
892
  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",
923
893
  children: "Cancel"
924
894
  }
@@ -927,24 +897,24 @@ function Sr({
927
897
  ] })
928
898
  }
929
899
  ),
930
- G && X(O) && ye && /* @__PURE__ */ t(
931
- Yt,
900
+ F && K(i) && xe && /* @__PURE__ */ t(
901
+ Kt,
932
902
  {
933
- showCaption: A,
934
- setShowCaption: Be,
903
+ showCaption: M,
904
+ setShowCaption: Ye,
935
905
  editor: n,
936
- buttonRef: q,
906
+ buttonRef: G,
937
907
  imageRef: x,
938
- maxWidth: v,
939
- onResizeStart: Ke,
940
- onResizeEnd: Ye,
941
- captionsEnabled: !o && j
908
+ maxWidth: E,
909
+ onResizeStart: Xe,
910
+ onResizeEnd: Ke,
911
+ captionsEnabled: !v && T
942
912
  }
943
913
  )
944
914
  ]
945
915
  }
946
916
  ),
947
- A && (f.startsWith("Signature by") ? /* @__PURE__ */ t(Bt, { caption: S }) : /* @__PURE__ */ t(
917
+ M && (p.startsWith("Signature by") ? /* @__PURE__ */ t(Yt, { caption: L }) : /* @__PURE__ */ t(
948
918
  "div",
949
919
  {
950
920
  className: "image-caption-container",
@@ -955,61 +925,61 @@ function Sr({
955
925
  ...l === "inline-center" || l === "full" ? { margin: "0 auto" } : l === "inline-right" ? { marginLeft: "auto" } : l === "left" ? { float: "left", clear: "left" } : l === "right" ? { float: "right", clear: "right" } : {}
956
926
  },
957
927
  children: /* @__PURE__ */ h(
958
- Re,
928
+ De,
959
929
  {
960
- initialEditor: S,
930
+ initialEditor: L,
961
931
  initialNodes: [
962
- Se,
963
932
  Le,
964
933
  We,
965
934
  Ae,
935
+ Me,
966
936
  ke,
967
- ve
937
+ Ee
968
938
  ],
969
939
  children: [
970
- /* @__PURE__ */ t(ot, {}),
940
+ /* @__PURE__ */ t(nt, {}),
971
941
  /* @__PURE__ */ t(
972
- ze,
942
+ Se,
973
943
  {
974
944
  contentEditable: /* @__PURE__ */ t(
975
- Ee,
945
+ Ie,
976
946
  {
977
947
  "aria-placeholder": "Enter a caption...",
978
948
  placeholder: () => /* @__PURE__ */ t("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
979
949
  className: "ImageNode__contentEditable"
980
950
  }
981
951
  ),
982
- ErrorBoundary: Ie
952
+ ErrorBoundary: Pe
983
953
  }
984
954
  ),
985
955
  /* @__PURE__ */ t(
986
- De,
956
+ ze,
987
957
  {
988
958
  onChange: () => {
989
959
  }
990
960
  }
991
961
  ),
992
- /* @__PURE__ */ t(Pe, {}),
993
- /* @__PURE__ */ t(Me, { namespace: $e.namespace })
962
+ /* @__PURE__ */ t(Re, {}),
963
+ /* @__PURE__ */ t($e, { namespace: _e.namespace })
994
964
  ]
995
965
  }
996
966
  )
997
967
  }
998
968
  )),
999
969
  /* @__PURE__ */ t(
1000
- jt,
970
+ Bt,
1001
971
  {
1002
- open: _e,
972
+ open: Oe,
1003
973
  onOpenChange: Z,
1004
974
  oldImageUrl: u,
1005
975
  newImageUrl: me,
1006
- onReplace: Je,
1007
- onCancel: Ue
976
+ onReplace: Ue,
977
+ onCancel: Ze
1008
978
  }
1009
979
  )
1010
980
  ] }) });
1011
981
  }
1012
982
  export {
1013
- Ne as RIGHT_CLICK_IMAGE_COMMAND,
1014
- Sr as default
983
+ ve as RIGHT_CLICK_IMAGE_COMMAND,
984
+ gr as default
1015
985
  };