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.
@@ -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 x = zn(y);
54
- d.appendChild(x);
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", (x) => {
189
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d.click());
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 me(h) {
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 _ = document.createElement("span");
218
- _.style[h] = v;
219
- const C = d.extractContents();
220
- _.appendChild(C), d.insertNode(_), f.removeAllRanges();
221
- const P = document.createRange();
222
- P.selectNodeContents(_), f.addRange(P), me(P);
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 x = document.createRange();
228
- x.setStart(y.firstChild, 0), x.setEnd(y.firstChild, 0), f.addRange(x), me(x);
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", (x) => {
241
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), f.click());
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", (x) => {
249
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), y.click());
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
- { command: "justifyLeft", icon: wo, title: "Align Left" },
258
- { command: "justifyCenter", icon: yo, title: "Align Center" },
259
- { command: "justifyRight", icon: bo, title: "Align Right" },
260
- { command: "justifyFull", icon: xo, title: "Justify" }
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", (x) => {
264
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d.click());
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 = () => document.execCommand(f.command), h.appendChild(d);
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", (x) => {
278
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d.click());
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", (x) => {
292
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d.click());
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", (x) => {
306
- (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d.click());
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 = () => me(), h;
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
- (_.key === "Enter" || _.key === " ") && (_.preventDefault(), h.click());
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 = "", x = "";
377
+ let d = !1, y = "", b = "";
334
378
  return h.onclick = () => {
335
- const _ = document.querySelector(
379
+ const S = document.querySelector(
336
380
  ".editor-container"
337
381
  );
338
- if (!_) return;
339
- const C = _.querySelector(".editor");
382
+ if (!S) return;
383
+ const k = S.querySelector(".editor");
340
384
  if (d)
341
- y ? _.setAttribute("style", y) : _.removeAttribute("style"), C && (x ? C.setAttribute("style", x) : C.removeAttribute("style")), h.replaceChild(v, f), d = !1;
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 = _.getAttribute("style") || "", x = C && C.getAttribute("style") || "", _.style.position = "fixed", _.style.top = "0", _.style.left = "0", _.style.width = "100vw", _.style.height = "100vh";
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 P = 9998;
346
- document.querySelectorAll("body *").forEach((I) => {
347
- const M = window.getComputedStyle(I).getPropertyValue("z-index"), $ = parseInt(M, 10);
348
- !isNaN($) && $ > 0 && (P = Math.max(P, $));
349
- }), _.style.zIndex = String(Math.max(P + 1, 9999));
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
- _.style.zIndex = "9999";
395
+ S.style.zIndex = "9999";
352
396
  }
353
- _.style.backgroundColor = "#ffffff", _.style.display = "flex", _.style.flexDirection = "column", C && (C.style.flexGrow = "1", C.style.overflowY = "auto", C.style.border = "none", C.style.borderRadius = "0", C.style.boxShadow = "none"), h.replaceChild(f, v), d = !0;
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 x = document.createElement("input");
365
- x.type = "url", x.placeholder = "Enter URL (e.g., https://example.com)", x.style.width = "100%", x.style.padding = "8px", x.style.border = "1px solid #ccc", x.style.borderRadius = "4px", x.style.marginBottom = "15px", x.style.boxSizing = "border-box";
366
- const _ = document.createElement("div");
367
- _.style.display = "flex", _.style.gap = "10px", _.style.justifyContent = "flex-end";
368
- const C = document.createElement("div");
369
- C.setAttribute("role", "button"), C.tabIndex = 0, C.style.userSelect = "none", C.textContent = "Cancel", C.style.padding = "8px 16px", C.style.border = "1px solid #ccc", C.style.borderRadius = "4px", C.style.backgroundColor = "#f5f5f5", C.style.cursor = "pointer", C.addEventListener("keydown", (A) => {
370
- (A.key === "Enter" || A.key === " " || A.key === "Escape") && (A.preventDefault(), C.click());
371
- }), C.onclick = () => {
372
- f.style.display = "none", x.value = "", P = null;
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 P = null;
375
- const I = document.createElement("div");
376
- I.setAttribute("role", "button"), I.tabIndex = 0, I.style.userSelect = "none", I.textContent = "Insert", I.style.padding = "8px 16px", I.style.border = "none", I.style.borderRadius = "4px", I.style.backgroundColor = "#007bff", I.style.color = "#fff", I.style.cursor = "pointer", I.addEventListener("keydown", (A) => {
377
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), I.click());
378
- }), I.onclick = () => {
379
- const A = x.value.trim();
380
- if (A)
381
- if (P)
382
- P.setAttribute("href", A), P.setAttribute("target", "_blank"), P.setAttribute("rel", "noopener noreferrer"), P.setAttribute("tabindex", "0");
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, A);
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", x.value = "", P = null;
402
- }, _.appendChild(C), _.appendChild(I), d.appendChild(y), d.appendChild(x), d.appendChild(_), f.appendChild(d), document.body.appendChild(f), x.onkeydown = (A) => {
403
- A.key === "Enter" ? I.click() : A.key === "Escape" && C.click();
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 $ = ye(ao, { width: 16, height: 16 });
408
- M.appendChild($), 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 = () => {
409
- P = null;
410
- const A = window.getSelection();
411
- if (A && A.rangeCount > 0) {
412
- let G = A.getRangeAt(0).startContainer;
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
- P = X, x.value = P.getAttribute("href") || "";
462
+ R = X, b.value = R.getAttribute("href") || "";
419
463
  break;
420
464
  }
421
465
  X = X.parentElement;
422
466
  }
423
467
  }
