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