@linker-design-plus/tiny-peony 1.4.30 → 1.4.32

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
@@ -340,18 +340,18 @@ const yI = (I, E) => {
340
340
  return;
341
341
  }
342
342
  if ($(i.commonAncestorContainer) && i.commonAncestorContainer.tagName === "DIV") {
343
- const H = WA(h), P = WA(c), X = document.createDocumentFragment();
343
+ const K = WA(h), P = WA(c), z = document.createDocumentFragment();
344
344
  for (; P != null && P.firstChild; )
345
- X.appendChild(P.firstChild);
346
- H == null || H.appendChild(X), P == null || P.remove();
347
- const K = window.getSelection(), W = document.createRange();
348
- W.setStart(h, d), W.setEnd(h, d), K == null || K.removeAllRanges(), K == null || K.addRange(W);
345
+ z.appendChild(P.firstChild);
346
+ K == null || K.appendChild(z), P == null || P.remove();
347
+ const v = window.getSelection(), W = document.createRange();
348
+ W.setStart(h, d), W.setEnd(h, d), v == null || v.removeAllRanges(), v == null || v.addRange(W);
349
349
  }
350
350
  i = I.cursor.isRangeInEditor() ? window.getSelection().getRangeAt(0) : t, i = mA(i.commonAncestorContainer) && i.commonAncestorContainer.textContent === "粘贴文本" ? t : i;
351
351
  const [u] = vA(
352
352
  i.commonAncestorContainer,
353
- (H) => H.tagName === "P" && H.classList.contains(NA)
354
- ), [D] = vA(i.startContainer, (H) => H.tagName === "SPAN" && H.dataset.type === q.anchor), y = document.createRange(), F = !!D;
353
+ (K) => K.tagName === "P" && K.classList.contains(NA)
354
+ ), [D] = vA(i.startContainer, (K) => K.tagName === "SPAN" && K.dataset.type === q.anchor), y = document.createRange(), F = !!D;
355
355
  y.setStart(i.startContainer, i.startOffset), y.setEndAfter(u.lastChild);
356
356
  const p = y.extractContents();
357
357
  if (!(u != null && u.textContent))
