@qwanyx/stack 0.2.40 → 0.2.42
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 +19 -19
- package/dist/index.esm.js +504 -507
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -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) => {
|
|
@@ -4068,57 +4068,57 @@ var Ji;
|
|
|
4068
4068
|
function pu() {
|
|
4069
4069
|
return Ji || (Ji = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4070
4070
|
var r = He, 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 (
|
|
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,19 +4229,19 @@ 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;
|
|
4236
4236
|
{
|
|
4237
|
-
var
|
|
4238
|
-
Me = new
|
|
4237
|
+
var ct = typeof WeakMap == "function" ? WeakMap : Map;
|
|
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,7 +4281,7 @@ 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") {
|
|
@@ -4294,76 +4294,76 @@ function pu() {
|
|
|
4294
4294
|
if (Ne !== 1 || je !== 1)
|
|
4295
4295
|
do
|
|
4296
4296
|
if (Ne--, je--, je < 0 || se[Ne] !== Ke[je]) {
|
|
4297
|
-
var
|
|
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
|
}
|
|
4344
4344
|
}
|
|
4345
4345
|
return "";
|
|
4346
4346
|
}
|
|
4347
|
-
var
|
|
4348
|
-
function Dt(
|
|
4349
|
-
if (
|
|
4350
|
-
var P =
|
|
4347
|
+
var dt = Object.prototype.hasOwnProperty, Ut = {}, Wt = C.ReactDebugCurrentFrame;
|
|
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
|
|
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 Ke = Error((Z || "React class") + ": " + G + " type `" + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
4362
|
+
if (typeof _[le] != "function") {
|
|
4363
|
+
var Ke = 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
4364
|
throw Ke.name = "Invariant Violation", Ke;
|
|
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
|
}
|
|
@@ -4371,29 +4371,29 @@ function pu() {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
|
-
var
|
|
4375
|
-
function At(
|
|
4376
|
-
return
|
|
4374
|
+
var ht = Array.isArray;
|
|
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 Xe(
|
|
4386
|
+
return Xe(_), !1;
|
|
4387
4387
|
} catch {
|
|
4388
4388
|
return !0;
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
|
-
function Xe(
|
|
4392
|
-
return "" +
|
|
4391
|
+
function Xe(_) {
|
|
4392
|
+
return "" + _;
|
|
4393
4393
|
}
|
|
4394
|
-
function q(
|
|
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 q(_) {
|
|
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(_)), Xe(_);
|
|
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 I(
|
|
4405
|
-
if (
|
|
4406
|
-
var P = Object.getOwnPropertyDescriptor(
|
|
4404
|
+
function I(_) {
|
|
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 (
|
|
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
|
|
4476
|
+
var _e, le = {}, se = null, Ke = null;
|
|
4477
4477
|
G !== void 0 && (q(G), se = "" + G), K(P) && (q(P.key), se = "" + P.key), I(P) && (Ke = P.ref, Q(P, he));
|
|
4478
|
-
for (
|
|
4479
|
-
|
|
4480
|
-
if (
|
|
4481
|
-
var Ne =
|
|
4482
|
-
for (
|
|
4483
|
-
le[
|
|
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
4485
|
if (se || Ke) {
|
|
4486
|
-
var je = typeof
|
|
4486
|
+
var je = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _;
|
|
4487
4487
|
se && ee(le, je), Ke && ae(le, je);
|
|
4488
4488
|
}
|
|
4489
|
-
return ne(
|
|
4489
|
+
return ne(_, se, Ke, 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
|
|
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
|
-
|
|
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,48 +4587,48 @@ 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 Ke =
|
|
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 Ke = lt();
|
|
4610
4610
|
Ke ? se += Ke : 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) {
|
|
4618
|
-
var
|
|
4619
|
-
if (
|
|
4618
|
+
var at = P.children;
|
|
4619
|
+
if (at !== void 0)
|
|
4620
4620
|
if (Z)
|
|
4621
|
-
if (At(
|
|
4622
|
-
for (var br = 0; br <
|
|
4623
|
-
yr(
|
|
4624
|
-
Object.freeze && Object.freeze(
|
|
4621
|
+
if (At(at)) {
|
|
4622
|
+
for (var br = 0; br < at.length; br++)
|
|
4623
|
+
yr(at[br], _);
|
|
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(
|
|
4628
|
+
yr(at, _);
|
|
4629
4629
|
}
|
|
4630
|
-
if (
|
|
4631
|
-
var rr = L(
|
|
4630
|
+
if (dt.call(P, "key")) {
|
|
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,15 +5259,15 @@ 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
|
(I) => _r(I.from).toLowerCase().includes(S) || _r(I.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 {
|
|
@@ -5283,7 +5283,7 @@ function Af({
|
|
|
5283
5283
|
De(() => {
|
|
5284
5284
|
k([]), R(/* @__PURE__ */ new Set()), oe(null), L(null), a === void 0 && ke(""), d && Me();
|
|
5285
5285
|
}, [s, d]);
|
|
5286
|
-
const
|
|
5286
|
+
const ct = re(async (S) => {
|
|
5287
5287
|
if (ge) {
|
|
5288
5288
|
oe(S), pe(null), Se(!0);
|
|
5289
5289
|
try {
|
|
@@ -5295,10 +5295,10 @@ function Af({
|
|
|
5295
5295
|
Se(!1);
|
|
5296
5296
|
}
|
|
5297
5297
|
}, [ge, t, s]), Ct = re((S) => {
|
|
5298
|
-
f == null || f(S), i &&
|
|
5299
|
-
}, [f, i,
|
|
5298
|
+
f == null || f(S), i && ct(S);
|
|
5299
|
+
}, [f, i, ct]), qt = re((S, I, K) => {
|
|
5300
5300
|
if (!o) {
|
|
5301
|
-
f == null || f(S), i &&
|
|
5301
|
+
f == null || f(S), i && ct(S);
|
|
5302
5302
|
return;
|
|
5303
5303
|
}
|
|
5304
5304
|
const Q = S.uid;
|
|
@@ -5344,7 +5344,7 @@ function Af({
|
|
|
5344
5344
|
const K = I instanceof Error ? I : new Error("Archive failed");
|
|
5345
5345
|
console.error("Archive error:", K), L(K.message), m == null || m(K);
|
|
5346
5346
|
}
|
|
5347
|
-
}, [ge, t, j, s, g, m]),
|
|
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 {
|
|
@@ -5357,16 +5357,16 @@ function Af({
|
|
|
5357
5357
|
delete: it,
|
|
5358
5358
|
archive: ot,
|
|
5359
5359
|
refresh: Me,
|
|
5360
|
-
selectAll:
|
|
5360
|
+
selectAll: dt,
|
|
5361
5361
|
clearSelection: Ut
|
|
5362
5362
|
}, Dt = (S) => {
|
|
5363
5363
|
if (!S) return "";
|
|
5364
5364
|
const I = new Date(S), K = /* @__PURE__ */ new Date();
|
|
5365
5365
|
return I.toDateString() === K.toDateString() ? I.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : I.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5366
|
-
},
|
|
5366
|
+
}, ft = (S, I) => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5367
5367
|
padding: "12px 16px",
|
|
5368
|
-
background: I ?
|
|
5369
|
-
borderBottom: `1px solid ${
|
|
5368
|
+
background: I ? 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,31 +5391,31 @@ 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
|
-
] }) }),
|
|
5398
|
-
/* @__PURE__ */ p.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
5399
|
-
/* @__PURE__ */ p.jsxs("div", { style: { fontSize: "14px", color:
|
|
5397
|
+
] }) }), ht = (S) => /* @__PURE__ */ p.jsxs("div", { style: { padding: "24px" }, children: [
|
|
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:
|
|
5411
|
+
) : /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color: b.textSecondary }, children: "No content available" })
|
|
5412
5412
|
] }), At = (S, I) => /* @__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",
|
|
@@ -5424,17 +5424,17 @@ function Af({
|
|
|
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
|
] }),
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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..." }), Xe = C ||
|
|
5512
|
-
return M && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background:
|
|
5510
|
+
color: b.textSecondary
|
|
5511
|
+
}, children: "Loading..." }), Xe = C || ft, q = 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,16 +5564,16 @@ 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
5578
|
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? X() : ze.map((S, I) => /* @__PURE__ */ p.jsx(
|
|
5579
5579
|
"div",
|
|
@@ -5753,7 +5753,7 @@ function Ns(r, e, t) {
|
|
|
5753
5753
|
return s && (r === s || n && r.previousSibling === s) || n && ds(r, t) !== void 0;
|
|
5754
5754
|
}
|
|
5755
5755
|
function Xu(r, e, t) {
|
|
5756
|
-
const n =
|
|
5756
|
+
const n = ut(t._window);
|
|
5757
5757
|
let s = null, o = null;
|
|
5758
5758
|
n !== null && n.anchorNode === r && (s = n.anchorOffset, o = n.focusOffset);
|
|
5759
5759
|
const i = r.nodeValue;
|
|
@@ -5796,20 +5796,20 @@ function kl(r, e, t) {
|
|
|
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);
|
|
@@ -6087,7 +6087,7 @@ function Il(r) {
|
|
|
6087
6087
|
return r.nodeType === Zt ? r.nodeValue : null;
|
|
6088
6088
|
}
|
|
6089
6089
|
function ki(r, e, t) {
|
|
6090
|
-
const n =
|
|
6090
|
+
const n = ut(e._window);
|
|
6091
6091
|
if (n === null) return;
|
|
6092
6092
|
const s = n.anchorNode;
|
|
6093
6093
|
let { anchorOffset: o, focusOffset: i } = n;
|
|
@@ -6303,7 +6303,7 @@ function ac(r, e, t) {
|
|
|
6303
6303
|
}
|
|
6304
6304
|
n !== null && Ni(n, r, e);
|
|
6305
6305
|
}
|
|
6306
|
-
function
|
|
6306
|
+
function ut(r) {
|
|
6307
6307
|
return wt ? (r || window).getSelection() : null;
|
|
6308
6308
|
}
|
|
6309
6309
|
function uc(r) {
|
|
@@ -6529,13 +6529,13 @@ 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
6540
|
const ie = Hn(Ye, j);
|
|
6541
6541
|
ie === D ? D = Ls(Jr(j, A.element)) : (A.withBefore(D).insertChild(ie), Jr(j, A.element)), k++, M++;
|
|
@@ -6739,7 +6739,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6739
6739
|
const t = V(), n = r.data, s = Xl(r);
|
|
6740
6740
|
if (n != null && O(t) && Yl(t, s, n, r.timeStamp, !1)) {
|
|
6741
6741
|
Gr && (Ps(e, n), Gr = !1);
|
|
6742
|
-
const o = t.anchor.getNode(), i =
|
|
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
6745
|
zn && !t.isCollapsed() && z(o) && i.anchorNode !== null && o.getTextContent().slice(0, a) + n + o.getTextContent().slice(a + u) === Il(i.anchorNode) || U(e, Sr, n);
|
|
@@ -6751,7 +6751,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6751
6751
|
}), Cr = null;
|
|
6752
6752
|
}], ["click", function(r, e) {
|
|
6753
6753
|
nt(e, () => {
|
|
6754
|
-
const t = V(), n =
|
|
6754
|
+
const t = V(), n = ut(e._window), s = wn();
|
|
6755
6755
|
if (n) {
|
|
6756
6756
|
if (O(t)) {
|
|
6757
6757
|
const o = t.anchor, i = o.getNode();
|
|
@@ -6881,7 +6881,7 @@ let rn = 0, Hl = null, Jl = 0, Cr = null;
|
|
|
6881
6881
|
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
|
-
const o = r.anchor, i = r.focus, l = o.getNode(), a = Be(), u =
|
|
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
6885
|
return d !== i.key || !z(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) {
|
|
@@ -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 (z(v) &&
|
|
6911
|
+
const v = f[E], b = v.getTextContentSize();
|
|
6912
|
+
if (z(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
|
}
|
|
@@ -6946,7 +6946,7 @@ function Zl(r) {
|
|
|
6946
6946
|
}
|
|
6947
6947
|
const kr = /* @__PURE__ */ new Map();
|
|
6948
6948
|
function ea(r) {
|
|
6949
|
-
const e = r.target, t =
|
|
6949
|
+
const e = r.target, t = ut(e == null ? null : e.nodeType === 9 ? e.defaultView : e.ownerDocument.defaultView);
|
|
6950
6950
|
if (t === null) return;
|
|
6951
6951
|
const n = Fl(t.anchorNode);
|
|
6952
6952
|
if (n === null) return;
|
|
@@ -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();
|
|
@@ -8008,8 +8008,8 @@ 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 = Qe(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;
|
|
@@ -8073,11 +8073,11 @@ class er {
|
|
|
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;
|
|
@@ -8268,7 +8268,7 @@ class er {
|
|
|
8268
8268
|
return N(f) ? (m = f.__key, g = t ? f.getChildrenSize() : 0) : (g = l.getIndexWithinParent(), m = h.__key, t || g++), s.set(m, g, "element"), void (i && o.set(m, g, "element"));
|
|
8269
8269
|
}
|
|
8270
8270
|
}
|
|
8271
|
-
const a = Be(), u =
|
|
8271
|
+
const a = Be(), u = ut(a._window);
|
|
8272
8272
|
if (!u) return;
|
|
8273
8273
|
const c = a._blockCursorElement, d = a._rootElement;
|
|
8274
8274
|
if (d === null || c === null || !N(l) || l.isInline() || l.canBeEmpty() || Ni(c, a, d), function(f, h, g, m) {
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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,14 +8751,14 @@ 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);
|
|
8761
|
-
const w = s ? null :
|
|
8761
|
+
const w = s ? null : ut(r._window);
|
|
8762
8762
|
if (r._editable && w !== null && (a || l === null || l.dirty)) {
|
|
8763
8763
|
$e = r, Ie = t;
|
|
8764
8764
|
try {
|
|
@@ -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);
|
|
@@ -8864,7 +8864,7 @@ function da(r, e, t) {
|
|
|
8864
8864
|
Ie = a, tt = !1, r._updating = !0, $e = r;
|
|
8865
8865
|
try {
|
|
8866
8866
|
u && (r._headless ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(C) {
|
|
8867
|
-
const x = C.getEditorState()._selection, A =
|
|
8867
|
+
const x = C.getEditorState()._selection, A = ut(C._window);
|
|
8868
8868
|
return O(x) || x == null ? Pi(x, A, C, null) : x.clone();
|
|
8869
8869
|
}(r));
|
|
8870
8870
|
const m = r._compositionKey;
|
|
@@ -8872,10 +8872,10 @@ 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) {
|
|
@@ -8885,14 +8885,14 @@ function da(r, e, t) {
|
|
|
8885
8885
|
z(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
|
-
z(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && eo(L), L !== void 0 && Bo(L, v) && To(x, L,
|
|
8895
|
+
z(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));
|
|
@@ -9804,7 +9804,7 @@ class xs {
|
|
|
9804
9804
|
blur() {
|
|
9805
9805
|
const e = this._rootElement;
|
|
9806
9806
|
e !== null && e.blur();
|
|
9807
|
-
const t =
|
|
9807
|
+
const t = ut(this._window);
|
|
9808
9808
|
t !== null && t.removeAllRanges();
|
|
9809
9809
|
}
|
|
9810
9810
|
isEditable() {
|
|
@@ -10282,7 +10282,7 @@ async function $o(r, e, t) {
|
|
|
10282
10282
|
a(zo(r, e, t));
|
|
10283
10283
|
});
|
|
10284
10284
|
});
|
|
10285
|
-
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o =
|
|
10285
|
+
const n = r.getRootElement(), s = r._window == null ? window.document : r._window.document, o = ut(r._window);
|
|
10286
10286
|
if (n === null || o === null) return !1;
|
|
10287
10287
|
const i = s.createElement("span");
|
|
10288
10288
|
i.style.cssText = "position: fixed; top: -1000px;", i.append(s.createTextNode("#")), n.append(i);
|
|
@@ -10296,7 +10296,7 @@ async function $o(r, e, t) {
|
|
|
10296
10296
|
}
|
|
10297
10297
|
function zo(r, e, t) {
|
|
10298
10298
|
if (t === void 0) {
|
|
10299
|
-
const s =
|
|
10299
|
+
const s = ut(r._window);
|
|
10300
10300
|
if (!s) return !1;
|
|
10301
10301
|
const o = s.anchorNode, i = s.focusNode;
|
|
10302
10302
|
if (o !== null && i !== null && !yn(r, o, i)) return !1;
|
|
@@ -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,11 +10759,11 @@ 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
10768
|
D === void 0 || Qe(D) || E.push(D);
|
|
10769
10769
|
}
|
|
@@ -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: [
|
|
@@ -12128,21 +12128,21 @@ function af({
|
|
|
12128
12128
|
aiProcessingAction: m,
|
|
12129
12129
|
renderAboveToolbar: y
|
|
12130
12130
|
}) {
|
|
12131
|
-
const C = { ...tf, ...s }, [x, A] = He.useState(!1), w = He.useRef(void 0), [E, v] = He.useState(r), [
|
|
12131
|
+
const C = { ...tf, ...s }, [x, A] = He.useState(!1), w = He.useRef(void 0), [E, v] = He.useState(r), [b, D] = He.useState(!1), [k, M] = He.useState(null), B = g ?? b, F = m ?? k;
|
|
12132
12132
|
He.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,33 +12359,33 @@ function Sf({
|
|
|
12359
12359
|
onAiRewrite: w,
|
|
12360
12360
|
renderAboveToolbar: E
|
|
12361
12361
|
}) {
|
|
12362
|
-
const v = { ...uf, ...c }, [
|
|
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 = He.useRef(void 0);
|
|
12363
12363
|
He.useEffect(() => {
|
|
12364
|
-
l !== void 0 && l !== Ge.current && (Ge.current = l, Y(t),
|
|
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),
|
|
12368
|
-
}, ge = xe(null), [Me,
|
|
12369
|
-
const
|
|
12370
|
-
|
|
12367
|
+
Y(W), Ce(!1), i == null || i(W);
|
|
12368
|
+
}, ge = xe(null), [Me, ct] = H(!1), Ct = (W) => {
|
|
12369
|
+
const be = W.target.files;
|
|
12370
|
+
be && ie((Xe) => [...Xe, ...Array.from(be)]), ge.current && (ge.current.value = "");
|
|
12371
12371
|
}, qt = (W) => {
|
|
12372
|
-
W.preventDefault(), W.stopPropagation(),
|
|
12372
|
+
W.preventDefault(), W.stopPropagation(), ct(!0);
|
|
12373
12373
|
}, it = (W) => {
|
|
12374
|
-
W.preventDefault(), W.stopPropagation(),
|
|
12374
|
+
W.preventDefault(), W.stopPropagation(), ct(!1);
|
|
12375
12375
|
}, ot = (W) => {
|
|
12376
|
-
W.preventDefault(), W.stopPropagation(),
|
|
12377
|
-
},
|
|
12378
|
-
ie((
|
|
12376
|
+
W.preventDefault(), W.stopPropagation(), ct(!1), W.dataTransfer.files && ie((be) => [...be, ...Array.from(W.dataTransfer.files)]);
|
|
12377
|
+
}, dt = (W) => W.type.startsWith("image/") ? "image" : W.type === "application/pdf" ? "picture_as_pdf" : W.type.includes("spreadsheet") || W.type.includes("excel") ? "table_chart" : W.type.includes("document") || W.type.includes("word") ? "description" : "attach_file", Ut = (W) => {
|
|
12378
|
+
ie((be) => be.filter((Xe, q) => q !== 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
12391
|
de.map(async (Xe) => {
|
|
@@ -12399,22 +12399,22 @@ function Sf({
|
|
|
12399
12399
|
size: Xe.size
|
|
12400
12400
|
};
|
|
12401
12401
|
})
|
|
12402
|
-
),
|
|
12402
|
+
), be = R.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim();
|
|
12403
12403
|
await s({
|
|
12404
|
-
to:
|
|
12404
|
+
to: b.trim(),
|
|
12405
12405
|
cc: k.trim() || void 0,
|
|
12406
12406
|
bcc: B.trim() || void 0,
|
|
12407
12407
|
subject: L.trim(),
|
|
12408
|
-
html:
|
|
12408
|
+
html: be,
|
|
12409
12409
|
attachments: W,
|
|
12410
12410
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
12411
12411
|
}), D(""), M(""), F(""), j(""), Y(""), ie([]);
|
|
12412
12412
|
} catch (W) {
|
|
12413
|
-
|
|
12413
|
+
we(W instanceof Error ? W.message : "Failed to send email");
|
|
12414
12414
|
} finally {
|
|
12415
|
-
|
|
12415
|
+
ve(!1);
|
|
12416
12416
|
}
|
|
12417
|
-
},
|
|
12417
|
+
}, ft = {
|
|
12418
12418
|
width: "100%",
|
|
12419
12419
|
padding: "8px 12px",
|
|
12420
12420
|
fontSize: "14px",
|
|
@@ -12423,21 +12423,21 @@ function Sf({
|
|
|
12423
12423
|
background: v.inputBackground,
|
|
12424
12424
|
color: v.text,
|
|
12425
12425
|
outline: "none"
|
|
12426
|
-
},
|
|
12426
|
+
}, ht = {
|
|
12427
12427
|
display: "block",
|
|
12428
12428
|
fontSize: "12px",
|
|
12429
12429
|
fontWeight: 500,
|
|
12430
12430
|
color: v.textSecondary,
|
|
12431
12431
|
marginBottom: "4px",
|
|
12432
12432
|
textTransform: "uppercase"
|
|
12433
|
-
}, At = (W) => ({
|
|
12433
|
+
}, At = (W, be = !1) => ({
|
|
12434
12434
|
padding: "10px 20px",
|
|
12435
12435
|
fontSize: "14px",
|
|
12436
12436
|
fontWeight: 500,
|
|
12437
12437
|
border: "none",
|
|
12438
12438
|
borderRadius: "6px",
|
|
12439
|
-
cursor:
|
|
12440
|
-
opacity:
|
|
12439
|
+
cursor: be ? "not-allowed" : "pointer",
|
|
12440
|
+
opacity: be ? 0.6 : 1,
|
|
12441
12441
|
background: W ? v.buttonPrimary : v.buttonSecondary,
|
|
12442
12442
|
color: W ? "#ffffff" : v.text,
|
|
12443
12443
|
display: "flex",
|
|
@@ -12471,16 +12471,16 @@ function Sf({
|
|
|
12471
12471
|
}
|
|
12472
12472
|
),
|
|
12473
12473
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
12474
|
-
/* @__PURE__ */ p.jsx("label", { style:
|
|
12474
|
+
/* @__PURE__ */ p.jsx("label", { style: ht, children: "To" }),
|
|
12475
12475
|
/* @__PURE__ */ p.jsx(
|
|
12476
12476
|
"input",
|
|
12477
12477
|
{
|
|
12478
12478
|
type: "email",
|
|
12479
|
-
value:
|
|
12479
|
+
value: b,
|
|
12480
12480
|
onChange: (W) => D(W.target.value),
|
|
12481
12481
|
placeholder: "recipient@example.com",
|
|
12482
12482
|
disabled: d || oe,
|
|
12483
|
-
style:
|
|
12483
|
+
style: ft
|
|
12484
12484
|
}
|
|
12485
12485
|
)
|
|
12486
12486
|
] }),
|
|
@@ -12504,7 +12504,7 @@ function Sf({
|
|
|
12504
12504
|
),
|
|
12505
12505
|
Se && /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
|
12506
12506
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
12507
|
-
/* @__PURE__ */ p.jsx("label", { style:
|
|
12507
|
+
/* @__PURE__ */ p.jsx("label", { style: ht, children: "CC" }),
|
|
12508
12508
|
/* @__PURE__ */ p.jsx(
|
|
12509
12509
|
"input",
|
|
12510
12510
|
{
|
|
@@ -12513,12 +12513,12 @@ function Sf({
|
|
|
12513
12513
|
onChange: (W) => M(W.target.value),
|
|
12514
12514
|
placeholder: "cc@example.com",
|
|
12515
12515
|
disabled: d || oe,
|
|
12516
|
-
style:
|
|
12516
|
+
style: ft
|
|
12517
12517
|
}
|
|
12518
12518
|
)
|
|
12519
12519
|
] }),
|
|
12520
12520
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
12521
|
-
/* @__PURE__ */ p.jsx("label", { style:
|
|
12521
|
+
/* @__PURE__ */ p.jsx("label", { style: ht, children: "BCC" }),
|
|
12522
12522
|
/* @__PURE__ */ p.jsx(
|
|
12523
12523
|
"input",
|
|
12524
12524
|
{
|
|
@@ -12527,13 +12527,13 @@ function Sf({
|
|
|
12527
12527
|
onChange: (W) => F(W.target.value),
|
|
12528
12528
|
placeholder: "bcc@example.com",
|
|
12529
12529
|
disabled: d || oe,
|
|
12530
|
-
style:
|
|
12530
|
+
style: ft
|
|
12531
12531
|
}
|
|
12532
12532
|
)
|
|
12533
12533
|
] })
|
|
12534
12534
|
] }),
|
|
12535
12535
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
12536
|
-
/* @__PURE__ */ p.jsx("label", { style:
|
|
12536
|
+
/* @__PURE__ */ p.jsx("label", { style: ht, children: "Subject" }),
|
|
12537
12537
|
/* @__PURE__ */ p.jsx(
|
|
12538
12538
|
"input",
|
|
12539
12539
|
{
|
|
@@ -12542,34 +12542,31 @@ function Sf({
|
|
|
12542
12542
|
onChange: (W) => j(W.target.value),
|
|
12543
12543
|
placeholder: "Email subject",
|
|
12544
12544
|
disabled: d || oe,
|
|
12545
|
-
style:
|
|
12545
|
+
style: ft
|
|
12546
12546
|
}
|
|
12547
12547
|
)
|
|
12548
12548
|
] }),
|
|
12549
|
-
/* @__PURE__ */ p.
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
}
|
|
12569
|
-
) })
|
|
12570
|
-
] }),
|
|
12549
|
+
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ p.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ p.jsx(
|
|
12550
|
+
af,
|
|
12551
|
+
{
|
|
12552
|
+
value: R,
|
|
12553
|
+
onChange: ze,
|
|
12554
|
+
placeholder: h,
|
|
12555
|
+
replyTo: n,
|
|
12556
|
+
theme: v,
|
|
12557
|
+
disabled: d || oe,
|
|
12558
|
+
minHeight: m,
|
|
12559
|
+
externalUpdate: ke ? l : void 0,
|
|
12560
|
+
insertText: a,
|
|
12561
|
+
insertTextTrigger: u,
|
|
12562
|
+
onAiRestructure: x,
|
|
12563
|
+
onAiProofread: A,
|
|
12564
|
+
onAiRewrite: w,
|
|
12565
|
+
renderAboveToolbar: E
|
|
12566
|
+
}
|
|
12567
|
+
) }) }),
|
|
12571
12568
|
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
12572
|
-
/* @__PURE__ */ p.jsx("label", { style: { ...
|
|
12569
|
+
/* @__PURE__ */ p.jsx("label", { style: { ...ht, marginBottom: "8px" }, children: "Attachments" }),
|
|
12573
12570
|
/* @__PURE__ */ p.jsx(
|
|
12574
12571
|
"input",
|
|
12575
12572
|
{
|
|
@@ -12612,7 +12609,7 @@ function Sf({
|
|
|
12612
12609
|
]
|
|
12613
12610
|
}
|
|
12614
12611
|
),
|
|
12615
|
-
de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((W,
|
|
12612
|
+
de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((W, be) => /* @__PURE__ */ p.jsxs(
|
|
12616
12613
|
"div",
|
|
12617
12614
|
{
|
|
12618
12615
|
style: {
|
|
@@ -12624,7 +12621,7 @@ function Sf({
|
|
|
12624
12621
|
borderRadius: "8px"
|
|
12625
12622
|
},
|
|
12626
12623
|
children: [
|
|
12627
|
-
/* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: v.textSecondary }, children:
|
|
12624
|
+
/* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: v.textSecondary }, children: dt(W) }),
|
|
12628
12625
|
/* @__PURE__ */ p.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
12629
12626
|
/* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: v.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: W.name }),
|
|
12630
12627
|
/* @__PURE__ */ p.jsx("div", { style: { fontSize: "12px", color: v.textSecondary }, children: Wt(W.size) })
|
|
@@ -12633,7 +12630,7 @@ function Sf({
|
|
|
12633
12630
|
"button",
|
|
12634
12631
|
{
|
|
12635
12632
|
type: "button",
|
|
12636
|
-
onClick: () => Ut(
|
|
12633
|
+
onClick: () => Ut(be),
|
|
12637
12634
|
disabled: d || oe,
|
|
12638
12635
|
style: {
|
|
12639
12636
|
background: "none",
|
|
@@ -12649,7 +12646,7 @@ function Sf({
|
|
|
12649
12646
|
)
|
|
12650
12647
|
]
|
|
12651
12648
|
},
|
|
12652
|
-
`${W.name}-${
|
|
12649
|
+
`${W.name}-${be}`
|
|
12653
12650
|
)) })
|
|
12654
12651
|
] }),
|
|
12655
12652
|
/* @__PURE__ */ p.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
|
|
@@ -12659,7 +12656,7 @@ function Sf({
|
|
|
12659
12656
|
type: "button",
|
|
12660
12657
|
onClick: o,
|
|
12661
12658
|
disabled: d || oe,
|
|
12662
|
-
style: At(!1),
|
|
12659
|
+
style: At(!1, d || oe),
|
|
12663
12660
|
children: "Cancel"
|
|
12664
12661
|
}
|
|
12665
12662
|
),
|
|
@@ -12668,8 +12665,8 @@ function Sf({
|
|
|
12668
12665
|
{
|
|
12669
12666
|
type: "button",
|
|
12670
12667
|
onClick: Dt,
|
|
12671
|
-
disabled: d || oe || !
|
|
12672
|
-
style: At(!0),
|
|
12668
|
+
disabled: d || oe || !b.trim() || !L.trim(),
|
|
12669
|
+
style: At(!0, d || oe || !b.trim() || !L.trim()),
|
|
12673
12670
|
children: [
|
|
12674
12671
|
/* @__PURE__ */ p.jsx(
|
|
12675
12672
|
"span",
|
|
@@ -12737,7 +12734,7 @@ function kf({
|
|
|
12737
12734
|
), E = s && y.trim() && !r.some((B) => {
|
|
12738
12735
|
var F;
|
|
12739
12736
|
return ((F = B.label) == null ? void 0 : F.toLowerCase()) === y.toLowerCase();
|
|
12740
|
-
}), v = e.map((B) => r.find((F) => F.id === B)).filter(Boolean),
|
|
12737
|
+
}), v = e.map((B) => r.find((F) => F.id === B)).filter(Boolean), b = re((B) => {
|
|
12741
12738
|
var F;
|
|
12742
12739
|
c > 0 && e.length >= c || (t([...e, B]), C(""), (F = A.current) == null || F.focus());
|
|
12743
12740
|
}, [e, t, c]), D = re((B) => {
|
|
@@ -12745,10 +12742,10 @@ function kf({
|
|
|
12745
12742
|
}, [e, t]), k = re(async () => {
|
|
12746
12743
|
if (!E) return;
|
|
12747
12744
|
const B = await (o == null ? void 0 : o(y.trim()));
|
|
12748
|
-
B &&
|
|
12749
|
-
}, [E, y, o,
|
|
12750
|
-
B.key === "Enter" ? (B.preventDefault(), E ? k() : w.length > 0 &&
|
|
12751
|
-
}, [E, w, y, e, k,
|
|
12745
|
+
B && b(B.id), C("");
|
|
12746
|
+
}, [E, y, o, b]), M = re((B) => {
|
|
12747
|
+
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(""));
|
|
12748
|
+
}, [E, w, y, e, k, b, D]);
|
|
12752
12749
|
return /* @__PURE__ */ p.jsxs("div", { ref: x, className: f, style: { position: "relative" }, children: [
|
|
12753
12750
|
a && /* @__PURE__ */ p.jsx(
|
|
12754
12751
|
"label",
|
|
@@ -12877,7 +12874,7 @@ function kf({
|
|
|
12877
12874
|
w.map((B) => /* @__PURE__ */ p.jsxs(
|
|
12878
12875
|
"div",
|
|
12879
12876
|
{
|
|
12880
|
-
onClick: () =>
|
|
12877
|
+
onClick: () => b(B.id),
|
|
12881
12878
|
style: {
|
|
12882
12879
|
padding: "10px 12px",
|
|
12883
12880
|
fontSize: "14px",
|
|
@@ -12978,7 +12975,7 @@ function Tf({
|
|
|
12978
12975
|
const Y = F.target;
|
|
12979
12976
|
Y.style.opacity = "0.5";
|
|
12980
12977
|
});
|
|
12981
|
-
}, [t, n]),
|
|
12978
|
+
}, [t, n]), b = re((F) => {
|
|
12982
12979
|
const L = F.target;
|
|
12983
12980
|
L.style.opacity = "1", m(null), C(null), A(null), w.current = null;
|
|
12984
12981
|
}, []), D = re((F, L, j) => {
|
|
@@ -13035,9 +13032,9 @@ function Tf({
|
|
|
13035
13032
|
"div",
|
|
13036
13033
|
{
|
|
13037
13034
|
draggable: !0,
|
|
13038
|
-
onDragStart: (
|
|
13039
|
-
onDragEnd:
|
|
13040
|
-
onDragOver: (
|
|
13035
|
+
onDragStart: (ve) => v(ve, R),
|
|
13036
|
+
onDragEnd: b,
|
|
13037
|
+
onDragOver: (ve) => D(ve, F.id, Y),
|
|
13041
13038
|
onClick: () => a == null ? void 0 : a(R),
|
|
13042
13039
|
className: `cursor-grab active:cursor-grabbing transition-all ${ie ? "opacity-50 scale-95" : ""} ${h}`,
|
|
13043
13040
|
children: o(R, ie)
|
|
@@ -13110,33 +13107,33 @@ function Bf({
|
|
|
13110
13107
|
theme: g = {}
|
|
13111
13108
|
}) {
|
|
13112
13109
|
const m = { ...df, ...g }, { allDayItems: y, timedItems: C } = bt(() => {
|
|
13113
|
-
const
|
|
13110
|
+
const b = [], D = [];
|
|
13114
13111
|
for (const k of r)
|
|
13115
|
-
l(k) ?
|
|
13116
|
-
return { allDayItems:
|
|
13112
|
+
l(k) ? b.push(k) : D.push(k);
|
|
13113
|
+
return { allDayItems: b, timedItems: D };
|
|
13117
13114
|
}, [r, l]), x = bt(() => {
|
|
13118
|
-
const
|
|
13115
|
+
const b = [];
|
|
13119
13116
|
for (let D = t; D <= n; D++)
|
|
13120
|
-
|
|
13121
|
-
return
|
|
13117
|
+
b.push(D);
|
|
13118
|
+
return b;
|
|
13122
13119
|
}, [t, n]), A = (n - t + 1) * s, w = re(
|
|
13123
|
-
(
|
|
13124
|
-
const D = o(
|
|
13120
|
+
(b) => {
|
|
13121
|
+
const D = o(b);
|
|
13125
13122
|
if (!D) return null;
|
|
13126
13123
|
const k = ff(D);
|
|
13127
13124
|
if (!k) return null;
|
|
13128
|
-
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(
|
|
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(b), Y = Math.max(20, R / 60 * s);
|
|
13129
13126
|
return { top: j, height: Y };
|
|
13130
13127
|
},
|
|
13131
13128
|
[o, i, t, n, s]
|
|
13132
13129
|
), E = bt(() => {
|
|
13133
13130
|
if (!f || !pf(e)) return null;
|
|
13134
|
-
const
|
|
13131
|
+
const b = /* @__PURE__ */ new Date(), D = b.getHours(), k = b.getMinutes();
|
|
13135
13132
|
return D < t || D > n ? null : (D - t) * s + k / 60 * s;
|
|
13136
13133
|
}, [e, f, t, n, s]), v = re(
|
|
13137
|
-
(
|
|
13134
|
+
(b) => {
|
|
13138
13135
|
if (!d) return;
|
|
13139
|
-
const D =
|
|
13136
|
+
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")}`;
|
|
13140
13137
|
d(R);
|
|
13141
13138
|
},
|
|
13142
13139
|
[d, s, t, n]
|
|
@@ -13164,20 +13161,20 @@ function Bf({
|
|
|
13164
13161
|
children: "All Day"
|
|
13165
13162
|
}
|
|
13166
13163
|
),
|
|
13167
|
-
/* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: y.map((
|
|
13164
|
+
/* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: y.map((b) => /* @__PURE__ */ p.jsx(
|
|
13168
13165
|
"div",
|
|
13169
13166
|
{
|
|
13170
|
-
onClick: () => c == null ? void 0 : c(
|
|
13167
|
+
onClick: () => c == null ? void 0 : c(b),
|
|
13171
13168
|
style: { cursor: c ? "pointer" : "default" },
|
|
13172
|
-
children: u(
|
|
13169
|
+
children: u(b)
|
|
13173
13170
|
},
|
|
13174
|
-
a(
|
|
13171
|
+
a(b)
|
|
13175
13172
|
)) })
|
|
13176
13173
|
]
|
|
13177
13174
|
}
|
|
13178
13175
|
),
|
|
13179
13176
|
/* @__PURE__ */ p.jsxs("div", { style: { position: "relative", height: A }, children: [
|
|
13180
|
-
x.map((
|
|
13177
|
+
x.map((b, D) => /* @__PURE__ */ p.jsxs("div", { style: { position: "absolute", top: D * s, left: 0, right: 0 }, children: [
|
|
13181
13178
|
/* @__PURE__ */ p.jsx(
|
|
13182
13179
|
"div",
|
|
13183
13180
|
{
|
|
@@ -13191,7 +13188,7 @@ function Bf({
|
|
|
13191
13188
|
fontSize: "11px",
|
|
13192
13189
|
color: m.hourTextColor
|
|
13193
13190
|
},
|
|
13194
|
-
children: hf(
|
|
13191
|
+
children: hf(b)
|
|
13195
13192
|
}
|
|
13196
13193
|
),
|
|
13197
13194
|
/* @__PURE__ */ p.jsx(
|
|
@@ -13220,7 +13217,7 @@ function Bf({
|
|
|
13220
13217
|
}
|
|
13221
13218
|
}
|
|
13222
13219
|
)
|
|
13223
|
-
] },
|
|
13220
|
+
] }, b)),
|
|
13224
13221
|
/* @__PURE__ */ p.jsx(
|
|
13225
13222
|
"div",
|
|
13226
13223
|
{
|
|
@@ -13274,8 +13271,8 @@ function Bf({
|
|
|
13274
13271
|
]
|
|
13275
13272
|
}
|
|
13276
13273
|
),
|
|
13277
|
-
C.map((
|
|
13278
|
-
const D = w(
|
|
13274
|
+
C.map((b) => {
|
|
13275
|
+
const D = w(b);
|
|
13279
13276
|
return D ? /* @__PURE__ */ p.jsx(
|
|
13280
13277
|
"div",
|
|
13281
13278
|
{
|
|
@@ -13289,18 +13286,18 @@ function Bf({
|
|
|
13289
13286
|
cursor: c ? "pointer" : "default"
|
|
13290
13287
|
},
|
|
13291
13288
|
onClick: (k) => {
|
|
13292
|
-
k.stopPropagation(), c == null || c(
|
|
13289
|
+
k.stopPropagation(), c == null || c(b);
|
|
13293
13290
|
},
|
|
13294
|
-
children: u(
|
|
13291
|
+
children: u(b)
|
|
13295
13292
|
},
|
|
13296
|
-
a(
|
|
13293
|
+
a(b)
|
|
13297
13294
|
) : null;
|
|
13298
13295
|
})
|
|
13299
13296
|
] })
|
|
13300
13297
|
] });
|
|
13301
13298
|
}
|
|
13302
13299
|
function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, variant: s = "widget", hideSaveButton: o = !1 }) {
|
|
13303
|
-
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),
|
|
13300
|
+
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null), M = xe(null), B = xe(null), F = xe([]), L = xe(null), j = xe(null), R = xe(null), Y = xe(null), de = xe(!1), ie = xe([]), oe = xe(null), ve = xe(null), pe = xe([]), we = xe([]), Se = xe("insert"), Oe = xe(!1), ke = xe(0), Ce = xe(0), Ge = xe(0), ze = (q) => {
|
|
13304
13301
|
const T = Math.floor(q / 60), X = Math.floor(q % 60);
|
|
13305
13302
|
return `${T.toString().padStart(2, "0")}:${X.toString().padStart(2, "0")}`;
|
|
13306
13303
|
}, ge = async (q) => {
|
|
@@ -13322,7 +13319,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13322
13319
|
ne.setInt16(Fe, Ue, !0), Fe += 2;
|
|
13323
13320
|
}
|
|
13324
13321
|
return new Blob([ae], { type: "audio/wav" });
|
|
13325
|
-
},
|
|
13322
|
+
}, ct = async (q, T, X, J) => {
|
|
13326
13323
|
const S = new AudioContext(), I = q.sampleRate, K = Math.max(q.numberOfChannels, T.numberOfChannels), Q = Math.min(X, q.length), ee = Math.max(0, q.length - X), ae = J === "insert" ? Q + T.length + ee : Q + T.length, ne = S.createBuffer(K, ae, I);
|
|
13327
13324
|
for (let te = 0; te < K; te++) {
|
|
13328
13325
|
const Ae = ne.getChannelData(te), Fe = te < q.numberOfChannels ? q.getChannelData(te) : q.getChannelData(0);
|
|
@@ -13337,7 +13334,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13337
13334
|
}
|
|
13338
13335
|
return await S.close(), ne;
|
|
13339
13336
|
}, Ct = re(() => {
|
|
13340
|
-
const q =
|
|
13337
|
+
const q = b.current;
|
|
13341
13338
|
if (!q) return;
|
|
13342
13339
|
const T = q.getContext("2d");
|
|
13343
13340
|
if (!T) return;
|
|
@@ -13355,18 +13352,18 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13355
13352
|
if (I.length > 0)
|
|
13356
13353
|
if (l === "recording")
|
|
13357
13354
|
for (let Ue = 0; Ue < I.length; Ue++) {
|
|
13358
|
-
const
|
|
13355
|
+
const lt = I.length - 1 - Ue, Et = ye - lt * 4;
|
|
13359
13356
|
if (Et < -3 || Et > J) continue;
|
|
13360
13357
|
const pt = I[Ue] * (S / 2 - 12), Pt = S / 2 - pt;
|
|
13361
13358
|
T.fillStyle = "#10b981", T.fillRect(Et, Pt, 3, pt * 2);
|
|
13362
13359
|
}
|
|
13363
13360
|
else {
|
|
13364
13361
|
const Ue = K > 0 ? Q / K * I.length : 0;
|
|
13365
|
-
for (let
|
|
13366
|
-
const Et = Ue -
|
|
13362
|
+
for (let lt = 0; lt < I.length; lt++) {
|
|
13363
|
+
const Et = Ue - lt, pt = ye - Et * 4;
|
|
13367
13364
|
if (pt < -3 || pt > J) continue;
|
|
13368
|
-
const Pt = I[
|
|
13369
|
-
T.fillStyle =
|
|
13365
|
+
const Pt = I[lt] * (S / 2 - 12), yr = S / 2 - Pt;
|
|
13366
|
+
T.fillStyle = lt <= Ue ? "#10b981" : "#4b5563", T.fillRect(pt, yr, 3, Pt * 2);
|
|
13370
13367
|
}
|
|
13371
13368
|
}
|
|
13372
13369
|
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";
|
|
@@ -13402,18 +13399,18 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13402
13399
|
}
|
|
13403
13400
|
const I = new Blob(F.current, { type: "audio/webm" });
|
|
13404
13401
|
let K, Q;
|
|
13405
|
-
if (oe.current !== null &&
|
|
13402
|
+
if (oe.current !== null && ve.current)
|
|
13406
13403
|
try {
|
|
13407
|
-
const ne = await ge(I), te =
|
|
13408
|
-
|
|
13404
|
+
const ne = await ge(I), te = ve.current.sampleRate, Ae = Math.floor(oe.current * te), Fe = await ct(
|
|
13405
|
+
ve.current,
|
|
13409
13406
|
ne,
|
|
13410
13407
|
Ae,
|
|
13411
13408
|
Se.current
|
|
13412
13409
|
);
|
|
13413
13410
|
K = Me(Fe), Q = Fe.length / Fe.sampleRate, Se.current === "insert" && (ie.current = [
|
|
13414
13411
|
...ie.current,
|
|
13415
|
-
...
|
|
13416
|
-
]), oe.current = null,
|
|
13412
|
+
...we.current
|
|
13413
|
+
]), oe.current = null, ve.current = null, pe.current = [], we.current = [];
|
|
13417
13414
|
} catch {
|
|
13418
13415
|
K = I, Q = ke.current > 0 ? ke.current : 1;
|
|
13419
13416
|
}
|
|
@@ -13437,14 +13434,14 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13437
13434
|
}
|
|
13438
13435
|
}, ot = () => {
|
|
13439
13436
|
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();
|
|
13440
|
-
},
|
|
13441
|
-
const T =
|
|
13437
|
+
}, dt = (q) => {
|
|
13438
|
+
const T = b.current;
|
|
13442
13439
|
if (!T) return;
|
|
13443
13440
|
const X = d || u;
|
|
13444
13441
|
if (X <= 0) return;
|
|
13445
13442
|
const J = ie.current;
|
|
13446
13443
|
if (J.length === 0) return;
|
|
13447
|
-
const S = T.getBoundingClientRect(), I = q -
|
|
13444
|
+
const S = T.getBoundingClientRect(), I = q - Ce.current, K = 4, Q = S.width / T.width, ee = J.length / X * K, ae = -I / (ee * Q), ne = Ge.current + ae, te = Math.max(0, Math.min(ne, X));
|
|
13448
13445
|
R.current && (R.current.currentTime = te), y(te);
|
|
13449
13446
|
}, Ut = () => {
|
|
13450
13447
|
R.current && (R.current.currentTime = 0), y(0);
|
|
@@ -13455,29 +13452,29 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13455
13452
|
const q = R.current;
|
|
13456
13453
|
q && (h ? (q.pause(), y(q.currentTime), g(!1)) : (q.currentTime = m, q.play().catch(() => {
|
|
13457
13454
|
}), g(!0)));
|
|
13458
|
-
},
|
|
13455
|
+
}, ft = async (q) => {
|
|
13459
13456
|
if (!Y.current) {
|
|
13460
13457
|
it();
|
|
13461
13458
|
return;
|
|
13462
13459
|
}
|
|
13463
13460
|
try {
|
|
13464
|
-
R.current && (R.current.pause(), g(!1)), Se.current = q,
|
|
13461
|
+
R.current && (R.current.pause(), g(!1)), Se.current = q, ve.current = await ge(Y.current);
|
|
13465
13462
|
const T = d || u;
|
|
13466
13463
|
oe.current = m;
|
|
13467
13464
|
const X = T > 0 ? m / T : 0, J = Math.floor(X * ie.current.length);
|
|
13468
|
-
pe.current = ie.current.slice(0, J),
|
|
13465
|
+
pe.current = ie.current.slice(0, J), we.current = ie.current.slice(J), ie.current = [...pe.current], it();
|
|
13469
13466
|
} catch {
|
|
13470
13467
|
x("Failed to prepare recording. Please try again.");
|
|
13471
13468
|
}
|
|
13472
|
-
},
|
|
13473
|
-
R.current && (R.current.pause(), R.current = null), Y.current = null,
|
|
13469
|
+
}, ht = () => {
|
|
13470
|
+
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();
|
|
13474
13471
|
}, At = () => {
|
|
13475
13472
|
Y.current ? r(Y.current, d || u) : alert("No audio recorded yet!");
|
|
13476
13473
|
};
|
|
13477
13474
|
if (De(() => {
|
|
13478
|
-
l === "recording" &&
|
|
13475
|
+
l === "recording" && b.current && B.current && de.current && (j.current = requestAnimationFrame(qt));
|
|
13479
13476
|
}, [l]), De(() => {
|
|
13480
|
-
const q =
|
|
13477
|
+
const q = b.current;
|
|
13481
13478
|
if (!q) return;
|
|
13482
13479
|
const T = () => {
|
|
13483
13480
|
const X = window.devicePixelRatio || 1, J = q.getBoundingClientRect();
|
|
@@ -13488,7 +13485,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13488
13485
|
return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
13489
13486
|
}, []), De(() => {
|
|
13490
13487
|
if (l === "idle") {
|
|
13491
|
-
const q =
|
|
13488
|
+
const q = b.current;
|
|
13492
13489
|
if (!q) return;
|
|
13493
13490
|
const T = q.getContext("2d");
|
|
13494
13491
|
if (!T) return;
|
|
@@ -13513,7 +13510,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13513
13510
|
const T = () => {
|
|
13514
13511
|
const X = R.current;
|
|
13515
13512
|
if (X && h) {
|
|
13516
|
-
const J =
|
|
13513
|
+
const J = b.current;
|
|
13517
13514
|
if (J) {
|
|
13518
13515
|
const S = J.getContext("2d");
|
|
13519
13516
|
if (S) {
|
|
@@ -13527,12 +13524,12 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13527
13524
|
fe.addColorStop(0, Ae), fe.addColorStop(1, "transparent"), S.fillStyle = fe, S.fillRect(0, 0, te, Q);
|
|
13528
13525
|
const qe = S.createLinearGradient(K - te, 0, K, 0);
|
|
13529
13526
|
qe.addColorStop(0, "transparent"), qe.addColorStop(1, Ae), S.fillStyle = qe, S.fillRect(K - te, 0, te, Q), S.strokeStyle = "#5a6b62", S.lineWidth = 1, S.beginPath(), S.moveTo(0, Q / 2), S.lineTo(K, Q / 2), S.stroke();
|
|
13530
|
-
const Ue = K / 2,
|
|
13527
|
+
const Ue = K / 2, lt = 3, Et = 4, pt = ae > 0 ? ne / ae * ee.length : 0;
|
|
13531
13528
|
for (let tr = 0; tr < ee.length; tr++) {
|
|
13532
13529
|
const ws = pt - tr, xr = Ue - ws * Et;
|
|
13533
|
-
if (xr < -
|
|
13530
|
+
if (xr < -lt || xr > K) continue;
|
|
13534
13531
|
const Mr = ee[tr] * (Q / 2 - 12), Cs = Q / 2 - Mr;
|
|
13535
|
-
S.fillStyle = tr <= pt ? "#10b981" : "#4b5563", S.fillRect(xr, Cs,
|
|
13532
|
+
S.fillStyle = tr <= pt ? "#10b981" : "#4b5563", S.fillRect(xr, Cs, lt, Mr * 2);
|
|
13536
13533
|
}
|
|
13537
13534
|
S.strokeStyle = "#ef4444", S.lineWidth = 1, S.beginPath(), S.moveTo(Ue, 0), S.lineTo(Ue, Q), S.stroke(), S.fillStyle = "#fff", S.font = "bold 18px monospace", S.textAlign = "center";
|
|
13538
13535
|
const Pt = Math.floor(ne / 60), yr = Math.floor(ne % 60);
|
|
@@ -13570,7 +13567,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13570
13567
|
alignItems: "center",
|
|
13571
13568
|
justifyContent: "center",
|
|
13572
13569
|
transition: "background 0.15s"
|
|
13573
|
-
},
|
|
13570
|
+
}, be = {
|
|
13574
13571
|
...W,
|
|
13575
13572
|
opacity: 0.3,
|
|
13576
13573
|
cursor: "not-allowed"
|
|
@@ -13579,13 +13576,13 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13579
13576
|
/* @__PURE__ */ p.jsx(
|
|
13580
13577
|
"canvas",
|
|
13581
13578
|
{
|
|
13582
|
-
ref:
|
|
13579
|
+
ref: b,
|
|
13583
13580
|
style: { width: "100%", height: "32px", cursor: "pointer", flexShrink: 0 },
|
|
13584
13581
|
onMouseDown: (q) => {
|
|
13585
13582
|
if (l === "editing") {
|
|
13586
|
-
Oe.current = !0,
|
|
13583
|
+
Oe.current = !0, Ce.current = q.clientX, Ge.current = m;
|
|
13587
13584
|
const T = (J) => {
|
|
13588
|
-
Oe.current &&
|
|
13585
|
+
Oe.current && dt(J.clientX);
|
|
13589
13586
|
}, X = () => {
|
|
13590
13587
|
Oe.current = !1, window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", X);
|
|
13591
13588
|
};
|
|
@@ -13614,7 +13611,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13614
13611
|
{
|
|
13615
13612
|
onClick: Ut,
|
|
13616
13613
|
disabled: l === "idle" || l === "recording",
|
|
13617
|
-
style: l === "idle" || l === "recording" ?
|
|
13614
|
+
style: l === "idle" || l === "recording" ? be : W,
|
|
13618
13615
|
title: "Go to start",
|
|
13619
13616
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "first_page" })
|
|
13620
13617
|
}
|
|
@@ -13630,7 +13627,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13630
13627
|
Dt();
|
|
13631
13628
|
},
|
|
13632
13629
|
disabled: l === "idle",
|
|
13633
|
-
style: l === "idle" ?
|
|
13630
|
+
style: l === "idle" ? be : W,
|
|
13634
13631
|
title: h || l === "recording" && !A ? "Pause" : "Play",
|
|
13635
13632
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: h || l === "recording" && !A ? "pause" : "play_arrow" })
|
|
13636
13633
|
}
|
|
@@ -13640,7 +13637,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13640
13637
|
{
|
|
13641
13638
|
onClick: Wt,
|
|
13642
13639
|
disabled: l === "idle" || l === "recording",
|
|
13643
|
-
style: l === "idle" || l === "recording" ?
|
|
13640
|
+
style: l === "idle" || l === "recording" ? be : W,
|
|
13644
13641
|
title: "Go to end",
|
|
13645
13642
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "last_page" })
|
|
13646
13643
|
}
|
|
@@ -13650,10 +13647,10 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13650
13647
|
"button",
|
|
13651
13648
|
{
|
|
13652
13649
|
onClick: () => {
|
|
13653
|
-
E === "insert" ? ot() : l === "idle" ? (v("insert"), it()) : l === "editing" && (v("insert"),
|
|
13650
|
+
E === "insert" ? ot() : l === "idle" ? (v("insert"), it()) : l === "editing" && (v("insert"), ft("insert"));
|
|
13654
13651
|
},
|
|
13655
13652
|
disabled: l === "recording" && E !== "insert" || h,
|
|
13656
|
-
style: l === "recording" && E !== "insert" || h ?
|
|
13653
|
+
style: l === "recording" && E !== "insert" || h ? be : W,
|
|
13657
13654
|
title: E === "insert" ? "Stop recording" : "Insert recording",
|
|
13658
13655
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "insert" ? "#ef4444" : "#171717" }, children: "add" })
|
|
13659
13656
|
}
|
|
@@ -13662,10 +13659,10 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13662
13659
|
"button",
|
|
13663
13660
|
{
|
|
13664
13661
|
onClick: () => {
|
|
13665
|
-
E === "mic" ? ot() : l === "idle" ? (v("mic"), it()) : l === "editing" && (v("mic"),
|
|
13662
|
+
E === "mic" ? ot() : l === "idle" ? (v("mic"), it()) : l === "editing" && (v("mic"), ft("replace"));
|
|
13666
13663
|
},
|
|
13667
13664
|
disabled: l === "recording" && E !== "mic" || h,
|
|
13668
|
-
style: l === "recording" && E !== "mic" || h ?
|
|
13665
|
+
style: l === "recording" && E !== "mic" || h ? be : W,
|
|
13669
13666
|
title: E === "mic" ? "Stop recording" : "Record",
|
|
13670
13667
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
13671
13668
|
}
|
|
@@ -13674,10 +13671,10 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13674
13671
|
"button",
|
|
13675
13672
|
{
|
|
13676
13673
|
onClick: () => {
|
|
13677
|
-
E === "startover" ? ot() : l === "editing" && (v("startover"),
|
|
13674
|
+
E === "startover" ? ot() : l === "editing" && (v("startover"), ht());
|
|
13678
13675
|
},
|
|
13679
13676
|
disabled: l === "idle" || l === "recording" && E !== "startover" || h,
|
|
13680
|
-
style: l === "idle" || l === "recording" && E !== "startover" || h ?
|
|
13677
|
+
style: l === "idle" || l === "recording" && E !== "startover" || h ? be : W,
|
|
13681
13678
|
title: E === "startover" ? "Stop recording" : "Start over",
|
|
13682
13679
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
|
|
13683
13680
|
}
|
|
@@ -13689,7 +13686,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13689
13686
|
{
|
|
13690
13687
|
onClick: () => Y.current && t(Y.current),
|
|
13691
13688
|
disabled: l !== "editing" || n,
|
|
13692
|
-
style: l !== "editing" || n ?
|
|
13689
|
+
style: l !== "editing" || n ? be : W,
|
|
13693
13690
|
title: n ? "Transcribing..." : "Transcribe audio",
|
|
13694
13691
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: n ? "hourglass_empty" : "subtitles" })
|
|
13695
13692
|
}
|
|
@@ -13699,7 +13696,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13699
13696
|
{
|
|
13700
13697
|
onClick: At,
|
|
13701
13698
|
disabled: l !== "editing",
|
|
13702
|
-
style: l !== "editing" ?
|
|
13699
|
+
style: l !== "editing" ? be : W,
|
|
13703
13700
|
title: "Save recording",
|
|
13704
13701
|
children: /* @__PURE__ */ p.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "save" })
|
|
13705
13702
|
}
|