nam-rich-text-editor 9.2.1 → 9.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rich-text-editor.es.js +1447 -1374
- package/dist/rich-text-editor.umd.js +9 -9
- package/dist/utils/SelectionUtils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import Qr, { forwardRef as Zr, useRef as Xe, useEffect as
|
|
1
|
+
import Qr, { forwardRef as Zr, useRef as Xe, useEffect as Ht, useImperativeHandle as eo } from "react";
|
|
2
2
|
function to() {
|
|
3
|
-
const
|
|
4
|
-
return
|
|
3
|
+
const h = document.createElement("select");
|
|
4
|
+
return h.innerHTML = `
|
|
5
5
|
<option value="Arial">Arial</option>
|
|
6
6
|
<option value="Times New Roman">Times New Roman</option>
|
|
7
7
|
<option value="Courier New">Courier New</option>
|
|
8
8
|
<option value="Georgia">Georgia</option>
|
|
9
9
|
<option value="Verdana">Verdana</option>
|
|
10
|
-
`,
|
|
10
|
+
`, h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "4px", h.style.borderRadius = "3px", h.style.color = "#000000", h.onchange = () => document.execCommand("fontName", !1, h.value), h;
|
|
11
11
|
}
|
|
12
12
|
function no() {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const h = document.createElement("select");
|
|
14
|
+
return h.innerHTML = `
|
|
15
15
|
<option value="1">8pt</option>
|
|
16
16
|
<option value="2">10pt</option>
|
|
17
17
|
<option value="3" selected>12pt</option>
|
|
@@ -19,20 +19,20 @@ function no() {
|
|
|
19
19
|
<option value="5">18pt</option>
|
|
20
20
|
<option value="6">24pt</option>
|
|
21
21
|
<option value="7">36pt</option>
|
|
22
|
-
`,
|
|
22
|
+
`, h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "4px", h.style.borderRadius = "3px", h.style.color = "#000000", h.onchange = () => document.execCommand("fontSize", !1, h.value), h;
|
|
23
23
|
}
|
|
24
24
|
function ro() {
|
|
25
|
-
const
|
|
26
|
-
return
|
|
25
|
+
const h = document.createElement("select");
|
|
26
|
+
return h.title = "Heading", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "4px", h.style.borderRadius = "3px", h.style.color = "#000000", h.innerHTML = `
|
|
27
27
|
<option value="p">Normal</option>
|
|
28
28
|
<option value="h1">Heading 1</option>
|
|
29
29
|
<option value="h2">Heading 2</option>
|
|
30
30
|
<option value="h3">Heading 3</option>
|
|
31
31
|
<option value="h4">Heading 4</option>
|
|
32
|
-
`,
|
|
33
|
-
const
|
|
32
|
+
`, h.onchange = () => {
|
|
33
|
+
const m = h.value, p = m === "p" ? "P" : m.toUpperCase();
|
|
34
34
|
document.execCommand("formatBlock", !1, `<${p}>`);
|
|
35
|
-
},
|
|
35
|
+
}, h;
|
|
36
36
|
}
|
|
37
37
|
const oo = {
|
|
38
38
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45,20 +45,20 @@ const oo = {
|
|
|
45
45
|
"stroke-linecap": "round",
|
|
46
46
|
"stroke-linejoin": "round"
|
|
47
47
|
};
|
|
48
|
-
const
|
|
49
|
-
const u = document.createElementNS("http://www.w3.org/2000/svg",
|
|
50
|
-
return Object.keys(
|
|
51
|
-
u.setAttribute(
|
|
52
|
-
}), p?.length && p.forEach((
|
|
53
|
-
const
|
|
54
|
-
u.appendChild(
|
|
48
|
+
const zn = ([h, m, p]) => {
|
|
49
|
+
const u = document.createElementNS("http://www.w3.org/2000/svg", h);
|
|
50
|
+
return Object.keys(m).forEach((v) => {
|
|
51
|
+
u.setAttribute(v, String(m[v]));
|
|
52
|
+
}), p?.length && p.forEach((v) => {
|
|
53
|
+
const y = zn(v);
|
|
54
|
+
u.appendChild(y);
|
|
55
55
|
}), u;
|
|
56
|
-
}, ye = (
|
|
56
|
+
}, ye = (h, m = {}) => {
|
|
57
57
|
const u = {
|
|
58
58
|
...oo,
|
|
59
|
-
...
|
|
59
|
+
...m
|
|
60
60
|
};
|
|
61
|
-
return
|
|
61
|
+
return zn(["svg", u, h]);
|
|
62
62
|
};
|
|
63
63
|
const io = [
|
|
64
64
|
["path", { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }]
|
|
@@ -111,13 +111,13 @@ const ho = [
|
|
|
111
111
|
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }],
|
|
112
112
|
["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" }]
|
|
113
113
|
];
|
|
114
|
-
const
|
|
114
|
+
const mo = [
|
|
115
115
|
["path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }],
|
|
116
116
|
["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }],
|
|
117
117
|
["path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }],
|
|
118
118
|
["path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" }]
|
|
119
119
|
];
|
|
120
|
-
const
|
|
120
|
+
const vo = [
|
|
121
121
|
[
|
|
122
122
|
"path",
|
|
123
123
|
{
|
|
@@ -177,48 +177,48 @@ const To = [
|
|
|
177
177
|
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
178
178
|
];
|
|
179
179
|
let Qe = null;
|
|
180
|
-
function de(
|
|
181
|
-
if (
|
|
182
|
-
Qe =
|
|
180
|
+
function de(h) {
|
|
181
|
+
if (h) {
|
|
182
|
+
Qe = h.cloneRange();
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
185
|
+
const m = window.getSelection();
|
|
186
|
+
if (!m || m.rangeCount === 0) {
|
|
187
187
|
Qe = null;
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
|
-
Qe =
|
|
190
|
+
Qe = m.getRangeAt(0).cloneRange();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
|
|
192
|
+
function Re() {
|
|
193
|
+
const h = window.getSelection();
|
|
194
|
+
h && (h.removeAllRanges(), Qe && h.addRange(Qe.cloneRange()));
|
|
195
195
|
}
|
|
196
|
-
function Fn(
|
|
196
|
+
function Fn(h, m) {
|
|
197
197
|
const p = window.getSelection();
|
|
198
198
|
if (!p || p.rangeCount === 0) return;
|
|
199
199
|
const u = p.getRangeAt(0);
|
|
200
200
|
if (!u.collapsed) {
|
|
201
201
|
const w = document.createElement("span");
|
|
202
|
-
w.style[
|
|
203
|
-
const
|
|
204
|
-
w.appendChild(
|
|
205
|
-
const
|
|
206
|
-
|
|
202
|
+
w.style[h] = m;
|
|
203
|
+
const g = u.extractContents();
|
|
204
|
+
w.appendChild(g), u.insertNode(w), p.removeAllRanges();
|
|
205
|
+
const T = document.createRange();
|
|
206
|
+
T.selectNodeContents(w), p.addRange(T), de(T);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
209
|
+
const v = document.createElement("span");
|
|
210
|
+
v.style[h] = m, v.appendChild(document.createTextNode("")), u.insertNode(v), p.removeAllRanges();
|
|
211
|
+
const y = document.createRange();
|
|
212
|
+
y.setStart(v.firstChild, 0), y.setEnd(v.firstChild, 0), p.addRange(y), de(y);
|
|
213
213
|
}
|
|
214
|
-
function _o(
|
|
215
|
-
Fn("color",
|
|
214
|
+
function _o(h) {
|
|
215
|
+
Fn("color", h);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
Fn("backgroundColor",
|
|
217
|
+
function Ao(h) {
|
|
218
|
+
Fn("backgroundColor", h);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
const
|
|
220
|
+
function Mo() {
|
|
221
|
+
const h = document.createDocumentFragment();
|
|
222
222
|
return [
|
|
223
223
|
{ command: "bold", icon: io, title: "Bold" },
|
|
224
224
|
{ command: "italic", icon: so, title: "Italic" },
|
|
@@ -226,39 +226,39 @@ function Ro() {
|
|
|
226
226
|
{ command: "strikeThrough", icon: bo, title: "Strikethrough" }
|
|
227
227
|
].forEach((p) => {
|
|
228
228
|
const u = document.createElement("div");
|
|
229
|
-
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (
|
|
230
|
-
(
|
|
229
|
+
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (y) => {
|
|
230
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), u.click());
|
|
231
231
|
});
|
|
232
|
-
const
|
|
233
|
-
u.appendChild(
|
|
234
|
-
|
|
235
|
-
}), u.onclick = (
|
|
236
|
-
|
|
232
|
+
const v = ye(p.icon, { width: 16, height: 16 });
|
|
233
|
+
u.appendChild(v), u.title = p.title, u.style.fontWeight = p.command === "bold" ? "bold" : "normal", u.style.fontStyle = p.command === "italic" ? "italic" : "normal", u.style.textDecoration = p.command === "underline" ? "underline" : "none", u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.addEventListener("mousedown", (y) => {
|
|
234
|
+
y.preventDefault(), de();
|
|
235
|
+
}), u.onclick = (y) => {
|
|
236
|
+
y.preventDefault();
|
|
237
237
|
const w = u.closest(".editor-container")?.querySelector(".editor");
|
|
238
|
-
w && (
|
|
239
|
-
},
|
|
240
|
-
}),
|
|
238
|
+
w && (Re(), w.focus()), document.execCommand(p.command), w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
239
|
+
}, h.appendChild(u);
|
|
240
|
+
}), h;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
|
|
242
|
+
function Ro() {
|
|
243
|
+
const h = document.createDocumentFragment(), m = document.createElement("input");
|
|
244
|
+
m.type = "color", m.style.display = "none", m.title = "Text Color";
|
|
245
245
|
const p = document.createElement("div");
|
|
246
|
-
p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (
|
|
247
|
-
(
|
|
248
|
-
}), p.textContent = "A", p.style.color = "#000", p.style.fontSize = "16px", p.style.fontWeight = "bold", p.style.border = "1px solid #ccc", p.style.borderRadius = "4px", p.style.padding = "4px 8px", p.style.cursor = "pointer", p.style.backgroundColor = "#fff", p.title = "Text Color", p.onclick = () =>
|
|
249
|
-
|
|
250
|
-
},
|
|
246
|
+
p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (y) => {
|
|
247
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), p.click());
|
|
248
|
+
}), p.textContent = "A", p.style.color = "#000", p.style.fontSize = "16px", p.style.fontWeight = "bold", p.style.border = "1px solid #ccc", p.style.borderRadius = "4px", p.style.padding = "4px 8px", p.style.cursor = "pointer", p.style.backgroundColor = "#fff", p.title = "Text Color", p.onclick = () => m.click(), m.onchange = () => {
|
|
249
|
+
Re(), _o(m.value), p.style.color = m.value;
|
|
250
|
+
}, h.appendChild(p), h.appendChild(m);
|
|
251
251
|
const u = document.createElement("input");
|
|
252
252
|
u.type = "color", u.style.display = "none", u.title = "Background Color";
|
|
253
|
-
const
|
|
254
|
-
return
|
|
255
|
-
(
|
|
256
|
-
}),
|
|
257
|
-
|
|
258
|
-
},
|
|
253
|
+
const v = document.createElement("div");
|
|
254
|
+
return v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (y) => {
|
|
255
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), v.click());
|
|
256
|
+
}), v.textContent = "BA", v.style.color = "#000", v.style.fontSize = "14px", v.style.fontWeight = "bold", v.style.border = "1px solid #ccc", v.style.borderRadius = "4px", v.style.padding = "4px 6px", v.style.cursor = "pointer", v.style.backgroundColor = "#fff", v.title = "Background Color", v.onclick = () => u.click(), u.onchange = () => {
|
|
257
|
+
Re(), Ao(u.value), v.style.backgroundColor = u.value, v.style.color = "#000";
|
|
258
|
+
}, h.appendChild(v), h.appendChild(u), h;
|
|
259
259
|
}
|
|
260
260
|
function Io() {
|
|
261
|
-
const
|
|
261
|
+
const h = document.createDocumentFragment();
|
|
262
262
|
return [
|
|
263
263
|
{
|
|
264
264
|
command: "justifyLeft",
|
|
@@ -286,485 +286,485 @@ function Io() {
|
|
|
286
286
|
}
|
|
287
287
|
].forEach((p) => {
|
|
288
288
|
const u = document.createElement("div");
|
|
289
|
-
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (
|
|
290
|
-
(
|
|
289
|
+
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (y) => {
|
|
290
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), u.click());
|
|
291
291
|
});
|
|
292
|
-
const
|
|
293
|
-
u.appendChild(
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
292
|
+
const v = ye(p.icon, { width: 16, height: 16 });
|
|
293
|
+
u.appendChild(v), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.addEventListener("mousedown", (y) => {
|
|
294
|
+
y.preventDefault();
|
|
295
|
+
}), u.onclick = (y) => {
|
|
296
|
+
y.preventDefault(), y.stopPropagation();
|
|
297
|
+
const g = u.closest(".editor-container")?.querySelector(".editor");
|
|
298
|
+
if (!g) return;
|
|
299
|
+
const T = window.__selectedImageContainer;
|
|
300
|
+
if (console.log("Align clicked, selectedContainer:", T), T && g.contains(T)) {
|
|
301
|
+
T.style.textAlign = p.align, console.log("Applied align:", p.align, "to container"), g.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const A = window.getSelection();
|
|
305
|
+
if (A && A.rangeCount > 0 && A.anchorNode) {
|
|
306
|
+
let k = A.anchorNode;
|
|
307
|
+
for (; k && k.nodeType !== Node.ELEMENT_NODE; )
|
|
308
|
+
k = k.parentNode;
|
|
309
|
+
let _ = k;
|
|
310
|
+
for (; _ && _ !== g && _ !== document.body; ) {
|
|
311
|
+
if (_.tagName === "P" || _.classList.contains("editor-image-container")) {
|
|
312
|
+
_.style.textAlign = p.align, g.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
313
|
+
return;
|
|
308
314
|
}
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
if (S) {
|
|
312
|
-
S.style.textAlign = p.align;
|
|
313
|
-
const _ = u.closest(".editor-container")?.querySelector(".editor");
|
|
314
|
-
_ && _.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
315
|
-
return;
|
|
315
|
+
_ = _.parentElement;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
document.execCommand(p.command);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}, v.appendChild(u);
|
|
322
|
-
}), v;
|
|
318
|
+
document.execCommand(p.command), g.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
319
|
+
}, h.appendChild(u);
|
|
320
|
+
}), h;
|
|
323
321
|
}
|
|
324
|
-
function Po(
|
|
325
|
-
|
|
322
|
+
function Po(h) {
|
|
323
|
+
h.querySelectorAll(
|
|
324
|
+
"p > ul, p > ol, div:not(.editor-image-container):not(.editor-image-wrapper) > ul, div:not(.editor-image-container):not(.editor-image-wrapper) > ol"
|
|
325
|
+
).forEach((p) => {
|
|
326
326
|
const u = p.parentElement;
|
|
327
|
-
u && u.tagName === "P" && (u.parentNode?.insertBefore(p, u.nextSibling), !u.textContent?.trim() && !u.querySelector("img") && u.remove());
|
|
327
|
+
u && (u.tagName === "P" || u.tagName === "DIV" && !u.classList.contains("editor-image-container") && !u.classList.contains("editor-image-wrapper") && u !== h) && (u.parentNode?.insertBefore(p, u.nextSibling), !u.textContent?.trim() && !u.querySelector("img") && u.remove());
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
330
|
function Oo() {
|
|
331
|
-
const
|
|
331
|
+
const h = document.createDocumentFragment();
|
|
332
332
|
return [
|
|
333
333
|
{ command: "insertUnorderedList", icon: fo, title: "Bullet List" },
|
|
334
334
|
{ command: "insertOrderedList", icon: po, title: "Numbered List" }
|
|
335
335
|
].forEach((p) => {
|
|
336
336
|
const u = document.createElement("div");
|
|
337
|
-
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (
|
|
338
|
-
(
|
|
337
|
+
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (y) => {
|
|
338
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), u.click());
|
|
339
339
|
});
|
|
340
|
-
const
|
|
341
|
-
u.appendChild(
|
|
342
|
-
|
|
343
|
-
}), u.onclick = (
|
|
344
|
-
|
|
340
|
+
const v = ye(p.icon, { width: 16, height: 16 });
|
|
341
|
+
u.appendChild(v), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.addEventListener("mousedown", (y) => {
|
|
342
|
+
y.preventDefault(), de();
|
|
343
|
+
}), u.onclick = (y) => {
|
|
344
|
+
y.preventDefault();
|
|
345
345
|
const w = u.closest(".editor-container")?.querySelector(".editor");
|
|
346
|
-
w ? (
|
|
346
|
+
w ? (Re(), w.focus(), document.execCommand(p.command), setTimeout(() => {
|
|
347
347
|
Po(w), w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
348
348
|
}, 0)) : document.execCommand(p.command);
|
|
349
|
-
},
|
|
350
|
-
}),
|
|
349
|
+
}, h.appendChild(u);
|
|
350
|
+
}), h;
|
|
351
351
|
}
|
|
352
352
|
function Do() {
|
|
353
|
-
const
|
|
353
|
+
const h = document.createDocumentFragment();
|
|
354
354
|
return [
|
|
355
355
|
{ command: "indent", icon: uo, title: "Increase Indent" },
|
|
356
356
|
{ command: "outdent", icon: co, title: "Decrease Indent" }
|
|
357
357
|
].forEach((p) => {
|
|
358
358
|
const u = document.createElement("div");
|
|
359
|
-
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (
|
|
360
|
-
(
|
|
359
|
+
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (y) => {
|
|
360
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), u.click());
|
|
361
361
|
});
|
|
362
|
-
const
|
|
363
|
-
u.appendChild(
|
|
364
|
-
}),
|
|
362
|
+
const v = ye(p.icon, { width: 16, height: 16 });
|
|
363
|
+
u.appendChild(v), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), h.appendChild(u);
|
|
364
|
+
}), h;
|
|
365
365
|
}
|
|
366
366
|
function No() {
|
|
367
|
-
const
|
|
367
|
+
const h = document.createDocumentFragment();
|
|
368
368
|
return [
|
|
369
369
|
{ command: "undo", icon: So, title: "Undo" },
|
|
370
370
|
{ command: "redo", icon: go, title: "Redo" }
|
|
371
371
|
].forEach((p) => {
|
|
372
372
|
const u = document.createElement("div");
|
|
373
|
-
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (
|
|
374
|
-
(
|
|
373
|
+
u.setAttribute("role", "button"), u.tabIndex = 0, u.style.userSelect = "none", u.addEventListener("keydown", (y) => {
|
|
374
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), u.click());
|
|
375
375
|
});
|
|
376
|
-
const
|
|
377
|
-
u.appendChild(
|
|
378
|
-
}),
|
|
376
|
+
const v = ye(p.icon, { width: 16, height: 16 });
|
|
377
|
+
u.appendChild(v), u.title = p.title, u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "6px 10px", u.style.borderRadius = "3px", u.style.cursor = "pointer", u.style.color = "#000000", u.onmouseover = () => u.style.backgroundColor = "#f0f0f0", u.onmouseout = () => u.style.backgroundColor = "#ffffff", u.onclick = () => document.execCommand(p.command), h.appendChild(u);
|
|
378
|
+
}), h;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
(p.key === "Enter" || p.key === " ") && (p.preventDefault(),
|
|
380
|
+
function Lo() {
|
|
381
|
+
const h = document.createElement("div");
|
|
382
|
+
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (p) => {
|
|
383
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), h.click());
|
|
384
384
|
});
|
|
385
|
-
const
|
|
386
|
-
return
|
|
385
|
+
const m = ye(ao, { width: 16, height: 16 });
|
|
386
|
+
return h.appendChild(m), 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 = () => de(), h;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
388
|
+
function zo() {
|
|
389
|
+
const h = document.createElement("div");
|
|
390
|
+
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (w) => {
|
|
391
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), h.click());
|
|
392
392
|
});
|
|
393
|
-
const
|
|
393
|
+
const m = ye(ho, {
|
|
394
394
|
width: 16,
|
|
395
395
|
height: 16
|
|
396
|
-
}), p = ye(
|
|
396
|
+
}), p = ye(mo, {
|
|
397
397
|
width: 16,
|
|
398
398
|
height: 16
|
|
399
399
|
});
|
|
400
|
-
|
|
401
|
-
let u = !1,
|
|
402
|
-
return
|
|
403
|
-
const w =
|
|
400
|
+
h.appendChild(m), 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";
|
|
401
|
+
let u = !1, v = "", y = "";
|
|
402
|
+
return h.onclick = () => {
|
|
403
|
+
const w = h.closest(
|
|
404
404
|
".editor-container"
|
|
405
405
|
);
|
|
406
406
|
if (!w) return;
|
|
407
|
-
const
|
|
407
|
+
const g = w.querySelector(".editor");
|
|
408
408
|
if (u)
|
|
409
|
-
|
|
409
|
+
v ? w.setAttribute("style", v) : w.removeAttribute("style"), g && (y ? g.setAttribute("style", y) : g.removeAttribute("style")), h.replaceChild(m, p), u = !1;
|
|
410
410
|
else {
|
|
411
|
-
|
|
411
|
+
v = w.getAttribute("style") || "", y = g && g.getAttribute("style") || "", w.style.position = "fixed", w.style.top = "0", w.style.left = "0", w.style.width = "100vw", w.style.height = "100vh", w.style.margin = "0", w.style.padding = "0";
|
|
412
412
|
try {
|
|
413
|
-
let
|
|
414
|
-
document.querySelectorAll("body *").forEach((
|
|
415
|
-
const
|
|
416
|
-
!isNaN(
|
|
417
|
-
}), w.style.zIndex = String(Math.max(
|
|
413
|
+
let T = 9998;
|
|
414
|
+
document.querySelectorAll("body *").forEach((A) => {
|
|
415
|
+
const k = window.getComputedStyle(A).getPropertyValue("z-index"), _ = parseInt(k, 10);
|
|
416
|
+
!isNaN(_) && _ > 0 && (T = Math.max(T, _));
|
|
417
|
+
}), w.style.zIndex = String(Math.max(T + 1, 9999));
|
|
418
418
|
} catch {
|
|
419
419
|
w.style.zIndex = "9999";
|
|
420
420
|
}
|
|
421
|
-
w.style.backgroundColor = "#ffffff", w.style.display = "flex", w.style.flexDirection = "column", w.style.boxSizing = "border-box",
|
|
421
|
+
w.style.backgroundColor = "#ffffff", w.style.display = "flex", w.style.flexDirection = "column", w.style.boxSizing = "border-box", g && (g.style.flex = "1 1 0", g.style.overflowY = "auto", g.style.border = "none", g.style.borderRadius = "0", g.style.boxShadow = "none", g.style.height = "", g.style.minHeight = "0", g.style.maxHeight = "none", g.style.padding = "20px", g.style.boxSizing = "border-box"), h.replaceChild(p, m), u = !0;
|
|
422
422
|
}
|
|
423
|
-
},
|
|
423
|
+
}, h;
|
|
424
424
|
}
|
|
425
|
-
function Fo(
|
|
426
|
-
const
|
|
425
|
+
function Fo(h) {
|
|
426
|
+
const m = document.createDocumentFragment(), p = document.createElement("div");
|
|
427
427
|
p.style.position = "fixed", p.style.top = "0", p.style.left = "0", p.style.width = "100%", p.style.height = "100%", p.style.backgroundColor = "rgba(0, 0, 0, 0.5)", p.style.display = "none", p.style.zIndex = "1000", p.style.alignItems = "center", p.style.justifyContent = "center", p.style.flexDirection = "column";
|
|
428
428
|
const u = document.createElement("div");
|
|
429
429
|
u.style.backgroundColor = "#fff", u.style.padding = "20px", u.style.borderRadius = "8px", u.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)", u.style.minWidth = "300px";
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
const
|
|
433
|
-
|
|
430
|
+
const v = document.createElement("h3");
|
|
431
|
+
v.textContent = "Insert Hyperlink", v.style.margin = "0 0 15px 0", v.style.fontSize = "18px", v.style.fontWeight = "bold";
|
|
432
|
+
const y = document.createElement("input");
|
|
433
|
+
y.type = "url", y.placeholder = "Enter URL (e.g., https://example.com)", y.style.width = "100%", y.style.padding = "8px", y.style.border = "1px solid #ccc", y.style.borderRadius = "4px", y.style.marginBottom = "15px", y.style.boxSizing = "border-box";
|
|
434
434
|
const w = document.createElement("div");
|
|
435
435
|
w.style.display = "flex", w.style.gap = "10px", w.style.justifyContent = "flex-end";
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
(
|
|
439
|
-
}),
|
|
440
|
-
p.style.display = "none",
|
|
436
|
+
const g = document.createElement("div");
|
|
437
|
+
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.textContent = "Cancel", g.style.padding = "8px 16px", g.style.border = "1px solid #ccc", g.style.borderRadius = "4px", g.style.backgroundColor = "#f5f5f5", g.style.cursor = "pointer", g.addEventListener("keydown", (R) => {
|
|
438
|
+
(R.key === "Enter" || R.key === " " || R.key === "Escape") && (R.preventDefault(), g.click());
|
|
439
|
+
}), g.onclick = () => {
|
|
440
|
+
p.style.display = "none", y.value = "", T = null;
|
|
441
441
|
};
|
|
442
|
-
let
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
(
|
|
446
|
-
}),
|
|
447
|
-
const
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
|
|
442
|
+
let T = null;
|
|
443
|
+
const A = document.createElement("div");
|
|
444
|
+
A.setAttribute("role", "button"), A.tabIndex = 0, A.style.userSelect = "none", A.textContent = "Insert", A.style.padding = "8px 16px", A.style.border = "none", A.style.borderRadius = "4px", A.style.backgroundColor = "#007bff", A.style.color = "#fff", A.style.cursor = "pointer", A.addEventListener("keydown", (R) => {
|
|
445
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), A.click());
|
|
446
|
+
}), A.onclick = () => {
|
|
447
|
+
const R = y.value.trim();
|
|
448
|
+
if (R)
|
|
449
|
+
if (T)
|
|
450
|
+
T.setAttribute("href", R), T.setAttribute("target", "_blank"), T.setAttribute("rel", "noopener noreferrer"), T.setAttribute("tabindex", "0");
|
|
451
451
|
else {
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
455
|
-
let
|
|
456
|
-
for (;
|
|
457
|
-
|
|
458
|
-
let
|
|
459
|
-
for (;
|
|
460
|
-
if (
|
|
461
|
-
const
|
|
462
|
-
|
|
452
|
+
Re(), document.execCommand("createLink", !1, R);
|
|
453
|
+
const j = window.getSelection();
|
|
454
|
+
if (j && j.rangeCount > 0) {
|
|
455
|
+
let N = j.getRangeAt(0).startContainer;
|
|
456
|
+
for (; N && N.nodeType !== Node.ELEMENT_NODE; )
|
|
457
|
+
N = N.parentNode;
|
|
458
|
+
let P = N;
|
|
459
|
+
for (; P && P !== document.body; ) {
|
|
460
|
+
if (P.tagName === "A") {
|
|
461
|
+
const H = P;
|
|
462
|
+
H.setAttribute("target", "_blank"), H.setAttribute("rel", "noopener noreferrer"), H.setAttribute("tabindex", "0");
|
|
463
463
|
break;
|
|
464
464
|
}
|
|
465
|
-
|
|
465
|
+
P = P.parentElement;
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
p.style.display = "none",
|
|
470
|
-
}, w.appendChild(
|
|
471
|
-
|
|
469
|
+
p.style.display = "none", y.value = "", T = null;
|
|
470
|
+
}, w.appendChild(g), w.appendChild(A), u.appendChild(v), u.appendChild(y), u.appendChild(w), p.appendChild(u), document.body.appendChild(p), y.onkeydown = (R) => {
|
|
471
|
+
R.key === "Enter" ? A.click() : R.key === "Escape" && g.click();
|
|
472
472
|
};
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
let
|
|
481
|
-
for (;
|
|
482
|
-
|
|
483
|
-
let
|
|
484
|
-
for (;
|
|
485
|
-
if (
|
|
486
|
-
|
|
473
|
+
const k = document.createElement("div");
|
|
474
|
+
k.setAttribute("role", "button"), k.tabIndex = 0, k.style.userSelect = "none";
|
|
475
|
+
const _ = ye(lo, { width: 16, height: 16 });
|
|
476
|
+
k.appendChild(_), k.title = "Insert Hyperlink", k.style.border = "1px solid #e1e1e1", k.style.backgroundColor = "#ffffff", k.style.padding = "6px 10px", k.style.borderRadius = "3px", k.style.cursor = "pointer", k.style.color = "#000000", k.onmouseover = () => k.style.backgroundColor = "#f0f0f0", k.onmouseout = () => k.style.backgroundColor = "#ffffff", k.onmousedown = () => {
|
|
477
|
+
T = null;
|
|
478
|
+
const R = window.getSelection();
|
|
479
|
+
if (R && R.rangeCount > 0) {
|
|
480
|
+
let N = R.getRangeAt(0).startContainer;
|
|
481
|
+
for (; N && N.nodeType !== Node.ELEMENT_NODE; )
|
|
482
|
+
N = N.parentNode;
|
|
483
|
+
let P = N;
|
|
484
|
+
for (; P && P !== document.body; ) {
|
|
485
|
+
if (P.tagName === "A") {
|
|
486
|
+
T = P, y.value = T.getAttribute("href") || "";
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
|
-
|
|
489
|
+
P = P.parentElement;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
de();
|
|
493
|
-
},
|
|
494
|
-
(
|
|
495
|
-
}),
|
|
496
|
-
p.style.display = "flex",
|
|
497
|
-
},
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
|
|
493
|
+
}, k.addEventListener("keydown", (R) => {
|
|
494
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), k.click());
|
|
495
|
+
}), k.onclick = () => {
|
|
496
|
+
p.style.display = "flex", y.focus();
|
|
497
|
+
}, m.appendChild(k);
|
|
498
|
+
const I = h.querySelector(".editor");
|
|
499
|
+
return I && I.addEventListener("click", (R) => {
|
|
500
|
+
const j = R.target;
|
|
501
|
+
if (j.tagName === "A") {
|
|
502
|
+
R.preventDefault();
|
|
503
|
+
const N = j.getAttribute("href");
|
|
504
|
+
N && window.open(N, "_blank");
|
|
505
505
|
}
|
|
506
|
-
}),
|
|
506
|
+
}), m;
|
|
507
507
|
}
|
|
508
508
|
function jo() {
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
(
|
|
509
|
+
const h = document.createDocumentFragment(), m = document.createElement("div");
|
|
510
|
+
m.setAttribute("role", "button"), m.tabIndex = 0, m.style.userSelect = "none", m.addEventListener("keydown", (ne) => {
|
|
511
|
+
(ne.key === "Enter" || ne.key === " ") && (ne.preventDefault(), m.click());
|
|
512
512
|
});
|
|
513
|
-
const p = ye(
|
|
514
|
-
|
|
513
|
+
const p = ye(vo, { width: 16, height: 16 });
|
|
514
|
+
m.appendChild(p), m.title = "Insert Quote", 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";
|
|
515
515
|
const u = document.createElement("div");
|
|
516
516
|
u.className = "rte-modal-overlay", u.style.display = "none";
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
517
|
+
const v = document.createElement("div");
|
|
518
|
+
v.className = "rte-modal";
|
|
519
|
+
const y = document.createElement("div");
|
|
520
|
+
y.className = "rte-modal-header";
|
|
521
521
|
const w = document.createElement("h3");
|
|
522
522
|
w.textContent = "Insert Quote", w.className = "rte-modal-title";
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
u.style.display = "none",
|
|
526
|
-
},
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const S = document.createElement("label");
|
|
530
|
-
S.textContent = "Title", S.className = "rte-label";
|
|
531
|
-
const _ = document.createElement("input");
|
|
532
|
-
_.type = "text", _.placeholder = "e.g., Article title or source", _.className = "rte-input";
|
|
523
|
+
const g = document.createElement("div");
|
|
524
|
+
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.className = "rte-modal-close", g.innerHTML = "×", g.onclick = () => {
|
|
525
|
+
u.style.display = "none", te = null;
|
|
526
|
+
}, y.appendChild(w), y.appendChild(g);
|
|
527
|
+
const T = document.createElement("div");
|
|
528
|
+
T.className = "rte-modal-form";
|
|
533
529
|
const A = document.createElement("label");
|
|
534
|
-
A.textContent = "
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
|
|
530
|
+
A.textContent = "Title", A.className = "rte-label";
|
|
531
|
+
const k = document.createElement("input");
|
|
532
|
+
k.type = "text", k.placeholder = "e.g., Article title or source", k.className = "rte-input";
|
|
533
|
+
const _ = document.createElement("label");
|
|
534
|
+
_.textContent = "Source URL", _.className = "rte-label";
|
|
535
|
+
const I = document.createElement("input");
|
|
536
|
+
I.type = "url", I.placeholder = "https://example.com", I.className = "rte-input";
|
|
537
|
+
const R = document.createElement("div");
|
|
538
|
+
R.className = "rte-preview-label", R.textContent = "Preview";
|
|
539
|
+
const j = document.createElement("div");
|
|
540
|
+
j.className = "rte-modal-preview";
|
|
543
541
|
const N = document.createElement("div");
|
|
544
|
-
N.className = "rte-blockquote-
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
542
|
+
N.className = "rte-blockquote-title";
|
|
543
|
+
const P = document.createElement("div");
|
|
544
|
+
P.className = "rte-blockquote-content";
|
|
545
|
+
const H = document.createElement("div");
|
|
546
|
+
H.className = "rte-blockquote-footer", j.appendChild(N), j.appendChild(P), j.appendChild(H), T.appendChild(A), T.appendChild(k), T.appendChild(_), T.appendChild(I), T.appendChild(R), T.appendChild(j);
|
|
547
|
+
const L = document.createElement("div");
|
|
548
|
+
L.className = "rte-modal-actions";
|
|
549
|
+
const V = document.createElement("div");
|
|
550
|
+
V.setAttribute("role", "button"), V.tabIndex = 0, V.style.userSelect = "none", V.className = "rte-btn-danger", V.textContent = "Remove", V.style.display = "none", V.onclick = () => {
|
|
551
|
+
te && (te.remove(), te = null), u.style.display = "none";
|
|
552
552
|
};
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
u.style.display = "none",
|
|
553
|
+
const Z = document.createElement("div");
|
|
554
|
+
Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-muted", Z.textContent = "Cancel", Z.onclick = () => {
|
|
555
|
+
u.style.display = "none", te = null;
|
|
556
556
|
};
|
|
557
557
|
const ie = document.createElement("div");
|
|
558
558
|
ie.setAttribute("role", "button"), ie.tabIndex = 0, ie.style.userSelect = "none", ie.className = "rte-btn-primary", ie.textContent = "Apply", ie.onclick = () => {
|
|
559
|
-
const
|
|
560
|
-
let
|
|
561
|
-
if (
|
|
562
|
-
const le =
|
|
559
|
+
const ne = k.value.trim();
|
|
560
|
+
let W = I.value.trim();
|
|
561
|
+
if (W && !/^https?:\/\//i.test(W) && (W = `https://${W}`), te) {
|
|
562
|
+
const le = te.querySelector(
|
|
563
563
|
".rte-blockquote-title"
|
|
564
564
|
);
|
|
565
|
-
if (
|
|
566
|
-
if (le) le.textContent =
|
|
565
|
+
if (ne)
|
|
566
|
+
if (le) le.textContent = ne;
|
|
567
567
|
else {
|
|
568
|
-
const
|
|
569
|
-
|
|
568
|
+
const J = document.createElement("div");
|
|
569
|
+
J.className = "rte-blockquote-title", J.textContent = ne, te.insertBefore(J, te.firstChild);
|
|
570
570
|
}
|
|
571
571
|
else le && le.remove();
|
|
572
|
-
const ce =
|
|
572
|
+
const ce = te.querySelector(
|
|
573
573
|
".rte-blockquote-footer"
|
|
574
574
|
);
|
|
575
|
-
if (
|
|
575
|
+
if (W)
|
|
576
576
|
if (ce) {
|
|
577
|
-
const
|
|
578
|
-
|
|
577
|
+
const J = ce.querySelector("a");
|
|
578
|
+
J.href = W, J.textContent = W;
|
|
579
579
|
} else {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
|
|
580
|
+
const J = document.createElement("footer");
|
|
581
|
+
J.className = "rte-blockquote-footer";
|
|
582
|
+
const Q = document.createElement("cite"), X = document.createElement("a");
|
|
583
|
+
X.href = W, X.textContent = W, X.target = "_blank", X.rel = "noopener noreferrer", Q.appendChild(X), J.appendChild(Q), te.appendChild(J);
|
|
584
584
|
}
|
|
585
585
|
else ce && ce.remove();
|
|
586
586
|
} else {
|
|
587
|
-
|
|
587
|
+
Re();
|
|
588
588
|
const le = window.getSelection();
|
|
589
589
|
if (!le || le.rangeCount === 0) {
|
|
590
590
|
u.style.display = "none";
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
const ce = le.getRangeAt(0),
|
|
594
|
-
if (
|
|
595
|
-
const
|
|
596
|
-
|
|
593
|
+
const ce = le.getRangeAt(0), J = ce.extractContents(), Q = document.createElement("blockquote");
|
|
594
|
+
if (Q.className = "rte-blockquote", ne) {
|
|
595
|
+
const re = document.createElement("div");
|
|
596
|
+
re.className = "rte-blockquote-title", re.textContent = ne, Q.appendChild(re);
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
|
|
598
|
+
const X = document.createElement("p");
|
|
599
|
+
if (X.appendChild(J), Q.appendChild(X), W) {
|
|
600
|
+
const re = document.createElement("footer");
|
|
601
|
+
re.className = "rte-blockquote-footer";
|
|
602
602
|
const se = document.createElement("cite"), pe = document.createElement("a");
|
|
603
|
-
pe.href =
|
|
603
|
+
pe.href = W, pe.textContent = W, pe.target = "_blank", pe.rel = "noopener noreferrer", se.appendChild(pe), re.appendChild(se), Q.appendChild(re);
|
|
604
604
|
}
|
|
605
|
-
ce.insertNode(
|
|
605
|
+
ce.insertNode(Q), le.removeAllRanges();
|
|
606
606
|
const oe = document.createRange();
|
|
607
|
-
oe.setStartAfter(
|
|
607
|
+
oe.setStartAfter(Q), oe.collapse(!0), le.addRange(oe), de(oe);
|
|
608
608
|
}
|
|
609
|
-
u.style.display = "none",
|
|
610
|
-
},
|
|
611
|
-
let
|
|
612
|
-
return
|
|
613
|
-
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
le.appendChild(
|
|
618
|
-
let ce =
|
|
609
|
+
u.style.display = "none", k.value = "", I.value = "", te = null;
|
|
610
|
+
}, L.appendChild(V), L.appendChild(Z), L.appendChild(ie), v.appendChild(y), v.appendChild(T), v.appendChild(L), u.appendChild(v), document.body.appendChild(u);
|
|
611
|
+
let te = null, x = "";
|
|
612
|
+
return m.onmousedown = () => {
|
|
613
|
+
te = null, x = "";
|
|
614
|
+
const ne = window.getSelection();
|
|
615
|
+
if (ne && ne.rangeCount > 0) {
|
|
616
|
+
const W = ne.getRangeAt(0), le = document.createElement("div");
|
|
617
|
+
le.appendChild(W.cloneContents()), x = le.innerHTML || W.toString();
|
|
618
|
+
let ce = W.startContainer;
|
|
619
619
|
for (; ce && ce.nodeType !== Node.ELEMENT_NODE; )
|
|
620
620
|
ce = ce.parentNode;
|
|
621
|
-
let
|
|
622
|
-
for (;
|
|
623
|
-
if (
|
|
624
|
-
|
|
625
|
-
const
|
|
621
|
+
let J = ce;
|
|
622
|
+
for (; J && J !== document.body; ) {
|
|
623
|
+
if (J.tagName === "BLOCKQUOTE") {
|
|
624
|
+
te = J;
|
|
625
|
+
const Q = te.querySelector(
|
|
626
626
|
".rte-blockquote-title"
|
|
627
|
-
),
|
|
627
|
+
), X = te.querySelector(
|
|
628
628
|
".rte-blockquote-footer a"
|
|
629
629
|
);
|
|
630
|
-
|
|
631
|
-
const oe =
|
|
632
|
-
|
|
630
|
+
k.value = Q && Q.textContent || "", I.value = X && X.href || "", V.style.display = "inline-block";
|
|
631
|
+
const oe = te.querySelector("p");
|
|
632
|
+
P.innerHTML = oe ? oe.innerHTML : te.innerHTML, N.textContent = Q && Q.textContent || "", H.innerHTML = X ? `<a href="${X.href}">${X.href}</a>` : "";
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
J = J.parentElement;
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
|
|
639
|
-
},
|
|
640
|
-
const
|
|
641
|
-
if (!
|
|
638
|
+
te || (P.innerHTML = x || "<em>Selected text will appear here</em>", N.textContent = "", H.innerHTML = "", V.style.display = "none"), de();
|
|
639
|
+
}, k.oninput = () => N.textContent = k.value, I.oninput = () => {
|
|
640
|
+
const ne = I.value.trim();
|
|
641
|
+
if (!ne) H.innerHTML = "";
|
|
642
642
|
else {
|
|
643
|
-
const
|
|
644
|
-
|
|
643
|
+
const W = /^https?:\/\//i.test(ne) ? ne : `https://${ne}`;
|
|
644
|
+
H.innerHTML = `<a href="${W}" target="_blank" rel="noopener noreferrer">${W}</a>`;
|
|
645
645
|
}
|
|
646
|
-
},
|
|
647
|
-
u.style.display = "flex",
|
|
648
|
-
},
|
|
646
|
+
}, m.onclick = () => {
|
|
647
|
+
u.style.display = "flex", k.focus();
|
|
648
|
+
}, h.appendChild(m), h;
|
|
649
649
|
}
|
|
650
650
|
function Ho() {
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
(u.key === "Enter" || u.key === " ") && (u.preventDefault(),
|
|
651
|
+
const h = document.createDocumentFragment(), m = document.createElement("div");
|
|
652
|
+
m.setAttribute("role", "button"), m.tabIndex = 0, m.style.userSelect = "none", m.addEventListener("keydown", (u) => {
|
|
653
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), m.click());
|
|
654
654
|
});
|
|
655
655
|
const p = ye(yo, { width: 16, height: 16 });
|
|
656
|
-
return
|
|
656
|
+
return m.appendChild(p), m.title = "Remove Formatting", 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.onclick = () => document.execCommand("removeFormat"), h.appendChild(m), h;
|
|
657
657
|
}
|
|
658
|
-
function Bo(
|
|
659
|
-
const
|
|
658
|
+
function Bo(h) {
|
|
659
|
+
const m = document.createDocumentFragment(), p = document.createElement("div");
|
|
660
660
|
p.className = "rte-modal-overlay", p.style.display = "none";
|
|
661
661
|
const u = document.createElement("div");
|
|
662
662
|
u.className = "rte-modal";
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
|
|
663
|
+
const v = document.createElement("div");
|
|
664
|
+
v.className = "rte-modal-header";
|
|
665
|
+
const y = document.createElement("h3");
|
|
666
|
+
y.className = "rte-modal-title", y.textContent = "Insert Video";
|
|
667
667
|
const w = document.createElement("div");
|
|
668
|
-
w.setAttribute("role", "button"), w.tabIndex = 0, w.style.userSelect = "none", w.className = "rte-modal-close", w.innerHTML = "×", w.onclick = () => p.style.display = "none",
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
668
|
+
w.setAttribute("role", "button"), w.tabIndex = 0, w.style.userSelect = "none", w.className = "rte-modal-close", w.innerHTML = "×", w.onclick = () => p.style.display = "none", v.appendChild(y), v.appendChild(w);
|
|
669
|
+
const g = document.createElement("div");
|
|
670
|
+
g.className = "rte-modal-form";
|
|
671
|
+
const T = document.createElement("label");
|
|
672
|
+
T.className = "rte-label", T.textContent = "Video URL";
|
|
673
|
+
const A = document.createElement("input");
|
|
674
|
+
A.type = "url", A.className = "rte-input", A.placeholder = "https://... or YouTube URL";
|
|
675
|
+
const k = document.createElement("div");
|
|
676
|
+
k.className = "rte-preview-label", k.textContent = "Preview";
|
|
675
677
|
const _ = document.createElement("div");
|
|
676
|
-
_.className = "rte-preview
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
const G = document.createElement("div");
|
|
684
|
-
G.className = "rte-field", G.appendChild(k), G.appendChild(S);
|
|
685
|
-
const W = document.createElement("div");
|
|
686
|
-
W.className = "rte-dim-row";
|
|
678
|
+
_.className = "rte-modal-preview";
|
|
679
|
+
const I = document.createElement("div");
|
|
680
|
+
I.className = "rte-form-left";
|
|
681
|
+
const R = document.createElement("div");
|
|
682
|
+
R.className = "rte-form-right";
|
|
683
|
+
const j = document.createElement("div");
|
|
684
|
+
j.className = "rte-field", j.appendChild(T), j.appendChild(A);
|
|
687
685
|
const N = document.createElement("div");
|
|
688
|
-
N.
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
const
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
686
|
+
N.className = "rte-dim-row";
|
|
687
|
+
const P = document.createElement("div");
|
|
688
|
+
P.style.display = "flex", P.style.flexDirection = "column";
|
|
689
|
+
const H = document.createElement("label");
|
|
690
|
+
H.className = "rte-label", H.textContent = "Width (px)";
|
|
691
|
+
const L = document.createElement("input");
|
|
692
|
+
L.type = "text", L.className = "rte-dim-input", L.placeholder = "e.g., 560", P.appendChild(H), P.appendChild(L);
|
|
693
|
+
const V = document.createElement("div");
|
|
694
|
+
V.style.display = "flex", V.style.flexDirection = "column";
|
|
695
|
+
const Z = document.createElement("label");
|
|
696
|
+
Z.className = "rte-label", Z.textContent = "Height (px)";
|
|
697
697
|
const ie = document.createElement("input");
|
|
698
|
-
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315",
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
|
|
698
|
+
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", V.appendChild(Z), V.appendChild(ie), N.appendChild(P), N.appendChild(V), I.appendChild(j), I.appendChild(N), R.appendChild(k), R.appendChild(_), g.appendChild(I), g.appendChild(R);
|
|
699
|
+
const te = document.createElement("div");
|
|
700
|
+
te.className = "rte-modal-actions";
|
|
701
|
+
const x = document.createElement("div");
|
|
702
|
+
x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.className = "rte-btn-muted", x.textContent = "Cancel", x.onclick = () => p.style.display = "none";
|
|
703
|
+
const ne = document.createElement("div");
|
|
704
|
+
ne.setAttribute("role", "button"), ne.tabIndex = 0, ne.style.userSelect = "none", ne.className = "rte-btn-primary", ne.textContent = "Insert", te.appendChild(x), te.appendChild(ne), u.appendChild(v), u.appendChild(g), u.appendChild(te), p.appendChild(u), document.body.appendChild(p);
|
|
705
|
+
const W = document.createElement("div");
|
|
706
|
+
W.setAttribute("role", "button"), W.tabIndex = 0, W.style.userSelect = "none";
|
|
707
707
|
const le = ye(To, { width: 16, height: 16 });
|
|
708
|
-
|
|
709
|
-
(
|
|
710
|
-
}),
|
|
711
|
-
|
|
708
|
+
W.appendChild(le), W.title = "Insert Video", W.style.border = "1px solid #e1e1e1", W.style.backgroundColor = "#ffffff", W.style.padding = "6px 10px", W.style.borderRadius = "3px", W.style.cursor = "pointer", W.style.color = "#000000", W.onmouseover = () => W.style.backgroundColor = "#f0f0f0", W.onmouseout = () => W.style.backgroundColor = "#ffffff", W.onmousedown = () => de(), W.addEventListener("keydown", (Q) => {
|
|
709
|
+
(Q.key === "Enter" || Q.key === " ") && (Q.preventDefault(), W.click());
|
|
710
|
+
}), W.onclick = () => {
|
|
711
|
+
_.innerHTML = "<em>No URL entered</em>", A.value = "", p.style.display = "flex", A.focus();
|
|
712
712
|
};
|
|
713
713
|
const ce = () => {
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
716
|
-
|
|
714
|
+
const Q = A.value.trim(), X = L && L.value.trim() || "", oe = ie && ie.value.trim() || "", re = parseInt(X, 10), se = parseInt(oe, 10);
|
|
715
|
+
if (!Q) {
|
|
716
|
+
_.innerHTML = "<em>No preview</em>";
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
|
-
const pe =
|
|
719
|
+
const pe = Q.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
720
720
|
if (pe) {
|
|
721
|
-
const E = pe[1],
|
|
722
|
-
|
|
721
|
+
const E = pe[1], B = Number.isFinite(re) ? re : 320, Y = Number.isFinite(se) ? se : 180;
|
|
722
|
+
_.innerHTML = `<iframe width="${B}" height="${Y}" src="https://www.youtube.com/embed/${E}" frameborder="0" allowfullscreen></iframe>`;
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
|
-
const fe = Number.isFinite(
|
|
726
|
-
|
|
725
|
+
const fe = Number.isFinite(re) ? `${re}px` : "320px", he = Number.isFinite(se) ? `${se}px` : "auto";
|
|
726
|
+
_.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${Q}"></video>`;
|
|
727
727
|
};
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
if (!
|
|
728
|
+
A.oninput = ce, typeof L < "u" && (L.oninput = ce), typeof ie < "u" && (ie.oninput = ce), ne.onclick = () => {
|
|
729
|
+
const Q = A.value.trim(), X = L && L.value.trim() || "", oe = ie && ie.value.trim() || "", re = parseInt(X, 10), se = parseInt(oe, 10);
|
|
730
|
+
if (!Q) {
|
|
731
731
|
p.style.display = "none";
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
|
|
734
|
+
Re();
|
|
735
735
|
const pe = window.getSelection();
|
|
736
736
|
if (!pe || pe.rangeCount === 0) {
|
|
737
737
|
p.style.display = "none";
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
const fe = pe.getRangeAt(0), he =
|
|
740
|
+
const fe = pe.getRangeAt(0), he = Q.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
741
741
|
let E;
|
|
742
742
|
if (he) {
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const Y = he[1], G = document.createElement("div"), xe = Number.isFinite(re) ? re : 560, we = Number.isFinite(se) ? se : 315;
|
|
744
|
+
G.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${Y}" frameborder="0" allowfullscreen></iframe>`, G.contentEditable = "false", G.className = "editor-video-wrapper", G.style.display = "block", G.style.maxWidth = "100%", G.style.width = "auto", G.style.height = "auto", G.style.boxSizing = "border-box", G.style.userSelect = "none", E = G;
|
|
745
745
|
} else {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const Y = document.createElement("div"), G = document.createElement("video");
|
|
747
|
+
G.controls = !0, G.src = Q, Number.isFinite(re) && (G.width = re), Number.isFinite(se) && (G.height = se), G.style.maxWidth = "100%", G.style.display = "block", Y.appendChild(G), Y.contentEditable = "false", Y.className = "editor-video-wrapper", Y.style.display = "block", Y.style.maxWidth = "100%", Y.style.width = "auto", Y.style.height = "auto", Y.style.boxSizing = "border-box", Y.style.userSelect = "none", E = Y;
|
|
748
748
|
}
|
|
749
749
|
fe.insertNode(E), pe.removeAllRanges();
|
|
750
|
-
const
|
|
751
|
-
|
|
750
|
+
const B = document.createRange();
|
|
751
|
+
B.setStartAfter(E), B.collapse(!0), pe.addRange(B), de(B);
|
|
752
752
|
try {
|
|
753
|
-
const
|
|
754
|
-
|
|
753
|
+
const Y = J;
|
|
754
|
+
Y && typeof Y.focus == "function" && (Y.focus(), Y.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
755
755
|
} catch {
|
|
756
756
|
}
|
|
757
|
-
p.style.display = "none",
|
|
757
|
+
p.style.display = "none", A.value = "", _.innerHTML = "";
|
|
758
758
|
};
|
|
759
|
-
const
|
|
760
|
-
return
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
}),
|
|
759
|
+
const J = h.querySelector(".editor");
|
|
760
|
+
return J && J.addEventListener("click", (Q) => {
|
|
761
|
+
const X = Q.target;
|
|
762
|
+
X && X.tagName === "VIDEO" && X.focus();
|
|
763
|
+
}), m.appendChild(W), m;
|
|
764
764
|
}
|
|
765
|
-
function qo(
|
|
766
|
-
const
|
|
767
|
-
|
|
765
|
+
function qo(h) {
|
|
766
|
+
const m = document.createElement("div");
|
|
767
|
+
m.style.display = "flex", m.style.flexWrap = "wrap", m.style.gap = "8px", m.style.marginBottom = "10px", m.style.padding = "12px", m.style.border = "1px solid #e1e1e1", m.style.backgroundColor = "#ffffff", m.style.borderRadius = "4px", m.style.boxShadow = "0 1px 3px rgba(0,0,0,0.1)";
|
|
768
768
|
const p = to();
|
|
769
769
|
p.innerHTML = `
|
|
770
770
|
<option value="Arial">Arial</option>
|
|
@@ -772,7 +772,7 @@ function qo(v) {
|
|
|
772
772
|
<option value="Courier New">Courier New</option>
|
|
773
773
|
<option value="Georgia">Georgia</option>
|
|
774
774
|
<option value="Verdana">Verdana</option>
|
|
775
|
-
`, p.style.border = "1px solid #e1e1e1", p.style.backgroundColor = "#ffffff", p.style.padding = "4px", p.style.borderRadius = "3px", p.style.color = "#000000", p.onchange = () => document.execCommand("fontName", !1, p.value),
|
|
775
|
+
`, p.style.border = "1px solid #e1e1e1", p.style.backgroundColor = "#ffffff", p.style.padding = "4px", p.style.borderRadius = "3px", p.style.color = "#000000", p.onchange = () => document.execCommand("fontName", !1, p.value), m.appendChild(p);
|
|
776
776
|
const u = ro();
|
|
777
777
|
u.title = "Heading", u.style.border = "1px solid #e1e1e1", u.style.backgroundColor = "#ffffff", u.style.padding = "4px", u.style.borderRadius = "3px", u.style.color = "#000000", u.innerHTML = `
|
|
778
778
|
<option value="p">Normal</option>
|
|
@@ -781,31 +781,31 @@ function qo(v) {
|
|
|
781
781
|
<option value="h3">Heading 3</option>
|
|
782
782
|
<option value="h4">Heading 4</option>
|
|
783
783
|
`, u.onchange = () => {
|
|
784
|
-
const
|
|
785
|
-
document.execCommand("formatBlock", !1, `<${
|
|
786
|
-
},
|
|
784
|
+
const H = u.value, L = H === "p" ? "P" : H.toUpperCase();
|
|
785
|
+
document.execCommand("formatBlock", !1, `<${L}>`);
|
|
786
|
+
}, m.appendChild(u), document.addEventListener("selectionchange", () => {
|
|
787
787
|
try {
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
let
|
|
791
|
-
for (;
|
|
792
|
-
|
|
793
|
-
if (!
|
|
794
|
-
let
|
|
795
|
-
for (;
|
|
796
|
-
const
|
|
797
|
-
if (
|
|
798
|
-
u.value =
|
|
788
|
+
const H = window.getSelection();
|
|
789
|
+
if (!H || !H.anchorNode) return;
|
|
790
|
+
let L = H.anchorNode;
|
|
791
|
+
for (; L && L.nodeType !== Node.ELEMENT_NODE; )
|
|
792
|
+
L = L.parentNode;
|
|
793
|
+
if (!L) return;
|
|
794
|
+
let V = L;
|
|
795
|
+
for (; V && V !== document.body && V !== m.parentElement; ) {
|
|
796
|
+
const Z = V.tagName?.toUpperCase?.();
|
|
797
|
+
if (Z === "H1" || Z === "H2" || Z === "H3" || Z === "H4" || Z === "P") {
|
|
798
|
+
u.value = Z === "P" ? "p" : Z.toLowerCase();
|
|
799
799
|
return;
|
|
800
800
|
}
|
|
801
|
-
|
|
801
|
+
V = V.parentElement;
|
|
802
802
|
}
|
|
803
803
|
u.value = "p";
|
|
804
804
|
} catch {
|
|
805
805
|
}
|
|
806
806
|
});
|
|
807
|
-
const
|
|
808
|
-
|
|
807
|
+
const v = no();
|
|
808
|
+
v.innerHTML = `
|
|
809
809
|
<option value="1">8pt</option>
|
|
810
810
|
<option value="2">10pt</option>
|
|
811
811
|
<option value="3" selected>12pt</option>
|
|
@@ -813,201 +813,41 @@ function qo(v) {
|
|
|
813
813
|
<option value="5">18pt</option>
|
|
814
814
|
<option value="6">24pt</option>
|
|
815
815
|
<option value="7">36pt</option>
|
|
816
|
-
`,
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
const w =
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
const
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
const
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
return
|
|
841
|
-
}
|
|
842
|
-
function Wo(v) {
|
|
843
|
-
const p = new DOMParser().parseFromString(v, "text/html");
|
|
844
|
-
return Array.from(p.querySelectorAll("img")).forEach((m) => {
|
|
845
|
-
if (!p.body.contains(m) || m.closest(".editor-image-wrapper")) return;
|
|
846
|
-
const w = m.getAttribute("src") || m.src;
|
|
847
|
-
if (!w) return;
|
|
848
|
-
const x = document.createElement("img");
|
|
849
|
-
x.src = w, m.alt && (x.alt = m.alt), m.title && (x.title = m.title), x.style.maxWidth = "100%", x.style.width = "100%", x.style.height = "auto", x.style.cursor = "pointer", x.draggable = !1;
|
|
850
|
-
const k = m.getAttribute("width") || m.style.width || (m.naturalWidth > 0 ? `${m.naturalWidth}px` : null), S = document.createElement("div");
|
|
851
|
-
S.className = "editor-image-wrapper", S.style.display = "inline-block", S.style.position = "relative", S.style.maxWidth = "100%", S.style.width = k && k !== "0px" ? k.includes("px") ? k : `${k}px` : "300px", S.style.height = "auto", S.contentEditable = "false", S.style.boxSizing = "border-box", S.style.touchAction = "none", S.style.userSelect = "none", S.appendChild(x);
|
|
852
|
-
const _ = document.createElement("p");
|
|
853
|
-
_.style.margin = "10px 0", _.style.textAlign = "left", _.style.display = "block", _.appendChild(S);
|
|
854
|
-
let A = m;
|
|
855
|
-
const B = m.closest("figure"), P = m.closest("picture");
|
|
856
|
-
if (B && p.body.contains(B))
|
|
857
|
-
A = B;
|
|
858
|
-
else if (P && p.body.contains(P))
|
|
859
|
-
A = P;
|
|
860
|
-
else {
|
|
861
|
-
let G = m.parentNode;
|
|
862
|
-
for (; G && G !== p.body && G.parentNode !== p.body && Array.from(G.childNodes).filter(
|
|
863
|
-
(N) => N.nodeType === Node.ELEMENT_NODE || N.nodeType === Node.TEXT_NODE && N.textContent?.trim()
|
|
864
|
-
).length === 1; )
|
|
865
|
-
A = G, G = G.parentNode;
|
|
866
|
-
}
|
|
867
|
-
A && A.parentNode && p.body.contains(A) ? A.parentNode.replaceChild(_, A) : m.parentNode && p.body.contains(m) && m.parentNode.replaceChild(_, m);
|
|
868
|
-
}), p.body.innerHTML;
|
|
869
|
-
}
|
|
870
|
-
function Yo(v, h) {
|
|
871
|
-
const p = document.createElement("div");
|
|
872
|
-
p.classList.add("editor"), p.contentEditable = "true", p.style.color = "#000000", p.style.border = "1px solid #e1e1e1", p.style.height = "400px", p.style.overflowY = "auto", p.style.padding = "15px", p.style.fontFamily = "Arial, sans-serif", p.style.fontSize = "14px", p.style.lineHeight = "1.5", p.style.outline = "none", p.style.backgroundColor = "#ffffff", p.style.borderRadius = "4px", p.style.boxShadow = "inset 0 1px 3px rgba(0,0,0,0.1)", p.style.direction = "ltr", p.style.textAlign = "left", p.style.scrollbarWidth = "none", p.style.msOverflowStyle = "none";
|
|
873
|
-
const u = document.createElement("style");
|
|
874
|
-
u.textContent = `
|
|
875
|
-
.editor::-webkit-scrollbar { display: none; }
|
|
876
|
-
.editor ul, .editor ol {
|
|
877
|
-
margin: 0.5em 0;
|
|
878
|
-
padding-left: 2em;
|
|
879
|
-
list-style-position: outside;
|
|
880
|
-
}
|
|
881
|
-
.editor ul { list-style-type: disc; }
|
|
882
|
-
.editor ol { list-style-type: decimal; }
|
|
883
|
-
.editor li {
|
|
884
|
-
margin: 0.25em 0;
|
|
885
|
-
display: list-item;
|
|
886
|
-
}
|
|
887
|
-
`, document.querySelector("style[data-editor-scrollbar]") || (u.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(u)), p.innerHTML = "", p.addEventListener("dragover", (w) => {
|
|
888
|
-
w.preventDefault(), w.stopPropagation();
|
|
889
|
-
}), p.addEventListener("drop", (w) => {
|
|
890
|
-
w.preventDefault(), w.stopPropagation();
|
|
891
|
-
const x = w.clientX, k = w.clientY;
|
|
892
|
-
let S = null;
|
|
893
|
-
if (document.caretRangeFromPoint)
|
|
894
|
-
S = document.caretRangeFromPoint(x, k);
|
|
895
|
-
else if (document.caretPositionFromPoint) {
|
|
896
|
-
const A = document.caretPositionFromPoint(x, k);
|
|
897
|
-
A && (S = document.createRange(), S.setStart(A.offsetNode, A.offset));
|
|
898
|
-
}
|
|
899
|
-
const _ = w.dataTransfer?.files;
|
|
900
|
-
if (_ && _.length > 0)
|
|
901
|
-
for (let A = 0; A < _.length; A++) {
|
|
902
|
-
const B = _[A];
|
|
903
|
-
if (B.type.startsWith("image/")) {
|
|
904
|
-
const P = new FileReader();
|
|
905
|
-
P.onload = (G) => {
|
|
906
|
-
const W = document.createElement("img");
|
|
907
|
-
W.src = G.target?.result, W.style.maxWidth = "100%", W.style.width = "100%", W.style.height = "auto", W.style.cursor = "pointer", W.draggable = !1;
|
|
908
|
-
const N = document.createElement("div");
|
|
909
|
-
N.className = "editor-image-wrapper", N.style.display = "inline-block", N.style.position = "relative", N.style.maxWidth = "100%", N.style.width = "auto", N.style.height = "auto", N.contentEditable = "false", N.style.userSelect = "none", N.style.boxSizing = "border-box", N.style.touchAction = "none", N.appendChild(W);
|
|
910
|
-
const J = document.createElement("div");
|
|
911
|
-
if (J.contentEditable = "true", J.style.margin = "10px 0", J.style.textAlign = "left", J.style.display = "block", J.appendChild(N), S)
|
|
912
|
-
try {
|
|
913
|
-
S.insertNode(J);
|
|
914
|
-
const U = window.getSelection();
|
|
915
|
-
if (U) {
|
|
916
|
-
U.removeAllRanges();
|
|
917
|
-
const Z = document.createRange();
|
|
918
|
-
Z.setStartAfter(J), Z.collapse(!0), U.addRange(Z), de(Z);
|
|
919
|
-
}
|
|
920
|
-
} catch {
|
|
921
|
-
p.appendChild(J);
|
|
922
|
-
}
|
|
923
|
-
else
|
|
924
|
-
p.appendChild(J);
|
|
925
|
-
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus();
|
|
926
|
-
}, P.readAsDataURL(B);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}), p.addEventListener("paste", (w) => {
|
|
930
|
-
w.preventDefault();
|
|
931
|
-
const x = w.clipboardData;
|
|
932
|
-
if (!x) return;
|
|
933
|
-
let k = x.getData("text/html");
|
|
934
|
-
k ? k = Wo(k) : k = x.getData("text/plain");
|
|
935
|
-
const S = window.getSelection();
|
|
936
|
-
if (S && S.rangeCount > 0) {
|
|
937
|
-
const _ = S.getRangeAt(0), A = document.createElement("div");
|
|
938
|
-
A.innerHTML = k;
|
|
939
|
-
const B = document.createDocumentFragment();
|
|
940
|
-
for (; A.firstChild; )
|
|
941
|
-
B.appendChild(A.firstChild);
|
|
942
|
-
_.deleteContents(), _.insertNode(B), _.collapse(!1), S.removeAllRanges(), S.addRange(_);
|
|
943
|
-
} else {
|
|
944
|
-
const _ = document.createElement("div");
|
|
945
|
-
for (_.innerHTML = k; _.firstChild; )
|
|
946
|
-
p.appendChild(_.firstChild);
|
|
947
|
-
}
|
|
948
|
-
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
|
|
949
|
-
}), p.addEventListener("click", (w) => {
|
|
950
|
-
const x = w.target;
|
|
951
|
-
let k = x;
|
|
952
|
-
if (x.tagName === "IMG" && (k = x.parentElement), k && k.classList.contains("editor-image-wrapper")) {
|
|
953
|
-
w.preventDefault(), w.stopPropagation(), h(k);
|
|
954
|
-
const S = k.parentElement;
|
|
955
|
-
if (S && (S.tagName === "DIV" || S.tagName === "P") && S.querySelector(".editor-image-wrapper"))
|
|
956
|
-
try {
|
|
957
|
-
const _ = window.getSelection();
|
|
958
|
-
if (_) {
|
|
959
|
-
const A = document.createRange();
|
|
960
|
-
A.selectNodeContents(S), _.removeAllRanges(), _.addRange(A), de();
|
|
961
|
-
}
|
|
962
|
-
} catch {
|
|
963
|
-
}
|
|
964
|
-
} else
|
|
965
|
-
de();
|
|
966
|
-
}), p.addEventListener("keyup", () => de()), p.addEventListener("mouseup", () => de()), p.addEventListener("focus", () => de()), window.addEventListener("selectionchange", () => {
|
|
967
|
-
try {
|
|
968
|
-
const w = window.getSelection();
|
|
969
|
-
if (!w || !w.anchorNode) return;
|
|
970
|
-
let x = w.anchorNode;
|
|
971
|
-
for (; x && x.nodeType !== Node.ELEMENT_NODE; )
|
|
972
|
-
x = x.parentNode;
|
|
973
|
-
if (!x) return;
|
|
974
|
-
p.contains(x) && de();
|
|
975
|
-
} catch {
|
|
976
|
-
}
|
|
977
|
-
});
|
|
978
|
-
const m = () => {
|
|
979
|
-
if (!p.firstChild) {
|
|
980
|
-
p.innerHTML = "<p><br></p>";
|
|
981
|
-
return;
|
|
982
|
-
}
|
|
983
|
-
const w = Array.from(p.childNodes);
|
|
984
|
-
for (const x of w)
|
|
985
|
-
if (x.nodeType === Node.TEXT_NODE && x.textContent?.trim()) {
|
|
986
|
-
const k = window.getSelection();
|
|
987
|
-
let S = null;
|
|
988
|
-
k && k.rangeCount > 0 && (S = k.getRangeAt(0).cloneRange());
|
|
989
|
-
const _ = document.createElement("p");
|
|
990
|
-
if (x.parentNode?.insertBefore(_, x), _.appendChild(x), S && k)
|
|
991
|
-
try {
|
|
992
|
-
k.removeAllRanges(), k.addRange(S);
|
|
993
|
-
} catch {
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
};
|
|
997
|
-
let g = null;
|
|
998
|
-
return p.addEventListener("input", () => {
|
|
999
|
-
g && clearTimeout(g), g = setTimeout(() => m(), 100);
|
|
1000
|
-
}), !p.innerHTML || p.innerHTML.trim() === "" ? p.innerHTML = "<p><br></p>" : m(), p;
|
|
816
|
+
`, v.style.border = "1px solid #e1e1e1", v.style.backgroundColor = "#ffffff", v.style.padding = "4px", v.style.borderRadius = "3px", v.style.color = "#000000", v.onchange = () => document.execCommand("fontSize", !1, v.value), m.appendChild(v);
|
|
817
|
+
const y = Mo();
|
|
818
|
+
m.appendChild(y);
|
|
819
|
+
const w = Ro();
|
|
820
|
+
m.appendChild(w);
|
|
821
|
+
const g = Io();
|
|
822
|
+
m.appendChild(g);
|
|
823
|
+
const T = Oo();
|
|
824
|
+
m.appendChild(T);
|
|
825
|
+
const A = Do();
|
|
826
|
+
m.appendChild(A);
|
|
827
|
+
const k = No();
|
|
828
|
+
m.appendChild(k);
|
|
829
|
+
const _ = Lo();
|
|
830
|
+
m.appendChild(_);
|
|
831
|
+
const I = Fo(h);
|
|
832
|
+
m.appendChild(I);
|
|
833
|
+
const R = jo();
|
|
834
|
+
m.appendChild(R);
|
|
835
|
+
const j = Ho();
|
|
836
|
+
m.appendChild(j);
|
|
837
|
+
const N = Bo(h);
|
|
838
|
+
m.appendChild(N);
|
|
839
|
+
const P = zo();
|
|
840
|
+
return m.appendChild(P), m;
|
|
1001
841
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
842
|
+
function Wo(h) {
|
|
843
|
+
return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
|
|
1004
844
|
}
|
|
1005
|
-
var Je = { exports: {} },
|
|
1006
|
-
function
|
|
1007
|
-
return Pn || (Pn = 1, (function(
|
|
845
|
+
var Je = { exports: {} }, Yo = Je.exports, Pn;
|
|
846
|
+
function $o() {
|
|
847
|
+
return Pn || (Pn = 1, (function(h, m) {
|
|
1008
848
|
(function(p, u) {
|
|
1009
|
-
|
|
1010
|
-
})(
|
|
849
|
+
h.exports = u();
|
|
850
|
+
})(Yo, (function() {
|
|
1011
851
|
function p(t, e) {
|
|
1012
852
|
var n = Object.keys(t);
|
|
1013
853
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1022,54 +862,54 @@ function Uo() {
|
|
|
1022
862
|
for (var e = 1; e < arguments.length; e++) {
|
|
1023
863
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
1024
864
|
e % 2 ? p(Object(n), !0).forEach((function(r) {
|
|
1025
|
-
|
|
865
|
+
T(t, r, n[r]);
|
|
1026
866
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : p(Object(n)).forEach((function(r) {
|
|
1027
867
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
1028
868
|
}));
|
|
1029
869
|
}
|
|
1030
870
|
return t;
|
|
1031
871
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return
|
|
872
|
+
function v(t) {
|
|
873
|
+
return v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1034
874
|
return typeof e;
|
|
1035
875
|
} : function(e) {
|
|
1036
876
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1037
|
-
},
|
|
877
|
+
}, v(t);
|
|
1038
878
|
}
|
|
1039
|
-
function
|
|
879
|
+
function y(t, e) {
|
|
1040
880
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1041
881
|
}
|
|
1042
882
|
function w(t, e) {
|
|
1043
883
|
for (var n = 0; n < e.length; n++) {
|
|
1044
884
|
var r = e[n];
|
|
1045
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t,
|
|
885
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, N(r.key), r);
|
|
1046
886
|
}
|
|
1047
887
|
}
|
|
1048
|
-
function
|
|
888
|
+
function g(t, e, n) {
|
|
1049
889
|
return e && w(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1050
890
|
}
|
|
1051
|
-
function
|
|
1052
|
-
return (e =
|
|
891
|
+
function T(t, e, n) {
|
|
892
|
+
return (e = N(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
1053
893
|
}
|
|
1054
|
-
function
|
|
894
|
+
function A(t, e) {
|
|
1055
895
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
1056
|
-
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e &&
|
|
896
|
+
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _(t, e);
|
|
1057
897
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
898
|
+
function k(t) {
|
|
899
|
+
return k = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
1060
900
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
1061
|
-
},
|
|
901
|
+
}, k(t);
|
|
1062
902
|
}
|
|
1063
|
-
function
|
|
1064
|
-
return
|
|
903
|
+
function _(t, e) {
|
|
904
|
+
return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
1065
905
|
return n.__proto__ = r, n;
|
|
1066
|
-
},
|
|
906
|
+
}, _(t, e);
|
|
1067
907
|
}
|
|
1068
|
-
function
|
|
908
|
+
function I(t) {
|
|
1069
909
|
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1070
910
|
return t;
|
|
1071
911
|
}
|
|
1072
|
-
function
|
|
912
|
+
function R(t) {
|
|
1073
913
|
var e = (function() {
|
|
1074
914
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
1075
915
|
if (typeof Proxy == "function") return !0;
|
|
@@ -1081,31 +921,31 @@ function Uo() {
|
|
|
1081
921
|
}
|
|
1082
922
|
})();
|
|
1083
923
|
return function() {
|
|
1084
|
-
var n, r =
|
|
924
|
+
var n, r = k(t);
|
|
1085
925
|
if (e) {
|
|
1086
|
-
var o =
|
|
926
|
+
var o = k(this).constructor;
|
|
1087
927
|
n = Reflect.construct(r, arguments, o);
|
|
1088
928
|
} else n = r.apply(this, arguments);
|
|
1089
929
|
return (function(i, a) {
|
|
1090
930
|
if (a && (typeof a == "object" || typeof a == "function")) return a;
|
|
1091
931
|
if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1092
|
-
return
|
|
932
|
+
return I(i);
|
|
1093
933
|
})(this, n);
|
|
1094
934
|
};
|
|
1095
935
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
936
|
+
function j() {
|
|
937
|
+
return j = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
1098
938
|
var r = (function(i, a) {
|
|
1099
|
-
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i =
|
|
939
|
+
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = k(i)) !== null; ) ;
|
|
1100
940
|
return i;
|
|
1101
941
|
})(t, e);
|
|
1102
942
|
if (r) {
|
|
1103
943
|
var o = Object.getOwnPropertyDescriptor(r, e);
|
|
1104
944
|
return o.get ? o.get.call(arguments.length < 3 ? t : n) : o.value;
|
|
1105
945
|
}
|
|
1106
|
-
},
|
|
946
|
+
}, j.apply(this, arguments);
|
|
1107
947
|
}
|
|
1108
|
-
function
|
|
948
|
+
function N(t) {
|
|
1109
949
|
var e = (function(n, r) {
|
|
1110
950
|
if (typeof n != "object" || n === null) return n;
|
|
1111
951
|
var o = n[Symbol.toPrimitive];
|
|
@@ -1118,49 +958,49 @@ function Uo() {
|
|
|
1118
958
|
})(t, "string");
|
|
1119
959
|
return typeof e == "symbol" ? e : e + "";
|
|
1120
960
|
}
|
|
1121
|
-
var
|
|
961
|
+
var P = function(t) {
|
|
1122
962
|
return !(!t || !t.Window) && t instanceof t.Window;
|
|
1123
|
-
},
|
|
1124
|
-
function
|
|
1125
|
-
|
|
963
|
+
}, H = void 0, L = void 0;
|
|
964
|
+
function V(t) {
|
|
965
|
+
H = t;
|
|
1126
966
|
var e = t.document.createTextNode("");
|
|
1127
|
-
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)),
|
|
967
|
+
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), L = t;
|
|
1128
968
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return
|
|
969
|
+
function Z(t) {
|
|
970
|
+
return P(t) ? t : (t.ownerDocument || t).defaultView || L.window;
|
|
1131
971
|
}
|
|
1132
|
-
typeof window < "u" && window &&
|
|
972
|
+
typeof window < "u" && window && V(window);
|
|
1133
973
|
var ie = function(t) {
|
|
1134
|
-
return !!t &&
|
|
1135
|
-
},
|
|
974
|
+
return !!t && v(t) === "object";
|
|
975
|
+
}, te = function(t) {
|
|
1136
976
|
return typeof t == "function";
|
|
1137
|
-
},
|
|
1138
|
-
return t ===
|
|
977
|
+
}, x = { window: function(t) {
|
|
978
|
+
return t === L || P(t);
|
|
1139
979
|
}, docFrag: function(t) {
|
|
1140
980
|
return ie(t) && t.nodeType === 11;
|
|
1141
|
-
}, object: ie, func:
|
|
981
|
+
}, object: ie, func: te, number: function(t) {
|
|
1142
982
|
return typeof t == "number";
|
|
1143
983
|
}, bool: function(t) {
|
|
1144
984
|
return typeof t == "boolean";
|
|
1145
985
|
}, string: function(t) {
|
|
1146
986
|
return typeof t == "string";
|
|
1147
987
|
}, element: function(t) {
|
|
1148
|
-
if (!t ||
|
|
1149
|
-
var e =
|
|
1150
|
-
return /object|function/.test(typeof Element > "u" ? "undefined" :
|
|
988
|
+
if (!t || v(t) !== "object") return !1;
|
|
989
|
+
var e = Z(t) || L;
|
|
990
|
+
return /object|function/.test(typeof Element > "u" ? "undefined" : v(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
1151
991
|
}, plainObject: function(t) {
|
|
1152
992
|
return ie(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
1153
993
|
}, array: function(t) {
|
|
1154
|
-
return ie(t) && t.length !== void 0 &&
|
|
994
|
+
return ie(t) && t.length !== void 0 && te(t.splice);
|
|
1155
995
|
} };
|
|
1156
|
-
function
|
|
996
|
+
function ne(t) {
|
|
1157
997
|
var e = t.interaction;
|
|
1158
998
|
if (e.prepared.name === "drag") {
|
|
1159
999
|
var n = e.prepared.axis;
|
|
1160
1000
|
n === "x" ? (e.coords.cur.page.y = e.coords.start.page.y, e.coords.cur.client.y = e.coords.start.client.y, e.coords.velocity.client.y = 0, e.coords.velocity.page.y = 0) : n === "y" && (e.coords.cur.page.x = e.coords.start.page.x, e.coords.cur.client.x = e.coords.start.client.x, e.coords.velocity.client.x = 0, e.coords.velocity.page.x = 0);
|
|
1161
1001
|
}
|
|
1162
1002
|
}
|
|
1163
|
-
function
|
|
1003
|
+
function W(t) {
|
|
1164
1004
|
var e = t.iEvent, n = t.interaction;
|
|
1165
1005
|
if (n.prepared.name === "drag") {
|
|
1166
1006
|
var r = n.prepared.axis;
|
|
@@ -1173,25 +1013,25 @@ function Uo() {
|
|
|
1173
1013
|
var le = { id: "actions/drag", install: function(t) {
|
|
1174
1014
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
1175
1015
|
n.prototype.draggable = le.draggable, e.map.drag = le, e.methodDict.drag = "draggable", r.actions.drag = le.defaults;
|
|
1176
|
-
}, listeners: { "interactions:before-action-move":
|
|
1016
|
+
}, listeners: { "interactions:before-action-move": ne, "interactions:action-resume": ne, "interactions:action-move": W, "auto-start:check": function(t) {
|
|
1177
1017
|
var e = t.interaction, n = t.interactable, r = t.buttons, o = n.options.drag;
|
|
1178
1018
|
if (o && o.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (r & n.options.drag.mouseButtons) != 0)) return t.action = { name: "drag", axis: o.lockAxis === "start" ? o.startAxis : o.lockAxis }, !1;
|
|
1179
1019
|
} }, draggable: function(t) {
|
|
1180
|
-
return
|
|
1181
|
-
}, beforeMove:
|
|
1020
|
+
return x.object(t) ? (this.options.drag.enabled = t.enabled !== !1, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : x.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
1021
|
+
}, beforeMove: ne, move: W, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
1182
1022
|
return "move";
|
|
1183
1023
|
}, filterEventType: function(t) {
|
|
1184
1024
|
return t.search("drag") === 0;
|
|
1185
|
-
} }, ce = le,
|
|
1025
|
+
} }, ce = le, J = { init: function(t) {
|
|
1186
1026
|
var e = t;
|
|
1187
|
-
|
|
1027
|
+
J.document = e.document, J.DocumentFragment = e.DocumentFragment || Q, J.SVGElement = e.SVGElement || Q, J.SVGSVGElement = e.SVGSVGElement || Q, J.SVGElementInstance = e.SVGElementInstance || Q, J.Element = e.Element || Q, J.HTMLElement = e.HTMLElement || J.Element, J.Event = e.Event, J.Touch = e.Touch || Q, J.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
1188
1028
|
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
1189
|
-
function
|
|
1029
|
+
function Q() {
|
|
1190
1030
|
}
|
|
1191
|
-
var
|
|
1192
|
-
var e =
|
|
1193
|
-
oe.supportsTouch = "ontouchstart" in t ||
|
|
1194
|
-
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null },
|
|
1031
|
+
var X = J, oe = { init: function(t) {
|
|
1032
|
+
var e = X.Element, n = t.navigator || {};
|
|
1033
|
+
oe.supportsTouch = "ontouchstart" in t || x.func(t.DocumentTouch) && X.document instanceof t.DocumentTouch, oe.supportsPointerEvent = n.pointerEnabled !== !1 && !!X.PointerEvent, oe.isIOS = /iP(hone|od|ad)/.test(n.platform), oe.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), oe.isIe9 = /MSIE 9/.test(n.userAgent), oe.isOperaMobile = n.appName === "Opera" && oe.supportsTouch && /Presto/.test(n.userAgent), oe.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", oe.pEventTypes = oe.supportsPointerEvent ? X.PointerEvent === t.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, oe.wheelEvent = X.document && "onmousewheel" in X.document ? "mousewheel" : "wheel";
|
|
1034
|
+
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, re = oe;
|
|
1195
1035
|
function se(t, e) {
|
|
1196
1036
|
if (t.contains) return t.contains(e);
|
|
1197
1037
|
for (; e; ) {
|
|
@@ -1201,7 +1041,7 @@ function Uo() {
|
|
|
1201
1041
|
return !1;
|
|
1202
1042
|
}
|
|
1203
1043
|
function pe(t, e) {
|
|
1204
|
-
for (;
|
|
1044
|
+
for (; x.element(t); ) {
|
|
1205
1045
|
if (he(t, e)) return t;
|
|
1206
1046
|
t = fe(t);
|
|
1207
1047
|
}
|
|
@@ -1209,40 +1049,40 @@ function Uo() {
|
|
|
1209
1049
|
}
|
|
1210
1050
|
function fe(t) {
|
|
1211
1051
|
var e = t.parentNode;
|
|
1212
|
-
if (
|
|
1213
|
-
for (; (e = e.host) &&
|
|
1052
|
+
if (x.docFrag(e)) {
|
|
1053
|
+
for (; (e = e.host) && x.docFrag(e); ) ;
|
|
1214
1054
|
return e;
|
|
1215
1055
|
}
|
|
1216
1056
|
return e;
|
|
1217
1057
|
}
|
|
1218
1058
|
function he(t, e) {
|
|
1219
|
-
return
|
|
1059
|
+
return L !== H && (e = e.replace(/\/deep\//g, " ")), t[re.prefixedMatchesSelector](e);
|
|
1220
1060
|
}
|
|
1221
1061
|
var E = function(t) {
|
|
1222
1062
|
return t.parentNode || t.host;
|
|
1223
1063
|
};
|
|
1224
|
-
function
|
|
1064
|
+
function B(t, e) {
|
|
1225
1065
|
for (var n, r = [], o = t; (n = E(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
|
|
1226
1066
|
return r;
|
|
1227
1067
|
}
|
|
1228
|
-
function
|
|
1229
|
-
for (;
|
|
1068
|
+
function Y(t, e, n) {
|
|
1069
|
+
for (; x.element(t); ) {
|
|
1230
1070
|
if (he(t, e)) return !0;
|
|
1231
1071
|
if ((t = fe(t)) === n) return he(t, e);
|
|
1232
1072
|
}
|
|
1233
1073
|
return !1;
|
|
1234
1074
|
}
|
|
1235
|
-
function
|
|
1075
|
+
function G(t) {
|
|
1236
1076
|
return t.correspondingUseElement || t;
|
|
1237
1077
|
}
|
|
1238
1078
|
function xe(t) {
|
|
1239
|
-
var e = t instanceof
|
|
1079
|
+
var e = t instanceof X.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
1240
1080
|
return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top };
|
|
1241
1081
|
}
|
|
1242
1082
|
function we(t) {
|
|
1243
1083
|
var e, n = xe(t);
|
|
1244
|
-
if (!
|
|
1245
|
-
var r = { x: (e = (e =
|
|
1084
|
+
if (!re.isIOS7 && n) {
|
|
1085
|
+
var r = { x: (e = (e = Z(t)) || L).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
1246
1086
|
n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
|
|
1247
1087
|
}
|
|
1248
1088
|
return n;
|
|
@@ -1252,45 +1092,45 @@ function Uo() {
|
|
|
1252
1092
|
return e;
|
|
1253
1093
|
}
|
|
1254
1094
|
function Ee(t) {
|
|
1255
|
-
return !!
|
|
1095
|
+
return !!x.string(t) && (X.document.querySelector(t), !0);
|
|
1256
1096
|
}
|
|
1257
|
-
function
|
|
1097
|
+
function z(t, e) {
|
|
1258
1098
|
for (var n in e) t[n] = e[n];
|
|
1259
1099
|
return t;
|
|
1260
1100
|
}
|
|
1261
|
-
function
|
|
1101
|
+
function et(t, e, n) {
|
|
1262
1102
|
return t === "parent" ? fe(n) : t === "self" ? e.getRect(n) : pe(n, t);
|
|
1263
1103
|
}
|
|
1264
|
-
function
|
|
1104
|
+
function Le(t, e, n, r) {
|
|
1265
1105
|
var o = t;
|
|
1266
|
-
return
|
|
1106
|
+
return x.string(o) ? o = et(o, e, n) : x.func(o) && (o = o.apply(void 0, r)), x.element(o) && (o = we(o)), o;
|
|
1267
1107
|
}
|
|
1268
|
-
function
|
|
1108
|
+
function tt(t) {
|
|
1269
1109
|
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
1270
1110
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return !t || "x" in t && "y" in t || ((t =
|
|
1111
|
+
function gt(t) {
|
|
1112
|
+
return !t || "x" in t && "y" in t || ((t = z({}, 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;
|
|
1273
1113
|
}
|
|
1274
|
-
function
|
|
1114
|
+
function nt(t, e, n) {
|
|
1275
1115
|
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;
|
|
1276
1116
|
}
|
|
1277
|
-
function
|
|
1117
|
+
function ze(t, e, n) {
|
|
1278
1118
|
var r = n && t.options[n];
|
|
1279
|
-
return
|
|
1119
|
+
return tt(Le(r && r.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
|
|
1280
1120
|
}
|
|
1281
1121
|
function Ie(t, e) {
|
|
1282
1122
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(l) {
|
|
1283
1123
|
return !0;
|
|
1284
1124
|
}, r = arguments.length > 3 ? arguments[3] : void 0;
|
|
1285
|
-
if (r = r || {},
|
|
1125
|
+
if (r = r || {}, x.string(t) && t.search(" ") !== -1 && (t = Bt(t)), x.array(t)) return t.forEach((function(l) {
|
|
1286
1126
|
return Ie(l, e, n, r);
|
|
1287
1127
|
})), r;
|
|
1288
|
-
if (
|
|
1289
|
-
else if (
|
|
1128
|
+
if (x.object(t) && (e = t, t = ""), x.func(e) && n(t)) r[t] = r[t] || [], r[t].push(e);
|
|
1129
|
+
else if (x.array(e)) for (var o = 0, i = e; o < i.length; o++) {
|
|
1290
1130
|
var a = i[o];
|
|
1291
1131
|
Ie(t, a, n, r);
|
|
1292
1132
|
}
|
|
1293
|
-
else if (
|
|
1133
|
+
else if (x.object(e)) for (var s in e)
|
|
1294
1134
|
Ie(Bt(s).map((function(l) {
|
|
1295
1135
|
return "".concat(t).concat(l);
|
|
1296
1136
|
})), e[s], n, r);
|
|
@@ -1302,7 +1142,7 @@ function Uo() {
|
|
|
1302
1142
|
var Fe = function(t, e) {
|
|
1303
1143
|
return Math.sqrt(t * t + e * e);
|
|
1304
1144
|
}, jn = ["webkit", "moz"];
|
|
1305
|
-
function
|
|
1145
|
+
function rt(t, e) {
|
|
1306
1146
|
t.__set || (t.__set = {});
|
|
1307
1147
|
var n = function(o) {
|
|
1308
1148
|
if (jn.some((function(i) {
|
|
@@ -1317,33 +1157,33 @@ function Uo() {
|
|
|
1317
1157
|
for (var r in e) n(r);
|
|
1318
1158
|
return t;
|
|
1319
1159
|
}
|
|
1320
|
-
function
|
|
1160
|
+
function ot(t, e) {
|
|
1321
1161
|
t.page = t.page || {}, t.page.x = e.page.x, t.page.y = e.page.y, t.client = t.client || {}, t.client.x = e.client.x, t.client.y = e.client.y, t.timeStamp = e.timeStamp;
|
|
1322
1162
|
}
|
|
1323
1163
|
function qt(t) {
|
|
1324
1164
|
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
1325
1165
|
}
|
|
1326
1166
|
function Wt(t) {
|
|
1327
|
-
return t instanceof
|
|
1167
|
+
return t instanceof X.Event || t instanceof X.Touch;
|
|
1328
1168
|
}
|
|
1329
|
-
function
|
|
1169
|
+
function it(t, e, n) {
|
|
1330
1170
|
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
1331
1171
|
}
|
|
1332
1172
|
function Yt(t, e) {
|
|
1333
|
-
return e = e || { x: 0, y: 0 },
|
|
1173
|
+
return e = e || { x: 0, y: 0 }, re.isOperaMobile && Wt(t) ? (it("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : it("page", t, e), e;
|
|
1334
1174
|
}
|
|
1335
1175
|
function je(t) {
|
|
1336
|
-
return
|
|
1176
|
+
return x.number(t.pointerId) ? t.pointerId : t.identifier;
|
|
1337
1177
|
}
|
|
1338
1178
|
function Hn(t, e, n) {
|
|
1339
1179
|
var r = e.length > 1 ? $t(e) : e[0];
|
|
1340
1180
|
Yt(r, t.page), (function(o, i) {
|
|
1341
|
-
i = i || {},
|
|
1181
|
+
i = i || {}, re.isOperaMobile && Wt(o) ? it("screen", o, i) : it("client", o, i);
|
|
1342
1182
|
})(r, t.client), t.timeStamp = n;
|
|
1343
1183
|
}
|
|
1344
|
-
function
|
|
1184
|
+
function yt(t) {
|
|
1345
1185
|
var e = [];
|
|
1346
|
-
return
|
|
1186
|
+
return x.array(t) ? (e[0] = t[0], e[1] = t[1]) : t.type === "touchend" ? t.touches.length === 1 ? (e[0] = t.touches[0], e[1] = t.changedTouches[0]) : t.touches.length === 0 && (e[0] = t.changedTouches[0], e[1] = t.changedTouches[1]) : (e[0] = t.touches[0], e[1] = t.touches[1]), e;
|
|
1347
1187
|
}
|
|
1348
1188
|
function $t(t) {
|
|
1349
1189
|
for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) {
|
|
@@ -1353,38 +1193,38 @@ function Uo() {
|
|
|
1353
1193
|
for (var i in e) e[i] /= t.length;
|
|
1354
1194
|
return e;
|
|
1355
1195
|
}
|
|
1356
|
-
function
|
|
1196
|
+
function bt(t) {
|
|
1357
1197
|
if (!t.length) return null;
|
|
1358
|
-
var e =
|
|
1198
|
+
var e = yt(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY), o = Math.max(e[0].pageX, e[1].pageX), i = Math.max(e[0].pageY, e[1].pageY);
|
|
1359
1199
|
return { x: n, y: r, left: n, top: r, right: o, bottom: i, width: o - n, height: i - r };
|
|
1360
1200
|
}
|
|
1361
|
-
function
|
|
1362
|
-
var n = e + "X", r = e + "Y", o =
|
|
1201
|
+
function xt(t, e) {
|
|
1202
|
+
var n = e + "X", r = e + "Y", o = yt(t), i = o[0][n] - o[1][n], a = o[0][r] - o[1][r];
|
|
1363
1203
|
return Fe(i, a);
|
|
1364
1204
|
}
|
|
1365
|
-
function
|
|
1366
|
-
var n = e + "X", r = e + "Y", o =
|
|
1205
|
+
function wt(t, e) {
|
|
1206
|
+
var n = e + "X", r = e + "Y", o = yt(t), i = o[1][n] - o[0][n], a = o[1][r] - o[0][r];
|
|
1367
1207
|
return 180 * Math.atan2(a, i) / Math.PI;
|
|
1368
1208
|
}
|
|
1369
1209
|
function Vt(t) {
|
|
1370
|
-
return
|
|
1210
|
+
return x.string(t.pointerType) ? t.pointerType : x.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof X.Touch ? "touch" : "mouse";
|
|
1371
1211
|
}
|
|
1372
1212
|
function Ut(t) {
|
|
1373
|
-
var e =
|
|
1374
|
-
return [
|
|
1213
|
+
var e = x.func(t.composedPath) ? t.composedPath() : t.path;
|
|
1214
|
+
return [G(e ? e[0] : t.target), G(t.currentTarget)];
|
|
1375
1215
|
}
|
|
1376
|
-
var
|
|
1216
|
+
var at = (function() {
|
|
1377
1217
|
function t(e) {
|
|
1378
|
-
|
|
1218
|
+
y(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
1379
1219
|
}
|
|
1380
|
-
return
|
|
1220
|
+
return g(t, [{ key: "preventDefault", value: function() {
|
|
1381
1221
|
} }, { key: "stopPropagation", value: function() {
|
|
1382
1222
|
this.propagationStopped = !0;
|
|
1383
1223
|
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1384
1224
|
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
1385
1225
|
} }]), t;
|
|
1386
1226
|
})();
|
|
1387
|
-
Object.defineProperty(
|
|
1227
|
+
Object.defineProperty(at.prototype, "interaction", { get: function() {
|
|
1388
1228
|
return this._interaction._proxy;
|
|
1389
1229
|
}, set: function() {
|
|
1390
1230
|
} });
|
|
@@ -1402,15 +1242,15 @@ function Uo() {
|
|
|
1402
1242
|
}, Be = function(t, e) {
|
|
1403
1243
|
return t[He(t, e)];
|
|
1404
1244
|
}, De = (function(t) {
|
|
1405
|
-
|
|
1406
|
-
var e =
|
|
1245
|
+
A(n, t);
|
|
1246
|
+
var e = R(n);
|
|
1407
1247
|
function n(r, o, i) {
|
|
1408
1248
|
var a;
|
|
1409
|
-
|
|
1249
|
+
y(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;
|
|
1410
1250
|
var s = i === "dragleave" ? r.prev : r.cur, l = s.element, d = s.dropzone;
|
|
1411
1251
|
return a.type = i, a.target = l, a.currentTarget = l, a.dropzone = d, a.dragEvent = o, a.relatedTarget = o.target, a.draggable = o.interactable, a.timeStamp = o.timeStamp, a;
|
|
1412
1252
|
}
|
|
1413
|
-
return
|
|
1253
|
+
return g(n, [{ key: "reject", value: function() {
|
|
1414
1254
|
var r = this, o = this._interaction.dropState;
|
|
1415
1255
|
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") {
|
|
1416
1256
|
var i = o.activeDrops, a = He(i, (function(l) {
|
|
@@ -1427,21 +1267,21 @@ function Uo() {
|
|
|
1427
1267
|
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1428
1268
|
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
1429
1269
|
} }]), n;
|
|
1430
|
-
})(
|
|
1270
|
+
})(at);
|
|
1431
1271
|
function Kt(t, e) {
|
|
1432
1272
|
for (var n = 0, r = t.slice(); n < r.length; n++) {
|
|
1433
1273
|
var o = r[n], i = o.dropzone, a = o.element;
|
|
1434
1274
|
e.dropzone = i, e.target = a, i.fire(e), e.propagationStopped = e.immediatePropagationStopped = !1;
|
|
1435
1275
|
}
|
|
1436
1276
|
}
|
|
1437
|
-
function
|
|
1277
|
+
function Et(t, e) {
|
|
1438
1278
|
for (var n = (function(i, a) {
|
|
1439
1279
|
for (var s = [], l = 0, d = i.interactables.list; l < d.length; l++) {
|
|
1440
1280
|
var c = d[l];
|
|
1441
1281
|
if (c.options.drop.enabled) {
|
|
1442
1282
|
var f = c.options.drop.accept;
|
|
1443
|
-
if (!(
|
|
1444
|
-
var C =
|
|
1283
|
+
if (!(x.element(f) && f !== a || x.string(f) && !he(a, f) || x.func(f) && !f({ dropzone: c, draggableElement: a }))) for (var b = 0, S = c.getAllElements(); b < S.length; b++) {
|
|
1284
|
+
var C = S[b];
|
|
1445
1285
|
C !== a && s.push({ dropzone: c, element: C, rect: c.getRect(C) });
|
|
1446
1286
|
}
|
|
1447
1287
|
}
|
|
@@ -1455,44 +1295,44 @@ function Uo() {
|
|
|
1455
1295
|
}
|
|
1456
1296
|
function Jt(t, e, n) {
|
|
1457
1297
|
for (var r = t.dropState, o = t.interactable, i = t.element, a = [], s = 0, l = r.activeDrops; s < l.length; s++) {
|
|
1458
|
-
var d = l[s], c = d.dropzone, f = d.element,
|
|
1459
|
-
a.push(
|
|
1298
|
+
var d = l[s], c = d.dropzone, f = d.element, b = d.rect, S = c.dropCheck(e, n, o, i, f, b);
|
|
1299
|
+
a.push(S ? f : null);
|
|
1460
1300
|
}
|
|
1461
1301
|
var C = (function(M) {
|
|
1462
|
-
for (var
|
|
1463
|
-
var
|
|
1464
|
-
if (
|
|
1465
|
-
var
|
|
1466
|
-
if (
|
|
1467
|
-
|
|
1302
|
+
for (var D, O, F, U = [], ee = 0; ee < M.length; ee++) {
|
|
1303
|
+
var q = M[ee], K = M[D];
|
|
1304
|
+
if (q && ee !== D) if (K) {
|
|
1305
|
+
var ve = E(q), ae = E(K);
|
|
1306
|
+
if (ve !== q.ownerDocument) if (ae !== q.ownerDocument) if (ve !== ae) {
|
|
1307
|
+
U = U.length ? U : B(K);
|
|
1468
1308
|
var ge = void 0;
|
|
1469
|
-
if (
|
|
1470
|
-
if (
|
|
1471
|
-
ge =
|
|
1472
|
-
} else ge =
|
|
1473
|
-
for (var be =
|
|
1474
|
-
var
|
|
1475
|
-
if (
|
|
1476
|
-
if (Ue ===
|
|
1477
|
-
|
|
1309
|
+
if (K instanceof X.HTMLElement && q instanceof X.SVGElement && !(q instanceof X.SVGSVGElement)) {
|
|
1310
|
+
if (q === ae) continue;
|
|
1311
|
+
ge = q.ownerSVGElement;
|
|
1312
|
+
} else ge = q;
|
|
1313
|
+
for (var be = B(ge, K.ownerDocument), Se = 0; be[Se] && be[Se] === U[Se]; ) Se++;
|
|
1314
|
+
var mt = [be[Se - 1], be[Se], U[Se]];
|
|
1315
|
+
if (mt[0]) for (var Ue = mt[0].lastChild; Ue; ) {
|
|
1316
|
+
if (Ue === mt[1]) {
|
|
1317
|
+
D = ee, U = be;
|
|
1478
1318
|
break;
|
|
1479
1319
|
}
|
|
1480
|
-
if (Ue ===
|
|
1320
|
+
if (Ue === mt[2]) break;
|
|
1481
1321
|
Ue = Ue.previousSibling;
|
|
1482
1322
|
}
|
|
1483
|
-
} else
|
|
1484
|
-
else
|
|
1485
|
-
} else
|
|
1323
|
+
} else F = K, (parseInt(Z(O = q).getComputedStyle(O).zIndex, 10) || 0) >= (parseInt(Z(F).getComputedStyle(F).zIndex, 10) || 0) && (D = ee);
|
|
1324
|
+
else D = ee;
|
|
1325
|
+
} else D = ee;
|
|
1486
1326
|
}
|
|
1487
|
-
return
|
|
1327
|
+
return D;
|
|
1488
1328
|
})(a);
|
|
1489
1329
|
return r.activeDrops[C] || null;
|
|
1490
1330
|
}
|
|
1491
|
-
function
|
|
1331
|
+
function kt(t, e, n) {
|
|
1492
1332
|
var r = t.dropState, o = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
|
1493
1333
|
return n.type === "dragstart" && (o.activate = new De(r, n, "dropactivate"), o.activate.target = null, o.activate.dropzone = null), n.type === "dragend" && (o.deactivate = new De(r, n, "dropdeactivate"), o.deactivate.target = null, o.deactivate.dropzone = null), r.rejected || (r.cur.element !== r.prev.element && (r.prev.dropzone && (o.leave = new De(r, n, "dragleave"), n.dragLeave = o.leave.target = r.prev.element, n.prevDropzone = o.leave.dropzone = r.prev.dropzone), r.cur.dropzone && (o.enter = new De(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (o.drop = new De(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (o.move = new De(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), o;
|
|
1494
1334
|
}
|
|
1495
|
-
function
|
|
1335
|
+
function Ct(t, e) {
|
|
1496
1336
|
var n = t.dropState, r = n.activeDrops, o = n.cur, i = n.prev;
|
|
1497
1337
|
e.leave && i.dropzone.fire(e.leave), e.enter && o.dropzone.fire(e.enter), e.move && o.dropzone.fire(e.move), e.drop && o.dropzone.fire(e.drop), e.deactivate && Kt(r, e.deactivate), n.prev.dropzone = o.dropzone, n.prev.element = o.element;
|
|
1498
1338
|
}
|
|
@@ -1500,47 +1340,47 @@ function Uo() {
|
|
|
1500
1340
|
var n = t.interaction, r = t.iEvent, o = t.event;
|
|
1501
1341
|
if (r.type === "dragmove" || r.type === "dragend") {
|
|
1502
1342
|
var i = n.dropState;
|
|
1503
|
-
e.dynamicDrop && (i.activeDrops =
|
|
1343
|
+
e.dynamicDrop && (i.activeDrops = Et(e, n.element));
|
|
1504
1344
|
var a = r, s = Jt(n, a, o);
|
|
1505
|
-
i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events =
|
|
1345
|
+
i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events = kt(n, 0, a);
|
|
1506
1346
|
}
|
|
1507
1347
|
}
|
|
1508
1348
|
var Zt = { id: "actions/drop", install: function(t) {
|
|
1509
1349
|
var e = t.actions, n = t.interactStatic, r = t.Interactable, o = t.defaults;
|
|
1510
1350
|
t.usePlugin(ce), r.prototype.dropzone = function(i) {
|
|
1511
1351
|
return (function(a, s) {
|
|
1512
|
-
if (
|
|
1352
|
+
if (x.object(s)) {
|
|
1513
1353
|
if (a.options.drop.enabled = s.enabled !== !1, s.listeners) {
|
|
1514
|
-
var l = Ie(s.listeners), d = Object.keys(l).reduce((function(f,
|
|
1515
|
-
return f[/^(enter|leave)/.test(
|
|
1354
|
+
var l = Ie(s.listeners), d = Object.keys(l).reduce((function(f, b) {
|
|
1355
|
+
return f[/^(enter|leave)/.test(b) ? "drag".concat(b) : /^(activate|deactivate|move)/.test(b) ? "drop".concat(b) : b] = l[b], f;
|
|
1516
1356
|
}), {}), c = a.options.drop.listeners;
|
|
1517
1357
|
c && a.off(c), a.on(d), a.options.drop.listeners = d;
|
|
1518
1358
|
}
|
|
1519
|
-
return
|
|
1359
|
+
return x.func(s.ondrop) && a.on("drop", s.ondrop), x.func(s.ondropactivate) && a.on("dropactivate", s.ondropactivate), x.func(s.ondropdeactivate) && a.on("dropdeactivate", s.ondropdeactivate), x.func(s.ondragenter) && a.on("dragenter", s.ondragenter), x.func(s.ondragleave) && a.on("dragleave", s.ondragleave), x.func(s.ondropmove) && a.on("dropmove", s.ondropmove), /^(pointer|center)$/.test(s.overlap) ? a.options.drop.overlap = s.overlap : x.number(s.overlap) && (a.options.drop.overlap = Math.max(Math.min(1, s.overlap), 0)), "accept" in s && (a.options.drop.accept = s.accept), "checker" in s && (a.options.drop.checker = s.checker), a;
|
|
1520
1360
|
}
|
|
1521
|
-
return
|
|
1361
|
+
return x.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
1522
1362
|
})(this, i);
|
|
1523
1363
|
}, r.prototype.dropCheck = function(i, a, s, l, d, c) {
|
|
1524
|
-
return (function(f,
|
|
1525
|
-
var
|
|
1526
|
-
if (!(
|
|
1527
|
-
var
|
|
1528
|
-
if (
|
|
1529
|
-
var
|
|
1530
|
-
|
|
1531
|
-
var
|
|
1532
|
-
|
|
1364
|
+
return (function(f, b, S, C, M, D, O) {
|
|
1365
|
+
var F = !1;
|
|
1366
|
+
if (!(O = O || f.getRect(D))) return !!f.options.drop.checker && f.options.drop.checker(b, S, F, f, D, C, M);
|
|
1367
|
+
var U = f.options.drop.overlap;
|
|
1368
|
+
if (U === "pointer") {
|
|
1369
|
+
var ee = ze(C, M, "drag"), q = Yt(b);
|
|
1370
|
+
q.x += ee.x, q.y += ee.y;
|
|
1371
|
+
var K = q.x > O.left && q.x < O.right, ve = q.y > O.top && q.y < O.bottom;
|
|
1372
|
+
F = K && ve;
|
|
1533
1373
|
}
|
|
1534
1374
|
var ae = C.getRect(M);
|
|
1535
|
-
if (ae &&
|
|
1375
|
+
if (ae && U === "center") {
|
|
1536
1376
|
var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
|
|
1537
|
-
|
|
1377
|
+
F = ge >= O.left && ge <= O.right && be >= O.top && be <= O.bottom;
|
|
1538
1378
|
}
|
|
1539
|
-
return ae &&
|
|
1379
|
+
return ae && x.number(U) && (F = Math.max(0, Math.min(O.right, ae.right) - Math.max(O.left, ae.left)) * Math.max(0, Math.min(O.bottom, ae.bottom) - Math.max(O.top, ae.top)) / (ae.width * ae.height) >= U), f.options.drop.checker && (F = f.options.drop.checker(b, S, F, f, D, C, M)), F;
|
|
1540
1380
|
})(this, i, a, s, l, d, c);
|
|
1541
1381
|
}, n.dynamicDrop = function(i) {
|
|
1542
|
-
return
|
|
1543
|
-
},
|
|
1382
|
+
return x.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
|
|
1383
|
+
}, z(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = Zt.defaults;
|
|
1544
1384
|
}, listeners: { "interactions:before-action-start": function(t) {
|
|
1545
1385
|
var e = t.interaction;
|
|
1546
1386
|
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
|
@@ -1548,18 +1388,18 @@ function Uo() {
|
|
|
1548
1388
|
var n = t.interaction, r = (t.event, t.iEvent);
|
|
1549
1389
|
if (n.prepared.name === "drag") {
|
|
1550
1390
|
var o = n.dropState;
|
|
1551
|
-
o.activeDrops = [], o.events = {}, o.activeDrops =
|
|
1391
|
+
o.activeDrops = [], o.events = {}, o.activeDrops = Et(e, n.element), o.events = kt(n, 0, r), o.events.activate && (Kt(o.activeDrops, o.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
|
|
1552
1392
|
}
|
|
1553
1393
|
}, "interactions:action-move": Qt, "interactions:after-action-move": function(t, e) {
|
|
1554
1394
|
var n = t.interaction, r = t.iEvent;
|
|
1555
1395
|
if (n.prepared.name === "drag") {
|
|
1556
1396
|
var o = n.dropState;
|
|
1557
|
-
|
|
1397
|
+
Ct(n, o.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), o.events = {};
|
|
1558
1398
|
}
|
|
1559
1399
|
}, "interactions:action-end": function(t, e) {
|
|
1560
1400
|
if (t.interaction.prepared.name === "drag") {
|
|
1561
1401
|
var n = t.interaction, r = t.iEvent;
|
|
1562
|
-
Qt(t, e),
|
|
1402
|
+
Qt(t, e), Ct(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
|
|
1563
1403
|
}
|
|
1564
1404
|
}, "interactions:stop": function(t) {
|
|
1565
1405
|
var e = t.interaction;
|
|
@@ -1567,29 +1407,29 @@ function Uo() {
|
|
|
1567
1407
|
var n = e.dropState;
|
|
1568
1408
|
n && (n.activeDrops = null, n.events = null, n.cur.dropzone = null, n.cur.element = null, n.prev.dropzone = null, n.prev.element = null, n.rejected = !1);
|
|
1569
1409
|
}
|
|
1570
|
-
} }, getActiveDrops:
|
|
1410
|
+
} }, getActiveDrops: Et, getDrop: Jt, getDropEvents: kt, fireDropEvents: Ct, filterEventType: function(t) {
|
|
1571
1411
|
return t.search("drag") === 0 || t.search("drop") === 0;
|
|
1572
1412
|
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Bn = Zt;
|
|
1573
|
-
function
|
|
1413
|
+
function St(t) {
|
|
1574
1414
|
var e = t.interaction, n = t.iEvent, r = t.phase;
|
|
1575
1415
|
if (e.prepared.name === "gesture") {
|
|
1576
1416
|
var o = e.pointers.map((function(d) {
|
|
1577
1417
|
return d.pointer;
|
|
1578
1418
|
})), i = r === "start", a = r === "end", s = e.interactable.options.deltaSource;
|
|
1579
|
-
if (n.touches = [o[0], o[1]], i) n.distance =
|
|
1419
|
+
if (n.touches = [o[0], o[1]], i) n.distance = xt(o, s), n.box = bt(o), n.scale = 1, n.ds = 0, n.angle = wt(o, s), n.da = 0, e.gesture.startDistance = n.distance, e.gesture.startAngle = n.angle;
|
|
1580
1420
|
else if (a || e.pointers.length < 2) {
|
|
1581
1421
|
var l = e.prevEvent;
|
|
1582
1422
|
n.distance = l.distance, n.box = l.box, n.scale = l.scale, n.ds = 0, n.angle = l.angle, n.da = 0;
|
|
1583
|
-
} else n.distance =
|
|
1584
|
-
e.gesture.distance = n.distance, e.gesture.angle = n.angle,
|
|
1423
|
+
} else n.distance = xt(o, s), n.box = bt(o), n.scale = n.distance / e.gesture.startDistance, n.angle = wt(o, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
|
|
1424
|
+
e.gesture.distance = n.distance, e.gesture.angle = n.angle, x.number(n.scale) && n.scale !== 1 / 0 && !isNaN(n.scale) && (e.gesture.scale = n.scale);
|
|
1585
1425
|
}
|
|
1586
1426
|
}
|
|
1587
|
-
var
|
|
1427
|
+
var Tt = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
|
|
1588
1428
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
1589
1429
|
n.prototype.gesturable = function(o) {
|
|
1590
|
-
return
|
|
1591
|
-
}, e.map.gesture =
|
|
1592
|
-
}, listeners: { "interactions:action-start":
|
|
1430
|
+
return x.object(o) ? (this.options.gesture.enabled = o.enabled !== !1, this.setPerAction("gesture", o), this.setOnEvents("gesture", o), this) : x.bool(o) ? (this.options.gesture.enabled = o, this) : this.options.gesture;
|
|
1431
|
+
}, e.map.gesture = Tt, e.methodDict.gesture = "gesturable", r.actions.gesture = Tt.defaults;
|
|
1432
|
+
}, listeners: { "interactions:action-start": St, "interactions:action-move": St, "interactions:action-end": St, "interactions:new": function(t) {
|
|
1593
1433
|
t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
|
|
1594
1434
|
}, "auto-start:check": function(t) {
|
|
1595
1435
|
if (!(t.interaction.pointers.length < 2)) {
|
|
@@ -1600,11 +1440,11 @@ function Uo() {
|
|
|
1600
1440
|
return "";
|
|
1601
1441
|
}, filterEventType: function(t) {
|
|
1602
1442
|
return t.search("gesture") === 0;
|
|
1603
|
-
} }, qn =
|
|
1443
|
+
} }, qn = Tt;
|
|
1604
1444
|
function Wn(t, e, n, r, o, i, a) {
|
|
1605
1445
|
if (!e) return !1;
|
|
1606
1446
|
if (e === !0) {
|
|
1607
|
-
var s =
|
|
1447
|
+
var s = x.number(i.width) ? i.width : i.right - i.left, l = x.number(i.height) ? i.height : i.bottom - i.top;
|
|
1608
1448
|
if (a = Math.min(a, Math.abs((t === "left" || t === "right" ? s : l) / 2)), s < 0 && (t === "left" ? t = "right" : t === "right" && (t = "left")), l < 0 && (t === "top" ? t = "bottom" : t === "bottom" && (t = "top")), t === "left") {
|
|
1609
1449
|
var d = s >= 0 ? i.left : i.right;
|
|
1610
1450
|
return n.x < d + a;
|
|
@@ -1616,7 +1456,7 @@ function Uo() {
|
|
|
1616
1456
|
if (t === "right") return n.x > (s >= 0 ? i.right : i.left) - a;
|
|
1617
1457
|
if (t === "bottom") return n.y > (l >= 0 ? i.bottom : i.top) - a;
|
|
1618
1458
|
}
|
|
1619
|
-
return !!
|
|
1459
|
+
return !!x.element(r) && (x.element(e) ? e === r : Y(r, e, o));
|
|
1620
1460
|
}
|
|
1621
1461
|
function en(t) {
|
|
1622
1462
|
var e = t.iEvent, n = t.interaction;
|
|
@@ -1631,7 +1471,7 @@ function Uo() {
|
|
|
1631
1471
|
return i.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
|
|
1632
1472
|
})(n), Ce.defaultMargin = n.supportsTouch || n.supportsPointerEvent ? 20 : 10, r.prototype.resizable = function(i) {
|
|
1633
1473
|
return (function(a, s, l) {
|
|
1634
|
-
return
|
|
1474
|
+
return x.object(s) ? (a.options.resize.enabled = s.enabled !== !1, a.setPerAction("resize", s), a.setOnEvents("resize", s), x.string(s.axis) && /^x$|^y$|^xy$/.test(s.axis) ? a.options.resize.axis = s.axis : s.axis === null && (a.options.resize.axis = l.defaults.actions.resize.axis), x.bool(s.preserveAspectRatio) ? a.options.resize.preserveAspectRatio = s.preserveAspectRatio : x.bool(s.square) && (a.options.resize.square = s.square), a) : x.bool(s) ? (a.options.resize.enabled = s, a) : a.options.resize;
|
|
1635
1475
|
})(this, i, t);
|
|
1636
1476
|
}, e.map.resize = Ce, e.methodDict.resize = "resizable", o.actions.resize = Ce.defaults;
|
|
1637
1477
|
}, listeners: { "interactions:new": function(t) {
|
|
@@ -1641,19 +1481,19 @@ function Uo() {
|
|
|
1641
1481
|
var n = e.iEvent, r = e.interaction;
|
|
1642
1482
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1643
1483
|
var o = n, i = r.rect;
|
|
1644
|
-
r._rects = { start:
|
|
1484
|
+
r._rects = { start: z({}, i), corrected: z({}, i), previous: z({}, 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;
|
|
1645
1485
|
}
|
|
1646
1486
|
})(t), en(t);
|
|
1647
1487
|
}, "interactions:action-move": function(t) {
|
|
1648
1488
|
(function(e) {
|
|
1649
1489
|
var n = e.iEvent, r = e.interaction;
|
|
1650
1490
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1651
|
-
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, d = l.start, c = l.corrected, f = l.delta,
|
|
1652
|
-
if (
|
|
1653
|
-
if (
|
|
1491
|
+
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, d = l.start, c = l.corrected, f = l.delta, b = l.previous;
|
|
1492
|
+
if (z(b, c), a) {
|
|
1493
|
+
if (z(c, s), i === "reposition") {
|
|
1654
1494
|
if (c.top > c.bottom) {
|
|
1655
|
-
var
|
|
1656
|
-
c.top = c.bottom, c.bottom =
|
|
1495
|
+
var S = c.top;
|
|
1496
|
+
c.top = c.bottom, c.bottom = S;
|
|
1657
1497
|
}
|
|
1658
1498
|
if (c.left > c.right) {
|
|
1659
1499
|
var C = c.left;
|
|
@@ -1661,7 +1501,7 @@ function Uo() {
|
|
|
1661
1501
|
}
|
|
1662
1502
|
}
|
|
1663
1503
|
} else c.top = Math.min(s.top, d.bottom), c.bottom = Math.max(s.bottom, d.top), c.left = Math.min(s.left, d.right), c.right = Math.max(s.right, d.left);
|
|
1664
|
-
for (var M in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[M] = c[M] -
|
|
1504
|
+
for (var M in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[M] = c[M] - b[M];
|
|
1665
1505
|
o.edges = r.prepared.edges, o.rect = c, o.deltaRect = f;
|
|
1666
1506
|
}
|
|
1667
1507
|
})(t), en(t);
|
|
@@ -1674,9 +1514,9 @@ function Uo() {
|
|
|
1674
1514
|
}, "auto-start:check": function(t) {
|
|
1675
1515
|
var e = t.interaction, n = t.interactable, r = t.element, o = t.rect, i = t.buttons;
|
|
1676
1516
|
if (o) {
|
|
1677
|
-
var a =
|
|
1517
|
+
var a = z({}, e.coords.cur.page), s = n.options.resize;
|
|
1678
1518
|
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (i & s.mouseButtons) != 0)) {
|
|
1679
|
-
if (
|
|
1519
|
+
if (x.object(s.edges)) {
|
|
1680
1520
|
var l = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1681
1521
|
for (var d in l) l[d] = Wn(d, s.edges[d], a, e._latestPointer.eventTarget, r, o, s.margin || Ce.defaultMargin);
|
|
1682
1522
|
l.left = l.left && !l.right, l.top = l.top && !l.bottom, (l.left || l.right || l.top || l.bottom) && (t.action = { name: "resize", edges: l });
|
|
@@ -1719,77 +1559,77 @@ function Uo() {
|
|
|
1719
1559
|
}, Pe = function(o) {
|
|
1720
1560
|
return clearTimeout(o);
|
|
1721
1561
|
});
|
|
1722
|
-
} },
|
|
1723
|
-
|
|
1562
|
+
} }, $ = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(t) {
|
|
1563
|
+
$.isScrolling = !0, Te.cancel($.i), t.autoScroll = $, $.interaction = t, $.prevTime = $.now(), $.i = Te.request($.scroll);
|
|
1724
1564
|
}, stop: function() {
|
|
1725
|
-
|
|
1565
|
+
$.isScrolling = !1, $.interaction && ($.interaction.autoScroll = null), Te.cancel($.i);
|
|
1726
1566
|
}, scroll: function() {
|
|
1727
|
-
var t =
|
|
1567
|
+
var t = $.interaction, e = t.interactable, n = t.element, r = t.prepared.name, o = e.options[r].autoScroll, i = nn(o.container, e, n), a = $.now(), s = (a - $.prevTime) / 1e3, l = o.speed * s;
|
|
1728
1568
|
if (l >= 1) {
|
|
1729
|
-
var d = { x:
|
|
1569
|
+
var d = { x: $.x * l, y: $.y * l };
|
|
1730
1570
|
if (d.x || d.y) {
|
|
1731
1571
|
var c = rn(i);
|
|
1732
|
-
|
|
1733
|
-
var f = rn(i),
|
|
1734
|
-
(
|
|
1572
|
+
x.window(i) ? i.scrollBy(d.x, d.y) : i && (i.scrollLeft += d.x, i.scrollTop += d.y);
|
|
1573
|
+
var f = rn(i), b = { x: f.x - c.x, y: f.y - c.y };
|
|
1574
|
+
(b.x || b.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: b, interaction: t, container: i });
|
|
1735
1575
|
}
|
|
1736
|
-
|
|
1576
|
+
$.prevTime = a;
|
|
1737
1577
|
}
|
|
1738
|
-
|
|
1578
|
+
$.isScrolling && (Te.cancel($.i), $.i = Te.request($.scroll));
|
|
1739
1579
|
}, check: function(t, e) {
|
|
1740
1580
|
var n;
|
|
1741
1581
|
return (n = t.options[e].autoScroll) == null ? void 0 : n.enabled;
|
|
1742
1582
|
}, onInteractionMove: function(t) {
|
|
1743
1583
|
var e = t.interaction, n = t.pointer;
|
|
1744
|
-
if (e.interacting() &&
|
|
1584
|
+
if (e.interacting() && $.check(e.interactable, e.prepared.name)) if (e.simulation) $.x = $.y = 0;
|
|
1745
1585
|
else {
|
|
1746
1586
|
var r, o, i, a, s = e.interactable, l = e.element, d = e.prepared.name, c = s.options[d].autoScroll, f = nn(c.container, s, l);
|
|
1747
|
-
if (
|
|
1587
|
+
if (x.window(f)) a = n.clientX < $.margin, r = n.clientY < $.margin, o = n.clientX > f.innerWidth - $.margin, i = n.clientY > f.innerHeight - $.margin;
|
|
1748
1588
|
else {
|
|
1749
|
-
var
|
|
1750
|
-
a = n.clientX <
|
|
1589
|
+
var b = xe(f);
|
|
1590
|
+
a = n.clientX < b.left + $.margin, r = n.clientY < b.top + $.margin, o = n.clientX > b.right - $.margin, i = n.clientY > b.bottom - $.margin;
|
|
1751
1591
|
}
|
|
1752
|
-
|
|
1592
|
+
$.x = o ? 1 : a ? -1 : 0, $.y = i ? 1 : r ? -1 : 0, $.isScrolling || ($.margin = c.margin, $.speed = c.speed, $.start(e));
|
|
1753
1593
|
}
|
|
1754
1594
|
} };
|
|
1755
1595
|
function nn(t, e, n) {
|
|
1756
|
-
return (
|
|
1596
|
+
return (x.string(t) ? et(t, e, n) : t) || Z(n);
|
|
1757
1597
|
}
|
|
1758
1598
|
function rn(t) {
|
|
1759
|
-
return
|
|
1599
|
+
return x.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
|
|
1760
1600
|
}
|
|
1761
1601
|
var Vn = { id: "auto-scroll", install: function(t) {
|
|
1762
1602
|
var e = t.defaults, n = t.actions;
|
|
1763
|
-
t.autoScroll =
|
|
1603
|
+
t.autoScroll = $, $.now = function() {
|
|
1764
1604
|
return t.now();
|
|
1765
|
-
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll =
|
|
1605
|
+
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = $.defaults;
|
|
1766
1606
|
}, listeners: { "interactions:new": function(t) {
|
|
1767
1607
|
t.interaction.autoScroll = null;
|
|
1768
1608
|
}, "interactions:destroy": function(t) {
|
|
1769
|
-
t.interaction.autoScroll = null,
|
|
1770
|
-
}, "interactions:stop":
|
|
1771
|
-
return
|
|
1609
|
+
t.interaction.autoScroll = null, $.stop(), $.interaction && ($.interaction = null);
|
|
1610
|
+
}, "interactions:stop": $.stop, "interactions:action-move": function(t) {
|
|
1611
|
+
return $.onInteractionMove(t);
|
|
1772
1612
|
} } }, Un = Vn;
|
|
1773
1613
|
function qe(t, e) {
|
|
1774
1614
|
var n = !1;
|
|
1775
1615
|
return function() {
|
|
1776
|
-
return n || (
|
|
1616
|
+
return n || (L.console.warn(e), n = !0), t.apply(this, arguments);
|
|
1777
1617
|
};
|
|
1778
1618
|
}
|
|
1779
|
-
function
|
|
1619
|
+
function _t(t, e) {
|
|
1780
1620
|
return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
|
|
1781
1621
|
}
|
|
1782
1622
|
function Xn(t) {
|
|
1783
|
-
return
|
|
1623
|
+
return x.bool(t) ? (this.options.styleCursor = t, this) : t === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
|
|
1784
1624
|
}
|
|
1785
1625
|
function Gn(t) {
|
|
1786
|
-
return
|
|
1626
|
+
return x.func(t) ? (this.options.actionChecker = t, this) : t === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
|
|
1787
1627
|
}
|
|
1788
1628
|
var Kn = { id: "auto-start/interactableMethods", install: function(t) {
|
|
1789
1629
|
var e = t.Interactable;
|
|
1790
1630
|
e.prototype.getAction = function(n, r, o, i) {
|
|
1791
1631
|
var a = (function(s, l, d, c, f) {
|
|
1792
|
-
var
|
|
1632
|
+
var b = s.getRect(c), S = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], C = { action: null, interactable: s, interaction: d, element: c, rect: b, buttons: S };
|
|
1793
1633
|
return f.fire("auto-start:check", C), C.action;
|
|
1794
1634
|
})(this, r, o, i, t);
|
|
1795
1635
|
return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, i, o) : a;
|
|
@@ -1800,14 +1640,14 @@ function Uo() {
|
|
|
1800
1640
|
}), "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = Gn, e.prototype.styleCursor = Xn;
|
|
1801
1641
|
} };
|
|
1802
1642
|
function on(t, e, n, r, o) {
|
|
1803
|
-
return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled &&
|
|
1643
|
+
return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && st(e, n, t, o) ? t : null;
|
|
1804
1644
|
}
|
|
1805
1645
|
function Jn(t, e, n, r, o, i, a) {
|
|
1806
1646
|
for (var s = 0, l = r.length; s < l; s++) {
|
|
1807
1647
|
var d = r[s], c = o[s], f = d.getAction(e, n, t, c);
|
|
1808
1648
|
if (f) {
|
|
1809
|
-
var
|
|
1810
|
-
if (
|
|
1649
|
+
var b = on(f, d, c, i, a);
|
|
1650
|
+
if (b) return { action: b, interactable: d, element: c };
|
|
1811
1651
|
}
|
|
1812
1652
|
}
|
|
1813
1653
|
return { action: null, interactable: null, element: null };
|
|
@@ -1817,7 +1657,7 @@ function Uo() {
|
|
|
1817
1657
|
function l(c) {
|
|
1818
1658
|
i.push(c), a.push(s);
|
|
1819
1659
|
}
|
|
1820
|
-
for (;
|
|
1660
|
+
for (; x.element(s); ) {
|
|
1821
1661
|
i = [], a = [], o.interactables.forEachMatch(s, l);
|
|
1822
1662
|
var d = Jn(t, e, n, i, a, r, o);
|
|
1823
1663
|
if (d.action && !d.interactable.options[d.action.name].manualStart) return d;
|
|
@@ -1827,22 +1667,22 @@ function Uo() {
|
|
|
1827
1667
|
}
|
|
1828
1668
|
function sn(t, e, n) {
|
|
1829
1669
|
var r = e.action, o = e.interactable, i = e.element;
|
|
1830
|
-
r = r || { name: null }, t.interactable = o, t.element = i,
|
|
1670
|
+
r = r || { name: null }, t.interactable = o, t.element = i, _t(t.prepared, r), t.rect = o && r.name ? o.getRect(i) : null, cn(t, n), n.fire("autoStart:prepared", { interaction: t });
|
|
1831
1671
|
}
|
|
1832
|
-
function
|
|
1672
|
+
function st(t, e, n, r) {
|
|
1833
1673
|
var o = t.options, i = o[n.name].max, a = o[n.name].maxPerElement, s = r.autoStart.maxInteractions, l = 0, d = 0, c = 0;
|
|
1834
1674
|
if (!(i && a && s)) return !1;
|
|
1835
|
-
for (var f = 0,
|
|
1836
|
-
var
|
|
1837
|
-
if (
|
|
1675
|
+
for (var f = 0, b = r.interactions.list; f < b.length; f++) {
|
|
1676
|
+
var S = b[f], C = S.prepared.name;
|
|
1677
|
+
if (S.interacting() && (++l >= s || S.interactable === t && ((d += C === n.name ? 1 : 0) >= i || S.element === e && (c++, C === n.name && c >= a))))
|
|
1838
1678
|
return !1;
|
|
1839
1679
|
}
|
|
1840
1680
|
return s > 0;
|
|
1841
1681
|
}
|
|
1842
1682
|
function ln(t, e) {
|
|
1843
|
-
return
|
|
1683
|
+
return x.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
|
|
1844
1684
|
}
|
|
1845
|
-
function
|
|
1685
|
+
function At(t, e, n) {
|
|
1846
1686
|
var r = n.autoStart.cursorElement;
|
|
1847
1687
|
r && r !== t && (r.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, n.autoStart.cursorElement = e ? t : null;
|
|
1848
1688
|
}
|
|
@@ -1852,16 +1692,16 @@ function Uo() {
|
|
|
1852
1692
|
var i = "";
|
|
1853
1693
|
if (o.name) {
|
|
1854
1694
|
var a = n.options[o.name].cursorChecker;
|
|
1855
|
-
i =
|
|
1695
|
+
i = x.func(a) ? a(o, n, r, t._interacting) : e.actions.map[o.name].getCursor(o);
|
|
1856
1696
|
}
|
|
1857
|
-
|
|
1858
|
-
} else e.autoStart.cursorElement &&
|
|
1697
|
+
At(t.element, i || "", e);
|
|
1698
|
+
} else e.autoStart.cursorElement && At(e.autoStart.cursorElement, "", e);
|
|
1859
1699
|
}
|
|
1860
1700
|
var Qn = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1861
1701
|
var e = t.interactStatic, n = t.defaults;
|
|
1862
|
-
t.usePlugin(Kn), n.base.actionChecker = null, n.base.styleCursor = !0,
|
|
1702
|
+
t.usePlugin(Kn), n.base.actionChecker = null, n.base.styleCursor = !0, z(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
|
|
1863
1703
|
return ln(r, t);
|
|
1864
|
-
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit:
|
|
1704
|
+
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: st, cursorElement: null };
|
|
1865
1705
|
}, listeners: { "interactions:down": function(t, e) {
|
|
1866
1706
|
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget;
|
|
1867
1707
|
n.interacting() || sn(n, an(n, r, o, i, e), e);
|
|
@@ -1874,34 +1714,34 @@ function Uo() {
|
|
|
1874
1714
|
if (o.pointerIsDown && !o.interacting() && o.pointerWasMoved && o.prepared.name) {
|
|
1875
1715
|
r.fire("autoStart:before-start", n);
|
|
1876
1716
|
var i = o.interactable, a = o.prepared.name;
|
|
1877
|
-
a && i && (i.options[a].manualStart || !
|
|
1717
|
+
a && i && (i.options[a].manualStart || !st(i, o.element, o.prepared, r) ? o.stop() : (o.start(o.prepared, i, o.element), cn(o, r)));
|
|
1878
1718
|
}
|
|
1879
1719
|
})(t, e);
|
|
1880
1720
|
}, "interactions:stop": function(t, e) {
|
|
1881
1721
|
var n = t.interaction, r = n.interactable;
|
|
1882
|
-
r && r.options.styleCursor &&
|
|
1883
|
-
} }, maxInteractions: ln, withinInteractionLimit:
|
|
1722
|
+
r && r.options.styleCursor && At(n.element, "", e);
|
|
1723
|
+
} }, maxInteractions: ln, withinInteractionLimit: st, validateAction: on }, Mt = Qn, Zn = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
|
|
1884
1724
|
var n = t.interaction, r = t.eventTarget, o = t.dx, i = t.dy;
|
|
1885
1725
|
if (n.prepared.name === "drag") {
|
|
1886
1726
|
var a = Math.abs(o), s = Math.abs(i), l = n.interactable.options.drag, d = l.startAxis, c = a > s ? "x" : a < s ? "y" : "xy";
|
|
1887
1727
|
if (n.prepared.axis = l.lockAxis === "start" ? c[0] : l.lockAxis, c !== "xy" && d !== "xy" && d !== c) {
|
|
1888
1728
|
n.prepared.name = null;
|
|
1889
|
-
for (var f = r,
|
|
1729
|
+
for (var f = r, b = function(C) {
|
|
1890
1730
|
if (C !== n.interactable) {
|
|
1891
1731
|
var M = n.interactable.options.drag;
|
|
1892
1732
|
if (!M.manualStart && C.testIgnoreAllow(M, f, r)) {
|
|
1893
|
-
var
|
|
1894
|
-
if (
|
|
1895
|
-
if (!
|
|
1896
|
-
var
|
|
1897
|
-
return
|
|
1898
|
-
})(c, C) && Mt.validateAction(
|
|
1733
|
+
var D = C.getAction(n.downPointer, n.downEvent, n, f);
|
|
1734
|
+
if (D && D.name === "drag" && (function(O, F) {
|
|
1735
|
+
if (!F) return !1;
|
|
1736
|
+
var U = F.options.drag.startAxis;
|
|
1737
|
+
return O === "xy" || U === "xy" || U === O;
|
|
1738
|
+
})(c, C) && Mt.validateAction(D, C, f, r, e)) return C;
|
|
1899
1739
|
}
|
|
1900
1740
|
}
|
|
1901
|
-
};
|
|
1902
|
-
var
|
|
1903
|
-
if (
|
|
1904
|
-
n.prepared.name = "drag", n.interactable =
|
|
1741
|
+
}; x.element(f); ) {
|
|
1742
|
+
var S = e.interactables.forEachMatch(f, b);
|
|
1743
|
+
if (S) {
|
|
1744
|
+
n.prepared.name = "drag", n.interactable = S, n.element = f;
|
|
1905
1745
|
break;
|
|
1906
1746
|
}
|
|
1907
1747
|
f = fe(f);
|
|
@@ -1934,7 +1774,7 @@ function Uo() {
|
|
|
1934
1774
|
} }, getHoldDuration: Rt }, tr = er, nr = { id: "auto-start", install: function(t) {
|
|
1935
1775
|
t.usePlugin(Mt), t.usePlugin(tr), t.usePlugin(Zn);
|
|
1936
1776
|
} }, rr = function(t) {
|
|
1937
|
-
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) :
|
|
1777
|
+
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : x.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault;
|
|
1938
1778
|
};
|
|
1939
1779
|
function or(t) {
|
|
1940
1780
|
var e = t.interaction, n = t.event;
|
|
@@ -1947,10 +1787,10 @@ function Uo() {
|
|
|
1947
1787
|
var a = r.options.preventDefault;
|
|
1948
1788
|
if (a !== "never") if (a !== "always") {
|
|
1949
1789
|
if (o.events.supportsPassive && /^touch(start|move)$/.test(i.type)) {
|
|
1950
|
-
var s =
|
|
1790
|
+
var s = Z(i.target).document, l = o.getDocOptions(s);
|
|
1951
1791
|
if (!l || !l.events || l.events.passive !== !1) return;
|
|
1952
1792
|
}
|
|
1953
|
-
/^(mouse|pointer|touch)*(down|start)/i.test(i.type) ||
|
|
1793
|
+
/^(mouse|pointer|touch)*(down|start)/i.test(i.type) || x.element(i.target) && he(i.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || i.preventDefault();
|
|
1954
1794
|
} else i.preventDefault();
|
|
1955
1795
|
})(this, t, n);
|
|
1956
1796
|
}, t.interactions.docEvents.push({ type: "dragstart", listener: function(n) {
|
|
@@ -1962,7 +1802,7 @@ function Uo() {
|
|
|
1962
1802
|
}, listeners: ["down", "move", "up", "cancel"].reduce((function(t, e) {
|
|
1963
1803
|
return t["interactions:".concat(e)] = or, t;
|
|
1964
1804
|
}), {}) };
|
|
1965
|
-
function
|
|
1805
|
+
function lt(t, e) {
|
|
1966
1806
|
if (e.phaselessTypes[t]) return !0;
|
|
1967
1807
|
for (var n in e.map) if (t.indexOf(n) === 0 && t.substr(n.length) in e.phases) return !0;
|
|
1968
1808
|
return !1;
|
|
@@ -1971,27 +1811,27 @@ function Uo() {
|
|
|
1971
1811
|
var e = {};
|
|
1972
1812
|
for (var n in t) {
|
|
1973
1813
|
var r = t[n];
|
|
1974
|
-
|
|
1814
|
+
x.plainObject(r) ? e[n] = Ne(r) : x.array(r) ? e[n] = Gt(r) : e[n] = r;
|
|
1975
1815
|
}
|
|
1976
1816
|
return e;
|
|
1977
1817
|
}
|
|
1978
|
-
var
|
|
1818
|
+
var It = (function() {
|
|
1979
1819
|
function t(e) {
|
|
1980
|
-
|
|
1820
|
+
y(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 = ct(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1981
1821
|
}
|
|
1982
|
-
return
|
|
1822
|
+
return g(t, [{ key: "start", value: function(e, n) {
|
|
1983
1823
|
var r, o, i = e.phase, a = this.interaction, s = (function(d) {
|
|
1984
1824
|
var c = d.interactable.options[d.prepared.name], f = c.modifiers;
|
|
1985
|
-
return f && f.length ? f : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(
|
|
1986
|
-
var
|
|
1987
|
-
return
|
|
1988
|
-
})).filter((function(
|
|
1989
|
-
return !!
|
|
1825
|
+
return f && f.length ? f : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(b) {
|
|
1826
|
+
var S = c[b];
|
|
1827
|
+
return S && S.enabled && { options: S, methods: S._methods };
|
|
1828
|
+
})).filter((function(b) {
|
|
1829
|
+
return !!b;
|
|
1990
1830
|
}));
|
|
1991
1831
|
})(a);
|
|
1992
|
-
this.prepareStates(s), this.startEdges =
|
|
1832
|
+
this.prepareStates(s), this.startEdges = z({}, a.edges), this.edges = z({}, 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 };
|
|
1993
1833
|
var l = this.fillArg({ phase: i, pageCoords: n, preEnd: !1 });
|
|
1994
|
-
return this.result =
|
|
1834
|
+
return this.result = ct(), this.startAll(l), this.result = this.setAll(l);
|
|
1995
1835
|
} }, { key: "fillArg", value: function(e) {
|
|
1996
1836
|
var n = this.interaction;
|
|
1997
1837
|
return e.interaction = n, e.interactable = n.interactable, e.element = n.element, e.rect || (e.rect = n.rect), e.edges || (e.edges = this.startEdges), e.startOffset = this.startOffset, e;
|
|
@@ -2002,24 +1842,24 @@ function Uo() {
|
|
|
2002
1842
|
}
|
|
2003
1843
|
} }, { key: "setAll", value: function(e) {
|
|
2004
1844
|
var n = e.phase, r = e.preEnd, o = e.skipModifiers, i = e.rect, a = e.edges;
|
|
2005
|
-
e.coords =
|
|
2006
|
-
for (var s = o ? this.states.slice(o) : this.states, l =
|
|
2007
|
-
var c, f = s[d],
|
|
2008
|
-
(c = f.methods) != null && c.set && this.shouldDo(
|
|
1845
|
+
e.coords = z({}, e.pageCoords), e.rect = z({}, i), e.edges = z({}, a);
|
|
1846
|
+
for (var s = o ? this.states.slice(o) : this.states, l = ct(e.coords, e.rect), d = 0; d < s.length; d++) {
|
|
1847
|
+
var c, f = s[d], b = f.options, S = z({}, e.coords), C = null;
|
|
1848
|
+
(c = f.methods) != null && c.set && this.shouldDo(b, r, n) && (e.state = f, C = f.methods.set(e), nt(e.edges, e.rect, { x: e.coords.x - S.x, y: e.coords.y - S.y })), l.eventProps.push(C);
|
|
2009
1849
|
}
|
|
2010
|
-
|
|
2011
|
-
var M = this.result.coords,
|
|
2012
|
-
if (M &&
|
|
2013
|
-
var
|
|
2014
|
-
l.changed =
|
|
1850
|
+
z(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;
|
|
1851
|
+
var M = this.result.coords, D = this.result.rect;
|
|
1852
|
+
if (M && D) {
|
|
1853
|
+
var O = l.rect.left !== D.left || l.rect.right !== D.right || l.rect.top !== D.top || l.rect.bottom !== D.bottom;
|
|
1854
|
+
l.changed = O || M.x !== l.coords.x || M.y !== l.coords.y;
|
|
2015
1855
|
}
|
|
2016
1856
|
return l;
|
|
2017
1857
|
} }, { key: "applyToInteraction", value: function(e) {
|
|
2018
1858
|
var n = this.interaction, r = e.phase, o = n.coords.cur, i = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
|
|
2019
|
-
r === "start" &&
|
|
1859
|
+
r === "start" && z(this.startDelta, a.delta);
|
|
2020
1860
|
for (var d = 0, c = [[i, s], [o, l]]; d < c.length; d++) {
|
|
2021
|
-
var f = c[d],
|
|
2022
|
-
|
|
1861
|
+
var f = c[d], b = f[0], S = f[1];
|
|
1862
|
+
b.page.x += S.x, b.page.y += S.y, b.client.x += S.x, b.client.y += S.y;
|
|
2023
1863
|
}
|
|
2024
1864
|
var C = this.result.rectDelta, M = e.rect || n.rect;
|
|
2025
1865
|
M.left += C.left, M.right += C.right, M.top += C.top, M.bottom += C.bottom, M.width = M.right - M.left, M.height = M.bottom - M.top;
|
|
@@ -2046,7 +1886,7 @@ function Uo() {
|
|
|
2046
1886
|
} }, { key: "stop", value: function(e) {
|
|
2047
1887
|
var n = e.interaction;
|
|
2048
1888
|
if (this.states && this.states.length) {
|
|
2049
|
-
var r =
|
|
1889
|
+
var r = z({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
|
|
2050
1890
|
this.fillArg(r);
|
|
2051
1891
|
for (var o = 0, i = this.states; o < i.length; o++) {
|
|
2052
1892
|
var a = i[o];
|
|
@@ -2065,8 +1905,8 @@ function Uo() {
|
|
|
2065
1905
|
var n = e.interaction, r = n.coords, o = n.rect, i = n.modification;
|
|
2066
1906
|
if (i.result) {
|
|
2067
1907
|
for (var a = i.startDelta, s = i.result, l = s.delta, d = s.rectDelta, c = 0, f = [[r.start, a], [r.cur, l]]; c < f.length; c++) {
|
|
2068
|
-
var
|
|
2069
|
-
|
|
1908
|
+
var b = f[c], S = b[0], C = b[1];
|
|
1909
|
+
S.page.x -= C.x, S.page.y -= C.y, S.client.x -= C.x, S.client.y -= C.y;
|
|
2070
1910
|
}
|
|
2071
1911
|
o.left -= d.left, o.right -= d.right, o.top -= d.top, o.bottom -= d.bottom;
|
|
2072
1912
|
}
|
|
@@ -2075,12 +1915,12 @@ function Uo() {
|
|
|
2075
1915
|
} }, { key: "copyFrom", value: function(e) {
|
|
2076
1916
|
this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map((function(n) {
|
|
2077
1917
|
return Ne(n);
|
|
2078
|
-
})), this.result =
|
|
1918
|
+
})), this.result = ct(z({}, e.result.coords), z({}, e.result.rect));
|
|
2079
1919
|
} }, { key: "destroy", value: function() {
|
|
2080
1920
|
for (var e in this) this[e] = null;
|
|
2081
1921
|
} }]), t;
|
|
2082
1922
|
})();
|
|
2083
|
-
function
|
|
1923
|
+
function ct(t, e) {
|
|
2084
1924
|
return { rect: e, coords: t, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
|
|
2085
1925
|
}
|
|
2086
1926
|
function _e(t, e) {
|
|
@@ -2104,7 +1944,7 @@ function Uo() {
|
|
|
2104
1944
|
t.defaults.perAction.modifiers = [];
|
|
2105
1945
|
}, listeners: { "interactions:new": function(t) {
|
|
2106
1946
|
var e = t.interaction;
|
|
2107
|
-
e.modification = new
|
|
1947
|
+
e.modification = new It(e);
|
|
2108
1948
|
}, "interactions:before-action-start": function(t) {
|
|
2109
1949
|
var e = t.interaction, n = t.interaction.modification;
|
|
2110
1950
|
n.start(t, e.coords.start.page), e.edges = n.edges, n.applyToInteraction(t);
|
|
@@ -2120,16 +1960,16 @@ function Uo() {
|
|
|
2120
1960
|
return t.interaction.modification.restoreInteractionCoords(t);
|
|
2121
1961
|
}, "interactions:stop": function(t) {
|
|
2122
1962
|
return t.interaction.modification.stop(t);
|
|
2123
|
-
} } }, dn = ir, pn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} },
|
|
2124
|
-
|
|
2125
|
-
var e =
|
|
1963
|
+
} } }, dn = ir, pn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, Pt = (function(t) {
|
|
1964
|
+
A(n, t);
|
|
1965
|
+
var e = R(n);
|
|
2126
1966
|
function n(r, o, i, a, s, l, d) {
|
|
2127
1967
|
var c;
|
|
2128
|
-
|
|
2129
|
-
var f = r.interactable,
|
|
2130
|
-
return c.page =
|
|
1968
|
+
y(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;
|
|
1969
|
+
var f = r.interactable, b = (f && f.options || pn).deltaSource, S = ze(f, s, i), C = a === "start", M = a === "end", D = C ? I(c) : r.prevEvent, O = C ? r.coords.start : M ? { page: D.page, client: D.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1970
|
+
return c.page = z({}, O.page), c.client = z({}, O.client), c.rect = z({}, r.rect), c.timeStamp = O.timeStamp, M || (c.page.x -= S.x, c.page.y -= S.y, c.client.x -= S.x, c.client.y -= S.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 = d || i + (a || ""), c.interactable = f, c.t0 = C ? r.pointers[r.pointers.length - 1].downTime : D.t0, c.x0 = r.coords.start.page.x - S.x, c.y0 = r.coords.start.page.y - S.y, c.clientX0 = r.coords.start.client.x - S.x, c.clientY0 = r.coords.start.client.y - S.y, c.delta = C || M ? { x: 0, y: 0 } : { x: c[b].x - D[b].x, y: c[b].y - D[b].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = z({}, r.coords.velocity[b]), c.speed = Fe(c.velocity.x, c.velocity.y), c.swipe = M || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
2131
1971
|
}
|
|
2132
|
-
return
|
|
1972
|
+
return g(n, [{ key: "getSwipe", value: function() {
|
|
2133
1973
|
var r = this._interaction;
|
|
2134
1974
|
if (r.prevEvent.speed < 600 || this.timeStamp - r.prevEvent.timeStamp > 150) return null;
|
|
2135
1975
|
var o = 180 * Math.atan2(r.prevEvent.velocityY, r.prevEvent.velocityX) / Math.PI;
|
|
@@ -2142,8 +1982,8 @@ function Uo() {
|
|
|
2142
1982
|
} }, { key: "stopPropagation", value: function() {
|
|
2143
1983
|
this.propagationStopped = !0;
|
|
2144
1984
|
} }]), n;
|
|
2145
|
-
})(
|
|
2146
|
-
Object.defineProperties(
|
|
1985
|
+
})(at);
|
|
1986
|
+
Object.defineProperties(Pt.prototype, { pageX: { get: function() {
|
|
2147
1987
|
return this.page.x;
|
|
2148
1988
|
}, set: function(t) {
|
|
2149
1989
|
this.page.x = t;
|
|
@@ -2176,8 +2016,8 @@ function Uo() {
|
|
|
2176
2016
|
}, set: function(t) {
|
|
2177
2017
|
this.velocity.y = t;
|
|
2178
2018
|
} } });
|
|
2179
|
-
var ar =
|
|
2180
|
-
|
|
2019
|
+
var ar = g((function t(e, n, r, o, i) {
|
|
2020
|
+
y(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;
|
|
2181
2021
|
})), sr = (function(t) {
|
|
2182
2022
|
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
2183
2023
|
})({}), fn = (function(t) {
|
|
@@ -2185,7 +2025,7 @@ function Uo() {
|
|
|
2185
2025
|
})({}), lr = 0, cr = (function() {
|
|
2186
2026
|
function t(e) {
|
|
2187
2027
|
var n = this, r = e.pointerType, o = e.scopeFire;
|
|
2188
|
-
|
|
2028
|
+
y(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) {
|
|
2189
2029
|
this.move(c);
|
|
2190
2030
|
}), "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 = lr++, this._scopeFire = o, this.pointerType = r;
|
|
2191
2031
|
var i = this;
|
|
@@ -2204,21 +2044,21 @@ function Uo() {
|
|
|
2204
2044
|
for (var d in fn) l(d);
|
|
2205
2045
|
this._scopeFire("interactions:new", { interaction: this });
|
|
2206
2046
|
}
|
|
2207
|
-
return
|
|
2047
|
+
return g(t, [{ key: "pointerMoveTolerance", get: function() {
|
|
2208
2048
|
return 1;
|
|
2209
2049
|
} }, { key: "pointerDown", value: function(e, n, r) {
|
|
2210
2050
|
var o = this.updatePointer(e, n, r, !0), i = this.pointers[o];
|
|
2211
2051
|
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: o, pointerInfo: i, type: "down", interaction: this });
|
|
2212
2052
|
} }, { key: "start", value: function(e, n, r) {
|
|
2213
|
-
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (
|
|
2053
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (_t(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? z({}, 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);
|
|
2214
2054
|
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
2215
2055
|
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
2216
2056
|
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;
|
|
2217
2057
|
this.pointerIsDown && !this.pointerWasMoved && (o = this.coords.cur.client.x - this.coords.start.client.x, i = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Fe(o, i) > this.pointerMoveTolerance);
|
|
2218
2058
|
var s, l, d, c = this.getPointerIndex(e), f = { pointer: e, pointerIndex: c, pointerInfo: this.pointers[c], event: n, type: "move", eventTarget: r, dx: o, dy: i, duplicate: a, interaction: this };
|
|
2219
|
-
a || (s = this.coords.velocity, l = this.coords.delta, d = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / d, s.page.y = l.page.y / d, s.client.x = l.client.x / d, s.client.y = l.client.y / d, s.timeStamp = d), this._scopeFire("interactions:move", f), a || this.simulation || (this.interacting() && (f.type = null, this.move(f)), this.pointerWasMoved &&
|
|
2059
|
+
a || (s = this.coords.velocity, l = this.coords.delta, d = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / d, s.page.y = l.page.y / d, s.client.x = l.client.x / d, s.client.y = l.client.y / d, s.timeStamp = d), this._scopeFire("interactions:move", f), a || this.simulation || (this.interacting() && (f.type = null, this.move(f)), this.pointerWasMoved && ot(this.coords.prev, this.coords.cur));
|
|
2220
2060
|
} }, { key: "move", value: function(e) {
|
|
2221
|
-
e && e.event || qt(this.coords.delta), (e =
|
|
2061
|
+
e && e.event || qt(this.coords.delta), (e = z({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
2222
2062
|
} }, { key: "pointerUp", value: function(e, n, r, o) {
|
|
2223
2063
|
var i = this.getPointerIndex(e);
|
|
2224
2064
|
i === -1 && (i = this.updatePointer(e, n, r, !1));
|
|
@@ -2246,7 +2086,7 @@ function Uo() {
|
|
|
2246
2086
|
var i, a, s, l = je(e), d = this.getPointerIndex(e), c = this.pointers[d];
|
|
2247
2087
|
return o = o !== !1 && (o || /(down|start)$/i.test(n.type)), c ? c.pointer = e : (c = new ar(l, e, n, null, null), d = this.pointers.length, this.pointers.push(c)), Hn(this.coords.cur, this.pointers.map((function(f) {
|
|
2248
2088
|
return f.pointer;
|
|
2249
|
-
})), this._now()), i = this.coords.delta, a = this.coords.prev, s = this.coords.cur, i.page.x = s.page.x - a.page.x, i.page.y = s.page.y - a.page.y, i.client.x = s.client.x - a.client.x, i.client.y = s.client.y - a.client.y, i.timeStamp = s.timeStamp - a.timeStamp, o && (this.pointerIsDown = !0, c.downTime = this.coords.cur.timeStamp, c.downTarget = r,
|
|
2089
|
+
})), this._now()), i = this.coords.delta, a = this.coords.prev, s = this.coords.cur, i.page.x = s.page.x - a.page.x, i.page.y = s.page.y - a.page.y, i.client.x = s.client.x - a.client.x, i.client.y = s.client.y - a.client.y, i.timeStamp = s.timeStamp - a.timeStamp, o && (this.pointerIsDown = !0, c.downTime = this.coords.cur.timeStamp, c.downTarget = r, rt(this.downPointer, e), this.interacting() || (ot(this.coords.start, this.coords.cur), ot(this.coords.prev, this.coords.cur), this.downEvent = n, this.pointerWasMoved = !1)), this._updateLatestPointer(e, n, r), this._scopeFire("interactions:update-pointer", { pointer: e, event: n, eventTarget: r, down: o, pointerInfo: c, pointerIndex: d, interaction: this }), d;
|
|
2250
2090
|
} }, { key: "removePointer", value: function(e, n) {
|
|
2251
2091
|
var r = this.getPointerIndex(e);
|
|
2252
2092
|
if (r !== -1) {
|
|
@@ -2258,13 +2098,13 @@ function Uo() {
|
|
|
2258
2098
|
} }, { key: "destroy", value: function() {
|
|
2259
2099
|
this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
|
|
2260
2100
|
} }, { key: "_createPreparedEvent", value: function(e, n, r, o) {
|
|
2261
|
-
return new
|
|
2101
|
+
return new Pt(this, e, this.prepared.name, n, this.element, r, o);
|
|
2262
2102
|
} }, { key: "_fireEvent", value: function(e) {
|
|
2263
2103
|
var n;
|
|
2264
2104
|
(n = this.interactable) == null || n.fire(e), (!this.prevEvent || e.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = e);
|
|
2265
2105
|
} }, { key: "_doPhase", value: function(e) {
|
|
2266
2106
|
var n = e.event, r = e.phase, o = e.preEnd, i = e.type, a = this.rect;
|
|
2267
|
-
if (a && r === "move" && (
|
|
2107
|
+
if (a && r === "move" && (nt(this.edges, a, this.coords.delta[this.interactable.options.deltaSource]), a.width = a.right - a.left, a.height = a.bottom - a.top), this._scopeFire("interactions:before-action-".concat(r), e) === !1) return !1;
|
|
2268
2108
|
var s = e.iEvent = this._createPreparedEvent(n, r, o, i);
|
|
2269
2109
|
return this._scopeFire("interactions:action-".concat(r), e), r === "start" && (this.prevEvent = s), this._fireEvent(s), this._scopeFire("interactions:after-action-".concat(r), e), !0;
|
|
2270
2110
|
} }, { key: "_now", value: function() {
|
|
@@ -2272,20 +2112,20 @@ function Uo() {
|
|
|
2272
2112
|
} }]), t;
|
|
2273
2113
|
})();
|
|
2274
2114
|
function hn(t) {
|
|
2275
|
-
|
|
2115
|
+
mn(t.interaction);
|
|
2276
2116
|
}
|
|
2277
|
-
function
|
|
2117
|
+
function mn(t) {
|
|
2278
2118
|
if (!(function(n) {
|
|
2279
2119
|
return !(!n.offset.pending.x && !n.offset.pending.y);
|
|
2280
2120
|
})(t)) return !1;
|
|
2281
2121
|
var e = t.offset.pending;
|
|
2282
|
-
return
|
|
2122
|
+
return Ot(t.coords.cur, e), Ot(t.coords.delta, e), nt(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
|
|
2283
2123
|
}
|
|
2284
2124
|
function ur(t) {
|
|
2285
2125
|
var e = t.x, n = t.y;
|
|
2286
2126
|
this.offset.pending.x += e, this.offset.pending.y += n, this.offset.total.x += e, this.offset.total.y += n;
|
|
2287
2127
|
}
|
|
2288
|
-
function
|
|
2128
|
+
function Ot(t, e) {
|
|
2289
2129
|
var n = t.page, r = t.client, o = e.x, i = e.y;
|
|
2290
2130
|
n.x += o, n.y += i, r.x += o, r.y += i;
|
|
2291
2131
|
}
|
|
@@ -2296,22 +2136,22 @@ function Uo() {
|
|
|
2296
2136
|
t.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
|
|
2297
2137
|
}, "interactions:update-pointer": function(t) {
|
|
2298
2138
|
return (function(e) {
|
|
2299
|
-
e.pointerIsDown && (
|
|
2139
|
+
e.pointerIsDown && (Ot(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
|
|
2300
2140
|
})(t.interaction);
|
|
2301
2141
|
}, "interactions:before-action-start": hn, "interactions:before-action-move": hn, "interactions:before-action-end": function(t) {
|
|
2302
2142
|
var e = t.interaction;
|
|
2303
|
-
if (
|
|
2143
|
+
if (mn(e)) return e.move({ offset: !0 }), e.end(), !1;
|
|
2304
2144
|
}, "interactions:stop": function(t) {
|
|
2305
2145
|
var e = t.interaction;
|
|
2306
2146
|
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
2307
|
-
} } },
|
|
2147
|
+
} } }, vn = dr, pr = (function() {
|
|
2308
2148
|
function t(e) {
|
|
2309
|
-
|
|
2149
|
+
y(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;
|
|
2310
2150
|
}
|
|
2311
|
-
return
|
|
2312
|
-
var n = this.interaction, r =
|
|
2151
|
+
return g(t, [{ key: "start", value: function(e) {
|
|
2152
|
+
var n = this.interaction, r = ut(n);
|
|
2313
2153
|
if (!r || !r.enabled) return !1;
|
|
2314
|
-
var o = n.coords.velocity.client, i = Fe(o.x, o.y), a = this.modification || (this.modification = new
|
|
2154
|
+
var o = n.coords.velocity.client, i = Fe(o.x, o.y), a = this.modification || (this.modification = new It(n));
|
|
2315
2155
|
if (a.copyFrom(n.modification), this.t0 = n._now(), this.allowResume = r.allowResume, this.v0 = i, this.currentOffset = { x: 0, y: 0 }, this.startCoords = n.coords.cur.page, this.modifierArg = a.fillArg({ pageCoords: this.startCoords, preEnd: !0, phase: "inertiastart" }), this.t0 - n.coords.cur.timeStamp < 50 && i > r.minSpeed && i > r.endSpeed) this.startInertia();
|
|
2316
2156
|
else {
|
|
2317
2157
|
if (a.result = a.setAll(this.modifierArg), !a.result.changed) return !1;
|
|
@@ -2319,7 +2159,7 @@ function Uo() {
|
|
|
2319
2159
|
}
|
|
2320
2160
|
return n.modification.result.rect = null, n.offsetBy(this.targetOffset), n._doPhase({ interaction: n, event: e, phase: "inertiastart" }), n.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), n.modification.result.rect = null, this.active = !0, n.simulation = this, !0;
|
|
2321
2161
|
} }, { key: "startInertia", value: function() {
|
|
2322
|
-
var e = this, n = this.interaction.coords.velocity.client, r =
|
|
2162
|
+
var e = this, n = this.interaction.coords.velocity.client, r = ut(this.interaction), o = r.resistance, i = -Math.log(r.endSpeed / this.v0) / o;
|
|
2323
2163
|
this.targetOffset = { x: (n.x - i) / o, y: (n.y - i) / o }, this.te = i, this.lambda_v0 = o / this.v0, this.one_ve_v0 = 1 - r.endSpeed / this.v0;
|
|
2324
2164
|
var a = this.modification, s = this.modifierArg;
|
|
2325
2165
|
s.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, a.result = a.setAll(s), a.result.changed && (this.isModified = !0, this.modifiedOffset = { x: this.targetOffset.x + a.result.delta.x, y: this.targetOffset.y + a.result.delta.y }), this.onNextFrame((function() {
|
|
@@ -2336,17 +2176,17 @@ function Uo() {
|
|
|
2336
2176
|
n.active && e();
|
|
2337
2177
|
}));
|
|
2338
2178
|
} }, { key: "inertiaTick", value: function() {
|
|
2339
|
-
var e, n, r, o, i, a, s, l = this, d = this.interaction, c =
|
|
2179
|
+
var e, n, r, o, i, a, s, l = this, d = this.interaction, c = ut(d).resistance, f = (d._now() - this.t0) / 1e3;
|
|
2340
2180
|
if (f < this.te) {
|
|
2341
|
-
var
|
|
2342
|
-
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y,
|
|
2343
|
-
var C = { x:
|
|
2181
|
+
var b, S = 1 - (Math.exp(-c * f) - this.lambda_v0) / this.one_ve_v0;
|
|
2182
|
+
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, b = { x: gn(s = S, e, r, i), y: gn(s, n, o, a) }) : b = { x: this.targetOffset.x * S, y: this.targetOffset.y * S };
|
|
2183
|
+
var C = { x: b.x - this.currentOffset.x, y: b.y - this.currentOffset.y };
|
|
2344
2184
|
this.currentOffset.x += C.x, this.currentOffset.y += C.y, d.offsetBy(C), d.move(), this.onNextFrame((function() {
|
|
2345
2185
|
return l.inertiaTick();
|
|
2346
2186
|
}));
|
|
2347
2187
|
} else d.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
|
|
2348
2188
|
} }, { key: "smoothEndTick", value: function() {
|
|
2349
|
-
var e = this, n = this.interaction, r = n._now() - this.t0, o =
|
|
2189
|
+
var e = this, n = this.interaction, r = n._now() - this.t0, o = ut(n).smoothEndDuration;
|
|
2350
2190
|
if (r < o) {
|
|
2351
2191
|
var i = { x: yn(r, 0, this.targetOffset.x, o), y: yn(r, 0, this.targetOffset.y, o) }, a = { x: i.x - this.currentOffset.x, y: i.y - this.currentOffset.y };
|
|
2352
2192
|
this.currentOffset.x += a.x, this.currentOffset.y += a.y, n.offsetBy(a), n.move({ skipModifiers: this.modifierCount }), this.onNextFrame((function() {
|
|
@@ -2355,20 +2195,20 @@ function Uo() {
|
|
|
2355
2195
|
} else n.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
|
|
2356
2196
|
} }, { key: "resume", value: function(e) {
|
|
2357
2197
|
var n = e.pointer, r = e.event, o = e.eventTarget, i = this.interaction;
|
|
2358
|
-
i.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i.updatePointer(n, r, o, !0), i._doPhase({ interaction: i, event: r, phase: "resume" }),
|
|
2198
|
+
i.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i.updatePointer(n, r, o, !0), i._doPhase({ interaction: i, event: r, phase: "resume" }), ot(i.coords.prev, i.coords.cur), this.stop();
|
|
2359
2199
|
} }, { key: "end", value: function() {
|
|
2360
2200
|
this.interaction.move(), this.interaction.end(), this.stop();
|
|
2361
2201
|
} }, { key: "stop", value: function() {
|
|
2362
2202
|
this.active = this.smoothEnd = !1, this.interaction.simulation = null, Te.cancel(this.timeout);
|
|
2363
2203
|
} }]), t;
|
|
2364
2204
|
})();
|
|
2365
|
-
function
|
|
2205
|
+
function ut(t) {
|
|
2366
2206
|
var e = t.interactable, n = t.prepared;
|
|
2367
2207
|
return e && e.options && n.name && e.options[n.name].inertia;
|
|
2368
2208
|
}
|
|
2369
2209
|
var fr = { id: "inertia", before: ["modifiers", "actions"], install: function(t) {
|
|
2370
2210
|
var e = t.defaults;
|
|
2371
|
-
t.usePlugin(
|
|
2211
|
+
t.usePlugin(vn), t.usePlugin(dn), t.actions.phases.inertiastart = !0, t.actions.phases.resume = !0, e.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
|
|
2372
2212
|
}, listeners: { "interactions:new": function(t) {
|
|
2373
2213
|
var e = t.interaction;
|
|
2374
2214
|
e.inertia = new pr(e);
|
|
@@ -2377,7 +2217,7 @@ function Uo() {
|
|
|
2377
2217
|
return (!e._interacting || e.simulation || !e.inertia.start(n)) && null;
|
|
2378
2218
|
}, "interactions:down": function(t) {
|
|
2379
2219
|
var e = t.interaction, n = t.eventTarget, r = e.inertia;
|
|
2380
|
-
if (r.active) for (var o = n;
|
|
2220
|
+
if (r.active) for (var o = n; x.element(o); ) {
|
|
2381
2221
|
if (o === e.element) {
|
|
2382
2222
|
r.resume(t);
|
|
2383
2223
|
break;
|
|
@@ -2414,9 +2254,9 @@ function Uo() {
|
|
|
2414
2254
|
}
|
|
2415
2255
|
var xn = (function() {
|
|
2416
2256
|
function t(e) {
|
|
2417
|
-
|
|
2257
|
+
y(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = z({}, e || {});
|
|
2418
2258
|
}
|
|
2419
|
-
return
|
|
2259
|
+
return g(t, [{ key: "fire", value: function(e) {
|
|
2420
2260
|
var n, r = this.global;
|
|
2421
2261
|
(n = this.types[e.type]) && bn(e, n), !e.propagationStopped && r && (n = r[e.type]) && bn(e, n);
|
|
2422
2262
|
} }, { key: "on", value: function(e, n) {
|
|
@@ -2434,11 +2274,11 @@ function Uo() {
|
|
|
2434
2274
|
} }, { key: "getRect", value: function(e) {
|
|
2435
2275
|
return null;
|
|
2436
2276
|
} }]), t;
|
|
2437
|
-
})(),
|
|
2277
|
+
})(), mr = (function() {
|
|
2438
2278
|
function t(e) {
|
|
2439
|
-
|
|
2279
|
+
y(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, rt(this, e);
|
|
2440
2280
|
}
|
|
2441
|
-
return
|
|
2281
|
+
return g(t, [{ key: "preventOriginalDefault", value: function() {
|
|
2442
2282
|
this.originalEvent.preventDefault();
|
|
2443
2283
|
} }, { key: "stopPropagation", value: function() {
|
|
2444
2284
|
this.originalEvent.stopPropagation();
|
|
@@ -2447,93 +2287,93 @@ function Uo() {
|
|
|
2447
2287
|
} }]), t;
|
|
2448
2288
|
})();
|
|
2449
2289
|
function Ye(t) {
|
|
2450
|
-
return
|
|
2290
|
+
return x.object(t) ? { capture: !!t.capture, passive: !!t.passive } : { capture: !!t, passive: !1 };
|
|
2451
2291
|
}
|
|
2452
|
-
function
|
|
2292
|
+
function dt(t, e) {
|
|
2453
2293
|
return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
|
|
2454
2294
|
}
|
|
2455
|
-
var
|
|
2456
|
-
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f,
|
|
2295
|
+
var vr = { id: "events", install: function(t) {
|
|
2296
|
+
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f, b, S, C) {
|
|
2457
2297
|
var M = Ye(C);
|
|
2458
|
-
if (!r[
|
|
2459
|
-
r[
|
|
2460
|
-
for (var
|
|
2461
|
-
var
|
|
2462
|
-
a(
|
|
2298
|
+
if (!r[b]) {
|
|
2299
|
+
r[b] = [];
|
|
2300
|
+
for (var D = 0; D < o.length; D++) {
|
|
2301
|
+
var O = o[D];
|
|
2302
|
+
a(O, b, l), a(O, b, d, !0);
|
|
2463
2303
|
}
|
|
2464
2304
|
}
|
|
2465
|
-
var
|
|
2466
|
-
return
|
|
2305
|
+
var F = r[b], U = Be(F, (function(ee) {
|
|
2306
|
+
return ee.selector === c && ee.context === f;
|
|
2467
2307
|
}));
|
|
2468
|
-
|
|
2469
|
-
}, removeDelegate: function(c, f,
|
|
2470
|
-
var M,
|
|
2471
|
-
if (
|
|
2472
|
-
for (M =
|
|
2473
|
-
var
|
|
2474
|
-
if (
|
|
2475
|
-
for (var
|
|
2476
|
-
var
|
|
2477
|
-
if (
|
|
2478
|
-
|
|
2308
|
+
U || (U = { selector: c, context: f, listeners: [] }, F.push(U)), U.listeners.push({ func: S, options: M });
|
|
2309
|
+
}, removeDelegate: function(c, f, b, S, C) {
|
|
2310
|
+
var M, D = Ye(C), O = r[b], F = !1;
|
|
2311
|
+
if (O)
|
|
2312
|
+
for (M = O.length - 1; M >= 0; M--) {
|
|
2313
|
+
var U = O[M];
|
|
2314
|
+
if (U.selector === c && U.context === f) {
|
|
2315
|
+
for (var ee = U.listeners, q = ee.length - 1; q >= 0; q--) {
|
|
2316
|
+
var K = ee[q];
|
|
2317
|
+
if (K.func === S && dt(K.options, D)) {
|
|
2318
|
+
ee.splice(q, 1), ee.length || (O.splice(M, 1), s(f, b, l), s(f, b, d, !0)), F = !0;
|
|
2479
2319
|
break;
|
|
2480
2320
|
}
|
|
2481
2321
|
}
|
|
2482
|
-
if (
|
|
2322
|
+
if (F) break;
|
|
2483
2323
|
}
|
|
2484
2324
|
}
|
|
2485
2325
|
}, delegateListener: l, delegateUseCapture: d, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
2486
|
-
function a(c, f,
|
|
2326
|
+
function a(c, f, b, S) {
|
|
2487
2327
|
if (c.addEventListener) {
|
|
2488
|
-
var C = Ye(
|
|
2489
|
-
return
|
|
2328
|
+
var C = Ye(S), M = Be(n, (function(D) {
|
|
2329
|
+
return D.eventTarget === c;
|
|
2490
2330
|
}));
|
|
2491
|
-
M || (M = { eventTarget: c, events: {} }, n.push(M)), M.events[f] || (M.events[f] = []), Be(M.events[f], (function(
|
|
2492
|
-
return
|
|
2493
|
-
})) || (c.addEventListener(f,
|
|
2331
|
+
M || (M = { eventTarget: c, events: {} }, n.push(M)), M.events[f] || (M.events[f] = []), Be(M.events[f], (function(D) {
|
|
2332
|
+
return D.func === b && dt(D.options, C);
|
|
2333
|
+
})) || (c.addEventListener(f, b, i.supportsOptions ? C : C.capture), M.events[f].push({ func: b, options: C }));
|
|
2494
2334
|
}
|
|
2495
2335
|
}
|
|
2496
|
-
function s(c, f,
|
|
2336
|
+
function s(c, f, b, S) {
|
|
2497
2337
|
if (c.addEventListener && c.removeEventListener) {
|
|
2498
|
-
var C = He(n, (function(
|
|
2499
|
-
return
|
|
2338
|
+
var C = He(n, (function(ve) {
|
|
2339
|
+
return ve.eventTarget === c;
|
|
2500
2340
|
})), M = n[C];
|
|
2501
2341
|
if (M && M.events) if (f !== "all") {
|
|
2502
|
-
var
|
|
2503
|
-
if (
|
|
2504
|
-
if (
|
|
2505
|
-
for (var
|
|
2506
|
-
var
|
|
2507
|
-
s(c, f,
|
|
2342
|
+
var D = !1, O = M.events[f];
|
|
2343
|
+
if (O) {
|
|
2344
|
+
if (b === "all") {
|
|
2345
|
+
for (var F = O.length - 1; F >= 0; F--) {
|
|
2346
|
+
var U = O[F];
|
|
2347
|
+
s(c, f, U.func, U.options);
|
|
2508
2348
|
}
|
|
2509
2349
|
return;
|
|
2510
2350
|
}
|
|
2511
|
-
for (var
|
|
2512
|
-
var
|
|
2513
|
-
if (
|
|
2514
|
-
c.removeEventListener(f,
|
|
2351
|
+
for (var ee = Ye(S), q = 0; q < O.length; q++) {
|
|
2352
|
+
var K = O[q];
|
|
2353
|
+
if (K.func === b && dt(K.options, ee)) {
|
|
2354
|
+
c.removeEventListener(f, b, i.supportsOptions ? ee : ee.capture), O.splice(q, 1), O.length === 0 && (delete M.events[f], D = !0);
|
|
2515
2355
|
break;
|
|
2516
2356
|
}
|
|
2517
2357
|
}
|
|
2518
2358
|
}
|
|
2519
|
-
|
|
2359
|
+
D && !Object.keys(M.events).length && n.splice(C, 1);
|
|
2520
2360
|
} else for (f in M.events) M.events.hasOwnProperty(f) && s(c, f, "all");
|
|
2521
2361
|
}
|
|
2522
2362
|
}
|
|
2523
2363
|
function l(c, f) {
|
|
2524
|
-
for (var
|
|
2525
|
-
for (var
|
|
2526
|
-
var
|
|
2527
|
-
if (he(
|
|
2528
|
-
var
|
|
2529
|
-
|
|
2530
|
-
for (var
|
|
2531
|
-
var
|
|
2532
|
-
|
|
2364
|
+
for (var b = Ye(f), S = new mr(c), C = r[c.type], M = Ut(c)[0], D = M; x.element(D); ) {
|
|
2365
|
+
for (var O = 0; O < C.length; O++) {
|
|
2366
|
+
var F = C[O], U = F.selector, ee = F.context;
|
|
2367
|
+
if (he(D, U) && se(ee, M) && se(ee, D)) {
|
|
2368
|
+
var q = F.listeners;
|
|
2369
|
+
S.currentTarget = D;
|
|
2370
|
+
for (var K = 0; K < q.length; K++) {
|
|
2371
|
+
var ve = q[K];
|
|
2372
|
+
dt(ve.options, b) && ve.func(S);
|
|
2533
2373
|
}
|
|
2534
2374
|
}
|
|
2535
2375
|
}
|
|
2536
|
-
|
|
2376
|
+
D = fe(D);
|
|
2537
2377
|
}
|
|
2538
2378
|
}
|
|
2539
2379
|
function d(c) {
|
|
@@ -2544,9 +2384,9 @@ function Uo() {
|
|
|
2544
2384
|
}, get passive() {
|
|
2545
2385
|
return i.supportsPassive = !0;
|
|
2546
2386
|
} }), t.events = i, i;
|
|
2547
|
-
} },
|
|
2548
|
-
for (var e = 0, n =
|
|
2549
|
-
var r = n[e], o =
|
|
2387
|
+
} }, Dt = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
|
|
2388
|
+
for (var e = 0, n = Dt.methodOrder; e < n.length; e++) {
|
|
2389
|
+
var r = n[e], o = Dt[r](t);
|
|
2550
2390
|
if (o) return o;
|
|
2551
2391
|
}
|
|
2552
2392
|
return null;
|
|
@@ -2600,30 +2440,30 @@ function Uo() {
|
|
|
2600
2440
|
return n.id === e;
|
|
2601
2441
|
}));
|
|
2602
2442
|
}
|
|
2603
|
-
var gr =
|
|
2443
|
+
var gr = Dt, Nt = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
|
|
2604
2444
|
function En(t, e) {
|
|
2605
2445
|
return function(n) {
|
|
2606
2446
|
var r = e.interactions.list, o = Vt(n), i = Ut(n), a = i[0], s = i[1], l = [];
|
|
2607
2447
|
if (/^touch/.test(n.type)) {
|
|
2608
2448
|
e.prevTouchTime = e.now();
|
|
2609
2449
|
for (var d = 0, c = n.changedTouches; d < c.length; d++) {
|
|
2610
|
-
var f = c[d],
|
|
2611
|
-
l.push([
|
|
2450
|
+
var f = c[d], b = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, S = kn(b);
|
|
2451
|
+
l.push([b.pointer, b.eventTarget, b.curEventTarget, S]);
|
|
2612
2452
|
}
|
|
2613
2453
|
} else {
|
|
2614
2454
|
var C = !1;
|
|
2615
|
-
if (!
|
|
2455
|
+
if (!re.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2616
2456
|
for (var M = 0; M < r.length && !C; M++) C = r[M].pointerType !== "mouse" && r[M].pointerIsDown;
|
|
2617
2457
|
C = C || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2618
2458
|
}
|
|
2619
2459
|
if (!C) {
|
|
2620
|
-
var
|
|
2621
|
-
l.push([
|
|
2460
|
+
var D = { pointer: n, pointerId: je(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, O = kn(D);
|
|
2461
|
+
l.push([D.pointer, D.eventTarget, D.curEventTarget, O]);
|
|
2622
2462
|
}
|
|
2623
2463
|
}
|
|
2624
|
-
for (var
|
|
2625
|
-
var
|
|
2626
|
-
|
|
2464
|
+
for (var F = 0; F < l.length; F++) {
|
|
2465
|
+
var U = l[F], ee = U[0], q = U[1], K = U[2];
|
|
2466
|
+
U[3][t](ee, n, q, K);
|
|
2627
2467
|
}
|
|
2628
2468
|
};
|
|
2629
2469
|
}
|
|
@@ -2631,7 +2471,7 @@ function Uo() {
|
|
|
2631
2471
|
var e = t.pointerType, n = t.scope, r = { interaction: gr.search(t), searchDetails: t };
|
|
2632
2472
|
return n.fire("interactions:find", r), r.interaction || n.interactions.new({ pointerType: e });
|
|
2633
2473
|
}
|
|
2634
|
-
function
|
|
2474
|
+
function Lt(t, e) {
|
|
2635
2475
|
var n = t.doc, r = t.scope, o = t.options, i = r.interactions.docEvents, a = r.events, s = a[e];
|
|
2636
2476
|
for (var l in r.browser.isIOS && !o.events && (o.events = { passive: !1 }), a.delegatedEvents) s(n, l, a.delegateListener), s(n, l, a.delegateUseCapture, !0);
|
|
2637
2477
|
for (var d = o && o.events, c = 0; c < i.length; c++) {
|
|
@@ -2640,32 +2480,32 @@ function Uo() {
|
|
|
2640
2480
|
}
|
|
2641
2481
|
}
|
|
2642
2482
|
var yr = { id: "core/interactions", install: function(t) {
|
|
2643
|
-
for (var e = {}, n = 0; n <
|
|
2644
|
-
var r =
|
|
2483
|
+
for (var e = {}, n = 0; n < Nt.length; n++) {
|
|
2484
|
+
var r = Nt[n];
|
|
2645
2485
|
e[r] = En(r, t);
|
|
2646
2486
|
}
|
|
2647
|
-
var o, i =
|
|
2487
|
+
var o, i = re.pEventTypes;
|
|
2648
2488
|
function a() {
|
|
2649
2489
|
for (var s = 0, l = t.interactions.list; s < l.length; s++) {
|
|
2650
2490
|
var d = l[s];
|
|
2651
2491
|
if (d.pointerIsDown && d.pointerType === "touch" && !d._interacting) for (var c = function() {
|
|
2652
|
-
var
|
|
2492
|
+
var S = b[f];
|
|
2653
2493
|
t.documents.some((function(C) {
|
|
2654
|
-
return se(C.doc,
|
|
2655
|
-
})) || d.removePointer(
|
|
2656
|
-
}, f = 0,
|
|
2494
|
+
return se(C.doc, S.downTarget);
|
|
2495
|
+
})) || d.removePointer(S.pointer, S.event);
|
|
2496
|
+
}, f = 0, b = d.pointers; f < b.length; f++) c();
|
|
2657
2497
|
}
|
|
2658
2498
|
}
|
|
2659
|
-
(o =
|
|
2499
|
+
(o = X.PointerEvent ? [{ type: i.down, listener: a }, { type: i.down, listener: e.pointerDown }, { type: i.move, listener: e.pointerMove }, { type: i.up, listener: e.pointerUp }, { type: i.cancel, listener: e.pointerUp }] : [{ type: "mousedown", listener: e.pointerDown }, { type: "mousemove", listener: e.pointerMove }, { type: "mouseup", listener: e.pointerUp }, { type: "touchstart", listener: a }, { type: "touchstart", listener: e.pointerDown }, { type: "touchmove", listener: e.pointerMove }, { type: "touchend", listener: e.pointerUp }, { type: "touchcancel", listener: e.pointerUp }]).push({ type: "blur", listener: function(s) {
|
|
2660
2500
|
for (var l = 0, d = t.interactions.list; l < d.length; l++)
|
|
2661
2501
|
d[l].documentBlur(s);
|
|
2662
2502
|
} }), t.prevTouchTime = 0, t.Interaction = (function(s) {
|
|
2663
|
-
|
|
2664
|
-
var l =
|
|
2503
|
+
A(d, s);
|
|
2504
|
+
var l = R(d);
|
|
2665
2505
|
function d() {
|
|
2666
|
-
return
|
|
2506
|
+
return y(this, d), l.apply(this, arguments);
|
|
2667
2507
|
}
|
|
2668
|
-
return
|
|
2508
|
+
return g(d, [{ key: "pointerMoveTolerance", get: function() {
|
|
2669
2509
|
return t.interactions.pointerMoveTolerance;
|
|
2670
2510
|
}, set: function(c) {
|
|
2671
2511
|
t.interactions.pointerMoveTolerance = c;
|
|
@@ -2680,45 +2520,45 @@ function Uo() {
|
|
|
2680
2520
|
return t.interactions.list.push(l), l;
|
|
2681
2521
|
}, listeners: e, docEvents: o, pointerMoveTolerance: 1 }, t.usePlugin(un);
|
|
2682
2522
|
}, listeners: { "scope:add-document": function(t) {
|
|
2683
|
-
return
|
|
2523
|
+
return Lt(t, "add");
|
|
2684
2524
|
}, "scope:remove-document": function(t) {
|
|
2685
|
-
return
|
|
2525
|
+
return Lt(t, "remove");
|
|
2686
2526
|
}, "interactable:unset": function(t, e) {
|
|
2687
2527
|
for (var n = t.interactable, r = e.interactions.list.length - 1; r >= 0; r--) {
|
|
2688
2528
|
var o = e.interactions.list[r];
|
|
2689
2529
|
o.interactable === n && (o.stop(), e.fire("interactions:destroy", { interaction: o }), o.destroy(), e.interactions.list.length > 2 && e.interactions.list.splice(r, 1));
|
|
2690
2530
|
}
|
|
2691
|
-
} }, onDocSignal:
|
|
2531
|
+
} }, onDocSignal: Lt, doOnInteractions: En, methodNames: Nt }, br = yr, Ae = (function(t) {
|
|
2692
2532
|
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2693
|
-
})(
|
|
2533
|
+
})(Ae || {}), xr = (function() {
|
|
2694
2534
|
function t(e, n, r, o) {
|
|
2695
|
-
|
|
2535
|
+
y(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new xn(), 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 = Z(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
|
|
2696
2536
|
}
|
|
2697
|
-
return
|
|
2537
|
+
return g(t, [{ key: "_defaults", get: function() {
|
|
2698
2538
|
return { base: {}, perAction: {}, actions: {} };
|
|
2699
2539
|
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2700
|
-
return
|
|
2540
|
+
return x.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), x.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), x.func(n.onend) && this.on("".concat(e, "end"), n.onend), x.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
2701
2541
|
} }, { key: "updatePerActionListeners", value: function(e, n, r) {
|
|
2702
2542
|
var o, i = this, a = (o = this._actions.map[e]) == null ? void 0 : o.filterEventType, s = function(l) {
|
|
2703
|
-
return (a == null || a(l)) &&
|
|
2543
|
+
return (a == null || a(l)) && lt(l, i._actions);
|
|
2704
2544
|
};
|
|
2705
|
-
(
|
|
2545
|
+
(x.array(n) || x.object(n)) && this._onOff(Ae.Off, e, n, void 0, s), (x.array(r) || x.object(r)) && this._onOff(Ae.On, e, r, void 0, s);
|
|
2706
2546
|
} }, { key: "setPerAction", value: function(e, n) {
|
|
2707
2547
|
var r = this._defaults;
|
|
2708
2548
|
for (var o in n) {
|
|
2709
2549
|
var i = o, a = this.options[e], s = n[i];
|
|
2710
|
-
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s),
|
|
2550
|
+
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), x.array(s) ? a[i] = Gt(s) : x.plainObject(s) ? (a[i] = z(a[i] || {}, Ne(s)), x.object(r.perAction[i]) && "enabled" in r.perAction[i] && (a[i].enabled = s.enabled !== !1)) : x.bool(s) && x.object(r.perAction[i]) ? a[i].enabled = s : a[i] = s;
|
|
2711
2551
|
}
|
|
2712
2552
|
} }, { key: "getRect", value: function(e) {
|
|
2713
|
-
return e = e || (
|
|
2553
|
+
return e = e || (x.element(this.target) ? this.target : null), x.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
|
|
2714
2554
|
} }, { key: "rectChecker", value: function(e) {
|
|
2715
2555
|
var n = this;
|
|
2716
|
-
return
|
|
2717
|
-
var o =
|
|
2556
|
+
return x.func(e) ? (this.getRect = function(r) {
|
|
2557
|
+
var o = z({}, e.apply(n, r));
|
|
2718
2558
|
return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
|
|
2719
2559
|
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2720
2560
|
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
2721
|
-
if (Ee(n) ||
|
|
2561
|
+
if (Ee(n) || x.object(n)) {
|
|
2722
2562
|
for (var r in this.options[e] = n, this._actions.map) this.options[r][e] = n;
|
|
2723
2563
|
return this;
|
|
2724
2564
|
}
|
|
@@ -2729,7 +2569,7 @@ function Uo() {
|
|
|
2729
2569
|
return e === "page" || e === "client" ? (this.options.deltaSource = e, this) : this.options.deltaSource;
|
|
2730
2570
|
} }, { key: "getAllElements", value: function() {
|
|
2731
2571
|
var e = this.target;
|
|
2732
|
-
return
|
|
2572
|
+
return x.string(e) ? Array.from(this._context.querySelectorAll(e)) : x.func(e) && e.getAllElements ? e.getAllElements() : x.element(e) ? [e] : [];
|
|
2733
2573
|
} }, { key: "context", value: function() {
|
|
2734
2574
|
return this._context;
|
|
2735
2575
|
} }, { key: "inContext", value: function(e) {
|
|
@@ -2737,36 +2577,36 @@ function Uo() {
|
|
|
2737
2577
|
} }, { key: "testIgnoreAllow", value: function(e, n, r) {
|
|
2738
2578
|
return !this.testIgnore(e.ignoreFrom, n, r) && this.testAllow(e.allowFrom, n, r);
|
|
2739
2579
|
} }, { key: "testAllow", value: function(e, n, r) {
|
|
2740
|
-
return !e || !!
|
|
2580
|
+
return !e || !!x.element(r) && (x.string(e) ? Y(r, e, n) : !!x.element(e) && se(e, r));
|
|
2741
2581
|
} }, { key: "testIgnore", value: function(e, n, r) {
|
|
2742
|
-
return !(!e || !
|
|
2582
|
+
return !(!e || !x.element(r)) && (x.string(e) ? Y(r, e, n) : !!x.element(e) && se(e, r));
|
|
2743
2583
|
} }, { key: "fire", value: function(e) {
|
|
2744
2584
|
return this.events.fire(e), this;
|
|
2745
2585
|
} }, { key: "_onOff", value: function(e, n, r, o, i) {
|
|
2746
|
-
|
|
2586
|
+
x.object(n) && !x.array(n) && (o = r, r = null);
|
|
2747
2587
|
var a = Ie(n, r, i);
|
|
2748
2588
|
for (var s in a) {
|
|
2749
|
-
s === "wheel" && (s =
|
|
2589
|
+
s === "wheel" && (s = re.wheelEvent);
|
|
2750
2590
|
for (var l = 0, d = a[s]; l < d.length; l++) {
|
|
2751
2591
|
var c = d[l];
|
|
2752
|
-
|
|
2592
|
+
lt(s, this._actions) ? this.events[e === Ae.On ? "on" : "off"](s, c) : x.string(this.target) ? this._scopeEvents[e === Ae.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, o) : this._scopeEvents[e === Ae.On ? "add" : "remove"](this.target, s, c, o);
|
|
2753
2593
|
}
|
|
2754
2594
|
}
|
|
2755
2595
|
return this;
|
|
2756
2596
|
} }, { key: "on", value: function(e, n, r) {
|
|
2757
|
-
return this._onOff(
|
|
2597
|
+
return this._onOff(Ae.On, e, n, r);
|
|
2758
2598
|
} }, { key: "off", value: function(e, n, r) {
|
|
2759
|
-
return this._onOff(
|
|
2599
|
+
return this._onOff(Ae.Off, e, n, r);
|
|
2760
2600
|
} }, { key: "set", value: function(e) {
|
|
2761
2601
|
var n = this._defaults;
|
|
2762
|
-
for (var r in
|
|
2602
|
+
for (var r in x.object(e) || (e = {}), this.options = Ne(n.base), this._actions.methodDict) {
|
|
2763
2603
|
var o = r, i = this._actions.methodDict[o];
|
|
2764
|
-
this.options[o] = {}, this.setPerAction(o,
|
|
2604
|
+
this.options[o] = {}, this.setPerAction(o, z(z({}, n.perAction), n.actions[o])), this[i](e[o]);
|
|
2765
2605
|
}
|
|
2766
|
-
for (var a in e) a !== "getRect" ?
|
|
2606
|
+
for (var a in e) a !== "getRect" ? x.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2767
2607
|
return this;
|
|
2768
2608
|
} }, { key: "unset", value: function() {
|
|
2769
|
-
if (
|
|
2609
|
+
if (x.string(this.target)) for (var e in this._scopeEvents.delegatedEvents) for (var n = this._scopeEvents.delegatedEvents[e], r = n.length - 1; r >= 0; r--) {
|
|
2770
2610
|
var o = n[r], i = o.selector, a = o.context, s = o.listeners;
|
|
2771
2611
|
i === this.target && a === this._context && n.splice(r, 1);
|
|
2772
2612
|
for (var l = s.length - 1; l >= 0; l--) this._scopeEvents.removeDelegate(this.target, this._context, e, s[l][0], s[l][1]);
|
|
@@ -2776,105 +2616,105 @@ function Uo() {
|
|
|
2776
2616
|
})(), wr = (function() {
|
|
2777
2617
|
function t(e) {
|
|
2778
2618
|
var n = this;
|
|
2779
|
-
|
|
2780
|
-
var o = r.interactable, i = o.target, a =
|
|
2619
|
+
y(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2620
|
+
var o = r.interactable, i = o.target, a = x.string(i) ? n.selectorMap[i] : i[n.scope.id], s = He(a, (function(l) {
|
|
2781
2621
|
return l === o;
|
|
2782
2622
|
}));
|
|
2783
2623
|
a.splice(s, 1);
|
|
2784
2624
|
} });
|
|
2785
2625
|
}
|
|
2786
|
-
return
|
|
2787
|
-
n =
|
|
2626
|
+
return g(t, [{ key: "new", value: function(e, n) {
|
|
2627
|
+
n = z(n || {}, { actions: this.scope.actions });
|
|
2788
2628
|
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2789
|
-
return this.scope.addDocument(r._doc), this.list.push(r),
|
|
2629
|
+
return this.scope.addDocument(r._doc), this.list.push(r), x.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;
|
|
2790
2630
|
} }, { key: "getExisting", value: function(e, n) {
|
|
2791
|
-
var r = n && n.context || this.scope.document, o =
|
|
2631
|
+
var r = n && n.context || this.scope.document, o = x.string(e), i = o ? this.selectorMap[e] : e[this.scope.id];
|
|
2792
2632
|
if (i) return Be(i, (function(a) {
|
|
2793
2633
|
return a._context === r && (o || a.inContext(e));
|
|
2794
2634
|
}));
|
|
2795
2635
|
} }, { key: "forEachMatch", value: function(e, n) {
|
|
2796
2636
|
for (var r = 0, o = this.list; r < o.length; r++) {
|
|
2797
2637
|
var i = o[r], a = void 0;
|
|
2798
|
-
if ((
|
|
2638
|
+
if ((x.string(i.target) ? x.element(e) && he(e, i.target) : e === i.target) && i.inContext(e) && (a = n(i)), a !== void 0) return a;
|
|
2799
2639
|
}
|
|
2800
2640
|
} }]), t;
|
|
2801
2641
|
})(), Er = (function() {
|
|
2802
2642
|
function t() {
|
|
2803
2643
|
var e = this;
|
|
2804
|
-
|
|
2644
|
+
y(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = re, this.defaults = Ne(pn), this.Eventable = xn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
|
|
2805
2645
|
var o = function i(a, s) {
|
|
2806
2646
|
var l = r.interactables.getExisting(a, s);
|
|
2807
2647
|
return l || ((l = r.interactables.new(a, s)).events.global = i.globalEvents), l;
|
|
2808
2648
|
};
|
|
2809
|
-
return o.getPointerAverage = $t, o.getTouchBBox =
|
|
2649
|
+
return o.getPointerAverage = $t, o.getTouchBBox = bt, o.getTouchDistance = xt, o.getTouchAngle = wt, o.getElementRect = we, o.getElementClientRect = xe, o.matchesSelector = he, o.closest = pe, o.globalEvents = {}, o.version = "1.10.27", o.scope = r, o.use = function(i, a) {
|
|
2810
2650
|
return this.scope.usePlugin(i, a), this;
|
|
2811
2651
|
}, o.isSet = function(i, a) {
|
|
2812
2652
|
return !!this.scope.interactables.get(i, a && a.context);
|
|
2813
2653
|
}, o.on = qe((function(i, a, s) {
|
|
2814
|
-
if (
|
|
2654
|
+
if (x.string(i) && i.search(" ") !== -1 && (i = i.trim().split(/ +/)), x.array(i)) {
|
|
2815
2655
|
for (var l = 0, d = i; l < d.length; l++) {
|
|
2816
2656
|
var c = d[l];
|
|
2817
2657
|
this.on(c, a, s);
|
|
2818
2658
|
}
|
|
2819
2659
|
return this;
|
|
2820
2660
|
}
|
|
2821
|
-
if (
|
|
2661
|
+
if (x.object(i)) {
|
|
2822
2662
|
for (var f in i) this.on(f, i[f], a);
|
|
2823
2663
|
return this;
|
|
2824
2664
|
}
|
|
2825
|
-
return
|
|
2665
|
+
return lt(i, this.scope.actions) ? this.globalEvents[i] ? this.globalEvents[i].push(a) : this.globalEvents[i] = [a] : this.scope.events.add(this.scope.document, i, a, { options: s }), this;
|
|
2826
2666
|
}), "The interact.on() method is being deprecated"), o.off = qe((function(i, a, s) {
|
|
2827
|
-
if (
|
|
2667
|
+
if (x.string(i) && i.search(" ") !== -1 && (i = i.trim().split(/ +/)), x.array(i)) {
|
|
2828
2668
|
for (var l = 0, d = i; l < d.length; l++) {
|
|
2829
2669
|
var c = d[l];
|
|
2830
2670
|
this.off(c, a, s);
|
|
2831
2671
|
}
|
|
2832
2672
|
return this;
|
|
2833
2673
|
}
|
|
2834
|
-
if (
|
|
2674
|
+
if (x.object(i)) {
|
|
2835
2675
|
for (var f in i) this.off(f, i[f], a);
|
|
2836
2676
|
return this;
|
|
2837
2677
|
}
|
|
2838
|
-
var
|
|
2839
|
-
return
|
|
2678
|
+
var b;
|
|
2679
|
+
return lt(i, this.scope.actions) ? i in this.globalEvents && (b = this.globalEvents[i].indexOf(a)) !== -1 && this.globalEvents[i].splice(b, 1) : this.scope.events.remove(this.scope.document, i, a, s), this;
|
|
2840
2680
|
}), "The interact.off() method is being deprecated"), o.debug = function() {
|
|
2841
2681
|
return this.scope;
|
|
2842
2682
|
}, o.supportsTouch = function() {
|
|
2843
|
-
return
|
|
2683
|
+
return re.supportsTouch;
|
|
2844
2684
|
}, o.supportsPointerEvent = function() {
|
|
2845
|
-
return
|
|
2685
|
+
return re.supportsPointerEvent;
|
|
2846
2686
|
}, o.stop = function() {
|
|
2847
2687
|
for (var i = 0, a = this.scope.interactions.list; i < a.length; i++) a[i].stop();
|
|
2848
2688
|
return this;
|
|
2849
2689
|
}, o.pointerMoveTolerance = function(i) {
|
|
2850
|
-
return
|
|
2690
|
+
return x.number(i) ? (this.scope.interactions.pointerMoveTolerance = i, this) : this.scope.interactions.pointerMoveTolerance;
|
|
2851
2691
|
}, o.addDocument = function(i, a) {
|
|
2852
2692
|
this.scope.addDocument(i, a);
|
|
2853
2693
|
}, o.removeDocument = function(i) {
|
|
2854
2694
|
this.scope.removeDocument(i);
|
|
2855
2695
|
}, o;
|
|
2856
|
-
})(this), this.InteractEvent =
|
|
2696
|
+
})(this), this.InteractEvent = Pt, this.Interactable = void 0, this.interactables = new wr(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(r) {
|
|
2857
2697
|
return e.removeDocument(r.target);
|
|
2858
2698
|
};
|
|
2859
2699
|
var n = this;
|
|
2860
2700
|
this.Interactable = (function(r) {
|
|
2861
|
-
|
|
2862
|
-
var o =
|
|
2701
|
+
A(i, r);
|
|
2702
|
+
var o = R(i);
|
|
2863
2703
|
function i() {
|
|
2864
|
-
return
|
|
2704
|
+
return y(this, i), o.apply(this, arguments);
|
|
2865
2705
|
}
|
|
2866
|
-
return
|
|
2706
|
+
return g(i, [{ key: "_defaults", get: function() {
|
|
2867
2707
|
return n.defaults;
|
|
2868
2708
|
} }, { key: "set", value: function(a) {
|
|
2869
|
-
return
|
|
2709
|
+
return j(k(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2870
2710
|
} }, { key: "unset", value: function() {
|
|
2871
|
-
|
|
2711
|
+
j(k(i.prototype), "unset", this).call(this);
|
|
2872
2712
|
var a = n.interactables.list.indexOf(this);
|
|
2873
2713
|
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2874
2714
|
} }]), i;
|
|
2875
2715
|
})(xr);
|
|
2876
2716
|
}
|
|
2877
|
-
return
|
|
2717
|
+
return g(t, [{ key: "addListeners", value: function(e, n) {
|
|
2878
2718
|
this.listenerMaps.push({ id: n, map: e });
|
|
2879
2719
|
} }, { key: "fire", value: function(e, n) {
|
|
2880
2720
|
for (var r = 0, o = this.listenerMaps; r < o.length; r++) {
|
|
@@ -2883,7 +2723,7 @@ function Uo() {
|
|
|
2883
2723
|
}
|
|
2884
2724
|
} }, { key: "init", value: function(e) {
|
|
2885
2725
|
return this.isInitialized ? this : (function(n, r) {
|
|
2886
|
-
return n.isInitialized = !0,
|
|
2726
|
+
return n.isInitialized = !0, x.window(r) && V(r), X.init(r), re.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(br), n.usePlugin(vr), n;
|
|
2887
2727
|
})(this, e);
|
|
2888
2728
|
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2889
2729
|
var n = e.id;
|
|
@@ -2903,10 +2743,10 @@ function Uo() {
|
|
|
2903
2743
|
return this;
|
|
2904
2744
|
} }, { key: "addDocument", value: function(e, n) {
|
|
2905
2745
|
if (this.getDocIndex(e) !== -1) return !1;
|
|
2906
|
-
var r =
|
|
2907
|
-
n = n ?
|
|
2746
|
+
var r = Z(e);
|
|
2747
|
+
n = n ? z({}, 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 });
|
|
2908
2748
|
} }, { key: "removeDocument", value: function(e) {
|
|
2909
|
-
var n = this.getDocIndex(e), r =
|
|
2749
|
+
var n = this.getDocIndex(e), r = Z(e), o = this.documents[n].options;
|
|
2910
2750
|
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 });
|
|
2911
2751
|
} }, { key: "getDocIndex", value: function(e) {
|
|
2912
2752
|
for (var n = 0; n < this.documents.length; n++) if (this.documents[n].doc === e) return n;
|
|
@@ -2921,7 +2761,7 @@ function Uo() {
|
|
|
2921
2761
|
function Cn(t) {
|
|
2922
2762
|
return t && t.replace(/\/.*$/, "");
|
|
2923
2763
|
}
|
|
2924
|
-
var Sn = new Er(),
|
|
2764
|
+
var Sn = new Er(), me = Sn.interactStatic, kr = typeof globalThis < "u" ? globalThis : window;
|
|
2925
2765
|
Sn.init(kr);
|
|
2926
2766
|
var Cr = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2927
2767
|
}, elements: function() {
|
|
@@ -2931,40 +2771,40 @@ function Uo() {
|
|
|
2931
2771
|
return o in t || i in t;
|
|
2932
2772
|
})), n = function(r, o) {
|
|
2933
2773
|
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, d = l === void 0 ? { x: 0, y: 0 } : l, c = { range: i, grid: t, x: null, y: null }, f = 0; f < e.length; f++) {
|
|
2934
|
-
var
|
|
2935
|
-
c[
|
|
2774
|
+
var b = e[f], S = b[0], C = b[1], M = Math.round((r - d.x) / t[S]), D = Math.round((o - d.y) / t[C]);
|
|
2775
|
+
c[S] = Math.max(s.left, Math.min(s.right, M * t[S] + d.x)), c[C] = Math.max(s.top, Math.min(s.bottom, D * t[C] + d.y));
|
|
2936
2776
|
}
|
|
2937
2777
|
return c;
|
|
2938
2778
|
};
|
|
2939
2779
|
return n.grid = t, n.coordFields = e, n;
|
|
2940
2780
|
} }), Sr = { id: "snappers", install: function(t) {
|
|
2941
2781
|
var e = t.interactStatic;
|
|
2942
|
-
e.snappers =
|
|
2782
|
+
e.snappers = z(e.snappers || {}, Cr), e.createSnapGrid = e.snappers.grid;
|
|
2943
2783
|
} }, Tr = Sr, _r = { start: function(t) {
|
|
2944
2784
|
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, d = l.equalDelta, c = l.modifiers;
|
|
2945
|
-
a === "preserve" && (a = n.width / n.height), e.startCoords =
|
|
2785
|
+
a === "preserve" && (a = n.width / n.height), e.startCoords = z({}, o), e.startRect = z({}, n), e.ratio = a, e.equalDelta = d;
|
|
2946
2786
|
var f = 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 };
|
|
2947
2787
|
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2948
|
-
var
|
|
2949
|
-
e.edgeSign = { x:
|
|
2788
|
+
var b = (f.left ? 1 : -1) * (f.top ? 1 : -1);
|
|
2789
|
+
e.edgeSign = { x: b, y: b };
|
|
2950
2790
|
} else e.edgeSign = { x: f.left ? -1 : 1, y: f.top ? -1 : 1 };
|
|
2951
|
-
if (s !== !1 &&
|
|
2952
|
-
var
|
|
2953
|
-
|
|
2791
|
+
if (s !== !1 && z(r, f), c != null && c.length) {
|
|
2792
|
+
var S = new It(t.interaction);
|
|
2793
|
+
S.copyFrom(t.interaction.modification), S.prepareStates(c), e.subModification = S, S.startAll(u({}, t));
|
|
2954
2794
|
}
|
|
2955
2795
|
}, set: function(t) {
|
|
2956
|
-
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i =
|
|
2957
|
-
if (
|
|
2958
|
-
var s =
|
|
2959
|
-
|
|
2796
|
+
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = z({}, r), a = e.equalDelta ? Ar : Mr;
|
|
2797
|
+
if (z(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
|
|
2798
|
+
var s = z({}, n);
|
|
2799
|
+
nt(o, s, { x: r.x - i.x, y: r.y - i.y });
|
|
2960
2800
|
var l = e.subModification.setAll(u(u({}, t), {}, { rect: s, edges: o, pageCoords: r, prevCoords: r, prevRect: s })), d = l.delta;
|
|
2961
|
-
return l.changed && (a(e, Math.abs(d.x) > Math.abs(d.y), l.coords, l.rect),
|
|
2801
|
+
return l.changed && (a(e, Math.abs(d.x) > Math.abs(d.y), l.coords, l.rect), z(r, l.coords)), l.eventProps;
|
|
2962
2802
|
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2963
|
-
function
|
|
2803
|
+
function Ar(t, e, n) {
|
|
2964
2804
|
var r = t.startCoords, o = t.edgeSign;
|
|
2965
2805
|
e ? n.y = r.y + (n.x - r.x) * o.y : n.x = r.x + (n.y - r.y) * o.x;
|
|
2966
2806
|
}
|
|
2967
|
-
function
|
|
2807
|
+
function Mr(t, e, n, r) {
|
|
2968
2808
|
var o = t.startRect, i = t.startCoords, a = t.ratio, s = t.edgeSign;
|
|
2969
2809
|
if (e) {
|
|
2970
2810
|
var l = r.width / a;
|
|
@@ -2974,15 +2814,15 @@ function Uo() {
|
|
|
2974
2814
|
n.x = i.x + (d - o.width) * s.x;
|
|
2975
2815
|
}
|
|
2976
2816
|
}
|
|
2977
|
-
var
|
|
2817
|
+
var Rr = _e(_r, "aspectRatio"), Tn = function() {
|
|
2978
2818
|
};
|
|
2979
2819
|
Tn._defaults = {};
|
|
2980
|
-
var
|
|
2820
|
+
var pt = Tn;
|
|
2981
2821
|
function Oe(t, e, n) {
|
|
2982
|
-
return
|
|
2822
|
+
return x.func(t) ? Le(t, e.interactable, e.element, [n.x, n.y, e]) : Le(t, e.interactable, e.element);
|
|
2983
2823
|
}
|
|
2984
|
-
var
|
|
2985
|
-
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l =
|
|
2824
|
+
var ft = { start: function(t) {
|
|
2825
|
+
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = z({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2986
2826
|
if (e && s) {
|
|
2987
2827
|
var d = Oe(a.restriction, o, i);
|
|
2988
2828
|
if (d) {
|
|
@@ -2996,76 +2836,76 @@ function Uo() {
|
|
|
2996
2836
|
var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = Oe(o.restriction, n, e);
|
|
2997
2837
|
if (a) {
|
|
2998
2838
|
var s = (function(l) {
|
|
2999
|
-
return !l || "left" in l && "top" in l || ((l =
|
|
2839
|
+
return !l || "left" in l && "top" in l || ((l = z({}, 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;
|
|
3000
2840
|
})(a);
|
|
3001
2841
|
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);
|
|
3002
2842
|
}
|
|
3003
|
-
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir = _e(
|
|
3004
|
-
function
|
|
2843
|
+
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Ir = _e(ft, "restrict"), _n = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, An = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
|
|
2844
|
+
function Mn(t, e) {
|
|
3005
2845
|
for (var n = 0, r = ["top", "left", "bottom", "right"]; n < r.length; n++) {
|
|
3006
2846
|
var o = r[n];
|
|
3007
2847
|
o in t || (t[o] = e[o]);
|
|
3008
2848
|
}
|
|
3009
2849
|
return t;
|
|
3010
2850
|
}
|
|
3011
|
-
var $e = { noInner: _n, noOuter:
|
|
2851
|
+
var $e = { noInner: _n, noOuter: An, start: function(t) {
|
|
3012
2852
|
var e, n = t.interaction, r = t.startOffset, o = t.state, i = o.options;
|
|
3013
|
-
i && (e =
|
|
2853
|
+
i && (e = tt(Oe(i.offset, n, n.coords.start.page))), e = e || { x: 0, y: 0 }, o.offset = { top: e.y + r.top, left: e.x + r.left, bottom: e.y - r.bottom, right: e.x - r.right };
|
|
3014
2854
|
}, set: function(t) {
|
|
3015
2855
|
var e = t.coords, n = t.edges, r = t.interaction, o = t.state, i = o.offset, a = o.options;
|
|
3016
2856
|
if (n) {
|
|
3017
|
-
var s =
|
|
3018
|
-
|
|
2857
|
+
var s = z({}, e), l = Oe(a.inner, r, s) || {}, d = Oe(a.outer, r, s) || {};
|
|
2858
|
+
Mn(l, _n), Mn(d, An), n.top ? e.y = Math.min(Math.max(d.top + i.top, s.y), l.top + i.top) : n.bottom && (e.y = Math.max(Math.min(d.bottom + i.bottom, s.y), l.bottom + i.bottom)), n.left ? e.x = Math.min(Math.max(d.left + i.left, s.x), l.left + i.left) : n.right && (e.x = Math.max(Math.min(d.right + i.right, s.x), l.right + i.right));
|
|
3019
2859
|
}
|
|
3020
|
-
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr = _e($e, "restrictEdges"), Or =
|
|
2860
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Pr = _e($e, "restrictEdges"), Or = z({ get elementRect() {
|
|
3021
2861
|
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
3022
2862
|
}, set elementRect(t) {
|
|
3023
|
-
} },
|
|
2863
|
+
} }, ft.defaults), Dr = _e({ start: ft.start, set: ft.set, defaults: Or }, "restrictRect"), Nr = { width: -1 / 0, height: -1 / 0 }, Lr = { width: 1 / 0, height: 1 / 0 }, zr = _e({ start: function(t) {
|
|
3024
2864
|
return $e.start(t);
|
|
3025
2865
|
}, set: function(t) {
|
|
3026
2866
|
var e = t.interaction, n = t.state, r = t.rect, o = t.edges, i = n.options;
|
|
3027
2867
|
if (o) {
|
|
3028
|
-
var a =
|
|
3029
|
-
n.options = { endOnly: i.endOnly, inner:
|
|
2868
|
+
var a = gt(Oe(i.min, e, t.coords)) || Nr, s = gt(Oe(i.max, e, t.coords)) || Lr;
|
|
2869
|
+
n.options = { endOnly: i.endOnly, inner: z({}, $e.noInner), outer: z({}, $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;
|
|
3030
2870
|
}
|
|
3031
2871
|
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), zt = { start: function(t) {
|
|
3032
|
-
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, d = l.offsetWithOrigin ? (function(
|
|
3033
|
-
var
|
|
2872
|
+
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, d = l.offsetWithOrigin ? (function(b) {
|
|
2873
|
+
var S = b.interaction.element, C = tt(Le(b.state.options.origin, null, null, [S])), M = C || ze(b.interactable, S, b.interaction.prepared.name);
|
|
3034
2874
|
return M;
|
|
3035
2875
|
})(t) : { x: 0, y: 0 };
|
|
3036
2876
|
if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
3037
2877
|
else {
|
|
3038
|
-
var c =
|
|
3039
|
-
(e =
|
|
2878
|
+
var c = Le(l.offset, r, o, [n]);
|
|
2879
|
+
(e = tt(c) || { x: 0, y: 0 }).x += d.x, e.y += d.y;
|
|
3040
2880
|
}
|
|
3041
2881
|
var f = l.relativePoints;
|
|
3042
|
-
a.offsets = i && f && f.length ? f.map((function(
|
|
3043
|
-
return { index:
|
|
2882
|
+
a.offsets = i && f && f.length ? f.map((function(b, S) {
|
|
2883
|
+
return { index: S, relativePoint: b, x: s.left - i.width * b.x + e.x, y: s.top - i.height * b.y + e.y };
|
|
3044
2884
|
})) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
3045
2885
|
}, set: function(t) {
|
|
3046
|
-
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a =
|
|
2886
|
+
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = ze(e.interactable, e.element, e.prepared.name), s = z({}, n), l = [];
|
|
3047
2887
|
o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
3048
|
-
for (var d = 0, c = i; d < c.length; d++) for (var f = c[d],
|
|
3049
|
-
var
|
|
3050
|
-
(
|
|
2888
|
+
for (var d = 0, c = i; d < c.length; d++) for (var f = c[d], b = s.x - f.x, S = s.y - f.y, C = 0, M = o.targets.length; C < M; C++) {
|
|
2889
|
+
var D = o.targets[C], O = void 0;
|
|
2890
|
+
(O = x.func(D) ? D(b, S, e._proxy, f, C) : D) && l.push({ x: (x.number(O.x) ? O.x : b) + f.x, y: (x.number(O.y) ? O.y : S) + f.y, range: x.number(O.range) ? O.range : o.range, source: D, index: C, offset: f });
|
|
3051
2891
|
}
|
|
3052
|
-
for (var
|
|
3053
|
-
var
|
|
3054
|
-
|
|
2892
|
+
for (var F = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, U = 0; U < l.length; U++) {
|
|
2893
|
+
var ee = l[U], q = ee.range, K = ee.x - s.x, ve = ee.y - s.y, ae = Fe(K, ve), ge = ae <= q;
|
|
2894
|
+
q === 1 / 0 && F.inRange && F.range !== 1 / 0 && (ge = !1), F.target && !(ge ? F.inRange && q !== 1 / 0 ? ae / q < F.distance / F.range : q === 1 / 0 && F.range !== 1 / 0 || ae < F.distance : !F.inRange && ae < F.distance) || (F.target = ee, F.distance = ae, F.range = q, F.inRange = ge, F.delta.x = K, F.delta.y = ve);
|
|
3055
2895
|
}
|
|
3056
|
-
return
|
|
3057
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr = _e(zt, "snap"),
|
|
2896
|
+
return F.inRange && (n.x = F.target.x, n.y = F.target.y), r.closest = F, F;
|
|
2897
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Fr = _e(zt, "snap"), ht = { start: function(t) {
|
|
3058
2898
|
var e = t.state, n = t.edges, r = e.options;
|
|
3059
2899
|
if (!n) return null;
|
|
3060
2900
|
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"]], zt.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
3061
2901
|
}, set: function(t) {
|
|
3062
2902
|
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 };
|
|
3063
|
-
n.options =
|
|
2903
|
+
n.options = z({}, o), n.options.targets = [];
|
|
3064
2904
|
for (var s = 0, l = o.targets || []; s < l.length; s++) {
|
|
3065
2905
|
var d = l[s], c = void 0;
|
|
3066
|
-
if (c =
|
|
3067
|
-
for (var f = 0,
|
|
3068
|
-
var
|
|
2906
|
+
if (c = x.func(d) ? d(a.x, a.y, e) : d) {
|
|
2907
|
+
for (var f = 0, b = n.targetFields; f < b.length; f++) {
|
|
2908
|
+
var S = b[f], C = S[0], M = S[1];
|
|
3069
2909
|
if (C in c || M in c) {
|
|
3070
2910
|
c.x = c[C], c.y = c[M];
|
|
3071
2911
|
break;
|
|
@@ -3074,23 +2914,23 @@ function Uo() {
|
|
|
3074
2914
|
n.options.targets.push(c);
|
|
3075
2915
|
}
|
|
3076
2916
|
}
|
|
3077
|
-
var
|
|
3078
|
-
return n.options = o,
|
|
3079
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(
|
|
2917
|
+
var D = zt.set(t);
|
|
2918
|
+
return n.options = o, D;
|
|
2919
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(ht, "snapSize"), Ft = { aspectRatio: Rr, restrictEdges: Pr, restrict: Ir, restrictRect: Dr, restrictSize: zr, snapEdges: _e({ start: function(t) {
|
|
3080
2920
|
var e = t.edges;
|
|
3081
|
-
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]],
|
|
3082
|
-
}, set:
|
|
2921
|
+
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], ht.start(t)) : null;
|
|
2922
|
+
}, set: ht.set, defaults: z(Ne(ht.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Fr, snapSize: jr, spring: pt, avoid: pt, transform: pt, rubberband: pt }, Hr = { id: "modifiers", install: function(t) {
|
|
3083
2923
|
var e = t.interactStatic;
|
|
3084
|
-
for (var n in t.usePlugin(dn), t.usePlugin(Tr), e.modifiers =
|
|
3085
|
-
var r =
|
|
2924
|
+
for (var n in t.usePlugin(dn), t.usePlugin(Tr), e.modifiers = Ft, Ft) {
|
|
2925
|
+
var r = Ft[n], o = r._defaults, i = r._methods;
|
|
3086
2926
|
o._methods = i, t.defaults.perAction[n] = o;
|
|
3087
2927
|
}
|
|
3088
|
-
} }, Br = Hr,
|
|
3089
|
-
|
|
3090
|
-
var e =
|
|
2928
|
+
} }, Br = Hr, Rn = (function(t) {
|
|
2929
|
+
A(n, t);
|
|
2930
|
+
var e = R(n);
|
|
3091
2931
|
function n(r, o, i, a, s, l) {
|
|
3092
2932
|
var d;
|
|
3093
|
-
if (
|
|
2933
|
+
if (y(this, n), rt(I(d = e.call(this, s)), i), i !== o && rt(I(d), o), d.timeStamp = l, d.originalEvent = i, d.type = r, d.pointerId = je(o), d.pointerType = Vt(o), d.target = a, d.currentTarget = null, r === "tap") {
|
|
3094
2934
|
var c = s.getPointerIndex(o);
|
|
3095
2935
|
d.dt = d.timeStamp - s.pointers[c].downTime;
|
|
3096
2936
|
var f = d.timeStamp - s.tapTime;
|
|
@@ -3098,7 +2938,7 @@ function Uo() {
|
|
|
3098
2938
|
} else r === "doubletap" && (d.dt = o.timeStamp - s.tapTime, d.double = !0);
|
|
3099
2939
|
return d;
|
|
3100
2940
|
}
|
|
3101
|
-
return
|
|
2941
|
+
return g(n, [{ key: "_subtractOrigin", value: function(r) {
|
|
3102
2942
|
var o = r.x, i = r.y;
|
|
3103
2943
|
return this.pageX -= o, this.pageY -= i, this.clientX -= o, this.clientY -= i, this;
|
|
3104
2944
|
} }, { key: "_addOrigin", value: function(r) {
|
|
@@ -3107,8 +2947,8 @@ function Uo() {
|
|
|
3107
2947
|
} }, { key: "preventDefault", value: function() {
|
|
3108
2948
|
this.originalEvent.preventDefault();
|
|
3109
2949
|
} }]), n;
|
|
3110
|
-
})(
|
|
3111
|
-
t.pointerEvents = Ve, t.defaults.actions.pointerEvents = Ve.defaults,
|
|
2950
|
+
})(at), Ve = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
|
|
2951
|
+
t.pointerEvents = Ve, t.defaults.actions.pointerEvents = Ve.defaults, z(t.actions.phaselessTypes, Ve.types);
|
|
3112
2952
|
}, listeners: { "interactions:new": function(t) {
|
|
3113
2953
|
var e = t.interaction;
|
|
3114
2954
|
e.prevTap = null, e.tapTime = 0;
|
|
@@ -3117,42 +2957,42 @@ function Uo() {
|
|
|
3117
2957
|
!e && n.hold || (n.hold = { duration: 1 / 0, timeout: null });
|
|
3118
2958
|
}, "interactions:move": function(t, e) {
|
|
3119
2959
|
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget;
|
|
3120
|
-
t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown &&
|
|
2960
|
+
t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && jt(t), Me({ interaction: n, pointer: r, event: o, eventTarget: i, type: "move" }, e));
|
|
3121
2961
|
}, "interactions:down": function(t, e) {
|
|
3122
2962
|
(function(n, r) {
|
|
3123
|
-
for (var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, d = o.pointers[l].hold, c = ue(s), f = { interaction: o, pointer: i, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null },
|
|
3124
|
-
var
|
|
3125
|
-
f.node =
|
|
2963
|
+
for (var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, d = o.pointers[l].hold, c = ue(s), f = { interaction: o, pointer: i, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null }, b = 0; b < c.length; b++) {
|
|
2964
|
+
var S = c[b];
|
|
2965
|
+
f.node = S, r.fire("pointerEvents:collect-targets", f);
|
|
3126
2966
|
}
|
|
3127
2967
|
if (f.targets.length) {
|
|
3128
|
-
for (var C = 1 / 0, M = 0,
|
|
3129
|
-
var
|
|
3130
|
-
|
|
2968
|
+
for (var C = 1 / 0, M = 0, D = f.targets; M < D.length; M++) {
|
|
2969
|
+
var O = D[M].eventable.options.holdDuration;
|
|
2970
|
+
O < C && (C = O);
|
|
3131
2971
|
}
|
|
3132
2972
|
d.duration = C, d.timeout = setTimeout((function() {
|
|
3133
|
-
|
|
2973
|
+
Me({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
|
|
3134
2974
|
}), C);
|
|
3135
2975
|
}
|
|
3136
|
-
})(t, e),
|
|
2976
|
+
})(t, e), Me(t, e);
|
|
3137
2977
|
}, "interactions:up": function(t, e) {
|
|
3138
|
-
|
|
2978
|
+
jt(t), Me(t, e), (function(n, r) {
|
|
3139
2979
|
var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget;
|
|
3140
|
-
o.pointerWasMoved ||
|
|
2980
|
+
o.pointerWasMoved || Me({ interaction: o, eventTarget: s, pointer: i, event: a, type: "tap" }, r);
|
|
3141
2981
|
})(t, e);
|
|
3142
2982
|
}, "interactions:cancel": function(t, e) {
|
|
3143
|
-
|
|
3144
|
-
} }, PointerEvent:
|
|
3145
|
-
function
|
|
3146
|
-
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = t.targets, l = s === void 0 ? In(t, e) : s, d = new
|
|
2983
|
+
jt(t), Me(t, e);
|
|
2984
|
+
} }, PointerEvent: Rn, fire: Me, collectEventTargets: In, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
|
|
2985
|
+
function Me(t, e) {
|
|
2986
|
+
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = t.targets, l = s === void 0 ? In(t, e) : s, d = new Rn(a, r, o, i, n, e.now());
|
|
3147
2987
|
e.fire("pointerEvents:new", { pointerEvent: d });
|
|
3148
2988
|
for (var c = { interaction: n, pointer: r, event: o, eventTarget: i, targets: l, type: a, pointerEvent: d }, f = 0; f < l.length; f++) {
|
|
3149
|
-
var
|
|
3150
|
-
for (var
|
|
3151
|
-
var C =
|
|
3152
|
-
if (d._subtractOrigin(C), d.eventable =
|
|
2989
|
+
var b = l[f];
|
|
2990
|
+
for (var S in b.props || {}) d[S] = b.props[S];
|
|
2991
|
+
var C = ze(b.eventable, b.node);
|
|
2992
|
+
if (d._subtractOrigin(C), d.eventable = b.eventable, d.currentTarget = b.node, b.eventable.fire(d), d._addOrigin(C), d.immediatePropagationStopped || d.propagationStopped && f + 1 < l.length && l[f + 1].node !== d.currentTarget) break;
|
|
3153
2993
|
}
|
|
3154
2994
|
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
3155
|
-
var M = d.double ?
|
|
2995
|
+
var M = d.double ? Me({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : d;
|
|
3156
2996
|
n.prevTap = M, n.tapTime = M.timeStamp;
|
|
3157
2997
|
}
|
|
3158
2998
|
return d;
|
|
@@ -3161,15 +3001,15 @@ function Uo() {
|
|
|
3161
3001
|
var n = t.interaction, r = t.pointer, o = t.event, i = t.eventTarget, a = t.type, s = n.getPointerIndex(r), l = n.pointers[s];
|
|
3162
3002
|
if (a === "tap" && (n.pointerWasMoved || !l || l.downTarget !== i)) return [];
|
|
3163
3003
|
for (var d = ue(i), c = { interaction: n, pointer: r, event: o, eventTarget: i, type: a, path: d, targets: [], node: null }, f = 0; f < d.length; f++) {
|
|
3164
|
-
var
|
|
3165
|
-
c.node =
|
|
3004
|
+
var b = d[f];
|
|
3005
|
+
c.node = b, e.fire("pointerEvents:collect-targets", c);
|
|
3166
3006
|
}
|
|
3167
|
-
return a === "hold" && (c.targets = c.targets.filter((function(
|
|
3007
|
+
return a === "hold" && (c.targets = c.targets.filter((function(S) {
|
|
3168
3008
|
var C, M;
|
|
3169
|
-
return
|
|
3009
|
+
return S.eventable.options.holdDuration === ((C = n.pointers[s]) == null || (M = C.hold) == null ? void 0 : M.duration);
|
|
3170
3010
|
}))), c.targets;
|
|
3171
3011
|
}
|
|
3172
|
-
function
|
|
3012
|
+
function jt(t) {
|
|
3173
3013
|
var e = t.interaction, n = t.pointerIndex, r = e.pointers[n].hold;
|
|
3174
3014
|
r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
|
|
3175
3015
|
}
|
|
@@ -3198,7 +3038,7 @@ function Uo() {
|
|
|
3198
3038
|
} }) }, $r = Yr, Vr = { id: "pointer-events/interactableTargets", install: function(t) {
|
|
3199
3039
|
var e = t.Interactable;
|
|
3200
3040
|
e.prototype.pointerEvents = function(r) {
|
|
3201
|
-
return
|
|
3041
|
+
return z(this.events.options, r), this;
|
|
3202
3042
|
};
|
|
3203
3043
|
var n = e.prototype._backCompatOption;
|
|
3204
3044
|
e.prototype._backCompatOption = function(r, o) {
|
|
@@ -3218,7 +3058,7 @@ function Uo() {
|
|
|
3218
3058
|
};
|
|
3219
3059
|
}, "interactable:set": function(t, e) {
|
|
3220
3060
|
var n = t.interactable, r = t.options;
|
|
3221
|
-
|
|
3061
|
+
z(n.events.options, e.pointerEvents.defaults), z(n.events.options, r.pointerEvents || {});
|
|
3222
3062
|
} } }, Ur = Vr, Xr = { id: "pointer-events", install: function(t) {
|
|
3223
3063
|
t.usePlugin(qr), t.usePlugin($r), t.usePlugin(Ur);
|
|
3224
3064
|
} }, Gr = Xr, Kr = { id: "reflow", install: function(t) {
|
|
@@ -3226,17 +3066,17 @@ function Uo() {
|
|
|
3226
3066
|
t.actions.phases.reflow = !0, e.prototype.reflow = function(n) {
|
|
3227
3067
|
return (function(r, o, i) {
|
|
3228
3068
|
for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, d = function() {
|
|
3229
|
-
var f = a[c],
|
|
3230
|
-
if (!
|
|
3231
|
-
var
|
|
3232
|
-
return
|
|
3069
|
+
var f = a[c], b = r.getRect(f);
|
|
3070
|
+
if (!b) return 1;
|
|
3071
|
+
var S, C = Be(i.interactions.list, (function(O) {
|
|
3072
|
+
return O.interacting() && O.interactable === r && O.element === f && O.prepared.name === o.name;
|
|
3233
3073
|
}));
|
|
3234
|
-
if (C) C.move(), l && (
|
|
3235
|
-
C._reflowResolve =
|
|
3074
|
+
if (C) C.move(), l && (S = C._reflowPromise || new s((function(O) {
|
|
3075
|
+
C._reflowResolve = O;
|
|
3236
3076
|
})));
|
|
3237
3077
|
else {
|
|
3238
|
-
var M =
|
|
3239
|
-
return { coords:
|
|
3078
|
+
var M = gt(b), D = /* @__PURE__ */ (function(O) {
|
|
3079
|
+
return { coords: O, get page() {
|
|
3240
3080
|
return this.coords.page;
|
|
3241
3081
|
}, get client() {
|
|
3242
3082
|
return this.coords.client;
|
|
@@ -3263,16 +3103,16 @@ function Uo() {
|
|
|
3263
3103
|
}, preventDefault: function() {
|
|
3264
3104
|
} };
|
|
3265
3105
|
})({ page: { x: M.x, y: M.y }, client: { x: M.x, y: M.y }, timeStamp: i.now() });
|
|
3266
|
-
|
|
3267
|
-
var
|
|
3268
|
-
|
|
3269
|
-
var ae =
|
|
3270
|
-
|
|
3106
|
+
S = (function(O, F, U, ee, q) {
|
|
3107
|
+
var K = O.interactions.new({ pointerType: "reflow" }), ve = { interaction: K, event: q, pointer: q, eventTarget: U, phase: "reflow" };
|
|
3108
|
+
K.interactable = F, K.element = U, K.prevEvent = q, K.updatePointer(q, q, U, !0), qt(K.coords.delta), _t(K.prepared, ee), K._doPhase(ve);
|
|
3109
|
+
var ae = O.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
|
|
3110
|
+
K._reflowResolve = Se;
|
|
3271
3111
|
})) : void 0;
|
|
3272
|
-
return
|
|
3273
|
-
})(i, r, f, o,
|
|
3112
|
+
return K._reflowPromise = be, K.start(ee, F, U), K._interacting ? (K.move(ve), K.end(q)) : (K.stop(), K._reflowResolve()), K.removePointer(q, q), be;
|
|
3113
|
+
})(i, r, f, o, D);
|
|
3274
3114
|
}
|
|
3275
|
-
l && l.push(
|
|
3115
|
+
l && l.push(S);
|
|
3276
3116
|
}, c = 0; c < a.length && !d(); c++) ;
|
|
3277
3117
|
return l && s.all(l).then((function() {
|
|
3278
3118
|
return r;
|
|
@@ -3285,78 +3125,311 @@ function Uo() {
|
|
|
3285
3125
|
r.splice(r.indexOf(o), 1);
|
|
3286
3126
|
})(e.interactions.list, n));
|
|
3287
3127
|
} } }, Jr = Kr;
|
|
3288
|
-
if (
|
|
3289
|
-
|
|
3128
|
+
if (me.use(un), me.use(vn), me.use(Gr), me.use(hr), me.use(Br), me.use(nr), me.use($n), me.use(Un), me.use(Jr), me.default = me, v(h) === "object" && h) try {
|
|
3129
|
+
h.exports = me;
|
|
3290
3130
|
} catch {
|
|
3291
3131
|
}
|
|
3292
|
-
return
|
|
3132
|
+
return me.default = me, me;
|
|
3293
3133
|
}));
|
|
3294
3134
|
})(Je, Je.exports)), Je.exports;
|
|
3295
3135
|
}
|
|
3296
|
-
var
|
|
3297
|
-
const
|
|
3298
|
-
function
|
|
3299
|
-
const
|
|
3300
|
-
|
|
3136
|
+
var Vo = /* @__PURE__ */ $o();
|
|
3137
|
+
const Ze = /* @__PURE__ */ Wo(Vo);
|
|
3138
|
+
function Uo(h) {
|
|
3139
|
+
const p = new DOMParser().parseFromString(h, "text/html");
|
|
3140
|
+
return Array.from(p.querySelectorAll("img")).forEach((v) => {
|
|
3141
|
+
if (!p.body.contains(v) || v.closest(".editor-image-wrapper")) return;
|
|
3142
|
+
const w = v.getAttribute("src") || v.src;
|
|
3143
|
+
if (!w) return;
|
|
3144
|
+
const g = document.createElement("img");
|
|
3145
|
+
g.src = w, v.alt && (g.alt = v.alt), v.title && (g.title = v.title), g.style.maxWidth = "100%", g.style.width = "100%", g.style.height = "auto", g.style.cursor = "pointer", g.draggable = !1;
|
|
3146
|
+
const T = v.getAttribute("width") || v.style.width || (v.naturalWidth > 0 ? `${v.naturalWidth}px` : null), A = document.createElement("div");
|
|
3147
|
+
A.className = "editor-image-wrapper", A.style.display = "inline-block", A.style.position = "relative", A.style.maxWidth = "100%", A.style.width = T && T !== "0px" ? T.includes("px") ? T : `${T}px` : "300px", A.style.height = "auto", A.contentEditable = "false", A.style.boxSizing = "border-box", A.style.touchAction = "none", A.style.userSelect = "none", A.appendChild(g);
|
|
3148
|
+
const k = document.createElement("div");
|
|
3149
|
+
k.className = "editor-image-container", k.style.margin = "10px 0", k.style.textAlign = "left", k.style.display = "block", k.appendChild(A);
|
|
3150
|
+
let _ = v;
|
|
3151
|
+
const I = v.closest("figure"), R = v.closest("picture");
|
|
3152
|
+
if (I && p.body.contains(I))
|
|
3153
|
+
_ = I;
|
|
3154
|
+
else if (R && p.body.contains(R))
|
|
3155
|
+
_ = R;
|
|
3156
|
+
else {
|
|
3157
|
+
let j = v.parentNode;
|
|
3158
|
+
for (; j && j !== p.body && j.parentNode !== p.body && Array.from(j.childNodes).filter(
|
|
3159
|
+
(P) => P.nodeType === Node.ELEMENT_NODE || P.nodeType === Node.TEXT_NODE && P.textContent?.trim()
|
|
3160
|
+
).length === 1; )
|
|
3161
|
+
_ = j, j = j.parentNode;
|
|
3162
|
+
}
|
|
3163
|
+
_ && _.parentNode && p.body.contains(_) ? _.parentNode.replaceChild(k, _) : v.parentNode && p.body.contains(v) && v.parentNode.replaceChild(k, v);
|
|
3164
|
+
}), p.body.innerHTML;
|
|
3165
|
+
}
|
|
3166
|
+
function Xo(h, m) {
|
|
3167
|
+
const p = document.createElement("div");
|
|
3168
|
+
p.classList.add("editor"), p.contentEditable = "true", p.style.color = "#000000", p.style.border = "1px solid #e1e1e1", p.style.height = "400px", p.style.overflowY = "auto", p.style.padding = "15px", p.style.fontFamily = "Arial, sans-serif", p.style.fontSize = "14px", p.style.lineHeight = "1.5", p.style.outline = "none", p.style.backgroundColor = "#ffffff", p.style.borderRadius = "4px", p.style.boxShadow = "inset 0 1px 3px rgba(0,0,0,0.1)", p.style.direction = "ltr", p.style.textAlign = "left", p.style.scrollbarWidth = "none", p.style.msOverflowStyle = "none";
|
|
3169
|
+
const u = document.createElement("style");
|
|
3170
|
+
u.textContent = `
|
|
3171
|
+
.editor::-webkit-scrollbar { display: none; }
|
|
3172
|
+
.editor ul, .editor ol {
|
|
3173
|
+
margin: 0.5em 0;
|
|
3174
|
+
padding-left: 2em;
|
|
3175
|
+
list-style-position: outside;
|
|
3176
|
+
}
|
|
3177
|
+
.editor ul { list-style-type: disc; }
|
|
3178
|
+
.editor ol { list-style-type: decimal; }
|
|
3179
|
+
.editor li {
|
|
3180
|
+
margin: 0.25em 0;
|
|
3181
|
+
display: list-item;
|
|
3182
|
+
}
|
|
3183
|
+
`, document.querySelector("style[data-editor-scrollbar]") || (u.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(u)), p.innerHTML = "", p.addEventListener("dragover", (w) => {
|
|
3184
|
+
w.preventDefault(), w.stopPropagation();
|
|
3185
|
+
}), p.addEventListener("drop", (w) => {
|
|
3186
|
+
w.preventDefault(), w.stopPropagation();
|
|
3187
|
+
const g = w.clientX, T = w.clientY;
|
|
3188
|
+
let A = null;
|
|
3189
|
+
if (document.caretRangeFromPoint)
|
|
3190
|
+
A = document.caretRangeFromPoint(g, T);
|
|
3191
|
+
else if (document.caretPositionFromPoint) {
|
|
3192
|
+
const _ = document.caretPositionFromPoint(g, T);
|
|
3193
|
+
_ && (A = document.createRange(), A.setStart(_.offsetNode, _.offset));
|
|
3194
|
+
}
|
|
3195
|
+
const k = w.dataTransfer?.files;
|
|
3196
|
+
if (k && k.length > 0)
|
|
3197
|
+
for (let _ = 0; _ < k.length; _++) {
|
|
3198
|
+
const I = k[_];
|
|
3199
|
+
if (I.type.startsWith("image/")) {
|
|
3200
|
+
const R = new FileReader();
|
|
3201
|
+
R.onload = (j) => {
|
|
3202
|
+
const N = document.createElement("img");
|
|
3203
|
+
N.src = j.target?.result, N.style.maxWidth = "100%", N.style.width = "100%", N.style.height = "auto", N.style.cursor = "pointer", N.draggable = !1;
|
|
3204
|
+
const P = document.createElement("div");
|
|
3205
|
+
P.className = "editor-image-wrapper", P.style.display = "inline-block", P.style.position = "relative", P.style.maxWidth = "100%", P.style.width = "auto", P.style.height = "auto", P.contentEditable = "false", P.style.userSelect = "none", P.style.boxSizing = "border-box", P.style.touchAction = "none", P.appendChild(N);
|
|
3206
|
+
const H = document.createElement("div");
|
|
3207
|
+
if (H.className = "editor-image-container", H.style.margin = "10px 0", H.style.textAlign = "left", H.style.display = "block", H.appendChild(P), A)
|
|
3208
|
+
try {
|
|
3209
|
+
A.insertNode(H);
|
|
3210
|
+
const L = window.getSelection();
|
|
3211
|
+
if (L) {
|
|
3212
|
+
L.removeAllRanges();
|
|
3213
|
+
const V = document.createRange();
|
|
3214
|
+
V.setStartAfter(H), V.collapse(!0), L.addRange(V), de(V);
|
|
3215
|
+
}
|
|
3216
|
+
} catch {
|
|
3217
|
+
p.appendChild(H);
|
|
3218
|
+
}
|
|
3219
|
+
else
|
|
3220
|
+
p.appendChild(H);
|
|
3221
|
+
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus();
|
|
3222
|
+
}, R.readAsDataURL(I);
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
}), p.addEventListener("copy", (w) => {
|
|
3226
|
+
const g = window.getSelection();
|
|
3227
|
+
if (!g || g.rangeCount === 0) return;
|
|
3228
|
+
const A = g.getRangeAt(0).cloneContents(), k = document.createElement("div");
|
|
3229
|
+
k.appendChild(A), k.querySelectorAll(".editor-image-wrapper").forEach((N) => {
|
|
3230
|
+
const P = N.querySelector("img");
|
|
3231
|
+
if (P) {
|
|
3232
|
+
const H = P, L = N;
|
|
3233
|
+
L.style.width && H.setAttribute(
|
|
3234
|
+
"width",
|
|
3235
|
+
parseInt(L.style.width).toString()
|
|
3236
|
+
);
|
|
3237
|
+
}
|
|
3238
|
+
}), k.querySelectorAll(".editor-image-container").forEach((N) => {
|
|
3239
|
+
const P = N;
|
|
3240
|
+
P.style.textAlign && P.setAttribute("data-align", P.style.textAlign);
|
|
3241
|
+
});
|
|
3242
|
+
const R = k.innerHTML, j = g.toString();
|
|
3243
|
+
w.clipboardData?.setData("text/html", R), w.clipboardData?.setData("text/plain", j), w.preventDefault();
|
|
3244
|
+
}), p.addEventListener("cut", (w) => {
|
|
3245
|
+
const g = window.getSelection();
|
|
3246
|
+
if (!g || g.rangeCount === 0) return;
|
|
3247
|
+
const T = g.getRangeAt(0), A = T.cloneContents(), k = document.createElement("div");
|
|
3248
|
+
k.appendChild(A), k.querySelectorAll(".editor-image-wrapper").forEach((N) => {
|
|
3249
|
+
const P = N.querySelector("img");
|
|
3250
|
+
if (P) {
|
|
3251
|
+
const H = P, L = N;
|
|
3252
|
+
L.style.width && H.setAttribute(
|
|
3253
|
+
"width",
|
|
3254
|
+
parseInt(L.style.width).toString()
|
|
3255
|
+
);
|
|
3256
|
+
}
|
|
3257
|
+
}), k.querySelectorAll(".editor-image-container").forEach((N) => {
|
|
3258
|
+
const P = N;
|
|
3259
|
+
P.style.textAlign && P.setAttribute("data-align", P.style.textAlign);
|
|
3260
|
+
});
|
|
3261
|
+
const R = k.innerHTML, j = g.toString();
|
|
3262
|
+
w.clipboardData?.setData("text/html", R), w.clipboardData?.setData("text/plain", j), w.preventDefault(), T.deleteContents(), p.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3263
|
+
}), p.addEventListener("paste", async (w) => {
|
|
3264
|
+
w.preventDefault();
|
|
3265
|
+
const g = w.clipboardData;
|
|
3266
|
+
if (!g) return;
|
|
3267
|
+
const A = Array.from(g.items).filter((I) => I.type.startsWith("image/"));
|
|
3268
|
+
if (A.length > 0) {
|
|
3269
|
+
for (const I of A) {
|
|
3270
|
+
const R = I.getAsFile();
|
|
3271
|
+
if (R) {
|
|
3272
|
+
const j = new FileReader();
|
|
3273
|
+
j.onload = (N) => {
|
|
3274
|
+
const P = N.target?.result;
|
|
3275
|
+
if (P) {
|
|
3276
|
+
const H = document.createElement("img");
|
|
3277
|
+
H.src = P, H.style.maxWidth = "100%", H.style.width = "100%", H.style.height = "auto", H.style.cursor = "pointer", H.draggable = !1;
|
|
3278
|
+
const L = document.createElement("div");
|
|
3279
|
+
L.className = "editor-image-wrapper", L.style.display = "inline-block", L.style.position = "relative", L.style.maxWidth = "100%", L.style.width = "auto", L.style.height = "auto", L.contentEditable = "false", L.style.boxSizing = "border-box", L.style.touchAction = "none", L.style.userSelect = "none", L.appendChild(H);
|
|
3280
|
+
const V = document.createElement("div");
|
|
3281
|
+
V.className = "editor-image-container", V.style.margin = "10px 0", V.style.textAlign = "left", V.style.display = "block", V.appendChild(L);
|
|
3282
|
+
const Z = window.getSelection();
|
|
3283
|
+
if (Z && Z.rangeCount > 0) {
|
|
3284
|
+
Z.getRangeAt(0).insertNode(V), Z.removeAllRanges();
|
|
3285
|
+
const te = document.createRange();
|
|
3286
|
+
te.setStartAfter(V), te.collapse(!0), Z.addRange(te);
|
|
3287
|
+
} else
|
|
3288
|
+
p.appendChild(V);
|
|
3289
|
+
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
|
|
3290
|
+
}
|
|
3291
|
+
}, j.readAsDataURL(R);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
let k = g.getData("text/html");
|
|
3297
|
+
k ? k = Uo(k) : k = g.getData("text/plain");
|
|
3298
|
+
const _ = window.getSelection();
|
|
3299
|
+
if (_ && _.rangeCount > 0) {
|
|
3300
|
+
const I = _.getRangeAt(0), R = document.createElement("div");
|
|
3301
|
+
R.innerHTML = k;
|
|
3302
|
+
const j = document.createDocumentFragment();
|
|
3303
|
+
for (; R.firstChild; )
|
|
3304
|
+
j.appendChild(R.firstChild);
|
|
3305
|
+
I.deleteContents(), I.insertNode(j), I.collapse(!1), _.removeAllRanges(), _.addRange(I);
|
|
3306
|
+
} else {
|
|
3307
|
+
const I = document.createElement("div");
|
|
3308
|
+
for (I.innerHTML = k; I.firstChild; )
|
|
3309
|
+
p.appendChild(I.firstChild);
|
|
3310
|
+
}
|
|
3311
|
+
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), de();
|
|
3312
|
+
}), p.addEventListener("click", (w) => {
|
|
3313
|
+
const g = w.target;
|
|
3314
|
+
let T = null;
|
|
3315
|
+
if (g.tagName === "IMG" ? T = g.parentElement : g.classList.contains("editor-image-wrapper") && (T = g), T && T.classList.contains("editor-image-wrapper")) {
|
|
3316
|
+
w.preventDefault(), w.stopPropagation(), p.querySelectorAll(".editor-image-wrapper").forEach((_) => {
|
|
3317
|
+
if (_ !== T && _.classList.contains("resizable")) {
|
|
3318
|
+
const I = _, R = I.getBoundingClientRect(), j = Math.round(R.width) + "px", N = Math.round(R.height) + "px";
|
|
3319
|
+
Ze(I).unset(), I.classList.remove("resizable"), I.style.border = "none", I.style.transform = "", I.dataset.x = "", I.dataset.y = "", I.style.width = j, I.style.height = N, I.contentEditable = "false";
|
|
3320
|
+
const P = I.querySelector("img");
|
|
3321
|
+
P && (P.style.width = "100%", P.style.height = "100%");
|
|
3322
|
+
}
|
|
3323
|
+
}), m(T);
|
|
3324
|
+
const k = T.parentElement;
|
|
3325
|
+
k && (k.classList.contains("editor-image-container") || k.tagName === "DIV" || k.tagName === "P") && (window.__selectedImageContainer = k, console.log("Selected image container:", k));
|
|
3326
|
+
} else
|
|
3327
|
+
window.__selectedImageContainer = null, p.querySelectorAll(
|
|
3328
|
+
".editor-image-wrapper.resizable"
|
|
3329
|
+
).forEach((k) => {
|
|
3330
|
+
const _ = k, I = _.getBoundingClientRect(), R = Math.round(I.width) + "px", j = Math.round(I.height) + "px";
|
|
3331
|
+
Ze(_).unset(), _.classList.remove("resizable"), _.style.border = "none", _.style.transform = "", _.dataset.x = "", _.dataset.y = "", _.style.width = R, _.style.height = j, _.contentEditable = "false";
|
|
3332
|
+
const N = _.querySelector("img");
|
|
3333
|
+
N && (N.style.width = "100%", N.style.height = "100%");
|
|
3334
|
+
}), de();
|
|
3335
|
+
}), p.addEventListener("keyup", () => de()), p.addEventListener("mouseup", () => de()), p.addEventListener("focus", () => de()), window.addEventListener("selectionchange", () => {
|
|
3336
|
+
try {
|
|
3337
|
+
const w = window.getSelection();
|
|
3338
|
+
if (!w || !w.anchorNode) return;
|
|
3339
|
+
let g = w.anchorNode;
|
|
3340
|
+
for (; g && g.nodeType !== Node.ELEMENT_NODE; )
|
|
3341
|
+
g = g.parentNode;
|
|
3342
|
+
if (!g) return;
|
|
3343
|
+
p.contains(g) && de();
|
|
3344
|
+
} catch {
|
|
3345
|
+
}
|
|
3346
|
+
});
|
|
3347
|
+
const v = () => {
|
|
3348
|
+
if (!p.firstChild) {
|
|
3349
|
+
p.innerHTML = "<p><br></p>";
|
|
3350
|
+
return;
|
|
3351
|
+
}
|
|
3352
|
+
const w = Array.from(p.childNodes);
|
|
3353
|
+
for (const g of w)
|
|
3354
|
+
if (g.nodeType === Node.TEXT_NODE && g.textContent?.trim()) {
|
|
3355
|
+
const T = window.getSelection();
|
|
3356
|
+
let A = null;
|
|
3357
|
+
T && T.rangeCount > 0 && (A = T.getRangeAt(0).cloneRange());
|
|
3358
|
+
const k = document.createElement("p");
|
|
3359
|
+
if (g.parentNode?.insertBefore(k, g), k.appendChild(g), A && T)
|
|
3360
|
+
try {
|
|
3361
|
+
T.removeAllRanges(), T.addRange(A);
|
|
3362
|
+
} catch {
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
};
|
|
3366
|
+
let y = null;
|
|
3367
|
+
return p.addEventListener("input", () => {
|
|
3368
|
+
y && clearTimeout(y), y = setTimeout(() => v(), 100);
|
|
3369
|
+
}), !p.innerHTML || p.innerHTML.trim() === "" ? p.innerHTML = "<p><br></p>" : v(), p;
|
|
3370
|
+
}
|
|
3371
|
+
function On(h) {
|
|
3372
|
+
const m = document.createElement("input");
|
|
3373
|
+
m.type = "file", m.accept = "image/*", m.onchange = (p) => {
|
|
3301
3374
|
const u = p.target.files?.[0];
|
|
3302
3375
|
if (u) {
|
|
3303
|
-
const
|
|
3304
|
-
|
|
3376
|
+
const v = new FileReader();
|
|
3377
|
+
v.onload = (y) => {
|
|
3305
3378
|
const w = document.createElement("img");
|
|
3306
|
-
w.src =
|
|
3307
|
-
const
|
|
3308
|
-
|
|
3309
|
-
const
|
|
3310
|
-
|
|
3379
|
+
w.src = y.target?.result, w.style.maxWidth = "100%", w.style.width = "100%", w.style.height = "auto", w.style.cursor = "pointer", w.draggable = !1;
|
|
3380
|
+
const g = document.createElement("div");
|
|
3381
|
+
g.className = "editor-image-wrapper", g.style.display = "inline-block", g.style.position = "relative", g.style.maxWidth = "100%", g.style.width = "auto", g.style.height = "auto", g.contentEditable = "false", g.style.boxSizing = "border-box", g.style.touchAction = "none", g.style.userSelect = "none", g.appendChild(w);
|
|
3382
|
+
const T = document.createElement("div");
|
|
3383
|
+
T.className = "editor-image-container", T.style.margin = "10px 0", T.style.textAlign = "left", T.style.display = "block", T.appendChild(g);
|
|
3311
3384
|
try {
|
|
3312
|
-
|
|
3313
|
-
const
|
|
3314
|
-
if (
|
|
3315
|
-
|
|
3316
|
-
const
|
|
3317
|
-
|
|
3385
|
+
Re();
|
|
3386
|
+
const A = window.getSelection();
|
|
3387
|
+
if (A && A.rangeCount > 0) {
|
|
3388
|
+
A.getRangeAt(0).insertNode(T), A.removeAllRanges();
|
|
3389
|
+
const _ = document.createRange();
|
|
3390
|
+
_.setStartAfter(T), _.collapse(!0), A.addRange(_), de(_);
|
|
3318
3391
|
} else
|
|
3319
|
-
|
|
3392
|
+
h.appendChild(T), h.focus(), de();
|
|
3320
3393
|
} catch {
|
|
3321
|
-
|
|
3394
|
+
h.appendChild(T), h.focus(), de();
|
|
3322
3395
|
}
|
|
3323
|
-
|
|
3324
|
-
},
|
|
3396
|
+
h.dispatchEvent(new Event("input", { bubbles: !0 })), h.focus();
|
|
3397
|
+
}, v.readAsDataURL(u);
|
|
3325
3398
|
}
|
|
3326
|
-
},
|
|
3399
|
+
}, m.click();
|
|
3327
3400
|
}
|
|
3328
|
-
function Go(
|
|
3329
|
-
let
|
|
3330
|
-
if (
|
|
3331
|
-
const p =
|
|
3401
|
+
function Go(h) {
|
|
3402
|
+
let m = null;
|
|
3403
|
+
if (h.tagName === "IMG" ? m = h.parentElement : m = h, !m) return;
|
|
3404
|
+
const p = m.querySelector("img");
|
|
3332
3405
|
if (p)
|
|
3333
|
-
if (
|
|
3334
|
-
const u =
|
|
3335
|
-
|
|
3336
|
-
const w =
|
|
3406
|
+
if (m.classList.contains("resizable")) {
|
|
3407
|
+
const u = m.getBoundingClientRect(), v = Math.round(u.width) + "px", y = Math.round(u.height) + "px";
|
|
3408
|
+
Ze(m).unset(), m.classList.remove("resizable"), m.style.border = "none", m.style.transform = "", m.dataset.x = "", m.dataset.y = "", m.style.width = v, m.style.height = y, m.contentEditable = "false", p && (p.style.width = "100%", p.style.height = "100%");
|
|
3409
|
+
const w = m.closest(".editor");
|
|
3337
3410
|
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3338
3411
|
} else {
|
|
3339
|
-
|
|
3340
|
-
const u =
|
|
3341
|
-
|
|
3412
|
+
m.classList.add("resizable"), m.style.border = "2px dashed #007bff", m.style.position = "relative", m.style.userSelect = "none";
|
|
3413
|
+
const u = m.getBoundingClientRect();
|
|
3414
|
+
m.style.width = u.width + "px", m.style.height = u.height + "px", p && (p.style.width = "100%", p.style.height = "100%"), Ze(m).resizable({
|
|
3342
3415
|
edges: { left: !0, right: !0, bottom: !0, top: !0 },
|
|
3343
3416
|
listeners: {
|
|
3344
|
-
move: (
|
|
3345
|
-
const
|
|
3346
|
-
Object.assign(
|
|
3347
|
-
width: `${
|
|
3348
|
-
height: `${
|
|
3417
|
+
move: (v) => {
|
|
3418
|
+
const y = v.target;
|
|
3419
|
+
Object.assign(y.style, {
|
|
3420
|
+
width: `${v.rect.width}px`,
|
|
3421
|
+
height: `${v.rect.height}px`
|
|
3349
3422
|
});
|
|
3350
|
-
const w =
|
|
3423
|
+
const w = y.closest(".editor");
|
|
3351
3424
|
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3352
3425
|
},
|
|
3353
|
-
end: (
|
|
3354
|
-
const w =
|
|
3426
|
+
end: (v) => {
|
|
3427
|
+
const w = v.target.closest(".editor");
|
|
3355
3428
|
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3356
3429
|
}
|
|
3357
3430
|
},
|
|
3358
3431
|
modifiers: [
|
|
3359
|
-
|
|
3432
|
+
Ze.modifiers.restrictSize({ min: { width: 50, height: 50 } })
|
|
3360
3433
|
],
|
|
3361
3434
|
inertia: !0
|
|
3362
3435
|
});
|
|
@@ -3367,14 +3440,14 @@ class Ko {
|
|
|
3367
3440
|
toolbar;
|
|
3368
3441
|
editor;
|
|
3369
3442
|
constructor() {
|
|
3370
|
-
this.container = document.createElement("div"), this.container.classList.add("editor-container"), this.editor =
|
|
3443
|
+
this.container = document.createElement("div"), this.container.classList.add("editor-container"), this.editor = Xo(
|
|
3371
3444
|
() => On(this.editor),
|
|
3372
3445
|
(p) => Go(p)
|
|
3373
3446
|
), this.toolbar = qo(this.container);
|
|
3374
|
-
const
|
|
3447
|
+
const m = this.toolbar.querySelector(
|
|
3375
3448
|
'[role="button"][title="Insert Image"]'
|
|
3376
3449
|
);
|
|
3377
|
-
|
|
3450
|
+
m && (m.addEventListener("mousedown", () => de()), m.onclick = () => On(this.editor)), this.container.appendChild(this.toolbar), this.container.appendChild(this.editor);
|
|
3378
3451
|
}
|
|
3379
3452
|
getElement() {
|
|
3380
3453
|
return this.container;
|
|
@@ -3382,8 +3455,8 @@ class Ko {
|
|
|
3382
3455
|
getHTML() {
|
|
3383
3456
|
return this.editor.innerHTML;
|
|
3384
3457
|
}
|
|
3385
|
-
setHTML(
|
|
3386
|
-
this.editor.innerHTML =
|
|
3458
|
+
setHTML(m) {
|
|
3459
|
+
this.editor.innerHTML = m, this.wrapUnwrappedImages();
|
|
3387
3460
|
}
|
|
3388
3461
|
wrapUnwrappedImages() {
|
|
3389
3462
|
Array.from(this.editor.querySelectorAll("img")).forEach((p) => {
|
|
@@ -3391,32 +3464,32 @@ class Ko {
|
|
|
3391
3464
|
return;
|
|
3392
3465
|
const u = p.parentElement;
|
|
3393
3466
|
if (u && u.classList.contains("editor-image-wrapper")) {
|
|
3394
|
-
const
|
|
3395
|
-
|
|
3467
|
+
const _ = p;
|
|
3468
|
+
_.style.maxWidth = "100%", _.style.width = "100%", _.style.height = "auto", _.style.cursor = "pointer", _.draggable = !1, u.contentEditable = "false", u.style.display || (u.style.display = "inline-block"), u.style.position || (u.style.position = "relative"), u.style.maxWidth = "100%", u.style.boxSizing = "border-box", u.style.touchAction = "none", u.style.userSelect = "none", (!u.style.width || u.style.width === "0px") && (u.style.width = "300px");
|
|
3396
3469
|
return;
|
|
3397
3470
|
}
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
const w = (
|
|
3403
|
-
if (!
|
|
3404
|
-
const
|
|
3405
|
-
if (!
|
|
3406
|
-
const
|
|
3407
|
-
return Number.isFinite(
|
|
3408
|
-
},
|
|
3409
|
-
|
|
3410
|
-
const
|
|
3411
|
-
if (
|
|
3412
|
-
const
|
|
3413
|
-
|
|
3471
|
+
const v = document.createElement("div");
|
|
3472
|
+
v.className = "editor-image-wrapper", v.style.display = "inline-block", v.style.position = "relative", v.style.maxWidth = "100%", v.style.width = "300px", v.contentEditable = "false", v.style.userSelect = "none", v.style.boxSizing = "border-box", v.style.touchAction = "none";
|
|
3473
|
+
const y = p;
|
|
3474
|
+
y.style.maxWidth = "100%", y.style.width = "100%", y.style.height = "auto", y.style.cursor = "pointer", y.draggable = !1;
|
|
3475
|
+
const w = (_) => {
|
|
3476
|
+
if (!_) return null;
|
|
3477
|
+
const I = String(_).match(/(\d+(?:\.\d+)?)/);
|
|
3478
|
+
if (!I) return null;
|
|
3479
|
+
const R = Math.round(Number(I[1]));
|
|
3480
|
+
return Number.isFinite(R) && R > 0 ? R : null;
|
|
3481
|
+
}, g = w(y.getAttribute("width")) ?? w(y.style.width) ?? w(y.getAttribute("style"));
|
|
3482
|
+
g ? v.style.width = `${g}px` : y.onload = () => {
|
|
3483
|
+
const _ = this.editor.clientWidth || 0, I = y.naturalWidth || 0;
|
|
3484
|
+
if (I > 0) {
|
|
3485
|
+
const R = _ > 0 ? Math.min(I, _) : I;
|
|
3486
|
+
v.style.width = `${R}px`;
|
|
3414
3487
|
}
|
|
3415
3488
|
};
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3418
|
-
const
|
|
3419
|
-
|
|
3489
|
+
const T = document.createElement("div");
|
|
3490
|
+
T.className = "editor-image-container", T.style.margin = "10px 0", T.style.textAlign = "left", T.style.display = "block";
|
|
3491
|
+
const A = y.closest("figure") ?? y.closest(".se-image-container") ?? y, k = A.parentNode;
|
|
3492
|
+
k && this.editor.contains(A) && k.contains(A) && (v.appendChild(y), T.appendChild(v), k.replaceChild(T, A));
|
|
3420
3493
|
}), this.editor.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3421
3494
|
}
|
|
3422
3495
|
}
|
|
@@ -3425,43 +3498,43 @@ var Dn;
|
|
|
3425
3498
|
function Jo() {
|
|
3426
3499
|
if (Dn) return Ge;
|
|
3427
3500
|
Dn = 1;
|
|
3428
|
-
var
|
|
3429
|
-
function p(u,
|
|
3501
|
+
var h = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
|
|
3502
|
+
function p(u, v, y) {
|
|
3430
3503
|
var w = null;
|
|
3431
|
-
if (
|
|
3432
|
-
|
|
3433
|
-
for (var
|
|
3434
|
-
|
|
3435
|
-
} else
|
|
3436
|
-
return
|
|
3437
|
-
$$typeof:
|
|
3504
|
+
if (y !== void 0 && (w = "" + y), v.key !== void 0 && (w = "" + v.key), "key" in v) {
|
|
3505
|
+
y = {};
|
|
3506
|
+
for (var g in v)
|
|
3507
|
+
g !== "key" && (y[g] = v[g]);
|
|
3508
|
+
} else y = v;
|
|
3509
|
+
return v = y.ref, {
|
|
3510
|
+
$$typeof: h,
|
|
3438
3511
|
type: u,
|
|
3439
3512
|
key: w,
|
|
3440
|
-
ref:
|
|
3441
|
-
props:
|
|
3513
|
+
ref: v !== void 0 ? v : null,
|
|
3514
|
+
props: y
|
|
3442
3515
|
};
|
|
3443
3516
|
}
|
|
3444
|
-
return Ge.Fragment =
|
|
3517
|
+
return Ge.Fragment = m, Ge.jsx = p, Ge.jsxs = p, Ge;
|
|
3445
3518
|
}
|
|
3446
3519
|
var Ke = {};
|
|
3447
3520
|
var Nn;
|
|
3448
3521
|
function Qo() {
|
|
3449
3522
|
return Nn || (Nn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3450
|
-
function
|
|
3523
|
+
function h(E) {
|
|
3451
3524
|
if (E == null) return null;
|
|
3452
3525
|
if (typeof E == "function")
|
|
3453
3526
|
return E.$$typeof === ce ? null : E.displayName || E.name || null;
|
|
3454
3527
|
if (typeof E == "string") return E;
|
|
3455
3528
|
switch (E) {
|
|
3456
|
-
case
|
|
3529
|
+
case P:
|
|
3457
3530
|
return "Fragment";
|
|
3458
|
-
case
|
|
3531
|
+
case L:
|
|
3459
3532
|
return "Profiler";
|
|
3460
|
-
case
|
|
3533
|
+
case H:
|
|
3461
3534
|
return "StrictMode";
|
|
3462
|
-
case
|
|
3535
|
+
case te:
|
|
3463
3536
|
return "Suspense";
|
|
3464
|
-
case
|
|
3537
|
+
case x:
|
|
3465
3538
|
return "SuspenseList";
|
|
3466
3539
|
case le:
|
|
3467
3540
|
return "Activity";
|
|
@@ -3470,100 +3543,100 @@ function Qo() {
|
|
|
3470
3543
|
switch (typeof E.tag == "number" && console.error(
|
|
3471
3544
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
3472
3545
|
), E.$$typeof) {
|
|
3473
|
-
case
|
|
3546
|
+
case N:
|
|
3474
3547
|
return "Portal";
|
|
3475
|
-
case ne:
|
|
3476
|
-
return E.displayName || "Context";
|
|
3477
3548
|
case Z:
|
|
3549
|
+
return E.displayName || "Context";
|
|
3550
|
+
case V:
|
|
3478
3551
|
return (E._context.displayName || "Context") + ".Consumer";
|
|
3479
3552
|
case ie:
|
|
3480
|
-
var
|
|
3481
|
-
return E = E.displayName, E || (E =
|
|
3482
|
-
case
|
|
3483
|
-
return
|
|
3484
|
-
case
|
|
3485
|
-
|
|
3553
|
+
var B = E.render;
|
|
3554
|
+
return E = E.displayName, E || (E = B.displayName || B.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
|
|
3555
|
+
case ne:
|
|
3556
|
+
return B = E.displayName || null, B !== null ? B : h(E.type) || "Memo";
|
|
3557
|
+
case W:
|
|
3558
|
+
B = E._payload, E = E._init;
|
|
3486
3559
|
try {
|
|
3487
|
-
return
|
|
3560
|
+
return h(E(B));
|
|
3488
3561
|
} catch {
|
|
3489
3562
|
}
|
|
3490
3563
|
}
|
|
3491
3564
|
return null;
|
|
3492
3565
|
}
|
|
3493
|
-
function
|
|
3566
|
+
function m(E) {
|
|
3494
3567
|
return "" + E;
|
|
3495
3568
|
}
|
|
3496
3569
|
function p(E) {
|
|
3497
3570
|
try {
|
|
3498
|
-
|
|
3499
|
-
var
|
|
3571
|
+
m(E);
|
|
3572
|
+
var B = !1;
|
|
3500
3573
|
} catch {
|
|
3501
|
-
|
|
3574
|
+
B = !0;
|
|
3502
3575
|
}
|
|
3503
|
-
if (
|
|
3504
|
-
|
|
3505
|
-
var
|
|
3506
|
-
return
|
|
3507
|
-
|
|
3576
|
+
if (B) {
|
|
3577
|
+
B = console;
|
|
3578
|
+
var Y = B.error, G = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
|
|
3579
|
+
return Y.call(
|
|
3580
|
+
B,
|
|
3508
3581
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3509
|
-
|
|
3510
|
-
),
|
|
3582
|
+
G
|
|
3583
|
+
), m(E);
|
|
3511
3584
|
}
|
|
3512
3585
|
}
|
|
3513
3586
|
function u(E) {
|
|
3514
|
-
if (E ===
|
|
3515
|
-
if (typeof E == "object" && E !== null && E.$$typeof ===
|
|
3587
|
+
if (E === P) return "<>";
|
|
3588
|
+
if (typeof E == "object" && E !== null && E.$$typeof === W)
|
|
3516
3589
|
return "<...>";
|
|
3517
3590
|
try {
|
|
3518
|
-
var
|
|
3519
|
-
return
|
|
3591
|
+
var B = h(E);
|
|
3592
|
+
return B ? "<" + B + ">" : "<...>";
|
|
3520
3593
|
} catch {
|
|
3521
3594
|
return "<...>";
|
|
3522
3595
|
}
|
|
3523
3596
|
}
|
|
3524
|
-
function
|
|
3525
|
-
var E =
|
|
3597
|
+
function v() {
|
|
3598
|
+
var E = J.A;
|
|
3526
3599
|
return E === null ? null : E.getOwner();
|
|
3527
3600
|
}
|
|
3528
|
-
function
|
|
3601
|
+
function y() {
|
|
3529
3602
|
return Error("react-stack-top-frame");
|
|
3530
3603
|
}
|
|
3531
3604
|
function w(E) {
|
|
3532
|
-
if (
|
|
3533
|
-
var
|
|
3534
|
-
if (
|
|
3605
|
+
if (Q.call(E, "key")) {
|
|
3606
|
+
var B = Object.getOwnPropertyDescriptor(E, "key").get;
|
|
3607
|
+
if (B && B.isReactWarning) return !1;
|
|
3535
3608
|
}
|
|
3536
3609
|
return E.key !== void 0;
|
|
3537
3610
|
}
|
|
3538
|
-
function
|
|
3539
|
-
function
|
|
3540
|
-
|
|
3611
|
+
function g(E, B) {
|
|
3612
|
+
function Y() {
|
|
3613
|
+
re || (re = !0, console.error(
|
|
3541
3614
|
"%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)",
|
|
3542
|
-
|
|
3615
|
+
B
|
|
3543
3616
|
));
|
|
3544
3617
|
}
|
|
3545
|
-
|
|
3546
|
-
get:
|
|
3618
|
+
Y.isReactWarning = !0, Object.defineProperty(E, "key", {
|
|
3619
|
+
get: Y,
|
|
3547
3620
|
configurable: !0
|
|
3548
3621
|
});
|
|
3549
3622
|
}
|
|
3550
|
-
function
|
|
3551
|
-
var E =
|
|
3623
|
+
function T() {
|
|
3624
|
+
var E = h(this.type);
|
|
3552
3625
|
return se[E] || (se[E] = !0, console.error(
|
|
3553
3626
|
"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."
|
|
3554
3627
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
3555
3628
|
}
|
|
3556
|
-
function
|
|
3557
|
-
var ue =
|
|
3629
|
+
function A(E, B, Y, G, xe, we) {
|
|
3630
|
+
var ue = Y.ref;
|
|
3558
3631
|
return E = {
|
|
3559
|
-
$$typeof:
|
|
3632
|
+
$$typeof: j,
|
|
3560
3633
|
type: E,
|
|
3561
|
-
key:
|
|
3562
|
-
props:
|
|
3563
|
-
_owner:
|
|
3634
|
+
key: B,
|
|
3635
|
+
props: Y,
|
|
3636
|
+
_owner: G
|
|
3564
3637
|
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(E, "ref", {
|
|
3565
3638
|
enumerable: !1,
|
|
3566
|
-
get:
|
|
3639
|
+
get: T
|
|
3567
3640
|
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
3568
3641
|
configurable: !1,
|
|
3569
3642
|
enumerable: !1,
|
|
@@ -3586,126 +3659,126 @@ function Qo() {
|
|
|
3586
3659
|
value: we
|
|
3587
3660
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
3588
3661
|
}
|
|
3589
|
-
function
|
|
3590
|
-
var ue =
|
|
3662
|
+
function k(E, B, Y, G, xe, we) {
|
|
3663
|
+
var ue = B.children;
|
|
3591
3664
|
if (ue !== void 0)
|
|
3592
|
-
if (
|
|
3593
|
-
if (
|
|
3594
|
-
for (
|
|
3595
|
-
|
|
3665
|
+
if (G)
|
|
3666
|
+
if (X(ue)) {
|
|
3667
|
+
for (G = 0; G < ue.length; G++)
|
|
3668
|
+
_(ue[G]);
|
|
3596
3669
|
Object.freeze && Object.freeze(ue);
|
|
3597
3670
|
} else
|
|
3598
3671
|
console.error(
|
|
3599
3672
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3600
3673
|
);
|
|
3601
|
-
else
|
|
3602
|
-
if (
|
|
3603
|
-
ue =
|
|
3604
|
-
var Ee = Object.keys(
|
|
3605
|
-
return
|
|
3674
|
+
else _(ue);
|
|
3675
|
+
if (Q.call(B, "key")) {
|
|
3676
|
+
ue = h(E);
|
|
3677
|
+
var Ee = Object.keys(B).filter(function(et) {
|
|
3678
|
+
return et !== "key";
|
|
3606
3679
|
});
|
|
3607
|
-
|
|
3680
|
+
G = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", he[ue + G] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
3608
3681
|
`A props object containing a "key" prop is being spread into JSX:
|
|
3609
3682
|
let props = %s;
|
|
3610
3683
|
<%s {...props} />
|
|
3611
3684
|
React keys must be passed directly to JSX without using spread:
|
|
3612
3685
|
let props = %s;
|
|
3613
3686
|
<%s key={someKey} {...props} />`,
|
|
3614
|
-
|
|
3687
|
+
G,
|
|
3615
3688
|
ue,
|
|
3616
3689
|
Ee,
|
|
3617
3690
|
ue
|
|
3618
|
-
), he[ue +
|
|
3619
|
-
}
|
|
3620
|
-
if (ue = null,
|
|
3621
|
-
|
|
3622
|
-
for (var
|
|
3623
|
-
|
|
3624
|
-
} else
|
|
3625
|
-
return ue &&
|
|
3626
|
-
|
|
3691
|
+
), he[ue + G] = !0);
|
|
3692
|
+
}
|
|
3693
|
+
if (ue = null, Y !== void 0 && (p(Y), ue = "" + Y), w(B) && (p(B.key), ue = "" + B.key), "key" in B) {
|
|
3694
|
+
Y = {};
|
|
3695
|
+
for (var z in B)
|
|
3696
|
+
z !== "key" && (Y[z] = B[z]);
|
|
3697
|
+
} else Y = B;
|
|
3698
|
+
return ue && g(
|
|
3699
|
+
Y,
|
|
3627
3700
|
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
3628
|
-
),
|
|
3701
|
+
), A(
|
|
3629
3702
|
E,
|
|
3630
3703
|
ue,
|
|
3631
|
-
|
|
3632
|
-
|
|
3704
|
+
Y,
|
|
3705
|
+
v(),
|
|
3633
3706
|
xe,
|
|
3634
3707
|
we
|
|
3635
3708
|
);
|
|
3636
3709
|
}
|
|
3637
|
-
function
|
|
3638
|
-
|
|
3710
|
+
function _(E) {
|
|
3711
|
+
I(E) ? E._store && (E._store.validated = 1) : typeof E == "object" && E !== null && E.$$typeof === W && (E._payload.status === "fulfilled" ? I(E._payload.value) && E._payload.value._store && (E._payload.value._store.validated = 1) : E._store && (E._store.validated = 1));
|
|
3639
3712
|
}
|
|
3640
|
-
function
|
|
3641
|
-
return typeof E == "object" && E !== null && E.$$typeof ===
|
|
3713
|
+
function I(E) {
|
|
3714
|
+
return typeof E == "object" && E !== null && E.$$typeof === j;
|
|
3642
3715
|
}
|
|
3643
|
-
var
|
|
3716
|
+
var R = Qr, j = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), H = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), te = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), ne = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), J = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, X = Array.isArray, oe = console.createTask ? console.createTask : function() {
|
|
3644
3717
|
return null;
|
|
3645
3718
|
};
|
|
3646
|
-
|
|
3719
|
+
R = {
|
|
3647
3720
|
react_stack_bottom_frame: function(E) {
|
|
3648
3721
|
return E();
|
|
3649
3722
|
}
|
|
3650
3723
|
};
|
|
3651
|
-
var
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
)(), fe = oe(u(
|
|
3655
|
-
Ke.Fragment =
|
|
3656
|
-
var
|
|
3657
|
-
return
|
|
3724
|
+
var re, se = {}, pe = R.react_stack_bottom_frame.bind(
|
|
3725
|
+
R,
|
|
3726
|
+
y
|
|
3727
|
+
)(), fe = oe(u(y)), he = {};
|
|
3728
|
+
Ke.Fragment = P, Ke.jsx = function(E, B, Y) {
|
|
3729
|
+
var G = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
3730
|
+
return k(
|
|
3658
3731
|
E,
|
|
3659
|
-
|
|
3660
|
-
|
|
3732
|
+
B,
|
|
3733
|
+
Y,
|
|
3661
3734
|
!1,
|
|
3662
|
-
|
|
3663
|
-
|
|
3735
|
+
G ? Error("react-stack-top-frame") : pe,
|
|
3736
|
+
G ? oe(u(E)) : fe
|
|
3664
3737
|
);
|
|
3665
|
-
}, Ke.jsxs = function(E,
|
|
3666
|
-
var
|
|
3667
|
-
return
|
|
3738
|
+
}, Ke.jsxs = function(E, B, Y) {
|
|
3739
|
+
var G = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
3740
|
+
return k(
|
|
3668
3741
|
E,
|
|
3669
|
-
|
|
3670
|
-
|
|
3742
|
+
B,
|
|
3743
|
+
Y,
|
|
3671
3744
|
!0,
|
|
3672
|
-
|
|
3673
|
-
|
|
3745
|
+
G ? Error("react-stack-top-frame") : pe,
|
|
3746
|
+
G ? oe(u(E)) : fe
|
|
3674
3747
|
);
|
|
3675
3748
|
};
|
|
3676
3749
|
})()), Ke;
|
|
3677
3750
|
}
|
|
3678
|
-
var
|
|
3751
|
+
var Ln;
|
|
3679
3752
|
function Zo() {
|
|
3680
|
-
return
|
|
3753
|
+
return Ln || (Ln = 1, process.env.NODE_ENV === "production" ? vt.exports = Jo() : vt.exports = Qo()), vt.exports;
|
|
3681
3754
|
}
|
|
3682
3755
|
var ei = Zo();
|
|
3683
|
-
const ni = Zr(({ onChange:
|
|
3684
|
-
const u = Xe(null),
|
|
3685
|
-
return
|
|
3686
|
-
w.current =
|
|
3687
|
-
}, [
|
|
3688
|
-
setHTML: (
|
|
3689
|
-
u.current && u.current.setHTML(
|
|
3756
|
+
const ni = Zr(({ onChange: h, initialValue: m }, p) => {
|
|
3757
|
+
const u = Xe(null), v = Xe(null), y = Xe(m), w = Xe(h), g = Xe(!1);
|
|
3758
|
+
return Ht(() => {
|
|
3759
|
+
w.current = h;
|
|
3760
|
+
}, [h]), eo(p, () => ({
|
|
3761
|
+
setHTML: (T) => {
|
|
3762
|
+
u.current && u.current.setHTML(T);
|
|
3690
3763
|
},
|
|
3691
3764
|
getHTML: () => u.current?.getHTML() || ""
|
|
3692
|
-
})),
|
|
3693
|
-
if (
|
|
3694
|
-
u.current = new Ko(),
|
|
3695
|
-
const
|
|
3765
|
+
})), Ht(() => {
|
|
3766
|
+
if (v.current && !u.current) {
|
|
3767
|
+
u.current = new Ko(), v.current.appendChild(u.current.getElement()), m && (u.current.setHTML(m), y.current = m), g.current = !0;
|
|
3768
|
+
const T = u.current.getElement(), A = T.querySelector(
|
|
3696
3769
|
".editor"
|
|
3697
|
-
),
|
|
3698
|
-
const
|
|
3699
|
-
w.current?.(
|
|
3770
|
+
), k = () => {
|
|
3771
|
+
const _ = u.current?.getHTML() || "";
|
|
3772
|
+
w.current?.(_);
|
|
3700
3773
|
};
|
|
3701
|
-
|
|
3774
|
+
A ? (A.addEventListener("input", k), A.addEventListener("paste", k)) : (T.addEventListener("input", k), T.addEventListener("paste", k));
|
|
3702
3775
|
}
|
|
3703
|
-
}, []),
|
|
3704
|
-
if (
|
|
3705
|
-
const
|
|
3706
|
-
|
|
3776
|
+
}, []), Ht(() => {
|
|
3777
|
+
if (g.current && u.current && m !== void 0 && m !== y.current) {
|
|
3778
|
+
const T = u.current.getHTML();
|
|
3779
|
+
m !== T && (u.current.setHTML(m), y.current = m);
|
|
3707
3780
|
}
|
|
3708
|
-
}, [
|
|
3781
|
+
}, [m]), /* @__PURE__ */ ei.jsx("div", { ref: v });
|
|
3709
3782
|
});
|
|
3710
3783
|
export {
|
|
3711
3784
|
Ko as RichTextEditor,
|