424
- me();
425
- }, M.addEventListener("keydown", (A) => {
426
- (A.key === "Enter" || A.key === " ") && (A.preventDefault(), M.click());
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", x.focus();
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", (A) => {
432
- const ee = A.target;
475
+ return re && re.addEventListener("click", (P) => {
476
+ const ee = P.target;
433
477
  if (ee.tagName === "A") {
434
- A.preventDefault();
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 x = document.createElement("div");
452
- x.className = "rte-modal-header";
453
- const _ = document.createElement("h3");
454
- _.textContent = "Insert Quote", _.className = "rte-modal-title";
455
- const C = document.createElement("div");
456
- C.setAttribute("role", "button"), C.tabIndex = 0, C.style.userSelect = "none", C.className = "rte-modal-close", C.innerHTML = "×", C.onclick = () => {
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
- }, x.appendChild(_), x.appendChild(C);
459
- const P = document.createElement("div");
460
- P.className = "rte-modal-form";
461
- const I = document.createElement("label");
462
- I.textContent = "Title", I.className = "rte-label";
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 $ = document.createElement("label");
466
- $.textContent = "Source URL", $.className = "rte-label";
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 A = document.createElement("div");
470
- A.className = "rte-preview-label", A.textContent = "Preview";
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), P.appendChild(I), P.appendChild(M), P.appendChild($), P.appendChild(re), P.appendChild(A), P.appendChild(ee);
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 Y = document.createElement("cite"), H = document.createElement("a");
515
- H.href = z, H.textContent = z, H.target = "_blank", H.rel = "noopener noreferrer", Y.appendChild(H), V.appendChild(Y), Z.appendChild(V);
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(), Y = document.createElement("blockquote");
526
- if (Y.className = "rte-blockquote", K) {
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, Y.appendChild(J);
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), Y.appendChild(H), z) {
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), Y.appendChild(J);
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(Y), le.removeAllRanges();
581
+ ce.insertNode($), le.removeAllRanges();
538
582
  const ne = document.createRange();
539
- ne.setStartAfter(Y), ne.collapse(!0), le.addRange(ne), me(ne);
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(x), y.appendChild(P), y.appendChild(U), d.appendChild(y), document.body.appendChild(d);
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 Y = Z.querySelector(
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 = Y && Y.textContent || "", re.value = H && H.href || "", te.style.display = "inline-block";
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 = Y && Y.textContent || "", oe.innerHTML = H ? `<a href="${H.href}">${H.href}</a>` : "";
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"), me();
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 x = document.createElement("h3");
598
- x.className = "rte-modal-title", x.textContent = "Insert Video";
599
- const _ = document.createElement("div");
600
- _.setAttribute("role", "button"), _.tabIndex = 0, _.style.userSelect = "none", _.className = "rte-modal-close", _.innerHTML = "&times;", _.onclick = () => f.style.display = "none", y.appendChild(x), y.appendChild(_);
601
- const C = document.createElement("div");
602
- C.className = "rte-modal-form";
603
- const P = document.createElement("label");
604
- P.className = "rte-label", P.textContent = "Video URL";
605
- const I = document.createElement("input");
606
- I.type = "url", I.className = "rte-input", I.placeholder = "https://... or YouTube URL";
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 = "&times;", 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 $ = document.createElement("div");
610
- $.className = "rte-modal-preview";
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 A = document.createElement("div");
614
- A.className = "rte-form-right";
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(P), ee.appendChild(I);
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), A.appendChild(M), A.appendChild($), C.appendChild(re), C.appendChild(A);
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(C), d.appendChild(Z), f.appendChild(d), document.body.appendChild(f);
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 = () => me(), z.addEventListener("keydown", (Y) => {
641
- (Y.key === "Enter" || Y.key === " ") && (Y.preventDefault(), z.click());
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
- $.innerHTML = "<em>No URL entered</em>", I.value = "", f.style.display = "flex", I.focus();
687
+ Y.innerHTML = "<em>No URL entered</em>", O.value = "", f.style.display = "flex", O.focus();
644
688
  };
645
689
  const ce = () => {
646
- const Y = I.value.trim(), H = U && U.value.trim() || "", ne = ie && ie.value.trim() || "", J = parseInt(H, 10), se = parseInt(ne, 10);
647
- if (!Y) {
648
- $.innerHTML = "<em>No preview</em>";
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 = Y.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
695
+ const de = $.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
652
696
  if (de) {
653
- const b = de[1], D = Number.isFinite(J) ? J : 320, L = Number.isFinite(se) ? se : 180;
654
- $.innerHTML = `<iframe width="${D}" height="${L}" src="https://www.youtube.com/embed/${b}" frameborder="0" allowfullscreen></iframe>`;
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
- $.innerHTML = `<video controls style="max-width:100%; width:${pe}; height:${fe};" src="${Y}"></video>`;
702
+ Y.innerHTML = `<video controls style="max-width:100%; width:${pe}; height:${fe};" src="${$}"></video>`;
659
703
  };
660
- I.oninput = ce, typeof U < "u" && (U.oninput = ce), typeof ie < "u" && (ie.oninput = ce), K.onclick = () => {
661
- const Y = I.value.trim(), H = U && U.value.trim() || "", ne = ie && ie.value.trim() || "", J = parseInt(H, 10), se = parseInt(ne, 10);
662
- if (!Y) {
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 = Y.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
673
- let b;
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", b = B;
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 = Y, 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", b = L;
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(b), de.removeAllRanges();
725
+ pe.insertNode(x), de.removeAllRanges();
682
726
  const D = document.createRange();
683
- D.setStartAfter(b), D.collapse(!0), de.addRange(D), me(D);
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", I.value = "", $.innerHTML = "";
733
+ f.style.display = "none", O.value = "", Y.innerHTML = "";
690
734
  };
691
735
  const V = h.querySelector(".editor");
692
- return V && V.addEventListener("click", (Y) => {
693
- const H = Y.target;
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 x = So();
750
- v.appendChild(x);
751
- const _ = Mo();
752
- v.appendChild(_);
753
- const C = Ro();
754
- v.appendChild(C);
755
- const P = Io();
756
- v.appendChild(P);
757
- const I = Oo();
758
- v.appendChild(I);
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 $ = Po();
762
- v.appendChild($);
805
+ const Y = Po();
806
+ v.appendChild(Y);
763
807
  const re = No(h);
764
808
  v.appendChild(re);
765
- const A = zo();
766
- v.appendChild(A);
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 x = 0; x < y.length; x++) {
783
- const _ = y[x];
784
- if (_.type.startsWith("image/")) {
785
- const C = new FileReader();
786
- C.onload = (P) => {
787
- const I = document.createElement("img");
788
- I.src = P.target?.result, I.style.maxWidth = "100%", I.style.width = "100%", I.style.height = "auto", I.style.cursor = "pointer", I.draggable = !1;
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(I);
791
- const $ = document.createElement("p");
792
- $.style.margin = "10px 0", $.style.textAlign = "left", $.appendChild(M), f.appendChild($);
793
- }, C.readAsDataURL(_);
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 x = y;
799
- y.tagName === "IMG" && (x = y.parentElement), x && x.classList.contains("editor-image-wrapper") && v(x);
800
- }), f.addEventListener("keyup", () => me()), f.addEventListener("mouseup", () => me()), f.addEventListener("focus", () => me()), window.addEventListener("selectionchange", () => {
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) && me();
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
- P(t, r, n[r]);
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 x(t, e) {
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 _(t, e) {
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 C(t, e, n) {
860
- return e && _(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
915
+ function k(t, e, n) {
916
+ return e && S(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
861
917
  }
862
- function P(t, e, n) {
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 I(t, e) {
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 && $(t, 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 $(t, e) {
875
- return $ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
930
+ function Y(t, e) {
931
+ return Y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
876
932
  return n.__proto__ = r, n;
877
- }, $(t, e);
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 A(t) {
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 || Y, V.SVGElement = e.SVGElement || Y, V.SVGSVGElement = e.SVGSVGElement || Y, V.SVGElementInstance = e.SVGElementInstance || Y, V.Element = e.Element || Y, V.HTMLElement = e.HTMLElement || V.Element, V.Event = e.Event, V.Touch = e.Touch || Y, V.PointerEvent = e.PointerEvent || e.MSPointerEvent;
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 Y() {
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 b = function(t) {
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 = b(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = 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 R(t, e) {
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 = R({}, 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;
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
- x(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
1245
+ b(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
1190
1246
  }
1191
- return C(t, [{ key: "preventDefault", value: function() {
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
- I(n, t);
1217
- var e = A(n);
1272
+ O(n, t);
1273
+ var e = P(n);
1218
1274
  function n(r, o, i) {
1219
1275
  var a;
1220
- x(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;
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 C(n, [{ key: "reject", value: function() {
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(k) {
1273
- for (var T, S, O, F = [], W = 0; W < k.length; W++) {
1274
- var N = k[W], q = k[T];
1275
- if (N && W !== T) if (q) {
1276
- var ve = b(N), ae = b(q);
1277
- if (ve !== N.ownerDocument) if (ae !== N.ownerDocument) if (ve !== ae) {
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
- T = W, F = be;
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 O = q, (parseInt(Q(S = N).getComputedStyle(S).zIndex, 10) || 0) >= (parseInt(Q(O).getComputedStyle(O).zIndex, 10) || 0) && (T = W);
1295
- else T = W;
1296
- } else T = W;
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 T;
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, k, T, S) {
1336
- var O = !1;
1337
- if (!(S = S || p.getRect(T))) return !!p.options.drop.checker && p.options.drop.checker(m, E, O, p, T, w, k);
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, k, "drag"), N = qt(m);
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 > S.left && N.x < S.right, ve = N.y > S.top && N.y < S.bottom;
1343
- O = q && ve;
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(k);
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
- O = ge >= S.left && ge <= S.right && be >= S.top && be <= S.bottom;
1404
+ A = ge >= T.left && ge <= T.right && be >= T.top && be <= T.bottom;
1349
1405
  }
1350
- return ae && g.number(F) && (O = Math.max(0, Math.min(S.right, ae.right) - Math.max(S.left, ae.left)) * Math.max(0, Math.min(S.bottom, ae.bottom) - Math.max(S.top, ae.top)) / (ae.width * ae.height) >= F), p.options.drop.checker && (O = p.options.drop.checker(m, E, O, p, T, w, k)), O;
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
- }, R(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;
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: R({}, i), corrected: R({}, i), previous: R({}, 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;
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 (R(m, c), a) {
1464
- if (R(c, s), i === "reposition") {
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 k in c.width = c.right - c.left, c.height = c.bottom - c.top, c) p[k] = c[k] - m[k];
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 = R({}, e.coords.cur.page), s = n.options.resize;
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, R(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
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 k = n.interactable.options.drag;
1703
- if (!k.manualStart && w.testIgnoreAllow(k, p, r)) {
1704
- var T = w.getAction(n.downPointer, n.downEvent, n, p);
1705
- if (T && T.name === "drag" && (function(S, O) {
1706
- if (!O) return !1;
1707
- var F = O.options.drag.startAxis;
1708
- return S === "xy" || F === "xy" || F === S;
1709
- })(c, w) && _t.validateAction(T, w, p, r, e)) return w;
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
- x(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 };
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 C(t, [{ key: "start", value: function(e, n) {
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 = R({}, a.edges), this.edges = R({}, 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 };
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 = R({}, e.pageCoords), e.rect = R({}, i), e.edges = R({}, a);
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 = R({}, e.coords), w = null;
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
- R(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;
1822
- var k = this.result.coords, T = this.result.rect;
1823
- if (k && T) {
1824
- var S = l.rect.left !== T.left || l.rect.right !== T.right || l.rect.top !== T.top || l.rect.bottom !== T.bottom;
1825
- l.changed = S || k.x !== l.coords.x || k.y !== l.coords.y;
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" && R(this.startDelta, a.delta);
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, k = e.rect || n.rect;
1836
- k.left += w.left, k.right += w.right, k.top += w.top, k.bottom += w.bottom, k.width = k.right - k.left, k.height = k.bottom - k.top;
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 = R({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
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(R({}, e.result.coords), R({}, e.result.rect));
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
- I(n, t);
1936
- var e = A(n);
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
- x(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;
1940
- var p = r.interactable, m = (p && p.options || un).deltaSource, E = Le(p, s, i), w = a === "start", k = a === "end", T = w ? re(c) : r.prevEvent, S = w ? r.coords.start : k ? { page: T.page, client: T.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
1941
- return c.page = R({}, S.page), c.client = R({}, S.client), c.rect = R({}, r.rect), c.timeStamp = S.timeStamp, k || (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 : T.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 || k ? { x: 0, y: 0 } : { x: c[m].x - T[m].x, y: c[m].y - T[m].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = R({}, r.coords.velocity[m]), c.speed = je(c.velocity.x, c.velocity.y), c.swipe = k || a === "inertiastart" ? c.getSwipe() : null, c;
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 C(n, [{ key: "getSwipe", value: function() {
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 = C((function t(e, n, r, o, i) {
1991
- x(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;
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
- x(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) {
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 C(t, [{ key: "pointerMoveTolerance", get: function() {
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 ? R({}, 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);
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 = R({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(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
- x(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;
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 C(t, [{ key: "start", value: function(e) {
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
- x(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = R({}, e || {});
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 C(t, [{ key: "fire", value: function(e) {
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
- x(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, tt(this, e);
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 C(t, [{ key: "preventOriginalDefault", value: function() {
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 k = Ye(w);
2324
+ var C = Ye(w);
2269
2325
  if (!r[m]) {
2270
2326
  r[m] = [];
2271
- for (var T = 0; T < o.length; T++) {
2272
- var S = o[T];
2273
- a(S, m, l), a(S, m, u, !0);
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 O = r[m], F = Be(O, (function(W) {
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: [] }, O.push(F)), F.listeners.push({ func: E, options: k });
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 k, T = Ye(w), S = r[m], O = !1;
2282
- if (S)
2283
- for (k = S.length - 1; k >= 0; k--) {
2284
- var F = S[k];
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, T)) {
2289
- W.splice(N, 1), W.length || (S.splice(k, 1), s(p, m, l), s(p, m, u, !0)), O = !0;
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 (O) break;
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), k = Be(n, (function(T) {
2300
- return T.eventTarget === c;
2355
+ var w = Ye(E), C = Be(n, (function(_) {
2356
+ return _.eventTarget === c;
2301
2357
  }));
2302
- k || (k = { eventTarget: c, events: {} }, n.push(k)), k.events[p] || (k.events[p] = []), Be(k.events[p], (function(T) {
2303
- return T.func === m && ct(T.options, w);
2304
- })) || (c.addEventListener(p, m, i.supportsOptions ? w : w.capture), k.events[p].push({ func: m, options: w }));
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(ve) {
2310
- return ve.eventTarget === c;
2311
- })), k = n[w];
2312
- if (k && k.events) if (p !== "all") {
2313
- var T = !1, S = k.events[p];
2314
- if (S) {
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 O = S.length - 1; O >= 0; O--) {
2317
- var F = S[O];
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 < S.length; N++) {
2323
- var q = S[N];
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), S.splice(N, 1), S.length === 0 && (delete k.events[p], T = !0);
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
- T && !Object.keys(k.events).length && n.splice(w, 1);
2331
- } else for (p in k.events) k.events.hasOwnProperty(p) && s(c, p, "all");
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], k = $t(c)[0], T = k; g.element(T); ) {
2336
- for (var S = 0; S < w.length; S++) {
2337
- var O = w[S], F = O.selector, W = O.context;
2338
- if (fe(T, F) && se(W, k) && se(W, T)) {
2339
- var N = O.listeners;
2340
- E.currentTarget = T;
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 ve = N[q];
2343
- ct(ve.options, m) && ve.func(E);
2398
+ var me = N[q];
2399
+ ct(me.options, m) && me.func(E);
2344
2400
  }
2345
2401
  }
2346
2402
  }
2347
- T = pe(T);
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 k = 0; k < r.length && !w; k++) w = r[k].pointerType !== "mouse" && r[k].pointerIsDown;
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 T = { pointer: n, pointerId: Fe(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, S = wn(T);
2432
- l.push([T.pointer, T.eventTarget, T.curEventTarget, S]);
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 O = 0; O < l.length; O++) {
2436
- var F = l[O], W = F[0], N = F[1], q = F[2];
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
- I(u, s);
2475
- var l = A(u);
2530
+ O(u, s);
2531
+ var l = P(u);
2476
2532
  function u() {
2477
- return x(this, u), l.apply(this, arguments);
2533
+ return b(this, u), l.apply(this, arguments);
2478
2534
  }
2479
- return C(u, [{ key: "pointerMoveTolerance", get: function() {
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
- x(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);
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 C(t, [{ key: "_defaults", get: function() {
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] = R(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;
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 = R({}, e.apply(n, r));
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, R(R({}, n.perAction), n.actions[o])), this[i](e[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
- x(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
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 C(t, [{ key: "new", value: function(e, n) {
2598
- n = R(n || {}, { actions: this.scope.actions });
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
- x(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) {
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
- I(i, r);
2673
- var o = A(i);
2728
+ O(i, r);
2729
+ var o = P(i);
2674
2730
  function i() {
2675
- return x(this, i), o.apply(this, arguments);
2731
+ return b(this, i), o.apply(this, arguments);
2676
2732
  }
2677
- return C(i, [{ key: "_defaults", get: function() {
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 C(t, [{ key: "addListeners", value: function(e, n) {
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 ? R({}, 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 });
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(), he = kn.interactStatic, Er = typeof globalThis < "u" ? globalThis : window;
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], k = Math.round((r - u.x) / t[E]), T = Math.round((o - u.y) / t[w]);
2746
- c[E] = Math.max(s.left, Math.min(s.right, k * t[E] + u.x)), c[w] = Math.max(s.top, Math.min(s.bottom, T * t[w] + u.y));
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 = R(e.snappers || {}, kr), e.createSnapGrid = e.snappers.grid;
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 = R({}, o), e.startRect = R({}, n), e.ratio = a, e.equalDelta = u;
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 && R(r, p), c != null && c.length) {
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 = R({}, r), a = e.equalDelta ? _r : Mr;
2768
- if (R(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
2769
- var s = R({}, n);
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), R(r, l.coords)), l.eventProps;
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 = R({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
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 = R({}, 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;
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 = R({}, e), l = Ae(a.inner, r, s) || {}, u = Ae(a.outer, r, 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 = R({ get elementRect() {
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: R({}, $e.noInner), outer: R({}, $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;
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])), k = w || Le(m.interactable, E, m.interaction.prepared.name);
2845
- return k;
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 = R({}, n), l = [];
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, k = o.targets.length; w < k; w++) {
2860
- var T = o.targets[w], S = void 0;
2861
- (S = g.func(T) ? T(m, E, e._proxy, p, w) : T) && l.push({ x: (g.number(S.x) ? S.x : m) + p.x, y: (g.number(S.y) ? S.y : E) + p.y, range: g.number(S.range) ? S.range : o.range, source: T, index: w, offset: p });
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 O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, F = 0; F < l.length; F++) {
2864
- var W = l[F], N = W.range, q = W.x - s.x, ve = W.y - s.y, ae = je(q, ve), ge = ae <= N;
2865
- N === 1 / 0 && O.inRange && O.range !== 1 / 0 && (ge = !1), O.target && !(ge ? O.inRange && N !== 1 / 0 ? ae / N < O.distance / O.range : N === 1 / 0 && O.range !== 1 / 0 || ae < O.distance : !O.inRange && ae < O.distance) || (O.target = W, O.distance = ae, O.range = N, O.inRange = ge, O.delta.x = q, O.delta.y = ve);
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 O.inRange && (n.x = O.target.x, n.y = O.target.y), r.closest = O, O;
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 = R({}, o), n.options.targets = [];
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], k = E[1];
2880
- if (w in c || k in c) {
2881
- c.x = c[w], c.y = c[k];
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 T = Nt.set(t);
2889
- return n.options = o, T;
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: R(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) {
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
- I(n, t);
2901
- var e = A(n);
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 (x(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") {
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 C(n, [{ key: "_subtractOrigin", value: function(r) {
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, R(t.actions.phaselessTypes, We.types);
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, k = 0, T = p.targets; k < T.length; k++) {
2940
- var S = T[k].eventable.options.holdDuration;
2941
- S < w && (w = S);
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 k = u.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : u;
2967
- n.prevTap = k, n.tapTime = k.timeStamp;
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, k;
2980
- return E.eventable.options.holdDuration === ((w = n.pointers[s]) == null || (k = w.hold) == null ? void 0 : k.duration);
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 R(this.events.options, r), this;
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
- R(n.events.options, e.pointerEvents.defaults), R(n.events.options, r.pointerEvents || {});
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(S) {
3043
- return S.interacting() && S.interactable === r && S.element === p && S.prepared.name === o.name;
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(S) {
3046
- w._reflowResolve = S;
3101
+ if (w) w.move(), l && (E = w._reflowPromise || new s((function(T) {
3102
+ w._reflowResolve = T;
3047
3103
  })));
3048
3104
  else {
3049
- var k = vt(m), T = /* @__PURE__ */ (function(S) {
3050
- return { coords: S, get page() {
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: k.x, y: k.y }, client: { x: k.x, y: k.y }, timeStamp: i.now() });
3077
- E = (function(S, O, F, W, N) {
3078
- var q = S.interactions.new({ pointerType: "reflow" }), ve = { interaction: q, event: N, pointer: N, eventTarget: F, phase: "reflow" };
3079
- q.interactable = O, q.element = F, q.prevEvent = N, q.updatePointer(N, N, F, !0), Ht(q.coords.delta), St(q.prepared, W), q._doPhase(ve);
3080
- var ae = S.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
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, O, F), q._interacting ? (q.move(ve), q.end(N)) : (q.stop(), q._reflowResolve()), q.removePointer(N, N), be;
3084
- })(i, r, p, o, T);
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 (he.use(ln), he.use(hn), he.use(Xr), he.use(fr), he.use(Hr), he.use(tr), he.use(Yn), he.use(Wn), he.use(Kr), he.default = he, y(h) === "object" && h) try {
3100
- h.exports = he;
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 he.default = he, he;
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 = (x) => {
3116
- const _ = document.createElement("img");
3117
- _.src = x.target?.result, _.style.maxWidth = "100%", _.style.width = "100%", _.style.height = "auto", _.style.cursor = "pointer", _.draggable = !1;
3118
- const C = document.createElement("div");
3119
- C.className = "editor-image-wrapper", C.style.display = "inline-block", C.style.position = "relative", C.style.maxWidth = "100%", C.style.width = "auto", C.style.height = "auto", C.contentEditable = "false", C.style.boxSizing = "border-box", C.style.touchAction = "none", C.style.userSelect = "none", C.appendChild(_);
3120
- const P = document.createElement("p");
3121
- P.style.margin = "10px 0", P.style.textAlign = "left", P.appendChild(C);
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 I = window.getSelection();
3125
- if (I && I.rangeCount > 0) {
3126
- I.getRangeAt(0).insertNode(P), I.removeAllRanges();
3127
- const $ = document.createRange();
3128
- $.setStartAfter(P), $.collapse(!0), I.addRange($), me($);
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(P), h.focus(), me();
3186
+ h.appendChild(R), h.focus(), he();
3131
3187
  } catch {
3132
- h.appendChild(P), h.focus(), me();
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", x = Math.round(d.height) + "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 = x, v.contentEditable = "false", f && (f.style.width = "100%", f.style.height = "100%");
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 x = y.target;
3154
- Object.assign(x.style, {
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, x) {
3198
- var _ = null;
3199
- if (x !== void 0 && (_ = "" + x), y.key !== void 0 && (_ = "" + y.key), "key" in y) {
3200
- x = {};
3201
- for (var C in y)
3202
- C !== "key" && (x[C] = y[C]);
3203
- } else x = y;
3204
- return y = x.ref, {
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: x
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(b) {
3219
- if (b == null) return null;
3220
- if (typeof b == "function")
3221
- return b.$$typeof === ce ? null : b.displayName || b.name || null;
3222
- if (typeof b == "string") return b;
3223
- switch (b) {
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 b == "object")
3238
- switch (typeof b.tag == "number" && console.error(
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
- ), b.$$typeof) {
3296
+ ), x.$$typeof) {
3241
3297
  case G:
3242
3298
  return "Portal";
3243
3299
  case Q:
3244
- return b.displayName || "Context";
3300
+ return x.displayName || "Context";
3245
3301
  case te:
3246
- return (b._context.displayName || "Context") + ".Consumer";
3302
+ return (x._context.displayName || "Context") + ".Consumer";
3247
3303
  case ie:
3248
- var D = b.render;
3249
- return b = b.displayName, b || (b = D.displayName || D.name || "", b = b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef"), b;
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 = b.displayName || null, D !== null ? D : h(b.type) || "Memo";
3307
+ return D = x.displayName || null, D !== null ? D : h(x.type) || "Memo";
3252
3308
  case z:
3253
- D = b._payload, b = b._init;
3309
+ D = x._payload, x = x._init;
3254
3310
  try {
3255
- return h(b(D));
3311
+ return h(x(D));
3256
3312
  } catch {
3257
3313
  }
3258
3314
  }
3259
3315
  return null;
3260
3316
  }
3261
- function v(b) {
3262
- return "" + b;
3317
+ function v(x) {
3318
+ return "" + x;
3263
3319
  }
3264
- function f(b) {
3320
+ function f(x) {
3265
3321
  try {
3266
- v(b);
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 && b[Symbol.toStringTag] || b.constructor.name || "Object";
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(b);
3334
+ ), v(x);
3279
3335
  }
3280
3336
  }
3281
- function d(b) {
3282
- if (b === X) return "<>";
3283
- if (typeof b == "object" && b !== null && b.$$typeof === z)
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(b);
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 b = V.A;
3294
- return b === null ? null : b.getOwner();
3349
+ var x = V.A;
3350
+ return x === null ? null : x.getOwner();
3295
3351
  }
3296
- function x() {
3352
+ function b() {
3297
3353
  return Error("react-stack-top-frame");
3298
3354
  }
3299
- function _(b) {
3300
- if (Y.call(b, "key")) {
3301
- var D = Object.getOwnPropertyDescriptor(b, "key").get;
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 b.key !== void 0;
3360
+ return x.key !== void 0;
3305
3361
  }
3306
- function C(b, D) {
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(b, "key", {
3369
+ L.isReactWarning = !0, Object.defineProperty(x, "key", {
3314
3370
  get: L,
3315
3371
  configurable: !0
3316
3372
  });
3317
3373
  }
3318
- function P() {
3319
- var b = h(this.type);
3320
- return se[b] || (se[b] = !0, console.error(
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
- )), b = this.props.ref, b !== void 0 ? b : null;
3378
+ )), x = this.props.ref, x !== void 0 ? x : null;
3323
3379
  }
3324
- function I(b, D, L, B, xe, we) {
3380
+ function O(x, D, L, B, xe, we) {
3325
3381
  var ue = L.ref;
3326
- return b = {
3382
+ return x = {
3327
3383
  $$typeof: ee,
3328
- type: b,
3384
+ type: x,
3329
3385
  key: D,
3330
3386
  props: L,
3331
3387
  _owner: B
3332
- }, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(b, "ref", {
3388
+ }, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(x, "ref", {
3333
3389
  enumerable: !1,
3334
- get: P
3335
- }) : Object.defineProperty(b, "ref", { enumerable: !1, value: null }), b._store = {}, Object.defineProperty(b._store, "validated", {
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(b, "_debugInfo", {
3396
+ }), Object.defineProperty(x, "_debugInfo", {
3341
3397
  configurable: !1,
3342
3398
  enumerable: !1,
3343
3399
  writable: !0,
3344
3400
  value: null
3345
- }), Object.defineProperty(b, "_debugStack", {
3401
+ }), Object.defineProperty(x, "_debugStack", {
3346
3402
  configurable: !1,
3347
3403
  enumerable: !1,
3348
3404
  writable: !0,
3349
3405
  value: xe
3350
- }), Object.defineProperty(b, "_debugTask", {
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(b.props), Object.freeze(b)), b;
3411
+ }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
3356
3412
  }
3357
- function M(b, D, L, B, xe, we) {
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
- $(ue[B]);
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 $(ue);
3370
- if (Y.call(D, "key")) {
3371
- ue = h(b);
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), _(D) && (f(D.key), ue = "" + D.key), "key" in D) {
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 R in D)
3391
- R !== "key" && (L[R] = D[R]);
3446
+ for (var I in D)
3447
+ I !== "key" && (L[I] = D[I]);
3392
3448
  } else L = D;
3393
- return ue && C(
3449
+ return ue && k(
3394
3450
  L,
3395
- typeof b == "function" ? b.displayName || b.name || "Unknown" : b
3396
- ), I(
3397
- b,
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 $(b) {
3406
- re(b) ? b._store && (b._store.validated = 1) : typeof b == "object" && b !== null && b.$$typeof === z && (b._payload.status === "fulfilled" ? re(b._payload.value) && b._payload.value._store && (b._payload.value._store.validated = 1) : b._store && (b._store.validated = 1));
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(b) {
3409
- return typeof b == "object" && b !== null && b.$$typeof === ee;
3464
+ function re(x) {
3465
+ return typeof x == "object" && x !== null && x.$$typeof === ee;
3410
3466
  }
3411
- var A = 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 = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, H = Array.isArray, ne = console.createTask ? console.createTask : function() {
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
- A = {
3415
- react_stack_bottom_frame: function(b) {
3416
- return b();
3470
+ P = {
3471
+ react_stack_bottom_frame: function(x) {
3472
+ return x();
3417
3473
  }
3418
3474
  };
3419
- var J, se = {}, de = A.react_stack_bottom_frame.bind(
3420
- A,
3421
- x
3422
- )(), pe = ne(d(x)), fe = {};
3423
- Ge.Fragment = X, Ge.jsx = function(b, D, L) {
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
- b,
3482
+ x,
3427
3483
  D,
3428
3484
  L,
3429
3485
  !1,
3430
3486
  B ? Error("react-stack-top-frame") : de,
3431
- B ? ne(d(b)) : pe
3487
+ B ? ne(d(x)) : pe
3432
3488
  );
3433
- }, Ge.jsxs = function(b, D, L) {
3489
+ }, Ge.jsxs = function(x, D, L) {
3434
3490
  var B = 1e4 > V.recentlyCreatedOwnerStacks++;
3435
3491
  return M(
3436
- b,
3492
+ x,
3437
3493
  D,
3438
3494
  L,
3439
3495
  !0,
3440
3496
  B ? Error("react-stack-top-frame") : de,
3441
- B ? ne(d(b)) : pe
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(), x = () => {
3460
- const _ = f.current?.getHTML() || "";
3461
- h?.(_);
3515
+ const y = f.current.getElement(), b = () => {
3516
+ const S = f.current?.getHTML() || "";
3517
+ h?.(S);
3462
3518
  };
3463
- y.addEventListener("input", x), y.addEventListener("keyup", x), y.addEventListener("paste", x);
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
  };