eddyter 1.4.8 → 1.4.9
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.
- package/dist/{ImageResizer-C5luyjPa.js → ImageResizer-BVwxL4Eh.js} +20 -19
- package/dist/assets/style.css +1 -1
- package/dist/{generateDocxThumbnail-Bg1t0PrM.js → generateDocxThumbnail-C-ncaF7K.js} +1 -1
- package/dist/{generatePdfThumbnail-DAlYprsR.js → generatePdfThumbnail-3ltsGn6c.js} +8 -8
- package/dist/{generateXlsxThumbnail-CQTndahy.js → generateXlsxThumbnail-D7WwiJyR.js} +1 -1
- package/dist/{html2pdf.bundle.min-CDGSMyz-.js → html2pdf.bundle.min-clbInSdL.js} +1 -1
- package/dist/{index-BiSbWE5S.js → index-BoaegKBH.js} +43 -36
- package/dist/{index-bcmxAWk7.js → index-C2wTHo-G.js} +54 -52
- package/dist/{index-0q0ojIJJ.js → index-DvjIQ7q3.js} +349 -364
- package/dist/{index-DIH7BtWD.js → index-oIJfc57t.js} +14302 -14136
- package/dist/index.js +1 -1
- package/dist/ui/Icons.d.ts +2 -1
- package/package.json +3 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { jsx as r, jsxs as h, Fragment as Kt } from "react/jsx-runtime";
|
|
2
|
-
import { I as
|
|
3
|
-
import { c as vt,
|
|
4
|
-
import { LinkNode as
|
|
5
|
-
import { AutoFocusPlugin as
|
|
6
|
-
import { useCollaborationContext as
|
|
7
|
-
import { useLexicalComposerContext as
|
|
8
|
-
import { ContentEditable as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { LexicalNestedComposer as
|
|
12
|
-
import { OnChangePlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { useLexicalEditable as
|
|
15
|
-
import { useLexicalNodeSelection as
|
|
16
|
-
import { mergeRegister as
|
|
17
|
-
import {
|
|
18
|
-
import wt, { useState as I, useRef as V, useMemo as
|
|
2
|
+
import { I as Ie } from "./ImageResizer-BVwxL4Eh.js";
|
|
3
|
+
import { c as vt, d as re, e as oe, f as ie, g as ae, h as ne, i as se, B as Gt, C as It, I as Pe, S as Se, u as ze, j as et, t as A, k as Me, l as Ae, L as De, W as Le, m as $e, A as Te, n as We, o as je, p as Ye, q as _e, r as Oe, E as He, s as Fe, X as Xe, M as Be, v as Ue, w as Ke, x as Ge, y as qe, z as Ve } from "./index-oIJfc57t.js";
|
|
4
|
+
import { LinkNode as Je } from "@lexical/link";
|
|
5
|
+
import { AutoFocusPlugin as Qe } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
6
|
+
import { useCollaborationContext as Ze } from "@lexical/react/LexicalCollaborationContext";
|
|
7
|
+
import { useLexicalComposerContext as tr } from "@lexical/react/LexicalComposerContext";
|
|
8
|
+
import { ContentEditable as er } from "@lexical/react/LexicalContentEditable";
|
|
9
|
+
import { LexicalErrorBoundary as rr } from "@lexical/react/LexicalErrorBoundary";
|
|
10
|
+
import { HistoryPlugin as or } from "@lexical/react/LexicalHistoryPlugin";
|
|
11
|
+
import { LexicalNestedComposer as ir } from "@lexical/react/LexicalNestedComposer";
|
|
12
|
+
import { OnChangePlugin as ar } from "@lexical/react/LexicalOnChangePlugin";
|
|
13
|
+
import { RichTextPlugin as nr } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { useLexicalEditable as sr } from "@lexical/react/useLexicalEditable";
|
|
15
|
+
import { useLexicalNodeSelection as dr } from "@lexical/react/useLexicalNodeSelection";
|
|
16
|
+
import { mergeRegister as cr } from "@lexical/utils";
|
|
17
|
+
import { $getRoot as qt, $isNodeSelection as st, $getSelection as dt, $isParagraphNode as Yt, $setSelection as xt, $isRangeSelection as lr, SELECTION_CHANGE_COMMAND as ur, COMMAND_PRIORITY_LOW as rt, CLICK_COMMAND as mr, DRAGSTART_COMMAND as gr, KEY_DELETE_COMMAND as fr, KEY_BACKSPACE_COMMAND as hr, KEY_ENTER_COMMAND as pr, KEY_ESCAPE_COMMAND as br, $getNodeByKey as ct, RootNode as yr, TextNode as xr, LineBreakNode as wr, ParagraphNode as vr, createCommand as Cr } from "lexical";
|
|
18
|
+
import wt, { useState as I, useEffect as J, useRef as V, useMemo as Vt, useCallback as S, useLayoutEffect as Jt, Suspense as Nr } from "react";
|
|
19
19
|
import "react-dom";
|
|
20
|
-
const
|
|
20
|
+
const de = vt("Crop", [
|
|
21
21
|
["path", { d: "M6 2v14a2 2 0 0 0 2 2h14", key: "ron5a4" }],
|
|
22
22
|
["path", { d: "M18 22V8a2 2 0 0 0-2-2H2", key: "7s9ehn" }]
|
|
23
23
|
]);
|
|
24
|
-
const
|
|
24
|
+
const kr = vt("Link2", [
|
|
25
25
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
26
26
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
27
27
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
28
28
|
]);
|
|
29
|
-
const
|
|
29
|
+
const Qt = vt("RectangleHorizontal", [
|
|
30
30
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
|
|
31
31
|
]);
|
|
32
|
-
const
|
|
32
|
+
const Zt = vt("RectangleVertical", [
|
|
33
33
|
["rect", { width: "12", height: "20", x: "6", y: "2", rx: "2", key: "1oxtiu" }]
|
|
34
34
|
]);
|
|
35
|
-
const
|
|
35
|
+
const Rr = vt("RotateCcw", [
|
|
36
36
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
37
37
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
38
|
-
]),
|
|
38
|
+
]), Er = ({
|
|
39
39
|
open: i,
|
|
40
40
|
onOpenChange: o,
|
|
41
41
|
oldImageUrl: e,
|
|
42
42
|
newImageUrl: d,
|
|
43
|
-
onReplace:
|
|
43
|
+
onReplace: v,
|
|
44
44
|
onCancel: w
|
|
45
|
-
}) => /* @__PURE__ */ r(
|
|
46
|
-
/* @__PURE__ */ h(
|
|
47
|
-
/* @__PURE__ */ h(
|
|
45
|
+
}) => /* @__PURE__ */ r(re, { open: i, onOpenChange: o, children: /* @__PURE__ */ h(oe, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
|
|
46
|
+
/* @__PURE__ */ h(ie, { children: [
|
|
47
|
+
/* @__PURE__ */ h(ae, { className: "flex items-center gap-2 text-xl", children: [
|
|
48
48
|
/* @__PURE__ */ r("span", { className: "text-2xl", children: "🔄" }),
|
|
49
49
|
"Compare Images"
|
|
50
50
|
] }),
|
|
51
|
-
/* @__PURE__ */ r(
|
|
51
|
+
/* @__PURE__ */ r(ne, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
|
|
52
52
|
] }),
|
|
53
53
|
/* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
|
|
54
54
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
|
|
@@ -70,7 +70,7 @@ const kr = vt("RotateCcw", [
|
|
|
70
70
|
' Clicking "Replace" will update the image in your document. This action cannot be undone.'
|
|
71
71
|
] }) })
|
|
72
72
|
] }),
|
|
73
|
-
/* @__PURE__ */ h(
|
|
73
|
+
/* @__PURE__ */ h(se, { className: "gap-2", children: [
|
|
74
74
|
/* @__PURE__ */ r(
|
|
75
75
|
Gt,
|
|
76
76
|
{
|
|
@@ -82,7 +82,7 @@ const kr = vt("RotateCcw", [
|
|
|
82
82
|
/* @__PURE__ */ h(
|
|
83
83
|
Gt,
|
|
84
84
|
{
|
|
85
|
-
onClick:
|
|
85
|
+
onClick: v,
|
|
86
86
|
className: "bg-blue-500 hover:bg-blue-600 text-white",
|
|
87
87
|
children: [
|
|
88
88
|
/* @__PURE__ */ r("span", { className: "mr-2", children: "✓" }),
|
|
@@ -92,54 +92,24 @@ const kr = vt("RotateCcw", [
|
|
|
92
92
|
)
|
|
93
93
|
] })
|
|
94
94
|
] }) });
|
|
95
|
-
function
|
|
95
|
+
function Ir({
|
|
96
96
|
caption: i
|
|
97
97
|
}) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */ r(
|
|
112
|
-
pe,
|
|
113
|
-
{
|
|
114
|
-
contentEditable: /* @__PURE__ */ r(
|
|
115
|
-
ue,
|
|
116
|
-
{
|
|
117
|
-
"aria-placeholder": "Enter signature name...",
|
|
118
|
-
placeholder: /* @__PURE__ */ r("div", { style: {
|
|
119
|
-
position: "absolute",
|
|
120
|
-
top: "4px",
|
|
121
|
-
left: "8px",
|
|
122
|
-
right: "8px",
|
|
123
|
-
textAlign: "center",
|
|
124
|
-
pointerEvents: "none",
|
|
125
|
-
color: "hsla(var(--cteditorf47ac10b-foreground) / 0.4)",
|
|
126
|
-
fontStyle: "italic"
|
|
127
|
-
}, children: "Enter signature name..." }),
|
|
128
|
-
className: "signature-caption-editable"
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
ErrorBoundary: me
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ r(he, { onChange: () => {
|
|
135
|
-
} }),
|
|
136
|
-
/* @__PURE__ */ r(ge, {}),
|
|
137
|
-
/* @__PURE__ */ r(de, { namespace: ce.namespace })
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
) });
|
|
98
|
+
const [o, e] = I(""), [d, v] = I("");
|
|
99
|
+
return J(() => ((() => {
|
|
100
|
+
const R = i.getEditorState().read(() => qt().getTextContent()).split(" • ");
|
|
101
|
+
e(R[0] || ""), v(R[1] || "");
|
|
102
|
+
})(), i.registerUpdateListener(({ editorState: z }) => {
|
|
103
|
+
const k = z.read(() => qt().getTextContent()).split(" • ");
|
|
104
|
+
e(k[0] || ""), v(k[1] || "");
|
|
105
|
+
})), [i]), /* @__PURE__ */ r("div", { className: "signature-caption-container", children: /* @__PURE__ */ h("div", { className: "signature-caption-info", children: [
|
|
106
|
+
o && /* @__PURE__ */ r("span", { className: "signature-user-name", children: o }),
|
|
107
|
+
o && d && /* @__PURE__ */ r("span", { className: "signature-separator" }),
|
|
108
|
+
d && /* @__PURE__ */ r("span", { className: "signature-timestamp", children: d }),
|
|
109
|
+
!o && !d && /* @__PURE__ */ r("span", { children: "Signature" })
|
|
110
|
+
] }) });
|
|
141
111
|
}
|
|
142
|
-
const
|
|
112
|
+
const Pr = "/transform-image/";
|
|
143
113
|
function ht(i) {
|
|
144
114
|
if (!It || i.startsWith("data:") || i.toLowerCase().endsWith(".svg"))
|
|
145
115
|
return !1;
|
|
@@ -150,7 +120,7 @@ function ht(i) {
|
|
|
150
120
|
return !1;
|
|
151
121
|
}
|
|
152
122
|
}
|
|
153
|
-
function
|
|
123
|
+
function ce(i) {
|
|
154
124
|
if (!ht(i))
|
|
155
125
|
return null;
|
|
156
126
|
try {
|
|
@@ -160,16 +130,16 @@ function Ce(i) {
|
|
|
160
130
|
return null;
|
|
161
131
|
}
|
|
162
132
|
}
|
|
163
|
-
function
|
|
133
|
+
function Sr(i, o) {
|
|
164
134
|
if (!ht(i))
|
|
165
135
|
return i;
|
|
166
|
-
const e =
|
|
136
|
+
const e = ce(i);
|
|
167
137
|
if (!e)
|
|
168
138
|
return i;
|
|
169
139
|
const d = `${o.x},${o.y},${o.width},${o.height}`;
|
|
170
|
-
return `${It.replace(/\/$/, "")}${
|
|
140
|
+
return `${It.replace(/\/$/, "")}${Pr}${e}?crop=${d}`;
|
|
171
141
|
}
|
|
172
|
-
function
|
|
142
|
+
function te(i) {
|
|
173
143
|
if (!ht(i))
|
|
174
144
|
return i;
|
|
175
145
|
try {
|
|
@@ -181,11 +151,11 @@ function Zt(i) {
|
|
|
181
151
|
}
|
|
182
152
|
function Rt(i) {
|
|
183
153
|
if (!ht(i))
|
|
184
|
-
return
|
|
185
|
-
const o =
|
|
186
|
-
return o ? `${It.replace(/\/$/, "")}/${o}` :
|
|
154
|
+
return te(i);
|
|
155
|
+
const o = ce(i);
|
|
156
|
+
return o ? `${It.replace(/\/$/, "")}/${o}` : te(i);
|
|
187
157
|
}
|
|
188
|
-
function
|
|
158
|
+
function zr(i) {
|
|
189
159
|
if (typeof document > "u")
|
|
190
160
|
return;
|
|
191
161
|
let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
|
|
@@ -193,7 +163,7 @@ function Sr(i) {
|
|
|
193
163
|
}
|
|
194
164
|
Array(12).fill(0);
|
|
195
165
|
let _t = 1;
|
|
196
|
-
class
|
|
166
|
+
class Mr {
|
|
197
167
|
constructor() {
|
|
198
168
|
this.subscribe = (o) => (this.subscribers.push(o), () => {
|
|
199
169
|
const e = this.subscribers.indexOf(o);
|
|
@@ -207,8 +177,8 @@ class zr {
|
|
|
207
177
|
];
|
|
208
178
|
}, this.create = (o) => {
|
|
209
179
|
var e;
|
|
210
|
-
const { message: d, ...
|
|
211
|
-
return this.dismissedToasts.has(w) && this.dismissedToasts.delete(w),
|
|
180
|
+
const { message: d, ...v } = o, w = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : _t++, z = this.toasts.find((k) => k.id === w), R = o.dismissible === void 0 ? !0 : o.dismissible;
|
|
181
|
+
return this.dismissedToasts.has(w) && this.dismissedToasts.delete(w), z ? this.toasts = this.toasts.map((k) => k.id === w ? (this.publish({
|
|
212
182
|
...k,
|
|
213
183
|
...o,
|
|
214
184
|
id: w,
|
|
@@ -217,12 +187,12 @@ class zr {
|
|
|
217
187
|
...k,
|
|
218
188
|
...o,
|
|
219
189
|
id: w,
|
|
220
|
-
dismissible:
|
|
190
|
+
dismissible: R,
|
|
221
191
|
title: d
|
|
222
192
|
}) : k) : this.addToast({
|
|
223
193
|
title: d,
|
|
224
|
-
...
|
|
225
|
-
dismissible:
|
|
194
|
+
...v,
|
|
195
|
+
dismissible: R,
|
|
226
196
|
id: w
|
|
227
197
|
}), w;
|
|
228
198
|
}, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
|
|
@@ -267,60 +237,60 @@ class zr {
|
|
|
267
237
|
message: e.loading,
|
|
268
238
|
description: typeof e.description != "function" ? e.description : void 0
|
|
269
239
|
}));
|
|
270
|
-
const
|
|
271
|
-
let w = d !== void 0,
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
240
|
+
const v = Promise.resolve(o instanceof Function ? o() : o);
|
|
241
|
+
let w = d !== void 0, z;
|
|
242
|
+
const R = v.then(async (C) => {
|
|
243
|
+
if (z = [
|
|
274
244
|
"resolve",
|
|
275
|
-
|
|
276
|
-
], wt.isValidElement(
|
|
245
|
+
C
|
|
246
|
+
], wt.isValidElement(C))
|
|
277
247
|
w = !1, this.create({
|
|
278
248
|
id: d,
|
|
279
249
|
type: "default",
|
|
280
|
-
message:
|
|
250
|
+
message: C
|
|
281
251
|
});
|
|
282
|
-
else if (
|
|
252
|
+
else if (Dr(C) && !C.ok) {
|
|
283
253
|
w = !1;
|
|
284
|
-
const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${
|
|
254
|
+
const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${C.status}`) : e.error, N = typeof e.description == "function" ? await e.description(`HTTP error! status: ${C.status}`) : e.description, L = typeof c == "object" && !wt.isValidElement(c) ? c : {
|
|
285
255
|
message: c
|
|
286
256
|
};
|
|
287
257
|
this.create({
|
|
288
258
|
id: d,
|
|
289
259
|
type: "error",
|
|
290
|
-
description:
|
|
291
|
-
...
|
|
260
|
+
description: N,
|
|
261
|
+
...L
|
|
292
262
|
});
|
|
293
|
-
} else if (
|
|
263
|
+
} else if (C instanceof Error) {
|
|
294
264
|
w = !1;
|
|
295
|
-
const c = typeof e.error == "function" ? await e.error(
|
|
265
|
+
const c = typeof e.error == "function" ? await e.error(C) : e.error, N = typeof e.description == "function" ? await e.description(C) : e.description, L = typeof c == "object" && !wt.isValidElement(c) ? c : {
|
|
296
266
|
message: c
|
|
297
267
|
};
|
|
298
268
|
this.create({
|
|
299
269
|
id: d,
|
|
300
270
|
type: "error",
|
|
301
|
-
description:
|
|
302
|
-
...
|
|
271
|
+
description: N,
|
|
272
|
+
...L
|
|
303
273
|
});
|
|
304
274
|
} else if (e.success !== void 0) {
|
|
305
275
|
w = !1;
|
|
306
|
-
const c = typeof e.success == "function" ? await e.success(
|
|
276
|
+
const c = typeof e.success == "function" ? await e.success(C) : e.success, N = typeof e.description == "function" ? await e.description(C) : e.description, L = typeof c == "object" && !wt.isValidElement(c) ? c : {
|
|
307
277
|
message: c
|
|
308
278
|
};
|
|
309
279
|
this.create({
|
|
310
280
|
id: d,
|
|
311
281
|
type: "success",
|
|
312
|
-
description:
|
|
313
|
-
...
|
|
282
|
+
description: N,
|
|
283
|
+
...L
|
|
314
284
|
});
|
|
315
285
|
}
|
|
316
|
-
}).catch(async (
|
|
317
|
-
if (
|
|
286
|
+
}).catch(async (C) => {
|
|
287
|
+
if (z = [
|
|
318
288
|
"reject",
|
|
319
|
-
|
|
289
|
+
C
|
|
320
290
|
], e.error !== void 0) {
|
|
321
291
|
w = !1;
|
|
322
|
-
const
|
|
323
|
-
message:
|
|
292
|
+
const P = typeof e.error == "function" ? await e.error(C) : e.error, c = typeof e.description == "function" ? await e.description(C) : e.description, y = typeof P == "object" && !wt.isValidElement(P) ? P : {
|
|
293
|
+
message: P
|
|
324
294
|
};
|
|
325
295
|
this.create({
|
|
326
296
|
id: d,
|
|
@@ -331,7 +301,7 @@ class zr {
|
|
|
331
301
|
}
|
|
332
302
|
}).finally(() => {
|
|
333
303
|
w && (this.dismiss(d), d = void 0), e.finally == null || e.finally.call(e);
|
|
334
|
-
}), k = () => new Promise((
|
|
304
|
+
}), k = () => new Promise((C, P) => R.then(() => z[0] === "reject" ? P(z[1]) : C(z[1])).catch(P));
|
|
335
305
|
return typeof d != "string" && typeof d != "number" ? {
|
|
336
306
|
unwrap: k
|
|
337
307
|
} : Object.assign(d, {
|
|
@@ -347,14 +317,14 @@ class zr {
|
|
|
347
317
|
}, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
348
318
|
}
|
|
349
319
|
}
|
|
350
|
-
const Y = new
|
|
320
|
+
const Y = new Mr(), Ar = (i, o) => {
|
|
351
321
|
const e = o?.id || _t++;
|
|
352
322
|
return Y.addToast({
|
|
353
323
|
title: i,
|
|
354
324
|
...o,
|
|
355
325
|
id: e
|
|
356
326
|
}), e;
|
|
357
|
-
},
|
|
327
|
+
}, Dr = (i) => i && typeof i == "object" && "ok" in i && typeof i.ok == "boolean" && "status" in i && typeof i.status == "number", Lr = Ar, $r = () => Y.toasts, Tr = () => Y.getActiveToasts(), Wr = Object.assign(Lr, {
|
|
358
328
|
success: Y.success,
|
|
359
329
|
info: Y.info,
|
|
360
330
|
warning: Y.warning,
|
|
@@ -365,21 +335,21 @@ const Y = new zr(), Mr = (i, o) => {
|
|
|
365
335
|
dismiss: Y.dismiss,
|
|
366
336
|
loading: Y.loading
|
|
367
337
|
}, {
|
|
368
|
-
getHistory:
|
|
369
|
-
getToasts:
|
|
338
|
+
getHistory: $r,
|
|
339
|
+
getToasts: Tr
|
|
370
340
|
});
|
|
371
|
-
Sr("[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
|
|
341
|
+
zr("[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%)}");
|
|
342
|
+
function jr({
|
|
373
343
|
open: i,
|
|
374
344
|
onOpenChange: o,
|
|
375
345
|
src: e,
|
|
376
346
|
altText: d,
|
|
377
|
-
width:
|
|
347
|
+
width: v,
|
|
378
348
|
height: w,
|
|
379
|
-
onCropApply:
|
|
349
|
+
onCropApply: z
|
|
380
350
|
}) {
|
|
381
|
-
const [
|
|
382
|
-
switch (
|
|
351
|
+
const [R, k] = I("freeform"), [C, P] = I(e), [c, N] = I(!1), y = V(null), L = V(null), [n, W] = I({ x: 0, y: 0, width: 0, height: 0 }), [E, $] = I({ x: 0, y: 0, width: 0, height: 0 }), ot = V(null), lt = Vt(() => typeof v == "number" && typeof w == "number" && w > 0 ? v / w : n.width > 0 && n.height > 0 ? n.width / n.height : null, [n.height, n.width, w, v]), pt = Vt(() => {
|
|
352
|
+
switch (R) {
|
|
383
353
|
case "original":
|
|
384
354
|
return lt;
|
|
385
355
|
case "1:1":
|
|
@@ -395,7 +365,7 @@ function Wr({
|
|
|
395
365
|
default:
|
|
396
366
|
return null;
|
|
397
367
|
}
|
|
398
|
-
}, [lt,
|
|
368
|
+
}, [lt, R]), m = 24, j = S(
|
|
399
369
|
(s) => {
|
|
400
370
|
let { x: p, y: b, width: g, height: x } = s;
|
|
401
371
|
const F = n.width, ut = n.height;
|
|
@@ -428,7 +398,7 @@ function Wr({
|
|
|
428
398
|
},
|
|
429
399
|
[n.height, n.width, j]
|
|
430
400
|
), it = S(() => {
|
|
431
|
-
const s = y.current, p =
|
|
401
|
+
const s = y.current, p = L.current;
|
|
432
402
|
if (!s || !p)
|
|
433
403
|
return;
|
|
434
404
|
let b = 0, g = 0, x = p;
|
|
@@ -440,49 +410,49 @@ function Wr({
|
|
|
440
410
|
width: p.offsetWidth,
|
|
441
411
|
height: p.offsetHeight
|
|
442
412
|
});
|
|
443
|
-
}, []),
|
|
413
|
+
}, []), Q = S(
|
|
444
414
|
(s) => {
|
|
445
415
|
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), ot.current = {
|
|
446
416
|
mode: "move",
|
|
447
417
|
startX: s.clientX,
|
|
448
418
|
startY: s.clientY,
|
|
449
|
-
initialRect: { ...
|
|
419
|
+
initialRect: { ...E }
|
|
450
420
|
});
|
|
451
421
|
},
|
|
452
|
-
[n.height, n.width,
|
|
422
|
+
[n.height, n.width, E]
|
|
453
423
|
), Pt = S(
|
|
454
424
|
(s, p) => {
|
|
455
425
|
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), ot.current = {
|
|
456
426
|
mode: p,
|
|
457
427
|
startX: s.clientX,
|
|
458
428
|
startY: s.clientY,
|
|
459
|
-
initialRect: { ...
|
|
429
|
+
initialRect: { ...E }
|
|
460
430
|
});
|
|
461
431
|
},
|
|
462
|
-
[n.height, n.width,
|
|
432
|
+
[n.height, n.width, E]
|
|
463
433
|
), St = S(async () => {
|
|
464
434
|
if (n.width <= 0 || n.height <= 0) {
|
|
465
435
|
o(!1);
|
|
466
436
|
return;
|
|
467
437
|
}
|
|
468
|
-
const s =
|
|
438
|
+
const s = L.current;
|
|
469
439
|
if (!s || !s.naturalWidth || !s.naturalHeight) {
|
|
470
|
-
|
|
440
|
+
Wr.error("Could not read image dimensions");
|
|
471
441
|
return;
|
|
472
442
|
}
|
|
473
443
|
const p = s.naturalWidth / n.width, b = s.naturalHeight / n.height, g = {
|
|
474
|
-
x: Math.max(0, Math.round(
|
|
475
|
-
y: Math.max(0, Math.round(
|
|
476
|
-
width: Math.max(1, Math.round(
|
|
477
|
-
height: Math.max(1, Math.round(
|
|
444
|
+
x: Math.max(0, Math.round(E.x * p)),
|
|
445
|
+
y: Math.max(0, Math.round(E.y * b)),
|
|
446
|
+
width: Math.max(1, Math.round(E.width * p)),
|
|
447
|
+
height: Math.max(1, Math.round(E.height * b)),
|
|
478
448
|
naturalWidth: s.naturalWidth,
|
|
479
449
|
naturalHeight: s.naturalHeight
|
|
480
450
|
};
|
|
481
|
-
g.width = Math.min(g.width, s.naturalWidth - g.x), g.height = Math.min(g.height, s.naturalHeight - g.y), await Promise.resolve(
|
|
482
|
-
}, [n,
|
|
483
|
-
return
|
|
484
|
-
i && (W({ x: 0, y: 0, width: 0, height: 0 }), $({ x: 0, y: 0, width: 0, height: 0 }),
|
|
485
|
-
}, [i, e]),
|
|
451
|
+
g.width = Math.min(g.width, s.naturalWidth - g.x), g.height = Math.min(g.height, s.naturalHeight - g.y), await Promise.resolve(z(g)), o(!1);
|
|
452
|
+
}, [n, E, z, o]);
|
|
453
|
+
return J(() => {
|
|
454
|
+
i && (W({ x: 0, y: 0, width: 0, height: 0 }), $({ x: 0, y: 0, width: 0, height: 0 }), N(!1), P(Rt(e)));
|
|
455
|
+
}, [i, e]), J(() => {
|
|
486
456
|
if (!i)
|
|
487
457
|
return;
|
|
488
458
|
const s = y.current;
|
|
@@ -492,13 +462,13 @@ function Wr({
|
|
|
492
462
|
it();
|
|
493
463
|
});
|
|
494
464
|
p.observe(s);
|
|
495
|
-
const b =
|
|
465
|
+
const b = L.current;
|
|
496
466
|
b && p.observe(b);
|
|
497
467
|
const g = () => it();
|
|
498
468
|
return window.addEventListener("resize", g), () => {
|
|
499
469
|
p.disconnect(), window.removeEventListener("resize", g);
|
|
500
470
|
};
|
|
501
|
-
}, [i, it]),
|
|
471
|
+
}, [i, it]), J(() => {
|
|
502
472
|
if (!i)
|
|
503
473
|
return;
|
|
504
474
|
const s = (b) => {
|
|
@@ -506,7 +476,7 @@ function Wr({
|
|
|
506
476
|
if (!g)
|
|
507
477
|
return;
|
|
508
478
|
b.preventDefault();
|
|
509
|
-
const x = b.clientX - g.startX, F = b.clientY - g.startY, ut = n.width, mt = n.height,
|
|
479
|
+
const x = b.clientX - g.startX, F = b.clientY - g.startY, ut = n.width, mt = n.height, Z = pt ?? null, { x: K, y: at, width: _, height: G } = g.initialRect;
|
|
510
480
|
if (g.mode === "move") {
|
|
511
481
|
const gt = Math.max(0, ut - _), Ct = Math.max(0, mt - G);
|
|
512
482
|
$(
|
|
@@ -519,9 +489,9 @@ function Wr({
|
|
|
519
489
|
);
|
|
520
490
|
return;
|
|
521
491
|
}
|
|
522
|
-
const
|
|
523
|
-
let O = K,
|
|
524
|
-
|
|
492
|
+
const D = g.mode;
|
|
493
|
+
let O = K, tt = at, X = _, B = G;
|
|
494
|
+
D.includes("e") && (X = _ + x), D.includes("w") && (O = K + x, X = _ - x), D.includes("s") && (B = G + F), D.includes("n") && (tt = at + F, B = G - F), Z != null && Z > 0 && (D === "e" || D === "w" ? (B = X / Z, D.includes("n") && (tt = at + G - B)) : D === "n" || D === "s" ? (X = B * Z, D.includes("w") && (O = K + _ - X)) : (B = X / Z, D.includes("n") && (tt = at + G - B), D.includes("w") && (O = K + _ - X))), $(j({ x: O, y: tt, width: X, height: B }));
|
|
525
495
|
}, p = () => {
|
|
526
496
|
ot.current = null;
|
|
527
497
|
};
|
|
@@ -534,10 +504,10 @@ function Wr({
|
|
|
534
504
|
n.height,
|
|
535
505
|
pt,
|
|
536
506
|
j
|
|
537
|
-
]),
|
|
507
|
+
]), J(() => {
|
|
538
508
|
i && bt(pt);
|
|
539
|
-
}, [i, pt, n, bt]), /* @__PURE__ */ r(
|
|
540
|
-
|
|
509
|
+
}, [i, pt, n, bt]), /* @__PURE__ */ r(re, { open: i, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
510
|
+
oe,
|
|
541
511
|
{
|
|
542
512
|
className: "sm:cteditor-max-w-[860px] cteditor-max-w-[calc(100%-2rem)] cteditor-rounded-xl cteditor-overflow-hidden cteditor-p-0",
|
|
543
513
|
onClick: (s) => s.stopPropagation(),
|
|
@@ -552,16 +522,16 @@ function Wr({
|
|
|
552
522
|
/* @__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
523
|
"img",
|
|
554
524
|
{
|
|
555
|
-
ref:
|
|
556
|
-
src:
|
|
525
|
+
ref: L,
|
|
526
|
+
src: C,
|
|
557
527
|
alt: d || "Crop preview",
|
|
558
528
|
className: "cteditor-max-w-full cteditor-max-h-[460px] cteditor-w-auto cteditor-h-auto cteditor-select-none cteditor-block",
|
|
559
529
|
draggable: !1,
|
|
560
530
|
onLoad: () => {
|
|
561
|
-
|
|
531
|
+
N(!1), it();
|
|
562
532
|
},
|
|
563
533
|
onError: () => {
|
|
564
|
-
|
|
534
|
+
N(!0);
|
|
565
535
|
}
|
|
566
536
|
}
|
|
567
537
|
) }),
|
|
@@ -570,10 +540,10 @@ function Wr({
|
|
|
570
540
|
{
|
|
571
541
|
className: "cteditor-absolute cteditor-border-2 cteditor-border-blue-500 cteditor-cursor-move cteditor-select-none",
|
|
572
542
|
style: {
|
|
573
|
-
left: n.x +
|
|
574
|
-
top: n.y +
|
|
575
|
-
width:
|
|
576
|
-
height:
|
|
543
|
+
left: n.x + E.x,
|
|
544
|
+
top: n.y + E.y,
|
|
545
|
+
width: E.width,
|
|
546
|
+
height: E.height
|
|
577
547
|
},
|
|
578
548
|
children: [
|
|
579
549
|
/* @__PURE__ */ r(
|
|
@@ -594,7 +564,7 @@ function Wr({
|
|
|
594
564
|
"div",
|
|
595
565
|
{
|
|
596
566
|
className: "cteditor-absolute cteditor-inset-0 cteditor-pointer-events-auto",
|
|
597
|
-
onPointerDown:
|
|
567
|
+
onPointerDown: Q,
|
|
598
568
|
"aria-label": "Move crop area"
|
|
599
569
|
}
|
|
600
570
|
),
|
|
@@ -623,23 +593,23 @@ function Wr({
|
|
|
623
593
|
}
|
|
624
594
|
) }),
|
|
625
595
|
/* @__PURE__ */ h("div", { className: "cteditor-p-4 md:cteditor-p-5 cteditor-border-l cteditor-border-border cteditor-bg-background", children: [
|
|
626
|
-
/* @__PURE__ */ h(
|
|
627
|
-
/* @__PURE__ */ r(
|
|
628
|
-
/* @__PURE__ */ r(
|
|
596
|
+
/* @__PURE__ */ h(ie, { className: "cteditor-mb-4 cteditor-space-y-1", children: [
|
|
597
|
+
/* @__PURE__ */ r(ae, { children: "Crop" }),
|
|
598
|
+
/* @__PURE__ */ r(ne, { children: "Choose an aspect ratio and adjust the crop area, then click Apply." })
|
|
629
599
|
] }),
|
|
630
600
|
/* @__PURE__ */ h("div", { className: "cteditor-space-y-4", children: [
|
|
631
601
|
/* @__PURE__ */ h("div", { children: [
|
|
632
602
|
/* @__PURE__ */ r("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-mb-2", children: "Aspect ratio" }),
|
|
633
603
|
/* @__PURE__ */ r("div", { className: "cteditor-grid cteditor-grid-cols-3 cteditor-gap-2", children: [
|
|
634
|
-
{ id: "freeform", label: "Freeform", icon:
|
|
635
|
-
{ id: "original", label: "Original", icon:
|
|
636
|
-
{ id: "1:1", label: "1:1", icon:
|
|
637
|
-
{ id: "4:3", label: "4:3", icon:
|
|
638
|
-
{ id: "16:9", label: "16:9", icon:
|
|
639
|
-
{ id: "3:4", label: "3:4", icon:
|
|
640
|
-
{ id: "9:16", label: "9:16", icon:
|
|
604
|
+
{ id: "freeform", label: "Freeform", icon: de },
|
|
605
|
+
{ id: "original", label: "Original", icon: Pe },
|
|
606
|
+
{ id: "1:1", label: "1:1", icon: Se },
|
|
607
|
+
{ id: "4:3", label: "4:3", icon: Qt },
|
|
608
|
+
{ id: "16:9", label: "16:9", icon: Qt },
|
|
609
|
+
{ id: "3:4", label: "3:4", icon: Zt },
|
|
610
|
+
{ id: "9:16", label: "9:16", icon: Zt }
|
|
641
611
|
].map((s) => {
|
|
642
|
-
const p = s.icon, b =
|
|
612
|
+
const p = s.icon, b = R === s.id;
|
|
643
613
|
return /* @__PURE__ */ h(
|
|
644
614
|
"button",
|
|
645
615
|
{
|
|
@@ -661,19 +631,19 @@ function Wr({
|
|
|
661
631
|
/* @__PURE__ */ h("div", { children: [
|
|
662
632
|
/* @__PURE__ */ r("p", { className: "cteditor-text-xs cteditor-text-muted-foreground cteditor-mb-0.5", children: "Crop size" }),
|
|
663
633
|
/* @__PURE__ */ h("p", { className: "cteditor-text-sm cteditor-font-medium", children: [
|
|
664
|
-
Math.round(
|
|
634
|
+
Math.round(E.width),
|
|
665
635
|
" × ",
|
|
666
|
-
Math.round(
|
|
636
|
+
Math.round(E.height),
|
|
667
637
|
" px"
|
|
668
638
|
] })
|
|
669
639
|
] }),
|
|
670
640
|
/* @__PURE__ */ h("div", { children: [
|
|
671
641
|
/* @__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:
|
|
642
|
+
/* @__PURE__ */ r("p", { className: "cteditor-text-sm", children: R === "freeform" ? "Free" : R === "original" ? "Original" : R })
|
|
673
643
|
] })
|
|
674
644
|
] })
|
|
675
645
|
] }),
|
|
676
|
-
/* @__PURE__ */ h(
|
|
646
|
+
/* @__PURE__ */ h(se, { className: "cteditor-gap-2 cteditor-mt-4", children: [
|
|
677
647
|
/* @__PURE__ */ r(
|
|
678
648
|
"button",
|
|
679
649
|
{
|
|
@@ -709,8 +679,8 @@ function Wr({
|
|
|
709
679
|
}
|
|
710
680
|
) });
|
|
711
681
|
}
|
|
712
|
-
const Et = /* @__PURE__ */ new Set(),
|
|
713
|
-
function
|
|
682
|
+
const Et = /* @__PURE__ */ new Set(), ee = Cr("RIGHT_CLICK_IMAGE_COMMAND");
|
|
683
|
+
function Yr(i) {
|
|
714
684
|
if (!Et.has(i))
|
|
715
685
|
throw new Promise((o) => {
|
|
716
686
|
const e = new Image();
|
|
@@ -721,19 +691,19 @@ function jr(i) {
|
|
|
721
691
|
};
|
|
722
692
|
});
|
|
723
693
|
}
|
|
724
|
-
function
|
|
694
|
+
function _r({
|
|
725
695
|
altText: i,
|
|
726
696
|
className: o,
|
|
727
697
|
imageRef: e,
|
|
728
698
|
src: d,
|
|
729
|
-
width:
|
|
699
|
+
width: v,
|
|
730
700
|
height: w,
|
|
731
|
-
maxWidth:
|
|
732
|
-
onError:
|
|
701
|
+
maxWidth: z,
|
|
702
|
+
onError: R,
|
|
733
703
|
onLoad: k
|
|
734
704
|
}) {
|
|
735
|
-
|
|
736
|
-
const
|
|
705
|
+
Yr(d);
|
|
706
|
+
const C = typeof v == "number", P = typeof w == "number", c = C && P, N = C ? v : "auto", y = P ? w : "auto";
|
|
737
707
|
return /* @__PURE__ */ r(
|
|
738
708
|
"img",
|
|
739
709
|
{
|
|
@@ -742,17 +712,17 @@ function Yr({
|
|
|
742
712
|
alt: i,
|
|
743
713
|
ref: e,
|
|
744
714
|
style: c ? {
|
|
745
|
-
width:
|
|
715
|
+
width: N,
|
|
746
716
|
height: "auto",
|
|
747
|
-
aspectRatio: `${
|
|
717
|
+
aspectRatio: `${N} / ${y}`,
|
|
748
718
|
maxWidth: "100%"
|
|
749
|
-
} :
|
|
719
|
+
} : C ? {
|
|
750
720
|
// Only width known (e.g. bogus height stripped from source HTML):
|
|
751
721
|
// fix the width and let the browser compute height naturally.
|
|
752
|
-
width:
|
|
722
|
+
width: N,
|
|
753
723
|
height: "auto",
|
|
754
724
|
maxWidth: "100%"
|
|
755
|
-
} :
|
|
725
|
+
} : P ? {
|
|
756
726
|
// Only height known: fix height, let browser compute width.
|
|
757
727
|
width: "auto",
|
|
758
728
|
height: y,
|
|
@@ -761,13 +731,13 @@ function Yr({
|
|
|
761
731
|
// No dimensions specified - use original image size.
|
|
762
732
|
height: "auto"
|
|
763
733
|
},
|
|
764
|
-
onError:
|
|
734
|
+
onError: R,
|
|
765
735
|
onLoad: k,
|
|
766
736
|
draggable: "false"
|
|
767
737
|
}
|
|
768
738
|
);
|
|
769
739
|
}
|
|
770
|
-
function
|
|
740
|
+
function Or() {
|
|
771
741
|
return /* @__PURE__ */ r(
|
|
772
742
|
"img",
|
|
773
743
|
{
|
|
@@ -781,24 +751,24 @@ function _r() {
|
|
|
781
751
|
}
|
|
782
752
|
);
|
|
783
753
|
}
|
|
784
|
-
function
|
|
754
|
+
function co({
|
|
785
755
|
src: i,
|
|
786
756
|
altText: o,
|
|
787
757
|
nodeKey: e,
|
|
788
758
|
width: d,
|
|
789
|
-
height:
|
|
759
|
+
height: v,
|
|
790
760
|
maxWidth: w,
|
|
791
|
-
resizable:
|
|
792
|
-
showCaption:
|
|
761
|
+
resizable: z,
|
|
762
|
+
showCaption: R,
|
|
793
763
|
caption: k,
|
|
794
|
-
captionsEnabled:
|
|
795
|
-
originalPrompt:
|
|
764
|
+
captionsEnabled: C,
|
|
765
|
+
originalPrompt: P,
|
|
796
766
|
position: c = "none",
|
|
797
|
-
linkUrl:
|
|
767
|
+
linkUrl: N
|
|
798
768
|
}) {
|
|
799
|
-
const y = V(null),
|
|
800
|
-
|
|
801
|
-
if (!n || !st(j) ||
|
|
769
|
+
const y = V(null), L = V(null), [n, W, E] = dr(e), [$, ot] = I(!1), lt = V(!1), { isCollabActive: pt } = Ze(), [m] = tr(), [j, bt] = I(null), it = V(null), [Q, Pt] = I(!1), St = sr(), [s, p] = I(!1), [b, g] = I(""), [x, F] = I(!1), [ut, mt] = I(!1), [Z, K] = I(""), [at, _] = I(""), [G, D] = I(!1), O = V(null), [tt, X] = I(0), [B, gt] = I(!1), Ct = V(null), [le, yt] = I(null), [zt, Mt] = I(!1), Nt = ze()?.apiKey, At = tt > 0 && tt < 350;
|
|
770
|
+
Jt(() => {
|
|
771
|
+
if (!n || !st(j) || Q) {
|
|
802
772
|
yt(null);
|
|
803
773
|
return;
|
|
804
774
|
}
|
|
@@ -807,7 +777,7 @@ function so({
|
|
|
807
777
|
yt(null);
|
|
808
778
|
return;
|
|
809
779
|
}
|
|
810
|
-
const u = a.getBoundingClientRect(), f = l.getBoundingClientRect(),
|
|
780
|
+
const u = a.getBoundingClientRect(), f = l.getBoundingClientRect(), M = t.getBoundingClientRect(), T = 8, H = M.width;
|
|
811
781
|
if (H <= 0) {
|
|
812
782
|
yt(null);
|
|
813
783
|
return;
|
|
@@ -828,7 +798,7 @@ function so({
|
|
|
828
798
|
right: "auto"
|
|
829
799
|
});
|
|
830
800
|
}
|
|
831
|
-
}, [n, j,
|
|
801
|
+
}, [n, j, Q, At, m, tt]), J(() => {
|
|
832
802
|
if (y.current) {
|
|
833
803
|
const t = () => {
|
|
834
804
|
lt.current || y.current && X(y.current.offsetWidth);
|
|
@@ -837,7 +807,7 @@ function so({
|
|
|
837
807
|
const a = new ResizeObserver(t);
|
|
838
808
|
return a.observe(y.current), () => a.disconnect();
|
|
839
809
|
}
|
|
840
|
-
}, [d,
|
|
810
|
+
}, [d, v, n]), Jt(() => {
|
|
841
811
|
if ((c === "left" || c === "right") && typeof d == "number" && y.current) {
|
|
842
812
|
const t = y.current.closest(".editor-image"), a = t?.parentElement, l = m.getRootElement(), u = l ? l.getBoundingClientRect().width : d + 32, f = `${Math.min(d + 32, u)}px`;
|
|
843
813
|
return t && (t.style.removeProperty("display"), t.style.setProperty("max-width", f, "important")), a && a.style.setProperty("max-width", f, "important"), () => {
|
|
@@ -850,7 +820,7 @@ function so({
|
|
|
850
820
|
const a = dt();
|
|
851
821
|
return n && st(a) && (t.preventDefault(), m.update(() => {
|
|
852
822
|
a.getNodes().forEach((u) => {
|
|
853
|
-
if (
|
|
823
|
+
if (et(u)) {
|
|
854
824
|
const f = u.getParent();
|
|
855
825
|
u.remove(), f && Yt(f) && f.getChildrenSize() === 0 && f.setFormat("left");
|
|
856
826
|
}
|
|
@@ -860,18 +830,18 @@ function so({
|
|
|
860
830
|
[m, n]
|
|
861
831
|
), Ot = S(
|
|
862
832
|
(t) => {
|
|
863
|
-
const a = dt(), l =
|
|
833
|
+
const a = dt(), l = L.current;
|
|
864
834
|
if (n && st(a) && a.getNodes().length === 1) {
|
|
865
|
-
if (
|
|
835
|
+
if (R)
|
|
866
836
|
return xt(null), t.preventDefault(), k.focus(), !0;
|
|
867
837
|
if (l !== null && l !== document.activeElement)
|
|
868
838
|
return t.preventDefault(), l.focus(), !0;
|
|
869
839
|
}
|
|
870
840
|
return !1;
|
|
871
841
|
},
|
|
872
|
-
[k, n,
|
|
842
|
+
[k, n, R]
|
|
873
843
|
), Ht = S(
|
|
874
|
-
(t) => it.current === k ||
|
|
844
|
+
(t) => it.current === k || L.current === t.target ? (xt(null), m.update(() => {
|
|
875
845
|
W(!0);
|
|
876
846
|
const a = m.getRootElement();
|
|
877
847
|
a !== null && a.focus();
|
|
@@ -888,72 +858,72 @@ function so({
|
|
|
888
858
|
const u = l === y.current;
|
|
889
859
|
let f = !1;
|
|
890
860
|
if (!u && y.current) {
|
|
891
|
-
const
|
|
892
|
-
f = a.clientX >=
|
|
861
|
+
const M = y.current.getBoundingClientRect();
|
|
862
|
+
f = a.clientX >= M.left && a.clientX <= M.right && a.clientY >= M.top && a.clientY <= M.bottom;
|
|
893
863
|
}
|
|
894
|
-
return u || f ? (a.shiftKey ? W(!n) : (
|
|
864
|
+
return u || f ? (a.shiftKey ? W(!n) : (E(), W(!0)), !0) : !1;
|
|
895
865
|
},
|
|
896
|
-
[$, n, W,
|
|
866
|
+
[$, n, W, E]
|
|
897
867
|
), $t = S(
|
|
898
868
|
(t) => {
|
|
899
869
|
m.getEditorState().read(() => {
|
|
900
870
|
const a = dt();
|
|
901
|
-
t.target.tagName === "IMG" &&
|
|
902
|
-
|
|
871
|
+
t.target.tagName === "IMG" && lr(a) && a.getNodes().length === 1 && m.dispatchCommand(
|
|
872
|
+
ee,
|
|
903
873
|
t
|
|
904
874
|
);
|
|
905
875
|
});
|
|
906
876
|
},
|
|
907
877
|
[m]
|
|
908
878
|
);
|
|
909
|
-
|
|
879
|
+
J(() => {
|
|
910
880
|
let t = !0;
|
|
911
|
-
const a = m.getRootElement(), l =
|
|
881
|
+
const a = m.getRootElement(), l = cr(
|
|
912
882
|
m.registerUpdateListener(({ editorState: u }) => {
|
|
913
883
|
t && bt(u.read(() => dt()));
|
|
914
884
|
}),
|
|
915
885
|
m.registerCommand(
|
|
916
|
-
|
|
886
|
+
ur,
|
|
917
887
|
(u, f) => (it.current = f, !1),
|
|
918
|
-
|
|
888
|
+
rt
|
|
919
889
|
),
|
|
920
890
|
m.registerCommand(
|
|
921
|
-
|
|
891
|
+
mr,
|
|
922
892
|
Lt,
|
|
923
|
-
|
|
893
|
+
rt
|
|
924
894
|
),
|
|
925
895
|
m.registerCommand(
|
|
926
|
-
|
|
896
|
+
ee,
|
|
927
897
|
Lt,
|
|
928
|
-
|
|
898
|
+
rt
|
|
929
899
|
),
|
|
930
900
|
m.registerCommand(
|
|
931
|
-
|
|
901
|
+
gr,
|
|
932
902
|
(u) => u.target === y.current ? (u.preventDefault(), !0) : !1,
|
|
933
|
-
|
|
903
|
+
rt
|
|
934
904
|
),
|
|
935
905
|
m.registerCommand(
|
|
936
|
-
|
|
906
|
+
fr,
|
|
937
907
|
Dt,
|
|
938
|
-
|
|
908
|
+
rt
|
|
939
909
|
),
|
|
940
910
|
m.registerCommand(
|
|
941
|
-
|
|
911
|
+
hr,
|
|
942
912
|
Dt,
|
|
943
|
-
|
|
913
|
+
rt
|
|
944
914
|
),
|
|
945
|
-
m.registerCommand(
|
|
915
|
+
m.registerCommand(pr, Ot, rt),
|
|
946
916
|
m.registerCommand(
|
|
947
|
-
|
|
917
|
+
br,
|
|
948
918
|
Ht,
|
|
949
|
-
|
|
919
|
+
rt
|
|
950
920
|
)
|
|
951
921
|
);
|
|
952
922
|
return a?.addEventListener("contextmenu", $t), () => {
|
|
953
923
|
t = !1, l(), a?.removeEventListener("contextmenu", $t);
|
|
954
924
|
};
|
|
955
925
|
}, [
|
|
956
|
-
|
|
926
|
+
E,
|
|
957
927
|
m,
|
|
958
928
|
$,
|
|
959
929
|
n,
|
|
@@ -965,21 +935,21 @@ function so({
|
|
|
965
935
|
$t,
|
|
966
936
|
W
|
|
967
937
|
]);
|
|
968
|
-
const
|
|
938
|
+
const ue = () => {
|
|
969
939
|
m.update(() => {
|
|
970
940
|
const t = ct(e);
|
|
971
|
-
|
|
941
|
+
et(t) && t.setShowCaption(!0);
|
|
972
942
|
});
|
|
973
|
-
},
|
|
943
|
+
}, me = (t, a) => {
|
|
974
944
|
lt.current = !1, setTimeout(() => {
|
|
975
945
|
ot(!1);
|
|
976
946
|
}, 200), m.update(() => {
|
|
977
947
|
const l = ct(e);
|
|
978
|
-
|
|
948
|
+
et(l) && l.setWidthAndHeight(t, a);
|
|
979
949
|
});
|
|
980
|
-
},
|
|
950
|
+
}, ge = () => {
|
|
981
951
|
lt.current = !0, ot(!0);
|
|
982
|
-
},
|
|
952
|
+
}, fe = (t) => {
|
|
983
953
|
if (t.preventDefault(), t.stopPropagation(), i.startsWith("data:")) {
|
|
984
954
|
const a = window.open("", "_blank");
|
|
985
955
|
a && (a.document.write(`
|
|
@@ -1010,10 +980,10 @@ function so({
|
|
|
1010
980
|
`), a.document.close());
|
|
1011
981
|
} else
|
|
1012
982
|
window.open(i, "_blank");
|
|
1013
|
-
},
|
|
983
|
+
}, he = (t) => {
|
|
1014
984
|
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1015
985
|
const a = ct(e);
|
|
1016
|
-
if (
|
|
986
|
+
if (et(a)) {
|
|
1017
987
|
const l = a.getParent();
|
|
1018
988
|
a.remove(), l && Yt(l) && l.getChildrenSize() === 0 && l.setFormat("left");
|
|
1019
989
|
}
|
|
@@ -1021,28 +991,28 @@ function so({
|
|
|
1021
991
|
}, ft = (t, a) => {
|
|
1022
992
|
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1023
993
|
const l = ct(e);
|
|
1024
|
-
if (
|
|
994
|
+
if (et(l)) {
|
|
1025
995
|
l.setPosition(a);
|
|
1026
996
|
const u = l.getParent();
|
|
1027
997
|
u && Yt(u) && (a === "left" ? u.setFormat("left") : a === "right" ? u.setFormat("right") : u.setFormat(""));
|
|
1028
998
|
}
|
|
1029
999
|
});
|
|
1030
|
-
},
|
|
1000
|
+
}, pe = (t) => {
|
|
1031
1001
|
t.preventDefault(), t.stopPropagation(), p(!s);
|
|
1032
|
-
},
|
|
1002
|
+
}, be = S((t) => {
|
|
1033
1003
|
t.preventDefault(), t.stopPropagation(), gt(!0);
|
|
1034
|
-
}, []),
|
|
1004
|
+
}, []), ye = S(
|
|
1035
1005
|
(t) => {
|
|
1036
1006
|
t.preventDefault(), t.stopPropagation();
|
|
1037
1007
|
const a = Rt(i);
|
|
1038
|
-
if (!(ht(i) && i !== a) && !(typeof d == "number" || typeof
|
|
1008
|
+
if (!(ht(i) && i !== a) && !(typeof d == "number" || typeof v == "number"))
|
|
1039
1009
|
return;
|
|
1040
1010
|
m.update(
|
|
1041
1011
|
() => {
|
|
1042
|
-
const
|
|
1043
|
-
if (!
|
|
1012
|
+
const M = ct(e);
|
|
1013
|
+
if (!et(M))
|
|
1044
1014
|
return;
|
|
1045
|
-
|
|
1015
|
+
M.setSrc(a), M.setWidthAndHeight("inherit", "inherit");
|
|
1046
1016
|
const T = dt();
|
|
1047
1017
|
T && xt(T.clone());
|
|
1048
1018
|
},
|
|
@@ -1051,65 +1021,65 @@ function so({
|
|
|
1051
1021
|
const f = y.current;
|
|
1052
1022
|
f && requestAnimationFrame(() => {
|
|
1053
1023
|
f.src = a, f.style.removeProperty("width"), f.style.removeProperty("height");
|
|
1054
|
-
}),
|
|
1024
|
+
}), A.success("Image reset to original size and crop");
|
|
1055
1025
|
},
|
|
1056
|
-
[m, e, i, d,
|
|
1057
|
-
),
|
|
1026
|
+
[m, e, i, d, v]
|
|
1027
|
+
), xe = S(
|
|
1058
1028
|
async (t) => {
|
|
1059
1029
|
let a = i;
|
|
1060
1030
|
if (ht(i))
|
|
1061
1031
|
a = Rt(i);
|
|
1062
1032
|
else {
|
|
1063
1033
|
if (!Nt) {
|
|
1064
|
-
|
|
1034
|
+
A.error("API key is required to upload and crop external images.");
|
|
1065
1035
|
return;
|
|
1066
1036
|
}
|
|
1067
|
-
const u =
|
|
1037
|
+
const u = A.loading("Uploading image…");
|
|
1068
1038
|
try {
|
|
1069
|
-
a = (await
|
|
1070
|
-
|
|
1039
|
+
a = (await Me.post(
|
|
1040
|
+
Ae.project.fileUploadFromUrl,
|
|
1071
1041
|
{ url: i, prefix: "uploads" },
|
|
1072
1042
|
{ headers: { "x-api-key": Nt } }
|
|
1073
|
-
)).data.fileUrl,
|
|
1043
|
+
)).data.fileUrl, A.dismiss(u);
|
|
1074
1044
|
} catch {
|
|
1075
|
-
|
|
1045
|
+
A.dismiss(u), A.error("Failed to upload image. Try again.");
|
|
1076
1046
|
return;
|
|
1077
1047
|
}
|
|
1078
1048
|
}
|
|
1079
|
-
const l =
|
|
1049
|
+
const l = Sr(a, t);
|
|
1080
1050
|
if (l === a) {
|
|
1081
|
-
|
|
1051
|
+
A.error("Cropping is only supported for images hosted on the CDN.");
|
|
1082
1052
|
return;
|
|
1083
1053
|
}
|
|
1084
1054
|
Mt(!0), m.update(() => {
|
|
1085
1055
|
const u = ct(e);
|
|
1086
|
-
if (!
|
|
1056
|
+
if (!et(u))
|
|
1087
1057
|
return;
|
|
1088
1058
|
u.setSrc(l), u.setWidthAndHeight(t.width, t.height);
|
|
1089
1059
|
const f = dt();
|
|
1090
1060
|
f && xt(f.clone());
|
|
1091
|
-
}),
|
|
1061
|
+
}), A.success("Image cropped");
|
|
1092
1062
|
},
|
|
1093
1063
|
[m, e, i, Nt]
|
|
1094
|
-
),
|
|
1095
|
-
|
|
1096
|
-
|
|
1064
|
+
), we = S(() => {
|
|
1065
|
+
N && !n && (O.current = setTimeout(() => {
|
|
1066
|
+
D(!0);
|
|
1097
1067
|
}, 300));
|
|
1098
|
-
}, [
|
|
1099
|
-
O.current && (clearTimeout(O.current), O.current = null),
|
|
1068
|
+
}, [N, n]), ve = S(() => {
|
|
1069
|
+
O.current && (clearTimeout(O.current), O.current = null), D(!1);
|
|
1100
1070
|
}, []), Ft = S((t) => {
|
|
1101
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1102
|
-
}, [
|
|
1103
|
-
|
|
1071
|
+
t.preventDefault(), t.stopPropagation(), N && window.open(N, "_blank", "noopener,noreferrer");
|
|
1072
|
+
}, [N]);
|
|
1073
|
+
J(() => () => {
|
|
1104
1074
|
O.current && clearTimeout(O.current);
|
|
1105
|
-
}, []),
|
|
1075
|
+
}, []), J(() => {
|
|
1106
1076
|
n || gt(!1);
|
|
1107
1077
|
}, [n]);
|
|
1108
1078
|
const Xt = async () => {
|
|
1109
1079
|
if (!b.trim() || x)
|
|
1110
1080
|
return;
|
|
1111
1081
|
F(!0);
|
|
1112
|
-
const t =
|
|
1082
|
+
const t = A.loading("Refining image...", {
|
|
1113
1083
|
description: "This may take 10-30 seconds. Please wait."
|
|
1114
1084
|
});
|
|
1115
1085
|
try {
|
|
@@ -1134,14 +1104,14 @@ function so({
|
|
|
1134
1104
|
"include pictures"
|
|
1135
1105
|
].some((kt) => Wt.includes(kt));
|
|
1136
1106
|
};
|
|
1137
|
-
let
|
|
1138
|
-
if (
|
|
1139
|
-
const U =
|
|
1140
|
-
f(U) && o && o !== "Generated image" && o.trim() ?
|
|
1107
|
+
let M = "";
|
|
1108
|
+
if (P && P.trim()) {
|
|
1109
|
+
const U = P.trim();
|
|
1110
|
+
f(U) && o && o !== "Generated image" && o.trim() ? M = o.trim() : M = U;
|
|
1141
1111
|
} else
|
|
1142
|
-
o && o !== "Generated image" && o.trim() && (
|
|
1143
|
-
|
|
1144
|
-
const T = await fetch(`${
|
|
1112
|
+
o && o !== "Generated image" && o.trim() && (M = o.trim());
|
|
1113
|
+
M ? a = `${M} with ${u}` : a = u;
|
|
1114
|
+
const T = await fetch(`${Ge}/agent/stream`, {
|
|
1145
1115
|
method: "POST",
|
|
1146
1116
|
headers: { "Content-Type": "application/json" },
|
|
1147
1117
|
body: JSON.stringify({
|
|
@@ -1189,40 +1159,40 @@ function so({
|
|
|
1189
1159
|
}
|
|
1190
1160
|
if (!nt)
|
|
1191
1161
|
throw new Error("Failed to generate image - no image received");
|
|
1192
|
-
|
|
1162
|
+
A.dismiss(t), A.success("Image refined successfully!", {
|
|
1193
1163
|
description: "Compare the images and choose which to keep."
|
|
1194
1164
|
}), K(nt), _(a), mt(!0), g(""), p(!1);
|
|
1195
1165
|
} catch (a) {
|
|
1196
|
-
if (
|
|
1166
|
+
if (A.dismiss(t), a instanceof qe) {
|
|
1197
1167
|
const l = a.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
|
|
1198
|
-
|
|
1168
|
+
A.error(l, {
|
|
1199
1169
|
description: a.message,
|
|
1200
1170
|
duration: 8e3
|
|
1201
1171
|
});
|
|
1202
1172
|
} else
|
|
1203
|
-
a instanceof
|
|
1173
|
+
a instanceof Ve ? A.error("Credits Issue", {
|
|
1204
1174
|
description: a.message,
|
|
1205
1175
|
duration: 8e3
|
|
1206
|
-
}) :
|
|
1176
|
+
}) : A.error("Failed to refine image", {
|
|
1207
1177
|
description: a instanceof Error ? a.message : "Unknown error. Please try again."
|
|
1208
1178
|
});
|
|
1209
1179
|
} finally {
|
|
1210
1180
|
F(!1);
|
|
1211
1181
|
}
|
|
1212
|
-
},
|
|
1182
|
+
}, Ce = () => {
|
|
1213
1183
|
m.update(() => {
|
|
1214
1184
|
const t = ct(e);
|
|
1215
|
-
if (
|
|
1216
|
-
t.setSrc(
|
|
1185
|
+
if (et(t)) {
|
|
1186
|
+
t.setSrc(Z), t.setOriginalPrompt(at);
|
|
1217
1187
|
const a = dt();
|
|
1218
1188
|
a && xt(a.clone());
|
|
1219
1189
|
}
|
|
1220
|
-
}), mt(!1), K(""), _(""),
|
|
1190
|
+
}), mt(!1), K(""), _(""), A.success("Image replaced successfully!", {
|
|
1221
1191
|
description: "The image has been updated with the refined version."
|
|
1222
1192
|
});
|
|
1223
|
-
},
|
|
1193
|
+
}, Ne = () => {
|
|
1224
1194
|
mt(!1), K(""), _("");
|
|
1225
|
-
},
|
|
1195
|
+
}, ke = n && st(j) && !$, Bt = (n || $) && St, Re = () => c === "left" || c === "right" ? {
|
|
1226
1196
|
position: "relative",
|
|
1227
1197
|
display: "block",
|
|
1228
1198
|
width: "100%"
|
|
@@ -1250,7 +1220,7 @@ function so({
|
|
|
1250
1220
|
} : {
|
|
1251
1221
|
position: "relative",
|
|
1252
1222
|
display: "inline-block"
|
|
1253
|
-
},
|
|
1223
|
+
}, Ee = S(
|
|
1254
1224
|
(t) => {
|
|
1255
1225
|
if ($ || t.target.closest("button"))
|
|
1256
1226
|
return;
|
|
@@ -1260,26 +1230,26 @@ function so({
|
|
|
1260
1230
|
const f = y.current.getBoundingClientRect();
|
|
1261
1231
|
u = t.clientX >= f.left && t.clientX <= f.right && t.clientY >= f.top && t.clientY <= f.bottom;
|
|
1262
1232
|
}
|
|
1263
|
-
!l && !u || (t.stopPropagation(), t.shiftKey ? W(!n) : (
|
|
1233
|
+
!l && !u || (t.stopPropagation(), t.shiftKey ? W(!n) : (E(), W(!0)));
|
|
1264
1234
|
},
|
|
1265
|
-
[$, n, W,
|
|
1235
|
+
[$, n, W, E]
|
|
1266
1236
|
);
|
|
1267
|
-
return /* @__PURE__ */ r(
|
|
1237
|
+
return /* @__PURE__ */ r(Nr, { fallback: null, children: /* @__PURE__ */ h(Kt, { children: [
|
|
1268
1238
|
/* @__PURE__ */ h(
|
|
1269
1239
|
"div",
|
|
1270
1240
|
{
|
|
1271
|
-
draggable:
|
|
1272
|
-
style:
|
|
1273
|
-
onClick:
|
|
1274
|
-
onMouseEnter:
|
|
1275
|
-
onMouseLeave:
|
|
1241
|
+
draggable: ke,
|
|
1242
|
+
style: Re(),
|
|
1243
|
+
onClick: Ee,
|
|
1244
|
+
onMouseEnter: we,
|
|
1245
|
+
onMouseLeave: ve,
|
|
1276
1246
|
children: [
|
|
1277
1247
|
zt ? /* @__PURE__ */ h(
|
|
1278
1248
|
"div",
|
|
1279
1249
|
{
|
|
1280
1250
|
className: "cteditor-relative cteditor-inline-block cteditor-my-2 cteditor-select-none cteditor-rounded-lg cteditor-overflow-hidden",
|
|
1281
1251
|
style: {
|
|
1282
|
-
...typeof d == "number" && typeof
|
|
1252
|
+
...typeof d == "number" && typeof v == "number" ? { width: d, height: v, aspectRatio: `${d} / ${v}`, maxWidth: "100%" } : { minWidth: 200, minHeight: 150 }
|
|
1283
1253
|
},
|
|
1284
1254
|
children: [
|
|
1285
1255
|
/* @__PURE__ */ r(
|
|
@@ -1295,35 +1265,36 @@ function so({
|
|
|
1295
1265
|
}
|
|
1296
1266
|
),
|
|
1297
1267
|
/* @__PURE__ */ h("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-rounded-lg cteditor-bg-muted", children: [
|
|
1298
|
-
/* @__PURE__ */ r(
|
|
1268
|
+
/* @__PURE__ */ r(De, { className: "cteditor-w-10 cteditor-h-10 cteditor-text-muted-foreground cteditor-animate-spin cteditor-mb-2", "aria-hidden": !0 }),
|
|
1299
1269
|
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-muted-foreground", children: "Applying crop…" })
|
|
1300
1270
|
] })
|
|
1301
1271
|
]
|
|
1302
1272
|
}
|
|
1303
|
-
) :
|
|
1304
|
-
|
|
1273
|
+
) : Q ? /* @__PURE__ */ r(Or, {}) : /* @__PURE__ */ r(
|
|
1274
|
+
_r,
|
|
1305
1275
|
{
|
|
1306
|
-
className: Bt ? `focused ${st(j) ? "draggable" : ""}` :
|
|
1276
|
+
className: Bt ? `focused ${st(j) ? "draggable" : ""}` : N ? "cteditor-cursor-pointer" : null,
|
|
1307
1277
|
src: i,
|
|
1308
1278
|
altText: o,
|
|
1309
1279
|
imageRef: y,
|
|
1310
1280
|
width: d,
|
|
1311
|
-
height:
|
|
1281
|
+
height: v,
|
|
1312
1282
|
maxWidth: w,
|
|
1313
1283
|
onError: () => Pt(!0)
|
|
1314
1284
|
}
|
|
1315
1285
|
),
|
|
1316
|
-
G &&
|
|
1286
|
+
G && N && !n && /* @__PURE__ */ h(
|
|
1317
1287
|
"div",
|
|
1318
1288
|
{
|
|
1319
1289
|
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",
|
|
1320
1290
|
style: { zIndex: 10 },
|
|
1321
1291
|
children: [
|
|
1322
|
-
/* @__PURE__ */ r(
|
|
1323
|
-
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children:
|
|
1292
|
+
/* @__PURE__ */ r(kr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
|
|
1293
|
+
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: N }),
|
|
1324
1294
|
/* @__PURE__ */ r(
|
|
1325
1295
|
"button",
|
|
1326
1296
|
{
|
|
1297
|
+
type: "button",
|
|
1327
1298
|
onClick: Ft,
|
|
1328
1299
|
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",
|
|
1329
1300
|
children: "Open"
|
|
@@ -1332,74 +1303,80 @@ function so({
|
|
|
1332
1303
|
]
|
|
1333
1304
|
}
|
|
1334
1305
|
),
|
|
1335
|
-
n && st(j) && !
|
|
1306
|
+
n && st(j) && !Q && !zt && /* @__PURE__ */ h(
|
|
1336
1307
|
"div",
|
|
1337
1308
|
{
|
|
1338
1309
|
ref: Ct,
|
|
1339
1310
|
className: "cteditor-absolute cteditor-flex cteditor-gap-1 z-10 cteditor-text-foreground",
|
|
1340
|
-
style:
|
|
1311
|
+
style: le ?? (At ? { left: "50%", transform: "translateX(-50%) translateY(100%) translateY(4px)", bottom: 0 } : { top: 8, right: 8 }),
|
|
1341
1312
|
children: [
|
|
1342
1313
|
/* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-accent cteditor-border cteditor-border-foreground/10 cteditor-rounded-md cteditor-shadow-md cteditor-p-0.5", children: [
|
|
1343
1314
|
/* @__PURE__ */ r(
|
|
1344
1315
|
"button",
|
|
1345
1316
|
{
|
|
1317
|
+
type: "button",
|
|
1346
1318
|
onClick: (t) => ft(t, "left"),
|
|
1347
1319
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1348
1320
|
"aria-label": "Wrap text left",
|
|
1349
1321
|
title: "Wrap text left",
|
|
1350
|
-
children: /* @__PURE__ */ r(
|
|
1322
|
+
children: /* @__PURE__ */ r(Le, {})
|
|
1351
1323
|
}
|
|
1352
1324
|
),
|
|
1353
1325
|
/* @__PURE__ */ r(
|
|
1354
1326
|
"button",
|
|
1355
1327
|
{
|
|
1328
|
+
type: "button",
|
|
1356
1329
|
onClick: (t) => ft(t, "right"),
|
|
1357
1330
|
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1358
1331
|
"aria-label": "Wrap text right",
|
|
1359
1332
|
title: "Wrap text right",
|
|
1360
|
-
children: /* @__PURE__ */ r(
|
|
1333
|
+
children: /* @__PURE__ */ r($e, {})
|
|
1361
1334
|
}
|
|
1362
1335
|
),
|
|
1363
1336
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
1364
1337
|
/* @__PURE__ */ r(
|
|
1365
1338
|
"button",
|
|
1366
1339
|
{
|
|
1340
|
+
type: "button",
|
|
1367
1341
|
onClick: (t) => ft(t, "inline-left"),
|
|
1368
1342
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1369
1343
|
"aria-label": "Align left",
|
|
1370
1344
|
title: "Align left (no text wrap)",
|
|
1371
|
-
children: /* @__PURE__ */ r(
|
|
1345
|
+
children: /* @__PURE__ */ r(Te, {})
|
|
1372
1346
|
}
|
|
1373
1347
|
),
|
|
1374
1348
|
/* @__PURE__ */ r(
|
|
1375
1349
|
"button",
|
|
1376
1350
|
{
|
|
1351
|
+
type: "button",
|
|
1377
1352
|
onClick: (t) => ft(t, "inline-center"),
|
|
1378
1353
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-center" || c === "full" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1379
1354
|
"aria-label": "Align center",
|
|
1380
1355
|
title: "Align center (no text wrap)",
|
|
1381
|
-
children: /* @__PURE__ */ r(
|
|
1356
|
+
children: /* @__PURE__ */ r(We, {})
|
|
1382
1357
|
}
|
|
1383
1358
|
),
|
|
1384
1359
|
/* @__PURE__ */ r(
|
|
1385
1360
|
"button",
|
|
1386
1361
|
{
|
|
1362
|
+
type: "button",
|
|
1387
1363
|
onClick: (t) => ft(t, "inline-right"),
|
|
1388
1364
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1389
1365
|
"aria-label": "Align right",
|
|
1390
1366
|
title: "Align right (no text wrap)",
|
|
1391
|
-
children: /* @__PURE__ */ r(
|
|
1367
|
+
children: /* @__PURE__ */ r(je, {})
|
|
1392
1368
|
}
|
|
1393
1369
|
),
|
|
1394
1370
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
1395
1371
|
/* @__PURE__ */ r(
|
|
1396
1372
|
"button",
|
|
1397
1373
|
{
|
|
1374
|
+
type: "button",
|
|
1398
1375
|
onClick: (t) => ft(t, "none"),
|
|
1399
1376
|
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "none" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1400
1377
|
"aria-label": "Inline",
|
|
1401
1378
|
title: "Inline with text",
|
|
1402
|
-
children: /* @__PURE__ */ r(
|
|
1379
|
+
children: /* @__PURE__ */ r(Ye, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1403
1380
|
}
|
|
1404
1381
|
),
|
|
1405
1382
|
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
@@ -1407,75 +1384,81 @@ function so({
|
|
|
1407
1384
|
/* @__PURE__ */ r(
|
|
1408
1385
|
"button",
|
|
1409
1386
|
{
|
|
1410
|
-
|
|
1387
|
+
type: "button",
|
|
1388
|
+
onClick: be,
|
|
1411
1389
|
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors",
|
|
1412
1390
|
"aria-label": "Crop image",
|
|
1413
1391
|
title: "Crop image",
|
|
1414
|
-
children: /* @__PURE__ */ r(
|
|
1392
|
+
children: /* @__PURE__ */ r(de, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1415
1393
|
}
|
|
1416
1394
|
),
|
|
1417
|
-
(Rt(i) !== i || typeof d == "number" || typeof
|
|
1395
|
+
(Rt(i) !== i || typeof d == "number" || typeof v == "number") && /* @__PURE__ */ r(
|
|
1418
1396
|
"button",
|
|
1419
1397
|
{
|
|
1420
|
-
|
|
1398
|
+
type: "button",
|
|
1399
|
+
onClick: ye,
|
|
1421
1400
|
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors",
|
|
1422
1401
|
"aria-label": "Reset image to original size and crop",
|
|
1423
1402
|
title: "Reset to original size and crop",
|
|
1424
|
-
children: /* @__PURE__ */ r(
|
|
1403
|
+
children: /* @__PURE__ */ r(Rr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1425
1404
|
}
|
|
1426
1405
|
)
|
|
1427
1406
|
] })
|
|
1428
1407
|
] }),
|
|
1429
|
-
|
|
1408
|
+
N && /* @__PURE__ */ r(
|
|
1430
1409
|
"button",
|
|
1431
1410
|
{
|
|
1411
|
+
type: "button",
|
|
1432
1412
|
onClick: Ft,
|
|
1433
1413
|
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/95 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1434
1414
|
"aria-label": "Visit link",
|
|
1435
|
-
title: `Visit: ${
|
|
1436
|
-
children: /* @__PURE__ */ r(
|
|
1415
|
+
title: `Visit: ${N}`,
|
|
1416
|
+
children: /* @__PURE__ */ r(_e, {})
|
|
1437
1417
|
}
|
|
1438
1418
|
),
|
|
1439
|
-
|
|
1419
|
+
P && /* @__PURE__ */ r(
|
|
1440
1420
|
"button",
|
|
1441
1421
|
{
|
|
1422
|
+
type: "button",
|
|
1442
1423
|
onClick: (t) => {
|
|
1443
|
-
t.stopPropagation(),
|
|
1424
|
+
t.stopPropagation(), pe(t);
|
|
1444
1425
|
},
|
|
1445
1426
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1446
1427
|
"aria-label": "Refine image",
|
|
1447
1428
|
title: "Refine image",
|
|
1448
|
-
children: /* @__PURE__ */ r(
|
|
1429
|
+
children: /* @__PURE__ */ r(Oe, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1449
1430
|
}
|
|
1450
1431
|
),
|
|
1451
1432
|
/* @__PURE__ */ r(
|
|
1452
1433
|
"button",
|
|
1453
1434
|
{
|
|
1435
|
+
type: "button",
|
|
1454
1436
|
onClick: (t) => {
|
|
1455
|
-
t.stopPropagation(),
|
|
1437
|
+
t.stopPropagation(), fe(t);
|
|
1456
1438
|
},
|
|
1457
1439
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1458
1440
|
"aria-label": "Open image in new tab",
|
|
1459
1441
|
title: "Open in new tab",
|
|
1460
|
-
children: /* @__PURE__ */ r(
|
|
1442
|
+
children: /* @__PURE__ */ r(He, {})
|
|
1461
1443
|
}
|
|
1462
1444
|
),
|
|
1463
1445
|
/* @__PURE__ */ r(
|
|
1464
1446
|
"button",
|
|
1465
1447
|
{
|
|
1448
|
+
type: "button",
|
|
1466
1449
|
onClick: (t) => {
|
|
1467
|
-
t.stopPropagation(),
|
|
1450
|
+
t.stopPropagation(), he(t);
|
|
1468
1451
|
},
|
|
1469
1452
|
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1470
1453
|
"aria-label": "Delete image",
|
|
1471
1454
|
title: "Delete image",
|
|
1472
|
-
children: /* @__PURE__ */ r(
|
|
1455
|
+
children: /* @__PURE__ */ r(Fe, {})
|
|
1473
1456
|
}
|
|
1474
1457
|
)
|
|
1475
1458
|
]
|
|
1476
1459
|
}
|
|
1477
1460
|
),
|
|
1478
|
-
s && n && !
|
|
1461
|
+
s && n && !Q && P && /* @__PURE__ */ r(
|
|
1479
1462
|
"div",
|
|
1480
1463
|
{
|
|
1481
1464
|
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background/85 cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-foreground/20 cteditor-p-3 cteditor-backdrop-blur-lg md:cteditor-min-w-80",
|
|
@@ -1510,6 +1493,7 @@ function so({
|
|
|
1510
1493
|
/* @__PURE__ */ r(
|
|
1511
1494
|
"button",
|
|
1512
1495
|
{
|
|
1496
|
+
type: "button",
|
|
1513
1497
|
onClick: (t) => {
|
|
1514
1498
|
t.stopPropagation(), Xt();
|
|
1515
1499
|
},
|
|
@@ -1524,36 +1508,37 @@ function so({
|
|
|
1524
1508
|
/* @__PURE__ */ r(
|
|
1525
1509
|
"button",
|
|
1526
1510
|
{
|
|
1511
|
+
type: "button",
|
|
1527
1512
|
onClick: (t) => {
|
|
1528
1513
|
t.stopPropagation(), p(!1), g("");
|
|
1529
1514
|
},
|
|
1530
1515
|
disabled: x,
|
|
1531
1516
|
className: "cteditor-size-9 cteditor-flex cteditor-items-center cteditor-justify-center 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",
|
|
1532
|
-
children: /* @__PURE__ */ r(
|
|
1517
|
+
children: /* @__PURE__ */ r(Xe, { size: 16 })
|
|
1533
1518
|
}
|
|
1534
1519
|
)
|
|
1535
1520
|
] })
|
|
1536
1521
|
] })
|
|
1537
1522
|
}
|
|
1538
1523
|
),
|
|
1539
|
-
|
|
1540
|
-
|
|
1524
|
+
z && st(j) && Bt && !zt && /* @__PURE__ */ r(
|
|
1525
|
+
Ie,
|
|
1541
1526
|
{
|
|
1542
|
-
showCaption:
|
|
1543
|
-
setShowCaption:
|
|
1527
|
+
showCaption: R,
|
|
1528
|
+
setShowCaption: ue,
|
|
1544
1529
|
editor: m,
|
|
1545
|
-
buttonRef:
|
|
1530
|
+
buttonRef: L,
|
|
1546
1531
|
imageRef: y,
|
|
1547
1532
|
maxWidth: w,
|
|
1548
|
-
onResizeStart:
|
|
1549
|
-
onResizeEnd:
|
|
1550
|
-
captionsEnabled: !
|
|
1533
|
+
onResizeStart: ge,
|
|
1534
|
+
onResizeEnd: me,
|
|
1535
|
+
captionsEnabled: !Q && C
|
|
1551
1536
|
}
|
|
1552
1537
|
)
|
|
1553
1538
|
]
|
|
1554
1539
|
}
|
|
1555
1540
|
),
|
|
1556
|
-
|
|
1541
|
+
R && (o.startsWith("Signature by") ? /* @__PURE__ */ r(Ir, { caption: k }) : /* @__PURE__ */ r(
|
|
1557
1542
|
"div",
|
|
1558
1543
|
{
|
|
1559
1544
|
className: "image-caption-container",
|
|
@@ -1564,73 +1549,73 @@ function so({
|
|
|
1564
1549
|
...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" } : {}
|
|
1565
1550
|
},
|
|
1566
1551
|
children: /* @__PURE__ */ h(
|
|
1567
|
-
|
|
1552
|
+
ir,
|
|
1568
1553
|
{
|
|
1569
1554
|
initialEditor: k,
|
|
1570
1555
|
initialNodes: [
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1556
|
+
yr,
|
|
1557
|
+
xr,
|
|
1558
|
+
wr,
|
|
1559
|
+
vr,
|
|
1560
|
+
Je,
|
|
1561
|
+
Be
|
|
1577
1562
|
],
|
|
1578
1563
|
children: [
|
|
1579
|
-
/* @__PURE__ */ r(
|
|
1564
|
+
/* @__PURE__ */ r(Qe, {}),
|
|
1580
1565
|
/* @__PURE__ */ r(
|
|
1581
|
-
|
|
1566
|
+
nr,
|
|
1582
1567
|
{
|
|
1583
1568
|
contentEditable: /* @__PURE__ */ r(
|
|
1584
|
-
|
|
1569
|
+
er,
|
|
1585
1570
|
{
|
|
1586
1571
|
"aria-placeholder": "Enter a caption...",
|
|
1587
1572
|
placeholder: () => /* @__PURE__ */ r("span", { className: "cteditor-text-xs cteditor-absolute cteditor-left-2 cteditor-top-[7px]", children: "Enter a caption..." }),
|
|
1588
1573
|
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 cteditor-relative"
|
|
1589
1574
|
}
|
|
1590
1575
|
),
|
|
1591
|
-
ErrorBoundary:
|
|
1576
|
+
ErrorBoundary: rr
|
|
1592
1577
|
}
|
|
1593
1578
|
),
|
|
1594
1579
|
/* @__PURE__ */ r(
|
|
1595
|
-
|
|
1580
|
+
ar,
|
|
1596
1581
|
{
|
|
1597
1582
|
onChange: () => {
|
|
1598
1583
|
}
|
|
1599
1584
|
}
|
|
1600
1585
|
),
|
|
1601
|
-
/* @__PURE__ */ r(
|
|
1602
|
-
/* @__PURE__ */ r(
|
|
1586
|
+
/* @__PURE__ */ r(or, {}),
|
|
1587
|
+
/* @__PURE__ */ r(Ue, { namespace: Ke.namespace })
|
|
1603
1588
|
]
|
|
1604
1589
|
}
|
|
1605
1590
|
)
|
|
1606
1591
|
}
|
|
1607
1592
|
)),
|
|
1608
1593
|
/* @__PURE__ */ r(
|
|
1609
|
-
|
|
1594
|
+
jr,
|
|
1610
1595
|
{
|
|
1611
1596
|
open: B,
|
|
1612
1597
|
onOpenChange: gt,
|
|
1613
1598
|
src: i,
|
|
1614
1599
|
altText: o,
|
|
1615
1600
|
width: d,
|
|
1616
|
-
height:
|
|
1617
|
-
onCropApply:
|
|
1601
|
+
height: v,
|
|
1602
|
+
onCropApply: xe
|
|
1618
1603
|
}
|
|
1619
1604
|
),
|
|
1620
1605
|
/* @__PURE__ */ r(
|
|
1621
|
-
|
|
1606
|
+
Er,
|
|
1622
1607
|
{
|
|
1623
1608
|
open: ut,
|
|
1624
1609
|
onOpenChange: mt,
|
|
1625
1610
|
oldImageUrl: i,
|
|
1626
|
-
newImageUrl:
|
|
1627
|
-
onReplace:
|
|
1628
|
-
onCancel:
|
|
1611
|
+
newImageUrl: Z,
|
|
1612
|
+
onReplace: Ce,
|
|
1613
|
+
onCancel: Ne
|
|
1629
1614
|
}
|
|
1630
1615
|
)
|
|
1631
1616
|
] }) });
|
|
1632
1617
|
}
|
|
1633
1618
|
export {
|
|
1634
|
-
|
|
1635
|
-
|
|
1619
|
+
ee as RIGHT_CLICK_IMAGE_COMMAND,
|
|
1620
|
+
co as default
|
|
1636
1621
|
};
|