@qwanyx/stack 0.2.42 → 0.2.43
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.cjs.js +15 -15
- package/dist/index.esm.js +345 -340
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Oa = Object.defineProperty;
|
|
|
2
2
|
var Ma = (r, e, t) => e in r ? Oa(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ir = (r, e, t) => Ma(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as As from "react";
|
|
5
|
-
import
|
|
5
|
+
import Je, { useState as H, useCallback as re, useEffect as De, useMemo as bt, useRef as xe, createContext as Ia, useContext as $a, useLayoutEffect as jr, Suspense as za, forwardRef as al } from "react";
|
|
6
6
|
import { flushSync as qa, createPortal as Ua } from "react-dom";
|
|
7
7
|
class xf {
|
|
8
8
|
constructor(e) {
|
|
@@ -4044,7 +4044,7 @@ var Hi;
|
|
|
4044
4044
|
function hu() {
|
|
4045
4045
|
if (Hi) return $r;
|
|
4046
4046
|
Hi = 1;
|
|
4047
|
-
var r =
|
|
4047
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
4048
4048
|
function i(l, a, u) {
|
|
4049
4049
|
var c, d = {}, f = null, h = null;
|
|
4050
4050
|
u !== void 0 && (f = "" + u), a.key !== void 0 && (f = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
@@ -4067,7 +4067,7 @@ var zr = {};
|
|
|
4067
4067
|
var Ji;
|
|
4068
4068
|
function pu() {
|
|
4069
4069
|
return Ji || (Ji = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4070
|
-
var r =
|
|
4070
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), l = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
|
|
4071
4071
|
function y(_) {
|
|
4072
4072
|
if (_ === null || typeof _ != "object")
|
|
4073
4073
|
return null;
|
|
@@ -4286,14 +4286,14 @@ function pu() {
|
|
|
4286
4286
|
} catch (Ze) {
|
|
4287
4287
|
if (Ze && Z && typeof Ze.stack == "string") {
|
|
4288
4288
|
for (var se = Ze.stack.split(`
|
|
4289
|
-
`),
|
|
4290
|
-
`), Ne = se.length - 1, je =
|
|
4289
|
+
`), He = Z.stack.split(`
|
|
4290
|
+
`), Ne = se.length - 1, je = He.length - 1; Ne >= 1 && je >= 0 && se[Ne] !== He[je]; )
|
|
4291
4291
|
je--;
|
|
4292
4292
|
for (; Ne >= 1 && je >= 0; Ne--, je--)
|
|
4293
|
-
if (se[Ne] !==
|
|
4293
|
+
if (se[Ne] !== He[je]) {
|
|
4294
4294
|
if (Ne !== 1 || je !== 1)
|
|
4295
4295
|
do
|
|
4296
|
-
if (Ne--, je--, je < 0 || se[Ne] !==
|
|
4296
|
+
if (Ne--, je--, je < 0 || se[Ne] !== He[je]) {
|
|
4297
4297
|
var at = `
|
|
4298
4298
|
` + se[Ne].replace(" at new ", " at ");
|
|
4299
4299
|
return _.displayName && at.includes("<anonymous>") && (at = at.replace("<anonymous>", _.displayName)), typeof _ == "function" && Me.set(_, at), at;
|
|
@@ -4360,8 +4360,8 @@ function pu() {
|
|
|
4360
4360
|
var se = void 0;
|
|
4361
4361
|
try {
|
|
4362
4362
|
if (typeof _[le] != "function") {
|
|
4363
|
-
var
|
|
4364
|
-
throw
|
|
4363
|
+
var He = Error((Z || "React class") + ": " + G + " type `" + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof _[le] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4364
|
+
throw He.name = "Invariant Violation", He;
|
|
4365
4365
|
}
|
|
4366
4366
|
se = _[le](P, le, Z, G, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4367
4367
|
} catch (Ne) {
|
|
@@ -4383,17 +4383,17 @@ function pu() {
|
|
|
4383
4383
|
}
|
|
4384
4384
|
function be(_) {
|
|
4385
4385
|
try {
|
|
4386
|
-
return
|
|
4386
|
+
return Ke(_), !1;
|
|
4387
4387
|
} catch {
|
|
4388
4388
|
return !0;
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
|
-
function
|
|
4391
|
+
function Ke(_) {
|
|
4392
4392
|
return "" + _;
|
|
4393
4393
|
}
|
|
4394
|
-
function
|
|
4394
|
+
function I(_) {
|
|
4395
4395
|
if (be(_))
|
|
4396
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(_)),
|
|
4396
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(_)), Ke(_);
|
|
4397
4397
|
}
|
|
4398
4398
|
var T = C.ReactCurrentOwner, X = {
|
|
4399
4399
|
key: !0,
|
|
@@ -4401,7 +4401,7 @@ function pu() {
|
|
|
4401
4401
|
__self: !0,
|
|
4402
4402
|
__source: !0
|
|
4403
4403
|
}, J, S;
|
|
4404
|
-
function
|
|
4404
|
+
function $(_) {
|
|
4405
4405
|
if (dt.call(_, "ref")) {
|
|
4406
4406
|
var P = Object.getOwnPropertyDescriptor(_, "ref").get;
|
|
4407
4407
|
if (P && P.isReactWarning)
|
|
@@ -4473,8 +4473,8 @@ function pu() {
|
|
|
4473
4473
|
};
|
|
4474
4474
|
function te(_, P, G, Z, he) {
|
|
4475
4475
|
{
|
|
4476
|
-
var _e, le = {}, se = null,
|
|
4477
|
-
G !== void 0 && (
|
|
4476
|
+
var _e, le = {}, se = null, He = null;
|
|
4477
|
+
G !== void 0 && (I(G), se = "" + G), K(P) && (I(P.key), se = "" + P.key), $(P) && (He = P.ref, Q(P, he));
|
|
4478
4478
|
for (_e in P)
|
|
4479
4479
|
dt.call(P, _e) && !X.hasOwnProperty(_e) && (le[_e] = P[_e]);
|
|
4480
4480
|
if (_ && _.defaultProps) {
|
|
@@ -4482,11 +4482,11 @@ function pu() {
|
|
|
4482
4482
|
for (_e in Ne)
|
|
4483
4483
|
le[_e] === void 0 && (le[_e] = Ne[_e]);
|
|
4484
4484
|
}
|
|
4485
|
-
if (se ||
|
|
4485
|
+
if (se || He) {
|
|
4486
4486
|
var je = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _;
|
|
4487
|
-
se && ee(le, je),
|
|
4487
|
+
se && ee(le, je), He && ae(le, je);
|
|
4488
4488
|
}
|
|
4489
|
-
return ne(_, se,
|
|
4489
|
+
return ne(_, se, He, he, Z, T.current, le);
|
|
4490
4490
|
}
|
|
4491
4491
|
}
|
|
4492
4492
|
var Ae = C.ReactCurrentOwner, Fe = C.ReactDebugCurrentFrame;
|
|
@@ -4606,8 +4606,8 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4606
4606
|
if (!le) {
|
|
4607
4607
|
var se = "";
|
|
4608
4608
|
(_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (se += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4609
|
-
var
|
|
4610
|
-
|
|
4609
|
+
var He = lt();
|
|
4610
|
+
He ? se += He : se += Ue();
|
|
4611
4611
|
var Ne;
|
|
4612
4612
|
_ === null ? Ne = "null" : At(_) ? Ne = "array" : _ !== void 0 && _.$$typeof === e ? (Ne = "<" + (L(_.type) || "Unknown") + " />", se = " Did you accidentally export a JSX literal instead of a component?") : Ne = typeof _, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ne, se);
|
|
4613
4613
|
}
|
|
@@ -5265,7 +5265,7 @@ function Af({
|
|
|
5265
5265
|
if (!Ce.trim()) return D;
|
|
5266
5266
|
const S = Ce.toLowerCase();
|
|
5267
5267
|
return D.filter(
|
|
5268
|
-
(
|
|
5268
|
+
($) => _r($.from).toLowerCase().includes(S) || _r($.subject).toLowerCase().includes(S)
|
|
5269
5269
|
);
|
|
5270
5270
|
}, [D, Ce]), ge = bt(() => e ? new uu({ baseUrl: r, system_id: e }) : null, [r, e]), Me = re(async () => {
|
|
5271
5271
|
if (ge) {
|
|
@@ -5274,8 +5274,8 @@ function Af({
|
|
|
5274
5274
|
const S = await ge.listEmails(t, n, s);
|
|
5275
5275
|
S != null && S.messages && (k(S.messages), y == null || y(S.messages));
|
|
5276
5276
|
} catch (S) {
|
|
5277
|
-
const
|
|
5278
|
-
L(
|
|
5277
|
+
const $ = S instanceof Error ? S : new Error("Failed to fetch emails");
|
|
5278
|
+
L($.message), m == null || m($);
|
|
5279
5279
|
}
|
|
5280
5280
|
B(!1);
|
|
5281
5281
|
}
|
|
@@ -5287,68 +5287,68 @@ function Af({
|
|
|
5287
5287
|
if (ge) {
|
|
5288
5288
|
oe(S), pe(null), Se(!0);
|
|
5289
5289
|
try {
|
|
5290
|
-
const
|
|
5291
|
-
|
|
5292
|
-
} catch (
|
|
5293
|
-
console.error("Failed to fetch email body:",
|
|
5290
|
+
const $ = await ge.getEmailParsed(t, S.uid, s || "INBOX");
|
|
5291
|
+
$ != null && $.body && pe($.body);
|
|
5292
|
+
} catch ($) {
|
|
5293
|
+
console.error("Failed to fetch email body:", $);
|
|
5294
5294
|
}
|
|
5295
5295
|
Se(!1);
|
|
5296
5296
|
}
|
|
5297
5297
|
}, [ge, t, s]), Ct = re((S) => {
|
|
5298
5298
|
f == null || f(S), i && ct(S);
|
|
5299
|
-
}, [f, i, ct]), qt = re((S,
|
|
5299
|
+
}, [f, i, ct]), qt = re((S, $, K) => {
|
|
5300
5300
|
if (!o) {
|
|
5301
5301
|
f == null || f(S), i && ct(S);
|
|
5302
5302
|
return;
|
|
5303
5303
|
}
|
|
5304
5304
|
const Q = S.uid;
|
|
5305
5305
|
if (K.shiftKey && Y !== null) {
|
|
5306
|
-
const ee = Math.min(Y,
|
|
5306
|
+
const ee = Math.min(Y, $), ae = Math.max(Y, $), ne = D.slice(ee, ae + 1).map((Ae) => Ae.uid), te = new Set(ne);
|
|
5307
5307
|
R(te), h == null || h(Array.from(te));
|
|
5308
5308
|
} else if (K.ctrlKey || K.metaKey)
|
|
5309
5309
|
R((ee) => {
|
|
5310
5310
|
const ae = new Set(ee);
|
|
5311
5311
|
return ae.has(Q) ? ae.delete(Q) : ae.add(Q), h == null || h(Array.from(ae)), ae;
|
|
5312
|
-
}), de(
|
|
5312
|
+
}), de($);
|
|
5313
5313
|
else {
|
|
5314
5314
|
const ee = /* @__PURE__ */ new Set([Q]);
|
|
5315
|
-
R(ee), de(
|
|
5315
|
+
R(ee), de($), h == null || h(Array.from(ee));
|
|
5316
5316
|
}
|
|
5317
5317
|
}, [o, Y, D, j, f, h, i]), it = re(async () => {
|
|
5318
5318
|
if (!ge || j.size === 0) return;
|
|
5319
5319
|
const S = s || "INBOX";
|
|
5320
5320
|
try {
|
|
5321
|
-
const
|
|
5322
|
-
if (console.log("Trash result:",
|
|
5321
|
+
const $ = await ge.trashEmails(t, Array.from(j), S);
|
|
5322
|
+
if (console.log("Trash result:", $), $.success && $.moved > 0) {
|
|
5323
5323
|
k((Q) => Q.filter((ee) => !j.has(ee.uid)));
|
|
5324
5324
|
const K = Array.from(j);
|
|
5325
5325
|
R(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5326
5326
|
} else
|
|
5327
5327
|
L("Failed to move emails to trash");
|
|
5328
|
-
} catch (
|
|
5329
|
-
const K =
|
|
5328
|
+
} catch ($) {
|
|
5329
|
+
const K = $ instanceof Error ? $ : new Error("Trash failed");
|
|
5330
5330
|
console.error("Trash error:", K), L(K.message), m == null || m(K);
|
|
5331
5331
|
}
|
|
5332
5332
|
}, [ge, t, j, s, g, m]), ot = re(async () => {
|
|
5333
5333
|
if (!ge || j.size === 0) return;
|
|
5334
5334
|
const S = s || "INBOX";
|
|
5335
5335
|
try {
|
|
5336
|
-
const
|
|
5337
|
-
if (console.log("Archive result:",
|
|
5336
|
+
const $ = await ge.archiveEmails(t, Array.from(j), S);
|
|
5337
|
+
if (console.log("Archive result:", $), $.success && $.archived > 0) {
|
|
5338
5338
|
k((Q) => Q.filter((ee) => !j.has(ee.uid)));
|
|
5339
5339
|
const K = Array.from(j);
|
|
5340
5340
|
R(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5341
5341
|
} else
|
|
5342
5342
|
L("Failed to archive emails");
|
|
5343
|
-
} catch (
|
|
5344
|
-
const K =
|
|
5343
|
+
} catch ($) {
|
|
5344
|
+
const K = $ instanceof Error ? $ : new Error("Archive failed");
|
|
5345
5345
|
console.error("Archive error:", K), L(K.message), m == null || m(K);
|
|
5346
5346
|
}
|
|
5347
5347
|
}, [ge, t, j, s, g, m]), dt = re(() => {
|
|
5348
5348
|
if (j.size === D.length)
|
|
5349
5349
|
R(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
5350
5350
|
else {
|
|
5351
|
-
const S = new Set(D.map((
|
|
5351
|
+
const S = new Set(D.map(($) => $.uid));
|
|
5352
5352
|
R(S), h == null || h(Array.from(S));
|
|
5353
5353
|
}
|
|
5354
5354
|
}, [D, j.size, h]), Ut = re(() => {
|
|
@@ -5361,11 +5361,11 @@ function Af({
|
|
|
5361
5361
|
clearSelection: Ut
|
|
5362
5362
|
}, Dt = (S) => {
|
|
5363
5363
|
if (!S) return "";
|
|
5364
|
-
const
|
|
5365
|
-
return
|
|
5366
|
-
}, ft = (S,
|
|
5364
|
+
const $ = new Date(S), K = /* @__PURE__ */ new Date();
|
|
5365
|
+
return $.toDateString() === K.toDateString() ? $.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : $.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5366
|
+
}, ft = (S, $) => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5367
5367
|
padding: "12px 16px",
|
|
5368
|
-
background:
|
|
5368
|
+
background: $ ? b.selectedBackground : S.seen ? b.cardBackground : b.unreadBackground,
|
|
5369
5369
|
borderBottom: `1px solid ${b.border}`,
|
|
5370
5370
|
cursor: "pointer",
|
|
5371
5371
|
transition: "background 0.15s ease"
|
|
@@ -5409,7 +5409,7 @@ function Af({
|
|
|
5409
5409
|
dangerouslySetInnerHTML: { __html: ve }
|
|
5410
5410
|
}
|
|
5411
5411
|
) : /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color: b.textSecondary }, children: "No content available" })
|
|
5412
|
-
] }), At = (S,
|
|
5412
|
+
] }), At = (S, $) => /* @__PURE__ */ p.jsxs("div", { style: {
|
|
5413
5413
|
display: "flex",
|
|
5414
5414
|
alignItems: "center",
|
|
5415
5415
|
gap: "8px",
|
|
@@ -5420,7 +5420,7 @@ function Af({
|
|
|
5420
5420
|
/* @__PURE__ */ p.jsx(
|
|
5421
5421
|
"button",
|
|
5422
5422
|
{
|
|
5423
|
-
onClick:
|
|
5423
|
+
onClick: $.selectAll,
|
|
5424
5424
|
style: {
|
|
5425
5425
|
padding: "6px 12px",
|
|
5426
5426
|
background: "transparent",
|
|
@@ -5441,7 +5441,7 @@ function Af({
|
|
|
5441
5441
|
/* @__PURE__ */ p.jsx(
|
|
5442
5442
|
"button",
|
|
5443
5443
|
{
|
|
5444
|
-
onClick:
|
|
5444
|
+
onClick: $.archive,
|
|
5445
5445
|
title: "Archive",
|
|
5446
5446
|
style: {
|
|
5447
5447
|
display: "flex",
|
|
@@ -5461,7 +5461,7 @@ function Af({
|
|
|
5461
5461
|
/* @__PURE__ */ p.jsx(
|
|
5462
5462
|
"button",
|
|
5463
5463
|
{
|
|
5464
|
-
onClick:
|
|
5464
|
+
onClick: $.delete,
|
|
5465
5465
|
title: "Delete",
|
|
5466
5466
|
style: {
|
|
5467
5467
|
display: "flex",
|
|
@@ -5483,7 +5483,7 @@ function Af({
|
|
|
5483
5483
|
/* @__PURE__ */ p.jsx(
|
|
5484
5484
|
"button",
|
|
5485
5485
|
{
|
|
5486
|
-
onClick:
|
|
5486
|
+
onClick: $.refresh,
|
|
5487
5487
|
title: "Refresh",
|
|
5488
5488
|
style: {
|
|
5489
5489
|
display: "flex",
|
|
@@ -5508,7 +5508,7 @@ function Af({
|
|
|
5508
5508
|
padding: "48px",
|
|
5509
5509
|
textAlign: "center",
|
|
5510
5510
|
color: b.textSecondary
|
|
5511
|
-
}, children: "Loading..." }),
|
|
5511
|
+
}, children: "Loading..." }), Ke = C || ft, I = x || ht, T = A || At, X = w || W, J = E || be;
|
|
5512
5512
|
return M && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background: b.background, width: "100%", height: "100%" }, children: J() }) : /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", background: b.background, width: "100%", height: "100%" }, children: [
|
|
5513
5513
|
/* @__PURE__ */ p.jsxs("div", { style: {
|
|
5514
5514
|
flex: i && ie ? "0 0 50%" : "1",
|
|
@@ -5575,17 +5575,17 @@ function Af({
|
|
|
5575
5575
|
fontSize: "14px",
|
|
5576
5576
|
borderBottom: `1px solid ${b.border}`
|
|
5577
5577
|
}, children: F }),
|
|
5578
|
-
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? X() : ze.map((S,
|
|
5578
|
+
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? X() : ze.map((S, $) => /* @__PURE__ */ p.jsx(
|
|
5579
5579
|
"div",
|
|
5580
5580
|
{
|
|
5581
|
-
onClick: (K) => qt(S,
|
|
5581
|
+
onClick: (K) => qt(S, $, K),
|
|
5582
5582
|
onDoubleClick: () => Ct(S),
|
|
5583
|
-
children:
|
|
5583
|
+
children: Ke(S, j.has(S.uid))
|
|
5584
5584
|
},
|
|
5585
5585
|
S.uid
|
|
5586
5586
|
)) })
|
|
5587
5587
|
] }),
|
|
5588
|
-
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
5588
|
+
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: I(ie) })
|
|
5589
5589
|
] });
|
|
5590
5590
|
}
|
|
5591
5591
|
function Ef({
|
|
@@ -5622,7 +5622,7 @@ function Ef({
|
|
|
5622
5622
|
}, [h, d, n]), A = re((w) => {
|
|
5623
5623
|
s == null || s(w, h, g);
|
|
5624
5624
|
}, [s, h, g]);
|
|
5625
|
-
return
|
|
5625
|
+
return Je.useEffect(() => {
|
|
5626
5626
|
h.length === 0 ? f(-1) : d >= h.length ? f(h.length - 1) : d < 0 && h.length > 0 && (f(0), n == null || n(h[0], 0));
|
|
5627
5627
|
}, [h.length, d, n]), r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `text-sm text-neutral-400 text-center py-4 ${a}`, children: i }) : /* @__PURE__ */ p.jsxs("div", { className: `space-y-2 ${a}`, children: [
|
|
5628
5628
|
/* @__PURE__ */ p.jsxs("div", { className: "flex items-center justify-between text-xs text-neutral-500", children: [
|
|
@@ -5732,7 +5732,7 @@ const fi = {}, _u = {}, hl = {}, or = {}, Er = {}, ln = {}, Sr = {}, os = {}, Ws
|
|
|
5732
5732
|
function Ju(r) {
|
|
5733
5733
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5734
5734
|
}
|
|
5735
|
-
var
|
|
5735
|
+
var z = Ju(function(r) {
|
|
5736
5736
|
const e = new URLSearchParams();
|
|
5737
5737
|
e.append("code", r);
|
|
5738
5738
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -5791,7 +5791,7 @@ function kl(r, e, t) {
|
|
|
5791
5791
|
const h = e[f], g = h.type, m = h.target, y = ec(m, r, l, i);
|
|
5792
5792
|
if (!y) continue;
|
|
5793
5793
|
const [C, x] = y;
|
|
5794
|
-
if (g === "characterData") n &&
|
|
5794
|
+
if (g === "characterData") n && q(x) && Zu(s, m, x) && Xu(m, x, r);
|
|
5795
5795
|
else if (g === "childList") {
|
|
5796
5796
|
u = !0;
|
|
5797
5797
|
const A = h.addedNodes;
|
|
@@ -5856,7 +5856,7 @@ function Zi(r, e) {
|
|
|
5856
5856
|
function eo(r) {
|
|
5857
5857
|
let e, t, n = r;
|
|
5858
5858
|
if (n.__text !== "" || !n.isSimpleText() || n.isUnmergeable()) {
|
|
5859
|
-
for (; (e = n.getPreviousSibling()) !== null &&
|
|
5859
|
+
for (; (e = n.getPreviousSibling()) !== null && q(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
|
|
5860
5860
|
if (e.__text !== "") {
|
|
5861
5861
|
if (Xi(e, n)) {
|
|
5862
5862
|
n = Zi(e, n);
|
|
@@ -5866,7 +5866,7 @@ function eo(r) {
|
|
|
5866
5866
|
}
|
|
5867
5867
|
e.remove();
|
|
5868
5868
|
}
|
|
5869
|
-
for (; (t = n.getNextSibling()) !== null &&
|
|
5869
|
+
for (; (t = n.getNextSibling()) !== null && q(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
|
|
5870
5870
|
if (t.__text !== "") {
|
|
5871
5871
|
if (Xi(n, t)) {
|
|
5872
5872
|
n = Zi(n, t);
|
|
@@ -5885,7 +5885,7 @@ function to(r) {
|
|
|
5885
5885
|
for (; r.type === "element"; ) {
|
|
5886
5886
|
const e = r.getNode(), t = r.offset;
|
|
5887
5887
|
let n, s;
|
|
5888
|
-
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1),
|
|
5888
|
+
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1), q(n)) {
|
|
5889
5889
|
r.set(n.__key, s ? n.getTextContentSize() : 0, "text");
|
|
5890
5890
|
break;
|
|
5891
5891
|
}
|
|
@@ -5947,7 +5947,7 @@ function Vn(r, e, t) {
|
|
|
5947
5947
|
return e === "subscript" ? s &= -65 : e === "superscript" && (s &= -33), s;
|
|
5948
5948
|
}
|
|
5949
5949
|
function jl(r) {
|
|
5950
|
-
return
|
|
5950
|
+
return q(r) || ar(r) || me(r);
|
|
5951
5951
|
}
|
|
5952
5952
|
function sc(r, e) {
|
|
5953
5953
|
if (e != null) return void (r.__key = e);
|
|
@@ -6094,7 +6094,7 @@ function ki(r, e, t) {
|
|
|
6094
6094
|
if (s !== null) {
|
|
6095
6095
|
let l = Il(s);
|
|
6096
6096
|
const a = Nr(s);
|
|
6097
|
-
if (l !== null &&
|
|
6097
|
+
if (l !== null && q(a)) {
|
|
6098
6098
|
if (l === us && t) {
|
|
6099
6099
|
const u = t.length;
|
|
6100
6100
|
l = t, o = u, i = u;
|
|
@@ -6141,7 +6141,7 @@ function ic(r, e) {
|
|
|
6141
6141
|
const t = r.anchor.offset, n = e.getParentOrThrow(), s = e.isToken();
|
|
6142
6142
|
return t === 0 ? !e.canInsertTextBefore() || !n.canInsertTextBefore() && !e.isComposing() || s || function(o) {
|
|
6143
6143
|
const i = o.getPreviousSibling();
|
|
6144
|
-
return (
|
|
6144
|
+
return (q(i) || N(i) && i.isInline()) && !i.canInsertTextAfter();
|
|
6145
6145
|
}(e) : t === e.getTextContentSize() && (!e.canInsertTextAfter() || !n.canInsertTextAfter() && !e.isComposing() || s);
|
|
6146
6146
|
}
|
|
6147
6147
|
function so(r) {
|
|
@@ -6183,7 +6183,7 @@ function en(r, e) {
|
|
|
6183
6183
|
function Bi(r, e, t, n, s) {
|
|
6184
6184
|
if (t.size === 0) return;
|
|
6185
6185
|
const o = n.__type, i = n.__key, l = e.get(o);
|
|
6186
|
-
l === void 0 &&
|
|
6186
|
+
l === void 0 && z(33, o);
|
|
6187
6187
|
const a = l.klass;
|
|
6188
6188
|
let u = r.get(a);
|
|
6189
6189
|
u === void 0 && (u = /* @__PURE__ */ new Map(), r.set(a, u));
|
|
@@ -6216,11 +6216,11 @@ function U(r, e, t) {
|
|
|
6216
6216
|
return ca(r, e, t);
|
|
6217
6217
|
}
|
|
6218
6218
|
function fs(r) {
|
|
6219
|
-
return !
|
|
6219
|
+
return !Ye(r) && !r.isLastChild() && !r.isInline();
|
|
6220
6220
|
}
|
|
6221
6221
|
function Hn(r, e) {
|
|
6222
6222
|
const t = r._keyToDOMMap.get(e);
|
|
6223
|
-
return t === void 0 &&
|
|
6223
|
+
return t === void 0 && z(75, e), t;
|
|
6224
6224
|
}
|
|
6225
6225
|
function xn(r) {
|
|
6226
6226
|
const e = r.assignedSlot || r.parentElement;
|
|
@@ -6236,7 +6236,7 @@ function tn(r, e) {
|
|
|
6236
6236
|
}
|
|
6237
6237
|
function hs(r) {
|
|
6238
6238
|
const e = r._window;
|
|
6239
|
-
return e === null &&
|
|
6239
|
+
return e === null && z(78), e;
|
|
6240
6240
|
}
|
|
6241
6241
|
function lc(r) {
|
|
6242
6242
|
let e = r.getParentOrThrow();
|
|
@@ -6247,20 +6247,20 @@ function lc(r) {
|
|
|
6247
6247
|
return e;
|
|
6248
6248
|
}
|
|
6249
6249
|
function Ft(r) {
|
|
6250
|
-
return
|
|
6250
|
+
return Ye(r) || N(r) && r.isShadowRoot();
|
|
6251
6251
|
}
|
|
6252
6252
|
function Lt(r) {
|
|
6253
6253
|
const e = Be(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6254
|
-
n === void 0 &&
|
|
6254
|
+
n === void 0 && z(200, r.constructor.name, t);
|
|
6255
6255
|
const { replace: s, replaceWithKlass: o } = n;
|
|
6256
6256
|
if (s !== null) {
|
|
6257
6257
|
const i = s(r), l = i.constructor;
|
|
6258
|
-
return o !== null ? i instanceof o ||
|
|
6258
|
+
return o !== null ? i instanceof o || z(201, o.name, o.getType(), l.name, l.getType(), r.constructor.name, t) : i instanceof r.constructor && l !== r.constructor || z(202, l.name, l.getType(), r.constructor.name, t), i.__key === r.__key && z(203, r.constructor.name, t, l.name, l.getType()), i;
|
|
6259
6259
|
}
|
|
6260
6260
|
return r;
|
|
6261
6261
|
}
|
|
6262
6262
|
function Fs(r, e) {
|
|
6263
|
-
!
|
|
6263
|
+
!Ye(r.getParent()) || N(e) || me(e) || z(99);
|
|
6264
6264
|
}
|
|
6265
6265
|
function js(r) {
|
|
6266
6266
|
return (me(r) || N(r) && !r.canBeEmpty()) && !r.isInline();
|
|
@@ -6326,7 +6326,7 @@ function Jn(r) {
|
|
|
6326
6326
|
function Vt(r) {
|
|
6327
6327
|
if (me(r) && !r.isInline()) return !0;
|
|
6328
6328
|
if (!N(r) || Ft(r)) return !1;
|
|
6329
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
6329
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
6330
6330
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6331
6331
|
}
|
|
6332
6332
|
function Wr(r, e) {
|
|
@@ -6340,7 +6340,7 @@ function cc() {
|
|
|
6340
6340
|
const co = /* @__PURE__ */ new WeakMap(), dc = /* @__PURE__ */ new Map();
|
|
6341
6341
|
function fc(r) {
|
|
6342
6342
|
if (!r._readOnly && r.isEmpty()) return dc;
|
|
6343
|
-
r._readOnly ||
|
|
6343
|
+
r._readOnly || z(192);
|
|
6344
6344
|
let e = co.get(r);
|
|
6345
6345
|
if (!e) {
|
|
6346
6346
|
e = /* @__PURE__ */ new Map(), co.set(r, e);
|
|
@@ -6370,14 +6370,14 @@ function zl(r, e, t, n, s, o) {
|
|
|
6370
6370
|
i.__parent === e && (N(i) && zl(i, l, t, n, s, o), t.has(l) || o.delete(l), s.push(l)), i = i.getNextSibling();
|
|
6371
6371
|
}
|
|
6372
6372
|
}
|
|
6373
|
-
let Xt,
|
|
6373
|
+
let Xt, Xe, dn, ps, Hs, Js, dr, _t, Qs, fn, Re = "", Qe = "", St = null, mt = "", Ot = "", ql = !1, hn = !1, Rn = null;
|
|
6374
6374
|
function Qn(r, e) {
|
|
6375
6375
|
const t = dr.get(r);
|
|
6376
6376
|
if (e !== null) {
|
|
6377
6377
|
const n = Zs(r);
|
|
6378
6378
|
n.parentNode === e && e.removeChild(n);
|
|
6379
6379
|
}
|
|
6380
|
-
if (_t.has(r) ||
|
|
6380
|
+
if (_t.has(r) || Xe._keyToDOMMap.delete(r), N(t)) {
|
|
6381
6381
|
const n = Xn(t, dr);
|
|
6382
6382
|
Ys(n, 0, n.length - 1, null);
|
|
6383
6383
|
}
|
|
@@ -6409,20 +6409,20 @@ function Wl(r, e) {
|
|
|
6409
6409
|
}
|
|
6410
6410
|
function Yn(r, e) {
|
|
6411
6411
|
const t = _t.get(r);
|
|
6412
|
-
t === void 0 &&
|
|
6413
|
-
const n = t.createDOM(Xt,
|
|
6412
|
+
t === void 0 && z(60);
|
|
6413
|
+
const n = t.createDOM(Xt, Xe);
|
|
6414
6414
|
if (function(s, o, i) {
|
|
6415
6415
|
const l = i._keyToDOMMap;
|
|
6416
6416
|
(function(a, u, c) {
|
|
6417
6417
|
a[`__lexicalKey_${u._key}`] = c;
|
|
6418
6418
|
})(o, i, s), l.set(s, o);
|
|
6419
|
-
}(r, n,
|
|
6419
|
+
}(r, n, Xe), q(t) ? n.setAttribute("data-lexical-text", "true") : me(t) && n.setAttribute("data-lexical-decorator", "true"), N(t)) {
|
|
6420
6420
|
const s = t.__indent, o = t.__size;
|
|
6421
6421
|
if (s !== 0 && Ul(n, s), o !== 0) {
|
|
6422
6422
|
const l = o - 1;
|
|
6423
6423
|
(function(a, u, c, d) {
|
|
6424
|
-
const f =
|
|
6425
|
-
|
|
6424
|
+
const f = Qe;
|
|
6425
|
+
Qe = "", Xs(a, c, 0, u, c.getDOMSlot(d)), Vl(c, d), Qe = f;
|
|
6426
6426
|
})(Xn(t, _t), l, t, n);
|
|
6427
6427
|
}
|
|
6428
6428
|
const i = t.__format;
|
|
@@ -6430,9 +6430,9 @@ function Yn(r, e) {
|
|
|
6430
6430
|
} else {
|
|
6431
6431
|
const s = t.getTextContent();
|
|
6432
6432
|
if (me(t)) {
|
|
6433
|
-
const o = t.decorate(
|
|
6433
|
+
const o = t.decorate(Xe, Xt);
|
|
6434
6434
|
o !== null && Kl(r, o), n.contentEditable = "false";
|
|
6435
|
-
} else
|
|
6435
|
+
} else q(t) && (t.isDirectionless() || (Qe += s));
|
|
6436
6436
|
Re += s, Ot += s;
|
|
6437
6437
|
}
|
|
6438
6438
|
return e !== null && e.insertChild(n), Bi(fn, dn, ps, t, "created"), n;
|
|
@@ -6444,7 +6444,7 @@ function Xs(r, e, t, n, s) {
|
|
|
6444
6444
|
for (; i <= n; ++i) {
|
|
6445
6445
|
Yn(r[i], s);
|
|
6446
6446
|
const l = _t.get(r[i]);
|
|
6447
|
-
l !== null &&
|
|
6447
|
+
l !== null && q(l) && (St === null && (St = l.getFormat()), mt === "" && (mt = l.getStyle()));
|
|
6448
6448
|
}
|
|
6449
6449
|
fs(e) && (Re += Mt), s.element.__lexicalTextContent = Re, Re = o + Re;
|
|
6450
6450
|
}
|
|
@@ -6465,8 +6465,8 @@ function Gl(r, e, t) {
|
|
|
6465
6465
|
}
|
|
6466
6466
|
function Vl(r, e) {
|
|
6467
6467
|
const t = e.__lexicalDirTextContent || "", n = e.__lexicalDir || "";
|
|
6468
|
-
if (t !==
|
|
6469
|
-
const o =
|
|
6468
|
+
if (t !== Qe || n !== Rn) {
|
|
6469
|
+
const o = Qe === "", i = o ? Rn : (s = Qe, Uu.test(s) ? "rtl" : Wu.test(s) ? "ltr" : null);
|
|
6470
6470
|
if (i !== n) {
|
|
6471
6471
|
const l = e.classList, a = Xt.theme;
|
|
6472
6472
|
let u = n !== null ? a[n] : void 0, c = i !== null ? a[i] : void 0;
|
|
@@ -6490,14 +6490,14 @@ function Vl(r, e) {
|
|
|
6490
6490
|
}
|
|
6491
6491
|
hn || (r.getWritable().__dir = i);
|
|
6492
6492
|
}
|
|
6493
|
-
Rn = i, e.__lexicalDirTextContent =
|
|
6493
|
+
Rn = i, e.__lexicalDirTextContent = Qe, e.__lexicalDir = i;
|
|
6494
6494
|
}
|
|
6495
6495
|
var s;
|
|
6496
6496
|
}
|
|
6497
6497
|
function gc(r, e, t) {
|
|
6498
|
-
const n =
|
|
6498
|
+
const n = Qe;
|
|
6499
6499
|
var s;
|
|
6500
|
-
|
|
6500
|
+
Qe = "", St = null, mt = "", function(o, i, l) {
|
|
6501
6501
|
const a = Re, u = o.__size, c = i.__size;
|
|
6502
6502
|
Re = "";
|
|
6503
6503
|
const d = l.element;
|
|
@@ -6518,10 +6518,10 @@ function gc(r, e, t) {
|
|
|
6518
6518
|
Qn(f, null);
|
|
6519
6519
|
}
|
|
6520
6520
|
const g = _t.get(h);
|
|
6521
|
-
|
|
6521
|
+
q(g) && (St === null && (St = g.getFormat()), mt === "" && (mt = g.getStyle()));
|
|
6522
6522
|
} else {
|
|
6523
6523
|
const f = Xn(o, dr), h = Xn(i, _t);
|
|
6524
|
-
if (f.length !== u &&
|
|
6524
|
+
if (f.length !== u && z(227), h.length !== c && z(228), u === 0) c !== 0 && Xs(h, i, 0, c - 1, l);
|
|
6525
6525
|
else if (c === 0) {
|
|
6526
6526
|
if (u !== 0) {
|
|
6527
6527
|
const g = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
@@ -6537,17 +6537,17 @@ function gc(r, e, t) {
|
|
|
6537
6537
|
v === void 0 && (v = new Set(m)), b === void 0 && (b = new Set(y));
|
|
6538
6538
|
const Y = b.has(L), de = v.has(j);
|
|
6539
6539
|
if (Y) if (de) {
|
|
6540
|
-
const ie = Hn(
|
|
6540
|
+
const ie = Hn(Xe, j);
|
|
6541
6541
|
ie === D ? D = Ls(Jr(j, A.element)) : (A.withBefore(D).insertChild(ie), Jr(j, A.element)), k++, M++;
|
|
6542
6542
|
} else Yn(j, A.withBefore(D)), M++;
|
|
6543
6543
|
else D = Ls(Zs(L)), Qn(L, A.element), k++;
|
|
6544
6544
|
}
|
|
6545
6545
|
const R = _t.get(j);
|
|
6546
|
-
R !== null &&
|
|
6546
|
+
R !== null && q(R) && (St === null && (St = R.getFormat()), mt === "" && (mt = R.getStyle()));
|
|
6547
6547
|
}
|
|
6548
6548
|
const B = k > w, F = M > E;
|
|
6549
6549
|
if (B && !F) {
|
|
6550
|
-
const L = y[E + 1], j = L === void 0 ? null :
|
|
6550
|
+
const L = y[E + 1], j = L === void 0 ? null : Xe.getElementByKey(L);
|
|
6551
6551
|
Xs(y, g, M, E, A.withBefore(j));
|
|
6552
6552
|
} else F && !B && Ys(m, k, w, A.element);
|
|
6553
6553
|
})(i, f, h, u, c, l);
|
|
@@ -6555,78 +6555,78 @@ function gc(r, e, t) {
|
|
|
6555
6555
|
fs(i) && (Re += Mt), d.__lexicalTextContent = Re, Re = a + Re;
|
|
6556
6556
|
}(r, e, e.getDOMSlot(t)), Vl(e, t), Fr(s = e) && St != null && St !== s.__textFormat && !hn && (s.setTextFormat(St), s.setTextStyle(mt)), function(o) {
|
|
6557
6557
|
Fr(o) && mt !== "" && mt !== o.__textStyle && !hn && o.setTextStyle(mt);
|
|
6558
|
-
}(e),
|
|
6558
|
+
}(e), Qe = n;
|
|
6559
6559
|
}
|
|
6560
6560
|
function Xn(r, e) {
|
|
6561
6561
|
const t = [];
|
|
6562
6562
|
let n = r.__first;
|
|
6563
6563
|
for (; n !== null; ) {
|
|
6564
6564
|
const s = e.get(n);
|
|
6565
|
-
s === void 0 &&
|
|
6565
|
+
s === void 0 && z(101), t.push(n), n = s.__next;
|
|
6566
6566
|
}
|
|
6567
6567
|
return t;
|
|
6568
6568
|
}
|
|
6569
6569
|
function Jr(r, e) {
|
|
6570
6570
|
const t = dr.get(r);
|
|
6571
6571
|
let n = _t.get(r);
|
|
6572
|
-
t !== void 0 && n !== void 0 ||
|
|
6573
|
-
const s = ql || Js.has(r) || Hs.has(r), o = Hn(
|
|
6572
|
+
t !== void 0 && n !== void 0 || z(61);
|
|
6573
|
+
const s = ql || Js.has(r) || Hs.has(r), o = Hn(Xe, r);
|
|
6574
6574
|
if (t === n && !s) {
|
|
6575
6575
|
if (N(t)) {
|
|
6576
6576
|
const i = o.__lexicalTextContent;
|
|
6577
6577
|
i !== void 0 && (Re += i, Ot += i);
|
|
6578
6578
|
const l = o.__lexicalDirTextContent;
|
|
6579
|
-
l !== void 0 && (
|
|
6579
|
+
l !== void 0 && (Qe += l);
|
|
6580
6580
|
} else {
|
|
6581
6581
|
const i = t.getTextContent();
|
|
6582
|
-
|
|
6582
|
+
q(t) && !t.isDirectionless() && (Qe += i), Ot += i, Re += i;
|
|
6583
6583
|
}
|
|
6584
6584
|
return o;
|
|
6585
6585
|
}
|
|
6586
6586
|
if (t !== n && s && Bi(fn, dn, ps, n, "updated"), n.updateDOM(t, o, Xt)) {
|
|
6587
6587
|
const i = Yn(r, null);
|
|
6588
|
-
return e === null &&
|
|
6588
|
+
return e === null && z(62), e.replaceChild(i, o), Qn(r, null), i;
|
|
6589
6589
|
}
|
|
6590
6590
|
if (N(t) && N(n)) {
|
|
6591
6591
|
const i = n.__indent;
|
|
6592
6592
|
i !== t.__indent && Ul(o, i);
|
|
6593
6593
|
const l = n.__format;
|
|
6594
|
-
l !== t.__format && Wl(o, l), s && (gc(t, n, o),
|
|
6594
|
+
l !== t.__format && Wl(o, l), s && (gc(t, n, o), Ye(n) || n.isInline() || Gl(t, n, o)), fs(n) && (Re += Mt, Ot += Mt);
|
|
6595
6595
|
} else {
|
|
6596
6596
|
const i = n.getTextContent();
|
|
6597
6597
|
if (me(n)) {
|
|
6598
|
-
const l = n.decorate(
|
|
6598
|
+
const l = n.decorate(Xe, Xt);
|
|
6599
6599
|
l !== null && Kl(r, l);
|
|
6600
|
-
} else
|
|
6600
|
+
} else q(n) && !n.isDirectionless() && (Qe += i);
|
|
6601
6601
|
Re += i, Ot += i;
|
|
6602
6602
|
}
|
|
6603
|
-
if (!hn &&
|
|
6603
|
+
if (!hn && Ye(n) && n.__cachedText !== Ot) {
|
|
6604
6604
|
const i = n.getWritable();
|
|
6605
6605
|
i.__cachedText = Ot, n = i;
|
|
6606
6606
|
}
|
|
6607
6607
|
return o;
|
|
6608
6608
|
}
|
|
6609
6609
|
function Kl(r, e) {
|
|
6610
|
-
let t =
|
|
6611
|
-
const n =
|
|
6610
|
+
let t = Xe._pendingDecorators;
|
|
6611
|
+
const n = Xe._decorators;
|
|
6612
6612
|
if (t === null) {
|
|
6613
6613
|
if (n[r] === e) return;
|
|
6614
|
-
t = Pl(
|
|
6614
|
+
t = Pl(Xe);
|
|
6615
6615
|
}
|
|
6616
6616
|
t[r] = e;
|
|
6617
6617
|
}
|
|
6618
6618
|
function Ls(r) {
|
|
6619
6619
|
let e = r.nextSibling;
|
|
6620
|
-
return e !== null && e ===
|
|
6620
|
+
return e !== null && e === Xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6621
6621
|
}
|
|
6622
6622
|
function mc(r, e, t, n, s, o) {
|
|
6623
|
-
Re = "", Ot = "",
|
|
6623
|
+
Re = "", Ot = "", Qe = "", ql = n === Br, Rn = null, Xe = t, Xt = t._config, dn = t._nodes, ps = Xe._listeners.mutation, Hs = s, Js = o, dr = r._nodeMap, _t = e._nodeMap, hn = e._readOnly, Qs = new Map(t._keyToDOMMap);
|
|
6624
6624
|
const i = /* @__PURE__ */ new Map();
|
|
6625
|
-
return fn = i, Jr("root", null),
|
|
6625
|
+
return fn = i, Jr("root", null), Xe = void 0, dn = void 0, Hs = void 0, Js = void 0, dr = void 0, _t = void 0, Xt = void 0, Qs = void 0, fn = void 0, i;
|
|
6626
6626
|
}
|
|
6627
6627
|
function Zs(r) {
|
|
6628
6628
|
const e = Qs.get(r);
|
|
6629
|
-
return e === void 0 &&
|
|
6629
|
+
return e === void 0 && z(75, r), e;
|
|
6630
6630
|
}
|
|
6631
6631
|
const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
6632
6632
|
if (rn = r.timeStamp, Hl = r.key, e.isComposing()) return;
|
|
@@ -6727,7 +6727,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6727
6727
|
const t = V();
|
|
6728
6728
|
if (O(t) && !e.isComposing()) {
|
|
6729
6729
|
const n = t.anchor, s = t.anchor.getNode();
|
|
6730
|
-
We(n.key), (r.timeStamp < rn + ei || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format ||
|
|
6730
|
+
We(n.key), (r.timeStamp < rn + ei || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || q(s) && s.getStyle() !== t.style) && U(e, Sr, qu);
|
|
6731
6731
|
}
|
|
6732
6732
|
});
|
|
6733
6733
|
}], ["compositionend", function(r, e) {
|
|
@@ -6742,7 +6742,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6742
6742
|
const o = t.anchor.getNode(), i = ut(e._window);
|
|
6743
6743
|
if (i === null) return;
|
|
6744
6744
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, u = l ? t.focus.offset : t.anchor.offset;
|
|
6745
|
-
zn && !t.isCollapsed() &&
|
|
6745
|
+
zn && !t.isCollapsed() && q(o) && i.anchorNode !== null && o.getTextContent().slice(0, a) + n + o.getTextContent().slice(a + u) === Il(i.anchorNode) || U(e, Sr, n);
|
|
6746
6746
|
const c = n.length;
|
|
6747
6747
|
Yt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), as || gn || mi || !e.isComposing() || (rn = 0, We(null));
|
|
6748
6748
|
} else
|
|
@@ -6755,7 +6755,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6755
6755
|
if (n) {
|
|
6756
6756
|
if (O(t)) {
|
|
6757
6757
|
const o = t.anchor, i = o.getNode();
|
|
6758
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !
|
|
6758
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !Ye(i) && Ee().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (N(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6759
6759
|
} else if (r.pointerType === "touch") {
|
|
6760
6760
|
const o = n.anchorNode;
|
|
6761
6761
|
if (o !== null) {
|
|
@@ -6786,7 +6786,7 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6786
6786
|
});
|
|
6787
6787
|
}, ei), O(i)) {
|
|
6788
6788
|
const g = i.anchor.getNode();
|
|
6789
|
-
g.markDirty(), i.format = g.getFormat(),
|
|
6789
|
+
g.markDirty(), i.format = g.getFormat(), q(g) || z(142), i.style = g.getStyle();
|
|
6790
6790
|
}
|
|
6791
6791
|
} else {
|
|
6792
6792
|
We(null), t.preventDefault();
|
|
@@ -6799,7 +6799,7 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6799
6799
|
var l;
|
|
6800
6800
|
if (!O(i)) return;
|
|
6801
6801
|
const a = t.data;
|
|
6802
|
-
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() ||
|
|
6802
|
+
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() || Ye(i.anchor.getNode()) || o === null || i.applyDOMRange(o), Cr = null;
|
|
6803
6803
|
const u = i.anchor, c = i.focus, d = u.getNode(), f = c.getNode();
|
|
6804
6804
|
if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
|
|
6805
6805
|
case "insertFromYank":
|
|
@@ -6882,7 +6882,7 @@ const Zn = /* @__PURE__ */ new WeakMap();
|
|
|
6882
6882
|
let ri = !1, ni = !1, nn = !1, Gr = !1, Ql = [0, "", 0, "root", 0];
|
|
6883
6883
|
function Yl(r, e, t, n, s) {
|
|
6884
6884
|
const o = r.anchor, i = r.focus, l = o.getNode(), a = Be(), u = ut(a._window), c = u !== null ? u.anchorNode : null, d = o.key, f = a.getElementByKey(d), h = t.length;
|
|
6885
|
-
return d !== i.key || !
|
|
6885
|
+
return d !== i.key || !q(l) || (!s && (!zn || Jl < n + 50) || l.isDirty() && h < 2 || Ol(t)) && o.offset !== i.offset && !l.isComposing() || sr(l) || l.isDirty() && h > 1 || (s || !zn) && f !== null && !l.isComposing() && c !== Gn(f) || u !== null && e !== null && (!e.collapsed || e.startContainer !== u.anchorNode || e.startOffset !== u.anchorOffset) || l.getFormat() !== r.format || l.getStyle() !== r.style || ic(r, l);
|
|
6886
6886
|
}
|
|
6887
6887
|
function ho(r, e) {
|
|
6888
6888
|
return r !== null && r.nodeValue !== null && r.nodeType === Zt && e !== 0 && e !== r.nodeValue.length;
|
|
@@ -6899,7 +6899,7 @@ function po(r, e, t) {
|
|
|
6899
6899
|
r.type === "Range" && r.anchorNode === r.focusNode && (l.dirty = !0);
|
|
6900
6900
|
const c = hs(e).event, d = c ? c.timeStamp : performance.now(), [f, h, g, m, y] = Ql, C = Ee(), x = e.isComposing() === !1 && C.getTextContent() === "";
|
|
6901
6901
|
if (d < y + 200 && a.offset === g && a.key === m) l.format = f, l.style = h;
|
|
6902
|
-
else if (a.type === "text")
|
|
6902
|
+
else if (a.type === "text") q(u) || z(141), l.format = u.getFormat(), l.style = u.getStyle();
|
|
6903
6903
|
else if (a.type === "element" && !x) {
|
|
6904
6904
|
const A = a.getNode();
|
|
6905
6905
|
l.style = "", A instanceof Pr && A.getChildrenSize() === 0 ? (l.format = A.getTextFormat(), l.style = A.getTextStyle()) : l.format = 0;
|
|
@@ -6909,7 +6909,7 @@ function po(r, e, t) {
|
|
|
6909
6909
|
let A = zu, w = !1;
|
|
6910
6910
|
for (let E = 0; E < h; E++) {
|
|
6911
6911
|
const v = f[E], b = v.getTextContentSize();
|
|
6912
|
-
if (
|
|
6912
|
+
if (q(v) && b !== 0 && !(E === 0 && v.__key === C && m === b || E === h - 1 && v.__key === x && y === 0) && (w = !0, A &= v.getFormat(), A === 0)) break;
|
|
6913
6913
|
}
|
|
6914
6914
|
l.format = w ? A : 0;
|
|
6915
6915
|
}
|
|
@@ -6927,7 +6927,7 @@ function Ps(r, e) {
|
|
|
6927
6927
|
if (We(null), t !== null && e != null) {
|
|
6928
6928
|
if (e === "") {
|
|
6929
6929
|
const n = Ve(t), s = Gn(r.getElementByKey(t));
|
|
6930
|
-
return void (s !== null && s.nodeValue !== null &&
|
|
6930
|
+
return void (s !== null && s.nodeValue !== null && q(n) && Ti(n, s.nodeValue, null, null, !0));
|
|
6931
6931
|
}
|
|
6932
6932
|
if (e[e.length - 1] === `
|
|
6933
6933
|
`) {
|
|
@@ -6967,16 +6967,16 @@ function mo(r) {
|
|
|
6967
6967
|
}
|
|
6968
6968
|
function yc(r) {
|
|
6969
6969
|
const e = r.ownerDocument, t = Zn.get(e);
|
|
6970
|
-
t === void 0 &&
|
|
6970
|
+
t === void 0 && z(162);
|
|
6971
6971
|
const n = t - 1;
|
|
6972
|
-
n >= 0 ||
|
|
6972
|
+
n >= 0 || z(164), Zn.set(e, n), n === 0 && e.removeEventListener("selectionchange", ea);
|
|
6973
6973
|
const s = cs(r);
|
|
6974
6974
|
Ei(s) ? (function(i) {
|
|
6975
6975
|
if (i._parentEditor !== null) {
|
|
6976
6976
|
const l = Si(i), a = l[l.length - 1]._key;
|
|
6977
6977
|
kr.get(a) === i && kr.delete(a);
|
|
6978
6978
|
} else kr.delete(i._key);
|
|
6979
|
-
}(s), r.__lexicalEditor = null) : s &&
|
|
6979
|
+
}(s), r.__lexicalEditor = null) : s && z(198);
|
|
6980
6980
|
const o = Zl(r);
|
|
6981
6981
|
for (let i = 0; i < o.length; i++) o[i]();
|
|
6982
6982
|
r.__lexicalEventHandles = [];
|
|
@@ -7000,14 +7000,14 @@ function si(r, e, t) {
|
|
|
7000
7000
|
const l = r.getIndexWithinParent();
|
|
7001
7001
|
lr(r), es(o, s, l, -1);
|
|
7002
7002
|
} else lr(r);
|
|
7003
|
-
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e &&
|
|
7003
|
+
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e && Ye(s) && s.isEmpty() && s.selectEnd();
|
|
7004
7004
|
}
|
|
7005
7005
|
class gs {
|
|
7006
7006
|
static getType() {
|
|
7007
|
-
|
|
7007
|
+
z(64, this.name);
|
|
7008
7008
|
}
|
|
7009
7009
|
static clone(e) {
|
|
7010
|
-
|
|
7010
|
+
z(65, this.name);
|
|
7011
7011
|
}
|
|
7012
7012
|
afterCloneFrom(e) {
|
|
7013
7013
|
this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev;
|
|
@@ -7019,7 +7019,7 @@ class gs {
|
|
|
7019
7019
|
return this.__type;
|
|
7020
7020
|
}
|
|
7021
7021
|
isInline() {
|
|
7022
|
-
|
|
7022
|
+
z(137, this.constructor.name);
|
|
7023
7023
|
}
|
|
7024
7024
|
isAttached() {
|
|
7025
7025
|
let e = this.__key;
|
|
@@ -7035,7 +7035,7 @@ class gs {
|
|
|
7035
7035
|
const t = e || V();
|
|
7036
7036
|
if (t == null) return !1;
|
|
7037
7037
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
7038
|
-
if (
|
|
7038
|
+
if (q(this)) return n;
|
|
7039
7039
|
if (O(t) && t.anchor.type === "element" && t.focus.type === "element") {
|
|
7040
7040
|
if (t.isCollapsed()) return !1;
|
|
7041
7041
|
const s = this.getParent();
|
|
@@ -7065,20 +7065,20 @@ class gs {
|
|
|
7065
7065
|
}
|
|
7066
7066
|
getParentOrThrow() {
|
|
7067
7067
|
const e = this.getParent();
|
|
7068
|
-
return e === null &&
|
|
7068
|
+
return e === null && z(66, this.__key), e;
|
|
7069
7069
|
}
|
|
7070
7070
|
getTopLevelElement() {
|
|
7071
7071
|
let e = this;
|
|
7072
7072
|
for (; e !== null; ) {
|
|
7073
7073
|
const t = e.getParent();
|
|
7074
|
-
if (Ft(t)) return N(e) || e === this && me(e) ||
|
|
7074
|
+
if (Ft(t)) return N(e) || e === this && me(e) || z(194), e;
|
|
7075
7075
|
e = t;
|
|
7076
7076
|
}
|
|
7077
7077
|
return null;
|
|
7078
7078
|
}
|
|
7079
7079
|
getTopLevelElementOrThrow() {
|
|
7080
7080
|
const e = this.getTopLevelElement();
|
|
7081
|
-
return e === null &&
|
|
7081
|
+
return e === null && z(67, this.__key), e;
|
|
7082
7082
|
}
|
|
7083
7083
|
getParents() {
|
|
7084
7084
|
const e = [];
|
|
@@ -7182,7 +7182,7 @@ class gs {
|
|
|
7182
7182
|
if (s.has(u.__key) || n.push(u), u === e) break;
|
|
7183
7183
|
let c = null, d = u;
|
|
7184
7184
|
do {
|
|
7185
|
-
if (d === null &&
|
|
7185
|
+
if (d === null && z(68), c = t ? d.getNextSibling() : d.getPreviousSibling(), d = d.getParent(), d === null) break;
|
|
7186
7186
|
c !== null || s.has(d.__key) || n.push(d);
|
|
7187
7187
|
} while (c === null);
|
|
7188
7188
|
o = c;
|
|
@@ -7195,7 +7195,7 @@ class gs {
|
|
|
7195
7195
|
}
|
|
7196
7196
|
getLatest() {
|
|
7197
7197
|
const e = Ve(this.__key);
|
|
7198
|
-
return e === null &&
|
|
7198
|
+
return e === null && z(113), e;
|
|
7199
7199
|
}
|
|
7200
7200
|
getWritable() {
|
|
7201
7201
|
et();
|
|
@@ -7211,19 +7211,19 @@ class gs {
|
|
|
7211
7211
|
return this.getTextContent().length;
|
|
7212
7212
|
}
|
|
7213
7213
|
createDOM(e, t) {
|
|
7214
|
-
|
|
7214
|
+
z(70);
|
|
7215
7215
|
}
|
|
7216
7216
|
updateDOM(e, t, n) {
|
|
7217
|
-
|
|
7217
|
+
z(71);
|
|
7218
7218
|
}
|
|
7219
7219
|
exportDOM(e) {
|
|
7220
7220
|
return { element: this.createDOM(e._config, e) };
|
|
7221
7221
|
}
|
|
7222
7222
|
exportJSON() {
|
|
7223
|
-
|
|
7223
|
+
z(72);
|
|
7224
7224
|
}
|
|
7225
7225
|
static importJSON(e) {
|
|
7226
|
-
|
|
7226
|
+
z(18, this.name);
|
|
7227
7227
|
}
|
|
7228
7228
|
static transform() {
|
|
7229
7229
|
return null;
|
|
@@ -7238,7 +7238,7 @@ class gs {
|
|
|
7238
7238
|
const s = this.getLatest(), o = this.__key, i = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), u = a.__size;
|
|
7239
7239
|
lr(l);
|
|
7240
7240
|
const c = s.getPreviousSibling(), d = s.getNextSibling(), f = s.__prev, h = s.__next, g = s.__parent;
|
|
7241
|
-
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) ||
|
|
7241
|
+
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) || z(139), this.getChildren().forEach((m) => {
|
|
7242
7242
|
l.append(m);
|
|
7243
7243
|
})), O(n)) {
|
|
7244
7244
|
Nt(n);
|
|
@@ -7293,7 +7293,7 @@ class gs {
|
|
|
7293
7293
|
const n = this.getPreviousSibling(), s = this.getParentOrThrow();
|
|
7294
7294
|
if (n === null) return s.select(0, 0);
|
|
7295
7295
|
if (N(n)) return n.select();
|
|
7296
|
-
if (!
|
|
7296
|
+
if (!q(n)) {
|
|
7297
7297
|
const o = n.getIndexWithinParent() + 1;
|
|
7298
7298
|
return s.select(o, o);
|
|
7299
7299
|
}
|
|
@@ -7304,7 +7304,7 @@ class gs {
|
|
|
7304
7304
|
const n = this.getNextSibling(), s = this.getParentOrThrow();
|
|
7305
7305
|
if (n === null) return s.select();
|
|
7306
7306
|
if (N(n)) return n.select(0, 0);
|
|
7307
|
-
if (!
|
|
7307
|
+
if (!q(n)) {
|
|
7308
7308
|
const o = n.getIndexWithinParent();
|
|
7309
7309
|
return s.select(o, o);
|
|
7310
7310
|
}
|
|
@@ -7497,12 +7497,12 @@ class Lr extends gs {
|
|
|
7497
7497
|
if ((l === null ? u : l) !== (a === null ? c : a)) return !0;
|
|
7498
7498
|
if (l === a && u !== c) {
|
|
7499
7499
|
const m = t.firstChild;
|
|
7500
|
-
m == null &&
|
|
7500
|
+
m == null && z(48);
|
|
7501
7501
|
const y = document.createElement(c);
|
|
7502
7502
|
return yo(y, this, 0, i, s, n), t.replaceChild(y, m), !1;
|
|
7503
7503
|
}
|
|
7504
7504
|
let d = t;
|
|
7505
|
-
a !== null && l !== null && (d = t.firstChild, d == null &&
|
|
7505
|
+
a !== null && l !== null && (d = t.firstChild, d == null && z(49)), ra(s, d, this);
|
|
7506
7506
|
const f = n.theme.text;
|
|
7507
7507
|
f !== void 0 && o !== i && ta(0, o, i, d, f);
|
|
7508
7508
|
const h = e.__style, g = this.__style;
|
|
@@ -7517,7 +7517,7 @@ class Lr extends gs {
|
|
|
7517
7517
|
}
|
|
7518
7518
|
exportDOM(e) {
|
|
7519
7519
|
let { element: t } = super.exportDOM(e);
|
|
7520
|
-
return t !== null && It(t) ||
|
|
7520
|
+
return t !== null && It(t) || z(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (t = Nn(t, "b")), this.hasFormat("italic") && (t = Nn(t, "i")), this.hasFormat("strikethrough") && (t = Nn(t, "s")), this.hasFormat("underline") && (t = Nn(t, "u")), { element: t };
|
|
7521
7521
|
}
|
|
7522
7522
|
exportJSON() {
|
|
7523
7523
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), type: "text", version: 1 };
|
|
@@ -7637,7 +7637,7 @@ class Lr extends gs {
|
|
|
7637
7637
|
}
|
|
7638
7638
|
mergeWithSibling(e) {
|
|
7639
7639
|
const t = e === this.getPreviousSibling();
|
|
7640
|
-
t || e === this.getNextSibling() ||
|
|
7640
|
+
t || e === this.getNextSibling() || z(50);
|
|
7641
7641
|
const n = this.__key, s = e.__key, o = this.__text, i = o.length;
|
|
7642
7642
|
Ht() === s && We(n);
|
|
7643
7643
|
const l = V();
|
|
@@ -7667,7 +7667,7 @@ function vc(r) {
|
|
|
7667
7667
|
}
|
|
7668
7668
|
function wc(r) {
|
|
7669
7669
|
const e = r;
|
|
7670
|
-
r.parentElement === null &&
|
|
7670
|
+
r.parentElement === null && z(129);
|
|
7671
7671
|
let t = e.textContent || "";
|
|
7672
7672
|
if (function(n) {
|
|
7673
7673
|
let s, o = n.parentNode;
|
|
@@ -7736,12 +7736,12 @@ function Gt(r) {
|
|
|
7736
7736
|
function Pe(r = "") {
|
|
7737
7737
|
return Lt(new Lr(r));
|
|
7738
7738
|
}
|
|
7739
|
-
function
|
|
7739
|
+
function q(r) {
|
|
7740
7740
|
return r instanceof Lr;
|
|
7741
7741
|
}
|
|
7742
7742
|
function Li(r, e) {
|
|
7743
7743
|
const t = r.fontWeight, n = r.textDecoration.split(" "), s = t === "700" || t === "bold", o = n.includes("line-through"), i = r.fontStyle === "italic", l = n.includes("underline"), a = r.verticalAlign;
|
|
7744
|
-
return (u) => (
|
|
7744
|
+
return (u) => (q(u) && (s && !u.hasFormat("bold") && u.toggleFormat("bold"), o && !u.hasFormat("strikethrough") && u.toggleFormat("strikethrough"), i && !u.hasFormat("italic") && u.toggleFormat("italic"), l && !u.hasFormat("underline") && u.toggleFormat("underline"), a !== "sub" || u.hasFormat("subscript") || u.toggleFormat("subscript"), a !== "super" || u.hasFormat("superscript") || u.toggleFormat("superscript"), e && !u.hasFormat(e) && u.toggleFormat(e)), u);
|
|
7745
7745
|
}
|
|
7746
7746
|
class _n extends Lr {
|
|
7747
7747
|
static getType() {
|
|
@@ -7767,13 +7767,13 @@ class _n extends Lr {
|
|
|
7767
7767
|
return { ...super.exportJSON(), type: "tab", version: 1 };
|
|
7768
7768
|
}
|
|
7769
7769
|
setTextContent(e) {
|
|
7770
|
-
|
|
7770
|
+
z(126);
|
|
7771
7771
|
}
|
|
7772
7772
|
setDetail(e) {
|
|
7773
|
-
|
|
7773
|
+
z(127);
|
|
7774
7774
|
}
|
|
7775
7775
|
setMode(e) {
|
|
7776
|
-
|
|
7776
|
+
z(128);
|
|
7777
7777
|
}
|
|
7778
7778
|
canInsertTextBefore() {
|
|
7779
7779
|
return !1;
|
|
@@ -7810,7 +7810,7 @@ class Ac {
|
|
|
7810
7810
|
}
|
|
7811
7811
|
getNode() {
|
|
7812
7812
|
const e = Ve(this.key);
|
|
7813
|
-
return e === null &&
|
|
7813
|
+
return e === null && z(20), e;
|
|
7814
7814
|
}
|
|
7815
7815
|
set(e, t, n) {
|
|
7816
7816
|
const s = this._selection, o = this.key;
|
|
@@ -7822,13 +7822,13 @@ function jt(r, e, t) {
|
|
|
7822
7822
|
}
|
|
7823
7823
|
function Ms(r, e) {
|
|
7824
7824
|
let t = e.__key, n = r.offset, s = "element";
|
|
7825
|
-
if (
|
|
7825
|
+
if (q(e)) {
|
|
7826
7826
|
s = "text";
|
|
7827
7827
|
const o = e.getTextContentSize();
|
|
7828
7828
|
n > o && (n = o);
|
|
7829
7829
|
} else if (!N(e)) {
|
|
7830
7830
|
const o = e.getNextSibling();
|
|
7831
|
-
if (
|
|
7831
|
+
if (q(o)) t = o.__key, n = 0, s = "text";
|
|
7832
7832
|
else {
|
|
7833
7833
|
const i = e.getParent();
|
|
7834
7834
|
i && (t = i.__key, n = e.getIndexWithinParent() + 1);
|
|
@@ -7839,7 +7839,7 @@ function Ms(r, e) {
|
|
|
7839
7839
|
function _o(r, e) {
|
|
7840
7840
|
if (N(e)) {
|
|
7841
7841
|
const t = e.getLastDescendant();
|
|
7842
|
-
N(t) ||
|
|
7842
|
+
N(t) || q(t) ? Ms(r, t) : Ms(r, e);
|
|
7843
7843
|
} else Ms(r, e);
|
|
7844
7844
|
}
|
|
7845
7845
|
function Kt(r, e, t, n) {
|
|
@@ -7894,7 +7894,7 @@ class ms {
|
|
|
7894
7894
|
insertNodes(e) {
|
|
7895
7895
|
const t = this.getNodes(), n = t.length, s = t[n - 1];
|
|
7896
7896
|
let o;
|
|
7897
|
-
if (
|
|
7897
|
+
if (q(s)) o = s.select();
|
|
7898
7898
|
else {
|
|
7899
7899
|
const i = s.getIndexWithinParent() + 1;
|
|
7900
7900
|
o = s.getParentOrThrow().select(i, i);
|
|
@@ -7967,7 +7967,7 @@ class er {
|
|
|
7967
7967
|
const f = e[d];
|
|
7968
7968
|
if (N(f) && !f.isInline()) c || (u += `
|
|
7969
7969
|
`), c = !f.isEmpty();
|
|
7970
|
-
else if (c = !1,
|
|
7970
|
+
else if (c = !1, q(f)) {
|
|
7971
7971
|
let h = f.getTextContent();
|
|
7972
7972
|
f === t ? f === n ? s.type === "element" && o.type === "element" && o.offset !== s.offset || (h = l < a ? h.slice(l, a) : h.slice(a, l)) : h = i ? h.slice(l) : h.slice(a) : f === n && (h = i ? h.slice(0, a) : h.slice(0, l)), u += h;
|
|
7973
7973
|
} else !me(f) && !ar(f) || f === n && this.isCollapsed() || (u += f.getTextContent());
|
|
@@ -8008,22 +8008,22 @@ class er {
|
|
|
8008
8008
|
const t = this.anchor, n = this.focus, s = this.format, o = this.style;
|
|
8009
8009
|
let i = t, l = n;
|
|
8010
8010
|
!this.isCollapsed() && n.isBefore(t) && (i = n, l = t), i.type === "element" && function(y, C, x, A) {
|
|
8011
|
-
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(), b =
|
|
8011
|
+
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(), b = Ye(w) ? Le().append(v) : v;
|
|
8012
8012
|
v.setFormat(x), v.setStyle(A), E === null ? w.append(b) : E.insertBefore(b), y.is(C) && C.set(v.__key, 0, "text"), y.set(v.__key, 0, "text");
|
|
8013
8013
|
}(i, l, s, o);
|
|
8014
8014
|
const a = i.offset;
|
|
8015
8015
|
let u = l.offset;
|
|
8016
8016
|
const c = this.getNodes(), d = c.length;
|
|
8017
8017
|
let f = c[0];
|
|
8018
|
-
|
|
8018
|
+
q(f) || z(26);
|
|
8019
8019
|
const h = f.getTextContent().length, g = f.getParentOrThrow();
|
|
8020
8020
|
let m = c[d - 1];
|
|
8021
8021
|
if (d === 1 && l.type === "element" && (u = h, l.set(i.key, u, "text")), this.isCollapsed() && a === h && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !g.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
8022
8022
|
let y = f.getNextSibling();
|
|
8023
|
-
if (
|
|
8023
|
+
if (q(y) && y.canInsertTextBefore() && !sr(y) || (y = Pe(), y.setFormat(s), y.setStyle(o), g.canInsertTextAfter() ? f.insertAfter(y) : g.insertAfter(y)), y.select(0, 0), f = y, e !== "") return void this.insertText(e);
|
|
8024
8024
|
} else if (this.isCollapsed() && a === 0 && (f.isSegmented() || f.isToken() || !f.canInsertTextBefore() || !g.canInsertTextBefore() && f.getPreviousSibling() === null)) {
|
|
8025
8025
|
let y = f.getPreviousSibling();
|
|
8026
|
-
if (
|
|
8026
|
+
if (q(y) && !sr(y) || (y = Pe(), y.setFormat(s), g.canInsertTextBefore() ? f.insertBefore(y) : g.insertBefore(y)), y.select(), f = y, e !== "") return void this.insertText(e);
|
|
8027
8027
|
} else if (f.isSegmented() && a !== h) {
|
|
8028
8028
|
const y = Pe(f.getTextContent());
|
|
8029
8029
|
y.setFormat(s), f.replace(y), f = y;
|
|
@@ -8062,12 +8062,12 @@ class er {
|
|
|
8062
8062
|
if (!C.is(x) && x.isInline()) do
|
|
8063
8063
|
A = x, x = x.getParentOrThrow();
|
|
8064
8064
|
while (x.isInline());
|
|
8065
|
-
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (
|
|
8065
|
+
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (q(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
8066
8066
|
if (m.isSegmented()) {
|
|
8067
8067
|
const D = Pe(m.getTextContent());
|
|
8068
8068
|
m.replace(D), m = D;
|
|
8069
8069
|
}
|
|
8070
|
-
|
|
8070
|
+
Ye(l.getNode()) || l.type !== "text" || (m = m.spliceText(0, u, "")), y.add(m.__key);
|
|
8071
8071
|
} else {
|
|
8072
8072
|
const D = m.getParentOrThrow();
|
|
8073
8073
|
D.canBeEmpty() || D.getChildrenSize() !== 1 ? m.remove() : D.remove();
|
|
@@ -8103,7 +8103,7 @@ class er {
|
|
|
8103
8103
|
const { anchor: e, focus: t } = this, n = this.getNodes(), s = this.isBackward() ? t : e, o = this.isBackward() ? e : t;
|
|
8104
8104
|
let i = s.getNode(), l = o.getNode();
|
|
8105
8105
|
const a = Wr(i, Vt), u = Wr(l, Vt);
|
|
8106
|
-
|
|
8106
|
+
q(i) && i.isToken() && s.offset < i.getTextContentSize() && (s.offset = 0), o.offset > 0 && q(l) && l.isToken() && (o.offset = l.getTextContentSize()), n.forEach((d) => {
|
|
8107
8107
|
tn(i, d) || tn(l, d) || d.getKey() === i.getKey() || d.getKey() === l.getKey() || d.remove();
|
|
8108
8108
|
});
|
|
8109
8109
|
const c = (d, f) => {
|
|
@@ -8113,20 +8113,20 @@ class er {
|
|
|
8113
8113
|
return h.setFormat(d.getFormat()), h.setStyle(d.getStyle()), d.replace(h);
|
|
8114
8114
|
}
|
|
8115
8115
|
};
|
|
8116
|
-
if (i === l &&
|
|
8116
|
+
if (i === l && q(i)) {
|
|
8117
8117
|
const d = Math.abs(t.offset - e.offset);
|
|
8118
8118
|
return i.spliceText(s.offset, d, "", !0), void c(i, d);
|
|
8119
8119
|
}
|
|
8120
|
-
if (
|
|
8120
|
+
if (q(i)) {
|
|
8121
8121
|
const d = i.getTextContentSize() - s.offset;
|
|
8122
8122
|
i.spliceText(s.offset, d, ""), i = c(i, d) || i;
|
|
8123
8123
|
}
|
|
8124
|
-
|
|
8124
|
+
q(l) && (l.spliceText(0, o.offset, ""), l = c(l, o.offset) || l), i.isAttached() && q(i) ? i.selectEnd() : l.isAttached() && q(l) && l.selectStart(), N(a) && N(u) && a !== u && (a.append(...u.getChildren()), u.remove(), o.set(s.key, s.offset, s.type));
|
|
8125
8125
|
}
|
|
8126
8126
|
formatText(e, t = null) {
|
|
8127
8127
|
if (this.isCollapsed()) return this.toggleFormat(e), void We(null);
|
|
8128
8128
|
const n = this.getNodes(), s = [];
|
|
8129
|
-
for (const w of n)
|
|
8129
|
+
for (const w of n) q(w) && s.push(w);
|
|
8130
8130
|
const o = (w) => {
|
|
8131
8131
|
n.forEach((E) => {
|
|
8132
8132
|
if (Fr(E)) {
|
|
@@ -8167,7 +8167,7 @@ class er {
|
|
|
8167
8167
|
if (this.anchor.key === "root") {
|
|
8168
8168
|
this.insertParagraph();
|
|
8169
8169
|
const g = V();
|
|
8170
|
-
return O(g) ||
|
|
8170
|
+
return O(g) || z(134), g.insertNodes(e);
|
|
8171
8171
|
}
|
|
8172
8172
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = Wr(t, Vt), s = e[e.length - 1];
|
|
8173
8173
|
if (N(n) && "__language" in n) {
|
|
@@ -8179,7 +8179,7 @@ class er {
|
|
|
8179
8179
|
return;
|
|
8180
8180
|
}
|
|
8181
8181
|
if (!e.some((g) => (N(g) || me(g)) && !g.isInline())) {
|
|
8182
|
-
N(n) ||
|
|
8182
|
+
N(n) || z(211, t.constructor.name, t.getType());
|
|
8183
8183
|
const g = Is(this);
|
|
8184
8184
|
return n.splice(g, 0, e), void s.selectEnd();
|
|
8185
8185
|
}
|
|
@@ -8188,7 +8188,7 @@ class er {
|
|
|
8188
8188
|
let y = null;
|
|
8189
8189
|
for (let C = 0; C < g.length; C++) {
|
|
8190
8190
|
const x = g[C], A = ar(x);
|
|
8191
|
-
if (A || me(x) && x.isInline() || N(x) && x.isInline() ||
|
|
8191
|
+
if (A || me(x) && x.isInline() || N(x) && x.isInline() || q(x) || x.isParentRequired()) {
|
|
8192
8192
|
if (y === null && (y = x.createParentElementNode(), m.append(y), A)) continue;
|
|
8193
8193
|
y !== null && y.append(x);
|
|
8194
8194
|
} else m.append(x), y = null;
|
|
@@ -8197,11 +8197,11 @@ class er {
|
|
|
8197
8197
|
}(e), i = o.getLastDescendant(), l = o.getChildren(), a = !N(n) || !n.isEmpty() ? this.insertParagraph() : null, u = l[l.length - 1];
|
|
8198
8198
|
let c = l[0];
|
|
8199
8199
|
var d;
|
|
8200
|
-
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) ||
|
|
8200
|
+
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) || z(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = l[1]), c && (n === null && z(212, t.constructor.name, t.getType()), function(g, m, y) {
|
|
8201
8201
|
const C = m.getParentOrThrow().getLastChild();
|
|
8202
8202
|
let x = m;
|
|
8203
8203
|
const A = [m];
|
|
8204
|
-
for (; x !== C; ) x.getNextSibling() ||
|
|
8204
|
+
for (; x !== C; ) x.getNextSibling() || z(140), x = x.getNextSibling(), A.push(x);
|
|
8205
8205
|
let w = g;
|
|
8206
8206
|
for (const E of A) w = w.insertAfter(E);
|
|
8207
8207
|
}(n, c));
|
|
@@ -8216,7 +8216,7 @@ class er {
|
|
|
8216
8216
|
return Ee().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8217
8217
|
}
|
|
8218
8218
|
const e = Is(this), t = Wr(this.anchor.getNode(), Vt);
|
|
8219
|
-
N(t) ||
|
|
8219
|
+
N(t) || z(213);
|
|
8220
8220
|
const n = t.getChildAtIndex(e), s = n ? [n, ...n.getNextSiblings()] : [], o = t.insertNewAfter(this, !1);
|
|
8221
8221
|
return o ? (o.append(...s), o.selectStart(), o) : null;
|
|
8222
8222
|
}
|
|
@@ -8233,18 +8233,18 @@ class er {
|
|
|
8233
8233
|
const [a, u] = ii(this);
|
|
8234
8234
|
if (t === 0) return [];
|
|
8235
8235
|
if (t === 1) {
|
|
8236
|
-
if (
|
|
8236
|
+
if (q(i) && !this.isCollapsed()) {
|
|
8237
8237
|
const d = a > u ? u : a, f = a > u ? a : u, h = i.splitText(d, f), g = d === 0 ? h[0] : h[1];
|
|
8238
8238
|
return g != null ? [g] : [];
|
|
8239
8239
|
}
|
|
8240
8240
|
return [i];
|
|
8241
8241
|
}
|
|
8242
8242
|
const c = s.isBefore(o);
|
|
8243
|
-
if (
|
|
8243
|
+
if (q(i)) {
|
|
8244
8244
|
const d = c ? a : u;
|
|
8245
8245
|
d === i.getTextContentSize() ? e.shift() : d !== 0 && ([, i] = i.splitText(d), e[0] = i);
|
|
8246
8246
|
}
|
|
8247
|
-
if (
|
|
8247
|
+
if (q(l)) {
|
|
8248
8248
|
const d = l.getTextContent().length, f = c ? u : a;
|
|
8249
8249
|
f === 0 ? e.pop() : f !== d && ([l] = l.splitText(f), e[n] = l);
|
|
8250
8250
|
}
|
|
@@ -8258,7 +8258,7 @@ class er {
|
|
|
8258
8258
|
return h.add(l.__key), void Nt(h);
|
|
8259
8259
|
}
|
|
8260
8260
|
const f = t ? l.getPreviousSibling() : l.getNextSibling();
|
|
8261
|
-
if (
|
|
8261
|
+
if (q(f)) {
|
|
8262
8262
|
const h = f.__key, g = t ? f.getTextContent().length : 0;
|
|
8263
8263
|
return s.set(h, g, "text"), void (i && o.set(h, g, "text"));
|
|
8264
8264
|
}
|
|
@@ -8274,7 +8274,7 @@ class er {
|
|
|
8274
8274
|
if (d === null || c === null || !N(l) || l.isInline() || l.canBeEmpty() || Ni(c, a, d), function(f, h, g, m) {
|
|
8275
8275
|
f.modify(h, g, m);
|
|
8276
8276
|
}(u, e, t ? "backward" : "forward", n), u.rangeCount > 0) {
|
|
8277
|
-
const f = u.getRangeAt(0), h = this.anchor.getNode(), g =
|
|
8277
|
+
const f = u.getRangeAt(0), h = this.anchor.getNode(), g = Ye(h) ? h : lc(h);
|
|
8278
8278
|
if (this.applyDOMRange(f), this.dirty = !0, !i) {
|
|
8279
8279
|
const m = this.getNodes(), y = [];
|
|
8280
8280
|
let C = !1;
|
|
@@ -8343,7 +8343,7 @@ class er {
|
|
|
8343
8343
|
}
|
|
8344
8344
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
8345
8345
|
const n = this.anchor.getNode();
|
|
8346
|
-
n.isEmpty() &&
|
|
8346
|
+
n.isEmpty() && Ye(n.getParent()) && n.getIndexWithinParent() === 0 && n.collapseAtStart(this);
|
|
8347
8347
|
}
|
|
8348
8348
|
}
|
|
8349
8349
|
deleteLine(e) {
|
|
@@ -8411,13 +8411,13 @@ function Co(r, e, t, n) {
|
|
|
8411
8411
|
const f = u.parentNode;
|
|
8412
8412
|
r === f && e > Array.prototype.indexOf.call(f.children, u) && o--;
|
|
8413
8413
|
}
|
|
8414
|
-
if (s = Dr(c),
|
|
8414
|
+
if (s = Dr(c), q(s)) o = no(s, i);
|
|
8415
8415
|
else {
|
|
8416
8416
|
let f = Dr(r);
|
|
8417
8417
|
if (f === null) return null;
|
|
8418
8418
|
if (N(f)) {
|
|
8419
8419
|
const h = n.getElementByKey(f.getKey());
|
|
8420
|
-
h === null &&
|
|
8420
|
+
h === null && z(214), [f, o] = f.getDOMSlot(h).resolveChildIndex(f, h, r, e), N(f) || z(215), i && o >= f.getChildrenSize() && (o = Math.max(0, f.getChildrenSize() - 1));
|
|
8421
8421
|
let m = f.getChildAtIndex(o);
|
|
8422
8422
|
if (N(m) && function(y, C, x) {
|
|
8423
8423
|
const A = y.getParent();
|
|
@@ -8426,7 +8426,7 @@ function Co(r, e, t, n) {
|
|
|
8426
8426
|
const y = i ? m.getLastDescendant() : m.getFirstDescendant();
|
|
8427
8427
|
y === null ? f = m : (m = y, f = N(m) ? m : m.getParentOrThrow()), o = 0;
|
|
8428
8428
|
}
|
|
8429
|
-
|
|
8429
|
+
q(m) ? (s = m, f = null, o = no(m, i)) : m !== f && i && !d && (N(f) || z(216), o = Math.min(f.getChildrenSize(), o + 1));
|
|
8430
8430
|
} else {
|
|
8431
8431
|
const h = f.getIndexWithinParent();
|
|
8432
8432
|
o = e === 0 && me(f) && Dr(r) === f ? h : h + 1, f = f.getParentOrThrow();
|
|
@@ -8434,7 +8434,7 @@ function Co(r, e, t, n) {
|
|
|
8434
8434
|
if (N(f)) return jt(f.__key, o, "element");
|
|
8435
8435
|
}
|
|
8436
8436
|
} else s = Dr(r);
|
|
8437
|
-
return
|
|
8437
|
+
return q(s) ? jt(s.__key, o, "text") : null;
|
|
8438
8438
|
}
|
|
8439
8439
|
function Do(r, e, t) {
|
|
8440
8440
|
const n = r.offset, s = r.getNode();
|
|
@@ -8443,15 +8443,15 @@ function Do(r, e, t) {
|
|
|
8443
8443
|
if (e) {
|
|
8444
8444
|
if ((t || !e) && o === null && N(i) && i.isInline()) {
|
|
8445
8445
|
const l = i.getPreviousSibling();
|
|
8446
|
-
|
|
8446
|
+
q(l) && (r.key = l.__key, r.offset = l.getTextContent().length);
|
|
8447
8447
|
}
|
|
8448
|
-
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") :
|
|
8448
|
+
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") : q(o) && (r.key = o.__key, r.offset = o.getTextContent().length);
|
|
8449
8449
|
} else if (n === s.getTextContent().length) {
|
|
8450
8450
|
const o = s.getNextSibling(), i = s.getParent();
|
|
8451
8451
|
if (e && N(o) && o.isInline()) r.key = o.__key, r.offset = 0, r.type = "element";
|
|
8452
8452
|
else if ((t || e) && o === null && N(i) && i.isInline() && !i.canInsertTextAfter()) {
|
|
8453
8453
|
const l = i.getNextSibling();
|
|
8454
|
-
|
|
8454
|
+
q(l) && (r.key = l.__key, r.offset = 0);
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
8457
8457
|
}
|
|
@@ -8539,21 +8539,21 @@ function Eo(r) {
|
|
|
8539
8539
|
if (r.isCollapsed()) {
|
|
8540
8540
|
if (!N(o)) return;
|
|
8541
8541
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8542
|
-
if (
|
|
8542
|
+
if (q(u)) {
|
|
8543
8543
|
let c = 0;
|
|
8544
8544
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text"), n.set(u.__key, c, "text");
|
|
8545
8545
|
}
|
|
8546
8546
|
} else {
|
|
8547
8547
|
if (N(o)) {
|
|
8548
8548
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8549
|
-
if (
|
|
8549
|
+
if (q(u)) {
|
|
8550
8550
|
let c = 0;
|
|
8551
8551
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text");
|
|
8552
8552
|
}
|
|
8553
8553
|
}
|
|
8554
8554
|
if (N(i)) {
|
|
8555
8555
|
const l = i.getChildrenSize(), a = s >= l, u = a ? i.getChildAtIndex(l - 1) : i.getChildAtIndex(s);
|
|
8556
|
-
if (
|
|
8556
|
+
if (q(u)) {
|
|
8557
8557
|
let c = 0;
|
|
8558
8558
|
a && (c = u.getTextContentSize()), n.set(u.__key, c, "text");
|
|
8559
8559
|
}
|
|
@@ -8562,7 +8562,7 @@ function Eo(r) {
|
|
|
8562
8562
|
}
|
|
8563
8563
|
function ts(r, e, t, n, s) {
|
|
8564
8564
|
let o = null, i = 0, l = null;
|
|
8565
|
-
n !== null ? (o = n.__key,
|
|
8565
|
+
n !== null ? (o = n.__key, q(n) ? (i = n.getTextContentSize(), l = "text") : N(n) && (i = n.getChildrenSize(), l = "element")) : s !== null && (o = s.__key, q(s) ? l = "text" : N(s) && (l = "element")), o !== null && l !== null ? r.set(o, i, l) : (i = e.getIndexWithinParent(), i === -1 && (i = t.getChildrenSize()), r.set(t.__key, i, "element"));
|
|
8566
8566
|
}
|
|
8567
8567
|
function So(r, e, t, n, s) {
|
|
8568
8568
|
r.type === "text" ? (r.key = t, e || (r.offset += s)) : r.offset > n.getIndexWithinParent() && (r.offset -= 1);
|
|
@@ -8628,7 +8628,7 @@ function Is(r) {
|
|
|
8628
8628
|
let e = r;
|
|
8629
8629
|
r.isCollapsed() || e.removeText();
|
|
8630
8630
|
const t = V();
|
|
8631
|
-
O(t) && (e = t), O(e) ||
|
|
8631
|
+
O(t) && (e = t), O(e) || z(161);
|
|
8632
8632
|
const n = e.anchor;
|
|
8633
8633
|
let s = n.getNode(), o = n.offset;
|
|
8634
8634
|
for (; !Vt(s); ) [s, o] = kc(s, o);
|
|
@@ -8640,7 +8640,7 @@ function kc(r, e) {
|
|
|
8640
8640
|
const s = Le();
|
|
8641
8641
|
return Ee().append(s), s.select(), [Ee(), 0];
|
|
8642
8642
|
}
|
|
8643
|
-
if (
|
|
8643
|
+
if (q(r)) {
|
|
8644
8644
|
const s = r.splitText(e);
|
|
8645
8645
|
if (s.length === 0) return [t, r.getIndexWithinParent()];
|
|
8646
8646
|
const o = e === 0 ? 0 : 1;
|
|
@@ -8660,16 +8660,16 @@ function Cn() {
|
|
|
8660
8660
|
return tt || Ie !== null && Ie._readOnly;
|
|
8661
8661
|
}
|
|
8662
8662
|
function et() {
|
|
8663
|
-
tt &&
|
|
8663
|
+
tt && z(13);
|
|
8664
8664
|
}
|
|
8665
8665
|
function la() {
|
|
8666
|
-
On > 99 &&
|
|
8666
|
+
On > 99 && z(14);
|
|
8667
8667
|
}
|
|
8668
8668
|
function $t() {
|
|
8669
|
-
return Ie === null &&
|
|
8669
|
+
return Ie === null && z(195, aa()), Ie;
|
|
8670
8670
|
}
|
|
8671
8671
|
function Be() {
|
|
8672
|
-
return $e === null &&
|
|
8672
|
+
return $e === null && z(196, aa()), $e;
|
|
8673
8673
|
}
|
|
8674
8674
|
function aa() {
|
|
8675
8675
|
let r = 0;
|
|
@@ -8691,7 +8691,7 @@ function Tc() {
|
|
|
8691
8691
|
function To(r, e, t) {
|
|
8692
8692
|
const n = e.__type, s = function(l, a) {
|
|
8693
8693
|
const u = l._nodes.get(a);
|
|
8694
|
-
return u === void 0 &&
|
|
8694
|
+
return u === void 0 && z(30, a), u;
|
|
8695
8695
|
}(r, n);
|
|
8696
8696
|
let o = t.get(n);
|
|
8697
8697
|
o === void 0 && (o = Array.from(s.transforms), t.set(n, o));
|
|
@@ -8713,9 +8713,9 @@ function Bc(r) {
|
|
|
8713
8713
|
}
|
|
8714
8714
|
function Ri(r, e) {
|
|
8715
8715
|
const t = r.type, n = e.get(t);
|
|
8716
|
-
n === void 0 &&
|
|
8716
|
+
n === void 0 && z(17, t);
|
|
8717
8717
|
const s = n.klass;
|
|
8718
|
-
r.type !== s.getType() &&
|
|
8718
|
+
r.type !== s.getType() && z(18, s.name);
|
|
8719
8719
|
const o = s.importJSON(r), i = r.children;
|
|
8720
8720
|
if (N(o) && Array.isArray(i)) for (let l = 0; l < i.length; l++) {
|
|
8721
8721
|
const a = Ri(i[l], e);
|
|
@@ -8844,7 +8844,7 @@ function Fo(r, e) {
|
|
|
8844
8844
|
if (i !== void 0) {
|
|
8845
8845
|
if (l = i.onUpdate, i.skipTransforms && (n = !0), i.discrete) {
|
|
8846
8846
|
const a = r._pendingEditorState;
|
|
8847
|
-
a === null &&
|
|
8847
|
+
a === null && z(191), a._flushSync = !0;
|
|
8848
8848
|
}
|
|
8849
8849
|
l && r._deferred.push(l), ua(r, i.tag);
|
|
8850
8850
|
}
|
|
@@ -8882,7 +8882,7 @@ function da(r, e, t) {
|
|
|
8882
8882
|
const A = x._dirtyLeaves, w = C._nodeMap;
|
|
8883
8883
|
for (const E of A) {
|
|
8884
8884
|
const v = w.get(E);
|
|
8885
|
-
|
|
8885
|
+
q(v) && v.isAttached() && v.isSimpleText() && !v.isUnmergeable() && eo(v);
|
|
8886
8886
|
}
|
|
8887
8887
|
}(a, r) : function(C, x) {
|
|
8888
8888
|
const A = x._dirtyLeaves, w = x._dirtyElements, E = C._nodeMap, v = Ht(), b = /* @__PURE__ */ new Map();
|
|
@@ -8892,7 +8892,7 @@ function da(r, e, t) {
|
|
|
8892
8892
|
x._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
8893
8893
|
for (const F of D) {
|
|
8894
8894
|
const L = E.get(F);
|
|
8895
|
-
|
|
8895
|
+
q(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && eo(L), L !== void 0 && Bo(L, v) && To(x, L, b), A.add(F);
|
|
8896
8896
|
}
|
|
8897
8897
|
if (D = x._dirtyLeaves, k = D.size, k > 0) {
|
|
8898
8898
|
On++;
|
|
@@ -8924,7 +8924,7 @@ function da(r, e, t) {
|
|
|
8924
8924
|
const y = a._selection;
|
|
8925
8925
|
if (O(y)) {
|
|
8926
8926
|
const C = a._nodeMap, x = y.anchor.key, A = y.focus.key;
|
|
8927
|
-
C.get(x) !== void 0 && C.get(A) !== void 0 ||
|
|
8927
|
+
C.get(x) !== void 0 && C.get(A) !== void 0 || z(19);
|
|
8928
8928
|
} else kt(y) && y._nodes.size === 0 && (a._selection = null);
|
|
8929
8929
|
} catch (m) {
|
|
8930
8930
|
return m instanceof Error && r._onError(m), r._pendingEditorState = l, r._dirtyType = Br, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void Jt(r);
|
|
@@ -8959,13 +8959,13 @@ class on {
|
|
|
8959
8959
|
}
|
|
8960
8960
|
insertChild(e) {
|
|
8961
8961
|
const t = this.before || this.getManagedLineBreak();
|
|
8962
|
-
return t !== null && t.parentElement !== this.element &&
|
|
8962
|
+
return t !== null && t.parentElement !== this.element && z(222), this.element.insertBefore(e, t), this;
|
|
8963
8963
|
}
|
|
8964
8964
|
removeChild(e) {
|
|
8965
|
-
return e.parentElement !== this.element &&
|
|
8965
|
+
return e.parentElement !== this.element && z(223), this.element.removeChild(e), this;
|
|
8966
8966
|
}
|
|
8967
8967
|
replaceChild(e, t) {
|
|
8968
|
-
return t.parentElement !== this.element &&
|
|
8968
|
+
return t.parentElement !== this.element && z(224), this.element.replaceChild(e, t), this;
|
|
8969
8969
|
}
|
|
8970
8970
|
getFirstChild() {
|
|
8971
8971
|
const e = this.after ? this.after.nextSibling : this.element.firstChild;
|
|
@@ -9033,7 +9033,7 @@ function jo(r, e) {
|
|
|
9033
9033
|
for (let o = n.previousSibling; o !== null; o = n.previousSibling) s++;
|
|
9034
9034
|
t.push(s);
|
|
9035
9035
|
}
|
|
9036
|
-
return n !== r &&
|
|
9036
|
+
return n !== r && z(225), t.reverse();
|
|
9037
9037
|
}
|
|
9038
9038
|
class zt extends gs {
|
|
9039
9039
|
constructor(e) {
|
|
@@ -9085,7 +9085,7 @@ class zt extends gs {
|
|
|
9085
9085
|
const e = [];
|
|
9086
9086
|
let t = this.getFirstChild();
|
|
9087
9087
|
for (; t !== null; ) {
|
|
9088
|
-
if (
|
|
9088
|
+
if (q(t) && e.push(t), N(t)) {
|
|
9089
9089
|
const n = t.getAllTextNodes();
|
|
9090
9090
|
e.push(...n);
|
|
9091
9091
|
}
|
|
@@ -9126,7 +9126,7 @@ class zt extends gs {
|
|
|
9126
9126
|
}
|
|
9127
9127
|
getFirstChildOrThrow() {
|
|
9128
9128
|
const e = this.getFirstChild();
|
|
9129
|
-
return e === null &&
|
|
9129
|
+
return e === null && z(45, this.__key), e;
|
|
9130
9130
|
}
|
|
9131
9131
|
getLastChild() {
|
|
9132
9132
|
const e = this.getLatest().__last;
|
|
@@ -9134,7 +9134,7 @@ class zt extends gs {
|
|
|
9134
9134
|
}
|
|
9135
9135
|
getLastChildOrThrow() {
|
|
9136
9136
|
const e = this.getLastChild();
|
|
9137
|
-
return e === null &&
|
|
9137
|
+
return e === null && z(96, this.__key), e;
|
|
9138
9138
|
}
|
|
9139
9139
|
getChildAtIndex(e) {
|
|
9140
9140
|
const t = this.getChildrenSize();
|
|
@@ -9188,10 +9188,10 @@ class zt extends gs {
|
|
|
9188
9188
|
if (!this.canBeEmpty()) {
|
|
9189
9189
|
if (e === 0 && t === 0) {
|
|
9190
9190
|
const a = this.getFirstChild();
|
|
9191
|
-
if (
|
|
9191
|
+
if (q(a) || N(a)) return a.select(0, 0);
|
|
9192
9192
|
} else if (!(e !== void 0 && e !== i || t !== void 0 && t !== i)) {
|
|
9193
9193
|
const a = this.getLastChild();
|
|
9194
|
-
if (
|
|
9194
|
+
if (q(a) || N(a)) return a.select();
|
|
9195
9195
|
}
|
|
9196
9196
|
}
|
|
9197
9197
|
s === void 0 && (s = i), o === void 0 && (o = i);
|
|
@@ -9228,7 +9228,7 @@ class zt extends gs {
|
|
|
9228
9228
|
}
|
|
9229
9229
|
splice(e, t, n) {
|
|
9230
9230
|
const s = n.length, o = this.getChildrenSize(), i = this.getWritable();
|
|
9231
|
-
e + t <= o ||
|
|
9231
|
+
e + t <= o || z(226, String(e), String(t), String(o));
|
|
9232
9232
|
const l = i.__key, a = [], u = [], c = this.getChildAtIndex(e + t);
|
|
9233
9233
|
let d = null, f = o - t + s;
|
|
9234
9234
|
if (e !== 0) if (e === o) d = this.getLastChild();
|
|
@@ -9239,7 +9239,7 @@ class zt extends gs {
|
|
|
9239
9239
|
if (t > 0) {
|
|
9240
9240
|
let g = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
9241
9241
|
for (let m = 0; m < t; m++) {
|
|
9242
|
-
g === null &&
|
|
9242
|
+
g === null && z(100);
|
|
9243
9243
|
const y = g.getNextSibling(), C = g.__key;
|
|
9244
9244
|
lr(g.getWritable()), u.push(C), g = y;
|
|
9245
9245
|
}
|
|
@@ -9256,7 +9256,7 @@ class zt extends gs {
|
|
|
9256
9256
|
const x = h.getWritable();
|
|
9257
9257
|
x.__next = C, y.__prev = x.__key;
|
|
9258
9258
|
}
|
|
9259
|
-
m.__key === l &&
|
|
9259
|
+
m.__key === l && z(76), y.__parent = l, a.push(C), h = m;
|
|
9260
9260
|
}
|
|
9261
9261
|
if (e + t === o)
|
|
9262
9262
|
h !== null && (h.getWritable().__next = null, i.__last = h.__key);
|
|
@@ -9358,7 +9358,7 @@ class Nc extends gs {
|
|
|
9358
9358
|
super(e);
|
|
9359
9359
|
}
|
|
9360
9360
|
decorate(e, t) {
|
|
9361
|
-
|
|
9361
|
+
z(47);
|
|
9362
9362
|
}
|
|
9363
9363
|
isIsolated() {
|
|
9364
9364
|
return !1;
|
|
@@ -9384,23 +9384,23 @@ class Dn extends zt {
|
|
|
9384
9384
|
super("root"), this.__cachedText = null;
|
|
9385
9385
|
}
|
|
9386
9386
|
getTopLevelElementOrThrow() {
|
|
9387
|
-
|
|
9387
|
+
z(51);
|
|
9388
9388
|
}
|
|
9389
9389
|
getTextContent() {
|
|
9390
9390
|
const e = this.__cachedText;
|
|
9391
9391
|
return !Cn() && Be()._dirtyType !== ur || e === null ? super.getTextContent() : e;
|
|
9392
9392
|
}
|
|
9393
9393
|
remove() {
|
|
9394
|
-
|
|
9394
|
+
z(52);
|
|
9395
9395
|
}
|
|
9396
9396
|
replace(e) {
|
|
9397
|
-
|
|
9397
|
+
z(53);
|
|
9398
9398
|
}
|
|
9399
9399
|
insertBefore(e) {
|
|
9400
|
-
|
|
9400
|
+
z(54);
|
|
9401
9401
|
}
|
|
9402
9402
|
insertAfter(e) {
|
|
9403
|
-
|
|
9403
|
+
z(55);
|
|
9404
9404
|
}
|
|
9405
9405
|
updateDOM(e, t) {
|
|
9406
9406
|
return !1;
|
|
@@ -9408,7 +9408,7 @@ class Dn extends zt {
|
|
|
9408
9408
|
append(...e) {
|
|
9409
9409
|
for (let t = 0; t < e.length; t++) {
|
|
9410
9410
|
const n = e[t];
|
|
9411
|
-
N(n) || me(n) ||
|
|
9411
|
+
N(n) || me(n) || z(56);
|
|
9412
9412
|
}
|
|
9413
9413
|
return super.append(...e);
|
|
9414
9414
|
}
|
|
@@ -9423,7 +9423,7 @@ class Dn extends zt {
|
|
|
9423
9423
|
return !0;
|
|
9424
9424
|
}
|
|
9425
9425
|
}
|
|
9426
|
-
function
|
|
9426
|
+
function Ye(r) {
|
|
9427
9427
|
return r instanceof Dn;
|
|
9428
9428
|
}
|
|
9429
9429
|
function fa(r) {
|
|
@@ -9434,9 +9434,9 @@ function Oi() {
|
|
|
9434
9434
|
}
|
|
9435
9435
|
function ha(r) {
|
|
9436
9436
|
const e = r.exportJSON(), t = r.constructor;
|
|
9437
|
-
if (e.type !== t.getType() &&
|
|
9437
|
+
if (e.type !== t.getType() && z(130, t.name), N(r)) {
|
|
9438
9438
|
const n = e.children;
|
|
9439
|
-
Array.isArray(n) ||
|
|
9439
|
+
Array.isArray(n) || z(59, t.name);
|
|
9440
9440
|
const s = r.getChildren();
|
|
9441
9441
|
for (let o = 0; o < s.length; o++) {
|
|
9442
9442
|
const i = ha(s[o]);
|
|
@@ -9541,7 +9541,7 @@ class Pr extends zt {
|
|
|
9541
9541
|
}
|
|
9542
9542
|
collapseAtStart() {
|
|
9543
9543
|
const e = this.getChildren();
|
|
9544
|
-
if (e.length === 0 ||
|
|
9544
|
+
if (e.length === 0 || q(e[0]) && e[0].getTextContent().trim() === "") {
|
|
9545
9545
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
9546
9546
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
9547
9547
|
}
|
|
@@ -9636,11 +9636,11 @@ class xs {
|
|
|
9636
9636
|
};
|
|
9637
9637
|
}
|
|
9638
9638
|
registerCommand(e, t, n) {
|
|
9639
|
-
n === void 0 &&
|
|
9639
|
+
n === void 0 && z(35);
|
|
9640
9640
|
const s = this._commands;
|
|
9641
9641
|
s.has(e) || s.set(e, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
|
|
9642
9642
|
const o = s.get(e);
|
|
9643
|
-
o === void 0 &&
|
|
9643
|
+
o === void 0 && z(36, String(e));
|
|
9644
9644
|
const i = o[n];
|
|
9645
9645
|
return i.add(t), () => {
|
|
9646
9646
|
i.delete(t), o.every((l) => l.size === 0) && s.delete(e);
|
|
@@ -9656,7 +9656,7 @@ class xs {
|
|
|
9656
9656
|
}
|
|
9657
9657
|
getRegisteredNode(e) {
|
|
9658
9658
|
const t = this._nodes.get(e.getType());
|
|
9659
|
-
return t === void 0 &&
|
|
9659
|
+
return t === void 0 && z(37, e.name), t;
|
|
9660
9660
|
}
|
|
9661
9661
|
resolveRegisteredNodeAfterReplacements(e) {
|
|
9662
9662
|
for (; e.replaceWithKlass; ) e = this.getRegisteredNode(e.replaceWithKlass);
|
|
@@ -9765,7 +9765,7 @@ class xs {
|
|
|
9765
9765
|
return this._editorState;
|
|
9766
9766
|
}
|
|
9767
9767
|
setEditorState(e, t) {
|
|
9768
|
-
e.isEmpty() &&
|
|
9768
|
+
e.isEmpty() && z(38);
|
|
9769
9769
|
let n = e;
|
|
9770
9770
|
n._readOnly && (n = fa(e), n._selection = e._selection ? e._selection.clone() : null), Tl(this);
|
|
9771
9771
|
const s = this._pendingEditorState, o = this._updateTags, i = t !== void 0 ? t.tag : null;
|
|
@@ -9890,7 +9890,7 @@ function qc(r) {
|
|
|
9890
9890
|
const o = s.getChildren(), i = o.length;
|
|
9891
9891
|
for (let l = 0; l < i; l++) {
|
|
9892
9892
|
const a = o[n];
|
|
9893
|
-
if (!
|
|
9893
|
+
if (!q(a)) return !1;
|
|
9894
9894
|
}
|
|
9895
9895
|
}
|
|
9896
9896
|
}
|
|
@@ -9974,7 +9974,7 @@ function Qc(r, e, t, n) {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
function Yc(r) {
|
|
9976
9976
|
const e = r.anchor.getNode();
|
|
9977
|
-
return (
|
|
9977
|
+
return (Ye(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
9978
9978
|
}
|
|
9979
9979
|
function Ro(r, e, t) {
|
|
9980
9980
|
const n = Yc(r);
|
|
@@ -9982,7 +9982,7 @@ function Ro(r, e, t) {
|
|
|
9982
9982
|
}
|
|
9983
9983
|
function Oo(r) {
|
|
9984
9984
|
if (me(r) || !N(r) || Ft(r)) return !1;
|
|
9985
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
9985
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
9986
9986
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9987
9987
|
}
|
|
9988
9988
|
function Xc(r) {
|
|
@@ -10062,7 +10062,7 @@ function nd(r) {
|
|
|
10062
10062
|
if (O(m)) {
|
|
10063
10063
|
const y = m.anchor;
|
|
10064
10064
|
let C = y.getNode(), x = 0, A = 0;
|
|
10065
|
-
if (
|
|
10065
|
+
if (q(C) && u >= 0 && c >= 0 && (x = u, A = u + c, m.setTextNodeRange(C, x, C, A)), x === A && d === "" || (m.insertRawText(d), C = y.getNode()), q(C)) {
|
|
10066
10066
|
x = f, A = f + h;
|
|
10067
10067
|
const w = C.getTextContentSize();
|
|
10068
10068
|
x = x > w ? w : x, A = A > w ? w : A, m.setTextNodeRange(C, x, C, A);
|
|
@@ -10112,7 +10112,7 @@ function Ca(r, e, t, n = null) {
|
|
|
10112
10112
|
let i = e;
|
|
10113
10113
|
if (n !== null) {
|
|
10114
10114
|
let h = Fi(e);
|
|
10115
|
-
h =
|
|
10115
|
+
h = q(h) && n !== null ? ya(n, h) : h, i = h;
|
|
10116
10116
|
}
|
|
10117
10117
|
const l = N(i) ? i.getChildren() : [], a = r._nodes.get(i.getType());
|
|
10118
10118
|
let u;
|
|
@@ -10235,7 +10235,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10235
10235
|
let i = t;
|
|
10236
10236
|
if (e !== null) {
|
|
10237
10237
|
let u = Fi(t);
|
|
10238
|
-
u =
|
|
10238
|
+
u = q(u) && e !== null ? ya(e, u) : u, i = u;
|
|
10239
10239
|
}
|
|
10240
10240
|
const l = N(i) ? i.getChildren() : [], a = function(u) {
|
|
10241
10241
|
const c = u.exportJSON(), d = u.constructor;
|
|
@@ -10245,7 +10245,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10245
10245
|
}
|
|
10246
10246
|
return c;
|
|
10247
10247
|
}(i);
|
|
10248
|
-
if (
|
|
10248
|
+
if (q(i)) {
|
|
10249
10249
|
const u = i.__text;
|
|
10250
10250
|
u.length > 0 ? a.text = u : s = !1;
|
|
10251
10251
|
}
|
|
@@ -10270,7 +10270,7 @@ function ud(r) {
|
|
|
10270
10270
|
const e = [];
|
|
10271
10271
|
for (let t = 0; t < r.length; t++) {
|
|
10272
10272
|
const n = r[t], s = Bc(n);
|
|
10273
|
-
|
|
10273
|
+
q(s) && Hc(s), e.push(s);
|
|
10274
10274
|
}
|
|
10275
10275
|
return e;
|
|
10276
10276
|
}
|
|
@@ -10597,7 +10597,7 @@ function bd(r) {
|
|
|
10597
10597
|
const t = V();
|
|
10598
10598
|
if (!O(t)) return !1;
|
|
10599
10599
|
const { anchor: n } = t, s = n.getNode();
|
|
10600
|
-
return t.isCollapsed() && n.offset === 0 && !
|
|
10600
|
+
return t.isCollapsed() && n.offset === 0 && !Ye(s) && rd(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Qi, void 0)) : (!Uo || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(or, !0));
|
|
10601
10601
|
}, ce), r.registerCommand(_l, (e) => {
|
|
10602
10602
|
if (Ln(e.target)) return !1;
|
|
10603
10603
|
const t = V();
|
|
@@ -10621,7 +10621,7 @@ function bd(r) {
|
|
|
10621
10621
|
const { offset: o, node: i } = s, l = Nr(i);
|
|
10622
10622
|
if (l !== null) {
|
|
10623
10623
|
const a = Ec();
|
|
10624
|
-
if (
|
|
10624
|
+
if (q(l)) a.anchor.set(l.getKey(), o, "text"), a.focus.set(l.getKey(), o, "text");
|
|
10625
10625
|
else {
|
|
10626
10626
|
const c = l.getParentOrThrow().getKey(), d = l.getIndexWithinParent() + 1;
|
|
10627
10627
|
a.anchor.set(c, d, "element"), a.focus.set(c, d, "element");
|
|
@@ -10765,17 +10765,17 @@ function Bd(r, e, t, n, s) {
|
|
|
10765
10765
|
for (const [v, b] of A) {
|
|
10766
10766
|
if (!b) continue;
|
|
10767
10767
|
const D = w.get(v);
|
|
10768
|
-
D === void 0 ||
|
|
10768
|
+
D === void 0 || Ye(D) || E.push(D);
|
|
10769
10769
|
}
|
|
10770
10770
|
return E;
|
|
10771
10771
|
}(e, t, n);
|
|
10772
10772
|
if (l.length === 0) return yt;
|
|
10773
10773
|
if (l.length > 1) {
|
|
10774
10774
|
const C = e._nodeMap, x = C.get(o.anchor.key), A = C.get(i.anchor.key);
|
|
10775
|
-
return x && A && !r._nodeMap.has(x.__key) &&
|
|
10775
|
+
return x && A && !r._nodeMap.has(x.__key) && q(x) && x.__text.length === 1 && o.anchor.offset === 1 ? Jo : yt;
|
|
10776
10776
|
}
|
|
10777
10777
|
const a = l[0], u = r._nodeMap.get(a.__key);
|
|
10778
|
-
if (!
|
|
10778
|
+
if (!q(u) || !q(a) || u.__mode !== a.__mode) return yt;
|
|
10779
10779
|
const c = u.__text, d = a.__text;
|
|
10780
10780
|
if (c === d) return yt;
|
|
10781
10781
|
const f = o.anchor, h = i.anchor;
|
|
@@ -10795,7 +10795,7 @@ function Nd(r, e) {
|
|
|
10795
10795
|
const m = o._selection;
|
|
10796
10796
|
return l.size > 0 || a.size > 0 ? g === !1 && d !== yt && d === n && c < t + e && h || l.size === 1 && function(y, C, x) {
|
|
10797
10797
|
const A = C._nodeMap.get(y), w = x._nodeMap.get(y), E = C._selection, v = x._selection;
|
|
10798
|
-
return !(O(E) && O(v) && E.anchor.type === "element" && E.focus.type === "element" && v.anchor.type === "text" && v.focus.type === "text" || !
|
|
10798
|
+
return !(O(E) && O(v) && E.anchor.type === "element" && E.focus.type === "element" && v.anchor.type === "text" && v.focus.type === "text" || !q(A) || !q(w) || A.__parent !== w.__parent) && JSON.stringify(C.read(() => A.exportJSON())) === JSON.stringify(x.read(() => w.exportJSON()));
|
|
10799
10799
|
}(Array.from(l)[0], s, o) ? Pn : ai : m !== null ? Pn : ui;
|
|
10800
10800
|
})();
|
|
10801
10801
|
return t = c, n = d, f;
|
|
@@ -11701,7 +11701,7 @@ const tf = {
|
|
|
11701
11701
|
}
|
|
11702
11702
|
};
|
|
11703
11703
|
function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiRewrite: s, aiProcessing: o, aiProcessingAction: i, onAiAction: l, hasContent: a }) {
|
|
11704
|
-
const [u] = vt(), [c, d] =
|
|
11704
|
+
const [u] = vt(), [c, d] = Je.useState(!1), f = Je.useRef(null), h = t || n || s, g = re(() => {
|
|
11705
11705
|
u.dispatchCommand(xt, "bold");
|
|
11706
11706
|
}, [u]), m = re(() => {
|
|
11707
11707
|
u.dispatchCommand(xt, "italic");
|
|
@@ -12012,7 +12012,7 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
12012
12012
|
);
|
|
12013
12013
|
}
|
|
12014
12014
|
function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
12015
|
-
const [n] = vt(), s =
|
|
12015
|
+
const [n] = vt(), s = Je.useRef(!1);
|
|
12016
12016
|
return De(() => {
|
|
12017
12017
|
r && (s.current && !e || (s.current = !0, n.update(
|
|
12018
12018
|
() => {
|
|
@@ -12030,7 +12030,7 @@ function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
|
12030
12030
|
}, [r, e, n, t]), null;
|
|
12031
12031
|
}
|
|
12032
12032
|
function of({ text: r, trigger: e }) {
|
|
12033
|
-
const [t] = vt(), n =
|
|
12033
|
+
const [t] = vt(), n = Je.useRef(void 0);
|
|
12034
12034
|
return De(() => {
|
|
12035
12035
|
if (e === void 0 || e === n.current || !r) return;
|
|
12036
12036
|
n.current = e;
|
|
@@ -12128,8 +12128,8 @@ function af({
|
|
|
12128
12128
|
aiProcessingAction: m,
|
|
12129
12129
|
renderAboveToolbar: y
|
|
12130
12130
|
}) {
|
|
12131
|
-
const C = { ...tf, ...s }, [x, A] =
|
|
12132
|
-
|
|
12131
|
+
const C = { ...tf, ...s }, [x, A] = Je.useState(!1), w = Je.useRef(void 0), [E, v] = Je.useState(r), [b, D] = Je.useState(!1), [k, M] = Je.useState(null), B = g ?? b, F = m ?? k;
|
|
12132
|
+
Je.useEffect(() => {
|
|
12133
12133
|
a !== void 0 && a !== w.current && (w.current = a, A(!0));
|
|
12134
12134
|
}, [a]);
|
|
12135
12135
|
const L = re(() => {
|
|
@@ -12359,15 +12359,15 @@ function Sf({
|
|
|
12359
12359
|
onAiRewrite: w,
|
|
12360
12360
|
renderAboveToolbar: E
|
|
12361
12361
|
}) {
|
|
12362
|
-
const v = { ...uf, ...c }, [b, D] = H(r), [k, M] = H(""), [B, F] = H(""), [L, j] = H(e), [R, Y] = H(t), [de, ie] = H([]), [oe, ve] = H(!1), [pe, we] = H(""), [Se, Oe] = H(f), [ke, Ce] = H(!1), Ge =
|
|
12363
|
-
|
|
12362
|
+
const v = { ...uf, ...c }, [b, D] = H(r), [k, M] = H(""), [B, F] = H(""), [L, j] = H(e), [R, Y] = H(t), [de, ie] = H([]), [oe, ve] = H(!1), [pe, we] = H(""), [Se, Oe] = H(f), [ke, Ce] = H(!1), Ge = Je.useRef(void 0);
|
|
12363
|
+
Je.useEffect(() => {
|
|
12364
12364
|
l !== void 0 && l !== Ge.current && (Ge.current = l, Y(t), Ce(!0));
|
|
12365
12365
|
}, [l, t]);
|
|
12366
12366
|
const ze = (W) => {
|
|
12367
12367
|
Y(W), Ce(!1), i == null || i(W);
|
|
12368
12368
|
}, ge = xe(null), [Me, ct] = H(!1), Ct = (W) => {
|
|
12369
12369
|
const be = W.target.files;
|
|
12370
|
-
be && ie((
|
|
12370
|
+
be && ie((Ke) => [...Ke, ...Array.from(be)]), ge.current && (ge.current.value = "");
|
|
12371
12371
|
}, qt = (W) => {
|
|
12372
12372
|
W.preventDefault(), W.stopPropagation(), ct(!0);
|
|
12373
12373
|
}, it = (W) => {
|
|
@@ -12375,7 +12375,7 @@ function Sf({
|
|
|
12375
12375
|
}, ot = (W) => {
|
|
12376
12376
|
W.preventDefault(), W.stopPropagation(), ct(!1), W.dataTransfer.files && ie((be) => [...be, ...Array.from(W.dataTransfer.files)]);
|
|
12377
12377
|
}, dt = (W) => W.type.startsWith("image/") ? "image" : W.type === "application/pdf" ? "picture_as_pdf" : W.type.includes("spreadsheet") || W.type.includes("excel") ? "table_chart" : W.type.includes("document") || W.type.includes("word") ? "description" : "attach_file", Ut = (W) => {
|
|
12378
|
-
ie((be) => be.filter((
|
|
12378
|
+
ie((be) => be.filter((Ke, I) => I !== W));
|
|
12379
12379
|
}, Wt = (W) => W < 1024 ? `${W} B` : W < 1024 * 1024 ? `${(W / 1024).toFixed(1)} KB` : `${(W / (1024 * 1024)).toFixed(1)} MB`, Dt = async () => {
|
|
12380
12380
|
if (!b.trim()) {
|
|
12381
12381
|
we("Recipient email is required");
|
|
@@ -12388,19 +12388,18 @@ function Sf({
|
|
|
12388
12388
|
ve(!0), we("");
|
|
12389
12389
|
try {
|
|
12390
12390
|
const W = await Promise.all(
|
|
12391
|
-
de.map(async (
|
|
12392
|
-
const
|
|
12393
|
-
new Uint8Array(
|
|
12391
|
+
de.map(async (I) => {
|
|
12392
|
+
const T = await I.arrayBuffer(), X = btoa(
|
|
12393
|
+
new Uint8Array(T).reduce((J, S) => J + String.fromCharCode(S), "")
|
|
12394
12394
|
);
|
|
12395
12395
|
return {
|
|
12396
|
-
filename:
|
|
12397
|
-
content_type:
|
|
12398
|
-
data:
|
|
12399
|
-
size:
|
|
12396
|
+
filename: I.name,
|
|
12397
|
+
content_type: I.type || "application/octet-stream",
|
|
12398
|
+
data: X,
|
|
12399
|
+
size: I.size
|
|
12400
12400
|
};
|
|
12401
12401
|
})
|
|
12402
|
-
), be = R.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim()
|
|
12403
|
-
await s({
|
|
12402
|
+
), be = R.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Ke = {
|
|
12404
12403
|
to: b.trim(),
|
|
12405
12404
|
cc: k.trim() || void 0,
|
|
12406
12405
|
bcc: B.trim() || void 0,
|
|
@@ -12408,7 +12407,13 @@ function Sf({
|
|
|
12408
12407
|
html: be,
|
|
12409
12408
|
attachments: W,
|
|
12410
12409
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
12411
|
-
}
|
|
12410
|
+
};
|
|
12411
|
+
console.log("[MailComposer] Sending email:", {
|
|
12412
|
+
to: Ke.to,
|
|
12413
|
+
subject: Ke.subject,
|
|
12414
|
+
attachmentsCount: Ke.attachments.length,
|
|
12415
|
+
attachments: Ke.attachments.map((I) => ({ filename: I.filename, size: I.size, type: I.content_type }))
|
|
12416
|
+
}), await s(Ke), D(""), M(""), F(""), j(""), Y(""), ie([]);
|
|
12412
12417
|
} catch (W) {
|
|
12413
12418
|
we(W instanceof Error ? W.message : "Failed to send email");
|
|
12414
12419
|
} finally {
|
|
@@ -13297,32 +13302,32 @@ function Bf({
|
|
|
13297
13302
|
] });
|
|
13298
13303
|
}
|
|
13299
13304
|
function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, variant: s = "widget", hideSaveButton: o = !1 }) {
|
|
13300
|
-
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null), M = xe(null), B = xe(null), F = xe([]), L = xe(null), j = xe(null), R = xe(null), Y = xe(null), de = xe(!1), ie = xe([]), oe = xe(null), ve = xe(null), pe = xe([]), we = xe([]), Se = xe("insert"), Oe = xe(!1), ke = xe(0), Ce = xe(0), Ge = xe(0), ze = (
|
|
13301
|
-
const T = Math.floor(
|
|
13305
|
+
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null), M = xe(null), B = xe(null), F = xe([]), L = xe(null), j = xe(null), R = xe(null), Y = xe(null), de = xe(!1), ie = xe([]), oe = xe(null), ve = xe(null), pe = xe([]), we = xe([]), Se = xe("insert"), Oe = xe(!1), ke = xe(0), Ce = xe(0), Ge = xe(0), ze = (I) => {
|
|
13306
|
+
const T = Math.floor(I / 60), X = Math.floor(I % 60);
|
|
13302
13307
|
return `${T.toString().padStart(2, "0")}:${X.toString().padStart(2, "0")}`;
|
|
13303
|
-
}, ge = async (
|
|
13304
|
-
const T = await
|
|
13308
|
+
}, ge = async (I) => {
|
|
13309
|
+
const T = await I.arrayBuffer(), X = new AudioContext(), J = await X.decodeAudioData(T);
|
|
13305
13310
|
return await X.close(), J;
|
|
13306
|
-
}, Me = (
|
|
13307
|
-
const T =
|
|
13311
|
+
}, Me = (I) => {
|
|
13312
|
+
const T = I.numberOfChannels, X = I.sampleRate, J = 1, S = 16, $ = S / 8, K = T * $, Q = X * K, ee = I.length * K, ae = new ArrayBuffer(44 + ee), ne = new DataView(ae), te = (ye, fe) => {
|
|
13308
13313
|
for (let qe = 0; qe < fe.length; qe++)
|
|
13309
13314
|
ne.setUint8(ye + qe, fe.charCodeAt(qe));
|
|
13310
13315
|
};
|
|
13311
13316
|
te(0, "RIFF"), ne.setUint32(4, 36 + ee, !0), te(8, "WAVE"), te(12, "fmt "), ne.setUint32(16, 16, !0), ne.setUint16(20, J, !0), ne.setUint16(22, T, !0), ne.setUint32(24, X, !0), ne.setUint32(28, Q, !0), ne.setUint16(32, K, !0), ne.setUint16(34, S, !0), te(36, "data"), ne.setUint32(40, ee, !0);
|
|
13312
13317
|
const Ae = [];
|
|
13313
13318
|
for (let ye = 0; ye < T; ye++)
|
|
13314
|
-
Ae.push(
|
|
13319
|
+
Ae.push(I.getChannelData(ye));
|
|
13315
13320
|
let Fe = 44;
|
|
13316
|
-
for (let ye = 0; ye <
|
|
13321
|
+
for (let ye = 0; ye < I.length; ye++)
|
|
13317
13322
|
for (let fe = 0; fe < T; fe++) {
|
|
13318
13323
|
const qe = Math.max(-1, Math.min(1, Ae[fe][ye])), Ue = qe < 0 ? qe * 32768 : qe * 32767;
|
|
13319
13324
|
ne.setInt16(Fe, Ue, !0), Fe += 2;
|
|
13320
13325
|
}
|
|
13321
13326
|
return new Blob([ae], { type: "audio/wav" });
|
|
13322
|
-
}, ct = async (
|
|
13323
|
-
const S = new AudioContext(),
|
|
13327
|
+
}, ct = async (I, T, X, J) => {
|
|
13328
|
+
const S = new AudioContext(), $ = I.sampleRate, K = Math.max(I.numberOfChannels, T.numberOfChannels), Q = Math.min(X, I.length), ee = Math.max(0, I.length - X), ae = J === "insert" ? Q + T.length + ee : Q + T.length, ne = S.createBuffer(K, ae, $);
|
|
13324
13329
|
for (let te = 0; te < K; te++) {
|
|
13325
|
-
const Ae = ne.getChannelData(te), Fe = te <
|
|
13330
|
+
const Ae = ne.getChannelData(te), Fe = te < I.numberOfChannels ? I.getChannelData(te) : I.getChannelData(0);
|
|
13326
13331
|
for (let fe = 0; fe < Q; fe++)
|
|
13327
13332
|
Ae[fe] = Fe[fe];
|
|
13328
13333
|
const ye = te < T.numberOfChannels ? T.getChannelData(te) : T.getChannelData(0);
|
|
@@ -13334,11 +13339,11 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13334
13339
|
}
|
|
13335
13340
|
return await S.close(), ne;
|
|
13336
13341
|
}, Ct = re(() => {
|
|
13337
|
-
const
|
|
13338
|
-
if (!
|
|
13339
|
-
const T =
|
|
13342
|
+
const I = b.current;
|
|
13343
|
+
if (!I) return;
|
|
13344
|
+
const T = I.getContext("2d");
|
|
13340
13345
|
if (!T) return;
|
|
13341
|
-
const X =
|
|
13346
|
+
const X = I.getBoundingClientRect(), J = X.width, S = X.height, $ = ie.current, K = d || u || 1, Q = l === "recording" ? u : m;
|
|
13342
13347
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13343
13348
|
const ee = 8, ae = "rgba(0, 0, 0, 0.4)", ne = T.createLinearGradient(0, 0, 0, ee);
|
|
13344
13349
|
ne.addColorStop(0, ae), ne.addColorStop(1, "transparent"), T.fillStyle = ne, T.fillRect(0, 0, J, ee);
|
|
@@ -13349,59 +13354,59 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13349
13354
|
const Fe = T.createLinearGradient(J - ee, 0, J, 0);
|
|
13350
13355
|
Fe.addColorStop(0, "transparent"), Fe.addColorStop(1, ae), T.fillStyle = Fe, T.fillRect(J - ee, 0, ee, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13351
13356
|
const ye = J / 2;
|
|
13352
|
-
if (
|
|
13357
|
+
if ($.length > 0)
|
|
13353
13358
|
if (l === "recording")
|
|
13354
|
-
for (let Ue = 0; Ue <
|
|
13355
|
-
const lt =
|
|
13359
|
+
for (let Ue = 0; Ue < $.length; Ue++) {
|
|
13360
|
+
const lt = $.length - 1 - Ue, Et = ye - lt * 4;
|
|
13356
13361
|
if (Et < -3 || Et > J) continue;
|
|
13357
|
-
const pt =
|
|
13362
|
+
const pt = $[Ue] * (S / 2 - 12), Pt = S / 2 - pt;
|
|
13358
13363
|
T.fillStyle = "#10b981", T.fillRect(Et, Pt, 3, pt * 2);
|
|
13359
13364
|
}
|
|
13360
13365
|
else {
|
|
13361
|
-
const Ue = K > 0 ? Q / K *
|
|
13362
|
-
for (let lt = 0; lt <
|
|
13366
|
+
const Ue = K > 0 ? Q / K * $.length : 0;
|
|
13367
|
+
for (let lt = 0; lt < $.length; lt++) {
|
|
13363
13368
|
const Et = Ue - lt, pt = ye - Et * 4;
|
|
13364
13369
|
if (pt < -3 || pt > J) continue;
|
|
13365
|
-
const Pt =
|
|
13370
|
+
const Pt = $[lt] * (S / 2 - 12), yr = S / 2 - Pt;
|
|
13366
13371
|
T.fillStyle = lt <= Ue ? "#10b981" : "#4b5563", T.fillRect(pt, yr, 3, Pt * 2);
|
|
13367
13372
|
}
|
|
13368
13373
|
}
|
|
13369
13374
|
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(ye, 0), T.lineTo(ye, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText(ze(Q), ye, S - 6), l === "recording" && (T.fillStyle = "#ef4444", T.beginPath(), T.arc(20, 20, 8, 0, Math.PI * 2), T.fill(), T.fillStyle = "#fff", T.font = "10px sans-serif", T.textAlign = "left", T.fillText("REC", 34, 24)), T.textAlign = "left";
|
|
13370
13375
|
}, [l, m, u, d]), qt = () => {
|
|
13371
|
-
const
|
|
13372
|
-
if (!
|
|
13373
|
-
const T =
|
|
13374
|
-
|
|
13376
|
+
const I = B.current;
|
|
13377
|
+
if (!I || !de.current) return;
|
|
13378
|
+
const T = I.frequencyBinCount, X = new Uint8Array(T);
|
|
13379
|
+
I.getByteTimeDomainData(X);
|
|
13375
13380
|
let J = 0;
|
|
13376
13381
|
for (let K = 0; K < T; K++) {
|
|
13377
13382
|
const Q = (X[K] - 128) / 128;
|
|
13378
13383
|
J += Q * Q;
|
|
13379
13384
|
}
|
|
13380
|
-
const S = Math.sqrt(J / T),
|
|
13381
|
-
ie.current.push(
|
|
13385
|
+
const S = Math.sqrt(J / T), $ = Math.min(1, S * 3);
|
|
13386
|
+
ie.current.push($), Ct(), de.current && (j.current = requestAnimationFrame(qt));
|
|
13382
13387
|
}, it = async () => {
|
|
13383
13388
|
try {
|
|
13384
13389
|
x(null), w(!1), oe.current === null && (ie.current = []);
|
|
13385
|
-
const
|
|
13386
|
-
k.current =
|
|
13390
|
+
const I = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
13391
|
+
k.current = I;
|
|
13387
13392
|
const T = new AudioContext();
|
|
13388
13393
|
M.current = T;
|
|
13389
13394
|
const X = T.createAnalyser();
|
|
13390
|
-
X.fftSize = 2048, B.current = X, T.createMediaStreamSource(
|
|
13391
|
-
const S = new MediaRecorder(
|
|
13392
|
-
D.current = S, F.current = [], S.ondataavailable = (
|
|
13393
|
-
|
|
13395
|
+
X.fftSize = 2048, B.current = X, T.createMediaStreamSource(I).connect(X);
|
|
13396
|
+
const S = new MediaRecorder(I);
|
|
13397
|
+
D.current = S, F.current = [], S.ondataavailable = ($) => {
|
|
13398
|
+
$.data.size > 0 && F.current.push($.data);
|
|
13394
13399
|
}, S.onstop = async () => {
|
|
13395
13400
|
try {
|
|
13396
13401
|
if (de.current = !1, F.current.length === 0) {
|
|
13397
|
-
x("No audio was recorded. Please try again."), a("idle"),
|
|
13402
|
+
x("No audio was recorded. Please try again."), a("idle"), I.getTracks().forEach((ne) => ne.stop());
|
|
13398
13403
|
return;
|
|
13399
13404
|
}
|
|
13400
|
-
const
|
|
13405
|
+
const $ = new Blob(F.current, { type: "audio/webm" });
|
|
13401
13406
|
let K, Q;
|
|
13402
13407
|
if (oe.current !== null && ve.current)
|
|
13403
13408
|
try {
|
|
13404
|
-
const ne = await ge(
|
|
13409
|
+
const ne = await ge($), te = ve.current.sampleRate, Ae = Math.floor(oe.current * te), Fe = await ct(
|
|
13405
13410
|
ve.current,
|
|
13406
13411
|
ne,
|
|
13407
13412
|
Ae,
|
|
@@ -13412,17 +13417,17 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13412
13417
|
...we.current
|
|
13413
13418
|
]), oe.current = null, ve.current = null, pe.current = [], we.current = [];
|
|
13414
13419
|
} catch {
|
|
13415
|
-
K =
|
|
13420
|
+
K = $, Q = ke.current > 0 ? ke.current : 1;
|
|
13416
13421
|
}
|
|
13417
13422
|
else
|
|
13418
|
-
K =
|
|
13423
|
+
K = $, Q = ke.current > 0 ? ke.current : 1;
|
|
13419
13424
|
Y.current = K;
|
|
13420
13425
|
const ee = URL.createObjectURL(K), ae = new Audio(ee);
|
|
13421
13426
|
ae.ontimeupdate = () => {
|
|
13422
13427
|
y(ae.currentTime);
|
|
13423
13428
|
}, ae.onended = () => {
|
|
13424
13429
|
g(!1);
|
|
13425
|
-
}, R.current = ae, f(Q), y(Q), a("editing"),
|
|
13430
|
+
}, R.current = ae, f(Q), y(Q), a("editing"), I.getTracks().forEach((ne) => ne.stop());
|
|
13426
13431
|
} catch {
|
|
13427
13432
|
x("Failed to process recording"), a("idle");
|
|
13428
13433
|
}
|
|
@@ -13434,31 +13439,31 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13434
13439
|
}
|
|
13435
13440
|
}, ot = () => {
|
|
13436
13441
|
de.current = !1, w(!1), v(null), j.current && (cancelAnimationFrame(j.current), j.current = null), L.current && (clearInterval(L.current), L.current = null), D.current && D.current.state !== "inactive" && D.current.stop();
|
|
13437
|
-
}, dt = (
|
|
13442
|
+
}, dt = (I) => {
|
|
13438
13443
|
const T = b.current;
|
|
13439
13444
|
if (!T) return;
|
|
13440
13445
|
const X = d || u;
|
|
13441
13446
|
if (X <= 0) return;
|
|
13442
13447
|
const J = ie.current;
|
|
13443
13448
|
if (J.length === 0) return;
|
|
13444
|
-
const S = T.getBoundingClientRect(),
|
|
13449
|
+
const S = T.getBoundingClientRect(), $ = I - Ce.current, K = 4, Q = S.width / T.width, ee = J.length / X * K, ae = -$ / (ee * Q), ne = Ge.current + ae, te = Math.max(0, Math.min(ne, X));
|
|
13445
13450
|
R.current && (R.current.currentTime = te), y(te);
|
|
13446
13451
|
}, Ut = () => {
|
|
13447
13452
|
R.current && (R.current.currentTime = 0), y(0);
|
|
13448
13453
|
}, Wt = () => {
|
|
13449
|
-
const
|
|
13450
|
-
R.current && (R.current.currentTime =
|
|
13454
|
+
const I = d || u;
|
|
13455
|
+
R.current && (R.current.currentTime = I), y(I);
|
|
13451
13456
|
}, Dt = () => {
|
|
13452
|
-
const
|
|
13453
|
-
|
|
13457
|
+
const I = R.current;
|
|
13458
|
+
I && (h ? (I.pause(), y(I.currentTime), g(!1)) : (I.currentTime = m, I.play().catch(() => {
|
|
13454
13459
|
}), g(!0)));
|
|
13455
|
-
}, ft = async (
|
|
13460
|
+
}, ft = async (I) => {
|
|
13456
13461
|
if (!Y.current) {
|
|
13457
13462
|
it();
|
|
13458
13463
|
return;
|
|
13459
13464
|
}
|
|
13460
13465
|
try {
|
|
13461
|
-
R.current && (R.current.pause(), g(!1)), Se.current =
|
|
13466
|
+
R.current && (R.current.pause(), g(!1)), Se.current = I, ve.current = await ge(Y.current);
|
|
13462
13467
|
const T = d || u;
|
|
13463
13468
|
oe.current = m;
|
|
13464
13469
|
const X = T > 0 ? m / T : 0, J = Math.floor(X * ie.current.length);
|
|
@@ -13474,39 +13479,39 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13474
13479
|
if (De(() => {
|
|
13475
13480
|
l === "recording" && b.current && B.current && de.current && (j.current = requestAnimationFrame(qt));
|
|
13476
13481
|
}, [l]), De(() => {
|
|
13477
|
-
const
|
|
13478
|
-
if (!
|
|
13482
|
+
const I = b.current;
|
|
13483
|
+
if (!I) return;
|
|
13479
13484
|
const T = () => {
|
|
13480
|
-
const X = window.devicePixelRatio || 1, J =
|
|
13481
|
-
|
|
13482
|
-
const S =
|
|
13485
|
+
const X = window.devicePixelRatio || 1, J = I.getBoundingClientRect();
|
|
13486
|
+
I.width = J.width * X, I.height = J.height * X;
|
|
13487
|
+
const S = I.getContext("2d");
|
|
13483
13488
|
S && S.scale(X, X);
|
|
13484
13489
|
};
|
|
13485
13490
|
return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
13486
13491
|
}, []), De(() => {
|
|
13487
13492
|
if (l === "idle") {
|
|
13488
|
-
const
|
|
13489
|
-
if (!
|
|
13490
|
-
const T =
|
|
13493
|
+
const I = b.current;
|
|
13494
|
+
if (!I) return;
|
|
13495
|
+
const T = I.getContext("2d");
|
|
13491
13496
|
if (!T) return;
|
|
13492
|
-
const X =
|
|
13497
|
+
const X = I.getBoundingClientRect(), J = X.width, S = X.height;
|
|
13493
13498
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13494
|
-
const
|
|
13495
|
-
Q.addColorStop(0, K), Q.addColorStop(1, "transparent"), T.fillStyle = Q, T.fillRect(0, 0, J,
|
|
13496
|
-
const ee = T.createLinearGradient(0, S -
|
|
13497
|
-
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S -
|
|
13498
|
-
const ae = T.createLinearGradient(0, 0,
|
|
13499
|
-
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0,
|
|
13500
|
-
const ne = T.createLinearGradient(J -
|
|
13501
|
-
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J -
|
|
13499
|
+
const $ = 8, K = "rgba(0, 0, 0, 0.4)", Q = T.createLinearGradient(0, 0, 0, $);
|
|
13500
|
+
Q.addColorStop(0, K), Q.addColorStop(1, "transparent"), T.fillStyle = Q, T.fillRect(0, 0, J, $);
|
|
13501
|
+
const ee = T.createLinearGradient(0, S - $, 0, S);
|
|
13502
|
+
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S - $, J, $);
|
|
13503
|
+
const ae = T.createLinearGradient(0, 0, $, 0);
|
|
13504
|
+
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0, $, S);
|
|
13505
|
+
const ne = T.createLinearGradient(J - $, 0, J, 0);
|
|
13506
|
+
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J - $, 0, $, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13502
13507
|
const te = J / 2;
|
|
13503
13508
|
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(te, 0), T.lineTo(te, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText("00:00", te, S - 6);
|
|
13504
13509
|
}
|
|
13505
13510
|
}, [l]), De(() => () => {
|
|
13506
|
-
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((
|
|
13511
|
+
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((I) => I.stop()), M.current && M.current.state !== "closed" && M.current.close();
|
|
13507
13512
|
}, []), De(() => {
|
|
13508
13513
|
if (l === "editing" && h) {
|
|
13509
|
-
let
|
|
13514
|
+
let I;
|
|
13510
13515
|
const T = () => {
|
|
13511
13516
|
const X = R.current;
|
|
13512
13517
|
if (X && h) {
|
|
@@ -13514,7 +13519,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13514
13519
|
if (J) {
|
|
13515
13520
|
const S = J.getContext("2d");
|
|
13516
13521
|
if (S) {
|
|
13517
|
-
const
|
|
13522
|
+
const $ = J.getBoundingClientRect(), K = $.width, Q = $.height, ee = ie.current, ae = d || u || 1, ne = X.currentTime;
|
|
13518
13523
|
S.fillStyle = "#2d3b35", S.fillRect(0, 0, K, Q);
|
|
13519
13524
|
const te = 8, Ae = "rgba(0, 0, 0, 0.4)", Fe = S.createLinearGradient(0, 0, 0, te);
|
|
13520
13525
|
Fe.addColorStop(0, Ae), Fe.addColorStop(1, "transparent"), S.fillStyle = Fe, S.fillRect(0, 0, K, te);
|
|
@@ -13536,10 +13541,10 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13536
13541
|
S.fillText(`${Pt.toString().padStart(2, "0")}:${yr.toString().padStart(2, "0")}`, Ue, Q - 6), S.textAlign = "left";
|
|
13537
13542
|
}
|
|
13538
13543
|
}
|
|
13539
|
-
|
|
13544
|
+
I = requestAnimationFrame(T);
|
|
13540
13545
|
}
|
|
13541
13546
|
};
|
|
13542
|
-
return
|
|
13547
|
+
return I = requestAnimationFrame(T), () => cancelAnimationFrame(I);
|
|
13543
13548
|
}
|
|
13544
13549
|
}, [l, h, d, u]), De(() => {
|
|
13545
13550
|
l === "editing" && !h && Ct();
|
|
@@ -13571,16 +13576,16 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13571
13576
|
...W,
|
|
13572
13577
|
opacity: 0.3,
|
|
13573
13578
|
cursor: "not-allowed"
|
|
13574
|
-
},
|
|
13575
|
-
return /* @__PURE__ */ p.jsxs("div", { style:
|
|
13579
|
+
}, Ke = i ? { border: "1px solid #e5e5e5", borderRadius: "12px", overflow: "hidden", background: "white" } : { overflow: "hidden", background: "white", flexShrink: 0 };
|
|
13580
|
+
return /* @__PURE__ */ p.jsxs("div", { style: Ke, children: [
|
|
13576
13581
|
/* @__PURE__ */ p.jsx(
|
|
13577
13582
|
"canvas",
|
|
13578
13583
|
{
|
|
13579
13584
|
ref: b,
|
|
13580
13585
|
style: { width: "100%", height: "32px", cursor: "pointer", flexShrink: 0 },
|
|
13581
|
-
onMouseDown: (
|
|
13586
|
+
onMouseDown: (I) => {
|
|
13582
13587
|
if (l === "editing") {
|
|
13583
|
-
Oe.current = !0, Ce.current =
|
|
13588
|
+
Oe.current = !0, Ce.current = I.clientX, Ge.current = m;
|
|
13584
13589
|
const T = (J) => {
|
|
13585
13590
|
Oe.current && dt(J.clientX);
|
|
13586
13591
|
}, X = () => {
|
|
@@ -13621,8 +13626,8 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13621
13626
|
{
|
|
13622
13627
|
onClick: () => {
|
|
13623
13628
|
if (l === "recording") {
|
|
13624
|
-
const
|
|
13625
|
-
|
|
13629
|
+
const I = D.current;
|
|
13630
|
+
I && (I.state === "recording" ? (I.pause(), w(!0)) : I.state === "paused" && (I.resume(), w(!1)));
|
|
13626
13631
|
} else
|
|
13627
13632
|
Dt();
|
|
13628
13633
|
},
|