@qwanyx/stack 0.2.41 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +22 -22
- package/dist/index.esm.js +739 -734
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Oa = Object.defineProperty;
|
|
|
2
2
|
var Ma = (r, e, t) => e in r ? Oa(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ir = (r, e, t) => Ma(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as As from "react";
|
|
5
|
-
import
|
|
5
|
+
import Je, { useState as H, useCallback as re, useEffect as De, useMemo as bt, useRef as xe, createContext as Ia, useContext as $a, useLayoutEffect as jr, Suspense as za, forwardRef as al } from "react";
|
|
6
6
|
import { flushSync as qa, createPortal as Ua } from "react-dom";
|
|
7
7
|
class xf {
|
|
8
8
|
constructor(e) {
|
|
@@ -3630,10 +3630,10 @@ class uu {
|
|
|
3630
3630
|
for (const h of c.messages)
|
|
3631
3631
|
h.uid && d.set(h.uid, h);
|
|
3632
3632
|
const f = a.map((h) => {
|
|
3633
|
-
var A, w, E, v,
|
|
3633
|
+
var A, w, E, v, b;
|
|
3634
3634
|
const g = d.get(h);
|
|
3635
3635
|
if (!g) return null;
|
|
3636
|
-
const m = ((A = g.flags) == null ? void 0 : A.some((D) => D.includes("Seen"))) || !1, y = ((E = (w = g.envelope) == null ? void 0 : w.from) == null ? void 0 : E.email) || "Unknown", C = ((v = g.envelope) == null ? void 0 : v.subject) || "(No subject)", x = ((
|
|
3636
|
+
const m = ((A = g.flags) == null ? void 0 : A.some((D) => D.includes("Seen"))) || !1, y = ((E = (w = g.envelope) == null ? void 0 : w.from) == null ? void 0 : E.email) || "Unknown", C = ((v = g.envelope) == null ? void 0 : v.subject) || "(No subject)", x = ((b = g.envelope) == null ? void 0 : b.date) || "";
|
|
3637
3637
|
return { uid: h, from: y, subject: C, date: x, seen: m };
|
|
3638
3638
|
}).filter(Boolean);
|
|
3639
3639
|
return {
|
|
@@ -3697,8 +3697,8 @@ class uu {
|
|
|
3697
3697
|
const c = /* @__PURE__ */ new Map();
|
|
3698
3698
|
for (const w of u.attachments || [])
|
|
3699
3699
|
if (w.contentId) {
|
|
3700
|
-
const E = this.contentToBase64(w.content), v = `data:${w.mimeType};base64,${E}`,
|
|
3701
|
-
c.set(
|
|
3700
|
+
const E = this.contentToBase64(w.content), v = `data:${w.mimeType};base64,${E}`, b = w.contentId.replace(/^<|>$/g, "");
|
|
3701
|
+
c.set(b, v), c.set(`<${b}>`, v);
|
|
3702
3702
|
}
|
|
3703
3703
|
let d = u.html || "";
|
|
3704
3704
|
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (w, E) => {
|
|
@@ -4044,7 +4044,7 @@ var Hi;
|
|
|
4044
4044
|
function hu() {
|
|
4045
4045
|
if (Hi) return $r;
|
|
4046
4046
|
Hi = 1;
|
|
4047
|
-
var r =
|
|
4047
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
4048
4048
|
function i(l, a, u) {
|
|
4049
4049
|
var c, d = {}, f = null, h = null;
|
|
4050
4050
|
u !== void 0 && (f = "" + u), a.key !== void 0 && (f = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
@@ -4067,58 +4067,58 @@ var zr = {};
|
|
|
4067
4067
|
var Ji;
|
|
4068
4068
|
function pu() {
|
|
4069
4069
|
return Ji || (Ji = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4070
|
-
var r =
|
|
4071
|
-
function y(
|
|
4072
|
-
if (
|
|
4070
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), l = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
|
|
4071
|
+
function y(_) {
|
|
4072
|
+
if (_ === null || typeof _ != "object")
|
|
4073
4073
|
return null;
|
|
4074
|
-
var P = g &&
|
|
4074
|
+
var P = g && _[g] || _[m];
|
|
4075
4075
|
return typeof P == "function" ? P : null;
|
|
4076
4076
|
}
|
|
4077
4077
|
var C = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4078
|
-
function x(
|
|
4078
|
+
function x(_) {
|
|
4079
4079
|
{
|
|
4080
4080
|
for (var P = arguments.length, G = new Array(P > 1 ? P - 1 : 0), Z = 1; Z < P; Z++)
|
|
4081
4081
|
G[Z - 1] = arguments[Z];
|
|
4082
|
-
A("error",
|
|
4082
|
+
A("error", _, G);
|
|
4083
4083
|
}
|
|
4084
4084
|
}
|
|
4085
|
-
function A(
|
|
4085
|
+
function A(_, P, G) {
|
|
4086
4086
|
{
|
|
4087
4087
|
var Z = C.ReactDebugCurrentFrame, he = Z.getStackAddendum();
|
|
4088
4088
|
he !== "" && (P += "%s", G = G.concat([he]));
|
|
4089
|
-
var
|
|
4089
|
+
var _e = G.map(function(le) {
|
|
4090
4090
|
return String(le);
|
|
4091
4091
|
});
|
|
4092
|
-
|
|
4092
|
+
_e.unshift("Warning: " + P), Function.prototype.apply.call(console[_], console, _e);
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
|
-
var w = !1, E = !1, v = !1,
|
|
4095
|
+
var w = !1, E = !1, v = !1, b = !1, D = !1, k;
|
|
4096
4096
|
k = Symbol.for("react.module.reference");
|
|
4097
|
-
function M(
|
|
4098
|
-
return !!(typeof
|
|
4097
|
+
function M(_) {
|
|
4098
|
+
return !!(typeof _ == "string" || typeof _ == "function" || _ === n || _ === o || D || _ === s || _ === u || _ === c || b || _ === h || w || E || v || typeof _ == "object" && _ !== null && (_.$$typeof === f || _.$$typeof === d || _.$$typeof === i || _.$$typeof === l || _.$$typeof === a || // This needs to include all possible module reference object
|
|
4099
4099
|
// types supported by any Flight configuration anywhere since
|
|
4100
4100
|
// we don't know which Flight build this will end up being used
|
|
4101
4101
|
// with.
|
|
4102
|
-
|
|
4102
|
+
_.$$typeof === k || _.getModuleId !== void 0));
|
|
4103
4103
|
}
|
|
4104
|
-
function B(
|
|
4105
|
-
var Z =
|
|
4104
|
+
function B(_, P, G) {
|
|
4105
|
+
var Z = _.displayName;
|
|
4106
4106
|
if (Z)
|
|
4107
4107
|
return Z;
|
|
4108
4108
|
var he = P.displayName || P.name || "";
|
|
4109
4109
|
return he !== "" ? G + "(" + he + ")" : G;
|
|
4110
4110
|
}
|
|
4111
|
-
function F(
|
|
4112
|
-
return
|
|
4111
|
+
function F(_) {
|
|
4112
|
+
return _.displayName || "Context";
|
|
4113
4113
|
}
|
|
4114
|
-
function L(
|
|
4115
|
-
if (
|
|
4114
|
+
function L(_) {
|
|
4115
|
+
if (_ == null)
|
|
4116
4116
|
return null;
|
|
4117
|
-
if (typeof
|
|
4118
|
-
return
|
|
4119
|
-
if (typeof
|
|
4120
|
-
return
|
|
4121
|
-
switch (
|
|
4117
|
+
if (typeof _.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof _ == "function")
|
|
4118
|
+
return _.displayName || _.name || null;
|
|
4119
|
+
if (typeof _ == "string")
|
|
4120
|
+
return _;
|
|
4121
|
+
switch (_) {
|
|
4122
4122
|
case n:
|
|
4123
4123
|
return "Fragment";
|
|
4124
4124
|
case t:
|
|
@@ -4132,23 +4132,23 @@ function pu() {
|
|
|
4132
4132
|
case c:
|
|
4133
4133
|
return "SuspenseList";
|
|
4134
4134
|
}
|
|
4135
|
-
if (typeof
|
|
4136
|
-
switch (
|
|
4135
|
+
if (typeof _ == "object")
|
|
4136
|
+
switch (_.$$typeof) {
|
|
4137
4137
|
case l:
|
|
4138
|
-
var P =
|
|
4138
|
+
var P = _;
|
|
4139
4139
|
return F(P) + ".Consumer";
|
|
4140
4140
|
case i:
|
|
4141
|
-
var G =
|
|
4141
|
+
var G = _;
|
|
4142
4142
|
return F(G._context) + ".Provider";
|
|
4143
4143
|
case a:
|
|
4144
|
-
return B(
|
|
4144
|
+
return B(_, _.render, "ForwardRef");
|
|
4145
4145
|
case d:
|
|
4146
|
-
var Z =
|
|
4147
|
-
return Z !== null ? Z : L(
|
|
4146
|
+
var Z = _.displayName || null;
|
|
4147
|
+
return Z !== null ? Z : L(_.type) || "Memo";
|
|
4148
4148
|
case f: {
|
|
4149
|
-
var he =
|
|
4149
|
+
var he = _, _e = he._payload, le = he._init;
|
|
4150
4150
|
try {
|
|
4151
|
-
return L(le(
|
|
4151
|
+
return L(le(_e));
|
|
4152
4152
|
} catch {
|
|
4153
4153
|
return null;
|
|
4154
4154
|
}
|
|
@@ -4156,28 +4156,28 @@ function pu() {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
return null;
|
|
4158
4158
|
}
|
|
4159
|
-
var j = Object.assign, R = 0, Y, de, ie, oe,
|
|
4159
|
+
var j = Object.assign, R = 0, Y, de, ie, oe, ve, pe, we;
|
|
4160
4160
|
function Se() {
|
|
4161
4161
|
}
|
|
4162
4162
|
Se.__reactDisabledLog = !0;
|
|
4163
4163
|
function Oe() {
|
|
4164
4164
|
{
|
|
4165
4165
|
if (R === 0) {
|
|
4166
|
-
Y = console.log, de = console.info, ie = console.warn, oe = console.error,
|
|
4167
|
-
var
|
|
4166
|
+
Y = console.log, de = console.info, ie = console.warn, oe = console.error, ve = console.group, pe = console.groupCollapsed, we = console.groupEnd;
|
|
4167
|
+
var _ = {
|
|
4168
4168
|
configurable: !0,
|
|
4169
4169
|
enumerable: !0,
|
|
4170
4170
|
value: Se,
|
|
4171
4171
|
writable: !0
|
|
4172
4172
|
};
|
|
4173
4173
|
Object.defineProperties(console, {
|
|
4174
|
-
info:
|
|
4175
|
-
log:
|
|
4176
|
-
warn:
|
|
4177
|
-
error:
|
|
4178
|
-
group:
|
|
4179
|
-
groupCollapsed:
|
|
4180
|
-
groupEnd:
|
|
4174
|
+
info: _,
|
|
4175
|
+
log: _,
|
|
4176
|
+
warn: _,
|
|
4177
|
+
error: _,
|
|
4178
|
+
group: _,
|
|
4179
|
+
groupCollapsed: _,
|
|
4180
|
+
groupEnd: _
|
|
4181
4181
|
});
|
|
4182
4182
|
}
|
|
4183
4183
|
R++;
|
|
@@ -4186,40 +4186,40 @@ function pu() {
|
|
|
4186
4186
|
function ke() {
|
|
4187
4187
|
{
|
|
4188
4188
|
if (R--, R === 0) {
|
|
4189
|
-
var
|
|
4189
|
+
var _ = {
|
|
4190
4190
|
configurable: !0,
|
|
4191
4191
|
enumerable: !0,
|
|
4192
4192
|
writable: !0
|
|
4193
4193
|
};
|
|
4194
4194
|
Object.defineProperties(console, {
|
|
4195
|
-
log: j({},
|
|
4195
|
+
log: j({}, _, {
|
|
4196
4196
|
value: Y
|
|
4197
4197
|
}),
|
|
4198
|
-
info: j({},
|
|
4198
|
+
info: j({}, _, {
|
|
4199
4199
|
value: de
|
|
4200
4200
|
}),
|
|
4201
|
-
warn: j({},
|
|
4201
|
+
warn: j({}, _, {
|
|
4202
4202
|
value: ie
|
|
4203
4203
|
}),
|
|
4204
|
-
error: j({},
|
|
4204
|
+
error: j({}, _, {
|
|
4205
4205
|
value: oe
|
|
4206
4206
|
}),
|
|
4207
|
-
group: j({},
|
|
4208
|
-
value:
|
|
4207
|
+
group: j({}, _, {
|
|
4208
|
+
value: ve
|
|
4209
4209
|
}),
|
|
4210
|
-
groupCollapsed: j({},
|
|
4210
|
+
groupCollapsed: j({}, _, {
|
|
4211
4211
|
value: pe
|
|
4212
4212
|
}),
|
|
4213
|
-
groupEnd: j({},
|
|
4214
|
-
value:
|
|
4213
|
+
groupEnd: j({}, _, {
|
|
4214
|
+
value: we
|
|
4215
4215
|
})
|
|
4216
4216
|
});
|
|
4217
4217
|
}
|
|
4218
4218
|
R < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4219
4219
|
}
|
|
4220
4220
|
}
|
|
4221
|
-
var
|
|
4222
|
-
function ze(
|
|
4221
|
+
var Ce = C.ReactCurrentDispatcher, Ge;
|
|
4222
|
+
function ze(_, P, G) {
|
|
4223
4223
|
{
|
|
4224
4224
|
if (Ge === void 0)
|
|
4225
4225
|
try {
|
|
@@ -4229,7 +4229,7 @@ function pu() {
|
|
|
4229
4229
|
Ge = Z && Z[1] || "";
|
|
4230
4230
|
}
|
|
4231
4231
|
return `
|
|
4232
|
-
` + Ge +
|
|
4232
|
+
` + Ge + _;
|
|
4233
4233
|
}
|
|
4234
4234
|
}
|
|
4235
4235
|
var ge = !1, Me;
|
|
@@ -4237,11 +4237,11 @@ function pu() {
|
|
|
4237
4237
|
var ct = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4238
4238
|
Me = new ct();
|
|
4239
4239
|
}
|
|
4240
|
-
function Ct(
|
|
4241
|
-
if (!
|
|
4240
|
+
function Ct(_, P) {
|
|
4241
|
+
if (!_ || ge)
|
|
4242
4242
|
return "";
|
|
4243
4243
|
{
|
|
4244
|
-
var G = Me.get(
|
|
4244
|
+
var G = Me.get(_);
|
|
4245
4245
|
if (G !== void 0)
|
|
4246
4246
|
return G;
|
|
4247
4247
|
}
|
|
@@ -4249,8 +4249,8 @@ function pu() {
|
|
|
4249
4249
|
ge = !0;
|
|
4250
4250
|
var he = Error.prepareStackTrace;
|
|
4251
4251
|
Error.prepareStackTrace = void 0;
|
|
4252
|
-
var
|
|
4253
|
-
|
|
4252
|
+
var _e;
|
|
4253
|
+
_e = Ce.current, Ce.current = null, Oe();
|
|
4254
4254
|
try {
|
|
4255
4255
|
if (P) {
|
|
4256
4256
|
var le = function() {
|
|
@@ -4266,14 +4266,14 @@ function pu() {
|
|
|
4266
4266
|
} catch (Ze) {
|
|
4267
4267
|
Z = Ze;
|
|
4268
4268
|
}
|
|
4269
|
-
Reflect.construct(
|
|
4269
|
+
Reflect.construct(_, [], le);
|
|
4270
4270
|
} else {
|
|
4271
4271
|
try {
|
|
4272
4272
|
le.call();
|
|
4273
4273
|
} catch (Ze) {
|
|
4274
4274
|
Z = Ze;
|
|
4275
4275
|
}
|
|
4276
|
-
|
|
4276
|
+
_.call(le.prototype);
|
|
4277
4277
|
}
|
|
4278
4278
|
} else {
|
|
4279
4279
|
try {
|
|
@@ -4281,63 +4281,63 @@ function pu() {
|
|
|
4281
4281
|
} catch (Ze) {
|
|
4282
4282
|
Z = Ze;
|
|
4283
4283
|
}
|
|
4284
|
-
|
|
4284
|
+
_();
|
|
4285
4285
|
}
|
|
4286
4286
|
} catch (Ze) {
|
|
4287
4287
|
if (Ze && Z && typeof Ze.stack == "string") {
|
|
4288
4288
|
for (var se = Ze.stack.split(`
|
|
4289
|
-
`),
|
|
4290
|
-
`), Ne = se.length - 1, je =
|
|
4289
|
+
`), He = Z.stack.split(`
|
|
4290
|
+
`), Ne = se.length - 1, je = He.length - 1; Ne >= 1 && je >= 0 && se[Ne] !== He[je]; )
|
|
4291
4291
|
je--;
|
|
4292
4292
|
for (; Ne >= 1 && je >= 0; Ne--, je--)
|
|
4293
|
-
if (se[Ne] !==
|
|
4293
|
+
if (se[Ne] !== He[je]) {
|
|
4294
4294
|
if (Ne !== 1 || je !== 1)
|
|
4295
4295
|
do
|
|
4296
|
-
if (Ne--, je--, je < 0 || se[Ne] !==
|
|
4296
|
+
if (Ne--, je--, je < 0 || se[Ne] !== He[je]) {
|
|
4297
4297
|
var at = `
|
|
4298
4298
|
` + se[Ne].replace(" at new ", " at ");
|
|
4299
|
-
return
|
|
4299
|
+
return _.displayName && at.includes("<anonymous>") && (at = at.replace("<anonymous>", _.displayName)), typeof _ == "function" && Me.set(_, at), at;
|
|
4300
4300
|
}
|
|
4301
4301
|
while (Ne >= 1 && je >= 0);
|
|
4302
4302
|
break;
|
|
4303
4303
|
}
|
|
4304
4304
|
}
|
|
4305
4305
|
} finally {
|
|
4306
|
-
ge = !1,
|
|
4306
|
+
ge = !1, Ce.current = _e, ke(), Error.prepareStackTrace = he;
|
|
4307
4307
|
}
|
|
4308
|
-
var br =
|
|
4309
|
-
return typeof
|
|
4308
|
+
var br = _ ? _.displayName || _.name : "", rr = br ? ze(br) : "";
|
|
4309
|
+
return typeof _ == "function" && Me.set(_, rr), rr;
|
|
4310
4310
|
}
|
|
4311
|
-
function qt(
|
|
4312
|
-
return Ct(
|
|
4311
|
+
function qt(_, P, G) {
|
|
4312
|
+
return Ct(_, !1);
|
|
4313
4313
|
}
|
|
4314
|
-
function it(
|
|
4315
|
-
var P =
|
|
4314
|
+
function it(_) {
|
|
4315
|
+
var P = _.prototype;
|
|
4316
4316
|
return !!(P && P.isReactComponent);
|
|
4317
4317
|
}
|
|
4318
|
-
function ot(
|
|
4319
|
-
if (
|
|
4318
|
+
function ot(_, P, G) {
|
|
4319
|
+
if (_ == null)
|
|
4320
4320
|
return "";
|
|
4321
|
-
if (typeof
|
|
4322
|
-
return Ct(
|
|
4323
|
-
if (typeof
|
|
4324
|
-
return ze(
|
|
4325
|
-
switch (
|
|
4321
|
+
if (typeof _ == "function")
|
|
4322
|
+
return Ct(_, it(_));
|
|
4323
|
+
if (typeof _ == "string")
|
|
4324
|
+
return ze(_);
|
|
4325
|
+
switch (_) {
|
|
4326
4326
|
case u:
|
|
4327
4327
|
return ze("Suspense");
|
|
4328
4328
|
case c:
|
|
4329
4329
|
return ze("SuspenseList");
|
|
4330
4330
|
}
|
|
4331
|
-
if (typeof
|
|
4332
|
-
switch (
|
|
4331
|
+
if (typeof _ == "object")
|
|
4332
|
+
switch (_.$$typeof) {
|
|
4333
4333
|
case a:
|
|
4334
|
-
return qt(
|
|
4334
|
+
return qt(_.render);
|
|
4335
4335
|
case d:
|
|
4336
|
-
return ot(
|
|
4336
|
+
return ot(_.type, P, G);
|
|
4337
4337
|
case f: {
|
|
4338
|
-
var Z =
|
|
4338
|
+
var Z = _, he = Z._payload, _e = Z._init;
|
|
4339
4339
|
try {
|
|
4340
|
-
return ot(
|
|
4340
|
+
return ot(_e(he), P, G);
|
|
4341
4341
|
} catch {
|
|
4342
4342
|
}
|
|
4343
4343
|
}
|
|
@@ -4345,25 +4345,25 @@ function pu() {
|
|
|
4345
4345
|
return "";
|
|
4346
4346
|
}
|
|
4347
4347
|
var dt = Object.prototype.hasOwnProperty, Ut = {}, Wt = C.ReactDebugCurrentFrame;
|
|
4348
|
-
function Dt(
|
|
4349
|
-
if (
|
|
4350
|
-
var P =
|
|
4348
|
+
function Dt(_) {
|
|
4349
|
+
if (_) {
|
|
4350
|
+
var P = _._owner, G = ot(_.type, _._source, P ? P.type : null);
|
|
4351
4351
|
Wt.setExtraStackFrame(G);
|
|
4352
4352
|
} else
|
|
4353
4353
|
Wt.setExtraStackFrame(null);
|
|
4354
4354
|
}
|
|
4355
|
-
function ft(
|
|
4355
|
+
function ft(_, P, G, Z, he) {
|
|
4356
4356
|
{
|
|
4357
|
-
var
|
|
4358
|
-
for (var le in
|
|
4359
|
-
if (
|
|
4357
|
+
var _e = Function.call.bind(dt);
|
|
4358
|
+
for (var le in _)
|
|
4359
|
+
if (_e(_, le)) {
|
|
4360
4360
|
var se = void 0;
|
|
4361
4361
|
try {
|
|
4362
|
-
if (typeof
|
|
4363
|
-
var
|
|
4364
|
-
throw
|
|
4362
|
+
if (typeof _[le] != "function") {
|
|
4363
|
+
var He = Error((Z || "React class") + ": " + G + " type `" + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof _[le] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4364
|
+
throw He.name = "Invariant Violation", He;
|
|
4365
4365
|
}
|
|
4366
|
-
se =
|
|
4366
|
+
se = _[le](P, le, Z, G, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4367
4367
|
} catch (Ne) {
|
|
4368
4368
|
se = Ne;
|
|
4369
4369
|
}
|
|
@@ -4372,28 +4372,28 @@ function pu() {
|
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
4374
|
var ht = Array.isArray;
|
|
4375
|
-
function At(
|
|
4376
|
-
return ht(
|
|
4375
|
+
function At(_) {
|
|
4376
|
+
return ht(_);
|
|
4377
4377
|
}
|
|
4378
|
-
function W(
|
|
4378
|
+
function W(_) {
|
|
4379
4379
|
{
|
|
4380
|
-
var P = typeof Symbol == "function" && Symbol.toStringTag, G = P &&
|
|
4380
|
+
var P = typeof Symbol == "function" && Symbol.toStringTag, G = P && _[Symbol.toStringTag] || _.constructor.name || "Object";
|
|
4381
4381
|
return G;
|
|
4382
4382
|
}
|
|
4383
4383
|
}
|
|
4384
|
-
function
|
|
4384
|
+
function be(_) {
|
|
4385
4385
|
try {
|
|
4386
|
-
return
|
|
4386
|
+
return Ke(_), !1;
|
|
4387
4387
|
} catch {
|
|
4388
4388
|
return !0;
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
|
-
function
|
|
4392
|
-
return "" +
|
|
4391
|
+
function Ke(_) {
|
|
4392
|
+
return "" + _;
|
|
4393
4393
|
}
|
|
4394
|
-
function
|
|
4395
|
-
if (
|
|
4396
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(
|
|
4394
|
+
function I(_) {
|
|
4395
|
+
if (be(_))
|
|
4396
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(_)), Ke(_);
|
|
4397
4397
|
}
|
|
4398
4398
|
var T = C.ReactCurrentOwner, X = {
|
|
4399
4399
|
key: !0,
|
|
@@ -4401,58 +4401,58 @@ function pu() {
|
|
|
4401
4401
|
__self: !0,
|
|
4402
4402
|
__source: !0
|
|
4403
4403
|
}, J, S;
|
|
4404
|
-
function
|
|
4405
|
-
if (dt.call(
|
|
4406
|
-
var P = Object.getOwnPropertyDescriptor(
|
|
4404
|
+
function $(_) {
|
|
4405
|
+
if (dt.call(_, "ref")) {
|
|
4406
|
+
var P = Object.getOwnPropertyDescriptor(_, "ref").get;
|
|
4407
4407
|
if (P && P.isReactWarning)
|
|
4408
4408
|
return !1;
|
|
4409
4409
|
}
|
|
4410
|
-
return
|
|
4410
|
+
return _.ref !== void 0;
|
|
4411
4411
|
}
|
|
4412
|
-
function K(
|
|
4413
|
-
if (dt.call(
|
|
4414
|
-
var P = Object.getOwnPropertyDescriptor(
|
|
4412
|
+
function K(_) {
|
|
4413
|
+
if (dt.call(_, "key")) {
|
|
4414
|
+
var P = Object.getOwnPropertyDescriptor(_, "key").get;
|
|
4415
4415
|
if (P && P.isReactWarning)
|
|
4416
4416
|
return !1;
|
|
4417
4417
|
}
|
|
4418
|
-
return
|
|
4418
|
+
return _.key !== void 0;
|
|
4419
4419
|
}
|
|
4420
|
-
function Q(
|
|
4421
|
-
typeof
|
|
4420
|
+
function Q(_, P) {
|
|
4421
|
+
typeof _.ref == "string" && T.current;
|
|
4422
4422
|
}
|
|
4423
|
-
function ee(
|
|
4423
|
+
function ee(_, P) {
|
|
4424
4424
|
{
|
|
4425
4425
|
var G = function() {
|
|
4426
4426
|
J || (J = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", P));
|
|
4427
4427
|
};
|
|
4428
|
-
G.isReactWarning = !0, Object.defineProperty(
|
|
4428
|
+
G.isReactWarning = !0, Object.defineProperty(_, "key", {
|
|
4429
4429
|
get: G,
|
|
4430
4430
|
configurable: !0
|
|
4431
4431
|
});
|
|
4432
4432
|
}
|
|
4433
4433
|
}
|
|
4434
|
-
function ae(
|
|
4434
|
+
function ae(_, P) {
|
|
4435
4435
|
{
|
|
4436
4436
|
var G = function() {
|
|
4437
4437
|
S || (S = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", P));
|
|
4438
4438
|
};
|
|
4439
|
-
G.isReactWarning = !0, Object.defineProperty(
|
|
4439
|
+
G.isReactWarning = !0, Object.defineProperty(_, "ref", {
|
|
4440
4440
|
get: G,
|
|
4441
4441
|
configurable: !0
|
|
4442
4442
|
});
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
4445
|
-
var ne = function(
|
|
4445
|
+
var ne = function(_, P, G, Z, he, _e, le) {
|
|
4446
4446
|
var se = {
|
|
4447
4447
|
// This tag allows us to uniquely identify this as a React Element
|
|
4448
4448
|
$$typeof: e,
|
|
4449
4449
|
// Built-in properties that belong on the element
|
|
4450
|
-
type:
|
|
4450
|
+
type: _,
|
|
4451
4451
|
key: P,
|
|
4452
4452
|
ref: G,
|
|
4453
4453
|
props: le,
|
|
4454
4454
|
// Record the component responsible for creating this element.
|
|
4455
|
-
_owner:
|
|
4455
|
+
_owner: _e
|
|
4456
4456
|
};
|
|
4457
4457
|
return se._store = {}, Object.defineProperty(se._store, "validated", {
|
|
4458
4458
|
configurable: !1,
|
|
@@ -4471,58 +4471,58 @@ function pu() {
|
|
|
4471
4471
|
value: he
|
|
4472
4472
|
}), Object.freeze && (Object.freeze(se.props), Object.freeze(se)), se;
|
|
4473
4473
|
};
|
|
4474
|
-
function te(
|
|
4474
|
+
function te(_, P, G, Z, he) {
|
|
4475
4475
|
{
|
|
4476
|
-
var
|
|
4477
|
-
G !== void 0 && (
|
|
4478
|
-
for (
|
|
4479
|
-
dt.call(P,
|
|
4480
|
-
if (
|
|
4481
|
-
var Ne =
|
|
4482
|
-
for (
|
|
4483
|
-
le[
|
|
4476
|
+
var _e, le = {}, se = null, He = null;
|
|
4477
|
+
G !== void 0 && (I(G), se = "" + G), K(P) && (I(P.key), se = "" + P.key), $(P) && (He = P.ref, Q(P, he));
|
|
4478
|
+
for (_e in P)
|
|
4479
|
+
dt.call(P, _e) && !X.hasOwnProperty(_e) && (le[_e] = P[_e]);
|
|
4480
|
+
if (_ && _.defaultProps) {
|
|
4481
|
+
var Ne = _.defaultProps;
|
|
4482
|
+
for (_e in Ne)
|
|
4483
|
+
le[_e] === void 0 && (le[_e] = Ne[_e]);
|
|
4484
4484
|
}
|
|
4485
|
-
if (se ||
|
|
4486
|
-
var je = typeof
|
|
4487
|
-
se && ee(le, je),
|
|
4485
|
+
if (se || He) {
|
|
4486
|
+
var je = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _;
|
|
4487
|
+
se && ee(le, je), He && ae(le, je);
|
|
4488
4488
|
}
|
|
4489
|
-
return ne(
|
|
4489
|
+
return ne(_, se, He, he, Z, T.current, le);
|
|
4490
4490
|
}
|
|
4491
4491
|
}
|
|
4492
4492
|
var Ae = C.ReactCurrentOwner, Fe = C.ReactDebugCurrentFrame;
|
|
4493
|
-
function ye(
|
|
4494
|
-
if (
|
|
4495
|
-
var P =
|
|
4493
|
+
function ye(_) {
|
|
4494
|
+
if (_) {
|
|
4495
|
+
var P = _._owner, G = ot(_.type, _._source, P ? P.type : null);
|
|
4496
4496
|
Fe.setExtraStackFrame(G);
|
|
4497
4497
|
} else
|
|
4498
4498
|
Fe.setExtraStackFrame(null);
|
|
4499
4499
|
}
|
|
4500
4500
|
var fe;
|
|
4501
4501
|
fe = !1;
|
|
4502
|
-
function qe(
|
|
4503
|
-
return typeof
|
|
4502
|
+
function qe(_) {
|
|
4503
|
+
return typeof _ == "object" && _ !== null && _.$$typeof === e;
|
|
4504
4504
|
}
|
|
4505
4505
|
function Ue() {
|
|
4506
4506
|
{
|
|
4507
4507
|
if (Ae.current) {
|
|
4508
|
-
var
|
|
4509
|
-
if (
|
|
4508
|
+
var _ = L(Ae.current.type);
|
|
4509
|
+
if (_)
|
|
4510
4510
|
return `
|
|
4511
4511
|
|
|
4512
|
-
Check the render method of \`` +
|
|
4512
|
+
Check the render method of \`` + _ + "`.";
|
|
4513
4513
|
}
|
|
4514
4514
|
return "";
|
|
4515
4515
|
}
|
|
4516
4516
|
}
|
|
4517
|
-
function lt(
|
|
4517
|
+
function lt(_) {
|
|
4518
4518
|
return "";
|
|
4519
4519
|
}
|
|
4520
4520
|
var Et = {};
|
|
4521
|
-
function pt(
|
|
4521
|
+
function pt(_) {
|
|
4522
4522
|
{
|
|
4523
4523
|
var P = Ue();
|
|
4524
4524
|
if (!P) {
|
|
4525
|
-
var G = typeof
|
|
4525
|
+
var G = typeof _ == "string" ? _ : _.displayName || _.name;
|
|
4526
4526
|
G && (P = `
|
|
4527
4527
|
|
|
4528
4528
|
Check the top-level render call using <` + G + ">.");
|
|
@@ -4530,41 +4530,41 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4530
4530
|
return P;
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
|
-
function Pt(
|
|
4533
|
+
function Pt(_, P) {
|
|
4534
4534
|
{
|
|
4535
|
-
if (!
|
|
4535
|
+
if (!_._store || _._store.validated || _.key != null)
|
|
4536
4536
|
return;
|
|
4537
|
-
|
|
4537
|
+
_._store.validated = !0;
|
|
4538
4538
|
var G = pt(P);
|
|
4539
4539
|
if (Et[G])
|
|
4540
4540
|
return;
|
|
4541
4541
|
Et[G] = !0;
|
|
4542
4542
|
var Z = "";
|
|
4543
|
-
|
|
4543
|
+
_ && _._owner && _._owner !== Ae.current && (Z = " It was passed a child from " + L(_._owner.type) + "."), ye(_), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', G, Z), ye(null);
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
|
-
function yr(
|
|
4546
|
+
function yr(_, P) {
|
|
4547
4547
|
{
|
|
4548
|
-
if (typeof
|
|
4548
|
+
if (typeof _ != "object")
|
|
4549
4549
|
return;
|
|
4550
|
-
if (At(
|
|
4551
|
-
for (var G = 0; G <
|
|
4552
|
-
var Z =
|
|
4550
|
+
if (At(_))
|
|
4551
|
+
for (var G = 0; G < _.length; G++) {
|
|
4552
|
+
var Z = _[G];
|
|
4553
4553
|
qe(Z) && Pt(Z, P);
|
|
4554
4554
|
}
|
|
4555
|
-
else if (qe(
|
|
4556
|
-
|
|
4557
|
-
else if (
|
|
4558
|
-
var he = y(
|
|
4559
|
-
if (typeof he == "function" && he !==
|
|
4560
|
-
for (var
|
|
4555
|
+
else if (qe(_))
|
|
4556
|
+
_._store && (_._store.validated = !0);
|
|
4557
|
+
else if (_) {
|
|
4558
|
+
var he = y(_);
|
|
4559
|
+
if (typeof he == "function" && he !== _.entries)
|
|
4560
|
+
for (var _e = he.call(_), le; !(le = _e.next()).done; )
|
|
4561
4561
|
qe(le.value) && Pt(le.value, P);
|
|
4562
4562
|
}
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
4565
|
-
function tr(
|
|
4565
|
+
function tr(_) {
|
|
4566
4566
|
{
|
|
4567
|
-
var P =
|
|
4567
|
+
var P = _.type;
|
|
4568
4568
|
if (P == null || typeof P == "string")
|
|
4569
4569
|
return;
|
|
4570
4570
|
var G;
|
|
@@ -4578,7 +4578,7 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4578
4578
|
return;
|
|
4579
4579
|
if (G) {
|
|
4580
4580
|
var Z = L(P);
|
|
4581
|
-
ft(G,
|
|
4581
|
+
ft(G, _.props, "prop", Z, _);
|
|
4582
4582
|
} else if (P.PropTypes !== void 0 && !fe) {
|
|
4583
4583
|
fe = !0;
|
|
4584
4584
|
var he = L(P);
|
|
@@ -4587,31 +4587,31 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4587
4587
|
typeof P.getDefaultProps == "function" && !P.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
4588
4588
|
}
|
|
4589
4589
|
}
|
|
4590
|
-
function ws(
|
|
4590
|
+
function ws(_) {
|
|
4591
4591
|
{
|
|
4592
|
-
for (var P = Object.keys(
|
|
4592
|
+
for (var P = Object.keys(_.props), G = 0; G < P.length; G++) {
|
|
4593
4593
|
var Z = P[G];
|
|
4594
4594
|
if (Z !== "children" && Z !== "key") {
|
|
4595
|
-
ye(
|
|
4595
|
+
ye(_), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Z), ye(null);
|
|
4596
4596
|
break;
|
|
4597
4597
|
}
|
|
4598
4598
|
}
|
|
4599
|
-
|
|
4599
|
+
_.ref !== null && (ye(_), x("Invalid attribute `ref` supplied to `React.Fragment`."), ye(null));
|
|
4600
4600
|
}
|
|
4601
4601
|
}
|
|
4602
4602
|
var xr = {};
|
|
4603
|
-
function Mr(
|
|
4603
|
+
function Mr(_, P, G, Z, he, _e) {
|
|
4604
4604
|
{
|
|
4605
|
-
var le = M(
|
|
4605
|
+
var le = M(_);
|
|
4606
4606
|
if (!le) {
|
|
4607
4607
|
var se = "";
|
|
4608
|
-
(
|
|
4609
|
-
var
|
|
4610
|
-
|
|
4608
|
+
(_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (se += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4609
|
+
var He = lt();
|
|
4610
|
+
He ? se += He : se += Ue();
|
|
4611
4611
|
var Ne;
|
|
4612
|
-
|
|
4612
|
+
_ === null ? Ne = "null" : At(_) ? Ne = "array" : _ !== void 0 && _.$$typeof === e ? (Ne = "<" + (L(_.type) || "Unknown") + " />", se = " Did you accidentally export a JSX literal instead of a component?") : Ne = typeof _, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ne, se);
|
|
4613
4613
|
}
|
|
4614
|
-
var je = te(
|
|
4614
|
+
var je = te(_, P, G, he, _e);
|
|
4615
4615
|
if (je == null)
|
|
4616
4616
|
return je;
|
|
4617
4617
|
if (le) {
|
|
@@ -4620,15 +4620,15 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4620
4620
|
if (Z)
|
|
4621
4621
|
if (At(at)) {
|
|
4622
4622
|
for (var br = 0; br < at.length; br++)
|
|
4623
|
-
yr(at[br],
|
|
4623
|
+
yr(at[br], _);
|
|
4624
4624
|
Object.freeze && Object.freeze(at);
|
|
4625
4625
|
} else
|
|
4626
4626
|
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
4627
4627
|
else
|
|
4628
|
-
yr(at,
|
|
4628
|
+
yr(at, _);
|
|
4629
4629
|
}
|
|
4630
4630
|
if (dt.call(P, "key")) {
|
|
4631
|
-
var rr = L(
|
|
4631
|
+
var rr = L(_), Ze = Object.keys(P).filter(function(Ra) {
|
|
4632
4632
|
return Ra !== "key";
|
|
4633
4633
|
}), Ds = Ze.length > 0 ? "{key: someKey, " + Ze.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
4634
4634
|
if (!xr[rr + Ds]) {
|
|
@@ -4641,14 +4641,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4641
4641
|
<%s key={someKey} {...props} />`, Ds, rr, Pa, rr), xr[rr + Ds] = !0;
|
|
4642
4642
|
}
|
|
4643
4643
|
}
|
|
4644
|
-
return
|
|
4644
|
+
return _ === n ? ws(je) : tr(je), je;
|
|
4645
4645
|
}
|
|
4646
4646
|
}
|
|
4647
|
-
function Cs(
|
|
4648
|
-
return Mr(
|
|
4647
|
+
function Cs(_, P, G) {
|
|
4648
|
+
return Mr(_, P, G, !0);
|
|
4649
4649
|
}
|
|
4650
|
-
function Fa(
|
|
4651
|
-
return Mr(
|
|
4650
|
+
function Fa(_, P, G) {
|
|
4651
|
+
return Mr(_, P, G, !1);
|
|
4652
4652
|
}
|
|
4653
4653
|
var ja = Fa, La = Cs;
|
|
4654
4654
|
zr.Fragment = n, zr.jsx = ja, zr.jsxs = La;
|
|
@@ -4758,11 +4758,11 @@ function vf({
|
|
|
4758
4758
|
onRefresh: h,
|
|
4759
4759
|
theme: g = {}
|
|
4760
4760
|
}) {
|
|
4761
|
-
const { data: m, loading: y, error: C, refetch: x } = fu(r, e), [A, w] = H(""), [E, v] = H({}), [
|
|
4761
|
+
const { data: m, loading: y, error: C, refetch: x } = fu(r, e), [A, w] = H(""), [E, v] = H({}), [b, D] = H(1), k = bt(() => {
|
|
4762
4762
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
4763
4763
|
let j = m;
|
|
4764
|
-
return l && A && a.length > 0 && (j = Bs.search(j, A, a)), Object.keys(E).length > 0 && (j = Bs.filterByFields(j, E)), Bs.paginate(j,
|
|
4765
|
-
}, [m, A, E,
|
|
4764
|
+
return l && A && a.length > 0 && (j = Bs.search(j, A, a)), Object.keys(E).length > 0 && (j = Bs.filterByFields(j, E)), Bs.paginate(j, b, d);
|
|
4765
|
+
}, [m, A, E, b, d, l, a]);
|
|
4766
4766
|
De(() => {
|
|
4767
4767
|
D(1);
|
|
4768
4768
|
}, [A, E]);
|
|
@@ -4906,7 +4906,7 @@ function vf({
|
|
|
4906
4906
|
}, children: [
|
|
4907
4907
|
/* @__PURE__ */ p.jsxs("div", { style: { fontSize: "13px", color: B.textSecondary }, children: [
|
|
4908
4908
|
"Page ",
|
|
4909
|
-
|
|
4909
|
+
b,
|
|
4910
4910
|
" of ",
|
|
4911
4911
|
k.totalPages
|
|
4912
4912
|
] }),
|
|
@@ -4915,14 +4915,14 @@ function vf({
|
|
|
4915
4915
|
"button",
|
|
4916
4916
|
{
|
|
4917
4917
|
onClick: () => D((j) => Math.max(1, j - 1)),
|
|
4918
|
-
disabled:
|
|
4918
|
+
disabled: b === 1,
|
|
4919
4919
|
style: {
|
|
4920
4920
|
padding: "6px 12px",
|
|
4921
4921
|
border: `1px solid ${B.border}`,
|
|
4922
4922
|
borderRadius: "6px",
|
|
4923
4923
|
background: "white",
|
|
4924
|
-
cursor:
|
|
4925
|
-
opacity:
|
|
4924
|
+
cursor: b === 1 ? "not-allowed" : "pointer",
|
|
4925
|
+
opacity: b === 1 ? 0.5 : 1
|
|
4926
4926
|
},
|
|
4927
4927
|
children: "Previous"
|
|
4928
4928
|
}
|
|
@@ -4931,14 +4931,14 @@ function vf({
|
|
|
4931
4931
|
"button",
|
|
4932
4932
|
{
|
|
4933
4933
|
onClick: () => D((j) => Math.min(k.totalPages, j + 1)),
|
|
4934
|
-
disabled:
|
|
4934
|
+
disabled: b === k.totalPages,
|
|
4935
4935
|
style: {
|
|
4936
4936
|
padding: "6px 12px",
|
|
4937
4937
|
border: `1px solid ${B.border}`,
|
|
4938
4938
|
borderRadius: "6px",
|
|
4939
4939
|
background: "white",
|
|
4940
|
-
cursor:
|
|
4941
|
-
opacity:
|
|
4940
|
+
cursor: b === k.totalPages ? "not-allowed" : "pointer",
|
|
4941
|
+
opacity: b === k.totalPages ? 0.5 : 1
|
|
4942
4942
|
},
|
|
4943
4943
|
children: "Next"
|
|
4944
4944
|
}
|
|
@@ -5050,17 +5050,17 @@ function Df({
|
|
|
5050
5050
|
className: i = ""
|
|
5051
5051
|
}) {
|
|
5052
5052
|
const l = Math.min(Math.max(e, 1), 5), [a, u] = H([]), [c, d] = H([]), [f, h] = H(Array(l).fill(!1)), [g, m] = H(Array(l).fill(!1)), y = xe([]), C = re((v) => {
|
|
5053
|
-
const
|
|
5054
|
-
if (
|
|
5055
|
-
const D = Math.floor(Math.random() *
|
|
5056
|
-
return
|
|
5053
|
+
const b = r.filter((k) => !v.includes(k._id));
|
|
5054
|
+
if (b.length === 0) return null;
|
|
5055
|
+
const D = Math.floor(Math.random() * b.length);
|
|
5056
|
+
return b[D];
|
|
5057
5057
|
}, [r]), x = re(() => Math.random() * (n - t) + t, [t, n]);
|
|
5058
5058
|
De(() => {
|
|
5059
5059
|
if (r.length === 0) {
|
|
5060
5060
|
u([]), d([]);
|
|
5061
5061
|
return;
|
|
5062
5062
|
}
|
|
5063
|
-
const v = [],
|
|
5063
|
+
const v = [], b = [], D = [];
|
|
5064
5064
|
for (let k = 0; k < l && k < r.length; k++) {
|
|
5065
5065
|
const M = C(D);
|
|
5066
5066
|
M && (v.push(M), D.push(M._id));
|
|
@@ -5070,12 +5070,12 @@ function Df({
|
|
|
5070
5070
|
v[k]._id,
|
|
5071
5071
|
...v.filter((F, L) => L !== k).map((F) => F._id)
|
|
5072
5072
|
], B = C(M);
|
|
5073
|
-
B ?
|
|
5073
|
+
B ? b.push(B) : b.push(v[k]);
|
|
5074
5074
|
}
|
|
5075
|
-
u(v), d(
|
|
5075
|
+
u(v), d(b);
|
|
5076
5076
|
}, [r, l, C]);
|
|
5077
5077
|
const A = re((v) => {
|
|
5078
|
-
const
|
|
5078
|
+
const b = x(), D = setTimeout(() => {
|
|
5079
5079
|
h((k) => {
|
|
5080
5080
|
const M = [...k];
|
|
5081
5081
|
return M[v] = !M[v], M;
|
|
@@ -5100,7 +5100,7 @@ function Df({
|
|
|
5100
5100
|
}, 150);
|
|
5101
5101
|
}, 200);
|
|
5102
5102
|
}, 150);
|
|
5103
|
-
},
|
|
5103
|
+
}, b);
|
|
5104
5104
|
y.current[v] = D;
|
|
5105
5105
|
}, [x, C, a, c, g]), w = xe(!1);
|
|
5106
5106
|
De(() => {
|
|
@@ -5116,8 +5116,8 @@ function Df({
|
|
|
5116
5116
|
const E = (v) => {
|
|
5117
5117
|
s && s(v);
|
|
5118
5118
|
};
|
|
5119
|
-
return r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : a.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ p.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${i}`, children: a.map((v,
|
|
5120
|
-
const D = c[
|
|
5119
|
+
return r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : a.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ p.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${i}`, children: a.map((v, b) => {
|
|
5120
|
+
const D = c[b], k = g[b];
|
|
5121
5121
|
return /* @__PURE__ */ p.jsx(
|
|
5122
5122
|
"div",
|
|
5123
5123
|
{
|
|
@@ -5129,7 +5129,7 @@ function Df({
|
|
|
5129
5129
|
{
|
|
5130
5130
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
5131
5131
|
style: {
|
|
5132
|
-
transform: `rotateY(${f[
|
|
5132
|
+
transform: `rotateY(${f[b] ? 180 : 0}deg)`,
|
|
5133
5133
|
transition: "transform 0.5s",
|
|
5134
5134
|
transformStyle: "preserve-3d"
|
|
5135
5135
|
},
|
|
@@ -5145,7 +5145,7 @@ function Df({
|
|
|
5145
5145
|
"div",
|
|
5146
5146
|
{
|
|
5147
5147
|
style: {
|
|
5148
|
-
transform: f[
|
|
5148
|
+
transform: f[b] ? "scaleX(-1)" : "scaleX(1)",
|
|
5149
5149
|
width: "100%",
|
|
5150
5150
|
height: "100%"
|
|
5151
5151
|
},
|
|
@@ -5175,7 +5175,7 @@ function Df({
|
|
|
5175
5175
|
"div",
|
|
5176
5176
|
{
|
|
5177
5177
|
style: {
|
|
5178
|
-
transform: f[
|
|
5178
|
+
transform: f[b] ? "scaleX(-1)" : "scaleX(1)",
|
|
5179
5179
|
width: "100%",
|
|
5180
5180
|
height: "100%"
|
|
5181
5181
|
},
|
|
@@ -5198,7 +5198,7 @@ function Df({
|
|
|
5198
5198
|
}
|
|
5199
5199
|
)
|
|
5200
5200
|
},
|
|
5201
|
-
`slot-${
|
|
5201
|
+
`slot-${b}`
|
|
5202
5202
|
);
|
|
5203
5203
|
}) });
|
|
5204
5204
|
}
|
|
@@ -5259,23 +5259,23 @@ function Af({
|
|
|
5259
5259
|
renderLoading: E,
|
|
5260
5260
|
theme: v = {}
|
|
5261
5261
|
}) {
|
|
5262
|
-
const
|
|
5262
|
+
const b = { ...mu, ...v }, [D, k] = H([]), [M, B] = H(!1), [F, L] = H(null), [j, R] = H(/* @__PURE__ */ new Set()), [Y, de] = H(null), [ie, oe] = H(null), [ve, pe] = H(null), [we, Se] = H(!1), [Oe, ke] = H(""), Ce = a !== void 0 ? a : Oe, Ge = (S) => {
|
|
5263
5263
|
u ? u(S) : ke(S);
|
|
5264
5264
|
}, ze = bt(() => {
|
|
5265
|
-
if (!
|
|
5266
|
-
const S =
|
|
5265
|
+
if (!Ce.trim()) return D;
|
|
5266
|
+
const S = Ce.toLowerCase();
|
|
5267
5267
|
return D.filter(
|
|
5268
|
-
(
|
|
5268
|
+
($) => _r($.from).toLowerCase().includes(S) || _r($.subject).toLowerCase().includes(S)
|
|
5269
5269
|
);
|
|
5270
|
-
}, [D,
|
|
5270
|
+
}, [D, Ce]), ge = bt(() => e ? new uu({ baseUrl: r, system_id: e }) : null, [r, e]), Me = re(async () => {
|
|
5271
5271
|
if (ge) {
|
|
5272
5272
|
B(!0), L(null);
|
|
5273
5273
|
try {
|
|
5274
5274
|
const S = await ge.listEmails(t, n, s);
|
|
5275
5275
|
S != null && S.messages && (k(S.messages), y == null || y(S.messages));
|
|
5276
5276
|
} catch (S) {
|
|
5277
|
-
const
|
|
5278
|
-
L(
|
|
5277
|
+
const $ = S instanceof Error ? S : new Error("Failed to fetch emails");
|
|
5278
|
+
L($.message), m == null || m($);
|
|
5279
5279
|
}
|
|
5280
5280
|
B(!1);
|
|
5281
5281
|
}
|
|
@@ -5287,68 +5287,68 @@ function Af({
|
|
|
5287
5287
|
if (ge) {
|
|
5288
5288
|
oe(S), pe(null), Se(!0);
|
|
5289
5289
|
try {
|
|
5290
|
-
const
|
|
5291
|
-
|
|
5292
|
-
} catch (
|
|
5293
|
-
console.error("Failed to fetch email body:",
|
|
5290
|
+
const $ = await ge.getEmailParsed(t, S.uid, s || "INBOX");
|
|
5291
|
+
$ != null && $.body && pe($.body);
|
|
5292
|
+
} catch ($) {
|
|
5293
|
+
console.error("Failed to fetch email body:", $);
|
|
5294
5294
|
}
|
|
5295
5295
|
Se(!1);
|
|
5296
5296
|
}
|
|
5297
5297
|
}, [ge, t, s]), Ct = re((S) => {
|
|
5298
5298
|
f == null || f(S), i && ct(S);
|
|
5299
|
-
}, [f, i, ct]), qt = re((S,
|
|
5299
|
+
}, [f, i, ct]), qt = re((S, $, K) => {
|
|
5300
5300
|
if (!o) {
|
|
5301
5301
|
f == null || f(S), i && ct(S);
|
|
5302
5302
|
return;
|
|
5303
5303
|
}
|
|
5304
5304
|
const Q = S.uid;
|
|
5305
5305
|
if (K.shiftKey && Y !== null) {
|
|
5306
|
-
const ee = Math.min(Y,
|
|
5306
|
+
const ee = Math.min(Y, $), ae = Math.max(Y, $), ne = D.slice(ee, ae + 1).map((Ae) => Ae.uid), te = new Set(ne);
|
|
5307
5307
|
R(te), h == null || h(Array.from(te));
|
|
5308
5308
|
} else if (K.ctrlKey || K.metaKey)
|
|
5309
5309
|
R((ee) => {
|
|
5310
5310
|
const ae = new Set(ee);
|
|
5311
5311
|
return ae.has(Q) ? ae.delete(Q) : ae.add(Q), h == null || h(Array.from(ae)), ae;
|
|
5312
|
-
}), de(
|
|
5312
|
+
}), de($);
|
|
5313
5313
|
else {
|
|
5314
5314
|
const ee = /* @__PURE__ */ new Set([Q]);
|
|
5315
|
-
R(ee), de(
|
|
5315
|
+
R(ee), de($), h == null || h(Array.from(ee));
|
|
5316
5316
|
}
|
|
5317
5317
|
}, [o, Y, D, j, f, h, i]), it = re(async () => {
|
|
5318
5318
|
if (!ge || j.size === 0) return;
|
|
5319
5319
|
const S = s || "INBOX";
|
|
5320
5320
|
try {
|
|
5321
|
-
const
|
|
5322
|
-
if (console.log("Trash result:",
|
|
5321
|
+
const $ = await ge.trashEmails(t, Array.from(j), S);
|
|
5322
|
+
if (console.log("Trash result:", $), $.success && $.moved > 0) {
|
|
5323
5323
|
k((Q) => Q.filter((ee) => !j.has(ee.uid)));
|
|
5324
5324
|
const K = Array.from(j);
|
|
5325
5325
|
R(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5326
5326
|
} else
|
|
5327
5327
|
L("Failed to move emails to trash");
|
|
5328
|
-
} catch (
|
|
5329
|
-
const K =
|
|
5328
|
+
} catch ($) {
|
|
5329
|
+
const K = $ instanceof Error ? $ : new Error("Trash failed");
|
|
5330
5330
|
console.error("Trash error:", K), L(K.message), m == null || m(K);
|
|
5331
5331
|
}
|
|
5332
5332
|
}, [ge, t, j, s, g, m]), ot = re(async () => {
|
|
5333
5333
|
if (!ge || j.size === 0) return;
|
|
5334
5334
|
const S = s || "INBOX";
|
|
5335
5335
|
try {
|
|
5336
|
-
const
|
|
5337
|
-
if (console.log("Archive result:",
|
|
5336
|
+
const $ = await ge.archiveEmails(t, Array.from(j), S);
|
|
5337
|
+
if (console.log("Archive result:", $), $.success && $.archived > 0) {
|
|
5338
5338
|
k((Q) => Q.filter((ee) => !j.has(ee.uid)));
|
|
5339
5339
|
const K = Array.from(j);
|
|
5340
5340
|
R(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5341
5341
|
} else
|
|
5342
5342
|
L("Failed to archive emails");
|
|
5343
|
-
} catch (
|
|
5344
|
-
const K =
|
|
5343
|
+
} catch ($) {
|
|
5344
|
+
const K = $ instanceof Error ? $ : new Error("Archive failed");
|
|
5345
5345
|
console.error("Archive error:", K), L(K.message), m == null || m(K);
|
|
5346
5346
|
}
|
|
5347
5347
|
}, [ge, t, j, s, g, m]), dt = re(() => {
|
|
5348
5348
|
if (j.size === D.length)
|
|
5349
5349
|
R(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
5350
5350
|
else {
|
|
5351
|
-
const S = new Set(D.map((
|
|
5351
|
+
const S = new Set(D.map(($) => $.uid));
|
|
5352
5352
|
R(S), h == null || h(Array.from(S));
|
|
5353
5353
|
}
|
|
5354
5354
|
}, [D, j.size, h]), Ut = re(() => {
|
|
@@ -5361,12 +5361,12 @@ function Af({
|
|
|
5361
5361
|
clearSelection: Ut
|
|
5362
5362
|
}, Dt = (S) => {
|
|
5363
5363
|
if (!S) return "";
|
|
5364
|
-
const
|
|
5365
|
-
return
|
|
5366
|
-
}, ft = (S,
|
|
5364
|
+
const $ = new Date(S), K = /* @__PURE__ */ new Date();
|
|
5365
|
+
return $.toDateString() === K.toDateString() ? $.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : $.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5366
|
+
}, ft = (S, $) => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5367
5367
|
padding: "12px 16px",
|
|
5368
|
-
background:
|
|
5369
|
-
borderBottom: `1px solid ${
|
|
5368
|
+
background: $ ? b.selectedBackground : S.seen ? b.cardBackground : b.unreadBackground,
|
|
5369
|
+
borderBottom: `1px solid ${b.border}`,
|
|
5370
5370
|
cursor: "pointer",
|
|
5371
5371
|
transition: "background 0.15s ease"
|
|
5372
5372
|
}, children: /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
@@ -5374,7 +5374,7 @@ function Af({
|
|
|
5374
5374
|
/* @__PURE__ */ p.jsx("div", { style: {
|
|
5375
5375
|
fontSize: "14px",
|
|
5376
5376
|
fontWeight: S.seen ? 400 : 600,
|
|
5377
|
-
color:
|
|
5377
|
+
color: b.text,
|
|
5378
5378
|
whiteSpace: "nowrap",
|
|
5379
5379
|
overflow: "hidden",
|
|
5380
5380
|
textOverflow: "ellipsis"
|
|
@@ -5382,7 +5382,7 @@ function Af({
|
|
|
5382
5382
|
/* @__PURE__ */ p.jsx("div", { style: {
|
|
5383
5383
|
fontSize: "14px",
|
|
5384
5384
|
fontWeight: S.seen ? 400 : 500,
|
|
5385
|
-
color: S.seen ?
|
|
5385
|
+
color: S.seen ? b.textSecondary : b.text,
|
|
5386
5386
|
marginTop: "2px",
|
|
5387
5387
|
whiteSpace: "nowrap",
|
|
5388
5388
|
overflow: "hidden",
|
|
@@ -5391,57 +5391,57 @@ function Af({
|
|
|
5391
5391
|
] }),
|
|
5392
5392
|
/* @__PURE__ */ p.jsx("div", { style: {
|
|
5393
5393
|
fontSize: "12px",
|
|
5394
|
-
color:
|
|
5394
|
+
color: b.textSecondary,
|
|
5395
5395
|
flexShrink: 0
|
|
5396
5396
|
}, children: Dt(S.date) })
|
|
5397
5397
|
] }) }), ht = (S) => /* @__PURE__ */ p.jsxs("div", { style: { padding: "24px" }, children: [
|
|
5398
|
-
/* @__PURE__ */ p.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
5399
|
-
/* @__PURE__ */ p.jsxs("div", { style: { fontSize: "14px", color:
|
|
5398
|
+
/* @__PURE__ */ p.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: b.text }, children: _r(S.subject) || "(No subject)" }),
|
|
5399
|
+
/* @__PURE__ */ p.jsxs("div", { style: { fontSize: "14px", color: b.textSecondary, marginBottom: "16px" }, children: [
|
|
5400
5400
|
"From: ",
|
|
5401
5401
|
_r(S.from),
|
|
5402
5402
|
" • ",
|
|
5403
5403
|
new Date(S.date).toLocaleString()
|
|
5404
5404
|
] }),
|
|
5405
|
-
|
|
5405
|
+
we ? /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color: b.textSecondary }, children: "Loading..." }) : ve ? /* @__PURE__ */ p.jsx(
|
|
5406
5406
|
"div",
|
|
5407
5407
|
{
|
|
5408
|
-
style: { fontSize: "14px", color:
|
|
5409
|
-
dangerouslySetInnerHTML: { __html:
|
|
5408
|
+
style: { fontSize: "14px", color: b.text },
|
|
5409
|
+
dangerouslySetInnerHTML: { __html: ve }
|
|
5410
5410
|
}
|
|
5411
|
-
) : /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color:
|
|
5412
|
-
] }), At = (S,
|
|
5411
|
+
) : /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color: b.textSecondary }, children: "No content available" })
|
|
5412
|
+
] }), At = (S, $) => /* @__PURE__ */ p.jsxs("div", { style: {
|
|
5413
5413
|
display: "flex",
|
|
5414
5414
|
alignItems: "center",
|
|
5415
5415
|
gap: "8px",
|
|
5416
5416
|
padding: "8px 16px",
|
|
5417
|
-
background:
|
|
5418
|
-
borderBottom: `1px solid ${
|
|
5417
|
+
background: b.cardBackground,
|
|
5418
|
+
borderBottom: `1px solid ${b.border}`
|
|
5419
5419
|
}, children: [
|
|
5420
5420
|
/* @__PURE__ */ p.jsx(
|
|
5421
5421
|
"button",
|
|
5422
5422
|
{
|
|
5423
|
-
onClick:
|
|
5423
|
+
onClick: $.selectAll,
|
|
5424
5424
|
style: {
|
|
5425
5425
|
padding: "6px 12px",
|
|
5426
5426
|
background: "transparent",
|
|
5427
|
-
border: `1px solid ${
|
|
5427
|
+
border: `1px solid ${b.border}`,
|
|
5428
5428
|
borderRadius: "6px",
|
|
5429
5429
|
fontSize: "13px",
|
|
5430
5430
|
cursor: "pointer",
|
|
5431
|
-
color:
|
|
5431
|
+
color: b.text
|
|
5432
5432
|
},
|
|
5433
5433
|
children: S.length === D.length ? "Deselect All" : "Select All"
|
|
5434
5434
|
}
|
|
5435
5435
|
),
|
|
5436
5436
|
S.length > 0 && /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
|
5437
|
-
/* @__PURE__ */ p.jsxs("span", { style: { fontSize: "13px", color:
|
|
5437
|
+
/* @__PURE__ */ p.jsxs("span", { style: { fontSize: "13px", color: b.textSecondary }, children: [
|
|
5438
5438
|
S.length,
|
|
5439
5439
|
" selected"
|
|
5440
5440
|
] }),
|
|
5441
5441
|
/* @__PURE__ */ p.jsx(
|
|
5442
5442
|
"button",
|
|
5443
5443
|
{
|
|
5444
|
-
onClick:
|
|
5444
|
+
onClick: $.archive,
|
|
5445
5445
|
title: "Archive",
|
|
5446
5446
|
style: {
|
|
5447
5447
|
display: "flex",
|
|
@@ -5450,10 +5450,10 @@ function Af({
|
|
|
5450
5450
|
width: "32px",
|
|
5451
5451
|
height: "32px",
|
|
5452
5452
|
background: "transparent",
|
|
5453
|
-
border: `1px solid ${
|
|
5453
|
+
border: `1px solid ${b.border}`,
|
|
5454
5454
|
borderRadius: "6px",
|
|
5455
5455
|
cursor: "pointer",
|
|
5456
|
-
color:
|
|
5456
|
+
color: b.textSecondary
|
|
5457
5457
|
},
|
|
5458
5458
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
5459
5459
|
}
|
|
@@ -5461,7 +5461,7 @@ function Af({
|
|
|
5461
5461
|
/* @__PURE__ */ p.jsx(
|
|
5462
5462
|
"button",
|
|
5463
5463
|
{
|
|
5464
|
-
onClick:
|
|
5464
|
+
onClick: $.delete,
|
|
5465
5465
|
title: "Delete",
|
|
5466
5466
|
style: {
|
|
5467
5467
|
display: "flex",
|
|
@@ -5470,10 +5470,10 @@ function Af({
|
|
|
5470
5470
|
width: "32px",
|
|
5471
5471
|
height: "32px",
|
|
5472
5472
|
background: "transparent",
|
|
5473
|
-
border: `1px solid ${
|
|
5473
|
+
border: `1px solid ${b.border}`,
|
|
5474
5474
|
borderRadius: "6px",
|
|
5475
5475
|
cursor: "pointer",
|
|
5476
|
-
color:
|
|
5476
|
+
color: b.textSecondary
|
|
5477
5477
|
},
|
|
5478
5478
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
5479
5479
|
}
|
|
@@ -5483,7 +5483,7 @@ function Af({
|
|
|
5483
5483
|
/* @__PURE__ */ p.jsx(
|
|
5484
5484
|
"button",
|
|
5485
5485
|
{
|
|
5486
|
-
onClick:
|
|
5486
|
+
onClick: $.refresh,
|
|
5487
5487
|
title: "Refresh",
|
|
5488
5488
|
style: {
|
|
5489
5489
|
display: "flex",
|
|
@@ -5492,10 +5492,10 @@ function Af({
|
|
|
5492
5492
|
width: "32px",
|
|
5493
5493
|
height: "32px",
|
|
5494
5494
|
background: "transparent",
|
|
5495
|
-
border: `1px solid ${
|
|
5495
|
+
border: `1px solid ${b.border}`,
|
|
5496
5496
|
borderRadius: "6px",
|
|
5497
5497
|
cursor: "pointer",
|
|
5498
|
-
color:
|
|
5498
|
+
color: b.textSecondary
|
|
5499
5499
|
},
|
|
5500
5500
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
5501
5501
|
}
|
|
@@ -5503,25 +5503,25 @@ function Af({
|
|
|
5503
5503
|
] }), W = () => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5504
5504
|
padding: "48px",
|
|
5505
5505
|
textAlign: "center",
|
|
5506
|
-
color:
|
|
5507
|
-
}, children: c }),
|
|
5506
|
+
color: b.textSecondary
|
|
5507
|
+
}, children: c }), be = () => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5508
5508
|
padding: "48px",
|
|
5509
5509
|
textAlign: "center",
|
|
5510
|
-
color:
|
|
5511
|
-
}, children: "Loading..." }),
|
|
5512
|
-
return M && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background:
|
|
5510
|
+
color: b.textSecondary
|
|
5511
|
+
}, children: "Loading..." }), Ke = C || ft, I = x || ht, T = A || At, X = w || W, J = E || be;
|
|
5512
|
+
return M && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background: b.background, width: "100%", height: "100%" }, children: J() }) : /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", background: b.background, width: "100%", height: "100%" }, children: [
|
|
5513
5513
|
/* @__PURE__ */ p.jsxs("div", { style: {
|
|
5514
5514
|
flex: i && ie ? "0 0 50%" : "1",
|
|
5515
5515
|
display: "flex",
|
|
5516
5516
|
flexDirection: "column",
|
|
5517
|
-
borderRight: i && ie ? `1px solid ${
|
|
5517
|
+
borderRight: i && ie ? `1px solid ${b.border}` : "none",
|
|
5518
5518
|
overflow: "hidden"
|
|
5519
5519
|
}, children: [
|
|
5520
5520
|
o && T(Array.from(j), Wt),
|
|
5521
5521
|
l && /* @__PURE__ */ p.jsx("div", { style: {
|
|
5522
5522
|
padding: "8px 12px",
|
|
5523
|
-
borderBottom: `1px solid ${
|
|
5524
|
-
background:
|
|
5523
|
+
borderBottom: `1px solid ${b.border}`,
|
|
5524
|
+
background: b.background
|
|
5525
5525
|
}, children: /* @__PURE__ */ p.jsxs("div", { style: {
|
|
5526
5526
|
display: "flex",
|
|
5527
5527
|
alignItems: "center",
|
|
@@ -5530,7 +5530,7 @@ function Af({
|
|
|
5530
5530
|
background: "#f5f5f5",
|
|
5531
5531
|
borderRadius: "6px"
|
|
5532
5532
|
}, children: [
|
|
5533
|
-
/* @__PURE__ */ p.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
5533
|
+
/* @__PURE__ */ p.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: b.textSecondary, strokeWidth: "2", children: [
|
|
5534
5534
|
/* @__PURE__ */ p.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
5535
5535
|
/* @__PURE__ */ p.jsx("path", { d: "M21 21l-4.35-4.35" })
|
|
5536
5536
|
] }),
|
|
@@ -5539,7 +5539,7 @@ function Af({
|
|
|
5539
5539
|
{
|
|
5540
5540
|
type: "text",
|
|
5541
5541
|
placeholder: "Search by email or subject...",
|
|
5542
|
-
value:
|
|
5542
|
+
value: Ce,
|
|
5543
5543
|
onChange: (S) => Ge(S.target.value),
|
|
5544
5544
|
style: {
|
|
5545
5545
|
flex: 1,
|
|
@@ -5547,11 +5547,11 @@ function Af({
|
|
|
5547
5547
|
background: "transparent",
|
|
5548
5548
|
outline: "none",
|
|
5549
5549
|
fontSize: "13px",
|
|
5550
|
-
color:
|
|
5550
|
+
color: b.text
|
|
5551
5551
|
}
|
|
5552
5552
|
}
|
|
5553
5553
|
),
|
|
5554
|
-
|
|
5554
|
+
Ce && /* @__PURE__ */ p.jsx(
|
|
5555
5555
|
"button",
|
|
5556
5556
|
{
|
|
5557
5557
|
onClick: () => Ge(""),
|
|
@@ -5564,28 +5564,28 @@ function Af({
|
|
|
5564
5564
|
alignItems: "center",
|
|
5565
5565
|
justifyContent: "center"
|
|
5566
5566
|
},
|
|
5567
|
-
children: /* @__PURE__ */ p.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
5567
|
+
children: /* @__PURE__ */ p.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: b.textSecondary, strokeWidth: "2", children: /* @__PURE__ */ p.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
5568
5568
|
}
|
|
5569
5569
|
)
|
|
5570
5570
|
] }) }),
|
|
5571
5571
|
F && /* @__PURE__ */ p.jsx("div", { style: {
|
|
5572
5572
|
padding: "12px 16px",
|
|
5573
5573
|
background: "#fef2f2",
|
|
5574
|
-
color:
|
|
5574
|
+
color: b.danger,
|
|
5575
5575
|
fontSize: "14px",
|
|
5576
|
-
borderBottom: `1px solid ${
|
|
5576
|
+
borderBottom: `1px solid ${b.border}`
|
|
5577
5577
|
}, children: F }),
|
|
5578
|
-
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? X() : ze.map((S,
|
|
5578
|
+
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? X() : ze.map((S, $) => /* @__PURE__ */ p.jsx(
|
|
5579
5579
|
"div",
|
|
5580
5580
|
{
|
|
5581
|
-
onClick: (K) => qt(S,
|
|
5581
|
+
onClick: (K) => qt(S, $, K),
|
|
5582
5582
|
onDoubleClick: () => Ct(S),
|
|
5583
|
-
children:
|
|
5583
|
+
children: Ke(S, j.has(S.uid))
|
|
5584
5584
|
},
|
|
5585
5585
|
S.uid
|
|
5586
5586
|
)) })
|
|
5587
5587
|
] }),
|
|
5588
|
-
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
5588
|
+
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: I(ie) })
|
|
5589
5589
|
] });
|
|
5590
5590
|
}
|
|
5591
5591
|
function Ef({
|
|
@@ -5622,7 +5622,7 @@ function Ef({
|
|
|
5622
5622
|
}, [h, d, n]), A = re((w) => {
|
|
5623
5623
|
s == null || s(w, h, g);
|
|
5624
5624
|
}, [s, h, g]);
|
|
5625
|
-
return
|
|
5625
|
+
return Je.useEffect(() => {
|
|
5626
5626
|
h.length === 0 ? f(-1) : d >= h.length ? f(h.length - 1) : d < 0 && h.length > 0 && (f(0), n == null || n(h[0], 0));
|
|
5627
5627
|
}, [h.length, d, n]), r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `text-sm text-neutral-400 text-center py-4 ${a}`, children: i }) : /* @__PURE__ */ p.jsxs("div", { className: `space-y-2 ${a}`, children: [
|
|
5628
5628
|
/* @__PURE__ */ p.jsxs("div", { className: "flex items-center justify-between text-xs text-neutral-500", children: [
|
|
@@ -5732,7 +5732,7 @@ const fi = {}, _u = {}, hl = {}, or = {}, Er = {}, ln = {}, Sr = {}, os = {}, Ws
|
|
|
5732
5732
|
function Ju(r) {
|
|
5733
5733
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5734
5734
|
}
|
|
5735
|
-
var
|
|
5735
|
+
var z = Ju(function(r) {
|
|
5736
5736
|
const e = new URLSearchParams();
|
|
5737
5737
|
e.append("code", r);
|
|
5738
5738
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -5791,25 +5791,25 @@ function kl(r, e, t) {
|
|
|
5791
5791
|
const h = e[f], g = h.type, m = h.target, y = ec(m, r, l, i);
|
|
5792
5792
|
if (!y) continue;
|
|
5793
5793
|
const [C, x] = y;
|
|
5794
|
-
if (g === "characterData") n &&
|
|
5794
|
+
if (g === "characterData") n && q(x) && Zu(s, m, x) && Xu(m, x, r);
|
|
5795
5795
|
else if (g === "childList") {
|
|
5796
5796
|
u = !0;
|
|
5797
5797
|
const A = h.addedNodes;
|
|
5798
5798
|
for (let v = 0; v < A.length; v++) {
|
|
5799
|
-
const
|
|
5800
|
-
if (k != null &&
|
|
5799
|
+
const b = A[v], D = Ll(b), k = b.parentNode;
|
|
5800
|
+
if (k != null && b !== a && D === null && !Ns(b, k, r)) {
|
|
5801
5801
|
if (Yt) {
|
|
5802
|
-
const M =
|
|
5802
|
+
const M = b.innerText || b.nodeValue;
|
|
5803
5803
|
M && (c += M);
|
|
5804
5804
|
}
|
|
5805
|
-
k.removeChild(
|
|
5805
|
+
k.removeChild(b);
|
|
5806
5806
|
}
|
|
5807
5807
|
}
|
|
5808
5808
|
const w = h.removedNodes, E = w.length;
|
|
5809
5809
|
if (E > 0) {
|
|
5810
5810
|
let v = 0;
|
|
5811
|
-
for (let
|
|
5812
|
-
const D = w[
|
|
5811
|
+
for (let b = 0; b < E; b++) {
|
|
5812
|
+
const D = w[b];
|
|
5813
5813
|
(Ns(D, m, r) || a === D) && (m.appendChild(D), v++);
|
|
5814
5814
|
}
|
|
5815
5815
|
E !== v && o.set(C, x);
|
|
@@ -5856,7 +5856,7 @@ function Zi(r, e) {
|
|
|
5856
5856
|
function eo(r) {
|
|
5857
5857
|
let e, t, n = r;
|
|
5858
5858
|
if (n.__text !== "" || !n.isSimpleText() || n.isUnmergeable()) {
|
|
5859
|
-
for (; (e = n.getPreviousSibling()) !== null &&
|
|
5859
|
+
for (; (e = n.getPreviousSibling()) !== null && q(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
|
|
5860
5860
|
if (e.__text !== "") {
|
|
5861
5861
|
if (Xi(e, n)) {
|
|
5862
5862
|
n = Zi(e, n);
|
|
@@ -5866,7 +5866,7 @@ function eo(r) {
|
|
|
5866
5866
|
}
|
|
5867
5867
|
e.remove();
|
|
5868
5868
|
}
|
|
5869
|
-
for (; (t = n.getNextSibling()) !== null &&
|
|
5869
|
+
for (; (t = n.getNextSibling()) !== null && q(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
|
|
5870
5870
|
if (t.__text !== "") {
|
|
5871
5871
|
if (Xi(n, t)) {
|
|
5872
5872
|
n = Zi(n, t);
|
|
@@ -5885,7 +5885,7 @@ function to(r) {
|
|
|
5885
5885
|
for (; r.type === "element"; ) {
|
|
5886
5886
|
const e = r.getNode(), t = r.offset;
|
|
5887
5887
|
let n, s;
|
|
5888
|
-
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1),
|
|
5888
|
+
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1), q(n)) {
|
|
5889
5889
|
r.set(n.__key, s ? n.getTextContentSize() : 0, "text");
|
|
5890
5890
|
break;
|
|
5891
5891
|
}
|
|
@@ -5947,7 +5947,7 @@ function Vn(r, e, t) {
|
|
|
5947
5947
|
return e === "subscript" ? s &= -65 : e === "superscript" && (s &= -33), s;
|
|
5948
5948
|
}
|
|
5949
5949
|
function jl(r) {
|
|
5950
|
-
return
|
|
5950
|
+
return q(r) || ar(r) || me(r);
|
|
5951
5951
|
}
|
|
5952
5952
|
function sc(r, e) {
|
|
5953
5953
|
if (e != null) return void (r.__key = e);
|
|
@@ -6094,7 +6094,7 @@ function ki(r, e, t) {
|
|
|
6094
6094
|
if (s !== null) {
|
|
6095
6095
|
let l = Il(s);
|
|
6096
6096
|
const a = Nr(s);
|
|
6097
|
-
if (l !== null &&
|
|
6097
|
+
if (l !== null && q(a)) {
|
|
6098
6098
|
if (l === us && t) {
|
|
6099
6099
|
const u = t.length;
|
|
6100
6100
|
l = t, o = u, i = u;
|
|
@@ -6141,7 +6141,7 @@ function ic(r, e) {
|
|
|
6141
6141
|
const t = r.anchor.offset, n = e.getParentOrThrow(), s = e.isToken();
|
|
6142
6142
|
return t === 0 ? !e.canInsertTextBefore() || !n.canInsertTextBefore() && !e.isComposing() || s || function(o) {
|
|
6143
6143
|
const i = o.getPreviousSibling();
|
|
6144
|
-
return (
|
|
6144
|
+
return (q(i) || N(i) && i.isInline()) && !i.canInsertTextAfter();
|
|
6145
6145
|
}(e) : t === e.getTextContentSize() && (!e.canInsertTextAfter() || !n.canInsertTextAfter() && !e.isComposing() || s);
|
|
6146
6146
|
}
|
|
6147
6147
|
function so(r) {
|
|
@@ -6183,7 +6183,7 @@ function en(r, e) {
|
|
|
6183
6183
|
function Bi(r, e, t, n, s) {
|
|
6184
6184
|
if (t.size === 0) return;
|
|
6185
6185
|
const o = n.__type, i = n.__key, l = e.get(o);
|
|
6186
|
-
l === void 0 &&
|
|
6186
|
+
l === void 0 && z(33, o);
|
|
6187
6187
|
const a = l.klass;
|
|
6188
6188
|
let u = r.get(a);
|
|
6189
6189
|
u === void 0 && (u = /* @__PURE__ */ new Map(), r.set(a, u));
|
|
@@ -6216,11 +6216,11 @@ function U(r, e, t) {
|
|
|
6216
6216
|
return ca(r, e, t);
|
|
6217
6217
|
}
|
|
6218
6218
|
function fs(r) {
|
|
6219
|
-
return !
|
|
6219
|
+
return !Ye(r) && !r.isLastChild() && !r.isInline();
|
|
6220
6220
|
}
|
|
6221
6221
|
function Hn(r, e) {
|
|
6222
6222
|
const t = r._keyToDOMMap.get(e);
|
|
6223
|
-
return t === void 0 &&
|
|
6223
|
+
return t === void 0 && z(75, e), t;
|
|
6224
6224
|
}
|
|
6225
6225
|
function xn(r) {
|
|
6226
6226
|
const e = r.assignedSlot || r.parentElement;
|
|
@@ -6236,7 +6236,7 @@ function tn(r, e) {
|
|
|
6236
6236
|
}
|
|
6237
6237
|
function hs(r) {
|
|
6238
6238
|
const e = r._window;
|
|
6239
|
-
return e === null &&
|
|
6239
|
+
return e === null && z(78), e;
|
|
6240
6240
|
}
|
|
6241
6241
|
function lc(r) {
|
|
6242
6242
|
let e = r.getParentOrThrow();
|
|
@@ -6247,20 +6247,20 @@ function lc(r) {
|
|
|
6247
6247
|
return e;
|
|
6248
6248
|
}
|
|
6249
6249
|
function Ft(r) {
|
|
6250
|
-
return
|
|
6250
|
+
return Ye(r) || N(r) && r.isShadowRoot();
|
|
6251
6251
|
}
|
|
6252
6252
|
function Lt(r) {
|
|
6253
6253
|
const e = Be(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6254
|
-
n === void 0 &&
|
|
6254
|
+
n === void 0 && z(200, r.constructor.name, t);
|
|
6255
6255
|
const { replace: s, replaceWithKlass: o } = n;
|
|
6256
6256
|
if (s !== null) {
|
|
6257
6257
|
const i = s(r), l = i.constructor;
|
|
6258
|
-
return o !== null ? i instanceof o ||
|
|
6258
|
+
return o !== null ? i instanceof o || z(201, o.name, o.getType(), l.name, l.getType(), r.constructor.name, t) : i instanceof r.constructor && l !== r.constructor || z(202, l.name, l.getType(), r.constructor.name, t), i.__key === r.__key && z(203, r.constructor.name, t, l.name, l.getType()), i;
|
|
6259
6259
|
}
|
|
6260
6260
|
return r;
|
|
6261
6261
|
}
|
|
6262
6262
|
function Fs(r, e) {
|
|
6263
|
-
!
|
|
6263
|
+
!Ye(r.getParent()) || N(e) || me(e) || z(99);
|
|
6264
6264
|
}
|
|
6265
6265
|
function js(r) {
|
|
6266
6266
|
return (me(r) || N(r) && !r.canBeEmpty()) && !r.isInline();
|
|
@@ -6326,7 +6326,7 @@ function Jn(r) {
|
|
|
6326
6326
|
function Vt(r) {
|
|
6327
6327
|
if (me(r) && !r.isInline()) return !0;
|
|
6328
6328
|
if (!N(r) || Ft(r)) return !1;
|
|
6329
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
6329
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
6330
6330
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6331
6331
|
}
|
|
6332
6332
|
function Wr(r, e) {
|
|
@@ -6340,7 +6340,7 @@ function cc() {
|
|
|
6340
6340
|
const co = /* @__PURE__ */ new WeakMap(), dc = /* @__PURE__ */ new Map();
|
|
6341
6341
|
function fc(r) {
|
|
6342
6342
|
if (!r._readOnly && r.isEmpty()) return dc;
|
|
6343
|
-
r._readOnly ||
|
|
6343
|
+
r._readOnly || z(192);
|
|
6344
6344
|
let e = co.get(r);
|
|
6345
6345
|
if (!e) {
|
|
6346
6346
|
e = /* @__PURE__ */ new Map(), co.set(r, e);
|
|
@@ -6370,14 +6370,14 @@ function zl(r, e, t, n, s, o) {
|
|
|
6370
6370
|
i.__parent === e && (N(i) && zl(i, l, t, n, s, o), t.has(l) || o.delete(l), s.push(l)), i = i.getNextSibling();
|
|
6371
6371
|
}
|
|
6372
6372
|
}
|
|
6373
|
-
let Xt,
|
|
6373
|
+
let Xt, Xe, dn, ps, Hs, Js, dr, _t, Qs, fn, Re = "", Qe = "", St = null, mt = "", Ot = "", ql = !1, hn = !1, Rn = null;
|
|
6374
6374
|
function Qn(r, e) {
|
|
6375
6375
|
const t = dr.get(r);
|
|
6376
6376
|
if (e !== null) {
|
|
6377
6377
|
const n = Zs(r);
|
|
6378
6378
|
n.parentNode === e && e.removeChild(n);
|
|
6379
6379
|
}
|
|
6380
|
-
if (_t.has(r) ||
|
|
6380
|
+
if (_t.has(r) || Xe._keyToDOMMap.delete(r), N(t)) {
|
|
6381
6381
|
const n = Xn(t, dr);
|
|
6382
6382
|
Ys(n, 0, n.length - 1, null);
|
|
6383
6383
|
}
|
|
@@ -6409,20 +6409,20 @@ function Wl(r, e) {
|
|
|
6409
6409
|
}
|
|
6410
6410
|
function Yn(r, e) {
|
|
6411
6411
|
const t = _t.get(r);
|
|
6412
|
-
t === void 0 &&
|
|
6413
|
-
const n = t.createDOM(Xt,
|
|
6412
|
+
t === void 0 && z(60);
|
|
6413
|
+
const n = t.createDOM(Xt, Xe);
|
|
6414
6414
|
if (function(s, o, i) {
|
|
6415
6415
|
const l = i._keyToDOMMap;
|
|
6416
6416
|
(function(a, u, c) {
|
|
6417
6417
|
a[`__lexicalKey_${u._key}`] = c;
|
|
6418
6418
|
})(o, i, s), l.set(s, o);
|
|
6419
|
-
}(r, n,
|
|
6419
|
+
}(r, n, Xe), q(t) ? n.setAttribute("data-lexical-text", "true") : me(t) && n.setAttribute("data-lexical-decorator", "true"), N(t)) {
|
|
6420
6420
|
const s = t.__indent, o = t.__size;
|
|
6421
6421
|
if (s !== 0 && Ul(n, s), o !== 0) {
|
|
6422
6422
|
const l = o - 1;
|
|
6423
6423
|
(function(a, u, c, d) {
|
|
6424
|
-
const f =
|
|
6425
|
-
|
|
6424
|
+
const f = Qe;
|
|
6425
|
+
Qe = "", Xs(a, c, 0, u, c.getDOMSlot(d)), Vl(c, d), Qe = f;
|
|
6426
6426
|
})(Xn(t, _t), l, t, n);
|
|
6427
6427
|
}
|
|
6428
6428
|
const i = t.__format;
|
|
@@ -6430,9 +6430,9 @@ function Yn(r, e) {
|
|
|
6430
6430
|
} else {
|
|
6431
6431
|
const s = t.getTextContent();
|
|
6432
6432
|
if (me(t)) {
|
|
6433
|
-
const o = t.decorate(
|
|
6433
|
+
const o = t.decorate(Xe, Xt);
|
|
6434
6434
|
o !== null && Kl(r, o), n.contentEditable = "false";
|
|
6435
|
-
} else
|
|
6435
|
+
} else q(t) && (t.isDirectionless() || (Qe += s));
|
|
6436
6436
|
Re += s, Ot += s;
|
|
6437
6437
|
}
|
|
6438
6438
|
return e !== null && e.insertChild(n), Bi(fn, dn, ps, t, "created"), n;
|
|
@@ -6444,7 +6444,7 @@ function Xs(r, e, t, n, s) {
|
|
|
6444
6444
|
for (; i <= n; ++i) {
|
|
6445
6445
|
Yn(r[i], s);
|
|
6446
6446
|
const l = _t.get(r[i]);
|
|
6447
|
-
l !== null &&
|
|
6447
|
+
l !== null && q(l) && (St === null && (St = l.getFormat()), mt === "" && (mt = l.getStyle()));
|
|
6448
6448
|
}
|
|
6449
6449
|
fs(e) && (Re += Mt), s.element.__lexicalTextContent = Re, Re = o + Re;
|
|
6450
6450
|
}
|
|
@@ -6465,8 +6465,8 @@ function Gl(r, e, t) {
|
|
|
6465
6465
|
}
|
|
6466
6466
|
function Vl(r, e) {
|
|
6467
6467
|
const t = e.__lexicalDirTextContent || "", n = e.__lexicalDir || "";
|
|
6468
|
-
if (t !==
|
|
6469
|
-
const o =
|
|
6468
|
+
if (t !== Qe || n !== Rn) {
|
|
6469
|
+
const o = Qe === "", i = o ? Rn : (s = Qe, Uu.test(s) ? "rtl" : Wu.test(s) ? "ltr" : null);
|
|
6470
6470
|
if (i !== n) {
|
|
6471
6471
|
const l = e.classList, a = Xt.theme;
|
|
6472
6472
|
let u = n !== null ? a[n] : void 0, c = i !== null ? a[i] : void 0;
|
|
@@ -6490,14 +6490,14 @@ function Vl(r, e) {
|
|
|
6490
6490
|
}
|
|
6491
6491
|
hn || (r.getWritable().__dir = i);
|
|
6492
6492
|
}
|
|
6493
|
-
Rn = i, e.__lexicalDirTextContent =
|
|
6493
|
+
Rn = i, e.__lexicalDirTextContent = Qe, e.__lexicalDir = i;
|
|
6494
6494
|
}
|
|
6495
6495
|
var s;
|
|
6496
6496
|
}
|
|
6497
6497
|
function gc(r, e, t) {
|
|
6498
|
-
const n =
|
|
6498
|
+
const n = Qe;
|
|
6499
6499
|
var s;
|
|
6500
|
-
|
|
6500
|
+
Qe = "", St = null, mt = "", function(o, i, l) {
|
|
6501
6501
|
const a = Re, u = o.__size, c = i.__size;
|
|
6502
6502
|
Re = "";
|
|
6503
6503
|
const d = l.element;
|
|
@@ -6518,10 +6518,10 @@ function gc(r, e, t) {
|
|
|
6518
6518
|
Qn(f, null);
|
|
6519
6519
|
}
|
|
6520
6520
|
const g = _t.get(h);
|
|
6521
|
-
|
|
6521
|
+
q(g) && (St === null && (St = g.getFormat()), mt === "" && (mt = g.getStyle()));
|
|
6522
6522
|
} else {
|
|
6523
6523
|
const f = Xn(o, dr), h = Xn(i, _t);
|
|
6524
|
-
if (f.length !== u &&
|
|
6524
|
+
if (f.length !== u && z(227), h.length !== c && z(228), u === 0) c !== 0 && Xs(h, i, 0, c - 1, l);
|
|
6525
6525
|
else if (c === 0) {
|
|
6526
6526
|
if (u !== 0) {
|
|
6527
6527
|
const g = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
@@ -6529,25 +6529,25 @@ function gc(r, e, t) {
|
|
|
6529
6529
|
}
|
|
6530
6530
|
} else (function(g, m, y, C, x, A) {
|
|
6531
6531
|
const w = C - 1, E = x - 1;
|
|
6532
|
-
let v,
|
|
6532
|
+
let v, b, D = A.getFirstChild(), k = 0, M = 0;
|
|
6533
6533
|
for (; k <= w && M <= E; ) {
|
|
6534
6534
|
const L = m[k], j = y[M];
|
|
6535
6535
|
if (L === j) D = Ls(Jr(j, A.element)), k++, M++;
|
|
6536
6536
|
else {
|
|
6537
|
-
v === void 0 && (v = new Set(m)),
|
|
6538
|
-
const Y =
|
|
6537
|
+
v === void 0 && (v = new Set(m)), b === void 0 && (b = new Set(y));
|
|
6538
|
+
const Y = b.has(L), de = v.has(j);
|
|
6539
6539
|
if (Y) if (de) {
|
|
6540
|
-
const ie = Hn(
|
|
6540
|
+
const ie = Hn(Xe, j);
|
|
6541
6541
|
ie === D ? D = Ls(Jr(j, A.element)) : (A.withBefore(D).insertChild(ie), Jr(j, A.element)), k++, M++;
|
|
6542
6542
|
} else Yn(j, A.withBefore(D)), M++;
|
|
6543
6543
|
else D = Ls(Zs(L)), Qn(L, A.element), k++;
|
|
6544
6544
|
}
|
|
6545
6545
|
const R = _t.get(j);
|
|
6546
|
-
R !== null &&
|
|
6546
|
+
R !== null && q(R) && (St === null && (St = R.getFormat()), mt === "" && (mt = R.getStyle()));
|
|
6547
6547
|
}
|
|
6548
6548
|
const B = k > w, F = M > E;
|
|
6549
6549
|
if (B && !F) {
|
|
6550
|
-
const L = y[E + 1], j = L === void 0 ? null :
|
|
6550
|
+
const L = y[E + 1], j = L === void 0 ? null : Xe.getElementByKey(L);
|
|
6551
6551
|
Xs(y, g, M, E, A.withBefore(j));
|
|
6552
6552
|
} else F && !B && Ys(m, k, w, A.element);
|
|
6553
6553
|
})(i, f, h, u, c, l);
|
|
@@ -6555,78 +6555,78 @@ function gc(r, e, t) {
|
|
|
6555
6555
|
fs(i) && (Re += Mt), d.__lexicalTextContent = Re, Re = a + Re;
|
|
6556
6556
|
}(r, e, e.getDOMSlot(t)), Vl(e, t), Fr(s = e) && St != null && St !== s.__textFormat && !hn && (s.setTextFormat(St), s.setTextStyle(mt)), function(o) {
|
|
6557
6557
|
Fr(o) && mt !== "" && mt !== o.__textStyle && !hn && o.setTextStyle(mt);
|
|
6558
|
-
}(e),
|
|
6558
|
+
}(e), Qe = n;
|
|
6559
6559
|
}
|
|
6560
6560
|
function Xn(r, e) {
|
|
6561
6561
|
const t = [];
|
|
6562
6562
|
let n = r.__first;
|
|
6563
6563
|
for (; n !== null; ) {
|
|
6564
6564
|
const s = e.get(n);
|
|
6565
|
-
s === void 0 &&
|
|
6565
|
+
s === void 0 && z(101), t.push(n), n = s.__next;
|
|
6566
6566
|
}
|
|
6567
6567
|
return t;
|
|
6568
6568
|
}
|
|
6569
6569
|
function Jr(r, e) {
|
|
6570
6570
|
const t = dr.get(r);
|
|
6571
6571
|
let n = _t.get(r);
|
|
6572
|
-
t !== void 0 && n !== void 0 ||
|
|
6573
|
-
const s = ql || Js.has(r) || Hs.has(r), o = Hn(
|
|
6572
|
+
t !== void 0 && n !== void 0 || z(61);
|
|
6573
|
+
const s = ql || Js.has(r) || Hs.has(r), o = Hn(Xe, r);
|
|
6574
6574
|
if (t === n && !s) {
|
|
6575
6575
|
if (N(t)) {
|
|
6576
6576
|
const i = o.__lexicalTextContent;
|
|
6577
6577
|
i !== void 0 && (Re += i, Ot += i);
|
|
6578
6578
|
const l = o.__lexicalDirTextContent;
|
|
6579
|
-
l !== void 0 && (
|
|
6579
|
+
l !== void 0 && (Qe += l);
|
|
6580
6580
|
} else {
|
|
6581
6581
|
const i = t.getTextContent();
|
|
6582
|
-
|
|
6582
|
+
q(t) && !t.isDirectionless() && (Qe += i), Ot += i, Re += i;
|
|
6583
6583
|
}
|
|
6584
6584
|
return o;
|
|
6585
6585
|
}
|
|
6586
6586
|
if (t !== n && s && Bi(fn, dn, ps, n, "updated"), n.updateDOM(t, o, Xt)) {
|
|
6587
6587
|
const i = Yn(r, null);
|
|
6588
|
-
return e === null &&
|
|
6588
|
+
return e === null && z(62), e.replaceChild(i, o), Qn(r, null), i;
|
|
6589
6589
|
}
|
|
6590
6590
|
if (N(t) && N(n)) {
|
|
6591
6591
|
const i = n.__indent;
|
|
6592
6592
|
i !== t.__indent && Ul(o, i);
|
|
6593
6593
|
const l = n.__format;
|
|
6594
|
-
l !== t.__format && Wl(o, l), s && (gc(t, n, o),
|
|
6594
|
+
l !== t.__format && Wl(o, l), s && (gc(t, n, o), Ye(n) || n.isInline() || Gl(t, n, o)), fs(n) && (Re += Mt, Ot += Mt);
|
|
6595
6595
|
} else {
|
|
6596
6596
|
const i = n.getTextContent();
|
|
6597
6597
|
if (me(n)) {
|
|
6598
|
-
const l = n.decorate(
|
|
6598
|
+
const l = n.decorate(Xe, Xt);
|
|
6599
6599
|
l !== null && Kl(r, l);
|
|
6600
|
-
} else
|
|
6600
|
+
} else q(n) && !n.isDirectionless() && (Qe += i);
|
|
6601
6601
|
Re += i, Ot += i;
|
|
6602
6602
|
}
|
|
6603
|
-
if (!hn &&
|
|
6603
|
+
if (!hn && Ye(n) && n.__cachedText !== Ot) {
|
|
6604
6604
|
const i = n.getWritable();
|
|
6605
6605
|
i.__cachedText = Ot, n = i;
|
|
6606
6606
|
}
|
|
6607
6607
|
return o;
|
|
6608
6608
|
}
|
|
6609
6609
|
function Kl(r, e) {
|
|
6610
|
-
let t =
|
|
6611
|
-
const n =
|
|
6610
|
+
let t = Xe._pendingDecorators;
|
|
6611
|
+
const n = Xe._decorators;
|
|
6612
6612
|
if (t === null) {
|
|
6613
6613
|
if (n[r] === e) return;
|
|
6614
|
-
t = Pl(
|
|
6614
|
+
t = Pl(Xe);
|
|
6615
6615
|
}
|
|
6616
6616
|
t[r] = e;
|
|
6617
6617
|
}
|
|
6618
6618
|
function Ls(r) {
|
|
6619
6619
|
let e = r.nextSibling;
|
|
6620
|
-
return e !== null && e ===
|
|
6620
|
+
return e !== null && e === Xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6621
6621
|
}
|
|
6622
6622
|
function mc(r, e, t, n, s, o) {
|
|
6623
|
-
Re = "", Ot = "",
|
|
6623
|
+
Re = "", Ot = "", Qe = "", ql = n === Br, Rn = null, Xe = t, Xt = t._config, dn = t._nodes, ps = Xe._listeners.mutation, Hs = s, Js = o, dr = r._nodeMap, _t = e._nodeMap, hn = e._readOnly, Qs = new Map(t._keyToDOMMap);
|
|
6624
6624
|
const i = /* @__PURE__ */ new Map();
|
|
6625
|
-
return fn = i, Jr("root", null),
|
|
6625
|
+
return fn = i, Jr("root", null), Xe = void 0, dn = void 0, Hs = void 0, Js = void 0, dr = void 0, _t = void 0, Xt = void 0, Qs = void 0, fn = void 0, i;
|
|
6626
6626
|
}
|
|
6627
6627
|
function Zs(r) {
|
|
6628
6628
|
const e = Qs.get(r);
|
|
6629
|
-
return e === void 0 &&
|
|
6629
|
+
return e === void 0 && z(75, r), e;
|
|
6630
6630
|
}
|
|
6631
6631
|
const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
6632
6632
|
if (rn = r.timeStamp, Hl = r.key, e.isComposing()) return;
|
|
@@ -6727,7 +6727,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6727
6727
|
const t = V();
|
|
6728
6728
|
if (O(t) && !e.isComposing()) {
|
|
6729
6729
|
const n = t.anchor, s = t.anchor.getNode();
|
|
6730
|
-
We(n.key), (r.timeStamp < rn + ei || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format ||
|
|
6730
|
+
We(n.key), (r.timeStamp < rn + ei || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || q(s) && s.getStyle() !== t.style) && U(e, Sr, qu);
|
|
6731
6731
|
}
|
|
6732
6732
|
});
|
|
6733
6733
|
}], ["compositionend", function(r, e) {
|
|
@@ -6742,7 +6742,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6742
6742
|
const o = t.anchor.getNode(), i = ut(e._window);
|
|
6743
6743
|
if (i === null) return;
|
|
6744
6744
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, u = l ? t.focus.offset : t.anchor.offset;
|
|
6745
|
-
zn && !t.isCollapsed() &&
|
|
6745
|
+
zn && !t.isCollapsed() && q(o) && i.anchorNode !== null && o.getTextContent().slice(0, a) + n + o.getTextContent().slice(a + u) === Il(i.anchorNode) || U(e, Sr, n);
|
|
6746
6746
|
const c = n.length;
|
|
6747
6747
|
Yt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), as || gn || mi || !e.isComposing() || (rn = 0, We(null));
|
|
6748
6748
|
} else
|
|
@@ -6755,7 +6755,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6755
6755
|
if (n) {
|
|
6756
6756
|
if (O(t)) {
|
|
6757
6757
|
const o = t.anchor, i = o.getNode();
|
|
6758
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !
|
|
6758
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !Ye(i) && Ee().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (N(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6759
6759
|
} else if (r.pointerType === "touch") {
|
|
6760
6760
|
const o = n.anchorNode;
|
|
6761
6761
|
if (o !== null) {
|
|
@@ -6786,7 +6786,7 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6786
6786
|
});
|
|
6787
6787
|
}, ei), O(i)) {
|
|
6788
6788
|
const g = i.anchor.getNode();
|
|
6789
|
-
g.markDirty(), i.format = g.getFormat(),
|
|
6789
|
+
g.markDirty(), i.format = g.getFormat(), q(g) || z(142), i.style = g.getStyle();
|
|
6790
6790
|
}
|
|
6791
6791
|
} else {
|
|
6792
6792
|
We(null), t.preventDefault();
|
|
@@ -6799,7 +6799,7 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6799
6799
|
var l;
|
|
6800
6800
|
if (!O(i)) return;
|
|
6801
6801
|
const a = t.data;
|
|
6802
|
-
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() ||
|
|
6802
|
+
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() || Ye(i.anchor.getNode()) || o === null || i.applyDOMRange(o), Cr = null;
|
|
6803
6803
|
const u = i.anchor, c = i.focus, d = u.getNode(), f = c.getNode();
|
|
6804
6804
|
if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
|
|
6805
6805
|
case "insertFromYank":
|
|
@@ -6882,7 +6882,7 @@ const Zn = /* @__PURE__ */ new WeakMap();
|
|
|
6882
6882
|
let ri = !1, ni = !1, nn = !1, Gr = !1, Ql = [0, "", 0, "root", 0];
|
|
6883
6883
|
function Yl(r, e, t, n, s) {
|
|
6884
6884
|
const o = r.anchor, i = r.focus, l = o.getNode(), a = Be(), u = ut(a._window), c = u !== null ? u.anchorNode : null, d = o.key, f = a.getElementByKey(d), h = t.length;
|
|
6885
|
-
return d !== i.key || !
|
|
6885
|
+
return d !== i.key || !q(l) || (!s && (!zn || Jl < n + 50) || l.isDirty() && h < 2 || Ol(t)) && o.offset !== i.offset && !l.isComposing() || sr(l) || l.isDirty() && h > 1 || (s || !zn) && f !== null && !l.isComposing() && c !== Gn(f) || u !== null && e !== null && (!e.collapsed || e.startContainer !== u.anchorNode || e.startOffset !== u.anchorOffset) || l.getFormat() !== r.format || l.getStyle() !== r.style || ic(r, l);
|
|
6886
6886
|
}
|
|
6887
6887
|
function ho(r, e) {
|
|
6888
6888
|
return r !== null && r.nodeValue !== null && r.nodeType === Zt && e !== 0 && e !== r.nodeValue.length;
|
|
@@ -6899,7 +6899,7 @@ function po(r, e, t) {
|
|
|
6899
6899
|
r.type === "Range" && r.anchorNode === r.focusNode && (l.dirty = !0);
|
|
6900
6900
|
const c = hs(e).event, d = c ? c.timeStamp : performance.now(), [f, h, g, m, y] = Ql, C = Ee(), x = e.isComposing() === !1 && C.getTextContent() === "";
|
|
6901
6901
|
if (d < y + 200 && a.offset === g && a.key === m) l.format = f, l.style = h;
|
|
6902
|
-
else if (a.type === "text")
|
|
6902
|
+
else if (a.type === "text") q(u) || z(141), l.format = u.getFormat(), l.style = u.getStyle();
|
|
6903
6903
|
else if (a.type === "element" && !x) {
|
|
6904
6904
|
const A = a.getNode();
|
|
6905
6905
|
l.style = "", A instanceof Pr && A.getChildrenSize() === 0 ? (l.format = A.getTextFormat(), l.style = A.getTextStyle()) : l.format = 0;
|
|
@@ -6908,8 +6908,8 @@ function po(r, e, t) {
|
|
|
6908
6908
|
const c = a.key, d = l.focus.key, f = l.getNodes(), h = f.length, g = l.isBackward(), m = g ? i : s, y = g ? s : i, C = g ? d : c, x = g ? c : d;
|
|
6909
6909
|
let A = zu, w = !1;
|
|
6910
6910
|
for (let E = 0; E < h; E++) {
|
|
6911
|
-
const v = f[E],
|
|
6912
|
-
if (
|
|
6911
|
+
const v = f[E], b = v.getTextContentSize();
|
|
6912
|
+
if (q(v) && b !== 0 && !(E === 0 && v.__key === C && m === b || E === h - 1 && v.__key === x && y === 0) && (w = !0, A &= v.getFormat(), A === 0)) break;
|
|
6913
6913
|
}
|
|
6914
6914
|
l.format = w ? A : 0;
|
|
6915
6915
|
}
|
|
@@ -6927,7 +6927,7 @@ function Ps(r, e) {
|
|
|
6927
6927
|
if (We(null), t !== null && e != null) {
|
|
6928
6928
|
if (e === "") {
|
|
6929
6929
|
const n = Ve(t), s = Gn(r.getElementByKey(t));
|
|
6930
|
-
return void (s !== null && s.nodeValue !== null &&
|
|
6930
|
+
return void (s !== null && s.nodeValue !== null && q(n) && Ti(n, s.nodeValue, null, null, !0));
|
|
6931
6931
|
}
|
|
6932
6932
|
if (e[e.length - 1] === `
|
|
6933
6933
|
`) {
|
|
@@ -6967,16 +6967,16 @@ function mo(r) {
|
|
|
6967
6967
|
}
|
|
6968
6968
|
function yc(r) {
|
|
6969
6969
|
const e = r.ownerDocument, t = Zn.get(e);
|
|
6970
|
-
t === void 0 &&
|
|
6970
|
+
t === void 0 && z(162);
|
|
6971
6971
|
const n = t - 1;
|
|
6972
|
-
n >= 0 ||
|
|
6972
|
+
n >= 0 || z(164), Zn.set(e, n), n === 0 && e.removeEventListener("selectionchange", ea);
|
|
6973
6973
|
const s = cs(r);
|
|
6974
6974
|
Ei(s) ? (function(i) {
|
|
6975
6975
|
if (i._parentEditor !== null) {
|
|
6976
6976
|
const l = Si(i), a = l[l.length - 1]._key;
|
|
6977
6977
|
kr.get(a) === i && kr.delete(a);
|
|
6978
6978
|
} else kr.delete(i._key);
|
|
6979
|
-
}(s), r.__lexicalEditor = null) : s &&
|
|
6979
|
+
}(s), r.__lexicalEditor = null) : s && z(198);
|
|
6980
6980
|
const o = Zl(r);
|
|
6981
6981
|
for (let i = 0; i < o.length; i++) o[i]();
|
|
6982
6982
|
r.__lexicalEventHandles = [];
|
|
@@ -7000,14 +7000,14 @@ function si(r, e, t) {
|
|
|
7000
7000
|
const l = r.getIndexWithinParent();
|
|
7001
7001
|
lr(r), es(o, s, l, -1);
|
|
7002
7002
|
} else lr(r);
|
|
7003
|
-
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e &&
|
|
7003
|
+
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e && Ye(s) && s.isEmpty() && s.selectEnd();
|
|
7004
7004
|
}
|
|
7005
7005
|
class gs {
|
|
7006
7006
|
static getType() {
|
|
7007
|
-
|
|
7007
|
+
z(64, this.name);
|
|
7008
7008
|
}
|
|
7009
7009
|
static clone(e) {
|
|
7010
|
-
|
|
7010
|
+
z(65, this.name);
|
|
7011
7011
|
}
|
|
7012
7012
|
afterCloneFrom(e) {
|
|
7013
7013
|
this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev;
|
|
@@ -7019,7 +7019,7 @@ class gs {
|
|
|
7019
7019
|
return this.__type;
|
|
7020
7020
|
}
|
|
7021
7021
|
isInline() {
|
|
7022
|
-
|
|
7022
|
+
z(137, this.constructor.name);
|
|
7023
7023
|
}
|
|
7024
7024
|
isAttached() {
|
|
7025
7025
|
let e = this.__key;
|
|
@@ -7035,7 +7035,7 @@ class gs {
|
|
|
7035
7035
|
const t = e || V();
|
|
7036
7036
|
if (t == null) return !1;
|
|
7037
7037
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
7038
|
-
if (
|
|
7038
|
+
if (q(this)) return n;
|
|
7039
7039
|
if (O(t) && t.anchor.type === "element" && t.focus.type === "element") {
|
|
7040
7040
|
if (t.isCollapsed()) return !1;
|
|
7041
7041
|
const s = this.getParent();
|
|
@@ -7065,20 +7065,20 @@ class gs {
|
|
|
7065
7065
|
}
|
|
7066
7066
|
getParentOrThrow() {
|
|
7067
7067
|
const e = this.getParent();
|
|
7068
|
-
return e === null &&
|
|
7068
|
+
return e === null && z(66, this.__key), e;
|
|
7069
7069
|
}
|
|
7070
7070
|
getTopLevelElement() {
|
|
7071
7071
|
let e = this;
|
|
7072
7072
|
for (; e !== null; ) {
|
|
7073
7073
|
const t = e.getParent();
|
|
7074
|
-
if (Ft(t)) return N(e) || e === this && me(e) ||
|
|
7074
|
+
if (Ft(t)) return N(e) || e === this && me(e) || z(194), e;
|
|
7075
7075
|
e = t;
|
|
7076
7076
|
}
|
|
7077
7077
|
return null;
|
|
7078
7078
|
}
|
|
7079
7079
|
getTopLevelElementOrThrow() {
|
|
7080
7080
|
const e = this.getTopLevelElement();
|
|
7081
|
-
return e === null &&
|
|
7081
|
+
return e === null && z(67, this.__key), e;
|
|
7082
7082
|
}
|
|
7083
7083
|
getParents() {
|
|
7084
7084
|
const e = [];
|
|
@@ -7182,7 +7182,7 @@ class gs {
|
|
|
7182
7182
|
if (s.has(u.__key) || n.push(u), u === e) break;
|
|
7183
7183
|
let c = null, d = u;
|
|
7184
7184
|
do {
|
|
7185
|
-
if (d === null &&
|
|
7185
|
+
if (d === null && z(68), c = t ? d.getNextSibling() : d.getPreviousSibling(), d = d.getParent(), d === null) break;
|
|
7186
7186
|
c !== null || s.has(d.__key) || n.push(d);
|
|
7187
7187
|
} while (c === null);
|
|
7188
7188
|
o = c;
|
|
@@ -7195,7 +7195,7 @@ class gs {
|
|
|
7195
7195
|
}
|
|
7196
7196
|
getLatest() {
|
|
7197
7197
|
const e = Ve(this.__key);
|
|
7198
|
-
return e === null &&
|
|
7198
|
+
return e === null && z(113), e;
|
|
7199
7199
|
}
|
|
7200
7200
|
getWritable() {
|
|
7201
7201
|
et();
|
|
@@ -7211,19 +7211,19 @@ class gs {
|
|
|
7211
7211
|
return this.getTextContent().length;
|
|
7212
7212
|
}
|
|
7213
7213
|
createDOM(e, t) {
|
|
7214
|
-
|
|
7214
|
+
z(70);
|
|
7215
7215
|
}
|
|
7216
7216
|
updateDOM(e, t, n) {
|
|
7217
|
-
|
|
7217
|
+
z(71);
|
|
7218
7218
|
}
|
|
7219
7219
|
exportDOM(e) {
|
|
7220
7220
|
return { element: this.createDOM(e._config, e) };
|
|
7221
7221
|
}
|
|
7222
7222
|
exportJSON() {
|
|
7223
|
-
|
|
7223
|
+
z(72);
|
|
7224
7224
|
}
|
|
7225
7225
|
static importJSON(e) {
|
|
7226
|
-
|
|
7226
|
+
z(18, this.name);
|
|
7227
7227
|
}
|
|
7228
7228
|
static transform() {
|
|
7229
7229
|
return null;
|
|
@@ -7238,7 +7238,7 @@ class gs {
|
|
|
7238
7238
|
const s = this.getLatest(), o = this.__key, i = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), u = a.__size;
|
|
7239
7239
|
lr(l);
|
|
7240
7240
|
const c = s.getPreviousSibling(), d = s.getNextSibling(), f = s.__prev, h = s.__next, g = s.__parent;
|
|
7241
|
-
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) ||
|
|
7241
|
+
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) || z(139), this.getChildren().forEach((m) => {
|
|
7242
7242
|
l.append(m);
|
|
7243
7243
|
})), O(n)) {
|
|
7244
7244
|
Nt(n);
|
|
@@ -7293,7 +7293,7 @@ class gs {
|
|
|
7293
7293
|
const n = this.getPreviousSibling(), s = this.getParentOrThrow();
|
|
7294
7294
|
if (n === null) return s.select(0, 0);
|
|
7295
7295
|
if (N(n)) return n.select();
|
|
7296
|
-
if (!
|
|
7296
|
+
if (!q(n)) {
|
|
7297
7297
|
const o = n.getIndexWithinParent() + 1;
|
|
7298
7298
|
return s.select(o, o);
|
|
7299
7299
|
}
|
|
@@ -7304,7 +7304,7 @@ class gs {
|
|
|
7304
7304
|
const n = this.getNextSibling(), s = this.getParentOrThrow();
|
|
7305
7305
|
if (n === null) return s.select();
|
|
7306
7306
|
if (N(n)) return n.select(0, 0);
|
|
7307
|
-
if (!
|
|
7307
|
+
if (!q(n)) {
|
|
7308
7308
|
const o = n.getIndexWithinParent();
|
|
7309
7309
|
return s.select(o, o);
|
|
7310
7310
|
}
|
|
@@ -7497,12 +7497,12 @@ class Lr extends gs {
|
|
|
7497
7497
|
if ((l === null ? u : l) !== (a === null ? c : a)) return !0;
|
|
7498
7498
|
if (l === a && u !== c) {
|
|
7499
7499
|
const m = t.firstChild;
|
|
7500
|
-
m == null &&
|
|
7500
|
+
m == null && z(48);
|
|
7501
7501
|
const y = document.createElement(c);
|
|
7502
7502
|
return yo(y, this, 0, i, s, n), t.replaceChild(y, m), !1;
|
|
7503
7503
|
}
|
|
7504
7504
|
let d = t;
|
|
7505
|
-
a !== null && l !== null && (d = t.firstChild, d == null &&
|
|
7505
|
+
a !== null && l !== null && (d = t.firstChild, d == null && z(49)), ra(s, d, this);
|
|
7506
7506
|
const f = n.theme.text;
|
|
7507
7507
|
f !== void 0 && o !== i && ta(0, o, i, d, f);
|
|
7508
7508
|
const h = e.__style, g = this.__style;
|
|
@@ -7517,7 +7517,7 @@ class Lr extends gs {
|
|
|
7517
7517
|
}
|
|
7518
7518
|
exportDOM(e) {
|
|
7519
7519
|
let { element: t } = super.exportDOM(e);
|
|
7520
|
-
return t !== null && It(t) ||
|
|
7520
|
+
return t !== null && It(t) || z(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (t = Nn(t, "b")), this.hasFormat("italic") && (t = Nn(t, "i")), this.hasFormat("strikethrough") && (t = Nn(t, "s")), this.hasFormat("underline") && (t = Nn(t, "u")), { element: t };
|
|
7521
7521
|
}
|
|
7522
7522
|
exportJSON() {
|
|
7523
7523
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), type: "text", version: 1 };
|
|
@@ -7616,9 +7616,9 @@ class Lr extends gs {
|
|
|
7616
7616
|
const x = V(), A = [h];
|
|
7617
7617
|
let w = d.length;
|
|
7618
7618
|
for (let E = 1; E < c; E++) {
|
|
7619
|
-
const v = l[E],
|
|
7619
|
+
const v = l[E], b = v.length, D = Pe(v).getWritable();
|
|
7620
7620
|
D.__format = g, D.__style = m, D.__detail = y;
|
|
7621
|
-
const k = D.__key, M = w +
|
|
7621
|
+
const k = D.__key, M = w + b;
|
|
7622
7622
|
if (O(x)) {
|
|
7623
7623
|
const B = x.anchor, F = x.focus;
|
|
7624
7624
|
B.key === s && B.type === "text" && B.offset > w && B.offset <= M && (B.key = k, B.offset -= w, x.dirty = !0), F.key === s && F.type === "text" && F.offset > w && F.offset <= M && (F.key = k, F.offset -= w, x.dirty = !0);
|
|
@@ -7626,8 +7626,8 @@ class Lr extends gs {
|
|
|
7626
7626
|
o === s && We(k), w = M, A.push(D);
|
|
7627
7627
|
}
|
|
7628
7628
|
if (f !== null) {
|
|
7629
|
-
(function(
|
|
7630
|
-
const D =
|
|
7629
|
+
(function(b) {
|
|
7630
|
+
const D = b.getPreviousSibling(), k = b.getNextSibling();
|
|
7631
7631
|
D !== null && Kn(D), k !== null && Kn(k);
|
|
7632
7632
|
})(this);
|
|
7633
7633
|
const E = f.getWritable(), v = this.getIndexWithinParent();
|
|
@@ -7637,7 +7637,7 @@ class Lr extends gs {
|
|
|
7637
7637
|
}
|
|
7638
7638
|
mergeWithSibling(e) {
|
|
7639
7639
|
const t = e === this.getPreviousSibling();
|
|
7640
|
-
t || e === this.getNextSibling() ||
|
|
7640
|
+
t || e === this.getNextSibling() || z(50);
|
|
7641
7641
|
const n = this.__key, s = e.__key, o = this.__text, i = o.length;
|
|
7642
7642
|
Ht() === s && We(n);
|
|
7643
7643
|
const l = V();
|
|
@@ -7667,7 +7667,7 @@ function vc(r) {
|
|
|
7667
7667
|
}
|
|
7668
7668
|
function wc(r) {
|
|
7669
7669
|
const e = r;
|
|
7670
|
-
r.parentElement === null &&
|
|
7670
|
+
r.parentElement === null && z(129);
|
|
7671
7671
|
let t = e.textContent || "";
|
|
7672
7672
|
if (function(n) {
|
|
7673
7673
|
let s, o = n.parentNode;
|
|
@@ -7736,12 +7736,12 @@ function Gt(r) {
|
|
|
7736
7736
|
function Pe(r = "") {
|
|
7737
7737
|
return Lt(new Lr(r));
|
|
7738
7738
|
}
|
|
7739
|
-
function
|
|
7739
|
+
function q(r) {
|
|
7740
7740
|
return r instanceof Lr;
|
|
7741
7741
|
}
|
|
7742
7742
|
function Li(r, e) {
|
|
7743
7743
|
const t = r.fontWeight, n = r.textDecoration.split(" "), s = t === "700" || t === "bold", o = n.includes("line-through"), i = r.fontStyle === "italic", l = n.includes("underline"), a = r.verticalAlign;
|
|
7744
|
-
return (u) => (
|
|
7744
|
+
return (u) => (q(u) && (s && !u.hasFormat("bold") && u.toggleFormat("bold"), o && !u.hasFormat("strikethrough") && u.toggleFormat("strikethrough"), i && !u.hasFormat("italic") && u.toggleFormat("italic"), l && !u.hasFormat("underline") && u.toggleFormat("underline"), a !== "sub" || u.hasFormat("subscript") || u.toggleFormat("subscript"), a !== "super" || u.hasFormat("superscript") || u.toggleFormat("superscript"), e && !u.hasFormat(e) && u.toggleFormat(e)), u);
|
|
7745
7745
|
}
|
|
7746
7746
|
class _n extends Lr {
|
|
7747
7747
|
static getType() {
|
|
@@ -7767,13 +7767,13 @@ class _n extends Lr {
|
|
|
7767
7767
|
return { ...super.exportJSON(), type: "tab", version: 1 };
|
|
7768
7768
|
}
|
|
7769
7769
|
setTextContent(e) {
|
|
7770
|
-
|
|
7770
|
+
z(126);
|
|
7771
7771
|
}
|
|
7772
7772
|
setDetail(e) {
|
|
7773
|
-
|
|
7773
|
+
z(127);
|
|
7774
7774
|
}
|
|
7775
7775
|
setMode(e) {
|
|
7776
|
-
|
|
7776
|
+
z(128);
|
|
7777
7777
|
}
|
|
7778
7778
|
canInsertTextBefore() {
|
|
7779
7779
|
return !1;
|
|
@@ -7810,7 +7810,7 @@ class Ac {
|
|
|
7810
7810
|
}
|
|
7811
7811
|
getNode() {
|
|
7812
7812
|
const e = Ve(this.key);
|
|
7813
|
-
return e === null &&
|
|
7813
|
+
return e === null && z(20), e;
|
|
7814
7814
|
}
|
|
7815
7815
|
set(e, t, n) {
|
|
7816
7816
|
const s = this._selection, o = this.key;
|
|
@@ -7822,13 +7822,13 @@ function jt(r, e, t) {
|
|
|
7822
7822
|
}
|
|
7823
7823
|
function Ms(r, e) {
|
|
7824
7824
|
let t = e.__key, n = r.offset, s = "element";
|
|
7825
|
-
if (
|
|
7825
|
+
if (q(e)) {
|
|
7826
7826
|
s = "text";
|
|
7827
7827
|
const o = e.getTextContentSize();
|
|
7828
7828
|
n > o && (n = o);
|
|
7829
7829
|
} else if (!N(e)) {
|
|
7830
7830
|
const o = e.getNextSibling();
|
|
7831
|
-
if (
|
|
7831
|
+
if (q(o)) t = o.__key, n = 0, s = "text";
|
|
7832
7832
|
else {
|
|
7833
7833
|
const i = e.getParent();
|
|
7834
7834
|
i && (t = i.__key, n = e.getIndexWithinParent() + 1);
|
|
@@ -7839,7 +7839,7 @@ function Ms(r, e) {
|
|
|
7839
7839
|
function _o(r, e) {
|
|
7840
7840
|
if (N(e)) {
|
|
7841
7841
|
const t = e.getLastDescendant();
|
|
7842
|
-
N(t) ||
|
|
7842
|
+
N(t) || q(t) ? Ms(r, t) : Ms(r, e);
|
|
7843
7843
|
} else Ms(r, e);
|
|
7844
7844
|
}
|
|
7845
7845
|
function Kt(r, e, t, n) {
|
|
@@ -7894,7 +7894,7 @@ class ms {
|
|
|
7894
7894
|
insertNodes(e) {
|
|
7895
7895
|
const t = this.getNodes(), n = t.length, s = t[n - 1];
|
|
7896
7896
|
let o;
|
|
7897
|
-
if (
|
|
7897
|
+
if (q(s)) o = s.select();
|
|
7898
7898
|
else {
|
|
7899
7899
|
const i = s.getIndexWithinParent() + 1;
|
|
7900
7900
|
o = s.getParentOrThrow().select(i, i);
|
|
@@ -7967,7 +7967,7 @@ class er {
|
|
|
7967
7967
|
const f = e[d];
|
|
7968
7968
|
if (N(f) && !f.isInline()) c || (u += `
|
|
7969
7969
|
`), c = !f.isEmpty();
|
|
7970
|
-
else if (c = !1,
|
|
7970
|
+
else if (c = !1, q(f)) {
|
|
7971
7971
|
let h = f.getTextContent();
|
|
7972
7972
|
f === t ? f === n ? s.type === "element" && o.type === "element" && o.offset !== s.offset || (h = l < a ? h.slice(l, a) : h.slice(a, l)) : h = i ? h.slice(l) : h.slice(a) : f === n && (h = i ? h.slice(0, a) : h.slice(0, l)), u += h;
|
|
7973
7973
|
} else !me(f) && !ar(f) || f === n && this.isCollapsed() || (u += f.getTextContent());
|
|
@@ -8008,22 +8008,22 @@ class er {
|
|
|
8008
8008
|
const t = this.anchor, n = this.focus, s = this.format, o = this.style;
|
|
8009
8009
|
let i = t, l = n;
|
|
8010
8010
|
!this.isCollapsed() && n.isBefore(t) && (i = n, l = t), i.type === "element" && function(y, C, x, A) {
|
|
8011
|
-
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(),
|
|
8012
|
-
v.setFormat(x), v.setStyle(A), E === null ? w.append(
|
|
8011
|
+
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(), b = Ye(w) ? Le().append(v) : v;
|
|
8012
|
+
v.setFormat(x), v.setStyle(A), E === null ? w.append(b) : E.insertBefore(b), y.is(C) && C.set(v.__key, 0, "text"), y.set(v.__key, 0, "text");
|
|
8013
8013
|
}(i, l, s, o);
|
|
8014
8014
|
const a = i.offset;
|
|
8015
8015
|
let u = l.offset;
|
|
8016
8016
|
const c = this.getNodes(), d = c.length;
|
|
8017
8017
|
let f = c[0];
|
|
8018
|
-
|
|
8018
|
+
q(f) || z(26);
|
|
8019
8019
|
const h = f.getTextContent().length, g = f.getParentOrThrow();
|
|
8020
8020
|
let m = c[d - 1];
|
|
8021
8021
|
if (d === 1 && l.type === "element" && (u = h, l.set(i.key, u, "text")), this.isCollapsed() && a === h && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !g.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
8022
8022
|
let y = f.getNextSibling();
|
|
8023
|
-
if (
|
|
8023
|
+
if (q(y) && y.canInsertTextBefore() && !sr(y) || (y = Pe(), y.setFormat(s), y.setStyle(o), g.canInsertTextAfter() ? f.insertAfter(y) : g.insertAfter(y)), y.select(0, 0), f = y, e !== "") return void this.insertText(e);
|
|
8024
8024
|
} else if (this.isCollapsed() && a === 0 && (f.isSegmented() || f.isToken() || !f.canInsertTextBefore() || !g.canInsertTextBefore() && f.getPreviousSibling() === null)) {
|
|
8025
8025
|
let y = f.getPreviousSibling();
|
|
8026
|
-
if (
|
|
8026
|
+
if (q(y) && !sr(y) || (y = Pe(), y.setFormat(s), g.canInsertTextBefore() ? f.insertBefore(y) : g.insertBefore(y)), y.select(), f = y, e !== "") return void this.insertText(e);
|
|
8027
8027
|
} else if (f.isSegmented() && a !== h) {
|
|
8028
8028
|
const y = Pe(f.getTextContent());
|
|
8029
8029
|
y.setFormat(s), f.replace(y), f = y;
|
|
@@ -8062,22 +8062,22 @@ class er {
|
|
|
8062
8062
|
if (!C.is(x) && x.isInline()) do
|
|
8063
8063
|
A = x, x = x.getParentOrThrow();
|
|
8064
8064
|
while (x.isInline());
|
|
8065
|
-
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (
|
|
8065
|
+
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (q(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
8066
8066
|
if (m.isSegmented()) {
|
|
8067
8067
|
const D = Pe(m.getTextContent());
|
|
8068
8068
|
m.replace(D), m = D;
|
|
8069
8069
|
}
|
|
8070
|
-
|
|
8070
|
+
Ye(l.getNode()) || l.type !== "text" || (m = m.spliceText(0, u, "")), y.add(m.__key);
|
|
8071
8071
|
} else {
|
|
8072
8072
|
const D = m.getParentOrThrow();
|
|
8073
8073
|
D.canBeEmpty() || D.getChildrenSize() !== 1 ? m.remove() : D.remove();
|
|
8074
8074
|
}
|
|
8075
8075
|
else y.add(m.__key);
|
|
8076
|
-
const w = x.getChildren(), E = new Set(c), v = C.is(x),
|
|
8076
|
+
const w = x.getChildren(), E = new Set(c), v = C.is(x), b = C.isInline() && f.getNextSibling() === null ? C : f;
|
|
8077
8077
|
for (let D = w.length - 1; D >= 0; D--) {
|
|
8078
8078
|
const k = w[D];
|
|
8079
8079
|
if (k.is(f) || N(k) && k.isParentOf(f)) break;
|
|
8080
|
-
k.isAttached() && (!E.has(k) || k.is(A) ? v ||
|
|
8080
|
+
k.isAttached() && (!E.has(k) || k.is(A) ? v || b.insertAfter(k, !1) : k.remove());
|
|
8081
8081
|
}
|
|
8082
8082
|
if (!v) {
|
|
8083
8083
|
let D = x, k = null;
|
|
@@ -8103,7 +8103,7 @@ class er {
|
|
|
8103
8103
|
const { anchor: e, focus: t } = this, n = this.getNodes(), s = this.isBackward() ? t : e, o = this.isBackward() ? e : t;
|
|
8104
8104
|
let i = s.getNode(), l = o.getNode();
|
|
8105
8105
|
const a = Wr(i, Vt), u = Wr(l, Vt);
|
|
8106
|
-
|
|
8106
|
+
q(i) && i.isToken() && s.offset < i.getTextContentSize() && (s.offset = 0), o.offset > 0 && q(l) && l.isToken() && (o.offset = l.getTextContentSize()), n.forEach((d) => {
|
|
8107
8107
|
tn(i, d) || tn(l, d) || d.getKey() === i.getKey() || d.getKey() === l.getKey() || d.remove();
|
|
8108
8108
|
});
|
|
8109
8109
|
const c = (d, f) => {
|
|
@@ -8113,20 +8113,20 @@ class er {
|
|
|
8113
8113
|
return h.setFormat(d.getFormat()), h.setStyle(d.getStyle()), d.replace(h);
|
|
8114
8114
|
}
|
|
8115
8115
|
};
|
|
8116
|
-
if (i === l &&
|
|
8116
|
+
if (i === l && q(i)) {
|
|
8117
8117
|
const d = Math.abs(t.offset - e.offset);
|
|
8118
8118
|
return i.spliceText(s.offset, d, "", !0), void c(i, d);
|
|
8119
8119
|
}
|
|
8120
|
-
if (
|
|
8120
|
+
if (q(i)) {
|
|
8121
8121
|
const d = i.getTextContentSize() - s.offset;
|
|
8122
8122
|
i.spliceText(s.offset, d, ""), i = c(i, d) || i;
|
|
8123
8123
|
}
|
|
8124
|
-
|
|
8124
|
+
q(l) && (l.spliceText(0, o.offset, ""), l = c(l, o.offset) || l), i.isAttached() && q(i) ? i.selectEnd() : l.isAttached() && q(l) && l.selectStart(), N(a) && N(u) && a !== u && (a.append(...u.getChildren()), u.remove(), o.set(s.key, s.offset, s.type));
|
|
8125
8125
|
}
|
|
8126
8126
|
formatText(e, t = null) {
|
|
8127
8127
|
if (this.isCollapsed()) return this.toggleFormat(e), void We(null);
|
|
8128
8128
|
const n = this.getNodes(), s = [];
|
|
8129
|
-
for (const w of n)
|
|
8129
|
+
for (const w of n) q(w) && s.push(w);
|
|
8130
8130
|
const o = (w) => {
|
|
8131
8131
|
n.forEach((E) => {
|
|
8132
8132
|
if (Fr(E)) {
|
|
@@ -8167,7 +8167,7 @@ class er {
|
|
|
8167
8167
|
if (this.anchor.key === "root") {
|
|
8168
8168
|
this.insertParagraph();
|
|
8169
8169
|
const g = V();
|
|
8170
|
-
return O(g) ||
|
|
8170
|
+
return O(g) || z(134), g.insertNodes(e);
|
|
8171
8171
|
}
|
|
8172
8172
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = Wr(t, Vt), s = e[e.length - 1];
|
|
8173
8173
|
if (N(n) && "__language" in n) {
|
|
@@ -8179,7 +8179,7 @@ class er {
|
|
|
8179
8179
|
return;
|
|
8180
8180
|
}
|
|
8181
8181
|
if (!e.some((g) => (N(g) || me(g)) && !g.isInline())) {
|
|
8182
|
-
N(n) ||
|
|
8182
|
+
N(n) || z(211, t.constructor.name, t.getType());
|
|
8183
8183
|
const g = Is(this);
|
|
8184
8184
|
return n.splice(g, 0, e), void s.selectEnd();
|
|
8185
8185
|
}
|
|
@@ -8188,7 +8188,7 @@ class er {
|
|
|
8188
8188
|
let y = null;
|
|
8189
8189
|
for (let C = 0; C < g.length; C++) {
|
|
8190
8190
|
const x = g[C], A = ar(x);
|
|
8191
|
-
if (A || me(x) && x.isInline() || N(x) && x.isInline() ||
|
|
8191
|
+
if (A || me(x) && x.isInline() || N(x) && x.isInline() || q(x) || x.isParentRequired()) {
|
|
8192
8192
|
if (y === null && (y = x.createParentElementNode(), m.append(y), A)) continue;
|
|
8193
8193
|
y !== null && y.append(x);
|
|
8194
8194
|
} else m.append(x), y = null;
|
|
@@ -8197,11 +8197,11 @@ class er {
|
|
|
8197
8197
|
}(e), i = o.getLastDescendant(), l = o.getChildren(), a = !N(n) || !n.isEmpty() ? this.insertParagraph() : null, u = l[l.length - 1];
|
|
8198
8198
|
let c = l[0];
|
|
8199
8199
|
var d;
|
|
8200
|
-
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) ||
|
|
8200
|
+
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) || z(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = l[1]), c && (n === null && z(212, t.constructor.name, t.getType()), function(g, m, y) {
|
|
8201
8201
|
const C = m.getParentOrThrow().getLastChild();
|
|
8202
8202
|
let x = m;
|
|
8203
8203
|
const A = [m];
|
|
8204
|
-
for (; x !== C; ) x.getNextSibling() ||
|
|
8204
|
+
for (; x !== C; ) x.getNextSibling() || z(140), x = x.getNextSibling(), A.push(x);
|
|
8205
8205
|
let w = g;
|
|
8206
8206
|
for (const E of A) w = w.insertAfter(E);
|
|
8207
8207
|
}(n, c));
|
|
@@ -8216,7 +8216,7 @@ class er {
|
|
|
8216
8216
|
return Ee().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8217
8217
|
}
|
|
8218
8218
|
const e = Is(this), t = Wr(this.anchor.getNode(), Vt);
|
|
8219
|
-
N(t) ||
|
|
8219
|
+
N(t) || z(213);
|
|
8220
8220
|
const n = t.getChildAtIndex(e), s = n ? [n, ...n.getNextSiblings()] : [], o = t.insertNewAfter(this, !1);
|
|
8221
8221
|
return o ? (o.append(...s), o.selectStart(), o) : null;
|
|
8222
8222
|
}
|
|
@@ -8233,18 +8233,18 @@ class er {
|
|
|
8233
8233
|
const [a, u] = ii(this);
|
|
8234
8234
|
if (t === 0) return [];
|
|
8235
8235
|
if (t === 1) {
|
|
8236
|
-
if (
|
|
8236
|
+
if (q(i) && !this.isCollapsed()) {
|
|
8237
8237
|
const d = a > u ? u : a, f = a > u ? a : u, h = i.splitText(d, f), g = d === 0 ? h[0] : h[1];
|
|
8238
8238
|
return g != null ? [g] : [];
|
|
8239
8239
|
}
|
|
8240
8240
|
return [i];
|
|
8241
8241
|
}
|
|
8242
8242
|
const c = s.isBefore(o);
|
|
8243
|
-
if (
|
|
8243
|
+
if (q(i)) {
|
|
8244
8244
|
const d = c ? a : u;
|
|
8245
8245
|
d === i.getTextContentSize() ? e.shift() : d !== 0 && ([, i] = i.splitText(d), e[0] = i);
|
|
8246
8246
|
}
|
|
8247
|
-
if (
|
|
8247
|
+
if (q(l)) {
|
|
8248
8248
|
const d = l.getTextContent().length, f = c ? u : a;
|
|
8249
8249
|
f === 0 ? e.pop() : f !== d && ([l] = l.splitText(f), e[n] = l);
|
|
8250
8250
|
}
|
|
@@ -8258,7 +8258,7 @@ class er {
|
|
|
8258
8258
|
return h.add(l.__key), void Nt(h);
|
|
8259
8259
|
}
|
|
8260
8260
|
const f = t ? l.getPreviousSibling() : l.getNextSibling();
|
|
8261
|
-
if (
|
|
8261
|
+
if (q(f)) {
|
|
8262
8262
|
const h = f.__key, g = t ? f.getTextContent().length : 0;
|
|
8263
8263
|
return s.set(h, g, "text"), void (i && o.set(h, g, "text"));
|
|
8264
8264
|
}
|
|
@@ -8274,7 +8274,7 @@ class er {
|
|
|
8274
8274
|
if (d === null || c === null || !N(l) || l.isInline() || l.canBeEmpty() || Ni(c, a, d), function(f, h, g, m) {
|
|
8275
8275
|
f.modify(h, g, m);
|
|
8276
8276
|
}(u, e, t ? "backward" : "forward", n), u.rangeCount > 0) {
|
|
8277
|
-
const f = u.getRangeAt(0), h = this.anchor.getNode(), g =
|
|
8277
|
+
const f = u.getRangeAt(0), h = this.anchor.getNode(), g = Ye(h) ? h : lc(h);
|
|
8278
8278
|
if (this.applyDOMRange(f), this.dirty = !0, !i) {
|
|
8279
8279
|
const m = this.getNodes(), y = [];
|
|
8280
8280
|
let C = !1;
|
|
@@ -8290,8 +8290,8 @@ class er {
|
|
|
8290
8290
|
N(x) ? x.selectEnd() : x.getParentOrThrow().selectEnd();
|
|
8291
8291
|
}
|
|
8292
8292
|
u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(x) {
|
|
8293
|
-
const A = x.focus, w = x.anchor, E = w.key, v = w.offset,
|
|
8294
|
-
Kt(w, A.key, A.offset, A.type), Kt(A, E, v,
|
|
8293
|
+
const A = x.focus, w = x.anchor, E = w.key, v = w.offset, b = w.type;
|
|
8294
|
+
Kt(w, A.key, A.offset, A.type), Kt(A, E, v, b), x._cachedNodes = null;
|
|
8295
8295
|
}(this);
|
|
8296
8296
|
}
|
|
8297
8297
|
}
|
|
@@ -8343,7 +8343,7 @@ class er {
|
|
|
8343
8343
|
}
|
|
8344
8344
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
8345
8345
|
const n = this.anchor.getNode();
|
|
8346
|
-
n.isEmpty() &&
|
|
8346
|
+
n.isEmpty() && Ye(n.getParent()) && n.getIndexWithinParent() === 0 && n.collapseAtStart(this);
|
|
8347
8347
|
}
|
|
8348
8348
|
}
|
|
8349
8349
|
deleteLine(e) {
|
|
@@ -8411,13 +8411,13 @@ function Co(r, e, t, n) {
|
|
|
8411
8411
|
const f = u.parentNode;
|
|
8412
8412
|
r === f && e > Array.prototype.indexOf.call(f.children, u) && o--;
|
|
8413
8413
|
}
|
|
8414
|
-
if (s = Dr(c),
|
|
8414
|
+
if (s = Dr(c), q(s)) o = no(s, i);
|
|
8415
8415
|
else {
|
|
8416
8416
|
let f = Dr(r);
|
|
8417
8417
|
if (f === null) return null;
|
|
8418
8418
|
if (N(f)) {
|
|
8419
8419
|
const h = n.getElementByKey(f.getKey());
|
|
8420
|
-
h === null &&
|
|
8420
|
+
h === null && z(214), [f, o] = f.getDOMSlot(h).resolveChildIndex(f, h, r, e), N(f) || z(215), i && o >= f.getChildrenSize() && (o = Math.max(0, f.getChildrenSize() - 1));
|
|
8421
8421
|
let m = f.getChildAtIndex(o);
|
|
8422
8422
|
if (N(m) && function(y, C, x) {
|
|
8423
8423
|
const A = y.getParent();
|
|
@@ -8426,7 +8426,7 @@ function Co(r, e, t, n) {
|
|
|
8426
8426
|
const y = i ? m.getLastDescendant() : m.getFirstDescendant();
|
|
8427
8427
|
y === null ? f = m : (m = y, f = N(m) ? m : m.getParentOrThrow()), o = 0;
|
|
8428
8428
|
}
|
|
8429
|
-
|
|
8429
|
+
q(m) ? (s = m, f = null, o = no(m, i)) : m !== f && i && !d && (N(f) || z(216), o = Math.min(f.getChildrenSize(), o + 1));
|
|
8430
8430
|
} else {
|
|
8431
8431
|
const h = f.getIndexWithinParent();
|
|
8432
8432
|
o = e === 0 && me(f) && Dr(r) === f ? h : h + 1, f = f.getParentOrThrow();
|
|
@@ -8434,7 +8434,7 @@ function Co(r, e, t, n) {
|
|
|
8434
8434
|
if (N(f)) return jt(f.__key, o, "element");
|
|
8435
8435
|
}
|
|
8436
8436
|
} else s = Dr(r);
|
|
8437
|
-
return
|
|
8437
|
+
return q(s) ? jt(s.__key, o, "text") : null;
|
|
8438
8438
|
}
|
|
8439
8439
|
function Do(r, e, t) {
|
|
8440
8440
|
const n = r.offset, s = r.getNode();
|
|
@@ -8443,15 +8443,15 @@ function Do(r, e, t) {
|
|
|
8443
8443
|
if (e) {
|
|
8444
8444
|
if ((t || !e) && o === null && N(i) && i.isInline()) {
|
|
8445
8445
|
const l = i.getPreviousSibling();
|
|
8446
|
-
|
|
8446
|
+
q(l) && (r.key = l.__key, r.offset = l.getTextContent().length);
|
|
8447
8447
|
}
|
|
8448
|
-
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") :
|
|
8448
|
+
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") : q(o) && (r.key = o.__key, r.offset = o.getTextContent().length);
|
|
8449
8449
|
} else if (n === s.getTextContent().length) {
|
|
8450
8450
|
const o = s.getNextSibling(), i = s.getParent();
|
|
8451
8451
|
if (e && N(o) && o.isInline()) r.key = o.__key, r.offset = 0, r.type = "element";
|
|
8452
8452
|
else if ((t || e) && o === null && N(i) && i.isInline() && !i.canInsertTextAfter()) {
|
|
8453
8453
|
const l = i.getNextSibling();
|
|
8454
|
-
|
|
8454
|
+
q(l) && (r.key = l.__key, r.offset = 0);
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
8457
8457
|
}
|
|
@@ -8539,21 +8539,21 @@ function Eo(r) {
|
|
|
8539
8539
|
if (r.isCollapsed()) {
|
|
8540
8540
|
if (!N(o)) return;
|
|
8541
8541
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8542
|
-
if (
|
|
8542
|
+
if (q(u)) {
|
|
8543
8543
|
let c = 0;
|
|
8544
8544
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text"), n.set(u.__key, c, "text");
|
|
8545
8545
|
}
|
|
8546
8546
|
} else {
|
|
8547
8547
|
if (N(o)) {
|
|
8548
8548
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8549
|
-
if (
|
|
8549
|
+
if (q(u)) {
|
|
8550
8550
|
let c = 0;
|
|
8551
8551
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text");
|
|
8552
8552
|
}
|
|
8553
8553
|
}
|
|
8554
8554
|
if (N(i)) {
|
|
8555
8555
|
const l = i.getChildrenSize(), a = s >= l, u = a ? i.getChildAtIndex(l - 1) : i.getChildAtIndex(s);
|
|
8556
|
-
if (
|
|
8556
|
+
if (q(u)) {
|
|
8557
8557
|
let c = 0;
|
|
8558
8558
|
a && (c = u.getTextContentSize()), n.set(u.__key, c, "text");
|
|
8559
8559
|
}
|
|
@@ -8562,7 +8562,7 @@ function Eo(r) {
|
|
|
8562
8562
|
}
|
|
8563
8563
|
function ts(r, e, t, n, s) {
|
|
8564
8564
|
let o = null, i = 0, l = null;
|
|
8565
|
-
n !== null ? (o = n.__key,
|
|
8565
|
+
n !== null ? (o = n.__key, q(n) ? (i = n.getTextContentSize(), l = "text") : N(n) && (i = n.getChildrenSize(), l = "element")) : s !== null && (o = s.__key, q(s) ? l = "text" : N(s) && (l = "element")), o !== null && l !== null ? r.set(o, i, l) : (i = e.getIndexWithinParent(), i === -1 && (i = t.getChildrenSize()), r.set(t.__key, i, "element"));
|
|
8566
8566
|
}
|
|
8567
8567
|
function So(r, e, t, n, s) {
|
|
8568
8568
|
r.type === "text" ? (r.key = t, e || (r.offset += s)) : r.offset > n.getIndexWithinParent() && (r.offset -= 1);
|
|
@@ -8572,20 +8572,20 @@ function Sc(r, e, t, n, s, o, i) {
|
|
|
8572
8572
|
if (s.has("collaboration") && d !== o || d !== null && Ai(d)) return;
|
|
8573
8573
|
if (!O(e)) return void (r !== null && yn(t, l, a) && n.removeAllRanges());
|
|
8574
8574
|
const f = e.anchor, h = e.focus, g = f.key, m = h.key, y = Hn(t, g), C = Hn(t, m), x = f.offset, A = h.offset, w = e.format, E = e.style, v = e.isCollapsed();
|
|
8575
|
-
let
|
|
8575
|
+
let b = y, D = C, k = !1;
|
|
8576
8576
|
if (f.type === "text") {
|
|
8577
|
-
|
|
8577
|
+
b = Gn(y);
|
|
8578
8578
|
const R = f.getNode();
|
|
8579
8579
|
k = R.getFormat() !== w || R.getStyle() !== E;
|
|
8580
8580
|
} else O(r) && r.anchor.type === "text" && (k = !0);
|
|
8581
8581
|
var M, B, F, L, j;
|
|
8582
|
-
if (h.type === "text" && (D = Gn(C)),
|
|
8582
|
+
if (h.type === "text" && (D = Gn(C)), b !== null && D !== null && (v && (r === null || k || O(r) && (r.format !== w || r.style !== E)) && (M = w, B = E, F = x, L = g, j = performance.now(), Ql = [M, B, F, L, j]), u !== x || c !== A || l !== b || a !== D || n.type === "Range" && v || (d !== null && o.contains(d) || o.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
8583
8583
|
try {
|
|
8584
|
-
n.setBaseAndExtent(
|
|
8584
|
+
n.setBaseAndExtent(b, x, D, A);
|
|
8585
8585
|
} catch {
|
|
8586
8586
|
}
|
|
8587
8587
|
if (!s.has("skip-scroll-into-view") && e.isCollapsed() && o !== null && o === document.activeElement) {
|
|
8588
|
-
const R = e instanceof er && e.anchor.type === "element" ?
|
|
8588
|
+
const R = e instanceof er && e.anchor.type === "element" ? b.childNodes[x] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
8589
8589
|
if (R !== null) {
|
|
8590
8590
|
let Y;
|
|
8591
8591
|
if (R instanceof Text) {
|
|
@@ -8593,26 +8593,26 @@ function Sc(r, e, t, n, s, o, i) {
|
|
|
8593
8593
|
de.selectNode(R), Y = de.getBoundingClientRect();
|
|
8594
8594
|
} else Y = R.getBoundingClientRect();
|
|
8595
8595
|
(function(de, ie, oe) {
|
|
8596
|
-
const
|
|
8596
|
+
const ve = oe.ownerDocument, pe = ve.defaultView;
|
|
8597
8597
|
if (pe === null) return;
|
|
8598
|
-
let { top:
|
|
8599
|
-
for (;
|
|
8600
|
-
const Ge =
|
|
8598
|
+
let { top: we, bottom: Se } = ie, Oe = 0, ke = 0, Ce = oe;
|
|
8599
|
+
for (; Ce !== null; ) {
|
|
8600
|
+
const Ge = Ce === ve.body;
|
|
8601
8601
|
if (Ge) Oe = 0, ke = hs(de).innerHeight;
|
|
8602
8602
|
else {
|
|
8603
|
-
const ge =
|
|
8603
|
+
const ge = Ce.getBoundingClientRect();
|
|
8604
8604
|
Oe = ge.top, ke = ge.bottom;
|
|
8605
8605
|
}
|
|
8606
8606
|
let ze = 0;
|
|
8607
|
-
if (
|
|
8607
|
+
if (we < Oe ? ze = -(Oe - we) : Se > ke && (ze = Se - ke), ze !== 0) if (Ge) pe.scrollBy(0, ze);
|
|
8608
8608
|
else {
|
|
8609
|
-
const ge =
|
|
8610
|
-
|
|
8611
|
-
const Me =
|
|
8612
|
-
|
|
8609
|
+
const ge = Ce.scrollTop;
|
|
8610
|
+
Ce.scrollTop += ze;
|
|
8611
|
+
const Me = Ce.scrollTop - ge;
|
|
8612
|
+
we -= Me, Se -= Me;
|
|
8613
8613
|
}
|
|
8614
8614
|
if (Ge) break;
|
|
8615
|
-
|
|
8615
|
+
Ce = xn(Ce);
|
|
8616
8616
|
}
|
|
8617
8617
|
})(t, Y, o);
|
|
8618
8618
|
}
|
|
@@ -8628,7 +8628,7 @@ function Is(r) {
|
|
|
8628
8628
|
let e = r;
|
|
8629
8629
|
r.isCollapsed() || e.removeText();
|
|
8630
8630
|
const t = V();
|
|
8631
|
-
O(t) && (e = t), O(e) ||
|
|
8631
|
+
O(t) && (e = t), O(e) || z(161);
|
|
8632
8632
|
const n = e.anchor;
|
|
8633
8633
|
let s = n.getNode(), o = n.offset;
|
|
8634
8634
|
for (; !Vt(s); ) [s, o] = kc(s, o);
|
|
@@ -8640,7 +8640,7 @@ function kc(r, e) {
|
|
|
8640
8640
|
const s = Le();
|
|
8641
8641
|
return Ee().append(s), s.select(), [Ee(), 0];
|
|
8642
8642
|
}
|
|
8643
|
-
if (
|
|
8643
|
+
if (q(r)) {
|
|
8644
8644
|
const s = r.splitText(e);
|
|
8645
8645
|
if (s.length === 0) return [t, r.getIndexWithinParent()];
|
|
8646
8646
|
const o = e === 0 ? 0 : 1;
|
|
@@ -8660,16 +8660,16 @@ function Cn() {
|
|
|
8660
8660
|
return tt || Ie !== null && Ie._readOnly;
|
|
8661
8661
|
}
|
|
8662
8662
|
function et() {
|
|
8663
|
-
tt &&
|
|
8663
|
+
tt && z(13);
|
|
8664
8664
|
}
|
|
8665
8665
|
function la() {
|
|
8666
|
-
On > 99 &&
|
|
8666
|
+
On > 99 && z(14);
|
|
8667
8667
|
}
|
|
8668
8668
|
function $t() {
|
|
8669
|
-
return Ie === null &&
|
|
8669
|
+
return Ie === null && z(195, aa()), Ie;
|
|
8670
8670
|
}
|
|
8671
8671
|
function Be() {
|
|
8672
|
-
return $e === null &&
|
|
8672
|
+
return $e === null && z(196, aa()), $e;
|
|
8673
8673
|
}
|
|
8674
8674
|
function aa() {
|
|
8675
8675
|
let r = 0;
|
|
@@ -8691,7 +8691,7 @@ function Tc() {
|
|
|
8691
8691
|
function To(r, e, t) {
|
|
8692
8692
|
const n = e.__type, s = function(l, a) {
|
|
8693
8693
|
const u = l._nodes.get(a);
|
|
8694
|
-
return u === void 0 &&
|
|
8694
|
+
return u === void 0 && z(30, a), u;
|
|
8695
8695
|
}(r, n);
|
|
8696
8696
|
let o = t.get(n);
|
|
8697
8697
|
o === void 0 && (o = Array.from(s.transforms), t.set(n, o));
|
|
@@ -8713,9 +8713,9 @@ function Bc(r) {
|
|
|
8713
8713
|
}
|
|
8714
8714
|
function Ri(r, e) {
|
|
8715
8715
|
const t = r.type, n = e.get(t);
|
|
8716
|
-
n === void 0 &&
|
|
8716
|
+
n === void 0 && z(17, t);
|
|
8717
8717
|
const s = n.klass;
|
|
8718
|
-
r.type !== s.getType() &&
|
|
8718
|
+
r.type !== s.getType() && z(18, s.name);
|
|
8719
8719
|
const o = s.importJSON(r), i = r.children;
|
|
8720
8720
|
if (N(o) && Array.isArray(i)) for (let l = 0; l < i.length; l++) {
|
|
8721
8721
|
const a = Ri(i[l], e);
|
|
@@ -8740,8 +8740,8 @@ function Jt(r, e) {
|
|
|
8740
8740
|
if (r._pendingEditorState = null, r._editorState = t, !s && a && h !== null) {
|
|
8741
8741
|
$e = r, Ie = t, tt = !1, r._updating = !0;
|
|
8742
8742
|
try {
|
|
8743
|
-
const v = r._dirtyType,
|
|
8744
|
-
h.disconnect(), g = mc(o, t, r, v,
|
|
8743
|
+
const v = r._dirtyType, b = r._dirtyElements, D = r._dirtyLeaves;
|
|
8744
|
+
h.disconnect(), g = mc(o, t, r, v, b, D);
|
|
8745
8745
|
} catch (v) {
|
|
8746
8746
|
if (v instanceof Error && r._onError(v), $s) throw v;
|
|
8747
8747
|
return pa(r, null, n, t), Bl(r), r._dirtyType = Br, $s = !0, Jt(r, o), void ($s = !1);
|
|
@@ -8751,10 +8751,10 @@ function Jt(r, e) {
|
|
|
8751
8751
|
}
|
|
8752
8752
|
t._readOnly || (t._readOnly = !0);
|
|
8753
8753
|
const m = r._dirtyLeaves, y = r._dirtyElements, C = r._normalizedNodes, x = r._updateTags, A = r._deferred;
|
|
8754
|
-
a && (r._dirtyType = ur, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(v,
|
|
8754
|
+
a && (r._dirtyType = ur, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(v, b) {
|
|
8755
8755
|
const D = v._decorators;
|
|
8756
8756
|
let k = v._pendingDecorators || D;
|
|
8757
|
-
const M =
|
|
8757
|
+
const M = b._nodeMap;
|
|
8758
8758
|
let B;
|
|
8759
8759
|
for (B in k) M.has(B) || (k === D && (k = Pl(v)), delete k[B]);
|
|
8760
8760
|
}(r, t);
|
|
@@ -8771,31 +8771,31 @@ function Jt(r, e) {
|
|
|
8771
8771
|
$e = d, Ie = u;
|
|
8772
8772
|
}
|
|
8773
8773
|
}
|
|
8774
|
-
g !== null && function(v,
|
|
8774
|
+
g !== null && function(v, b, D, k, M) {
|
|
8775
8775
|
const B = Array.from(v._listeners.mutation), F = B.length;
|
|
8776
8776
|
for (let L = 0; L < F; L++) {
|
|
8777
|
-
const [j, R] = B[L], Y =
|
|
8777
|
+
const [j, R] = B[L], Y = b.get(R);
|
|
8778
8778
|
Y !== void 0 && j(Y, { dirtyLeaves: k, prevEditorState: M, updateTags: D });
|
|
8779
8779
|
}
|
|
8780
8780
|
}(r, g, x, m, o), O(l) || l === null || i !== null && i.is(l) || r.dispatchCommand(fi, void 0);
|
|
8781
8781
|
const E = r._pendingDecorators;
|
|
8782
|
-
E !== null && (r._decorators = E, r._pendingDecorators = null, sn("decorator", r, !0, E)), function(v,
|
|
8783
|
-
const k = ro(
|
|
8782
|
+
E !== null && (r._decorators = E, r._pendingDecorators = null, sn("decorator", r, !0, E)), function(v, b, D) {
|
|
8783
|
+
const k = ro(b), M = ro(D);
|
|
8784
8784
|
k !== M && sn("textcontent", v, !0, M);
|
|
8785
|
-
}(r, e || o, t), sn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: C, prevEditorState: e || o, tags: x }), function(v,
|
|
8786
|
-
if (v._deferred = [],
|
|
8785
|
+
}(r, e || o, t), sn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: C, prevEditorState: e || o, tags: x }), function(v, b) {
|
|
8786
|
+
if (v._deferred = [], b.length !== 0) {
|
|
8787
8787
|
const D = v._updating;
|
|
8788
8788
|
v._updating = !0;
|
|
8789
8789
|
try {
|
|
8790
|
-
for (let k = 0; k <
|
|
8790
|
+
for (let k = 0; k < b.length; k++) b[k]();
|
|
8791
8791
|
} finally {
|
|
8792
8792
|
v._updating = D;
|
|
8793
8793
|
}
|
|
8794
8794
|
}
|
|
8795
8795
|
}(r, A), function(v) {
|
|
8796
|
-
const
|
|
8797
|
-
if (
|
|
8798
|
-
const D =
|
|
8796
|
+
const b = v._updates;
|
|
8797
|
+
if (b.length !== 0) {
|
|
8798
|
+
const D = b.shift();
|
|
8799
8799
|
if (D) {
|
|
8800
8800
|
const [k, M] = D;
|
|
8801
8801
|
da(v, k, M);
|
|
@@ -8844,7 +8844,7 @@ function Fo(r, e) {
|
|
|
8844
8844
|
if (i !== void 0) {
|
|
8845
8845
|
if (l = i.onUpdate, i.skipTransforms && (n = !0), i.discrete) {
|
|
8846
8846
|
const a = r._pendingEditorState;
|
|
8847
|
-
a === null &&
|
|
8847
|
+
a === null && z(191), a._flushSync = !0;
|
|
8848
8848
|
}
|
|
8849
8849
|
l && r._deferred.push(l), ua(r, i.tag);
|
|
8850
8850
|
}
|
|
@@ -8872,27 +8872,27 @@ function da(r, e, t) {
|
|
|
8872
8872
|
const A = x.getEditorState()._selection, w = C._selection;
|
|
8873
8873
|
if (O(w)) {
|
|
8874
8874
|
const E = w.anchor, v = w.focus;
|
|
8875
|
-
let
|
|
8876
|
-
if (E.type === "text" && (
|
|
8875
|
+
let b;
|
|
8876
|
+
if (E.type === "text" && (b = E.getNode(), b.selectionTransform(A, w)), v.type === "text") {
|
|
8877
8877
|
const D = v.getNode();
|
|
8878
|
-
|
|
8878
|
+
b !== D && D.selectionTransform(A, w);
|
|
8879
8879
|
}
|
|
8880
8880
|
}
|
|
8881
8881
|
}(a, r), r._dirtyType !== ur && (o ? function(C, x) {
|
|
8882
8882
|
const A = x._dirtyLeaves, w = C._nodeMap;
|
|
8883
8883
|
for (const E of A) {
|
|
8884
8884
|
const v = w.get(E);
|
|
8885
|
-
|
|
8885
|
+
q(v) && v.isAttached() && v.isSimpleText() && !v.isUnmergeable() && eo(v);
|
|
8886
8886
|
}
|
|
8887
8887
|
}(a, r) : function(C, x) {
|
|
8888
|
-
const A = x._dirtyLeaves, w = x._dirtyElements, E = C._nodeMap, v = Ht(),
|
|
8888
|
+
const A = x._dirtyLeaves, w = x._dirtyElements, E = C._nodeMap, v = Ht(), b = /* @__PURE__ */ new Map();
|
|
8889
8889
|
let D = A, k = D.size, M = w, B = M.size;
|
|
8890
8890
|
for (; k > 0 || B > 0; ) {
|
|
8891
8891
|
if (k > 0) {
|
|
8892
8892
|
x._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
8893
8893
|
for (const F of D) {
|
|
8894
8894
|
const L = E.get(F);
|
|
8895
|
-
|
|
8895
|
+
q(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && eo(L), L !== void 0 && Bo(L, v) && To(x, L, b), A.add(F);
|
|
8896
8896
|
}
|
|
8897
8897
|
if (D = x._dirtyLeaves, k = D.size, k > 0) {
|
|
8898
8898
|
On++;
|
|
@@ -8904,18 +8904,18 @@ function da(r, e, t) {
|
|
|
8904
8904
|
const L = F[0], j = F[1];
|
|
8905
8905
|
if (L !== "root" && !j) continue;
|
|
8906
8906
|
const R = E.get(L);
|
|
8907
|
-
R !== void 0 && Bo(R, v) && To(x, R,
|
|
8907
|
+
R !== void 0 && Bo(R, v) && To(x, R, b), w.set(L, j);
|
|
8908
8908
|
}
|
|
8909
8909
|
D = x._dirtyLeaves, k = D.size, M = x._dirtyElements, B = M.size, On++;
|
|
8910
8910
|
}
|
|
8911
8911
|
x._dirtyLeaves = A, x._dirtyElements = w;
|
|
8912
8912
|
}(a, r), Fo(r), function(C, x, A, w) {
|
|
8913
|
-
const E = C._nodeMap, v = x._nodeMap,
|
|
8913
|
+
const E = C._nodeMap, v = x._nodeMap, b = [];
|
|
8914
8914
|
for (const [D] of w) {
|
|
8915
8915
|
const k = v.get(D);
|
|
8916
|
-
k !== void 0 && (k.isAttached() || (N(k) && zl(k, D, E, v,
|
|
8916
|
+
k !== void 0 && (k.isAttached() || (N(k) && zl(k, D, E, v, b, w), E.has(D) || w.delete(D), b.push(D)));
|
|
8917
8917
|
}
|
|
8918
|
-
for (const D of
|
|
8918
|
+
for (const D of b) v.delete(D);
|
|
8919
8919
|
for (const D of A) {
|
|
8920
8920
|
const k = v.get(D);
|
|
8921
8921
|
k === void 0 || k.isAttached() || (E.has(D) || A.delete(D), v.delete(D));
|
|
@@ -8924,7 +8924,7 @@ function da(r, e, t) {
|
|
|
8924
8924
|
const y = a._selection;
|
|
8925
8925
|
if (O(y)) {
|
|
8926
8926
|
const C = a._nodeMap, x = y.anchor.key, A = y.focus.key;
|
|
8927
|
-
C.get(x) !== void 0 && C.get(A) !== void 0 ||
|
|
8927
|
+
C.get(x) !== void 0 && C.get(A) !== void 0 || z(19);
|
|
8928
8928
|
} else kt(y) && y._nodes.size === 0 && (a._selection = null);
|
|
8929
8929
|
} catch (m) {
|
|
8930
8930
|
return m instanceof Error && r._onError(m), r._pendingEditorState = l, r._dirtyType = Br, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void Jt(r);
|
|
@@ -8959,13 +8959,13 @@ class on {
|
|
|
8959
8959
|
}
|
|
8960
8960
|
insertChild(e) {
|
|
8961
8961
|
const t = this.before || this.getManagedLineBreak();
|
|
8962
|
-
return t !== null && t.parentElement !== this.element &&
|
|
8962
|
+
return t !== null && t.parentElement !== this.element && z(222), this.element.insertBefore(e, t), this;
|
|
8963
8963
|
}
|
|
8964
8964
|
removeChild(e) {
|
|
8965
|
-
return e.parentElement !== this.element &&
|
|
8965
|
+
return e.parentElement !== this.element && z(223), this.element.removeChild(e), this;
|
|
8966
8966
|
}
|
|
8967
8967
|
replaceChild(e, t) {
|
|
8968
|
-
return t.parentElement !== this.element &&
|
|
8968
|
+
return t.parentElement !== this.element && z(224), this.element.replaceChild(e, t), this;
|
|
8969
8969
|
}
|
|
8970
8970
|
getFirstChild() {
|
|
8971
8971
|
const e = this.after ? this.after.nextSibling : this.element.firstChild;
|
|
@@ -9033,7 +9033,7 @@ function jo(r, e) {
|
|
|
9033
9033
|
for (let o = n.previousSibling; o !== null; o = n.previousSibling) s++;
|
|
9034
9034
|
t.push(s);
|
|
9035
9035
|
}
|
|
9036
|
-
return n !== r &&
|
|
9036
|
+
return n !== r && z(225), t.reverse();
|
|
9037
9037
|
}
|
|
9038
9038
|
class zt extends gs {
|
|
9039
9039
|
constructor(e) {
|
|
@@ -9085,7 +9085,7 @@ class zt extends gs {
|
|
|
9085
9085
|
const e = [];
|
|
9086
9086
|
let t = this.getFirstChild();
|
|
9087
9087
|
for (; t !== null; ) {
|
|
9088
|
-
if (
|
|
9088
|
+
if (q(t) && e.push(t), N(t)) {
|
|
9089
9089
|
const n = t.getAllTextNodes();
|
|
9090
9090
|
e.push(...n);
|
|
9091
9091
|
}
|
|
@@ -9126,7 +9126,7 @@ class zt extends gs {
|
|
|
9126
9126
|
}
|
|
9127
9127
|
getFirstChildOrThrow() {
|
|
9128
9128
|
const e = this.getFirstChild();
|
|
9129
|
-
return e === null &&
|
|
9129
|
+
return e === null && z(45, this.__key), e;
|
|
9130
9130
|
}
|
|
9131
9131
|
getLastChild() {
|
|
9132
9132
|
const e = this.getLatest().__last;
|
|
@@ -9134,7 +9134,7 @@ class zt extends gs {
|
|
|
9134
9134
|
}
|
|
9135
9135
|
getLastChildOrThrow() {
|
|
9136
9136
|
const e = this.getLastChild();
|
|
9137
|
-
return e === null &&
|
|
9137
|
+
return e === null && z(96, this.__key), e;
|
|
9138
9138
|
}
|
|
9139
9139
|
getChildAtIndex(e) {
|
|
9140
9140
|
const t = this.getChildrenSize();
|
|
@@ -9188,10 +9188,10 @@ class zt extends gs {
|
|
|
9188
9188
|
if (!this.canBeEmpty()) {
|
|
9189
9189
|
if (e === 0 && t === 0) {
|
|
9190
9190
|
const a = this.getFirstChild();
|
|
9191
|
-
if (
|
|
9191
|
+
if (q(a) || N(a)) return a.select(0, 0);
|
|
9192
9192
|
} else if (!(e !== void 0 && e !== i || t !== void 0 && t !== i)) {
|
|
9193
9193
|
const a = this.getLastChild();
|
|
9194
|
-
if (
|
|
9194
|
+
if (q(a) || N(a)) return a.select();
|
|
9195
9195
|
}
|
|
9196
9196
|
}
|
|
9197
9197
|
s === void 0 && (s = i), o === void 0 && (o = i);
|
|
@@ -9228,7 +9228,7 @@ class zt extends gs {
|
|
|
9228
9228
|
}
|
|
9229
9229
|
splice(e, t, n) {
|
|
9230
9230
|
const s = n.length, o = this.getChildrenSize(), i = this.getWritable();
|
|
9231
|
-
e + t <= o ||
|
|
9231
|
+
e + t <= o || z(226, String(e), String(t), String(o));
|
|
9232
9232
|
const l = i.__key, a = [], u = [], c = this.getChildAtIndex(e + t);
|
|
9233
9233
|
let d = null, f = o - t + s;
|
|
9234
9234
|
if (e !== 0) if (e === o) d = this.getLastChild();
|
|
@@ -9239,7 +9239,7 @@ class zt extends gs {
|
|
|
9239
9239
|
if (t > 0) {
|
|
9240
9240
|
let g = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
9241
9241
|
for (let m = 0; m < t; m++) {
|
|
9242
|
-
g === null &&
|
|
9242
|
+
g === null && z(100);
|
|
9243
9243
|
const y = g.getNextSibling(), C = g.__key;
|
|
9244
9244
|
lr(g.getWritable()), u.push(C), g = y;
|
|
9245
9245
|
}
|
|
@@ -9256,7 +9256,7 @@ class zt extends gs {
|
|
|
9256
9256
|
const x = h.getWritable();
|
|
9257
9257
|
x.__next = C, y.__prev = x.__key;
|
|
9258
9258
|
}
|
|
9259
|
-
m.__key === l &&
|
|
9259
|
+
m.__key === l && z(76), y.__parent = l, a.push(C), h = m;
|
|
9260
9260
|
}
|
|
9261
9261
|
if (e + t === o)
|
|
9262
9262
|
h !== null && (h.getWritable().__next = null, i.__last = h.__key);
|
|
@@ -9358,7 +9358,7 @@ class Nc extends gs {
|
|
|
9358
9358
|
super(e);
|
|
9359
9359
|
}
|
|
9360
9360
|
decorate(e, t) {
|
|
9361
|
-
|
|
9361
|
+
z(47);
|
|
9362
9362
|
}
|
|
9363
9363
|
isIsolated() {
|
|
9364
9364
|
return !1;
|
|
@@ -9384,23 +9384,23 @@ class Dn extends zt {
|
|
|
9384
9384
|
super("root"), this.__cachedText = null;
|
|
9385
9385
|
}
|
|
9386
9386
|
getTopLevelElementOrThrow() {
|
|
9387
|
-
|
|
9387
|
+
z(51);
|
|
9388
9388
|
}
|
|
9389
9389
|
getTextContent() {
|
|
9390
9390
|
const e = this.__cachedText;
|
|
9391
9391
|
return !Cn() && Be()._dirtyType !== ur || e === null ? super.getTextContent() : e;
|
|
9392
9392
|
}
|
|
9393
9393
|
remove() {
|
|
9394
|
-
|
|
9394
|
+
z(52);
|
|
9395
9395
|
}
|
|
9396
9396
|
replace(e) {
|
|
9397
|
-
|
|
9397
|
+
z(53);
|
|
9398
9398
|
}
|
|
9399
9399
|
insertBefore(e) {
|
|
9400
|
-
|
|
9400
|
+
z(54);
|
|
9401
9401
|
}
|
|
9402
9402
|
insertAfter(e) {
|
|
9403
|
-
|
|
9403
|
+
z(55);
|
|
9404
9404
|
}
|
|
9405
9405
|
updateDOM(e, t) {
|
|
9406
9406
|
return !1;
|
|
@@ -9408,7 +9408,7 @@ class Dn extends zt {
|
|
|
9408
9408
|
append(...e) {
|
|
9409
9409
|
for (let t = 0; t < e.length; t++) {
|
|
9410
9410
|
const n = e[t];
|
|
9411
|
-
N(n) || me(n) ||
|
|
9411
|
+
N(n) || me(n) || z(56);
|
|
9412
9412
|
}
|
|
9413
9413
|
return super.append(...e);
|
|
9414
9414
|
}
|
|
@@ -9423,7 +9423,7 @@ class Dn extends zt {
|
|
|
9423
9423
|
return !0;
|
|
9424
9424
|
}
|
|
9425
9425
|
}
|
|
9426
|
-
function
|
|
9426
|
+
function Ye(r) {
|
|
9427
9427
|
return r instanceof Dn;
|
|
9428
9428
|
}
|
|
9429
9429
|
function fa(r) {
|
|
@@ -9434,9 +9434,9 @@ function Oi() {
|
|
|
9434
9434
|
}
|
|
9435
9435
|
function ha(r) {
|
|
9436
9436
|
const e = r.exportJSON(), t = r.constructor;
|
|
9437
|
-
if (e.type !== t.getType() &&
|
|
9437
|
+
if (e.type !== t.getType() && z(130, t.name), N(r)) {
|
|
9438
9438
|
const n = e.children;
|
|
9439
|
-
Array.isArray(n) ||
|
|
9439
|
+
Array.isArray(n) || z(59, t.name);
|
|
9440
9440
|
const s = r.getChildren();
|
|
9441
9441
|
for (let o = 0; o < s.length; o++) {
|
|
9442
9442
|
const i = ha(s[o]);
|
|
@@ -9541,7 +9541,7 @@ class Pr extends zt {
|
|
|
9541
9541
|
}
|
|
9542
9542
|
collapseAtStart() {
|
|
9543
9543
|
const e = this.getChildren();
|
|
9544
|
-
if (e.length === 0 ||
|
|
9544
|
+
if (e.length === 0 || q(e[0]) && e[0].getTextContent().trim() === "") {
|
|
9545
9545
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
9546
9546
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
9547
9547
|
}
|
|
@@ -9636,11 +9636,11 @@ class xs {
|
|
|
9636
9636
|
};
|
|
9637
9637
|
}
|
|
9638
9638
|
registerCommand(e, t, n) {
|
|
9639
|
-
n === void 0 &&
|
|
9639
|
+
n === void 0 && z(35);
|
|
9640
9640
|
const s = this._commands;
|
|
9641
9641
|
s.has(e) || s.set(e, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
|
|
9642
9642
|
const o = s.get(e);
|
|
9643
|
-
o === void 0 &&
|
|
9643
|
+
o === void 0 && z(36, String(e));
|
|
9644
9644
|
const i = o[n];
|
|
9645
9645
|
return i.add(t), () => {
|
|
9646
9646
|
i.delete(t), o.every((l) => l.size === 0) && s.delete(e);
|
|
@@ -9656,7 +9656,7 @@ class xs {
|
|
|
9656
9656
|
}
|
|
9657
9657
|
getRegisteredNode(e) {
|
|
9658
9658
|
const t = this._nodes.get(e.getType());
|
|
9659
|
-
return t === void 0 &&
|
|
9659
|
+
return t === void 0 && z(37, e.name), t;
|
|
9660
9660
|
}
|
|
9661
9661
|
resolveRegisteredNodeAfterReplacements(e) {
|
|
9662
9662
|
for (; e.replaceWithKlass; ) e = this.getRegisteredNode(e.replaceWithKlass);
|
|
@@ -9765,7 +9765,7 @@ class xs {
|
|
|
9765
9765
|
return this._editorState;
|
|
9766
9766
|
}
|
|
9767
9767
|
setEditorState(e, t) {
|
|
9768
|
-
e.isEmpty() &&
|
|
9768
|
+
e.isEmpty() && z(38);
|
|
9769
9769
|
let n = e;
|
|
9770
9770
|
n._readOnly && (n = fa(e), n._selection = e._selection ? e._selection.clone() : null), Tl(this);
|
|
9771
9771
|
const s = this._pendingEditorState, o = this._updateTags, i = t !== void 0 ? t.tag : null;
|
|
@@ -9890,7 +9890,7 @@ function qc(r) {
|
|
|
9890
9890
|
const o = s.getChildren(), i = o.length;
|
|
9891
9891
|
for (let l = 0; l < i; l++) {
|
|
9892
9892
|
const a = o[n];
|
|
9893
|
-
if (!
|
|
9893
|
+
if (!q(a)) return !1;
|
|
9894
9894
|
}
|
|
9895
9895
|
}
|
|
9896
9896
|
}
|
|
@@ -9974,7 +9974,7 @@ function Qc(r, e, t, n) {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
function Yc(r) {
|
|
9976
9976
|
const e = r.anchor.getNode();
|
|
9977
|
-
return (
|
|
9977
|
+
return (Ye(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
9978
9978
|
}
|
|
9979
9979
|
function Ro(r, e, t) {
|
|
9980
9980
|
const n = Yc(r);
|
|
@@ -9982,7 +9982,7 @@ function Ro(r, e, t) {
|
|
|
9982
9982
|
}
|
|
9983
9983
|
function Oo(r) {
|
|
9984
9984
|
if (me(r) || !N(r) || Ft(r)) return !1;
|
|
9985
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
9985
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
9986
9986
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9987
9987
|
}
|
|
9988
9988
|
function Xc(r) {
|
|
@@ -10062,7 +10062,7 @@ function nd(r) {
|
|
|
10062
10062
|
if (O(m)) {
|
|
10063
10063
|
const y = m.anchor;
|
|
10064
10064
|
let C = y.getNode(), x = 0, A = 0;
|
|
10065
|
-
if (
|
|
10065
|
+
if (q(C) && u >= 0 && c >= 0 && (x = u, A = u + c, m.setTextNodeRange(C, x, C, A)), x === A && d === "" || (m.insertRawText(d), C = y.getNode()), q(C)) {
|
|
10066
10066
|
x = f, A = f + h;
|
|
10067
10067
|
const w = C.getTextContentSize();
|
|
10068
10068
|
x = x > w ? w : x, A = A > w ? w : A, m.setTextNodeRange(C, x, C, A);
|
|
@@ -10112,7 +10112,7 @@ function Ca(r, e, t, n = null) {
|
|
|
10112
10112
|
let i = e;
|
|
10113
10113
|
if (n !== null) {
|
|
10114
10114
|
let h = Fi(e);
|
|
10115
|
-
h =
|
|
10115
|
+
h = q(h) && n !== null ? ya(n, h) : h, i = h;
|
|
10116
10116
|
}
|
|
10117
10117
|
const l = N(i) ? i.getChildren() : [], a = r._nodes.get(i.getType());
|
|
10118
10118
|
let u;
|
|
@@ -10235,7 +10235,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10235
10235
|
let i = t;
|
|
10236
10236
|
if (e !== null) {
|
|
10237
10237
|
let u = Fi(t);
|
|
10238
|
-
u =
|
|
10238
|
+
u = q(u) && e !== null ? ya(e, u) : u, i = u;
|
|
10239
10239
|
}
|
|
10240
10240
|
const l = N(i) ? i.getChildren() : [], a = function(u) {
|
|
10241
10241
|
const c = u.exportJSON(), d = u.constructor;
|
|
@@ -10245,7 +10245,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10245
10245
|
}
|
|
10246
10246
|
return c;
|
|
10247
10247
|
}(i);
|
|
10248
|
-
if (
|
|
10248
|
+
if (q(i)) {
|
|
10249
10249
|
const u = i.__text;
|
|
10250
10250
|
u.length > 0 ? a.text = u : s = !1;
|
|
10251
10251
|
}
|
|
@@ -10270,7 +10270,7 @@ function ud(r) {
|
|
|
10270
10270
|
const e = [];
|
|
10271
10271
|
for (let t = 0; t < r.length; t++) {
|
|
10272
10272
|
const n = r[t], s = Bc(n);
|
|
10273
|
-
|
|
10273
|
+
q(s) && Hc(s), e.push(s);
|
|
10274
10274
|
}
|
|
10275
10275
|
return e;
|
|
10276
10276
|
}
|
|
@@ -10597,7 +10597,7 @@ function bd(r) {
|
|
|
10597
10597
|
const t = V();
|
|
10598
10598
|
if (!O(t)) return !1;
|
|
10599
10599
|
const { anchor: n } = t, s = n.getNode();
|
|
10600
|
-
return t.isCollapsed() && n.offset === 0 && !
|
|
10600
|
+
return t.isCollapsed() && n.offset === 0 && !Ye(s) && rd(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Qi, void 0)) : (!Uo || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(or, !0));
|
|
10601
10601
|
}, ce), r.registerCommand(_l, (e) => {
|
|
10602
10602
|
if (Ln(e.target)) return !1;
|
|
10603
10603
|
const t = V();
|
|
@@ -10621,7 +10621,7 @@ function bd(r) {
|
|
|
10621
10621
|
const { offset: o, node: i } = s, l = Nr(i);
|
|
10622
10622
|
if (l !== null) {
|
|
10623
10623
|
const a = Ec();
|
|
10624
|
-
if (
|
|
10624
|
+
if (q(l)) a.anchor.set(l.getKey(), o, "text"), a.focus.set(l.getKey(), o, "text");
|
|
10625
10625
|
else {
|
|
10626
10626
|
const c = l.getParentOrThrow().getKey(), d = l.getIndexWithinParent() + 1;
|
|
10627
10627
|
a.anchor.set(c, d, "element"), a.focus.set(c, d, "element");
|
|
@@ -10707,7 +10707,7 @@ function vd({ content: r }) {
|
|
|
10707
10707
|
}
|
|
10708
10708
|
const Sa = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? jr : De;
|
|
10709
10709
|
function wd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: g, id: m, role: y = "textbox", spellCheck: C = !0, style: x, tabIndex: A, "data-testid": w, ...E }, v) {
|
|
10710
|
-
const [
|
|
10710
|
+
const [b, D] = H(r.isEditable()), k = re((B) => {
|
|
10711
10711
|
B && B.ownerDocument && B.ownerDocument.defaultView ? r.setRootElement(B) : r.setRootElement(null);
|
|
10712
10712
|
}, [r]), M = bt(() => /* @__PURE__ */ function(...B) {
|
|
10713
10713
|
return (F) => {
|
|
@@ -10718,7 +10718,7 @@ function wd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
10718
10718
|
}(v, k), [k, v]);
|
|
10719
10719
|
return Sa(() => (D(r.isEditable()), r.registerEditableListener((B) => {
|
|
10720
10720
|
D(B);
|
|
10721
|
-
})), [r]), p.jsx("div", { "aria-activedescendant":
|
|
10721
|
+
})), [r]), p.jsx("div", { "aria-activedescendant": b ? e : void 0, "aria-autocomplete": b ? t : "none", "aria-controls": b ? n : void 0, "aria-describedby": s, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": b && y === "combobox" ? !!i : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": b ? d : void 0, "aria-readonly": !b || void 0, "aria-required": f, autoCapitalize: h, className: g, contentEditable: b, "data-testid": w, id: m, ref: M, role: b ? y : void 0, spellCheck: C, style: x, tabIndex: A, ...E });
|
|
10722
10722
|
}
|
|
10723
10723
|
const Cd = al(wd);
|
|
10724
10724
|
function Ho(r) {
|
|
@@ -10759,23 +10759,23 @@ function Bd(r, e, t, n, s) {
|
|
|
10759
10759
|
const l = function(C, x, A) {
|
|
10760
10760
|
const w = C._nodeMap, E = [];
|
|
10761
10761
|
for (const v of x) {
|
|
10762
|
-
const
|
|
10763
|
-
|
|
10762
|
+
const b = w.get(v);
|
|
10763
|
+
b !== void 0 && E.push(b);
|
|
10764
10764
|
}
|
|
10765
|
-
for (const [v,
|
|
10766
|
-
if (!
|
|
10765
|
+
for (const [v, b] of A) {
|
|
10766
|
+
if (!b) continue;
|
|
10767
10767
|
const D = w.get(v);
|
|
10768
|
-
D === void 0 ||
|
|
10768
|
+
D === void 0 || Ye(D) || E.push(D);
|
|
10769
10769
|
}
|
|
10770
10770
|
return E;
|
|
10771
10771
|
}(e, t, n);
|
|
10772
10772
|
if (l.length === 0) return yt;
|
|
10773
10773
|
if (l.length > 1) {
|
|
10774
10774
|
const C = e._nodeMap, x = C.get(o.anchor.key), A = C.get(i.anchor.key);
|
|
10775
|
-
return x && A && !r._nodeMap.has(x.__key) &&
|
|
10775
|
+
return x && A && !r._nodeMap.has(x.__key) && q(x) && x.__text.length === 1 && o.anchor.offset === 1 ? Jo : yt;
|
|
10776
10776
|
}
|
|
10777
10777
|
const a = l[0], u = r._nodeMap.get(a.__key);
|
|
10778
|
-
if (!
|
|
10778
|
+
if (!q(u) || !q(a) || u.__mode !== a.__mode) return yt;
|
|
10779
10779
|
const c = u.__text, d = a.__text;
|
|
10780
10780
|
if (c === d) return yt;
|
|
10781
10781
|
const f = o.anchor, h = i.anchor;
|
|
@@ -10795,7 +10795,7 @@ function Nd(r, e) {
|
|
|
10795
10795
|
const m = o._selection;
|
|
10796
10796
|
return l.size > 0 || a.size > 0 ? g === !1 && d !== yt && d === n && c < t + e && h || l.size === 1 && function(y, C, x) {
|
|
10797
10797
|
const A = C._nodeMap.get(y), w = x._nodeMap.get(y), E = C._selection, v = x._selection;
|
|
10798
|
-
return !(O(E) && O(v) && E.anchor.type === "element" && E.focus.type === "element" && v.anchor.type === "text" && v.focus.type === "text" || !
|
|
10798
|
+
return !(O(E) && O(v) && E.anchor.type === "element" && E.focus.type === "element" && v.anchor.type === "text" && v.focus.type === "text" || !q(A) || !q(w) || A.__parent !== w.__parent) && JSON.stringify(C.read(() => A.exportJSON())) === JSON.stringify(x.read(() => w.exportJSON()));
|
|
10799
10799
|
}(Array.from(l)[0], s, o) ? Pn : ai : m !== null ? Pn : ui;
|
|
10800
10800
|
})();
|
|
10801
10801
|
return t = c, n = d, f;
|
|
@@ -11701,7 +11701,7 @@ const tf = {
|
|
|
11701
11701
|
}
|
|
11702
11702
|
};
|
|
11703
11703
|
function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiRewrite: s, aiProcessing: o, aiProcessingAction: i, onAiAction: l, hasContent: a }) {
|
|
11704
|
-
const [u] = vt(), [c, d] =
|
|
11704
|
+
const [u] = vt(), [c, d] = Je.useState(!1), f = Je.useRef(null), h = t || n || s, g = re(() => {
|
|
11705
11705
|
u.dispatchCommand(xt, "bold");
|
|
11706
11706
|
}, [u]), m = re(() => {
|
|
11707
11707
|
u.dispatchCommand(xt, "italic");
|
|
@@ -11713,8 +11713,8 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11713
11713
|
u.dispatchCommand(Na, void 0);
|
|
11714
11714
|
}, [u]), A = re(() => {
|
|
11715
11715
|
u.update(() => {
|
|
11716
|
-
const
|
|
11717
|
-
O(
|
|
11716
|
+
const b = V();
|
|
11717
|
+
O(b) && Jc(b, () => Ii());
|
|
11718
11718
|
});
|
|
11719
11719
|
}, [u]), w = {
|
|
11720
11720
|
display: "flex",
|
|
@@ -11736,8 +11736,8 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11736
11736
|
}
|
|
11737
11737
|
`, v = () => {
|
|
11738
11738
|
setTimeout(() => {
|
|
11739
|
-
var
|
|
11740
|
-
(
|
|
11739
|
+
var b;
|
|
11740
|
+
(b = f.current) != null && b.contains(document.activeElement) || d(!1);
|
|
11741
11741
|
}, 150);
|
|
11742
11742
|
};
|
|
11743
11743
|
return /* @__PURE__ */ p.jsxs(
|
|
@@ -11932,8 +11932,8 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11932
11932
|
alignItems: "center",
|
|
11933
11933
|
gap: "8px"
|
|
11934
11934
|
},
|
|
11935
|
-
onMouseEnter: (
|
|
11936
|
-
onMouseLeave: (
|
|
11935
|
+
onMouseEnter: (b) => b.currentTarget.style.background = "#f3f4f6",
|
|
11936
|
+
onMouseLeave: (b) => b.currentTarget.style.background = "transparent",
|
|
11937
11937
|
children: [
|
|
11938
11938
|
/* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#3b82f6" }, children: "format_list_bulleted" }),
|
|
11939
11939
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
@@ -11962,8 +11962,8 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11962
11962
|
alignItems: "center",
|
|
11963
11963
|
gap: "8px"
|
|
11964
11964
|
},
|
|
11965
|
-
onMouseEnter: (
|
|
11966
|
-
onMouseLeave: (
|
|
11965
|
+
onMouseEnter: (b) => b.currentTarget.style.background = "#f3f4f6",
|
|
11966
|
+
onMouseLeave: (b) => b.currentTarget.style.background = "transparent",
|
|
11967
11967
|
children: [
|
|
11968
11968
|
/* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#22c55e" }, children: "spellcheck" }),
|
|
11969
11969
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
@@ -11992,8 +11992,8 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11992
11992
|
alignItems: "center",
|
|
11993
11993
|
gap: "8px"
|
|
11994
11994
|
},
|
|
11995
|
-
onMouseEnter: (
|
|
11996
|
-
onMouseLeave: (
|
|
11995
|
+
onMouseEnter: (b) => b.currentTarget.style.background = "#f3f4f6",
|
|
11996
|
+
onMouseLeave: (b) => b.currentTarget.style.background = "transparent",
|
|
11997
11997
|
children: [
|
|
11998
11998
|
/* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#9333ea" }, children: "brush" }),
|
|
11999
11999
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
@@ -12012,7 +12012,7 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
12012
12012
|
);
|
|
12013
12013
|
}
|
|
12014
12014
|
function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
12015
|
-
const [n] = vt(), s =
|
|
12015
|
+
const [n] = vt(), s = Je.useRef(!1);
|
|
12016
12016
|
return De(() => {
|
|
12017
12017
|
r && (s.current && !e || (s.current = !0, n.update(
|
|
12018
12018
|
() => {
|
|
@@ -12030,7 +12030,7 @@ function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
|
12030
12030
|
}, [r, e, n, t]), null;
|
|
12031
12031
|
}
|
|
12032
12032
|
function of({ text: r, trigger: e }) {
|
|
12033
|
-
const [t] = vt(), n =
|
|
12033
|
+
const [t] = vt(), n = Je.useRef(void 0);
|
|
12034
12034
|
return De(() => {
|
|
12035
12035
|
if (e === void 0 || e === n.current || !r) return;
|
|
12036
12036
|
n.current = e;
|
|
@@ -12128,21 +12128,21 @@ function af({
|
|
|
12128
12128
|
aiProcessingAction: m,
|
|
12129
12129
|
renderAboveToolbar: y
|
|
12130
12130
|
}) {
|
|
12131
|
-
const C = { ...tf, ...s }, [x, A] =
|
|
12132
|
-
|
|
12131
|
+
const C = { ...tf, ...s }, [x, A] = Je.useState(!1), w = Je.useRef(void 0), [E, v] = Je.useState(r), [b, D] = Je.useState(!1), [k, M] = Je.useState(null), B = g ?? b, F = m ?? k;
|
|
12132
|
+
Je.useEffect(() => {
|
|
12133
12133
|
a !== void 0 && a !== w.current && (w.current = a, A(!0));
|
|
12134
12134
|
}, [a]);
|
|
12135
12135
|
const L = re(() => {
|
|
12136
12136
|
A(!1);
|
|
12137
12137
|
}, []), j = (pe) => pe.replace(/<[^>]*>/g, "").trim(), R = (pe) => pe.split(`
|
|
12138
|
-
`).map((
|
|
12139
|
-
const
|
|
12140
|
-
if (!
|
|
12138
|
+
`).map((we) => `<p>${we || "<br>"}</p>`).join(""), Y = async (pe) => {
|
|
12139
|
+
const we = j(E);
|
|
12140
|
+
if (!we) return;
|
|
12141
12141
|
const Se = pe === "restructure" ? d : pe === "proofread" ? f : h;
|
|
12142
12142
|
if (Se) {
|
|
12143
12143
|
D(!0), M(pe);
|
|
12144
12144
|
try {
|
|
12145
|
-
const Oe = await Se(
|
|
12145
|
+
const Oe = await Se(we), ke = R(Oe);
|
|
12146
12146
|
v(ke), e == null || e(ke), w.current = Date.now(), A(!0);
|
|
12147
12147
|
} catch (Oe) {
|
|
12148
12148
|
console.error(`AI ${pe} failed:`, Oe);
|
|
@@ -12159,14 +12159,14 @@ function af({
|
|
|
12159
12159
|
nodes: [Or, gr, mr, En, vs, _s],
|
|
12160
12160
|
editable: !o
|
|
12161
12161
|
}, oe = re(
|
|
12162
|
-
(pe,
|
|
12162
|
+
(pe, we) => {
|
|
12163
12163
|
pe.read(() => {
|
|
12164
|
-
const Se = wa(
|
|
12164
|
+
const Se = wa(we, null);
|
|
12165
12165
|
v(Se), e == null || e(Se);
|
|
12166
12166
|
});
|
|
12167
12167
|
},
|
|
12168
12168
|
[e]
|
|
12169
|
-
),
|
|
12169
|
+
), ve = `
|
|
12170
12170
|
.mail-editor-paragraph {
|
|
12171
12171
|
margin: 0 0 8px 0;
|
|
12172
12172
|
line-height: 1.5;
|
|
@@ -12252,7 +12252,7 @@ function af({
|
|
|
12252
12252
|
minHeight: l
|
|
12253
12253
|
},
|
|
12254
12254
|
children: [
|
|
12255
|
-
/* @__PURE__ */ p.jsx("style", { children:
|
|
12255
|
+
/* @__PURE__ */ p.jsx("style", { children: ve }),
|
|
12256
12256
|
y,
|
|
12257
12257
|
/* @__PURE__ */ p.jsxs(Rc, { initialConfig: ie, children: [
|
|
12258
12258
|
/* @__PURE__ */ p.jsx(
|
|
@@ -12359,60 +12359,65 @@ function Sf({
|
|
|
12359
12359
|
onAiRewrite: w,
|
|
12360
12360
|
renderAboveToolbar: E
|
|
12361
12361
|
}) {
|
|
12362
|
-
const v = { ...uf, ...c }, [
|
|
12363
|
-
|
|
12364
|
-
l !== void 0 && l !== Ge.current && (Ge.current = l, Y(t),
|
|
12362
|
+
const v = { ...uf, ...c }, [b, D] = H(r), [k, M] = H(""), [B, F] = H(""), [L, j] = H(e), [R, Y] = H(t), [de, ie] = H([]), [oe, ve] = H(!1), [pe, we] = H(""), [Se, Oe] = H(f), [ke, Ce] = H(!1), Ge = Je.useRef(void 0);
|
|
12363
|
+
Je.useEffect(() => {
|
|
12364
|
+
l !== void 0 && l !== Ge.current && (Ge.current = l, Y(t), Ce(!0));
|
|
12365
12365
|
}, [l, t]);
|
|
12366
12366
|
const ze = (W) => {
|
|
12367
|
-
Y(W),
|
|
12367
|
+
Y(W), Ce(!1), i == null || i(W);
|
|
12368
12368
|
}, ge = xe(null), [Me, ct] = H(!1), Ct = (W) => {
|
|
12369
|
-
const
|
|
12370
|
-
|
|
12369
|
+
const be = W.target.files;
|
|
12370
|
+
be && ie((Ke) => [...Ke, ...Array.from(be)]), ge.current && (ge.current.value = "");
|
|
12371
12371
|
}, qt = (W) => {
|
|
12372
12372
|
W.preventDefault(), W.stopPropagation(), ct(!0);
|
|
12373
12373
|
}, it = (W) => {
|
|
12374
12374
|
W.preventDefault(), W.stopPropagation(), ct(!1);
|
|
12375
12375
|
}, ot = (W) => {
|
|
12376
|
-
W.preventDefault(), W.stopPropagation(), ct(!1), W.dataTransfer.files && ie((
|
|
12376
|
+
W.preventDefault(), W.stopPropagation(), ct(!1), W.dataTransfer.files && ie((be) => [...be, ...Array.from(W.dataTransfer.files)]);
|
|
12377
12377
|
}, dt = (W) => W.type.startsWith("image/") ? "image" : W.type === "application/pdf" ? "picture_as_pdf" : W.type.includes("spreadsheet") || W.type.includes("excel") ? "table_chart" : W.type.includes("document") || W.type.includes("word") ? "description" : "attach_file", Ut = (W) => {
|
|
12378
|
-
ie((
|
|
12378
|
+
ie((be) => be.filter((Ke, I) => I !== W));
|
|
12379
12379
|
}, Wt = (W) => W < 1024 ? `${W} B` : W < 1024 * 1024 ? `${(W / 1024).toFixed(1)} KB` : `${(W / (1024 * 1024)).toFixed(1)} MB`, Dt = async () => {
|
|
12380
|
-
if (!
|
|
12381
|
-
|
|
12380
|
+
if (!b.trim()) {
|
|
12381
|
+
we("Recipient email is required");
|
|
12382
12382
|
return;
|
|
12383
12383
|
}
|
|
12384
12384
|
if (!L.trim()) {
|
|
12385
|
-
|
|
12385
|
+
we("Subject is required");
|
|
12386
12386
|
return;
|
|
12387
12387
|
}
|
|
12388
|
-
|
|
12388
|
+
ve(!0), we("");
|
|
12389
12389
|
try {
|
|
12390
12390
|
const W = await Promise.all(
|
|
12391
|
-
de.map(async (
|
|
12392
|
-
const
|
|
12393
|
-
new Uint8Array(
|
|
12391
|
+
de.map(async (I) => {
|
|
12392
|
+
const T = await I.arrayBuffer(), X = btoa(
|
|
12393
|
+
new Uint8Array(T).reduce((J, S) => J + String.fromCharCode(S), "")
|
|
12394
12394
|
);
|
|
12395
12395
|
return {
|
|
12396
|
-
filename:
|
|
12397
|
-
content_type:
|
|
12398
|
-
data:
|
|
12399
|
-
size:
|
|
12396
|
+
filename: I.name,
|
|
12397
|
+
content_type: I.type || "application/octet-stream",
|
|
12398
|
+
data: X,
|
|
12399
|
+
size: I.size
|
|
12400
12400
|
};
|
|
12401
12401
|
})
|
|
12402
|
-
),
|
|
12403
|
-
|
|
12404
|
-
to: _.trim(),
|
|
12402
|
+
), be = R.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Ke = {
|
|
12403
|
+
to: b.trim(),
|
|
12405
12404
|
cc: k.trim() || void 0,
|
|
12406
12405
|
bcc: B.trim() || void 0,
|
|
12407
12406
|
subject: L.trim(),
|
|
12408
|
-
html:
|
|
12407
|
+
html: be,
|
|
12409
12408
|
attachments: W,
|
|
12410
12409
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
12411
|
-
}
|
|
12410
|
+
};
|
|
12411
|
+
console.log("[MailComposer] Sending email:", {
|
|
12412
|
+
to: Ke.to,
|
|
12413
|
+
subject: Ke.subject,
|
|
12414
|
+
attachmentsCount: Ke.attachments.length,
|
|
12415
|
+
attachments: Ke.attachments.map((I) => ({ filename: I.filename, size: I.size, type: I.content_type }))
|
|
12416
|
+
}), await s(Ke), D(""), M(""), F(""), j(""), Y(""), ie([]);
|
|
12412
12417
|
} catch (W) {
|
|
12413
|
-
|
|
12418
|
+
we(W instanceof Error ? W.message : "Failed to send email");
|
|
12414
12419
|
} finally {
|
|
12415
|
-
|
|
12420
|
+
ve(!1);
|
|
12416
12421
|
}
|
|
12417
12422
|
}, ft = {
|
|
12418
12423
|
width: "100%",
|
|
@@ -12430,14 +12435,14 @@ function Sf({
|
|
|
12430
12435
|
color: v.textSecondary,
|
|
12431
12436
|
marginBottom: "4px",
|
|
12432
12437
|
textTransform: "uppercase"
|
|
12433
|
-
}, At = (W) => ({
|
|
12438
|
+
}, At = (W, be = !1) => ({
|
|
12434
12439
|
padding: "10px 20px",
|
|
12435
12440
|
fontSize: "14px",
|
|
12436
12441
|
fontWeight: 500,
|
|
12437
12442
|
border: "none",
|
|
12438
12443
|
borderRadius: "6px",
|
|
12439
|
-
cursor:
|
|
12440
|
-
opacity:
|
|
12444
|
+
cursor: be ? "not-allowed" : "pointer",
|
|
12445
|
+
opacity: be ? 0.6 : 1,
|
|
12441
12446
|
background: W ? v.buttonPrimary : v.buttonSecondary,
|
|
12442
12447
|
color: W ? "#ffffff" : v.text,
|
|
12443
12448
|
display: "flex",
|
|
@@ -12476,7 +12481,7 @@ function Sf({
|
|
|
12476
12481
|
"input",
|
|
12477
12482
|
{
|
|
12478
12483
|
type: "email",
|
|
12479
|
-
value:
|
|
12484
|
+
value: b,
|
|
12480
12485
|
onChange: (W) => D(W.target.value),
|
|
12481
12486
|
placeholder: "recipient@example.com",
|
|
12482
12487
|
disabled: d || oe,
|
|
@@ -12609,7 +12614,7 @@ function Sf({
|
|
|
12609
12614
|
]
|
|
12610
12615
|
}
|
|
12611
12616
|
),
|
|
12612
|
-
de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((W,
|
|
12617
|
+
de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((W, be) => /* @__PURE__ */ p.jsxs(
|
|
12613
12618
|
"div",
|
|
12614
12619
|
{
|
|
12615
12620
|
style: {
|
|
@@ -12630,7 +12635,7 @@ function Sf({
|
|
|
12630
12635
|
"button",
|
|
12631
12636
|
{
|
|
12632
12637
|
type: "button",
|
|
12633
|
-
onClick: () => Ut(
|
|
12638
|
+
onClick: () => Ut(be),
|
|
12634
12639
|
disabled: d || oe,
|
|
12635
12640
|
style: {
|
|
12636
12641
|
background: "none",
|
|
@@ -12646,7 +12651,7 @@ function Sf({
|
|
|
12646
12651
|
)
|
|
12647
12652
|
]
|
|
12648
12653
|
},
|
|
12649
|
-
`${W.name}-${
|
|
12654
|
+
`${W.name}-${be}`
|
|
12650
12655
|
)) })
|
|
12651
12656
|
] }),
|
|
12652
12657
|
/* @__PURE__ */ p.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
|
|
@@ -12656,7 +12661,7 @@ function Sf({
|
|
|
12656
12661
|
type: "button",
|
|
12657
12662
|
onClick: o,
|
|
12658
12663
|
disabled: d || oe,
|
|
12659
|
-
style: At(!1),
|
|
12664
|
+
style: At(!1, d || oe),
|
|
12660
12665
|
children: "Cancel"
|
|
12661
12666
|
}
|
|
12662
12667
|
),
|
|
@@ -12665,8 +12670,8 @@ function Sf({
|
|
|
12665
12670
|
{
|
|
12666
12671
|
type: "button",
|
|
12667
12672
|
onClick: Dt,
|
|
12668
|
-
disabled: d || oe || !
|
|
12669
|
-
style: At(!0),
|
|
12673
|
+
disabled: d || oe || !b.trim() || !L.trim(),
|
|
12674
|
+
style: At(!0, d || oe || !b.trim() || !L.trim()),
|
|
12670
12675
|
children: [
|
|
12671
12676
|
/* @__PURE__ */ p.jsx(
|
|
12672
12677
|
"span",
|
|
@@ -12734,7 +12739,7 @@ function kf({
|
|
|
12734
12739
|
), E = s && y.trim() && !r.some((B) => {
|
|
12735
12740
|
var F;
|
|
12736
12741
|
return ((F = B.label) == null ? void 0 : F.toLowerCase()) === y.toLowerCase();
|
|
12737
|
-
}), v = e.map((B) => r.find((F) => F.id === B)).filter(Boolean),
|
|
12742
|
+
}), v = e.map((B) => r.find((F) => F.id === B)).filter(Boolean), b = re((B) => {
|
|
12738
12743
|
var F;
|
|
12739
12744
|
c > 0 && e.length >= c || (t([...e, B]), C(""), (F = A.current) == null || F.focus());
|
|
12740
12745
|
}, [e, t, c]), D = re((B) => {
|
|
@@ -12742,10 +12747,10 @@ function kf({
|
|
|
12742
12747
|
}, [e, t]), k = re(async () => {
|
|
12743
12748
|
if (!E) return;
|
|
12744
12749
|
const B = await (o == null ? void 0 : o(y.trim()));
|
|
12745
|
-
B &&
|
|
12746
|
-
}, [E, y, o,
|
|
12747
|
-
B.key === "Enter" ? (B.preventDefault(), E ? k() : w.length > 0 &&
|
|
12748
|
-
}, [E, w, y, e, k,
|
|
12750
|
+
B && b(B.id), C("");
|
|
12751
|
+
}, [E, y, o, b]), M = re((B) => {
|
|
12752
|
+
B.key === "Enter" ? (B.preventDefault(), E ? k() : w.length > 0 && b(w[0].id)) : B.key === "Backspace" && !y && e.length > 0 ? D(e[e.length - 1]) : B.key === "Escape" && (m(!1), C(""));
|
|
12753
|
+
}, [E, w, y, e, k, b, D]);
|
|
12749
12754
|
return /* @__PURE__ */ p.jsxs("div", { ref: x, className: f, style: { position: "relative" }, children: [
|
|
12750
12755
|
a && /* @__PURE__ */ p.jsx(
|
|
12751
12756
|
"label",
|
|
@@ -12874,7 +12879,7 @@ function kf({
|
|
|
12874
12879
|
w.map((B) => /* @__PURE__ */ p.jsxs(
|
|
12875
12880
|
"div",
|
|
12876
12881
|
{
|
|
12877
|
-
onClick: () =>
|
|
12882
|
+
onClick: () => b(B.id),
|
|
12878
12883
|
style: {
|
|
12879
12884
|
padding: "10px 12px",
|
|
12880
12885
|
fontSize: "14px",
|
|
@@ -12975,7 +12980,7 @@ function Tf({
|
|
|
12975
12980
|
const Y = F.target;
|
|
12976
12981
|
Y.style.opacity = "0.5";
|
|
12977
12982
|
});
|
|
12978
|
-
}, [t, n]),
|
|
12983
|
+
}, [t, n]), b = re((F) => {
|
|
12979
12984
|
const L = F.target;
|
|
12980
12985
|
L.style.opacity = "1", m(null), C(null), A(null), w.current = null;
|
|
12981
12986
|
}, []), D = re((F, L, j) => {
|
|
@@ -13032,9 +13037,9 @@ function Tf({
|
|
|
13032
13037
|
"div",
|
|
13033
13038
|
{
|
|
13034
13039
|
draggable: !0,
|
|
13035
|
-
onDragStart: (
|
|
13036
|
-
onDragEnd:
|
|
13037
|
-
onDragOver: (
|
|
13040
|
+
onDragStart: (ve) => v(ve, R),
|
|
13041
|
+
onDragEnd: b,
|
|
13042
|
+
onDragOver: (ve) => D(ve, F.id, Y),
|
|
13038
13043
|
onClick: () => a == null ? void 0 : a(R),
|
|
13039
13044
|
className: `cursor-grab active:cursor-grabbing transition-all ${ie ? "opacity-50 scale-95" : ""} ${h}`,
|
|
13040
13045
|
children: o(R, ie)
|
|
@@ -13107,33 +13112,33 @@ function Bf({
|
|
|
13107
13112
|
theme: g = {}
|
|
13108
13113
|
}) {
|
|
13109
13114
|
const m = { ...df, ...g }, { allDayItems: y, timedItems: C } = bt(() => {
|
|
13110
|
-
const
|
|
13115
|
+
const b = [], D = [];
|
|
13111
13116
|
for (const k of r)
|
|
13112
|
-
l(k) ?
|
|
13113
|
-
return { allDayItems:
|
|
13117
|
+
l(k) ? b.push(k) : D.push(k);
|
|
13118
|
+
return { allDayItems: b, timedItems: D };
|
|
13114
13119
|
}, [r, l]), x = bt(() => {
|
|
13115
|
-
const
|
|
13120
|
+
const b = [];
|
|
13116
13121
|
for (let D = t; D <= n; D++)
|
|
13117
|
-
|
|
13118
|
-
return
|
|
13122
|
+
b.push(D);
|
|
13123
|
+
return b;
|
|
13119
13124
|
}, [t, n]), A = (n - t + 1) * s, w = re(
|
|
13120
|
-
(
|
|
13121
|
-
const D = o(
|
|
13125
|
+
(b) => {
|
|
13126
|
+
const D = o(b);
|
|
13122
13127
|
if (!D) return null;
|
|
13123
13128
|
const k = ff(D);
|
|
13124
13129
|
if (!k) return null;
|
|
13125
|
-
const { hours: M, minutes: B } = k, F = Math.max(t, Math.min(n, M)), L = M < t ? 0 : B, j = (F - t) * s + L / 60 * s, R = i(
|
|
13130
|
+
const { hours: M, minutes: B } = k, F = Math.max(t, Math.min(n, M)), L = M < t ? 0 : B, j = (F - t) * s + L / 60 * s, R = i(b), Y = Math.max(20, R / 60 * s);
|
|
13126
13131
|
return { top: j, height: Y };
|
|
13127
13132
|
},
|
|
13128
13133
|
[o, i, t, n, s]
|
|
13129
13134
|
), E = bt(() => {
|
|
13130
13135
|
if (!f || !pf(e)) return null;
|
|
13131
|
-
const
|
|
13136
|
+
const b = /* @__PURE__ */ new Date(), D = b.getHours(), k = b.getMinutes();
|
|
13132
13137
|
return D < t || D > n ? null : (D - t) * s + k / 60 * s;
|
|
13133
13138
|
}, [e, f, t, n, s]), v = re(
|
|
13134
|
-
(
|
|
13139
|
+
(b) => {
|
|
13135
13140
|
if (!d) return;
|
|
13136
|
-
const D =
|
|
13141
|
+
const D = b.currentTarget.getBoundingClientRect(), M = (b.clientY - D.top) / s * 60, B = Math.floor(M / 60) + t, F = Math.round(M % 60 / 15) * 15, L = Math.min(n, Math.max(t, B)), j = F >= 60 ? 0 : F, R = `${L.toString().padStart(2, "0")}:${j.toString().padStart(2, "0")}`;
|
|
13137
13142
|
d(R);
|
|
13138
13143
|
},
|
|
13139
13144
|
[d, s, t, n]
|
|
@@ -13161,20 +13166,20 @@ function Bf({
|
|
|
13161
13166
|
children: "All Day"
|
|
13162
13167
|
}
|
|
13163
13168
|
),
|
|
13164
|
-
/* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: y.map((
|
|
13169
|
+
/* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: y.map((b) => /* @__PURE__ */ p.jsx(
|
|
13165
13170
|
"div",
|
|
13166
13171
|
{
|
|
13167
|
-
onClick: () => c == null ? void 0 : c(
|
|
13172
|
+
onClick: () => c == null ? void 0 : c(b),
|
|
13168
13173
|
style: { cursor: c ? "pointer" : "default" },
|
|
13169
|
-
children: u(
|
|
13174
|
+
children: u(b)
|
|
13170
13175
|
},
|
|
13171
|
-
a(
|
|
13176
|
+
a(b)
|
|
13172
13177
|
)) })
|
|
13173
13178
|
]
|
|
13174
13179
|
}
|
|
13175
13180
|
),
|
|
13176
13181
|
/* @__PURE__ */ p.jsxs("div", { style: { position: "relative", height: A }, children: [
|
|
13177
|
-
x.map((
|
|
13182
|
+
x.map((b, D) => /* @__PURE__ */ p.jsxs("div", { style: { position: "absolute", top: D * s, left: 0, right: 0 }, children: [
|
|
13178
13183
|
/* @__PURE__ */ p.jsx(
|
|
13179
13184
|
"div",
|
|
13180
13185
|
{
|
|
@@ -13188,7 +13193,7 @@ function Bf({
|
|
|
13188
13193
|
fontSize: "11px",
|
|
13189
13194
|
color: m.hourTextColor
|
|
13190
13195
|
},
|
|
13191
|
-
children: hf(
|
|
13196
|
+
children: hf(b)
|
|
13192
13197
|
}
|
|
13193
13198
|
),
|
|
13194
13199
|
/* @__PURE__ */ p.jsx(
|
|
@@ -13217,7 +13222,7 @@ function Bf({
|
|
|
13217
13222
|
}
|
|
13218
13223
|
}
|
|
13219
13224
|
)
|
|
13220
|
-
] },
|
|
13225
|
+
] }, b)),
|
|
13221
13226
|
/* @__PURE__ */ p.jsx(
|
|
13222
13227
|
"div",
|
|
13223
13228
|
{
|
|
@@ -13271,8 +13276,8 @@ function Bf({
|
|
|
13271
13276
|
]
|
|
13272
13277
|
}
|
|
13273
13278
|
),
|
|
13274
|
-
C.map((
|
|
13275
|
-
const D = w(
|
|
13279
|
+
C.map((b) => {
|
|
13280
|
+
const D = w(b);
|
|
13276
13281
|
return D ? /* @__PURE__ */ p.jsx(
|
|
13277
13282
|
"div",
|
|
13278
13283
|
{
|
|
@@ -13286,43 +13291,43 @@ function Bf({
|
|
|
13286
13291
|
cursor: c ? "pointer" : "default"
|
|
13287
13292
|
},
|
|
13288
13293
|
onClick: (k) => {
|
|
13289
|
-
k.stopPropagation(), c == null || c(
|
|
13294
|
+
k.stopPropagation(), c == null || c(b);
|
|
13290
13295
|
},
|
|
13291
|
-
children: u(
|
|
13296
|
+
children: u(b)
|
|
13292
13297
|
},
|
|
13293
|
-
a(
|
|
13298
|
+
a(b)
|
|
13294
13299
|
) : null;
|
|
13295
13300
|
})
|
|
13296
13301
|
] })
|
|
13297
13302
|
] });
|
|
13298
13303
|
}
|
|
13299
13304
|
function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, variant: s = "widget", hideSaveButton: o = !1 }) {
|
|
13300
|
-
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null),
|
|
13301
|
-
const T = Math.floor(
|
|
13305
|
+
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null), M = xe(null), B = xe(null), F = xe([]), L = xe(null), j = xe(null), R = xe(null), Y = xe(null), de = xe(!1), ie = xe([]), oe = xe(null), ve = xe(null), pe = xe([]), we = xe([]), Se = xe("insert"), Oe = xe(!1), ke = xe(0), Ce = xe(0), Ge = xe(0), ze = (I) => {
|
|
13306
|
+
const T = Math.floor(I / 60), X = Math.floor(I % 60);
|
|
13302
13307
|
return `${T.toString().padStart(2, "0")}:${X.toString().padStart(2, "0")}`;
|
|
13303
|
-
}, ge = async (
|
|
13304
|
-
const T = await
|
|
13308
|
+
}, ge = async (I) => {
|
|
13309
|
+
const T = await I.arrayBuffer(), X = new AudioContext(), J = await X.decodeAudioData(T);
|
|
13305
13310
|
return await X.close(), J;
|
|
13306
|
-
}, Me = (
|
|
13307
|
-
const T =
|
|
13311
|
+
}, Me = (I) => {
|
|
13312
|
+
const T = I.numberOfChannels, X = I.sampleRate, J = 1, S = 16, $ = S / 8, K = T * $, Q = X * K, ee = I.length * K, ae = new ArrayBuffer(44 + ee), ne = new DataView(ae), te = (ye, fe) => {
|
|
13308
13313
|
for (let qe = 0; qe < fe.length; qe++)
|
|
13309
13314
|
ne.setUint8(ye + qe, fe.charCodeAt(qe));
|
|
13310
13315
|
};
|
|
13311
13316
|
te(0, "RIFF"), ne.setUint32(4, 36 + ee, !0), te(8, "WAVE"), te(12, "fmt "), ne.setUint32(16, 16, !0), ne.setUint16(20, J, !0), ne.setUint16(22, T, !0), ne.setUint32(24, X, !0), ne.setUint32(28, Q, !0), ne.setUint16(32, K, !0), ne.setUint16(34, S, !0), te(36, "data"), ne.setUint32(40, ee, !0);
|
|
13312
13317
|
const Ae = [];
|
|
13313
13318
|
for (let ye = 0; ye < T; ye++)
|
|
13314
|
-
Ae.push(
|
|
13319
|
+
Ae.push(I.getChannelData(ye));
|
|
13315
13320
|
let Fe = 44;
|
|
13316
|
-
for (let ye = 0; ye <
|
|
13321
|
+
for (let ye = 0; ye < I.length; ye++)
|
|
13317
13322
|
for (let fe = 0; fe < T; fe++) {
|
|
13318
13323
|
const qe = Math.max(-1, Math.min(1, Ae[fe][ye])), Ue = qe < 0 ? qe * 32768 : qe * 32767;
|
|
13319
13324
|
ne.setInt16(Fe, Ue, !0), Fe += 2;
|
|
13320
13325
|
}
|
|
13321
13326
|
return new Blob([ae], { type: "audio/wav" });
|
|
13322
|
-
}, ct = async (
|
|
13323
|
-
const S = new AudioContext(),
|
|
13327
|
+
}, ct = async (I, T, X, J) => {
|
|
13328
|
+
const S = new AudioContext(), $ = I.sampleRate, K = Math.max(I.numberOfChannels, T.numberOfChannels), Q = Math.min(X, I.length), ee = Math.max(0, I.length - X), ae = J === "insert" ? Q + T.length + ee : Q + T.length, ne = S.createBuffer(K, ae, $);
|
|
13324
13329
|
for (let te = 0; te < K; te++) {
|
|
13325
|
-
const Ae = ne.getChannelData(te), Fe = te <
|
|
13330
|
+
const Ae = ne.getChannelData(te), Fe = te < I.numberOfChannels ? I.getChannelData(te) : I.getChannelData(0);
|
|
13326
13331
|
for (let fe = 0; fe < Q; fe++)
|
|
13327
13332
|
Ae[fe] = Fe[fe];
|
|
13328
13333
|
const ye = te < T.numberOfChannels ? T.getChannelData(te) : T.getChannelData(0);
|
|
@@ -13334,11 +13339,11 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13334
13339
|
}
|
|
13335
13340
|
return await S.close(), ne;
|
|
13336
13341
|
}, Ct = re(() => {
|
|
13337
|
-
const
|
|
13338
|
-
if (!
|
|
13339
|
-
const T =
|
|
13342
|
+
const I = b.current;
|
|
13343
|
+
if (!I) return;
|
|
13344
|
+
const T = I.getContext("2d");
|
|
13340
13345
|
if (!T) return;
|
|
13341
|
-
const X =
|
|
13346
|
+
const X = I.getBoundingClientRect(), J = X.width, S = X.height, $ = ie.current, K = d || u || 1, Q = l === "recording" ? u : m;
|
|
13342
13347
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13343
13348
|
const ee = 8, ae = "rgba(0, 0, 0, 0.4)", ne = T.createLinearGradient(0, 0, 0, ee);
|
|
13344
13349
|
ne.addColorStop(0, ae), ne.addColorStop(1, "transparent"), T.fillStyle = ne, T.fillRect(0, 0, J, ee);
|
|
@@ -13349,80 +13354,80 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13349
13354
|
const Fe = T.createLinearGradient(J - ee, 0, J, 0);
|
|
13350
13355
|
Fe.addColorStop(0, "transparent"), Fe.addColorStop(1, ae), T.fillStyle = Fe, T.fillRect(J - ee, 0, ee, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13351
13356
|
const ye = J / 2;
|
|
13352
|
-
if (
|
|
13357
|
+
if ($.length > 0)
|
|
13353
13358
|
if (l === "recording")
|
|
13354
|
-
for (let Ue = 0; Ue <
|
|
13355
|
-
const lt =
|
|
13359
|
+
for (let Ue = 0; Ue < $.length; Ue++) {
|
|
13360
|
+
const lt = $.length - 1 - Ue, Et = ye - lt * 4;
|
|
13356
13361
|
if (Et < -3 || Et > J) continue;
|
|
13357
|
-
const pt =
|
|
13362
|
+
const pt = $[Ue] * (S / 2 - 12), Pt = S / 2 - pt;
|
|
13358
13363
|
T.fillStyle = "#10b981", T.fillRect(Et, Pt, 3, pt * 2);
|
|
13359
13364
|
}
|
|
13360
13365
|
else {
|
|
13361
|
-
const Ue = K > 0 ? Q / K *
|
|
13362
|
-
for (let lt = 0; lt <
|
|
13366
|
+
const Ue = K > 0 ? Q / K * $.length : 0;
|
|
13367
|
+
for (let lt = 0; lt < $.length; lt++) {
|
|
13363
13368
|
const Et = Ue - lt, pt = ye - Et * 4;
|
|
13364
13369
|
if (pt < -3 || pt > J) continue;
|
|
13365
|
-
const Pt =
|
|
13370
|
+
const Pt = $[lt] * (S / 2 - 12), yr = S / 2 - Pt;
|
|
13366
13371
|
T.fillStyle = lt <= Ue ? "#10b981" : "#4b5563", T.fillRect(pt, yr, 3, Pt * 2);
|
|
13367
13372
|
}
|
|
13368
13373
|
}
|
|
13369
13374
|
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(ye, 0), T.lineTo(ye, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText(ze(Q), ye, S - 6), l === "recording" && (T.fillStyle = "#ef4444", T.beginPath(), T.arc(20, 20, 8, 0, Math.PI * 2), T.fill(), T.fillStyle = "#fff", T.font = "10px sans-serif", T.textAlign = "left", T.fillText("REC", 34, 24)), T.textAlign = "left";
|
|
13370
13375
|
}, [l, m, u, d]), qt = () => {
|
|
13371
|
-
const
|
|
13372
|
-
if (!
|
|
13373
|
-
const T =
|
|
13374
|
-
|
|
13376
|
+
const I = B.current;
|
|
13377
|
+
if (!I || !de.current) return;
|
|
13378
|
+
const T = I.frequencyBinCount, X = new Uint8Array(T);
|
|
13379
|
+
I.getByteTimeDomainData(X);
|
|
13375
13380
|
let J = 0;
|
|
13376
13381
|
for (let K = 0; K < T; K++) {
|
|
13377
13382
|
const Q = (X[K] - 128) / 128;
|
|
13378
13383
|
J += Q * Q;
|
|
13379
13384
|
}
|
|
13380
|
-
const S = Math.sqrt(J / T),
|
|
13381
|
-
ie.current.push(
|
|
13385
|
+
const S = Math.sqrt(J / T), $ = Math.min(1, S * 3);
|
|
13386
|
+
ie.current.push($), Ct(), de.current && (j.current = requestAnimationFrame(qt));
|
|
13382
13387
|
}, it = async () => {
|
|
13383
13388
|
try {
|
|
13384
13389
|
x(null), w(!1), oe.current === null && (ie.current = []);
|
|
13385
|
-
const
|
|
13386
|
-
k.current =
|
|
13390
|
+
const I = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
13391
|
+
k.current = I;
|
|
13387
13392
|
const T = new AudioContext();
|
|
13388
13393
|
M.current = T;
|
|
13389
13394
|
const X = T.createAnalyser();
|
|
13390
|
-
X.fftSize = 2048, B.current = X, T.createMediaStreamSource(
|
|
13391
|
-
const S = new MediaRecorder(
|
|
13392
|
-
D.current = S, F.current = [], S.ondataavailable = (
|
|
13393
|
-
|
|
13395
|
+
X.fftSize = 2048, B.current = X, T.createMediaStreamSource(I).connect(X);
|
|
13396
|
+
const S = new MediaRecorder(I);
|
|
13397
|
+
D.current = S, F.current = [], S.ondataavailable = ($) => {
|
|
13398
|
+
$.data.size > 0 && F.current.push($.data);
|
|
13394
13399
|
}, S.onstop = async () => {
|
|
13395
13400
|
try {
|
|
13396
13401
|
if (de.current = !1, F.current.length === 0) {
|
|
13397
|
-
x("No audio was recorded. Please try again."), a("idle"),
|
|
13402
|
+
x("No audio was recorded. Please try again."), a("idle"), I.getTracks().forEach((ne) => ne.stop());
|
|
13398
13403
|
return;
|
|
13399
13404
|
}
|
|
13400
|
-
const
|
|
13405
|
+
const $ = new Blob(F.current, { type: "audio/webm" });
|
|
13401
13406
|
let K, Q;
|
|
13402
|
-
if (oe.current !== null &&
|
|
13407
|
+
if (oe.current !== null && ve.current)
|
|
13403
13408
|
try {
|
|
13404
|
-
const ne = await ge(
|
|
13405
|
-
|
|
13409
|
+
const ne = await ge($), te = ve.current.sampleRate, Ae = Math.floor(oe.current * te), Fe = await ct(
|
|
13410
|
+
ve.current,
|
|
13406
13411
|
ne,
|
|
13407
13412
|
Ae,
|
|
13408
13413
|
Se.current
|
|
13409
13414
|
);
|
|
13410
13415
|
K = Me(Fe), Q = Fe.length / Fe.sampleRate, Se.current === "insert" && (ie.current = [
|
|
13411
13416
|
...ie.current,
|
|
13412
|
-
...
|
|
13413
|
-
]), oe.current = null,
|
|
13417
|
+
...we.current
|
|
13418
|
+
]), oe.current = null, ve.current = null, pe.current = [], we.current = [];
|
|
13414
13419
|
} catch {
|
|
13415
|
-
K =
|
|
13420
|
+
K = $, Q = ke.current > 0 ? ke.current : 1;
|
|
13416
13421
|
}
|
|
13417
13422
|
else
|
|
13418
|
-
K =
|
|
13423
|
+
K = $, Q = ke.current > 0 ? ke.current : 1;
|
|
13419
13424
|
Y.current = K;
|
|
13420
13425
|
const ee = URL.createObjectURL(K), ae = new Audio(ee);
|
|
13421
13426
|
ae.ontimeupdate = () => {
|
|
13422
13427
|
y(ae.currentTime);
|
|
13423
13428
|
}, ae.onended = () => {
|
|
13424
13429
|
g(!1);
|
|
13425
|
-
}, R.current = ae, f(Q), y(Q), a("editing"),
|
|
13430
|
+
}, R.current = ae, f(Q), y(Q), a("editing"), I.getTracks().forEach((ne) => ne.stop());
|
|
13426
13431
|
} catch {
|
|
13427
13432
|
x("Failed to process recording"), a("idle");
|
|
13428
13433
|
}
|
|
@@ -13434,87 +13439,87 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13434
13439
|
}
|
|
13435
13440
|
}, ot = () => {
|
|
13436
13441
|
de.current = !1, w(!1), v(null), j.current && (cancelAnimationFrame(j.current), j.current = null), L.current && (clearInterval(L.current), L.current = null), D.current && D.current.state !== "inactive" && D.current.stop();
|
|
13437
|
-
}, dt = (
|
|
13438
|
-
const T =
|
|
13442
|
+
}, dt = (I) => {
|
|
13443
|
+
const T = b.current;
|
|
13439
13444
|
if (!T) return;
|
|
13440
13445
|
const X = d || u;
|
|
13441
13446
|
if (X <= 0) return;
|
|
13442
13447
|
const J = ie.current;
|
|
13443
13448
|
if (J.length === 0) return;
|
|
13444
|
-
const S = T.getBoundingClientRect(),
|
|
13449
|
+
const S = T.getBoundingClientRect(), $ = I - Ce.current, K = 4, Q = S.width / T.width, ee = J.length / X * K, ae = -$ / (ee * Q), ne = Ge.current + ae, te = Math.max(0, Math.min(ne, X));
|
|
13445
13450
|
R.current && (R.current.currentTime = te), y(te);
|
|
13446
13451
|
}, Ut = () => {
|
|
13447
13452
|
R.current && (R.current.currentTime = 0), y(0);
|
|
13448
13453
|
}, Wt = () => {
|
|
13449
|
-
const
|
|
13450
|
-
R.current && (R.current.currentTime =
|
|
13454
|
+
const I = d || u;
|
|
13455
|
+
R.current && (R.current.currentTime = I), y(I);
|
|
13451
13456
|
}, Dt = () => {
|
|
13452
|
-
const
|
|
13453
|
-
|
|
13457
|
+
const I = R.current;
|
|
13458
|
+
I && (h ? (I.pause(), y(I.currentTime), g(!1)) : (I.currentTime = m, I.play().catch(() => {
|
|
13454
13459
|
}), g(!0)));
|
|
13455
|
-
}, ft = async (
|
|
13460
|
+
}, ft = async (I) => {
|
|
13456
13461
|
if (!Y.current) {
|
|
13457
13462
|
it();
|
|
13458
13463
|
return;
|
|
13459
13464
|
}
|
|
13460
13465
|
try {
|
|
13461
|
-
R.current && (R.current.pause(), g(!1)), Se.current =
|
|
13466
|
+
R.current && (R.current.pause(), g(!1)), Se.current = I, ve.current = await ge(Y.current);
|
|
13462
13467
|
const T = d || u;
|
|
13463
13468
|
oe.current = m;
|
|
13464
13469
|
const X = T > 0 ? m / T : 0, J = Math.floor(X * ie.current.length);
|
|
13465
|
-
pe.current = ie.current.slice(0, J),
|
|
13470
|
+
pe.current = ie.current.slice(0, J), we.current = ie.current.slice(J), ie.current = [...pe.current], it();
|
|
13466
13471
|
} catch {
|
|
13467
13472
|
x("Failed to prepare recording. Please try again.");
|
|
13468
13473
|
}
|
|
13469
13474
|
}, ht = () => {
|
|
13470
|
-
R.current && (R.current.pause(), R.current = null), Y.current = null,
|
|
13475
|
+
R.current && (R.current.pause(), R.current = null), Y.current = null, ve.current = null, oe.current = null, pe.current = [], g(!1), y(0), f(0), c(0), it();
|
|
13471
13476
|
}, At = () => {
|
|
13472
13477
|
Y.current ? r(Y.current, d || u) : alert("No audio recorded yet!");
|
|
13473
13478
|
};
|
|
13474
13479
|
if (De(() => {
|
|
13475
|
-
l === "recording" &&
|
|
13480
|
+
l === "recording" && b.current && B.current && de.current && (j.current = requestAnimationFrame(qt));
|
|
13476
13481
|
}, [l]), De(() => {
|
|
13477
|
-
const
|
|
13478
|
-
if (!
|
|
13482
|
+
const I = b.current;
|
|
13483
|
+
if (!I) return;
|
|
13479
13484
|
const T = () => {
|
|
13480
|
-
const X = window.devicePixelRatio || 1, J =
|
|
13481
|
-
|
|
13482
|
-
const S =
|
|
13485
|
+
const X = window.devicePixelRatio || 1, J = I.getBoundingClientRect();
|
|
13486
|
+
I.width = J.width * X, I.height = J.height * X;
|
|
13487
|
+
const S = I.getContext("2d");
|
|
13483
13488
|
S && S.scale(X, X);
|
|
13484
13489
|
};
|
|
13485
13490
|
return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
13486
13491
|
}, []), De(() => {
|
|
13487
13492
|
if (l === "idle") {
|
|
13488
|
-
const
|
|
13489
|
-
if (!
|
|
13490
|
-
const T =
|
|
13493
|
+
const I = b.current;
|
|
13494
|
+
if (!I) return;
|
|
13495
|
+
const T = I.getContext("2d");
|
|
13491
13496
|
if (!T) return;
|
|
13492
|
-
const X =
|
|
13497
|
+
const X = I.getBoundingClientRect(), J = X.width, S = X.height;
|
|
13493
13498
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13494
|
-
const
|
|
13495
|
-
Q.addColorStop(0, K), Q.addColorStop(1, "transparent"), T.fillStyle = Q, T.fillRect(0, 0, J,
|
|
13496
|
-
const ee = T.createLinearGradient(0, S -
|
|
13497
|
-
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S -
|
|
13498
|
-
const ae = T.createLinearGradient(0, 0,
|
|
13499
|
-
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0,
|
|
13500
|
-
const ne = T.createLinearGradient(J -
|
|
13501
|
-
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J -
|
|
13499
|
+
const $ = 8, K = "rgba(0, 0, 0, 0.4)", Q = T.createLinearGradient(0, 0, 0, $);
|
|
13500
|
+
Q.addColorStop(0, K), Q.addColorStop(1, "transparent"), T.fillStyle = Q, T.fillRect(0, 0, J, $);
|
|
13501
|
+
const ee = T.createLinearGradient(0, S - $, 0, S);
|
|
13502
|
+
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S - $, J, $);
|
|
13503
|
+
const ae = T.createLinearGradient(0, 0, $, 0);
|
|
13504
|
+
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0, $, S);
|
|
13505
|
+
const ne = T.createLinearGradient(J - $, 0, J, 0);
|
|
13506
|
+
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J - $, 0, $, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13502
13507
|
const te = J / 2;
|
|
13503
13508
|
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(te, 0), T.lineTo(te, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText("00:00", te, S - 6);
|
|
13504
13509
|
}
|
|
13505
13510
|
}, [l]), De(() => () => {
|
|
13506
|
-
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((
|
|
13511
|
+
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((I) => I.stop()), M.current && M.current.state !== "closed" && M.current.close();
|
|
13507
13512
|
}, []), De(() => {
|
|
13508
13513
|
if (l === "editing" && h) {
|
|
13509
|
-
let
|
|
13514
|
+
let I;
|
|
13510
13515
|
const T = () => {
|
|
13511
13516
|
const X = R.current;
|
|
13512
13517
|
if (X && h) {
|
|
13513
|
-
const J =
|
|
13518
|
+
const J = b.current;
|
|
13514
13519
|
if (J) {
|
|
13515
13520
|
const S = J.getContext("2d");
|
|
13516
13521
|
if (S) {
|
|
13517
|
-
const
|
|
13522
|
+
const $ = J.getBoundingClientRect(), K = $.width, Q = $.height, ee = ie.current, ae = d || u || 1, ne = X.currentTime;
|
|
13518
13523
|
S.fillStyle = "#2d3b35", S.fillRect(0, 0, K, Q);
|
|
13519
13524
|
const te = 8, Ae = "rgba(0, 0, 0, 0.4)", Fe = S.createLinearGradient(0, 0, 0, te);
|
|
13520
13525
|
Fe.addColorStop(0, Ae), Fe.addColorStop(1, "transparent"), S.fillStyle = Fe, S.fillRect(0, 0, K, te);
|
|
@@ -13536,10 +13541,10 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13536
13541
|
S.fillText(`${Pt.toString().padStart(2, "0")}:${yr.toString().padStart(2, "0")}`, Ue, Q - 6), S.textAlign = "left";
|
|
13537
13542
|
}
|
|
13538
13543
|
}
|
|
13539
|
-
|
|
13544
|
+
I = requestAnimationFrame(T);
|
|
13540
13545
|
}
|
|
13541
13546
|
};
|
|
13542
|
-
return
|
|
13547
|
+
return I = requestAnimationFrame(T), () => cancelAnimationFrame(I);
|
|
13543
13548
|
}
|
|
13544
13549
|
}, [l, h, d, u]), De(() => {
|
|
13545
13550
|
l === "editing" && !h && Ct();
|
|
@@ -13567,20 +13572,20 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13567
13572
|
alignItems: "center",
|
|
13568
13573
|
justifyContent: "center",
|
|
13569
13574
|
transition: "background 0.15s"
|
|
13570
|
-
},
|
|
13575
|
+
}, be = {
|
|
13571
13576
|
...W,
|
|
13572
13577
|
opacity: 0.3,
|
|
13573
13578
|
cursor: "not-allowed"
|
|
13574
|
-
},
|
|
13575
|
-
return /* @__PURE__ */ p.jsxs("div", { style:
|
|
13579
|
+
}, Ke = i ? { border: "1px solid #e5e5e5", borderRadius: "12px", overflow: "hidden", background: "white" } : { overflow: "hidden", background: "white", flexShrink: 0 };
|
|
13580
|
+
return /* @__PURE__ */ p.jsxs("div", { style: Ke, children: [
|
|
13576
13581
|
/* @__PURE__ */ p.jsx(
|
|
13577
13582
|
"canvas",
|
|
13578
13583
|
{
|
|
13579
|
-
ref:
|
|
13584
|
+
ref: b,
|
|
13580
13585
|
style: { width: "100%", height: "32px", cursor: "pointer", flexShrink: 0 },
|
|
13581
|
-
onMouseDown: (
|
|
13586
|
+
onMouseDown: (I) => {
|
|
13582
13587
|
if (l === "editing") {
|
|
13583
|
-
Oe.current = !0,
|
|
13588
|
+
Oe.current = !0, Ce.current = I.clientX, Ge.current = m;
|
|
13584
13589
|
const T = (J) => {
|
|
13585
13590
|
Oe.current && dt(J.clientX);
|
|
13586
13591
|
}, X = () => {
|
|
@@ -13611,7 +13616,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13611
13616
|
{
|
|
13612
13617
|
onClick: Ut,
|
|
13613
13618
|
disabled: l === "idle" || l === "recording",
|
|
13614
|
-
style: l === "idle" || l === "recording" ?
|
|
13619
|
+
style: l === "idle" || l === "recording" ? be : W,
|
|
13615
13620
|
title: "Go to start",
|
|
13616
13621
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "first_page" })
|
|
13617
13622
|
}
|
|
@@ -13621,13 +13626,13 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13621
13626
|
{
|
|
13622
13627
|
onClick: () => {
|
|
13623
13628
|
if (l === "recording") {
|
|
13624
|
-
const
|
|
13625
|
-
|
|
13629
|
+
const I = D.current;
|
|
13630
|
+
I && (I.state === "recording" ? (I.pause(), w(!0)) : I.state === "paused" && (I.resume(), w(!1)));
|
|
13626
13631
|
} else
|
|
13627
13632
|
Dt();
|
|
13628
13633
|
},
|
|
13629
13634
|
disabled: l === "idle",
|
|
13630
|
-
style: l === "idle" ?
|
|
13635
|
+
style: l === "idle" ? be : W,
|
|
13631
13636
|
title: h || l === "recording" && !A ? "Pause" : "Play",
|
|
13632
13637
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: h || l === "recording" && !A ? "pause" : "play_arrow" })
|
|
13633
13638
|
}
|
|
@@ -13637,7 +13642,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13637
13642
|
{
|
|
13638
13643
|
onClick: Wt,
|
|
13639
13644
|
disabled: l === "idle" || l === "recording",
|
|
13640
|
-
style: l === "idle" || l === "recording" ?
|
|
13645
|
+
style: l === "idle" || l === "recording" ? be : W,
|
|
13641
13646
|
title: "Go to end",
|
|
13642
13647
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "last_page" })
|
|
13643
13648
|
}
|
|
@@ -13650,7 +13655,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13650
13655
|
E === "insert" ? ot() : l === "idle" ? (v("insert"), it()) : l === "editing" && (v("insert"), ft("insert"));
|
|
13651
13656
|
},
|
|
13652
13657
|
disabled: l === "recording" && E !== "insert" || h,
|
|
13653
|
-
style: l === "recording" && E !== "insert" || h ?
|
|
13658
|
+
style: l === "recording" && E !== "insert" || h ? be : W,
|
|
13654
13659
|
title: E === "insert" ? "Stop recording" : "Insert recording",
|
|
13655
13660
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "insert" ? "#ef4444" : "#171717" }, children: "add" })
|
|
13656
13661
|
}
|
|
@@ -13662,7 +13667,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13662
13667
|
E === "mic" ? ot() : l === "idle" ? (v("mic"), it()) : l === "editing" && (v("mic"), ft("replace"));
|
|
13663
13668
|
},
|
|
13664
13669
|
disabled: l === "recording" && E !== "mic" || h,
|
|
13665
|
-
style: l === "recording" && E !== "mic" || h ?
|
|
13670
|
+
style: l === "recording" && E !== "mic" || h ? be : W,
|
|
13666
13671
|
title: E === "mic" ? "Stop recording" : "Record",
|
|
13667
13672
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
13668
13673
|
}
|
|
@@ -13674,7 +13679,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13674
13679
|
E === "startover" ? ot() : l === "editing" && (v("startover"), ht());
|
|
13675
13680
|
},
|
|
13676
13681
|
disabled: l === "idle" || l === "recording" && E !== "startover" || h,
|
|
13677
|
-
style: l === "idle" || l === "recording" && E !== "startover" || h ?
|
|
13682
|
+
style: l === "idle" || l === "recording" && E !== "startover" || h ? be : W,
|
|
13678
13683
|
title: E === "startover" ? "Stop recording" : "Start over",
|
|
13679
13684
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
|
|
13680
13685
|
}
|
|
@@ -13686,7 +13691,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13686
13691
|
{
|
|
13687
13692
|
onClick: () => Y.current && t(Y.current),
|
|
13688
13693
|
disabled: l !== "editing" || n,
|
|
13689
|
-
style: l !== "editing" || n ?
|
|
13694
|
+
style: l !== "editing" || n ? be : W,
|
|
13690
13695
|
title: n ? "Transcribing..." : "Transcribe audio",
|
|
13691
13696
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: n ? "hourglass_empty" : "subtitles" })
|
|
13692
13697
|
}
|
|
@@ -13696,7 +13701,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13696
13701
|
{
|
|
13697
13702
|
onClick: At,
|
|
13698
13703
|
disabled: l !== "editing",
|
|
13699
|
-
style: l !== "editing" ?
|
|
13704
|
+
style: l !== "editing" ? be : W,
|
|
13700
13705
|
title: "Save recording",
|
|
13701
13706
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "save" })
|
|
13702
13707
|
}
|