@qwanyx/stack 0.2.18 → 0.2.19
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/client/MailClient.d.ts +4 -2
- package/dist/index.cjs.js +18 -18
- package/dist/index.esm.js +693 -689
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Rl = Object.defineProperty;
|
|
|
2
2
|
var jl = (r, e, t) => e in r ? Rl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var or = (r, e, t) => jl(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as ss from "react";
|
|
5
|
-
import Ks, { useState as Q, useCallback as Z, useEffect as
|
|
5
|
+
import Ks, { useState as Q, useCallback as Z, useEffect as pe, useMemo as Pt, useRef as bs, createContext as Il, useContext as Ml, useLayoutEffect as er, Suspense as $l, forwardRef as Qo } from "react";
|
|
6
6
|
import { flushSync as ql, createPortal as zl } from "react-dom";
|
|
7
7
|
class cf {
|
|
8
8
|
constructor(e) {
|
|
@@ -3559,29 +3559,31 @@ class la {
|
|
|
3559
3559
|
/**
|
|
3560
3560
|
* Move emails to trash (soft delete)
|
|
3561
3561
|
* Tries multiple folder names for Gmail locales
|
|
3562
|
+
* @param sourceFolder - The folder where the emails currently are (default: INBOX)
|
|
3562
3563
|
*/
|
|
3563
|
-
async trashEmails(e, t) {
|
|
3564
|
-
const
|
|
3565
|
-
for (const
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3568
|
-
...t.map((
|
|
3569
|
-
],
|
|
3570
|
-
if (
|
|
3571
|
-
return { success: !0, moved:
|
|
3564
|
+
async trashEmails(e, t, n = "INBOX") {
|
|
3565
|
+
const s = ["[Gmail]/Trash", "[Gmail]/Corbeille", "[Gmail]/Bin", "Trash"];
|
|
3566
|
+
for (const o of s) {
|
|
3567
|
+
const i = [
|
|
3568
|
+
`SELECT "${n}"`,
|
|
3569
|
+
...t.map((a) => `UID MOVE ${a} "${o}"`)
|
|
3570
|
+
], l = (await this.imapExec(e, i)).responses.filter((a) => a.ok && a.command === "UID MOVE").length;
|
|
3571
|
+
if (l > 0)
|
|
3572
|
+
return { success: !0, moved: l };
|
|
3572
3573
|
}
|
|
3573
3574
|
return { success: !1, moved: 0 };
|
|
3574
3575
|
}
|
|
3575
3576
|
/**
|
|
3576
3577
|
* Archive emails (remove from inbox, keep in All Mail)
|
|
3578
|
+
* @param sourceFolder - The folder where the emails currently are (default: INBOX)
|
|
3577
3579
|
*/
|
|
3578
|
-
async archiveEmails(e, t) {
|
|
3579
|
-
const
|
|
3580
|
-
|
|
3581
|
-
...t.map((
|
|
3580
|
+
async archiveEmails(e, t, n = "INBOX") {
|
|
3581
|
+
const s = [
|
|
3582
|
+
`SELECT "${n}"`,
|
|
3583
|
+
...t.map((u) => `UID STORE ${u} +FLAGS (\\Deleted)`),
|
|
3582
3584
|
"EXPUNGE"
|
|
3583
|
-
],
|
|
3584
|
-
return { success:
|
|
3585
|
+
], i = (await this.imapExec(e, s)).responses.filter((u) => u.ok && u.command === "UID STORE").length;
|
|
3586
|
+
return { success: i > 0, archived: i };
|
|
3585
3587
|
}
|
|
3586
3588
|
/**
|
|
3587
3589
|
* List available folders
|
|
@@ -3917,7 +3919,7 @@ function da(r, e, t = {}) {
|
|
|
3917
3919
|
}
|
|
3918
3920
|
}
|
|
3919
3921
|
}, [r, JSON.stringify(e), n, o, i]);
|
|
3920
|
-
return
|
|
3922
|
+
return pe(() => {
|
|
3921
3923
|
s && h();
|
|
3922
3924
|
}, [h, s]), {
|
|
3923
3925
|
data: u,
|
|
@@ -4095,18 +4097,18 @@ function ha() {
|
|
|
4095
4097
|
}
|
|
4096
4098
|
return null;
|
|
4097
4099
|
}
|
|
4098
|
-
var I = Object.assign, W = 0, ne,
|
|
4099
|
-
function
|
|
4100
|
+
var I = Object.assign, W = 0, ne, Se, $e, vt, ut, ae, Le;
|
|
4101
|
+
function qe() {
|
|
4100
4102
|
}
|
|
4101
|
-
|
|
4103
|
+
qe.__reactDisabledLog = !0;
|
|
4102
4104
|
function lt() {
|
|
4103
4105
|
{
|
|
4104
4106
|
if (W === 0) {
|
|
4105
|
-
ne = console.log,
|
|
4107
|
+
ne = console.log, Se = console.info, $e = console.warn, vt = console.error, ut = console.group, ae = console.groupCollapsed, Le = console.groupEnd;
|
|
4106
4108
|
var m = {
|
|
4107
4109
|
configurable: !0,
|
|
4108
4110
|
enumerable: !0,
|
|
4109
|
-
value:
|
|
4111
|
+
value: qe,
|
|
4110
4112
|
writable: !0
|
|
4111
4113
|
};
|
|
4112
4114
|
Object.defineProperties(console, {
|
|
@@ -4135,10 +4137,10 @@ function ha() {
|
|
|
4135
4137
|
value: ne
|
|
4136
4138
|
}),
|
|
4137
4139
|
info: I({}, m, {
|
|
4138
|
-
value:
|
|
4140
|
+
value: Se
|
|
4139
4141
|
}),
|
|
4140
4142
|
warn: I({}, m, {
|
|
4141
|
-
value:
|
|
4143
|
+
value: $e
|
|
4142
4144
|
}),
|
|
4143
4145
|
error: I({}, m, {
|
|
4144
4146
|
value: vt
|
|
@@ -4147,49 +4149,49 @@ function ha() {
|
|
|
4147
4149
|
value: ut
|
|
4148
4150
|
}),
|
|
4149
4151
|
groupCollapsed: I({}, m, {
|
|
4150
|
-
value:
|
|
4152
|
+
value: ae
|
|
4151
4153
|
}),
|
|
4152
4154
|
groupEnd: I({}, m, {
|
|
4153
|
-
value:
|
|
4155
|
+
value: Le
|
|
4154
4156
|
})
|
|
4155
4157
|
});
|
|
4156
4158
|
}
|
|
4157
4159
|
W < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4158
4160
|
}
|
|
4159
4161
|
}
|
|
4160
|
-
var
|
|
4161
|
-
function
|
|
4162
|
+
var ve = D.ReactCurrentDispatcher, Ze;
|
|
4163
|
+
function Te(m, T, R) {
|
|
4162
4164
|
{
|
|
4163
|
-
if (
|
|
4165
|
+
if (Ze === void 0)
|
|
4164
4166
|
try {
|
|
4165
4167
|
throw Error();
|
|
4166
4168
|
} catch (J) {
|
|
4167
4169
|
var q = J.stack.trim().match(/\n( *(at )?)/);
|
|
4168
|
-
|
|
4170
|
+
Ze = q && q[1] || "";
|
|
4169
4171
|
}
|
|
4170
4172
|
return `
|
|
4171
|
-
` +
|
|
4173
|
+
` + Ze + m;
|
|
4172
4174
|
}
|
|
4173
4175
|
}
|
|
4174
|
-
var
|
|
4176
|
+
var ze = !1, et;
|
|
4175
4177
|
{
|
|
4176
4178
|
var Gn = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4177
|
-
|
|
4179
|
+
et = new Gn();
|
|
4178
4180
|
}
|
|
4179
4181
|
function Hr(m, T) {
|
|
4180
|
-
if (!m ||
|
|
4182
|
+
if (!m || ze)
|
|
4181
4183
|
return "";
|
|
4182
4184
|
{
|
|
4183
|
-
var R =
|
|
4185
|
+
var R = et.get(m);
|
|
4184
4186
|
if (R !== void 0)
|
|
4185
4187
|
return R;
|
|
4186
4188
|
}
|
|
4187
4189
|
var q;
|
|
4188
|
-
|
|
4190
|
+
ze = !0;
|
|
4189
4191
|
var J = Error.prepareStackTrace;
|
|
4190
4192
|
Error.prepareStackTrace = void 0;
|
|
4191
4193
|
var X;
|
|
4192
|
-
X =
|
|
4194
|
+
X = ve.current, ve.current = null, lt();
|
|
4193
4195
|
try {
|
|
4194
4196
|
if (T) {
|
|
4195
4197
|
var K = function() {
|
|
@@ -4202,50 +4204,50 @@ function ha() {
|
|
|
4202
4204
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
4203
4205
|
try {
|
|
4204
4206
|
Reflect.construct(K, []);
|
|
4205
|
-
} catch (
|
|
4206
|
-
q =
|
|
4207
|
+
} catch (be) {
|
|
4208
|
+
q = be;
|
|
4207
4209
|
}
|
|
4208
4210
|
Reflect.construct(m, [], K);
|
|
4209
4211
|
} else {
|
|
4210
4212
|
try {
|
|
4211
4213
|
K.call();
|
|
4212
|
-
} catch (
|
|
4213
|
-
q =
|
|
4214
|
+
} catch (be) {
|
|
4215
|
+
q = be;
|
|
4214
4216
|
}
|
|
4215
4217
|
m.call(K.prototype);
|
|
4216
4218
|
}
|
|
4217
4219
|
} else {
|
|
4218
4220
|
try {
|
|
4219
4221
|
throw Error();
|
|
4220
|
-
} catch (
|
|
4221
|
-
q =
|
|
4222
|
+
} catch (be) {
|
|
4223
|
+
q = be;
|
|
4222
4224
|
}
|
|
4223
4225
|
m();
|
|
4224
4226
|
}
|
|
4225
|
-
} catch (
|
|
4226
|
-
if (
|
|
4227
|
-
for (var V =
|
|
4228
|
-
`),
|
|
4229
|
-
`),
|
|
4230
|
-
|
|
4231
|
-
for (;
|
|
4232
|
-
if (V[
|
|
4233
|
-
if (
|
|
4227
|
+
} catch (be) {
|
|
4228
|
+
if (be && q && typeof be.stack == "string") {
|
|
4229
|
+
for (var V = be.stack.split(`
|
|
4230
|
+
`), me = q.stack.split(`
|
|
4231
|
+
`), ie = V.length - 1, oe = me.length - 1; ie >= 1 && oe >= 0 && V[ie] !== me[oe]; )
|
|
4232
|
+
oe--;
|
|
4233
|
+
for (; ie >= 1 && oe >= 0; ie--, oe--)
|
|
4234
|
+
if (V[ie] !== me[oe]) {
|
|
4235
|
+
if (ie !== 1 || oe !== 1)
|
|
4234
4236
|
do
|
|
4235
|
-
if (
|
|
4236
|
-
var
|
|
4237
|
-
` + V[
|
|
4238
|
-
return m.displayName &&
|
|
4237
|
+
if (ie--, oe--, oe < 0 || V[ie] !== me[oe]) {
|
|
4238
|
+
var Ne = `
|
|
4239
|
+
` + V[ie].replace(" at new ", " at ");
|
|
4240
|
+
return m.displayName && Ne.includes("<anonymous>") && (Ne = Ne.replace("<anonymous>", m.displayName)), typeof m == "function" && et.set(m, Ne), Ne;
|
|
4239
4241
|
}
|
|
4240
|
-
while (
|
|
4242
|
+
while (ie >= 1 && oe >= 0);
|
|
4241
4243
|
break;
|
|
4242
4244
|
}
|
|
4243
4245
|
}
|
|
4244
4246
|
} finally {
|
|
4245
|
-
|
|
4247
|
+
ze = !1, ve.current = X, at(), Error.prepareStackTrace = J;
|
|
4246
4248
|
}
|
|
4247
|
-
var qt = m ? m.displayName || m.name : "", Dt = qt ?
|
|
4248
|
-
return typeof m == "function" &&
|
|
4249
|
+
var qt = m ? m.displayName || m.name : "", Dt = qt ? Te(qt) : "";
|
|
4250
|
+
return typeof m == "function" && et.set(m, Dt), Dt;
|
|
4249
4251
|
}
|
|
4250
4252
|
function Jn(m, T, R) {
|
|
4251
4253
|
return Hr(m, !1);
|
|
@@ -4254,29 +4256,29 @@ function ha() {
|
|
|
4254
4256
|
var T = m.prototype;
|
|
4255
4257
|
return !!(T && T.isReactComponent);
|
|
4256
4258
|
}
|
|
4257
|
-
function
|
|
4259
|
+
function It(m, T, R) {
|
|
4258
4260
|
if (m == null)
|
|
4259
4261
|
return "";
|
|
4260
4262
|
if (typeof m == "function")
|
|
4261
4263
|
return Hr(m, Qn(m));
|
|
4262
4264
|
if (typeof m == "string")
|
|
4263
|
-
return
|
|
4265
|
+
return Te(m);
|
|
4264
4266
|
switch (m) {
|
|
4265
4267
|
case a:
|
|
4266
|
-
return
|
|
4268
|
+
return Te("Suspense");
|
|
4267
4269
|
case c:
|
|
4268
|
-
return
|
|
4270
|
+
return Te("SuspenseList");
|
|
4269
4271
|
}
|
|
4270
4272
|
if (typeof m == "object")
|
|
4271
4273
|
switch (m.$$typeof) {
|
|
4272
4274
|
case l:
|
|
4273
4275
|
return Jn(m.render);
|
|
4274
4276
|
case f:
|
|
4275
|
-
return
|
|
4277
|
+
return It(m.type, T, R);
|
|
4276
4278
|
case d: {
|
|
4277
4279
|
var q = m, J = q._payload, X = q._init;
|
|
4278
4280
|
try {
|
|
4279
|
-
return
|
|
4281
|
+
return It(X(J), T, R);
|
|
4280
4282
|
} catch {
|
|
4281
4283
|
}
|
|
4282
4284
|
}
|
|
@@ -4284,9 +4286,9 @@ function ha() {
|
|
|
4284
4286
|
return "";
|
|
4285
4287
|
}
|
|
4286
4288
|
var bt = Object.prototype.hasOwnProperty, Gr = {}, Jr = D.ReactDebugCurrentFrame;
|
|
4287
|
-
function
|
|
4289
|
+
function Mt(m) {
|
|
4288
4290
|
if (m) {
|
|
4289
|
-
var T = m._owner, R =
|
|
4291
|
+
var T = m._owner, R = It(m.type, m._source, T ? T.type : null);
|
|
4290
4292
|
Jr.setExtraStackFrame(R);
|
|
4291
4293
|
} else
|
|
4292
4294
|
Jr.setExtraStackFrame(null);
|
|
@@ -4299,19 +4301,19 @@ function ha() {
|
|
|
4299
4301
|
var V = void 0;
|
|
4300
4302
|
try {
|
|
4301
4303
|
if (typeof m[K] != "function") {
|
|
4302
|
-
var
|
|
4303
|
-
throw
|
|
4304
|
+
var me = Error((q || "React class") + ": " + R + " type `" + K + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof m[K] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4305
|
+
throw me.name = "Invariant Violation", me;
|
|
4304
4306
|
}
|
|
4305
4307
|
V = m[K](T, K, q, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4306
|
-
} catch (
|
|
4307
|
-
V =
|
|
4308
|
+
} catch (ie) {
|
|
4309
|
+
V = ie;
|
|
4308
4310
|
}
|
|
4309
|
-
V && !(V instanceof Error) && (
|
|
4311
|
+
V && !(V instanceof Error) && (Mt(J), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", q || "React class", R, K, typeof V), Mt(null)), V instanceof Error && !(V.message in Gr) && (Gr[V.message] = !0, Mt(J), y("Failed %s type: %s", R, V.message), Mt(null));
|
|
4310
4312
|
}
|
|
4311
4313
|
}
|
|
4312
4314
|
}
|
|
4313
4315
|
var Xn = Array.isArray;
|
|
4314
|
-
function
|
|
4316
|
+
function M(m) {
|
|
4315
4317
|
return Xn(m);
|
|
4316
4318
|
}
|
|
4317
4319
|
function z(m) {
|
|
@@ -4320,21 +4322,21 @@ function ha() {
|
|
|
4320
4322
|
return R;
|
|
4321
4323
|
}
|
|
4322
4324
|
}
|
|
4323
|
-
function
|
|
4325
|
+
function se(m) {
|
|
4324
4326
|
try {
|
|
4325
|
-
return
|
|
4327
|
+
return Be(m), !1;
|
|
4326
4328
|
} catch {
|
|
4327
4329
|
return !0;
|
|
4328
4330
|
}
|
|
4329
4331
|
}
|
|
4330
|
-
function
|
|
4332
|
+
function Be(m) {
|
|
4331
4333
|
return "" + m;
|
|
4332
4334
|
}
|
|
4333
|
-
function
|
|
4334
|
-
if (
|
|
4335
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(m)),
|
|
4335
|
+
function Ae(m) {
|
|
4336
|
+
if (se(m))
|
|
4337
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(m)), Be(m);
|
|
4336
4338
|
}
|
|
4337
|
-
var
|
|
4339
|
+
var Ue = D.ReactCurrentOwner, Zn = {
|
|
4338
4340
|
key: !0,
|
|
4339
4341
|
ref: !0,
|
|
4340
4342
|
__self: !0,
|
|
@@ -4357,7 +4359,7 @@ function ha() {
|
|
|
4357
4359
|
return m.key !== void 0;
|
|
4358
4360
|
}
|
|
4359
4361
|
function bl(m, T) {
|
|
4360
|
-
typeof m.ref == "string" &&
|
|
4362
|
+
typeof m.ref == "string" && Ue.current;
|
|
4361
4363
|
}
|
|
4362
4364
|
function Dl(m, T) {
|
|
4363
4365
|
{
|
|
@@ -4412,26 +4414,26 @@ function ha() {
|
|
|
4412
4414
|
};
|
|
4413
4415
|
function Al(m, T, R, q, J) {
|
|
4414
4416
|
{
|
|
4415
|
-
var X, K = {}, V = null,
|
|
4416
|
-
R !== void 0 && (
|
|
4417
|
+
var X, K = {}, V = null, me = null;
|
|
4418
|
+
R !== void 0 && (Ae(R), V = "" + R), vl(T) && (Ae(T.key), V = "" + T.key), xl(T) && (me = T.ref, bl(T, J));
|
|
4417
4419
|
for (X in T)
|
|
4418
4420
|
bt.call(T, X) && !Zn.hasOwnProperty(X) && (K[X] = T[X]);
|
|
4419
4421
|
if (m && m.defaultProps) {
|
|
4420
|
-
var
|
|
4421
|
-
for (X in
|
|
4422
|
-
K[X] === void 0 && (K[X] =
|
|
4422
|
+
var ie = m.defaultProps;
|
|
4423
|
+
for (X in ie)
|
|
4424
|
+
K[X] === void 0 && (K[X] = ie[X]);
|
|
4423
4425
|
}
|
|
4424
|
-
if (V ||
|
|
4425
|
-
var
|
|
4426
|
-
V && Dl(K,
|
|
4426
|
+
if (V || me) {
|
|
4427
|
+
var oe = typeof m == "function" ? m.displayName || m.name || "Unknown" : m;
|
|
4428
|
+
V && Dl(K, oe), me && wl(K, oe);
|
|
4427
4429
|
}
|
|
4428
|
-
return Cl(m, V,
|
|
4430
|
+
return Cl(m, V, me, J, q, Ue.current, K);
|
|
4429
4431
|
}
|
|
4430
4432
|
}
|
|
4431
4433
|
var es = D.ReactCurrentOwner, Di = D.ReactDebugCurrentFrame;
|
|
4432
4434
|
function $t(m) {
|
|
4433
4435
|
if (m) {
|
|
4434
|
-
var T = m._owner, R =
|
|
4436
|
+
var T = m._owner, R = It(m.type, m._source, T ? T.type : null);
|
|
4435
4437
|
Di.setExtraStackFrame(R);
|
|
4436
4438
|
} else
|
|
4437
4439
|
Di.setExtraStackFrame(null);
|
|
@@ -4486,7 +4488,7 @@ Check the top-level render call using <` + R + ">.");
|
|
|
4486
4488
|
{
|
|
4487
4489
|
if (typeof m != "object")
|
|
4488
4490
|
return;
|
|
4489
|
-
if (
|
|
4491
|
+
if (M(m))
|
|
4490
4492
|
for (var R = 0; R < m.length; R++) {
|
|
4491
4493
|
var q = m[R];
|
|
4492
4494
|
rs(q) && Ai(q, T);
|
|
@@ -4545,33 +4547,33 @@ Check the top-level render call using <` + R + ">.");
|
|
|
4545
4547
|
if (!K) {
|
|
4546
4548
|
var V = "";
|
|
4547
4549
|
(m === void 0 || typeof m == "object" && m !== null && Object.keys(m).length === 0) && (V += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4548
|
-
var
|
|
4549
|
-
|
|
4550
|
-
var
|
|
4551
|
-
m === null ?
|
|
4550
|
+
var me = El();
|
|
4551
|
+
me ? V += me : V += wi();
|
|
4552
|
+
var ie;
|
|
4553
|
+
m === null ? ie = "null" : M(m) ? ie = "array" : m !== void 0 && m.$$typeof === e ? (ie = "<" + ($(m.type) || "Unknown") + " />", V = " Did you accidentally export a JSX literal instead of a component?") : ie = typeof m, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ie, V);
|
|
4552
4554
|
}
|
|
4553
|
-
var
|
|
4554
|
-
if (
|
|
4555
|
-
return
|
|
4555
|
+
var oe = Al(m, T, R, J, X);
|
|
4556
|
+
if (oe == null)
|
|
4557
|
+
return oe;
|
|
4556
4558
|
if (K) {
|
|
4557
|
-
var
|
|
4558
|
-
if (
|
|
4559
|
+
var Ne = T.children;
|
|
4560
|
+
if (Ne !== void 0)
|
|
4559
4561
|
if (q)
|
|
4560
|
-
if (
|
|
4561
|
-
for (var qt = 0; qt <
|
|
4562
|
-
Ei(
|
|
4563
|
-
Object.freeze && Object.freeze(
|
|
4562
|
+
if (M(Ne)) {
|
|
4563
|
+
for (var qt = 0; qt < Ne.length; qt++)
|
|
4564
|
+
Ei(Ne[qt], m);
|
|
4565
|
+
Object.freeze && Object.freeze(Ne);
|
|
4564
4566
|
} else
|
|
4565
4567
|
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
4566
4568
|
else
|
|
4567
|
-
Ei(
|
|
4569
|
+
Ei(Ne, m);
|
|
4568
4570
|
}
|
|
4569
4571
|
if (bt.call(T, "key")) {
|
|
4570
|
-
var Dt = $(m),
|
|
4572
|
+
var Dt = $(m), be = Object.keys(T).filter(function(Ol) {
|
|
4571
4573
|
return Ol !== "key";
|
|
4572
|
-
}), ns =
|
|
4574
|
+
}), ns = be.length > 0 ? "{key: someKey, " + be.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
4573
4575
|
if (!ki[Dt + ns]) {
|
|
4574
|
-
var Pl =
|
|
4576
|
+
var Pl = be.length > 0 ? "{" + be.join(": ..., ") + ": ...}" : "{}";
|
|
4575
4577
|
y(`A props object containing a "key" prop is being spread into JSX:
|
|
4576
4578
|
let props = %s;
|
|
4577
4579
|
<%s {...props} />
|
|
@@ -4580,7 +4582,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4580
4582
|
<%s key={someKey} {...props} />`, ns, Dt, Pl, Dt), ki[Dt + ns] = !0;
|
|
4581
4583
|
}
|
|
4582
4584
|
}
|
|
4583
|
-
return m === n ? Tl(
|
|
4585
|
+
return m === n ? Tl(oe) : Sl(oe), oe;
|
|
4584
4586
|
}
|
|
4585
4587
|
}
|
|
4586
4588
|
function Bl(m, T, R) {
|
|
@@ -4702,7 +4704,7 @@ function hf({
|
|
|
4702
4704
|
let I = g;
|
|
4703
4705
|
return u && w && l.length > 0 && (I = as.search(I, w, l)), Object.keys(C).length > 0 && (I = as.filterByFields(I, C)), as.paginate(I, k, f);
|
|
4704
4706
|
}, [g, w, C, k, f, u, l]);
|
|
4705
|
-
|
|
4707
|
+
pe(() => {
|
|
4706
4708
|
A(1);
|
|
4707
4709
|
}, [w, C]);
|
|
4708
4710
|
const P = () => {
|
|
@@ -4994,7 +4996,7 @@ function mf({
|
|
|
4994
4996
|
const A = Math.floor(Math.random() * k.length);
|
|
4995
4997
|
return k[A];
|
|
4996
4998
|
}, [r]), y = Z(() => Math.random() * (n - t) + t, [t, n]);
|
|
4997
|
-
|
|
4999
|
+
pe(() => {
|
|
4998
5000
|
if (r.length === 0) {
|
|
4999
5001
|
a([]), f([]);
|
|
5000
5002
|
return;
|
|
@@ -5042,7 +5044,7 @@ function mf({
|
|
|
5042
5044
|
}, k);
|
|
5043
5045
|
_.current[b] = A;
|
|
5044
5046
|
}, [y, D, l, c, p]), x = bs(!1);
|
|
5045
|
-
|
|
5047
|
+
pe(() => {
|
|
5046
5048
|
if (!(l.length === 0 || r.length <= 1) && !x.current) {
|
|
5047
5049
|
x.current = !0;
|
|
5048
5050
|
for (let b = 0; b < l.length; b++)
|
|
@@ -5195,105 +5197,107 @@ function yf({
|
|
|
5195
5197
|
renderLoading: y,
|
|
5196
5198
|
theme: w = {}
|
|
5197
5199
|
}) {
|
|
5198
|
-
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [
|
|
5199
|
-
if (
|
|
5200
|
+
const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [Se, $e] = Q(null), [vt, ut] = Q(!1), ae = Pt(() => e ? new la({ baseUrl: r, system_id: e }) : null, [r, e]), Le = Z(async () => {
|
|
5201
|
+
if (ae) {
|
|
5200
5202
|
A(!0), P(null);
|
|
5201
5203
|
try {
|
|
5202
|
-
const
|
|
5203
|
-
|
|
5204
|
-
} catch (
|
|
5205
|
-
const z =
|
|
5204
|
+
const M = await ae.listEmails(t, n, s);
|
|
5205
|
+
M != null && M.messages && (b(M.messages), h == null || h(M.messages));
|
|
5206
|
+
} catch (M) {
|
|
5207
|
+
const z = M instanceof Error ? M : new Error("Failed to fetch emails");
|
|
5206
5208
|
P(z.message), d == null || d(z);
|
|
5207
5209
|
}
|
|
5208
5210
|
A(!1);
|
|
5209
5211
|
}
|
|
5210
|
-
}, [
|
|
5211
|
-
|
|
5212
|
-
l &&
|
|
5213
|
-
}, [l,
|
|
5214
|
-
|
|
5212
|
+
}, [ae, t, n, s, d, h]);
|
|
5213
|
+
pe(() => {
|
|
5214
|
+
l && Le();
|
|
5215
|
+
}, [l, Le]), pe(() => {
|
|
5216
|
+
Le();
|
|
5215
5217
|
}, [s]);
|
|
5216
|
-
const
|
|
5217
|
-
if (
|
|
5218
|
-
ne(
|
|
5218
|
+
const qe = Z(async (M) => {
|
|
5219
|
+
if (ae) {
|
|
5220
|
+
ne(M), $e(null), ut(!0);
|
|
5219
5221
|
try {
|
|
5220
|
-
const z = await
|
|
5221
|
-
z != null && z.body &&
|
|
5222
|
+
const z = await ae.getEmailParsed(t, M.uid, s || "INBOX");
|
|
5223
|
+
z != null && z.body && $e(z.body);
|
|
5222
5224
|
} catch (z) {
|
|
5223
5225
|
console.error("Failed to fetch email body:", z);
|
|
5224
5226
|
}
|
|
5225
5227
|
ut(!1);
|
|
5226
5228
|
}
|
|
5227
|
-
}, [
|
|
5228
|
-
a == null || a(
|
|
5229
|
-
}, [a, i,
|
|
5229
|
+
}, [ae, t, s]), lt = Z((M) => {
|
|
5230
|
+
a == null || a(M), i && qe(M);
|
|
5231
|
+
}, [a, i, qe]), at = Z((M, z, se) => {
|
|
5230
5232
|
if (!o) {
|
|
5231
|
-
a == null || a(
|
|
5233
|
+
a == null || a(M), i && qe(M);
|
|
5232
5234
|
return;
|
|
5233
5235
|
}
|
|
5234
|
-
const
|
|
5235
|
-
if (
|
|
5236
|
-
const
|
|
5236
|
+
const Be = M.uid;
|
|
5237
|
+
if (se.shiftKey && $ !== null) {
|
|
5238
|
+
const Ae = Math.min($, z), Ue = Math.max($, z), Zn = C.slice(Ae, Ue + 1).map((Qr) => Qr.uid), ir = new Set(Zn);
|
|
5237
5239
|
U(ir), c == null || c(Array.from(ir));
|
|
5238
|
-
} else if (
|
|
5239
|
-
U((
|
|
5240
|
-
const
|
|
5241
|
-
return
|
|
5240
|
+
} else if (se.ctrlKey || se.metaKey)
|
|
5241
|
+
U((Ae) => {
|
|
5242
|
+
const Ue = new Set(Ae);
|
|
5243
|
+
return Ue.has(Be) ? Ue.delete(Be) : Ue.add(Be), c == null || c(Array.from(Ue)), Ue;
|
|
5242
5244
|
}), I(z);
|
|
5243
5245
|
else {
|
|
5244
|
-
const
|
|
5245
|
-
U(
|
|
5246
|
+
const Ae = /* @__PURE__ */ new Set([Be]);
|
|
5247
|
+
U(Ae), I(z), c == null || c(Array.from(Ae));
|
|
5246
5248
|
}
|
|
5247
|
-
}, [o, $, C, F, a, c, i]),
|
|
5248
|
-
if (!
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
}
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5249
|
+
}, [o, $, C, F, a, c, i]), ve = Z(async () => {
|
|
5250
|
+
if (!ae || F.size === 0) return;
|
|
5251
|
+
const M = s || "INBOX";
|
|
5252
|
+
try {
|
|
5253
|
+
const z = await ae.trashEmails(t, Array.from(F), M);
|
|
5254
|
+
if (console.log("Trash result:", z), z.success && z.moved > 0) {
|
|
5255
|
+
b((Be) => Be.filter((Ae) => !F.has(Ae.uid)));
|
|
5256
|
+
const se = Array.from(F);
|
|
5257
|
+
U(/* @__PURE__ */ new Set()), f == null || f(se);
|
|
5258
|
+
} else
|
|
5259
|
+
P("Failed to move emails to trash");
|
|
5260
|
+
} catch (z) {
|
|
5261
|
+
const se = z instanceof Error ? z : new Error("Trash failed");
|
|
5262
|
+
console.error("Trash error:", se), P(se.message), d == null || d(se);
|
|
5263
|
+
}
|
|
5264
|
+
}, [ae, t, F, s, f, d]), Ze = Z(async () => {
|
|
5265
|
+
if (!ae || F.size === 0) return;
|
|
5266
|
+
const M = s || "INBOX";
|
|
5267
|
+
try {
|
|
5268
|
+
const z = await ae.archiveEmails(t, Array.from(F), M);
|
|
5269
|
+
if (console.log("Archive result:", z), z.success && z.archived > 0) {
|
|
5270
|
+
b((Be) => Be.filter((Ae) => !F.has(Ae.uid)));
|
|
5271
|
+
const se = Array.from(F);
|
|
5272
|
+
U(/* @__PURE__ */ new Set()), f == null || f(se);
|
|
5273
|
+
} else
|
|
5274
|
+
P("Failed to archive emails");
|
|
5275
|
+
} catch (z) {
|
|
5276
|
+
const se = z instanceof Error ? z : new Error("Archive failed");
|
|
5277
|
+
console.error("Archive error:", se), P(se.message), d == null || d(se);
|
|
5278
|
+
}
|
|
5279
|
+
}, [ae, t, F, s, f, d]), Te = Z(() => {
|
|
5276
5280
|
if (F.size === C.length)
|
|
5277
5281
|
U(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
5278
5282
|
else {
|
|
5279
|
-
const
|
|
5280
|
-
U(
|
|
5283
|
+
const M = new Set(C.map((z) => z.uid));
|
|
5284
|
+
U(M), c == null || c(Array.from(M));
|
|
5281
5285
|
}
|
|
5282
|
-
}, [C, F.size, c]),
|
|
5286
|
+
}, [C, F.size, c]), ze = Z(() => {
|
|
5283
5287
|
U(/* @__PURE__ */ new Set()), c == null || c([]);
|
|
5284
|
-
}, [c]),
|
|
5285
|
-
delete:
|
|
5286
|
-
archive:
|
|
5287
|
-
refresh:
|
|
5288
|
-
selectAll:
|
|
5289
|
-
clearSelection:
|
|
5290
|
-
}, Gn = (
|
|
5291
|
-
if (!
|
|
5292
|
-
const z = new Date(
|
|
5293
|
-
return z.toDateString() ===
|
|
5294
|
-
}, Hr = (
|
|
5288
|
+
}, [c]), et = {
|
|
5289
|
+
delete: ve,
|
|
5290
|
+
archive: Ze,
|
|
5291
|
+
refresh: Le,
|
|
5292
|
+
selectAll: Te,
|
|
5293
|
+
clearSelection: ze
|
|
5294
|
+
}, Gn = (M) => {
|
|
5295
|
+
if (!M) return "";
|
|
5296
|
+
const z = new Date(M), se = /* @__PURE__ */ new Date();
|
|
5297
|
+
return z.toDateString() === se.toDateString() ? z.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : z.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5298
|
+
}, Hr = (M, z) => /* @__PURE__ */ v.jsx("div", { style: {
|
|
5295
5299
|
padding: "12px 16px",
|
|
5296
|
-
background: z ? x.selectedBackground :
|
|
5300
|
+
background: z ? x.selectedBackground : M.seen ? x.cardBackground : x.unreadBackground,
|
|
5297
5301
|
borderBottom: `1px solid ${x.border}`,
|
|
5298
5302
|
cursor: "pointer",
|
|
5299
5303
|
transition: "background 0.15s ease"
|
|
@@ -5301,43 +5305,43 @@ function yf({
|
|
|
5301
5305
|
/* @__PURE__ */ v.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5302
5306
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5303
5307
|
fontSize: "14px",
|
|
5304
|
-
fontWeight:
|
|
5308
|
+
fontWeight: M.seen ? 400 : 600,
|
|
5305
5309
|
color: x.text,
|
|
5306
5310
|
whiteSpace: "nowrap",
|
|
5307
5311
|
overflow: "hidden",
|
|
5308
5312
|
textOverflow: "ellipsis"
|
|
5309
|
-
}, children: Xr(
|
|
5313
|
+
}, children: Xr(M.from).split("@")[0] }),
|
|
5310
5314
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5311
5315
|
fontSize: "14px",
|
|
5312
|
-
fontWeight:
|
|
5313
|
-
color:
|
|
5316
|
+
fontWeight: M.seen ? 400 : 500,
|
|
5317
|
+
color: M.seen ? x.textSecondary : x.text,
|
|
5314
5318
|
marginTop: "2px",
|
|
5315
5319
|
whiteSpace: "nowrap",
|
|
5316
5320
|
overflow: "hidden",
|
|
5317
5321
|
textOverflow: "ellipsis"
|
|
5318
|
-
}, children: Xr(
|
|
5322
|
+
}, children: Xr(M.subject) || "(No subject)" })
|
|
5319
5323
|
] }),
|
|
5320
5324
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
5321
5325
|
fontSize: "12px",
|
|
5322
5326
|
color: x.textSecondary,
|
|
5323
5327
|
flexShrink: 0
|
|
5324
|
-
}, children: Gn(
|
|
5325
|
-
] }) }), Jn = (
|
|
5326
|
-
/* @__PURE__ */ v.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: x.text }, children: Xr(
|
|
5328
|
+
}, children: Gn(M.date) })
|
|
5329
|
+
] }) }), Jn = (M) => /* @__PURE__ */ v.jsxs("div", { style: { padding: "24px" }, children: [
|
|
5330
|
+
/* @__PURE__ */ v.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: x.text }, children: Xr(M.subject) || "(No subject)" }),
|
|
5327
5331
|
/* @__PURE__ */ v.jsxs("div", { style: { fontSize: "14px", color: x.textSecondary, marginBottom: "16px" }, children: [
|
|
5328
5332
|
"From: ",
|
|
5329
|
-
Xr(
|
|
5333
|
+
Xr(M.from),
|
|
5330
5334
|
" • ",
|
|
5331
|
-
new Date(
|
|
5335
|
+
new Date(M.date).toLocaleString()
|
|
5332
5336
|
] }),
|
|
5333
|
-
vt ? /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "Loading..." }) :
|
|
5337
|
+
vt ? /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "Loading..." }) : Se ? /* @__PURE__ */ v.jsx(
|
|
5334
5338
|
"div",
|
|
5335
5339
|
{
|
|
5336
5340
|
style: { fontSize: "14px", color: x.text },
|
|
5337
|
-
dangerouslySetInnerHTML: { __html:
|
|
5341
|
+
dangerouslySetInnerHTML: { __html: Se }
|
|
5338
5342
|
}
|
|
5339
5343
|
) : /* @__PURE__ */ v.jsx("div", { style: { fontSize: "14px", color: x.textSecondary }, children: "No content available" })
|
|
5340
|
-
] }), Qn = (
|
|
5344
|
+
] }), Qn = (M, z) => /* @__PURE__ */ v.jsxs("div", { style: {
|
|
5341
5345
|
display: "flex",
|
|
5342
5346
|
alignItems: "center",
|
|
5343
5347
|
gap: "8px",
|
|
@@ -5358,12 +5362,12 @@ function yf({
|
|
|
5358
5362
|
cursor: "pointer",
|
|
5359
5363
|
color: x.text
|
|
5360
5364
|
},
|
|
5361
|
-
children:
|
|
5365
|
+
children: M.length === C.length ? "Deselect All" : "Select All"
|
|
5362
5366
|
}
|
|
5363
5367
|
),
|
|
5364
|
-
|
|
5368
|
+
M.length > 0 && /* @__PURE__ */ v.jsxs(v.Fragment, { children: [
|
|
5365
5369
|
/* @__PURE__ */ v.jsxs("span", { style: { fontSize: "13px", color: x.textSecondary }, children: [
|
|
5366
|
-
|
|
5370
|
+
M.length,
|
|
5367
5371
|
" selected"
|
|
5368
5372
|
] }),
|
|
5369
5373
|
/* @__PURE__ */ v.jsx(
|
|
@@ -5428,7 +5432,7 @@ function yf({
|
|
|
5428
5432
|
children: /* @__PURE__ */ v.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
5429
5433
|
}
|
|
5430
5434
|
)
|
|
5431
|
-
] }),
|
|
5435
|
+
] }), It = () => /* @__PURE__ */ v.jsx("div", { style: {
|
|
5432
5436
|
padding: "48px",
|
|
5433
5437
|
textAlign: "center",
|
|
5434
5438
|
color: x.textSecondary
|
|
@@ -5436,7 +5440,7 @@ function yf({
|
|
|
5436
5440
|
padding: "48px",
|
|
5437
5441
|
textAlign: "center",
|
|
5438
5442
|
color: x.textSecondary
|
|
5439
|
-
}, children: "Loading..." }), Gr = p || Hr, Jr = g || Jn,
|
|
5443
|
+
}, children: "Loading..." }), Gr = p || Hr, Jr = g || Jn, Mt = _ || Qn, Yn = D || It, Xn = y || bt;
|
|
5440
5444
|
return k && C.length === 0 ? /* @__PURE__ */ v.jsx("div", { style: { background: x.background, width: "100%", height: "100%" }, children: Xn() }) : /* @__PURE__ */ v.jsxs("div", { style: { display: "flex", background: x.background, width: "100%", height: "100%" }, children: [
|
|
5441
5445
|
/* @__PURE__ */ v.jsxs("div", { style: {
|
|
5442
5446
|
flex: i && W ? "0 0 50%" : "1",
|
|
@@ -5445,7 +5449,7 @@ function yf({
|
|
|
5445
5449
|
borderRight: i && W ? `1px solid ${x.border}` : "none",
|
|
5446
5450
|
overflow: "hidden"
|
|
5447
5451
|
}, children: [
|
|
5448
|
-
o &&
|
|
5452
|
+
o && Mt(Array.from(F), et),
|
|
5449
5453
|
S && /* @__PURE__ */ v.jsx("div", { style: {
|
|
5450
5454
|
padding: "12px 16px",
|
|
5451
5455
|
background: "#fef2f2",
|
|
@@ -5453,14 +5457,14 @@ function yf({
|
|
|
5453
5457
|
fontSize: "14px",
|
|
5454
5458
|
borderBottom: `1px solid ${x.border}`
|
|
5455
5459
|
}, children: S }),
|
|
5456
|
-
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: C.length === 0 ? Yn() : C.map((
|
|
5460
|
+
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: C.length === 0 ? Yn() : C.map((M, z) => /* @__PURE__ */ v.jsx(
|
|
5457
5461
|
"div",
|
|
5458
5462
|
{
|
|
5459
|
-
onClick: (
|
|
5460
|
-
onDoubleClick: () => lt(
|
|
5461
|
-
children: Gr(
|
|
5463
|
+
onClick: (se) => at(M, z, se),
|
|
5464
|
+
onDoubleClick: () => lt(M),
|
|
5465
|
+
children: Gr(M, F.has(M.uid))
|
|
5462
5466
|
},
|
|
5463
|
-
|
|
5467
|
+
M.uid
|
|
5464
5468
|
)) })
|
|
5465
5469
|
] }),
|
|
5466
5470
|
i && W && /* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Jr(W) })
|
|
@@ -5591,22 +5595,22 @@ var ya = ma(function(r) {
|
|
|
5591
5595
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
5592
5596
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
5593
5597
|
});
|
|
5594
|
-
const eu =
|
|
5598
|
+
const eu = Il(null);
|
|
5595
5599
|
function _a(r, e) {
|
|
5596
5600
|
return { getTheme: function() {
|
|
5597
5601
|
return e ?? null;
|
|
5598
5602
|
} };
|
|
5599
5603
|
}
|
|
5600
|
-
function
|
|
5601
|
-
const r =
|
|
5604
|
+
function Ye() {
|
|
5605
|
+
const r = Ml(eu);
|
|
5602
5606
|
return r == null && ya(8), r;
|
|
5603
5607
|
}
|
|
5604
5608
|
function Pr(r) {
|
|
5605
5609
|
return {};
|
|
5606
5610
|
}
|
|
5607
|
-
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {},
|
|
5611
|
+
const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, je = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {}, Ii = {}, au = {}, ka = {}, cu = {}, du = {}, Sa = {}, Ln = {}, Qs = {}, As = {}, Ta = {}, Ba = {}, Zr = {}, en = {}, Na = {}, Fa = {}, La = {}, Me = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pa = Me && "documentMode" in document ? document.documentMode : null, Pe = Me && /Mac|iPod|iPhone|iPad/.test(navigator.platform), mt = Me && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), hn = !(!Me || !("InputEvent" in window) || Pa) && "getTargetRanges" in new window.InputEvent("input"), Pn = Me && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Or = Me && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Oa = Me && /Android/.test(navigator.userAgent), fu = Me && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ra = Me && Oa && fu, Ys = Me && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !fu, Rr = 1, _t = 3, Tt = 0, hu = 1, Yt = 2, ja = 0, Ia = 1, Ma = 2, pn = 4, gn = 8, Xs = 128, $a = 112 | (3 | pn | gn) | Xs, Zs = 1, ei = 2, ti = 3, ri = 4, ni = 5, si = 6, On = Pn || Or || Ys ? " " : "", nt = `
|
|
5608
5612
|
|
|
5609
|
-
`, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 },
|
|
5613
|
+
`, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 }, Mi = { center: ei, end: si, justify: ri, left: Zs, right: ti, start: ni }, Va = { [ei]: "center", [si]: "end", [ri]: "justify", [Zs]: "left", [ti]: "right", [ni]: "start" }, Ka = { normal: 0, segmented: 2, token: 1 }, Ha = { [ja]: "normal", [Ma]: "segmented", [Ia]: "token" };
|
|
5610
5614
|
function Ga(r) {
|
|
5611
5615
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5612
5616
|
}
|
|
@@ -5631,7 +5635,7 @@ function cs(r, e, t) {
|
|
|
5631
5635
|
return s && (r === s || n && r.previousSibling === s) || n && jn(r, t) !== void 0;
|
|
5632
5636
|
}
|
|
5633
5637
|
function Ya(r, e, t) {
|
|
5634
|
-
const n =
|
|
5638
|
+
const n = Fe(t._window);
|
|
5635
5639
|
let s = null, o = null;
|
|
5636
5640
|
n !== null && n.anchorNode === r && (s = n.anchorOffset, o = n.focusOffset);
|
|
5637
5641
|
const i = r.nodeValue;
|
|
@@ -5645,10 +5649,10 @@ function Xa(r, e, t) {
|
|
|
5645
5649
|
return e.nodeType === _t && t.isAttached();
|
|
5646
5650
|
}
|
|
5647
5651
|
function Za(r, e, t, n) {
|
|
5648
|
-
for (let s = r; s && !fc(s); s =
|
|
5652
|
+
for (let s = r; s && !fc(s); s = Ir(s)) {
|
|
5649
5653
|
const o = jn(s, e);
|
|
5650
5654
|
if (o !== void 0) {
|
|
5651
|
-
const i =
|
|
5655
|
+
const i = ge(o, t);
|
|
5652
5656
|
if (i) return Y(i) ? void 0 : [s, i];
|
|
5653
5657
|
} else if (s === n) return [n, Cu(t)];
|
|
5654
5658
|
}
|
|
@@ -5657,10 +5661,10 @@ function mu(r, e, t) {
|
|
|
5657
5661
|
Es = !0;
|
|
5658
5662
|
const n = performance.now() - ii > Ja;
|
|
5659
5663
|
try {
|
|
5660
|
-
|
|
5661
|
-
const s =
|
|
5664
|
+
Ee(r, () => {
|
|
5665
|
+
const s = j() || function(d) {
|
|
5662
5666
|
return d.getEditorState().read(() => {
|
|
5663
|
-
const h =
|
|
5667
|
+
const h = j();
|
|
5664
5668
|
return h !== null ? h.clone() : null;
|
|
5665
5669
|
});
|
|
5666
5670
|
}(r), o = /* @__PURE__ */ new Map(), i = r.getRootElement(), u = r._editorState, l = r._blockCursorElement;
|
|
@@ -5706,7 +5710,7 @@ function mu(r, e, t) {
|
|
|
5706
5710
|
}
|
|
5707
5711
|
t.takeRecords();
|
|
5708
5712
|
}
|
|
5709
|
-
s !== null && (a && (s.dirty = !0,
|
|
5713
|
+
s !== null && (a && (s.dirty = !0, Ge(s)), mt && Su(r) && s.insertRawText(c));
|
|
5710
5714
|
});
|
|
5711
5715
|
} finally {
|
|
5712
5716
|
Es = !1;
|
|
@@ -5718,7 +5722,7 @@ function yu(r) {
|
|
|
5718
5722
|
}
|
|
5719
5723
|
function _u(r) {
|
|
5720
5724
|
(function(e) {
|
|
5721
|
-
ii === 0 &&
|
|
5725
|
+
ii === 0 && Mn(e).addEventListener("textInput", Qa, !0);
|
|
5722
5726
|
})(r), r._observer = new MutationObserver((e, t) => {
|
|
5723
5727
|
mu(r, e, t);
|
|
5724
5728
|
});
|
|
@@ -5797,7 +5801,7 @@ function vu(r) {
|
|
|
5797
5801
|
for (; e != null; ) {
|
|
5798
5802
|
const t = Rn(e);
|
|
5799
5803
|
if (ui(t)) return t;
|
|
5800
|
-
e =
|
|
5804
|
+
e = Ir(e);
|
|
5801
5805
|
}
|
|
5802
5806
|
return null;
|
|
5803
5807
|
}
|
|
@@ -5829,7 +5833,7 @@ function bu(r) {
|
|
|
5829
5833
|
}
|
|
5830
5834
|
function nc(r, e) {
|
|
5831
5835
|
if (e != null) return void (r.__key = e);
|
|
5832
|
-
|
|
5836
|
+
De(), Gu();
|
|
5833
5837
|
const t = te(), n = it(), s = "" + ec++;
|
|
5834
5838
|
n._nodeMap.set(s, r), E(r) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = hu, r.__key = s;
|
|
5835
5839
|
}
|
|
@@ -5879,16 +5883,16 @@ function xn(r) {
|
|
|
5879
5883
|
const u = e.__key;
|
|
5880
5884
|
s._dirtyType = hu, E(r) ? i.set(u, !0) : s._dirtyLeaves.add(u);
|
|
5881
5885
|
}
|
|
5882
|
-
function
|
|
5883
|
-
|
|
5886
|
+
function he(r) {
|
|
5887
|
+
De();
|
|
5884
5888
|
const e = te(), t = e._compositionKey;
|
|
5885
5889
|
if (r !== t) {
|
|
5886
5890
|
if (e._compositionKey = r, t !== null) {
|
|
5887
|
-
const n =
|
|
5891
|
+
const n = ge(t);
|
|
5888
5892
|
n !== null && n.getWritable();
|
|
5889
5893
|
}
|
|
5890
5894
|
if (r !== null) {
|
|
5891
|
-
const n =
|
|
5895
|
+
const n = ge(r);
|
|
5892
5896
|
n !== null && n.getWritable();
|
|
5893
5897
|
}
|
|
5894
5898
|
}
|
|
@@ -5896,13 +5900,13 @@ function fe(r) {
|
|
|
5896
5900
|
function ht() {
|
|
5897
5901
|
return Ur() ? null : te()._compositionKey;
|
|
5898
5902
|
}
|
|
5899
|
-
function
|
|
5903
|
+
function ge(r, e) {
|
|
5900
5904
|
const t = (e || it())._nodeMap.get(r);
|
|
5901
5905
|
return t === void 0 ? null : t;
|
|
5902
5906
|
}
|
|
5903
5907
|
function Du(r, e) {
|
|
5904
5908
|
const t = jn(r, te());
|
|
5905
|
-
return t !== void 0 ?
|
|
5909
|
+
return t !== void 0 ? ge(t, e) : null;
|
|
5906
5910
|
}
|
|
5907
5911
|
function jn(r, e) {
|
|
5908
5912
|
return r[`__lexicalKey_${e._key}`];
|
|
@@ -5912,7 +5916,7 @@ function Xt(r, e) {
|
|
|
5912
5916
|
for (; t != null; ) {
|
|
5913
5917
|
const n = Du(t, e);
|
|
5914
5918
|
if (n !== null) return n;
|
|
5915
|
-
t =
|
|
5919
|
+
t = Ir(t);
|
|
5916
5920
|
}
|
|
5917
5921
|
return null;
|
|
5918
5922
|
}
|
|
@@ -5929,8 +5933,8 @@ function re() {
|
|
|
5929
5933
|
function Cu(r) {
|
|
5930
5934
|
return r._nodeMap.get("root");
|
|
5931
5935
|
}
|
|
5932
|
-
function
|
|
5933
|
-
|
|
5936
|
+
function Ge(r) {
|
|
5937
|
+
De();
|
|
5934
5938
|
const e = it();
|
|
5935
5939
|
r !== null && (r.dirty = !0, r.setCachedNodes(null)), e._selection = r;
|
|
5936
5940
|
}
|
|
@@ -5940,11 +5944,11 @@ function Vt(r) {
|
|
|
5940
5944
|
for (; o != null; ) {
|
|
5941
5945
|
const i = jn(o, s);
|
|
5942
5946
|
if (i !== void 0) return i;
|
|
5943
|
-
o =
|
|
5947
|
+
o = Ir(o);
|
|
5944
5948
|
}
|
|
5945
5949
|
return null;
|
|
5946
5950
|
}(r, e);
|
|
5947
|
-
return t === null ? r === e.getRootElement() ?
|
|
5951
|
+
return t === null ? r === e.getRootElement() ? ge("root") : null : ge(t);
|
|
5948
5952
|
}
|
|
5949
5953
|
function Vi(r, e) {
|
|
5950
5954
|
return e ? r.getTextContentSize() : 0;
|
|
@@ -5965,7 +5969,7 @@ function ku(r) {
|
|
|
5965
5969
|
return r.nodeType === _t ? r.nodeValue : null;
|
|
5966
5970
|
}
|
|
5967
5971
|
function ai(r, e, t) {
|
|
5968
|
-
const n =
|
|
5972
|
+
const n = Fe(e._window);
|
|
5969
5973
|
if (n === null) return;
|
|
5970
5974
|
const s = n.anchorNode;
|
|
5971
5975
|
let { anchorOffset: o, focusOffset: i } = n;
|
|
@@ -5990,7 +5994,7 @@ function ci(r, e, t, n, s) {
|
|
|
5990
5994
|
const l = o.getTextContent();
|
|
5991
5995
|
if (s || u !== l) {
|
|
5992
5996
|
if (u === "") {
|
|
5993
|
-
if (
|
|
5997
|
+
if (he(null), Pn || Or || Ys) o.remove();
|
|
5994
5998
|
else {
|
|
5995
5999
|
const g = te();
|
|
5996
6000
|
setTimeout(() => {
|
|
@@ -6003,10 +6007,10 @@ function ci(r, e, t, n, s) {
|
|
|
6003
6007
|
}
|
|
6004
6008
|
const a = o.getParent(), c = zr(), f = o.getTextContentSize(), d = ht(), h = o.getKey();
|
|
6005
6009
|
if (o.isToken() || d !== null && h === d && !i || B(c) && (a !== null && !a.canInsertTextBefore() && c.anchor.offset === 0 || c.anchor.key === r.__key && c.anchor.offset === 0 && !o.canInsertTextBefore() && !i || c.focus.key === r.__key && c.focus.offset === f && !o.canInsertTextAfter() && !i)) return void o.markDirty();
|
|
6006
|
-
const p =
|
|
6010
|
+
const p = j();
|
|
6007
6011
|
if (!B(p) || t === null || n === null) return void o.setTextContent(u);
|
|
6008
6012
|
if (p.setTextNodeRange(o, t, o, n), o.isSegmented()) {
|
|
6009
|
-
const g =
|
|
6013
|
+
const g = ce(o.getTextContent());
|
|
6010
6014
|
o.replace(g), o = g;
|
|
6011
6015
|
}
|
|
6012
6016
|
o.setTextContent(u);
|
|
@@ -6029,7 +6033,7 @@ function Hi(r) {
|
|
|
6029
6033
|
return r === "ArrowRight";
|
|
6030
6034
|
}
|
|
6031
6035
|
function gr(r, e) {
|
|
6032
|
-
return
|
|
6036
|
+
return Pe ? r : e;
|
|
6033
6037
|
}
|
|
6034
6038
|
function Gi(r) {
|
|
6035
6039
|
return r === "Enter";
|
|
@@ -6045,7 +6049,7 @@ function Ji(r, e, t) {
|
|
|
6045
6049
|
}
|
|
6046
6050
|
function ic() {
|
|
6047
6051
|
const r = re();
|
|
6048
|
-
|
|
6052
|
+
Ge(xu(r.select(0, r.getChildrenSize())));
|
|
6049
6053
|
}
|
|
6050
6054
|
function br(r, e) {
|
|
6051
6055
|
r.__lexicalClassNameCache === void 0 && (r.__lexicalClassNameCache = {});
|
|
@@ -6087,20 +6091,20 @@ function Br(r, e) {
|
|
|
6087
6091
|
return null;
|
|
6088
6092
|
}
|
|
6089
6093
|
function Su(r) {
|
|
6090
|
-
const e =
|
|
6094
|
+
const e = Mn(r).event, t = e && e.inputType;
|
|
6091
6095
|
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
|
|
6092
6096
|
}
|
|
6093
6097
|
function O(r, e, t) {
|
|
6094
6098
|
return Yu(r, e, t);
|
|
6095
6099
|
}
|
|
6096
|
-
function
|
|
6097
|
-
return !
|
|
6100
|
+
function In(r) {
|
|
6101
|
+
return !_e(r) && !r.isLastChild() && !r.isInline();
|
|
6098
6102
|
}
|
|
6099
6103
|
function vn(r, e) {
|
|
6100
6104
|
const t = r._keyToDOMMap.get(e);
|
|
6101
6105
|
return t === void 0 && N(75, e), t;
|
|
6102
6106
|
}
|
|
6103
|
-
function
|
|
6107
|
+
function Ir(r) {
|
|
6104
6108
|
const e = r.assignedSlot || r.parentElement;
|
|
6105
6109
|
return e !== null && e.nodeType === 11 ? e.host : e;
|
|
6106
6110
|
}
|
|
@@ -6112,22 +6116,22 @@ function Dr(r, e) {
|
|
|
6112
6116
|
}
|
|
6113
6117
|
return !1;
|
|
6114
6118
|
}
|
|
6115
|
-
function
|
|
6119
|
+
function Mn(r) {
|
|
6116
6120
|
const e = r._window;
|
|
6117
6121
|
return e === null && N(78), e;
|
|
6118
6122
|
}
|
|
6119
6123
|
function oc(r) {
|
|
6120
6124
|
let e = r.getParentOrThrow();
|
|
6121
6125
|
for (; e !== null; ) {
|
|
6122
|
-
if (
|
|
6126
|
+
if (Je(e)) return e;
|
|
6123
6127
|
e = e.getParentOrThrow();
|
|
6124
6128
|
}
|
|
6125
6129
|
return e;
|
|
6126
6130
|
}
|
|
6127
|
-
function
|
|
6128
|
-
return
|
|
6131
|
+
function Je(r) {
|
|
6132
|
+
return _e(r) || E(r) && r.isShadowRoot();
|
|
6129
6133
|
}
|
|
6130
|
-
function
|
|
6134
|
+
function Xe(r) {
|
|
6131
6135
|
const e = te(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6132
6136
|
n === void 0 && N(200, r.constructor.name, t);
|
|
6133
6137
|
const { replace: s, replaceWithKlass: o } = n;
|
|
@@ -6138,7 +6142,7 @@ function Ye(r) {
|
|
|
6138
6142
|
return r;
|
|
6139
6143
|
}
|
|
6140
6144
|
function ds(r, e) {
|
|
6141
|
-
!
|
|
6145
|
+
!_e(r.getParent()) || E(e) || Y(e) || N(99);
|
|
6142
6146
|
}
|
|
6143
6147
|
function fs(r) {
|
|
6144
6148
|
return (Y(r) || E(r) && !r.canBeEmpty()) && !r.isInline();
|
|
@@ -6181,7 +6185,7 @@ function uc(r, e, t) {
|
|
|
6181
6185
|
}
|
|
6182
6186
|
n !== null && fi(n, r, e);
|
|
6183
6187
|
}
|
|
6184
|
-
function
|
|
6188
|
+
function Fe(r) {
|
|
6185
6189
|
return Me ? (r || window).getSelection() : null;
|
|
6186
6190
|
}
|
|
6187
6191
|
function lc(r) {
|
|
@@ -6203,7 +6207,7 @@ function bn(r) {
|
|
|
6203
6207
|
}
|
|
6204
6208
|
function dt(r) {
|
|
6205
6209
|
if (Y(r) && !r.isInline()) return !0;
|
|
6206
|
-
if (!E(r) ||
|
|
6210
|
+
if (!E(r) || Je(r)) return !1;
|
|
6207
6211
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
6208
6212
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6209
6213
|
}
|
|
@@ -6248,14 +6252,14 @@ function Tu(r, e, t, n, s, o) {
|
|
|
6248
6252
|
i.__parent === e && (E(i) && Tu(i, u, t, n, s, o), t.has(u) || o.delete(u), s.push(u)), i = i.getNextSibling();
|
|
6249
6253
|
}
|
|
6250
6254
|
}
|
|
6251
|
-
let yt,
|
|
6255
|
+
let yt, xe, Nr, $n, Ss, Ts, Nt, Ie, Bs, Fr, ue = "", ye = "", We = null, Oe = "", rt = "", Bu = !1, Lr = !1, ln = null;
|
|
6252
6256
|
function Dn(r, e) {
|
|
6253
6257
|
const t = Nt.get(r);
|
|
6254
6258
|
if (e !== null) {
|
|
6255
6259
|
const n = Ls(r);
|
|
6256
6260
|
n.parentNode === e && e.removeChild(n);
|
|
6257
6261
|
}
|
|
6258
|
-
if (
|
|
6262
|
+
if (Ie.has(r) || xe._keyToDOMMap.delete(r), E(t)) {
|
|
6259
6263
|
const n = Cn(t, Nt);
|
|
6260
6264
|
Ns(n, 0, n.length - 1, null);
|
|
6261
6265
|
}
|
|
@@ -6286,45 +6290,45 @@ function Fu(r, e) {
|
|
|
6286
6290
|
e === 0 ? wt(t, "") : e === Zs ? wt(t, "left") : e === ei ? wt(t, "center") : e === ti ? wt(t, "right") : e === ri ? wt(t, "justify") : e === ni ? wt(t, "start") : e === si && wt(t, "end");
|
|
6287
6291
|
}
|
|
6288
6292
|
function wn(r, e) {
|
|
6289
|
-
const t =
|
|
6293
|
+
const t = Ie.get(r);
|
|
6290
6294
|
t === void 0 && N(60);
|
|
6291
|
-
const n = t.createDOM(yt,
|
|
6295
|
+
const n = t.createDOM(yt, xe);
|
|
6292
6296
|
if (function(s, o, i) {
|
|
6293
6297
|
const u = i._keyToDOMMap;
|
|
6294
6298
|
(function(l, a, c) {
|
|
6295
6299
|
l[`__lexicalKey_${a._key}`] = c;
|
|
6296
6300
|
})(o, i, s), u.set(s, o);
|
|
6297
|
-
}(r, n,
|
|
6301
|
+
}(r, n, xe), L(t) ? n.setAttribute("data-lexical-text", "true") : Y(t) && n.setAttribute("data-lexical-decorator", "true"), E(t)) {
|
|
6298
6302
|
const s = t.__indent, o = t.__size;
|
|
6299
6303
|
if (s !== 0 && Nu(n, s), o !== 0) {
|
|
6300
6304
|
const u = o - 1;
|
|
6301
6305
|
(function(l, a, c, f) {
|
|
6302
|
-
const d =
|
|
6303
|
-
|
|
6304
|
-
})(Cn(t,
|
|
6306
|
+
const d = ye;
|
|
6307
|
+
ye = "", Fs(l, c, 0, a, c.getDOMSlot(f)), Pu(c, f), ye = d;
|
|
6308
|
+
})(Cn(t, Ie), u, t, n);
|
|
6305
6309
|
}
|
|
6306
6310
|
const i = t.__format;
|
|
6307
|
-
i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n),
|
|
6311
|
+
i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n), In(t) && (ue += nt, rt += nt);
|
|
6308
6312
|
} else {
|
|
6309
6313
|
const s = t.getTextContent();
|
|
6310
6314
|
if (Y(t)) {
|
|
6311
|
-
const o = t.decorate(
|
|
6315
|
+
const o = t.decorate(xe, yt);
|
|
6312
6316
|
o !== null && Ou(r, o), n.contentEditable = "false";
|
|
6313
|
-
} else L(t) && (t.isDirectionless() || (
|
|
6314
|
-
|
|
6317
|
+
} else L(t) && (t.isDirectionless() || (ye += s));
|
|
6318
|
+
ue += s, rt += s;
|
|
6315
6319
|
}
|
|
6316
6320
|
return e !== null && e.insertChild(n), di(Fr, Nr, $n, t, "created"), n;
|
|
6317
6321
|
}
|
|
6318
6322
|
function Fs(r, e, t, n, s) {
|
|
6319
|
-
const o =
|
|
6320
|
-
|
|
6323
|
+
const o = ue;
|
|
6324
|
+
ue = "";
|
|
6321
6325
|
let i = t;
|
|
6322
6326
|
for (; i <= n; ++i) {
|
|
6323
6327
|
wn(r[i], s);
|
|
6324
|
-
const u =
|
|
6325
|
-
u !== null && L(u) && (
|
|
6328
|
+
const u = Ie.get(r[i]);
|
|
6329
|
+
u !== null && L(u) && (We === null && (We = u.getFormat()), Oe === "" && (Oe = u.getStyle()));
|
|
6326
6330
|
}
|
|
6327
|
-
|
|
6331
|
+
In(e) && (ue += nt), s.element.__lexicalTextContent = ue, ue = o + ue;
|
|
6328
6332
|
}
|
|
6329
6333
|
function Zi(r, e) {
|
|
6330
6334
|
if (r) {
|
|
@@ -6338,13 +6342,13 @@ function Zi(r, e) {
|
|
|
6338
6342
|
return null;
|
|
6339
6343
|
}
|
|
6340
6344
|
function Lu(r, e, t) {
|
|
6341
|
-
const n = Zi(r, Nt), s = Zi(e,
|
|
6345
|
+
const n = Zi(r, Nt), s = Zi(e, Ie);
|
|
6342
6346
|
n !== s && e.getDOMSlot(t).setManagedLineBreak(s);
|
|
6343
6347
|
}
|
|
6344
6348
|
function Pu(r, e) {
|
|
6345
6349
|
const t = e.__lexicalDirTextContent || "", n = e.__lexicalDir || "";
|
|
6346
|
-
if (t !==
|
|
6347
|
-
const o =
|
|
6350
|
+
if (t !== ye || n !== ln) {
|
|
6351
|
+
const o = ye === "", i = o ? ln : (s = ye, za.test(s) ? "rtl" : Ua.test(s) ? "ltr" : null);
|
|
6348
6352
|
if (i !== n) {
|
|
6349
6353
|
const u = e.classList, l = yt.theme;
|
|
6350
6354
|
let a = n !== null ? l[n] : void 0, c = i !== null ? l[i] : void 0;
|
|
@@ -6368,16 +6372,16 @@ function Pu(r, e) {
|
|
|
6368
6372
|
}
|
|
6369
6373
|
Lr || (r.getWritable().__dir = i);
|
|
6370
6374
|
}
|
|
6371
|
-
ln = i, e.__lexicalDirTextContent =
|
|
6375
|
+
ln = i, e.__lexicalDirTextContent = ye, e.__lexicalDir = i;
|
|
6372
6376
|
}
|
|
6373
6377
|
var s;
|
|
6374
6378
|
}
|
|
6375
6379
|
function pc(r, e, t) {
|
|
6376
|
-
const n =
|
|
6380
|
+
const n = ye;
|
|
6377
6381
|
var s;
|
|
6378
|
-
|
|
6379
|
-
const l =
|
|
6380
|
-
|
|
6382
|
+
ye = "", We = null, Oe = "", function(o, i, u) {
|
|
6383
|
+
const l = ue, a = o.__size, c = i.__size;
|
|
6384
|
+
ue = "";
|
|
6381
6385
|
const f = u.element;
|
|
6382
6386
|
if (a === 1 && c === 1) {
|
|
6383
6387
|
const d = o.__first, h = i.__first;
|
|
@@ -6395,10 +6399,10 @@ function pc(r, e, t) {
|
|
|
6395
6399
|
}
|
|
6396
6400
|
Dn(d, null);
|
|
6397
6401
|
}
|
|
6398
|
-
const p =
|
|
6399
|
-
L(p) && (
|
|
6402
|
+
const p = Ie.get(h);
|
|
6403
|
+
L(p) && (We === null && (We = p.getFormat()), Oe === "" && (Oe = p.getStyle()));
|
|
6400
6404
|
} else {
|
|
6401
|
-
const d = Cn(o, Nt), h = Cn(i,
|
|
6405
|
+
const d = Cn(o, Nt), h = Cn(i, Ie);
|
|
6402
6406
|
if (d.length !== a && N(227), h.length !== c && N(228), a === 0) c !== 0 && Fs(h, i, 0, c - 1, u);
|
|
6403
6407
|
else if (c === 0) {
|
|
6404
6408
|
if (a !== 0) {
|
|
@@ -6413,27 +6417,27 @@ function pc(r, e, t) {
|
|
|
6413
6417
|
if ($ === I) A = hs(mr(I, w.element)), S++, P++;
|
|
6414
6418
|
else {
|
|
6415
6419
|
b === void 0 && (b = new Set(g)), k === void 0 && (k = new Set(_));
|
|
6416
|
-
const ne = k.has($),
|
|
6417
|
-
if (ne) if (
|
|
6418
|
-
const
|
|
6419
|
-
|
|
6420
|
+
const ne = k.has($), Se = b.has(I);
|
|
6421
|
+
if (ne) if (Se) {
|
|
6422
|
+
const $e = vn(xe, I);
|
|
6423
|
+
$e === A ? A = hs(mr(I, w.element)) : (w.withBefore(A).insertChild($e), mr(I, w.element)), S++, P++;
|
|
6420
6424
|
} else wn(I, w.withBefore(A)), P++;
|
|
6421
6425
|
else A = hs(Ls($)), Dn($, w.element), S++;
|
|
6422
6426
|
}
|
|
6423
|
-
const W =
|
|
6424
|
-
W !== null && L(W) && (
|
|
6427
|
+
const W = Ie.get(I);
|
|
6428
|
+
W !== null && L(W) && (We === null && (We = W.getFormat()), Oe === "" && (Oe = W.getStyle()));
|
|
6425
6429
|
}
|
|
6426
6430
|
const F = S > x, U = P > C;
|
|
6427
6431
|
if (F && !U) {
|
|
6428
|
-
const $ = _[C + 1], I = $ === void 0 ? null :
|
|
6432
|
+
const $ = _[C + 1], I = $ === void 0 ? null : xe.getElementByKey($);
|
|
6429
6433
|
Fs(_, p, P, C, w.withBefore(I));
|
|
6430
6434
|
} else U && !F && Ns(g, S, x, w.element);
|
|
6431
6435
|
})(i, d, h, a, c, u);
|
|
6432
6436
|
}
|
|
6433
|
-
|
|
6434
|
-
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) &&
|
|
6435
|
-
Zt(o) &&
|
|
6436
|
-
}(e),
|
|
6437
|
+
In(i) && (ue += nt), f.__lexicalTextContent = ue, ue = l + ue;
|
|
6438
|
+
}(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) && We != null && We !== s.__textFormat && !Lr && (s.setTextFormat(We), s.setTextStyle(Oe)), function(o) {
|
|
6439
|
+
Zt(o) && Oe !== "" && Oe !== o.__textStyle && !Lr && o.setTextStyle(Oe);
|
|
6440
|
+
}(e), ye = n;
|
|
6437
6441
|
}
|
|
6438
6442
|
function Cn(r, e) {
|
|
6439
6443
|
const t = [];
|
|
@@ -6446,18 +6450,18 @@ function Cn(r, e) {
|
|
|
6446
6450
|
}
|
|
6447
6451
|
function mr(r, e) {
|
|
6448
6452
|
const t = Nt.get(r);
|
|
6449
|
-
let n =
|
|
6453
|
+
let n = Ie.get(r);
|
|
6450
6454
|
t !== void 0 && n !== void 0 || N(61);
|
|
6451
|
-
const s = Bu || Ts.has(r) || Ss.has(r), o = vn(
|
|
6455
|
+
const s = Bu || Ts.has(r) || Ss.has(r), o = vn(xe, r);
|
|
6452
6456
|
if (t === n && !s) {
|
|
6453
6457
|
if (E(t)) {
|
|
6454
6458
|
const i = o.__lexicalTextContent;
|
|
6455
|
-
i !== void 0 && (
|
|
6459
|
+
i !== void 0 && (ue += i, rt += i);
|
|
6456
6460
|
const u = o.__lexicalDirTextContent;
|
|
6457
|
-
u !== void 0 && (
|
|
6461
|
+
u !== void 0 && (ye += u);
|
|
6458
6462
|
} else {
|
|
6459
6463
|
const i = t.getTextContent();
|
|
6460
|
-
L(t) && !t.isDirectionless() && (
|
|
6464
|
+
L(t) && !t.isDirectionless() && (ye += i), rt += i, ue += i;
|
|
6461
6465
|
}
|
|
6462
6466
|
return o;
|
|
6463
6467
|
}
|
|
@@ -6469,38 +6473,38 @@ function mr(r, e) {
|
|
|
6469
6473
|
const i = n.__indent;
|
|
6470
6474
|
i !== t.__indent && Nu(o, i);
|
|
6471
6475
|
const u = n.__format;
|
|
6472
|
-
u !== t.__format && Fu(o, u), s && (pc(t, n, o),
|
|
6476
|
+
u !== t.__format && Fu(o, u), s && (pc(t, n, o), _e(n) || n.isInline() || Lu(t, n, o)), In(n) && (ue += nt, rt += nt);
|
|
6473
6477
|
} else {
|
|
6474
6478
|
const i = n.getTextContent();
|
|
6475
6479
|
if (Y(n)) {
|
|
6476
|
-
const u = n.decorate(
|
|
6480
|
+
const u = n.decorate(xe, yt);
|
|
6477
6481
|
u !== null && Ou(r, u);
|
|
6478
|
-
} else L(n) && !n.isDirectionless() && (
|
|
6479
|
-
|
|
6482
|
+
} else L(n) && !n.isDirectionless() && (ye += i);
|
|
6483
|
+
ue += i, rt += i;
|
|
6480
6484
|
}
|
|
6481
|
-
if (!Lr &&
|
|
6485
|
+
if (!Lr && _e(n) && n.__cachedText !== rt) {
|
|
6482
6486
|
const i = n.getWritable();
|
|
6483
6487
|
i.__cachedText = rt, n = i;
|
|
6484
6488
|
}
|
|
6485
6489
|
return o;
|
|
6486
6490
|
}
|
|
6487
6491
|
function Ou(r, e) {
|
|
6488
|
-
let t =
|
|
6489
|
-
const n =
|
|
6492
|
+
let t = xe._pendingDecorators;
|
|
6493
|
+
const n = xe._decorators;
|
|
6490
6494
|
if (t === null) {
|
|
6491
6495
|
if (n[r] === e) return;
|
|
6492
|
-
t = wu(
|
|
6496
|
+
t = wu(xe);
|
|
6493
6497
|
}
|
|
6494
6498
|
t[r] = e;
|
|
6495
6499
|
}
|
|
6496
6500
|
function hs(r) {
|
|
6497
6501
|
let e = r.nextSibling;
|
|
6498
|
-
return e !== null && e ===
|
|
6502
|
+
return e !== null && e === xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6499
6503
|
}
|
|
6500
6504
|
function gc(r, e, t, n, s, o) {
|
|
6501
|
-
|
|
6505
|
+
ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap, Ie = e._nodeMap, Lr = e._readOnly, Bs = new Map(t._keyToDOMMap);
|
|
6502
6506
|
const i = /* @__PURE__ */ new Map();
|
|
6503
|
-
return Fr = i, mr("root", null),
|
|
6507
|
+
return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0, Ie = void 0, yt = void 0, Bs = void 0, Fr = void 0, i;
|
|
6504
6508
|
}
|
|
6505
6509
|
function Ls(r) {
|
|
6506
6510
|
const e = Bs.get(r);
|
|
@@ -6539,41 +6543,41 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6539
6543
|
return u === " ";
|
|
6540
6544
|
}(t)) O(e, wa, r);
|
|
6541
6545
|
else if (function(u, l) {
|
|
6542
|
-
return
|
|
6546
|
+
return Pe && l && u.toLowerCase() === "o";
|
|
6543
6547
|
}(t, s)) r.preventDefault(), Cr = !0, O(e, Ht, !0);
|
|
6544
6548
|
else if (function(u, l) {
|
|
6545
6549
|
return Gi(u) && !l;
|
|
6546
6550
|
}(t, n)) Cr = !1, O(e, fn, r);
|
|
6547
6551
|
else if (function(u, l, a, c) {
|
|
6548
|
-
return
|
|
6552
|
+
return Pe ? !l && !a && (ar(u) || u.toLowerCase() === "h" && c) : !(c || l || a) && ar(u);
|
|
6549
6553
|
}(t, i, o, s)) ar(t) ? O(e, ou, r) : (r.preventDefault(), O(e, Et, !0));
|
|
6550
6554
|
else if (/* @__PURE__ */ function(u) {
|
|
6551
6555
|
return u === "Escape";
|
|
6552
6556
|
}(t)) O(e, uu, r);
|
|
6553
6557
|
else if (function(u, l, a, c, f) {
|
|
6554
|
-
return
|
|
6558
|
+
return Pe ? !(a || c || f) && (cr(u) || u.toLowerCase() === "d" && l) : !(l || c || f) && cr(u);
|
|
6555
6559
|
}(t, s, n, i, o)) cr(t) ? O(e, lu, r) : (r.preventDefault(), O(e, Et, !1));
|
|
6556
6560
|
else if (function(u, l, a) {
|
|
6557
|
-
return ar(u) && (
|
|
6561
|
+
return ar(u) && (Pe ? l : a);
|
|
6558
6562
|
}(t, i, s)) r.preventDefault(), O(e, Sr, !0);
|
|
6559
6563
|
else if (function(u, l, a) {
|
|
6560
|
-
return cr(u) && (
|
|
6564
|
+
return cr(u) && (Pe ? l : a);
|
|
6561
6565
|
}(t, i, s)) r.preventDefault(), O(e, Sr, !1);
|
|
6562
6566
|
else if (function(u, l) {
|
|
6563
|
-
return
|
|
6567
|
+
return Pe && l && ar(u);
|
|
6564
6568
|
}(t, o)) r.preventDefault(), O(e, Tr, !0);
|
|
6565
6569
|
else if (function(u, l) {
|
|
6566
|
-
return
|
|
6570
|
+
return Pe && l && cr(u);
|
|
6567
6571
|
}(t, o)) r.preventDefault(), O(e, Tr, !1);
|
|
6568
6572
|
else if (function(u, l, a, c) {
|
|
6569
6573
|
return u.toLowerCase() === "b" && !l && gr(a, c);
|
|
6570
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6574
|
+
}(t, i, o, s)) r.preventDefault(), O(e, je, "bold");
|
|
6571
6575
|
else if (function(u, l, a, c) {
|
|
6572
6576
|
return u.toLowerCase() === "u" && !l && gr(a, c);
|
|
6573
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6577
|
+
}(t, i, o, s)) r.preventDefault(), O(e, je, "underline");
|
|
6574
6578
|
else if (function(u, l, a, c) {
|
|
6575
6579
|
return u.toLowerCase() === "i" && !l && gr(a, c);
|
|
6576
|
-
}(t, i, o, s)) r.preventDefault(), O(e,
|
|
6580
|
+
}(t, i, o, s)) r.preventDefault(), O(e, je, "italic");
|
|
6577
6581
|
else if (/* @__PURE__ */ function(u, l, a, c) {
|
|
6578
6582
|
return u === "Tab" && !l && !a && !c;
|
|
6579
6583
|
}(t, i, s, o)) O(e, Ca, r);
|
|
@@ -6581,14 +6585,14 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6581
6585
|
return u.toLowerCase() === "z" && !l && gr(a, c);
|
|
6582
6586
|
}(t, n, o, s)) r.preventDefault(), O(e, Gs, void 0);
|
|
6583
6587
|
else if (function(u, l, a, c) {
|
|
6584
|
-
return
|
|
6588
|
+
return Pe ? u.toLowerCase() === "z" && a && l : u.toLowerCase() === "y" && c || u.toLowerCase() === "z" && c && l;
|
|
6585
6589
|
}(t, n, o, s)) r.preventDefault(), O(e, Js, void 0);
|
|
6586
6590
|
else {
|
|
6587
6591
|
const u = e._editorState._selection;
|
|
6588
6592
|
u === null || B(u) ? !mt && Ji(t, o, s) && (r.preventDefault(), O(e, As, r)) : function(l, a, c, f) {
|
|
6589
|
-
return !a && l.toLowerCase() === "c" && (
|
|
6593
|
+
return !a && l.toLowerCase() === "c" && (Pe ? c : f);
|
|
6590
6594
|
}(t, n, o, s) ? (r.preventDefault(), O(e, Ln, r)) : function(l, a, c, f) {
|
|
6591
|
-
return !a && l.toLowerCase() === "x" && (
|
|
6595
|
+
return !a && l.toLowerCase() === "x" && (Pe ? c : f);
|
|
6592
6596
|
}(t, n, o, s) ? (r.preventDefault(), O(e, Qs, r)) : Ji(t, o, s) && (r.preventDefault(), O(e, As, r));
|
|
6593
6597
|
}
|
|
6594
6598
|
/* @__PURE__ */ (function(u, l, a, c) {
|
|
@@ -6597,48 +6601,48 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6597
6601
|
}
|
|
6598
6602
|
}], ["pointerdown", function(r, e) {
|
|
6599
6603
|
const t = r.target, n = r.pointerType;
|
|
6600
|
-
t instanceof Node && n !== "touch" &&
|
|
6604
|
+
t instanceof Node && n !== "touch" && Ee(e, () => {
|
|
6601
6605
|
Y(Xt(t)) || (js = !0);
|
|
6602
6606
|
});
|
|
6603
6607
|
}], ["compositionstart", function(r, e) {
|
|
6604
|
-
|
|
6605
|
-
const t =
|
|
6608
|
+
Ee(e, () => {
|
|
6609
|
+
const t = j();
|
|
6606
6610
|
if (B(t) && !e.isComposing()) {
|
|
6607
6611
|
const n = t.anchor, s = t.anchor.getNode();
|
|
6608
|
-
|
|
6612
|
+
he(n.key), (r.timeStamp < wr + Ps || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || L(s) && s.getStyle() !== t.style) && O(e, Gt, qa);
|
|
6609
6613
|
}
|
|
6610
6614
|
});
|
|
6611
6615
|
}], ["compositionend", function(r, e) {
|
|
6612
|
-
mt ? fr = !0 :
|
|
6616
|
+
mt ? fr = !0 : Ee(e, () => {
|
|
6613
6617
|
ps(e, r.data);
|
|
6614
6618
|
});
|
|
6615
6619
|
}], ["input", function(r, e) {
|
|
6616
|
-
r.stopPropagation(),
|
|
6617
|
-
const t =
|
|
6618
|
-
if (n != null && B(t) &&
|
|
6620
|
+
r.stopPropagation(), Ee(e, () => {
|
|
6621
|
+
const t = j(), n = r.data, s = $u(r);
|
|
6622
|
+
if (n != null && B(t) && Mu(t, s, n, r.timeStamp, !1)) {
|
|
6619
6623
|
fr && (ps(e, n), fr = !1);
|
|
6620
|
-
const o = t.anchor.getNode(), i =
|
|
6624
|
+
const o = t.anchor.getNode(), i = Fe(e._window);
|
|
6621
6625
|
if (i === null) return;
|
|
6622
6626
|
const u = t.isBackward(), l = u ? t.anchor.offset : t.focus.offset, a = u ? t.focus.offset : t.anchor.offset;
|
|
6623
6627
|
hn && !t.isCollapsed() && L(o) && i.anchorNode !== null && o.getTextContent().slice(0, l) + n + o.getTextContent().slice(l + a) === ku(i.anchorNode) || O(e, Gt, n);
|
|
6624
6628
|
const c = n.length;
|
|
6625
|
-
mt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), Pn || Or || Ys || !e.isComposing() || (wr = 0,
|
|
6629
|
+
mt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), Pn || Or || Ys || !e.isComposing() || (wr = 0, he(null));
|
|
6626
6630
|
} else
|
|
6627
6631
|
ai(!1, e, n !== null ? n : void 0), fr && (ps(e, n || void 0), fr = !1);
|
|
6628
|
-
|
|
6632
|
+
De(), yu(te());
|
|
6629
6633
|
}), Wt = null;
|
|
6630
6634
|
}], ["click", function(r, e) {
|
|
6631
|
-
|
|
6632
|
-
const t =
|
|
6635
|
+
Ee(e, () => {
|
|
6636
|
+
const t = j(), n = Fe(e._window), s = zr();
|
|
6633
6637
|
if (n) {
|
|
6634
6638
|
if (B(t)) {
|
|
6635
6639
|
const o = t.anchor, i = o.getNode();
|
|
6636
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !
|
|
6640
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !_e(i) && re().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (E(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6637
6641
|
} else if (r.pointerType === "touch") {
|
|
6638
6642
|
const o = n.anchorNode;
|
|
6639
6643
|
if (o !== null) {
|
|
6640
6644
|
const i = o.nodeType;
|
|
6641
|
-
(i === Rr || i === _t) &&
|
|
6645
|
+
(i === Rr || i === _t) && Ge(mi(s, n, e, r));
|
|
6642
6646
|
}
|
|
6643
6647
|
}
|
|
6644
6648
|
}
|
|
@@ -6647,27 +6651,27 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
|
|
|
6647
6651
|
}], ["cut", tt], ["copy", tt], ["dragstart", tt], ["dragover", tt], ["dragend", tt], ["paste", tt], ["focus", tt], ["blur", tt], ["drop", tt]];
|
|
6648
6652
|
hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
6649
6653
|
const s = t.inputType, o = $u(t);
|
|
6650
|
-
s === "deleteCompositionText" || mt && Su(n) || s !== "insertCompositionText" &&
|
|
6651
|
-
const i =
|
|
6654
|
+
s === "deleteCompositionText" || mt && Su(n) || s !== "insertCompositionText" && Ee(n, () => {
|
|
6655
|
+
const i = j();
|
|
6652
6656
|
if (s === "deleteContentBackward") {
|
|
6653
6657
|
if (i === null) {
|
|
6654
6658
|
const h = zr();
|
|
6655
6659
|
if (!B(h)) return;
|
|
6656
|
-
|
|
6660
|
+
Ge(h.clone());
|
|
6657
6661
|
}
|
|
6658
6662
|
if (B(i)) {
|
|
6659
6663
|
const h = i.anchor.key === i.focus.key;
|
|
6660
6664
|
if (u = t.timeStamp, Ru === "MediaLast" && u < wr + Ps && n.isComposing() && h) {
|
|
6661
|
-
if (
|
|
6662
|
-
|
|
6663
|
-
|
|
6665
|
+
if (he(null), wr = 0, setTimeout(() => {
|
|
6666
|
+
Ee(n, () => {
|
|
6667
|
+
he(null);
|
|
6664
6668
|
});
|
|
6665
6669
|
}, Ps), B(i)) {
|
|
6666
6670
|
const p = i.anchor.getNode();
|
|
6667
6671
|
p.markDirty(), i.format = p.getFormat(), L(p) || N(142), i.style = p.getStyle();
|
|
6668
6672
|
}
|
|
6669
6673
|
} else {
|
|
6670
|
-
|
|
6674
|
+
he(null), t.preventDefault();
|
|
6671
6675
|
const p = i.anchor.getNode(), g = p.getTextContent(), _ = p.canInsertTextAfter(), D = i.anchor.offset === 0 && i.focus.offset === g.length;
|
|
6672
6676
|
Ra && h && !D && _ || O(n, Et, !0);
|
|
6673
6677
|
}
|
|
@@ -6677,7 +6681,7 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6677
6681
|
var u;
|
|
6678
6682
|
if (!B(i)) return;
|
|
6679
6683
|
const l = t.data;
|
|
6680
|
-
Wt !== null && ai(!1, n, Wt), i.dirty && Wt === null || !i.isCollapsed() ||
|
|
6684
|
+
Wt !== null && ai(!1, n, Wt), i.dirty && Wt === null || !i.isCollapsed() || _e(i.anchor.getNode()) || o === null || i.applyDOMRange(o), Wt = null;
|
|
6681
6685
|
const a = i.anchor, c = i.focus, f = a.getNode(), d = c.getNode();
|
|
6682
6686
|
if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
|
|
6683
6687
|
case "insertFromYank":
|
|
@@ -6686,13 +6690,13 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6686
6690
|
O(n, Gt, t);
|
|
6687
6691
|
break;
|
|
6688
6692
|
case "insertFromComposition":
|
|
6689
|
-
|
|
6693
|
+
he(null), O(n, Gt, t);
|
|
6690
6694
|
break;
|
|
6691
6695
|
case "insertLineBreak":
|
|
6692
|
-
|
|
6696
|
+
he(null), O(n, Ht, !1);
|
|
6693
6697
|
break;
|
|
6694
6698
|
case "insertParagraph":
|
|
6695
|
-
|
|
6699
|
+
he(null), Cr && !Or ? (Cr = !1, O(n, Ht, !1)) : O(n, kr, void 0);
|
|
6696
6700
|
break;
|
|
6697
6701
|
case "insertFromPaste":
|
|
6698
6702
|
case "insertFromPasteAsQuotation":
|
|
@@ -6726,16 +6730,16 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6726
6730
|
O(n, Tr, !1);
|
|
6727
6731
|
break;
|
|
6728
6732
|
case "formatStrikeThrough":
|
|
6729
|
-
O(n,
|
|
6733
|
+
O(n, je, "strikethrough");
|
|
6730
6734
|
break;
|
|
6731
6735
|
case "formatBold":
|
|
6732
|
-
O(n,
|
|
6736
|
+
O(n, je, "bold");
|
|
6733
6737
|
break;
|
|
6734
6738
|
case "formatItalic":
|
|
6735
|
-
O(n,
|
|
6739
|
+
O(n, je, "italic");
|
|
6736
6740
|
break;
|
|
6737
6741
|
case "formatUnderline":
|
|
6738
|
-
O(n,
|
|
6742
|
+
O(n, je, "underline");
|
|
6739
6743
|
break;
|
|
6740
6744
|
case "historyUndo":
|
|
6741
6745
|
O(n, Gs, void 0);
|
|
@@ -6750,16 +6754,16 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6750
6754
|
else if (l == null && t.dataTransfer) {
|
|
6751
6755
|
const h = t.dataTransfer.getData("text/plain");
|
|
6752
6756
|
t.preventDefault(), i.insertRawText(h);
|
|
6753
|
-
} else l != null &&
|
|
6757
|
+
} else l != null && Mu(i, o, l, t.timeStamp, !0) ? (t.preventDefault(), O(n, Gt, l)) : Wt = l;
|
|
6754
6758
|
ju = t.timeStamp;
|
|
6755
6759
|
}
|
|
6756
6760
|
});
|
|
6757
6761
|
}(r, e)]);
|
|
6758
6762
|
let wr = 0, Ru = null, ju = 0, Wt = null;
|
|
6759
6763
|
const An = /* @__PURE__ */ new WeakMap();
|
|
6760
|
-
let Rs = !1, js = !1, Cr = !1, fr = !1,
|
|
6761
|
-
function
|
|
6762
|
-
const o = r.anchor, i = r.focus, u = o.getNode(), l = te(), a =
|
|
6764
|
+
let Rs = !1, js = !1, Cr = !1, fr = !1, Iu = [0, "", 0, "root", 0];
|
|
6765
|
+
function Mu(r, e, t, n, s) {
|
|
6766
|
+
const o = r.anchor, i = r.focus, u = o.getNode(), l = te(), a = Fe(l._window), c = a !== null ? a.anchorNode : null, f = o.key, d = l.getElementByKey(f), h = t.length;
|
|
6763
6767
|
return f !== i.key || !L(u) || (!s && (!hn || ju < n + 50) || u.isDirty() && h < 2 || Au(t)) && o.offset !== i.offset && !u.isComposing() || Ct(u) || u.isDirty() && h > 1 || (s || !hn) && d !== null && !u.isComposing() && c !== yn(d) || a !== null && e !== null && (!e.collapsed || e.startContainer !== a.anchorNode || e.startOffset !== a.anchorOffset) || u.getFormat() !== r.format || u.getStyle() !== r.style || sc(r, u);
|
|
6764
6768
|
}
|
|
6765
6769
|
function eo(r, e) {
|
|
@@ -6767,15 +6771,15 @@ function eo(r, e) {
|
|
|
6767
6771
|
}
|
|
6768
6772
|
function to(r, e, t) {
|
|
6769
6773
|
const { anchorNode: n, anchorOffset: s, focusNode: o, focusOffset: i } = r;
|
|
6770
|
-
Rs && (Rs = !1, eo(n, s) && eo(o, i)) ||
|
|
6771
|
-
if (!t) return void
|
|
6774
|
+
Rs && (Rs = !1, eo(n, s) && eo(o, i)) || Ee(e, () => {
|
|
6775
|
+
if (!t) return void Ge(null);
|
|
6772
6776
|
if (!jr(e, n, o)) return;
|
|
6773
|
-
const u =
|
|
6777
|
+
const u = j();
|
|
6774
6778
|
if (B(u)) {
|
|
6775
6779
|
const l = u.anchor, a = l.getNode();
|
|
6776
6780
|
if (u.isCollapsed()) {
|
|
6777
6781
|
r.type === "Range" && r.anchorNode === r.focusNode && (u.dirty = !0);
|
|
6778
|
-
const c =
|
|
6782
|
+
const c = Mn(e).event, f = c ? c.timeStamp : performance.now(), [d, h, p, g, _] = Iu, D = re(), y = e.isComposing() === !1 && D.getTextContent() === "";
|
|
6779
6783
|
if (f < _ + 200 && l.offset === p && l.key === g) u.format = d, u.style = h;
|
|
6780
6784
|
else if (l.type === "text") L(a) || N(141), u.format = a.getFormat(), u.style = a.getStyle();
|
|
6781
6785
|
else if (l.type === "element" && !y) {
|
|
@@ -6802,14 +6806,14 @@ function $u(r) {
|
|
|
6802
6806
|
}
|
|
6803
6807
|
function ps(r, e) {
|
|
6804
6808
|
const t = r._compositionKey;
|
|
6805
|
-
if (
|
|
6809
|
+
if (he(null), t !== null && e != null) {
|
|
6806
6810
|
if (e === "") {
|
|
6807
|
-
const n =
|
|
6811
|
+
const n = ge(t), s = yn(r.getElementByKey(t));
|
|
6808
6812
|
return void (s !== null && s.nodeValue !== null && L(n) && ci(n, s.nodeValue, null, null, !0));
|
|
6809
6813
|
}
|
|
6810
6814
|
if (e[e.length - 1] === `
|
|
6811
6815
|
`) {
|
|
6812
|
-
const n =
|
|
6816
|
+
const n = j();
|
|
6813
6817
|
if (B(n)) {
|
|
6814
6818
|
const s = n.focus;
|
|
6815
6819
|
return n.anchor.set(s.key, s.offset, s.type), void O(r, fn, null);
|
|
@@ -6824,15 +6828,15 @@ function qu(r) {
|
|
|
6824
6828
|
}
|
|
6825
6829
|
const Jt = /* @__PURE__ */ new Map();
|
|
6826
6830
|
function zu(r) {
|
|
6827
|
-
const e = r.target, t =
|
|
6831
|
+
const e = r.target, t = Fe(e == null ? null : e.nodeType === 9 ? e.defaultView : e.ownerDocument.defaultView);
|
|
6828
6832
|
if (t === null) return;
|
|
6829
6833
|
const n = vu(t.anchorNode);
|
|
6830
6834
|
if (n === null) return;
|
|
6831
|
-
js && (js = !1,
|
|
6835
|
+
js && (js = !1, Ee(n, () => {
|
|
6832
6836
|
const a = zr(), c = t.anchorNode;
|
|
6833
6837
|
if (c === null) return;
|
|
6834
6838
|
const f = c.nodeType;
|
|
6835
|
-
f !== Rr && f !== _t ||
|
|
6839
|
+
f !== Rr && f !== _t || Ge(mi(a, t, n, r));
|
|
6836
6840
|
}));
|
|
6837
6841
|
const s = li(n), o = s[s.length - 1], i = o._key, u = Jt.get(i), l = u || o;
|
|
6838
6842
|
l !== n && to(t, l, !1), to(t, n, !0), n !== o ? Jt.set(i, n) : u && Jt.delete(i);
|
|
@@ -6859,12 +6863,12 @@ function mc(r) {
|
|
|
6859
6863
|
for (let i = 0; i < o.length; i++) o[i]();
|
|
6860
6864
|
r.__lexicalEventHandles = [];
|
|
6861
6865
|
}
|
|
6862
|
-
function
|
|
6863
|
-
|
|
6866
|
+
function Is(r, e, t) {
|
|
6867
|
+
De();
|
|
6864
6868
|
const n = r.__key, s = r.getParent();
|
|
6865
6869
|
if (s === null) return;
|
|
6866
6870
|
const o = function(u) {
|
|
6867
|
-
const l =
|
|
6871
|
+
const l = j();
|
|
6868
6872
|
if (!B(l) || !E(u)) return l;
|
|
6869
6873
|
const { anchor: a, focus: c } = l, f = a.getNode(), d = c.getNode();
|
|
6870
6874
|
return Dr(f, u) && a.set(u.__key, 0, "element"), Dr(d, u) && c.set(u.__key, 0, "element"), l;
|
|
@@ -6873,12 +6877,12 @@ function Ms(r, e, t) {
|
|
|
6873
6877
|
if (B(o) && e) {
|
|
6874
6878
|
const u = o.anchor, l = o.focus;
|
|
6875
6879
|
u.key === n && (kn(u, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0), l.key === n && (kn(l, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0);
|
|
6876
|
-
} else
|
|
6880
|
+
} else Ve(o) && e && r.isSelected() && r.selectPrevious();
|
|
6877
6881
|
if (B(o) && e && !i) {
|
|
6878
6882
|
const u = r.getIndexWithinParent();
|
|
6879
6883
|
kt(r), En(o, s, u, -1);
|
|
6880
6884
|
} else kt(r);
|
|
6881
|
-
t ||
|
|
6885
|
+
t || Je(s) || s.canBeEmpty() || !s.isEmpty() || Is(s, e), e && _e(s) && s.isEmpty() && s.selectEnd();
|
|
6882
6886
|
}
|
|
6883
6887
|
class qn {
|
|
6884
6888
|
static getType() {
|
|
@@ -6903,14 +6907,14 @@ class qn {
|
|
|
6903
6907
|
let e = this.__key;
|
|
6904
6908
|
for (; e !== null; ) {
|
|
6905
6909
|
if (e === "root") return !0;
|
|
6906
|
-
const t =
|
|
6910
|
+
const t = ge(e);
|
|
6907
6911
|
if (t === null) break;
|
|
6908
6912
|
e = t.__parent;
|
|
6909
6913
|
}
|
|
6910
6914
|
return !1;
|
|
6911
6915
|
}
|
|
6912
6916
|
isSelected(e) {
|
|
6913
|
-
const t = e ||
|
|
6917
|
+
const t = e || j();
|
|
6914
6918
|
if (t == null) return !1;
|
|
6915
6919
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
6916
6920
|
if (L(this)) return n;
|
|
@@ -6939,7 +6943,7 @@ class qn {
|
|
|
6939
6943
|
}
|
|
6940
6944
|
getParent() {
|
|
6941
6945
|
const e = this.getLatest().__parent;
|
|
6942
|
-
return e === null ? null :
|
|
6946
|
+
return e === null ? null : ge(e);
|
|
6943
6947
|
}
|
|
6944
6948
|
getParentOrThrow() {
|
|
6945
6949
|
const e = this.getParent();
|
|
@@ -6949,7 +6953,7 @@ class qn {
|
|
|
6949
6953
|
let e = this;
|
|
6950
6954
|
for (; e !== null; ) {
|
|
6951
6955
|
const t = e.getParent();
|
|
6952
|
-
if (
|
|
6956
|
+
if (Je(t)) return E(e) || e === this && Y(e) || N(194), e;
|
|
6953
6957
|
e = t;
|
|
6954
6958
|
}
|
|
6955
6959
|
return null;
|
|
@@ -6972,7 +6976,7 @@ class qn {
|
|
|
6972
6976
|
}
|
|
6973
6977
|
getPreviousSibling() {
|
|
6974
6978
|
const e = this.getLatest().__prev;
|
|
6975
|
-
return e === null ? null :
|
|
6979
|
+
return e === null ? null : ge(e);
|
|
6976
6980
|
}
|
|
6977
6981
|
getPreviousSiblings() {
|
|
6978
6982
|
const e = [], t = this.getParent();
|
|
@@ -6983,7 +6987,7 @@ class qn {
|
|
|
6983
6987
|
}
|
|
6984
6988
|
getNextSibling() {
|
|
6985
6989
|
const e = this.getLatest().__next;
|
|
6986
|
-
return e === null ? null :
|
|
6990
|
+
return e === null ? null : ge(e);
|
|
6987
6991
|
}
|
|
6988
6992
|
getNextSiblings() {
|
|
6989
6993
|
const e = [];
|
|
@@ -7072,12 +7076,12 @@ class qn {
|
|
|
7072
7076
|
return e !== null && e.has(this.__key);
|
|
7073
7077
|
}
|
|
7074
7078
|
getLatest() {
|
|
7075
|
-
const e =
|
|
7079
|
+
const e = ge(this.__key);
|
|
7076
7080
|
return e === null && N(113), e;
|
|
7077
7081
|
}
|
|
7078
7082
|
getWritable() {
|
|
7079
|
-
|
|
7080
|
-
const e = it(), t = te(), n = e._nodeMap, s = this.__key, o = this.getLatest(), i = t._cloneNotNeeded, u =
|
|
7083
|
+
De();
|
|
7084
|
+
const e = it(), t = te(), n = e._nodeMap, s = this.__key, o = this.getLatest(), i = t._cloneNotNeeded, u = j();
|
|
7081
7085
|
if (u !== null && u.setCachedNodes(null), i.has(s)) return xn(o), o;
|
|
7082
7086
|
const l = hi(o);
|
|
7083
7087
|
return i.add(s), xn(l), n.set(s, l), l;
|
|
@@ -7107,27 +7111,27 @@ class qn {
|
|
|
7107
7111
|
return null;
|
|
7108
7112
|
}
|
|
7109
7113
|
remove(e) {
|
|
7110
|
-
|
|
7114
|
+
Is(this, !0, e);
|
|
7111
7115
|
}
|
|
7112
7116
|
replace(e, t) {
|
|
7113
|
-
|
|
7114
|
-
let n =
|
|
7117
|
+
De();
|
|
7118
|
+
let n = j();
|
|
7115
7119
|
n !== null && (n = n.clone()), ds(this, e);
|
|
7116
7120
|
const s = this.getLatest(), o = this.__key, i = e.__key, u = e.getWritable(), l = this.getParentOrThrow().getWritable(), a = l.__size;
|
|
7117
7121
|
kt(u);
|
|
7118
7122
|
const c = s.getPreviousSibling(), f = s.getNextSibling(), d = s.__prev, h = s.__next, p = s.__parent;
|
|
7119
|
-
if (
|
|
7123
|
+
if (Is(s, !1, !0), c === null ? l.__first = i : c.getWritable().__next = i, u.__prev = d, f === null ? l.__last = i : f.getWritable().__prev = i, u.__next = h, u.__parent = p, l.__size = a, t && (E(this) && E(u) || N(139), this.getChildren().forEach((g) => {
|
|
7120
7124
|
u.append(g);
|
|
7121
7125
|
})), B(n)) {
|
|
7122
|
-
|
|
7126
|
+
Ge(n);
|
|
7123
7127
|
const g = n.anchor, _ = n.focus;
|
|
7124
7128
|
g.key === o && uo(g, u), _.key === o && uo(_, u);
|
|
7125
7129
|
}
|
|
7126
|
-
return ht() === o &&
|
|
7130
|
+
return ht() === o && he(i), u;
|
|
7127
7131
|
}
|
|
7128
7132
|
insertAfter(e, t = !0) {
|
|
7129
|
-
|
|
7130
|
-
const n = this.getWritable(), s = e.getWritable(), o = s.getParent(), i =
|
|
7133
|
+
De(), ds(this, e);
|
|
7134
|
+
const n = this.getWritable(), s = e.getWritable(), o = s.getParent(), i = j();
|
|
7131
7135
|
let u = !1, l = !1;
|
|
7132
7136
|
if (o !== null) {
|
|
7133
7137
|
const h = e.getIndexWithinParent();
|
|
@@ -7146,19 +7150,19 @@ class qn {
|
|
|
7146
7150
|
return e;
|
|
7147
7151
|
}
|
|
7148
7152
|
insertBefore(e, t = !0) {
|
|
7149
|
-
|
|
7153
|
+
De(), ds(this, e);
|
|
7150
7154
|
const n = this.getWritable(), s = e.getWritable(), o = s.__key;
|
|
7151
7155
|
kt(s);
|
|
7152
7156
|
const i = this.getPreviousSibling(), u = this.getParentOrThrow().getWritable(), l = n.__prev, a = this.getIndexWithinParent();
|
|
7153
7157
|
i === null ? u.__first = o : i.getWritable().__next = o, u.__size++, n.__prev = o, s.__prev = l, s.__next = n.__key, s.__parent = n.__parent;
|
|
7154
|
-
const c =
|
|
7158
|
+
const c = j();
|
|
7155
7159
|
return t && B(c) && En(c, this.getParentOrThrow(), a), e;
|
|
7156
7160
|
}
|
|
7157
7161
|
isParentRequired() {
|
|
7158
7162
|
return !1;
|
|
7159
7163
|
}
|
|
7160
7164
|
createParentElementNode() {
|
|
7161
|
-
return
|
|
7165
|
+
return le();
|
|
7162
7166
|
}
|
|
7163
7167
|
selectStart() {
|
|
7164
7168
|
return this.selectPrevious();
|
|
@@ -7167,7 +7171,7 @@ class qn {
|
|
|
7167
7171
|
return this.selectNext(0, 0);
|
|
7168
7172
|
}
|
|
7169
7173
|
selectPrevious(e, t) {
|
|
7170
|
-
|
|
7174
|
+
De();
|
|
7171
7175
|
const n = this.getPreviousSibling(), s = this.getParentOrThrow();
|
|
7172
7176
|
if (n === null) return s.select(0, 0);
|
|
7173
7177
|
if (E(n)) return n.select();
|
|
@@ -7178,7 +7182,7 @@ class qn {
|
|
|
7178
7182
|
return n.select(e, t);
|
|
7179
7183
|
}
|
|
7180
7184
|
selectNext(e, t) {
|
|
7181
|
-
|
|
7185
|
+
De();
|
|
7182
7186
|
const n = this.getNextSibling(), s = this.getParentOrThrow();
|
|
7183
7187
|
if (n === null) return s.select();
|
|
7184
7188
|
if (E(n)) return n.select(0, 0);
|
|
@@ -7195,12 +7199,12 @@ class qn {
|
|
|
7195
7199
|
this.markDirty();
|
|
7196
7200
|
}
|
|
7197
7201
|
}
|
|
7198
|
-
class
|
|
7202
|
+
class Mr extends qn {
|
|
7199
7203
|
static getType() {
|
|
7200
7204
|
return "linebreak";
|
|
7201
7205
|
}
|
|
7202
7206
|
static clone(e) {
|
|
7203
|
-
return new
|
|
7207
|
+
return new Mr(e.__key);
|
|
7204
7208
|
}
|
|
7205
7209
|
constructor(e) {
|
|
7206
7210
|
super(e);
|
|
@@ -7248,10 +7252,10 @@ function yc(r) {
|
|
|
7248
7252
|
return { node: Ft() };
|
|
7249
7253
|
}
|
|
7250
7254
|
function Ft() {
|
|
7251
|
-
return
|
|
7255
|
+
return Xe(new Mr());
|
|
7252
7256
|
}
|
|
7253
7257
|
function St(r) {
|
|
7254
|
-
return r instanceof
|
|
7258
|
+
return r instanceof Mr;
|
|
7255
7259
|
}
|
|
7256
7260
|
function tn(r) {
|
|
7257
7261
|
return r.nodeType === _t && /^( |\t|\r?\n)+$/.test(r.textContent || "");
|
|
@@ -7390,7 +7394,7 @@ class tr extends qn {
|
|
|
7390
7394
|
return { "#text": () => ({ conversion: bc, priority: 0 }), b: () => ({ conversion: xc, priority: 0 }), code: () => ({ conversion: ct, priority: 0 }), em: () => ({ conversion: ct, priority: 0 }), i: () => ({ conversion: ct, priority: 0 }), s: () => ({ conversion: ct, priority: 0 }), span: () => ({ conversion: _c, priority: 0 }), strong: () => ({ conversion: ct, priority: 0 }), sub: () => ({ conversion: ct, priority: 0 }), sup: () => ({ conversion: ct, priority: 0 }), u: () => ({ conversion: ct, priority: 0 }) };
|
|
7391
7395
|
}
|
|
7392
7396
|
static importJSON(e) {
|
|
7393
|
-
const t =
|
|
7397
|
+
const t = ce(e.text);
|
|
7394
7398
|
return t.setFormat(e.format), t.setDetail(e.detail), t.setMode(e.mode), t.setStyle(e.style), t;
|
|
7395
7399
|
}
|
|
7396
7400
|
exportDOM(e) {
|
|
@@ -7438,9 +7442,9 @@ class tr extends qn {
|
|
|
7438
7442
|
return t.__text = e, t;
|
|
7439
7443
|
}
|
|
7440
7444
|
select(e, t) {
|
|
7441
|
-
|
|
7445
|
+
De();
|
|
7442
7446
|
let n = e, s = t;
|
|
7443
|
-
const o =
|
|
7447
|
+
const o = j(), i = this.getTextContent(), u = this.__key;
|
|
7444
7448
|
if (typeof i == "string") {
|
|
7445
7449
|
const l = i.length;
|
|
7446
7450
|
n === void 0 && (n = l), s === void 0 && (s = l);
|
|
@@ -7448,7 +7452,7 @@ class tr extends qn {
|
|
|
7448
7452
|
if (!B(o)) return Hu(u, n, u, s, "text", "text");
|
|
7449
7453
|
{
|
|
7450
7454
|
const l = ht();
|
|
7451
|
-
l !== o.anchor.key && l !== o.focus.key ||
|
|
7455
|
+
l !== o.anchor.key && l !== o.focus.key || he(u), o.setTextNodeRange(this, n, this, s);
|
|
7452
7456
|
}
|
|
7453
7457
|
return o;
|
|
7454
7458
|
}
|
|
@@ -7463,7 +7467,7 @@ class tr extends qn {
|
|
|
7463
7467
|
const o = this.getWritable(), i = o.__text, u = n.length;
|
|
7464
7468
|
let l = e;
|
|
7465
7469
|
l < 0 && (l = u + l, l < 0 && (l = 0));
|
|
7466
|
-
const a =
|
|
7470
|
+
const a = j();
|
|
7467
7471
|
if (s && B(a)) {
|
|
7468
7472
|
const f = e + u;
|
|
7469
7473
|
a.setTextNodeRange(o, f, o, f);
|
|
@@ -7478,7 +7482,7 @@ class tr extends qn {
|
|
|
7478
7482
|
return !0;
|
|
7479
7483
|
}
|
|
7480
7484
|
splitText(...e) {
|
|
7481
|
-
|
|
7485
|
+
De();
|
|
7482
7486
|
const t = this.getLatest(), n = t.getTextContent(), s = t.__key, o = ht(), i = new Set(e), u = [], l = n.length;
|
|
7483
7487
|
let a = "";
|
|
7484
7488
|
for (let C = 0; C < l; C++) a !== "" && i.has(C) && (u.push(a), a = ""), a += n[C];
|
|
@@ -7490,18 +7494,18 @@ class tr extends qn {
|
|
|
7490
7494
|
let h;
|
|
7491
7495
|
const p = t.getFormat(), g = t.getStyle(), _ = t.__detail;
|
|
7492
7496
|
let D = !1;
|
|
7493
|
-
t.isSegmented() ? (h =
|
|
7494
|
-
const y =
|
|
7497
|
+
t.isSegmented() ? (h = ce(f), h.__format = p, h.__style = g, h.__detail = _, D = !0) : (h = t.getWritable(), h.__text = f);
|
|
7498
|
+
const y = j(), w = [h];
|
|
7495
7499
|
let x = f.length;
|
|
7496
7500
|
for (let C = 1; C < c; C++) {
|
|
7497
|
-
const b = u[C], k = b.length, A =
|
|
7501
|
+
const b = u[C], k = b.length, A = ce(b).getWritable();
|
|
7498
7502
|
A.__format = p, A.__style = g, A.__detail = _;
|
|
7499
7503
|
const S = A.__key, P = x + k;
|
|
7500
7504
|
if (B(y)) {
|
|
7501
7505
|
const F = y.anchor, U = y.focus;
|
|
7502
7506
|
F.key === s && F.type === "text" && F.offset > x && F.offset <= P && (F.key = S, F.offset -= x, y.dirty = !0), U.key === s && U.type === "text" && U.offset > x && U.offset <= P && (U.key = S, U.offset -= x, y.dirty = !0);
|
|
7503
7507
|
}
|
|
7504
|
-
o === s &&
|
|
7508
|
+
o === s && he(S), x = P, w.push(A);
|
|
7505
7509
|
}
|
|
7506
7510
|
if (d !== null) {
|
|
7507
7511
|
(function(k) {
|
|
@@ -7517,8 +7521,8 @@ class tr extends qn {
|
|
|
7517
7521
|
const t = e === this.getPreviousSibling();
|
|
7518
7522
|
t || e === this.getNextSibling() || N(50);
|
|
7519
7523
|
const n = this.__key, s = e.__key, o = this.__text, i = o.length;
|
|
7520
|
-
ht() === s &&
|
|
7521
|
-
const u =
|
|
7524
|
+
ht() === s && he(n);
|
|
7525
|
+
const u = j();
|
|
7522
7526
|
if (B(u)) {
|
|
7523
7527
|
const f = u.anchor, d = u.focus;
|
|
7524
7528
|
f !== null && f.key === s && (go(f, t, n, e, i), u.dirty = !0), d !== null && d.key === s && (go(d, t, n, e, i), u.dirty = !0);
|
|
@@ -7560,7 +7564,7 @@ function bc(r) {
|
|
|
7560
7564
|
const u = n[i];
|
|
7561
7565
|
u === `
|
|
7562
7566
|
` || u === `\r
|
|
7563
|
-
` ? s.push(Ft()) : u === " " ? s.push(qr()) : u !== "" && s.push(
|
|
7567
|
+
` ? s.push(Ft()) : u === " " ? s.push(qr()) : u !== "" && s.push(ce(u));
|
|
7564
7568
|
}
|
|
7565
7569
|
return { node: s };
|
|
7566
7570
|
}
|
|
@@ -7585,7 +7589,7 @@ function bc(r) {
|
|
|
7585
7589
|
}
|
|
7586
7590
|
s && (t = t.slice(0, t.length - 1));
|
|
7587
7591
|
}
|
|
7588
|
-
return t === "" ? { node: null } : { node:
|
|
7592
|
+
return t === "" ? { node: null } : { node: ce(t) };
|
|
7589
7593
|
}
|
|
7590
7594
|
function oo(r, e) {
|
|
7591
7595
|
let t = r;
|
|
@@ -7611,8 +7615,8 @@ function ct(r) {
|
|
|
7611
7615
|
const e = Dc[r.nodeName.toLowerCase()];
|
|
7612
7616
|
return e === void 0 ? { node: null } : { forChild: gi(r.style, e), node: null };
|
|
7613
7617
|
}
|
|
7614
|
-
function
|
|
7615
|
-
return
|
|
7618
|
+
function ce(r = "") {
|
|
7619
|
+
return Xe(new tr(r));
|
|
7616
7620
|
}
|
|
7617
7621
|
function L(r) {
|
|
7618
7622
|
return r instanceof tr;
|
|
@@ -7661,7 +7665,7 @@ class $r extends tr {
|
|
|
7661
7665
|
}
|
|
7662
7666
|
}
|
|
7663
7667
|
function qr() {
|
|
7664
|
-
return
|
|
7668
|
+
return Xe(new $r());
|
|
7665
7669
|
}
|
|
7666
7670
|
function wc(r) {
|
|
7667
7671
|
return r instanceof $r;
|
|
@@ -7687,15 +7691,15 @@ class Cc {
|
|
|
7687
7691
|
return t === n ? s < o : t.isBefore(n);
|
|
7688
7692
|
}
|
|
7689
7693
|
getNode() {
|
|
7690
|
-
const e =
|
|
7694
|
+
const e = ge(this.key);
|
|
7691
7695
|
return e === null && N(20), e;
|
|
7692
7696
|
}
|
|
7693
7697
|
set(e, t, n) {
|
|
7694
7698
|
const s = this._selection, o = this.key;
|
|
7695
|
-
this.key = e, this.offset = t, this.type = n, Ur() || (ht() === o &&
|
|
7699
|
+
this.key = e, this.offset = t, this.type = n, Ur() || (ht() === o && he(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
|
|
7696
7700
|
}
|
|
7697
7701
|
}
|
|
7698
|
-
function
|
|
7702
|
+
function Qe(r, e, t) {
|
|
7699
7703
|
return new Cc(r, e, t);
|
|
7700
7704
|
}
|
|
7701
7705
|
function ys(r, e) {
|
|
@@ -7734,7 +7738,7 @@ class zn {
|
|
|
7734
7738
|
this._cachedNodes = e;
|
|
7735
7739
|
}
|
|
7736
7740
|
is(e) {
|
|
7737
|
-
if (!
|
|
7741
|
+
if (!Ve(e)) return !1;
|
|
7738
7742
|
const t = this._nodes, n = e._nodes;
|
|
7739
7743
|
return t.size === n.size && Array.from(t).every((s) => n.has(s));
|
|
7740
7744
|
}
|
|
@@ -7785,7 +7789,7 @@ class zn {
|
|
|
7785
7789
|
if (e !== null) return e;
|
|
7786
7790
|
const t = this._nodes, n = [];
|
|
7787
7791
|
for (const s of t) {
|
|
7788
|
-
const o =
|
|
7792
|
+
const o = ge(s);
|
|
7789
7793
|
o !== null && n.push(o);
|
|
7790
7794
|
}
|
|
7791
7795
|
return Ur() || (this._cachedNodes = n), n;
|
|
@@ -7839,7 +7843,7 @@ class xt {
|
|
|
7839
7843
|
getTextContent() {
|
|
7840
7844
|
const e = this.getNodes();
|
|
7841
7845
|
if (e.length === 0) return "";
|
|
7842
|
-
const t = e[0], n = e[e.length - 1], s = this.anchor, o = this.focus, i = s.isBefore(o), [u, l] =
|
|
7846
|
+
const t = e[0], n = e[e.length - 1], s = this.anchor, o = this.focus, i = s.isBefore(o), [u, l] = Ms(this);
|
|
7843
7847
|
let a = "", c = !0;
|
|
7844
7848
|
for (let f = 0; f < e.length; f++) {
|
|
7845
7849
|
const d = e[f];
|
|
@@ -7860,7 +7864,7 @@ class xt {
|
|
|
7860
7864
|
}
|
|
7861
7865
|
clone() {
|
|
7862
7866
|
const e = this.anchor, t = this.focus;
|
|
7863
|
-
return new xt(
|
|
7867
|
+
return new xt(Qe(e.key, e.offset, e.type), Qe(t.key, t.offset, t.type), this.format, this.style);
|
|
7864
7868
|
}
|
|
7865
7869
|
toggleFormat(e) {
|
|
7866
7870
|
this.format = _n(this.format, e, null), this.dirty = !0;
|
|
@@ -7878,7 +7882,7 @@ class xt {
|
|
|
7878
7882
|
const i = t[o];
|
|
7879
7883
|
i === `
|
|
7880
7884
|
` || i === `\r
|
|
7881
|
-
` ? n.push(Ft()) : i === " " ? n.push(qr()) : n.push(
|
|
7885
|
+
` ? n.push(Ft()) : i === " " ? n.push(qr()) : n.push(ce(i));
|
|
7882
7886
|
}
|
|
7883
7887
|
this.insertNodes(n);
|
|
7884
7888
|
}
|
|
@@ -7886,7 +7890,7 @@ class xt {
|
|
|
7886
7890
|
const t = this.anchor, n = this.focus, s = this.format, o = this.style;
|
|
7887
7891
|
let i = t, u = n;
|
|
7888
7892
|
!this.isCollapsed() && n.isBefore(t) && (i = n, u = t), i.type === "element" && function(_, D, y, w) {
|
|
7889
|
-
const x = _.getNode(), C = x.getChildAtIndex(_.offset), b =
|
|
7893
|
+
const x = _.getNode(), C = x.getChildAtIndex(_.offset), b = ce(), k = _e(x) ? le().append(b) : b;
|
|
7890
7894
|
b.setFormat(y), b.setStyle(w), C === null ? x.append(k) : C.insertBefore(k), _.is(D) && D.set(b.__key, 0, "text"), _.set(b.__key, 0, "text");
|
|
7891
7895
|
}(i, u, s, o);
|
|
7892
7896
|
const l = i.offset;
|
|
@@ -7898,12 +7902,12 @@ class xt {
|
|
|
7898
7902
|
let g = c[f - 1];
|
|
7899
7903
|
if (f === 1 && u.type === "element" && (a = h, u.set(i.key, a, "text")), this.isCollapsed() && l === h && (d.isSegmented() || d.isToken() || !d.canInsertTextAfter() || !p.canInsertTextAfter() && d.getNextSibling() === null)) {
|
|
7900
7904
|
let _ = d.getNextSibling();
|
|
7901
|
-
if (L(_) && _.canInsertTextBefore() && !Ct(_) || (_ =
|
|
7905
|
+
if (L(_) && _.canInsertTextBefore() && !Ct(_) || (_ = ce(), _.setFormat(s), _.setStyle(o), p.canInsertTextAfter() ? d.insertAfter(_) : p.insertAfter(_)), _.select(0, 0), d = _, e !== "") return void this.insertText(e);
|
|
7902
7906
|
} else if (this.isCollapsed() && l === 0 && (d.isSegmented() || d.isToken() || !d.canInsertTextBefore() || !p.canInsertTextBefore() && d.getPreviousSibling() === null)) {
|
|
7903
7907
|
let _ = d.getPreviousSibling();
|
|
7904
|
-
if (L(_) && !Ct(_) || (_ =
|
|
7908
|
+
if (L(_) && !Ct(_) || (_ = ce(), _.setFormat(s), p.canInsertTextBefore() ? d.insertBefore(_) : p.insertBefore(_)), _.select(), d = _, e !== "") return void this.insertText(e);
|
|
7905
7909
|
} else if (d.isSegmented() && l !== h) {
|
|
7906
|
-
const _ =
|
|
7910
|
+
const _ = ce(d.getTextContent());
|
|
7907
7911
|
_.setFormat(s), d.replace(_), d = _;
|
|
7908
7912
|
} else if (!this.isCollapsed() && e !== "") {
|
|
7909
7913
|
const _ = g.getParent();
|
|
@@ -7911,18 +7915,18 @@ class xt {
|
|
|
7911
7915
|
}
|
|
7912
7916
|
if (f === 1) {
|
|
7913
7917
|
if (d.isToken()) {
|
|
7914
|
-
const w =
|
|
7918
|
+
const w = ce(e);
|
|
7915
7919
|
return w.select(), void d.replace(w);
|
|
7916
7920
|
}
|
|
7917
7921
|
const _ = d.getFormat(), D = d.getStyle();
|
|
7918
7922
|
if (l !== a || _ === s && D === o) {
|
|
7919
7923
|
if (wc(d)) {
|
|
7920
|
-
const w =
|
|
7924
|
+
const w = ce(e);
|
|
7921
7925
|
return w.setFormat(s), w.setStyle(o), w.select(), void d.replace(w);
|
|
7922
7926
|
}
|
|
7923
7927
|
} else {
|
|
7924
7928
|
if (d.getTextContent() !== "") {
|
|
7925
|
-
const w =
|
|
7929
|
+
const w = ce(e);
|
|
7926
7930
|
if (w.setFormat(s), w.setStyle(o), w.select(), l === 0) d.insertBefore(w, !1);
|
|
7927
7931
|
else {
|
|
7928
7932
|
const [x] = d.splitText(l);
|
|
@@ -7942,10 +7946,10 @@ class xt {
|
|
|
7942
7946
|
while (y.isInline());
|
|
7943
7947
|
if (u.type === "text" && (a !== 0 || g.getTextContent() === "") || u.type === "element" && g.getIndexWithinParent() < a) if (L(g) && !g.isToken() && a !== g.getTextContentSize()) {
|
|
7944
7948
|
if (g.isSegmented()) {
|
|
7945
|
-
const A =
|
|
7949
|
+
const A = ce(g.getTextContent());
|
|
7946
7950
|
g.replace(A), g = A;
|
|
7947
7951
|
}
|
|
7948
|
-
|
|
7952
|
+
_e(u.getNode()) || u.type !== "text" || (g = g.spliceText(0, a, "")), _.add(g.__key);
|
|
7949
7953
|
} else {
|
|
7950
7954
|
const A = g.getParentOrThrow();
|
|
7951
7955
|
A.canBeEmpty() || A.getChildrenSize() !== 1 ? g.remove() : A.remove();
|
|
@@ -7966,7 +7970,7 @@ class xt {
|
|
|
7966
7970
|
}
|
|
7967
7971
|
if (d.isToken()) if (l === h) d.select();
|
|
7968
7972
|
else {
|
|
7969
|
-
const A =
|
|
7973
|
+
const A = ce(e);
|
|
7970
7974
|
A.select(), d.replace(A);
|
|
7971
7975
|
}
|
|
7972
7976
|
else d = d.spliceText(l, h - l, e, !0), d.getTextContent() === "" ? d.remove() : d.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
@@ -7987,7 +7991,7 @@ class xt {
|
|
|
7987
7991
|
const c = (f, d) => {
|
|
7988
7992
|
if (f.getTextContent() === "") f.remove();
|
|
7989
7993
|
else if (d !== 0 && Ct(f)) {
|
|
7990
|
-
const h =
|
|
7994
|
+
const h = ce(f.getTextContent());
|
|
7991
7995
|
return h.setFormat(f.getFormat()), h.setStyle(f.getStyle()), f.replace(h);
|
|
7992
7996
|
}
|
|
7993
7997
|
};
|
|
@@ -8002,7 +8006,7 @@ class xt {
|
|
|
8002
8006
|
L(u) && (u.spliceText(0, o.offset, ""), u = c(u, o.offset) || u), i.isAttached() && L(i) ? i.selectEnd() : u.isAttached() && L(u) && u.selectStart(), E(l) && E(a) && l !== a && (l.append(...a.getChildren()), a.remove(), o.set(s.key, s.offset, s.type));
|
|
8003
8007
|
}
|
|
8004
8008
|
formatText(e, t = null) {
|
|
8005
|
-
if (this.isCollapsed()) return this.toggleFormat(e), void
|
|
8009
|
+
if (this.isCollapsed()) return this.toggleFormat(e), void he(null);
|
|
8006
8010
|
const n = this.getNodes(), s = [];
|
|
8007
8011
|
for (const x of n) L(x) && s.push(x);
|
|
8008
8012
|
const o = (x) => {
|
|
@@ -8013,7 +8017,7 @@ class xt {
|
|
|
8013
8017
|
}
|
|
8014
8018
|
});
|
|
8015
8019
|
}, i = s.length;
|
|
8016
|
-
if (i === 0) return this.toggleFormat(e),
|
|
8020
|
+
if (i === 0) return this.toggleFormat(e), he(null), void o(t);
|
|
8017
8021
|
const u = this.anchor, l = this.focus, a = this.isBackward(), c = a ? l : u, f = a ? u : l;
|
|
8018
8022
|
let d = 0, h = s[0], p = c.type === "element" ? 0 : c.offset;
|
|
8019
8023
|
if (c.type === "text" && p === h.getTextContentSize() && (d = 1, h = s[1], p = 0), h == null) return;
|
|
@@ -8044,7 +8048,7 @@ class xt {
|
|
|
8044
8048
|
if (e.length === 0) return;
|
|
8045
8049
|
if (this.anchor.key === "root") {
|
|
8046
8050
|
this.insertParagraph();
|
|
8047
|
-
const p =
|
|
8051
|
+
const p = j();
|
|
8048
8052
|
return B(p) || N(134), p.insertNodes(e);
|
|
8049
8053
|
}
|
|
8050
8054
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = dr(t, dt), s = e[e.length - 1];
|
|
@@ -8062,7 +8066,7 @@ class xt {
|
|
|
8062
8066
|
return n.splice(p, 0, e), void s.selectEnd();
|
|
8063
8067
|
}
|
|
8064
8068
|
const o = function(p) {
|
|
8065
|
-
const g =
|
|
8069
|
+
const g = le();
|
|
8066
8070
|
let _ = null;
|
|
8067
8071
|
for (let D = 0; D < p.length; D++) {
|
|
8068
8072
|
const y = p[D], w = St(y);
|
|
@@ -8090,7 +8094,7 @@ class xt {
|
|
|
8090
8094
|
}
|
|
8091
8095
|
insertParagraph() {
|
|
8092
8096
|
if (this.anchor.key === "root") {
|
|
8093
|
-
const i =
|
|
8097
|
+
const i = le();
|
|
8094
8098
|
return re().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8095
8099
|
}
|
|
8096
8100
|
const e = _s(this), t = dr(this.anchor.getNode(), dt);
|
|
@@ -8108,7 +8112,7 @@ class xt {
|
|
|
8108
8112
|
extract() {
|
|
8109
8113
|
const e = this.getNodes(), t = e.length, n = t - 1, s = this.anchor, o = this.focus;
|
|
8110
8114
|
let i = e[0], u = e[n];
|
|
8111
|
-
const [l, a] =
|
|
8115
|
+
const [l, a] = Ms(this);
|
|
8112
8116
|
if (t === 0) return [];
|
|
8113
8117
|
if (t === 1) {
|
|
8114
8118
|
if (L(i) && !this.isCollapsed()) {
|
|
@@ -8133,7 +8137,7 @@ class xt {
|
|
|
8133
8137
|
if (Y(u) && !u.isIsolated()) {
|
|
8134
8138
|
if (i && u.isKeyboardSelectable()) {
|
|
8135
8139
|
const h = ho();
|
|
8136
|
-
return h.add(u.__key), void
|
|
8140
|
+
return h.add(u.__key), void Ge(h);
|
|
8137
8141
|
}
|
|
8138
8142
|
const d = t ? u.getPreviousSibling() : u.getNextSibling();
|
|
8139
8143
|
if (L(d)) {
|
|
@@ -8146,13 +8150,13 @@ class xt {
|
|
|
8146
8150
|
return E(d) ? (g = d.__key, p = t ? d.getChildrenSize() : 0) : (p = u.getIndexWithinParent(), g = h.__key, t || p++), s.set(g, p, "element"), void (i && o.set(g, p, "element"));
|
|
8147
8151
|
}
|
|
8148
8152
|
}
|
|
8149
|
-
const l = te(), a =
|
|
8153
|
+
const l = te(), a = Fe(l._window);
|
|
8150
8154
|
if (!a) return;
|
|
8151
8155
|
const c = l._blockCursorElement, f = l._rootElement;
|
|
8152
8156
|
if (f === null || c === null || !E(u) || u.isInline() || u.canBeEmpty() || fi(c, l, f), function(d, h, p, g) {
|
|
8153
8157
|
d.modify(h, p, g);
|
|
8154
8158
|
}(a, e, t ? "backward" : "forward", n), a.rangeCount > 0) {
|
|
8155
|
-
const d = a.getRangeAt(0), h = this.anchor.getNode(), p =
|
|
8159
|
+
const d = a.getRangeAt(0), h = this.anchor.getNode(), p = _e(h) ? h : oc(h);
|
|
8156
8160
|
if (this.applyDOMRange(d), this.dirty = !0, !i) {
|
|
8157
8161
|
const g = this.getNodes(), _ = [];
|
|
8158
8162
|
let D = !1;
|
|
@@ -8192,7 +8196,7 @@ class xt {
|
|
|
8192
8196
|
if (i.isKeyboardSelectable() && E(s) && s.getChildrenSize() === 0) {
|
|
8193
8197
|
s.remove();
|
|
8194
8198
|
const u = ho();
|
|
8195
|
-
u.add(i.__key),
|
|
8199
|
+
u.add(i.__key), Ge(u);
|
|
8196
8200
|
} else
|
|
8197
8201
|
i.remove(), te().dispatchCommand(Hs, void 0);
|
|
8198
8202
|
return;
|
|
@@ -8221,7 +8225,7 @@ class xt {
|
|
|
8221
8225
|
}
|
|
8222
8226
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
8223
8227
|
const n = this.anchor.getNode();
|
|
8224
|
-
n.isEmpty() &&
|
|
8228
|
+
n.isEmpty() && _e(n.getParent()) && n.getIndexWithinParent() === 0 && n.collapseAtStart(this);
|
|
8225
8229
|
}
|
|
8226
8230
|
}
|
|
8227
8231
|
deleteLine(e) {
|
|
@@ -8249,7 +8253,7 @@ class xt {
|
|
|
8249
8253
|
return [this.anchor, this.focus];
|
|
8250
8254
|
}
|
|
8251
8255
|
}
|
|
8252
|
-
function
|
|
8256
|
+
function Ve(r) {
|
|
8253
8257
|
return r instanceof zn;
|
|
8254
8258
|
}
|
|
8255
8259
|
function lo(r) {
|
|
@@ -8258,7 +8262,7 @@ function lo(r) {
|
|
|
8258
8262
|
const t = r.getNode();
|
|
8259
8263
|
return e === t.getChildrenSize() ? t.getTextContent().length : 0;
|
|
8260
8264
|
}
|
|
8261
|
-
function
|
|
8265
|
+
function Ms(r) {
|
|
8262
8266
|
const e = r.getStartEndPoints();
|
|
8263
8267
|
if (e === null) return [0, 0];
|
|
8264
8268
|
const [t, n] = e;
|
|
@@ -8309,10 +8313,10 @@ function co(r, e, t, n) {
|
|
|
8309
8313
|
const h = d.getIndexWithinParent();
|
|
8310
8314
|
o = e === 0 && Y(d) && Vt(r) === d ? h : h + 1, d = d.getParentOrThrow();
|
|
8311
8315
|
}
|
|
8312
|
-
if (E(d)) return
|
|
8316
|
+
if (E(d)) return Qe(d.__key, o, "element");
|
|
8313
8317
|
}
|
|
8314
8318
|
} else s = Vt(r);
|
|
8315
|
-
return L(s) ?
|
|
8319
|
+
return L(s) ? Qe(s.__key, o, "text") : null;
|
|
8316
8320
|
}
|
|
8317
8321
|
function fo(r, e, t) {
|
|
8318
8322
|
const n = r.offset, s = r.getNode();
|
|
@@ -8360,11 +8364,11 @@ function $s(r) {
|
|
|
8360
8364
|
return E(r) && !r.isInline();
|
|
8361
8365
|
}
|
|
8362
8366
|
function Hu(r, e, t, n, s, o) {
|
|
8363
|
-
const i = it(), u = new xt(
|
|
8367
|
+
const i = it(), u = new xt(Qe(r, e, s), Qe(t, n, o), 0, "");
|
|
8364
8368
|
return u.dirty = !0, i._selection = u, u;
|
|
8365
8369
|
}
|
|
8366
8370
|
function Ac() {
|
|
8367
|
-
const r =
|
|
8371
|
+
const r = Qe("root", 0, "element"), e = Qe("root", 0, "element");
|
|
8368
8372
|
return new xt(r, e, 0, "");
|
|
8369
8373
|
}
|
|
8370
8374
|
function ho() {
|
|
@@ -8383,7 +8387,7 @@ function mi(r, e, t, n) {
|
|
|
8383
8387
|
const [p, g] = h;
|
|
8384
8388
|
return new xt(p, g, B(r) ? r.format : 0, B(r) ? r.style : "");
|
|
8385
8389
|
}
|
|
8386
|
-
function
|
|
8390
|
+
function j() {
|
|
8387
8391
|
return it()._selection;
|
|
8388
8392
|
}
|
|
8389
8393
|
function zr() {
|
|
@@ -8457,7 +8461,7 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8457
8461
|
S = W.getFormat() !== x || W.getStyle() !== C;
|
|
8458
8462
|
} else B(r) && r.anchor.type === "text" && (S = !0);
|
|
8459
8463
|
var P, F, U, $, I;
|
|
8460
|
-
if (h.type === "text" && (A = yn(D)), k !== null && A !== null && (b && (r === null || S || B(r) && (r.format !== x || r.style !== C)) && (P = x, F = C, U = y, $ = p, I = performance.now(),
|
|
8464
|
+
if (h.type === "text" && (A = yn(D)), k !== null && A !== null && (b && (r === null || S || B(r) && (r.format !== x || r.style !== C)) && (P = x, F = C, U = y, $ = p, I = performance.now(), Iu = [P, F, U, $, I]), a !== y || c !== w || u !== k || l !== A || n.type === "Range" && b || (f !== null && o.contains(f) || o.focus({ preventScroll: !0 }), d.type === "element"))) {
|
|
8461
8465
|
try {
|
|
8462
8466
|
n.setBaseAndExtent(k, y, A, w);
|
|
8463
8467
|
} catch {
|
|
@@ -8467,30 +8471,30 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8467
8471
|
if (W !== null) {
|
|
8468
8472
|
let ne;
|
|
8469
8473
|
if (W instanceof Text) {
|
|
8470
|
-
const
|
|
8471
|
-
|
|
8474
|
+
const Se = document.createRange();
|
|
8475
|
+
Se.selectNode(W), ne = Se.getBoundingClientRect();
|
|
8472
8476
|
} else ne = W.getBoundingClientRect();
|
|
8473
|
-
(function(
|
|
8474
|
-
const ut = vt.ownerDocument,
|
|
8475
|
-
if (
|
|
8476
|
-
let { top:
|
|
8477
|
-
for (;
|
|
8478
|
-
const
|
|
8479
|
-
if (
|
|
8477
|
+
(function(Se, $e, vt) {
|
|
8478
|
+
const ut = vt.ownerDocument, ae = ut.defaultView;
|
|
8479
|
+
if (ae === null) return;
|
|
8480
|
+
let { top: Le, bottom: qe } = $e, lt = 0, at = 0, ve = vt;
|
|
8481
|
+
for (; ve !== null; ) {
|
|
8482
|
+
const Ze = ve === ut.body;
|
|
8483
|
+
if (Ze) lt = 0, at = Mn(Se).innerHeight;
|
|
8480
8484
|
else {
|
|
8481
|
-
const
|
|
8482
|
-
lt =
|
|
8485
|
+
const ze = ve.getBoundingClientRect();
|
|
8486
|
+
lt = ze.top, at = ze.bottom;
|
|
8483
8487
|
}
|
|
8484
|
-
let
|
|
8485
|
-
if (
|
|
8488
|
+
let Te = 0;
|
|
8489
|
+
if (Le < lt ? Te = -(lt - Le) : qe > at && (Te = qe - at), Te !== 0) if (Ze) ae.scrollBy(0, Te);
|
|
8486
8490
|
else {
|
|
8487
|
-
const
|
|
8488
|
-
|
|
8489
|
-
const
|
|
8490
|
-
|
|
8491
|
+
const ze = ve.scrollTop;
|
|
8492
|
+
ve.scrollTop += Te;
|
|
8493
|
+
const et = ve.scrollTop - ze;
|
|
8494
|
+
Le -= et, qe -= et;
|
|
8491
8495
|
}
|
|
8492
|
-
if (
|
|
8493
|
-
|
|
8496
|
+
if (Ze) break;
|
|
8497
|
+
ve = Ir(ve);
|
|
8494
8498
|
}
|
|
8495
8499
|
})(t, ne, o);
|
|
8496
8500
|
}
|
|
@@ -8499,13 +8503,13 @@ function Ec(r, e, t, n, s, o, i) {
|
|
|
8499
8503
|
}
|
|
8500
8504
|
}
|
|
8501
8505
|
function kc(r) {
|
|
8502
|
-
let e =
|
|
8506
|
+
let e = j() || zr();
|
|
8503
8507
|
e === null && (e = re().selectEnd()), e.insertNodes(r);
|
|
8504
8508
|
}
|
|
8505
8509
|
function _s(r) {
|
|
8506
8510
|
let e = r;
|
|
8507
8511
|
r.isCollapsed() || e.removeText();
|
|
8508
|
-
const t =
|
|
8512
|
+
const t = j();
|
|
8509
8513
|
B(t) && (e = t), B(e) || N(161);
|
|
8510
8514
|
const n = e.anchor;
|
|
8511
8515
|
let s = n.getNode(), o = n.offset;
|
|
@@ -8515,7 +8519,7 @@ function _s(r) {
|
|
|
8515
8519
|
function Sc(r, e) {
|
|
8516
8520
|
const t = r.getParent();
|
|
8517
8521
|
if (!t) {
|
|
8518
|
-
const s =
|
|
8522
|
+
const s = le();
|
|
8519
8523
|
return re().append(s), s.select(), [re(), 0];
|
|
8520
8524
|
}
|
|
8521
8525
|
if (L(r)) {
|
|
@@ -8527,27 +8531,27 @@ function Sc(r, e) {
|
|
|
8527
8531
|
if (!E(r) || e === 0) return [t, r.getIndexWithinParent()];
|
|
8528
8532
|
const n = r.getChildAtIndex(e);
|
|
8529
8533
|
if (n) {
|
|
8530
|
-
const s = new xt(
|
|
8534
|
+
const s = new xt(Qe(r.__key, e, "element"), Qe(r.__key, e, "element"), 0, ""), o = r.insertNewAfter(s);
|
|
8531
8535
|
o && o.append(n, ...n.getNextSiblings());
|
|
8532
8536
|
}
|
|
8533
8537
|
return [t, r.getIndexWithinParent() + 1];
|
|
8534
8538
|
}
|
|
8535
|
-
let
|
|
8539
|
+
let de = null, fe = null, we = !1, xs = !1, an = 0;
|
|
8536
8540
|
const mo = { characterData: !0, childList: !0, subtree: !0 };
|
|
8537
8541
|
function Ur() {
|
|
8538
|
-
return
|
|
8542
|
+
return we || de !== null && de._readOnly;
|
|
8539
8543
|
}
|
|
8540
|
-
function
|
|
8541
|
-
|
|
8544
|
+
function De() {
|
|
8545
|
+
we && N(13);
|
|
8542
8546
|
}
|
|
8543
8547
|
function Gu() {
|
|
8544
8548
|
an > 99 && N(14);
|
|
8545
8549
|
}
|
|
8546
8550
|
function it() {
|
|
8547
|
-
return
|
|
8551
|
+
return de === null && N(195, Ju()), de;
|
|
8548
8552
|
}
|
|
8549
8553
|
function te() {
|
|
8550
|
-
return
|
|
8554
|
+
return fe === null && N(196, Ju()), fe;
|
|
8551
8555
|
}
|
|
8552
8556
|
function Ju() {
|
|
8553
8557
|
let r = 0;
|
|
@@ -8564,7 +8568,7 @@ function Ju() {
|
|
|
8564
8568
|
return e.size && (n += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), n;
|
|
8565
8569
|
}
|
|
8566
8570
|
function Tc() {
|
|
8567
|
-
return
|
|
8571
|
+
return fe;
|
|
8568
8572
|
}
|
|
8569
8573
|
function yo(r, e, t) {
|
|
8570
8574
|
const n = e.__type, s = function(u, l) {
|
|
@@ -8602,21 +8606,21 @@ function yi(r, e) {
|
|
|
8602
8606
|
return o;
|
|
8603
8607
|
}
|
|
8604
8608
|
function xo(r, e, t) {
|
|
8605
|
-
const n =
|
|
8606
|
-
|
|
8609
|
+
const n = de, s = we, o = fe;
|
|
8610
|
+
de = e, we = !0, fe = r;
|
|
8607
8611
|
try {
|
|
8608
8612
|
return t();
|
|
8609
8613
|
} finally {
|
|
8610
|
-
|
|
8614
|
+
de = n, we = s, fe = o;
|
|
8611
8615
|
}
|
|
8612
8616
|
}
|
|
8613
8617
|
function pt(r, e) {
|
|
8614
8618
|
const t = r._pendingEditorState, n = r._rootElement, s = r._headless || n === null;
|
|
8615
8619
|
if (t === null) return;
|
|
8616
|
-
const o = r._editorState, i = o._selection, u = t._selection, l = r._dirtyType !== Tt, a =
|
|
8620
|
+
const o = r._editorState, i = o._selection, u = t._selection, l = r._dirtyType !== Tt, a = de, c = we, f = fe, d = r._updating, h = r._observer;
|
|
8617
8621
|
let p = null;
|
|
8618
8622
|
if (r._pendingEditorState = null, r._editorState = t, !s && l && h !== null) {
|
|
8619
|
-
|
|
8623
|
+
fe = r, de = t, we = !1, r._updating = !0;
|
|
8620
8624
|
try {
|
|
8621
8625
|
const b = r._dirtyType, k = r._dirtyElements, A = r._dirtyLeaves;
|
|
8622
8626
|
h.disconnect(), p = gc(o, t, r, b, k, A);
|
|
@@ -8624,7 +8628,7 @@ function pt(r, e) {
|
|
|
8624
8628
|
if (b instanceof Error && r._onError(b), xs) throw b;
|
|
8625
8629
|
return tl(r, null, n, t), _u(r), r._dirtyType = Yt, xs = !0, pt(r, o), void (xs = !1);
|
|
8626
8630
|
} finally {
|
|
8627
|
-
h.observe(n, mo), r._updating = d,
|
|
8631
|
+
h.observe(n, mo), r._updating = d, de = a, we = c, fe = f;
|
|
8628
8632
|
}
|
|
8629
8633
|
}
|
|
8630
8634
|
t._readOnly || (t._readOnly = !0);
|
|
@@ -8636,9 +8640,9 @@ function pt(r, e) {
|
|
|
8636
8640
|
let F;
|
|
8637
8641
|
for (F in S) P.has(F) || (S === A && (S = wu(b)), delete S[F]);
|
|
8638
8642
|
}(r, t);
|
|
8639
|
-
const x = s ? null :
|
|
8643
|
+
const x = s ? null : Fe(r._window);
|
|
8640
8644
|
if (r._editable && x !== null && (l || u === null || u.dirty)) {
|
|
8641
|
-
|
|
8645
|
+
fe = r, de = t;
|
|
8642
8646
|
try {
|
|
8643
8647
|
if (h !== null && h.disconnect(), l || u === null || u.dirty) {
|
|
8644
8648
|
const b = r._blockCursorElement;
|
|
@@ -8646,7 +8650,7 @@ function pt(r, e) {
|
|
|
8646
8650
|
}
|
|
8647
8651
|
uc(r, n, u), h !== null && h.observe(n, mo);
|
|
8648
8652
|
} finally {
|
|
8649
|
-
|
|
8653
|
+
fe = f, de = a;
|
|
8650
8654
|
}
|
|
8651
8655
|
}
|
|
8652
8656
|
p !== null && function(b, k, A, S, P) {
|
|
@@ -8692,7 +8696,7 @@ function Ar(r, e, t, ...n) {
|
|
|
8692
8696
|
}
|
|
8693
8697
|
}
|
|
8694
8698
|
function Yu(r, e, t) {
|
|
8695
|
-
if (r._updating === !1 ||
|
|
8699
|
+
if (r._updating === !1 || fe !== r) {
|
|
8696
8700
|
let s = !1;
|
|
8697
8701
|
return r.update(() => {
|
|
8698
8702
|
s = Yu(r, e, t);
|
|
@@ -8738,11 +8742,11 @@ function Xu(r, e, t) {
|
|
|
8738
8742
|
const u = r._editorState;
|
|
8739
8743
|
let l = r._pendingEditorState, a = !1;
|
|
8740
8744
|
(l === null || l._readOnly) && (l = r._pendingEditorState = Zu(l || u), a = !0), l._flushSync = i;
|
|
8741
|
-
const c =
|
|
8742
|
-
|
|
8745
|
+
const c = de, f = we, d = fe, h = r._updating;
|
|
8746
|
+
de = l, we = !1, r._updating = !0, fe = r;
|
|
8743
8747
|
try {
|
|
8744
8748
|
a && (r._headless ? u._selection !== null && (l._selection = u._selection.clone()) : l._selection = function(D) {
|
|
8745
|
-
const y = D.getEditorState()._selection, w =
|
|
8749
|
+
const y = D.getEditorState()._selection, w = Fe(D._window);
|
|
8746
8750
|
return B(y) || y == null ? mi(y, w, D, null) : y.clone();
|
|
8747
8751
|
}(r));
|
|
8748
8752
|
const g = r._compositionKey;
|
|
@@ -8803,11 +8807,11 @@ function Xu(r, e, t) {
|
|
|
8803
8807
|
if (B(_)) {
|
|
8804
8808
|
const D = l._nodeMap, y = _.anchor.key, w = _.focus.key;
|
|
8805
8809
|
D.get(y) !== void 0 && D.get(w) !== void 0 || N(19);
|
|
8806
|
-
} else
|
|
8810
|
+
} else Ve(_) && _._nodes.size === 0 && (l._selection = null);
|
|
8807
8811
|
} catch (g) {
|
|
8808
8812
|
return g instanceof Error && r._onError(g), r._pendingEditorState = u, r._dirtyType = Yt, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void pt(r);
|
|
8809
8813
|
} finally {
|
|
8810
|
-
|
|
8814
|
+
de = c, we = f, fe = d, r._updating = h, an = 0;
|
|
8811
8815
|
}
|
|
8812
8816
|
r._dirtyType !== Tt || function(g, _) {
|
|
8813
8817
|
const D = _.getEditorState()._selection, y = g._selection;
|
|
@@ -8819,7 +8823,7 @@ function Xu(r, e, t) {
|
|
|
8819
8823
|
pt(r);
|
|
8820
8824
|
}) : (l._flushSync = !1, a && (n.clear(), r._deferred = [], r._pendingEditorState = null));
|
|
8821
8825
|
}
|
|
8822
|
-
function
|
|
8826
|
+
function Ee(r, e, t) {
|
|
8823
8827
|
r._updating ? r._updates.push([e, t]) : Xu(r, e, t);
|
|
8824
8828
|
}
|
|
8825
8829
|
class Er {
|
|
@@ -9000,7 +9004,7 @@ class ot extends qn {
|
|
|
9000
9004
|
}
|
|
9001
9005
|
getFirstChild() {
|
|
9002
9006
|
const e = this.getLatest().__first;
|
|
9003
|
-
return e === null ? null :
|
|
9007
|
+
return e === null ? null : ge(e);
|
|
9004
9008
|
}
|
|
9005
9009
|
getFirstChildOrThrow() {
|
|
9006
9010
|
const e = this.getFirstChild();
|
|
@@ -9008,7 +9012,7 @@ class ot extends qn {
|
|
|
9008
9012
|
}
|
|
9009
9013
|
getLastChild() {
|
|
9010
9014
|
const e = this.getLatest().__last;
|
|
9011
|
-
return e === null ? null :
|
|
9015
|
+
return e === null ? null : ge(e);
|
|
9012
9016
|
}
|
|
9013
9017
|
getLastChildOrThrow() {
|
|
9014
9018
|
const e = this.getLastChild();
|
|
@@ -9053,14 +9057,14 @@ class ot extends qn {
|
|
|
9053
9057
|
}
|
|
9054
9058
|
hasFormat(e) {
|
|
9055
9059
|
if (e !== "") {
|
|
9056
|
-
const t =
|
|
9060
|
+
const t = Mi[e];
|
|
9057
9061
|
return !!(this.getFormat() & t);
|
|
9058
9062
|
}
|
|
9059
9063
|
return !1;
|
|
9060
9064
|
}
|
|
9061
9065
|
select(e, t) {
|
|
9062
|
-
|
|
9063
|
-
const n =
|
|
9066
|
+
De();
|
|
9067
|
+
const n = j();
|
|
9064
9068
|
let s = e, o = t;
|
|
9065
9069
|
const i = this.getChildrenSize();
|
|
9066
9070
|
if (!this.canBeEmpty()) {
|
|
@@ -9096,7 +9100,7 @@ class ot extends qn {
|
|
|
9096
9100
|
return t.__dir = e, t;
|
|
9097
9101
|
}
|
|
9098
9102
|
setFormat(e) {
|
|
9099
|
-
return this.getWritable().__format = e !== "" ?
|
|
9103
|
+
return this.getWritable().__format = e !== "" ? Mi[e] : 0, this;
|
|
9100
9104
|
}
|
|
9101
9105
|
setStyle(e) {
|
|
9102
9106
|
return this.getWritable().__style = e || "", this;
|
|
@@ -9146,10 +9150,10 @@ class ot extends qn {
|
|
|
9146
9150
|
} else p.__prev = null;
|
|
9147
9151
|
}
|
|
9148
9152
|
if (i.__size = d, a.length) {
|
|
9149
|
-
const p =
|
|
9153
|
+
const p = j();
|
|
9150
9154
|
if (B(p)) {
|
|
9151
9155
|
const g = new Set(a), _ = new Set(l), { anchor: D, focus: y } = p;
|
|
9152
|
-
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() ||
|
|
9156
|
+
Do(D, g, _) && kn(D, D.getNode(), this, f, c), Do(y, g, _) && kn(y, y.getNode(), this, f, c), d !== 0 || this.canBeEmpty() || Je(this) || this.remove();
|
|
9153
9157
|
}
|
|
9154
9158
|
}
|
|
9155
9159
|
return i;
|
|
@@ -9301,7 +9305,7 @@ class Wr extends ot {
|
|
|
9301
9305
|
return !0;
|
|
9302
9306
|
}
|
|
9303
9307
|
}
|
|
9304
|
-
function
|
|
9308
|
+
function _e(r) {
|
|
9305
9309
|
return r instanceof Wr;
|
|
9306
9310
|
}
|
|
9307
9311
|
function Zu(r) {
|
|
@@ -9405,14 +9409,14 @@ class rr extends ot {
|
|
|
9405
9409
|
return { element: t };
|
|
9406
9410
|
}
|
|
9407
9411
|
static importJSON(e) {
|
|
9408
|
-
const t =
|
|
9412
|
+
const t = le();
|
|
9409
9413
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t.setTextFormat(e.textFormat), t;
|
|
9410
9414
|
}
|
|
9411
9415
|
exportJSON() {
|
|
9412
9416
|
return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle(), type: "paragraph", version: 1 };
|
|
9413
9417
|
}
|
|
9414
9418
|
insertNewAfter(e, t) {
|
|
9415
|
-
const n =
|
|
9419
|
+
const n = le();
|
|
9416
9420
|
n.setTextFormat(e.format), n.setTextStyle(e.style);
|
|
9417
9421
|
const s = this.getDirection();
|
|
9418
9422
|
return n.setDirection(s), n.setFormat(this.getFormatType()), n.setStyle(this.getTextStyle()), this.insertAfter(n, t), n;
|
|
@@ -9427,11 +9431,11 @@ class rr extends ot {
|
|
|
9427
9431
|
}
|
|
9428
9432
|
}
|
|
9429
9433
|
function Fc(r) {
|
|
9430
|
-
const e =
|
|
9434
|
+
const e = le();
|
|
9431
9435
|
return r.style && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
9432
9436
|
}
|
|
9433
|
-
function
|
|
9434
|
-
return
|
|
9437
|
+
function le() {
|
|
9438
|
+
return Xe(new rr());
|
|
9435
9439
|
}
|
|
9436
9440
|
function Zt(r) {
|
|
9437
9441
|
return r instanceof rr;
|
|
@@ -9444,7 +9448,7 @@ function tl(r, e, t, n) {
|
|
|
9444
9448
|
o !== null && (o.disconnect(), r._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", s.set("root", t));
|
|
9445
9449
|
}
|
|
9446
9450
|
function Pc(r) {
|
|
9447
|
-
const e = r || {}, t = Tc(), n = e.theme || {}, s = r === void 0 ? t : e.parentEditor || null, o = e.disableEvents || !1, i = _i(), u = e.namespace || (s !== null ? s._config.namespace : Eu()), l = e.editorState, a = [Wr, tr,
|
|
9451
|
+
const e = r || {}, t = Tc(), n = e.theme || {}, s = r === void 0 ? t : e.parentEditor || null, o = e.disableEvents || !1, i = _i(), u = e.namespace || (s !== null ? s._config.namespace : Eu()), l = e.editorState, a = [Wr, tr, Mr, $r, rr, xi, ...e.nodes || []], { onError: c, html: f } = e, d = e.editable === void 0 || e.editable;
|
|
9448
9452
|
let h;
|
|
9449
9453
|
if (r === void 0 && t !== null) h = t._nodes;
|
|
9450
9454
|
else {
|
|
@@ -9558,7 +9562,7 @@ class Wn {
|
|
|
9558
9562
|
s.push(l);
|
|
9559
9563
|
}
|
|
9560
9564
|
var i, u;
|
|
9561
|
-
return i = this, u = e.getType(),
|
|
9565
|
+
return i = this, u = e.getType(), Ee(i, () => {
|
|
9562
9566
|
const l = it();
|
|
9563
9567
|
if (l.isEmpty()) return;
|
|
9564
9568
|
if (u === "root") return void re().markDirty();
|
|
@@ -9651,15 +9655,15 @@ class Wn {
|
|
|
9651
9655
|
}
|
|
9652
9656
|
parseEditorState(e, t) {
|
|
9653
9657
|
return function(n, s, o) {
|
|
9654
|
-
const i = _i(), u =
|
|
9655
|
-
s._dirtyElements = /* @__PURE__ */ new Map(), s._dirtyLeaves = /* @__PURE__ */ new Set(), s._cloneNotNeeded = /* @__PURE__ */ new Set(), s._dirtyType = 0,
|
|
9658
|
+
const i = _i(), u = de, l = we, a = fe, c = s._dirtyElements, f = s._dirtyLeaves, d = s._cloneNotNeeded, h = s._dirtyType;
|
|
9659
|
+
s._dirtyElements = /* @__PURE__ */ new Map(), s._dirtyLeaves = /* @__PURE__ */ new Set(), s._cloneNotNeeded = /* @__PURE__ */ new Set(), s._dirtyType = 0, de = i, we = !1, fe = s;
|
|
9656
9660
|
try {
|
|
9657
9661
|
const p = s._nodes;
|
|
9658
9662
|
yi(n.root, p), o && o(), i._readOnly = !0;
|
|
9659
9663
|
} catch (p) {
|
|
9660
9664
|
p instanceof Error && s._onError(p);
|
|
9661
9665
|
} finally {
|
|
9662
|
-
s._dirtyElements = c, s._dirtyLeaves = f, s._cloneNotNeeded = d, s._dirtyType = h,
|
|
9666
|
+
s._dirtyElements = c, s._dirtyLeaves = f, s._cloneNotNeeded = d, s._dirtyType = h, de = u, we = l, fe = a;
|
|
9663
9667
|
}
|
|
9664
9668
|
return i;
|
|
9665
9669
|
}(typeof e == "string" ? JSON.parse(e) : e, this, t);
|
|
@@ -9668,12 +9672,12 @@ class Wn {
|
|
|
9668
9672
|
return pt(this), this.getEditorState().read(e, { editor: this });
|
|
9669
9673
|
}
|
|
9670
9674
|
update(e, t) {
|
|
9671
|
-
|
|
9675
|
+
Ee(this, e, t);
|
|
9672
9676
|
}
|
|
9673
9677
|
focus(e, t = {}) {
|
|
9674
9678
|
const n = this._rootElement;
|
|
9675
|
-
n !== null && (n.setAttribute("autocapitalize", "off"),
|
|
9676
|
-
const s =
|
|
9679
|
+
n !== null && (n.setAttribute("autocapitalize", "off"), Ee(this, () => {
|
|
9680
|
+
const s = j(), o = re();
|
|
9677
9681
|
s !== null ? s.dirty = !0 : o.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? o.selectStart() : o.selectEnd());
|
|
9678
9682
|
}, { onUpdate: () => {
|
|
9679
9683
|
n.removeAttribute("autocapitalize"), e && e();
|
|
@@ -9682,7 +9686,7 @@ class Wn {
|
|
|
9682
9686
|
blur() {
|
|
9683
9687
|
const e = this._rootElement;
|
|
9684
9688
|
e !== null && e.blur();
|
|
9685
|
-
const t =
|
|
9689
|
+
const t = Fe(this._window);
|
|
9686
9690
|
t !== null && t.removeAllRanges();
|
|
9687
9691
|
}
|
|
9688
9692
|
isEditable() {
|
|
@@ -9696,7 +9700,7 @@ class Wn {
|
|
|
9696
9700
|
}
|
|
9697
9701
|
}
|
|
9698
9702
|
Wn.version = "0.21.0+prod.esm";
|
|
9699
|
-
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er :
|
|
9703
|
+
const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er : pe, nn = { tag: "history-merge" };
|
|
9700
9704
|
function Rc({ initialConfig: r, children: e }) {
|
|
9701
9705
|
const t = Pt(() => {
|
|
9702
9706
|
const { theme: n, namespace: s, nodes: o, onError: i, editorState: u, html: l } = r, a = _a(null, n), c = Pc({ editable: r.editable, html: l, namespace: s, nodes: o, onError: (f) => i(f, c), theme: n });
|
|
@@ -9705,10 +9709,10 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9705
9709
|
if (d === void 0) f.update(() => {
|
|
9706
9710
|
const h = re();
|
|
9707
9711
|
if (h.isEmpty()) {
|
|
9708
|
-
const p =
|
|
9712
|
+
const p = le();
|
|
9709
9713
|
h.append(p);
|
|
9710
9714
|
const g = rl ? document.activeElement : null;
|
|
9711
|
-
(
|
|
9715
|
+
(j() !== null || g !== null && g === f.getRootElement()) && p.select();
|
|
9712
9716
|
}
|
|
9713
9717
|
}, nn);
|
|
9714
9718
|
else if (d !== null) switch (typeof d) {
|
|
@@ -9733,20 +9737,20 @@ function Rc({ initialConfig: r, children: e }) {
|
|
|
9733
9737
|
s.setEditable(n === void 0 || n);
|
|
9734
9738
|
}, []), v.jsx(eu.Provider, { value: t, children: e });
|
|
9735
9739
|
}
|
|
9736
|
-
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
9737
|
-
function
|
|
9740
|
+
const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
|
|
9741
|
+
function Ic(r) {
|
|
9738
9742
|
return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
|
|
9739
9743
|
}
|
|
9740
|
-
function
|
|
9744
|
+
function Mc() {
|
|
9741
9745
|
return function(r) {
|
|
9742
|
-
const [e] =
|
|
9746
|
+
const [e] = Ye(), t = Pt(() => r(e), [e, r]), [n, s] = Q(() => t.initialValueFn()), o = bs(n);
|
|
9743
9747
|
return jc(() => {
|
|
9744
9748
|
const { initialValueFn: i, subscribe: u } = t, l = i();
|
|
9745
9749
|
return o.current !== l && (o.current = l, s(l)), u((a) => {
|
|
9746
9750
|
o.current = a, s(a);
|
|
9747
9751
|
});
|
|
9748
9752
|
}, [t, r]), n;
|
|
9749
|
-
}(
|
|
9753
|
+
}(Ic);
|
|
9750
9754
|
}
|
|
9751
9755
|
function $c() {
|
|
9752
9756
|
return re().getTextContent();
|
|
@@ -9811,7 +9815,7 @@ function sl(r, e) {
|
|
|
9811
9815
|
if (e.isSelected(r) && !e.isSegmented() && !e.isToken() && t !== null) {
|
|
9812
9816
|
const [n, s] = t, o = r.isBackward(), i = n.getNode(), u = s.getNode(), l = e.is(i), a = e.is(u);
|
|
9813
9817
|
if (l || a) {
|
|
9814
|
-
const [c, f] =
|
|
9818
|
+
const [c, f] = Ms(r), d = i.is(u), h = e.is(o ? u : i), p = e.is(o ? i : u);
|
|
9815
9819
|
let g, _ = 0;
|
|
9816
9820
|
return d ? (_ = c > f ? f : c, g = c > f ? c : f) : h ? (_ = o ? f : c, g = void 0) : p && (_ = 0, g = o ? c : f), e.__text = e.__text.slice(_, g), e;
|
|
9817
9821
|
}
|
|
@@ -9852,14 +9856,14 @@ function Qc(r, e, t, n) {
|
|
|
9852
9856
|
}
|
|
9853
9857
|
function Yc(r) {
|
|
9854
9858
|
const e = r.anchor.getNode();
|
|
9855
|
-
return (
|
|
9859
|
+
return (_e(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
9856
9860
|
}
|
|
9857
9861
|
function Co(r, e, t) {
|
|
9858
9862
|
const n = Yc(r);
|
|
9859
9863
|
Qc(r, e, t ? !n : n, "character");
|
|
9860
9864
|
}
|
|
9861
9865
|
function Ao(r) {
|
|
9862
|
-
if (Y(r) || !E(r) ||
|
|
9866
|
+
if (Y(r) || !E(r) || Je(r)) return !1;
|
|
9863
9867
|
const e = r.getFirstChild(), t = e === null || St(e) || L(e) || e.isInline();
|
|
9864
9868
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9865
9869
|
}
|
|
@@ -9936,7 +9940,7 @@ function nd(r) {
|
|
|
9936
9940
|
if (l) {
|
|
9937
9941
|
const [a, c, f, d, h, p] = l;
|
|
9938
9942
|
r.update(() => {
|
|
9939
|
-
const g =
|
|
9943
|
+
const g = j();
|
|
9940
9944
|
if (B(g)) {
|
|
9941
9945
|
const _ = g.anchor;
|
|
9942
9946
|
let D = _.getNode(), y = 0, w = 0;
|
|
@@ -10036,12 +10040,12 @@ function fl(r, e, t, n, s = /* @__PURE__ */ new Map(), o) {
|
|
|
10036
10040
|
}
|
|
10037
10041
|
const f = r.childNodes;
|
|
10038
10042
|
let d = [];
|
|
10039
|
-
const h = (u == null || !
|
|
10043
|
+
const h = (u == null || !Je(u)) && (u != null && $s(u) || n);
|
|
10040
10044
|
for (let p = 0; p < f.length; p++) d.push(...fl(f[p], e, t, h, new Map(s), u));
|
|
10041
10045
|
return c != null && (d = c(d)), bn(r) && (d = sd(r, d, h ? () => {
|
|
10042
10046
|
const p = new xi();
|
|
10043
10047
|
return t.push(p), p;
|
|
10044
|
-
} :
|
|
10048
|
+
} : le)), u == null ? d.length > 0 ? i = i.concat(d) : bn(r) && function(p) {
|
|
10045
10049
|
return p.nextSibling == null || p.previousSibling == null ? !1 : ks(p.nextSibling) && ks(p.previousSibling);
|
|
10046
10050
|
}(r) && (i = i.concat(Ft())) : E(u) && u.append(...d), i;
|
|
10047
10051
|
}
|
|
@@ -10067,10 +10071,10 @@ var Sn = id(function(r) {
|
|
|
10067
10071
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
10068
10072
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
10069
10073
|
});
|
|
10070
|
-
function od(r, e =
|
|
10074
|
+
function od(r, e = j()) {
|
|
10071
10075
|
return e == null && Sn(166), B(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : al(r, e);
|
|
10072
10076
|
}
|
|
10073
|
-
function ud(r, e =
|
|
10077
|
+
function ud(r, e = j()) {
|
|
10074
10078
|
return e == null && Sn(166), B(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(ld(r, e));
|
|
10075
10079
|
}
|
|
10076
10080
|
function Eo(r, e, t) {
|
|
@@ -10094,7 +10098,7 @@ function Eo(r, e, t) {
|
|
|
10094
10098
|
const i = o.split(/(\r?\n|\t)/);
|
|
10095
10099
|
i[i.length - 1] === "" && i.pop();
|
|
10096
10100
|
for (let u = 0; u < i.length; u++) {
|
|
10097
|
-
const l =
|
|
10101
|
+
const l = j();
|
|
10098
10102
|
if (B(l)) {
|
|
10099
10103
|
const a = i[u];
|
|
10100
10104
|
a === `
|
|
@@ -10160,7 +10164,7 @@ async function So(r, e, t) {
|
|
|
10160
10164
|
l(To(r, e, t));
|
|
10161
10165
|
});
|
|
10162
10166
|
});
|
|
10163
|
-
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o =
|
|
10167
|
+
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o = Fe(r._window);
|
|
10164
10168
|
if (n === null || o === null) return !1;
|
|
10165
10169
|
const i = s.createElement("span");
|
|
10166
10170
|
i.style.cssText = "position: fixed; top: -1000px;", i.append(s.createTextNode("#")), n.append(i);
|
|
@@ -10174,11 +10178,11 @@ async function So(r, e, t) {
|
|
|
10174
10178
|
}
|
|
10175
10179
|
function To(r, e, t) {
|
|
10176
10180
|
if (t === void 0) {
|
|
10177
|
-
const s =
|
|
10181
|
+
const s = Fe(r._window);
|
|
10178
10182
|
if (!s) return !1;
|
|
10179
10183
|
const o = s.anchorNode, i = s.focusNode;
|
|
10180
10184
|
if (o !== null && i !== null && !jr(r, o, i)) return !1;
|
|
10181
|
-
const u =
|
|
10185
|
+
const u = j();
|
|
10182
10186
|
if (u === null) return !1;
|
|
10183
10187
|
t = dd(u);
|
|
10184
10188
|
}
|
|
@@ -10187,7 +10191,7 @@ function To(r, e, t) {
|
|
|
10187
10191
|
return n !== null && (fd(n, t), !0);
|
|
10188
10192
|
}
|
|
10189
10193
|
const cd = [["text/html", od], ["application/x-lexical-editor", ud]];
|
|
10190
|
-
function dd(r =
|
|
10194
|
+
function dd(r = j()) {
|
|
10191
10195
|
const e = { "text/plain": r ? r.getTextContent() : "" };
|
|
10192
10196
|
if (r) {
|
|
10193
10197
|
const t = ac();
|
|
@@ -10255,11 +10259,11 @@ class Kn extends ot {
|
|
|
10255
10259
|
return { ...super.exportJSON(), type: "quote" };
|
|
10256
10260
|
}
|
|
10257
10261
|
insertNewAfter(e, t) {
|
|
10258
|
-
const n =
|
|
10262
|
+
const n = le(), s = this.getDirection();
|
|
10259
10263
|
return n.setDirection(s), this.insertAfter(n, t), n;
|
|
10260
10264
|
}
|
|
10261
10265
|
collapseAtStart() {
|
|
10262
|
-
const e =
|
|
10266
|
+
const e = le();
|
|
10263
10267
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
10264
10268
|
}
|
|
10265
10269
|
canMergeWhenEmpty() {
|
|
@@ -10267,7 +10271,7 @@ class Kn extends ot {
|
|
|
10267
10271
|
}
|
|
10268
10272
|
}
|
|
10269
10273
|
function vi() {
|
|
10270
|
-
return
|
|
10274
|
+
return Xe(new Kn());
|
|
10271
10275
|
}
|
|
10272
10276
|
class Hn extends ot {
|
|
10273
10277
|
static getType() {
|
|
@@ -10318,15 +10322,15 @@ class Hn extends ot {
|
|
|
10318
10322
|
return { ...super.exportJSON(), tag: this.getTag(), type: "heading", version: 1 };
|
|
10319
10323
|
}
|
|
10320
10324
|
insertNewAfter(e, t = !0) {
|
|
10321
|
-
const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), o = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ?
|
|
10325
|
+
const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), o = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ? le() : yr(this.getTag()), i = this.getDirection();
|
|
10322
10326
|
if (o.setDirection(i), this.insertAfter(o, t), n === 0 && !this.isEmpty() && e) {
|
|
10323
|
-
const u =
|
|
10327
|
+
const u = le();
|
|
10324
10328
|
u.select(), this.replace(u, !0);
|
|
10325
10329
|
}
|
|
10326
10330
|
return o;
|
|
10327
10331
|
}
|
|
10328
10332
|
collapseAtStart() {
|
|
10329
|
-
const e = this.isEmpty() ?
|
|
10333
|
+
const e = this.isEmpty() ? le() : yr(this.getTag());
|
|
10330
10334
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
10331
10335
|
}
|
|
10332
10336
|
extractWithChild() {
|
|
@@ -10346,7 +10350,7 @@ function _d(r) {
|
|
|
10346
10350
|
return r.style !== null && (e.setFormat(r.style.textAlign), pi(r, e)), { node: e };
|
|
10347
10351
|
}
|
|
10348
10352
|
function yr(r) {
|
|
10349
|
-
return
|
|
10353
|
+
return Xe(new Hn(r));
|
|
10350
10354
|
}
|
|
10351
10355
|
function sn(r) {
|
|
10352
10356
|
let e = null;
|
|
@@ -10355,7 +10359,7 @@ function sn(r) {
|
|
|
10355
10359
|
return [n, Array.from(e.files), s];
|
|
10356
10360
|
}
|
|
10357
10361
|
function Po(r) {
|
|
10358
|
-
const e =
|
|
10362
|
+
const e = j();
|
|
10359
10363
|
if (!B(e)) return !1;
|
|
10360
10364
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes();
|
|
10361
10365
|
for (let s = 0; s < n.length; s++) {
|
|
@@ -10374,19 +10378,19 @@ function on(r) {
|
|
|
10374
10378
|
}
|
|
10375
10379
|
function xd(r) {
|
|
10376
10380
|
return Ot(r.registerCommand(tu, (e) => {
|
|
10377
|
-
const t =
|
|
10378
|
-
return !!
|
|
10381
|
+
const t = j();
|
|
10382
|
+
return !!Ve(t) && (t.clear(), !0);
|
|
10379
10383
|
}, 0), r.registerCommand(Et, (e) => {
|
|
10380
|
-
const t =
|
|
10384
|
+
const t = j();
|
|
10381
10385
|
return !!B(t) && (t.deleteCharacter(e), !0);
|
|
10382
10386
|
}, G), r.registerCommand(Sr, (e) => {
|
|
10383
|
-
const t =
|
|
10387
|
+
const t = j();
|
|
10384
10388
|
return !!B(t) && (t.deleteWord(e), !0);
|
|
10385
10389
|
}, G), r.registerCommand(Tr, (e) => {
|
|
10386
|
-
const t =
|
|
10390
|
+
const t = j();
|
|
10387
10391
|
return !!B(t) && (t.deleteLine(e), !0);
|
|
10388
10392
|
}, G), r.registerCommand(Gt, (e) => {
|
|
10389
|
-
const t =
|
|
10393
|
+
const t = j();
|
|
10390
10394
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
10391
10395
|
else {
|
|
10392
10396
|
if (t === null) return !1;
|
|
@@ -10399,14 +10403,14 @@ function xd(r) {
|
|
|
10399
10403
|
}
|
|
10400
10404
|
return !0;
|
|
10401
10405
|
}, G), r.registerCommand(Cs, () => {
|
|
10402
|
-
const e =
|
|
10406
|
+
const e = j();
|
|
10403
10407
|
return !!B(e) && (e.removeText(), !0);
|
|
10404
|
-
}, G), r.registerCommand(
|
|
10405
|
-
const t =
|
|
10408
|
+
}, G), r.registerCommand(je, (e) => {
|
|
10409
|
+
const t = j();
|
|
10406
10410
|
return !!B(t) && (t.formatText(e), !0);
|
|
10407
10411
|
}, G), r.registerCommand(ka, (e) => {
|
|
10408
|
-
const t =
|
|
10409
|
-
if (!B(t) && !
|
|
10412
|
+
const t = j();
|
|
10413
|
+
if (!B(t) && !Ve(t)) return !1;
|
|
10410
10414
|
const n = t.getNodes();
|
|
10411
10415
|
for (const s of n) {
|
|
10412
10416
|
const o = Vn(s, (i) => E(i) && !i.isInline());
|
|
@@ -10414,20 +10418,20 @@ function xd(r) {
|
|
|
10414
10418
|
}
|
|
10415
10419
|
return !0;
|
|
10416
10420
|
}, G), r.registerCommand(Ht, (e) => {
|
|
10417
|
-
const t =
|
|
10421
|
+
const t = j();
|
|
10418
10422
|
return !!B(t) && (t.insertLineBreak(e), !0);
|
|
10419
10423
|
}, G), r.registerCommand(kr, () => {
|
|
10420
|
-
const e =
|
|
10424
|
+
const e = j();
|
|
10421
10425
|
return !!B(e) && (e.insertParagraph(), !0);
|
|
10422
10426
|
}, G), r.registerCommand(Aa, () => (kc([qr()]), !0), G), r.registerCommand(Ea, () => Po((e) => {
|
|
10423
10427
|
const t = e.getIndent();
|
|
10424
10428
|
e.setIndent(t + 1);
|
|
10425
|
-
}), G), r.registerCommand(
|
|
10429
|
+
}), G), r.registerCommand(Ii, () => Po((e) => {
|
|
10426
10430
|
const t = e.getIndent();
|
|
10427
10431
|
t > 0 && e.setIndent(t - 1);
|
|
10428
10432
|
}), G), r.registerCommand(su, (e) => {
|
|
10429
|
-
const t =
|
|
10430
|
-
if (
|
|
10433
|
+
const t = j();
|
|
10434
|
+
if (Ve(t) && !on(e.target)) {
|
|
10431
10435
|
const n = t.getNodes();
|
|
10432
10436
|
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
10433
10437
|
} else if (B(t)) {
|
|
@@ -10436,8 +10440,8 @@ function xd(r) {
|
|
|
10436
10440
|
}
|
|
10437
10441
|
return !1;
|
|
10438
10442
|
}, G), r.registerCommand(iu, (e) => {
|
|
10439
|
-
const t =
|
|
10440
|
-
if (
|
|
10443
|
+
const t = j();
|
|
10444
|
+
if (Ve(t)) {
|
|
10441
10445
|
const n = t.getNodes();
|
|
10442
10446
|
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
10443
10447
|
} else if (B(t)) {
|
|
@@ -10450,8 +10454,8 @@ function xd(r) {
|
|
|
10450
10454
|
}
|
|
10451
10455
|
return !1;
|
|
10452
10456
|
}, G), r.registerCommand(nu, (e) => {
|
|
10453
|
-
const t =
|
|
10454
|
-
if (
|
|
10457
|
+
const t = j();
|
|
10458
|
+
if (Ve(t)) {
|
|
10455
10459
|
const n = t.getNodes();
|
|
10456
10460
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
10457
10461
|
}
|
|
@@ -10462,8 +10466,8 @@ function xd(r) {
|
|
|
10462
10466
|
}
|
|
10463
10467
|
return !1;
|
|
10464
10468
|
}, G), r.registerCommand(ru, (e) => {
|
|
10465
|
-
const t =
|
|
10466
|
-
if (
|
|
10469
|
+
const t = j();
|
|
10470
|
+
if (Ve(t) && !on(e.target)) {
|
|
10467
10471
|
const s = t.getNodes();
|
|
10468
10472
|
if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
|
|
10469
10473
|
}
|
|
@@ -10472,16 +10476,16 @@ function xd(r) {
|
|
|
10472
10476
|
return !!wo(t, !1) && (e.preventDefault(), Co(t, n, !1), !0);
|
|
10473
10477
|
}, G), r.registerCommand(ou, (e) => {
|
|
10474
10478
|
if (on(e.target)) return !1;
|
|
10475
|
-
const t =
|
|
10479
|
+
const t = j();
|
|
10476
10480
|
if (!B(t)) return !1;
|
|
10477
10481
|
const { anchor: n } = t, s = n.getNode();
|
|
10478
|
-
return t.isCollapsed() && n.offset === 0 && !
|
|
10482
|
+
return t.isCollapsed() && n.offset === 0 && !_e(s) && rd(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Ii, void 0)) : (!No || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(Et, !0));
|
|
10479
10483
|
}, G), r.registerCommand(lu, (e) => {
|
|
10480
10484
|
if (on(e.target)) return !1;
|
|
10481
|
-
const t =
|
|
10485
|
+
const t = j();
|
|
10482
10486
|
return !!B(t) && (e.preventDefault(), r.dispatchCommand(Et, !1));
|
|
10483
10487
|
}, G), r.registerCommand(fn, (e) => {
|
|
10484
|
-
const t =
|
|
10488
|
+
const t = j();
|
|
10485
10489
|
if (!B(t)) return !1;
|
|
10486
10490
|
if (e !== null) {
|
|
10487
10491
|
if ((No || gd || yd) && pd) return !1;
|
|
@@ -10489,7 +10493,7 @@ function xd(r) {
|
|
|
10489
10493
|
}
|
|
10490
10494
|
return r.dispatchCommand(kr, void 0);
|
|
10491
10495
|
}, G), r.registerCommand(uu, () => {
|
|
10492
|
-
const e =
|
|
10496
|
+
const e = j();
|
|
10493
10497
|
return !!B(e) && (r.blur(), !0);
|
|
10494
10498
|
}, G), r.registerCommand(au, (e) => {
|
|
10495
10499
|
const [, t] = sn(e);
|
|
@@ -10505,19 +10509,19 @@ function xd(r) {
|
|
|
10505
10509
|
l.anchor.set(c, f, "element"), l.focus.set(c, f, "element");
|
|
10506
10510
|
}
|
|
10507
10511
|
const a = xu(l);
|
|
10508
|
-
|
|
10512
|
+
Ge(a);
|
|
10509
10513
|
}
|
|
10510
10514
|
r.dispatchCommand(Fo, t);
|
|
10511
10515
|
}
|
|
10512
10516
|
return e.preventDefault(), !0;
|
|
10513
10517
|
}
|
|
10514
|
-
const n =
|
|
10518
|
+
const n = j();
|
|
10515
10519
|
return !!B(n);
|
|
10516
10520
|
}, G), r.registerCommand(cu, (e) => {
|
|
10517
|
-
const [t] = sn(e), n =
|
|
10521
|
+
const [t] = sn(e), n = j();
|
|
10518
10522
|
return !(t && !B(n));
|
|
10519
10523
|
}, G), r.registerCommand(du, (e) => {
|
|
10520
|
-
const [t] = sn(e), n =
|
|
10524
|
+
const [t] = sn(e), n = j();
|
|
10521
10525
|
if (t && !B(n)) return !1;
|
|
10522
10526
|
const s = Bo(e.clientX, e.clientY);
|
|
10523
10527
|
if (s !== null) {
|
|
@@ -10527,31 +10531,31 @@ function xd(r) {
|
|
|
10527
10531
|
return !0;
|
|
10528
10532
|
}, G), r.registerCommand(As, () => (ic(), !0), G), r.registerCommand(Ln, (e) => (So(r, gt(e, ClipboardEvent) ? e : null), !0), G), r.registerCommand(Qs, (e) => (async function(t, n) {
|
|
10529
10533
|
await So(n, gt(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
10530
|
-
const s =
|
|
10531
|
-
B(s) ? s.removeText() :
|
|
10534
|
+
const s = j();
|
|
10535
|
+
B(s) ? s.removeText() : Ve(s) && s.getNodes().forEach((o) => o.remove());
|
|
10532
10536
|
});
|
|
10533
10537
|
}(e, r), !0), G), r.registerCommand(Fn, (e) => {
|
|
10534
10538
|
const [, t, n] = sn(e);
|
|
10535
|
-
return t.length > 0 && !n ? (r.dispatchCommand(Fo, t), !0) : oi(e.target) ? !1 :
|
|
10539
|
+
return t.length > 0 && !n ? (r.dispatchCommand(Fo, t), !0) : oi(e.target) ? !1 : j() !== null && (function(s, o) {
|
|
10536
10540
|
s.preventDefault(), o.update(() => {
|
|
10537
|
-
const i =
|
|
10541
|
+
const i = j(), u = gt(s, InputEvent) || gt(s, KeyboardEvent) ? null : s.clipboardData;
|
|
10538
10542
|
u != null && i !== null && Eo(u, i, o);
|
|
10539
10543
|
}, { tag: "paste" });
|
|
10540
10544
|
}(e, r), !0);
|
|
10541
10545
|
}, G));
|
|
10542
10546
|
}
|
|
10543
|
-
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10547
|
+
const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
|
|
10544
10548
|
function Oo(r) {
|
|
10545
10549
|
return r.getEditorState().read(nl(r.isComposing()));
|
|
10546
10550
|
}
|
|
10547
10551
|
function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
10548
|
-
const [n] =
|
|
10552
|
+
const [n] = Ye(), s = function(o, i) {
|
|
10549
10553
|
const [u, l] = Q(() => o.getDecorators());
|
|
10550
10554
|
return qs(() => o.registerDecoratorListener((a) => {
|
|
10551
10555
|
ql(() => {
|
|
10552
10556
|
l(a);
|
|
10553
10557
|
});
|
|
10554
|
-
}), [o]),
|
|
10558
|
+
}), [o]), pe(() => {
|
|
10555
10559
|
l(o.getDecorators());
|
|
10556
10560
|
}, [o]), Pt(() => {
|
|
10557
10561
|
const a = [], c = Object.keys(u);
|
|
@@ -10567,7 +10571,7 @@ function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
10567
10571
|
}(n), v.jsxs(v.Fragment, { children: [r, v.jsx(bd, { content: e }), s] });
|
|
10568
10572
|
}
|
|
10569
10573
|
function bd({ content: r }) {
|
|
10570
|
-
const [e] =
|
|
10574
|
+
const [e] = Ye(), t = function(s) {
|
|
10571
10575
|
const [o, i] = Q(() => Oo(s));
|
|
10572
10576
|
return qs(() => {
|
|
10573
10577
|
function u() {
|
|
@@ -10580,10 +10584,10 @@ function bd({ content: r }) {
|
|
|
10580
10584
|
u();
|
|
10581
10585
|
}));
|
|
10582
10586
|
}, [s]), o;
|
|
10583
|
-
}(e), n =
|
|
10587
|
+
}(e), n = Mc();
|
|
10584
10588
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
10585
10589
|
}
|
|
10586
|
-
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10590
|
+
const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
|
|
10587
10591
|
function Dd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: u, ariaLabel: l, ariaLabelledBy: a, ariaMultiline: c, ariaOwns: f, ariaRequired: d, autoCapitalize: h, className: p, id: g, role: _ = "textbox", spellCheck: D = !0, style: y, tabIndex: w, "data-testid": x, ...C }, b) {
|
|
10588
10592
|
const [k, A] = Q(r.isEditable()), S = Z((F) => {
|
|
10589
10593
|
F && F.ownerDocument && F.ownerDocument.defaultView ? r.setRootElement(F) : r.setRootElement(null);
|
|
@@ -10604,7 +10608,7 @@ function Ro(r) {
|
|
|
10604
10608
|
}
|
|
10605
10609
|
const Cd = Qo(Ad);
|
|
10606
10610
|
function Ad(r, e) {
|
|
10607
|
-
const { placeholder: t, ...n } = r, [s] =
|
|
10611
|
+
const { placeholder: t, ...n } = r, [s] = Ye();
|
|
10608
10612
|
return v.jsxs(v.Fragment, { children: [v.jsx(wd, { editor: s, ...n, ref: e }), t != null && v.jsx(Ed, { editor: s, content: t })] });
|
|
10609
10613
|
}
|
|
10610
10614
|
function Ed({ content: r, editor: e }) {
|
|
@@ -10628,12 +10632,12 @@ function Ed({ content: r, editor: e }) {
|
|
|
10628
10632
|
let o = null;
|
|
10629
10633
|
return typeof r == "function" ? o = r(n) : r !== null && (o = r), o === null ? null : v.jsx("div", { "aria-hidden": !0, children: o });
|
|
10630
10634
|
}
|
|
10631
|
-
const un = 0, zs = 1, Us = 2,
|
|
10635
|
+
const un = 0, zs = 1, Us = 2, Re = 0, kd = 1, jo = 2, Sd = 3, Td = 4;
|
|
10632
10636
|
function Bd(r, e, t, n, s) {
|
|
10633
|
-
if (r === null || t.size === 0 && n.size === 0 && !s) return
|
|
10637
|
+
if (r === null || t.size === 0 && n.size === 0 && !s) return Re;
|
|
10634
10638
|
const o = e._selection, i = r._selection;
|
|
10635
10639
|
if (s) return kd;
|
|
10636
|
-
if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return
|
|
10640
|
+
if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return Re;
|
|
10637
10641
|
const u = function(D, y, w) {
|
|
10638
10642
|
const x = D._nodeMap, C = [];
|
|
10639
10643
|
for (const b of y) {
|
|
@@ -10643,35 +10647,35 @@ function Bd(r, e, t, n, s) {
|
|
|
10643
10647
|
for (const [b, k] of w) {
|
|
10644
10648
|
if (!k) continue;
|
|
10645
10649
|
const A = x.get(b);
|
|
10646
|
-
A === void 0 ||
|
|
10650
|
+
A === void 0 || _e(A) || C.push(A);
|
|
10647
10651
|
}
|
|
10648
10652
|
return C;
|
|
10649
10653
|
}(e, t, n);
|
|
10650
|
-
if (u.length === 0) return
|
|
10654
|
+
if (u.length === 0) return Re;
|
|
10651
10655
|
if (u.length > 1) {
|
|
10652
10656
|
const D = e._nodeMap, y = D.get(o.anchor.key), w = D.get(i.anchor.key);
|
|
10653
|
-
return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo :
|
|
10657
|
+
return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo : Re;
|
|
10654
10658
|
}
|
|
10655
10659
|
const l = u[0], a = r._nodeMap.get(l.__key);
|
|
10656
|
-
if (!L(a) || !L(l) || a.__mode !== l.__mode) return
|
|
10660
|
+
if (!L(a) || !L(l) || a.__mode !== l.__mode) return Re;
|
|
10657
10661
|
const c = a.__text, f = l.__text;
|
|
10658
|
-
if (c === f) return
|
|
10662
|
+
if (c === f) return Re;
|
|
10659
10663
|
const d = o.anchor, h = i.anchor;
|
|
10660
|
-
if (d.key !== h.key || d.type !== "text") return
|
|
10664
|
+
if (d.key !== h.key || d.type !== "text") return Re;
|
|
10661
10665
|
const p = d.offset, g = h.offset, _ = f.length - c.length;
|
|
10662
|
-
return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td :
|
|
10666
|
+
return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td : Re;
|
|
10663
10667
|
}
|
|
10664
10668
|
function Nd(r, e) {
|
|
10665
|
-
let t = Date.now(), n =
|
|
10669
|
+
let t = Date.now(), n = Re;
|
|
10666
10670
|
return (s, o, i, u, l, a) => {
|
|
10667
10671
|
const c = Date.now();
|
|
10668
|
-
if (a.has("historic")) return n =
|
|
10672
|
+
if (a.has("historic")) return n = Re, t = c, Us;
|
|
10669
10673
|
const f = Bd(s, o, u, l, r.isComposing()), d = (() => {
|
|
10670
10674
|
const h = i === null || i.editor === r, p = a.has("history-push");
|
|
10671
10675
|
if (!p && h && a.has("history-merge")) return un;
|
|
10672
10676
|
if (s === null) return zs;
|
|
10673
10677
|
const g = o._selection;
|
|
10674
|
-
return u.size > 0 || l.size > 0 ? p === !1 && f !==
|
|
10678
|
+
return u.size > 0 || l.size > 0 ? p === !1 && f !== Re && f === n && c < t + e && h || u.size === 1 && function(_, D, y) {
|
|
10675
10679
|
const w = D._nodeMap.get(_), x = y._nodeMap.get(_), C = D._selection, b = y._selection;
|
|
10676
10680
|
return !(B(C) && B(b) && C.anchor.type === "element" && C.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !L(w) || !L(x) || w.__parent !== x.__parent) && JSON.stringify(D.read(() => w.exportJSON())) === JSON.stringify(y.read(() => x.exportJSON()));
|
|
10677
10681
|
}(Array.from(u)[0], s, o) ? un : zs : g !== null ? un : Us;
|
|
@@ -10679,7 +10683,7 @@ function Nd(r, e) {
|
|
|
10679
10683
|
return t = c, n = f, d;
|
|
10680
10684
|
};
|
|
10681
10685
|
}
|
|
10682
|
-
function
|
|
10686
|
+
function Io(r) {
|
|
10683
10687
|
r.undoStack = [], r.redoStack = [], r.current = null;
|
|
10684
10688
|
}
|
|
10685
10689
|
function Fd(r, e, t) {
|
|
@@ -10698,7 +10702,7 @@ function Fd(r, e, t) {
|
|
|
10698
10702
|
const c = u.pop();
|
|
10699
10703
|
u.length === 0 && o.dispatchCommand(Zr, !1), i.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
|
|
10700
10704
|
}
|
|
10701
|
-
}(r, e), !0), G), r.registerCommand(Ta, () => (
|
|
10705
|
+
}(r, e), !0), G), r.registerCommand(Ta, () => (Io(e), !1), G), r.registerCommand(Ba, () => (Io(e), r.dispatchCommand(Zr, !1), r.dispatchCommand(en, !1), !0), G), r.registerUpdateListener(({ editorState: o, prevEditorState: i, dirtyLeaves: u, dirtyElements: l, tags: a }) => {
|
|
10702
10706
|
const c = e.current, f = e.redoStack, d = e.undoStack, h = c === null ? null : c.editorState;
|
|
10703
10707
|
if (c !== null && o === h) return;
|
|
10704
10708
|
const p = n(i, o, c, u, l, a);
|
|
@@ -10711,15 +10715,15 @@ function Ld() {
|
|
|
10711
10715
|
return { current: null, redoStack: [], undoStack: [] };
|
|
10712
10716
|
}
|
|
10713
10717
|
function Pd({ delay: r, externalHistoryState: e }) {
|
|
10714
|
-
const [t] =
|
|
10718
|
+
const [t] = Ye();
|
|
10715
10719
|
return function(n, s, o = 1e3) {
|
|
10716
10720
|
const i = Pt(() => s || Ld(), [s]);
|
|
10717
|
-
|
|
10721
|
+
pe(() => Fd(n, i, o), [o, n, i]);
|
|
10718
10722
|
}(t, e, r), null;
|
|
10719
10723
|
}
|
|
10720
|
-
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er :
|
|
10724
|
+
const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
|
|
10721
10725
|
function Rd({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
|
|
10722
|
-
const [n] =
|
|
10726
|
+
const [n] = Ye();
|
|
10723
10727
|
return Od(() => {
|
|
10724
10728
|
if (t) return n.registerUpdateListener(({ editorState: s, dirtyElements: o, dirtyLeaves: i, prevEditorState: u, tags: l }) => {
|
|
10725
10729
|
e && o.size === 0 && i.size === 0 || r && l.has("history-merge") || u.isEmpty() || t(s, n, l);
|
|
@@ -10731,11 +10735,11 @@ function Ws(r, e) {
|
|
|
10731
10735
|
return t.__proto__ = n, t;
|
|
10732
10736
|
}, Ws(r, e);
|
|
10733
10737
|
}
|
|
10734
|
-
var
|
|
10738
|
+
var Mo = { error: null }, jd = function(r) {
|
|
10735
10739
|
var e, t;
|
|
10736
10740
|
function n() {
|
|
10737
10741
|
for (var o, i = arguments.length, u = new Array(i), l = 0; l < i; l++) u[l] = arguments[l];
|
|
10738
|
-
return (o = r.call.apply(r, [this].concat(u)) || this).state =
|
|
10742
|
+
return (o = r.call.apply(r, [this].concat(u)) || this).state = Mo, o.resetErrorBoundary = function() {
|
|
10739
10743
|
for (var a, c = arguments.length, f = new Array(c), d = 0; d < c; d++) f[d] = arguments[d];
|
|
10740
10744
|
o.props.onReset == null || (a = o.props).onReset.apply(a, f), o.reset();
|
|
10741
10745
|
}, o;
|
|
@@ -10745,7 +10749,7 @@ var Io = { error: null }, jd = function(r) {
|
|
|
10745
10749
|
};
|
|
10746
10750
|
var s = n.prototype;
|
|
10747
10751
|
return s.reset = function() {
|
|
10748
|
-
this.setState(
|
|
10752
|
+
this.setState(Mo);
|
|
10749
10753
|
}, s.componentDidCatch = function(o, i) {
|
|
10750
10754
|
var u, l;
|
|
10751
10755
|
(u = (l = this.props).onError) == null || u.call(l, o, i);
|
|
@@ -10766,13 +10770,13 @@ var Io = { error: null }, jd = function(r) {
|
|
|
10766
10770
|
return this.props.children;
|
|
10767
10771
|
}, n;
|
|
10768
10772
|
}(ss.Component);
|
|
10769
|
-
function
|
|
10773
|
+
function Id({ children: r, onError: e }) {
|
|
10770
10774
|
return v.jsx(jd, { fallback: v.jsx("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: e, children: r });
|
|
10771
10775
|
}
|
|
10772
|
-
function
|
|
10776
|
+
function Md(r) {
|
|
10773
10777
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
10774
10778
|
}
|
|
10775
|
-
var
|
|
10779
|
+
var Ke = Md(function(r) {
|
|
10776
10780
|
const e = new URLSearchParams();
|
|
10777
10781
|
e.append("code", r);
|
|
10778
10782
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -10787,7 +10791,7 @@ function $d(r) {
|
|
|
10787
10791
|
e++, t = n.getParent();
|
|
10788
10792
|
continue;
|
|
10789
10793
|
}
|
|
10790
|
-
|
|
10794
|
+
Ke(40);
|
|
10791
10795
|
}
|
|
10792
10796
|
return e;
|
|
10793
10797
|
}
|
|
@@ -10795,7 +10799,7 @@ function $d(r) {
|
|
|
10795
10799
|
}
|
|
10796
10800
|
function Vs(r) {
|
|
10797
10801
|
let e = r.getParent();
|
|
10798
|
-
H(e) ||
|
|
10802
|
+
H(e) || Ke(40);
|
|
10799
10803
|
let t = e;
|
|
10800
10804
|
for (; t !== null; ) t = t.getParent(), H(t) && (e = t);
|
|
10801
10805
|
return e;
|
|
@@ -10809,29 +10813,29 @@ function gl(r) {
|
|
|
10809
10813
|
}
|
|
10810
10814
|
return e;
|
|
10811
10815
|
}
|
|
10812
|
-
function
|
|
10816
|
+
function He(r) {
|
|
10813
10817
|
return ee(r) && H(r.getFirstChild());
|
|
10814
10818
|
}
|
|
10815
10819
|
function $o(r) {
|
|
10816
|
-
return
|
|
10820
|
+
return ke().append(r);
|
|
10817
10821
|
}
|
|
10818
10822
|
function ml(r, e) {
|
|
10819
10823
|
return ee(r) && (e.length === 0 || e.length === 1 && r.is(e[0]) && r.getChildrenSize() === 0);
|
|
10820
10824
|
}
|
|
10821
10825
|
function qo(r, e) {
|
|
10822
10826
|
r.update(() => {
|
|
10823
|
-
const t =
|
|
10827
|
+
const t = j();
|
|
10824
10828
|
if (t !== null) {
|
|
10825
10829
|
const n = t.getNodes();
|
|
10826
10830
|
if (B(t)) {
|
|
10827
10831
|
const o = t.getStartEndPoints();
|
|
10828
|
-
o === null &&
|
|
10832
|
+
o === null && Ke(143);
|
|
10829
10833
|
const [i] = o, u = i.getNode(), l = u.getParent();
|
|
10830
10834
|
if (ml(u, n)) {
|
|
10831
|
-
const a =
|
|
10832
|
-
if (
|
|
10835
|
+
const a = Ce(e);
|
|
10836
|
+
if (Je(l)) {
|
|
10833
10837
|
u.replace(a);
|
|
10834
|
-
const c =
|
|
10838
|
+
const c = ke();
|
|
10835
10839
|
E(u) && (c.setFormat(u.getFormatType()), c.setIndent(u.getIndent())), a.append(c);
|
|
10836
10840
|
} else if (ee(u)) {
|
|
10837
10841
|
const c = u.getParentOrThrow();
|
|
@@ -10850,14 +10854,14 @@ function qo(r, e) {
|
|
|
10850
10854
|
const l = u.getKey();
|
|
10851
10855
|
if (H(u)) {
|
|
10852
10856
|
if (!s.has(l)) {
|
|
10853
|
-
const a =
|
|
10857
|
+
const a = Ce(e);
|
|
10854
10858
|
Lt(a, u.getChildren()), u.replace(a), s.add(l);
|
|
10855
10859
|
}
|
|
10856
10860
|
break;
|
|
10857
10861
|
}
|
|
10858
10862
|
{
|
|
10859
10863
|
const a = u.getParent();
|
|
10860
|
-
if (
|
|
10864
|
+
if (Je(a) && !s.has(l)) {
|
|
10861
10865
|
s.add(l), zo(u, e);
|
|
10862
10866
|
break;
|
|
10863
10867
|
}
|
|
@@ -10875,25 +10879,25 @@ function Lt(r, e) {
|
|
|
10875
10879
|
}
|
|
10876
10880
|
function zo(r, e) {
|
|
10877
10881
|
if (H(r)) return r;
|
|
10878
|
-
const t = r.getPreviousSibling(), n = r.getNextSibling(), s =
|
|
10882
|
+
const t = r.getPreviousSibling(), n = r.getNextSibling(), s = ke();
|
|
10879
10883
|
let o;
|
|
10880
10884
|
if (Lt(s, r.getChildren()), H(t) && e === t.getListType()) t.append(s), H(n) && e === n.getListType() && (Lt(t, n.getChildren()), n.remove()), o = t;
|
|
10881
10885
|
else if (H(n) && e === n.getListType()) n.getFirstChildOrThrow().insertBefore(s), o = n;
|
|
10882
10886
|
else {
|
|
10883
|
-
const i =
|
|
10887
|
+
const i = Ce(e);
|
|
10884
10888
|
i.append(s), r.replace(i), o = i;
|
|
10885
10889
|
}
|
|
10886
10890
|
return s.setFormat(r.getFormatType()), s.setIndent(r.getIndent()), r.remove(), o;
|
|
10887
10891
|
}
|
|
10888
10892
|
function bi(r, e) {
|
|
10889
10893
|
const t = r.getLastChild(), n = e.getFirstChild();
|
|
10890
|
-
t && n &&
|
|
10894
|
+
t && n && He(t) && He(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
10891
10895
|
const s = e.getChildren();
|
|
10892
10896
|
s.length > 0 && r.append(...s), e.remove();
|
|
10893
10897
|
}
|
|
10894
10898
|
function qd(r) {
|
|
10895
10899
|
r.update(() => {
|
|
10896
|
-
const e =
|
|
10900
|
+
const e = j();
|
|
10897
10901
|
if (B(e)) {
|
|
10898
10902
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes(), s = e.anchor.getNode();
|
|
10899
10903
|
if (ml(s, n)) t.add(Vs(s));
|
|
@@ -10908,7 +10912,7 @@ function qd(r) {
|
|
|
10908
10912
|
let i = o;
|
|
10909
10913
|
const u = gl(o);
|
|
10910
10914
|
for (const l of u) {
|
|
10911
|
-
const a =
|
|
10915
|
+
const a = le();
|
|
10912
10916
|
Lt(a, l.getChildren()), i.insertAfter(a), i = a, l.__key === e.anchor.key && e.anchor.set(a.getKey(), 0, "element"), l.__key === e.focus.key && e.focus.set(a.getKey(), 0, "element"), l.remove();
|
|
10913
10917
|
}
|
|
10914
10918
|
o.remove();
|
|
@@ -10918,65 +10922,65 @@ function qd(r) {
|
|
|
10918
10922
|
}
|
|
10919
10923
|
function zd(r) {
|
|
10920
10924
|
const e = /* @__PURE__ */ new Set();
|
|
10921
|
-
if (
|
|
10925
|
+
if (He(r) || e.has(r.getKey())) return;
|
|
10922
10926
|
const t = r.getParent(), n = r.getNextSibling(), s = r.getPreviousSibling();
|
|
10923
|
-
if (
|
|
10927
|
+
if (He(n) && He(s)) {
|
|
10924
10928
|
const o = s.getFirstChild();
|
|
10925
10929
|
if (H(o)) {
|
|
10926
10930
|
o.append(r);
|
|
10927
10931
|
const i = n.getFirstChild();
|
|
10928
10932
|
H(i) && (Lt(o, i.getChildren()), n.remove(), e.add(n.getKey()));
|
|
10929
10933
|
}
|
|
10930
|
-
} else if (
|
|
10934
|
+
} else if (He(n)) {
|
|
10931
10935
|
const o = n.getFirstChild();
|
|
10932
10936
|
if (H(o)) {
|
|
10933
10937
|
const i = o.getFirstChild();
|
|
10934
10938
|
i !== null && i.insertBefore(r);
|
|
10935
10939
|
}
|
|
10936
|
-
} else if (
|
|
10940
|
+
} else if (He(s)) {
|
|
10937
10941
|
const o = s.getFirstChild();
|
|
10938
10942
|
H(o) && o.append(r);
|
|
10939
10943
|
} else if (H(t)) {
|
|
10940
|
-
const o =
|
|
10944
|
+
const o = ke(), i = Ce(t.getListType());
|
|
10941
10945
|
o.append(i), i.append(r), s ? s.insertAfter(o) : n ? n.insertBefore(o) : t.append(o);
|
|
10942
10946
|
}
|
|
10943
10947
|
}
|
|
10944
10948
|
function Ud(r) {
|
|
10945
|
-
if (
|
|
10949
|
+
if (He(r)) return;
|
|
10946
10950
|
const e = r.getParent(), t = e ? e.getParent() : void 0;
|
|
10947
10951
|
if (H(t ? t.getParent() : void 0) && ee(t) && H(e)) {
|
|
10948
10952
|
const n = e ? e.getFirstChild() : void 0, s = e ? e.getLastChild() : void 0;
|
|
10949
10953
|
if (r.is(n)) t.insertBefore(r), e.isEmpty() && t.remove();
|
|
10950
10954
|
else if (r.is(s)) t.insertAfter(r), e.isEmpty() && t.remove();
|
|
10951
10955
|
else {
|
|
10952
|
-
const o = e.getListType(), i =
|
|
10956
|
+
const o = e.getListType(), i = ke(), u = Ce(o);
|
|
10953
10957
|
i.append(u), r.getPreviousSiblings().forEach((c) => u.append(c));
|
|
10954
|
-
const l =
|
|
10958
|
+
const l = ke(), a = Ce(o);
|
|
10955
10959
|
l.append(a), Lt(a, r.getNextSiblings()), t.insertBefore(i), t.insertAfter(l), t.replace(r);
|
|
10956
10960
|
}
|
|
10957
10961
|
}
|
|
10958
10962
|
}
|
|
10959
10963
|
function Wd() {
|
|
10960
|
-
const r =
|
|
10964
|
+
const r = j();
|
|
10961
10965
|
if (!B(r) || !r.isCollapsed()) return !1;
|
|
10962
10966
|
const e = r.anchor.getNode();
|
|
10963
10967
|
if (!ee(e) || e.getChildrenSize() !== 0) return !1;
|
|
10964
10968
|
const t = Vs(e), n = e.getParent();
|
|
10965
|
-
H(n) ||
|
|
10969
|
+
H(n) || Ke(40);
|
|
10966
10970
|
const s = n.getParent();
|
|
10967
10971
|
let o;
|
|
10968
|
-
if (
|
|
10972
|
+
if (Je(s)) o = le(), t.insertAfter(o);
|
|
10969
10973
|
else {
|
|
10970
10974
|
if (!ee(s)) return !1;
|
|
10971
|
-
o =
|
|
10975
|
+
o = ke(), s.insertAfter(o);
|
|
10972
10976
|
}
|
|
10973
10977
|
o.select();
|
|
10974
10978
|
const i = e.getNextSiblings();
|
|
10975
10979
|
if (i.length > 0) {
|
|
10976
|
-
const u =
|
|
10980
|
+
const u = Ce(n.getListType());
|
|
10977
10981
|
if (Zt(o)) o.insertAfter(u);
|
|
10978
10982
|
else {
|
|
10979
|
-
const l =
|
|
10983
|
+
const l = ke();
|
|
10980
10984
|
l.append(u), o.insertAfter(l);
|
|
10981
10985
|
}
|
|
10982
10986
|
i.forEach((l) => {
|
|
@@ -11018,7 +11022,7 @@ class Rt extends ot {
|
|
|
11018
11022
|
}
|
|
11019
11023
|
static transform() {
|
|
11020
11024
|
return (e) => {
|
|
11021
|
-
if (ee(e) ||
|
|
11025
|
+
if (ee(e) || Ke(144), e.__checked == null) return;
|
|
11022
11026
|
const t = e.getParent();
|
|
11023
11027
|
H(t) && t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0);
|
|
11024
11028
|
};
|
|
@@ -11027,7 +11031,7 @@ class Rt extends ot {
|
|
|
11027
11031
|
return { li: () => ({ conversion: Vd, priority: 0 }) };
|
|
11028
11032
|
}
|
|
11029
11033
|
static importJSON(e) {
|
|
11030
|
-
const t =
|
|
11034
|
+
const t = ke();
|
|
11031
11035
|
return t.setChecked(e.checked), t.setValue(e.value), t.setFormat(e.format), t.setDirection(e.direction), t;
|
|
11032
11036
|
}
|
|
11033
11037
|
exportDOM(e) {
|
|
@@ -11055,7 +11059,7 @@ class Rt extends ot {
|
|
|
11055
11059
|
if (n.__first === this.getKey()) n.insertBefore(e);
|
|
11056
11060
|
else if (n.__last === this.getKey()) n.insertAfter(e);
|
|
11057
11061
|
else {
|
|
11058
|
-
const s =
|
|
11062
|
+
const s = Ce(n.getListType());
|
|
11059
11063
|
let o = this.getNextSibling();
|
|
11060
11064
|
for (; o; ) {
|
|
11061
11065
|
const i = o;
|
|
@@ -11063,30 +11067,30 @@ class Rt extends ot {
|
|
|
11063
11067
|
}
|
|
11064
11068
|
n.insertAfter(e), e.insertAfter(s);
|
|
11065
11069
|
}
|
|
11066
|
-
return t && (E(e) ||
|
|
11070
|
+
return t && (E(e) || Ke(139), this.getChildren().forEach((s) => {
|
|
11067
11071
|
e.append(s);
|
|
11068
11072
|
})), this.remove(), n.getChildrenSize() === 0 && n.remove(), e;
|
|
11069
11073
|
}
|
|
11070
11074
|
insertAfter(e, t = !0) {
|
|
11071
11075
|
const n = this.getParentOrThrow();
|
|
11072
|
-
if (H(n) ||
|
|
11076
|
+
if (H(n) || Ke(39), ee(e)) return super.insertAfter(e, t);
|
|
11073
11077
|
const s = this.getNextSiblings();
|
|
11074
11078
|
if (n.insertAfter(e, t), s.length !== 0) {
|
|
11075
|
-
const o =
|
|
11079
|
+
const o = Ce(n.getListType());
|
|
11076
11080
|
s.forEach((i) => o.append(i)), e.insertAfter(o, t);
|
|
11077
11081
|
}
|
|
11078
11082
|
return e;
|
|
11079
11083
|
}
|
|
11080
11084
|
remove(e) {
|
|
11081
11085
|
const t = this.getPreviousSibling(), n = this.getNextSibling();
|
|
11082
|
-
super.remove(e), t && n &&
|
|
11086
|
+
super.remove(e), t && n && He(t) && He(n) && (bi(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
11083
11087
|
}
|
|
11084
11088
|
insertNewAfter(e, t = !0) {
|
|
11085
|
-
const n =
|
|
11089
|
+
const n = ke(this.__checked == null && void 0);
|
|
11086
11090
|
return this.insertAfter(n, t), n;
|
|
11087
11091
|
}
|
|
11088
11092
|
collapseAtStart(e) {
|
|
11089
|
-
const t =
|
|
11093
|
+
const t = le();
|
|
11090
11094
|
this.getChildren().forEach((i) => t.append(i));
|
|
11091
11095
|
const n = this.getParentOrThrow(), s = n.getParentOrThrow(), o = ee(s);
|
|
11092
11096
|
if (n.getChildrenSize() === 1) if (o) n.remove(), s.select();
|
|
@@ -11124,7 +11128,7 @@ class Rt extends ot {
|
|
|
11124
11128
|
return n;
|
|
11125
11129
|
}
|
|
11126
11130
|
setIndent(e) {
|
|
11127
|
-
typeof e != "number" &&
|
|
11131
|
+
typeof e != "number" && Ke(117), (e = Math.floor(e)) >= 0 || Ke(199);
|
|
11128
11132
|
let t = this.getIndent();
|
|
11129
11133
|
for (; t !== e; ) t < e ? (zd(this), t++) : (Ud(this), t--);
|
|
11130
11134
|
return this;
|
|
@@ -11147,7 +11151,7 @@ class Rt extends ot {
|
|
|
11147
11151
|
return !0;
|
|
11148
11152
|
}
|
|
11149
11153
|
createParentElementNode() {
|
|
11150
|
-
return
|
|
11154
|
+
return Ce("bullet");
|
|
11151
11155
|
}
|
|
11152
11156
|
canMergeWhenEmpty() {
|
|
11153
11157
|
return !0;
|
|
@@ -11174,13 +11178,13 @@ function Vd(r) {
|
|
|
11174
11178
|
for (const t of r.children) if (t.tagName === "INPUT") return Kd(t);
|
|
11175
11179
|
}
|
|
11176
11180
|
const e = r.getAttribute("aria-checked");
|
|
11177
|
-
return { node:
|
|
11181
|
+
return { node: ke(e === "true" || e !== "false" && void 0) };
|
|
11178
11182
|
}
|
|
11179
11183
|
function Kd(r) {
|
|
11180
|
-
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node:
|
|
11184
|
+
return r.getAttribute("type") !== "checkbox" ? { node: null } : { node: ke(r.hasAttribute("checked")) };
|
|
11181
11185
|
}
|
|
11182
|
-
function
|
|
11183
|
-
return
|
|
11186
|
+
function ke(r) {
|
|
11187
|
+
return Xe(new Rt(void 0, r));
|
|
11184
11188
|
}
|
|
11185
11189
|
function ee(r) {
|
|
11186
11190
|
return r instanceof Rt;
|
|
@@ -11220,7 +11224,7 @@ class sr extends ot {
|
|
|
11220
11224
|
}
|
|
11221
11225
|
static transform() {
|
|
11222
11226
|
return (e) => {
|
|
11223
|
-
H(e) ||
|
|
11227
|
+
H(e) || Ke(163), function(t) {
|
|
11224
11228
|
const n = t.getNextSibling();
|
|
11225
11229
|
H(n) && t.getListType() === n.getListType() && bi(t, n);
|
|
11226
11230
|
}(e), function(t) {
|
|
@@ -11234,7 +11238,7 @@ class sr extends ot {
|
|
|
11234
11238
|
return { ol: () => ({ conversion: Ko, priority: 0 }), ul: () => ({ conversion: Ko, priority: 0 }) };
|
|
11235
11239
|
}
|
|
11236
11240
|
static importJSON(e) {
|
|
11237
|
-
const t =
|
|
11241
|
+
const t = Ce(e.listType, e.start);
|
|
11238
11242
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
|
|
11239
11243
|
}
|
|
11240
11244
|
exportDOM(e) {
|
|
@@ -11255,11 +11259,11 @@ class sr extends ot {
|
|
|
11255
11259
|
const n = e[t];
|
|
11256
11260
|
if (ee(n)) super.append(n);
|
|
11257
11261
|
else {
|
|
11258
|
-
const s =
|
|
11262
|
+
const s = ke();
|
|
11259
11263
|
if (H(n)) s.append(n);
|
|
11260
11264
|
else if (E(n)) if (n.isInline()) s.append(n);
|
|
11261
11265
|
else {
|
|
11262
|
-
const o =
|
|
11266
|
+
const o = ce(n.getTextContent());
|
|
11263
11267
|
s.append(o);
|
|
11264
11268
|
}
|
|
11265
11269
|
else s.append(n);
|
|
@@ -11306,15 +11310,15 @@ function Hd(r) {
|
|
|
11306
11310
|
function Ko(r) {
|
|
11307
11311
|
const e = r.nodeName.toLowerCase();
|
|
11308
11312
|
let t = null;
|
|
11309
|
-
return e === "ol" ? t =
|
|
11313
|
+
return e === "ol" ? t = Ce("number", r.start) : e === "ul" && (t = function(n) {
|
|
11310
11314
|
if (n.getAttribute("__lexicallisttype") === "check" || n.classList.contains("contains-task-list")) return !0;
|
|
11311
11315
|
for (const s of n.childNodes) if (st(s) && s.hasAttribute("aria-checked")) return !0;
|
|
11312
11316
|
return !1;
|
|
11313
|
-
}(r) ?
|
|
11317
|
+
}(r) ? Ce("check") : Ce("bullet")), { after: Hd, node: t };
|
|
11314
11318
|
}
|
|
11315
11319
|
const Ho = { ol: "number", ul: "bullet" };
|
|
11316
|
-
function
|
|
11317
|
-
return
|
|
11320
|
+
function Ce(r, e = 1) {
|
|
11321
|
+
return Xe(new sr(r, e));
|
|
11318
11322
|
}
|
|
11319
11323
|
function H(r) {
|
|
11320
11324
|
return r instanceof sr;
|
|
@@ -11324,11 +11328,11 @@ function Jd(r) {
|
|
|
11324
11328
|
return Ot(r.registerCommand(_l, () => (qo(r, "number"), !0), Kt), r.registerCommand(yl, () => (qo(r, "bullet"), !0), Kt), r.registerCommand(Gd, () => (qd(r), !0), Kt), r.registerCommand(kr, () => !!Wd(), Kt));
|
|
11325
11329
|
}
|
|
11326
11330
|
function Qd() {
|
|
11327
|
-
const [r] =
|
|
11328
|
-
return
|
|
11331
|
+
const [r] = Ye();
|
|
11332
|
+
return pe(() => {
|
|
11329
11333
|
if (!r.hasNodes([sr, Rt])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
|
|
11330
11334
|
}, [r]), function(e) {
|
|
11331
|
-
|
|
11335
|
+
pe(() => Jd(e), [e]);
|
|
11332
11336
|
}(r), null;
|
|
11333
11337
|
}
|
|
11334
11338
|
const Yd = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
@@ -11435,7 +11439,7 @@ function Xd(r) {
|
|
|
11435
11439
|
return { node: e };
|
|
11436
11440
|
}
|
|
11437
11441
|
function Bn(r, e) {
|
|
11438
|
-
return
|
|
11442
|
+
return Xe(new jt(r, e));
|
|
11439
11443
|
}
|
|
11440
11444
|
function hr(r) {
|
|
11441
11445
|
return r instanceof jt;
|
|
@@ -11483,14 +11487,14 @@ class Kr extends jt {
|
|
|
11483
11487
|
}
|
|
11484
11488
|
}
|
|
11485
11489
|
function Go(r, e) {
|
|
11486
|
-
return
|
|
11490
|
+
return Xe(new Kr(r, e));
|
|
11487
11491
|
}
|
|
11488
11492
|
function Zd(r) {
|
|
11489
11493
|
return r instanceof Kr;
|
|
11490
11494
|
}
|
|
11491
11495
|
const Jo = Pr();
|
|
11492
11496
|
function vs(r, e = {}) {
|
|
11493
|
-
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, o =
|
|
11497
|
+
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, o = j();
|
|
11494
11498
|
if (!B(o)) return;
|
|
11495
11499
|
const i = o.extract();
|
|
11496
11500
|
if (r === null) i.forEach((u) => {
|
|
@@ -11528,8 +11532,8 @@ function vs(r, e = {}) {
|
|
|
11528
11532
|
}
|
|
11529
11533
|
}
|
|
11530
11534
|
function ef({ validateUrl: r, attributes: e }) {
|
|
11531
|
-
const [t] =
|
|
11532
|
-
return
|
|
11535
|
+
const [t] = Ye();
|
|
11536
|
+
return pe(() => {
|
|
11533
11537
|
if (!t.hasNodes([jt])) throw new Error("LinkPlugin: LinkNode not registered on editor");
|
|
11534
11538
|
return Ot(t.registerCommand(Jo, (n) => {
|
|
11535
11539
|
if (n === null) return vs(n), !0;
|
|
@@ -11539,7 +11543,7 @@ function ef({ validateUrl: r, attributes: e }) {
|
|
|
11539
11543
|
return vs(s, { ...e, rel: i, target: o, title: u }), !0;
|
|
11540
11544
|
}
|
|
11541
11545
|
}, Kt), r !== void 0 ? t.registerCommand(Fn, (n) => {
|
|
11542
|
-
const s =
|
|
11546
|
+
const s = j();
|
|
11543
11547
|
if (!B(s) || s.isCollapsed() || !gt(n, ClipboardEvent)) return !1;
|
|
11544
11548
|
const o = n;
|
|
11545
11549
|
if (o.clipboardData === null) return !1;
|
|
@@ -11579,19 +11583,19 @@ const tf = {
|
|
|
11579
11583
|
}
|
|
11580
11584
|
};
|
|
11581
11585
|
function nf({ theme: r, disabled: e }) {
|
|
11582
|
-
const [t] =
|
|
11583
|
-
t.dispatchCommand(
|
|
11586
|
+
const [t] = Ye(), n = Z(() => {
|
|
11587
|
+
t.dispatchCommand(je, "bold");
|
|
11584
11588
|
}, [t]), s = Z(() => {
|
|
11585
|
-
t.dispatchCommand(
|
|
11589
|
+
t.dispatchCommand(je, "italic");
|
|
11586
11590
|
}, [t]), o = Z(() => {
|
|
11587
|
-
t.dispatchCommand(
|
|
11591
|
+
t.dispatchCommand(je, "underline");
|
|
11588
11592
|
}, [t]), i = Z(() => {
|
|
11589
11593
|
t.dispatchCommand(yl, void 0);
|
|
11590
11594
|
}, [t]), u = Z(() => {
|
|
11591
11595
|
t.dispatchCommand(_l, void 0);
|
|
11592
11596
|
}, [t]), l = Z(() => {
|
|
11593
11597
|
t.update(() => {
|
|
11594
|
-
const f =
|
|
11598
|
+
const f = j();
|
|
11595
11599
|
B(f) && Jc(f, () => vi());
|
|
11596
11600
|
});
|
|
11597
11601
|
}, [t]), a = {
|
|
@@ -11739,13 +11743,13 @@ function nf({ theme: r, disabled: e }) {
|
|
|
11739
11743
|
);
|
|
11740
11744
|
}
|
|
11741
11745
|
function sf({ html: r }) {
|
|
11742
|
-
const [e] =
|
|
11743
|
-
return
|
|
11746
|
+
const [e] = Ye();
|
|
11747
|
+
return pe(() => {
|
|
11744
11748
|
r && e.update(() => {
|
|
11745
11749
|
const t = re();
|
|
11746
11750
|
t.clear();
|
|
11747
11751
|
const s = new DOMParser().parseFromString(r, "text/html"), o = ll(e, s);
|
|
11748
|
-
o.length > 0 ? t.append(...o) : t.append(
|
|
11752
|
+
o.length > 0 ? t.append(...o) : t.append(le());
|
|
11749
11753
|
});
|
|
11750
11754
|
}, []), null;
|
|
11751
11755
|
}
|
|
@@ -11926,7 +11930,7 @@ function xf({
|
|
|
11926
11930
|
}
|
|
11927
11931
|
),
|
|
11928
11932
|
placeholder: /* @__PURE__ */ v.jsx("div", { className: "mail-editor-placeholder", children: t }),
|
|
11929
|
-
ErrorBoundary:
|
|
11933
|
+
ErrorBoundary: Id
|
|
11930
11934
|
}
|
|
11931
11935
|
) }),
|
|
11932
11936
|
/* @__PURE__ */ v.jsx(Qd, {}),
|