nam-rich-text-editor 9.1.3 → 9.1.4
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/rich-text-editor.es.js +565 -509
- package/dist/rich-text-editor.umd.js +3 -3
- package/package.json +1 -1
|
@@ -50,8 +50,8 @@ const zn = ([h, v, f]) => {
|
|
|
50
50
|
return Object.keys(v).forEach((y) => {
|
|
51
51
|
d.setAttribute(y, String(v[y]));
|
|
52
52
|
}), f?.length && f.forEach((y) => {
|
|
53
|
-
const
|
|
54
|
-
d.appendChild(
|
|
53
|
+
const b = zn(y);
|
|
54
|
+
d.appendChild(b);
|
|
55
55
|
}), d;
|
|
56
56
|
}, ye = (h, v = {}) => {
|
|
57
57
|
const d = {
|
|
@@ -185,15 +185,15 @@ function So() {
|
|
|
185
185
|
{ command: "strikeThrough", icon: go, title: "Strikethrough" }
|
|
186
186
|
].forEach((f) => {
|
|
187
187
|
const d = document.createElement("div");
|
|
188
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
189
|
-
(
|
|
188
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (b) => {
|
|
189
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), d.click());
|
|
190
190
|
});
|
|
191
191
|
const y = ye(f.icon, { width: 16, height: 16 });
|
|
192
192
|
d.appendChild(y), d.title = f.title, d.style.fontWeight = f.command === "bold" ? "bold" : "normal", d.style.fontStyle = f.command === "italic" ? "italic" : "normal", d.style.textDecoration = f.command === "underline" ? "underline" : "none", d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(f.command), h.appendChild(d);
|
|
193
193
|
}), h;
|
|
194
194
|
}
|
|
195
195
|
let Je = null;
|
|
196
|
-
function
|
|
196
|
+
function he(h) {
|
|
197
197
|
if (h) {
|
|
198
198
|
Je = h.cloneRange();
|
|
199
199
|
return;
|
|
@@ -214,18 +214,18 @@ function Ln(h, v) {
|
|
|
214
214
|
if (!f || f.rangeCount === 0) return;
|
|
215
215
|
const d = f.getRangeAt(0);
|
|
216
216
|
if (!d.collapsed) {
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
217
|
+
const S = document.createElement("span");
|
|
218
|
+
S.style[h] = v;
|
|
219
|
+
const k = d.extractContents();
|
|
220
|
+
S.appendChild(k), d.insertNode(S), f.removeAllRanges();
|
|
221
|
+
const R = document.createRange();
|
|
222
|
+
R.selectNodeContents(S), f.addRange(R), he(R);
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
225
|
const y = document.createElement("span");
|
|
226
226
|
y.style[h] = v, y.appendChild(document.createTextNode("")), d.insertNode(y), f.removeAllRanges();
|
|
227
|
-
const
|
|
228
|
-
|
|
227
|
+
const b = document.createRange();
|
|
228
|
+
b.setStart(y.firstChild, 0), b.setEnd(y.firstChild, 0), f.addRange(b), he(b);
|
|
229
229
|
}
|
|
230
230
|
function To(h) {
|
|
231
231
|
Ln("color", h);
|
|
@@ -237,16 +237,16 @@ function Mo() {
|
|
|
237
237
|
const h = document.createDocumentFragment(), v = document.createElement("input");
|
|
238
238
|
v.type = "color", v.style.display = "none", v.title = "Text Color";
|
|
239
239
|
const f = document.createElement("div");
|
|
240
|
-
f.setAttribute("role", "button"), f.tabIndex = 0, f.style.userSelect = "none", f.addEventListener("keydown", (
|
|
241
|
-
(
|
|
240
|
+
f.setAttribute("role", "button"), f.tabIndex = 0, f.style.userSelect = "none", f.addEventListener("keydown", (b) => {
|
|
241
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), f.click());
|
|
242
242
|
}), f.textContent = "A", f.style.color = "#000", f.style.fontSize = "16px", f.style.fontWeight = "bold", f.style.border = "1px solid #ccc", f.style.borderRadius = "4px", f.style.padding = "4px 8px", f.style.cursor = "pointer", f.style.backgroundColor = "#fff", f.title = "Text Color", f.onclick = () => v.click(), v.onchange = () => {
|
|
243
243
|
Ne(), To(v.value), f.style.color = v.value;
|
|
244
244
|
}, h.appendChild(f), h.appendChild(v);
|
|
245
245
|
const d = document.createElement("input");
|
|
246
246
|
d.type = "color", d.style.display = "none", d.title = "Background Color";
|
|
247
247
|
const y = document.createElement("div");
|
|
248
|
-
return y.setAttribute("role", "button"), y.tabIndex = 0, y.style.userSelect = "none", y.addEventListener("keydown", (
|
|
249
|
-
(
|
|
248
|
+
return y.setAttribute("role", "button"), y.tabIndex = 0, y.style.userSelect = "none", y.addEventListener("keydown", (b) => {
|
|
249
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), y.click());
|
|
250
250
|
}), y.textContent = "BA", y.style.color = "#000", y.style.fontSize = "14px", y.style.fontWeight = "bold", y.style.border = "1px solid #ccc", y.style.borderRadius = "4px", y.style.padding = "4px 6px", y.style.cursor = "pointer", y.style.backgroundColor = "#fff", y.title = "Background Color", y.onclick = () => d.click(), d.onchange = () => {
|
|
251
251
|
Ne(), _o(d.value), y.style.backgroundColor = d.value, y.style.color = "#000";
|
|
252
252
|
}, h.appendChild(y), h.appendChild(d), h;
|
|
@@ -254,17 +254,61 @@ function Mo() {
|
|
|
254
254
|
function Ro() {
|
|
255
255
|
const h = document.createDocumentFragment();
|
|
256
256
|
return [
|
|
257
|
-
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
{
|
|
258
|
+
command: "justifyLeft",
|
|
259
|
+
align: "left",
|
|
260
|
+
icon: wo,
|
|
261
|
+
title: "Align Left"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
command: "justifyCenter",
|
|
265
|
+
align: "center",
|
|
266
|
+
icon: yo,
|
|
267
|
+
title: "Align Center"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
command: "justifyRight",
|
|
271
|
+
align: "right",
|
|
272
|
+
icon: bo,
|
|
273
|
+
title: "Align Right"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
command: "justifyFull",
|
|
277
|
+
align: "justify",
|
|
278
|
+
icon: xo,
|
|
279
|
+
title: "Justify"
|
|
280
|
+
}
|
|
261
281
|
].forEach((f) => {
|
|
262
282
|
const d = document.createElement("div");
|
|
263
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
264
|
-
(
|
|
283
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (b) => {
|
|
284
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), d.click());
|
|
265
285
|
});
|
|
266
286
|
const y = ye(f.icon, { width: 16, height: 16 });
|
|
267
|
-
d.appendChild(y), d.title = f.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () =>
|
|
287
|
+
d.appendChild(y), d.title = f.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => {
|
|
288
|
+
const b = window.getSelection();
|
|
289
|
+
if (b && b.rangeCount > 0) {
|
|
290
|
+
let S = b.anchorNode;
|
|
291
|
+
for (; S && S.nodeType !== Node.ELEMENT_NODE; )
|
|
292
|
+
S = S.parentNode;
|
|
293
|
+
let k = S, R = null;
|
|
294
|
+
for (; k && k !== document.body; ) {
|
|
295
|
+
if (k.tagName === "P" && k.querySelector(".editor-image-wrapper")) {
|
|
296
|
+
R = k;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
if (k.tagName === "P") {
|
|
300
|
+
R = k;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
k = k.parentElement;
|
|
304
|
+
}
|
|
305
|
+
if (R) {
|
|
306
|
+
R.style.textAlign = f.align;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
document.execCommand(f.command);
|
|
311
|
+
}, h.appendChild(d);
|
|
268
312
|
}), h;
|
|
269
313
|
}
|
|
270
314
|
function Io() {
|
|
@@ -274,8 +318,8 @@ function Io() {
|
|
|
274
318
|
{ command: "insertOrderedList", icon: co, title: "Numbered List" }
|
|
275
319
|
].forEach((f) => {
|
|
276
320
|
const d = document.createElement("div");
|
|
277
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
278
|
-
(
|
|
321
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (b) => {
|
|
322
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), d.click());
|
|
279
323
|
});
|
|
280
324
|
const y = ye(f.icon, { width: 16, height: 16 });
|
|
281
325
|
d.appendChild(y), d.title = f.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(f.command), h.appendChild(d);
|
|
@@ -288,8 +332,8 @@ function Oo() {
|
|
|
288
332
|
{ command: "outdent", icon: so, title: "Decrease Indent" }
|
|
289
333
|
].forEach((f) => {
|
|
290
334
|
const d = document.createElement("div");
|
|
291
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
292
|
-
(
|
|
335
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (b) => {
|
|
336
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), d.click());
|
|
293
337
|
});
|
|
294
338
|
const y = ye(f.icon, { width: 16, height: 16 });
|
|
295
339
|
d.appendChild(y), d.title = f.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(f.command), h.appendChild(d);
|
|
@@ -302,8 +346,8 @@ function Ao() {
|
|
|
302
346
|
{ command: "redo", icon: vo, title: "Redo" }
|
|
303
347
|
].forEach((f) => {
|
|
304
348
|
const d = document.createElement("div");
|
|
305
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
306
|
-
(
|
|
349
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (b) => {
|
|
350
|
+
(b.key === "Enter" || b.key === " ") && (b.preventDefault(), d.click());
|
|
307
351
|
});
|
|
308
352
|
const y = ye(f.icon, { width: 16, height: 16 });
|
|
309
353
|
d.appendChild(y), d.title = f.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(f.command), h.appendChild(d);
|
|
@@ -315,12 +359,12 @@ function Po() {
|
|
|
315
359
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), h.click());
|
|
316
360
|
});
|
|
317
361
|
const v = ye(oo, { width: 16, height: 16 });
|
|
318
|
-
return h.appendChild(v), h.title = "Insert Image", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff", h.onmousedown = () =>
|
|
362
|
+
return h.appendChild(v), h.title = "Insert Image", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff", h.onmousedown = () => he(), h;
|
|
319
363
|
}
|
|
320
364
|
function Do() {
|
|
321
365
|
const h = document.createElement("div");
|
|
322
|
-
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (
|
|
323
|
-
(
|
|
366
|
+
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (S) => {
|
|
367
|
+
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), h.click());
|
|
324
368
|
});
|
|
325
369
|
const v = ye(po, {
|
|
326
370
|
width: 16,
|
|
@@ -330,27 +374,27 @@ function Do() {
|
|
|
330
374
|
height: 16
|
|
331
375
|
});
|
|
332
376
|
h.appendChild(v), h.title = "Toggle Fullscreen", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff";
|
|
333
|
-
let d = !1, y = "",
|
|
377
|
+
let d = !1, y = "", b = "";
|
|
334
378
|
return h.onclick = () => {
|
|
335
|
-
const
|
|
379
|
+
const S = document.querySelector(
|
|
336
380
|
".editor-container"
|
|
337
381
|
);
|
|
338
|
-
if (!
|
|
339
|
-
const
|
|
382
|
+
if (!S) return;
|
|
383
|
+
const k = S.querySelector(".editor");
|
|
340
384
|
if (d)
|
|
341
|
-
y ?
|
|
385
|
+
y ? S.setAttribute("style", y) : S.removeAttribute("style"), k && (b ? k.setAttribute("style", b) : k.removeAttribute("style")), h.replaceChild(v, f), d = !1;
|
|
342
386
|
else {
|
|
343
|
-
y =
|
|
387
|
+
y = S.getAttribute("style") || "", b = k && k.getAttribute("style") || "", S.style.position = "fixed", S.style.top = "0", S.style.left = "0", S.style.width = "100vw", S.style.height = "100vh";
|
|
344
388
|
try {
|
|
345
|
-
let
|
|
346
|
-
document.querySelectorAll("body *").forEach((
|
|
347
|
-
const M = window.getComputedStyle(
|
|
348
|
-
!isNaN(
|
|
349
|
-
}),
|
|
389
|
+
let R = 9998;
|
|
390
|
+
document.querySelectorAll("body *").forEach((O) => {
|
|
391
|
+
const M = window.getComputedStyle(O).getPropertyValue("z-index"), Y = parseInt(M, 10);
|
|
392
|
+
!isNaN(Y) && Y > 0 && (R = Math.max(R, Y));
|
|
393
|
+
}), S.style.zIndex = String(Math.max(R + 1, 9999));
|
|
350
394
|
} catch {
|
|
351
|
-
|
|
395
|
+
S.style.zIndex = "9999";
|
|
352
396
|
}
|
|
353
|
-
|
|
397
|
+
S.style.backgroundColor = "#ffffff", S.style.display = "flex", S.style.flexDirection = "column", k && (k.style.flexGrow = "1", k.style.overflowY = "auto", k.style.border = "none", k.style.borderRadius = "0", k.style.boxShadow = "none"), h.replaceChild(f, v), d = !0;
|
|
354
398
|
}
|
|
355
399
|
}, h;
|
|
356
400
|
}
|
|
@@ -361,27 +405,27 @@ function No(h) {
|
|
|
361
405
|
d.style.backgroundColor = "#fff", d.style.padding = "20px", d.style.borderRadius = "8px", d.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)", d.style.minWidth = "300px";
|
|
362
406
|
const y = document.createElement("h3");
|
|
363
407
|
y.textContent = "Insert Hyperlink", y.style.margin = "0 0 15px 0", y.style.fontSize = "18px", y.style.fontWeight = "bold";
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
(
|
|
371
|
-
}),
|
|
372
|
-
f.style.display = "none",
|
|
408
|
+
const b = document.createElement("input");
|
|
409
|
+
b.type = "url", b.placeholder = "Enter URL (e.g., https://example.com)", b.style.width = "100%", b.style.padding = "8px", b.style.border = "1px solid #ccc", b.style.borderRadius = "4px", b.style.marginBottom = "15px", b.style.boxSizing = "border-box";
|
|
410
|
+
const S = document.createElement("div");
|
|
411
|
+
S.style.display = "flex", S.style.gap = "10px", S.style.justifyContent = "flex-end";
|
|
412
|
+
const k = document.createElement("div");
|
|
413
|
+
k.setAttribute("role", "button"), k.tabIndex = 0, k.style.userSelect = "none", k.textContent = "Cancel", k.style.padding = "8px 16px", k.style.border = "1px solid #ccc", k.style.borderRadius = "4px", k.style.backgroundColor = "#f5f5f5", k.style.cursor = "pointer", k.addEventListener("keydown", (P) => {
|
|
414
|
+
(P.key === "Enter" || P.key === " " || P.key === "Escape") && (P.preventDefault(), k.click());
|
|
415
|
+
}), k.onclick = () => {
|
|
416
|
+
f.style.display = "none", b.value = "", R = null;
|
|
373
417
|
};
|
|
374
|
-
let
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
(
|
|
378
|
-
}),
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
if (
|
|
382
|
-
|
|
418
|
+
let R = null;
|
|
419
|
+
const O = document.createElement("div");
|
|
420
|
+
O.setAttribute("role", "button"), O.tabIndex = 0, O.style.userSelect = "none", O.textContent = "Insert", O.style.padding = "8px 16px", O.style.border = "none", O.style.borderRadius = "4px", O.style.backgroundColor = "#007bff", O.style.color = "#fff", O.style.cursor = "pointer", O.addEventListener("keydown", (P) => {
|
|
421
|
+
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), O.click());
|
|
422
|
+
}), O.onclick = () => {
|
|
423
|
+
const P = b.value.trim();
|
|
424
|
+
if (P)
|
|
425
|
+
if (R)
|
|
426
|
+
R.setAttribute("href", P), R.setAttribute("target", "_blank"), R.setAttribute("rel", "noopener noreferrer"), R.setAttribute("tabindex", "0");
|
|
383
427
|
else {
|
|
384
|
-
Ne(), document.execCommand("createLink", !1,
|
|
428
|
+
Ne(), document.execCommand("createLink", !1, P);
|
|
385
429
|
const ee = window.getSelection();
|
|
386
430
|
if (ee && ee.rangeCount > 0) {
|
|
387
431
|
let G = ee.getRangeAt(0).startContainer;
|
|
@@ -398,40 +442,40 @@ function No(h) {
|
|
|
398
442
|
}
|
|
399
443
|
}
|
|
400
444
|
}
|
|
401
|
-
f.style.display = "none",
|
|
402
|
-
},
|
|
403
|
-
|
|
445
|
+
f.style.display = "none", b.value = "", R = null;
|
|
446
|
+
}, S.appendChild(k), S.appendChild(O), d.appendChild(y), d.appendChild(b), d.appendChild(S), f.appendChild(d), document.body.appendChild(f), b.onkeydown = (P) => {
|
|
447
|
+
P.key === "Enter" ? O.click() : P.key === "Escape" && k.click();
|
|
404
448
|
};
|
|
405
449
|
const M = document.createElement("div");
|
|
406
450
|
M.setAttribute("role", "button"), M.tabIndex = 0, M.style.userSelect = "none";
|
|
407
|
-
const
|
|
408
|
-
M.appendChild(
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
let G =
|
|
451
|
+
const Y = ye(ao, { width: 16, height: 16 });
|
|
452
|
+
M.appendChild(Y), M.title = "Insert Hyperlink", M.style.border = "1px solid #e1e1e1", M.style.backgroundColor = "#ffffff", M.style.padding = "6px 10px", M.style.borderRadius = "3px", M.style.cursor = "pointer", M.style.color = "#000000", M.onmouseover = () => M.style.backgroundColor = "#f0f0f0", M.onmouseout = () => M.style.backgroundColor = "#ffffff", M.onmousedown = () => {
|
|
453
|
+
R = null;
|
|
454
|
+
const P = window.getSelection();
|
|
455
|
+
if (P && P.rangeCount > 0) {
|
|
456
|
+
let G = P.getRangeAt(0).startContainer;
|
|
413
457
|
for (; G && G.nodeType !== Node.ELEMENT_NODE; )
|
|
414
458
|
G = G.parentNode;
|
|
415
459
|
let X = G;
|
|
416
460
|
for (; X && X !== document.body; ) {
|
|
417
461
|
if (X.tagName === "A") {
|
|
418
|
-
|
|
462
|
+
R = X, b.value = R.getAttribute("href") || "";
|
|
419
463
|
break;
|
|
420
464
|
}
|
|
421
465
|
X = X.parentElement;
|
|
422
466
|
}
|
|
423
467
|
}
|
|
424
|
-
|
|
425
|
-
}, M.addEventListener("keydown", (
|
|
426
|
-
(
|
|
468
|
+
he();
|
|
469
|
+
}, M.addEventListener("keydown", (P) => {
|
|
470
|
+
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), M.click());
|
|
427
471
|
}), M.onclick = () => {
|
|
428
|
-
f.style.display = "flex",
|
|
472
|
+
f.style.display = "flex", b.focus();
|
|
429
473
|
}, v.appendChild(M);
|
|
430
474
|
const re = h.querySelector(".editor");
|
|
431
|
-
return re && re.addEventListener("click", (
|
|
432
|
-
const ee =
|
|
475
|
+
return re && re.addEventListener("click", (P) => {
|
|
476
|
+
const ee = P.target;
|
|
433
477
|
if (ee.tagName === "A") {
|
|
434
|
-
|
|
478
|
+
P.preventDefault();
|
|
435
479
|
const G = ee.getAttribute("href");
|
|
436
480
|
G && window.open(G, "_blank");
|
|
437
481
|
}
|
|
@@ -448,26 +492,26 @@ function zo() {
|
|
|
448
492
|
d.className = "rte-modal-overlay", d.style.display = "none";
|
|
449
493
|
const y = document.createElement("div");
|
|
450
494
|
y.className = "rte-modal";
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
495
|
+
const b = document.createElement("div");
|
|
496
|
+
b.className = "rte-modal-header";
|
|
497
|
+
const S = document.createElement("h3");
|
|
498
|
+
S.textContent = "Insert Quote", S.className = "rte-modal-title";
|
|
499
|
+
const k = document.createElement("div");
|
|
500
|
+
k.setAttribute("role", "button"), k.tabIndex = 0, k.style.userSelect = "none", k.className = "rte-modal-close", k.innerHTML = "×", k.onclick = () => {
|
|
457
501
|
d.style.display = "none", Z = null;
|
|
458
|
-
},
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const
|
|
462
|
-
|
|
502
|
+
}, b.appendChild(S), b.appendChild(k);
|
|
503
|
+
const R = document.createElement("div");
|
|
504
|
+
R.className = "rte-modal-form";
|
|
505
|
+
const O = document.createElement("label");
|
|
506
|
+
O.textContent = "Title", O.className = "rte-label";
|
|
463
507
|
const M = document.createElement("input");
|
|
464
508
|
M.type = "text", M.placeholder = "e.g., Article title or source", M.className = "rte-input";
|
|
465
|
-
const
|
|
466
|
-
|
|
509
|
+
const Y = document.createElement("label");
|
|
510
|
+
Y.textContent = "Source URL", Y.className = "rte-label";
|
|
467
511
|
const re = document.createElement("input");
|
|
468
512
|
re.type = "url", re.placeholder = "https://example.com", re.className = "rte-input";
|
|
469
|
-
const
|
|
470
|
-
|
|
513
|
+
const P = document.createElement("div");
|
|
514
|
+
P.className = "rte-preview-label", P.textContent = "Preview";
|
|
471
515
|
const ee = document.createElement("div");
|
|
472
516
|
ee.className = "rte-modal-preview";
|
|
473
517
|
const G = document.createElement("div");
|
|
@@ -475,7 +519,7 @@ function zo() {
|
|
|
475
519
|
const X = document.createElement("div");
|
|
476
520
|
X.className = "rte-blockquote-content";
|
|
477
521
|
const oe = document.createElement("div");
|
|
478
|
-
oe.className = "rte-blockquote-footer", ee.appendChild(G), ee.appendChild(X), ee.appendChild(oe),
|
|
522
|
+
oe.className = "rte-blockquote-footer", ee.appendChild(G), ee.appendChild(X), ee.appendChild(oe), R.appendChild(O), R.appendChild(M), R.appendChild(Y), R.appendChild(re), R.appendChild(P), R.appendChild(ee);
|
|
479
523
|
const U = document.createElement("div");
|
|
480
524
|
U.className = "rte-modal-actions";
|
|
481
525
|
const te = document.createElement("div");
|
|
@@ -511,8 +555,8 @@ function zo() {
|
|
|
511
555
|
} else {
|
|
512
556
|
const V = document.createElement("footer");
|
|
513
557
|
V.className = "rte-blockquote-footer";
|
|
514
|
-
const
|
|
515
|
-
H.href = z, H.textContent = z, H.target = "_blank", H.rel = "noopener noreferrer",
|
|
558
|
+
const $ = document.createElement("cite"), H = document.createElement("a");
|
|
559
|
+
H.href = z, H.textContent = z, H.target = "_blank", H.rel = "noopener noreferrer", $.appendChild(H), V.appendChild($), Z.appendChild(V);
|
|
516
560
|
}
|
|
517
561
|
else ce && ce.remove();
|
|
518
562
|
} else {
|
|
@@ -522,24 +566,24 @@ function zo() {
|
|
|
522
566
|
d.style.display = "none";
|
|
523
567
|
return;
|
|
524
568
|
}
|
|
525
|
-
const ce = le.getRangeAt(0), V = ce.extractContents(),
|
|
526
|
-
if (
|
|
569
|
+
const ce = le.getRangeAt(0), V = ce.extractContents(), $ = document.createElement("blockquote");
|
|
570
|
+
if ($.className = "rte-blockquote", K) {
|
|
527
571
|
const J = document.createElement("div");
|
|
528
|
-
J.className = "rte-blockquote-title", J.textContent = K,
|
|
572
|
+
J.className = "rte-blockquote-title", J.textContent = K, $.appendChild(J);
|
|
529
573
|
}
|
|
530
574
|
const H = document.createElement("p");
|
|
531
|
-
if (H.appendChild(V),
|
|
575
|
+
if (H.appendChild(V), $.appendChild(H), z) {
|
|
532
576
|
const J = document.createElement("footer");
|
|
533
577
|
J.className = "rte-blockquote-footer";
|
|
534
578
|
const se = document.createElement("cite"), de = document.createElement("a");
|
|
535
|
-
de.href = z, de.textContent = z, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de), J.appendChild(se),
|
|
579
|
+
de.href = z, de.textContent = z, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de), J.appendChild(se), $.appendChild(J);
|
|
536
580
|
}
|
|
537
|
-
ce.insertNode(
|
|
581
|
+
ce.insertNode($), le.removeAllRanges();
|
|
538
582
|
const ne = document.createRange();
|
|
539
|
-
ne.setStartAfter(
|
|
583
|
+
ne.setStartAfter($), ne.collapse(!0), le.addRange(ne), he(ne);
|
|
540
584
|
}
|
|
541
585
|
d.style.display = "none", M.value = "", re.value = "", Z = null;
|
|
542
|
-
}, U.appendChild(te), U.appendChild(Q), U.appendChild(ie), y.appendChild(
|
|
586
|
+
}, U.appendChild(te), U.appendChild(Q), U.appendChild(ie), y.appendChild(b), y.appendChild(R), y.appendChild(U), d.appendChild(y), document.body.appendChild(d);
|
|
543
587
|
let Z = null, g = "";
|
|
544
588
|
return v.onmousedown = () => {
|
|
545
589
|
Z = null, g = "";
|
|
@@ -554,20 +598,20 @@ function zo() {
|
|
|
554
598
|
for (; V && V !== document.body; ) {
|
|
555
599
|
if (V.tagName === "BLOCKQUOTE") {
|
|
556
600
|
Z = V;
|
|
557
|
-
const
|
|
601
|
+
const $ = Z.querySelector(
|
|
558
602
|
".rte-blockquote-title"
|
|
559
603
|
), H = Z.querySelector(
|
|
560
604
|
".rte-blockquote-footer a"
|
|
561
605
|
);
|
|
562
|
-
M.value =
|
|
606
|
+
M.value = $ && $.textContent || "", re.value = H && H.href || "", te.style.display = "inline-block";
|
|
563
607
|
const ne = Z.querySelector("p");
|
|
564
|
-
X.innerHTML = ne ? ne.innerHTML : Z.innerHTML, G.textContent =
|
|
608
|
+
X.innerHTML = ne ? ne.innerHTML : Z.innerHTML, G.textContent = $ && $.textContent || "", oe.innerHTML = H ? `<a href="${H.href}">${H.href}</a>` : "";
|
|
565
609
|
break;
|
|
566
610
|
}
|
|
567
611
|
V = V.parentElement;
|
|
568
612
|
}
|
|
569
613
|
}
|
|
570
|
-
Z || (X.innerHTML = g || "<em>Selected text will appear here</em>", G.textContent = "", oe.innerHTML = "", te.style.display = "none"),
|
|
614
|
+
Z || (X.innerHTML = g || "<em>Selected text will appear here</em>", G.textContent = "", oe.innerHTML = "", te.style.display = "none"), he();
|
|
571
615
|
}, M.oninput = () => G.textContent = M.value, re.oninput = () => {
|
|
572
616
|
const K = re.value.trim();
|
|
573
617
|
if (!K) oe.innerHTML = "";
|
|
@@ -594,26 +638,26 @@ function jo(h) {
|
|
|
594
638
|
d.className = "rte-modal";
|
|
595
639
|
const y = document.createElement("div");
|
|
596
640
|
y.className = "rte-modal-header";
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
641
|
+
const b = document.createElement("h3");
|
|
642
|
+
b.className = "rte-modal-title", b.textContent = "Insert Video";
|
|
643
|
+
const S = document.createElement("div");
|
|
644
|
+
S.setAttribute("role", "button"), S.tabIndex = 0, S.style.userSelect = "none", S.className = "rte-modal-close", S.innerHTML = "×", S.onclick = () => f.style.display = "none", y.appendChild(b), y.appendChild(S);
|
|
645
|
+
const k = document.createElement("div");
|
|
646
|
+
k.className = "rte-modal-form";
|
|
647
|
+
const R = document.createElement("label");
|
|
648
|
+
R.className = "rte-label", R.textContent = "Video URL";
|
|
649
|
+
const O = document.createElement("input");
|
|
650
|
+
O.type = "url", O.className = "rte-input", O.placeholder = "https://... or YouTube URL";
|
|
607
651
|
const M = document.createElement("div");
|
|
608
652
|
M.className = "rte-preview-label", M.textContent = "Preview";
|
|
609
|
-
const
|
|
610
|
-
|
|
653
|
+
const Y = document.createElement("div");
|
|
654
|
+
Y.className = "rte-modal-preview";
|
|
611
655
|
const re = document.createElement("div");
|
|
612
656
|
re.className = "rte-form-left";
|
|
613
|
-
const
|
|
614
|
-
|
|
657
|
+
const P = document.createElement("div");
|
|
658
|
+
P.className = "rte-form-right";
|
|
615
659
|
const ee = document.createElement("div");
|
|
616
|
-
ee.className = "rte-field", ee.appendChild(
|
|
660
|
+
ee.className = "rte-field", ee.appendChild(R), ee.appendChild(O);
|
|
617
661
|
const G = document.createElement("div");
|
|
618
662
|
G.className = "rte-dim-row";
|
|
619
663
|
const X = document.createElement("div");
|
|
@@ -627,39 +671,39 @@ function jo(h) {
|
|
|
627
671
|
const Q = document.createElement("label");
|
|
628
672
|
Q.className = "rte-label", Q.textContent = "Height (px)";
|
|
629
673
|
const ie = document.createElement("input");
|
|
630
|
-
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", te.appendChild(Q), te.appendChild(ie), G.appendChild(X), G.appendChild(te), re.appendChild(ee), re.appendChild(G),
|
|
674
|
+
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", te.appendChild(Q), te.appendChild(ie), G.appendChild(X), G.appendChild(te), re.appendChild(ee), re.appendChild(G), P.appendChild(M), P.appendChild(Y), k.appendChild(re), k.appendChild(P);
|
|
631
675
|
const Z = document.createElement("div");
|
|
632
676
|
Z.className = "rte-modal-actions";
|
|
633
677
|
const g = document.createElement("div");
|
|
634
678
|
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.className = "rte-btn-muted", g.textContent = "Cancel", g.onclick = () => f.style.display = "none";
|
|
635
679
|
const K = document.createElement("div");
|
|
636
|
-
K.setAttribute("role", "button"), K.tabIndex = 0, K.style.userSelect = "none", K.className = "rte-btn-primary", K.textContent = "Insert", Z.appendChild(g), Z.appendChild(K), d.appendChild(y), d.appendChild(
|
|
680
|
+
K.setAttribute("role", "button"), K.tabIndex = 0, K.style.userSelect = "none", K.className = "rte-btn-primary", K.textContent = "Insert", Z.appendChild(g), Z.appendChild(K), d.appendChild(y), d.appendChild(k), d.appendChild(Z), f.appendChild(d), document.body.appendChild(f);
|
|
637
681
|
const z = document.createElement("div");
|
|
638
682
|
z.setAttribute("role", "button"), z.tabIndex = 0, z.style.userSelect = "none";
|
|
639
683
|
const le = ye(Co, { width: 16, height: 16 });
|
|
640
|
-
z.appendChild(le), z.title = "Insert Video", z.style.border = "1px solid #e1e1e1", z.style.backgroundColor = "#ffffff", z.style.padding = "6px 10px", z.style.borderRadius = "3px", z.style.cursor = "pointer", z.style.color = "#000000", z.onmouseover = () => z.style.backgroundColor = "#f0f0f0", z.onmouseout = () => z.style.backgroundColor = "#ffffff", z.onmousedown = () =>
|
|
641
|
-
(
|
|
684
|
+
z.appendChild(le), z.title = "Insert Video", z.style.border = "1px solid #e1e1e1", z.style.backgroundColor = "#ffffff", z.style.padding = "6px 10px", z.style.borderRadius = "3px", z.style.cursor = "pointer", z.style.color = "#000000", z.onmouseover = () => z.style.backgroundColor = "#f0f0f0", z.onmouseout = () => z.style.backgroundColor = "#ffffff", z.onmousedown = () => he(), z.addEventListener("keydown", ($) => {
|
|
685
|
+
($.key === "Enter" || $.key === " ") && ($.preventDefault(), z.click());
|
|
642
686
|
}), z.onclick = () => {
|
|
643
|
-
|
|
687
|
+
Y.innerHTML = "<em>No URL entered</em>", O.value = "", f.style.display = "flex", O.focus();
|
|
644
688
|
};
|
|
645
689
|
const ce = () => {
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
|
|
690
|
+
const $ = O.value.trim(), H = U && U.value.trim() || "", ne = ie && ie.value.trim() || "", J = parseInt(H, 10), se = parseInt(ne, 10);
|
|
691
|
+
if (!$) {
|
|
692
|
+
Y.innerHTML = "<em>No preview</em>";
|
|
649
693
|
return;
|
|
650
694
|
}
|
|
651
|
-
const de =
|
|
695
|
+
const de = $.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
652
696
|
if (de) {
|
|
653
|
-
const
|
|
654
|
-
|
|
697
|
+
const x = de[1], D = Number.isFinite(J) ? J : 320, L = Number.isFinite(se) ? se : 180;
|
|
698
|
+
Y.innerHTML = `<iframe width="${D}" height="${L}" src="https://www.youtube.com/embed/${x}" frameborder="0" allowfullscreen></iframe>`;
|
|
655
699
|
return;
|
|
656
700
|
}
|
|
657
701
|
const pe = Number.isFinite(J) ? `${J}px` : "320px", fe = Number.isFinite(se) ? `${se}px` : "auto";
|
|
658
|
-
|
|
702
|
+
Y.innerHTML = `<video controls style="max-width:100%; width:${pe}; height:${fe};" src="${$}"></video>`;
|
|
659
703
|
};
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
704
|
+
O.oninput = ce, typeof U < "u" && (U.oninput = ce), typeof ie < "u" && (ie.oninput = ce), K.onclick = () => {
|
|
705
|
+
const $ = O.value.trim(), H = U && U.value.trim() || "", ne = ie && ie.value.trim() || "", J = parseInt(H, 10), se = parseInt(ne, 10);
|
|
706
|
+
if (!$) {
|
|
663
707
|
f.style.display = "none";
|
|
664
708
|
return;
|
|
665
709
|
}
|
|
@@ -669,28 +713,28 @@ function jo(h) {
|
|
|
669
713
|
f.style.display = "none";
|
|
670
714
|
return;
|
|
671
715
|
}
|
|
672
|
-
const pe = de.getRangeAt(0), fe =
|
|
673
|
-
let
|
|
716
|
+
const pe = de.getRangeAt(0), fe = $.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
717
|
+
let x;
|
|
674
718
|
if (fe) {
|
|
675
719
|
const L = fe[1], B = document.createElement("div"), xe = Number.isFinite(J) ? J : 560, we = Number.isFinite(se) ? se : 315;
|
|
676
|
-
B.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${L}" frameborder="0" allowfullscreen></iframe>`, B.contentEditable = "false", B.className = "editor-video-wrapper", B.style.display = "block", B.style.maxWidth = "100%", B.style.width = "auto", B.style.height = "auto", B.style.boxSizing = "border-box", B.style.userSelect = "none",
|
|
720
|
+
B.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${L}" frameborder="0" allowfullscreen></iframe>`, B.contentEditable = "false", B.className = "editor-video-wrapper", B.style.display = "block", B.style.maxWidth = "100%", B.style.width = "auto", B.style.height = "auto", B.style.boxSizing = "border-box", B.style.userSelect = "none", x = B;
|
|
677
721
|
} else {
|
|
678
722
|
const L = document.createElement("div"), B = document.createElement("video");
|
|
679
|
-
B.controls = !0, B.src =
|
|
723
|
+
B.controls = !0, B.src = $, Number.isFinite(J) && (B.width = J), Number.isFinite(se) && (B.height = se), B.style.maxWidth = "100%", B.style.display = "block", L.appendChild(B), L.contentEditable = "false", L.className = "editor-video-wrapper", L.style.display = "block", L.style.maxWidth = "100%", L.style.width = "auto", L.style.height = "auto", L.style.boxSizing = "border-box", L.style.userSelect = "none", x = L;
|
|
680
724
|
}
|
|
681
|
-
pe.insertNode(
|
|
725
|
+
pe.insertNode(x), de.removeAllRanges();
|
|
682
726
|
const D = document.createRange();
|
|
683
|
-
D.setStartAfter(
|
|
727
|
+
D.setStartAfter(x), D.collapse(!0), de.addRange(D), he(D);
|
|
684
728
|
try {
|
|
685
729
|
const L = V;
|
|
686
730
|
L && typeof L.focus == "function" && (L.focus(), L.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
687
731
|
} catch {
|
|
688
732
|
}
|
|
689
|
-
f.style.display = "none",
|
|
733
|
+
f.style.display = "none", O.value = "", Y.innerHTML = "";
|
|
690
734
|
};
|
|
691
735
|
const V = h.querySelector(".editor");
|
|
692
|
-
return V && V.addEventListener("click", (
|
|
693
|
-
const H =
|
|
736
|
+
return V && V.addEventListener("click", ($) => {
|
|
737
|
+
const H = $.target;
|
|
694
738
|
H && H.tagName === "VIDEO" && H.focus();
|
|
695
739
|
}), v.appendChild(z), v;
|
|
696
740
|
}
|
|
@@ -746,24 +790,24 @@ function Fo(h) {
|
|
|
746
790
|
<option value="6">24pt</option>
|
|
747
791
|
<option value="7">36pt</option>
|
|
748
792
|
`, y.style.border = "1px solid #e1e1e1", y.style.backgroundColor = "#ffffff", y.style.padding = "4px", y.style.borderRadius = "3px", y.style.color = "#000000", y.onchange = () => document.execCommand("fontSize", !1, y.value), v.appendChild(y);
|
|
749
|
-
const
|
|
750
|
-
v.appendChild(
|
|
751
|
-
const
|
|
752
|
-
v.appendChild(
|
|
753
|
-
const
|
|
754
|
-
v.appendChild(
|
|
755
|
-
const
|
|
756
|
-
v.appendChild(
|
|
757
|
-
const
|
|
758
|
-
v.appendChild(
|
|
793
|
+
const b = So();
|
|
794
|
+
v.appendChild(b);
|
|
795
|
+
const S = Mo();
|
|
796
|
+
v.appendChild(S);
|
|
797
|
+
const k = Ro();
|
|
798
|
+
v.appendChild(k);
|
|
799
|
+
const R = Io();
|
|
800
|
+
v.appendChild(R);
|
|
801
|
+
const O = Oo();
|
|
802
|
+
v.appendChild(O);
|
|
759
803
|
const M = Ao();
|
|
760
804
|
v.appendChild(M);
|
|
761
|
-
const
|
|
762
|
-
v.appendChild(
|
|
805
|
+
const Y = Po();
|
|
806
|
+
v.appendChild(Y);
|
|
763
807
|
const re = No(h);
|
|
764
808
|
v.appendChild(re);
|
|
765
|
-
const
|
|
766
|
-
v.appendChild(
|
|
809
|
+
const P = zo();
|
|
810
|
+
v.appendChild(P);
|
|
767
811
|
const ee = Lo();
|
|
768
812
|
v.appendChild(ee);
|
|
769
813
|
const G = jo(h);
|
|
@@ -779,25 +823,37 @@ function Ho(h, v) {
|
|
|
779
823
|
d.preventDefault(), d.stopPropagation();
|
|
780
824
|
const y = d.dataTransfer?.files;
|
|
781
825
|
if (y && y.length > 0)
|
|
782
|
-
for (let
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
|
|
826
|
+
for (let b = 0; b < y.length; b++) {
|
|
827
|
+
const S = y[b];
|
|
828
|
+
if (S.type.startsWith("image/")) {
|
|
829
|
+
const k = new FileReader();
|
|
830
|
+
k.onload = (R) => {
|
|
831
|
+
const O = document.createElement("img");
|
|
832
|
+
O.src = R.target?.result, O.style.maxWidth = "100%", O.style.width = "100%", O.style.height = "auto", O.style.cursor = "pointer", O.draggable = !1;
|
|
789
833
|
const M = document.createElement("div");
|
|
790
|
-
M.className = "editor-image-wrapper", M.style.display = "inline-block", M.style.position = "relative", M.style.maxWidth = "100%", M.style.width = "auto", M.style.height = "auto", M.contentEditable = "false", M.style.userSelect = "none", M.style.boxSizing = "border-box", M.style.touchAction = "none", M.appendChild(
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
},
|
|
834
|
+
M.className = "editor-image-wrapper", M.style.display = "inline-block", M.style.position = "relative", M.style.maxWidth = "100%", M.style.width = "auto", M.style.height = "auto", M.contentEditable = "false", M.style.userSelect = "none", M.style.boxSizing = "border-box", M.style.touchAction = "none", M.appendChild(O);
|
|
835
|
+
const Y = document.createElement("div");
|
|
836
|
+
Y.contentEditable = "true", Y.style.margin = "10px 0", Y.style.textAlign = "left", Y.style.display = "block", Y.appendChild(M), f.appendChild(Y);
|
|
837
|
+
}, k.readAsDataURL(S);
|
|
794
838
|
}
|
|
795
839
|
}
|
|
796
840
|
}), f.addEventListener("click", (d) => {
|
|
797
841
|
const y = d.target;
|
|
798
|
-
let
|
|
799
|
-
y.tagName === "IMG" && (
|
|
800
|
-
|
|
842
|
+
let b = y;
|
|
843
|
+
if (y.tagName === "IMG" && (b = y.parentElement), b && b.classList.contains("editor-image-wrapper")) {
|
|
844
|
+
v(b);
|
|
845
|
+
const S = b.parentElement;
|
|
846
|
+
if (S && S.tagName === "DIV" && S.querySelector(".editor-image-wrapper"))
|
|
847
|
+
try {
|
|
848
|
+
const k = window.getSelection();
|
|
849
|
+
if (k) {
|
|
850
|
+
const R = document.createRange();
|
|
851
|
+
R.selectNode(S), k.removeAllRanges(), k.addRange(R), he();
|
|
852
|
+
}
|
|
853
|
+
} catch {
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}), f.addEventListener("keyup", () => he()), f.addEventListener("mouseup", () => he()), f.addEventListener("focus", () => he()), window.addEventListener("selectionchange", () => {
|
|
801
857
|
try {
|
|
802
858
|
const d = window.getSelection();
|
|
803
859
|
if (!d || !d.anchorNode) return;
|
|
@@ -805,7 +861,7 @@ function Ho(h, v) {
|
|
|
805
861
|
for (; y && y.nodeType !== Node.ELEMENT_NODE; )
|
|
806
862
|
y = y.parentNode;
|
|
807
863
|
if (!y) return;
|
|
808
|
-
f.contains(y) &&
|
|
864
|
+
f.contains(y) && he();
|
|
809
865
|
} catch {
|
|
810
866
|
}
|
|
811
867
|
}), f;
|
|
@@ -833,7 +889,7 @@ function Vo() {
|
|
|
833
889
|
for (var e = 1; e < arguments.length; e++) {
|
|
834
890
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
835
891
|
e % 2 ? f(Object(n), !0).forEach((function(r) {
|
|
836
|
-
|
|
892
|
+
R(t, r, n[r]);
|
|
837
893
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : f(Object(n)).forEach((function(r) {
|
|
838
894
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
839
895
|
}));
|
|
@@ -847,40 +903,40 @@ function Vo() {
|
|
|
847
903
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
848
904
|
}, y(t);
|
|
849
905
|
}
|
|
850
|
-
function
|
|
906
|
+
function b(t, e) {
|
|
851
907
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
852
908
|
}
|
|
853
|
-
function
|
|
909
|
+
function S(t, e) {
|
|
854
910
|
for (var n = 0; n < e.length; n++) {
|
|
855
911
|
var r = e[n];
|
|
856
912
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, G(r.key), r);
|
|
857
913
|
}
|
|
858
914
|
}
|
|
859
|
-
function
|
|
860
|
-
return e &&
|
|
915
|
+
function k(t, e, n) {
|
|
916
|
+
return e && S(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
861
917
|
}
|
|
862
|
-
function
|
|
918
|
+
function R(t, e, n) {
|
|
863
919
|
return (e = G(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
864
920
|
}
|
|
865
|
-
function
|
|
921
|
+
function O(t, e) {
|
|
866
922
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
867
|
-
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e &&
|
|
923
|
+
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && Y(t, e);
|
|
868
924
|
}
|
|
869
925
|
function M(t) {
|
|
870
926
|
return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
871
927
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
872
928
|
}, M(t);
|
|
873
929
|
}
|
|
874
|
-
function
|
|
875
|
-
return
|
|
930
|
+
function Y(t, e) {
|
|
931
|
+
return Y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
876
932
|
return n.__proto__ = r, n;
|
|
877
|
-
},
|
|
933
|
+
}, Y(t, e);
|
|
878
934
|
}
|
|
879
935
|
function re(t) {
|
|
880
936
|
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
881
937
|
return t;
|
|
882
938
|
}
|
|
883
|
-
function
|
|
939
|
+
function P(t) {
|
|
884
940
|
var e = (function() {
|
|
885
941
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
886
942
|
if (typeof Proxy == "function") return !0;
|
|
@@ -995,9 +1051,9 @@ function Vo() {
|
|
|
995
1051
|
return t.search("drag") === 0;
|
|
996
1052
|
} }, ce = le, V = { init: function(t) {
|
|
997
1053
|
var e = t;
|
|
998
|
-
V.document = e.document, V.DocumentFragment = e.DocumentFragment ||
|
|
1054
|
+
V.document = e.document, V.DocumentFragment = e.DocumentFragment || $, V.SVGElement = e.SVGElement || $, V.SVGSVGElement = e.SVGSVGElement || $, V.SVGElementInstance = e.SVGElementInstance || $, V.Element = e.Element || $, V.HTMLElement = e.HTMLElement || V.Element, V.Event = e.Event, V.Touch = e.Touch || $, V.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
999
1055
|
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
1000
|
-
function
|
|
1056
|
+
function $() {
|
|
1001
1057
|
}
|
|
1002
1058
|
var H = V, ne = { init: function(t) {
|
|
1003
1059
|
var e = H.Element, n = t.navigator || {};
|
|
@@ -1029,11 +1085,11 @@ function Vo() {
|
|
|
1029
1085
|
function fe(t, e) {
|
|
1030
1086
|
return U !== oe && (e = e.replace(/\/deep\//g, " ")), t[J.prefixedMatchesSelector](e);
|
|
1031
1087
|
}
|
|
1032
|
-
var
|
|
1088
|
+
var x = function(t) {
|
|
1033
1089
|
return t.parentNode || t.host;
|
|
1034
1090
|
};
|
|
1035
1091
|
function D(t, e) {
|
|
1036
|
-
for (var n, r = [], o = t; (n =
|
|
1092
|
+
for (var n, r = [], o = t; (n = x(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
|
|
1037
1093
|
return r;
|
|
1038
1094
|
}
|
|
1039
1095
|
function L(t, e, n) {
|
|
@@ -1065,7 +1121,7 @@ function Vo() {
|
|
|
1065
1121
|
function Ee(t) {
|
|
1066
1122
|
return !!g.string(t) && (H.document.querySelector(t), !0);
|
|
1067
1123
|
}
|
|
1068
|
-
function
|
|
1124
|
+
function I(t, e) {
|
|
1069
1125
|
for (var n in e) t[n] = e[n];
|
|
1070
1126
|
return t;
|
|
1071
1127
|
}
|
|
@@ -1080,7 +1136,7 @@ function Vo() {
|
|
|
1080
1136
|
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
1081
1137
|
}
|
|
1082
1138
|
function vt(t) {
|
|
1083
|
-
return !t || "x" in t && "y" in t || ((t =
|
|
1139
|
+
return !t || "x" in t && "y" in t || ((t = I({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
|
|
1084
1140
|
}
|
|
1085
1141
|
function et(t, e, n) {
|
|
1086
1142
|
t.left && (e.left += n.x), t.right && (e.right += n.x), t.top && (e.top += n.y), t.bottom && (e.bottom += n.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
|
|
@@ -1186,9 +1242,9 @@ function Vo() {
|
|
|
1186
1242
|
}
|
|
1187
1243
|
var ot = (function() {
|
|
1188
1244
|
function t(e) {
|
|
1189
|
-
|
|
1245
|
+
b(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
1190
1246
|
}
|
|
1191
|
-
return
|
|
1247
|
+
return k(t, [{ key: "preventDefault", value: function() {
|
|
1192
1248
|
} }, { key: "stopPropagation", value: function() {
|
|
1193
1249
|
this.propagationStopped = !0;
|
|
1194
1250
|
} }, { key: "stopImmediatePropagation", value: function() {
|
|
@@ -1213,15 +1269,15 @@ function Vo() {
|
|
|
1213
1269
|
}, Be = function(t, e) {
|
|
1214
1270
|
return t[He(t, e)];
|
|
1215
1271
|
}, Pe = (function(t) {
|
|
1216
|
-
|
|
1217
|
-
var e =
|
|
1272
|
+
O(n, t);
|
|
1273
|
+
var e = P(n);
|
|
1218
1274
|
function n(r, o, i) {
|
|
1219
1275
|
var a;
|
|
1220
|
-
|
|
1276
|
+
b(this, n), (a = e.call(this, o._interaction)).dropzone = void 0, a.dragEvent = void 0, a.relatedTarget = void 0, a.draggable = void 0, a.propagationStopped = !1, a.immediatePropagationStopped = !1;
|
|
1221
1277
|
var s = i === "dragleave" ? r.prev : r.cur, l = s.element, u = s.dropzone;
|
|
1222
1278
|
return a.type = i, a.target = l, a.currentTarget = l, a.dropzone = u, a.dragEvent = o, a.relatedTarget = o.target, a.draggable = o.interactable, a.timeStamp = o.timeStamp, a;
|
|
1223
1279
|
}
|
|
1224
|
-
return
|
|
1280
|
+
return k(n, [{ key: "reject", value: function() {
|
|
1225
1281
|
var r = this, o = this._interaction.dropState;
|
|
1226
1282
|
if (this.type === "dropactivate" || this.dropzone && o.cur.dropzone === this.dropzone && o.cur.element === this.target) if (o.prev.dropzone = this.dropzone, o.prev.element = this.target, o.rejected = !0, o.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
|
|
1227
1283
|
var i = o.activeDrops, a = He(i, (function(l) {
|
|
@@ -1269,12 +1325,12 @@ function Vo() {
|
|
|
1269
1325
|
var u = l[s], c = u.dropzone, p = u.element, m = u.rect, E = c.dropCheck(e, n, o, i, p, m);
|
|
1270
1326
|
a.push(E ? p : null);
|
|
1271
1327
|
}
|
|
1272
|
-
var w = (function(
|
|
1273
|
-
for (var
|
|
1274
|
-
var N =
|
|
1275
|
-
if (N && W !==
|
|
1276
|
-
var
|
|
1277
|
-
if (
|
|
1328
|
+
var w = (function(C) {
|
|
1329
|
+
for (var _, T, A, F = [], W = 0; W < C.length; W++) {
|
|
1330
|
+
var N = C[W], q = C[_];
|
|
1331
|
+
if (N && W !== _) if (q) {
|
|
1332
|
+
var me = x(N), ae = x(q);
|
|
1333
|
+
if (me !== N.ownerDocument) if (ae !== N.ownerDocument) if (me !== ae) {
|
|
1278
1334
|
F = F.length ? F : D(q);
|
|
1279
1335
|
var ge = void 0;
|
|
1280
1336
|
if (q instanceof H.HTMLElement && N instanceof H.SVGElement && !(N instanceof H.SVGSVGElement)) {
|
|
@@ -1285,17 +1341,17 @@ function Vo() {
|
|
|
1285
1341
|
var ft = [be[Se - 1], be[Se], F[Se]];
|
|
1286
1342
|
if (ft[0]) for (var Ue = ft[0].lastChild; Ue; ) {
|
|
1287
1343
|
if (Ue === ft[1]) {
|
|
1288
|
-
|
|
1344
|
+
_ = W, F = be;
|
|
1289
1345
|
break;
|
|
1290
1346
|
}
|
|
1291
1347
|
if (Ue === ft[2]) break;
|
|
1292
1348
|
Ue = Ue.previousSibling;
|
|
1293
1349
|
}
|
|
1294
|
-
} else
|
|
1295
|
-
else
|
|
1296
|
-
} else
|
|
1350
|
+
} else A = q, (parseInt(Q(T = N).getComputedStyle(T).zIndex, 10) || 0) >= (parseInt(Q(A).getComputedStyle(A).zIndex, 10) || 0) && (_ = W);
|
|
1351
|
+
else _ = W;
|
|
1352
|
+
} else _ = W;
|
|
1297
1353
|
}
|
|
1298
|
-
return
|
|
1354
|
+
return _;
|
|
1299
1355
|
})(a);
|
|
1300
1356
|
return r.activeDrops[w] || null;
|
|
1301
1357
|
}
|
|
@@ -1332,26 +1388,26 @@ function Vo() {
|
|
|
1332
1388
|
return g.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
1333
1389
|
})(this, i);
|
|
1334
1390
|
}, r.prototype.dropCheck = function(i, a, s, l, u, c) {
|
|
1335
|
-
return (function(p, m, E, w,
|
|
1336
|
-
var
|
|
1337
|
-
if (!(
|
|
1391
|
+
return (function(p, m, E, w, C, _, T) {
|
|
1392
|
+
var A = !1;
|
|
1393
|
+
if (!(T = T || p.getRect(_))) return !!p.options.drop.checker && p.options.drop.checker(m, E, A, p, _, w, C);
|
|
1338
1394
|
var F = p.options.drop.overlap;
|
|
1339
1395
|
if (F === "pointer") {
|
|
1340
|
-
var W = Le(w,
|
|
1396
|
+
var W = Le(w, C, "drag"), N = qt(m);
|
|
1341
1397
|
N.x += W.x, N.y += W.y;
|
|
1342
|
-
var q = N.x >
|
|
1343
|
-
|
|
1398
|
+
var q = N.x > T.left && N.x < T.right, me = N.y > T.top && N.y < T.bottom;
|
|
1399
|
+
A = q && me;
|
|
1344
1400
|
}
|
|
1345
|
-
var ae = w.getRect(
|
|
1401
|
+
var ae = w.getRect(C);
|
|
1346
1402
|
if (ae && F === "center") {
|
|
1347
1403
|
var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
|
|
1348
|
-
|
|
1404
|
+
A = ge >= T.left && ge <= T.right && be >= T.top && be <= T.bottom;
|
|
1349
1405
|
}
|
|
1350
|
-
return ae && g.number(F) && (
|
|
1406
|
+
return ae && g.number(F) && (A = Math.max(0, Math.min(T.right, ae.right) - Math.max(T.left, ae.left)) * Math.max(0, Math.min(T.bottom, ae.bottom) - Math.max(T.top, ae.top)) / (ae.width * ae.height) >= F), p.options.drop.checker && (A = p.options.drop.checker(m, E, A, p, _, w, C)), A;
|
|
1351
1407
|
})(this, i, a, s, l, u, c);
|
|
1352
1408
|
}, n.dynamicDrop = function(i) {
|
|
1353
1409
|
return g.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
|
|
1354
|
-
},
|
|
1410
|
+
}, I(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = Jt.defaults;
|
|
1355
1411
|
}, listeners: { "interactions:before-action-start": function(t) {
|
|
1356
1412
|
var e = t.interaction;
|
|
1357
1413
|
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
|
@@ -1452,7 +1508,7 @@ function Vo() {
|
|
|
1452
1508
|
var n = e.iEvent, r = e.interaction;
|
|
1453
1509
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1454
1510
|
var o = n, i = r.rect;
|
|
1455
|
-
r._rects = { start:
|
|
1511
|
+
r._rects = { start: I({}, i), corrected: I({}, i), previous: I({}, i), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, o.edges = r.prepared.edges, o.rect = r._rects.corrected, o.deltaRect = r._rects.delta;
|
|
1456
1512
|
}
|
|
1457
1513
|
})(t), Qt(t);
|
|
1458
1514
|
}, "interactions:action-move": function(t) {
|
|
@@ -1460,8 +1516,8 @@ function Vo() {
|
|
|
1460
1516
|
var n = e.iEvent, r = e.interaction;
|
|
1461
1517
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1462
1518
|
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, u = l.start, c = l.corrected, p = l.delta, m = l.previous;
|
|
1463
|
-
if (
|
|
1464
|
-
if (
|
|
1519
|
+
if (I(m, c), a) {
|
|
1520
|
+
if (I(c, s), i === "reposition") {
|
|
1465
1521
|
if (c.top > c.bottom) {
|
|
1466
1522
|
var E = c.top;
|
|
1467
1523
|
c.top = c.bottom, c.bottom = E;
|
|
@@ -1472,7 +1528,7 @@ function Vo() {
|
|
|
1472
1528
|
}
|
|
1473
1529
|
}
|
|
1474
1530
|
} else c.top = Math.min(s.top, u.bottom), c.bottom = Math.max(s.bottom, u.top), c.left = Math.min(s.left, u.right), c.right = Math.max(s.right, u.left);
|
|
1475
|
-
for (var
|
|
1531
|
+
for (var C in c.width = c.right - c.left, c.height = c.bottom - c.top, c) p[C] = c[C] - m[C];
|
|
1476
1532
|
o.edges = r.prepared.edges, o.rect = c, o.deltaRect = p;
|
|
1477
1533
|
}
|
|
1478
1534
|
})(t), Qt(t);
|
|
@@ -1485,7 +1541,7 @@ function Vo() {
|
|
|
1485
1541
|
}, "auto-start:check": function(t) {
|
|
1486
1542
|
var e = t.interaction, n = t.interactable, r = t.element, o = t.rect, i = t.buttons;
|
|
1487
1543
|
if (o) {
|
|
1488
|
-
var a =
|
|
1544
|
+
var a = I({}, e.coords.cur.page), s = n.options.resize;
|
|
1489
1545
|
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (i & s.mouseButtons) != 0)) {
|
|
1490
1546
|
if (g.object(s.edges)) {
|
|
1491
1547
|
var l = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
@@ -1670,7 +1726,7 @@ function Vo() {
|
|
|
1670
1726
|
}
|
|
1671
1727
|
var Jn = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1672
1728
|
var e = t.interactStatic, n = t.defaults;
|
|
1673
|
-
t.usePlugin(Gn), n.base.actionChecker = null, n.base.styleCursor = !0,
|
|
1729
|
+
t.usePlugin(Gn), n.base.actionChecker = null, n.base.styleCursor = !0, I(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
|
|
1674
1730
|
return an(r, t);
|
|
1675
1731
|
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: it, cursorElement: null };
|
|
1676
1732
|
}, listeners: { "interactions:down": function(t, e) {
|
|
@@ -1699,14 +1755,14 @@ function Vo() {
|
|
|
1699
1755
|
n.prepared.name = null;
|
|
1700
1756
|
for (var p = r, m = function(w) {
|
|
1701
1757
|
if (w !== n.interactable) {
|
|
1702
|
-
var
|
|
1703
|
-
if (!
|
|
1704
|
-
var
|
|
1705
|
-
if (
|
|
1706
|
-
if (!
|
|
1707
|
-
var F =
|
|
1708
|
-
return
|
|
1709
|
-
})(c, w) && _t.validateAction(
|
|
1758
|
+
var C = n.interactable.options.drag;
|
|
1759
|
+
if (!C.manualStart && w.testIgnoreAllow(C, p, r)) {
|
|
1760
|
+
var _ = w.getAction(n.downPointer, n.downEvent, n, p);
|
|
1761
|
+
if (_ && _.name === "drag" && (function(T, A) {
|
|
1762
|
+
if (!A) return !1;
|
|
1763
|
+
var F = A.options.drag.startAxis;
|
|
1764
|
+
return T === "xy" || F === "xy" || F === T;
|
|
1765
|
+
})(c, w) && _t.validateAction(_, w, p, r, e)) return w;
|
|
1710
1766
|
}
|
|
1711
1767
|
}
|
|
1712
1768
|
}; g.element(p); ) {
|
|
@@ -1788,9 +1844,9 @@ function Vo() {
|
|
|
1788
1844
|
}
|
|
1789
1845
|
var Rt = (function() {
|
|
1790
1846
|
function t(e) {
|
|
1791
|
-
|
|
1847
|
+
b(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = st(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1792
1848
|
}
|
|
1793
|
-
return
|
|
1849
|
+
return k(t, [{ key: "start", value: function(e, n) {
|
|
1794
1850
|
var r, o, i = e.phase, a = this.interaction, s = (function(u) {
|
|
1795
1851
|
var c = u.interactable.options[u.prepared.name], p = c.modifiers;
|
|
1796
1852
|
return p && p.length ? p : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(m) {
|
|
@@ -1800,7 +1856,7 @@ function Vo() {
|
|
|
1800
1856
|
return !!m;
|
|
1801
1857
|
}));
|
|
1802
1858
|
})(a);
|
|
1803
|
-
this.prepareStates(s), this.startEdges =
|
|
1859
|
+
this.prepareStates(s), this.startEdges = I({}, a.edges), this.edges = I({}, this.startEdges), this.startOffset = (r = a.rect, o = n, r ? { left: o.x - r.left, top: o.y - r.top, right: r.right - o.x, bottom: r.bottom - o.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
|
1804
1860
|
var l = this.fillArg({ phase: i, pageCoords: n, preEnd: !1 });
|
|
1805
1861
|
return this.result = st(), this.startAll(l), this.result = this.setAll(l);
|
|
1806
1862
|
} }, { key: "fillArg", value: function(e) {
|
|
@@ -1813,27 +1869,27 @@ function Vo() {
|
|
|
1813
1869
|
}
|
|
1814
1870
|
} }, { key: "setAll", value: function(e) {
|
|
1815
1871
|
var n = e.phase, r = e.preEnd, o = e.skipModifiers, i = e.rect, a = e.edges;
|
|
1816
|
-
e.coords =
|
|
1872
|
+
e.coords = I({}, e.pageCoords), e.rect = I({}, i), e.edges = I({}, a);
|
|
1817
1873
|
for (var s = o ? this.states.slice(o) : this.states, l = st(e.coords, e.rect), u = 0; u < s.length; u++) {
|
|
1818
|
-
var c, p = s[u], m = p.options, E =
|
|
1874
|
+
var c, p = s[u], m = p.options, E = I({}, e.coords), w = null;
|
|
1819
1875
|
(c = p.methods) != null && c.set && this.shouldDo(m, r, n) && (e.state = p, w = p.methods.set(e), et(e.edges, e.rect, { x: e.coords.x - E.x, y: e.coords.y - E.y })), l.eventProps.push(w);
|
|
1820
1876
|
}
|
|
1821
|
-
|
|
1822
|
-
var
|
|
1823
|
-
if (
|
|
1824
|
-
var
|
|
1825
|
-
l.changed =
|
|
1877
|
+
I(this.edges, e.edges), l.delta.x = e.coords.x - e.pageCoords.x, l.delta.y = e.coords.y - e.pageCoords.y, l.rectDelta.left = e.rect.left - i.left, l.rectDelta.right = e.rect.right - i.right, l.rectDelta.top = e.rect.top - i.top, l.rectDelta.bottom = e.rect.bottom - i.bottom;
|
|
1878
|
+
var C = this.result.coords, _ = this.result.rect;
|
|
1879
|
+
if (C && _) {
|
|
1880
|
+
var T = l.rect.left !== _.left || l.rect.right !== _.right || l.rect.top !== _.top || l.rect.bottom !== _.bottom;
|
|
1881
|
+
l.changed = T || C.x !== l.coords.x || C.y !== l.coords.y;
|
|
1826
1882
|
}
|
|
1827
1883
|
return l;
|
|
1828
1884
|
} }, { key: "applyToInteraction", value: function(e) {
|
|
1829
1885
|
var n = this.interaction, r = e.phase, o = n.coords.cur, i = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
|
|
1830
|
-
r === "start" &&
|
|
1886
|
+
r === "start" && I(this.startDelta, a.delta);
|
|
1831
1887
|
for (var u = 0, c = [[i, s], [o, l]]; u < c.length; u++) {
|
|
1832
1888
|
var p = c[u], m = p[0], E = p[1];
|
|
1833
1889
|
m.page.x += E.x, m.page.y += E.y, m.client.x += E.x, m.client.y += E.y;
|
|
1834
1890
|
}
|
|
1835
|
-
var w = this.result.rectDelta,
|
|
1836
|
-
|
|
1891
|
+
var w = this.result.rectDelta, C = e.rect || n.rect;
|
|
1892
|
+
C.left += w.left, C.right += w.right, C.top += w.top, C.bottom += w.bottom, C.width = C.right - C.left, C.height = C.bottom - C.top;
|
|
1837
1893
|
} }, { key: "setAndApply", value: function(e) {
|
|
1838
1894
|
var n = this.interaction, r = e.phase, o = e.preEnd, i = e.skipModifiers, a = this.setAll(this.fillArg({ preEnd: o, phase: r, pageCoords: e.modifiedCoords || n.coords.cur.page }));
|
|
1839
1895
|
if (this.result = a, !a.changed && (!i || i < this.states.length) && n.interacting()) return !1;
|
|
@@ -1857,7 +1913,7 @@ function Vo() {
|
|
|
1857
1913
|
} }, { key: "stop", value: function(e) {
|
|
1858
1914
|
var n = e.interaction;
|
|
1859
1915
|
if (this.states && this.states.length) {
|
|
1860
|
-
var r =
|
|
1916
|
+
var r = I({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
|
|
1861
1917
|
this.fillArg(r);
|
|
1862
1918
|
for (var o = 0, i = this.states; o < i.length; o++) {
|
|
1863
1919
|
var a = i[o];
|
|
@@ -1886,7 +1942,7 @@ function Vo() {
|
|
|
1886
1942
|
} }, { key: "copyFrom", value: function(e) {
|
|
1887
1943
|
this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map((function(n) {
|
|
1888
1944
|
return De(n);
|
|
1889
|
-
})), this.result = st(
|
|
1945
|
+
})), this.result = st(I({}, e.result.coords), I({}, e.result.rect));
|
|
1890
1946
|
} }, { key: "destroy", value: function() {
|
|
1891
1947
|
for (var e in this) this[e] = null;
|
|
1892
1948
|
} }]), t;
|
|
@@ -1932,15 +1988,15 @@ function Vo() {
|
|
|
1932
1988
|
}, "interactions:stop": function(t) {
|
|
1933
1989
|
return t.interaction.modification.stop(t);
|
|
1934
1990
|
} } }, cn = or, un = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, It = (function(t) {
|
|
1935
|
-
|
|
1936
|
-
var e =
|
|
1991
|
+
O(n, t);
|
|
1992
|
+
var e = P(n);
|
|
1937
1993
|
function n(r, o, i, a, s, l, u) {
|
|
1938
1994
|
var c;
|
|
1939
|
-
|
|
1940
|
-
var p = r.interactable, m = (p && p.options || un).deltaSource, E = Le(p, s, i), w = a === "start",
|
|
1941
|
-
return c.page =
|
|
1995
|
+
b(this, n), (c = e.call(this, r)).relatedTarget = null, c.screenX = void 0, c.screenY = void 0, c.button = void 0, c.buttons = void 0, c.ctrlKey = void 0, c.shiftKey = void 0, c.altKey = void 0, c.metaKey = void 0, c.page = void 0, c.client = void 0, c.delta = void 0, c.rect = void 0, c.x0 = void 0, c.y0 = void 0, c.t0 = void 0, c.dt = void 0, c.duration = void 0, c.clientX0 = void 0, c.clientY0 = void 0, c.velocity = void 0, c.speed = void 0, c.swipe = void 0, c.axes = void 0, c.preEnd = void 0, s = s || r.element;
|
|
1996
|
+
var p = r.interactable, m = (p && p.options || un).deltaSource, E = Le(p, s, i), w = a === "start", C = a === "end", _ = w ? re(c) : r.prevEvent, T = w ? r.coords.start : C ? { page: _.page, client: _.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1997
|
+
return c.page = I({}, T.page), c.client = I({}, T.client), c.rect = I({}, r.rect), c.timeStamp = T.timeStamp, C || (c.page.x -= E.x, c.page.y -= E.y, c.client.x -= E.x, c.client.y -= E.y), c.ctrlKey = o.ctrlKey, c.altKey = o.altKey, c.shiftKey = o.shiftKey, c.metaKey = o.metaKey, c.button = o.button, c.buttons = o.buttons, c.target = s, c.currentTarget = s, c.preEnd = l, c.type = u || i + (a || ""), c.interactable = p, c.t0 = w ? r.pointers[r.pointers.length - 1].downTime : _.t0, c.x0 = r.coords.start.page.x - E.x, c.y0 = r.coords.start.page.y - E.y, c.clientX0 = r.coords.start.client.x - E.x, c.clientY0 = r.coords.start.client.y - E.y, c.delta = w || C ? { x: 0, y: 0 } : { x: c[m].x - _[m].x, y: c[m].y - _[m].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = I({}, r.coords.velocity[m]), c.speed = je(c.velocity.x, c.velocity.y), c.swipe = C || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
1942
1998
|
}
|
|
1943
|
-
return
|
|
1999
|
+
return k(n, [{ key: "getSwipe", value: function() {
|
|
1944
2000
|
var r = this._interaction;
|
|
1945
2001
|
if (r.prevEvent.speed < 600 || this.timeStamp - r.prevEvent.timeStamp > 150) return null;
|
|
1946
2002
|
var o = 180 * Math.atan2(r.prevEvent.velocityY, r.prevEvent.velocityX) / Math.PI;
|
|
@@ -1987,8 +2043,8 @@ function Vo() {
|
|
|
1987
2043
|
}, set: function(t) {
|
|
1988
2044
|
this.velocity.y = t;
|
|
1989
2045
|
} } });
|
|
1990
|
-
var ir =
|
|
1991
|
-
|
|
2046
|
+
var ir = k((function t(e, n, r, o, i) {
|
|
2047
|
+
b(this, t), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e, this.pointer = n, this.event = r, this.downTime = o, this.downTarget = i;
|
|
1992
2048
|
})), ar = (function(t) {
|
|
1993
2049
|
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
1994
2050
|
})({}), dn = (function(t) {
|
|
@@ -1996,7 +2052,7 @@ function Vo() {
|
|
|
1996
2052
|
})({}), sr = 0, lr = (function() {
|
|
1997
2053
|
function t(e) {
|
|
1998
2054
|
var n = this, r = e.pointerType, o = e.scopeFire;
|
|
1999
|
-
|
|
2055
|
+
b(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = qe((function(c) {
|
|
2000
2056
|
this.move(c);
|
|
2001
2057
|
}), "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = sr++, this._scopeFire = o, this.pointerType = r;
|
|
2002
2058
|
var i = this;
|
|
@@ -2015,13 +2071,13 @@ function Vo() {
|
|
|
2015
2071
|
for (var u in dn) l(u);
|
|
2016
2072
|
this._scopeFire("interactions:new", { interaction: this });
|
|
2017
2073
|
}
|
|
2018
|
-
return
|
|
2074
|
+
return k(t, [{ key: "pointerMoveTolerance", get: function() {
|
|
2019
2075
|
return 1;
|
|
2020
2076
|
} }, { key: "pointerDown", value: function(e, n, r) {
|
|
2021
2077
|
var o = this.updatePointer(e, n, r, !0), i = this.pointers[o];
|
|
2022
2078
|
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: o, pointerInfo: i, type: "down", interaction: this });
|
|
2023
2079
|
} }, { key: "start", value: function(e, n, r) {
|
|
2024
|
-
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (St(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ?
|
|
2080
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (St(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? I({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
|
2025
2081
|
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
2026
2082
|
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
2027
2083
|
var o, i, a = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
|
|
@@ -2029,7 +2085,7 @@ function Vo() {
|
|
|
2029
2085
|
var s, l, u, c = this.getPointerIndex(e), p = { pointer: e, pointerIndex: c, pointerInfo: this.pointers[c], event: n, type: "move", eventTarget: r, dx: o, dy: i, duplicate: a, interaction: this };
|
|
2030
2086
|
a || (s = this.coords.velocity, l = this.coords.delta, u = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / u, s.page.y = l.page.y / u, s.client.x = l.client.x / u, s.client.y = l.client.y / u, s.timeStamp = u), this._scopeFire("interactions:move", p), a || this.simulation || (this.interacting() && (p.type = null, this.move(p)), this.pointerWasMoved && nt(this.coords.prev, this.coords.cur));
|
|
2031
2087
|
} }, { key: "move", value: function(e) {
|
|
2032
|
-
e && e.event || Ht(this.coords.delta), (e =
|
|
2088
|
+
e && e.event || Ht(this.coords.delta), (e = I({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
2033
2089
|
} }, { key: "pointerUp", value: function(e, n, r, o) {
|
|
2034
2090
|
var i = this.getPointerIndex(e);
|
|
2035
2091
|
i === -1 && (i = this.updatePointer(e, n, r, !1));
|
|
@@ -2117,9 +2173,9 @@ function Vo() {
|
|
|
2117
2173
|
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
2118
2174
|
} } }, hn = ur, dr = (function() {
|
|
2119
2175
|
function t(e) {
|
|
2120
|
-
|
|
2176
|
+
b(this, t), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e;
|
|
2121
2177
|
}
|
|
2122
|
-
return
|
|
2178
|
+
return k(t, [{ key: "start", value: function(e) {
|
|
2123
2179
|
var n = this.interaction, r = lt(n);
|
|
2124
2180
|
if (!r || !r.enabled) return !1;
|
|
2125
2181
|
var o = n.coords.velocity.client, i = je(o.x, o.y), a = this.modification || (this.modification = new Rt(n));
|
|
@@ -2225,9 +2281,9 @@ function Vo() {
|
|
|
2225
2281
|
}
|
|
2226
2282
|
var yn = (function() {
|
|
2227
2283
|
function t(e) {
|
|
2228
|
-
|
|
2284
|
+
b(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = I({}, e || {});
|
|
2229
2285
|
}
|
|
2230
|
-
return
|
|
2286
|
+
return k(t, [{ key: "fire", value: function(e) {
|
|
2231
2287
|
var n, r = this.global;
|
|
2232
2288
|
(n = this.types[e.type]) && gn(e, n), !e.propagationStopped && r && (n = r[e.type]) && gn(e, n);
|
|
2233
2289
|
} }, { key: "on", value: function(e, n) {
|
|
@@ -2247,9 +2303,9 @@ function Vo() {
|
|
|
2247
2303
|
} }]), t;
|
|
2248
2304
|
})(), hr = (function() {
|
|
2249
2305
|
function t(e) {
|
|
2250
|
-
|
|
2306
|
+
b(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, tt(this, e);
|
|
2251
2307
|
}
|
|
2252
|
-
return
|
|
2308
|
+
return k(t, [{ key: "preventOriginalDefault", value: function() {
|
|
2253
2309
|
this.originalEvent.preventDefault();
|
|
2254
2310
|
} }, { key: "stopPropagation", value: function() {
|
|
2255
2311
|
this.originalEvent.stopPropagation();
|
|
@@ -2265,86 +2321,86 @@ function Vo() {
|
|
|
2265
2321
|
}
|
|
2266
2322
|
var vr = { id: "events", install: function(t) {
|
|
2267
2323
|
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, p, m, E, w) {
|
|
2268
|
-
var
|
|
2324
|
+
var C = Ye(w);
|
|
2269
2325
|
if (!r[m]) {
|
|
2270
2326
|
r[m] = [];
|
|
2271
|
-
for (var
|
|
2272
|
-
var
|
|
2273
|
-
a(
|
|
2327
|
+
for (var _ = 0; _ < o.length; _++) {
|
|
2328
|
+
var T = o[_];
|
|
2329
|
+
a(T, m, l), a(T, m, u, !0);
|
|
2274
2330
|
}
|
|
2275
2331
|
}
|
|
2276
|
-
var
|
|
2332
|
+
var A = r[m], F = Be(A, (function(W) {
|
|
2277
2333
|
return W.selector === c && W.context === p;
|
|
2278
2334
|
}));
|
|
2279
|
-
F || (F = { selector: c, context: p, listeners: [] },
|
|
2335
|
+
F || (F = { selector: c, context: p, listeners: [] }, A.push(F)), F.listeners.push({ func: E, options: C });
|
|
2280
2336
|
}, removeDelegate: function(c, p, m, E, w) {
|
|
2281
|
-
var
|
|
2282
|
-
if (
|
|
2283
|
-
for (
|
|
2284
|
-
var F =
|
|
2337
|
+
var C, _ = Ye(w), T = r[m], A = !1;
|
|
2338
|
+
if (T)
|
|
2339
|
+
for (C = T.length - 1; C >= 0; C--) {
|
|
2340
|
+
var F = T[C];
|
|
2285
2341
|
if (F.selector === c && F.context === p) {
|
|
2286
2342
|
for (var W = F.listeners, N = W.length - 1; N >= 0; N--) {
|
|
2287
2343
|
var q = W[N];
|
|
2288
|
-
if (q.func === E && ct(q.options,
|
|
2289
|
-
W.splice(N, 1), W.length || (
|
|
2344
|
+
if (q.func === E && ct(q.options, _)) {
|
|
2345
|
+
W.splice(N, 1), W.length || (T.splice(C, 1), s(p, m, l), s(p, m, u, !0)), A = !0;
|
|
2290
2346
|
break;
|
|
2291
2347
|
}
|
|
2292
2348
|
}
|
|
2293
|
-
if (
|
|
2349
|
+
if (A) break;
|
|
2294
2350
|
}
|
|
2295
2351
|
}
|
|
2296
2352
|
}, delegateListener: l, delegateUseCapture: u, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
2297
2353
|
function a(c, p, m, E) {
|
|
2298
2354
|
if (c.addEventListener) {
|
|
2299
|
-
var w = Ye(E),
|
|
2300
|
-
return
|
|
2355
|
+
var w = Ye(E), C = Be(n, (function(_) {
|
|
2356
|
+
return _.eventTarget === c;
|
|
2301
2357
|
}));
|
|
2302
|
-
|
|
2303
|
-
return
|
|
2304
|
-
})) || (c.addEventListener(p, m, i.supportsOptions ? w : w.capture),
|
|
2358
|
+
C || (C = { eventTarget: c, events: {} }, n.push(C)), C.events[p] || (C.events[p] = []), Be(C.events[p], (function(_) {
|
|
2359
|
+
return _.func === m && ct(_.options, w);
|
|
2360
|
+
})) || (c.addEventListener(p, m, i.supportsOptions ? w : w.capture), C.events[p].push({ func: m, options: w }));
|
|
2305
2361
|
}
|
|
2306
2362
|
}
|
|
2307
2363
|
function s(c, p, m, E) {
|
|
2308
2364
|
if (c.addEventListener && c.removeEventListener) {
|
|
2309
|
-
var w = He(n, (function(
|
|
2310
|
-
return
|
|
2311
|
-
})),
|
|
2312
|
-
if (
|
|
2313
|
-
var
|
|
2314
|
-
if (
|
|
2365
|
+
var w = He(n, (function(me) {
|
|
2366
|
+
return me.eventTarget === c;
|
|
2367
|
+
})), C = n[w];
|
|
2368
|
+
if (C && C.events) if (p !== "all") {
|
|
2369
|
+
var _ = !1, T = C.events[p];
|
|
2370
|
+
if (T) {
|
|
2315
2371
|
if (m === "all") {
|
|
2316
|
-
for (var
|
|
2317
|
-
var F =
|
|
2372
|
+
for (var A = T.length - 1; A >= 0; A--) {
|
|
2373
|
+
var F = T[A];
|
|
2318
2374
|
s(c, p, F.func, F.options);
|
|
2319
2375
|
}
|
|
2320
2376
|
return;
|
|
2321
2377
|
}
|
|
2322
|
-
for (var W = Ye(E), N = 0; N <
|
|
2323
|
-
var q =
|
|
2378
|
+
for (var W = Ye(E), N = 0; N < T.length; N++) {
|
|
2379
|
+
var q = T[N];
|
|
2324
2380
|
if (q.func === m && ct(q.options, W)) {
|
|
2325
|
-
c.removeEventListener(p, m, i.supportsOptions ? W : W.capture),
|
|
2381
|
+
c.removeEventListener(p, m, i.supportsOptions ? W : W.capture), T.splice(N, 1), T.length === 0 && (delete C.events[p], _ = !0);
|
|
2326
2382
|
break;
|
|
2327
2383
|
}
|
|
2328
2384
|
}
|
|
2329
2385
|
}
|
|
2330
|
-
|
|
2331
|
-
} else for (p in
|
|
2386
|
+
_ && !Object.keys(C.events).length && n.splice(w, 1);
|
|
2387
|
+
} else for (p in C.events) C.events.hasOwnProperty(p) && s(c, p, "all");
|
|
2332
2388
|
}
|
|
2333
2389
|
}
|
|
2334
2390
|
function l(c, p) {
|
|
2335
|
-
for (var m = Ye(p), E = new hr(c), w = r[c.type],
|
|
2336
|
-
for (var
|
|
2337
|
-
var
|
|
2338
|
-
if (fe(
|
|
2339
|
-
var N =
|
|
2340
|
-
E.currentTarget =
|
|
2391
|
+
for (var m = Ye(p), E = new hr(c), w = r[c.type], C = $t(c)[0], _ = C; g.element(_); ) {
|
|
2392
|
+
for (var T = 0; T < w.length; T++) {
|
|
2393
|
+
var A = w[T], F = A.selector, W = A.context;
|
|
2394
|
+
if (fe(_, F) && se(W, C) && se(W, _)) {
|
|
2395
|
+
var N = A.listeners;
|
|
2396
|
+
E.currentTarget = _;
|
|
2341
2397
|
for (var q = 0; q < N.length; q++) {
|
|
2342
|
-
var
|
|
2343
|
-
ct(
|
|
2398
|
+
var me = N[q];
|
|
2399
|
+
ct(me.options, m) && me.func(E);
|
|
2344
2400
|
}
|
|
2345
2401
|
}
|
|
2346
2402
|
}
|
|
2347
|
-
|
|
2403
|
+
_ = pe(_);
|
|
2348
2404
|
}
|
|
2349
2405
|
}
|
|
2350
2406
|
function u(c) {
|
|
@@ -2424,16 +2480,16 @@ function Vo() {
|
|
|
2424
2480
|
} else {
|
|
2425
2481
|
var w = !1;
|
|
2426
2482
|
if (!J.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2427
|
-
for (var
|
|
2483
|
+
for (var C = 0; C < r.length && !w; C++) w = r[C].pointerType !== "mouse" && r[C].pointerIsDown;
|
|
2428
2484
|
w = w || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2429
2485
|
}
|
|
2430
2486
|
if (!w) {
|
|
2431
|
-
var
|
|
2432
|
-
l.push([
|
|
2487
|
+
var _ = { pointer: n, pointerId: Fe(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, T = wn(_);
|
|
2488
|
+
l.push([_.pointer, _.eventTarget, _.curEventTarget, T]);
|
|
2433
2489
|
}
|
|
2434
2490
|
}
|
|
2435
|
-
for (var
|
|
2436
|
-
var F = l[
|
|
2491
|
+
for (var A = 0; A < l.length; A++) {
|
|
2492
|
+
var F = l[A], W = F[0], N = F[1], q = F[2];
|
|
2437
2493
|
F[3][t](W, n, N, q);
|
|
2438
2494
|
}
|
|
2439
2495
|
};
|
|
@@ -2471,12 +2527,12 @@ function Vo() {
|
|
|
2471
2527
|
for (var l = 0, u = t.interactions.list; l < u.length; l++)
|
|
2472
2528
|
u[l].documentBlur(s);
|
|
2473
2529
|
} }), t.prevTouchTime = 0, t.Interaction = (function(s) {
|
|
2474
|
-
|
|
2475
|
-
var l =
|
|
2530
|
+
O(u, s);
|
|
2531
|
+
var l = P(u);
|
|
2476
2532
|
function u() {
|
|
2477
|
-
return
|
|
2533
|
+
return b(this, u), l.apply(this, arguments);
|
|
2478
2534
|
}
|
|
2479
|
-
return
|
|
2535
|
+
return k(u, [{ key: "pointerMoveTolerance", get: function() {
|
|
2480
2536
|
return t.interactions.pointerMoveTolerance;
|
|
2481
2537
|
}, set: function(c) {
|
|
2482
2538
|
t.interactions.pointerMoveTolerance = c;
|
|
@@ -2503,9 +2559,9 @@ function Vo() {
|
|
|
2503
2559
|
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2504
2560
|
})(Me || {}), br = (function() {
|
|
2505
2561
|
function t(e, n, r, o) {
|
|
2506
|
-
|
|
2562
|
+
b(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new yn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win = Q(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
|
|
2507
2563
|
}
|
|
2508
|
-
return
|
|
2564
|
+
return k(t, [{ key: "_defaults", get: function() {
|
|
2509
2565
|
return { base: {}, perAction: {}, actions: {} };
|
|
2510
2566
|
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2511
2567
|
return g.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), g.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), g.func(n.onend) && this.on("".concat(e, "end"), n.onend), g.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
@@ -2518,14 +2574,14 @@ function Vo() {
|
|
|
2518
2574
|
var r = this._defaults;
|
|
2519
2575
|
for (var o in n) {
|
|
2520
2576
|
var i = o, a = this.options[e], s = n[i];
|
|
2521
|
-
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), g.array(s) ? a[i] = Ut(s) : g.plainObject(s) ? (a[i] =
|
|
2577
|
+
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), g.array(s) ? a[i] = Ut(s) : g.plainObject(s) ? (a[i] = I(a[i] || {}, De(s)), g.object(r.perAction[i]) && "enabled" in r.perAction[i] && (a[i].enabled = s.enabled !== !1)) : g.bool(s) && g.object(r.perAction[i]) ? a[i].enabled = s : a[i] = s;
|
|
2522
2578
|
}
|
|
2523
2579
|
} }, { key: "getRect", value: function(e) {
|
|
2524
2580
|
return e = e || (g.element(this.target) ? this.target : null), g.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
|
|
2525
2581
|
} }, { key: "rectChecker", value: function(e) {
|
|
2526
2582
|
var n = this;
|
|
2527
2583
|
return g.func(e) ? (this.getRect = function(r) {
|
|
2528
|
-
var o =
|
|
2584
|
+
var o = I({}, e.apply(n, r));
|
|
2529
2585
|
return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
|
|
2530
2586
|
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2531
2587
|
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
@@ -2572,7 +2628,7 @@ function Vo() {
|
|
|
2572
2628
|
var n = this._defaults;
|
|
2573
2629
|
for (var r in g.object(e) || (e = {}), this.options = De(n.base), this._actions.methodDict) {
|
|
2574
2630
|
var o = r, i = this._actions.methodDict[o];
|
|
2575
|
-
this.options[o] = {}, this.setPerAction(o,
|
|
2631
|
+
this.options[o] = {}, this.setPerAction(o, I(I({}, n.perAction), n.actions[o])), this[i](e[o]);
|
|
2576
2632
|
}
|
|
2577
2633
|
for (var a in e) a !== "getRect" ? g.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2578
2634
|
return this;
|
|
@@ -2587,15 +2643,15 @@ function Vo() {
|
|
|
2587
2643
|
})(), xr = (function() {
|
|
2588
2644
|
function t(e) {
|
|
2589
2645
|
var n = this;
|
|
2590
|
-
|
|
2646
|
+
b(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2591
2647
|
var o = r.interactable, i = o.target, a = g.string(i) ? n.selectorMap[i] : i[n.scope.id], s = He(a, (function(l) {
|
|
2592
2648
|
return l === o;
|
|
2593
2649
|
}));
|
|
2594
2650
|
a.splice(s, 1);
|
|
2595
2651
|
} });
|
|
2596
2652
|
}
|
|
2597
|
-
return
|
|
2598
|
-
n =
|
|
2653
|
+
return k(t, [{ key: "new", value: function(e, n) {
|
|
2654
|
+
n = I(n || {}, { actions: this.scope.actions });
|
|
2599
2655
|
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2600
2656
|
return this.scope.addDocument(r._doc), this.list.push(r), g.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(r)) : (r.target[this.scope.id] || Object.defineProperty(e, this.scope.id, { value: [], configurable: !0 }), e[this.scope.id].push(r)), this.scope.fire("interactable:new", { target: e, options: n, interactable: r, win: this.scope._win }), r;
|
|
2601
2657
|
} }, { key: "getExisting", value: function(e, n) {
|
|
@@ -2612,7 +2668,7 @@ function Vo() {
|
|
|
2612
2668
|
})(), wr = (function() {
|
|
2613
2669
|
function t() {
|
|
2614
2670
|
var e = this;
|
|
2615
|
-
|
|
2671
|
+
b(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = J, this.defaults = De(un), this.Eventable = yn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
|
|
2616
2672
|
var o = function i(a, s) {
|
|
2617
2673
|
var l = r.interactables.getExisting(a, s);
|
|
2618
2674
|
return l || ((l = r.interactables.new(a, s)).events.global = i.globalEvents), l;
|
|
@@ -2669,12 +2725,12 @@ function Vo() {
|
|
|
2669
2725
|
};
|
|
2670
2726
|
var n = this;
|
|
2671
2727
|
this.Interactable = (function(r) {
|
|
2672
|
-
|
|
2673
|
-
var o =
|
|
2728
|
+
O(i, r);
|
|
2729
|
+
var o = P(i);
|
|
2674
2730
|
function i() {
|
|
2675
|
-
return
|
|
2731
|
+
return b(this, i), o.apply(this, arguments);
|
|
2676
2732
|
}
|
|
2677
|
-
return
|
|
2733
|
+
return k(i, [{ key: "_defaults", get: function() {
|
|
2678
2734
|
return n.defaults;
|
|
2679
2735
|
} }, { key: "set", value: function(a) {
|
|
2680
2736
|
return ee(M(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
@@ -2685,7 +2741,7 @@ function Vo() {
|
|
|
2685
2741
|
} }]), i;
|
|
2686
2742
|
})(br);
|
|
2687
2743
|
}
|
|
2688
|
-
return
|
|
2744
|
+
return k(t, [{ key: "addListeners", value: function(e, n) {
|
|
2689
2745
|
this.listenerMaps.push({ id: n, map: e });
|
|
2690
2746
|
} }, { key: "fire", value: function(e, n) {
|
|
2691
2747
|
for (var r = 0, o = this.listenerMaps; r < o.length; r++) {
|
|
@@ -2715,7 +2771,7 @@ function Vo() {
|
|
|
2715
2771
|
} }, { key: "addDocument", value: function(e, n) {
|
|
2716
2772
|
if (this.getDocIndex(e) !== -1) return !1;
|
|
2717
2773
|
var r = Q(e);
|
|
2718
|
-
n = n ?
|
|
2774
|
+
n = n ? I({}, n) : {}, this.documents.push({ doc: e, options: n }), this.events.documents.push(e), e !== this.document && this.events.add(r, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: e, window: r, scope: this, options: n });
|
|
2719
2775
|
} }, { key: "removeDocument", value: function(e) {
|
|
2720
2776
|
var n = this.getDocIndex(e), r = Q(e), o = this.documents[n].options;
|
|
2721
2777
|
this.events.remove(r, "unload", this.onWindowUnload), this.documents.splice(n, 1), this.events.documents.splice(n, 1), this.fire("scope:remove-document", { doc: e, window: r, scope: this, options: o });
|
|
@@ -2732,7 +2788,7 @@ function Vo() {
|
|
|
2732
2788
|
function En(t) {
|
|
2733
2789
|
return t && t.replace(/\/.*$/, "");
|
|
2734
2790
|
}
|
|
2735
|
-
var kn = new wr(),
|
|
2791
|
+
var kn = new wr(), ve = kn.interactStatic, Er = typeof globalThis < "u" ? globalThis : window;
|
|
2736
2792
|
kn.init(Er);
|
|
2737
2793
|
var kr = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2738
2794
|
}, elements: function() {
|
|
@@ -2742,34 +2798,34 @@ function Vo() {
|
|
|
2742
2798
|
return o in t || i in t;
|
|
2743
2799
|
})), n = function(r, o) {
|
|
2744
2800
|
for (var i = t.range, a = t.limits, s = a === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : a, l = t.offset, u = l === void 0 ? { x: 0, y: 0 } : l, c = { range: i, grid: t, x: null, y: null }, p = 0; p < e.length; p++) {
|
|
2745
|
-
var m = e[p], E = m[0], w = m[1],
|
|
2746
|
-
c[E] = Math.max(s.left, Math.min(s.right,
|
|
2801
|
+
var m = e[p], E = m[0], w = m[1], C = Math.round((r - u.x) / t[E]), _ = Math.round((o - u.y) / t[w]);
|
|
2802
|
+
c[E] = Math.max(s.left, Math.min(s.right, C * t[E] + u.x)), c[w] = Math.max(s.top, Math.min(s.bottom, _ * t[w] + u.y));
|
|
2747
2803
|
}
|
|
2748
2804
|
return c;
|
|
2749
2805
|
};
|
|
2750
2806
|
return n.grid = t, n.coordFields = e, n;
|
|
2751
2807
|
} }), Cr = { id: "snappers", install: function(t) {
|
|
2752
2808
|
var e = t.interactStatic;
|
|
2753
|
-
e.snappers =
|
|
2809
|
+
e.snappers = I(e.snappers || {}, kr), e.createSnapGrid = e.snappers.grid;
|
|
2754
2810
|
} }, Sr = Cr, Tr = { start: function(t) {
|
|
2755
2811
|
var e = t.state, n = t.rect, r = t.edges, o = t.pageCoords, i = e.options, a = i.ratio, s = i.enabled, l = e.options, u = l.equalDelta, c = l.modifiers;
|
|
2756
|
-
a === "preserve" && (a = n.width / n.height), e.startCoords =
|
|
2812
|
+
a === "preserve" && (a = n.width / n.height), e.startCoords = I({}, o), e.startRect = I({}, n), e.ratio = a, e.equalDelta = u;
|
|
2757
2813
|
var p = e.linkedEdges = { top: r.top || r.left && !r.bottom, left: r.left || r.top && !r.right, bottom: r.bottom || r.right && !r.top, right: r.right || r.bottom && !r.left };
|
|
2758
2814
|
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2759
2815
|
var m = (p.left ? 1 : -1) * (p.top ? 1 : -1);
|
|
2760
2816
|
e.edgeSign = { x: m, y: m };
|
|
2761
2817
|
} else e.edgeSign = { x: p.left ? -1 : 1, y: p.top ? -1 : 1 };
|
|
2762
|
-
if (s !== !1 &&
|
|
2818
|
+
if (s !== !1 && I(r, p), c != null && c.length) {
|
|
2763
2819
|
var E = new Rt(t.interaction);
|
|
2764
2820
|
E.copyFrom(t.interaction.modification), E.prepareStates(c), e.subModification = E, E.startAll(d({}, t));
|
|
2765
2821
|
}
|
|
2766
2822
|
}, set: function(t) {
|
|
2767
|
-
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i =
|
|
2768
|
-
if (
|
|
2769
|
-
var s =
|
|
2823
|
+
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = I({}, r), a = e.equalDelta ? _r : Mr;
|
|
2824
|
+
if (I(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
|
|
2825
|
+
var s = I({}, n);
|
|
2770
2826
|
et(o, s, { x: r.x - i.x, y: r.y - i.y });
|
|
2771
2827
|
var l = e.subModification.setAll(d(d({}, t), {}, { rect: s, edges: o, pageCoords: r, prevCoords: r, prevRect: s })), u = l.delta;
|
|
2772
|
-
return l.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect),
|
|
2828
|
+
return l.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect), I(r, l.coords)), l.eventProps;
|
|
2773
2829
|
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2774
2830
|
function _r(t, e, n) {
|
|
2775
2831
|
var r = t.startCoords, o = t.edgeSign;
|
|
@@ -2793,7 +2849,7 @@ function Vo() {
|
|
|
2793
2849
|
return g.func(t) ? ze(t, e.interactable, e.element, [n.x, n.y, e]) : ze(t, e.interactable, e.element);
|
|
2794
2850
|
}
|
|
2795
2851
|
var dt = { start: function(t) {
|
|
2796
|
-
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l =
|
|
2852
|
+
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = I({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2797
2853
|
if (e && s) {
|
|
2798
2854
|
var u = Ae(a.restriction, o, i);
|
|
2799
2855
|
if (u) {
|
|
@@ -2807,7 +2863,7 @@ function Vo() {
|
|
|
2807
2863
|
var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = Ae(o.restriction, n, e);
|
|
2808
2864
|
if (a) {
|
|
2809
2865
|
var s = (function(l) {
|
|
2810
|
-
return !l || "left" in l && "top" in l || ((l =
|
|
2866
|
+
return !l || "left" in l && "top" in l || ((l = I({}, l)).left = l.x || 0, l.top = l.y || 0, l.right = l.right || l.left + l.width, l.bottom = l.bottom || l.top + l.height), l;
|
|
2811
2867
|
})(a);
|
|
2812
2868
|
e.x = Math.max(Math.min(s.right - i.right, e.x), s.left + i.left), e.y = Math.max(Math.min(s.bottom - i.bottom, e.y), s.top + i.top);
|
|
2813
2869
|
}
|
|
@@ -2825,10 +2881,10 @@ function Vo() {
|
|
|
2825
2881
|
}, set: function(t) {
|
|
2826
2882
|
var e = t.coords, n = t.edges, r = t.interaction, o = t.state, i = o.offset, a = o.options;
|
|
2827
2883
|
if (n) {
|
|
2828
|
-
var s =
|
|
2884
|
+
var s = I({}, e), l = Ae(a.inner, r, s) || {}, u = Ae(a.outer, r, s) || {};
|
|
2829
2885
|
_n(l, Sn), _n(u, Tn), n.top ? e.y = Math.min(Math.max(u.top + i.top, s.y), l.top + i.top) : n.bottom && (e.y = Math.max(Math.min(u.bottom + i.bottom, s.y), l.bottom + i.bottom)), n.left ? e.x = Math.min(Math.max(u.left + i.left, s.x), l.left + i.left) : n.right && (e.x = Math.max(Math.min(u.right + i.right, s.x), l.right + i.right));
|
|
2830
2886
|
}
|
|
2831
|
-
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Or = _e($e, "restrictEdges"), Ar =
|
|
2887
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Or = _e($e, "restrictEdges"), Ar = I({ get elementRect() {
|
|
2832
2888
|
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
2833
2889
|
}, set elementRect(t) {
|
|
2834
2890
|
} }, dt.defaults), Pr = _e({ start: dt.start, set: dt.set, defaults: Ar }, "restrictRect"), Dr = { width: -1 / 0, height: -1 / 0 }, Nr = { width: 1 / 0, height: 1 / 0 }, zr = _e({ start: function(t) {
|
|
@@ -2837,12 +2893,12 @@ function Vo() {
|
|
|
2837
2893
|
var e = t.interaction, n = t.state, r = t.rect, o = t.edges, i = n.options;
|
|
2838
2894
|
if (o) {
|
|
2839
2895
|
var a = vt(Ae(i.min, e, t.coords)) || Dr, s = vt(Ae(i.max, e, t.coords)) || Nr;
|
|
2840
|
-
n.options = { endOnly: i.endOnly, inner:
|
|
2896
|
+
n.options = { endOnly: i.endOnly, inner: I({}, $e.noInner), outer: I({}, $e.noOuter) }, o.top ? (n.options.inner.top = r.bottom - a.height, n.options.outer.top = r.bottom - s.height) : o.bottom && (n.options.inner.bottom = r.top + a.height, n.options.outer.bottom = r.top + s.height), o.left ? (n.options.inner.left = r.right - a.width, n.options.outer.left = r.right - s.width) : o.right && (n.options.inner.right = r.left + a.width, n.options.outer.right = r.left + s.width), $e.set(t), n.options = i;
|
|
2841
2897
|
}
|
|
2842
2898
|
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Nt = { start: function(t) {
|
|
2843
2899
|
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, u = l.offsetWithOrigin ? (function(m) {
|
|
2844
|
-
var E = m.interaction.element, w = Ze(ze(m.state.options.origin, null, null, [E])),
|
|
2845
|
-
return
|
|
2900
|
+
var E = m.interaction.element, w = Ze(ze(m.state.options.origin, null, null, [E])), C = w || Le(m.interactable, E, m.interaction.prepared.name);
|
|
2901
|
+
return C;
|
|
2846
2902
|
})(t) : { x: 0, y: 0 };
|
|
2847
2903
|
if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2848
2904
|
else {
|
|
@@ -2854,54 +2910,54 @@ function Vo() {
|
|
|
2854
2910
|
return { index: E, relativePoint: m, x: s.left - i.width * m.x + e.x, y: s.top - i.height * m.y + e.y };
|
|
2855
2911
|
})) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
2856
2912
|
}, set: function(t) {
|
|
2857
|
-
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = Le(e.interactable, e.element, e.prepared.name), s =
|
|
2913
|
+
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = Le(e.interactable, e.element, e.prepared.name), s = I({}, n), l = [];
|
|
2858
2914
|
o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2859
|
-
for (var u = 0, c = i; u < c.length; u++) for (var p = c[u], m = s.x - p.x, E = s.y - p.y, w = 0,
|
|
2860
|
-
var
|
|
2861
|
-
(
|
|
2915
|
+
for (var u = 0, c = i; u < c.length; u++) for (var p = c[u], m = s.x - p.x, E = s.y - p.y, w = 0, C = o.targets.length; w < C; w++) {
|
|
2916
|
+
var _ = o.targets[w], T = void 0;
|
|
2917
|
+
(T = g.func(_) ? _(m, E, e._proxy, p, w) : _) && l.push({ x: (g.number(T.x) ? T.x : m) + p.x, y: (g.number(T.y) ? T.y : E) + p.y, range: g.number(T.range) ? T.range : o.range, source: _, index: w, offset: p });
|
|
2862
2918
|
}
|
|
2863
|
-
for (var
|
|
2864
|
-
var W = l[F], N = W.range, q = W.x - s.x,
|
|
2865
|
-
N === 1 / 0 &&
|
|
2919
|
+
for (var A = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, F = 0; F < l.length; F++) {
|
|
2920
|
+
var W = l[F], N = W.range, q = W.x - s.x, me = W.y - s.y, ae = je(q, me), ge = ae <= N;
|
|
2921
|
+
N === 1 / 0 && A.inRange && A.range !== 1 / 0 && (ge = !1), A.target && !(ge ? A.inRange && N !== 1 / 0 ? ae / N < A.distance / A.range : N === 1 / 0 && A.range !== 1 / 0 || ae < A.distance : !A.inRange && ae < A.distance) || (A.target = W, A.distance = ae, A.range = N, A.inRange = ge, A.delta.x = q, A.delta.y = me);
|
|
2866
2922
|
}
|
|
2867
|
-
return
|
|
2923
|
+
return A.inRange && (n.x = A.target.x, n.y = A.target.y), r.closest = A, A;
|
|
2868
2924
|
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Lr = _e(Nt, "snap"), pt = { start: function(t) {
|
|
2869
2925
|
var e = t.state, n = t.edges, r = e.options;
|
|
2870
2926
|
if (!n) return null;
|
|
2871
2927
|
t.state = { options: { targets: null, relativePoints: [{ x: n.left ? 0 : 1, y: n.top ? 0 : 1 }], offset: r.offset || "self", origin: { x: 0, y: 0 }, range: r.range } }, e.targetFields = e.targetFields || [["width", "height"], ["x", "y"]], Nt.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
2872
2928
|
}, set: function(t) {
|
|
2873
2929
|
var e = t.interaction, n = t.state, r = t.coords, o = n.options, i = n.offsets, a = { x: r.x - i[0].x, y: r.y - i[0].y };
|
|
2874
|
-
n.options =
|
|
2930
|
+
n.options = I({}, o), n.options.targets = [];
|
|
2875
2931
|
for (var s = 0, l = o.targets || []; s < l.length; s++) {
|
|
2876
2932
|
var u = l[s], c = void 0;
|
|
2877
2933
|
if (c = g.func(u) ? u(a.x, a.y, e) : u) {
|
|
2878
2934
|
for (var p = 0, m = n.targetFields; p < m.length; p++) {
|
|
2879
|
-
var E = m[p], w = E[0],
|
|
2880
|
-
if (w in c ||
|
|
2881
|
-
c.x = c[w], c.y = c[
|
|
2935
|
+
var E = m[p], w = E[0], C = E[1];
|
|
2936
|
+
if (w in c || C in c) {
|
|
2937
|
+
c.x = c[w], c.y = c[C];
|
|
2882
2938
|
break;
|
|
2883
2939
|
}
|
|
2884
2940
|
}
|
|
2885
2941
|
n.options.targets.push(c);
|
|
2886
2942
|
}
|
|
2887
2943
|
}
|
|
2888
|
-
var
|
|
2889
|
-
return n.options = o,
|
|
2944
|
+
var _ = Nt.set(t);
|
|
2945
|
+
return n.options = o, _;
|
|
2890
2946
|
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(pt, "snapSize"), zt = { aspectRatio: Rr, restrictEdges: Or, restrict: Ir, restrictRect: Pr, restrictSize: zr, snapEdges: _e({ start: function(t) {
|
|
2891
2947
|
var e = t.edges;
|
|
2892
2948
|
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], pt.start(t)) : null;
|
|
2893
|
-
}, set: pt.set, defaults:
|
|
2949
|
+
}, set: pt.set, defaults: I(De(pt.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Lr, snapSize: jr, spring: ut, avoid: ut, transform: ut, rubberband: ut }, Fr = { id: "modifiers", install: function(t) {
|
|
2894
2950
|
var e = t.interactStatic;
|
|
2895
2951
|
for (var n in t.usePlugin(cn), t.usePlugin(Sr), e.modifiers = zt, zt) {
|
|
2896
2952
|
var r = zt[n], o = r._defaults, i = r._methods;
|
|
2897
2953
|
o._methods = i, t.defaults.perAction[n] = o;
|
|
2898
2954
|
}
|
|
2899
2955
|
} }, Hr = Fr, Mn = (function(t) {
|
|
2900
|
-
|
|
2901
|
-
var e =
|
|
2956
|
+
O(n, t);
|
|
2957
|
+
var e = P(n);
|
|
2902
2958
|
function n(r, o, i, a, s, l) {
|
|
2903
2959
|
var u;
|
|
2904
|
-
if (
|
|
2960
|
+
if (b(this, n), tt(re(u = e.call(this, s)), i), i !== o && tt(re(u), o), u.timeStamp = l, u.originalEvent = i, u.type = r, u.pointerId = Fe(o), u.pointerType = Yt(o), u.target = a, u.currentTarget = null, r === "tap") {
|
|
2905
2961
|
var c = s.getPointerIndex(o);
|
|
2906
2962
|
u.dt = u.timeStamp - s.pointers[c].downTime;
|
|
2907
2963
|
var p = u.timeStamp - s.tapTime;
|
|
@@ -2909,7 +2965,7 @@ function Vo() {
|
|
|
2909
2965
|
} else r === "doubletap" && (u.dt = o.timeStamp - s.tapTime, u.double = !0);
|
|
2910
2966
|
return u;
|
|
2911
2967
|
}
|
|
2912
|
-
return
|
|
2968
|
+
return k(n, [{ key: "_subtractOrigin", value: function(r) {
|
|
2913
2969
|
var o = r.x, i = r.y;
|
|
2914
2970
|
return this.pageX -= o, this.pageY -= i, this.clientX -= o, this.clientY -= i, this;
|
|
2915
2971
|
} }, { key: "_addOrigin", value: function(r) {
|
|
@@ -2919,7 +2975,7 @@ function Vo() {
|
|
|
2919
2975
|
this.originalEvent.preventDefault();
|
|
2920
2976
|
} }]), n;
|
|
2921
2977
|
})(ot), We = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
|
|
2922
|
-
t.pointerEvents = We, t.defaults.actions.pointerEvents = We.defaults,
|
|
2978
|
+
t.pointerEvents = We, t.defaults.actions.pointerEvents = We.defaults, I(t.actions.phaselessTypes, We.types);
|
|
2923
2979
|
}, listeners: { "interactions:new": function(t) {
|
|
2924
2980
|
var e = t.interaction;
|
|
2925
2981
|
e.prevTap = null, e.tapTime = 0;
|
|
@@ -2936,9 +2992,9 @@ function Vo() {
|
|
|
2936
2992
|
p.node = E, r.fire("pointerEvents:collect-targets", p);
|
|
2937
2993
|
}
|
|
2938
2994
|
if (p.targets.length) {
|
|
2939
|
-
for (var w = 1 / 0,
|
|
2940
|
-
var
|
|
2941
|
-
|
|
2995
|
+
for (var w = 1 / 0, C = 0, _ = p.targets; C < _.length; C++) {
|
|
2996
|
+
var T = _[C].eventable.options.holdDuration;
|
|
2997
|
+
T < w && (w = T);
|
|
2942
2998
|
}
|
|
2943
2999
|
u.duration = w, u.timeout = setTimeout((function() {
|
|
2944
3000
|
Re({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
|
|
@@ -2963,8 +3019,8 @@ function Vo() {
|
|
|
2963
3019
|
if (u._subtractOrigin(w), u.eventable = m.eventable, u.currentTarget = m.node, m.eventable.fire(u), u._addOrigin(w), u.immediatePropagationStopped || u.propagationStopped && p + 1 < l.length && l[p + 1].node !== u.currentTarget) break;
|
|
2964
3020
|
}
|
|
2965
3021
|
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
2966
|
-
var
|
|
2967
|
-
n.prevTap =
|
|
3022
|
+
var C = u.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : u;
|
|
3023
|
+
n.prevTap = C, n.tapTime = C.timeStamp;
|
|
2968
3024
|
}
|
|
2969
3025
|
return u;
|
|
2970
3026
|
}
|
|
@@ -2976,8 +3032,8 @@ function Vo() {
|
|
|
2976
3032
|
c.node = m, e.fire("pointerEvents:collect-targets", c);
|
|
2977
3033
|
}
|
|
2978
3034
|
return a === "hold" && (c.targets = c.targets.filter((function(E) {
|
|
2979
|
-
var w,
|
|
2980
|
-
return E.eventable.options.holdDuration === ((w = n.pointers[s]) == null || (
|
|
3035
|
+
var w, C;
|
|
3036
|
+
return E.eventable.options.holdDuration === ((w = n.pointers[s]) == null || (C = w.hold) == null ? void 0 : C.duration);
|
|
2981
3037
|
}))), c.targets;
|
|
2982
3038
|
}
|
|
2983
3039
|
function Lt(t) {
|
|
@@ -3009,7 +3065,7 @@ function Vo() {
|
|
|
3009
3065
|
} }) }, Yr = Vr, $r = { id: "pointer-events/interactableTargets", install: function(t) {
|
|
3010
3066
|
var e = t.Interactable;
|
|
3011
3067
|
e.prototype.pointerEvents = function(r) {
|
|
3012
|
-
return
|
|
3068
|
+
return I(this.events.options, r), this;
|
|
3013
3069
|
};
|
|
3014
3070
|
var n = e.prototype._backCompatOption;
|
|
3015
3071
|
e.prototype._backCompatOption = function(r, o) {
|
|
@@ -3029,7 +3085,7 @@ function Vo() {
|
|
|
3029
3085
|
};
|
|
3030
3086
|
}, "interactable:set": function(t, e) {
|
|
3031
3087
|
var n = t.interactable, r = t.options;
|
|
3032
|
-
|
|
3088
|
+
I(n.events.options, e.pointerEvents.defaults), I(n.events.options, r.pointerEvents || {});
|
|
3033
3089
|
} } }, Wr = $r, Ur = { id: "pointer-events", install: function(t) {
|
|
3034
3090
|
t.usePlugin(Br), t.usePlugin(Yr), t.usePlugin(Wr);
|
|
3035
3091
|
} }, Xr = Ur, Gr = { id: "reflow", install: function(t) {
|
|
@@ -3039,15 +3095,15 @@ function Vo() {
|
|
|
3039
3095
|
for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, u = function() {
|
|
3040
3096
|
var p = a[c], m = r.getRect(p);
|
|
3041
3097
|
if (!m) return 1;
|
|
3042
|
-
var E, w = Be(i.interactions.list, (function(
|
|
3043
|
-
return
|
|
3098
|
+
var E, w = Be(i.interactions.list, (function(T) {
|
|
3099
|
+
return T.interacting() && T.interactable === r && T.element === p && T.prepared.name === o.name;
|
|
3044
3100
|
}));
|
|
3045
|
-
if (w) w.move(), l && (E = w._reflowPromise || new s((function(
|
|
3046
|
-
w._reflowResolve =
|
|
3101
|
+
if (w) w.move(), l && (E = w._reflowPromise || new s((function(T) {
|
|
3102
|
+
w._reflowResolve = T;
|
|
3047
3103
|
})));
|
|
3048
3104
|
else {
|
|
3049
|
-
var
|
|
3050
|
-
return { coords:
|
|
3105
|
+
var C = vt(m), _ = /* @__PURE__ */ (function(T) {
|
|
3106
|
+
return { coords: T, get page() {
|
|
3051
3107
|
return this.coords.page;
|
|
3052
3108
|
}, get client() {
|
|
3053
3109
|
return this.coords.client;
|
|
@@ -3073,15 +3129,15 @@ function Vo() {
|
|
|
3073
3129
|
return this.coords.buttons;
|
|
3074
3130
|
}, preventDefault: function() {
|
|
3075
3131
|
} };
|
|
3076
|
-
})({ page: { x:
|
|
3077
|
-
E = (function(
|
|
3078
|
-
var q =
|
|
3079
|
-
q.interactable =
|
|
3080
|
-
var ae =
|
|
3132
|
+
})({ page: { x: C.x, y: C.y }, client: { x: C.x, y: C.y }, timeStamp: i.now() });
|
|
3133
|
+
E = (function(T, A, F, W, N) {
|
|
3134
|
+
var q = T.interactions.new({ pointerType: "reflow" }), me = { interaction: q, event: N, pointer: N, eventTarget: F, phase: "reflow" };
|
|
3135
|
+
q.interactable = A, q.element = F, q.prevEvent = N, q.updatePointer(N, N, F, !0), Ht(q.coords.delta), St(q.prepared, W), q._doPhase(me);
|
|
3136
|
+
var ae = T.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
|
|
3081
3137
|
q._reflowResolve = Se;
|
|
3082
3138
|
})) : void 0;
|
|
3083
|
-
return q._reflowPromise = be, q.start(W,
|
|
3084
|
-
})(i, r, p, o,
|
|
3139
|
+
return q._reflowPromise = be, q.start(W, A, F), q._interacting ? (q.move(me), q.end(N)) : (q.stop(), q._reflowResolve()), q.removePointer(N, N), be;
|
|
3140
|
+
})(i, r, p, o, _);
|
|
3085
3141
|
}
|
|
3086
3142
|
l && l.push(E);
|
|
3087
3143
|
}, c = 0; c < a.length && !u(); c++) ;
|
|
@@ -3096,11 +3152,11 @@ function Vo() {
|
|
|
3096
3152
|
r.splice(r.indexOf(o), 1);
|
|
3097
3153
|
})(e.interactions.list, n));
|
|
3098
3154
|
} } }, Kr = Gr;
|
|
3099
|
-
if (
|
|
3100
|
-
h.exports =
|
|
3155
|
+
if (ve.use(ln), ve.use(hn), ve.use(Xr), ve.use(fr), ve.use(Hr), ve.use(tr), ve.use(Yn), ve.use(Wn), ve.use(Kr), ve.default = ve, y(h) === "object" && h) try {
|
|
3156
|
+
h.exports = ve;
|
|
3101
3157
|
} catch {
|
|
3102
3158
|
}
|
|
3103
|
-
return
|
|
3159
|
+
return ve.default = ve, ve;
|
|
3104
3160
|
}));
|
|
3105
3161
|
})(Ke, Ke.exports)), Ke.exports;
|
|
3106
3162
|
}
|
|
@@ -3112,24 +3168,24 @@ function An(h) {
|
|
|
3112
3168
|
const d = f.target.files?.[0];
|
|
3113
3169
|
if (d) {
|
|
3114
3170
|
const y = new FileReader();
|
|
3115
|
-
y.onload = (
|
|
3116
|
-
const
|
|
3117
|
-
|
|
3118
|
-
const
|
|
3119
|
-
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3171
|
+
y.onload = (b) => {
|
|
3172
|
+
const S = document.createElement("img");
|
|
3173
|
+
S.src = b.target?.result, S.style.maxWidth = "100%", S.style.width = "100%", S.style.height = "auto", S.style.cursor = "pointer", S.draggable = !1;
|
|
3174
|
+
const k = document.createElement("div");
|
|
3175
|
+
k.className = "editor-image-wrapper", k.style.display = "inline-block", k.style.position = "relative", k.style.maxWidth = "100%", k.style.width = "auto", k.style.height = "auto", k.contentEditable = "false", k.style.boxSizing = "border-box", k.style.touchAction = "none", k.style.userSelect = "none", k.appendChild(S);
|
|
3176
|
+
const R = document.createElement("div");
|
|
3177
|
+
R.contentEditable = "true", R.style.margin = "10px 0", R.style.textAlign = "left", R.style.display = "block", R.appendChild(k);
|
|
3122
3178
|
try {
|
|
3123
3179
|
Ne();
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3126
|
-
|
|
3127
|
-
const
|
|
3128
|
-
|
|
3180
|
+
const O = window.getSelection();
|
|
3181
|
+
if (O && O.rangeCount > 0) {
|
|
3182
|
+
O.getRangeAt(0).insertNode(R), O.removeAllRanges();
|
|
3183
|
+
const Y = document.createRange();
|
|
3184
|
+
Y.setStartAfter(R), Y.collapse(!0), O.addRange(Y), he(Y);
|
|
3129
3185
|
} else
|
|
3130
|
-
h.appendChild(
|
|
3186
|
+
h.appendChild(R), h.focus(), he();
|
|
3131
3187
|
} catch {
|
|
3132
|
-
h.appendChild(
|
|
3188
|
+
h.appendChild(R), h.focus(), he();
|
|
3133
3189
|
}
|
|
3134
3190
|
}, y.readAsDataURL(d);
|
|
3135
3191
|
}
|
|
@@ -3141,8 +3197,8 @@ function $o(h) {
|
|
|
3141
3197
|
const f = v.querySelector("img");
|
|
3142
3198
|
if (f)
|
|
3143
3199
|
if (v.classList.contains("resizable")) {
|
|
3144
|
-
const d = v.getBoundingClientRect(), y = Math.round(d.width) + "px",
|
|
3145
|
-
jt(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width = y, v.style.height =
|
|
3200
|
+
const d = v.getBoundingClientRect(), y = Math.round(d.width) + "px", b = Math.round(d.height) + "px";
|
|
3201
|
+
jt(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width = y, v.style.height = b, v.contentEditable = "false", f && (f.style.width = "100%", f.style.height = "100%");
|
|
3146
3202
|
} else {
|
|
3147
3203
|
v.classList.add("resizable"), v.style.border = "2px dashed #007bff", v.style.position = "relative", v.style.userSelect = "none";
|
|
3148
3204
|
const d = v.getBoundingClientRect();
|
|
@@ -3150,8 +3206,8 @@ function $o(h) {
|
|
|
3150
3206
|
edges: { left: !0, right: !0, bottom: !0, top: !0 },
|
|
3151
3207
|
listeners: {
|
|
3152
3208
|
move: (y) => {
|
|
3153
|
-
const
|
|
3154
|
-
Object.assign(
|
|
3209
|
+
const b = y.target;
|
|
3210
|
+
Object.assign(b.style, {
|
|
3155
3211
|
width: `${y.rect.width}px`,
|
|
3156
3212
|
height: `${y.rect.height}px`
|
|
3157
3213
|
});
|
|
@@ -3194,19 +3250,19 @@ function Uo() {
|
|
|
3194
3250
|
if (Pn) return Xe;
|
|
3195
3251
|
Pn = 1;
|
|
3196
3252
|
var h = Symbol.for("react.transitional.element"), v = Symbol.for("react.fragment");
|
|
3197
|
-
function f(d, y,
|
|
3198
|
-
var
|
|
3199
|
-
if (
|
|
3200
|
-
|
|
3201
|
-
for (var
|
|
3202
|
-
|
|
3203
|
-
} else
|
|
3204
|
-
return y =
|
|
3253
|
+
function f(d, y, b) {
|
|
3254
|
+
var S = null;
|
|
3255
|
+
if (b !== void 0 && (S = "" + b), y.key !== void 0 && (S = "" + y.key), "key" in y) {
|
|
3256
|
+
b = {};
|
|
3257
|
+
for (var k in y)
|
|
3258
|
+
k !== "key" && (b[k] = y[k]);
|
|
3259
|
+
} else b = y;
|
|
3260
|
+
return y = b.ref, {
|
|
3205
3261
|
$$typeof: h,
|
|
3206
3262
|
type: d,
|
|
3207
|
-
key:
|
|
3263
|
+
key: S,
|
|
3208
3264
|
ref: y !== void 0 ? y : null,
|
|
3209
|
-
props:
|
|
3265
|
+
props: b
|
|
3210
3266
|
};
|
|
3211
3267
|
}
|
|
3212
3268
|
return Xe.Fragment = v, Xe.jsx = f, Xe.jsxs = f, Xe;
|
|
@@ -3215,12 +3271,12 @@ var Ge = {};
|
|
|
3215
3271
|
var Dn;
|
|
3216
3272
|
function Xo() {
|
|
3217
3273
|
return Dn || (Dn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3218
|
-
function h(
|
|
3219
|
-
if (
|
|
3220
|
-
if (typeof
|
|
3221
|
-
return
|
|
3222
|
-
if (typeof
|
|
3223
|
-
switch (
|
|
3274
|
+
function h(x) {
|
|
3275
|
+
if (x == null) return null;
|
|
3276
|
+
if (typeof x == "function")
|
|
3277
|
+
return x.$$typeof === ce ? null : x.displayName || x.name || null;
|
|
3278
|
+
if (typeof x == "string") return x;
|
|
3279
|
+
switch (x) {
|
|
3224
3280
|
case X:
|
|
3225
3281
|
return "Fragment";
|
|
3226
3282
|
case U:
|
|
@@ -3234,141 +3290,141 @@ function Xo() {
|
|
|
3234
3290
|
case le:
|
|
3235
3291
|
return "Activity";
|
|
3236
3292
|
}
|
|
3237
|
-
if (typeof
|
|
3238
|
-
switch (typeof
|
|
3293
|
+
if (typeof x == "object")
|
|
3294
|
+
switch (typeof x.tag == "number" && console.error(
|
|
3239
3295
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
3240
|
-
),
|
|
3296
|
+
), x.$$typeof) {
|
|
3241
3297
|
case G:
|
|
3242
3298
|
return "Portal";
|
|
3243
3299
|
case Q:
|
|
3244
|
-
return
|
|
3300
|
+
return x.displayName || "Context";
|
|
3245
3301
|
case te:
|
|
3246
|
-
return (
|
|
3302
|
+
return (x._context.displayName || "Context") + ".Consumer";
|
|
3247
3303
|
case ie:
|
|
3248
|
-
var D =
|
|
3249
|
-
return
|
|
3304
|
+
var D = x.render;
|
|
3305
|
+
return x = x.displayName, x || (x = D.displayName || D.name || "", x = x !== "" ? "ForwardRef(" + x + ")" : "ForwardRef"), x;
|
|
3250
3306
|
case K:
|
|
3251
|
-
return D =
|
|
3307
|
+
return D = x.displayName || null, D !== null ? D : h(x.type) || "Memo";
|
|
3252
3308
|
case z:
|
|
3253
|
-
D =
|
|
3309
|
+
D = x._payload, x = x._init;
|
|
3254
3310
|
try {
|
|
3255
|
-
return h(
|
|
3311
|
+
return h(x(D));
|
|
3256
3312
|
} catch {
|
|
3257
3313
|
}
|
|
3258
3314
|
}
|
|
3259
3315
|
return null;
|
|
3260
3316
|
}
|
|
3261
|
-
function v(
|
|
3262
|
-
return "" +
|
|
3317
|
+
function v(x) {
|
|
3318
|
+
return "" + x;
|
|
3263
3319
|
}
|
|
3264
|
-
function f(
|
|
3320
|
+
function f(x) {
|
|
3265
3321
|
try {
|
|
3266
|
-
v(
|
|
3322
|
+
v(x);
|
|
3267
3323
|
var D = !1;
|
|
3268
3324
|
} catch {
|
|
3269
3325
|
D = !0;
|
|
3270
3326
|
}
|
|
3271
3327
|
if (D) {
|
|
3272
3328
|
D = console;
|
|
3273
|
-
var L = D.error, B = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
3329
|
+
var L = D.error, B = typeof Symbol == "function" && Symbol.toStringTag && x[Symbol.toStringTag] || x.constructor.name || "Object";
|
|
3274
3330
|
return L.call(
|
|
3275
3331
|
D,
|
|
3276
3332
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3277
3333
|
B
|
|
3278
|
-
), v(
|
|
3334
|
+
), v(x);
|
|
3279
3335
|
}
|
|
3280
3336
|
}
|
|
3281
|
-
function d(
|
|
3282
|
-
if (
|
|
3283
|
-
if (typeof
|
|
3337
|
+
function d(x) {
|
|
3338
|
+
if (x === X) return "<>";
|
|
3339
|
+
if (typeof x == "object" && x !== null && x.$$typeof === z)
|
|
3284
3340
|
return "<...>";
|
|
3285
3341
|
try {
|
|
3286
|
-
var D = h(
|
|
3342
|
+
var D = h(x);
|
|
3287
3343
|
return D ? "<" + D + ">" : "<...>";
|
|
3288
3344
|
} catch {
|
|
3289
3345
|
return "<...>";
|
|
3290
3346
|
}
|
|
3291
3347
|
}
|
|
3292
3348
|
function y() {
|
|
3293
|
-
var
|
|
3294
|
-
return
|
|
3349
|
+
var x = V.A;
|
|
3350
|
+
return x === null ? null : x.getOwner();
|
|
3295
3351
|
}
|
|
3296
|
-
function
|
|
3352
|
+
function b() {
|
|
3297
3353
|
return Error("react-stack-top-frame");
|
|
3298
3354
|
}
|
|
3299
|
-
function
|
|
3300
|
-
if (
|
|
3301
|
-
var D = Object.getOwnPropertyDescriptor(
|
|
3355
|
+
function S(x) {
|
|
3356
|
+
if ($.call(x, "key")) {
|
|
3357
|
+
var D = Object.getOwnPropertyDescriptor(x, "key").get;
|
|
3302
3358
|
if (D && D.isReactWarning) return !1;
|
|
3303
3359
|
}
|
|
3304
|
-
return
|
|
3360
|
+
return x.key !== void 0;
|
|
3305
3361
|
}
|
|
3306
|
-
function
|
|
3362
|
+
function k(x, D) {
|
|
3307
3363
|
function L() {
|
|
3308
3364
|
J || (J = !0, console.error(
|
|
3309
3365
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
3310
3366
|
D
|
|
3311
3367
|
));
|
|
3312
3368
|
}
|
|
3313
|
-
L.isReactWarning = !0, Object.defineProperty(
|
|
3369
|
+
L.isReactWarning = !0, Object.defineProperty(x, "key", {
|
|
3314
3370
|
get: L,
|
|
3315
3371
|
configurable: !0
|
|
3316
3372
|
});
|
|
3317
3373
|
}
|
|
3318
|
-
function
|
|
3319
|
-
var
|
|
3320
|
-
return se[
|
|
3374
|
+
function R() {
|
|
3375
|
+
var x = h(this.type);
|
|
3376
|
+
return se[x] || (se[x] = !0, console.error(
|
|
3321
3377
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
3322
|
-
)),
|
|
3378
|
+
)), x = this.props.ref, x !== void 0 ? x : null;
|
|
3323
3379
|
}
|
|
3324
|
-
function
|
|
3380
|
+
function O(x, D, L, B, xe, we) {
|
|
3325
3381
|
var ue = L.ref;
|
|
3326
|
-
return
|
|
3382
|
+
return x = {
|
|
3327
3383
|
$$typeof: ee,
|
|
3328
|
-
type:
|
|
3384
|
+
type: x,
|
|
3329
3385
|
key: D,
|
|
3330
3386
|
props: L,
|
|
3331
3387
|
_owner: B
|
|
3332
|
-
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(
|
|
3388
|
+
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(x, "ref", {
|
|
3333
3389
|
enumerable: !1,
|
|
3334
|
-
get:
|
|
3335
|
-
}) : Object.defineProperty(
|
|
3390
|
+
get: R
|
|
3391
|
+
}) : Object.defineProperty(x, "ref", { enumerable: !1, value: null }), x._store = {}, Object.defineProperty(x._store, "validated", {
|
|
3336
3392
|
configurable: !1,
|
|
3337
3393
|
enumerable: !1,
|
|
3338
3394
|
writable: !0,
|
|
3339
3395
|
value: 0
|
|
3340
|
-
}), Object.defineProperty(
|
|
3396
|
+
}), Object.defineProperty(x, "_debugInfo", {
|
|
3341
3397
|
configurable: !1,
|
|
3342
3398
|
enumerable: !1,
|
|
3343
3399
|
writable: !0,
|
|
3344
3400
|
value: null
|
|
3345
|
-
}), Object.defineProperty(
|
|
3401
|
+
}), Object.defineProperty(x, "_debugStack", {
|
|
3346
3402
|
configurable: !1,
|
|
3347
3403
|
enumerable: !1,
|
|
3348
3404
|
writable: !0,
|
|
3349
3405
|
value: xe
|
|
3350
|
-
}), Object.defineProperty(
|
|
3406
|
+
}), Object.defineProperty(x, "_debugTask", {
|
|
3351
3407
|
configurable: !1,
|
|
3352
3408
|
enumerable: !1,
|
|
3353
3409
|
writable: !0,
|
|
3354
3410
|
value: we
|
|
3355
|
-
}), Object.freeze && (Object.freeze(
|
|
3411
|
+
}), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
|
|
3356
3412
|
}
|
|
3357
|
-
function M(
|
|
3413
|
+
function M(x, D, L, B, xe, we) {
|
|
3358
3414
|
var ue = D.children;
|
|
3359
3415
|
if (ue !== void 0)
|
|
3360
3416
|
if (B)
|
|
3361
3417
|
if (H(ue)) {
|
|
3362
3418
|
for (B = 0; B < ue.length; B++)
|
|
3363
|
-
|
|
3419
|
+
Y(ue[B]);
|
|
3364
3420
|
Object.freeze && Object.freeze(ue);
|
|
3365
3421
|
} else
|
|
3366
3422
|
console.error(
|
|
3367
3423
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3368
3424
|
);
|
|
3369
|
-
else
|
|
3370
|
-
if (
|
|
3371
|
-
ue = h(
|
|
3425
|
+
else Y(ue);
|
|
3426
|
+
if ($.call(D, "key")) {
|
|
3427
|
+
ue = h(x);
|
|
3372
3428
|
var Ee = Object.keys(D).filter(function(Qe) {
|
|
3373
3429
|
return Qe !== "key";
|
|
3374
3430
|
});
|
|
@@ -3385,16 +3441,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3385
3441
|
ue
|
|
3386
3442
|
), fe[ue + B] = !0);
|
|
3387
3443
|
}
|
|
3388
|
-
if (ue = null, L !== void 0 && (f(L), ue = "" + L),
|
|
3444
|
+
if (ue = null, L !== void 0 && (f(L), ue = "" + L), S(D) && (f(D.key), ue = "" + D.key), "key" in D) {
|
|
3389
3445
|
L = {};
|
|
3390
|
-
for (var
|
|
3391
|
-
|
|
3446
|
+
for (var I in D)
|
|
3447
|
+
I !== "key" && (L[I] = D[I]);
|
|
3392
3448
|
} else L = D;
|
|
3393
|
-
return ue &&
|
|
3449
|
+
return ue && k(
|
|
3394
3450
|
L,
|
|
3395
|
-
typeof
|
|
3396
|
-
),
|
|
3397
|
-
|
|
3451
|
+
typeof x == "function" ? x.displayName || x.name || "Unknown" : x
|
|
3452
|
+
), O(
|
|
3453
|
+
x,
|
|
3398
3454
|
ue,
|
|
3399
3455
|
L,
|
|
3400
3456
|
y(),
|
|
@@ -3402,43 +3458,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3402
3458
|
we
|
|
3403
3459
|
);
|
|
3404
3460
|
}
|
|
3405
|
-
function
|
|
3406
|
-
re(
|
|
3461
|
+
function Y(x) {
|
|
3462
|
+
re(x) ? x._store && (x._store.validated = 1) : typeof x == "object" && x !== null && x.$$typeof === z && (x._payload.status === "fulfilled" ? re(x._payload.value) && x._payload.value._store && (x._payload.value._store.validated = 1) : x._store && (x._store.validated = 1));
|
|
3407
3463
|
}
|
|
3408
|
-
function re(
|
|
3409
|
-
return typeof
|
|
3464
|
+
function re(x) {
|
|
3465
|
+
return typeof x == "object" && x !== null && x.$$typeof === ee;
|
|
3410
3466
|
}
|
|
3411
|
-
var
|
|
3467
|
+
var P = Jr, ee = Symbol.for("react.transitional.element"), G = Symbol.for("react.portal"), X = Symbol.for("react.fragment"), oe = Symbol.for("react.strict_mode"), U = Symbol.for("react.profiler"), te = Symbol.for("react.consumer"), Q = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), V = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, H = Array.isArray, ne = console.createTask ? console.createTask : function() {
|
|
3412
3468
|
return null;
|
|
3413
3469
|
};
|
|
3414
|
-
|
|
3415
|
-
react_stack_bottom_frame: function(
|
|
3416
|
-
return
|
|
3470
|
+
P = {
|
|
3471
|
+
react_stack_bottom_frame: function(x) {
|
|
3472
|
+
return x();
|
|
3417
3473
|
}
|
|
3418
3474
|
};
|
|
3419
|
-
var J, se = {}, de =
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
)(), pe = ne(d(
|
|
3423
|
-
Ge.Fragment = X, Ge.jsx = function(
|
|
3475
|
+
var J, se = {}, de = P.react_stack_bottom_frame.bind(
|
|
3476
|
+
P,
|
|
3477
|
+
b
|
|
3478
|
+
)(), pe = ne(d(b)), fe = {};
|
|
3479
|
+
Ge.Fragment = X, Ge.jsx = function(x, D, L) {
|
|
3424
3480
|
var B = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
3425
3481
|
return M(
|
|
3426
|
-
|
|
3482
|
+
x,
|
|
3427
3483
|
D,
|
|
3428
3484
|
L,
|
|
3429
3485
|
!1,
|
|
3430
3486
|
B ? Error("react-stack-top-frame") : de,
|
|
3431
|
-
B ? ne(d(
|
|
3487
|
+
B ? ne(d(x)) : pe
|
|
3432
3488
|
);
|
|
3433
|
-
}, Ge.jsxs = function(
|
|
3489
|
+
}, Ge.jsxs = function(x, D, L) {
|
|
3434
3490
|
var B = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
3435
3491
|
return M(
|
|
3436
|
-
|
|
3492
|
+
x,
|
|
3437
3493
|
D,
|
|
3438
3494
|
L,
|
|
3439
3495
|
!0,
|
|
3440
3496
|
B ? Error("react-stack-top-frame") : de,
|
|
3441
|
-
B ? ne(d(
|
|
3497
|
+
B ? ne(d(x)) : pe
|
|
3442
3498
|
);
|
|
3443
3499
|
};
|
|
3444
3500
|
})()), Ge;
|
|
@@ -3456,11 +3512,11 @@ const Qo = ({
|
|
|
3456
3512
|
return Qr(() => {
|
|
3457
3513
|
if (d.current && !f.current) {
|
|
3458
3514
|
f.current = new Wo(), d.current.appendChild(f.current.getElement()), v && f.current.setHTML(v);
|
|
3459
|
-
const y = f.current.getElement(),
|
|
3460
|
-
const
|
|
3461
|
-
h?.(
|
|
3515
|
+
const y = f.current.getElement(), b = () => {
|
|
3516
|
+
const S = f.current?.getHTML() || "";
|
|
3517
|
+
h?.(S);
|
|
3462
3518
|
};
|
|
3463
|
-
y.addEventListener("input",
|
|
3519
|
+
y.addEventListener("input", b), y.addEventListener("keyup", b), y.addEventListener("paste", b);
|
|
3464
3520
|
}
|
|
3465
3521
|
}, [h, v]), /* @__PURE__ */ Ko.jsx("div", { ref: d });
|
|
3466
3522
|
};
|