@linker-design-plus/tiny-peony 1.3.0 → 1.3.2
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/index.mjs
CHANGED
|
@@ -38,10 +38,10 @@ const Ae = (C, e) => {
|
|
|
38
38
|
e.preventDefault();
|
|
39
39
|
const Q = ((u = e.data) == null ? void 0 : u.length) ?? 0, o = C.content.calcTextCount() - Q, i = C.maxLength - o;
|
|
40
40
|
if (i >= Q || !Q) return;
|
|
41
|
-
const s = i <= 0 ? Q : Q - i,
|
|
42
|
-
if (v(
|
|
41
|
+
const s = i <= 0 ? Q : Q - i, r = window.getSelection(), n = r == null ? void 0 : r.getRangeAt(0);
|
|
42
|
+
if (v(r) || v(n)) return;
|
|
43
43
|
const { endContainer: w, endOffset: h } = n, D = document.createRange();
|
|
44
|
-
D.setStart(w, h - s), D.setEnd(w, h), D.deleteContents(),
|
|
44
|
+
D.setStart(w, h - s), D.setEnd(w, h), D.deleteContents(), r.removeAllRanges(), r.addRange(D);
|
|
45
45
|
}, ge = (C, e) => {
|
|
46
46
|
const { inputType: Q } = e;
|
|
47
47
|
C.content.calcTextCount() >= C.maxLength && Q.includes("insert") && Q !== "insertParagraph" && e.preventDefault();
|
|
@@ -89,8 +89,8 @@ class Ie extends XE {
|
|
|
89
89
|
// 增加内容(增量)
|
|
90
90
|
appendContent(Q, o) {
|
|
91
91
|
var n;
|
|
92
|
-
const i = EC(this._editor, nB(Q) ? Q : [Q]), s = this.getParas()[0],
|
|
93
|
-
|
|
92
|
+
const i = EC(this._editor, nB(Q) ? Q : [Q]), s = this.getParas()[0], r = (n = s.textContent) != null && n.length ? void 0 : i.shift();
|
|
93
|
+
r && (s.innerHTML = r, o == null || o(s)), i.forEach((w) => {
|
|
94
94
|
const h = document.createElement("p");
|
|
95
95
|
h.innerHTML = w, h.classList.add(UA), this._editorElement.appendChild(h), o == null || o(h);
|
|
96
96
|
});
|
|
@@ -117,16 +117,16 @@ class Ie extends XE {
|
|
|
117
117
|
getTextContent() {
|
|
118
118
|
const Q = this.getParas(), o = (i) => {
|
|
119
119
|
const s = Array.from(i.childNodes);
|
|
120
|
-
let
|
|
120
|
+
let r = "";
|
|
121
121
|
for (let n = 0; n < s.length; n++) {
|
|
122
122
|
const w = s[n];
|
|
123
|
-
yA(w) ?
|
|
123
|
+
yA(w) ? r += w.textContent ?? "" : oA(w) && (r += // 主播标签需要递归处理
|
|
124
124
|
q.anchor === w.dataset.type ? o(w) : (
|
|
125
125
|
// 读音替换标签,需要使用替换后文本
|
|
126
126
|
q.pronunciation === w.dataset.type ? w.dataset.value : w.dataset.raw ?? ""
|
|
127
127
|
));
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return r;
|
|
130
130
|
};
|
|
131
131
|
return Q.map(o);
|
|
132
132
|
}
|
|
@@ -135,15 +135,15 @@ class Ie extends XE {
|
|
|
135
135
|
if (v(o) || !o.rangeCount || v(i)) return;
|
|
136
136
|
const s = document.createDocumentFragment();
|
|
137
137
|
if (iB(Q)) {
|
|
138
|
-
const
|
|
139
|
-
for (
|
|
140
|
-
s.appendChild(
|
|
138
|
+
const h = document.createElement("div");
|
|
139
|
+
for (h.innerHTML = Q; h.firstChild; )
|
|
140
|
+
s.appendChild(h.firstChild);
|
|
141
141
|
} else
|
|
142
142
|
s.appendChild(Q);
|
|
143
|
-
const
|
|
144
|
-
i.insertNode(s);
|
|
145
|
-
const
|
|
146
|
-
|
|
143
|
+
const r = s.lastChild;
|
|
144
|
+
(this._calcRange(i) ?? i).insertNode(s);
|
|
145
|
+
const w = document.createRange();
|
|
146
|
+
w.setStartAfter(r), w.setEndAfter(r), o.removeAllRanges(), o.addRange(w);
|
|
147
147
|
}
|
|
148
148
|
_delete() {
|
|
149
149
|
const { range: Q } = this._editor.cursor;
|
|
@@ -152,6 +152,23 @@ class Ie extends XE {
|
|
|
152
152
|
_update(Q) {
|
|
153
153
|
this._delete(), this._insert(Q);
|
|
154
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* 将 fragment 插入到 range 所在 contenteditable 的上一个 <p> 元素末尾
|
|
157
|
+
* @param {Range} range - 当前的 Range 对象
|
|
158
|
+
*/
|
|
159
|
+
_calcRange(Q) {
|
|
160
|
+
const o = Q.commonAncestorContainer;
|
|
161
|
+
if (o.tagName !== "DIV")
|
|
162
|
+
return Q;
|
|
163
|
+
const i = Q.startOffset, s = Array.from(o.children).filter((w) => w.tagName === "P");
|
|
164
|
+
if (i <= 0 || i - 1 >= s.length)
|
|
165
|
+
return console.warn("上一个 <p> 不存在"), Q;
|
|
166
|
+
const r = s[i - 1];
|
|
167
|
+
if (!r)
|
|
168
|
+
return console.warn("未找到上一个 <p>"), Q;
|
|
169
|
+
const n = document.createRange();
|
|
170
|
+
return n.selectNodeContents(r), n.collapse(!1), n;
|
|
171
|
+
}
|
|
155
172
|
}
|
|
156
173
|
class Ce extends zE {
|
|
157
174
|
constructor(Q) {
|
|
@@ -219,8 +236,8 @@ class Be extends ZE {
|
|
|
219
236
|
const o = [];
|
|
220
237
|
let i = Q;
|
|
221
238
|
for (; i && i.parentElement; ) {
|
|
222
|
-
const
|
|
223
|
-
if (o.unshift({ index:
|
|
239
|
+
const r = Array.from(i.parentElement.childNodes).indexOf(i);
|
|
240
|
+
if (o.unshift({ index: r }), oA(i) && i.tagName === "P" && i.classList.contains(UA))
|
|
224
241
|
break;
|
|
225
242
|
i = i.parentElement;
|
|
226
243
|
}
|
|
@@ -228,10 +245,10 @@ class Be extends ZE {
|
|
|
228
245
|
}
|
|
229
246
|
_record() {
|
|
230
247
|
var D;
|
|
231
|
-
const Q = this._editor.cursor.range, o = this._editor.content.getParas(), i = _A(Q.startContainer), s = o.indexOf(i),
|
|
248
|
+
const Q = this._editor.cursor.range, o = this._editor.content.getParas(), i = _A(Q.startContainer), s = o.indexOf(i), r = this._calcNodePathMatches(Q.startContainer), n = _A(Q.endContainer), w = o.indexOf(n), h = this._calcNodePathMatches(Q.endContainer);
|
|
232
249
|
return {
|
|
233
250
|
startParaIndex: s,
|
|
234
|
-
startMatchedIndexes:
|
|
251
|
+
startMatchedIndexes: r,
|
|
235
252
|
startOffset: Q.startOffset,
|
|
236
253
|
endParaIndex: w,
|
|
237
254
|
endMatchedIndexes: h,
|
|
@@ -264,8 +281,8 @@ class Be extends ZE {
|
|
|
264
281
|
D = w[f].index;
|
|
265
282
|
}
|
|
266
283
|
return u;
|
|
267
|
-
}, s = i(Q.startMatchedIndexes),
|
|
268
|
-
n.setStart(s, Q.startOffset), n.setEnd(
|
|
284
|
+
}, s = i(Q.startMatchedIndexes), r = i(Q.endMatchedIndexes), n = document.createRange();
|
|
285
|
+
n.setStart(s, Q.startOffset), n.setEnd(r, Q.endOffset), o.removeAllRanges(), o.addRange(n);
|
|
269
286
|
}
|
|
270
287
|
}
|
|
271
288
|
const GA = [];
|
|
@@ -307,7 +324,7 @@ const EI = (C, e) => {
|
|
|
307
324
|
data: "Hello"
|
|
308
325
|
});
|
|
309
326
|
C.element.dispatchEvent(Q);
|
|
310
|
-
const { range: o } = C.cursor, i = e[0], s = e[e.length - 1],
|
|
327
|
+
const { range: o } = C.cursor, i = e[0], s = e[e.length - 1], r = e.slice(1, -1);
|
|
311
328
|
let n = o;
|
|
312
329
|
if (!i || !n) return;
|
|
313
330
|
let w = null, h = 0, D = null;
|
|
@@ -344,7 +361,7 @@ const EI = (C, e) => {
|
|
|
344
361
|
U ? f.lastChild : f
|
|
345
362
|
);
|
|
346
363
|
let { nextSibling: J } = f;
|
|
347
|
-
if (
|
|
364
|
+
if (r.forEach((T) => {
|
|
348
365
|
var lA;
|
|
349
366
|
const $ = document.createElement("p");
|
|
350
367
|
if ($.classList.add(UA), $.textContent = T, (lA = f == null ? void 0 : f.parentNode) == null || lA.insertBefore($, J), J = $.nextSibling, EI(C, $), U) {
|
|
@@ -381,8 +398,8 @@ class ne extends OE {
|
|
|
381
398
|
X(this, "maxLength");
|
|
382
399
|
X(this, "plugin");
|
|
383
400
|
this._uid = rB(), this._editorElement = Q, this.content = new Ie(Q, this), this.cursor = new Ce(Q), this.undo = new Be(this, this.content, o == null ? void 0 : o.onUndoChange), this.command = new $E(this.content, this.cursor), this.maxLength = (o == null ? void 0 : o.maxLength) ?? 1e4, this.plugin = ((o == null ? void 0 : o.plugins) ?? []).reduce((i, s) => {
|
|
384
|
-
const
|
|
385
|
-
return i[n] =
|
|
401
|
+
const r = new s(this), n = r.prefix;
|
|
402
|
+
return i[n] = r, i;
|
|
386
403
|
}, {}), this._onchange = o == null ? void 0 : o.onChange, this._handleBackspace = this._handleBackspace.bind(this), this._handlePaste = this._handlePaste.bind(this), this._handleBeforeInput = this._handleBeforeInput.bind(this), this._handleCompositionEnd = this._handleCompositionEnd.bind(this), this._setup();
|
|
387
404
|
}
|
|
388
405
|
destroy() {
|
|
@@ -406,21 +423,21 @@ class ne extends OE {
|
|
|
406
423
|
if (Q.removedNodes.length) {
|
|
407
424
|
const i = Q.removedNodes[0];
|
|
408
425
|
if (oA(i) && i.dataset.type === q.highlight) {
|
|
409
|
-
const s = window.getSelection(), { range:
|
|
410
|
-
if (v(
|
|
426
|
+
const s = window.getSelection(), { range: r } = this.cursor;
|
|
427
|
+
if (v(r) || v(s)) return;
|
|
411
428
|
const n = document.createTextNode(""), w = document.createRange();
|
|
412
|
-
|
|
429
|
+
r.insertNode(n), w.setStartAfter(n), w.setEndAfter(n), s.removeAllRanges(), s.addRange(w);
|
|
413
430
|
}
|
|
414
431
|
}
|
|
415
432
|
Q.addedNodes.forEach((i) => {
|
|
416
433
|
oA(i) && i.tagName === "P" && !i.classList.contains(UA) && i.classList.add(UA);
|
|
417
434
|
}), Q.removedNodes.length && !this.content.getParas().length && this.content.insertEmptyPara(), (o = this._onchange) == null || o.call(this, this.content.calcTextCount()), Array.from(document.querySelectorAll("p span")).forEach((i) => {
|
|
418
435
|
var D;
|
|
419
|
-
const s = i.parentNode,
|
|
436
|
+
const s = i.parentNode, r = i.firstChild, n = i && i.style.textIndent === "20px" && i.style.fontSize && i.style.color, w = i && i.style.backgroundColor && ((D = i.parentElement) == null ? void 0 : D.style.textIndent) === "0px", h = i && Array.from(i.childNodes).every((u) => yA(u) && !u.textContent || oA(u) && u.tagName === "BR");
|
|
420
437
|
if (n || w) {
|
|
421
438
|
for (; i.firstChild; )
|
|
422
439
|
s == null || s.insertBefore(i.firstChild, i);
|
|
423
|
-
s == null || s.removeChild(i), jA(
|
|
440
|
+
s == null || s.removeChild(i), jA(r);
|
|
424
441
|
}
|
|
425
442
|
if (h && (s == null || s.removeChild(i)), w) {
|
|
426
443
|
s.removeAttribute("style");
|
|
@@ -428,8 +445,8 @@ class ne extends OE {
|
|
|
428
445
|
R.setStartAfter(R.startContainer), R.setEndAfter(R.endContainer), u == null || u.removeAllRanges(), u == null || u.addRange(R);
|
|
429
446
|
}
|
|
430
447
|
}), this.content.getParas().forEach((i) => {
|
|
431
|
-
const s = i.firstChild,
|
|
432
|
-
i.childNodes.length > 1 && (oA(
|
|
448
|
+
const s = i.firstChild, r = i.lastChild;
|
|
449
|
+
i.childNodes.length > 1 && (oA(r) && r.tagName === "BR" && r.remove(), oA(s) && s.tagName === "BR" && s.remove()), (i.childNodes.length === 0 || i.childNodes.length === 1 && yA(i.childNodes[0]) && i.childNodes[0].textContent === "") && i.remove();
|
|
433
450
|
});
|
|
434
451
|
}), this._observer.observe(this._editorElement, {
|
|
435
452
|
childList: !0,
|
|
@@ -446,7 +463,7 @@ class ne extends OE {
|
|
|
446
463
|
var s;
|
|
447
464
|
const o = window.getSelection(), i = o.getRangeAt(0);
|
|
448
465
|
if (Q.key === "Backspace" && i.startOffset === 0 && i.collapsed) {
|
|
449
|
-
const [
|
|
466
|
+
const [r] = SA(i.startContainer, (w) => w.tagName === "P" && w.classList.contains(UA)), n = r == null ? void 0 : r.previousElementSibling;
|
|
450
467
|
if (n) {
|
|
451
468
|
Q.preventDefault();
|
|
452
469
|
const w = n.childNodes, h = n.childNodes[0];
|
|
@@ -458,50 +475,50 @@ class ne extends OE {
|
|
|
458
475
|
) {
|
|
459
476
|
n.remove();
|
|
460
477
|
const D = document.createRange();
|
|
461
|
-
D.setStartBefore(
|
|
478
|
+
D.setStartBefore(r.firstChild), D.setEndBefore(r.firstChild), o.removeAllRanges(), o.addRange(D);
|
|
462
479
|
} else {
|
|
463
480
|
const D = document.createRange();
|
|
464
481
|
D.selectNodeContents(n), D.collapse(!1), o.removeAllRanges(), o.addRange(D);
|
|
465
|
-
const u = document.createDocumentFragment(), f =
|
|
466
|
-
for (;
|
|
467
|
-
u.appendChild(
|
|
468
|
-
D.insertNode(u),
|
|
482
|
+
const u = document.createDocumentFragment(), f = r.firstChild;
|
|
483
|
+
for (; r.firstChild; )
|
|
484
|
+
u.appendChild(r.firstChild);
|
|
485
|
+
D.insertNode(u), r.remove();
|
|
469
486
|
const R = document.createRange();
|
|
470
487
|
R.setStartBefore(f), R.setEndBefore(f), o.removeAllRanges(), o.addRange(R);
|
|
471
488
|
}
|
|
472
489
|
}
|
|
473
490
|
}
|
|
474
491
|
if (Q.key === "Delete" && ae()) {
|
|
475
|
-
const
|
|
476
|
-
if (v(
|
|
492
|
+
const r = getSelection(), n = (s = getSelection()) == null ? void 0 : s.getRangeAt(0);
|
|
493
|
+
if (v(r) || v(n)) return;
|
|
477
494
|
const w = _A(n.endContainer), h = w == null ? void 0 : w.nextElementSibling;
|
|
478
495
|
if (v(w) || v(h)) return;
|
|
479
496
|
const D = document.createRange();
|
|
480
497
|
for (D.selectNodeContents(w), D.collapse(!1); h.firstChild; )
|
|
481
498
|
w.appendChild(h.firstChild);
|
|
482
|
-
h.remove(),
|
|
499
|
+
h.remove(), r.removeAllRanges(), r.addRange(D), w.normalize();
|
|
483
500
|
}
|
|
484
501
|
if (Q.key === "Enter") {
|
|
485
|
-
const { range:
|
|
486
|
-
if (bE(
|
|
487
|
-
const [n] = SA(
|
|
488
|
-
if (
|
|
502
|
+
const { range: r } = this.cursor;
|
|
503
|
+
if (bE(r)) return;
|
|
504
|
+
const [n] = SA(r == null ? void 0 : r.commonAncestorContainer, (w) => w.tagName === "SPAN" && w.dataset.type === q.anchor);
|
|
505
|
+
if (r != null && r.collapsed && r.startOffset === 0 && n) {
|
|
489
506
|
Q.preventDefault();
|
|
490
507
|
const w = document.createElement("p");
|
|
491
508
|
w.innerHTML = "<br />", this._editorElement.insertBefore(w, n.parentElement);
|
|
492
509
|
}
|
|
493
510
|
}
|
|
494
511
|
if (i.startOffset === 0 && i.endContainer.tagName === "P" && _A(i.startContainer) === _A(i.endContainer)) {
|
|
495
|
-
const
|
|
496
|
-
if (v(
|
|
497
|
-
Q.key === "Backspace" && ce(
|
|
512
|
+
const r = _A(i.endContainer);
|
|
513
|
+
if (v(r)) return;
|
|
514
|
+
Q.key === "Backspace" && ce(r, o);
|
|
498
515
|
}
|
|
499
516
|
}
|
|
500
517
|
// 粘贴事件处理函数
|
|
501
518
|
_handlePaste(Q) {
|
|
502
519
|
var i, s;
|
|
503
520
|
Q.preventDefault(), se(this._editorElement);
|
|
504
|
-
const o = ((s = (i = Q.clipboardData) == null ? void 0 : i.getData("text/plain")) == null ? void 0 : s.split(/(?:\r?\n){2,}/).map((
|
|
521
|
+
const o = ((s = (i = Q.clipboardData) == null ? void 0 : i.getData("text/plain")) == null ? void 0 : s.split(/(?:\r?\n){2,}/).map((r) => r.trim()).filter((r) => r)) ?? [];
|
|
505
522
|
eC(this, EC(this, o));
|
|
506
523
|
}
|
|
507
524
|
_handleBeforeInput(Q) {
|
|
@@ -528,8 +545,8 @@ const Jg = (C, e, Q, o) => {
|
|
|
528
545
|
const Q = nB(e) ? e : [e];
|
|
529
546
|
let o = C;
|
|
530
547
|
for (; o; ) {
|
|
531
|
-
const i = o, s = Q.map((
|
|
532
|
-
if (s.some((
|
|
548
|
+
const i = o, s = Q.map((r) => r(i)).map((r) => r ? i : null);
|
|
549
|
+
if (s.some((r) => r)) return s;
|
|
533
550
|
o = o.parentElement;
|
|
534
551
|
}
|
|
535
552
|
return new Array(Q.length).fill(null);
|
|
@@ -550,7 +567,7 @@ const Jg = (C, e, Q, o) => {
|
|
|
550
567
|
const e = document.createElement("div");
|
|
551
568
|
return e.setAttribute("class", `editor-${C}-tag-modal`), e;
|
|
552
569
|
}, jA = (C, e, Q) => {
|
|
553
|
-
var
|
|
570
|
+
var r, n, w;
|
|
554
571
|
const o = C.previousSibling, i = C.nextSibling, s = e ?? C.textContent ?? "";
|
|
555
572
|
if (Q && // 空节点
|
|
556
573
|
(!o && !i || // 相邻停顿节点
|
|
@@ -561,7 +578,7 @@ const Jg = (C, e, Q, o) => {
|
|
|
561
578
|
q.pausation,
|
|
562
579
|
q.pronunciation
|
|
563
580
|
].includes(o.dataset.type))) {
|
|
564
|
-
oA(C) && C.dataset.type !== q.pausation ? C.replaceWith(C.dataset.raw ?? "") : (
|
|
581
|
+
oA(C) && C.dataset.type !== q.pausation ? C.replaceWith(C.dataset.raw ?? "") : (r = C.parentNode) == null || r.removeChild(C);
|
|
565
582
|
return;
|
|
566
583
|
}
|
|
567
584
|
if (yA(o)) {
|
|
@@ -571,15 +588,15 @@ const Jg = (C, e, Q, o) => {
|
|
|
571
588
|
yA(i) && (i.textContent = s + i.textContent, (w = C.parentNode) == null || w.removeChild(C), jA(i, i.textContent, !1));
|
|
572
589
|
}, mI = (C, e) => {
|
|
573
590
|
const Q = C.length, o = e.length, i = new Array(o).fill(0);
|
|
574
|
-
let s = i[0],
|
|
591
|
+
let s = i[0], r = 0, n = 0;
|
|
575
592
|
for (let w = 1; w <= Q; w++) {
|
|
576
593
|
for (let h = 1; h <= o; h++) {
|
|
577
594
|
const D = i[h];
|
|
578
|
-
C[w - 1] === e[h - 1] ? (i[h] = s + 1, i[h] >
|
|
595
|
+
C[w - 1] === e[h - 1] ? (i[h] = s + 1, i[h] > r && (r = Math.max(r, i[h]), n = h - 1)) : i[h] = 0, s = D;
|
|
579
596
|
}
|
|
580
597
|
s = i[0];
|
|
581
598
|
}
|
|
582
|
-
return e.substring(n -
|
|
599
|
+
return e.substring(n - r + 1, n + 1);
|
|
583
600
|
}, ae = () => {
|
|
584
601
|
const C = window.getSelection();
|
|
585
602
|
if (!C || !C.rangeCount || C.type !== "Caret") return !1;
|
|
@@ -637,14 +654,14 @@ function De(C, e, Q = {}) {
|
|
|
637
654
|
immediate: o = !0
|
|
638
655
|
} = Q, i = cA(!1);
|
|
639
656
|
let s = null;
|
|
640
|
-
function
|
|
657
|
+
function r() {
|
|
641
658
|
s && (clearTimeout(s), s = null);
|
|
642
659
|
}
|
|
643
660
|
function n() {
|
|
644
|
-
i.value = !1,
|
|
661
|
+
i.value = !1, r();
|
|
645
662
|
}
|
|
646
663
|
function w(...h) {
|
|
647
|
-
|
|
664
|
+
r(), i.value = !0, s = setTimeout(() => {
|
|
648
665
|
i.value = !1, s = null, C(...h);
|
|
649
666
|
}, Dg(e));
|
|
650
667
|
}
|
|
@@ -659,7 +676,7 @@ function eI(C = !1, e = {}) {
|
|
|
659
676
|
truthyValue: Q = !0,
|
|
660
677
|
falsyValue: o = !1
|
|
661
678
|
} = e, i = SE(C), s = cA(C);
|
|
662
|
-
function
|
|
679
|
+
function r(n) {
|
|
663
680
|
if (arguments.length)
|
|
664
681
|
return s.value = n, s.value;
|
|
665
682
|
{
|
|
@@ -667,7 +684,7 @@ function eI(C = !1, e = {}) {
|
|
|
667
684
|
return s.value = s.value === w ? Dg(o) : w, s.value;
|
|
668
685
|
}
|
|
669
686
|
}
|
|
670
|
-
return i ?
|
|
687
|
+
return i ? r : [s, r];
|
|
671
688
|
}
|
|
672
689
|
const sB = oC ? window : void 0, cB = oC ? window.navigator : void 0;
|
|
673
690
|
function de(C) {
|
|
@@ -680,12 +697,12 @@ function lg(...C) {
|
|
|
680
697
|
if (typeof C[0] == "string" || Array.isArray(C[0]) ? ([Q, o, i] = C, e = sB) : [e, Q, o, i] = C, !e)
|
|
681
698
|
return AC;
|
|
682
699
|
Q = ZC(Q), o = ZC(o);
|
|
683
|
-
const s = [],
|
|
700
|
+
const s = [], r = () => {
|
|
684
701
|
s.forEach((D) => D()), s.length = 0;
|
|
685
702
|
}, n = (D, u, f, R) => (D.addEventListener(u, f, R), () => D.removeEventListener(u, f, R)), w = oI(
|
|
686
703
|
() => [de(e), Dg(i)],
|
|
687
704
|
([D, u]) => {
|
|
688
|
-
if (
|
|
705
|
+
if (r(), !D)
|
|
689
706
|
return;
|
|
690
707
|
const f = we(u) ? { ...u } : u;
|
|
691
708
|
s.push(
|
|
@@ -694,7 +711,7 @@ function lg(...C) {
|
|
|
694
711
|
},
|
|
695
712
|
{ immediate: !0, flush: "post" }
|
|
696
713
|
), h = () => {
|
|
697
|
-
w(),
|
|
714
|
+
w(), r();
|
|
698
715
|
};
|
|
699
716
|
return aB(h), h;
|
|
700
717
|
}
|
|
@@ -712,7 +729,7 @@ function _C(C, e = {}) {
|
|
|
712
729
|
const {
|
|
713
730
|
controls: Q = !1,
|
|
714
731
|
navigator: o = cB
|
|
715
|
-
} = e, i = lB(() => o && "permissions" in o), s = VC(),
|
|
732
|
+
} = e, i = lB(() => o && "permissions" in o), s = VC(), r = typeof C == "string" ? { name: C } : C, n = VC(), w = () => {
|
|
716
733
|
var D, u;
|
|
717
734
|
n.value = (u = (D = s.value) == null ? void 0 : D.state) != null ? u : "prompt";
|
|
718
735
|
};
|
|
@@ -721,7 +738,7 @@ function _C(C, e = {}) {
|
|
|
721
738
|
if (i.value) {
|
|
722
739
|
if (!s.value)
|
|
723
740
|
try {
|
|
724
|
-
s.value = await o.permissions.query(
|
|
741
|
+
s.value = await o.permissions.query(r);
|
|
725
742
|
} catch {
|
|
726
743
|
s.value = void 0;
|
|
727
744
|
} finally {
|
|
@@ -744,15 +761,15 @@ function wB(C = {}) {
|
|
|
744
761
|
source: o,
|
|
745
762
|
copiedDuring: i = 1500,
|
|
746
763
|
legacy: s = !1
|
|
747
|
-
} = C,
|
|
764
|
+
} = C, r = lB(() => e && "clipboard" in e), n = _C("clipboard-read"), w = _C("clipboard-write"), h = FA(() => r.value || s), D = cA(""), u = cA(!1), f = De(() => u.value = !1, i, { immediate: !1 });
|
|
748
765
|
function R() {
|
|
749
|
-
|
|
766
|
+
r.value && J(n.value) ? e.clipboard.readText().then((M) => {
|
|
750
767
|
D.value = M;
|
|
751
768
|
}) : D.value = L();
|
|
752
769
|
}
|
|
753
770
|
h.value && Q && lg(["copy", "cut"], R, { passive: !0 });
|
|
754
771
|
async function G(M = Dg(o)) {
|
|
755
|
-
h.value && M != null && (
|
|
772
|
+
h.value && M != null && (r.value && J(w.value) ? await e.clipboard.writeText(M) : U(M), D.value = M, u.value = !0, f.start());
|
|
756
773
|
}
|
|
757
774
|
function U(M) {
|
|
758
775
|
const _ = document.createElement("textarea");
|
|
@@ -785,7 +802,7 @@ function cI(C = {}) {
|
|
|
785
802
|
resetOnTouchEnds: o = !1,
|
|
786
803
|
initialValue: i = { x: 0, y: 0 },
|
|
787
804
|
window: s = sB,
|
|
788
|
-
target:
|
|
805
|
+
target: r = s,
|
|
789
806
|
scroll: n = !0,
|
|
790
807
|
eventFilter: w
|
|
791
808
|
} = C;
|
|
@@ -806,9 +823,9 @@ function cI(C = {}) {
|
|
|
806
823
|
}, _ = () => {
|
|
807
824
|
f.value = i.x, R.value = i.y;
|
|
808
825
|
}, T = w ? (V) => w(() => L(V), {}) : (V) => L(V), $ = w ? (V) => w(() => J(V), {}) : (V) => J(V), lA = w ? () => w(() => M(), {}) : () => M();
|
|
809
|
-
if (
|
|
826
|
+
if (r) {
|
|
810
827
|
const V = { passive: !0 };
|
|
811
|
-
lg(
|
|
828
|
+
lg(r, ["mousemove", "dragover"], T, V), Q && e !== "movement" && (lg(r, ["touchstart", "touchmove"], $, V), o && lg(r, "touchend", _, V)), n && e === "page" && lg(s, "scroll", lA, V);
|
|
812
829
|
}
|
|
813
830
|
return {
|
|
814
831
|
x: f,
|
|
@@ -830,7 +847,7 @@ const fe = ["onClick"], Re = /* @__PURE__ */ MA({
|
|
|
830
847
|
{ label: "2S", value: 2 },
|
|
831
848
|
{ label: "2.5S", value: 2.5 }
|
|
832
849
|
];
|
|
833
|
-
return (
|
|
850
|
+
return (r, n) => iI((iA(), nA("ul", {
|
|
834
851
|
class: RA(sA(i)()),
|
|
835
852
|
contenteditable: "false",
|
|
836
853
|
onClick: n[0] || (n[0] = BC(() => {
|
|
@@ -881,7 +898,7 @@ const fe = ["onClick"], Re = /* @__PURE__ */ MA({
|
|
|
881
898
|
o == null || o(h, D), s();
|
|
882
899
|
}, s = () => {
|
|
883
900
|
w.component && (w.component.props.visible = !1);
|
|
884
|
-
},
|
|
901
|
+
}, r = (h) => {
|
|
885
902
|
var D, u;
|
|
886
903
|
if (w.component) {
|
|
887
904
|
let f = Ge.value, R = Ne.value;
|
|
@@ -900,7 +917,7 @@ const fe = ["onClick"], Re = /* @__PURE__ */ MA({
|
|
|
900
917
|
return QC(w, Q), document.body.appendChild(Q), {
|
|
901
918
|
target: void 0,
|
|
902
919
|
close: s,
|
|
903
|
-
update:
|
|
920
|
+
update: r
|
|
904
921
|
};
|
|
905
922
|
};
|
|
906
923
|
class Se extends sI {
|
|
@@ -938,7 +955,7 @@ class Se extends sI {
|
|
|
938
955
|
* @param evt Event对象
|
|
939
956
|
*/
|
|
940
957
|
_triggerPausationTagClick(Q) {
|
|
941
|
-
var
|
|
958
|
+
var r;
|
|
942
959
|
const o = Q.target, [i] = SA(
|
|
943
960
|
o,
|
|
944
961
|
(n) => n.tagName === "svg" && n.classList.contains(DB)
|
|
@@ -947,7 +964,7 @@ class Se extends sI {
|
|
|
947
964
|
(n) => n.tagName === "SPAN" && n.dataset.type === wg
|
|
948
965
|
);
|
|
949
966
|
if (i || v(s)) {
|
|
950
|
-
i && this.remove(s), (
|
|
967
|
+
i && this.remove(s), (r = this.modalInstance) == null || r.close();
|
|
951
968
|
return;
|
|
952
969
|
}
|
|
953
970
|
if (v(this.modalInstance)) {
|
|
@@ -990,7 +1007,7 @@ const Me = { style: { display: "none" } }, pe = /* @__PURE__ */ MA({
|
|
|
990
1007
|
return;
|
|
991
1008
|
}
|
|
992
1009
|
o("ok", w, n.value ?? "", Q.oldText);
|
|
993
|
-
},
|
|
1010
|
+
}, r = (w) => {
|
|
994
1011
|
o("cancel", w);
|
|
995
1012
|
}, n = cA();
|
|
996
1013
|
return oI([() => Q.visible, () => Q.oldText, () => Q.modelValue], () => {
|
|
@@ -1050,7 +1067,7 @@ const Me = { style: { display: "none" } }, pe = /* @__PURE__ */ MA({
|
|
|
1050
1067
|
default: Cg(() => {
|
|
1051
1068
|
var D;
|
|
1052
1069
|
return [
|
|
1053
|
-
y(sA(ZI), { onClick:
|
|
1070
|
+
y(sA(ZI), { onClick: r }, {
|
|
1054
1071
|
default: Cg(() => h[3] || (h[3] = [
|
|
1055
1072
|
LA("取消")
|
|
1056
1073
|
])),
|
|
@@ -1093,7 +1110,7 @@ const ag = q.pronunciation, [sg] = pg(ag), dB = sg("close"), { x: He, y: me } =
|
|
|
1093
1110
|
</g>
|
|
1094
1111
|
</g>
|
|
1095
1112
|
</svg>`, qe = (C, e) => {
|
|
1096
|
-
const Q = tC(q.pronunciation), { oldText: o, onOk: i, onCancel: s, onTryPlay:
|
|
1113
|
+
const Q = tC(q.pronunciation), { oldText: o, onOk: i, onCancel: s, onTryPlay: r } = e, n = (G, U, L) => {
|
|
1097
1114
|
i == null || i(G, U, L), h();
|
|
1098
1115
|
}, w = (G) => {
|
|
1099
1116
|
s == null || s(G), h();
|
|
@@ -1110,7 +1127,7 @@ const ag = q.pronunciation, [sg] = pg(ag), dB = sg("close"), { x: He, y: me } =
|
|
|
1110
1127
|
onOk: n,
|
|
1111
1128
|
onCancel: w,
|
|
1112
1129
|
onTryPlay: (G, U, L) => {
|
|
1113
|
-
|
|
1130
|
+
r == null || r(G, U, L);
|
|
1114
1131
|
}
|
|
1115
1132
|
});
|
|
1116
1133
|
return QC(R, Q), document.body.appendChild(Q), {
|
|
@@ -1136,7 +1153,7 @@ class ve extends sI {
|
|
|
1136
1153
|
jA(Q, Q.dataset.raw, !0);
|
|
1137
1154
|
}
|
|
1138
1155
|
_triggerPronunciationTagClick(Q) {
|
|
1139
|
-
var
|
|
1156
|
+
var r;
|
|
1140
1157
|
const o = Q.target, [i] = SA(
|
|
1141
1158
|
o,
|
|
1142
1159
|
(n) => n.tagName === "svg" && n.classList.contains(dB)
|
|
@@ -1145,7 +1162,7 @@ class ve extends sI {
|
|
|
1145
1162
|
(n) => n.tagName === "SPAN" && n.dataset.type === ag
|
|
1146
1163
|
);
|
|
1147
1164
|
if (i || v(s)) {
|
|
1148
|
-
i && this.remove(s), (
|
|
1165
|
+
i && this.remove(s), (r = this.modalInstance) == null || r.close();
|
|
1149
1166
|
return;
|
|
1150
1167
|
}
|
|
1151
1168
|
if (v(this.modalInstance)) {
|
|
@@ -1218,8 +1235,8 @@ class be extends sI {
|
|
|
1218
1235
|
this._insertAnchorTag(Q.anchor);
|
|
1219
1236
|
}
|
|
1220
1237
|
remove(Q) {
|
|
1221
|
-
const { top: o, id: i } = Q.dataset, s = i.split("_")[1],
|
|
1222
|
-
|
|
1238
|
+
const { top: o, id: i } = Q.dataset, s = i.split("_")[1], r = this.data[o].findIndex((u) => u.id === Number(s));
|
|
1239
|
+
r > -1 && (this.data[o].splice(r, 1), $C.delete(s));
|
|
1223
1240
|
const n = Array.from(Q.childNodes);
|
|
1224
1241
|
if (n.every((u) => yA(u))) {
|
|
1225
1242
|
jA(Q), Q.replaceWith(Q.textContent);
|
|
@@ -1229,8 +1246,8 @@ class be extends sI {
|
|
|
1229
1246
|
n.forEach((u) => w.appendChild(u)), Q.replaceWith(w), yA(h) && jA(h), yA(D) && jA(D);
|
|
1230
1247
|
}
|
|
1231
1248
|
_recordAnchor(Q, o, i, s) {
|
|
1232
|
-
const
|
|
1233
|
-
Q.id = o, Q.top = i,
|
|
1249
|
+
const r = this.data[i] ?? (this.data[i] = []);
|
|
1250
|
+
Q.id = o, Q.top = i, r.push({ background: s, data: Q, id: o }), $C.set(String(o), Q);
|
|
1234
1251
|
}
|
|
1235
1252
|
get _newAnchorId() {
|
|
1236
1253
|
const Q = Object.values(this.data).flat().map((o) => o.id);
|
|
@@ -1245,7 +1262,7 @@ class be extends sI {
|
|
|
1245
1262
|
Sg.warning("同一个文本不能同时选择两个及以上主播!");
|
|
1246
1263
|
return;
|
|
1247
1264
|
}
|
|
1248
|
-
const o = this._newAnchorId, i = yB[(o - 1) % 10], s = this.editor.cursor.range, { startContainer:
|
|
1265
|
+
const o = this._newAnchorId, i = yB[(o - 1) % 10], s = this.editor.cursor.range, { startContainer: r, startOffset: n, endContainer: w, endOffset: h } = s, D = (L) => oA(L) && L.tagName === "DIV" ? L.firstElementChild : oA(L) && L.tagName === "P" ? L : L.parentElement, u = (L) => {
|
|
1249
1266
|
const J = document.createElement("span");
|
|
1250
1267
|
return Jg(
|
|
1251
1268
|
J,
|
|
@@ -1277,18 +1294,18 @@ class be extends sI {
|
|
|
1277
1294
|
this.editor.content.update(V);
|
|
1278
1295
|
const EA = this._calcTopValue(V.getBoundingClientRect());
|
|
1279
1296
|
V.dataset.top = String(EA), T && this._recordAnchor(Q, o, EA, i);
|
|
1280
|
-
}, R = D(
|
|
1297
|
+
}, R = D(r), G = D(w), U = re(R, G);
|
|
1281
1298
|
if (R === G) {
|
|
1282
1299
|
f(
|
|
1283
|
-
oA(
|
|
1284
|
-
oA(
|
|
1300
|
+
oA(r) && r.tagName === "P" ? r.firstChild : r,
|
|
1301
|
+
oA(r) && r.tagName === "P" ? 0 : n,
|
|
1285
1302
|
w,
|
|
1286
1303
|
h,
|
|
1287
1304
|
!0
|
|
1288
1305
|
);
|
|
1289
1306
|
return;
|
|
1290
1307
|
}
|
|
1291
|
-
f(
|
|
1308
|
+
f(r, n, R, R.childNodes.length, !0), U.forEach((L) => {
|
|
1292
1309
|
f(L, 0, L, L.childNodes.length);
|
|
1293
1310
|
}), f(G.firstChild, 0, w, h, !1);
|
|
1294
1311
|
}
|
|
@@ -1313,19 +1330,19 @@ class be extends sI {
|
|
|
1313
1330
|
_syncAnchorTopValue() {
|
|
1314
1331
|
const o = Array.from(
|
|
1315
1332
|
this.editor.element.querySelectorAll(`span[data-type="${cg}"]`)
|
|
1316
|
-
).reduce((
|
|
1333
|
+
).reduce((r, n) => {
|
|
1317
1334
|
const w = n.dataset.id.split("_")[1];
|
|
1318
|
-
if (
|
|
1319
|
-
return n.dataset.top = String(
|
|
1335
|
+
if (r.has(w))
|
|
1336
|
+
return n.dataset.top = String(r.get(w)), r;
|
|
1320
1337
|
const h = this._calcTopValue(n.getBoundingClientRect());
|
|
1321
|
-
return n.dataset.top = String(h),
|
|
1338
|
+
return n.dataset.top = String(h), r.set(w, h), r;
|
|
1322
1339
|
}, /* @__PURE__ */ new Map()), i = Object.values(this.data).flat();
|
|
1323
|
-
Object.keys(this.data).forEach((
|
|
1324
|
-
const s = i.reduce((
|
|
1340
|
+
Object.keys(this.data).forEach((r) => delete this.data[r]);
|
|
1341
|
+
const s = i.reduce((r, n) => {
|
|
1325
1342
|
const w = o.get(String(n.id));
|
|
1326
|
-
return (
|
|
1343
|
+
return (r[w] ?? (r[w] = [])).push(n), r;
|
|
1327
1344
|
}, {});
|
|
1328
|
-
Object.keys(s).forEach((
|
|
1345
|
+
Object.keys(s).forEach((r) => this.data[r] = s[r]);
|
|
1329
1346
|
}
|
|
1330
1347
|
setup() {
|
|
1331
1348
|
this.observer = new MutationObserver(() => this._syncAnchorTopValue()), this.observer.observe(this.editor.element, {
|
|
@@ -1350,10 +1367,10 @@ const Te = ["onClick"], Pe = /* @__PURE__ */ MA({
|
|
|
1350
1367
|
},
|
|
1351
1368
|
emits: ["ok", "cancel"],
|
|
1352
1369
|
setup(C, { emit: e }) {
|
|
1353
|
-
const Q = C, o = e, [i] = vA("homophones"), s = (
|
|
1354
|
-
o("ok",
|
|
1370
|
+
const Q = C, o = e, [i] = vA("homophones"), s = (r, n) => {
|
|
1371
|
+
o("ok", r, n);
|
|
1355
1372
|
};
|
|
1356
|
-
return (
|
|
1373
|
+
return (r, n) => iI((iA(), nA("ul", {
|
|
1357
1374
|
class: RA(sA(i)()),
|
|
1358
1375
|
onClick: n[0] || (n[0] = BC(() => {
|
|
1359
1376
|
}, ["stop"]))
|
|
@@ -1401,10 +1418,10 @@ const Te = ["onClick"], Pe = /* @__PURE__ */ MA({
|
|
|
1401
1418
|
`
|
|
1402
1419
|
), s;
|
|
1403
1420
|
}, Ze = (C, e) => {
|
|
1404
|
-
const Q = tC(q.homophones), { word: o, data: i, onOK: s, onCancel:
|
|
1421
|
+
const Q = tC(q.homophones), { word: o, data: i, onOK: s, onCancel: r } = e, n = (R, G) => {
|
|
1405
1422
|
s == null || s(R, G), h();
|
|
1406
1423
|
}, w = (R) => {
|
|
1407
|
-
|
|
1424
|
+
r == null || r(R), h();
|
|
1408
1425
|
}, h = () => {
|
|
1409
1426
|
f.component && (f.component.props.visible = !1);
|
|
1410
1427
|
}, D = (R) => {
|
|
@@ -1452,7 +1469,7 @@ class _e extends sI {
|
|
|
1452
1469
|
jA(Q, Q.dataset.raw, !0);
|
|
1453
1470
|
}
|
|
1454
1471
|
_triggerHomophonesTagClick(Q) {
|
|
1455
|
-
var
|
|
1472
|
+
var r, n, w;
|
|
1456
1473
|
const o = Q.target, [i] = SA(
|
|
1457
1474
|
o,
|
|
1458
1475
|
(h) => h.tagName === "svg" && h.classList.contains(uB)
|
|
@@ -1461,7 +1478,7 @@ class _e extends sI {
|
|
|
1461
1478
|
(h) => h.tagName === "SPAN" && h.dataset.type === hg
|
|
1462
1479
|
);
|
|
1463
1480
|
if (i || v(s)) {
|
|
1464
|
-
i && this.remove(s), (
|
|
1481
|
+
i && this.remove(s), (r = this.modalInstance) == null || r.close();
|
|
1465
1482
|
return;
|
|
1466
1483
|
}
|
|
1467
1484
|
if (v(this.modalInstance)) {
|
|
@@ -1489,9 +1506,9 @@ class _e extends sI {
|
|
|
1489
1506
|
});
|
|
1490
1507
|
}
|
|
1491
1508
|
_insertHomophonesTag(Q) {
|
|
1492
|
-
const o = this.editor.content.getParas(), i = (s,
|
|
1509
|
+
const o = this.editor.content.getParas(), i = (s, r, n) => {
|
|
1493
1510
|
var h;
|
|
1494
|
-
let w =
|
|
1511
|
+
let w = r;
|
|
1495
1512
|
for (let D = 0; D < s.length; D++) {
|
|
1496
1513
|
const u = s[D], f = (h = u == null ? void 0 : u.dataset) == null ? void 0 : h.type, R = [
|
|
1497
1514
|
q.pausation,
|
|
@@ -1518,13 +1535,13 @@ class _e extends sI {
|
|
|
1518
1535
|
}
|
|
1519
1536
|
};
|
|
1520
1537
|
Q.forEach((s) => {
|
|
1521
|
-
const
|
|
1538
|
+
const r = o[s.paraIndex], n = Array.from(r.childNodes);
|
|
1522
1539
|
i(n, -1, s);
|
|
1523
1540
|
});
|
|
1524
1541
|
}
|
|
1525
1542
|
// 累计计算并更新索引属性
|
|
1526
1543
|
_calc(Q, o, i) {
|
|
1527
|
-
const s = window.getSelection(),
|
|
1544
|
+
const s = window.getSelection(), r = document.createRange();
|
|
1528
1545
|
if (Q.nodeType === Node.TEXT_NODE) {
|
|
1529
1546
|
const n = ze(
|
|
1530
1547
|
i.word,
|
|
@@ -1533,7 +1550,7 @@ class _e extends sI {
|
|
|
1533
1550
|
i.pinyin1,
|
|
1534
1551
|
i.pinyin2
|
|
1535
1552
|
);
|
|
1536
|
-
|
|
1553
|
+
r.selectNode(Q), r.setStart(Q, o), r.setEnd(Q, o + 1), r.deleteContents(), r.insertNode(n), s == null || s.removeAllRanges(), s == null || s.addRange(r), this.editor.cursor.toEnd(n);
|
|
1537
1554
|
}
|
|
1538
1555
|
oA(Q) && Q.dataset.type === q.homophones && (Q.dataset.value = i.modify, Q.firstElementChild.innerHTML = `${i.word}[${i.modify}]`);
|
|
1539
1556
|
}
|
|
@@ -1717,14 +1734,14 @@ const ot = MA({
|
|
|
1717
1734
|
},
|
|
1718
1735
|
setup(C, { emit: e }) {
|
|
1719
1736
|
const Q = Hg("icon"), o = FA(() => [Q, `${Q}-right`, { [`${Q}-spin`]: C.spin }]), i = FA(() => {
|
|
1720
|
-
const
|
|
1721
|
-
return C.size && (
|
|
1737
|
+
const r = {};
|
|
1738
|
+
return C.size && (r.fontSize = mg(C.size) ? `${C.size}px` : C.size), C.rotate && (r.transform = `rotate(${C.rotate}deg)`), r;
|
|
1722
1739
|
});
|
|
1723
1740
|
return {
|
|
1724
1741
|
cls: o,
|
|
1725
1742
|
innerStyle: i,
|
|
1726
|
-
onClick: (
|
|
1727
|
-
e("click",
|
|
1743
|
+
onClick: (r) => {
|
|
1744
|
+
e("click", r);
|
|
1728
1745
|
}
|
|
1729
1746
|
};
|
|
1730
1747
|
}
|
|
@@ -1742,7 +1759,7 @@ function at(C, e, Q, o, i, s) {
|
|
|
1742
1759
|
"stroke-width": C.strokeWidth,
|
|
1743
1760
|
"stroke-linecap": C.strokeLinecap,
|
|
1744
1761
|
"stroke-linejoin": C.strokeLinejoin,
|
|
1745
|
-
onClick: e[0] || (e[0] = (...
|
|
1762
|
+
onClick: e[0] || (e[0] = (...r) => C.onClick && C.onClick(...r))
|
|
1746
1763
|
}, rt, 14, it);
|
|
1747
1764
|
}
|
|
1748
1765
|
var KI = /* @__PURE__ */ Kg(ot, [["render", at]]);
|
|
@@ -1780,14 +1797,14 @@ const st = Object.assign(KI, {
|
|
|
1780
1797
|
},
|
|
1781
1798
|
setup(C, { emit: e }) {
|
|
1782
1799
|
const Q = Hg("icon"), o = FA(() => [Q, `${Q}-check-circle-fill`, { [`${Q}-spin`]: C.spin }]), i = FA(() => {
|
|
1783
|
-
const
|
|
1784
|
-
return C.size && (
|
|
1800
|
+
const r = {};
|
|
1801
|
+
return C.size && (r.fontSize = mg(C.size) ? `${C.size}px` : C.size), C.rotate && (r.transform = `rotate(${C.rotate}deg)`), r;
|
|
1785
1802
|
});
|
|
1786
1803
|
return {
|
|
1787
1804
|
cls: o,
|
|
1788
1805
|
innerStyle: i,
|
|
1789
|
-
onClick: (
|
|
1790
|
-
e("click",
|
|
1806
|
+
onClick: (r) => {
|
|
1807
|
+
e("click", r);
|
|
1791
1808
|
}
|
|
1792
1809
|
};
|
|
1793
1810
|
}
|
|
@@ -1811,7 +1828,7 @@ function Dt(C, e, Q, o, i, s) {
|
|
|
1811
1828
|
"stroke-width": C.strokeWidth,
|
|
1812
1829
|
"stroke-linecap": C.strokeLinecap,
|
|
1813
1830
|
"stroke-linejoin": C.strokeLinejoin,
|
|
1814
|
-
onClick: e[0] || (e[0] = (...
|
|
1831
|
+
onClick: e[0] || (e[0] = (...r) => C.onClick && C.onClick(...r))
|
|
1815
1832
|
}, ht, 14, lt);
|
|
1816
1833
|
}
|
|
1817
1834
|
var qI = /* @__PURE__ */ Kg(ct, [["render", Dt]]);
|
|
@@ -1849,14 +1866,14 @@ const dt = Object.assign(qI, {
|
|
|
1849
1866
|
},
|
|
1850
1867
|
setup(C, { emit: e }) {
|
|
1851
1868
|
const Q = Hg("icon"), o = FA(() => [Q, `${Q}-close-circle-fill`, { [`${Q}-spin`]: C.spin }]), i = FA(() => {
|
|
1852
|
-
const
|
|
1853
|
-
return C.size && (
|
|
1869
|
+
const r = {};
|
|
1870
|
+
return C.size && (r.fontSize = mg(C.size) ? `${C.size}px` : C.size), C.rotate && (r.transform = `rotate(${C.rotate}deg)`), r;
|
|
1854
1871
|
});
|
|
1855
1872
|
return {
|
|
1856
1873
|
cls: o,
|
|
1857
1874
|
innerStyle: i,
|
|
1858
|
-
onClick: (
|
|
1859
|
-
e("click",
|
|
1875
|
+
onClick: (r) => {
|
|
1876
|
+
e("click", r);
|
|
1860
1877
|
}
|
|
1861
1878
|
};
|
|
1862
1879
|
}
|
|
@@ -1880,7 +1897,7 @@ function Ft(C, e, Q, o, i, s) {
|
|
|
1880
1897
|
"stroke-width": C.strokeWidth,
|
|
1881
1898
|
"stroke-linecap": C.strokeLinecap,
|
|
1882
1899
|
"stroke-linejoin": C.strokeLinejoin,
|
|
1883
|
-
onClick: e[0] || (e[0] = (...
|
|
1900
|
+
onClick: e[0] || (e[0] = (...r) => C.onClick && C.onClick(...r))
|
|
1884
1901
|
}, Rt, 14, ut);
|
|
1885
1902
|
}
|
|
1886
1903
|
var vI = /* @__PURE__ */ Kg(yt, [["render", Ft]]);
|
|
@@ -1918,14 +1935,14 @@ const Nt = Object.assign(vI, {
|
|
|
1918
1935
|
},
|
|
1919
1936
|
setup(C, { emit: e }) {
|
|
1920
1937
|
const Q = Hg("icon"), o = FA(() => [Q, `${Q}-exclamation-circle-fill`, { [`${Q}-spin`]: C.spin }]), i = FA(() => {
|
|
1921
|
-
const
|
|
1922
|
-
return C.size && (
|
|
1938
|
+
const r = {};
|
|
1939
|
+
return C.size && (r.fontSize = mg(C.size) ? `${C.size}px` : C.size), C.rotate && (r.transform = `rotate(${C.rotate}deg)`), r;
|
|
1923
1940
|
});
|
|
1924
1941
|
return {
|
|
1925
1942
|
cls: o,
|
|
1926
1943
|
innerStyle: i,
|
|
1927
|
-
onClick: (
|
|
1928
|
-
e("click",
|
|
1944
|
+
onClick: (r) => {
|
|
1945
|
+
e("click", r);
|
|
1929
1946
|
}
|
|
1930
1947
|
};
|
|
1931
1948
|
}
|
|
@@ -1949,7 +1966,7 @@ function St(C, e, Q, o, i, s) {
|
|
|
1949
1966
|
"stroke-width": C.strokeWidth,
|
|
1950
1967
|
"stroke-linecap": C.strokeLinecap,
|
|
1951
1968
|
"stroke-linejoin": C.strokeLinejoin,
|
|
1952
|
-
onClick: e[0] || (e[0] = (...
|
|
1969
|
+
onClick: e[0] || (e[0] = (...r) => C.onClick && C.onClick(...r))
|
|
1953
1970
|
}, Ut, 14, kt);
|
|
1954
1971
|
}
|
|
1955
1972
|
var xI = /* @__PURE__ */ Kg(Gt, [["render", St]]);
|
|
@@ -1987,14 +2004,14 @@ const bI = Object.assign(xI, {
|
|
|
1987
2004
|
},
|
|
1988
2005
|
setup(C, { emit: e }) {
|
|
1989
2006
|
const Q = Hg("icon"), o = FA(() => [Q, `${Q}-info-circle-fill`, { [`${Q}-spin`]: C.spin }]), i = FA(() => {
|
|
1990
|
-
const
|
|
1991
|
-
return C.size && (
|
|
2007
|
+
const r = {};
|
|
2008
|
+
return C.size && (r.fontSize = mg(C.size) ? `${C.size}px` : C.size), C.rotate && (r.transform = `rotate(${C.rotate}deg)`), r;
|
|
1992
2009
|
});
|
|
1993
2010
|
return {
|
|
1994
2011
|
cls: o,
|
|
1995
2012
|
innerStyle: i,
|
|
1996
|
-
onClick: (
|
|
1997
|
-
e("click",
|
|
2013
|
+
onClick: (r) => {
|
|
2014
|
+
e("click", r);
|
|
1998
2015
|
}
|
|
1999
2016
|
};
|
|
2000
2017
|
}
|
|
@@ -2018,7 +2035,7 @@ function Ht(C, e, Q, o, i, s) {
|
|
|
2018
2035
|
"stroke-width": C.strokeWidth,
|
|
2019
2036
|
"stroke-linecap": C.strokeLinecap,
|
|
2020
2037
|
"stroke-linejoin": C.strokeLinejoin,
|
|
2021
|
-
onClick: e[0] || (e[0] = (...
|
|
2038
|
+
onClick: e[0] || (e[0] = (...r) => C.onClick && C.onClick(...r))
|
|
2022
2039
|
}, Yt, 14, pt);
|
|
2023
2040
|
}
|
|
2024
2041
|
var TI = /* @__PURE__ */ Kg(Mt, [["render", Ht]]);
|
|
@@ -2040,7 +2057,7 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2040
2057
|
var i;
|
|
2041
2058
|
var o = typeof document < "u" ? (i = document.currentScript) == null ? void 0 : i.src : void 0;
|
|
2042
2059
|
return typeof __filename < "u" && (o || (o = __filename)), function(s = {}) {
|
|
2043
|
-
var
|
|
2060
|
+
var r, n = Object.assign({}, s), w, h, D = new Promise((A, g) => {
|
|
2044
2061
|
w = A, h = g;
|
|
2045
2062
|
}), u = typeof window == "object", f = typeof importScripts == "function", R = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", G = Object.assign({}, n), U = "./this.program", L = (A, g) => {
|
|
2046
2063
|
throw g;
|
|
@@ -2051,8 +2068,8 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2051
2068
|
var g = M(A, !0);
|
|
2052
2069
|
return g.buffer || (g = new Uint8Array(g)), g;
|
|
2053
2070
|
}, _ = (A, g, I, B = !0) => {
|
|
2054
|
-
A = rC(A) ? new URL(A) : lA.normalize(A), $.readFile(A, B ? void 0 : "utf8", (t,
|
|
2055
|
-
t ? I(t) : g(B ?
|
|
2071
|
+
A = rC(A) ? new URL(A) : lA.normalize(A), $.readFile(A, B ? void 0 : "utf8", (t, a) => {
|
|
2072
|
+
t ? I(t) : g(B ? a.buffer : a);
|
|
2056
2073
|
});
|
|
2057
2074
|
}, !n.thisProgram && process.argv.length > 1 && (U = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), L = (A, g) => {
|
|
2058
2075
|
throw process.exitCode = A, g;
|
|
@@ -2254,12 +2271,12 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2254
2271
|
d.length !== A.length && jg("Mismatched type converter count");
|
|
2255
2272
|
for (var F = 0; F < A.length; ++F) XA(A[F], d[F]);
|
|
2256
2273
|
}
|
|
2257
|
-
var t = new Array(g.length),
|
|
2274
|
+
var t = new Array(g.length), a = [], c = 0;
|
|
2258
2275
|
g.forEach((l, d) => {
|
|
2259
|
-
Eg.hasOwnProperty(l) ? t[d] = Eg[l] : (
|
|
2260
|
-
t[d] = Eg[l], ++c, c ===
|
|
2276
|
+
Eg.hasOwnProperty(l) ? t[d] = Eg[l] : (a.push(l), ig.hasOwnProperty(l) || (ig[l] = []), ig[l].push(() => {
|
|
2277
|
+
t[d] = Eg[l], ++c, c === a.length && B(t);
|
|
2261
2278
|
}));
|
|
2262
|
-
}),
|
|
2279
|
+
}), a.length === 0 && B(t);
|
|
2263
2280
|
};
|
|
2264
2281
|
function jB(A, g, I = {}) {
|
|
2265
2282
|
var B = g.name;
|
|
@@ -2269,7 +2286,7 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2269
2286
|
}
|
|
2270
2287
|
if (Eg[A] = g, delete Pg[A], ig.hasOwnProperty(A)) {
|
|
2271
2288
|
var t = ig[A];
|
|
2272
|
-
delete ig[A], t.forEach((
|
|
2289
|
+
delete ig[A], t.forEach((a) => a());
|
|
2273
2290
|
}
|
|
2274
2291
|
}
|
|
2275
2292
|
function XA(A, g, I = {}) {
|
|
@@ -2279,8 +2296,8 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2279
2296
|
var gg = 8, WB = (A, g, I, B) => {
|
|
2280
2297
|
g = KA(g), XA(A, { name: g, fromWireType: function(t) {
|
|
2281
2298
|
return !!t;
|
|
2282
|
-
}, toWireType: function(t,
|
|
2283
|
-
return
|
|
2299
|
+
}, toWireType: function(t, a) {
|
|
2300
|
+
return a ? I : B;
|
|
2284
2301
|
}, argPackAdvance: gg, readValueFromPointer: function(t) {
|
|
2285
2302
|
return this.fromWireType(x[t]);
|
|
2286
2303
|
}, destructorFunction: null });
|
|
@@ -2334,7 +2351,7 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2334
2351
|
function t() {
|
|
2335
2352
|
return this.isSmartPointer ? Wg(this.registeredClass.instancePrototype, { ptrType: this.pointeeType, ptr: g, smartPtrType: this, smartPtr: A }) : Wg(this.registeredClass.instancePrototype, { ptrType: this, ptr: A });
|
|
2336
2353
|
}
|
|
2337
|
-
var
|
|
2354
|
+
var a = this.registeredClass.getActualType(g), c = uC[a];
|
|
2338
2355
|
if (!c) return t.call(this);
|
|
2339
2356
|
var l;
|
|
2340
2357
|
this.isConst ? l = c.constPointerType : l = c.pointerType;
|
|
@@ -2387,8 +2404,8 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2387
2404
|
var g = A.charCodeAt(0);
|
|
2388
2405
|
return g >= BQ && g <= QQ ? `_${A}` : A;
|
|
2389
2406
|
};
|
|
2390
|
-
function eQ(A, g, I, B, t,
|
|
2391
|
-
this.name = A, this.constructor = g, this.instancePrototype = I, this.rawDestructor = B, this.baseClass = t, this.getActualType =
|
|
2407
|
+
function eQ(A, g, I, B, t, a, c, l) {
|
|
2408
|
+
this.name = A, this.constructor = g, this.instancePrototype = I, this.rawDestructor = B, this.baseClass = t, this.getActualType = a, this.upcast = c, this.downcast = l, this.pureVirtualFunctions = [];
|
|
2392
2409
|
}
|
|
2393
2410
|
var RI = (A, g, I) => {
|
|
2394
2411
|
for (; g !== I; ) g.upcast || CA(`Expected null or instance of ${I.name}, got an instance of ${g.name}`), A = g.upcast(A), g = g.baseClass;
|
|
@@ -2441,8 +2458,8 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2441
2458
|
(g = this.rawDestructor) == null || g.call(this, A);
|
|
2442
2459
|
}, argPackAdvance: gg, readValueFromPointer: Xg, fromWireType: gQ });
|
|
2443
2460
|
};
|
|
2444
|
-
function zg(A, g, I, B, t,
|
|
2445
|
-
this.name = A, this.registeredClass = g, this.isReference = I, this.isConst = B, this.isSmartPointer = t, this.pointeeType =
|
|
2461
|
+
function zg(A, g, I, B, t, a, c, l, d, F, k) {
|
|
2462
|
+
this.name = A, this.registeredClass = g, this.isReference = I, this.isConst = B, this.isSmartPointer = t, this.pointeeType = a, this.sharingPolicy = c, this.rawGetPointee = l, this.rawConstructor = d, this.rawShare = F, this.rawDestructor = k, !t && g.baseClass === void 0 ? B ? (this.toWireType = tQ, this.destructorFunction = null) : (this.toWireType = iQ, this.destructorFunction = null) : this.toWireType = oQ;
|
|
2446
2463
|
}
|
|
2447
2464
|
var rQ = (A, g, I) => {
|
|
2448
2465
|
n.hasOwnProperty(A) || jg("Replacing nonexistent public symbol"), n[A].overloadTable !== void 0 && I !== void 0 ? n[A].overloadTable[I] = g : (n[A] = g, n[A].argCount = I);
|
|
@@ -2476,18 +2493,18 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2476
2493
|
return ZA(g), I;
|
|
2477
2494
|
}, Zg = (A, g) => {
|
|
2478
2495
|
var I = [], B = {};
|
|
2479
|
-
function t(
|
|
2480
|
-
if (!B[
|
|
2481
|
-
if (Pg[
|
|
2482
|
-
Pg[
|
|
2496
|
+
function t(a) {
|
|
2497
|
+
if (!B[a] && !Eg[a]) {
|
|
2498
|
+
if (Pg[a]) {
|
|
2499
|
+
Pg[a].forEach(t);
|
|
2483
2500
|
return;
|
|
2484
2501
|
}
|
|
2485
|
-
I.push(
|
|
2502
|
+
I.push(a), B[a] = !0;
|
|
2486
2503
|
}
|
|
2487
2504
|
}
|
|
2488
2505
|
throw g.forEach(t), new fC(`${A}: ` + I.map(RC).join([", "]));
|
|
2489
|
-
}, wQ = (A, g, I, B, t,
|
|
2490
|
-
k = KA(k),
|
|
2506
|
+
}, wQ = (A, g, I, B, t, a, c, l, d, F, k, m, p) => {
|
|
2507
|
+
k = KA(k), a = tg(t, a), l && (l = tg(c, l)), F && (F = tg(d, F)), p = tg(m, p);
|
|
2491
2508
|
var K = EQ(k);
|
|
2492
2509
|
CQ(K, function() {
|
|
2493
2510
|
Zg(`Cannot construct ${k} due to unbound types`, [B]);
|
|
@@ -2504,7 +2521,7 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2504
2521
|
return WC.apply(this, YI);
|
|
2505
2522
|
}), N = Object.create(aA, { constructor: { value: hA } });
|
|
2506
2523
|
hA.prototype = N;
|
|
2507
|
-
var H = new eQ(k, hA, N, p, rA,
|
|
2524
|
+
var H = new eQ(k, hA, N, p, rA, a, l, F);
|
|
2508
2525
|
H.baseClass && ((wA = H.baseClass).__derivedClasses ?? (wA.__derivedClasses = []), H.baseClass.__derivedClasses.push(H));
|
|
2509
2526
|
var DA = new zg(k, H, !0, !1, !1), eA = new zg(k + "*", H, !1, !1, !1), JA = new zg(k + " const*", H, !1, !0, !1);
|
|
2510
2527
|
return uC[A] = { pointerType: eA, constPointerType: JA }, rQ(K, hA), [DA, eA, JA];
|
|
@@ -2528,18 +2545,18 @@ var mt = Object.create, RB = Object.defineProperty, Kt = Object.getOwnPropertyDe
|
|
|
2528
2545
|
return t instanceof Object ? t : B;
|
|
2529
2546
|
}
|
|
2530
2547
|
function dQ(A, g, I, B) {
|
|
2531
|
-
for (var t = FC(A),
|
|
2548
|
+
for (var t = FC(A), a = A.length, c = "", l = "", d = 0; d < a - 2; ++d) c += (d !== 0 ? ", " : "") + "arg" + d, l += (d !== 0 ? ", " : "") + "arg" + d + "Wired";
|
|
2532
2549
|
var F = `
|
|
2533
2550
|
return function (${c}) {
|
|
2534
|
-
if (arguments.length !== ${
|
|
2535
|
-
throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${
|
|
2551
|
+
if (arguments.length !== ${a - 2}) {
|
|
2552
|
+
throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a - 2}');
|
|
2536
2553
|
}`;
|
|
2537
2554
|
t && (F += `var destructors = [];
|
|
2538
2555
|
`);
|
|
2539
2556
|
var k = t ? "destructors" : "null", m = ["humanName", "throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"];
|
|
2540
2557
|
g && (F += "var thisWired = classParam['toWireType'](" + k + `, this);
|
|
2541
2558
|
`);
|
|
2542
|
-
for (var d = 0; d <
|
|
2559
|
+
for (var d = 0; d < a - 2; ++d) F += "var arg" + d + "Wired = argType" + d + "['toWireType'](" + k + ", arg" + d + `);
|
|
2543
2560
|
`, m.push("argType" + d);
|
|
2544
2561
|
if (g && (l = "thisWired" + (l.length > 0 ? ", " : "") + l), F += (I || B ? "var rv = " : "") + "invoker(fn" + (l.length > 0 ? ", " : "") + l + `);
|
|
2545
2562
|
`, t) F += `runDestructors(destructors);
|
|
@@ -2554,12 +2571,12 @@ return ret;
|
|
|
2554
2571
|
`), F += `}
|
|
2555
2572
|
`, [m, F];
|
|
2556
2573
|
}
|
|
2557
|
-
function FI(A, g, I, B, t,
|
|
2574
|
+
function FI(A, g, I, B, t, a) {
|
|
2558
2575
|
var c = g.length;
|
|
2559
2576
|
c < 2 && CA("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
2560
2577
|
for (var l = g[1] !== null && I !== null, d = FC(g), F = g[0].name !== "void", k = [A, CA, B, t, hQ, g[0], g[1]], m = 0; m < c - 2; ++m) k.push(g[m + 2]);
|
|
2561
2578
|
if (!d) for (var m = l ? 1 : 2; m < g.length; ++m) g[m].destructorFunction !== null && k.push(g[m].destructorFunction);
|
|
2562
|
-
let [p, K] = dQ(g, l, F,
|
|
2579
|
+
let [p, K] = dQ(g, l, F, a);
|
|
2563
2580
|
p.push(K);
|
|
2564
2581
|
var W = DQ(Function, p)(...k);
|
|
2565
2582
|
return Og(A, W);
|
|
@@ -2571,9 +2588,9 @@ return ret;
|
|
|
2571
2588
|
A = A.trim();
|
|
2572
2589
|
let g = A.indexOf("(");
|
|
2573
2590
|
return g !== -1 ? A.substr(0, g) : A;
|
|
2574
|
-
}, yQ = (A, g, I, B, t,
|
|
2591
|
+
}, yQ = (A, g, I, B, t, a, c, l) => {
|
|
2575
2592
|
var d = NI(I, B);
|
|
2576
|
-
g = KA(g), g = NC(g),
|
|
2593
|
+
g = KA(g), g = NC(g), a = tg(t, a), eg([], [A], (F) => {
|
|
2577
2594
|
F = F[0];
|
|
2578
2595
|
var k = `${F.name}.${g}`;
|
|
2579
2596
|
function m() {
|
|
@@ -2582,12 +2599,12 @@ return ret;
|
|
|
2582
2599
|
g.startsWith("@@") && (g = Symbol[g.substring(2)]);
|
|
2583
2600
|
var p = F.registeredClass.constructor;
|
|
2584
2601
|
return p[g] === void 0 ? (m.argCount = I - 1, p[g] = m) : (fI(p, g, k), p[g].overloadTable[I - 1] = m), eg([], d, (K) => {
|
|
2585
|
-
var W = [K[0], null].concat(K.slice(1)), rA = FI(k, W, null,
|
|
2602
|
+
var W = [K[0], null].concat(K.slice(1)), rA = FI(k, W, null, a, c, l);
|
|
2586
2603
|
if (p[g].overloadTable === void 0 ? (rA.argCount = I - 1, p[g] = rA) : p[g].overloadTable[I - 1] = rA, F.registeredClass.__derivedClasses) for (let aA of F.registeredClass.__derivedClasses) aA.constructor.hasOwnProperty(g) || (aA.constructor[g] = rA);
|
|
2587
2604
|
return [];
|
|
2588
2605
|
}), [];
|
|
2589
2606
|
});
|
|
2590
|
-
}, uQ = (A, g, I, B, t,
|
|
2607
|
+
}, uQ = (A, g, I, B, t, a) => {
|
|
2591
2608
|
var c = NI(g, I);
|
|
2592
2609
|
t = tg(B, t), eg([], [A], (l) => {
|
|
2593
2610
|
l = l[0];
|
|
@@ -2595,11 +2612,11 @@ return ret;
|
|
|
2595
2612
|
if (l.registeredClass.constructor_body === void 0 && (l.registeredClass.constructor_body = []), l.registeredClass.constructor_body[g - 1] !== void 0) throw new ng(`Cannot register multiple constructors with identical number of parameters (${g - 1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
2596
2613
|
return l.registeredClass.constructor_body[g - 1] = () => {
|
|
2597
2614
|
Zg(`Cannot construct ${l.name} due to unbound types`, c);
|
|
2598
|
-
}, eg([], c, (F) => (F.splice(1, 0, null), l.registeredClass.constructor_body[g - 1] = FI(d, F, null, t,
|
|
2615
|
+
}, eg([], c, (F) => (F.splice(1, 0, null), l.registeredClass.constructor_body[g - 1] = FI(d, F, null, t, a), [])), [];
|
|
2599
2616
|
});
|
|
2600
|
-
}, fQ = (A, g, I, B, t,
|
|
2617
|
+
}, fQ = (A, g, I, B, t, a, c, l, d) => {
|
|
2601
2618
|
var F = NI(I, B);
|
|
2602
|
-
g = KA(g), g = NC(g),
|
|
2619
|
+
g = KA(g), g = NC(g), a = tg(t, a), eg([], [A], (k) => {
|
|
2603
2620
|
k = k[0];
|
|
2604
2621
|
var m = `${k.name}.${g}`;
|
|
2605
2622
|
g.startsWith("@@") && (g = Symbol[g.substring(2)]), l && k.registeredClass.pureVirtualFunctions.push(g);
|
|
@@ -2608,7 +2625,7 @@ return ret;
|
|
|
2608
2625
|
}
|
|
2609
2626
|
var K = k.registeredClass.instancePrototype, W = K[g];
|
|
2610
2627
|
return W === void 0 || W.overloadTable === void 0 && W.className !== k.name && W.argCount === I - 2 ? (p.argCount = I - 2, p.className = k.name, K[g] = p) : (fI(K, g, m), K[g].overloadTable[I - 2] = p), eg([], F, (rA) => {
|
|
2611
|
-
var aA = FI(m, rA, k,
|
|
2628
|
+
var aA = FI(m, rA, k, a, c, d);
|
|
2612
2629
|
return K[g].overloadTable === void 0 ? (aA.argCount = I - 2, K[g] = aA) : K[g].overloadTable[I - 2] = aA, [];
|
|
2613
2630
|
}), [];
|
|
2614
2631
|
});
|
|
@@ -2666,10 +2683,10 @@ return ret;
|
|
|
2666
2683
|
}
|
|
2667
2684
|
}, SQ = (A, g, I, B, t) => {
|
|
2668
2685
|
g = KA(g);
|
|
2669
|
-
var
|
|
2686
|
+
var a = (k) => k;
|
|
2670
2687
|
if (B === 0) {
|
|
2671
2688
|
var c = 32 - 8 * I;
|
|
2672
|
-
|
|
2689
|
+
a = (k) => k << c >>> c;
|
|
2673
2690
|
}
|
|
2674
2691
|
var l = g.includes("unsigned"), d = (k, m) => {
|
|
2675
2692
|
}, F;
|
|
@@ -2677,35 +2694,35 @@ return ret;
|
|
|
2677
2694
|
return d(m, this.name), m >>> 0;
|
|
2678
2695
|
} : F = function(k, m) {
|
|
2679
2696
|
return d(m, this.name), m;
|
|
2680
|
-
}, XA(A, { name: g, fromWireType:
|
|
2697
|
+
}, XA(A, { name: g, fromWireType: a, toWireType: F, argPackAdvance: gg, readValueFromPointer: UQ(g, I, B !== 0), destructorFunction: null });
|
|
2681
2698
|
}, MQ = (A, g, I) => {
|
|
2682
2699
|
var B = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], t = B[g];
|
|
2683
|
-
function
|
|
2700
|
+
function a(c) {
|
|
2684
2701
|
var l = z[c >> 2], d = z[c + 4 >> 2];
|
|
2685
2702
|
return new t(Y.buffer, d, l);
|
|
2686
2703
|
}
|
|
2687
|
-
I = KA(I), XA(A, { name: I, fromWireType:
|
|
2704
|
+
I = KA(I), XA(A, { name: I, fromWireType: a, argPackAdvance: gg, readValueFromPointer: a }, { ignoreDuplicateRegistrations: !0 });
|
|
2688
2705
|
}, pQ = (A, g) => {
|
|
2689
2706
|
GC(A);
|
|
2690
2707
|
}, LI = (A, g, I, B) => {
|
|
2691
2708
|
if (!(B > 0)) return 0;
|
|
2692
|
-
for (var t = I,
|
|
2709
|
+
for (var t = I, a = I + B - 1, c = 0; c < A.length; ++c) {
|
|
2693
2710
|
var l = A.charCodeAt(c);
|
|
2694
2711
|
if (l >= 55296 && l <= 57343) {
|
|
2695
2712
|
var d = A.charCodeAt(++c);
|
|
2696
2713
|
l = 65536 + ((l & 1023) << 10) | d & 1023;
|
|
2697
2714
|
}
|
|
2698
2715
|
if (l <= 127) {
|
|
2699
|
-
if (I >=
|
|
2716
|
+
if (I >= a) break;
|
|
2700
2717
|
g[I++] = l;
|
|
2701
2718
|
} else if (l <= 2047) {
|
|
2702
|
-
if (I + 1 >=
|
|
2719
|
+
if (I + 1 >= a) break;
|
|
2703
2720
|
g[I++] = 192 | l >> 6, g[I++] = 128 | l & 63;
|
|
2704
2721
|
} else if (l <= 65535) {
|
|
2705
|
-
if (I + 2 >=
|
|
2722
|
+
if (I + 2 >= a) break;
|
|
2706
2723
|
g[I++] = 224 | l >> 12, g[I++] = 128 | l >> 6 & 63, g[I++] = 128 | l & 63;
|
|
2707
2724
|
} else {
|
|
2708
|
-
if (I + 3 >=
|
|
2725
|
+
if (I + 3 >= a) break;
|
|
2709
2726
|
g[I++] = 240 | l >> 18, g[I++] = 128 | l >> 12 & 63, g[I++] = 128 | l >> 6 & 63, g[I++] = 128 | l & 63;
|
|
2710
2727
|
}
|
|
2711
2728
|
}
|
|
@@ -2719,53 +2736,53 @@ return ret;
|
|
|
2719
2736
|
}, LC = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0, rg = (A, g, I) => {
|
|
2720
2737
|
for (var B = g + I, t = g; A[t] && !(t >= B); ) ++t;
|
|
2721
2738
|
if (t - g > 16 && A.buffer && LC) return LC.decode(A.subarray(g, t));
|
|
2722
|
-
for (var
|
|
2739
|
+
for (var a = ""; g < t; ) {
|
|
2723
2740
|
var c = A[g++];
|
|
2724
2741
|
if (!(c & 128)) {
|
|
2725
|
-
|
|
2742
|
+
a += String.fromCharCode(c);
|
|
2726
2743
|
continue;
|
|
2727
2744
|
}
|
|
2728
2745
|
var l = A[g++] & 63;
|
|
2729
2746
|
if ((c & 224) == 192) {
|
|
2730
|
-
|
|
2747
|
+
a += String.fromCharCode((c & 31) << 6 | l);
|
|
2731
2748
|
continue;
|
|
2732
2749
|
}
|
|
2733
2750
|
var d = A[g++] & 63;
|
|
2734
|
-
if ((c & 240) == 224 ? c = (c & 15) << 12 | l << 6 | d : c = (c & 7) << 18 | l << 12 | d << 6 | A[g++] & 63, c < 65536)
|
|
2751
|
+
if ((c & 240) == 224 ? c = (c & 15) << 12 | l << 6 | d : c = (c & 7) << 18 | l << 12 | d << 6 | A[g++] & 63, c < 65536) a += String.fromCharCode(c);
|
|
2735
2752
|
else {
|
|
2736
2753
|
var F = c - 65536;
|
|
2737
|
-
|
|
2754
|
+
a += String.fromCharCode(55296 | F >> 10, 56320 | F & 1023);
|
|
2738
2755
|
}
|
|
2739
2756
|
}
|
|
2740
|
-
return
|
|
2757
|
+
return a;
|
|
2741
2758
|
}, $g = (A, g) => A ? rg(x, A, g) : "", JQ = (A, g) => {
|
|
2742
2759
|
g = KA(g);
|
|
2743
2760
|
var I = g === "std::string";
|
|
2744
2761
|
XA(A, { name: g, fromWireType(B) {
|
|
2745
|
-
var t = z[B >> 2],
|
|
2746
|
-
if (I) for (var l =
|
|
2747
|
-
var F =
|
|
2762
|
+
var t = z[B >> 2], a = B + 4, c;
|
|
2763
|
+
if (I) for (var l = a, d = 0; d <= t; ++d) {
|
|
2764
|
+
var F = a + d;
|
|
2748
2765
|
if (d == t || x[F] == 0) {
|
|
2749
2766
|
var k = F - l, m = $g(l, k);
|
|
2750
2767
|
c === void 0 ? c = m : (c += "\0", c += m), l = F + 1;
|
|
2751
2768
|
}
|
|
2752
2769
|
}
|
|
2753
2770
|
else {
|
|
2754
|
-
for (var p = new Array(t), d = 0; d < t; ++d) p[d] = String.fromCharCode(x[
|
|
2771
|
+
for (var p = new Array(t), d = 0; d < t; ++d) p[d] = String.fromCharCode(x[a + d]);
|
|
2755
2772
|
c = p.join("");
|
|
2756
2773
|
}
|
|
2757
2774
|
return ZA(B), c;
|
|
2758
2775
|
}, toWireType(B, t) {
|
|
2759
2776
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
2760
|
-
var
|
|
2761
|
-
c || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int8Array || CA("Cannot pass non-string to std::string"), I && c ?
|
|
2762
|
-
var l = JI(4 +
|
|
2763
|
-
if (z[l >> 2] =
|
|
2764
|
-
else if (c) for (var F = 0; F <
|
|
2777
|
+
var a, c = typeof t == "string";
|
|
2778
|
+
c || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int8Array || CA("Cannot pass non-string to std::string"), I && c ? a = UI(t) : a = t.length;
|
|
2779
|
+
var l = JI(4 + a + 1), d = l + 4;
|
|
2780
|
+
if (z[l >> 2] = a, I && c) kC(t, d, a + 1);
|
|
2781
|
+
else if (c) for (var F = 0; F < a; ++F) {
|
|
2765
2782
|
var k = t.charCodeAt(F);
|
|
2766
2783
|
k > 255 && (ZA(d), CA("String has UTF-16 code units that do not fit in 8 bits")), x[d + F] = k;
|
|
2767
2784
|
}
|
|
2768
|
-
else for (var F = 0; F <
|
|
2785
|
+
else for (var F = 0; F < a; ++F) x[d + F] = t[F];
|
|
2769
2786
|
return B !== null && B.push(ZA, l), l;
|
|
2770
2787
|
}, argPackAdvance: gg, readValueFromPointer: Xg, destructorFunction(B) {
|
|
2771
2788
|
ZA(B);
|
|
@@ -2773,17 +2790,17 @@ return ret;
|
|
|
2773
2790
|
}, UC = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, YQ = (A, g) => {
|
|
2774
2791
|
for (var I = A, B = I >> 1, t = B + g / 2; !(B >= t) && Z[B]; ) ++B;
|
|
2775
2792
|
if (I = B << 1, I - A > 32 && UC) return UC.decode(x.subarray(A, I));
|
|
2776
|
-
for (var
|
|
2793
|
+
for (var a = "", c = 0; !(c >= g / 2); ++c) {
|
|
2777
2794
|
var l = j[A + c * 2 >> 1];
|
|
2778
2795
|
if (l == 0) break;
|
|
2779
|
-
|
|
2796
|
+
a += String.fromCharCode(l);
|
|
2780
2797
|
}
|
|
2781
|
-
return
|
|
2798
|
+
return a;
|
|
2782
2799
|
}, HQ = (A, g, I) => {
|
|
2783
2800
|
if (I ?? (I = 2147483647), I < 2) return 0;
|
|
2784
2801
|
I -= 2;
|
|
2785
|
-
for (var B = g, t = I < A.length * 2 ? I / 2 : A.length,
|
|
2786
|
-
var c = A.charCodeAt(
|
|
2802
|
+
for (var B = g, t = I < A.length * 2 ? I / 2 : A.length, a = 0; a < t; ++a) {
|
|
2803
|
+
var c = A.charCodeAt(a);
|
|
2787
2804
|
j[g >> 1] = c, g += 2;
|
|
2788
2805
|
}
|
|
2789
2806
|
return j[g >> 1] = 0, g - B;
|
|
@@ -2792,17 +2809,17 @@ return ret;
|
|
|
2792
2809
|
var t = P[A + I * 4 >> 2];
|
|
2793
2810
|
if (t == 0) break;
|
|
2794
2811
|
if (++I, t >= 65536) {
|
|
2795
|
-
var
|
|
2796
|
-
B += String.fromCharCode(55296 |
|
|
2812
|
+
var a = t - 65536;
|
|
2813
|
+
B += String.fromCharCode(55296 | a >> 10, 56320 | a & 1023);
|
|
2797
2814
|
} else B += String.fromCharCode(t);
|
|
2798
2815
|
}
|
|
2799
2816
|
return B;
|
|
2800
2817
|
}, qQ = (A, g, I) => {
|
|
2801
2818
|
if (I ?? (I = 2147483647), I < 4) return 0;
|
|
2802
|
-
for (var B = g, t = B + I - 4,
|
|
2803
|
-
var c = A.charCodeAt(
|
|
2819
|
+
for (var B = g, t = B + I - 4, a = 0; a < A.length; ++a) {
|
|
2820
|
+
var c = A.charCodeAt(a);
|
|
2804
2821
|
if (c >= 55296 && c <= 57343) {
|
|
2805
|
-
var l = A.charCodeAt(++
|
|
2822
|
+
var l = A.charCodeAt(++a);
|
|
2806
2823
|
c = 65536 + ((c & 1023) << 10) | l & 1023;
|
|
2807
2824
|
}
|
|
2808
2825
|
if (P[g >> 2] = c, g += 4, g + 4 > t) break;
|
|
@@ -2816,11 +2833,11 @@ return ret;
|
|
|
2816
2833
|
return g;
|
|
2817
2834
|
}, xQ = (A, g, I) => {
|
|
2818
2835
|
I = KA(I);
|
|
2819
|
-
var B, t,
|
|
2820
|
-
g === 2 ? (B = YQ, t = HQ, c = mQ,
|
|
2836
|
+
var B, t, a, c;
|
|
2837
|
+
g === 2 ? (B = YQ, t = HQ, c = mQ, a = (l) => Z[l >> 1]) : g === 4 && (B = KQ, t = qQ, c = vQ, a = (l) => z[l >> 2]), XA(A, { name: I, fromWireType: (l) => {
|
|
2821
2838
|
for (var d = z[l >> 2], F, k = l + 4, m = 0; m <= d; ++m) {
|
|
2822
2839
|
var p = l + 4 + m * g;
|
|
2823
|
-
if (m == d ||
|
|
2840
|
+
if (m == d || a(p) == 0) {
|
|
2824
2841
|
var K = p - k, W = B(k, K);
|
|
2825
2842
|
F === void 0 ? F = W : (F += "\0", F += W), k = p + g;
|
|
2826
2843
|
}
|
|
@@ -2895,8 +2912,8 @@ return ret;
|
|
|
2895
2912
|
}, IE = (A, g) => {
|
|
2896
2913
|
var I = 0;
|
|
2897
2914
|
return kg().forEach((B, t) => {
|
|
2898
|
-
var
|
|
2899
|
-
z[A + t * 4 >> 2] =
|
|
2915
|
+
var a = g + I;
|
|
2916
|
+
z[A + t * 4 >> 2] = a, gE(B, a), I += B.length + 1;
|
|
2900
2917
|
}), 0;
|
|
2901
2918
|
}, CE = (A, g) => {
|
|
2902
2919
|
var I = kg();
|
|
@@ -2941,7 +2958,7 @@ return ret;
|
|
|
2941
2958
|
if (!t) return "";
|
|
2942
2959
|
g = t + "/" + g, I = tA.isAbs(t);
|
|
2943
2960
|
}
|
|
2944
|
-
return g = tA.normalizeArray(g.split("/").filter((
|
|
2961
|
+
return g = tA.normalizeArray(g.split("/").filter((a) => !!a), !I).join("/"), (I ? "/" : "") + g || ".";
|
|
2945
2962
|
}, relative: (A, g) => {
|
|
2946
2963
|
A = zA.resolve(A).substr(1), g = zA.resolve(g).substr(1);
|
|
2947
2964
|
function I(F) {
|
|
@@ -2949,7 +2966,7 @@ return ret;
|
|
|
2949
2966
|
for (var m = F.length - 1; m >= 0 && F[m] === ""; m--) ;
|
|
2950
2967
|
return k > m ? [] : F.slice(k, m - k + 1);
|
|
2951
2968
|
}
|
|
2952
|
-
for (var B = I(A.split("/")), t = I(g.split("/")),
|
|
2969
|
+
for (var B = I(A.split("/")), t = I(g.split("/")), a = Math.min(B.length, t.length), c = a, l = 0; l < a; l++) if (B[l] !== t[l]) {
|
|
2953
2970
|
c = l;
|
|
2954
2971
|
break;
|
|
2955
2972
|
}
|
|
@@ -2957,8 +2974,8 @@ return ret;
|
|
|
2957
2974
|
return d = d.concat(t.slice(c)), d.join("/");
|
|
2958
2975
|
} }, MI = [];
|
|
2959
2976
|
function AI(A, g, I) {
|
|
2960
|
-
var B = UI(A) + 1, t = new Array(B),
|
|
2961
|
-
return g && (t.length =
|
|
2977
|
+
var B = UI(A) + 1, t = new Array(B), a = LI(A, t, 0, t.length);
|
|
2978
|
+
return g && (t.length = a), t;
|
|
2962
2979
|
}
|
|
2963
2980
|
var QE = () => {
|
|
2964
2981
|
if (!MI.length) {
|
|
@@ -2967,9 +2984,9 @@ return ret;
|
|
|
2967
2984
|
var g = 256, I = Buffer.alloc(g), B = 0, t = process.stdin.fd;
|
|
2968
2985
|
try {
|
|
2969
2986
|
B = $.readSync(t, I);
|
|
2970
|
-
} catch (
|
|
2971
|
-
if (
|
|
2972
|
-
else throw
|
|
2987
|
+
} catch (a) {
|
|
2988
|
+
if (a.toString().includes("EOF")) B = 0;
|
|
2989
|
+
else throw a;
|
|
2973
2990
|
}
|
|
2974
2991
|
B > 0 ? A = I.slice(0, B).toString("utf-8") : A = null;
|
|
2975
2992
|
} else typeof window < "u" && typeof window.prompt == "function" ? (A = window.prompt("Input: "), A !== null && (A += `
|
|
@@ -2993,26 +3010,26 @@ return ret;
|
|
|
2993
3010
|
A.tty.ops.fsync(A.tty);
|
|
2994
3011
|
}, read(A, g, I, B, t) {
|
|
2995
3012
|
if (!A.tty || !A.tty.ops.get_char) throw new E.ErrnoError(60);
|
|
2996
|
-
for (var
|
|
3013
|
+
for (var a = 0, c = 0; c < B; c++) {
|
|
2997
3014
|
var l;
|
|
2998
3015
|
try {
|
|
2999
3016
|
l = A.tty.ops.get_char(A.tty);
|
|
3000
3017
|
} catch {
|
|
3001
3018
|
throw new E.ErrnoError(29);
|
|
3002
3019
|
}
|
|
3003
|
-
if (l === void 0 &&
|
|
3020
|
+
if (l === void 0 && a === 0) throw new E.ErrnoError(6);
|
|
3004
3021
|
if (l == null) break;
|
|
3005
|
-
|
|
3022
|
+
a++, g[I + c] = l;
|
|
3006
3023
|
}
|
|
3007
|
-
return
|
|
3024
|
+
return a && (A.node.timestamp = Date.now()), a;
|
|
3008
3025
|
}, write(A, g, I, B, t) {
|
|
3009
3026
|
if (!A.tty || !A.tty.ops.put_char) throw new E.ErrnoError(60);
|
|
3010
3027
|
try {
|
|
3011
|
-
for (var
|
|
3028
|
+
for (var a = 0; a < B; a++) A.tty.ops.put_char(A.tty, g[I + a]);
|
|
3012
3029
|
} catch {
|
|
3013
3030
|
throw new E.ErrnoError(29);
|
|
3014
3031
|
}
|
|
3015
|
-
return B && (A.node.timestamp = Date.now()),
|
|
3032
|
+
return B && (A.node.timestamp = Date.now()), a;
|
|
3016
3033
|
} }, default_tty_ops: { get_char(A) {
|
|
3017
3034
|
return QE();
|
|
3018
3035
|
}, put_char(A, g) {
|
|
@@ -3092,17 +3109,17 @@ return ret;
|
|
|
3092
3109
|
if (!E.isLink(A.mode)) throw new E.ErrnoError(28);
|
|
3093
3110
|
return A.link;
|
|
3094
3111
|
} }, stream_ops: { read(A, g, I, B, t) {
|
|
3095
|
-
var
|
|
3112
|
+
var a = A.node.contents;
|
|
3096
3113
|
if (t >= A.node.usedBytes) return 0;
|
|
3097
3114
|
var c = Math.min(A.node.usedBytes - t, B);
|
|
3098
|
-
if (c > 8 &&
|
|
3099
|
-
else for (var l = 0; l < c; l++) g[I + l] =
|
|
3115
|
+
if (c > 8 && a.subarray) g.set(a.subarray(t, t + c), I);
|
|
3116
|
+
else for (var l = 0; l < c; l++) g[I + l] = a[t + l];
|
|
3100
3117
|
return c;
|
|
3101
|
-
}, write(A, g, I, B, t,
|
|
3118
|
+
}, write(A, g, I, B, t, a) {
|
|
3102
3119
|
if (!B) return 0;
|
|
3103
3120
|
var c = A.node;
|
|
3104
3121
|
if (c.timestamp = Date.now(), g.subarray && (!c.contents || c.contents.subarray)) {
|
|
3105
|
-
if (
|
|
3122
|
+
if (a) return c.contents = g.subarray(I, I + B), c.usedBytes = B, B;
|
|
3106
3123
|
if (c.usedBytes === 0 && t === 0) return c.contents = g.slice(I, I + B), c.usedBytes = B, B;
|
|
3107
3124
|
if (t + B <= c.usedBytes) return c.contents.set(g.subarray(I, I + B), t), B;
|
|
3108
3125
|
}
|
|
@@ -3117,36 +3134,36 @@ return ret;
|
|
|
3117
3134
|
O.expandFileStorage(A.node, g + I), A.node.usedBytes = Math.max(A.node.usedBytes, g + I);
|
|
3118
3135
|
}, mmap(A, g, I, B, t) {
|
|
3119
3136
|
if (!E.isFile(A.node.mode)) throw new E.ErrnoError(43);
|
|
3120
|
-
var
|
|
3121
|
-
if (!(t & 2) && l.buffer === Y.buffer) c = !1,
|
|
3137
|
+
var a, c, l = A.node.contents;
|
|
3138
|
+
if (!(t & 2) && l.buffer === Y.buffer) c = !1, a = l.byteOffset;
|
|
3122
3139
|
else {
|
|
3123
|
-
if ((I > 0 || I + g < l.length) && (l.subarray ? l = l.subarray(I, I + g) : l = Array.prototype.slice.call(l, I, I + g)), c = !0,
|
|
3124
|
-
Y.set(l,
|
|
3140
|
+
if ((I > 0 || I + g < l.length) && (l.subarray ? l = l.subarray(I, I + g) : l = Array.prototype.slice.call(l, I, I + g)), c = !0, a = KC(g), !a) throw new E.ErrnoError(48);
|
|
3141
|
+
Y.set(l, a);
|
|
3125
3142
|
}
|
|
3126
|
-
return { ptr:
|
|
3143
|
+
return { ptr: a, allocated: c };
|
|
3127
3144
|
}, msync(A, g, I, B, t) {
|
|
3128
3145
|
return O.stream_ops.write(A, g, 0, B, I, !1), 0;
|
|
3129
3146
|
} } }, tE = (A, g, I, B) => {
|
|
3130
3147
|
var t = `al ${A}`;
|
|
3131
|
-
_(A, (
|
|
3132
|
-
g(new Uint8Array(
|
|
3133
|
-
}, (
|
|
3148
|
+
_(A, (a) => {
|
|
3149
|
+
g(new Uint8Array(a)), t && vg();
|
|
3150
|
+
}, (a) => {
|
|
3134
3151
|
if (I) I();
|
|
3135
3152
|
else throw `Loading data file "${A}" failed.`;
|
|
3136
3153
|
}), t && wI();
|
|
3137
|
-
}, oE = (A, g, I, B, t,
|
|
3138
|
-
E.createDataFile(A, g, I, B, t,
|
|
3154
|
+
}, oE = (A, g, I, B, t, a) => {
|
|
3155
|
+
E.createDataFile(A, g, I, B, t, a);
|
|
3139
3156
|
}, iE = n.preloadPlugins || [], nE = (A, g, I, B) => {
|
|
3140
3157
|
typeof Browser < "u" && Browser.init();
|
|
3141
3158
|
var t = !1;
|
|
3142
|
-
return iE.forEach((
|
|
3143
|
-
t ||
|
|
3159
|
+
return iE.forEach((a) => {
|
|
3160
|
+
t || a.canHandle(g) && (a.handle(A, g, I, B), t = !0);
|
|
3144
3161
|
}), t;
|
|
3145
|
-
}, rE = (A, g, I, B, t,
|
|
3162
|
+
}, rE = (A, g, I, B, t, a, c, l, d, F) => {
|
|
3146
3163
|
var k = g ? zA.resolve(tA.join2(A, g)) : A;
|
|
3147
3164
|
function m(p) {
|
|
3148
3165
|
function K(W) {
|
|
3149
|
-
F == null || F(), l || oE(A, g, W, B, t, d),
|
|
3166
|
+
F == null || F(), l || oE(A, g, W, B, t, d), a == null || a(), vg();
|
|
3150
3167
|
}
|
|
3151
3168
|
nE(p, k, K, () => {
|
|
3152
3169
|
c == null || c(), vg();
|
|
@@ -3221,17 +3238,17 @@ return ret;
|
|
|
3221
3238
|
if (A = zA.resolve(A), !A) return { path: "", node: null };
|
|
3222
3239
|
var I = { follow_mount: !0, recurse_count: 0 };
|
|
3223
3240
|
if (g = Object.assign(I, g), g.recurse_count > 8) throw new E.ErrnoError(32);
|
|
3224
|
-
for (var B = A.split("/").filter((m) => !!m), t = E.root,
|
|
3241
|
+
for (var B = A.split("/").filter((m) => !!m), t = E.root, a = "/", c = 0; c < B.length; c++) {
|
|
3225
3242
|
var l = c === B.length - 1;
|
|
3226
3243
|
if (l && g.parent) break;
|
|
3227
|
-
if (t = E.lookupNode(t, B[c]),
|
|
3228
|
-
var F = E.readlink(
|
|
3229
|
-
|
|
3230
|
-
var k = E.lookupPath(
|
|
3244
|
+
if (t = E.lookupNode(t, B[c]), a = tA.join2(a, B[c]), E.isMountpoint(t) && (!l || l && g.follow_mount) && (t = t.mounted.root), !l || g.follow) for (var d = 0; E.isLink(t.mode); ) {
|
|
3245
|
+
var F = E.readlink(a);
|
|
3246
|
+
a = zA.resolve(tA.dirname(a), F);
|
|
3247
|
+
var k = E.lookupPath(a, { recurse_count: g.recurse_count + 1 });
|
|
3231
3248
|
if (t = k.node, d++ > 40) throw new E.ErrnoError(32);
|
|
3232
3249
|
}
|
|
3233
3250
|
}
|
|
3234
|
-
return { path:
|
|
3251
|
+
return { path: a, node: t };
|
|
3235
3252
|
}, getPath(A) {
|
|
3236
3253
|
for (var g; ; ) {
|
|
3237
3254
|
if (E.isRoot(A)) {
|
|
@@ -3260,8 +3277,8 @@ return ret;
|
|
|
3260
3277
|
var I = E.mayLookup(A);
|
|
3261
3278
|
if (I) throw new E.ErrnoError(I);
|
|
3262
3279
|
for (var B = E.hashName(A.id, g), t = E.nameTable[B]; t; t = t.name_next) {
|
|
3263
|
-
var
|
|
3264
|
-
if (t.parent.id === A.id &&
|
|
3280
|
+
var a = t.name;
|
|
3281
|
+
if (t.parent.id === A.id && a === g) return t;
|
|
3265
3282
|
}
|
|
3266
3283
|
return E.lookup(A, g);
|
|
3267
3284
|
}, createNode(A, g, I, B) {
|
|
@@ -3307,8 +3324,8 @@ return ret;
|
|
|
3307
3324
|
var B;
|
|
3308
3325
|
try {
|
|
3309
3326
|
B = E.lookupNode(A, g);
|
|
3310
|
-
} catch (
|
|
3311
|
-
return
|
|
3327
|
+
} catch (a) {
|
|
3328
|
+
return a.errno;
|
|
3312
3329
|
}
|
|
3313
3330
|
var t = E.nodePermissions(A, "wx");
|
|
3314
3331
|
if (t) return t;
|
|
@@ -3354,24 +3371,24 @@ return ret;
|
|
|
3354
3371
|
function t(c) {
|
|
3355
3372
|
return E.syncFSRequests--, g(c);
|
|
3356
3373
|
}
|
|
3357
|
-
function
|
|
3358
|
-
if (c) return
|
|
3374
|
+
function a(c) {
|
|
3375
|
+
if (c) return a.errored ? void 0 : (a.errored = !0, t(c));
|
|
3359
3376
|
++B >= I.length && t(null);
|
|
3360
3377
|
}
|
|
3361
3378
|
I.forEach((c) => {
|
|
3362
|
-
if (!c.type.syncfs) return
|
|
3363
|
-
c.type.syncfs(c, A,
|
|
3379
|
+
if (!c.type.syncfs) return a(null);
|
|
3380
|
+
c.type.syncfs(c, A, a);
|
|
3364
3381
|
});
|
|
3365
3382
|
}, mount(A, g, I) {
|
|
3366
|
-
var B = I === "/", t = !I,
|
|
3383
|
+
var B = I === "/", t = !I, a;
|
|
3367
3384
|
if (B && E.root) throw new E.ErrnoError(10);
|
|
3368
3385
|
if (!B && !t) {
|
|
3369
3386
|
var c = E.lookupPath(I, { follow_mount: !1 });
|
|
3370
|
-
if (I = c.path,
|
|
3371
|
-
if (!E.isDir(
|
|
3387
|
+
if (I = c.path, a = c.node, E.isMountpoint(a)) throw new E.ErrnoError(10);
|
|
3388
|
+
if (!E.isDir(a.mode)) throw new E.ErrnoError(54);
|
|
3372
3389
|
}
|
|
3373
3390
|
var l = { type: A, opts: g, mountpoint: I, mounts: [] }, d = A.mount(l);
|
|
3374
|
-
return d.mount = l, l.root = d, B ? E.root = d :
|
|
3391
|
+
return d.mount = l, l.root = d, B ? E.root = d : a && (a.mounted = l, a.mount && a.mount.mounts.push(l)), d;
|
|
3375
3392
|
}, unmount(A) {
|
|
3376
3393
|
var g = E.lookupPath(A, { follow_mount: !1 });
|
|
3377
3394
|
if (!E.isMountpoint(g.node)) throw new E.ErrnoError(28);
|
|
@@ -3382,17 +3399,17 @@ return ret;
|
|
|
3382
3399
|
t.includes(l.mount) && E.destroyNode(l), l = d;
|
|
3383
3400
|
}
|
|
3384
3401
|
}), I.mounted = null;
|
|
3385
|
-
var
|
|
3386
|
-
I.mount.mounts.splice(
|
|
3402
|
+
var a = I.mount.mounts.indexOf(B);
|
|
3403
|
+
I.mount.mounts.splice(a, 1);
|
|
3387
3404
|
}, lookup(A, g) {
|
|
3388
3405
|
return A.node_ops.lookup(A, g);
|
|
3389
3406
|
}, mknod(A, g, I) {
|
|
3390
|
-
var B = E.lookupPath(A, { parent: !0 }), t = B.node,
|
|
3391
|
-
if (!
|
|
3392
|
-
var c = E.mayCreate(t,
|
|
3407
|
+
var B = E.lookupPath(A, { parent: !0 }), t = B.node, a = tA.basename(A);
|
|
3408
|
+
if (!a || a === "." || a === "..") throw new E.ErrnoError(28);
|
|
3409
|
+
var c = E.mayCreate(t, a);
|
|
3393
3410
|
if (c) throw new E.ErrnoError(c);
|
|
3394
3411
|
if (!t.node_ops.mknod) throw new E.ErrnoError(63);
|
|
3395
|
-
return t.node_ops.mknod(t,
|
|
3412
|
+
return t.node_ops.mknod(t, a, g, I);
|
|
3396
3413
|
}, create(A, g) {
|
|
3397
3414
|
return g = g !== void 0 ? g : 438, g &= 4095, g |= 32768, E.mknod(A, g, 0);
|
|
3398
3415
|
}, mkdir(A, g) {
|
|
@@ -3402,8 +3419,8 @@ return ret;
|
|
|
3402
3419
|
B += "/" + I[t];
|
|
3403
3420
|
try {
|
|
3404
3421
|
E.mkdir(B, g);
|
|
3405
|
-
} catch (
|
|
3406
|
-
if (
|
|
3422
|
+
} catch (a) {
|
|
3423
|
+
if (a.errno != 20) throw a;
|
|
3407
3424
|
}
|
|
3408
3425
|
}
|
|
3409
3426
|
}, mkdev(A, g, I) {
|
|
@@ -3412,12 +3429,12 @@ return ret;
|
|
|
3412
3429
|
if (!zA.resolve(A)) throw new E.ErrnoError(44);
|
|
3413
3430
|
var I = E.lookupPath(g, { parent: !0 }), B = I.node;
|
|
3414
3431
|
if (!B) throw new E.ErrnoError(44);
|
|
3415
|
-
var t = tA.basename(g),
|
|
3416
|
-
if (
|
|
3432
|
+
var t = tA.basename(g), a = E.mayCreate(B, t);
|
|
3433
|
+
if (a) throw new E.ErrnoError(a);
|
|
3417
3434
|
if (!B.node_ops.symlink) throw new E.ErrnoError(63);
|
|
3418
3435
|
return B.node_ops.symlink(B, t, A);
|
|
3419
3436
|
}, rename(A, g) {
|
|
3420
|
-
var I = tA.dirname(A), B = tA.dirname(g), t = tA.basename(A),
|
|
3437
|
+
var I = tA.dirname(A), B = tA.dirname(g), t = tA.basename(A), a = tA.basename(g), c, l, d;
|
|
3421
3438
|
if (c = E.lookupPath(A, { parent: !0 }), l = c.node, c = E.lookupPath(g, { parent: !0 }), d = c.node, !l || !d) throw new E.ErrnoError(44);
|
|
3422
3439
|
if (l.mount !== d.mount) throw new E.ErrnoError(75);
|
|
3423
3440
|
var F = E.lookupNode(l, t), k = zA.relative(A, B);
|
|
@@ -3425,19 +3442,19 @@ return ret;
|
|
|
3425
3442
|
if (k = zA.relative(g, I), k.charAt(0) !== ".") throw new E.ErrnoError(55);
|
|
3426
3443
|
var m;
|
|
3427
3444
|
try {
|
|
3428
|
-
m = E.lookupNode(d,
|
|
3445
|
+
m = E.lookupNode(d, a);
|
|
3429
3446
|
} catch {
|
|
3430
3447
|
}
|
|
3431
3448
|
if (F !== m) {
|
|
3432
3449
|
var p = E.isDir(F.mode), K = E.mayDelete(l, t, p);
|
|
3433
3450
|
if (K) throw new E.ErrnoError(K);
|
|
3434
|
-
if (K = m ? E.mayDelete(d,
|
|
3451
|
+
if (K = m ? E.mayDelete(d, a, p) : E.mayCreate(d, a), K) throw new E.ErrnoError(K);
|
|
3435
3452
|
if (!l.node_ops.rename) throw new E.ErrnoError(63);
|
|
3436
3453
|
if (E.isMountpoint(F) || m && E.isMountpoint(m)) throw new E.ErrnoError(10);
|
|
3437
3454
|
if (d !== l && (K = E.nodePermissions(l, "w"), K)) throw new E.ErrnoError(K);
|
|
3438
3455
|
E.hashRemoveNode(F);
|
|
3439
3456
|
try {
|
|
3440
|
-
l.node_ops.rename(F, d,
|
|
3457
|
+
l.node_ops.rename(F, d, a);
|
|
3441
3458
|
} catch (W) {
|
|
3442
3459
|
throw W;
|
|
3443
3460
|
} finally {
|
|
@@ -3445,8 +3462,8 @@ return ret;
|
|
|
3445
3462
|
}
|
|
3446
3463
|
}
|
|
3447
3464
|
}, rmdir(A) {
|
|
3448
|
-
var g = E.lookupPath(A, { parent: !0 }), I = g.node, B = tA.basename(A), t = E.lookupNode(I, B),
|
|
3449
|
-
if (
|
|
3465
|
+
var g = E.lookupPath(A, { parent: !0 }), I = g.node, B = tA.basename(A), t = E.lookupNode(I, B), a = E.mayDelete(I, B, !0);
|
|
3466
|
+
if (a) throw new E.ErrnoError(a);
|
|
3450
3467
|
if (!I.node_ops.rmdir) throw new E.ErrnoError(63);
|
|
3451
3468
|
if (E.isMountpoint(t)) throw new E.ErrnoError(10);
|
|
3452
3469
|
I.node_ops.rmdir(I, B), E.destroyNode(t);
|
|
@@ -3457,8 +3474,8 @@ return ret;
|
|
|
3457
3474
|
}, unlink(A) {
|
|
3458
3475
|
var g = E.lookupPath(A, { parent: !0 }), I = g.node;
|
|
3459
3476
|
if (!I) throw new E.ErrnoError(44);
|
|
3460
|
-
var B = tA.basename(A), t = E.lookupNode(I, B),
|
|
3461
|
-
if (
|
|
3477
|
+
var B = tA.basename(A), t = E.lookupNode(I, B), a = E.mayDelete(I, B, !1);
|
|
3478
|
+
if (a) throw new E.ErrnoError(a);
|
|
3462
3479
|
if (!I.node_ops.unlink) throw new E.ErrnoError(63);
|
|
3463
3480
|
if (E.isMountpoint(t)) throw new E.ErrnoError(10);
|
|
3464
3481
|
I.node_ops.unlink(I, B), E.destroyNode(t);
|
|
@@ -3490,8 +3507,8 @@ return ret;
|
|
|
3490
3507
|
}, chown(A, g, I, B) {
|
|
3491
3508
|
var t;
|
|
3492
3509
|
if (typeof A == "string") {
|
|
3493
|
-
var
|
|
3494
|
-
t =
|
|
3510
|
+
var a = E.lookupPath(A, { follow: !B });
|
|
3511
|
+
t = a.node;
|
|
3495
3512
|
} else t = A;
|
|
3496
3513
|
if (!t.node_ops.setattr) throw new E.ErrnoError(63);
|
|
3497
3514
|
t.node_ops.setattr(t, { timestamp: Date.now() });
|
|
@@ -3533,17 +3550,17 @@ return ret;
|
|
|
3533
3550
|
} catch {
|
|
3534
3551
|
}
|
|
3535
3552
|
}
|
|
3536
|
-
var
|
|
3553
|
+
var a = !1;
|
|
3537
3554
|
if (g & 64) if (B) {
|
|
3538
3555
|
if (g & 128) throw new E.ErrnoError(20);
|
|
3539
|
-
} else B = E.mknod(A, I, 0),
|
|
3556
|
+
} else B = E.mknod(A, I, 0), a = !0;
|
|
3540
3557
|
if (!B) throw new E.ErrnoError(44);
|
|
3541
3558
|
if (E.isChrdev(B.mode) && (g &= -513), g & 65536 && !E.isDir(B.mode)) throw new E.ErrnoError(54);
|
|
3542
|
-
if (!
|
|
3559
|
+
if (!a) {
|
|
3543
3560
|
var c = E.mayOpen(B, g);
|
|
3544
3561
|
if (c) throw new E.ErrnoError(c);
|
|
3545
3562
|
}
|
|
3546
|
-
g & 512 && !
|
|
3563
|
+
g & 512 && !a && E.truncate(B, 0), g &= -131713;
|
|
3547
3564
|
var l = E.createStream({ node: B, path: E.getPath(B), flags: g, seekable: !0, position: 0, stream_ops: B.stream_ops, ungotten: [], error: !1 });
|
|
3548
3565
|
return l.stream_ops.open && l.stream_ops.open(l), n.logReadFiles && !(g & 1) && (E.readFiles || (E.readFiles = {}), A in E.readFiles || (E.readFiles[A] = 1)), l;
|
|
3549
3566
|
}, close(A) {
|
|
@@ -3570,12 +3587,12 @@ return ret;
|
|
|
3570
3587
|
if ((A.flags & 2097155) === 1) throw new E.ErrnoError(8);
|
|
3571
3588
|
if (E.isDir(A.node.mode)) throw new E.ErrnoError(31);
|
|
3572
3589
|
if (!A.stream_ops.read) throw new E.ErrnoError(28);
|
|
3573
|
-
var
|
|
3574
|
-
if (!
|
|
3590
|
+
var a = typeof t < "u";
|
|
3591
|
+
if (!a) t = A.position;
|
|
3575
3592
|
else if (!A.seekable) throw new E.ErrnoError(70);
|
|
3576
3593
|
var c = A.stream_ops.read(A, g, I, B, t);
|
|
3577
|
-
return
|
|
3578
|
-
}, write(A, g, I, B, t,
|
|
3594
|
+
return a || (A.position += c), c;
|
|
3595
|
+
}, write(A, g, I, B, t, a) {
|
|
3579
3596
|
if (B < 0 || t < 0) throw new E.ErrnoError(28);
|
|
3580
3597
|
if (E.isClosed(A)) throw new E.ErrnoError(8);
|
|
3581
3598
|
if (!(A.flags & 2097155)) throw new E.ErrnoError(8);
|
|
@@ -3585,7 +3602,7 @@ return ret;
|
|
|
3585
3602
|
var c = typeof t < "u";
|
|
3586
3603
|
if (!c) t = A.position;
|
|
3587
3604
|
else if (!A.seekable) throw new E.ErrnoError(70);
|
|
3588
|
-
var l = A.stream_ops.write(A, g, I, B, t,
|
|
3605
|
+
var l = A.stream_ops.write(A, g, I, B, t, a);
|
|
3589
3606
|
return c || (A.position += l), l;
|
|
3590
3607
|
}, allocate(A, g, I) {
|
|
3591
3608
|
if (E.isClosed(A)) throw new E.ErrnoError(8);
|
|
@@ -3606,14 +3623,14 @@ return ret;
|
|
|
3606
3623
|
return A.stream_ops.ioctl(A, g, I);
|
|
3607
3624
|
}, readFile(A, g = {}) {
|
|
3608
3625
|
if (g.flags = g.flags || 0, g.encoding = g.encoding || "binary", g.encoding !== "utf8" && g.encoding !== "binary") throw new Error(`Invalid encoding type "${g.encoding}"`);
|
|
3609
|
-
var I, B = E.open(A, g.flags), t = E.stat(A),
|
|
3610
|
-
return E.read(B, c, 0,
|
|
3626
|
+
var I, B = E.open(A, g.flags), t = E.stat(A), a = t.size, c = new Uint8Array(a);
|
|
3627
|
+
return E.read(B, c, 0, a, 0), g.encoding === "utf8" ? I = rg(c, 0) : g.encoding === "binary" && (I = c), E.close(B), I;
|
|
3611
3628
|
}, writeFile(A, g, I = {}) {
|
|
3612
3629
|
I.flags = I.flags || 577;
|
|
3613
3630
|
var B = E.open(A, I.flags, I.mode);
|
|
3614
3631
|
if (typeof g == "string") {
|
|
3615
|
-
var t = new Uint8Array(UI(g) + 1),
|
|
3616
|
-
E.write(B, t, 0,
|
|
3632
|
+
var t = new Uint8Array(UI(g) + 1), a = LI(g, t, 0, t.length);
|
|
3633
|
+
E.write(B, t, 0, a, void 0, I.canOwn);
|
|
3617
3634
|
} else if (ArrayBuffer.isView(g)) E.write(B, g, 0, g.byteLength, void 0, I.canOwn);
|
|
3618
3635
|
else throw new Error("Unsupported data type");
|
|
3619
3636
|
E.close(B);
|
|
@@ -3627,7 +3644,7 @@ return ret;
|
|
|
3627
3644
|
}, createDefaultDirectories() {
|
|
3628
3645
|
E.mkdir("/tmp"), E.mkdir("/home"), E.mkdir("/home/web_user");
|
|
3629
3646
|
}, createDefaultDevices() {
|
|
3630
|
-
E.mkdir("/dev"), E.registerDevice(E.makedev(1, 3), { read: () => 0, write: (B, t,
|
|
3647
|
+
E.mkdir("/dev"), E.registerDevice(E.makedev(1, 3), { read: () => 0, write: (B, t, a, c, l) => c }), E.mkdev("/dev/null", E.makedev(1, 3)), og.register(E.makedev(5, 0), og.default_tty_ops), og.register(E.makedev(6, 0), og.default_tty1_ops), E.mkdev("/dev/tty", E.makedev(5, 0)), E.mkdev("/dev/tty1", E.makedev(6, 0));
|
|
3631
3648
|
var A = new Uint8Array(1024), g = 0, I = () => (g === 0 && (g = mC(A).byteLength), A[--g]);
|
|
3632
3649
|
E.createDevice("/dev", "random", I), E.createDevice("/dev", "urandom", I), E.mkdir("/dev/shm"), E.mkdir("/dev/shm/tmp");
|
|
3633
3650
|
}, createSpecialDirectories() {
|
|
@@ -3636,7 +3653,7 @@ return ret;
|
|
|
3636
3653
|
E.mkdir("/proc/self/fd"), E.mount({ mount() {
|
|
3637
3654
|
var g = E.createNode(A, "fd", 16895, 73);
|
|
3638
3655
|
return g.node_ops = { lookup(I, B) {
|
|
3639
|
-
var t = +B,
|
|
3656
|
+
var t = +B, a = E.getStreamChecked(t), c = { parent: null, mount: { mountpoint: "fake" }, node_ops: { readlink: () => a.path } };
|
|
3640
3657
|
return c.parent = c, c;
|
|
3641
3658
|
} }, g;
|
|
3642
3659
|
} }, {}, "/proc/self/fd");
|
|
@@ -3674,9 +3691,9 @@ return ret;
|
|
|
3674
3691
|
}, createPath(A, g, I, B) {
|
|
3675
3692
|
A = typeof A == "string" ? A : E.getPath(A);
|
|
3676
3693
|
for (var t = g.split("/").reverse(); t.length; ) {
|
|
3677
|
-
var
|
|
3678
|
-
if (
|
|
3679
|
-
var c = tA.join2(A,
|
|
3694
|
+
var a = t.pop();
|
|
3695
|
+
if (a) {
|
|
3696
|
+
var c = tA.join2(A, a);
|
|
3680
3697
|
try {
|
|
3681
3698
|
E.mkdir(c);
|
|
3682
3699
|
} catch {
|
|
@@ -3686,9 +3703,9 @@ return ret;
|
|
|
3686
3703
|
}
|
|
3687
3704
|
return c;
|
|
3688
3705
|
}, createFile(A, g, I, B, t) {
|
|
3689
|
-
var
|
|
3690
|
-
return E.create(
|
|
3691
|
-
}, createDataFile(A, g, I, B, t,
|
|
3706
|
+
var a = tA.join2(typeof A == "string" ? A : E.getPath(A), g), c = pI(B, t);
|
|
3707
|
+
return E.create(a, c);
|
|
3708
|
+
}, createDataFile(A, g, I, B, t, a) {
|
|
3692
3709
|
var c = g;
|
|
3693
3710
|
A && (A = typeof A == "string" ? A : E.getPath(A), c = g ? tA.join2(A, g) : A);
|
|
3694
3711
|
var l = pI(B, t), d = E.create(c, l);
|
|
@@ -3699,10 +3716,10 @@ return ret;
|
|
|
3699
3716
|
}
|
|
3700
3717
|
E.chmod(d, l | 146);
|
|
3701
3718
|
var p = E.open(d, 577);
|
|
3702
|
-
E.write(p, I, 0, I.length, 0,
|
|
3719
|
+
E.write(p, I, 0, I.length, 0, a), E.close(p), E.chmod(d, l);
|
|
3703
3720
|
}
|
|
3704
3721
|
}, createDevice(A, g, I, B) {
|
|
3705
|
-
var t = tA.join2(typeof A == "string" ? A : E.getPath(A), g),
|
|
3722
|
+
var t = tA.join2(typeof A == "string" ? A : E.getPath(A), g), a = pI(!!I, !!B);
|
|
3706
3723
|
E.createDevice.major || (E.createDevice.major = 64);
|
|
3707
3724
|
var c = E.makedev(E.createDevice.major++, 0);
|
|
3708
3725
|
return E.registerDevice(c, { open(l) {
|
|
@@ -3730,7 +3747,7 @@ return ret;
|
|
|
3730
3747
|
throw new E.ErrnoError(29);
|
|
3731
3748
|
}
|
|
3732
3749
|
return k && (l.node.timestamp = Date.now()), p;
|
|
3733
|
-
} }), E.mkdev(t,
|
|
3750
|
+
} }), E.mkdev(t, a, c);
|
|
3734
3751
|
}, forceLoadFile(A) {
|
|
3735
3752
|
if (A.isDevice || A.isFolder || A.link || A.contents) return !0;
|
|
3736
3753
|
if (typeof XMLHttpRequest < "u") throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
|
@@ -3741,7 +3758,7 @@ return ret;
|
|
|
3741
3758
|
}
|
|
3742
3759
|
else throw new Error("Cannot load without read() or XMLHttpRequest.");
|
|
3743
3760
|
}, createLazyFile(A, g, I, B, t) {
|
|
3744
|
-
class
|
|
3761
|
+
class a {
|
|
3745
3762
|
constructor() {
|
|
3746
3763
|
this.lengthKnown = !1, this.chunks = [];
|
|
3747
3764
|
}
|
|
@@ -3781,7 +3798,7 @@ return ret;
|
|
|
3781
3798
|
}
|
|
3782
3799
|
if (typeof XMLHttpRequest < "u") {
|
|
3783
3800
|
if (!f) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
|
|
3784
|
-
var c = new
|
|
3801
|
+
var c = new a(), l = { isDevice: !1, contents: c };
|
|
3785
3802
|
} else var l = { isDevice: !1, url: I };
|
|
3786
3803
|
var d = E.createFile(A, g, l, B, t);
|
|
3787
3804
|
l.contents ? d.contents = l.contents : l.url && (d.contents = null, d.url = l.url), Object.defineProperties(d, { usedBytes: { get: function() {
|
|
@@ -3822,13 +3839,13 @@ return ret;
|
|
|
3822
3839
|
}, doStat(A, g, I) {
|
|
3823
3840
|
var B = A(g);
|
|
3824
3841
|
P[I >> 2] = B.dev, P[I + 4 >> 2] = B.mode, z[I + 8 >> 2] = B.nlink, P[I + 12 >> 2] = B.uid, P[I + 16 >> 2] = B.gid, P[I + 20 >> 2] = B.rdev, fA = [B.size >>> 0, (gA = B.size, +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 24 >> 2] = fA[0], P[I + 28 >> 2] = fA[1], P[I + 32 >> 2] = 4096, P[I + 36 >> 2] = B.blocks;
|
|
3825
|
-
var t = B.atime.getTime(),
|
|
3826
|
-
return fA = [Math.floor(t / 1e3) >>> 0, (gA = Math.floor(t / 1e3), +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 40 >> 2] = fA[0], P[I + 44 >> 2] = fA[1], z[I + 48 >> 2] = t % 1e3 * 1e3, fA = [Math.floor(
|
|
3842
|
+
var t = B.atime.getTime(), a = B.mtime.getTime(), c = B.ctime.getTime();
|
|
3843
|
+
return fA = [Math.floor(t / 1e3) >>> 0, (gA = Math.floor(t / 1e3), +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 40 >> 2] = fA[0], P[I + 44 >> 2] = fA[1], z[I + 48 >> 2] = t % 1e3 * 1e3, fA = [Math.floor(a / 1e3) >>> 0, (gA = Math.floor(a / 1e3), +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 56 >> 2] = fA[0], P[I + 60 >> 2] = fA[1], z[I + 64 >> 2] = a % 1e3 * 1e3, fA = [Math.floor(c / 1e3) >>> 0, (gA = Math.floor(c / 1e3), +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 72 >> 2] = fA[0], P[I + 76 >> 2] = fA[1], z[I + 80 >> 2] = c % 1e3 * 1e3, fA = [B.ino >>> 0, (gA = B.ino, +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[I + 88 >> 2] = fA[0], P[I + 92 >> 2] = fA[1], 0;
|
|
3827
3844
|
}, doMsync(A, g, I, B, t) {
|
|
3828
3845
|
if (!E.isFile(g.node.mode)) throw new E.ErrnoError(43);
|
|
3829
3846
|
if (B & 2) return 0;
|
|
3830
|
-
var
|
|
3831
|
-
E.msync(g,
|
|
3847
|
+
var a = x.slice(A, A + I);
|
|
3848
|
+
E.msync(g, a, t, I, B);
|
|
3832
3849
|
}, getStreamFromFD(A) {
|
|
3833
3850
|
var g = E.getStreamChecked(A);
|
|
3834
3851
|
return g;
|
|
@@ -3846,7 +3863,7 @@ return ret;
|
|
|
3846
3863
|
}
|
|
3847
3864
|
}
|
|
3848
3865
|
var cE = (A, g, I, B) => {
|
|
3849
|
-
for (var t = 0,
|
|
3866
|
+
for (var t = 0, a = 0; a < I; a++) {
|
|
3850
3867
|
var c = z[g >> 2], l = z[g + 4 >> 2];
|
|
3851
3868
|
g += 8;
|
|
3852
3869
|
var d = E.read(A, Y, c, l, B);
|
|
@@ -3857,8 +3874,8 @@ return ret;
|
|
|
3857
3874
|
};
|
|
3858
3875
|
function lE(A, g, I, B) {
|
|
3859
3876
|
try {
|
|
3860
|
-
var t = Lg.getStreamFromFD(A),
|
|
3861
|
-
return z[B >> 2] =
|
|
3877
|
+
var t = Lg.getStreamFromFD(A), a = cE(t, g, I);
|
|
3878
|
+
return z[B >> 2] = a, 0;
|
|
3862
3879
|
} catch (c) {
|
|
3863
3880
|
if (typeof E > "u" || c.name !== "ErrnoError") throw c;
|
|
3864
3881
|
return c.errno;
|
|
@@ -3866,18 +3883,18 @@ return ret;
|
|
|
3866
3883
|
}
|
|
3867
3884
|
var wE = (A, g) => g + 2097152 >>> 0 < 4194305 - !!A ? (A >>> 0) + g * 4294967296 : NaN;
|
|
3868
3885
|
function hE(A, g, I, B, t) {
|
|
3869
|
-
var
|
|
3886
|
+
var a = wE(g, I);
|
|
3870
3887
|
try {
|
|
3871
|
-
if (isNaN(
|
|
3888
|
+
if (isNaN(a)) return 61;
|
|
3872
3889
|
var c = Lg.getStreamFromFD(A);
|
|
3873
|
-
return E.llseek(c,
|
|
3890
|
+
return E.llseek(c, a, B), fA = [c.position >>> 0, (gA = c.position, +Math.abs(gA) >= 1 ? gA > 0 ? +Math.floor(gA / 4294967296) >>> 0 : ~~+Math.ceil((gA - +(~~gA >>> 0)) / 4294967296) >>> 0 : 0)], P[t >> 2] = fA[0], P[t + 4 >> 2] = fA[1], c.getdents && a === 0 && B === 0 && (c.getdents = null), 0;
|
|
3874
3891
|
} catch (l) {
|
|
3875
3892
|
if (typeof E > "u" || l.name !== "ErrnoError") throw l;
|
|
3876
3893
|
return l.errno;
|
|
3877
3894
|
}
|
|
3878
3895
|
}
|
|
3879
3896
|
var DE = (A, g, I, B) => {
|
|
3880
|
-
for (var t = 0,
|
|
3897
|
+
for (var t = 0, a = 0; a < I; a++) {
|
|
3881
3898
|
var c = z[g >> 2], l = z[g + 4 >> 2];
|
|
3882
3899
|
g += 8;
|
|
3883
3900
|
var d = E.write(A, Y, c, l, B);
|
|
@@ -3888,8 +3905,8 @@ return ret;
|
|
|
3888
3905
|
};
|
|
3889
3906
|
function dE(A, g, I, B) {
|
|
3890
3907
|
try {
|
|
3891
|
-
var t = Lg.getStreamFromFD(A),
|
|
3892
|
-
return z[B >> 2] =
|
|
3908
|
+
var t = Lg.getStreamFromFD(A), a = DE(t, g, I);
|
|
3909
|
+
return z[B >> 2] = a, 0;
|
|
3893
3910
|
} catch (c) {
|
|
3894
3911
|
if (typeof E > "u" || c.name !== "ErrnoError") throw c;
|
|
3895
3912
|
return c.errno;
|
|
@@ -3900,15 +3917,15 @@ return ret;
|
|
|
3900
3917
|
return I;
|
|
3901
3918
|
}, qC = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], vC = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], uE = (A, g) => {
|
|
3902
3919
|
for (var I = new Date(A.getTime()); g > 0; ) {
|
|
3903
|
-
var B = gI(I.getFullYear()), t = I.getMonth(),
|
|
3904
|
-
if (g >
|
|
3920
|
+
var B = gI(I.getFullYear()), t = I.getMonth(), a = (B ? qC : vC)[t];
|
|
3921
|
+
if (g > a - I.getDate()) g -= a - I.getDate() + 1, I.setDate(1), t < 11 ? I.setMonth(t + 1) : (I.setMonth(0), I.setFullYear(I.getFullYear() + 1));
|
|
3905
3922
|
else return I.setDate(I.getDate() + g), I;
|
|
3906
3923
|
}
|
|
3907
3924
|
return I;
|
|
3908
3925
|
}, fE = (A, g) => {
|
|
3909
3926
|
Y.set(A, g);
|
|
3910
3927
|
}, RE = (A, g, I, B) => {
|
|
3911
|
-
var t = z[B + 40 >> 2],
|
|
3928
|
+
var t = z[B + 40 >> 2], a = { tm_sec: P[B >> 2], tm_min: P[B + 4 >> 2], tm_hour: P[B + 8 >> 2], tm_mday: P[B + 12 >> 2], tm_mon: P[B + 16 >> 2], tm_year: P[B + 20 >> 2], tm_wday: P[B + 24 >> 2], tm_yday: P[B + 28 >> 2], tm_isdst: P[B + 32 >> 2], tm_gmtoff: P[B + 36 >> 2], tm_zone: t ? $g(t) : "" }, c = $g(I), l = { "%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y" };
|
|
3912
3929
|
for (var d in l) c = c.replace(new RegExp(d, "g"), l[d]);
|
|
3913
3930
|
var F = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], k = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
3914
3931
|
function m(N, H, DA) {
|
|
@@ -3978,7 +3995,7 @@ return ret;
|
|
|
3978
3995
|
return H = Math.abs(H) / 60, H = H / 60 * 100 + H % 60, (DA ? "+" : "-") + ("0000" + H).slice(-4);
|
|
3979
3996
|
}, "%Z": (N) => N.tm_zone, "%%": () => "%" };
|
|
3980
3997
|
c = c.replace(/%%/g, "\0\0");
|
|
3981
|
-
for (var d in aA) c.includes(d) && (c = c.replace(new RegExp(d, "g"), aA[d](
|
|
3998
|
+
for (var d in aA) c.includes(d) && (c = c.replace(new RegExp(d, "g"), aA[d](a)));
|
|
3982
3999
|
c = c.replace(/\0\0/g, "%");
|
|
3983
4000
|
var hA = AI(c, !1);
|
|
3984
4001
|
return hA.length > g ? 0 : (fE(hA, A), hA.length - 1);
|
|
@@ -3993,7 +4010,7 @@ return ret;
|
|
|
3993
4010
|
}
|
|
3994
4011
|
}, IQ(), _B(), nQ(), fC = n.UnboundTypeError = lQ(Error, "UnboundTypeError"), NQ(), E.createPreloadedFile = rE, E.staticInit();
|
|
3995
4012
|
var NE = { t: qB, f: xB, x: bB, p: TB, k: WB, j: wQ, d: yQ, o: uQ, c: fQ, E: GC, i: LQ, b: SQ, a: MQ, y: pQ, h: JQ, e: xQ, l: bQ, v: TQ, w: PQ, u: jQ, m: VQ, r: _Q, s: AE, B: IE, C: CE, A: sE, z: lE, n: hE, g: dE, D: YC, q: FE }, kA = KB(), xC = (A) => (xC = kA.H)(A), JI = (A) => (JI = kA.J)(A), ZA = (A) => (ZA = kA.K)(A), bC = (A, g) => (bC = kA.L)(A, g), TC = (A, g) => (TC = kA.M)(A, g), PC = (A) => (PC = kA.N)(A);
|
|
3996
|
-
n.dynCall_jiji = (A, g, I, B, t) => (n.dynCall_jiji = kA.O)(A, g, I, B, t), n.dynCall_viijii = (A, g, I, B, t,
|
|
4013
|
+
n.dynCall_jiji = (A, g, I, B, t) => (n.dynCall_jiji = kA.O)(A, g, I, B, t), n.dynCall_viijii = (A, g, I, B, t, a, c) => (n.dynCall_viijii = kA.P)(A, g, I, B, t, a, c), n.dynCall_iiiiij = (A, g, I, B, t, a, c) => (n.dynCall_iiiiij = kA.Q)(A, g, I, B, t, a, c), n.dynCall_iiiiijj = (A, g, I, B, t, a, c, l, d) => (n.dynCall_iiiiijj = kA.R)(A, g, I, B, t, a, c, l, d), n.dynCall_iiiiiijj = (A, g, I, B, t, a, c, l, d, F) => (n.dynCall_iiiiiijj = kA.S)(A, g, I, B, t, a, c, l, d, F);
|
|
3997
4014
|
var II;
|
|
3998
4015
|
ug = function A() {
|
|
3999
4016
|
II || jC(), II || (ug = A);
|
|
@@ -4010,7 +4027,7 @@ return ret;
|
|
|
4010
4027
|
}, 1)) : A();
|
|
4011
4028
|
}
|
|
4012
4029
|
if (n.preInit) for (typeof n.preInit == "function" && (n.preInit = [n.preInit]); n.preInit.length > 0; ) n.preInit.pop()();
|
|
4013
|
-
return jC(),
|
|
4030
|
+
return jC(), r = D, r;
|
|
4014
4031
|
};
|
|
4015
4032
|
})();
|
|
4016
4033
|
typeof C == "object" && typeof e == "object" ? e.exports = Q : typeof define == "function" && define.amd && define([], () => Q);
|
|
@@ -4040,10 +4057,10 @@ const zt = [
|
|
|
4040
4057
|
syncConfirm: [bI, "--warning-6"]
|
|
4041
4058
|
}, _t = () => {
|
|
4042
4059
|
const C = (i, s) => {
|
|
4043
|
-
const [
|
|
4060
|
+
const [r, n] = Zt[i], { title: w } = s;
|
|
4044
4061
|
return () => [
|
|
4045
4062
|
CI("span", { class: "shim-icon" }),
|
|
4046
|
-
CI(
|
|
4063
|
+
CI(r, {
|
|
4047
4064
|
class: "normal-icon",
|
|
4048
4065
|
style: { color: `rgba(var(${n}))` }
|
|
4049
4066
|
}),
|
|
@@ -4055,7 +4072,7 @@ const zt = [
|
|
|
4055
4072
|
style: { padding: "0 0 4px" }
|
|
4056
4073
|
},
|
|
4057
4074
|
s.content
|
|
4058
|
-
), Q = (i, s,
|
|
4075
|
+
), Q = (i, s, r) => {
|
|
4059
4076
|
const { title: n, content: w, modalClass: h } = s, D = jI(n) ? C(i, s) : n, u = jI(w) ? e(i, s) : w, f = [
|
|
4060
4077
|
"common-modal",
|
|
4061
4078
|
["info", "success", "warning", "error", "confirm", "syncConfirm"].includes(i) && `common-modal__${i}`,
|
|
@@ -4079,11 +4096,11 @@ const zt = [
|
|
|
4079
4096
|
onOk: () => G(!0),
|
|
4080
4097
|
onCancel: () => G(!1)
|
|
4081
4098
|
},
|
|
4082
|
-
|
|
4099
|
+
r
|
|
4083
4100
|
);
|
|
4084
|
-
}) : XC[i](R,
|
|
4101
|
+
}) : XC[i](R, r);
|
|
4085
4102
|
};
|
|
4086
|
-
return { Modal: zt.reduce((i, s) => (i[s] = (
|
|
4103
|
+
return { Modal: zt.reduce((i, s) => (i[s] = (r, n) => Q(s, r, n), i), {}) };
|
|
4087
4104
|
}, WI = /* @__PURE__ */ MA({
|
|
4088
4105
|
name: "CommonModal",
|
|
4089
4106
|
props: {
|
|
@@ -4118,7 +4135,7 @@ const zt = [
|
|
|
4118
4135
|
h && (h.scrollTop = 0);
|
|
4119
4136
|
});
|
|
4120
4137
|
});
|
|
4121
|
-
const s = e.titleIcon || e["title-icon"],
|
|
4138
|
+
const s = e.titleIcon || e["title-icon"], r = () => C.renderIcon ? (s == null ? void 0 : s()) ?? y($A, null, [y("span", {
|
|
4122
4139
|
class: "shim-icon"
|
|
4123
4140
|
}, null), y(CC, {
|
|
4124
4141
|
class: "normal-icon",
|
|
@@ -4127,7 +4144,7 @@ const zt = [
|
|
|
4127
4144
|
...e,
|
|
4128
4145
|
title: () => {
|
|
4129
4146
|
var w, h;
|
|
4130
|
-
return y($A, null, [
|
|
4147
|
+
return y($A, null, [r(), y("span", {
|
|
4131
4148
|
style: {
|
|
4132
4149
|
marginLeft: C.renderIcon ? "30px" : "0"
|
|
4133
4150
|
},
|
|
@@ -4154,7 +4171,7 @@ const zt = [
|
|
|
4154
4171
|
C.config.globalProperties.$modal = e;
|
|
4155
4172
|
}
|
|
4156
4173
|
}), Ao = (C, e, Q) => {
|
|
4157
|
-
const o = cA(), i = cA(), s = cA(0),
|
|
4174
|
+
const o = cA(), i = cA(), s = cA(0), r = cA(!1);
|
|
4158
4175
|
let n;
|
|
4159
4176
|
const { renderHighlight: w, unrenderHighlight: h } = Bt(o, e), D = () => {
|
|
4160
4177
|
o.value = new ne(C.value, {
|
|
@@ -4167,7 +4184,7 @@ const zt = [
|
|
|
4167
4184
|
maxLength: e.maxLength,
|
|
4168
4185
|
onChange: (S) => {
|
|
4169
4186
|
var Y;
|
|
4170
|
-
s.value = S,
|
|
4187
|
+
s.value = S, r.value = !!((Y = o.value) != null && Y.element.querySelector(
|
|
4171
4188
|
`span[data-type=${q.pausation}]`
|
|
4172
4189
|
)), Q("update:textCount", S), Q("change", S);
|
|
4173
4190
|
},
|
|
@@ -4302,7 +4319,7 @@ const zt = [
|
|
|
4302
4319
|
editorCore: o,
|
|
4303
4320
|
editorAction: i,
|
|
4304
4321
|
count: s,
|
|
4305
|
-
hasPausationTag:
|
|
4322
|
+
hasPausationTag: r,
|
|
4306
4323
|
getContent: f,
|
|
4307
4324
|
setContent: R,
|
|
4308
4325
|
appendContent: G,
|
|
@@ -4328,7 +4345,7 @@ const zt = [
|
|
|
4328
4345
|
const [e] = vA("quick-context-menu"), Q = Ag(Yg), { x: o, y: i } = cI(), s = (L, J) => {
|
|
4329
4346
|
var M, _;
|
|
4330
4347
|
(_ = (M = Q == null ? void 0 : Q.editorAction.value) == null ? void 0 : M.plugin.pausation) == null || _.add({ delay: J }), D(!1);
|
|
4331
|
-
},
|
|
4348
|
+
}, r = async () => {
|
|
4332
4349
|
const L = await navigator.clipboard.readText(), J = (L == null ? void 0 : L.split(/(?:\r?\n){2,}/).map((M) => M.trim()).filter((M) => M)) ?? [];
|
|
4333
4350
|
eC(
|
|
4334
4351
|
Q.editorCore.value,
|
|
@@ -4366,7 +4383,7 @@ const zt = [
|
|
|
4366
4383
|
QA("li", {
|
|
4367
4384
|
class: RA(sA(e)("action-item")),
|
|
4368
4385
|
"data-type": "paste",
|
|
4369
|
-
onClick:
|
|
4386
|
+
onClick: r
|
|
4370
4387
|
}, "粘贴文本", 2),
|
|
4371
4388
|
QA("li", {
|
|
4372
4389
|
class: RA(sA(e)("action-item")),
|
|
@@ -4389,8 +4406,8 @@ const zt = [
|
|
|
4389
4406
|
}
|
|
4390
4407
|
}), Eo = /* @__PURE__ */ uA(Qo, [["__scopeId", "data-v-70332ebc"]]), TA = (C, e, Q) => {
|
|
4391
4408
|
const o = HE({ value: C }), { value: i } = mE(o);
|
|
4392
|
-
return [i, (
|
|
4393
|
-
o.value =
|
|
4409
|
+
return [i, (r) => {
|
|
4410
|
+
o.value = r, e == null || e(o.value);
|
|
4394
4411
|
}];
|
|
4395
4412
|
}, eo = {}, to = {
|
|
4396
4413
|
class: "icon",
|
|
@@ -4613,7 +4630,7 @@ const bo = /* @__PURE__ */ uA(qo, [["render", xo]]), [OI] = vA("refine-content")
|
|
|
4613
4630
|
}), s = () => {
|
|
4614
4631
|
var w;
|
|
4615
4632
|
v(e) || v(e.editorCore.value) || (eC(e == null ? void 0 : e.editorCore.value, [((w = Q.activedContent.value) == null ? void 0 : w.content) ?? ""]), Q.setVisible(!1));
|
|
4616
|
-
},
|
|
4633
|
+
}, r = () => {
|
|
4617
4634
|
var J;
|
|
4618
4635
|
if (v(e) || v(e.editorCore.value)) return;
|
|
4619
4636
|
const {
|
|
@@ -4665,7 +4682,7 @@ const bo = /* @__PURE__ */ uA(qo, [["render", xo]]), [OI] = vA("refine-content")
|
|
|
4665
4682
|
default: () => "替换",
|
|
4666
4683
|
icon: () => y(Go, null, null)
|
|
4667
4684
|
}), y(YA("a-button"), {
|
|
4668
|
-
onClick:
|
|
4685
|
+
onClick: r
|
|
4669
4686
|
}, {
|
|
4670
4687
|
default: () => "插入",
|
|
4671
4688
|
icon: () => y(So, null, null)
|
|
@@ -4764,8 +4781,8 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4764
4781
|
emit: e
|
|
4765
4782
|
}) => {
|
|
4766
4783
|
const Q = Ag(qg) ?? {}, o = FA(() => (Q == null ? void 0 : Q.contentState.value) === PA.未生成 ? "请输入优化文本的指令" : "AI撰写中..."), i = FA(() => {
|
|
4767
|
-
var
|
|
4768
|
-
return (
|
|
4784
|
+
var r;
|
|
4785
|
+
return (r = Q == null ? void 0 : Q.prompt.value) == null ? void 0 : r.length;
|
|
4769
4786
|
}), s = () => {
|
|
4770
4787
|
i.value && (Q.setShortVisible(!1), Q == null || Q.genRefineContent({
|
|
4771
4788
|
generateType: dg.重置,
|
|
@@ -4781,7 +4798,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4781
4798
|
modelValue: C.modelValue,
|
|
4782
4799
|
disabled: Q == null ? void 0 : Q.generating.value,
|
|
4783
4800
|
placeholder: o.value,
|
|
4784
|
-
onInput: (
|
|
4801
|
+
onInput: (r) => e("update:modelValue", r),
|
|
4785
4802
|
onPressEnter: s
|
|
4786
4803
|
}, {
|
|
4787
4804
|
prefix: () => y("span", null, [y(GB, {
|
|
@@ -4819,8 +4836,8 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4819
4836
|
}));
|
|
4820
4837
|
}, Q = (n, w) => {
|
|
4821
4838
|
var h;
|
|
4822
|
-
(h = n.children) != null && h.length && (
|
|
4823
|
-
}, [o, i] = eI(), [s,
|
|
4839
|
+
(h = n.children) != null && h.length && (r(w), i(!0));
|
|
4840
|
+
}, [o, i] = eI(), [s, r] = TA(-1);
|
|
4824
4841
|
return () => {
|
|
4825
4842
|
const n = (h, D, u = !0) => {
|
|
4826
4843
|
var f, R;
|
|
@@ -4869,10 +4886,10 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4869
4886
|
emits: {},
|
|
4870
4887
|
setup: () => {
|
|
4871
4888
|
const C = Ag(Yg), e = Ag(qg), Q = cA(), [o, i] = TA(!1, (f) => {
|
|
4872
|
-
f ||
|
|
4889
|
+
f || r({
|
|
4873
4890
|
zIndex: -10
|
|
4874
4891
|
});
|
|
4875
|
-
}), [s,
|
|
4892
|
+
}), [s, r] = TA({
|
|
4876
4893
|
zIndex: -10
|
|
4877
4894
|
}), n = (f) => {
|
|
4878
4895
|
if (v(C) || v(C.editorCore.value)) return;
|
|
@@ -4881,7 +4898,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4881
4898
|
} = C.editorCore.value;
|
|
4882
4899
|
if (!C.editorCore.value._editorElement.contains(f.target) || v(R.range) || R.isCaret() || e.visible.value) return;
|
|
4883
4900
|
const G = R.range.getBoundingClientRect();
|
|
4884
|
-
|
|
4901
|
+
r({
|
|
4885
4902
|
top: `${G.bottom + 10}px`,
|
|
4886
4903
|
left: `${G.left + (G.width - 172) / 2}px`
|
|
4887
4904
|
}), i(!0);
|
|
@@ -4946,8 +4963,8 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4946
4963
|
createSession: o,
|
|
4947
4964
|
sendSessionMessage: i,
|
|
4948
4965
|
abortSession: s
|
|
4949
|
-
} = e.refineContext, [
|
|
4950
|
-
sessionId:
|
|
4966
|
+
} = e.refineContext, [r, n] = TA(void 0), w = () => (i.abort(), s({
|
|
4967
|
+
sessionId: r.value
|
|
4951
4968
|
})), h = (b) => {
|
|
4952
4969
|
console.log("---insert ", b);
|
|
4953
4970
|
}, D = (b) => {
|
|
@@ -4955,7 +4972,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4955
4972
|
}, u = cA(), [f, R] = TA({
|
|
4956
4973
|
zIndex: -10
|
|
4957
4974
|
}), [G, U] = TA(!1, (b) => {
|
|
4958
|
-
b || (
|
|
4975
|
+
b || (r.value && w(), n(void 0), T(!1), lA(void 0), WA(!1), mA(PA.未生成), S(0), x([]), Z(void 0), EA(!0), R({
|
|
4959
4976
|
zIndex: -10
|
|
4960
4977
|
}));
|
|
4961
4978
|
}), L = () => {
|
|
@@ -4968,8 +4985,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
4968
4985
|
const BA = b.range.getBoundingClientRect();
|
|
4969
4986
|
R({
|
|
4970
4987
|
top: `${BA.bottom + 10}px`,
|
|
4971
|
-
left: `${
|
|
4972
|
-
// left: 0,
|
|
4988
|
+
left: `${e.editorCore.value._editorElement.getBoundingClientRect().left - 4}px`,
|
|
4973
4989
|
width: `${e.editorCore.value._editorElement.offsetWidth}px`
|
|
4974
4990
|
}), U(!0);
|
|
4975
4991
|
}, J = (b) => {
|
|
@@ -5009,7 +5025,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
5009
5025
|
}] : [NA(b)]), Z(Y.value[Y.value.length - 1]), S(Y.value.length), mA(PA.等待生成), n(rB());
|
|
5010
5026
|
const BA = await o({
|
|
5011
5027
|
agentId: Q,
|
|
5012
|
-
sessionId:
|
|
5028
|
+
sessionId: r.value
|
|
5013
5029
|
});
|
|
5014
5030
|
WA(!0), mA(PA.正在生成), i({
|
|
5015
5031
|
messageRequest: {
|
|
@@ -5020,7 +5036,7 @@ const GB = /* @__PURE__ */ uA(_o, [["render", Ai]]), [AB] = vA("refine-input"),
|
|
|
5020
5036
|
},
|
|
5021
5037
|
meta_data: {
|
|
5022
5038
|
ai_rewrite: (b == null ? void 0 : b.shortcutType) ?? (b == null ? void 0 : b.prompt),
|
|
5023
|
-
sessionId:
|
|
5039
|
+
sessionId: r.value
|
|
5024
5040
|
}
|
|
5025
5041
|
}
|
|
5026
5042
|
}, {
|
|
@@ -5230,7 +5246,7 @@ const gB = /* @__PURE__ */ uA(ri, [["render", ai]]), [pA] = vA("editor-container
|
|
|
5230
5246
|
}) => {
|
|
5231
5247
|
const o = cA(), i = cA(), {
|
|
5232
5248
|
editorCore: s,
|
|
5233
|
-
editorAction:
|
|
5249
|
+
editorAction: r,
|
|
5234
5250
|
count: n,
|
|
5235
5251
|
hasPausationTag: w,
|
|
5236
5252
|
getContent: h,
|
|
@@ -5255,7 +5271,7 @@ const gB = /* @__PURE__ */ uA(ri, [["render", ai]]), [pA] = vA("editor-container
|
|
|
5255
5271
|
eB(Yg, {
|
|
5256
5272
|
name: "Editor",
|
|
5257
5273
|
editorCore: s,
|
|
5258
|
-
editorAction:
|
|
5274
|
+
editorAction: r,
|
|
5259
5275
|
getContent: h,
|
|
5260
5276
|
setContent: D,
|
|
5261
5277
|
appendContent: u,
|
|
@@ -5277,11 +5293,11 @@ const gB = /* @__PURE__ */ uA(ri, [["render", ai]]), [pA] = vA("editor-container
|
|
|
5277
5293
|
});
|
|
5278
5294
|
const VA = FA(() => {
|
|
5279
5295
|
var b, BA;
|
|
5280
|
-
return ((BA = (b =
|
|
5296
|
+
return ((BA = (b = r.value) == null ? void 0 : b.plugin.anchor) == null ? void 0 : BA.data) ?? {};
|
|
5281
5297
|
}), mA = FA(() => Object.values(VA.value).flat().length), bA = FA(() => n.value <= 0 && !w.value), S = (b, BA, IA) => {
|
|
5282
5298
|
Array.from(document.body.querySelectorAll(`span[data-frag-id="anchor_${b}"]`)).forEach((NA) => {
|
|
5283
5299
|
var dA, HA;
|
|
5284
|
-
return (HA = (dA =
|
|
5300
|
+
return (HA = (dA = r.value) == null ? void 0 : dA.plugin.anchor) == null ? void 0 : HA.remove(NA);
|
|
5285
5301
|
}), Q("anchorRemove", IA);
|
|
5286
5302
|
}, Y = (b) => Object.entries(b).filter(([BA, IA]) => !!IA.length).map(([BA, IA]) => y("div", {
|
|
5287
5303
|
style: {
|
|
@@ -5371,7 +5387,7 @@ const gB = /* @__PURE__ */ uA(ri, [["render", ai]]), [pA] = vA("editor-container
|
|
|
5371
5387
|
}, [y("span", null, [n.value <= C.maxLength ? n.value : C.maxLength]), y("span", null, [LA(" / ")]), y("span", null, [C.maxLength, C.simple ? "" : "字"])]) : null])]);
|
|
5372
5388
|
}, P = cA();
|
|
5373
5389
|
return {
|
|
5374
|
-
action:
|
|
5390
|
+
action: r,
|
|
5375
5391
|
innerRender: () => {
|
|
5376
5392
|
var b, BA;
|
|
5377
5393
|
return y($A, null, [y("div", {
|
|
@@ -5411,7 +5427,7 @@ const gB = /* @__PURE__ */ uA(ri, [["render", ai]]), [pA] = vA("editor-container
|
|
|
5411
5427
|
ref: P
|
|
5412
5428
|
}, null)]), Z(), y("span", {
|
|
5413
5429
|
style: "display: none"
|
|
5414
|
-
}, [JSON.stringify(Object.keys(((BA = (b =
|
|
5430
|
+
}, [JSON.stringify(Object.keys(((BA = (b = r.value) == null ? void 0 : b.plugin.anchor) == null ? void 0 : BA.data) ?? {}))])]);
|
|
5415
5431
|
},
|
|
5416
5432
|
innerGetContent: h,
|
|
5417
5433
|
innerSetContent: D,
|