@@ -359,8 +359,8 @@ const yI = (I, E) => {
359
359
  else if (mA(u.lastChild))
360
360
  u.lastChild.textContent += o;
361
361
  else if ($(u.lastChild) && u.lastChild.dataset.type === q.anchor) {
362
- const { lastChild: H } = u.lastChild;
363
- mA(H) ? H.textContent += o : H == null || H.appendChild(document.createTextNode(o));
362
+ const { lastChild: K } = u.lastChild;
363
+ mA(K) ? K.textContent += o : K == null || K.appendChild(document.createTextNode(o));
364
364
  } else
365
365
  u.appendChild(document.createTextNode(o));
366
366
  yI(
@@ -368,12 +368,12 @@ const yI = (I, E) => {
368
368
  F ? u.lastChild : u
369
369
  );
370
370
  let { nextSibling: G } = u;
371
- if (a.forEach((H) => {
372
- var X;
371
+ if (a.forEach((K) => {
372
+ var z;
373
373
  const P = document.createElement("p");
374
- if (P.classList.add(NA), P.textContent = H, (X = u == null ? void 0 : u.parentNode) == null || X.insertBefore(P, G), G = P.nextSibling, yI(I, P), F) {
375
- const K = D.cloneNode(!1);
376
- K.innerHTML = P.innerHTML, P.innerHTML = K.outerHTML;
374
+ if (P.classList.add(NA), P.textContent = K, (z = u == null ? void 0 : u.parentNode) == null || z.insertBefore(P, G), G = P.nextSibling, yI(I, P), F) {
375
+ const v = D.cloneNode(!1);
376
+ v.innerHTML = P.innerHTML, P.innerHTML = v.outerHTML;
377
377
  }
378
378
  }), !r) return;
379
379
  const S = document.createElement("p");
@@ -382,13 +382,13 @@ const yI = (I, E) => {
382
382
  else if (mA(S.firstChild))
383
383
  S.firstChild.textContent = r + S.firstChild.textContent;
384
384
  else if ($(S.firstChild) && S.firstChild.dataset.type === q.anchor) {
385
- const { firstChild: H } = S.firstChild;
386
- mA(H) ? H.textContent = r + H.textContent : H == null || H.insertBefore(document.createTextNode(r), H.firstChild);
385
+ const { firstChild: K } = S.firstChild;
386
+ mA(K) ? K.textContent = r + K.textContent : K == null || K.insertBefore(document.createTextNode(r), K.firstChild);
387
387
  } else
388
388
  S.insertBefore(document.createTextNode(r), S.firstChild);
389
- I.element.insertBefore(S, G), [0.5, 1, 1.5, 2, 2.5].every((H) => {
389
+ I.element.insertBefore(S, G), [0.5, 1, 1.5, 2, 2.5].every((K) => {
390
390
  var P;
391
- return !((P = S.textContent) != null && P.trim().endsWith(`停顿: ${H}S`));
391
+ return !((P = S.textContent) != null && P.trim().endsWith(`停顿: ${K}S`));
392
392
  }) && yI(I, S);
393
393
  }, [Re] = ZA("paragraph"), NA = Re(), Fe = `<p class="${NA}"><br /></p>`;
394
394
  class Ne extends oe {
@@ -828,12 +828,12 @@ function He(I = {}) {
828
828
  d.value && S != null && (a.value && G(h.value) ? await E.clipboard.writeText(S) : F(S), c.value = S, f.value = !0, u.start());
829
829
  }
830
830
  function F(S) {
831
- const M = document.createElement("textarea");
832
- M.value = S ?? "", M.style.position = "absolute", M.style.opacity = "0", document.body.appendChild(M), M.select(), document.execCommand("copy"), M.remove();
831
+ const J = document.createElement("textarea");
832
+ J.value = S ?? "", J.style.position = "absolute", J.style.opacity = "0", document.body.appendChild(J), J.select(), document.execCommand("copy"), J.remove();
833
833
  }
834
834
  function p() {
835
- var S, M, H;
836
- return (H = (M = (S = document == null ? void 0 : document.getSelection) == null ? void 0 : S.call(document)) == null ? void 0 : M.toString()) != null ? H : "";
835
+ var S, J, K;
836
+ return (K = (J = (S = document == null ? void 0 : document.getSelection) == null ? void 0 : S.call(document)) == null ? void 0 : J.toString()) != null ? K : "";
837
837
  }
838
838
  function G(S) {
839
839
  return S === "granted" || S === "prompt";
@@ -863,25 +863,25 @@ function mI(I = {}) {
863
863
  eventFilter: h
864
864
  } = I;
865
865
  let d = null, c = 0, f = 0;
866
- const u = yA(o.x), D = yA(o.y), y = yA(null), F = typeof E == "function" ? E : Ke[E], p = (K) => {
867
- const W = F(K);
868
- d = K, W && ([u.value, D.value] = W, y.value = "mouse"), r && (c = r.scrollX, f = r.scrollY);
869
- }, G = (K) => {
870
- if (K.touches.length > 0) {
871
- const W = F(K.touches[0]);
866
+ const u = yA(o.x), D = yA(o.y), y = yA(null), F = typeof E == "function" ? E : Ke[E], p = (v) => {
867
+ const W = F(v);
868
+ d = v, W && ([u.value, D.value] = W, y.value = "mouse"), r && (c = r.scrollX, f = r.scrollY);
869
+ }, G = (v) => {
870
+ if (v.touches.length > 0) {
871
+ const W = F(v.touches[0]);
872
872
  W && ([u.value, D.value] = W, y.value = "touch");
873
873
  }
874
874
  }, S = () => {
875
875
  if (!d || !r)
876
876
  return;
877
- const K = F(d);
878
- d instanceof MouseEvent && K && (u.value = K[0] + r.scrollX - c, D.value = K[1] + r.scrollY - f);
879
- }, M = () => {
877
+ const v = F(d);
878
+ d instanceof MouseEvent && v && (u.value = v[0] + r.scrollX - c, D.value = v[1] + r.scrollY - f);
879
+ }, J = () => {
880
880
  u.value = o.x, D.value = o.y;
881
- }, H = h ? (K) => h(() => p(K), {}) : (K) => p(K), P = h ? (K) => h(() => G(K), {}) : (K) => G(K), X = h ? () => h(() => S(), {}) : () => S();
881
+ }, K = h ? (v) => h(() => p(v), {}) : (v) => p(v), P = h ? (v) => h(() => G(v), {}) : (v) => G(v), z = h ? () => h(() => S(), {}) : () => S();
882
882
  if (a) {
883
- const K = { passive: !0 };
884
- Ug(a, ["mousemove", "dragover"], H, K), B && E !== "movement" && (Ug(a, ["touchstart", "touchmove"], P, K), t && Ug(a, "touchend", M, K)), i && E === "page" && Ug(r, "scroll", X, K);
883
+ const v = { passive: !0 };
884
+ Ug(a, ["mousemove", "dragover"], K, v), B && E !== "movement" && (Ug(a, ["touchstart", "touchmove"], P, v), t && Ug(a, "touchend", J, v)), i && E === "page" && Ug(r, "scroll", z, v);
885
885
  }
886
886
  return {
887
887
  x: u,
@@ -1308,44 +1308,44 @@ class Ct extends MI {
1308
1308
  _insertOverlapAnchor(B) {
1309
1309
  const { range: t } = this.editor.cursor;
1310
1310
  if (x(t)) return !1;
1311
- const o = (K) => {
1311
+ const o = (v) => {
1312
1312
  var W;
1313
- return Array.prototype.indexOf.call((W = K.parentNode) == null ? void 0 : W.childNodes, K);
1314
- }, r = (K) => {
1315
- let W = K;
1313
+ return Array.prototype.indexOf.call((W = v.parentNode) == null ? void 0 : W.childNodes, v);
1314
+ }, r = (v) => {
1315
+ let W = v;
1316
1316
  for (; W && !($(W.parentNode) && W.parentNode.tagName === "P"); )
1317
1317
  W = W.parentNode;
1318
1318
  return W;
1319
- }, a = (K) => K.some((W) => $(W) && W.classList.contains(zg())), i = () => {
1320
- let K, W;
1319
+ }, a = (v) => v.some((W) => $(W) && W.classList.contains(zg())), i = () => {
1320
+ let v, W;
1321
1321
  const EA = S.length === 1;
1322
1322
  S.forEach((CA, nA) => {
1323
1323
  if (nA === 0) {
1324
1324
  const kA = () => {
1325
- var v, O, z;
1326
- const AA = (v = getSelection()) == null ? void 0 : v.getRangeAt(0), fA = AA == null ? void 0 : AA.startContainer, U = AA == null ? void 0 : AA.endContainer;
1325
+ var H, O, X;
1326
+ const AA = (H = getSelection()) == null ? void 0 : H.getRangeAt(0), fA = AA == null ? void 0 : AA.startContainer, U = AA == null ? void 0 : AA.endContainer;
1327
1327
  if (x(AA) || x(U) || x(fA))
1328
1328
  return null;
1329
1329
  if (fA === U) {
1330
1330
  if ($(fA) && fA.classList.contains(zg())) {
1331
- const J = document.createDocumentFragment(), m = AA.endContainer, dA = m.cloneNode(!1), wA = m.childNodes[AA.endOffset];
1331
+ const M = document.createDocumentFragment(), m = AA.endContainer, dA = m.cloneNode(!1), wA = m.childNodes[AA.endOffset];
1332
1332
  for (; m.firstChild && m.firstChild !== wA; )
1333
- J.appendChild(m.firstChild);
1334
- return dA.appendChild(J), (O = m.parentNode) == null || O.insertBefore(dA, m), m;
1333
+ M.appendChild(m.firstChild);
1334
+ return dA.appendChild(M), (O = m.parentNode) == null || O.insertBefore(dA, m), m;
1335
1335
  }
1336
1336
  if (mA(fA)) {
1337
- const J = fA.textContent;
1337
+ const M = fA.textContent;
1338
1338
  let m = fA.parentNode, dA = AA.startContainer;
1339
1339
  m.dataset.type === q.highlight && (dA = m.nextSibling, m = m.parentNode);
1340
1340
  const wA = m.cloneNode(!1), RA = document.createDocumentFragment();
1341
1341
  for (; m.firstChild && m.firstChild !== dA; )
1342
1342
  RA.appendChild(m.firstChild);
1343
- return wA.appendChild(RA), wA.appendChild(document.createTextNode(J.slice(0, AA.startOffset))), fA.replaceWith(J.slice(AA.startOffset)), (z = m.parentNode) == null || z.insertBefore(wA, m), m;
1343
+ return wA.appendChild(RA), wA.appendChild(document.createTextNode(M.slice(0, AA.startOffset))), fA.replaceWith(M.slice(AA.startOffset)), (X = m.parentNode) == null || X.insertBefore(wA, m), m;
1344
1344
  }
1345
1345
  }
1346
1346
  return $(U) && U.classList.contains(NA) ? U.childNodes[AA.endOffset] : U;
1347
1347
  };
1348
- [M, H, P, X] = h(
1348
+ [J, K, P, z] = h(
1349
1349
  CA,
1350
1350
  c,
1351
1351
  f,
@@ -1357,7 +1357,7 @@ class Ct extends MI {
1357
1357
  return;
1358
1358
  }
1359
1359
  if (nA === S.length - 1) {
1360
- [K, W, P, X] = h(
1360
+ [v, W, P, z] = h(
1361
1361
  CA,
1362
1362
  CA[0],
1363
1363
  0,
@@ -1377,44 +1377,44 @@ class Ct extends MI {
1377
1377
  null
1378
1378
  );
1379
1379
  });
1380
- }, h = (K, W, EA, CA, nA, kA, AA) => {
1380
+ }, h = (v, W, EA, CA, nA, kA, AA) => {
1381
1381
  var Z, eA, BA, tA;
1382
- const fA = Array.isArray(AA) ? AA : [AA], [U] = K, v = document.createRange();
1383
- v.setStart(W, EA), v.setEnd(CA, nA), (Z = getSelection()) == null || Z.removeAllRanges(), (eA = getSelection()) == null || eA.addRange(v);
1384
- const O = v.startContainer === v.endContainer && ((tA = (BA = v.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) === q.highlight ? v.startContainer.parentElement.cloneNode(!1) : null, z = v.cloneContents(), J = document.createDocumentFragment();
1385
- Array.from(z.childNodes).forEach((DA) => {
1382
+ const fA = Array.isArray(AA) ? AA : [AA], [U] = v, H = document.createRange();
1383
+ H.setStart(W, EA), H.setEnd(CA, nA), (Z = getSelection()) == null || Z.removeAllRanges(), (eA = getSelection()) == null || eA.addRange(H);
1384
+ const O = H.startContainer === H.endContainer && ((tA = (BA = H.startContainer.parentElement) == null ? void 0 : BA.dataset) == null ? void 0 : tA.type) === q.highlight ? H.startContainer.parentElement.cloneNode(!1) : null, X = H.cloneContents(), M = document.createDocumentFragment();
1385
+ Array.from(X.childNodes).forEach((DA) => {
1386
1386
  if (!$(DA) || !DA.classList.contains(zg())) {
1387
- O && O.appendChild(DA), J.appendChild(O ?? DA);
1387
+ O && O.appendChild(DA), M.appendChild(O ?? DA);
1388
1388
  return;
1389
1389
  }
1390
- J.append(...Array.from(DA.childNodes));
1390
+ M.append(...Array.from(DA.childNodes));
1391
1391
  });
1392
1392
  let m = document.createTextNode(""), dA = 0, wA = document.createTextNode(""), RA = 0;
1393
- return fA.includes("start") && (m = J.firstChild, dA = 0), fA.includes("end") && (wA = J.lastChild, RA = mA(wA) ? wA.data.length : $(J.lastChild) && J.lastChild.dataset.type === q.highlight ? J.lastChild.childNodes.length : J.childNodes.length), v.deleteContents(), U.insertBefore(J, typeof kA == "function" ? kA() : kA), [m, dA, wA, RA];
1394
- }, d = async (K) => {
1393
+ return fA.includes("start") && (m = M.firstChild, dA = 0), fA.includes("end") && (wA = M.lastChild, RA = mA(wA) ? wA.data.length : $(M.lastChild) && M.lastChild.dataset.type === q.highlight ? M.lastChild.childNodes.length : M.childNodes.length), H.deleteContents(), U.insertBefore(M, typeof kA == "function" ? kA() : kA), [m, dA, wA, RA];
1394
+ }, d = async (v) => {
1395
1395
  var EA, CA;
1396
1396
  const W = document.createRange();
1397
- M === P && $(M) && M.dataset.type === q.highlight ? W.selectNode(M) : (W.setStart(M, H), W.setEnd(P, X)), (EA = getSelection()) == null || EA.removeAllRanges(), (CA = getSelection()) == null || CA.addRange(W), this.editor.cursor.range = W, this._insertAnchorTag(B.anchor, K);
1398
- }, { startContainer: c, startOffset: f, endContainer: u, endOffset: D } = t, y = r(u), F = WA(c), p = WA(u), G = F === p ? [F] : [F, ...hC(F, p), p], S = G.map((K, W) => {
1399
- let EA = [], CA = 0, nA = K.childNodes.length;
1397
+ J === P && $(J) && J.dataset.type === q.highlight ? W.selectNode(J) : (W.setStart(J, K), W.setEnd(P, z)), (EA = getSelection()) == null || EA.removeAllRanges(), (CA = getSelection()) == null || CA.addRange(W), this.editor.cursor.range = W, this._insertAnchorTag(B.anchor, v);
1398
+ }, { startContainer: c, startOffset: f, endContainer: u, endOffset: D } = t, y = r(u), F = WA(c), p = WA(u), G = F === p ? [F] : [F, ...hC(F, p), p], S = G.map((v, W) => {
1399
+ let EA = [], CA = 0, nA = v.childNodes.length;
1400
1400
  switch (W) {
1401
1401
  case 0: {
1402
1402
  CA = $(c) && c.classList.contains(NA) ? 0 : o(r(c)), nA = // 同一段落
1403
1403
  G.length - 1 === W && // 非P段落
1404
- !($(u) && u.classList.contains(NA)) ? o(r(u)) + 1 : K.childNodes.length, EA = Array.from(K.childNodes).slice(CA, nA);
1404
+ !($(u) && u.classList.contains(NA)) ? o(r(u)) + 1 : v.childNodes.length, EA = Array.from(v.childNodes).slice(CA, nA);
1405
1405
  break;
1406
1406
  }
1407
1407
  case G.length - 1:
1408
- CA = 0, nA = $(u) && u.classList.contains(NA) ? K.childNodes.length : o(r(u)) + 1, EA = Array.from(K.childNodes).slice(0, nA);
1408
+ CA = 0, nA = $(u) && u.classList.contains(NA) ? v.childNodes.length : o(r(u)) + 1, EA = Array.from(v.childNodes).slice(0, nA);
1409
1409
  break;
1410
1410
  default:
1411
- CA = 0, nA = K.childNodes.length, EA = Array.from(K.childNodes).slice(CA, nA);
1411
+ CA = 0, nA = v.childNodes.length, EA = Array.from(v.childNodes).slice(CA, nA);
1412
1412
  break;
1413
1413
  }
1414
- return [K, a(EA)];
1414
+ return [v, a(EA)];
1415
1415
  });
1416
- let M, H = 0, P, X = 0;
1417
- return S.some(([K, W]) => W) ? (i(), d(y), !0) : !1;
1416
+ let J, K = 0, P, z = 0;
1417
+ return S.some(([v, W]) => W) ? (i(), d(y), !0) : !1;
1418
1418
  }
1419
1419
  _recordAnchor(B, t, o, r) {
1420
1420
  const a = this.data[o] ?? (this.data[o] = []);
@@ -1425,10 +1425,10 @@ class Ct extends MI {
1425
1425
  return B.length ? Math.max(...B) + 1 : 1;
1426
1426
  }
1427
1427
  _insertAnchorTag(B, t) {
1428
- const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset: f } = i, u = (M) => $(M) && M.tagName === "DIV" ? M.firstElementChild : $(M) && M.tagName === "P" ? M : WA(M), D = (M) => {
1429
- const H = document.createElement("span");
1428
+ const o = this._newAnchorId, r = String(Date.now()), a = vB[(o - 1) % 10], i = this.editor.cursor.range, { startContainer: h, startOffset: d, endContainer: c, endOffset: f } = i, u = (J) => $(J) && J.tagName === "DIV" ? J.firstElementChild : $(J) && J.tagName === "P" ? J : WA(J), D = (J) => {
1429
+ const K = document.createElement("span");
1430
1430
  return Kg(
1431
- H,
1431
+ K,
1432
1432
  {
1433
1433
  class: zg(),
1434
1434
  style: `background-color: ${a}`
@@ -1447,15 +1447,15 @@ class Ct extends MI {
1447
1447
  name: B.name,
1448
1448
  uid: r
1449
1449
  },
1450
- M
1451
- ), H;
1452
- }, y = (M, H, P, X, K = !1) => {
1450
+ J
1451
+ ), K;
1452
+ }, y = (J, K, P, z, v = !1) => {
1453
1453
  const W = document.createRange();
1454
- if (F(M, P))
1455
- W.selectNode(Array.from(M.childNodes).slice(H, X)[0]);
1454
+ if (F(J, P))
1455
+ W.selectNode(Array.from(J.childNodes).slice(K, z)[0]);
1456
1456
  else {
1457
- const AA = $(P) && [q.pausation].includes(P.dataset.type) ? P.childNodes.length : X;
1458
- $(M) && M.tagName === "P" ? (W.setStart(M.firstChild, 0), W.setEnd(M, M.childNodes.length)) : (W.setStart(M, H), W.setEnd(P, AA));
1457
+ const AA = $(P) && [q.pausation].includes(P.dataset.type) ? P.childNodes.length : z;
1458
+ $(J) && J.tagName === "P" ? (W.setStart(J.firstChild, 0), W.setEnd(J, J.childNodes.length)) : (W.setStart(J, K), W.setEnd(P, AA));
1459
1459
  }
1460
1460
  const EA = window.getSelection();
1461
1461
  EA.removeAllRanges(), EA.addRange(W), this.editor.cursor.range = W;
@@ -1464,24 +1464,24 @@ class Ct extends MI {
1464
1464
  const nA = D(CA.innerHTML);
1465
1465
  this.editor.content.update(nA);
1466
1466
  const kA = this._calcTopValue(nA.getBoundingClientRect());
1467
- return nA.dataset.top = String(kA), B.uid = nA.dataset.uid, K && this._recordAnchor(B, o, kA, a), nA;
1468
- }, F = (M, H) => {
1469
- var P, X;
1470
- return $(M) && M.tagName === "P" && M === H && // @ts-ignore
1471
- ((X = (P = Array.from(M.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : X.type) === q.highlight;
1467
+ return nA.dataset.top = String(kA), B.uid = nA.dataset.uid, v && this._recordAnchor(B, o, kA, a), nA;
1468
+ }, F = (J, K) => {
1469
+ var P, z;
1470
+ return $(J) && J.tagName === "P" && J === K && // @ts-ignore
1471
+ ((z = (P = Array.from(J.childNodes).slice(i.startOffset, i.endOffset)[0]) == null ? void 0 : P.dataset) == null ? void 0 : z.type) === q.highlight;
1472
1472
  }, p = u(h), G = u(c), S = hC(p, G);
1473
1473
  if (p === G) {
1474
- const M = F(h, c);
1474
+ const J = F(h, c);
1475
1475
  y(
1476
- M ? h : $(h) && h.tagName === "P" ? h.firstChild : h,
1477
- M ? d : $(h) && h.tagName === "P" ? 0 : d,
1476
+ J ? h : $(h) && h.tagName === "P" ? h.firstChild : h,
1477
+ J ? d : $(h) && h.tagName === "P" ? 0 : d,
1478
1478
  c,
1479
1479
  f,
1480
1480
  !0
1481
1481
  ), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1482
1482
  return;
1483
1483
  }
1484
- y(h, d, p, p.childNodes.length, !0), S.forEach((M) => y(M, 0, M, M.childNodes.length)), y(G.firstChild, 0, c, f, !1), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1484
+ y(h, d, p, p.childNodes.length, !0), S.forEach((J) => y(J, 0, J, J.childNodes.length)), y(G.firstChild, 0, c, f, !1), this._fixedAnchorSelection(t), this._fixedAnchorOrder(B), this._fixedAnchorHighlightContent();
1485
1485
  }
1486
1486
  _isIntersectOtherAnchors() {
1487
1487
  const { range: B } = this.editor.cursor;
@@ -1641,11 +1641,11 @@ const Bt = ["onClick"], Qt = /* @__PURE__ */ qA({
1641
1641
  if (u.component) {
1642
1642
  let p = ot.value, G = tt.value;
1643
1643
  if (D.popupContainer) {
1644
- const { offsetTop: S, offsetLeft: M, offsetHeight: H, offsetWidth: P } = D.popupContainer;
1645
- p = S + H + 5 + (((y = D.extraPos) == null ? void 0 : y.top) ?? 0), G = M - (88 - P) / 2 + (((F = D.extraPos) == null ? void 0 : F.left) ?? 0);
1644
+ const { offsetTop: S, offsetLeft: J, offsetHeight: K, offsetWidth: P } = D.popupContainer;
1645
+ p = S + K + 5 + (((y = D.extraPos) == null ? void 0 : y.top) ?? 0), G = J - (88 - P) / 2 + (((F = D.extraPos) == null ? void 0 : F.left) ?? 0);
1646
1646
  }
1647
- B.setAttribute("style", `top: ${p}px; left: ${G}px`), Object.entries(D).forEach(([S, M]) => {
1648
- u.component.props[S] = M;
1647
+ B.setAttribute("style", `top: ${p}px; left: ${G}px`), Object.entries(D).forEach(([S, J]) => {
1648
+ u.component.props[S] = J;
1649
1649
  });
1650
1650
  }
1651
1651
  }, u = N(I, {
@@ -2345,14 +2345,14 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2345
2345
  h = A, d = g;
2346
2346
  }), f = typeof window == "object", u = typeof importScripts == "function", D = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", y = Object.assign({}, i), F = "./this.program", p = (A, g) => {
2347
2347
  throw g;
2348
- }, G = "", S, M, H;
2348
+ }, G = "", S, J, K;
2349
2349
  if (D) {
2350
- var P = nC("fs"), X = nC("path");
2351
- G = __dirname + "/", S = (A, g) => (A = bg(A) ? new URL(A) : X.normalize(A), P.readFileSync(A, g ? void 0 : "utf8")), H = (A) => {
2350
+ var P = nC("fs"), z = nC("path");
2351
+ G = __dirname + "/", S = (A, g) => (A = bg(A) ? new URL(A) : z.normalize(A), P.readFileSync(A, g ? void 0 : "utf8")), K = (A) => {
2352
2352
  var g = S(A, !0);
2353
2353
  return g.buffer || (g = new Uint8Array(g)), g;
2354
- }, M = (A, g, C, Q = !0) => {
2355
- A = bg(A) ? new URL(A) : X.normalize(A), P.readFile(A, Q ? void 0 : "utf8", (n, s) => {
2354
+ }, J = (A, g, C, Q = !0) => {
2355
+ A = bg(A) ? new URL(A) : z.normalize(A), P.readFile(A, Q ? void 0 : "utf8", (n, s) => {
2356
2356
  n ? C(n) : g(Q ? s.buffer : s);
2357
2357
  });
2358
2358
  }, !i.thisProgram && process.argv.length > 1 && (F = process.argv[1].replace(/\\/g, "/")), process.argv.slice(2), p = (A, g) => {
@@ -2361,10 +2361,10 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2361
2361
  } else (f || u) && (u ? G = self.location.href : typeof document < "u" && document.currentScript && (G = document.currentScript.src), t && (G = t), G.startsWith("blob:") ? G = "" : G = G.substr(0, G.replace(/[?#].*/, "").lastIndexOf("/") + 1), S = (A) => {
2362
2362
  var g = new XMLHttpRequest();
2363
2363
  return g.open("GET", A, !1), g.send(null), g.responseText;
2364
- }, u && (H = (A) => {
2364
+ }, u && (K = (A) => {
2365
2365
  var g = new XMLHttpRequest();
2366
2366
  return g.open("GET", A, !1), g.responseType = "arraybuffer", g.send(null), new Uint8Array(g.response);
2367
- }), M = (A, g, C) => {
2367
+ }), J = (A, g, C) => {
2368
2368
  var Q = new XMLHttpRequest();
2369
2369
  Q.open("GET", A, !0), Q.responseType = "arraybuffer", Q.onload = () => {
2370
2370
  if (Q.status == 200 || Q.status == 0 && Q.response) {
@@ -2374,7 +2374,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2374
2374
  C();
2375
2375
  }, Q.onerror = C, Q.send(null);
2376
2376
  });
2377
- var K = i.print || console.log.bind(console), W = i.printErr || console.error.bind(console);
2377
+ var v = i.print || console.log.bind(console), W = i.printErr || console.error.bind(console);
2378
2378
  Object.assign(i, y), y = null, i.arguments && i.arguments, i.thisProgram && (F = i.thisProgram), i.quit && (p = i.quit);
2379
2379
  var EA;
2380
2380
  i.wasmBinary && (EA = i.wasmBinary);
@@ -2389,10 +2389,10 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2389
2389
  function nA(A) {
2390
2390
  if (BI(A)) return CA(A.slice(dg.length));
2391
2391
  }
2392
- var kA, AA = !1, fA, U, v, O, z, J, m, dA, wA;
2392
+ var kA, AA = !1, fA, U, H, O, X, M, m, dA, wA;
2393
2393
  function RA() {
2394
2394
  var A = kA.buffer;
2395
- i.HEAP8 = U = new Int8Array(A), i.HEAP16 = O = new Int16Array(A), i.HEAPU8 = v = new Uint8Array(A), i.HEAPU16 = z = new Uint16Array(A), i.HEAP32 = J = new Int32Array(A), i.HEAPU32 = m = new Uint32Array(A), i.HEAPF32 = dA = new Float32Array(A), i.HEAPF64 = wA = new Float64Array(A);
2395
+ i.HEAP8 = U = new Int8Array(A), i.HEAP16 = O = new Int16Array(A), i.HEAPU8 = H = new Uint8Array(A), i.HEAPU16 = X = new Uint16Array(A), i.HEAP32 = M = new Int32Array(A), i.HEAPU32 = m = new Uint32Array(A), i.HEAPF32 = dA = new Float32Array(A), i.HEAPF64 = wA = new Float64Array(A);
2396
2396
  }
2397
2397
  var Z = [], eA = [], BA = [];
2398
2398
  function tA() {
@@ -2443,7 +2443,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2443
2443
  if (A == $A && EA) return new Uint8Array(EA);
2444
2444
  var g = nA(A);
2445
2445
  if (g) return g;
2446
- if (H) return H(A);
2446
+ if (K) return K(A);
2447
2447
  throw "both async and sync fetching of the wasm failed";
2448
2448
  }
2449
2449
  function OB(A) {
@@ -2540,7 +2540,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2540
2540
  for (var A = new Array(256), g = 0; g < 256; ++g) A[g] = String.fromCharCode(g);
2541
2541
  mC = A;
2542
2542
  }, mC, zA = (A) => {
2543
- for (var g = "", C = A; v[C]; ) g += mC[v[C++]];
2543
+ for (var g = "", C = A; H[C]; ) g += mC[H[C++]];
2544
2544
  return g;
2545
2545
  }, Fg = {}, wg = {}, EI = {}, Ng, oA = (A) => {
2546
2546
  throw new Ng(A);
@@ -2583,7 +2583,7 @@ var Qo = Object.create, bB = Object.defineProperty, Eo = Object.getOwnPropertyDe
2583
2583
  }, toWireType: function(n, s) {
2584
2584
  return s ? C : Q;
2585
2585
  }, argPackAdvance: og, readValueFromPointer: function(n) {
2586
- return this.fromWireType(v[n]);
2586
+ return this.fromWireType(H[n]);
2587
2587
  }, destructorFunction: null });
2588
2588
  }, eQ = (A) => ({ count: A.count, deleteScheduled: A.deleteScheduled, preservePointerOnDelete: A.preservePointerOnDelete, ptr: A.ptr, ptrType: A.ptrType, smartPtr: A.smartPtr, smartPtrType: A.smartPtrType }), vI = (A) => {
2589
2589
  function g(C) {
@@ -2957,11 +2957,11 @@ return ret;
2957
2957
  }, PQ = (A, g, C) => {
2958
2958
  switch (g) {
2959
2959
  case 1:
2960
- return C ? (Q) => U[Q] : (Q) => v[Q];
2960
+ return C ? (Q) => U[Q] : (Q) => H[Q];
2961
2961
  case 2:
2962
- return C ? (Q) => O[Q >> 1] : (Q) => z[Q >> 1];
2962
+ return C ? (Q) => O[Q >> 1] : (Q) => X[Q >> 1];
2963
2963
  case 4:
2964
- return C ? (Q) => J[Q >> 2] : (Q) => m[Q >> 2];
2964
+ return C ? (Q) => M[Q >> 2] : (Q) => m[Q >> 2];
2965
2965
  default:
2966
2966
  throw new TypeError(`invalid integer width (${g}): ${A}`);
2967
2967
  }
@@ -3011,7 +3011,7 @@ return ret;
3011
3011
  }
3012
3012
  }
3013
3013
  return g[C] = 0, C - n;
3014
- }, VC = (A, g, C) => OI(A, v, g, C), XI = (A) => {
3014
+ }, VC = (A, g, C) => OI(A, H, g, C), XI = (A) => {
3015
3015
  for (var g = 0, C = 0; C < A.length; ++C) {
3016
3016
  var Q = A.charCodeAt(C);
3017
3017
  Q <= 127 ? g++ : Q <= 2047 ? g += 2 : Q >= 55296 && Q <= 57343 ? (g += 4, ++C) : g += 3;
@@ -3039,20 +3039,20 @@ return ret;
3039
3039
  }
3040
3040
  }
3041
3041
  return s;
3042
- }, cI = (A, g) => A ? Gg(v, A, g) : "", OQ = (A, g) => {
3042
+ }, cI = (A, g) => A ? Gg(H, A, g) : "", OQ = (A, g) => {
3043
3043
  g = zA(g);
3044
3044
  var C = g === "std::string";
3045
3045
  Eg(A, { name: g, fromWireType(Q) {
3046
3046
  var n = m[Q >> 2], s = Q + 4, l;
3047
3047
  if (C) for (var w = s, R = 0; R <= n; ++R) {
3048
3048
  var k = s + R;
3049
- if (R == n || v[k] == 0) {
3049
+ if (R == n || H[k] == 0) {
3050
3050
  var Y = k - w, j = cI(w, Y);
3051
3051
  l === void 0 ? l = j : (l += "\0", l += j), w = k + 1;
3052
3052
  }
3053
3053
  }
3054
3054
  else {
3055
- for (var b = new Array(n), R = 0; R < n; ++R) b[R] = String.fromCharCode(v[s + R]);
3055
+ for (var b = new Array(n), R = 0; R < n; ++R) b[R] = String.fromCharCode(H[s + R]);
3056
3056
  l = b.join("");
3057
3057
  }
3058
3058
  return tg(Q), l;
@@ -3064,16 +3064,16 @@ return ret;
3064
3064
  if (m[w >> 2] = s, C && l) VC(n, R, s + 1);
3065
3065
  else if (l) for (var k = 0; k < s; ++k) {
3066
3066
  var Y = n.charCodeAt(k);
3067
- Y > 255 && (tg(R), oA("String has UTF-16 code units that do not fit in 8 bits")), v[R + k] = Y;
3067
+ Y > 255 && (tg(R), oA("String has UTF-16 code units that do not fit in 8 bits")), H[R + k] = Y;
3068
3068
  }
3069
- else for (var k = 0; k < s; ++k) v[R + k] = n[k];
3069
+ else for (var k = 0; k < s; ++k) H[R + k] = n[k];
3070
3070
  return Q !== null && Q.push(tg, w), w;
3071
3071
  }, argPackAdvance: og, readValueFromPointer: iI, destructorFunction(Q) {
3072
3072
  tg(Q);
3073
3073
  } });
3074
3074
  }, XC = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, XQ = (A, g) => {
3075
- for (var C = A, Q = C >> 1, n = Q + g / 2; !(Q >= n) && z[Q]; ) ++Q;
3076
- if (C = Q << 1, C - A > 32 && XC) return XC.decode(v.subarray(A, C));
3075
+ for (var C = A, Q = C >> 1, n = Q + g / 2; !(Q >= n) && X[Q]; ) ++Q;
3076
+ if (C = Q << 1, C - A > 32 && XC) return XC.decode(H.subarray(A, C));
3077
3077
  for (var s = "", l = 0; !(l >= g / 2); ++l) {
3078
3078
  var w = O[A + l * 2 >> 1];
3079
3079
  if (w == 0) break;
@@ -3090,7 +3090,7 @@ return ret;
3090
3090
  return O[g >> 1] = 0, g - Q;
3091
3091
  }, ZQ = (A) => A.length * 2, _Q = (A, g) => {
3092
3092
  for (var C = 0, Q = ""; !(C >= g / 4); ) {
3093
- var n = J[A + C * 4 >> 2];
3093
+ var n = M[A + C * 4 >> 2];
3094
3094
  if (n == 0) break;
3095
3095
  if (++C, n >= 65536) {
3096
3096
  var s = n - 65536;
@@ -3106,9 +3106,9 @@ return ret;
3106
3106
  var w = A.charCodeAt(++s);
3107
3107
  l = 65536 + ((l & 1023) << 10) | w & 1023;
3108
3108
  }
3109
- if (J[g >> 2] = l, g += 4, g + 4 > n) break;
3109
+ if (M[g >> 2] = l, g += 4, g + 4 > n) break;
3110
3110
  }
3111
- return J[g >> 2] = 0, g - Q;
3111
+ return M[g >> 2] = 0, g - Q;
3112
3112
  }, AE = (A) => {
3113
3113
  for (var g = 0, C = 0; C < A.length; ++C) {
3114
3114
  var Q = A.charCodeAt(C);
@@ -3118,7 +3118,7 @@ return ret;
3118
3118
  }, gE = (A, g, C) => {
3119
3119
  C = zA(C);
3120
3120
  var Q, n, s, l;
3121
- g === 2 ? (Q = XQ, n = zQ, l = ZQ, s = (w) => z[w >> 1]) : g === 4 && (Q = _Q, n = $Q, l = AE, s = (w) => m[w >> 2]), Eg(A, { name: C, fromWireType: (w) => {
3121
+ g === 2 ? (Q = XQ, n = zQ, l = ZQ, s = (w) => X[w >> 1]) : g === 4 && (Q = _Q, n = $Q, l = AE, s = (w) => m[w >> 2]), Eg(A, { name: C, fromWireType: (w) => {
3122
3122
  for (var R = m[w >> 2], k, Y = w + 4, j = 0; j <= R; ++j) {
3123
3123
  var b = w + 4 + j * g;
3124
3124
  if (j == R || s(b) == 0) {
@@ -3140,7 +3140,7 @@ return ret;
3140
3140
  } });
3141
3141
  }, zC = () => F || "./this.program", CE = (A, g) => {
3142
3142
  VC(zC(), A, g);
3143
- }, BE = (A, g, C) => v.copyWithin(A, g, g + C), QE = () => {
3143
+ }, BE = (A, g, C) => H.copyWithin(A, g, g + C), QE = () => {
3144
3144
  MC = !1, _C = 0;
3145
3145
  }, EE = (A, g) => {
3146
3146
  var C = wg[A];
@@ -3180,7 +3180,7 @@ return ret;
3180
3180
  }, aE = (A) => {
3181
3181
  Qg("OOM");
3182
3182
  }, sE = (A) => {
3183
- v.length, aE();
3183
+ H.length, aE();
3184
3184
  }, zI = {}, Og = () => {
3185
3185
  if (!Og.strings) {
3186
3186
  var A = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", g = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: A, _: zC() };
@@ -3317,9 +3317,9 @@ return ret;
3317
3317
  } }, default_tty_ops: { get_char(A) {
3318
3318
  return hE();
3319
3319
  }, put_char(A, g) {
3320
- g === null || g === 10 ? (K(Gg(A.output, 0)), A.output = []) : g != 0 && A.output.push(g);
3320
+ g === null || g === 10 ? (v(Gg(A.output, 0)), A.output = []) : g != 0 && A.output.push(g);
3321
3321
  }, fsync(A) {
3322
- A.output && A.output.length > 0 && (K(Gg(A.output, 0)), A.output = []);
3322
+ A.output && A.output.length > 0 && (v(Gg(A.output, 0)), A.output = []);
3323
3323
  }, ioctl_tcgets(A) {
3324
3324
  return { c_iflag: 25856, c_oflag: 5, c_cflag: 191, c_lflag: 35387, c_cc: [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] };
3325
3325
  }, ioctl_tcsets(A, g, C) {
@@ -3330,7 +3330,7 @@ return ret;
3330
3330
  g === null || g === 10 ? (W(Gg(A.output, 0)), A.output = []) : g != 0 && A.output.push(g);
3331
3331
  }, fsync(A) {
3332
3332
  A.output && A.output.length > 0 && (W(Gg(A.output, 0)), A.output = []);
3333
- } } }, DE = (A, g) => (v.fill(0, A, A + g), A), uE = (A, g) => Math.ceil(A / g) * g, CB = (A) => {
3333
+ } } }, DE = (A, g) => (H.fill(0, A, A + g), A), uE = (A, g) => Math.ceil(A / g) * g, CB = (A) => {
3334
3334
  A = uE(A, 65536);
3335
3335
  var g = eB(65536, A);
3336
3336
  return g ? DE(g, A) : 0;
@@ -3429,7 +3429,7 @@ return ret;
3429
3429
  return gA.stream_ops.write(A, g, 0, Q, C, !1), 0;
3430
3430
  } } }, yE = (A, g, C, Q) => {
3431
3431
  var n = `al ${A}`;
3432
- M(A, (s) => {
3432
+ J(A, (s) => {
3433
3433
  g(new Uint8Array(s)), n && Cg();
3434
3434
  }, (s) => {
3435
3435
  if (C) C();
@@ -4071,7 +4071,7 @@ return ret;
4071
4071
  var VA = sA * L, GA = (sA + 1) * L - 1;
4072
4072
  if (GA = Math.min(GA, _ - 1), typeof UA.chunks[sA] > "u" && (UA.chunks[sA] = T(VA, GA)), typeof UA.chunks[sA] > "u") throw new Error("doXHR failed!");
4073
4073
  return UA.chunks[sA];
4074
- }), (LA || !_) && (L = _ = 1, _ = this.getter(0).length, L = _, K("LazyFiles on gzip forces download of the whole file when length is accessed")), this._length = _, this._chunkSize = L, this.lengthKnown = !0;
4074
+ }), (LA || !_) && (L = _ = 1, _ = this.getter(0).length, L = _, v("LazyFiles on gzip forces download of the whole file when length is accessed")), this._length = _, this._chunkSize = L, this.lengthKnown = !0;
4075
4075
  }
4076
4076
  get length() {
4077
4077
  return this.lengthKnown || this.cacheLength(), this._length;
@@ -4122,13 +4122,13 @@ return ret;
4122
4122
  return lA.join2(Q, g);
4123
4123
  }, doStat(A, g, C) {
4124
4124
  var Q = A(g);
4125
- J[C >> 2] = Q.dev, J[C + 4 >> 2] = Q.mode, m[C + 8 >> 2] = Q.nlink, J[C + 12 >> 2] = Q.uid, J[C + 16 >> 2] = Q.gid, J[C + 20 >> 2] = Q.rdev, YA = [Q.size >>> 0, (QA = Q.size, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[C + 24 >> 2] = YA[0], J[C + 28 >> 2] = YA[1], J[C + 32 >> 2] = 4096, J[C + 36 >> 2] = Q.blocks;
4125
+ M[C >> 2] = Q.dev, M[C + 4 >> 2] = Q.mode, m[C + 8 >> 2] = Q.nlink, M[C + 12 >> 2] = Q.uid, M[C + 16 >> 2] = Q.gid, M[C + 20 >> 2] = Q.rdev, YA = [Q.size >>> 0, (QA = Q.size, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[C + 24 >> 2] = YA[0], M[C + 28 >> 2] = YA[1], M[C + 32 >> 2] = 4096, M[C + 36 >> 2] = Q.blocks;
4126
4126
  var n = Q.atime.getTime(), s = Q.mtime.getTime(), l = Q.ctime.getTime();
4127
- return YA = [Math.floor(n / 1e3) >>> 0, (QA = Math.floor(n / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[C + 40 >> 2] = YA[0], J[C + 44 >> 2] = YA[1], m[C + 48 >> 2] = n % 1e3 * 1e3, YA = [Math.floor(s / 1e3) >>> 0, (QA = Math.floor(s / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[C + 56 >> 2] = YA[0], J[C + 60 >> 2] = YA[1], m[C + 64 >> 2] = s % 1e3 * 1e3, YA = [Math.floor(l / 1e3) >>> 0, (QA = Math.floor(l / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[C + 72 >> 2] = YA[0], J[C + 76 >> 2] = YA[1], m[C + 80 >> 2] = l % 1e3 * 1e3, YA = [Q.ino >>> 0, (QA = Q.ino, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[C + 88 >> 2] = YA[0], J[C + 92 >> 2] = YA[1], 0;
4127
+ return YA = [Math.floor(n / 1e3) >>> 0, (QA = Math.floor(n / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[C + 40 >> 2] = YA[0], M[C + 44 >> 2] = YA[1], m[C + 48 >> 2] = n % 1e3 * 1e3, YA = [Math.floor(s / 1e3) >>> 0, (QA = Math.floor(s / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[C + 56 >> 2] = YA[0], M[C + 60 >> 2] = YA[1], m[C + 64 >> 2] = s % 1e3 * 1e3, YA = [Math.floor(l / 1e3) >>> 0, (QA = Math.floor(l / 1e3), +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[C + 72 >> 2] = YA[0], M[C + 76 >> 2] = YA[1], m[C + 80 >> 2] = l % 1e3 * 1e3, YA = [Q.ino >>> 0, (QA = Q.ino, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[C + 88 >> 2] = YA[0], M[C + 92 >> 2] = YA[1], 0;
4128
4128
  }, doMsync(A, g, C, Q, n) {
4129
4129
  if (!e.isFile(g.node.mode)) throw new e.ErrnoError(43);
4130
4130
  if (Q & 2) return 0;
4131
- var s = v.slice(A, A + C);
4131
+ var s = H.slice(A, A + C);
4132
4132
  e.msync(g, s, n, C, Q);
4133
4133
  }, getStreamFromFD(A) {
4134
4134
  var g = e.getStreamChecked(A);
@@ -4171,7 +4171,7 @@ return ret;
4171
4171
  try {
4172
4172
  if (isNaN(s)) return 61;
4173
4173
  var l = Xg.getStreamFromFD(A);
4174
- return e.llseek(l, s, Q), YA = [l.position >>> 0, (QA = l.position, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], J[n >> 2] = YA[0], J[n + 4 >> 2] = YA[1], l.getdents && s === 0 && Q === 0 && (l.getdents = null), 0;
4174
+ return e.llseek(l, s, Q), YA = [l.position >>> 0, (QA = l.position, +Math.abs(QA) >= 1 ? QA > 0 ? +Math.floor(QA / 4294967296) >>> 0 : ~~+Math.ceil((QA - +(~~QA >>> 0)) / 4294967296) >>> 0 : 0)], M[n >> 2] = YA[0], M[n + 4 >> 2] = YA[1], l.getdents && s === 0 && Q === 0 && (l.getdents = null), 0;
4175
4175
  } catch (w) {
4176
4176
  if (typeof e > "u" || w.name !== "ErrnoError") throw w;
4177
4177
  return w.errno;
@@ -4209,7 +4209,7 @@ return ret;
4209
4209
  }, HE = (A, g) => {
4210
4210
  U.set(A, g);
4211
4211
  }, KE = (A, g, C, Q) => {
4212
- var n = m[Q + 40 >> 2], s = { tm_sec: J[Q >> 2], tm_min: J[Q + 4 >> 2], tm_hour: J[Q + 8 >> 2], tm_mday: J[Q + 12 >> 2], tm_mon: J[Q + 16 >> 2], tm_year: J[Q + 20 >> 2], tm_wday: J[Q + 24 >> 2], tm_yday: J[Q + 28 >> 2], tm_isdst: J[Q + 32 >> 2], tm_gmtoff: J[Q + 36 >> 2], tm_zone: n ? cI(n) : "" }, l = cI(C), w = { "%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" };
4212
+ var n = m[Q + 40 >> 2], s = { tm_sec: M[Q >> 2], tm_min: M[Q + 4 >> 2], tm_hour: M[Q + 8 >> 2], tm_mday: M[Q + 12 >> 2], tm_mon: M[Q + 16 >> 2], tm_year: M[Q + 20 >> 2], tm_wday: M[Q + 24 >> 2], tm_yday: M[Q + 28 >> 2], tm_isdst: M[Q + 32 >> 2], tm_gmtoff: M[Q + 36 >> 2], tm_zone: n ? cI(n) : "" }, l = cI(C), w = { "%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" };
4213
4213
  for (var R in w) l = l.replace(new RegExp(R, "g"), w[R]);
4214
4214
  var k = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Y = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
4215
4215
  function j(L, T, UA) {
@@ -4470,48 +4470,48 @@ const ho = [
4470
4470
  if (x(I) || x(I.editorCore.value)) return;
4471
4471
  const { cursor: h, content: d } = I.editorCore.value, { range: c } = h;
4472
4472
  if (x(c)) return;
4473
- const { startContainer: f, endContainer: u, startOffset: D, endOffset: y } = c, F = WA(c.startContainer), p = WA(c.endContainer), G = hC(F, p), S = d.getParas(), M = F === p;
4473
+ const { startContainer: f, endContainer: u, startOffset: D, endOffset: y } = c, F = WA(c.startContainer), p = WA(c.endContainer), G = hC(F, p), S = d.getParas(), J = F === p;
4474
4474
  B({
4475
4475
  index: S.indexOf(F),
4476
- offset: M && D > y ? y : D
4476
+ offset: J && D > y ? y : D
4477
4477
  }), o({
4478
4478
  index: S.indexOf(p),
4479
- offset: M ? y > D ? y : D : y
4479
+ offset: J ? y > D ? y : D : y
4480
4480
  });
4481
- const H = (X) => {
4482
- const K = document.createElement("span");
4481
+ const K = (z) => {
4482
+ const v = document.createElement("span");
4483
4483
  return Kg(
4484
- K,
4484
+ v,
4485
4485
  {
4486
4486
  class: GI,
4487
4487
  style: "background: #3367d1;color: #fff;line-height: 34px;padding: 8px 0 8.5px 0;"
4488
4488
  },
4489
4489
  {
4490
- raw: X
4490
+ raw: z
4491
4491
  },
4492
- X
4493
- ), K;
4494
- }, P = (X, K, W, EA) => {
4492
+ z
4493
+ ), v;
4494
+ }, P = (z, v, W, EA) => {
4495
4495
  var AA;
4496
- $(X) && X.tagName === "P" ? (c.setStart(X.firstChild, 0), c.setEnd(X, X.childNodes.length)) : (c.setStart(X, K), c.setEnd(W, EA));
4496
+ $(z) && z.tagName === "P" ? (c.setStart(z.firstChild, 0), c.setEnd(z, z.childNodes.length)) : (c.setStart(z, v), c.setEnd(W, EA));
4497
4497
  const CA = window.getSelection();
4498
4498
  CA.removeAllRanges(), CA.addRange(c);
4499
4499
  const nA = document.createElement("div");
4500
4500
  nA.appendChild(c.cloneContents());
4501
- const kA = H(nA.innerHTML);
4501
+ const kA = K(nA.innerHTML);
4502
4502
  (AA = I.editorCore.value) == null || AA.content.update(kA);
4503
4503
  };
4504
4504
  if (F === p) {
4505
- const X = $(f) && f.tagName === "P";
4505
+ const z = $(f) && f.tagName === "P";
4506
4506
  P(
4507
- X ? f.firstChild : f,
4508
- X ? 0 : D,
4507
+ z ? f.firstChild : f,
4508
+ z ? 0 : D,
4509
4509
  u,
4510
4510
  y
4511
4511
  );
4512
4512
  return;
4513
4513
  }
4514
- P(f, D, F, F.childNodes.length), G.forEach((X) => P(X, 0, X, X.childNodes.length)), P(p.firstChild, 0, u, y);
4514
+ P(f, D, F, F.childNodes.length), G.forEach((z) => P(z, 0, z, z.childNodes.length)), P(p.firstChild, 0, u, y);
4515
4515
  }, a = () => {
4516
4516
  var d;
4517
4517
  Array.from(
@@ -4548,14 +4548,14 @@ const ho = [
4548
4548
  ],
4549
4549
  maxLength: E.maxLength,
4550
4550
  onChange: (U) => {
4551
- var v;
4552
- r.value = U, a.value = !!((v = t.value) != null && v.element.querySelector(
4551
+ var H;
4552
+ r.value = U, a.value = !!((H = t.value) != null && H.element.querySelector(
4553
4553
  `span[data-type=${q.pausation}]`
4554
4554
  )), B("update:textCount", U), B("change", U);
4555
4555
  },
4556
4556
  onUndoChange: (U) => {
4557
- var v;
4558
- x((v = o.value.plugin[q.anchor]) == null ? void 0 : v.data) || (o.value.plugin[q.anchor].data = JSON.parse(U));
4557
+ var H;
4558
+ x((H = o.value.plugin[q.anchor]) == null ? void 0 : H.data) || (o.value.plugin[q.anchor].data = JSON.parse(U));
4559
4559
  }
4560
4560
  }), o.value = {
4561
4561
  base: {
@@ -4571,10 +4571,10 @@ const ho = [
4571
4571
  [q.anchor]: t.value.plugin.anchor
4572
4572
  }
4573
4573
  }, i = new MutationObserver(([U]) => {
4574
- var v, O;
4575
- Object.keys(((O = (v = o.value) == null ? void 0 : v.plugin[q.anchor]) == null ? void 0 : O.data) ?? []).forEach((z) => {
4574
+ var H, O;
4575
+ Object.keys(((O = (H = o.value) == null ? void 0 : H.plugin[q.anchor]) == null ? void 0 : O.data) ?? []).forEach((X) => {
4576
4576
  var wA, RA;
4577
- const J = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[q.anchor]) == null ? void 0 : RA.data[z]) ?? [], [m, dA] = J.reduce(
4577
+ const M = ((RA = (wA = o.value) == null ? void 0 : wA.plugin[q.anchor]) == null ? void 0 : RA.data[X]) ?? [], [m, dA] = M.reduce(
4578
4578
  (Z, eA) => {
4579
4579
  const BA = Array.from(
4580
4580
  document.body.querySelectorAll(`span[data-frag-id="anchor_${eA.id}"]`)
@@ -4583,7 +4583,7 @@ const ho = [
4583
4583
  },
4584
4584
  [[], []]
4585
4585
  );
4586
- o.value.plugin[q.anchor].data[z] = m, dA.forEach((Z) => B("anchorRemove", Z.data));
4586
+ o.value.plugin[q.anchor].data[X] = m, dA.forEach((Z) => B("anchorRemove", Z.data));
4587
4587
  });
4588
4588
  }), i.observe(I.value, {
4589
4589
  childList: !0,
@@ -4594,63 +4594,63 @@ const ho = [
4594
4594
  var U;
4595
4595
  (U = t.value) == null || U.destroy(), t.value = void 0, o.value = void 0, i == null || i.disconnect(), i = null;
4596
4596
  }, u = (U) => {
4597
- const v = { ...st, ...U ?? {} };
4598
- return v.withAuditHighlight ? t.value.content.getContent() : AA(v);
4597
+ const H = { ...st, ...U ?? {} };
4598
+ return H.withAuditHighlight ? t.value.content.getContent() : AA(H);
4599
4599
  }, D = async (U) => t.value.content.setContent(U), y = async (U) => {
4600
- var v, O;
4601
- E.simple ? (v = t.value) == null || v.content.appendContent(U) : (O = t.value) == null || O.appendContent(U);
4600
+ var H, O;
4601
+ E.simple ? (H = t.value) == null || H.content.appendContent(U) : (O = t.value) == null || O.appendContent(U);
4602
4602
  }, F = () => {
4603
4603
  var U;
4604
4604
  return ((U = t.value) == null ? void 0 : U.content.getTextContent()) ?? [];
4605
- }, p = (U) => t.value.content.insert(U), G = () => t.value.content.delete(), S = (U) => t.value.content.update(U), M = () => t.value.cursor.isCaret(), H = () => t.value.cursor.isRange(), P = () => {
4606
- var z;
4607
- const U = (z = o.value) == null ? void 0 : z.base.cursor.range;
4605
+ }, p = (U) => t.value.content.insert(U), G = () => t.value.content.delete(), S = (U) => t.value.content.update(U), J = () => t.value.cursor.isCaret(), K = () => t.value.cursor.isRange(), P = () => {
4606
+ var X;
4607
+ const U = (X = o.value) == null ? void 0 : X.base.cursor.range;
4608
4608
  if (x(U)) return !1;
4609
- const [v] = vA(U.startContainer, (J) => J.tagName === "P" && J.classList.contains(NA)), [O] = vA(U.endContainer, (J) => J.tagName === "P" && J.classList.contains(NA));
4610
- return !(x(v) || x(O) || v === O);
4611
- }, X = (U) => {
4612
- var J, m;
4613
- const v = (J = o.value) == null ? void 0 : J.base.cursor.range, O = (m = t.value) == null ? void 0 : m.content.getParas(), z = O == null ? void 0 : O.map((dA) => Array.from(dA.querySelectorAll(`span[data-type="${U}"]`))).flat();
4614
- return x(v) || x(O) || x(z) ? !1 : z.some((dA) => v.intersectsNode(dA));
4615
- }, K = (U) => {
4616
- var v;
4617
- return mA(U) ? ((v = U.textContent) == null ? void 0 : v.replace(/</g, "&lt;").replace(/>/g, "&gt;")) ?? "" : U.dataset.type === q.pausation ? `<break time="${Number(U.dataset.value) * 1e3}"/>` : U.dataset.type === q.pronunciation ? U.dataset.value : U.dataset.type === q.highlight ? U.dataset.raw : U.dataset.type === q.homophones ? `<phoneme alphabet="py" ph="${U.dataset.formattedValue}">${U.dataset.raw}</phoneme>` : "";
4618
- }, W = (U, v) => {
4609
+ const [H] = vA(U.startContainer, (M) => M.tagName === "P" && M.classList.contains(NA)), [O] = vA(U.endContainer, (M) => M.tagName === "P" && M.classList.contains(NA));
4610
+ return !(x(H) || x(O) || H === O);
4611
+ }, z = (U) => {
4612
+ var M, m;
4613
+ const H = (M = o.value) == null ? void 0 : M.base.cursor.range, O = (m = t.value) == null ? void 0 : m.content.getParas(), X = O == null ? void 0 : O.map((dA) => Array.from(dA.querySelectorAll(`span[data-type="${U}"]`))).flat();
4614
+ return x(H) || x(O) || x(X) ? !1 : X.some((dA) => H.intersectsNode(dA));
4615
+ }, v = (U) => {
4616
+ var H;
4617
+ return mA(U) ? ((H = U.textContent) == null ? void 0 : H.replace(/</g, "&lt;").replace(/>/g, "&gt;")) ?? "" : U.dataset.type === q.pausation ? `<break time="${Number(U.dataset.value) * 1e3}"/>` : U.dataset.type === q.pronunciation ? U.dataset.value : U.dataset.type === q.highlight ? U.dataset.raw : U.dataset.type === q.homophones ? `<phoneme alphabet="py" ph="${U.dataset.formattedValue}">${U.dataset.raw}</phoneme>` : "";
4618
+ }, W = (U, H) => {
4619
4619
  var wA;
4620
4620
  const O = Le(U);
4621
- let z = [];
4621
+ let X = [];
4622
4622
  if (!O.length) return "";
4623
- const J = (wA = t.value) == null ? void 0 : wA.cursor.range;
4623
+ const M = (wA = t.value) == null ? void 0 : wA.cursor.range;
4624
4624
  let m = -1;
4625
- if (v && (J != null && J.collapse)) {
4626
- const [RA] = vA(J == null ? void 0 : J.startContainer, (Z) => $(Z) && Z.dataset.type === q.anchor);
4627
- m = O.findIndex((Z) => Z === RA), z = m > -1 ? O.slice(m) : O;
4625
+ if (H && (M != null && M.collapse)) {
4626
+ const [RA] = vA(M == null ? void 0 : M.startContainer, (Z) => $(Z) && Z.dataset.type === q.anchor);
4627
+ m = O.findIndex((Z) => Z === RA), X = m > -1 ? O.slice(m) : O;
4628
4628
  }
4629
- return z.map((RA, Z) => {
4629
+ return X.map((RA, Z) => {
4630
4630
  let eA = [];
4631
4631
  if (Z === 0 && m > -1) {
4632
4632
  const BA = document.createRange();
4633
- BA.setStart(J.startContainer, J.startOffset), BA.setEnd(RA, RA.childNodes.length), eA = Array.from(BA.cloneContents().childNodes);
4633
+ BA.setStart(M.startContainer, M.startOffset), BA.setEnd(RA, RA.childNodes.length), eA = Array.from(BA.cloneContents().childNodes);
4634
4634
  } else
4635
4635
  eA = Array.from(RA.childNodes);
4636
- return eA.map((BA) => K(BA)).join("");
4637
- }).join("") || O.map((RA) => Array.from(RA.childNodes).map((Z) => K(Z)).join("")).join("");
4636
+ return eA.map((BA) => v(BA)).join("");
4637
+ }).join("") || O.map((RA) => Array.from(RA.childNodes).map((Z) => v(Z)).join("")).join("");
4638
4638
  }, EA = (U) => {
4639
- var z;
4640
- const v = U.uid ? `span[data-uid="${U.uid}"]` : `span[data-id="anchor_${U.id}"]`, O = (z = I.value) == null ? void 0 : z.querySelector(v);
4639
+ var X;
4640
+ const H = U.uid ? `span[data-uid="${U.uid}"]` : `span[data-id="anchor_${U.id}"]`, O = (X = I.value) == null ? void 0 : X.querySelector(H);
4641
4641
  return [O.dataset.emotion, O.dataset.role];
4642
4642
  }, CA = () => {
4643
4643
  var O;
4644
4644
  return (((O = t.value) == null ? void 0 : O.content.getParas()) ?? []).filter(
4645
- (z) => {
4646
- var J;
4647
- return (J = z.textContent) == null ? void 0 : J.trim();
4645
+ (X) => {
4646
+ var M;
4647
+ return (M = X.textContent) == null ? void 0 : M.trim();
4648
4648
  }
4649
- ).map((z) => Array.from(z.childNodes)).flat().every((z) => mA(z) && ["", " ", null].includes(z.textContent) || $(z) && z.dataset.type === q.anchor || $(z) && z.tagName === "BR");
4649
+ ).map((X) => Array.from(X.childNodes)).flat().every((X) => mA(X) && ["", " ", null].includes(X.textContent) || $(X) && X.dataset.type === q.anchor || $(X) && X.tagName === "BR");
4650
4650
  }, nA = (U) => {
4651
- U.forEach((v) => {
4652
- var z;
4653
- (((z = o.value) == null ? void 0 : z.plugin.anchor.data[v.top]) ?? (o.value.plugin.anchor.data[v.top] = [])).push({ background: vB[(v.id - 1) % 10], data: v, id: v.id });
4651
+ U.forEach((H) => {
4652
+ var X;
4653
+ (((X = o.value) == null ? void 0 : X.plugin.anchor.data[H.top]) ?? (o.value.plugin.anchor.data[H.top] = [])).push({ background: vB[(H.id - 1) % 10], data: H, id: H.id });
4654
4654
  });
4655
4655
  }, kA = () => {
4656
4656
  yo.confirm({
@@ -4658,35 +4658,35 @@ const ho = [
4658
4658
  content: "确定清空全部内容吗?",
4659
4659
  onOk: () => {
4660
4660
  D(""), B("clear"), setTimeout(() => {
4661
- var J, m;
4662
- const U = window.getSelection(), v = U != null && U.rangeCount ? U == null ? void 0 : U.getRangeAt(0) : null;
4663
- if (x(U) || v && $(v.commonAncestorContainer) && v.commonAncestorContainer.classList.contains(NA))
4661
+ var M, m;
4662
+ const U = window.getSelection(), H = U != null && U.rangeCount ? U == null ? void 0 : U.getRangeAt(0) : null;
4663
+ if (x(U) || H && $(H.commonAncestorContainer) && H.commonAncestorContainer.classList.contains(NA))
4664
4664
  return;
4665
- const O = document.createRange(), z = (m = (J = t.value) == null ? void 0 : J.content.getParas()) == null ? void 0 : m[0];
4666
- x(z) || (O.selectNodeContents(z), O.collapse(!1), U.removeAllRanges(), U.addRange(O));
4665
+ const O = document.createRange(), X = (m = (M = t.value) == null ? void 0 : M.content.getParas()) == null ? void 0 : m[0];
4666
+ x(X) || (O.selectNodeContents(X), O.collapse(!1), U.removeAllRanges(), U.addRange(O));
4667
4667
  });
4668
4668
  }
4669
4669
  });
4670
4670
  }, AA = (U) => {
4671
- const v = t.value.content.getContent(), O = document.createElement("div");
4672
- return O.innerHTML = v, U.withAuditHighlight || Array.from(
4671
+ const H = t.value.content.getContent(), O = document.createElement("div");
4672
+ return O.innerHTML = H, U.withAuditHighlight || Array.from(
4673
4673
  O.querySelectorAll(`.${yC}`)
4674
- ).forEach((J) => {
4674
+ ).forEach((M) => {
4675
4675
  const m = document.createDocumentFragment();
4676
- Array.from(J.childNodes).forEach((dA) => m.appendChild(dA)), J.replaceWith(m);
4676
+ Array.from(M.childNodes).forEach((dA) => m.appendChild(dA)), M.replaceWith(m);
4677
4677
  }), U.withRefineHighlight || Array.from(
4678
4678
  O.querySelectorAll(`.${GI}`)
4679
- ).forEach((J) => {
4680
- J.replaceWith(J.textContent ?? "");
4679
+ ).forEach((M) => {
4680
+ M.replaceWith(M.textContent ?? "");
4681
4681
  }), O.innerHTML;
4682
- }, fA = (U) => {
4683
- var O;
4684
- const v = Array.isArray(U) ? U : [U];
4685
- if (!((O = t.value) != null && O.cursor.isRangeInEditor()) || !M()) {
4682
+ }, fA = (U, H) => {
4683
+ var M;
4684
+ const O = Array.isArray(U) ? U : [U], X = (((M = t.value) == null ? void 0 : M.cursor.isRangeInEditor()) && J()) ?? !1;
4685
+ if (H == null || H(X), !X) {
4686
4686
  Yg.warning("请选择要插入的位置!");
4687
4687
  return;
4688
4688
  }
4689
- YI(t.value, JI(t.value, v));
4689
+ YI(t.value, JI(t.value, O));
4690
4690
  };
4691
4691
  return Hg(c), RB(f), {
4692
4692
  editorCore: t,
@@ -4700,11 +4700,11 @@ const ho = [
4700
4700
  insertContent: p,
4701
4701
  deleteContent: G,
4702
4702
  updateContent: S,
4703
- isCaret: M,
4704
- isRange: H,
4703
+ isCaret: J,
4704
+ isRange: K,
4705
4705
  isSelectionInDifferentParas: P,
4706
- isSelectionContainsTag: X,
4707
- convertToContent: K,
4706
+ isSelectionContainsTag: z,
4707
+ convertToContent: v,
4708
4708
  getAnchorTtsMark: W,
4709
4709
  getAnchorTtsEmotionAndRole: EA,
4710
4710
  isAllMarkedByAnchor: CA,
@@ -4718,19 +4718,19 @@ const ho = [
4718
4718
  __name: "contextMenu",
4719
4719
  setup(I) {
4720
4720
  const [E] = ZA("quick-context-menu"), B = gg(fg), { x: t, y: o } = mI(), r = (G, S) => {
4721
- var M, H;
4722
- (H = (M = B == null ? void 0 : B.editorAction.value) == null ? void 0 : M.plugin.pausation) == null || H.add({ delay: S }), f(!1);
4721
+ var J, K;
4722
+ (K = (J = B == null ? void 0 : B.editorAction.value) == null ? void 0 : J.plugin.pausation) == null || K.add({ delay: S }), f(!1);
4723
4723
  }, a = async () => {
4724
4724
  let G = "", S = [];
4725
- G = await (window.microApp ? window.rawWindow.navigator : window.navigator).clipboard.readText(), S = (G == null ? void 0 : G.split(/(?:\r?\n){2,}/).map((H) => H.trim()).filter((H) => H)) ?? [], YI(
4725
+ G = await (window.microApp ? window.rawWindow.navigator : window.navigator).clipboard.readText(), S = (G == null ? void 0 : G.split(/(?:\r?\n){2,}/).map((K) => K.trim()).filter((K) => K)) ?? [], YI(
4726
4726
  B.editorCore.value,
4727
4727
  JI(B.editorCore.value, S)
4728
4728
  ), f(!1);
4729
4729
  }, i = yA(), h = yA(!1), d = yA({ zIndex: -10 }), c = Qe(), f = (G) => {
4730
4730
  h.value = G ?? !h.value, F(!1);
4731
4731
  }, u = (G) => {
4732
- const S = G.target, [M] = vA(S, (H) => H.classList.contains(ko));
4733
- M && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` }, f(!0));
4732
+ const S = G.target, [J] = vA(S, (K) => K.classList.contains(ko));
4733
+ J && (G.preventDefault(), G.stopPropagation(), d.value = { top: `${o.value}px`, left: `${t.value}px` }, f(!0));
4734
4734
  }, D = (G) => {
4735
4735
  var S;
4736
4736
  (S = i.value) != null && S.contains(G.target) || (d.value = { zIndex: -10 }, f(!1));
@@ -4738,8 +4738,8 @@ const ho = [
4738
4738
  var S;
4739
4739
  (S = y.value) == null || S.$el.setAttribute("style", G ? "display: block" : "display: none");
4740
4740
  }, p = (G) => {
4741
- const S = G.target, [M] = vA(S, (H) => H.dataset.type === "pausation" || H.classList.contains("pausation"));
4742
- F(!!M);
4741
+ const S = G.target, [J] = vA(S, (K) => K.dataset.type === "pausation" || K.classList.contains("pausation"));
4742
+ F(!!J);
4743
4743
  };
4744
4744
  return Hg(() => {
4745
4745
  document.addEventListener("contextmenu", u), document.addEventListener("click", D), document.addEventListener("mouseover", p);
@@ -5029,11 +5029,11 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
5029
5029
  var d;
5030
5030
  x(E) || x(E.editorCore.value) || (B.revertRange(), YI(E == null ? void 0 : E.editorCore.value, (((d = B.activedContent.value) == null ? void 0 : d.content) ?? "").split($g)), B.setVisible(!1));
5031
5031
  }, a = () => {
5032
- var H;
5032
+ var K;
5033
5033
  if (x(E) || x(E.editorCore.value)) return;
5034
5034
  const d = (P) => {
5035
- const X = document.createElement("p");
5036
- return X.textContent = P, X.classList.add(NA), X;
5035
+ const z = document.createElement("p");
5036
+ return z.textContent = P, z.classList.add(NA), z;
5037
5037
  };
5038
5038
  B.revertRange();
5039
5039
  const {
@@ -5044,7 +5044,7 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
5044
5044
  if (x(f) || x(f.parentNode)) return;
5045
5045
  const u = document.createRange();
5046
5046
  u.setStart(c.endContainer, c.endOffset), u.setEndAfter(f);
5047
- const D = u.extractContents(), y = (((H = B.activedContent.value) == null ? void 0 : H.content) ?? "").split($g), F = document.createDocumentFragment();
5047
+ const D = u.extractContents(), y = (((K = B.activedContent.value) == null ? void 0 : K.content) ?? "").split($g), F = document.createDocumentFragment();
5048
5048
  y.forEach((P) => {
5049
5049
  F.appendChild(d(P));
5050
5050
  });
@@ -5052,8 +5052,8 @@ const nn = /* @__PURE__ */ JA(en, [["render", on]]), jB = () => {
5052
5052
  G.insertBefore(F, f.nextSibling), G.insertBefore(D, p.nextSibling);
5053
5053
  const S = window.getSelection();
5054
5054
  if (!S) return;
5055
- const M = document.createRange();
5056
- M.selectNodeContents(p), M.collapse(!1), S.removeAllRanges(), S.addRange(M), B.setVisible(!1);
5055
+ const J = document.createRange();
5056
+ J.selectNodeContents(p), J.collapse(!1), S.removeAllRanges(), S.addRange(J), B.setVisible(!1);
5057
5057
  }, i = () => {
5058
5058
  const {
5059
5059
  content: d,
@@ -5263,14 +5263,14 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5263
5263
  var d, c;
5264
5264
  if ((d = i.children) != null && d.length) {
5265
5265
  if (I.shortcutPosition.value === ag.底部) {
5266
- const f = Number.parseFloat(getComputedStyle(I.scrollElm.value).height), u = ((c = I.scrollElm.value) == null ? void 0 : c.scrollTop) ?? 0, D = f + u, y = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).top), F = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).height), p = sC.length * Zg + _g * 2, G = i.children.length * Zg, S = (sC.length - h) * Zg + _g, M = (
5266
+ const f = Number.parseFloat(getComputedStyle(I.scrollElm.value).height), u = ((c = I.scrollElm.value) == null ? void 0 : c.scrollTop) ?? 0, D = f + u, y = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).top), F = Number.parseFloat(getComputedStyle(I.refineGeneratorRef.value).height), p = sC.length * Zg + _g * 2, G = i.children.length * Zg, S = (sC.length - h) * Zg + _g, J = (
5267
5267
  // 弹窗定位 + 高度
5268
5268
  y + F + // 指令列表高度 + marginTop 8px
5269
5269
  p + 8 + // 子指令列表高度 + bottomTop 8px
5270
5270
  G + _g - // 子指令列表移动距离 + 指令列表 paddingTop 8px
5271
5271
  S
5272
5272
  );
5273
- I.setSubShortcutPosition(D > M ? sg.顶部对齐 : sg.底部对齐);
5273
+ I.setSubShortcutPosition(D > J ? sg.顶部对齐 : sg.底部对齐);
5274
5274
  } else
5275
5275
  I.setSubShortcutPosition(sg.底部对齐);
5276
5276
  a(h), o(!0);
@@ -5342,8 +5342,8 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5342
5342
  });
5343
5343
  let i;
5344
5344
  const h = async () => {
5345
- var P, X;
5346
- if (await new Promise((K) => setTimeout(K, 100)), x(I) || x(I.editorCore.value)) return;
5345
+ var P, z;
5346
+ if (await new Promise((v) => setTimeout(v, 100)), x(I) || x(I.editorCore.value)) return;
5347
5347
  const {
5348
5348
  cursor: p
5349
5349
  } = I.editorCore.value;
@@ -5354,15 +5354,15 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5354
5354
  !p.isRangeInEditor() || // 调优组件可见时,工具栏隐藏
5355
5355
  E.visible.value
5356
5356
  ) return;
5357
- const G = UB((P = E.scrollElm.value) == null ? void 0 : P.getBoundingClientRect(), p.range.getBoundingClientRect(), 10), S = 0, M = (
5357
+ const G = UB((P = E.scrollElm.value) == null ? void 0 : P.getBoundingClientRect(), p.range.getBoundingClientRect(), 10), S = 0, J = (
5358
5358
  // 容器宽度
5359
5359
  E.scrollElm.value.getBoundingClientRect().width - // 工具栏宽度
5360
5360
  172 - // 容器内边距
5361
5361
  16
5362
- ), H = G.left + (G.width - 172) / 2;
5362
+ ), K = G.left + (G.width - 172) / 2;
5363
5363
  a({
5364
- top: `${G.top + (((X = E.scrollElm.value) == null ? void 0 : X.scrollTop) ?? 0)}px`,
5365
- left: `${H <= 0 ? S : H >= M ? M : H}px`
5364
+ top: `${G.top + (((z = E.scrollElm.value) == null ? void 0 : z.scrollTop) ?? 0)}px`,
5365
+ left: `${K <= 0 ? S : K >= J ? J : K}px`
5366
5366
  });
5367
5367
  }, d = (p) => {
5368
5368
  var G;
@@ -5386,9 +5386,9 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5386
5386
  }, f = kI(() => {
5387
5387
  t.value && h();
5388
5388
  }), u = kI(async (p) => {
5389
- var S, M;
5389
+ var S, J;
5390
5390
  if (!t.value || (S = B.value) != null && S.contains(i.target)) return;
5391
- const G = (M = I == null ? void 0 : I.editorCore.value) == null ? void 0 : M.cursor;
5391
+ const G = (J = I == null ? void 0 : I.editorCore.value) == null ? void 0 : J.cursor;
5392
5392
  // 空上下文
5393
5393
  (x(I) || // 空编辑器实例
5394
5394
  x(I.editorCore.value) || // 空选区
@@ -5499,7 +5499,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5499
5499
  })), u = yA(), [D, y] = KA({
5500
5500
  zIndex: -10
5501
5501
  }), [F, p] = KA(!1, (rA) => {
5502
- rA || (d.value && [jA.等待生成, jA.正在生成].includes(v.value) && f(), c(void 0), EA(!1), nA(void 0), U(!1), O(jA.未生成), J(0), dA([]), RA(void 0), AA(!0), y({
5502
+ rA || (d.value && [jA.等待生成, jA.正在生成].includes(H.value) && f(), c(void 0), EA(!1), nA(void 0), U(!1), O(jA.未生成), M(0), dA([]), RA(void 0), AA(!0), y({
5503
5503
  zIndex: -10
5504
5504
  }));
5505
5505
  }), G = () => {
@@ -5513,32 +5513,32 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5513
5513
  });
5514
5514
  }, S = () => {
5515
5515
  x(o) || x(o.editorCore.value) || (G(), p(!0));
5516
- }, M = (rA) => {
5516
+ }, J = (rA) => {
5517
5517
  var _A;
5518
5518
  F.value && ((_A = u.value) != null && _A.contains(rA.target) || (B(), p(!1)));
5519
- }, H = kI(() => {
5519
+ }, K = kI(() => {
5520
5520
  F.value && G();
5521
- }), [P, X] = KA(void 0);
5521
+ }), [P, z] = KA(void 0);
5522
5522
  Hg(() => {
5523
5523
  var rA;
5524
- X(document.body.querySelector(".c-editor-container--refinable")), document.addEventListener("mousedown", M), (rA = P.value) == null || rA.addEventListener("scroll", H);
5524
+ z(document.body.querySelector(".c-editor-container--refinable")), document.addEventListener("mousedown", J), (rA = P.value) == null || rA.addEventListener("scroll", K);
5525
5525
  }), GC(() => {
5526
5526
  var rA;
5527
- document.removeEventListener("mousedown", M), (rA = P.value) == null || rA.removeEventListener("scroll", H);
5527
+ document.removeEventListener("mousedown", J), (rA = P.value) == null || rA.removeEventListener("scroll", K);
5528
5528
  });
5529
- const K = Ie(I.width) ? `${I.width}px` : I.width, [W, EA] = fI(), [CA, nA] = KA(void 0), [kA, AA] = fI(!0), [fA, U] = fI(), [v, O] = KA(jA.未生成), [z, J] = KA(0), [m, dA] = KA([]), [wA, RA] = KA(void 0), eA = {
5529
+ const v = Ie(I.width) ? `${I.width}px` : I.width, [W, EA] = fI(), [CA, nA] = KA(void 0), [kA, AA] = fI(!0), [fA, U] = fI(), [H, O] = KA(jA.未生成), [X, M] = KA(0), [m, dA] = KA([]), [wA, RA] = KA(void 0), eA = {
5530
5530
  name: "RefineGenerator",
5531
5531
  refineGeneratorRef: u,
5532
5532
  visible: F,
5533
- width: K,
5533
+ width: v,
5534
5534
  generating: W,
5535
5535
  prompt: CA,
5536
5536
  shortcutVisible: kA,
5537
5537
  content: m,
5538
5538
  activedContent: wA,
5539
5539
  contentVisible: fA,
5540
- contentPage: z,
5541
- contentState: v,
5540
+ contentPage: X,
5541
+ contentState: H,
5542
5542
  setVisible: p,
5543
5543
  setRefineGenerating: EA,
5544
5544
  setRefinePrompt: nA,
@@ -5549,9 +5549,9 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5549
5549
  var BI, bg;
5550
5550
  if (W.value) return;
5551
5551
  EA(!0), nA(void 0), dA((rA == null ? void 0 : rA.generateType) === mg.刷新 ? [...m.value, {
5552
- ...m.value[z.value - 1],
5552
+ ...m.value[X.value - 1],
5553
5553
  content: ""
5554
- }] : [dg(rA)]), RA(m.value[m.value.length - 1]), J(m.value.length), O(jA.等待生成), c(LB());
5554
+ }] : [dg(rA)]), RA(m.value[m.value.length - 1]), M(m.value.length), O(jA.等待生成), c(LB());
5555
5555
  const _A = await a({
5556
5556
  agentId: r,
5557
5557
  sessionId: d.value
@@ -5595,7 +5595,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5595
5595
  };
5596
5596
  }
5597
5597
  },
5598
- setContentPage: J,
5598
+ setContentPage: M,
5599
5599
  setContentVisible: U,
5600
5600
  setContentState: O,
5601
5601
  showRefineGenerator: S,
@@ -5636,7 +5636,7 @@ const WB = /* @__PURE__ */ JA(un, [["render", fn]]), [wB] = ZA("refine-input"),
5636
5636
  }, [N("div", {
5637
5637
  class: Sn(),
5638
5638
  style: {
5639
- width: K
5639
+ width: v
5640
5640
  }
5641
5641
  }, [N(rn, {
5642
5642
  modelValue: m.value,
@@ -5816,11 +5816,11 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5816
5816
  isCaret: p,
5817
5817
  isRange: G,
5818
5818
  isSelectionInDifferentParas: S,
5819
- isSelectionContainsTag: M,
5820
- convertToContent: H,
5819
+ isSelectionContainsTag: J,
5820
+ convertToContent: K,
5821
5821
  getAnchorTtsMark: P,
5822
- getAnchorTtsEmotionAndRole: X,
5823
- isAllMarkedByAnchor: K,
5822
+ getAnchorTtsEmotionAndRole: z,
5823
+ isAllMarkedByAnchor: v,
5824
5824
  addExtraAnchors: W,
5825
5825
  clearContent: EA,
5826
5826
  insertContentAtCursor: CA,
@@ -5840,10 +5840,10 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5840
5840
  updateContent: F,
5841
5841
  isCaret: p,
5842
5842
  isRange: G,
5843
- isSelectionContainsTag: M,
5843
+ isSelectionContainsTag: J,
5844
5844
  getAnchorTtsMark: P,
5845
- getAnchorTtsEmotionAndRole: X,
5846
- isAllMarkedByAnchor: K,
5845
+ getAnchorTtsEmotionAndRole: z,
5846
+ isAllMarkedByAnchor: v,
5847
5847
  addExtraAnchors: W,
5848
5848
  clearContent: EA,
5849
5849
  renderHighlight: nA,
@@ -5853,7 +5853,7 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5853
5853
  const AA = pA(() => {
5854
5854
  var Z, eA;
5855
5855
  return ((eA = (Z = r.value) == null ? void 0 : Z.plugin.anchor) == null ? void 0 : eA.data) ?? {};
5856
- }), fA = pA(() => Object.values(AA.value).flat().length), U = pA(() => i.value <= 0 && !h.value), v = (Z, eA, BA) => {
5856
+ }), fA = pA(() => Object.values(AA.value).flat().length), U = pA(() => i.value <= 0 && !h.value), H = (Z, eA, BA) => {
5857
5857
  let tA = Array.from(document.body.querySelectorAll(BA.uid ? `span[data-uid="${BA.uid}"]` : `span[data-frag-id="anchor_${Z}"]`));
5858
5858
  BA.uid || (tA = tA.filter((DA) => !DA.dataset.uid)), tA.forEach((DA) => {
5859
5859
  var SA, xA;
@@ -5872,7 +5872,7 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5872
5872
  background: DA,
5873
5873
  data: SA,
5874
5874
  id: xA
5875
- }) => z(xA, eA, DA, SA, !0)) : z(BA[0].id, eA, BA[0].background, BA[0].data, !1), BA.length > 6 ? N(Ae, {
5875
+ }) => X(xA, eA, DA, SA, !0)) : X(BA[0].id, eA, BA[0].background, BA[0].data, !1), BA.length > 6 ? N(Ae, {
5876
5876
  trigger: "click",
5877
5877
  position: "left",
5878
5878
  popupContainer: ".c-editor-container__core-anchor",
@@ -5897,8 +5897,8 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5897
5897
  background: DA,
5898
5898
  data: SA,
5899
5899
  id: xA
5900
- }) => z(xA, eA, DA, SA, !0, `.anchor-popover-wrapper_${tA}`))])
5901
- }) : null])), z = (Z, eA, BA, tA, DA = !1, SA = void 0) => {
5900
+ }) => X(xA, eA, DA, SA, !0, `.anchor-popover-wrapper_${tA}`))])
5901
+ }) : null])), X = (Z, eA, BA, tA, DA = !1, SA = void 0) => {
5902
5902
  const xA = () => I.listenMode === SB.multiple || I.listenAnchorId !== `${tA.id}_${tA.uid}` ? N("span", {
5903
5903
  onClick: () => B("anchorListen", tA, P(tA))
5904
5904
  }, [N(Mn, {
@@ -5919,7 +5919,7 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5919
5919
  popupContainer: SA,
5920
5920
  listen: Ig,
5921
5921
  listenStop: bA,
5922
- update: J
5922
+ update: M
5923
5923
  })) ?? N("img", {
5924
5924
  src: tA.avatar,
5925
5925
  class: Bg("avatar")
@@ -5934,18 +5934,18 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
5934
5934
  }, [tA.name]), N("label", {
5935
5935
  class: Bg("info-speed-volume")
5936
5936
  }, [Ag("语速: "), tA.speed, Ag(", 音量: "), tA.volume]), N("div", {
5937
- onClick: () => v(Z, eA, tA)
5937
+ onClick: () => H(Z, eA, tA)
5938
5938
  }, [N(DB, {
5939
5939
  class: Bg("info-rem")
5940
5940
  }, null)]), xA()]), DA ? N("div", {
5941
5941
  class: Bg("rem"),
5942
- onClick: () => v(Z, eA, tA)
5942
+ onClick: () => H(Z, eA, tA)
5943
5943
  }, [N(DB, {
5944
5944
  class: Bg("info-rem")
5945
5945
  }, null)]) : null]);
5946
5946
  }, Ig = () => B("anchorListen", tA, P(tA)), bA = () => B("anchorListenStop", tA);
5947
5947
  return Rg();
5948
- }, J = (Z) => {
5948
+ }, M = (Z) => {
5949
5949
  const {
5950
5950
  uid: eA
5951
5951
  } = Z, {
@@ -6053,13 +6053,13 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
6053
6053
  innerIsCaret: p,
6054
6054
  innerIsRange: G,
6055
6055
  innerIsSelectionInDifferentParas: S,
6056
- innerIsSelectionContainsTag: M,
6057
- innerConvertToContent: H,
6056
+ innerIsSelectionContainsTag: J,
6057
+ innerConvertToContent: K,
6058
6058
  innerGetAnchorTtsMark: P,
6059
- innerGetAnchorTtsEmotionAndRole: X,
6060
- innerIsAllMarkedByAnchor: K,
6059
+ innerGetAnchorTtsEmotionAndRole: z,
6060
+ innerIsAllMarkedByAnchor: v,
6061
6061
  innerAddExtraAnchors: W,
6062
- innerUpdateAnchor: J,
6062
+ innerUpdateAnchor: M,
6063
6063
  innerClearContent: EA,
6064
6064
  innerInsertContentAtCursor: CA,
6065
6065
  innerRenderHightlight: nA,
@@ -6127,8 +6127,8 @@ const DB = /* @__PURE__ */ JA(Hn, [["render", Kn]]), [PA] = ZA("editor-container
6127
6127
  clearContent() {
6128
6128
  return this.innerClearContent();
6129
6129
  },
6130
- insertContentAtCursor(I) {
6131
- return this.innerInsertContentAtCursor(I);
6130
+ insertContentAtCursor(I, E) {
6131
+ return this.innerInsertContentAtCursor(I, E);
6132
6132
  },
6133
6133
  clear() {
6134
6134
  return this.setContent(`<p class="${NA}"><br /></p>`);