@qwanyx/stack 0.2.76 → 0.2.78
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 +26 -26
- package/dist/index.esm.js +965 -972
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var vd = Object.defineProperty;
|
|
|
2
2
|
var wd = (r, e, t) => e in r ? vd(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Dt = (r, e, t) => wd(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as Fs from "react";
|
|
5
|
-
import Le, { createContext as su, useState as O, useCallback as Q, useEffect as Te, useContext as ou, useRef as me, useMemo as
|
|
5
|
+
import Le, { createContext as su, useState as O, useCallback as Q, useEffect as Te, useContext as ou, useRef as me, useMemo as ct, useLayoutEffect as cn, Suspense as Cd, forwardRef as au, memo as us } from "react";
|
|
6
6
|
import { flushSync as Dd, createPortal as Ed } from "react-dom";
|
|
7
7
|
class py {
|
|
8
8
|
constructor(e) {
|
|
@@ -3630,11 +3630,11 @@ class Hd {
|
|
|
3630
3630
|
for (const p of c.messages)
|
|
3631
3631
|
p.uid && d.set(p.uid, p);
|
|
3632
3632
|
const f = a.map((p) => {
|
|
3633
|
-
var
|
|
3633
|
+
var _, C, k, w, v;
|
|
3634
3634
|
const g = d.get(p);
|
|
3635
3635
|
if (!g) return null;
|
|
3636
|
-
const m = ((
|
|
3637
|
-
return { uid: p, from: x, subject:
|
|
3636
|
+
const m = ((_ = g.flags) == null ? void 0 : _.some((E) => E.includes("Seen"))) || !1, x = ((k = (C = g.envelope) == null ? void 0 : C.from) == null ? void 0 : k.email) || "Unknown", b = ((w = g.envelope) == null ? void 0 : w.subject) || "(No subject)", y = ((v = g.envelope) == null ? void 0 : v.date) || "";
|
|
3637
|
+
return { uid: p, from: x, subject: b, date: y, seen: m };
|
|
3638
3638
|
}).filter(Boolean);
|
|
3639
3639
|
return {
|
|
3640
3640
|
account: { id: e, label: "", email: "" },
|
|
@@ -3682,7 +3682,7 @@ class Hd {
|
|
|
3682
3682
|
* This handles CID embedded images by converting them to base64 data URIs
|
|
3683
3683
|
*/
|
|
3684
3684
|
async getEmailParsed(e, t, n = "INBOX") {
|
|
3685
|
-
var g, m, x,
|
|
3685
|
+
var g, m, x, b, y, _;
|
|
3686
3686
|
const s = (await this.imapExec(e, [
|
|
3687
3687
|
`SELECT "${n}"`,
|
|
3688
3688
|
`UID FETCH ${t} (FLAGS BODY[])`
|
|
@@ -3697,15 +3697,15 @@ class Hd {
|
|
|
3697
3697
|
const c = /* @__PURE__ */ new Map();
|
|
3698
3698
|
for (const C of u.attachments || [])
|
|
3699
3699
|
if (C.contentId) {
|
|
3700
|
-
const
|
|
3701
|
-
c.set(
|
|
3700
|
+
const k = this.contentToBase64(C.content), w = `data:${C.mimeType};base64,${k}`, v = C.contentId.replace(/^<|>$/g, "");
|
|
3701
|
+
c.set(v, w), c.set(`<${v}>`, w);
|
|
3702
3702
|
}
|
|
3703
3703
|
let d = u.html || "";
|
|
3704
|
-
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C,
|
|
3705
|
-
const w = c.get(
|
|
3704
|
+
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C, k) => {
|
|
3705
|
+
const w = c.get(k) || c.get(`<${k}>`);
|
|
3706
3706
|
return w ? `src="${w}"` : C;
|
|
3707
3707
|
}));
|
|
3708
|
-
const f = ((
|
|
3708
|
+
const f = ((b = o.flags) == null ? void 0 : b.some((C) => C.toLowerCase().includes("seen"))) || !1, p = ((y = u.from) == null ? void 0 : y.address) || ((_ = u.from) == null ? void 0 : _.name) || "Unknown";
|
|
3709
3709
|
return {
|
|
3710
3710
|
uid: t,
|
|
3711
3711
|
from: p,
|
|
@@ -4423,17 +4423,17 @@ function Kd() {
|
|
|
4423
4423
|
var $ = g && S[g] || S[m];
|
|
4424
4424
|
return typeof $ == "function" ? $ : null;
|
|
4425
4425
|
}
|
|
4426
|
-
var
|
|
4426
|
+
var b = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4427
4427
|
function y(S) {
|
|
4428
4428
|
{
|
|
4429
4429
|
for (var $ = arguments.length, te = new Array($ > 1 ? $ - 1 : 0), pe = 1; pe < $; pe++)
|
|
4430
4430
|
te[pe - 1] = arguments[pe];
|
|
4431
|
-
|
|
4431
|
+
_("error", S, te);
|
|
4432
4432
|
}
|
|
4433
4433
|
}
|
|
4434
|
-
function
|
|
4434
|
+
function _(S, $, te) {
|
|
4435
4435
|
{
|
|
4436
|
-
var pe =
|
|
4436
|
+
var pe = b.ReactDebugCurrentFrame, je = pe.getStackAddendum();
|
|
4437
4437
|
je !== "" && ($ += "%s", te = te.concat([je]));
|
|
4438
4438
|
var $e = te.map(function(Fe) {
|
|
4439
4439
|
return String(Fe);
|
|
@@ -4441,10 +4441,10 @@ function Kd() {
|
|
|
4441
4441
|
$e.unshift("Warning: " + $), Function.prototype.apply.call(console[S], console, $e);
|
|
4442
4442
|
}
|
|
4443
4443
|
}
|
|
4444
|
-
var C = !1,
|
|
4444
|
+
var C = !1, k = !1, w = !1, v = !1, E = !1, B;
|
|
4445
4445
|
B = Symbol.for("react.module.reference");
|
|
4446
4446
|
function A(S) {
|
|
4447
|
-
return !!(typeof S == "string" || typeof S == "function" || S === n || S === s ||
|
|
4447
|
+
return !!(typeof S == "string" || typeof S == "function" || S === n || S === s || E || S === i || S === u || S === c || v || S === p || C || k || w || typeof S == "object" && S !== null && (S.$$typeof === f || S.$$typeof === d || S.$$typeof === o || S.$$typeof === l || S.$$typeof === a || // This needs to include all possible module reference object
|
|
4448
4448
|
// types supported by any Flight configuration anywhere since
|
|
4449
4449
|
// we don't know which Flight build this will end up being used
|
|
4450
4450
|
// with.
|
|
@@ -4567,7 +4567,7 @@ function Kd() {
|
|
|
4567
4567
|
N < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4568
4568
|
}
|
|
4569
4569
|
}
|
|
4570
|
-
var fe =
|
|
4570
|
+
var fe = b.ReactCurrentDispatcher, ge;
|
|
4571
4571
|
function Ne(S, $, te) {
|
|
4572
4572
|
{
|
|
4573
4573
|
if (ge === void 0)
|
|
@@ -4693,7 +4693,7 @@ function Kd() {
|
|
|
4693
4693
|
}
|
|
4694
4694
|
return "";
|
|
4695
4695
|
}
|
|
4696
|
-
var qe = Object.prototype.hasOwnProperty, ze = {}, He =
|
|
4696
|
+
var qe = Object.prototype.hasOwnProperty, ze = {}, He = b.ReactDebugCurrentFrame;
|
|
4697
4697
|
function Y(S) {
|
|
4698
4698
|
if (S) {
|
|
4699
4699
|
var $ = S._owner, te = Se(S.type, S._source, $ ? $.type : null);
|
|
@@ -4744,7 +4744,7 @@ function Kd() {
|
|
|
4744
4744
|
if (le(S))
|
|
4745
4745
|
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(S)), ye(S);
|
|
4746
4746
|
}
|
|
4747
|
-
var Ge =
|
|
4747
|
+
var Ge = b.ReactCurrentOwner, vt = {
|
|
4748
4748
|
key: !0,
|
|
4749
4749
|
ref: !0,
|
|
4750
4750
|
__self: !0,
|
|
@@ -4838,7 +4838,7 @@ function Kd() {
|
|
|
4838
4838
|
return ee(S, Me, yt, je, pe, Ge.current, Fe);
|
|
4839
4839
|
}
|
|
4840
4840
|
}
|
|
4841
|
-
var ue =
|
|
4841
|
+
var ue = b.ReactCurrentOwner, he = b.ReactDebugCurrentFrame;
|
|
4842
4842
|
function G(S) {
|
|
4843
4843
|
if (S) {
|
|
4844
4844
|
var $ = S._owner, te = Se(S.type, S._source, $ ? $.type : null);
|
|
@@ -4911,7 +4911,7 @@ Check the top-level render call using <` + te + ">.");
|
|
|
4911
4911
|
}
|
|
4912
4912
|
}
|
|
4913
4913
|
}
|
|
4914
|
-
function
|
|
4914
|
+
function at(S) {
|
|
4915
4915
|
{
|
|
4916
4916
|
var $ = S.type;
|
|
4917
4917
|
if ($ == null || typeof $ == "string")
|
|
@@ -4990,7 +4990,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4990
4990
|
<%s key={someKey} {...props} />`, Bs, Er, bd, Er), Ue[Er + Bs] = !0;
|
|
4991
4991
|
}
|
|
4992
4992
|
}
|
|
4993
|
-
return S === n ? Qe(st) :
|
|
4993
|
+
return S === n ? Qe(st) : at(st), st;
|
|
4994
4994
|
}
|
|
4995
4995
|
}
|
|
4996
4996
|
function gt(S, $, te) {
|
|
@@ -5007,26 +5007,26 @@ process.env.NODE_ENV === "production" ? eo.exports = Gd() : eo.exports = Kd();
|
|
|
5007
5007
|
var h = eo.exports;
|
|
5008
5008
|
const fu = su(void 0);
|
|
5009
5009
|
function by({ apiUrl: r, systemId: e, children: t }) {
|
|
5010
|
-
const [n, i] = O(null), [s, o] = O(null), [l, a] = O(!1), [u, c] = O(!0), [d] = O(() => new cu({ apiUrl: r, systemId: e })), f = Q(async (
|
|
5011
|
-
const w = await d.isAdmin(
|
|
5010
|
+
const [n, i] = O(null), [s, o] = O(null), [l, a] = O(!1), [u, c] = O(!0), [d] = O(() => new cu({ apiUrl: r, systemId: e })), f = Q(async (k) => {
|
|
5011
|
+
const w = await d.isAdmin(k);
|
|
5012
5012
|
a(w);
|
|
5013
5013
|
}, [d]), p = Q(() => {
|
|
5014
|
-
const
|
|
5015
|
-
|
|
5014
|
+
const k = Tt.getToken(), w = Tt.getUser();
|
|
5015
|
+
k && w ? (o(k), i(w), f(w._id).finally(() => c(!1))) : c(!1);
|
|
5016
5016
|
}, [f]);
|
|
5017
5017
|
Te(() => {
|
|
5018
5018
|
p();
|
|
5019
5019
|
}, [p]);
|
|
5020
|
-
const g = Q(async (
|
|
5021
|
-
const
|
|
5022
|
-
return
|
|
5023
|
-
}, [d, f]), m = Q(async (
|
|
5024
|
-
const
|
|
5025
|
-
return
|
|
5026
|
-
}, [d, f]),
|
|
5027
|
-
const
|
|
5028
|
-
return
|
|
5029
|
-
}, [d, f]),
|
|
5020
|
+
const g = Q(async (k, w) => {
|
|
5021
|
+
const v = await d.login(k, w);
|
|
5022
|
+
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5023
|
+
}, [d, f]), m = Q(async (k, w, v) => d.register(k, w, v), [d]), x = Q(async (k, w) => {
|
|
5024
|
+
const v = await d.verifyEmail(k, w);
|
|
5025
|
+
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5026
|
+
}, [d, f]), b = Q(async (k) => d.requestPasswordReset(k), [d]), y = Q(async (k, w, v) => {
|
|
5027
|
+
const E = await d.setPasswordWithCode(k, w, v);
|
|
5028
|
+
return E.success && E.user && E.token && (o(E.token), i(E.user), await f(E.user._id)), E;
|
|
5029
|
+
}, [d, f]), _ = Q(async (k) => d.resendVerificationCode(k), [d]), C = Q(() => {
|
|
5030
5030
|
d.logout(), i(null), o(null), a(!1);
|
|
5031
5031
|
}, [d]);
|
|
5032
5032
|
return /* @__PURE__ */ h.jsx(fu.Provider, { value: {
|
|
@@ -5037,9 +5037,9 @@ function by({ apiUrl: r, systemId: e, children: t }) {
|
|
|
5037
5037
|
login: g,
|
|
5038
5038
|
register: m,
|
|
5039
5039
|
verifyEmail: x,
|
|
5040
|
-
requestPasswordReset:
|
|
5040
|
+
requestPasswordReset: b,
|
|
5041
5041
|
setPasswordWithCode: y,
|
|
5042
|
-
resendVerificationCode:
|
|
5042
|
+
resendVerificationCode: _,
|
|
5043
5043
|
logout: C,
|
|
5044
5044
|
refreshUser: p
|
|
5045
5045
|
}, children: t });
|
|
@@ -5075,15 +5075,15 @@ function hu({
|
|
|
5075
5075
|
className: u = "",
|
|
5076
5076
|
isModal: c = !1
|
|
5077
5077
|
}) {
|
|
5078
|
-
const [d, f] = O(""), [p, g] = O(""), [m, x] = O(""), [
|
|
5078
|
+
const [d, f] = O(""), [p, g] = O(""), [m, x] = O(""), [b, y] = O(!1), _ = { ...Yd, ...a };
|
|
5079
5079
|
async function C(A) {
|
|
5080
5080
|
A.preventDefault(), y(!0), x("");
|
|
5081
5081
|
const T = await r(d, p);
|
|
5082
5082
|
T.success ? e == null || e() : x(T.error || "Connexion impossible"), y(!1);
|
|
5083
5083
|
}
|
|
5084
|
-
const
|
|
5085
|
-
backgroundColor:
|
|
5086
|
-
borderRadius:
|
|
5084
|
+
const k = {
|
|
5085
|
+
backgroundColor: _.backgroundColor,
|
|
5086
|
+
borderRadius: _.borderRadius,
|
|
5087
5087
|
padding: "1.5rem",
|
|
5088
5088
|
width: "100%",
|
|
5089
5089
|
maxWidth: "24rem",
|
|
@@ -5093,49 +5093,49 @@ function hu({
|
|
|
5093
5093
|
}, w = {
|
|
5094
5094
|
width: "100%",
|
|
5095
5095
|
padding: "0.5rem 1rem",
|
|
5096
|
-
border: `1px solid ${
|
|
5097
|
-
borderRadius:
|
|
5098
|
-
backgroundColor:
|
|
5099
|
-
color:
|
|
5096
|
+
border: `1px solid ${_.borderColor}`,
|
|
5097
|
+
borderRadius: _.borderRadius,
|
|
5098
|
+
backgroundColor: _.inputBackground,
|
|
5099
|
+
color: _.textColor,
|
|
5100
5100
|
fontSize: "1rem",
|
|
5101
5101
|
outline: "none"
|
|
5102
|
-
},
|
|
5102
|
+
}, v = {
|
|
5103
5103
|
display: "block",
|
|
5104
5104
|
fontSize: "0.875rem",
|
|
5105
5105
|
fontWeight: 500,
|
|
5106
|
-
color:
|
|
5106
|
+
color: _.textMutedColor,
|
|
5107
5107
|
marginBottom: "0.25rem"
|
|
5108
|
-
},
|
|
5108
|
+
}, E = {
|
|
5109
5109
|
width: "100%",
|
|
5110
5110
|
padding: "0.75rem",
|
|
5111
|
-
backgroundColor:
|
|
5111
|
+
backgroundColor: b ? _.textMutedColor : _.primaryColor,
|
|
5112
5112
|
color: "#ffffff",
|
|
5113
5113
|
border: "none",
|
|
5114
|
-
borderRadius:
|
|
5114
|
+
borderRadius: _.borderRadius,
|
|
5115
5115
|
fontSize: "1rem",
|
|
5116
5116
|
fontWeight: 500,
|
|
5117
|
-
cursor:
|
|
5117
|
+
cursor: b ? "not-allowed" : "pointer",
|
|
5118
5118
|
transition: "background-color 0.2s"
|
|
5119
5119
|
}, B = {
|
|
5120
5120
|
padding: "0.75rem",
|
|
5121
|
-
backgroundColor:
|
|
5122
|
-
border: `1px solid ${
|
|
5123
|
-
borderRadius:
|
|
5121
|
+
backgroundColor: _.errorBackgroundColor,
|
|
5122
|
+
border: `1px solid ${_.errorColor}20`,
|
|
5123
|
+
borderRadius: _.borderRadius,
|
|
5124
5124
|
marginBottom: "1rem"
|
|
5125
5125
|
};
|
|
5126
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5126
|
+
return /* @__PURE__ */ h.jsxs("div", { style: k, className: u, children: [
|
|
5127
5127
|
t && /* @__PURE__ */ h.jsx("div", { style: { display: "flex", justifyContent: "center", marginBottom: "1.5rem" }, children: t }),
|
|
5128
5128
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5129
5129
|
fontSize: "1.25rem",
|
|
5130
5130
|
fontWeight: 700,
|
|
5131
|
-
color:
|
|
5131
|
+
color: _.textColor,
|
|
5132
5132
|
marginBottom: "1rem",
|
|
5133
5133
|
textAlign: t ? "center" : "left"
|
|
5134
5134
|
}, children: n }),
|
|
5135
5135
|
/* @__PURE__ */ h.jsxs("form", { onSubmit: C, children: [
|
|
5136
|
-
m && /* @__PURE__ */ h.jsx("div", { style: B, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5136
|
+
m && /* @__PURE__ */ h.jsx("div", { style: B, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: _.errorColor, margin: 0 }, children: m }) }),
|
|
5137
5137
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5138
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5138
|
+
/* @__PURE__ */ h.jsx("label", { style: v, children: o }),
|
|
5139
5139
|
/* @__PURE__ */ h.jsx(
|
|
5140
5140
|
"input",
|
|
5141
5141
|
{
|
|
@@ -5145,16 +5145,16 @@ function hu({
|
|
|
5145
5145
|
required: !0,
|
|
5146
5146
|
style: w,
|
|
5147
5147
|
onFocus: (A) => {
|
|
5148
|
-
A.target.style.borderColor =
|
|
5148
|
+
A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5149
5149
|
},
|
|
5150
5150
|
onBlur: (A) => {
|
|
5151
|
-
A.target.style.borderColor =
|
|
5151
|
+
A.target.style.borderColor = _.borderColor, A.target.style.boxShadow = "none";
|
|
5152
5152
|
}
|
|
5153
5153
|
}
|
|
5154
5154
|
)
|
|
5155
5155
|
] }),
|
|
5156
5156
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
5157
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5157
|
+
/* @__PURE__ */ h.jsx("label", { style: v, children: l }),
|
|
5158
5158
|
/* @__PURE__ */ h.jsx(
|
|
5159
5159
|
"input",
|
|
5160
5160
|
{
|
|
@@ -5164,10 +5164,10 @@ function hu({
|
|
|
5164
5164
|
required: !0,
|
|
5165
5165
|
style: w,
|
|
5166
5166
|
onFocus: (A) => {
|
|
5167
|
-
A.target.style.borderColor =
|
|
5167
|
+
A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5168
5168
|
},
|
|
5169
5169
|
onBlur: (A) => {
|
|
5170
|
-
A.target.style.borderColor =
|
|
5170
|
+
A.target.style.borderColor = _.borderColor, A.target.style.boxShadow = "none";
|
|
5171
5171
|
}
|
|
5172
5172
|
}
|
|
5173
5173
|
)
|
|
@@ -5176,15 +5176,15 @@ function hu({
|
|
|
5176
5176
|
"button",
|
|
5177
5177
|
{
|
|
5178
5178
|
type: "submit",
|
|
5179
|
-
disabled:
|
|
5180
|
-
style:
|
|
5179
|
+
disabled: b,
|
|
5180
|
+
style: E,
|
|
5181
5181
|
onMouseEnter: (A) => {
|
|
5182
|
-
|
|
5182
|
+
b || (A.target.style.backgroundColor = _.primaryHoverColor);
|
|
5183
5183
|
},
|
|
5184
5184
|
onMouseLeave: (A) => {
|
|
5185
|
-
|
|
5185
|
+
b || (A.target.style.backgroundColor = _.primaryColor);
|
|
5186
5186
|
},
|
|
5187
|
-
children:
|
|
5187
|
+
children: b ? s : i
|
|
5188
5188
|
}
|
|
5189
5189
|
)
|
|
5190
5190
|
] })
|
|
@@ -5290,19 +5290,19 @@ function Xd({
|
|
|
5290
5290
|
className: m = "",
|
|
5291
5291
|
isModal: x = !1
|
|
5292
5292
|
}) {
|
|
5293
|
-
const [
|
|
5293
|
+
const [b, y] = O(""), [_, C] = O(""), [k, w] = O(""), [v, E] = O(""), [B, A] = O(""), [T, F] = O(""), [R, D] = O(!1), N = { ...Qd, ...g };
|
|
5294
5294
|
async function M(W) {
|
|
5295
|
-
if (W.preventDefault(), F(""),
|
|
5295
|
+
if (W.preventDefault(), F(""), _ !== k) {
|
|
5296
5296
|
F("Les mots de passe ne correspondent pas");
|
|
5297
5297
|
return;
|
|
5298
5298
|
}
|
|
5299
|
-
if (
|
|
5299
|
+
if (_.length < 8) {
|
|
5300
5300
|
F("Le mot de passe doit contenir au moins 8 caractères");
|
|
5301
5301
|
return;
|
|
5302
5302
|
}
|
|
5303
5303
|
D(!0);
|
|
5304
|
-
const ce = await r(
|
|
5305
|
-
ce.success ? e == null || e(
|
|
5304
|
+
const ce = await r(b, _, p ? { firstName: v, lastName: B } : void 0);
|
|
5305
|
+
ce.success ? e == null || e(b) : F(ce.error || "Erreur lors de l'inscription"), D(!1);
|
|
5306
5306
|
}
|
|
5307
5307
|
const I = {
|
|
5308
5308
|
backgroundColor: N.backgroundColor,
|
|
@@ -5370,8 +5370,8 @@ function Xd({
|
|
|
5370
5370
|
"input",
|
|
5371
5371
|
{
|
|
5372
5372
|
type: "text",
|
|
5373
|
-
value:
|
|
5374
|
-
onChange: (W) =>
|
|
5373
|
+
value: v,
|
|
5374
|
+
onChange: (W) => E(W.target.value),
|
|
5375
5375
|
style: V
|
|
5376
5376
|
}
|
|
5377
5377
|
)
|
|
@@ -5395,7 +5395,7 @@ function Xd({
|
|
|
5395
5395
|
"input",
|
|
5396
5396
|
{
|
|
5397
5397
|
type: "email",
|
|
5398
|
-
value:
|
|
5398
|
+
value: b,
|
|
5399
5399
|
onChange: (W) => y(W.target.value),
|
|
5400
5400
|
required: !0,
|
|
5401
5401
|
style: V
|
|
@@ -5408,7 +5408,7 @@ function Xd({
|
|
|
5408
5408
|
"input",
|
|
5409
5409
|
{
|
|
5410
5410
|
type: "password",
|
|
5411
|
-
value:
|
|
5411
|
+
value: _,
|
|
5412
5412
|
onChange: (W) => C(W.target.value),
|
|
5413
5413
|
required: !0,
|
|
5414
5414
|
minLength: 8,
|
|
@@ -5422,7 +5422,7 @@ function Xd({
|
|
|
5422
5422
|
"input",
|
|
5423
5423
|
{
|
|
5424
5424
|
type: "password",
|
|
5425
|
-
value:
|
|
5425
|
+
value: k,
|
|
5426
5426
|
onChange: (W) => w(W.target.value),
|
|
5427
5427
|
required: !0,
|
|
5428
5428
|
style: V
|
|
@@ -5479,7 +5479,7 @@ function Sa({
|
|
|
5479
5479
|
className: g = "",
|
|
5480
5480
|
isModal: m = !1
|
|
5481
5481
|
}) {
|
|
5482
|
-
const [x,
|
|
5482
|
+
const [x, b] = O(Array(f).fill("")), [y, _] = O(""), [C, k] = O(!1), [w, v] = O(!1), [E, B] = O(!1), A = me([]), T = { ...Jd, ...p };
|
|
5483
5483
|
Te(() => {
|
|
5484
5484
|
var q;
|
|
5485
5485
|
(q = A.current[0]) == null || q.focus();
|
|
@@ -5487,7 +5487,7 @@ function Sa({
|
|
|
5487
5487
|
const F = (q, J) => {
|
|
5488
5488
|
var ce;
|
|
5489
5489
|
const W = J.replace(/\D/g, "").slice(-1), se = [...x];
|
|
5490
|
-
if (se[q] = W,
|
|
5490
|
+
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce = A.current[q + 1]) == null || ce.focus()), W && q === f - 1) {
|
|
5491
5491
|
const fe = se.join("");
|
|
5492
5492
|
fe.length === f && N(fe);
|
|
5493
5493
|
}
|
|
@@ -5500,7 +5500,7 @@ function Sa({
|
|
|
5500
5500
|
const J = q.clipboardData.getData("text").replace(/\D/g, "").slice(0, f), W = [...x];
|
|
5501
5501
|
J.split("").forEach((fe, ge) => {
|
|
5502
5502
|
ge < f && (W[ge] = fe);
|
|
5503
|
-
}),
|
|
5503
|
+
}), b(W);
|
|
5504
5504
|
const se = Math.min(J.length, f) - 1;
|
|
5505
5505
|
se >= 0 && ((ce = A.current[se]) == null || ce.focus()), J.length === f && N(J);
|
|
5506
5506
|
};
|
|
@@ -5508,18 +5508,18 @@ function Sa({
|
|
|
5508
5508
|
var se;
|
|
5509
5509
|
const J = q || x.join("");
|
|
5510
5510
|
if (J.length !== f) {
|
|
5511
|
-
|
|
5511
|
+
_("Veuillez entrer le code complet");
|
|
5512
5512
|
return;
|
|
5513
5513
|
}
|
|
5514
|
-
|
|
5514
|
+
k(!0), _("");
|
|
5515
5515
|
const W = await e(r, J);
|
|
5516
|
-
W.success ? t == null || t() : (
|
|
5516
|
+
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se = A.current[0]) == null || se.focus()), k(!1);
|
|
5517
5517
|
}
|
|
5518
5518
|
async function M() {
|
|
5519
5519
|
if (!n) return;
|
|
5520
|
-
|
|
5520
|
+
v(!0), B(!1), _("");
|
|
5521
5521
|
const q = await n(r);
|
|
5522
|
-
q.success ? (B(!0), setTimeout(() => B(!1), 3e3)) :
|
|
5522
|
+
q.success ? (B(!0), setTimeout(() => B(!1), 3e3)) : _(q.error || "Erreur lors de l'envoi"), v(!1);
|
|
5523
5523
|
}
|
|
5524
5524
|
const I = {
|
|
5525
5525
|
backgroundColor: T.backgroundColor,
|
|
@@ -5583,7 +5583,7 @@ function Sa({
|
|
|
5583
5583
|
borderRadius: T.borderRadius,
|
|
5584
5584
|
marginBottom: "1rem"
|
|
5585
5585
|
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: T.errorColor, margin: 0, textAlign: "center" }, children: y }) }),
|
|
5586
|
-
|
|
5586
|
+
E && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5587
5587
|
padding: "0.75rem",
|
|
5588
5588
|
backgroundColor: "#ECFDF5",
|
|
5589
5589
|
border: `1px solid ${T.successColor}20`,
|
|
@@ -5679,11 +5679,11 @@ function ef({
|
|
|
5679
5679
|
className: c = "",
|
|
5680
5680
|
isModal: d = !1
|
|
5681
5681
|
}) {
|
|
5682
|
-
const [f, p] = O(""), [g, m] = O(""), [x,
|
|
5683
|
-
async function
|
|
5684
|
-
B.preventDefault(),
|
|
5682
|
+
const [f, p] = O(""), [g, m] = O(""), [x, b] = O(!1), y = { ...Zd, ...u };
|
|
5683
|
+
async function _(B) {
|
|
5684
|
+
B.preventDefault(), b(!0), m("");
|
|
5685
5685
|
const A = await r(f);
|
|
5686
|
-
A.success ? e == null || e(f) : m(A.error || "Erreur lors de l'envoi"),
|
|
5686
|
+
A.success ? e == null || e(f) : m(A.error || "Erreur lors de l'envoi"), b(!1);
|
|
5687
5687
|
}
|
|
5688
5688
|
const C = {
|
|
5689
5689
|
backgroundColor: y.backgroundColor,
|
|
@@ -5694,7 +5694,7 @@ function ef({
|
|
|
5694
5694
|
...d && {
|
|
5695
5695
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
5696
5696
|
}
|
|
5697
|
-
},
|
|
5697
|
+
}, k = {
|
|
5698
5698
|
width: "100%",
|
|
5699
5699
|
padding: "0.5rem 1rem",
|
|
5700
5700
|
border: `1px solid ${y.borderColor}`,
|
|
@@ -5710,7 +5710,7 @@ function ef({
|
|
|
5710
5710
|
fontWeight: 500,
|
|
5711
5711
|
color: y.textMutedColor,
|
|
5712
5712
|
marginBottom: "0.25rem"
|
|
5713
|
-
},
|
|
5713
|
+
}, v = {
|
|
5714
5714
|
width: "100%",
|
|
5715
5715
|
padding: "0.75rem",
|
|
5716
5716
|
backgroundColor: x ? y.textMutedColor : y.primaryColor,
|
|
@@ -5721,7 +5721,7 @@ function ef({
|
|
|
5721
5721
|
fontWeight: 500,
|
|
5722
5722
|
cursor: x ? "not-allowed" : "pointer",
|
|
5723
5723
|
transition: "background-color 0.2s"
|
|
5724
|
-
},
|
|
5724
|
+
}, E = {
|
|
5725
5725
|
color: y.primaryColor,
|
|
5726
5726
|
textDecoration: "none",
|
|
5727
5727
|
fontSize: "0.875rem",
|
|
@@ -5744,7 +5744,7 @@ function ef({
|
|
|
5744
5744
|
textAlign: "center",
|
|
5745
5745
|
marginBottom: "1.5rem"
|
|
5746
5746
|
}, children: i }),
|
|
5747
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5747
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: _, children: [
|
|
5748
5748
|
g && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5749
5749
|
padding: "0.75rem",
|
|
5750
5750
|
backgroundColor: y.errorBackgroundColor,
|
|
@@ -5761,7 +5761,7 @@ function ef({
|
|
|
5761
5761
|
value: f,
|
|
5762
5762
|
onChange: (B) => p(B.target.value),
|
|
5763
5763
|
required: !0,
|
|
5764
|
-
style:
|
|
5764
|
+
style: k
|
|
5765
5765
|
}
|
|
5766
5766
|
)
|
|
5767
5767
|
] }),
|
|
@@ -5770,7 +5770,7 @@ function ef({
|
|
|
5770
5770
|
{
|
|
5771
5771
|
type: "submit",
|
|
5772
5772
|
disabled: x,
|
|
5773
|
-
style:
|
|
5773
|
+
style: v,
|
|
5774
5774
|
onMouseEnter: (B) => {
|
|
5775
5775
|
x || (B.target.style.backgroundColor = y.primaryHoverColor);
|
|
5776
5776
|
},
|
|
@@ -5780,7 +5780,7 @@ function ef({
|
|
|
5780
5780
|
children: x ? o : s
|
|
5781
5781
|
}
|
|
5782
5782
|
),
|
|
5783
|
-
t && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: t, style:
|
|
5783
|
+
t && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: t, style: E, children: a }) })
|
|
5784
5784
|
] })
|
|
5785
5785
|
] });
|
|
5786
5786
|
}
|
|
@@ -5813,9 +5813,9 @@ function rf({
|
|
|
5813
5813
|
className: p = "",
|
|
5814
5814
|
isModal: g = !1
|
|
5815
5815
|
}) {
|
|
5816
|
-
const [m, x] = O(""), [
|
|
5817
|
-
async function
|
|
5818
|
-
if (D.preventDefault(), C(""), m !==
|
|
5816
|
+
const [m, x] = O(""), [b, y] = O(""), [_, C] = O(""), [k, w] = O(!1), v = { ...tf, ...f };
|
|
5817
|
+
async function E(D) {
|
|
5818
|
+
if (D.preventDefault(), C(""), m !== b) {
|
|
5819
5819
|
C("Les mots de passe ne correspondent pas");
|
|
5820
5820
|
return;
|
|
5821
5821
|
}
|
|
@@ -5828,8 +5828,8 @@ function rf({
|
|
|
5828
5828
|
N.success ? n == null || n() : C(N.error || "Erreur lors de la réinitialisation"), w(!1);
|
|
5829
5829
|
}
|
|
5830
5830
|
const B = {
|
|
5831
|
-
backgroundColor:
|
|
5832
|
-
borderRadius:
|
|
5831
|
+
backgroundColor: v.backgroundColor,
|
|
5832
|
+
borderRadius: v.borderRadius,
|
|
5833
5833
|
padding: "1.5rem",
|
|
5834
5834
|
width: "100%",
|
|
5835
5835
|
maxWidth: "24rem",
|
|
@@ -5839,10 +5839,10 @@ function rf({
|
|
|
5839
5839
|
}, A = {
|
|
5840
5840
|
width: "100%",
|
|
5841
5841
|
padding: "0.5rem 1rem",
|
|
5842
|
-
border: `1px solid ${
|
|
5843
|
-
borderRadius:
|
|
5844
|
-
backgroundColor:
|
|
5845
|
-
color:
|
|
5842
|
+
border: `1px solid ${v.borderColor}`,
|
|
5843
|
+
borderRadius: v.borderRadius,
|
|
5844
|
+
backgroundColor: v.inputBackground,
|
|
5845
|
+
color: v.textColor,
|
|
5846
5846
|
fontSize: "1rem",
|
|
5847
5847
|
outline: "none",
|
|
5848
5848
|
boxSizing: "border-box"
|
|
@@ -5850,21 +5850,21 @@ function rf({
|
|
|
5850
5850
|
display: "block",
|
|
5851
5851
|
fontSize: "0.875rem",
|
|
5852
5852
|
fontWeight: 500,
|
|
5853
|
-
color:
|
|
5853
|
+
color: v.textMutedColor,
|
|
5854
5854
|
marginBottom: "0.25rem"
|
|
5855
5855
|
}, F = {
|
|
5856
5856
|
width: "100%",
|
|
5857
5857
|
padding: "0.75rem",
|
|
5858
|
-
backgroundColor:
|
|
5858
|
+
backgroundColor: k ? v.textMutedColor : v.primaryColor,
|
|
5859
5859
|
color: "#ffffff",
|
|
5860
5860
|
border: "none",
|
|
5861
|
-
borderRadius:
|
|
5861
|
+
borderRadius: v.borderRadius,
|
|
5862
5862
|
fontSize: "1rem",
|
|
5863
5863
|
fontWeight: 500,
|
|
5864
|
-
cursor:
|
|
5864
|
+
cursor: k ? "not-allowed" : "pointer",
|
|
5865
5865
|
transition: "background-color 0.2s"
|
|
5866
5866
|
}, R = {
|
|
5867
|
-
color:
|
|
5867
|
+
color: v.primaryColor,
|
|
5868
5868
|
textDecoration: "none",
|
|
5869
5869
|
fontSize: "0.875rem",
|
|
5870
5870
|
cursor: "pointer",
|
|
@@ -5876,24 +5876,24 @@ function rf({
|
|
|
5876
5876
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5877
5877
|
fontSize: "1.25rem",
|
|
5878
5878
|
fontWeight: 700,
|
|
5879
|
-
color:
|
|
5879
|
+
color: v.textColor,
|
|
5880
5880
|
marginBottom: "0.5rem",
|
|
5881
5881
|
textAlign: "center"
|
|
5882
5882
|
}, children: s }),
|
|
5883
5883
|
o && /* @__PURE__ */ h.jsx("p", { style: {
|
|
5884
5884
|
fontSize: "0.875rem",
|
|
5885
|
-
color:
|
|
5885
|
+
color: v.textMutedColor,
|
|
5886
5886
|
textAlign: "center",
|
|
5887
5887
|
marginBottom: "1.5rem"
|
|
5888
5888
|
}, children: o }),
|
|
5889
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5890
|
-
|
|
5889
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: E, children: [
|
|
5890
|
+
_ && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5891
5891
|
padding: "0.75rem",
|
|
5892
|
-
backgroundColor:
|
|
5893
|
-
border: `1px solid ${
|
|
5894
|
-
borderRadius:
|
|
5892
|
+
backgroundColor: v.errorBackgroundColor,
|
|
5893
|
+
border: `1px solid ${v.errorColor}20`,
|
|
5894
|
+
borderRadius: v.borderRadius,
|
|
5895
5895
|
marginBottom: "1rem"
|
|
5896
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5896
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: v.errorColor, margin: 0 }, children: _ }) }),
|
|
5897
5897
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5898
5898
|
/* @__PURE__ */ h.jsx("label", { style: T, children: u }),
|
|
5899
5899
|
/* @__PURE__ */ h.jsx(
|
|
@@ -5914,7 +5914,7 @@ function rf({
|
|
|
5914
5914
|
"input",
|
|
5915
5915
|
{
|
|
5916
5916
|
type: "password",
|
|
5917
|
-
value:
|
|
5917
|
+
value: b,
|
|
5918
5918
|
onChange: (D) => y(D.target.value),
|
|
5919
5919
|
required: !0,
|
|
5920
5920
|
style: A
|
|
@@ -5925,15 +5925,15 @@ function rf({
|
|
|
5925
5925
|
"button",
|
|
5926
5926
|
{
|
|
5927
5927
|
type: "submit",
|
|
5928
|
-
disabled:
|
|
5928
|
+
disabled: k,
|
|
5929
5929
|
style: F,
|
|
5930
5930
|
onMouseEnter: (D) => {
|
|
5931
|
-
|
|
5931
|
+
k || (D.target.style.backgroundColor = v.primaryHoverColor);
|
|
5932
5932
|
},
|
|
5933
5933
|
onMouseLeave: (D) => {
|
|
5934
|
-
|
|
5934
|
+
k || (D.target.style.backgroundColor = v.primaryColor);
|
|
5935
5935
|
},
|
|
5936
|
-
children:
|
|
5936
|
+
children: k ? a : l
|
|
5937
5937
|
}
|
|
5938
5938
|
),
|
|
5939
5939
|
i && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: i, style: R, children: d }) })
|
|
@@ -5956,23 +5956,23 @@ function nf({
|
|
|
5956
5956
|
isModal: f = !1,
|
|
5957
5957
|
labels: p = {}
|
|
5958
5958
|
}) {
|
|
5959
|
-
const [g, m] = O(l), [x,
|
|
5959
|
+
const [g, m] = O(l), [x, b] = O(""), [y, _] = O("");
|
|
5960
5960
|
async function C(A, T) {
|
|
5961
5961
|
const F = await r(A, T);
|
|
5962
|
-
return F.requiresVerification ? (
|
|
5962
|
+
return F.requiresVerification ? (b(A), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : F;
|
|
5963
5963
|
}
|
|
5964
|
-
async function
|
|
5964
|
+
async function k(A, T, F) {
|
|
5965
5965
|
const R = await e(A, T, F);
|
|
5966
|
-
return R.success && R.requiresVerification && (
|
|
5966
|
+
return R.success && R.requiresVerification && (b(A), m("verify-email")), R;
|
|
5967
5967
|
}
|
|
5968
5968
|
async function w(A) {
|
|
5969
5969
|
const T = await n(A);
|
|
5970
|
-
return T.success && (
|
|
5970
|
+
return T.success && (b(A), m("verify-reset-code")), T;
|
|
5971
5971
|
}
|
|
5972
|
-
async function
|
|
5973
|
-
return
|
|
5972
|
+
async function v(A, T) {
|
|
5973
|
+
return _(T), m("reset-password"), { success: !0 };
|
|
5974
5974
|
}
|
|
5975
|
-
const
|
|
5975
|
+
const E = () => {
|
|
5976
5976
|
switch (g) {
|
|
5977
5977
|
case "login":
|
|
5978
5978
|
return /* @__PURE__ */ h.jsx(
|
|
@@ -5991,7 +5991,7 @@ function nf({
|
|
|
5991
5991
|
return /* @__PURE__ */ h.jsx(
|
|
5992
5992
|
Xd,
|
|
5993
5993
|
{
|
|
5994
|
-
onRegister:
|
|
5994
|
+
onRegister: k,
|
|
5995
5995
|
onSuccess: () => {
|
|
5996
5996
|
},
|
|
5997
5997
|
onLoginClick: () => m("login"),
|
|
@@ -6035,7 +6035,7 @@ function nf({
|
|
|
6035
6035
|
Sa,
|
|
6036
6036
|
{
|
|
6037
6037
|
email: x,
|
|
6038
|
-
onVerify:
|
|
6038
|
+
onVerify: v,
|
|
6039
6039
|
onResendCode: s,
|
|
6040
6040
|
onBackClick: () => m("forgot-password"),
|
|
6041
6041
|
title: "Code de réinitialisation",
|
|
@@ -6088,7 +6088,7 @@ function nf({
|
|
|
6088
6088
|
alignItems: "center",
|
|
6089
6089
|
width: "100%"
|
|
6090
6090
|
}, children: [
|
|
6091
|
-
|
|
6091
|
+
E(),
|
|
6092
6092
|
B()
|
|
6093
6093
|
] });
|
|
6094
6094
|
}
|
|
@@ -6331,16 +6331,16 @@ function Dy({
|
|
|
6331
6331
|
onRefresh: p,
|
|
6332
6332
|
theme: g = {}
|
|
6333
6333
|
}) {
|
|
6334
|
-
const { data: m, loading: x, error:
|
|
6334
|
+
const { data: m, loading: x, error: b, refetch: y } = sf(r, e), [_, C] = O(""), [k, w] = O({}), [v, E] = O(1), B = ct(() => {
|
|
6335
6335
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
6336
6336
|
let D = m;
|
|
6337
|
-
return l &&
|
|
6338
|
-
}, [m,
|
|
6337
|
+
return l && _ && a.length > 0 && (D = Is.search(D, _, a)), Object.keys(k).length > 0 && (D = Is.filterByFields(D, k)), Is.paginate(D, v, d);
|
|
6338
|
+
}, [m, _, k, v, d, l, a]);
|
|
6339
6339
|
Te(() => {
|
|
6340
|
-
|
|
6341
|
-
}, [
|
|
6340
|
+
E(1);
|
|
6341
|
+
}, [_, k]);
|
|
6342
6342
|
const A = () => {
|
|
6343
|
-
C(""), w({}),
|
|
6343
|
+
C(""), w({}), E(1), y(), p == null || p();
|
|
6344
6344
|
}, T = {
|
|
6345
6345
|
background: g.background || "#ffffff",
|
|
6346
6346
|
cardBackground: g.cardBackground || "#f9fafb",
|
|
@@ -6361,13 +6361,13 @@ function Dy({
|
|
|
6361
6361
|
justifyContent: "center",
|
|
6362
6362
|
padding: "48px",
|
|
6363
6363
|
color: T.textSecondary
|
|
6364
|
-
}, children: "Loading..." }) :
|
|
6364
|
+
}, children: "Loading..." }) : b ? /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6365
6365
|
padding: "24px",
|
|
6366
6366
|
textAlign: "center",
|
|
6367
6367
|
color: "#ef4444"
|
|
6368
6368
|
}, children: [
|
|
6369
6369
|
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
6370
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px" }, children:
|
|
6370
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px" }, children: b.message }),
|
|
6371
6371
|
/* @__PURE__ */ h.jsx(
|
|
6372
6372
|
"button",
|
|
6373
6373
|
{
|
|
@@ -6427,7 +6427,7 @@ function Dy({
|
|
|
6427
6427
|
{
|
|
6428
6428
|
type: "text",
|
|
6429
6429
|
placeholder: u,
|
|
6430
|
-
value:
|
|
6430
|
+
value: _,
|
|
6431
6431
|
onChange: (D) => C(D.target.value),
|
|
6432
6432
|
style: {
|
|
6433
6433
|
width: "100%",
|
|
@@ -6479,7 +6479,7 @@ function Dy({
|
|
|
6479
6479
|
}, children: [
|
|
6480
6480
|
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color: T.textSecondary }, children: [
|
|
6481
6481
|
"Page ",
|
|
6482
|
-
|
|
6482
|
+
v,
|
|
6483
6483
|
" of ",
|
|
6484
6484
|
B.totalPages
|
|
6485
6485
|
] }),
|
|
@@ -6487,15 +6487,15 @@ function Dy({
|
|
|
6487
6487
|
/* @__PURE__ */ h.jsx(
|
|
6488
6488
|
"button",
|
|
6489
6489
|
{
|
|
6490
|
-
onClick: () =>
|
|
6491
|
-
disabled:
|
|
6490
|
+
onClick: () => E((D) => Math.max(1, D - 1)),
|
|
6491
|
+
disabled: v === 1,
|
|
6492
6492
|
style: {
|
|
6493
6493
|
padding: "6px 12px",
|
|
6494
6494
|
border: `1px solid ${T.border}`,
|
|
6495
6495
|
borderRadius: "6px",
|
|
6496
6496
|
background: "white",
|
|
6497
|
-
cursor:
|
|
6498
|
-
opacity:
|
|
6497
|
+
cursor: v === 1 ? "not-allowed" : "pointer",
|
|
6498
|
+
opacity: v === 1 ? 0.5 : 1
|
|
6499
6499
|
},
|
|
6500
6500
|
children: "Previous"
|
|
6501
6501
|
}
|
|
@@ -6503,15 +6503,15 @@ function Dy({
|
|
|
6503
6503
|
/* @__PURE__ */ h.jsx(
|
|
6504
6504
|
"button",
|
|
6505
6505
|
{
|
|
6506
|
-
onClick: () =>
|
|
6507
|
-
disabled:
|
|
6506
|
+
onClick: () => E((D) => Math.min(B.totalPages, D + 1)),
|
|
6507
|
+
disabled: v === B.totalPages,
|
|
6508
6508
|
style: {
|
|
6509
6509
|
padding: "6px 12px",
|
|
6510
6510
|
border: `1px solid ${T.border}`,
|
|
6511
6511
|
borderRadius: "6px",
|
|
6512
6512
|
background: "white",
|
|
6513
|
-
cursor:
|
|
6514
|
-
opacity:
|
|
6513
|
+
cursor: v === B.totalPages ? "not-allowed" : "pointer",
|
|
6514
|
+
opacity: v === B.totalPages ? 0.5 : 1
|
|
6515
6515
|
},
|
|
6516
6516
|
children: "Next"
|
|
6517
6517
|
}
|
|
@@ -6622,33 +6622,33 @@ function Sy({
|
|
|
6622
6622
|
cardSize: s = "medium",
|
|
6623
6623
|
className: o = ""
|
|
6624
6624
|
}) {
|
|
6625
|
-
const l = Math.min(Math.max(e, 1), 5), [a, u] = O([]), [c, d] = O([]), [f, p] = O(Array(l).fill(!1)), [g, m] = O(Array(l).fill(!1)), x = me([]),
|
|
6626
|
-
const
|
|
6627
|
-
if (
|
|
6628
|
-
const
|
|
6629
|
-
return
|
|
6625
|
+
const l = Math.min(Math.max(e, 1), 5), [a, u] = O([]), [c, d] = O([]), [f, p] = O(Array(l).fill(!1)), [g, m] = O(Array(l).fill(!1)), x = me([]), b = Q((w) => {
|
|
6626
|
+
const v = r.filter((B) => !w.includes(B._id));
|
|
6627
|
+
if (v.length === 0) return null;
|
|
6628
|
+
const E = Math.floor(Math.random() * v.length);
|
|
6629
|
+
return v[E];
|
|
6630
6630
|
}, [r]), y = Q(() => Math.random() * (n - t) + t, [t, n]);
|
|
6631
6631
|
Te(() => {
|
|
6632
6632
|
if (r.length === 0) {
|
|
6633
6633
|
u([]), d([]);
|
|
6634
6634
|
return;
|
|
6635
6635
|
}
|
|
6636
|
-
const w = [],
|
|
6636
|
+
const w = [], v = [], E = [];
|
|
6637
6637
|
for (let B = 0; B < l && B < r.length; B++) {
|
|
6638
|
-
const A =
|
|
6639
|
-
A && (w.push(A),
|
|
6638
|
+
const A = b(E);
|
|
6639
|
+
A && (w.push(A), E.push(A._id));
|
|
6640
6640
|
}
|
|
6641
6641
|
for (let B = 0; B < w.length; B++) {
|
|
6642
6642
|
const A = [
|
|
6643
6643
|
w[B]._id,
|
|
6644
6644
|
...w.filter((F, R) => R !== B).map((F) => F._id)
|
|
6645
|
-
], T =
|
|
6646
|
-
T ?
|
|
6645
|
+
], T = b(A);
|
|
6646
|
+
T ? v.push(T) : v.push(w[B]);
|
|
6647
6647
|
}
|
|
6648
|
-
u(w), d(
|
|
6649
|
-
}, [r, l,
|
|
6650
|
-
const
|
|
6651
|
-
const
|
|
6648
|
+
u(w), d(v);
|
|
6649
|
+
}, [r, l, b]);
|
|
6650
|
+
const _ = Q((w) => {
|
|
6651
|
+
const v = y(), E = setTimeout(() => {
|
|
6652
6652
|
p((B) => {
|
|
6653
6653
|
const A = [...B];
|
|
6654
6654
|
return A[w] = !A[w], A;
|
|
@@ -6666,43 +6666,43 @@ function Sy({
|
|
|
6666
6666
|
(B ? c[w] : a[w])._id,
|
|
6667
6667
|
...a.filter((N, M) => M !== w).map((N) => N._id),
|
|
6668
6668
|
...A.filter((N, M) => M !== w).map((N) => N._id)
|
|
6669
|
-
], D =
|
|
6669
|
+
], D = b(R);
|
|
6670
6670
|
return D && (T[w] = D), T;
|
|
6671
6671
|
}), setTimeout(() => {
|
|
6672
|
-
|
|
6672
|
+
_(w);
|
|
6673
6673
|
}, 150);
|
|
6674
6674
|
}, 200);
|
|
6675
6675
|
}, 150);
|
|
6676
|
-
},
|
|
6677
|
-
x.current[w] =
|
|
6678
|
-
}, [y,
|
|
6676
|
+
}, v);
|
|
6677
|
+
x.current[w] = E;
|
|
6678
|
+
}, [y, b, a, c, g]), C = me(!1);
|
|
6679
6679
|
Te(() => {
|
|
6680
6680
|
if (!(a.length === 0 || r.length <= 1) && !C.current) {
|
|
6681
6681
|
C.current = !0;
|
|
6682
6682
|
for (let w = 0; w < a.length; w++)
|
|
6683
|
-
|
|
6683
|
+
_(w);
|
|
6684
6684
|
return () => {
|
|
6685
6685
|
x.current.forEach((w) => clearTimeout(w)), x.current = [], C.current = !1;
|
|
6686
6686
|
};
|
|
6687
6687
|
}
|
|
6688
6688
|
}, [a.length, r.length]);
|
|
6689
|
-
const
|
|
6689
|
+
const k = (w) => {
|
|
6690
6690
|
i && i(w);
|
|
6691
6691
|
};
|
|
6692
|
-
return r.length === 0 ? /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : a.length === 0 ? /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ h.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${o}`, children: a.map((w,
|
|
6693
|
-
const
|
|
6692
|
+
return r.length === 0 ? /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : a.length === 0 ? /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ h.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${o}`, children: a.map((w, v) => {
|
|
6693
|
+
const E = c[v], B = g[v];
|
|
6694
6694
|
return /* @__PURE__ */ h.jsx(
|
|
6695
6695
|
"div",
|
|
6696
6696
|
{
|
|
6697
6697
|
className: `relative ${of[s]}`,
|
|
6698
6698
|
style: { perspective: "1000px" },
|
|
6699
|
-
onClick: () =>
|
|
6699
|
+
onClick: () => k(B ? E : w),
|
|
6700
6700
|
children: /* @__PURE__ */ h.jsxs(
|
|
6701
6701
|
"div",
|
|
6702
6702
|
{
|
|
6703
6703
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
6704
6704
|
style: {
|
|
6705
|
-
transform: `rotateY(${f[
|
|
6705
|
+
transform: `rotateY(${f[v] ? 180 : 0}deg)`,
|
|
6706
6706
|
transition: "transform 0.5s",
|
|
6707
6707
|
transformStyle: "preserve-3d"
|
|
6708
6708
|
},
|
|
@@ -6718,7 +6718,7 @@ function Sy({
|
|
|
6718
6718
|
"div",
|
|
6719
6719
|
{
|
|
6720
6720
|
style: {
|
|
6721
|
-
transform: f[
|
|
6721
|
+
transform: f[v] ? "scaleX(-1)" : "scaleX(1)",
|
|
6722
6722
|
width: "100%",
|
|
6723
6723
|
height: "100%"
|
|
6724
6724
|
},
|
|
@@ -6737,7 +6737,7 @@ function Sy({
|
|
|
6737
6737
|
)
|
|
6738
6738
|
}
|
|
6739
6739
|
),
|
|
6740
|
-
|
|
6740
|
+
E && /* @__PURE__ */ h.jsx(
|
|
6741
6741
|
"div",
|
|
6742
6742
|
{
|
|
6743
6743
|
className: "absolute inset-0 transition-opacity duration-200",
|
|
@@ -6748,7 +6748,7 @@ function Sy({
|
|
|
6748
6748
|
"div",
|
|
6749
6749
|
{
|
|
6750
6750
|
style: {
|
|
6751
|
-
transform: f[
|
|
6751
|
+
transform: f[v] ? "scaleX(-1)" : "scaleX(1)",
|
|
6752
6752
|
width: "100%",
|
|
6753
6753
|
height: "100%"
|
|
6754
6754
|
},
|
|
@@ -6756,12 +6756,12 @@ function Sy({
|
|
|
6756
6756
|
/* @__PURE__ */ h.jsx(
|
|
6757
6757
|
"img",
|
|
6758
6758
|
{
|
|
6759
|
-
src:
|
|
6760
|
-
alt:
|
|
6759
|
+
src: E.data.image,
|
|
6760
|
+
alt: E.title,
|
|
6761
6761
|
className: "w-full h-full object-cover"
|
|
6762
6762
|
}
|
|
6763
6763
|
),
|
|
6764
|
-
/* @__PURE__ */ h.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ h.jsx("p", { className: "text-white text-sm font-medium truncate", children:
|
|
6764
|
+
/* @__PURE__ */ h.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ h.jsx("p", { className: "text-white text-sm font-medium truncate", children: E.title }) })
|
|
6765
6765
|
]
|
|
6766
6766
|
}
|
|
6767
6767
|
)
|
|
@@ -6771,7 +6771,7 @@ function Sy({
|
|
|
6771
6771
|
}
|
|
6772
6772
|
)
|
|
6773
6773
|
},
|
|
6774
|
-
`slot-${
|
|
6774
|
+
`slot-${v}`
|
|
6775
6775
|
);
|
|
6776
6776
|
}) });
|
|
6777
6777
|
}
|
|
@@ -6825,22 +6825,22 @@ function Ay({
|
|
|
6825
6825
|
onDelete: g,
|
|
6826
6826
|
onError: m,
|
|
6827
6827
|
onLoad: x,
|
|
6828
|
-
renderItem:
|
|
6828
|
+
renderItem: b,
|
|
6829
6829
|
renderDetail: y,
|
|
6830
|
-
renderActions:
|
|
6830
|
+
renderActions: _,
|
|
6831
6831
|
renderEmpty: C,
|
|
6832
|
-
renderLoading:
|
|
6832
|
+
renderLoading: k,
|
|
6833
6833
|
theme: w = {}
|
|
6834
6834
|
}) {
|
|
6835
|
-
const
|
|
6835
|
+
const v = { ...af, ...w }, [E, B] = O([]), [A, T] = O(!1), [F, R] = O(null), [D, N] = O(/* @__PURE__ */ new Set()), [M, I] = O(null), [V, U] = O(null), [re, q] = O(null), [J, W] = O(!1), [se, ce] = O(""), fe = a !== void 0 ? a : se, ge = (oe) => {
|
|
6836
6836
|
u ? u(oe) : ce(oe);
|
|
6837
|
-
}, Ne =
|
|
6838
|
-
if (!fe.trim()) return
|
|
6837
|
+
}, Ne = ct(() => {
|
|
6838
|
+
if (!fe.trim()) return E;
|
|
6839
6839
|
const oe = fe.toLowerCase();
|
|
6840
|
-
return
|
|
6840
|
+
return E.filter(
|
|
6841
6841
|
(de) => Vr(de.from).toLowerCase().includes(oe) || Vr(de.subject).toLowerCase().includes(oe)
|
|
6842
6842
|
);
|
|
6843
|
-
}, [
|
|
6843
|
+
}, [E, fe]), _e = ct(() => e ? new Hd({ baseUrl: r, system_id: e }) : null, [r, e]), Z = Q(async () => {
|
|
6844
6844
|
if (_e) {
|
|
6845
6845
|
T(!0), R(null);
|
|
6846
6846
|
try {
|
|
@@ -6876,7 +6876,7 @@ function Ay({
|
|
|
6876
6876
|
}
|
|
6877
6877
|
const tt = oe.uid;
|
|
6878
6878
|
if (Ye.shiftKey && M !== null) {
|
|
6879
|
-
const rt = Math.min(M, de), Lt = Math.max(M, de), ee =
|
|
6879
|
+
const rt = Math.min(M, de), Lt = Math.max(M, de), ee = E.slice(rt, Lt + 1).map((ue) => ue.uid), j = new Set(ee);
|
|
6880
6880
|
N(j), p == null || p(Array.from(j));
|
|
6881
6881
|
} else if (Ye.ctrlKey || Ye.metaKey)
|
|
6882
6882
|
N((rt) => {
|
|
@@ -6887,7 +6887,7 @@ function Ay({
|
|
|
6887
6887
|
const rt = /* @__PURE__ */ new Set([tt]);
|
|
6888
6888
|
N(rt), I(de), p == null || p(Array.from(rt));
|
|
6889
6889
|
}
|
|
6890
|
-
}, [s, M,
|
|
6890
|
+
}, [s, M, E, D, f, p, o]), ke = Q(async () => {
|
|
6891
6891
|
if (!_e || D.size === 0) return;
|
|
6892
6892
|
const oe = i || "INBOX";
|
|
6893
6893
|
try {
|
|
@@ -6918,13 +6918,13 @@ function Ay({
|
|
|
6918
6918
|
console.error("Archive error:", Ye), R(Ye.message), m == null || m(Ye);
|
|
6919
6919
|
}
|
|
6920
6920
|
}, [_e, t, D, i, g, m]), qe = Q(() => {
|
|
6921
|
-
if (D.size ===
|
|
6921
|
+
if (D.size === E.length)
|
|
6922
6922
|
N(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6923
6923
|
else {
|
|
6924
|
-
const oe = new Set(
|
|
6924
|
+
const oe = new Set(E.map((de) => de.uid));
|
|
6925
6925
|
N(oe), p == null || p(Array.from(oe));
|
|
6926
6926
|
}
|
|
6927
|
-
}, [
|
|
6927
|
+
}, [E, D.size, p]), ze = Q(() => {
|
|
6928
6928
|
N(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6929
6929
|
}, [p]), He = {
|
|
6930
6930
|
delete: ke,
|
|
@@ -6938,8 +6938,8 @@ function Ay({
|
|
|
6938
6938
|
return de.toDateString() === Ye.toDateString() ? de.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : de.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
6939
6939
|
}, L = (oe, de) => /* @__PURE__ */ h.jsx("div", { style: {
|
|
6940
6940
|
padding: "12px 16px",
|
|
6941
|
-
background: de ?
|
|
6942
|
-
borderBottom: `1px solid ${
|
|
6941
|
+
background: de ? v.selectedBackground : oe.seen ? v.cardBackground : v.unreadBackground,
|
|
6942
|
+
borderBottom: `1px solid ${v.border}`,
|
|
6943
6943
|
cursor: "pointer",
|
|
6944
6944
|
transition: "background 0.15s ease"
|
|
6945
6945
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
@@ -6947,7 +6947,7 @@ function Ay({
|
|
|
6947
6947
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6948
6948
|
fontSize: "14px",
|
|
6949
6949
|
fontWeight: oe.seen ? 400 : 600,
|
|
6950
|
-
color:
|
|
6950
|
+
color: v.text,
|
|
6951
6951
|
whiteSpace: "nowrap",
|
|
6952
6952
|
overflow: "hidden",
|
|
6953
6953
|
textOverflow: "ellipsis"
|
|
@@ -6955,7 +6955,7 @@ function Ay({
|
|
|
6955
6955
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6956
6956
|
fontSize: "14px",
|
|
6957
6957
|
fontWeight: oe.seen ? 400 : 500,
|
|
6958
|
-
color: oe.seen ?
|
|
6958
|
+
color: oe.seen ? v.textSecondary : v.text,
|
|
6959
6959
|
marginTop: "2px",
|
|
6960
6960
|
whiteSpace: "nowrap",
|
|
6961
6961
|
overflow: "hidden",
|
|
@@ -6964,31 +6964,31 @@ function Ay({
|
|
|
6964
6964
|
] }),
|
|
6965
6965
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6966
6966
|
fontSize: "12px",
|
|
6967
|
-
color:
|
|
6967
|
+
color: v.textSecondary,
|
|
6968
6968
|
flexShrink: 0
|
|
6969
6969
|
}, children: Y(oe.date) })
|
|
6970
6970
|
] }) }), xe = (oe) => /* @__PURE__ */ h.jsxs("div", { style: { padding: "24px" }, children: [
|
|
6971
|
-
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
6972
|
-
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color:
|
|
6971
|
+
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: v.text }, children: Vr(oe.subject) || "(No subject)" }),
|
|
6972
|
+
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color: v.textSecondary, marginBottom: "16px" }, children: [
|
|
6973
6973
|
"From: ",
|
|
6974
6974
|
Vr(oe.from),
|
|
6975
6975
|
" • ",
|
|
6976
6976
|
new Date(oe.date).toLocaleString()
|
|
6977
6977
|
] }),
|
|
6978
|
-
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6978
|
+
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: v.textSecondary }, children: "Loading..." }) : re ? /* @__PURE__ */ h.jsx(
|
|
6979
6979
|
"div",
|
|
6980
6980
|
{
|
|
6981
|
-
style: { fontSize: "14px", color:
|
|
6981
|
+
style: { fontSize: "14px", color: v.text },
|
|
6982
6982
|
dangerouslySetInnerHTML: { __html: re }
|
|
6983
6983
|
}
|
|
6984
|
-
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6984
|
+
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: v.textSecondary }, children: "No content available" })
|
|
6985
6985
|
] }), Ke = (oe, de) => /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6986
6986
|
display: "flex",
|
|
6987
6987
|
alignItems: "center",
|
|
6988
6988
|
gap: "8px",
|
|
6989
6989
|
padding: "8px 16px",
|
|
6990
|
-
background:
|
|
6991
|
-
borderBottom: `1px solid ${
|
|
6990
|
+
background: v.cardBackground,
|
|
6991
|
+
borderBottom: `1px solid ${v.border}`
|
|
6992
6992
|
}, children: [
|
|
6993
6993
|
/* @__PURE__ */ h.jsx(
|
|
6994
6994
|
"button",
|
|
@@ -6997,17 +6997,17 @@ function Ay({
|
|
|
6997
6997
|
style: {
|
|
6998
6998
|
padding: "6px 12px",
|
|
6999
6999
|
background: "transparent",
|
|
7000
|
-
border: `1px solid ${
|
|
7000
|
+
border: `1px solid ${v.border}`,
|
|
7001
7001
|
borderRadius: "6px",
|
|
7002
7002
|
fontSize: "13px",
|
|
7003
7003
|
cursor: "pointer",
|
|
7004
|
-
color:
|
|
7004
|
+
color: v.text
|
|
7005
7005
|
},
|
|
7006
|
-
children: oe.length ===
|
|
7006
|
+
children: oe.length === E.length ? "Deselect All" : "Select All"
|
|
7007
7007
|
}
|
|
7008
7008
|
),
|
|
7009
7009
|
oe.length > 0 && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
7010
|
-
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color:
|
|
7010
|
+
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color: v.textSecondary }, children: [
|
|
7011
7011
|
oe.length,
|
|
7012
7012
|
" selected"
|
|
7013
7013
|
] }),
|
|
@@ -7023,10 +7023,10 @@ function Ay({
|
|
|
7023
7023
|
width: "32px",
|
|
7024
7024
|
height: "32px",
|
|
7025
7025
|
background: "transparent",
|
|
7026
|
-
border: `1px solid ${
|
|
7026
|
+
border: `1px solid ${v.border}`,
|
|
7027
7027
|
borderRadius: "6px",
|
|
7028
7028
|
cursor: "pointer",
|
|
7029
|
-
color:
|
|
7029
|
+
color: v.textSecondary
|
|
7030
7030
|
},
|
|
7031
7031
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
7032
7032
|
}
|
|
@@ -7043,10 +7043,10 @@ function Ay({
|
|
|
7043
7043
|
width: "32px",
|
|
7044
7044
|
height: "32px",
|
|
7045
7045
|
background: "transparent",
|
|
7046
|
-
border: `1px solid ${
|
|
7046
|
+
border: `1px solid ${v.border}`,
|
|
7047
7047
|
borderRadius: "6px",
|
|
7048
7048
|
cursor: "pointer",
|
|
7049
|
-
color:
|
|
7049
|
+
color: v.textSecondary
|
|
7050
7050
|
},
|
|
7051
7051
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
7052
7052
|
}
|
|
@@ -7065,10 +7065,10 @@ function Ay({
|
|
|
7065
7065
|
width: "32px",
|
|
7066
7066
|
height: "32px",
|
|
7067
7067
|
background: "transparent",
|
|
7068
|
-
border: `1px solid ${
|
|
7068
|
+
border: `1px solid ${v.border}`,
|
|
7069
7069
|
borderRadius: "6px",
|
|
7070
7070
|
cursor: "pointer",
|
|
7071
|
-
color:
|
|
7071
|
+
color: v.textSecondary
|
|
7072
7072
|
},
|
|
7073
7073
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
7074
7074
|
}
|
|
@@ -7076,25 +7076,25 @@ function Ay({
|
|
|
7076
7076
|
] }), z = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
7077
7077
|
padding: "48px",
|
|
7078
7078
|
textAlign: "center",
|
|
7079
|
-
color:
|
|
7079
|
+
color: v.textSecondary
|
|
7080
7080
|
}, children: c }), le = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
7081
7081
|
padding: "48px",
|
|
7082
7082
|
textAlign: "center",
|
|
7083
|
-
color:
|
|
7084
|
-
}, children: "Loading..." }), ye =
|
|
7085
|
-
return A &&
|
|
7083
|
+
color: v.textSecondary
|
|
7084
|
+
}, children: "Loading..." }), ye = b || L, be = y || xe, Ge = _ || Ke, vt = C || z, wt = k || le;
|
|
7085
|
+
return A && E.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: { background: v.background, width: "100%", height: "100%" }, children: wt() }) : /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", background: v.background, width: "100%", height: "100%" }, children: [
|
|
7086
7086
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
7087
7087
|
flex: o && V ? "0 0 50%" : "1",
|
|
7088
7088
|
display: "flex",
|
|
7089
7089
|
flexDirection: "column",
|
|
7090
|
-
borderRight: o && V ? `1px solid ${
|
|
7090
|
+
borderRight: o && V ? `1px solid ${v.border}` : "none",
|
|
7091
7091
|
overflow: "hidden"
|
|
7092
7092
|
}, children: [
|
|
7093
7093
|
s && Ge(Array.from(D), He),
|
|
7094
7094
|
l && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7095
7095
|
padding: "8px 12px",
|
|
7096
|
-
borderBottom: `1px solid ${
|
|
7097
|
-
background:
|
|
7096
|
+
borderBottom: `1px solid ${v.border}`,
|
|
7097
|
+
background: v.background
|
|
7098
7098
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: {
|
|
7099
7099
|
display: "flex",
|
|
7100
7100
|
alignItems: "center",
|
|
@@ -7103,7 +7103,7 @@ function Ay({
|
|
|
7103
7103
|
background: "#f5f5f5",
|
|
7104
7104
|
borderRadius: "6px"
|
|
7105
7105
|
}, children: [
|
|
7106
|
-
/* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
7106
|
+
/* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: v.textSecondary, strokeWidth: "2", children: [
|
|
7107
7107
|
/* @__PURE__ */ h.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
7108
7108
|
/* @__PURE__ */ h.jsx("path", { d: "M21 21l-4.35-4.35" })
|
|
7109
7109
|
] }),
|
|
@@ -7120,7 +7120,7 @@ function Ay({
|
|
|
7120
7120
|
background: "transparent",
|
|
7121
7121
|
outline: "none",
|
|
7122
7122
|
fontSize: "13px",
|
|
7123
|
-
color:
|
|
7123
|
+
color: v.text
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
),
|
|
@@ -7137,16 +7137,16 @@ function Ay({
|
|
|
7137
7137
|
alignItems: "center",
|
|
7138
7138
|
justifyContent: "center"
|
|
7139
7139
|
},
|
|
7140
|
-
children: /* @__PURE__ */ h.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
7140
|
+
children: /* @__PURE__ */ h.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: v.textSecondary, strokeWidth: "2", children: /* @__PURE__ */ h.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
7141
7141
|
}
|
|
7142
7142
|
)
|
|
7143
7143
|
] }) }),
|
|
7144
7144
|
F && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7145
7145
|
padding: "12px 16px",
|
|
7146
7146
|
background: "#fef2f2",
|
|
7147
|
-
color:
|
|
7147
|
+
color: v.danger,
|
|
7148
7148
|
fontSize: "14px",
|
|
7149
|
-
borderBottom: `1px solid ${
|
|
7149
|
+
borderBottom: `1px solid ${v.border}`
|
|
7150
7150
|
}, children: F }),
|
|
7151
7151
|
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Ne.length === 0 ? vt() : Ne.map((oe, de) => /* @__PURE__ */ h.jsx(
|
|
7152
7152
|
"div",
|
|
@@ -7173,18 +7173,18 @@ function Ty({
|
|
|
7173
7173
|
className: a = ""
|
|
7174
7174
|
}) {
|
|
7175
7175
|
const [u, c] = O(/* @__PURE__ */ new Set()), [d, f] = O(-1), p = r.filter((C) => u.has(C.id)), g = d >= 0 && d < p.length ? p[d] : null, m = Q((C) => {
|
|
7176
|
-
c((
|
|
7177
|
-
const w = new Set(
|
|
7176
|
+
c((k) => {
|
|
7177
|
+
const w = new Set(k);
|
|
7178
7178
|
return w.has(C) ? w.delete(C) : w.add(C), t == null || t(Array.from(w)), w;
|
|
7179
7179
|
});
|
|
7180
7180
|
}, [t]), x = Q(() => {
|
|
7181
7181
|
if (u.size === r.length)
|
|
7182
7182
|
c(/* @__PURE__ */ new Set()), f(-1), t == null || t([]);
|
|
7183
7183
|
else {
|
|
7184
|
-
const C = new Set(r.map((
|
|
7185
|
-
c(C), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((
|
|
7184
|
+
const C = new Set(r.map((k) => k.id));
|
|
7185
|
+
c(C), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((k) => k.id));
|
|
7186
7186
|
}
|
|
7187
|
-
}, [r, u.size, t, n]),
|
|
7187
|
+
}, [r, u.size, t, n]), b = Q(() => {
|
|
7188
7188
|
if (p.length === 0) return;
|
|
7189
7189
|
const C = d <= 0 ? p.length - 1 : d - 1;
|
|
7190
7190
|
f(C), n == null || n(p[C], C);
|
|
@@ -7192,7 +7192,7 @@ function Ty({
|
|
|
7192
7192
|
if (p.length === 0) return;
|
|
7193
7193
|
const C = d >= p.length - 1 ? 0 : d + 1;
|
|
7194
7194
|
f(C), n == null || n(p[C], C);
|
|
7195
|
-
}, [p, d, n]),
|
|
7195
|
+
}, [p, d, n]), _ = Q((C) => {
|
|
7196
7196
|
i == null || i(C, p, g);
|
|
7197
7197
|
}, [i, p, g]);
|
|
7198
7198
|
return Le.useEffect(() => {
|
|
@@ -7221,7 +7221,7 @@ function Ty({
|
|
|
7221
7221
|
/* @__PURE__ */ h.jsx(
|
|
7222
7222
|
"button",
|
|
7223
7223
|
{
|
|
7224
|
-
onClick:
|
|
7224
|
+
onClick: b,
|
|
7225
7225
|
className: "p-1 hover:bg-neutral-100 rounded transition-colors",
|
|
7226
7226
|
title: "Previous",
|
|
7227
7227
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: "chevron_left" })
|
|
@@ -7244,15 +7244,15 @@ function Ty({
|
|
|
7244
7244
|
] })
|
|
7245
7245
|
] }),
|
|
7246
7246
|
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((C) => {
|
|
7247
|
-
const
|
|
7247
|
+
const k = u.has(C.id), w = (g == null ? void 0 : g.id) === C.id;
|
|
7248
7248
|
return /* @__PURE__ */ h.jsxs(
|
|
7249
7249
|
"div",
|
|
7250
7250
|
{
|
|
7251
|
-
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${w ? "bg-blue-50 ring-1 ring-blue-200" :
|
|
7251
|
+
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${w ? "bg-blue-50 ring-1 ring-blue-200" : k ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
7252
7252
|
onClick: () => m(C.id),
|
|
7253
7253
|
children: [
|
|
7254
|
-
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${
|
|
7255
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(C,
|
|
7254
|
+
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${k ? "text-blue-500" : "text-neutral-300"}`, children: k ? "check_box" : "check_box_outline_blank" }),
|
|
7255
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(C, k, w) })
|
|
7256
7256
|
]
|
|
7257
7257
|
},
|
|
7258
7258
|
C.id
|
|
@@ -7260,13 +7260,13 @@ function Ty({
|
|
|
7260
7260
|
}) }),
|
|
7261
7261
|
s.length > 0 && u.size > 0 && /* @__PURE__ */ h.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: s.map((C) => {
|
|
7262
7262
|
var w;
|
|
7263
|
-
const
|
|
7263
|
+
const k = ((w = C.disabled) == null ? void 0 : w.call(C, p)) ?? !1;
|
|
7264
7264
|
return /* @__PURE__ */ h.jsxs(
|
|
7265
7265
|
"button",
|
|
7266
7266
|
{
|
|
7267
|
-
onClick: () =>
|
|
7268
|
-
disabled:
|
|
7269
|
-
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${
|
|
7267
|
+
onClick: () => _(C.id),
|
|
7268
|
+
disabled: k,
|
|
7269
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${k ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
7270
7270
|
children: [
|
|
7271
7271
|
C.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: C.icon }),
|
|
7272
7272
|
C.label
|
|
@@ -7363,29 +7363,29 @@ function Nu(r, e, t) {
|
|
|
7363
7363
|
for (let f = 0; f < e.length; f++) {
|
|
7364
7364
|
const p = e[f], g = p.type, m = p.target, x = Hf(m, r, l, o);
|
|
7365
7365
|
if (!x) continue;
|
|
7366
|
-
const [
|
|
7366
|
+
const [b, y] = x;
|
|
7367
7367
|
if (g === "characterData") n && X(y) && Wf(i, m, y) && Uf(m, y, r);
|
|
7368
7368
|
else if (g === "childList") {
|
|
7369
7369
|
u = !0;
|
|
7370
|
-
const
|
|
7371
|
-
for (let w = 0; w <
|
|
7372
|
-
const
|
|
7373
|
-
if (B != null &&
|
|
7370
|
+
const _ = p.addedNodes;
|
|
7371
|
+
for (let w = 0; w < _.length; w++) {
|
|
7372
|
+
const v = _[w], E = Lu(v), B = v.parentNode;
|
|
7373
|
+
if (B != null && v !== a && E === null && !Os(v, B, r)) {
|
|
7374
7374
|
if (vr) {
|
|
7375
|
-
const A =
|
|
7375
|
+
const A = v.innerText || v.nodeValue;
|
|
7376
7376
|
A && (c += A);
|
|
7377
7377
|
}
|
|
7378
|
-
B.removeChild(
|
|
7378
|
+
B.removeChild(v);
|
|
7379
7379
|
}
|
|
7380
7380
|
}
|
|
7381
|
-
const C = p.removedNodes,
|
|
7382
|
-
if (
|
|
7381
|
+
const C = p.removedNodes, k = C.length;
|
|
7382
|
+
if (k > 0) {
|
|
7383
7383
|
let w = 0;
|
|
7384
|
-
for (let
|
|
7385
|
-
const
|
|
7386
|
-
(Os(
|
|
7384
|
+
for (let v = 0; v < k; v++) {
|
|
7385
|
+
const E = C[v];
|
|
7386
|
+
(Os(E, m, r) || a === E) && (m.appendChild(E), w++);
|
|
7387
7387
|
}
|
|
7388
|
-
|
|
7388
|
+
k !== w && s.set(b, y);
|
|
7389
7389
|
}
|
|
7390
7390
|
}
|
|
7391
7391
|
}
|
|
@@ -7395,8 +7395,8 @@ function Nu(r, e, t) {
|
|
|
7395
7395
|
for (let f = 0; f < d.length; f++) {
|
|
7396
7396
|
const p = d[f], g = p.addedNodes, m = p.target;
|
|
7397
7397
|
for (let x = 0; x < g.length; x++) {
|
|
7398
|
-
const
|
|
7399
|
-
y == null ||
|
|
7398
|
+
const b = g[x], y = b.parentNode;
|
|
7399
|
+
y == null || b.nodeName !== "BR" || Os(b, m, r) || y.removeChild(b);
|
|
7400
7400
|
}
|
|
7401
7401
|
}
|
|
7402
7402
|
t.takeRecords();
|
|
@@ -7701,7 +7701,7 @@ function Jo(r, e, t, n, i) {
|
|
|
7701
7701
|
const g = ae();
|
|
7702
7702
|
if (!H(g) || t === null || n === null) return void s.setTextContent(l);
|
|
7703
7703
|
if (g.setTextNodeRange(s, t, s, n), s.isSegmented()) {
|
|
7704
|
-
const m =
|
|
7704
|
+
const m = lt(s.getTextContent());
|
|
7705
7705
|
s.replace(m), s = m;
|
|
7706
7706
|
}
|
|
7707
7707
|
s.setTextContent(l);
|
|
@@ -7943,7 +7943,7 @@ function Uu(r, e, t, n, i, s) {
|
|
|
7943
7943
|
o.__parent === e && (P(o) && Uu(o, l, t, n, i, s), t.has(l) || s.delete(l), i.push(l)), o = o.getNextSibling();
|
|
7944
7944
|
}
|
|
7945
7945
|
}
|
|
7946
|
-
let wr, _t, Un, bs, so, oo, Pr, Wt, ao, Wn,
|
|
7946
|
+
let wr, _t, Un, bs, so, oo, Pr, Wt, ao, Wn, ut = "", xt = "", Kt = null, Ot = "", ar = "", Wu = !1, Hn = !1, ki = null;
|
|
7947
7947
|
function Hi(r, e) {
|
|
7948
7948
|
const t = Pr.get(r);
|
|
7949
7949
|
if (e !== null) {
|
|
@@ -7999,27 +7999,27 @@ function Vi(r, e) {
|
|
|
7999
7999
|
})(Gi(t, Wt), l, t, n);
|
|
8000
8000
|
}
|
|
8001
8001
|
const o = t.__format;
|
|
8002
|
-
o !== 0 && Vu(n, o), t.isInline() || Gu(null, t, n), ys(t) && (
|
|
8002
|
+
o !== 0 && Vu(n, o), t.isInline() || Gu(null, t, n), ys(t) && (ut += ur, ar += ur);
|
|
8003
8003
|
} else {
|
|
8004
8004
|
const i = t.getTextContent();
|
|
8005
8005
|
if (We(t)) {
|
|
8006
8006
|
const s = t.decorate(_t, wr);
|
|
8007
8007
|
s !== null && Yu(r, s), n.contentEditable = "false";
|
|
8008
8008
|
} else X(t) && (t.isDirectionless() || (xt += i));
|
|
8009
|
-
|
|
8009
|
+
ut += i, ar += i;
|
|
8010
8010
|
}
|
|
8011
8011
|
return e !== null && e.insertChild(n), Zo(Wn, Un, bs, t, "created"), n;
|
|
8012
8012
|
}
|
|
8013
8013
|
function uo(r, e, t, n, i) {
|
|
8014
|
-
const s =
|
|
8015
|
-
|
|
8014
|
+
const s = ut;
|
|
8015
|
+
ut = "";
|
|
8016
8016
|
let o = t;
|
|
8017
8017
|
for (; o <= n; ++o) {
|
|
8018
8018
|
Vi(r[o], i);
|
|
8019
8019
|
const l = Wt.get(r[o]);
|
|
8020
8020
|
l !== null && X(l) && (Kt === null && (Kt = l.getFormat()), Ot === "" && (Ot = l.getStyle()));
|
|
8021
8021
|
}
|
|
8022
|
-
ys(e) && (
|
|
8022
|
+
ys(e) && (ut += ur), i.element.__lexicalTextContent = ut, ut = s + ut;
|
|
8023
8023
|
}
|
|
8024
8024
|
function Ua(r, e) {
|
|
8025
8025
|
if (r) {
|
|
@@ -8071,8 +8071,8 @@ function oh(r, e, t) {
|
|
|
8071
8071
|
const n = xt;
|
|
8072
8072
|
var i;
|
|
8073
8073
|
xt = "", Kt = null, Ot = "", function(s, o, l) {
|
|
8074
|
-
const a =
|
|
8075
|
-
|
|
8074
|
+
const a = ut, u = s.__size, c = o.__size;
|
|
8075
|
+
ut = "";
|
|
8076
8076
|
const d = l.element;
|
|
8077
8077
|
if (u === 1 && c === 1) {
|
|
8078
8078
|
const f = s.__first, p = o.__first;
|
|
@@ -8081,12 +8081,12 @@ function oh(r, e, t) {
|
|
|
8081
8081
|
const m = co(f), x = Vi(p, null);
|
|
8082
8082
|
try {
|
|
8083
8083
|
d.replaceChild(x, m);
|
|
8084
|
-
} catch (
|
|
8085
|
-
if (typeof
|
|
8086
|
-
const y = `${
|
|
8084
|
+
} catch (b) {
|
|
8085
|
+
if (typeof b == "object" && b != null) {
|
|
8086
|
+
const y = `${b.toString()} Parent: ${d.tagName}, new child: {tag: ${x.tagName} key: ${p}}, old child: {tag: ${m.tagName}, key: ${f}}.`;
|
|
8087
8087
|
throw new Error(y);
|
|
8088
8088
|
}
|
|
8089
|
-
throw
|
|
8089
|
+
throw b;
|
|
8090
8090
|
}
|
|
8091
8091
|
Hi(f, null);
|
|
8092
8092
|
}
|
|
@@ -8100,32 +8100,32 @@ function oh(r, e, t) {
|
|
|
8100
8100
|
const g = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
8101
8101
|
lo(f, 0, u - 1, g ? null : d), g && (d.textContent = "");
|
|
8102
8102
|
}
|
|
8103
|
-
} else (function(g, m, x,
|
|
8104
|
-
const C =
|
|
8105
|
-
let w,
|
|
8106
|
-
for (; B <= C && A <=
|
|
8103
|
+
} else (function(g, m, x, b, y, _) {
|
|
8104
|
+
const C = b - 1, k = y - 1;
|
|
8105
|
+
let w, v, E = _.getFirstChild(), B = 0, A = 0;
|
|
8106
|
+
for (; B <= C && A <= k; ) {
|
|
8107
8107
|
const R = m[B], D = x[A];
|
|
8108
|
-
if (R === D)
|
|
8108
|
+
if (R === D) E = qs(kn(D, _.element)), B++, A++;
|
|
8109
8109
|
else {
|
|
8110
|
-
w === void 0 && (w = new Set(m)),
|
|
8111
|
-
const M =
|
|
8110
|
+
w === void 0 && (w = new Set(m)), v === void 0 && (v = new Set(x));
|
|
8111
|
+
const M = v.has(R), I = w.has(D);
|
|
8112
8112
|
if (M) if (I) {
|
|
8113
8113
|
const V = Ui(_t, D);
|
|
8114
|
-
V ===
|
|
8115
|
-
} else Vi(D,
|
|
8116
|
-
else
|
|
8114
|
+
V === E ? E = qs(kn(D, _.element)) : (_.withBefore(E).insertChild(V), kn(D, _.element)), B++, A++;
|
|
8115
|
+
} else Vi(D, _.withBefore(E)), A++;
|
|
8116
|
+
else E = qs(co(R)), Hi(R, _.element), B++;
|
|
8117
8117
|
}
|
|
8118
8118
|
const N = Wt.get(D);
|
|
8119
8119
|
N !== null && X(N) && (Kt === null && (Kt = N.getFormat()), Ot === "" && (Ot = N.getStyle()));
|
|
8120
8120
|
}
|
|
8121
|
-
const T = B > C, F = A >
|
|
8121
|
+
const T = B > C, F = A > k;
|
|
8122
8122
|
if (T && !F) {
|
|
8123
|
-
const R = x[
|
|
8124
|
-
uo(x, g, A,
|
|
8125
|
-
} else F && !T && lo(m, B, C,
|
|
8123
|
+
const R = x[k + 1], D = R === void 0 ? null : _t.getElementByKey(R);
|
|
8124
|
+
uo(x, g, A, k, _.withBefore(D));
|
|
8125
|
+
} else F && !T && lo(m, B, C, _.element);
|
|
8126
8126
|
})(o, f, p, u, c, l);
|
|
8127
8127
|
}
|
|
8128
|
-
ys(o) && (
|
|
8128
|
+
ys(o) && (ut += ur), d.__lexicalTextContent = ut, ut = a + ut;
|
|
8129
8129
|
}(r, e, e.getDOMSlot(t)), Ku(e, t), an(i = e) && Kt != null && Kt !== i.__textFormat && !Hn && (i.setTextFormat(Kt), i.setTextStyle(Ot)), function(s) {
|
|
8130
8130
|
an(s) && Ot !== "" && Ot !== s.__textStyle && !Hn && s.setTextStyle(Ot);
|
|
8131
8131
|
}(e), xt = n;
|
|
@@ -8147,12 +8147,12 @@ function kn(r, e) {
|
|
|
8147
8147
|
if (t === n && !i) {
|
|
8148
8148
|
if (P(t)) {
|
|
8149
8149
|
const o = s.__lexicalTextContent;
|
|
8150
|
-
o !== void 0 && (
|
|
8150
|
+
o !== void 0 && (ut += o, ar += o);
|
|
8151
8151
|
const l = s.__lexicalDirTextContent;
|
|
8152
8152
|
l !== void 0 && (xt += l);
|
|
8153
8153
|
} else {
|
|
8154
8154
|
const o = t.getTextContent();
|
|
8155
|
-
X(t) && !t.isDirectionless() && (xt += o), ar += o,
|
|
8155
|
+
X(t) && !t.isDirectionless() && (xt += o), ar += o, ut += o;
|
|
8156
8156
|
}
|
|
8157
8157
|
return s;
|
|
8158
8158
|
}
|
|
@@ -8164,14 +8164,14 @@ function kn(r, e) {
|
|
|
8164
8164
|
const o = n.__indent;
|
|
8165
8165
|
o !== t.__indent && Hu(s, o);
|
|
8166
8166
|
const l = n.__format;
|
|
8167
|
-
l !== t.__format && Vu(s, l), i && (oh(t, n, s), bt(n) || n.isInline() || Gu(t, n, s)), ys(n) && (
|
|
8167
|
+
l !== t.__format && Vu(s, l), i && (oh(t, n, s), bt(n) || n.isInline() || Gu(t, n, s)), ys(n) && (ut += ur, ar += ur);
|
|
8168
8168
|
} else {
|
|
8169
8169
|
const o = n.getTextContent();
|
|
8170
8170
|
if (We(n)) {
|
|
8171
8171
|
const l = n.decorate(_t, wr);
|
|
8172
8172
|
l !== null && Yu(r, l);
|
|
8173
8173
|
} else X(n) && !n.isDirectionless() && (xt += o);
|
|
8174
|
-
|
|
8174
|
+
ut += o, ar += o;
|
|
8175
8175
|
}
|
|
8176
8176
|
if (!Hn && bt(n) && n.__cachedText !== ar) {
|
|
8177
8177
|
const o = n.getWritable();
|
|
@@ -8193,7 +8193,7 @@ function qs(r) {
|
|
|
8193
8193
|
return e !== null && e === _t._blockCursorElement && (e = e.nextSibling), e;
|
|
8194
8194
|
}
|
|
8195
8195
|
function ah(r, e, t, n, i, s) {
|
|
8196
|
-
|
|
8196
|
+
ut = "", ar = "", xt = "", Wu = n === sn, ki = null, _t = t, wr = t._config, Un = t._nodes, bs = _t._listeners.mutation, so = i, oo = s, Pr = r._nodeMap, Wt = e._nodeMap, Hn = e._readOnly, ao = new Map(t._keyToDOMMap);
|
|
8197
8197
|
const o = /* @__PURE__ */ new Map();
|
|
8198
8198
|
return Wn = o, kn("root", null), _t = void 0, Un = void 0, so = void 0, oo = void 0, Pr = void 0, Wt = void 0, wr = void 0, ao = void 0, Wn = void 0, o;
|
|
8199
8199
|
}
|
|
@@ -8363,8 +8363,8 @@ Li && ho.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
8363
8363
|
}
|
|
8364
8364
|
} else {
|
|
8365
8365
|
ht(null), t.preventDefault();
|
|
8366
|
-
const g = o.anchor.getNode(), m = g.getTextContent(), x = g.canInsertTextAfter(),
|
|
8367
|
-
Af && p && !
|
|
8366
|
+
const g = o.anchor.getNode(), m = g.getTextContent(), x = g.canInsertTextAfter(), b = o.anchor.offset === 0 && o.focus.offset === m.length;
|
|
8367
|
+
Af && p && !b && x || ne(n, Br, !0);
|
|
8368
8368
|
}
|
|
8369
8369
|
return;
|
|
8370
8370
|
}
|
|
@@ -8470,21 +8470,21 @@ function Ha(r, e, t) {
|
|
|
8470
8470
|
const a = l.anchor, u = a.getNode();
|
|
8471
8471
|
if (l.isCollapsed()) {
|
|
8472
8472
|
r.type === "Range" && r.anchorNode === r.focusNode && (l.dirty = !0);
|
|
8473
|
-
const c = xs(e).event, d = c ? c.timeStamp : performance.now(), [f, p, g, m, x] = Ju,
|
|
8473
|
+
const c = xs(e).event, d = c ? c.timeStamp : performance.now(), [f, p, g, m, x] = Ju, b = Xe(), y = e.isComposing() === !1 && b.getTextContent() === "";
|
|
8474
8474
|
if (d < x + 200 && a.offset === g && a.key === m) l.format = f, l.style = p;
|
|
8475
8475
|
else if (a.type === "text") X(u) || K(141), l.format = u.getFormat(), l.style = u.getStyle();
|
|
8476
8476
|
else if (a.type === "element" && !y) {
|
|
8477
|
-
const
|
|
8478
|
-
l.style = "",
|
|
8477
|
+
const _ = a.getNode();
|
|
8478
|
+
l.style = "", _ instanceof fn && _.getChildrenSize() === 0 ? (l.format = _.getTextFormat(), l.style = _.getTextStyle()) : l.format = 0;
|
|
8479
8479
|
}
|
|
8480
8480
|
} else {
|
|
8481
|
-
const c = a.key, d = l.focus.key, f = l.getNodes(), p = f.length, g = l.isBackward(), m = g ? o : i, x = g ? i : o,
|
|
8482
|
-
let
|
|
8483
|
-
for (let
|
|
8484
|
-
const w = f[
|
|
8485
|
-
if (X(w) &&
|
|
8481
|
+
const c = a.key, d = l.focus.key, f = l.getNodes(), p = f.length, g = l.isBackward(), m = g ? o : i, x = g ? i : o, b = g ? d : c, y = g ? c : d;
|
|
8482
|
+
let _ = Ff, C = !1;
|
|
8483
|
+
for (let k = 0; k < p; k++) {
|
|
8484
|
+
const w = f[k], v = w.getTextContentSize();
|
|
8485
|
+
if (X(w) && v !== 0 && !(k === 0 && w.__key === b && m === v || k === p - 1 && w.__key === y && x === 0) && (C = !0, _ &= w.getFormat(), _ === 0)) break;
|
|
8486
8486
|
}
|
|
8487
|
-
l.format = C ?
|
|
8487
|
+
l.format = C ? _ : 0;
|
|
8488
8488
|
}
|
|
8489
8489
|
}
|
|
8490
8490
|
ne(e, jo, void 0);
|
|
@@ -8853,7 +8853,7 @@ class _s {
|
|
|
8853
8853
|
return !1;
|
|
8854
8854
|
}
|
|
8855
8855
|
createParentElementNode() {
|
|
8856
|
-
return
|
|
8856
|
+
return ot();
|
|
8857
8857
|
}
|
|
8858
8858
|
selectStart() {
|
|
8859
8859
|
return this.selectPrevious();
|
|
@@ -9085,7 +9085,7 @@ class dn extends _s {
|
|
|
9085
9085
|
return { "#text": () => ({ conversion: hh, priority: 0 }), b: () => ({ conversion: dh, priority: 0 }), code: () => ({ conversion: pr, priority: 0 }), em: () => ({ conversion: pr, priority: 0 }), i: () => ({ conversion: pr, priority: 0 }), s: () => ({ conversion: pr, priority: 0 }), span: () => ({ conversion: ch, priority: 0 }), strong: () => ({ conversion: pr, priority: 0 }), sub: () => ({ conversion: pr, priority: 0 }), sup: () => ({ conversion: pr, priority: 0 }), u: () => ({ conversion: pr, priority: 0 }) };
|
|
9086
9086
|
}
|
|
9087
9087
|
static importJSON(e) {
|
|
9088
|
-
const t =
|
|
9088
|
+
const t = lt(e.text);
|
|
9089
9089
|
return t.setFormat(e.format), t.setDetail(e.detail), t.setMode(e.mode), t.setStyle(e.style), t;
|
|
9090
9090
|
}
|
|
9091
9091
|
exportDOM(e) {
|
|
@@ -9176,7 +9176,7 @@ class dn extends _s {
|
|
|
9176
9176
|
Et();
|
|
9177
9177
|
const t = this.getLatest(), n = t.getTextContent(), i = t.__key, s = xr(), o = new Set(e), l = [], a = n.length;
|
|
9178
9178
|
let u = "";
|
|
9179
|
-
for (let
|
|
9179
|
+
for (let k = 0; k < a; k++) u !== "" && o.has(k) && (l.push(u), u = ""), u += n[k];
|
|
9180
9180
|
u !== "" && l.push(u);
|
|
9181
9181
|
const c = l.length;
|
|
9182
9182
|
if (c === 0) return [];
|
|
@@ -9184,29 +9184,29 @@ class dn extends _s {
|
|
|
9184
9184
|
const d = l[0], f = t.getParent();
|
|
9185
9185
|
let p;
|
|
9186
9186
|
const g = t.getFormat(), m = t.getStyle(), x = t.__detail;
|
|
9187
|
-
let
|
|
9188
|
-
t.isSegmented() ? (p =
|
|
9189
|
-
const y = ae(),
|
|
9187
|
+
let b = !1;
|
|
9188
|
+
t.isSegmented() ? (p = lt(d), p.__format = g, p.__style = m, p.__detail = x, b = !0) : (p = t.getWritable(), p.__text = d);
|
|
9189
|
+
const y = ae(), _ = [p];
|
|
9190
9190
|
let C = d.length;
|
|
9191
|
-
for (let
|
|
9192
|
-
const w = l[
|
|
9193
|
-
|
|
9194
|
-
const B =
|
|
9191
|
+
for (let k = 1; k < c; k++) {
|
|
9192
|
+
const w = l[k], v = w.length, E = lt(w).getWritable();
|
|
9193
|
+
E.__format = g, E.__style = m, E.__detail = x;
|
|
9194
|
+
const B = E.__key, A = C + v;
|
|
9195
9195
|
if (H(y)) {
|
|
9196
9196
|
const T = y.anchor, F = y.focus;
|
|
9197
9197
|
T.key === i && T.type === "text" && T.offset > C && T.offset <= A && (T.key = B, T.offset -= C, y.dirty = !0), F.key === i && F.type === "text" && F.offset > C && F.offset <= A && (F.key = B, F.offset -= C, y.dirty = !0);
|
|
9198
9198
|
}
|
|
9199
|
-
s === i && ht(B), C = A,
|
|
9199
|
+
s === i && ht(B), C = A, _.push(E);
|
|
9200
9200
|
}
|
|
9201
9201
|
if (f !== null) {
|
|
9202
|
-
(function(
|
|
9203
|
-
const
|
|
9204
|
-
|
|
9202
|
+
(function(v) {
|
|
9203
|
+
const E = v.getPreviousSibling(), B = v.getNextSibling();
|
|
9204
|
+
E !== null && qi(E), B !== null && qi(B);
|
|
9205
9205
|
})(this);
|
|
9206
|
-
const
|
|
9207
|
-
|
|
9206
|
+
const k = f.getWritable(), w = this.getIndexWithinParent();
|
|
9207
|
+
b ? (k.splice(w, 0, _), this.remove()) : k.splice(w, 1, _), H(y) && Yi(y, f, w, c - 1);
|
|
9208
9208
|
}
|
|
9209
|
-
return
|
|
9209
|
+
return _;
|
|
9210
9210
|
}
|
|
9211
9211
|
mergeWithSibling(e) {
|
|
9212
9212
|
const t = e === this.getPreviousSibling();
|
|
@@ -9255,7 +9255,7 @@ function hh(r) {
|
|
|
9255
9255
|
const l = n[o];
|
|
9256
9256
|
l === `
|
|
9257
9257
|
` || l === `\r
|
|
9258
|
-
` ? i.push(Ir()) : l === " " ? i.push(ni()) : l !== "" && i.push(
|
|
9258
|
+
` ? i.push(Ir()) : l === " " ? i.push(ni()) : l !== "" && i.push(lt(l));
|
|
9259
9259
|
}
|
|
9260
9260
|
return { node: i };
|
|
9261
9261
|
}
|
|
@@ -9280,7 +9280,7 @@ function hh(r) {
|
|
|
9280
9280
|
}
|
|
9281
9281
|
i && (t = t.slice(0, t.length - 1));
|
|
9282
9282
|
}
|
|
9283
|
-
return t === "" ? { node: null } : { node:
|
|
9283
|
+
return t === "" ? { node: null } : { node: lt(t) };
|
|
9284
9284
|
}
|
|
9285
9285
|
function Qa(r, e) {
|
|
9286
9286
|
let t = r;
|
|
@@ -9306,7 +9306,7 @@ function pr(r) {
|
|
|
9306
9306
|
const e = ph[r.nodeName.toLowerCase()];
|
|
9307
9307
|
return e === void 0 ? { node: null } : { forChild: na(r.style, e), node: null };
|
|
9308
9308
|
}
|
|
9309
|
-
function
|
|
9309
|
+
function lt(r = "") {
|
|
9310
9310
|
return rr(new dn(r));
|
|
9311
9311
|
}
|
|
9312
9312
|
function X(r) {
|
|
@@ -9573,16 +9573,16 @@ class Dr {
|
|
|
9573
9573
|
const o = t[s];
|
|
9574
9574
|
o === `
|
|
9575
9575
|
` || o === `\r
|
|
9576
|
-
` ? n.push(Ir()) : o === " " ? n.push(ni()) : n.push(
|
|
9576
|
+
` ? n.push(Ir()) : o === " " ? n.push(ni()) : n.push(lt(o));
|
|
9577
9577
|
}
|
|
9578
9578
|
this.insertNodes(n);
|
|
9579
9579
|
}
|
|
9580
9580
|
insertText(e) {
|
|
9581
9581
|
const t = this.anchor, n = this.focus, i = this.format, s = this.style;
|
|
9582
9582
|
let o = t, l = n;
|
|
9583
|
-
!this.isCollapsed() && n.isBefore(t) && (o = n, l = t), o.type === "element" && function(x,
|
|
9584
|
-
const C = x.getNode(),
|
|
9585
|
-
w.setFormat(y), w.setStyle(
|
|
9583
|
+
!this.isCollapsed() && n.isBefore(t) && (o = n, l = t), o.type === "element" && function(x, b, y, _) {
|
|
9584
|
+
const C = x.getNode(), k = C.getChildAtIndex(x.offset), w = lt(), v = bt(C) ? ot().append(w) : w;
|
|
9585
|
+
w.setFormat(y), w.setStyle(_), k === null ? C.append(v) : k.insertBefore(v), x.is(b) && b.set(w.__key, 0, "text"), x.set(w.__key, 0, "text");
|
|
9586
9586
|
}(o, l, i, s);
|
|
9587
9587
|
const a = o.offset;
|
|
9588
9588
|
let u = l.offset;
|
|
@@ -9593,12 +9593,12 @@ class Dr {
|
|
|
9593
9593
|
let m = c[d - 1];
|
|
9594
9594
|
if (d === 1 && l.type === "element" && (u = p, l.set(o.key, u, "text")), this.isCollapsed() && a === p && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !g.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
9595
9595
|
let x = f.getNextSibling();
|
|
9596
|
-
if (X(x) && x.canInsertTextBefore() && !Ar(x) || (x =
|
|
9596
|
+
if (X(x) && x.canInsertTextBefore() && !Ar(x) || (x = lt(), x.setFormat(i), x.setStyle(s), g.canInsertTextAfter() ? f.insertAfter(x) : g.insertAfter(x)), x.select(0, 0), f = x, e !== "") return void this.insertText(e);
|
|
9597
9597
|
} else if (this.isCollapsed() && a === 0 && (f.isSegmented() || f.isToken() || !f.canInsertTextBefore() || !g.canInsertTextBefore() && f.getPreviousSibling() === null)) {
|
|
9598
9598
|
let x = f.getPreviousSibling();
|
|
9599
|
-
if (X(x) && !Ar(x) || (x =
|
|
9599
|
+
if (X(x) && !Ar(x) || (x = lt(), x.setFormat(i), g.canInsertTextBefore() ? f.insertBefore(x) : g.insertBefore(x)), x.select(), f = x, e !== "") return void this.insertText(e);
|
|
9600
9600
|
} else if (f.isSegmented() && a !== p) {
|
|
9601
|
-
const x =
|
|
9601
|
+
const x = lt(f.getTextContent());
|
|
9602
9602
|
x.setFormat(i), f.replace(x), f = x;
|
|
9603
9603
|
} else if (!this.isCollapsed() && e !== "") {
|
|
9604
9604
|
const x = m.getParent();
|
|
@@ -9606,67 +9606,67 @@ class Dr {
|
|
|
9606
9606
|
}
|
|
9607
9607
|
if (d === 1) {
|
|
9608
9608
|
if (f.isToken()) {
|
|
9609
|
-
const
|
|
9610
|
-
return
|
|
9609
|
+
const _ = lt(e);
|
|
9610
|
+
return _.select(), void f.replace(_);
|
|
9611
9611
|
}
|
|
9612
|
-
const x = f.getFormat(),
|
|
9613
|
-
if (a !== u || x === i &&
|
|
9612
|
+
const x = f.getFormat(), b = f.getStyle();
|
|
9613
|
+
if (a !== u || x === i && b === s) {
|
|
9614
9614
|
if (gh(f)) {
|
|
9615
|
-
const
|
|
9616
|
-
return
|
|
9615
|
+
const _ = lt(e);
|
|
9616
|
+
return _.setFormat(i), _.setStyle(s), _.select(), void f.replace(_);
|
|
9617
9617
|
}
|
|
9618
9618
|
} else {
|
|
9619
9619
|
if (f.getTextContent() !== "") {
|
|
9620
|
-
const
|
|
9621
|
-
if (
|
|
9620
|
+
const _ = lt(e);
|
|
9621
|
+
if (_.setFormat(i), _.setStyle(s), _.select(), a === 0) f.insertBefore(_, !1);
|
|
9622
9622
|
else {
|
|
9623
9623
|
const [C] = f.splitText(a);
|
|
9624
|
-
C.insertAfter(
|
|
9624
|
+
C.insertAfter(_, !1);
|
|
9625
9625
|
}
|
|
9626
|
-
return void (
|
|
9626
|
+
return void (_.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
9627
9627
|
}
|
|
9628
9628
|
f.setFormat(i), f.setStyle(s);
|
|
9629
9629
|
}
|
|
9630
9630
|
const y = u - a;
|
|
9631
|
-
f = f.spliceText(a, y, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = x, this.style =
|
|
9631
|
+
f = f.spliceText(a, y, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = x, this.style = b));
|
|
9632
9632
|
} else {
|
|
9633
|
-
const x = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]),
|
|
9634
|
-
let y = P(m) ? m : m.getParentOrThrow(),
|
|
9635
|
-
if (!
|
|
9636
|
-
|
|
9633
|
+
const x = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]), b = P(f) ? f : f.getParentOrThrow();
|
|
9634
|
+
let y = P(m) ? m : m.getParentOrThrow(), _ = m;
|
|
9635
|
+
if (!b.is(y) && y.isInline()) do
|
|
9636
|
+
_ = y, y = y.getParentOrThrow();
|
|
9637
9637
|
while (y.isInline());
|
|
9638
9638
|
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (X(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
9639
9639
|
if (m.isSegmented()) {
|
|
9640
|
-
const
|
|
9641
|
-
m.replace(
|
|
9640
|
+
const E = lt(m.getTextContent());
|
|
9641
|
+
m.replace(E), m = E;
|
|
9642
9642
|
}
|
|
9643
9643
|
bt(l.getNode()) || l.type !== "text" || (m = m.spliceText(0, u, "")), x.add(m.__key);
|
|
9644
9644
|
} else {
|
|
9645
|
-
const
|
|
9646
|
-
|
|
9645
|
+
const E = m.getParentOrThrow();
|
|
9646
|
+
E.canBeEmpty() || E.getChildrenSize() !== 1 ? m.remove() : E.remove();
|
|
9647
9647
|
}
|
|
9648
9648
|
else x.add(m.__key);
|
|
9649
|
-
const C = y.getChildren(),
|
|
9650
|
-
for (let
|
|
9651
|
-
const B = C[
|
|
9649
|
+
const C = y.getChildren(), k = new Set(c), w = b.is(y), v = b.isInline() && f.getNextSibling() === null ? b : f;
|
|
9650
|
+
for (let E = C.length - 1; E >= 0; E--) {
|
|
9651
|
+
const B = C[E];
|
|
9652
9652
|
if (B.is(f) || P(B) && B.isParentOf(f)) break;
|
|
9653
|
-
B.isAttached() && (!
|
|
9653
|
+
B.isAttached() && (!k.has(B) || B.is(_) ? w || v.insertAfter(B, !1) : B.remove());
|
|
9654
9654
|
}
|
|
9655
9655
|
if (!w) {
|
|
9656
|
-
let
|
|
9657
|
-
for (;
|
|
9658
|
-
const A =
|
|
9659
|
-
(T === 0 || A[T - 1].is(B)) && (x.delete(
|
|
9656
|
+
let E = y, B = null;
|
|
9657
|
+
for (; E !== null; ) {
|
|
9658
|
+
const A = E.getChildren(), T = A.length;
|
|
9659
|
+
(T === 0 || A[T - 1].is(B)) && (x.delete(E.__key), B = E), E = E.getParent();
|
|
9660
9660
|
}
|
|
9661
9661
|
}
|
|
9662
9662
|
if (f.isToken()) if (a === p) f.select();
|
|
9663
9663
|
else {
|
|
9664
|
-
const
|
|
9665
|
-
|
|
9664
|
+
const E = lt(e);
|
|
9665
|
+
E.select(), f.replace(E);
|
|
9666
9666
|
}
|
|
9667
9667
|
else f = f.spliceText(a, p - a, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
9668
|
-
for (let
|
|
9669
|
-
const B = c[
|
|
9668
|
+
for (let E = 1; E < d; E++) {
|
|
9669
|
+
const B = c[E], A = B.__key;
|
|
9670
9670
|
x.has(A) || B.remove();
|
|
9671
9671
|
}
|
|
9672
9672
|
}
|
|
@@ -9682,7 +9682,7 @@ class Dr {
|
|
|
9682
9682
|
const c = (d, f) => {
|
|
9683
9683
|
if (d.getTextContent() === "") d.remove();
|
|
9684
9684
|
else if (f !== 0 && Ar(d)) {
|
|
9685
|
-
const p =
|
|
9685
|
+
const p = lt(d.getTextContent());
|
|
9686
9686
|
return p.setFormat(d.getFormat()), p.setStyle(d.getStyle()), d.replace(p);
|
|
9687
9687
|
}
|
|
9688
9688
|
};
|
|
@@ -9701,10 +9701,10 @@ class Dr {
|
|
|
9701
9701
|
const n = this.getNodes(), i = [];
|
|
9702
9702
|
for (const C of n) X(C) && i.push(C);
|
|
9703
9703
|
const s = (C) => {
|
|
9704
|
-
n.forEach((
|
|
9705
|
-
if (an(
|
|
9706
|
-
const w =
|
|
9707
|
-
|
|
9704
|
+
n.forEach((k) => {
|
|
9705
|
+
if (an(k)) {
|
|
9706
|
+
const w = k.getFormatFlags(e, C);
|
|
9707
|
+
k.setTextFormat(w);
|
|
9708
9708
|
}
|
|
9709
9709
|
});
|
|
9710
9710
|
}, o = i.length;
|
|
@@ -9715,25 +9715,25 @@ class Dr {
|
|
|
9715
9715
|
const m = p.getFormatFlags(e, t);
|
|
9716
9716
|
s(m);
|
|
9717
9717
|
const x = o - 1;
|
|
9718
|
-
let
|
|
9719
|
-
const y = d.type === "text" ? d.offset :
|
|
9720
|
-
if (p.is(
|
|
9718
|
+
let b = i[x];
|
|
9719
|
+
const y = d.type === "text" ? d.offset : b.getTextContentSize();
|
|
9720
|
+
if (p.is(b)) {
|
|
9721
9721
|
if (g === y) return;
|
|
9722
9722
|
if (Ar(p) || g === 0 && y === p.getTextContentSize()) p.setFormat(m);
|
|
9723
9723
|
else {
|
|
9724
|
-
const C = p.splitText(g, y),
|
|
9725
|
-
|
|
9724
|
+
const C = p.splitText(g, y), k = g === 0 ? C[0] : C[1];
|
|
9725
|
+
k.setFormat(m), c.type === "text" && c.set(k.__key, 0, "text"), d.type === "text" && d.set(k.__key, y - g, "text");
|
|
9726
9726
|
}
|
|
9727
9727
|
return void (this.format = m);
|
|
9728
9728
|
}
|
|
9729
9729
|
g === 0 || Ar(p) || ([, p] = p.splitText(g), g = 0), p.setFormat(m);
|
|
9730
|
-
const
|
|
9731
|
-
y > 0 && (y ===
|
|
9730
|
+
const _ = b.getFormatFlags(e, m);
|
|
9731
|
+
y > 0 && (y === b.getTextContentSize() || Ar(b) || ([b] = b.splitText(y)), b.setFormat(_));
|
|
9732
9732
|
for (let C = f + 1; C < x; C++) {
|
|
9733
|
-
const
|
|
9734
|
-
|
|
9733
|
+
const k = i[C], w = k.getFormatFlags(e, _);
|
|
9734
|
+
k.setFormat(w);
|
|
9735
9735
|
}
|
|
9736
|
-
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(
|
|
9736
|
+
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(b.__key, y, "text"), this.format = m | _;
|
|
9737
9737
|
}
|
|
9738
9738
|
insertNodes(e) {
|
|
9739
9739
|
if (e.length === 0) return;
|
|
@@ -9757,12 +9757,12 @@ class Dr {
|
|
|
9757
9757
|
return n.splice(g, 0, e), void i.selectEnd();
|
|
9758
9758
|
}
|
|
9759
9759
|
const s = function(g) {
|
|
9760
|
-
const m =
|
|
9760
|
+
const m = ot();
|
|
9761
9761
|
let x = null;
|
|
9762
|
-
for (let
|
|
9763
|
-
const y = g[
|
|
9764
|
-
if (
|
|
9765
|
-
if (x === null && (x = y.createParentElementNode(), m.append(x),
|
|
9762
|
+
for (let b = 0; b < g.length; b++) {
|
|
9763
|
+
const y = g[b], _ = Mr(y);
|
|
9764
|
+
if (_ || We(y) && y.isInline() || P(y) && y.isInline() || X(y) || y.isParentRequired()) {
|
|
9765
|
+
if (x === null && (x = y.createParentElementNode(), m.append(x), _)) continue;
|
|
9766
9766
|
x !== null && x.append(y);
|
|
9767
9767
|
} else m.append(y), x = null;
|
|
9768
9768
|
}
|
|
@@ -9771,12 +9771,12 @@ class Dr {
|
|
|
9771
9771
|
let c = l[0];
|
|
9772
9772
|
var d;
|
|
9773
9773
|
P(d = c) && gr(d) && !d.isEmpty() && P(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (P(n) || K(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = l[1]), c && (n === null && K(212, t.constructor.name, t.getType()), function(g, m, x) {
|
|
9774
|
-
const
|
|
9774
|
+
const b = m.getParentOrThrow().getLastChild();
|
|
9775
9775
|
let y = m;
|
|
9776
|
-
const
|
|
9777
|
-
for (; y !==
|
|
9776
|
+
const _ = [m];
|
|
9777
|
+
for (; y !== b; ) y.getNextSibling() || K(140), y = y.getNextSibling(), _.push(y);
|
|
9778
9778
|
let C = g;
|
|
9779
|
-
for (const
|
|
9779
|
+
for (const k of _) C = C.insertAfter(k);
|
|
9780
9780
|
}(n, c));
|
|
9781
9781
|
const f = bn(o, gr);
|
|
9782
9782
|
a && P(f) && (a.canMergeWhenEmpty() || gr(u)) && (f.append(...a.getChildren()), a.remove()), P(n) && n.isEmpty() && n.remove(), o.selectEnd();
|
|
@@ -9785,7 +9785,7 @@ class Dr {
|
|
|
9785
9785
|
}
|
|
9786
9786
|
insertParagraph() {
|
|
9787
9787
|
if (this.anchor.key === "root") {
|
|
9788
|
-
const o =
|
|
9788
|
+
const o = ot();
|
|
9789
9789
|
return Xe().splice(this.anchor.offset, 0, [o]), o.select(), o;
|
|
9790
9790
|
}
|
|
9791
9791
|
const e = Gs(this), t = bn(this.anchor.getNode(), gr);
|
|
@@ -9850,12 +9850,12 @@ class Dr {
|
|
|
9850
9850
|
const f = u.getRangeAt(0), p = this.anchor.getNode(), g = bt(p) ? p : Jf(p);
|
|
9851
9851
|
if (this.applyDOMRange(f), this.dirty = !0, !o) {
|
|
9852
9852
|
const m = this.getNodes(), x = [];
|
|
9853
|
-
let
|
|
9853
|
+
let b = !1;
|
|
9854
9854
|
for (let y = 0; y < m.length; y++) {
|
|
9855
|
-
const
|
|
9856
|
-
Rn(
|
|
9855
|
+
const _ = m[y];
|
|
9856
|
+
Rn(_, g) ? x.push(_) : b = !0;
|
|
9857
9857
|
}
|
|
9858
|
-
if (
|
|
9858
|
+
if (b && x.length > 0) if (t) {
|
|
9859
9859
|
const y = x[0];
|
|
9860
9860
|
P(y) ? y.selectStart() : y.getParentOrThrow().selectStart();
|
|
9861
9861
|
} else {
|
|
@@ -9863,8 +9863,8 @@ class Dr {
|
|
|
9863
9863
|
P(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
|
|
9864
9864
|
}
|
|
9865
9865
|
u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(y) {
|
|
9866
|
-
const
|
|
9867
|
-
mr(C,
|
|
9866
|
+
const _ = y.focus, C = y.anchor, k = C.key, w = C.offset, v = C.type;
|
|
9867
|
+
mr(C, _.key, _.offset, _.type), mr(_, k, w, v), y._cachedNodes = null;
|
|
9868
9868
|
}(this);
|
|
9869
9869
|
}
|
|
9870
9870
|
}
|
|
@@ -9908,8 +9908,8 @@ class Dr {
|
|
|
9908
9908
|
(function(a, u) {
|
|
9909
9909
|
const c = a.anchor, d = a.focus, f = c.getNode(), p = d.getNode();
|
|
9910
9910
|
if (f === p && c.type === "text" && d.type === "text") {
|
|
9911
|
-
const g = c.offset, m = d.offset, x = g < m,
|
|
9912
|
-
|
|
9911
|
+
const g = c.offset, m = d.offset, x = g < m, b = x ? g : m, y = x ? m : g, _ = y - 1;
|
|
9912
|
+
b !== _ && (Ou(f.getTextContent().slice(b, y)) || (u ? d.offset = _ : c.offset = _));
|
|
9913
9913
|
}
|
|
9914
9914
|
})(this, e);
|
|
9915
9915
|
}
|
|
@@ -9992,9 +9992,9 @@ function el(r, e, t, n) {
|
|
|
9992
9992
|
const p = n.getElementByKey(f.getKey());
|
|
9993
9993
|
p === null && K(214), [f, s] = f.getDOMSlot(p).resolveChildIndex(f, p, r, e), P(f) || K(215), o && s >= f.getChildrenSize() && (s = Math.max(0, f.getChildrenSize() - 1));
|
|
9994
9994
|
let m = f.getChildAtIndex(s);
|
|
9995
|
-
if (P(m) && function(x,
|
|
9996
|
-
const
|
|
9997
|
-
return y === null ||
|
|
9995
|
+
if (P(m) && function(x, b, y) {
|
|
9996
|
+
const _ = x.getParent();
|
|
9997
|
+
return y === null || _ === null || !_.canBeEmpty() || _ !== y.getNode();
|
|
9998
9998
|
}(m, 0, t)) {
|
|
9999
9999
|
const x = o ? m.getLastDescendant() : m.getFirstDescendant();
|
|
10000
10000
|
x === null ? f = m : (m = x, f = P(m) ? m : m.getParentOrThrow()), s = 0;
|
|
@@ -10144,21 +10144,21 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10144
10144
|
const l = n.anchorNode, a = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
10145
10145
|
if (i.has("collaboration") && d !== s || d !== null && Ko(d)) return;
|
|
10146
10146
|
if (!H(e)) return void (r !== null && Zn(t, l, a) && n.removeAllRanges());
|
|
10147
|
-
const f = e.anchor, p = e.focus, g = f.key, m = p.key, x = Ui(t, g),
|
|
10148
|
-
let
|
|
10147
|
+
const f = e.anchor, p = e.focus, g = f.key, m = p.key, x = Ui(t, g), b = Ui(t, m), y = f.offset, _ = p.offset, C = e.format, k = e.style, w = e.isCollapsed();
|
|
10148
|
+
let v = x, E = b, B = !1;
|
|
10149
10149
|
if (f.type === "text") {
|
|
10150
|
-
|
|
10150
|
+
v = zi(x);
|
|
10151
10151
|
const N = f.getNode();
|
|
10152
|
-
B = N.getFormat() !== C || N.getStyle() !==
|
|
10152
|
+
B = N.getFormat() !== C || N.getStyle() !== k;
|
|
10153
10153
|
} else H(r) && r.anchor.type === "text" && (B = !0);
|
|
10154
10154
|
var A, T, F, R, D;
|
|
10155
|
-
if (p.type === "text" && (
|
|
10155
|
+
if (p.type === "text" && (E = zi(b)), v !== null && E !== null && (w && (r === null || B || H(r) && (r.format !== C || r.style !== k)) && (A = C, T = k, F = y, R = g, D = performance.now(), Ju = [A, T, F, R, D]), u !== y || c !== _ || l !== v || a !== E || n.type === "Range" && w || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
10156
10156
|
try {
|
|
10157
|
-
n.setBaseAndExtent(
|
|
10157
|
+
n.setBaseAndExtent(v, y, E, _);
|
|
10158
10158
|
} catch {
|
|
10159
10159
|
}
|
|
10160
10160
|
if (!i.has("skip-scroll-into-view") && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
10161
|
-
const N = e instanceof Dr && e.anchor.type === "element" ?
|
|
10161
|
+
const N = e instanceof Dr && e.anchor.type === "element" ? v.childNodes[y] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
10162
10162
|
if (N !== null) {
|
|
10163
10163
|
let M;
|
|
10164
10164
|
if (N instanceof Text) {
|
|
@@ -10210,7 +10210,7 @@ function Gs(r) {
|
|
|
10210
10210
|
function bh(r, e) {
|
|
10211
10211
|
const t = r.getParent();
|
|
10212
10212
|
if (!t) {
|
|
10213
|
-
const i =
|
|
10213
|
+
const i = ot();
|
|
10214
10214
|
return Xe().append(i), i.select(), [Xe(), 0];
|
|
10215
10215
|
}
|
|
10216
10216
|
if (X(r)) {
|
|
@@ -10313,8 +10313,8 @@ function br(r, e) {
|
|
|
10313
10313
|
if (r._pendingEditorState = null, r._editorState = t, !i && a && p !== null) {
|
|
10314
10314
|
ft = r, dt = t, St = !1, r._updating = !0;
|
|
10315
10315
|
try {
|
|
10316
|
-
const w = r._dirtyType,
|
|
10317
|
-
p.disconnect(), g = ah(s, t, r, w,
|
|
10316
|
+
const w = r._dirtyType, v = r._dirtyElements, E = r._dirtyLeaves;
|
|
10317
|
+
p.disconnect(), g = ah(s, t, r, w, v, E);
|
|
10318
10318
|
} catch (w) {
|
|
10319
10319
|
if (w instanceof Error && r._onError(w), Ks) throw w;
|
|
10320
10320
|
return mc(r, null, n, t), Fu(r), r._dirtyType = sn, Ks = !0, br(r, s), void (Ks = !1);
|
|
@@ -10323,13 +10323,13 @@ function br(r, e) {
|
|
|
10323
10323
|
}
|
|
10324
10324
|
}
|
|
10325
10325
|
t._readOnly || (t._readOnly = !0);
|
|
10326
|
-
const m = r._dirtyLeaves, x = r._dirtyElements,
|
|
10327
|
-
a && (r._dirtyType = jr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(w,
|
|
10328
|
-
const
|
|
10329
|
-
let B = w._pendingDecorators ||
|
|
10330
|
-
const A =
|
|
10326
|
+
const m = r._dirtyLeaves, x = r._dirtyElements, b = r._normalizedNodes, y = r._updateTags, _ = r._deferred;
|
|
10327
|
+
a && (r._dirtyType = jr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(w, v) {
|
|
10328
|
+
const E = w._decorators;
|
|
10329
|
+
let B = w._pendingDecorators || E;
|
|
10330
|
+
const A = v._nodeMap;
|
|
10331
10331
|
let T;
|
|
10332
|
-
for (T in B) A.has(T) || (B ===
|
|
10332
|
+
for (T in B) A.has(T) || (B === E && (B = Pu(w)), delete B[T]);
|
|
10333
10333
|
}(r, t);
|
|
10334
10334
|
const C = i ? null : jt(r._window);
|
|
10335
10335
|
if (r._editable && C !== null && (a || l === null || l.dirty)) {
|
|
@@ -10344,33 +10344,33 @@ function br(r, e) {
|
|
|
10344
10344
|
ft = d, dt = u;
|
|
10345
10345
|
}
|
|
10346
10346
|
}
|
|
10347
|
-
g !== null && function(w,
|
|
10347
|
+
g !== null && function(w, v, E, B, A) {
|
|
10348
10348
|
const T = Array.from(w._listeners.mutation), F = T.length;
|
|
10349
10349
|
for (let R = 0; R < F; R++) {
|
|
10350
|
-
const [D, N] = T[R], M =
|
|
10351
|
-
M !== void 0 && D(M, { dirtyLeaves: B, prevEditorState: A, updateTags:
|
|
10350
|
+
const [D, N] = T[R], M = v.get(N);
|
|
10351
|
+
M !== void 0 && D(M, { dirtyLeaves: B, prevEditorState: A, updateTags: E });
|
|
10352
10352
|
}
|
|
10353
10353
|
}(r, g, y, m, s), H(l) || l === null || o !== null && o.is(l) || r.dispatchCommand(jo, void 0);
|
|
10354
|
-
const
|
|
10355
|
-
|
|
10356
|
-
const B = Ra(
|
|
10354
|
+
const k = r._pendingDecorators;
|
|
10355
|
+
k !== null && (r._decorators = k, r._pendingDecorators = null, Pn("decorator", r, !0, k)), function(w, v, E) {
|
|
10356
|
+
const B = Ra(v), A = Ra(E);
|
|
10357
10357
|
B !== A && Pn("textcontent", w, !0, A);
|
|
10358
|
-
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes:
|
|
10359
|
-
if (w._deferred = [],
|
|
10360
|
-
const
|
|
10358
|
+
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(w, v) {
|
|
10359
|
+
if (w._deferred = [], v.length !== 0) {
|
|
10360
|
+
const E = w._updating;
|
|
10361
10361
|
w._updating = !0;
|
|
10362
10362
|
try {
|
|
10363
|
-
for (let B = 0; B <
|
|
10363
|
+
for (let B = 0; B < v.length; B++) v[B]();
|
|
10364
10364
|
} finally {
|
|
10365
|
-
w._updating =
|
|
10365
|
+
w._updating = E;
|
|
10366
10366
|
}
|
|
10367
10367
|
}
|
|
10368
|
-
}(r,
|
|
10369
|
-
const
|
|
10370
|
-
if (
|
|
10371
|
-
const
|
|
10372
|
-
if (
|
|
10373
|
-
const [B, A] =
|
|
10368
|
+
}(r, _), function(w) {
|
|
10369
|
+
const v = w._updates;
|
|
10370
|
+
if (v.length !== 0) {
|
|
10371
|
+
const E = v.shift();
|
|
10372
|
+
if (E) {
|
|
10373
|
+
const [B, A] = E;
|
|
10374
10374
|
hc(w, B, A);
|
|
10375
10375
|
}
|
|
10376
10376
|
}
|
|
@@ -10436,38 +10436,38 @@ function hc(r, e, t) {
|
|
|
10436
10436
|
const c = dt, d = St, f = ft, p = r._updating;
|
|
10437
10437
|
dt = a, St = !1, r._updating = !0, ft = r;
|
|
10438
10438
|
try {
|
|
10439
|
-
u && (r._headless ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(
|
|
10440
|
-
const y =
|
|
10441
|
-
return H(y) || y == null ? ia(y,
|
|
10439
|
+
u && (r._headless ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(b) {
|
|
10440
|
+
const y = b.getEditorState()._selection, _ = jt(b._window);
|
|
10441
|
+
return H(y) || y == null ? ia(y, _, b, null) : y.clone();
|
|
10442
10442
|
}(r));
|
|
10443
10443
|
const m = r._compositionKey;
|
|
10444
|
-
e(), s = ul(r, s), function(
|
|
10445
|
-
const
|
|
10444
|
+
e(), s = ul(r, s), function(b, y) {
|
|
10445
|
+
const _ = y.getEditorState()._selection, C = b._selection;
|
|
10446
10446
|
if (H(C)) {
|
|
10447
|
-
const
|
|
10448
|
-
let
|
|
10449
|
-
if (
|
|
10450
|
-
const
|
|
10451
|
-
|
|
10447
|
+
const k = C.anchor, w = C.focus;
|
|
10448
|
+
let v;
|
|
10449
|
+
if (k.type === "text" && (v = k.getNode(), v.selectionTransform(_, C)), w.type === "text") {
|
|
10450
|
+
const E = w.getNode();
|
|
10451
|
+
v !== E && E.selectionTransform(_, C);
|
|
10452
10452
|
}
|
|
10453
10453
|
}
|
|
10454
|
-
}(a, r), r._dirtyType !== jr && (s ? function(
|
|
10455
|
-
const
|
|
10456
|
-
for (const
|
|
10457
|
-
const w = C.get(
|
|
10454
|
+
}(a, r), r._dirtyType !== jr && (s ? function(b, y) {
|
|
10455
|
+
const _ = y._dirtyLeaves, C = b._nodeMap;
|
|
10456
|
+
for (const k of _) {
|
|
10457
|
+
const w = C.get(k);
|
|
10458
10458
|
X(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() && Fa(w);
|
|
10459
10459
|
}
|
|
10460
|
-
}(a, r) : function(
|
|
10461
|
-
const
|
|
10462
|
-
let
|
|
10460
|
+
}(a, r) : function(b, y) {
|
|
10461
|
+
const _ = y._dirtyLeaves, C = y._dirtyElements, k = b._nodeMap, w = xr(), v = /* @__PURE__ */ new Map();
|
|
10462
|
+
let E = _, B = E.size, A = C, T = A.size;
|
|
10463
10463
|
for (; B > 0 || T > 0; ) {
|
|
10464
10464
|
if (B > 0) {
|
|
10465
10465
|
y._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
10466
|
-
for (const F of
|
|
10467
|
-
const R =
|
|
10468
|
-
X(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Fa(R), R !== void 0 && al(R, w) && ol(y, R,
|
|
10466
|
+
for (const F of E) {
|
|
10467
|
+
const R = k.get(F);
|
|
10468
|
+
X(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Fa(R), R !== void 0 && al(R, w) && ol(y, R, v), _.add(F);
|
|
10469
10469
|
}
|
|
10470
|
-
if (
|
|
10470
|
+
if (E = y._dirtyLeaves, B = E.size, B > 0) {
|
|
10471
10471
|
Si++;
|
|
10472
10472
|
continue;
|
|
10473
10473
|
}
|
|
@@ -10476,28 +10476,28 @@ function hc(r, e, t) {
|
|
|
10476
10476
|
for (const F of A) {
|
|
10477
10477
|
const R = F[0], D = F[1];
|
|
10478
10478
|
if (R !== "root" && !D) continue;
|
|
10479
|
-
const N =
|
|
10480
|
-
N !== void 0 && al(N, w) && ol(y, N,
|
|
10479
|
+
const N = k.get(R);
|
|
10480
|
+
N !== void 0 && al(N, w) && ol(y, N, v), C.set(R, D);
|
|
10481
10481
|
}
|
|
10482
|
-
|
|
10482
|
+
E = y._dirtyLeaves, B = E.size, A = y._dirtyElements, T = A.size, Si++;
|
|
10483
10483
|
}
|
|
10484
|
-
y._dirtyLeaves =
|
|
10485
|
-
}(a, r), ul(r), function(
|
|
10486
|
-
const
|
|
10487
|
-
for (const [
|
|
10488
|
-
const B = w.get(
|
|
10489
|
-
B !== void 0 && (B.isAttached() || (P(B) && Uu(B,
|
|
10484
|
+
y._dirtyLeaves = _, y._dirtyElements = C;
|
|
10485
|
+
}(a, r), ul(r), function(b, y, _, C) {
|
|
10486
|
+
const k = b._nodeMap, w = y._nodeMap, v = [];
|
|
10487
|
+
for (const [E] of C) {
|
|
10488
|
+
const B = w.get(E);
|
|
10489
|
+
B !== void 0 && (B.isAttached() || (P(B) && Uu(B, E, k, w, v, C), k.has(E) || C.delete(E), v.push(E)));
|
|
10490
10490
|
}
|
|
10491
|
-
for (const
|
|
10492
|
-
for (const
|
|
10493
|
-
const B = w.get(
|
|
10494
|
-
B === void 0 || B.isAttached() || (
|
|
10491
|
+
for (const E of v) w.delete(E);
|
|
10492
|
+
for (const E of _) {
|
|
10493
|
+
const B = w.get(E);
|
|
10494
|
+
B === void 0 || B.isAttached() || (k.has(E) || _.delete(E), w.delete(E));
|
|
10495
10495
|
}
|
|
10496
10496
|
}(l, a, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (a._flushSync = !0);
|
|
10497
10497
|
const x = a._selection;
|
|
10498
10498
|
if (H(x)) {
|
|
10499
|
-
const
|
|
10500
|
-
|
|
10499
|
+
const b = a._nodeMap, y = x.anchor.key, _ = x.focus.key;
|
|
10500
|
+
b.get(y) !== void 0 && b.get(_) !== void 0 || K(19);
|
|
10501
10501
|
} else Yt(x) && x._nodes.size === 0 && (a._selection = null);
|
|
10502
10502
|
} catch (m) {
|
|
10503
10503
|
return m instanceof Error && r._onError(m), r._pendingEditorState = l, r._dirtyType = sn, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void br(r);
|
|
@@ -10505,10 +10505,10 @@ function hc(r, e, t) {
|
|
|
10505
10505
|
dt = c, St = d, ft = f, r._updating = p, Si = 0;
|
|
10506
10506
|
}
|
|
10507
10507
|
r._dirtyType !== jr || function(m, x) {
|
|
10508
|
-
const
|
|
10508
|
+
const b = x.getEditorState()._selection, y = m._selection;
|
|
10509
10509
|
if (y !== null) {
|
|
10510
|
-
if (y.dirty || !y.is(
|
|
10511
|
-
} else if (
|
|
10510
|
+
if (y.dirty || !y.is(b)) return !0;
|
|
10511
|
+
} else if (b !== null) return !0;
|
|
10512
10512
|
return !1;
|
|
10513
10513
|
}(a, r) ? a._flushSync ? (a._flushSync = !1, br(r)) : u && Gf(() => {
|
|
10514
10514
|
br(r);
|
|
@@ -10813,8 +10813,8 @@ class hr extends _s {
|
|
|
10813
10813
|
let g = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
10814
10814
|
for (let m = 0; m < t; m++) {
|
|
10815
10815
|
g === null && K(100);
|
|
10816
|
-
const x = g.getNextSibling(),
|
|
10817
|
-
Fr(g.getWritable()), u.push(
|
|
10816
|
+
const x = g.getNextSibling(), b = g.__key;
|
|
10817
|
+
Fr(g.getWritable()), u.push(b), g = x;
|
|
10818
10818
|
}
|
|
10819
10819
|
}
|
|
10820
10820
|
let p = d;
|
|
@@ -10823,13 +10823,13 @@ class hr extends _s {
|
|
|
10823
10823
|
p !== null && m.is(p) && (d = p = p.getPreviousSibling());
|
|
10824
10824
|
const x = m.getWritable();
|
|
10825
10825
|
x.__parent === l && f--, Fr(x);
|
|
10826
|
-
const
|
|
10827
|
-
if (p === null) o.__first =
|
|
10826
|
+
const b = m.__key;
|
|
10827
|
+
if (p === null) o.__first = b, x.__prev = null;
|
|
10828
10828
|
else {
|
|
10829
10829
|
const y = p.getWritable();
|
|
10830
|
-
y.__next =
|
|
10830
|
+
y.__next = b, x.__prev = y.__key;
|
|
10831
10831
|
}
|
|
10832
|
-
m.__key === l && K(76), x.__parent = l, a.push(
|
|
10832
|
+
m.__key === l && K(76), x.__parent = l, a.push(b), p = m;
|
|
10833
10833
|
}
|
|
10834
10834
|
if (e + t === s)
|
|
10835
10835
|
p !== null && (p.getWritable().__next = null, o.__last = p.__key);
|
|
@@ -10843,8 +10843,8 @@ class hr extends _s {
|
|
|
10843
10843
|
if (o.__size = f, u.length) {
|
|
10844
10844
|
const g = ae();
|
|
10845
10845
|
if (H(g)) {
|
|
10846
|
-
const m = new Set(u), x = new Set(a), { anchor:
|
|
10847
|
-
dl(
|
|
10846
|
+
const m = new Set(u), x = new Set(a), { anchor: b, focus: y } = g;
|
|
10847
|
+
dl(b, m, x) && Qi(b, b.getNode(), this, d, c), dl(y, m, x) && Qi(y, y.getNode(), this, d, c), f !== 0 || this.canBeEmpty() || er(this) || this.remove();
|
|
10848
10848
|
}
|
|
10849
10849
|
}
|
|
10850
10850
|
return o;
|
|
@@ -11100,14 +11100,14 @@ class fn extends hr {
|
|
|
11100
11100
|
return { element: t };
|
|
11101
11101
|
}
|
|
11102
11102
|
static importJSON(e) {
|
|
11103
|
-
const t =
|
|
11103
|
+
const t = ot();
|
|
11104
11104
|
return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t.setTextFormat(e.textFormat), t;
|
|
11105
11105
|
}
|
|
11106
11106
|
exportJSON() {
|
|
11107
11107
|
return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle(), type: "paragraph", version: 1 };
|
|
11108
11108
|
}
|
|
11109
11109
|
insertNewAfter(e, t) {
|
|
11110
|
-
const n =
|
|
11110
|
+
const n = ot();
|
|
11111
11111
|
n.setTextFormat(e.format), n.setTextStyle(e.style);
|
|
11112
11112
|
const i = this.getDirection();
|
|
11113
11113
|
return n.setDirection(i), n.setFormat(this.getFormatType()), n.setStyle(this.getTextStyle()), this.insertAfter(n, t), n;
|
|
@@ -11122,10 +11122,10 @@ class fn extends hr {
|
|
|
11122
11122
|
}
|
|
11123
11123
|
}
|
|
11124
11124
|
function wh(r) {
|
|
11125
|
-
const e =
|
|
11125
|
+
const e = ot();
|
|
11126
11126
|
return r.style && (e.setFormat(r.style.textAlign), ra(r, e)), { node: e };
|
|
11127
11127
|
}
|
|
11128
|
-
function
|
|
11128
|
+
function ot() {
|
|
11129
11129
|
return rr(new fn());
|
|
11130
11130
|
}
|
|
11131
11131
|
function an(r) {
|
|
@@ -11145,29 +11145,29 @@ function Dh(r) {
|
|
|
11145
11145
|
else {
|
|
11146
11146
|
p = /* @__PURE__ */ new Map();
|
|
11147
11147
|
for (let m = 0; m < u.length; m++) {
|
|
11148
|
-
let x = u[m],
|
|
11148
|
+
let x = u[m], b = null, y = null;
|
|
11149
11149
|
if (typeof x != "function") {
|
|
11150
11150
|
const w = x;
|
|
11151
|
-
x = w.replace,
|
|
11151
|
+
x = w.replace, b = w.with, y = w.withKlass || null;
|
|
11152
11152
|
}
|
|
11153
|
-
const
|
|
11154
|
-
C !== null &&
|
|
11153
|
+
const _ = x.getType(), C = x.transform(), k = /* @__PURE__ */ new Set();
|
|
11154
|
+
C !== null && k.add(C), p.set(_, { exportDOM: d && d.export ? d.export.get(x) : void 0, klass: x, replace: b, replaceWithKlass: y, transforms: k });
|
|
11155
11155
|
}
|
|
11156
11156
|
}
|
|
11157
11157
|
const g = new Cs(o, i, p, { disableEvents: s, namespace: l, theme: n }, c || console.error, function(m, x) {
|
|
11158
|
-
const
|
|
11159
|
-
Object.keys(C).forEach((
|
|
11160
|
-
let w =
|
|
11161
|
-
w === void 0 && (w = [],
|
|
11158
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (C) => {
|
|
11159
|
+
Object.keys(C).forEach((k) => {
|
|
11160
|
+
let w = b.get(k);
|
|
11161
|
+
w === void 0 && (w = [], b.set(k, w)), w.push(C[k]);
|
|
11162
11162
|
});
|
|
11163
11163
|
};
|
|
11164
11164
|
return m.forEach((C) => {
|
|
11165
|
-
const
|
|
11166
|
-
if (
|
|
11167
|
-
y.add(
|
|
11168
|
-
const w =
|
|
11169
|
-
w !== null &&
|
|
11170
|
-
}), x &&
|
|
11165
|
+
const k = C.klass.importDOM;
|
|
11166
|
+
if (k == null || y.has(k)) return;
|
|
11167
|
+
y.add(k);
|
|
11168
|
+
const w = k.call(C.klass);
|
|
11169
|
+
w !== null && _(w);
|
|
11170
|
+
}), x && _(x), b;
|
|
11171
11171
|
}(p, d ? d.import : void 0), f);
|
|
11172
11172
|
return a !== void 0 && (g._pendingEditorState = a, g._dirtyType = sn), g;
|
|
11173
11173
|
}
|
|
@@ -11300,26 +11300,26 @@ class Cs {
|
|
|
11300
11300
|
} : (x) => {
|
|
11301
11301
|
if (Ga(x)) return;
|
|
11302
11302
|
Va(x);
|
|
11303
|
-
const
|
|
11303
|
+
const b = a.isEditable();
|
|
11304
11304
|
switch (p) {
|
|
11305
11305
|
case "cut":
|
|
11306
|
-
return
|
|
11306
|
+
return b && ne(a, Io, x);
|
|
11307
11307
|
case "copy":
|
|
11308
11308
|
return ne(a, fs, x);
|
|
11309
11309
|
case "paste":
|
|
11310
|
-
return
|
|
11310
|
+
return b && ne(a, ds, x);
|
|
11311
11311
|
case "dragstart":
|
|
11312
|
-
return
|
|
11312
|
+
return b && ne(a, Du, x);
|
|
11313
11313
|
case "dragover":
|
|
11314
|
-
return
|
|
11314
|
+
return b && ne(a, Eu, x);
|
|
11315
11315
|
case "dragend":
|
|
11316
|
-
return
|
|
11316
|
+
return b && ne(a, _f, x);
|
|
11317
11317
|
case "focus":
|
|
11318
|
-
return
|
|
11318
|
+
return b && ne(a, Cf, x);
|
|
11319
11319
|
case "blur":
|
|
11320
|
-
return
|
|
11320
|
+
return b && ne(a, Df, x);
|
|
11321
11321
|
case "drop":
|
|
11322
|
-
return
|
|
11322
|
+
return b && ne(a, Cu, x);
|
|
11323
11323
|
}
|
|
11324
11324
|
};
|
|
11325
11325
|
l.addEventListener(p, m), d.push(() => {
|
|
@@ -11393,14 +11393,14 @@ class Cs {
|
|
|
11393
11393
|
Cs.version = "0.21.0+prod.esm";
|
|
11394
11394
|
const yc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Eh = yc ? cn : Te, yi = { tag: "history-merge" };
|
|
11395
11395
|
function kh({ initialConfig: r, children: e }) {
|
|
11396
|
-
const t =
|
|
11396
|
+
const t = ct(() => {
|
|
11397
11397
|
const { theme: n, namespace: i, nodes: s, onError: o, editorState: l, html: a } = r, u = cf(null, n), c = Dh({ editable: r.editable, html: a, namespace: i, nodes: s, onError: (d) => o(d, c), theme: n });
|
|
11398
11398
|
return function(d, f) {
|
|
11399
11399
|
if (f !== null) {
|
|
11400
11400
|
if (f === void 0) d.update(() => {
|
|
11401
11401
|
const p = Xe();
|
|
11402
11402
|
if (p.isEmpty()) {
|
|
11403
|
-
const g =
|
|
11403
|
+
const g = ot();
|
|
11404
11404
|
p.append(g);
|
|
11405
11405
|
const m = yc ? document.activeElement : null;
|
|
11406
11406
|
(ae() !== null || m !== null && m === d.getRootElement()) && g.select();
|
|
@@ -11434,7 +11434,7 @@ function Ah(r) {
|
|
|
11434
11434
|
}
|
|
11435
11435
|
function Th() {
|
|
11436
11436
|
return function(r) {
|
|
11437
|
-
const [e] = Ht(), t =
|
|
11437
|
+
const [e] = Ht(), t = ct(() => r(e), [e, r]), [n, i] = O(() => t.initialValueFn()), s = me(n);
|
|
11438
11438
|
return Sh(() => {
|
|
11439
11439
|
const { initialValueFn: o, subscribe: l } = t, a = o();
|
|
11440
11440
|
return s.current !== a && (s.current = a, i(a)), l((u) => {
|
|
@@ -11634,11 +11634,11 @@ function Gh(r) {
|
|
|
11634
11634
|
const m = ae();
|
|
11635
11635
|
if (H(m)) {
|
|
11636
11636
|
const x = m.anchor;
|
|
11637
|
-
let
|
|
11638
|
-
if (X(
|
|
11639
|
-
y = f,
|
|
11640
|
-
const C =
|
|
11641
|
-
y = y > C ? C : y,
|
|
11637
|
+
let b = x.getNode(), y = 0, _ = 0;
|
|
11638
|
+
if (X(b) && u >= 0 && c >= 0 && (y = u, _ = u + c, m.setTextNodeRange(b, y, b, _)), y === _ && d === "" || (m.insertRawText(d), b = x.getNode()), X(b)) {
|
|
11639
|
+
y = f, _ = f + p;
|
|
11640
|
+
const C = b.getTextContentSize();
|
|
11641
|
+
y = y > C ? C : y, _ = _ > C ? C : _, m.setTextNodeRange(b, y, b, _);
|
|
11642
11642
|
}
|
|
11643
11643
|
n.stopImmediatePropagation();
|
|
11644
11644
|
}
|
|
@@ -11711,10 +11711,10 @@ function Sc(r, e, t, n, i = /* @__PURE__ */ new Map(), s) {
|
|
|
11711
11711
|
if (kc.has(r.nodeName)) return o;
|
|
11712
11712
|
let l = null;
|
|
11713
11713
|
const a = function(g, m) {
|
|
11714
|
-
const { nodeName: x } = g,
|
|
11714
|
+
const { nodeName: x } = g, b = m._htmlConversions.get(x.toLowerCase());
|
|
11715
11715
|
let y = null;
|
|
11716
|
-
if (
|
|
11717
|
-
const C =
|
|
11716
|
+
if (b !== void 0) for (const _ of b) {
|
|
11717
|
+
const C = _(g);
|
|
11718
11718
|
C !== null && (y === null || (y.priority || 0) <= (C.priority || 0)) && (y = C);
|
|
11719
11719
|
}
|
|
11720
11720
|
return y !== null ? y.conversion : null;
|
|
@@ -11736,7 +11736,7 @@ function Sc(r, e, t, n, i = /* @__PURE__ */ new Map(), s) {
|
|
|
11736
11736
|
return c != null && (f = c(f)), Wi(r) && (f = Kh(r, f, p ? () => {
|
|
11737
11737
|
const g = new la();
|
|
11738
11738
|
return t.push(g), g;
|
|
11739
|
-
} :
|
|
11739
|
+
} : ot)), l == null ? f.length > 0 ? o = o.concat(f) : Wi(r) && function(g) {
|
|
11740
11740
|
return g.nextSibling == null || g.previousSibling == null ? !1 : io(g.nextSibling) && io(g.previousSibling);
|
|
11741
11741
|
}(r) && (o = o.concat(Ir())) : P(l) && l.append(...f), o;
|
|
11742
11742
|
}
|
|
@@ -11950,11 +11950,11 @@ class Es extends hr {
|
|
|
11950
11950
|
return { ...super.exportJSON(), type: "quote" };
|
|
11951
11951
|
}
|
|
11952
11952
|
insertNewAfter(e, t) {
|
|
11953
|
-
const n =
|
|
11953
|
+
const n = ot(), i = this.getDirection();
|
|
11954
11954
|
return n.setDirection(i), this.insertAfter(n, t), n;
|
|
11955
11955
|
}
|
|
11956
11956
|
collapseAtStart() {
|
|
11957
|
-
const e =
|
|
11957
|
+
const e = ot();
|
|
11958
11958
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
11959
11959
|
}
|
|
11960
11960
|
canMergeWhenEmpty() {
|
|
@@ -12013,15 +12013,15 @@ class ks extends hr {
|
|
|
12013
12013
|
return { ...super.exportJSON(), tag: this.getTag(), type: "heading", version: 1 };
|
|
12014
12014
|
}
|
|
12015
12015
|
insertNewAfter(e, t = !0) {
|
|
12016
|
-
const n = e ? e.anchor.offset : 0, i = this.getLastDescendant(), s = !i || e && e.anchor.key === i.getKey() && n === i.getTextContentSize() || !e ?
|
|
12016
|
+
const n = e ? e.anchor.offset : 0, i = this.getLastDescendant(), s = !i || e && e.anchor.key === i.getKey() && n === i.getTextContentSize() || !e ? ot() : Sn(this.getTag()), o = this.getDirection();
|
|
12017
12017
|
if (s.setDirection(o), this.insertAfter(s, t), n === 0 && !this.isEmpty() && e) {
|
|
12018
|
-
const l =
|
|
12018
|
+
const l = ot();
|
|
12019
12019
|
l.select(), this.replace(l, !0);
|
|
12020
12020
|
}
|
|
12021
12021
|
return s;
|
|
12022
12022
|
}
|
|
12023
12023
|
collapseAtStart() {
|
|
12024
|
-
const e = this.isEmpty() ?
|
|
12024
|
+
const e = this.isEmpty() ? ot() : Sn(this.getTag());
|
|
12025
12025
|
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
12026
12026
|
}
|
|
12027
12027
|
extractWithChild() {
|
|
@@ -12248,7 +12248,7 @@ function cp({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
12248
12248
|
});
|
|
12249
12249
|
}), [s]), Te(() => {
|
|
12250
12250
|
a(s.getDecorators());
|
|
12251
|
-
}, [s]),
|
|
12251
|
+
}, [s]), ct(() => {
|
|
12252
12252
|
const u = [], c = Object.keys(l);
|
|
12253
12253
|
for (let d = 0; d < c.length; d++) {
|
|
12254
12254
|
const f = c[d], p = h.jsx(o, { onError: (m) => s._onError(m), children: h.jsx(Cd, { fallback: null, children: l[f] }) }), g = s.getElementByKey(f);
|
|
@@ -12279,19 +12279,19 @@ function dp({ content: r }) {
|
|
|
12279
12279
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
12280
12280
|
}
|
|
12281
12281
|
const Tc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? cn : Te;
|
|
12282
|
-
function fp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: i, ariaErrorMessage: s, ariaExpanded: o, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: p, className: g, id: m, role: x = "textbox", spellCheck:
|
|
12283
|
-
const [
|
|
12282
|
+
function fp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: i, ariaErrorMessage: s, ariaExpanded: o, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: p, className: g, id: m, role: x = "textbox", spellCheck: b = !0, style: y, tabIndex: _, "data-testid": C, ...k }, w) {
|
|
12283
|
+
const [v, E] = O(r.isEditable()), B = Q((T) => {
|
|
12284
12284
|
T && T.ownerDocument && T.ownerDocument.defaultView ? r.setRootElement(T) : r.setRootElement(null);
|
|
12285
|
-
}, [r]), A =
|
|
12285
|
+
}, [r]), A = ct(() => /* @__PURE__ */ function(...T) {
|
|
12286
12286
|
return (F) => {
|
|
12287
12287
|
T.forEach((R) => {
|
|
12288
12288
|
typeof R == "function" ? R(F) : R != null && (R.current = F);
|
|
12289
12289
|
});
|
|
12290
12290
|
};
|
|
12291
12291
|
}(w, B), [B, w]);
|
|
12292
|
-
return Tc(() => (
|
|
12293
|
-
|
|
12294
|
-
})), [r]), h.jsx("div", { "aria-activedescendant":
|
|
12292
|
+
return Tc(() => (E(r.isEditable()), r.registerEditableListener((T) => {
|
|
12293
|
+
E(T);
|
|
12294
|
+
})), [r]), h.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": i, ...s != null ? { "aria-errormessage": s } : {}, "aria-expanded": v && x === "combobox" ? !!o : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": f, autoCapitalize: p, className: g, contentEditable: v, "data-testid": C, id: m, ref: A, role: v ? x : void 0, spellCheck: b, style: y, tabIndex: _, ...k });
|
|
12295
12295
|
}
|
|
12296
12296
|
const hp = au(fp);
|
|
12297
12297
|
function El(r) {
|
|
@@ -12329,23 +12329,23 @@ function _p(r, e, t, n, i) {
|
|
|
12329
12329
|
const s = e._selection, o = r._selection;
|
|
12330
12330
|
if (i) return yp;
|
|
12331
12331
|
if (!(H(s) && H(o) && o.isCollapsed() && s.isCollapsed())) return zt;
|
|
12332
|
-
const l = function(
|
|
12333
|
-
const C =
|
|
12332
|
+
const l = function(b, y, _) {
|
|
12333
|
+
const C = b._nodeMap, k = [];
|
|
12334
12334
|
for (const w of y) {
|
|
12335
|
-
const
|
|
12336
|
-
|
|
12335
|
+
const v = C.get(w);
|
|
12336
|
+
v !== void 0 && k.push(v);
|
|
12337
12337
|
}
|
|
12338
|
-
for (const [w,
|
|
12339
|
-
if (!
|
|
12340
|
-
const
|
|
12341
|
-
|
|
12338
|
+
for (const [w, v] of _) {
|
|
12339
|
+
if (!v) continue;
|
|
12340
|
+
const E = C.get(w);
|
|
12341
|
+
E === void 0 || bt(E) || k.push(E);
|
|
12342
12342
|
}
|
|
12343
|
-
return
|
|
12343
|
+
return k;
|
|
12344
12344
|
}(e, t, n);
|
|
12345
12345
|
if (l.length === 0) return zt;
|
|
12346
12346
|
if (l.length > 1) {
|
|
12347
|
-
const
|
|
12348
|
-
return y &&
|
|
12347
|
+
const b = e._nodeMap, y = b.get(s.anchor.key), _ = b.get(o.anchor.key);
|
|
12348
|
+
return y && _ && !r._nodeMap.has(y.__key) && X(y) && y.__text.length === 1 && s.anchor.offset === 1 ? kl : zt;
|
|
12349
12349
|
}
|
|
12350
12350
|
const a = l[0], u = r._nodeMap.get(a.__key);
|
|
12351
12351
|
if (!X(u) || !X(a) || u.__mode !== a.__mode) return zt;
|
|
@@ -12366,9 +12366,9 @@ function vp(r, e) {
|
|
|
12366
12366
|
if (!g && p && u.has("history-merge")) return _i;
|
|
12367
12367
|
if (i === null) return _o;
|
|
12368
12368
|
const m = s._selection;
|
|
12369
|
-
return l.size > 0 || a.size > 0 ? g === !1 && d !== zt && d === n && c < t + e && p || l.size === 1 && function(x,
|
|
12370
|
-
const
|
|
12371
|
-
return !(H(
|
|
12369
|
+
return l.size > 0 || a.size > 0 ? g === !1 && d !== zt && d === n && c < t + e && p || l.size === 1 && function(x, b, y) {
|
|
12370
|
+
const _ = b._nodeMap.get(x), C = y._nodeMap.get(x), k = b._selection, w = y._selection;
|
|
12371
|
+
return !(H(k) && H(w) && k.anchor.type === "element" && k.focus.type === "element" && w.anchor.type === "text" && w.focus.type === "text" || !X(_) || !X(C) || _.__parent !== C.__parent) && JSON.stringify(b.read(() => _.exportJSON())) === JSON.stringify(y.read(() => C.exportJSON()));
|
|
12372
12372
|
}(Array.from(l)[0], i, s) ? _i : _o : m !== null ? _i : vo;
|
|
12373
12373
|
})();
|
|
12374
12374
|
return t = c, n = d, f;
|
|
@@ -12408,7 +12408,7 @@ function Cp() {
|
|
|
12408
12408
|
function Dp({ delay: r, externalHistoryState: e }) {
|
|
12409
12409
|
const [t] = Ht();
|
|
12410
12410
|
return function(n, i, s = 1e3) {
|
|
12411
|
-
const o =
|
|
12411
|
+
const o = ct(() => i || Cp(), [i]);
|
|
12412
12412
|
Te(() => wp(n, o, s), [s, n, o]);
|
|
12413
12413
|
}(t, e, r), null;
|
|
12414
12414
|
}
|
|
@@ -12603,7 +12603,7 @@ function Bp(r) {
|
|
|
12603
12603
|
let o = s;
|
|
12604
12604
|
const l = Nc(s);
|
|
12605
12605
|
for (const a of l) {
|
|
12606
|
-
const u =
|
|
12606
|
+
const u = ot();
|
|
12607
12607
|
Or(u, a.getChildren()), o.insertAfter(u), o = u, a.__key === e.anchor.key && e.anchor.set(u.getKey(), 0, "element"), a.__key === e.focus.key && e.focus.set(u.getKey(), 0, "element"), a.remove();
|
|
12608
12608
|
}
|
|
12609
12609
|
s.remove();
|
|
@@ -12660,7 +12660,7 @@ function Rp() {
|
|
|
12660
12660
|
Pe(n) || Qt(40);
|
|
12661
12661
|
const i = n.getParent();
|
|
12662
12662
|
let s;
|
|
12663
|
-
if (er(i)) s =
|
|
12663
|
+
if (er(i)) s = ot(), t.insertAfter(s);
|
|
12664
12664
|
else {
|
|
12665
12665
|
if (!Ze(i)) return !1;
|
|
12666
12666
|
s = Bt(), i.insertAfter(s);
|
|
@@ -12781,7 +12781,7 @@ class Ur extends hr {
|
|
|
12781
12781
|
return this.insertAfter(n, t), n;
|
|
12782
12782
|
}
|
|
12783
12783
|
collapseAtStart(e) {
|
|
12784
|
-
const t =
|
|
12784
|
+
const t = ot();
|
|
12785
12785
|
this.getChildren().forEach((o) => t.append(o));
|
|
12786
12786
|
const n = this.getParentOrThrow(), i = n.getParentOrThrow(), s = Ze(i);
|
|
12787
12787
|
if (n.getChildrenSize() === 1) if (s) n.remove(), i.select();
|
|
@@ -12954,7 +12954,7 @@ class pn extends hr {
|
|
|
12954
12954
|
if (Pe(n)) i.append(n);
|
|
12955
12955
|
else if (P(n)) if (n.isInline()) i.append(n);
|
|
12956
12956
|
else {
|
|
12957
|
-
const s =
|
|
12957
|
+
const s = lt(n.getTextContent());
|
|
12958
12958
|
i.append(s);
|
|
12959
12959
|
}
|
|
12960
12960
|
else i.append(n);
|
|
@@ -13433,31 +13433,31 @@ var zr;
|
|
|
13433
13433
|
throw new RangeError("Invalid value");
|
|
13434
13434
|
let g, m;
|
|
13435
13435
|
for (g = c; ; g++) {
|
|
13436
|
-
const
|
|
13437
|
-
if (C <=
|
|
13436
|
+
const _ = Be.getNumDataCodewords(g, u) * 8, C = o.getTotalBits(a, g);
|
|
13437
|
+
if (C <= _) {
|
|
13438
13438
|
m = C;
|
|
13439
13439
|
break;
|
|
13440
13440
|
}
|
|
13441
13441
|
if (g >= d)
|
|
13442
13442
|
throw new RangeError("Data too long");
|
|
13443
13443
|
}
|
|
13444
|
-
for (const
|
|
13445
|
-
p && m <= Be.getNumDataCodewords(g,
|
|
13444
|
+
for (const _ of [Be.Ecc.MEDIUM, Be.Ecc.QUARTILE, Be.Ecc.HIGH])
|
|
13445
|
+
p && m <= Be.getNumDataCodewords(g, _) * 8 && (u = _);
|
|
13446
13446
|
let x = [];
|
|
13447
|
-
for (const
|
|
13448
|
-
t(
|
|
13449
|
-
for (const C of
|
|
13447
|
+
for (const _ of a) {
|
|
13448
|
+
t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(g), x);
|
|
13449
|
+
for (const C of _.getData())
|
|
13450
13450
|
x.push(C);
|
|
13451
13451
|
}
|
|
13452
13452
|
i(x.length == m);
|
|
13453
|
-
const
|
|
13454
|
-
i(x.length <=
|
|
13455
|
-
for (let
|
|
13456
|
-
t(
|
|
13453
|
+
const b = Be.getNumDataCodewords(g, u) * 8;
|
|
13454
|
+
i(x.length <= b), t(0, Math.min(4, b - x.length), x), t(0, (8 - x.length % 8) % 8, x), i(x.length % 8 == 0);
|
|
13455
|
+
for (let _ = 236; x.length < b; _ ^= 253)
|
|
13456
|
+
t(_, 8, x);
|
|
13457
13457
|
let y = [];
|
|
13458
13458
|
for (; y.length * 8 < x.length; )
|
|
13459
13459
|
y.push(0);
|
|
13460
|
-
return x.forEach((
|
|
13460
|
+
return x.forEach((_, C) => y[C >>> 3] |= _ << 7 - (C & 7)), new Be(g, u, y, f);
|
|
13461
13461
|
}
|
|
13462
13462
|
/*-- Accessor methods --*/
|
|
13463
13463
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -13547,17 +13547,17 @@ var zr;
|
|
|
13547
13547
|
throw new RangeError("Invalid argument");
|
|
13548
13548
|
const d = Be.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][u], f = Be.ECC_CODEWORDS_PER_BLOCK[c.ordinal][u], p = Math.floor(Be.getNumRawDataModules(u) / 8), g = d - p % d, m = Math.floor(p / d);
|
|
13549
13549
|
let x = [];
|
|
13550
|
-
const
|
|
13551
|
-
for (let
|
|
13552
|
-
let
|
|
13553
|
-
C +=
|
|
13554
|
-
const w = Be.reedSolomonComputeRemainder(
|
|
13555
|
-
|
|
13550
|
+
const b = Be.reedSolomonComputeDivisor(f);
|
|
13551
|
+
for (let _ = 0, C = 0; _ < d; _++) {
|
|
13552
|
+
let k = a.slice(C, C + m - f + (_ < g ? 0 : 1));
|
|
13553
|
+
C += k.length;
|
|
13554
|
+
const w = Be.reedSolomonComputeRemainder(k, b);
|
|
13555
|
+
_ < g && k.push(0), x.push(k.concat(w));
|
|
13556
13556
|
}
|
|
13557
13557
|
let y = [];
|
|
13558
|
-
for (let
|
|
13559
|
-
x.forEach((C,
|
|
13560
|
-
(
|
|
13558
|
+
for (let _ = 0; _ < x[0].length; _++)
|
|
13559
|
+
x.forEach((C, k) => {
|
|
13560
|
+
(_ != m - f || k >= g) && y.push(C[_]);
|
|
13561
13561
|
});
|
|
13562
13562
|
return i(y.length == p), y;
|
|
13563
13563
|
}
|
|
@@ -13948,8 +13948,8 @@ function Jp(r, e, t, n) {
|
|
|
13948
13948
|
const i = r.length + t * 2, s = Math.floor(e * Xp), o = i / e, l = (n.width || s) * o, a = (n.height || s) * o, u = n.x == null ? r.length / 2 - l / 2 : n.x * o, c = n.y == null ? r.length / 2 - a / 2 : n.y * o, d = n.opacity == null ? 1 : n.opacity;
|
|
13949
13949
|
let f = null;
|
|
13950
13950
|
if (n.excavate) {
|
|
13951
|
-
let g = Math.floor(u), m = Math.floor(c), x = Math.ceil(l + u - g),
|
|
13952
|
-
f = { x: g, y: m, w: x, h:
|
|
13951
|
+
let g = Math.floor(u), m = Math.floor(c), x = Math.ceil(l + u - g), b = Math.ceil(a + c - m);
|
|
13952
|
+
f = { x: g, y: m, w: x, h: b };
|
|
13953
13953
|
}
|
|
13954
13954
|
const p = n.crossOrigin;
|
|
13955
13955
|
return { x: u, y: c, h: a, w: l, excavation: f, opacity: d, crossOrigin: p };
|
|
@@ -14032,12 +14032,12 @@ var eg = function() {
|
|
|
14032
14032
|
"boostLevel",
|
|
14033
14033
|
"marginSize",
|
|
14034
14034
|
"imageSettings"
|
|
14035
|
-
]), { style: x } = m,
|
|
14035
|
+
]), { style: x } = m, b = Eo(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null), C = Le.useRef(null), k = Le.useCallback(
|
|
14036
14036
|
(D) => {
|
|
14037
|
-
|
|
14037
|
+
_.current = D, typeof t == "function" ? t(D) : t && (t.current = D);
|
|
14038
14038
|
},
|
|
14039
14039
|
[t]
|
|
14040
|
-
), [w,
|
|
14040
|
+
), [w, v] = Le.useState(!1), { margin: E, cells: B, numCells: A, calculatedImageSettings: T } = Hc({
|
|
14041
14041
|
value: i,
|
|
14042
14042
|
level: o,
|
|
14043
14043
|
minVersion: c,
|
|
@@ -14048,8 +14048,8 @@ var eg = function() {
|
|
|
14048
14048
|
size: s
|
|
14049
14049
|
});
|
|
14050
14050
|
Le.useEffect(() => {
|
|
14051
|
-
if (
|
|
14052
|
-
const D =
|
|
14051
|
+
if (_.current != null) {
|
|
14052
|
+
const D = _.current, N = D.getContext("2d");
|
|
14053
14053
|
if (!N)
|
|
14054
14054
|
return;
|
|
14055
14055
|
let M = B;
|
|
@@ -14061,20 +14061,20 @@ var eg = function() {
|
|
|
14061
14061
|
const U = window.devicePixelRatio || 1;
|
|
14062
14062
|
D.height = D.width = s * U;
|
|
14063
14063
|
const re = s / A * U;
|
|
14064
|
-
N.scale(re, re), N.fillStyle = l, N.fillRect(0, 0, A, A), N.fillStyle = a, eg ? N.fill(new Path2D(Uc(M,
|
|
14064
|
+
N.scale(re, re), N.fillStyle = l, N.fillRect(0, 0, A, A), N.fillStyle = a, eg ? N.fill(new Path2D(Uc(M, E))) : B.forEach(function(q, J) {
|
|
14065
14065
|
q.forEach(function(W, se) {
|
|
14066
|
-
W && N.fillRect(se +
|
|
14066
|
+
W && N.fillRect(se + E, J + E, 1, 1);
|
|
14067
14067
|
});
|
|
14068
14068
|
}), T && (N.globalAlpha = T.opacity), V && N.drawImage(
|
|
14069
14069
|
I,
|
|
14070
|
-
T.x +
|
|
14071
|
-
T.y +
|
|
14070
|
+
T.x + E,
|
|
14071
|
+
T.y + E,
|
|
14072
14072
|
T.w,
|
|
14073
14073
|
T.h
|
|
14074
14074
|
);
|
|
14075
14075
|
}
|
|
14076
14076
|
}), Le.useEffect(() => {
|
|
14077
|
-
|
|
14077
|
+
v(!1);
|
|
14078
14078
|
}, [y]);
|
|
14079
14079
|
const F = Do({ height: s, width: s }, x);
|
|
14080
14080
|
let R = null;
|
|
@@ -14085,7 +14085,7 @@ var eg = function() {
|
|
|
14085
14085
|
key: y,
|
|
14086
14086
|
style: { display: "none" },
|
|
14087
14087
|
onLoad: () => {
|
|
14088
|
-
|
|
14088
|
+
v(!0);
|
|
14089
14089
|
},
|
|
14090
14090
|
ref: C,
|
|
14091
14091
|
crossOrigin: T == null ? void 0 : T.crossOrigin
|
|
@@ -14096,9 +14096,9 @@ var eg = function() {
|
|
|
14096
14096
|
style: F,
|
|
14097
14097
|
height: s,
|
|
14098
14098
|
width: s,
|
|
14099
|
-
ref:
|
|
14099
|
+
ref: k,
|
|
14100
14100
|
role: "img"
|
|
14101
|
-
},
|
|
14101
|
+
}, b)
|
|
14102
14102
|
), R);
|
|
14103
14103
|
}
|
|
14104
14104
|
);
|
|
@@ -14129,7 +14129,7 @@ var Vc = Le.forwardRef(
|
|
|
14129
14129
|
"title",
|
|
14130
14130
|
"marginSize",
|
|
14131
14131
|
"imageSettings"
|
|
14132
|
-
]), { margin: x, cells:
|
|
14132
|
+
]), { margin: x, cells: b, numCells: y, calculatedImageSettings: _ } = Hc({
|
|
14133
14133
|
value: i,
|
|
14134
14134
|
level: o,
|
|
14135
14135
|
minVersion: c,
|
|
@@ -14139,21 +14139,21 @@ var Vc = Le.forwardRef(
|
|
|
14139
14139
|
imageSettings: g,
|
|
14140
14140
|
size: s
|
|
14141
14141
|
});
|
|
14142
|
-
let C =
|
|
14143
|
-
g != null &&
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
)),
|
|
14142
|
+
let C = b, k = null;
|
|
14143
|
+
g != null && _ != null && (_.excavation != null && (C = Wc(
|
|
14144
|
+
b,
|
|
14145
|
+
_.excavation
|
|
14146
|
+
)), k = /* @__PURE__ */ Le.createElement(
|
|
14147
14147
|
"image",
|
|
14148
14148
|
{
|
|
14149
14149
|
href: g.src,
|
|
14150
|
-
height:
|
|
14151
|
-
width:
|
|
14152
|
-
x:
|
|
14153
|
-
y:
|
|
14150
|
+
height: _.h,
|
|
14151
|
+
width: _.w,
|
|
14152
|
+
x: _.x + x,
|
|
14153
|
+
y: _.y + x,
|
|
14154
14154
|
preserveAspectRatio: "none",
|
|
14155
|
-
opacity:
|
|
14156
|
-
crossOrigin:
|
|
14155
|
+
opacity: _.opacity,
|
|
14156
|
+
crossOrigin: _.crossOrigin
|
|
14157
14157
|
}
|
|
14158
14158
|
));
|
|
14159
14159
|
const w = Uc(C, x);
|
|
@@ -14176,7 +14176,7 @@ var Vc = Le.forwardRef(
|
|
|
14176
14176
|
}
|
|
14177
14177
|
),
|
|
14178
14178
|
/* @__PURE__ */ Le.createElement("path", { fill: a, d: w, shapeRendering: "crispEdges" }),
|
|
14179
|
-
|
|
14179
|
+
k
|
|
14180
14180
|
);
|
|
14181
14181
|
}
|
|
14182
14182
|
);
|
|
@@ -14293,14 +14293,14 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14293
14293
|
u.dispatchCommand(Ut, "italic");
|
|
14294
14294
|
}, [u]), x = Q(() => {
|
|
14295
14295
|
u.dispatchCommand(Ut, "underline");
|
|
14296
|
-
}, [u]),
|
|
14296
|
+
}, [u]), b = Q(() => {
|
|
14297
14297
|
u.dispatchCommand(Fc, void 0);
|
|
14298
14298
|
}, [u]), y = Q(() => {
|
|
14299
14299
|
u.dispatchCommand(Mc, void 0);
|
|
14300
|
-
}, [u]),
|
|
14300
|
+
}, [u]), _ = Q(() => {
|
|
14301
14301
|
u.update(() => {
|
|
14302
|
-
const
|
|
14303
|
-
H(
|
|
14302
|
+
const v = ae();
|
|
14303
|
+
H(v) && Oh(v, () => ua());
|
|
14304
14304
|
});
|
|
14305
14305
|
}, [u]), C = {
|
|
14306
14306
|
display: "flex",
|
|
@@ -14316,14 +14316,14 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14316
14316
|
fontSize: "14px",
|
|
14317
14317
|
fontWeight: 600,
|
|
14318
14318
|
opacity: e ? 0.5 : 1
|
|
14319
|
-
},
|
|
14319
|
+
}, k = `
|
|
14320
14320
|
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
14321
14321
|
background: ${r.border};
|
|
14322
14322
|
}
|
|
14323
14323
|
`, w = () => {
|
|
14324
14324
|
setTimeout(() => {
|
|
14325
|
-
var
|
|
14326
|
-
(
|
|
14325
|
+
var v;
|
|
14326
|
+
(v = f.current) != null && v.contains(document.activeElement) || d(!1);
|
|
14327
14327
|
}, 150);
|
|
14328
14328
|
};
|
|
14329
14329
|
return /* @__PURE__ */ h.jsxs(
|
|
@@ -14338,7 +14338,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14338
14338
|
background: r.toolbarBackground
|
|
14339
14339
|
},
|
|
14340
14340
|
children: [
|
|
14341
|
-
/* @__PURE__ */ h.jsx("style", { children:
|
|
14341
|
+
/* @__PURE__ */ h.jsx("style", { children: k }),
|
|
14342
14342
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px" }, children: [
|
|
14343
14343
|
/* @__PURE__ */ h.jsx(
|
|
14344
14344
|
"button",
|
|
@@ -14392,7 +14392,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14392
14392
|
{
|
|
14393
14393
|
type: "button",
|
|
14394
14394
|
className: "mail-editor-toolbar-btn",
|
|
14395
|
-
onClick:
|
|
14395
|
+
onClick: b,
|
|
14396
14396
|
disabled: e,
|
|
14397
14397
|
style: C,
|
|
14398
14398
|
title: "Bullet List",
|
|
@@ -14441,7 +14441,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14441
14441
|
{
|
|
14442
14442
|
type: "button",
|
|
14443
14443
|
className: "mail-editor-toolbar-btn",
|
|
14444
|
-
onClick:
|
|
14444
|
+
onClick: _,
|
|
14445
14445
|
disabled: e,
|
|
14446
14446
|
style: C,
|
|
14447
14447
|
title: "Quote",
|
|
@@ -14518,8 +14518,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14518
14518
|
alignItems: "center",
|
|
14519
14519
|
gap: "8px"
|
|
14520
14520
|
},
|
|
14521
|
-
onMouseEnter: (
|
|
14522
|
-
onMouseLeave: (
|
|
14521
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14522
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14523
14523
|
children: [
|
|
14524
14524
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#3b82f6" }, children: "format_list_bulleted" }),
|
|
14525
14525
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14548,8 +14548,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14548
14548
|
alignItems: "center",
|
|
14549
14549
|
gap: "8px"
|
|
14550
14550
|
},
|
|
14551
|
-
onMouseEnter: (
|
|
14552
|
-
onMouseLeave: (
|
|
14551
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14552
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14553
14553
|
children: [
|
|
14554
14554
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#22c55e" }, children: "spellcheck" }),
|
|
14555
14555
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14578,8 +14578,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14578
14578
|
alignItems: "center",
|
|
14579
14579
|
gap: "8px"
|
|
14580
14580
|
},
|
|
14581
|
-
onMouseEnter: (
|
|
14582
|
-
onMouseLeave: (
|
|
14581
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14582
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14583
14583
|
children: [
|
|
14584
14584
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#9333ea" }, children: "brush" }),
|
|
14585
14585
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14604,7 +14604,7 @@ function ag({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
|
14604
14604
|
() => {
|
|
14605
14605
|
const s = Xe();
|
|
14606
14606
|
s.clear();
|
|
14607
|
-
const o =
|
|
14607
|
+
const o = ot();
|
|
14608
14608
|
s.append(o), o.select();
|
|
14609
14609
|
const a = new DOMParser().parseFromString(r, "text/html"), c = Cc(n, a).filter((d) => d.getParent() === null);
|
|
14610
14610
|
c.length > 0 && lc(c), o.getTextContent() === "" && s.getChildrenSize() > 1 && o.remove(), s.selectEnd();
|
|
@@ -14632,7 +14632,7 @@ function lg({ text: r, trigger: e }) {
|
|
|
14632
14632
|
const a = ae();
|
|
14633
14633
|
H(a) && a.insertText(i);
|
|
14634
14634
|
} else {
|
|
14635
|
-
const a =
|
|
14635
|
+
const a = ot(), u = lt(i);
|
|
14636
14636
|
a.append(u), o.append(a);
|
|
14637
14637
|
}
|
|
14638
14638
|
}
|
|
@@ -14714,29 +14714,29 @@ function cg({
|
|
|
14714
14714
|
aiProcessingAction: m,
|
|
14715
14715
|
renderAboveToolbar: x
|
|
14716
14716
|
}) {
|
|
14717
|
-
const
|
|
14717
|
+
const b = { ...ig, ...i }, [y, _] = Le.useState(!1), C = Le.useRef(void 0), [k, w] = Le.useState(r), [v, E] = Le.useState(!1), [B, A] = Le.useState(null), T = g ?? v, F = m ?? B;
|
|
14718
14718
|
Le.useEffect(() => {
|
|
14719
|
-
a !== void 0 && a !== C.current && (C.current = a,
|
|
14719
|
+
a !== void 0 && a !== C.current && (C.current = a, _(!0));
|
|
14720
14720
|
}, [a]);
|
|
14721
14721
|
const R = Q(() => {
|
|
14722
|
-
|
|
14722
|
+
_(!1);
|
|
14723
14723
|
}, []), D = (q) => q.replace(/<[^>]*>/g, "").trim(), N = (q) => q.split(`
|
|
14724
14724
|
`).map((J) => `<p>${J || "<br>"}</p>`).join(""), M = async (q) => {
|
|
14725
|
-
const J = D(
|
|
14725
|
+
const J = D(k);
|
|
14726
14726
|
if (!J) return;
|
|
14727
14727
|
const W = q === "restructure" ? d : q === "proofread" ? f : p;
|
|
14728
14728
|
if (W) {
|
|
14729
|
-
|
|
14729
|
+
E(!0), A(q);
|
|
14730
14730
|
try {
|
|
14731
14731
|
const se = await W(J), ce = N(se);
|
|
14732
|
-
w(ce), e == null || e(ce), C.current = Date.now(),
|
|
14732
|
+
w(ce), e == null || e(ce), C.current = Date.now(), _(!0);
|
|
14733
14733
|
} catch (se) {
|
|
14734
14734
|
console.error(`AI ${q} failed:`, se);
|
|
14735
14735
|
} finally {
|
|
14736
|
-
|
|
14736
|
+
E(!1), A(null);
|
|
14737
14737
|
}
|
|
14738
14738
|
}
|
|
14739
|
-
}, I = D(
|
|
14739
|
+
}, I = D(k).length > 0, V = {
|
|
14740
14740
|
namespace: "MailEditor",
|
|
14741
14741
|
theme: sg,
|
|
14742
14742
|
onError: (q) => {
|
|
@@ -14774,15 +14774,15 @@ function cg({
|
|
|
14774
14774
|
margin: 4px 0;
|
|
14775
14775
|
}
|
|
14776
14776
|
.mail-editor-link {
|
|
14777
|
-
color: ${
|
|
14777
|
+
color: ${b.primary};
|
|
14778
14778
|
text-decoration: underline;
|
|
14779
14779
|
}
|
|
14780
14780
|
.mail-editor-quote {
|
|
14781
14781
|
margin: 8px 0;
|
|
14782
14782
|
padding: 8px 16px;
|
|
14783
|
-
border-left: 3px solid ${
|
|
14784
|
-
background: ${
|
|
14785
|
-
color: ${
|
|
14783
|
+
border-left: 3px solid ${b.quoteBorder};
|
|
14784
|
+
background: ${b.quoteBackground};
|
|
14785
|
+
color: ${b.textSecondary};
|
|
14786
14786
|
}
|
|
14787
14787
|
.mail-editor-h1 {
|
|
14788
14788
|
font-size: 24px;
|
|
@@ -14805,7 +14805,7 @@ function cg({
|
|
|
14805
14805
|
padding: 16px;
|
|
14806
14806
|
font-size: 14px;
|
|
14807
14807
|
line-height: 1.6;
|
|
14808
|
-
color: ${
|
|
14808
|
+
color: ${b.text};
|
|
14809
14809
|
}
|
|
14810
14810
|
.mail-editor-content:focus {
|
|
14811
14811
|
outline: none;
|
|
@@ -14814,7 +14814,7 @@ function cg({
|
|
|
14814
14814
|
position: absolute;
|
|
14815
14815
|
top: 16px;
|
|
14816
14816
|
left: 16px;
|
|
14817
|
-
color: ${
|
|
14817
|
+
color: ${b.textSecondary};
|
|
14818
14818
|
pointer-events: none;
|
|
14819
14819
|
font-size: 14px;
|
|
14820
14820
|
}
|
|
@@ -14828,9 +14828,9 @@ function cg({
|
|
|
14828
14828
|
{
|
|
14829
14829
|
className: o,
|
|
14830
14830
|
style: {
|
|
14831
|
-
border: `1px solid ${
|
|
14831
|
+
border: `1px solid ${b.border}`,
|
|
14832
14832
|
borderRadius: "8px",
|
|
14833
|
-
background:
|
|
14833
|
+
background: b.background,
|
|
14834
14834
|
overflow: "hidden",
|
|
14835
14835
|
display: "flex",
|
|
14836
14836
|
flexDirection: "column",
|
|
@@ -14844,7 +14844,7 @@ function cg({
|
|
|
14844
14844
|
/* @__PURE__ */ h.jsx(
|
|
14845
14845
|
og,
|
|
14846
14846
|
{
|
|
14847
|
-
theme:
|
|
14847
|
+
theme: b,
|
|
14848
14848
|
disabled: s,
|
|
14849
14849
|
onAiRestructure: d,
|
|
14850
14850
|
onAiProofread: f,
|
|
@@ -14869,7 +14869,7 @@ function cg({
|
|
|
14869
14869
|
padding: "16px",
|
|
14870
14870
|
fontSize: "14px",
|
|
14871
14871
|
lineHeight: 1.6,
|
|
14872
|
-
color:
|
|
14872
|
+
color: b.text
|
|
14873
14873
|
}
|
|
14874
14874
|
}
|
|
14875
14875
|
),
|
|
@@ -14884,7 +14884,7 @@ function cg({
|
|
|
14884
14884
|
/* @__PURE__ */ h.jsx(
|
|
14885
14885
|
ag,
|
|
14886
14886
|
{
|
|
14887
|
-
html: y ?
|
|
14887
|
+
html: y ? k : r,
|
|
14888
14888
|
isExternalUpdate: y,
|
|
14889
14889
|
onImportComplete: R
|
|
14890
14890
|
}
|
|
@@ -14897,7 +14897,7 @@ function cg({
|
|
|
14897
14897
|
}
|
|
14898
14898
|
)
|
|
14899
14899
|
] }),
|
|
14900
|
-
n && /* @__PURE__ */ h.jsx(ug, { replyTo: n, theme:
|
|
14900
|
+
n && /* @__PURE__ */ h.jsx(ug, { replyTo: n, theme: b })
|
|
14901
14901
|
]
|
|
14902
14902
|
}
|
|
14903
14903
|
);
|
|
@@ -14939,13 +14939,13 @@ function My({
|
|
|
14939
14939
|
className: g = "",
|
|
14940
14940
|
minHeight: m = "200px",
|
|
14941
14941
|
sendButtonText: x = "Send",
|
|
14942
|
-
hideCancelButton:
|
|
14942
|
+
hideCancelButton: b = !1,
|
|
14943
14943
|
onAiRestructure: y,
|
|
14944
|
-
onAiProofread:
|
|
14944
|
+
onAiProofread: _,
|
|
14945
14945
|
onAiRewrite: C,
|
|
14946
|
-
renderAboveToolbar:
|
|
14946
|
+
renderAboveToolbar: k
|
|
14947
14947
|
}) {
|
|
14948
|
-
const w = { ...dg, ...c }, [
|
|
14948
|
+
const w = { ...dg, ...c }, [v, E] = O(r), [B, A] = O(""), [T, F] = O(""), [R, D] = O(e), [N, M] = O(t), [I, V] = O([]), [U, re] = O(!1), [q, J] = O(""), [W, se] = O(f), [ce, fe] = O(!1), ge = Le.useRef(void 0);
|
|
14949
14949
|
Le.useEffect(() => {
|
|
14950
14950
|
l !== void 0 && l !== ge.current && (ge.current = l, M(t), fe(!0));
|
|
14951
14951
|
}, [l, t]);
|
|
@@ -14971,7 +14971,7 @@ function My({
|
|
|
14971
14971
|
}, qe = (z) => z.type.startsWith("image/") ? "image" : z.type === "application/pdf" ? "picture_as_pdf" : z.type.includes("spreadsheet") || z.type.includes("excel") ? "table_chart" : z.type.includes("document") || z.type.includes("word") ? "description" : "attach_file", ze = (z) => {
|
|
14972
14972
|
V((le) => le.filter((ye, be) => be !== z));
|
|
14973
14973
|
}, He = (z) => z < 1024 ? `${z} B` : z < 1024 * 1024 ? `${(z / 1024).toFixed(1)} KB` : `${(z / (1024 * 1024)).toFixed(1)} MB`, Y = async () => {
|
|
14974
|
-
if (!
|
|
14974
|
+
if (!v.trim()) {
|
|
14975
14975
|
J("Recipient email is required");
|
|
14976
14976
|
return;
|
|
14977
14977
|
}
|
|
@@ -14994,7 +14994,7 @@ function My({
|
|
|
14994
14994
|
};
|
|
14995
14995
|
})
|
|
14996
14996
|
), le = N.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), ye = {
|
|
14997
|
-
to:
|
|
14997
|
+
to: v.trim(),
|
|
14998
14998
|
cc: B.trim() || void 0,
|
|
14999
14999
|
bcc: T.trim() || void 0,
|
|
15000
15000
|
subject: R.trim(),
|
|
@@ -15005,7 +15005,7 @@ function My({
|
|
|
15005
15005
|
console.log("[MailComposer] Sending email - to:", ye.to, "subject:", ye.subject, "attachmentsCount:", ye.attachments.length), ye.attachments.length > 0 && ye.attachments.forEach((be, Ge) => {
|
|
15006
15006
|
var vt;
|
|
15007
15007
|
console.log(`[MailComposer] Attachment ${Ge + 1}:`, be.filename, "size:", be.size, "type:", be.content_type, "data length:", ((vt = be.data) == null ? void 0 : vt.length) || 0);
|
|
15008
|
-
}), await i(ye),
|
|
15008
|
+
}), await i(ye), E(""), A(""), F(""), D(""), M(""), V([]);
|
|
15009
15009
|
} catch (z) {
|
|
15010
15010
|
J(z instanceof Error ? z.message : "Failed to send email");
|
|
15011
15011
|
} finally {
|
|
@@ -15073,8 +15073,8 @@ function My({
|
|
|
15073
15073
|
"input",
|
|
15074
15074
|
{
|
|
15075
15075
|
type: "email",
|
|
15076
|
-
value:
|
|
15077
|
-
onChange: (z) =>
|
|
15076
|
+
value: v,
|
|
15077
|
+
onChange: (z) => E(z.target.value),
|
|
15078
15078
|
placeholder: "recipient@example.com",
|
|
15079
15079
|
disabled: d || U,
|
|
15080
15080
|
style: L
|
|
@@ -15157,9 +15157,9 @@ function My({
|
|
|
15157
15157
|
insertText: a,
|
|
15158
15158
|
insertTextTrigger: u,
|
|
15159
15159
|
onAiRestructure: y,
|
|
15160
|
-
onAiProofread:
|
|
15160
|
+
onAiProofread: _,
|
|
15161
15161
|
onAiRewrite: C,
|
|
15162
|
-
renderAboveToolbar:
|
|
15162
|
+
renderAboveToolbar: k
|
|
15163
15163
|
}
|
|
15164
15164
|
) }) }),
|
|
15165
15165
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -15247,7 +15247,7 @@ function My({
|
|
|
15247
15247
|
)) })
|
|
15248
15248
|
] }),
|
|
15249
15249
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
|
|
15250
|
-
!
|
|
15250
|
+
!b && s && /* @__PURE__ */ h.jsx(
|
|
15251
15251
|
"button",
|
|
15252
15252
|
{
|
|
15253
15253
|
type: "button",
|
|
@@ -15262,8 +15262,8 @@ function My({
|
|
|
15262
15262
|
{
|
|
15263
15263
|
type: "button",
|
|
15264
15264
|
onClick: Y,
|
|
15265
|
-
disabled: d || U || !
|
|
15266
|
-
style: Ke(!0, d || U || !
|
|
15265
|
+
disabled: d || U || !v.trim() || !R.trim(),
|
|
15266
|
+
style: Ke(!0, d || U || !v.trim() || !R.trim()),
|
|
15267
15267
|
children: [
|
|
15268
15268
|
/* @__PURE__ */ h.jsx(
|
|
15269
15269
|
"span",
|
|
@@ -15316,10 +15316,10 @@ function Ry({
|
|
|
15316
15316
|
theme: d = {},
|
|
15317
15317
|
className: f = ""
|
|
15318
15318
|
}) {
|
|
15319
|
-
const p = { ...fg, ...d }, [g, m] = O(!1), [x,
|
|
15319
|
+
const p = { ...fg, ...d }, [g, m] = O(!1), [x, b] = O(""), y = me(null), _ = me(null);
|
|
15320
15320
|
Te(() => {
|
|
15321
15321
|
function T(F) {
|
|
15322
|
-
y.current && !y.current.contains(F.target) && (m(!1),
|
|
15322
|
+
y.current && !y.current.contains(F.target) && (m(!1), b(""));
|
|
15323
15323
|
}
|
|
15324
15324
|
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
15325
15325
|
}, []);
|
|
@@ -15328,21 +15328,21 @@ function Ry({
|
|
|
15328
15328
|
var F;
|
|
15329
15329
|
return ((F = T.label) == null ? void 0 : F.toLowerCase().includes(x.toLowerCase())) && !e.includes(T.id);
|
|
15330
15330
|
}
|
|
15331
|
-
),
|
|
15331
|
+
), k = i && x.trim() && !r.some((T) => {
|
|
15332
15332
|
var F;
|
|
15333
15333
|
return ((F = T.label) == null ? void 0 : F.toLowerCase()) === x.toLowerCase();
|
|
15334
|
-
}), w = e.map((T) => r.find((F) => F.id === T)).filter(Boolean),
|
|
15334
|
+
}), w = e.map((T) => r.find((F) => F.id === T)).filter(Boolean), v = Q((T) => {
|
|
15335
15335
|
var F;
|
|
15336
|
-
c > 0 && e.length >= c || (t([...e, T]),
|
|
15337
|
-
}, [e, t, c]),
|
|
15336
|
+
c > 0 && e.length >= c || (t([...e, T]), b(""), c === 1 ? m(!1) : (F = _.current) == null || F.focus());
|
|
15337
|
+
}, [e, t, c]), E = Q((T) => {
|
|
15338
15338
|
t(e.filter((F) => F !== T));
|
|
15339
15339
|
}, [e, t]), B = Q(async () => {
|
|
15340
|
-
if (!
|
|
15340
|
+
if (!k) return;
|
|
15341
15341
|
const T = await (s == null ? void 0 : s(x.trim()));
|
|
15342
|
-
T &&
|
|
15343
|
-
}, [
|
|
15344
|
-
T.key === "Enter" ? (T.preventDefault(),
|
|
15345
|
-
}, [
|
|
15342
|
+
T && v(T.id), b("");
|
|
15343
|
+
}, [k, x, s, v]), A = Q((T) => {
|
|
15344
|
+
T.key === "Enter" ? (T.preventDefault(), k ? B() : C.length > 0 && v(C[0].id)) : T.key === "Backspace" && !x && e.length > 0 ? E(e[e.length - 1]) : T.key === "Escape" && (m(!1), b(""));
|
|
15345
|
+
}, [k, C, x, e, B, v, E]);
|
|
15346
15346
|
return /* @__PURE__ */ h.jsxs("div", { ref: y, className: f, style: { position: "relative" }, children: [
|
|
15347
15347
|
a && /* @__PURE__ */ h.jsx(
|
|
15348
15348
|
"label",
|
|
@@ -15394,7 +15394,7 @@ function Ry({
|
|
|
15394
15394
|
{
|
|
15395
15395
|
type: "button",
|
|
15396
15396
|
onClick: (F) => {
|
|
15397
|
-
F.stopPropagation(),
|
|
15397
|
+
F.stopPropagation(), E(T.id);
|
|
15398
15398
|
},
|
|
15399
15399
|
style: {
|
|
15400
15400
|
border: "none",
|
|
@@ -15415,11 +15415,11 @@ function Ry({
|
|
|
15415
15415
|
/* @__PURE__ */ h.jsx(
|
|
15416
15416
|
"input",
|
|
15417
15417
|
{
|
|
15418
|
-
ref:
|
|
15418
|
+
ref: _,
|
|
15419
15419
|
type: "text",
|
|
15420
15420
|
value: x,
|
|
15421
15421
|
onChange: (T) => {
|
|
15422
|
-
|
|
15422
|
+
b(T.target.value), g || m(!0);
|
|
15423
15423
|
},
|
|
15424
15424
|
onFocus: () => m(!0),
|
|
15425
15425
|
onKeyDown: A,
|
|
@@ -15456,7 +15456,7 @@ function Ry({
|
|
|
15456
15456
|
overflowY: "auto",
|
|
15457
15457
|
zIndex: 50
|
|
15458
15458
|
},
|
|
15459
|
-
children: C.length === 0 && !
|
|
15459
|
+
children: C.length === 0 && !k ? /* @__PURE__ */ h.jsx(
|
|
15460
15460
|
"div",
|
|
15461
15461
|
{
|
|
15462
15462
|
style: {
|
|
@@ -15471,7 +15471,7 @@ function Ry({
|
|
|
15471
15471
|
C.map((T) => /* @__PURE__ */ h.jsxs(
|
|
15472
15472
|
"div",
|
|
15473
15473
|
{
|
|
15474
|
-
onClick: () =>
|
|
15474
|
+
onClick: () => v(T.id),
|
|
15475
15475
|
style: {
|
|
15476
15476
|
padding: "10px 12px",
|
|
15477
15477
|
fontSize: "14px",
|
|
@@ -15518,7 +15518,7 @@ function Ry({
|
|
|
15518
15518
|
},
|
|
15519
15519
|
T.id
|
|
15520
15520
|
)),
|
|
15521
|
-
|
|
15521
|
+
k && /* @__PURE__ */ h.jsxs(
|
|
15522
15522
|
"div",
|
|
15523
15523
|
{
|
|
15524
15524
|
onClick: B,
|
|
@@ -15568,30 +15568,32 @@ function jy({
|
|
|
15568
15568
|
className: a = "",
|
|
15569
15569
|
theme: u = {}
|
|
15570
15570
|
}) {
|
|
15571
|
-
const c = { ...hg, ...u }, [d, f] = O(""), [p, g] = O(!1), m = me(null), x = me(null),
|
|
15571
|
+
const c = { ...hg, ...u }, [d, f] = O(""), [p, g] = O(!1), m = me(null), x = me(null), b = ct(() => e && r.find((E) => E.id === e) || null, [e, r]), y = ct(() => {
|
|
15572
15572
|
if (!d.trim()) return r;
|
|
15573
|
-
const
|
|
15573
|
+
const E = d.toLowerCase();
|
|
15574
15574
|
return r.filter(
|
|
15575
|
-
(
|
|
15576
|
-
var
|
|
15577
|
-
return ((
|
|
15575
|
+
(B) => {
|
|
15576
|
+
var A, T;
|
|
15577
|
+
return ((A = B.label) == null ? void 0 : A.toLowerCase().includes(E)) || ((T = B.notes) == null ? void 0 : T.toLowerCase().includes(E));
|
|
15578
15578
|
}
|
|
15579
15579
|
);
|
|
15580
15580
|
}, [r, d]);
|
|
15581
15581
|
Te(() => {
|
|
15582
|
-
const
|
|
15583
|
-
m.current && !m.current.contains(
|
|
15582
|
+
const E = (B) => {
|
|
15583
|
+
m.current && !m.current.contains(B.target) && g(!1);
|
|
15584
15584
|
};
|
|
15585
|
-
return document.addEventListener("mousedown",
|
|
15585
|
+
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
15586
15586
|
}, []);
|
|
15587
|
-
const
|
|
15588
|
-
i && i(
|
|
15587
|
+
const _ = (E) => {
|
|
15588
|
+
i && i(E), g(!1), f("");
|
|
15589
15589
|
}, C = () => {
|
|
15590
15590
|
o && o(d.trim() || void 0), g(!1), f("");
|
|
15591
|
-
},
|
|
15591
|
+
}, k = () => {
|
|
15592
15592
|
g(!0);
|
|
15593
|
-
}, w = (
|
|
15594
|
-
f(
|
|
15593
|
+
}, w = (E) => {
|
|
15594
|
+
f(E.target.value), p || g(!0);
|
|
15595
|
+
}, v = (E) => {
|
|
15596
|
+
E.key === "Enter" ? (E.preventDefault(), y.length > 0 && i ? (i(y[0]), g(!1), f("")) : o && d.trim() && (o(d.trim()), g(!1), f(""))) : E.key === "Escape" && (g(!1), f(""));
|
|
15595
15597
|
};
|
|
15596
15598
|
return /* @__PURE__ */ h.jsxs(
|
|
15597
15599
|
"div",
|
|
@@ -15601,7 +15603,7 @@ function jy({
|
|
|
15601
15603
|
style: { position: "relative", width: "100%" },
|
|
15602
15604
|
children: [
|
|
15603
15605
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
15604
|
-
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, position: "relative" }, children:
|
|
15606
|
+
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, position: "relative" }, children: b && !p ? (
|
|
15605
15607
|
// Show selected value as a chip/tag
|
|
15606
15608
|
/* @__PURE__ */ h.jsxs(
|
|
15607
15609
|
"div",
|
|
@@ -15623,14 +15625,14 @@ function jy({
|
|
|
15623
15625
|
onClick: () => g(!0),
|
|
15624
15626
|
children: [
|
|
15625
15627
|
/* @__PURE__ */ h.jsxs("div", { style: { overflow: "hidden" }, children: [
|
|
15626
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
15627
|
-
|
|
15628
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: b.label }),
|
|
15629
|
+
b.notes && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "11px", color: c.textSecondary, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: b.notes })
|
|
15628
15630
|
] }),
|
|
15629
15631
|
s && /* @__PURE__ */ h.jsx(
|
|
15630
15632
|
"button",
|
|
15631
15633
|
{
|
|
15632
|
-
onClick: (
|
|
15633
|
-
|
|
15634
|
+
onClick: (E) => {
|
|
15635
|
+
E.stopPropagation(), s();
|
|
15634
15636
|
},
|
|
15635
15637
|
style: {
|
|
15636
15638
|
marginLeft: "8px",
|
|
@@ -15678,7 +15680,8 @@ function jy({
|
|
|
15678
15680
|
type: "text",
|
|
15679
15681
|
value: d,
|
|
15680
15682
|
onChange: w,
|
|
15681
|
-
onFocus:
|
|
15683
|
+
onFocus: k,
|
|
15684
|
+
onKeyDown: v,
|
|
15682
15685
|
placeholder: n,
|
|
15683
15686
|
style: {
|
|
15684
15687
|
width: "100%",
|
|
@@ -15716,11 +15719,11 @@ function jy({
|
|
|
15716
15719
|
transition: "background 0.15s",
|
|
15717
15720
|
flexShrink: 0
|
|
15718
15721
|
},
|
|
15719
|
-
onMouseEnter: (
|
|
15720
|
-
|
|
15722
|
+
onMouseEnter: (E) => {
|
|
15723
|
+
E.currentTarget.style.background = c.cardHover || "#f3f4f6";
|
|
15721
15724
|
},
|
|
15722
|
-
onMouseLeave: (
|
|
15723
|
-
|
|
15725
|
+
onMouseLeave: (E) => {
|
|
15726
|
+
E.currentTarget.style.background = c.background || "#ffffff";
|
|
15724
15727
|
},
|
|
15725
15728
|
title: `Create ${t || "item"}`,
|
|
15726
15729
|
children: "+"
|
|
@@ -15745,40 +15748,40 @@ function jy({
|
|
|
15745
15748
|
textAlign: "center",
|
|
15746
15749
|
color: c.textSecondary,
|
|
15747
15750
|
fontSize: "14px"
|
|
15748
|
-
}, children: d ? `No results for "${d}"` : "No items" }) : y.map((
|
|
15751
|
+
}, children: d ? `No results for "${d}"` : "No items" }) : y.map((E, B) => /* @__PURE__ */ h.jsxs(
|
|
15749
15752
|
"div",
|
|
15750
15753
|
{
|
|
15751
|
-
onClick: () =>
|
|
15754
|
+
onClick: () => _(E),
|
|
15752
15755
|
style: {
|
|
15753
15756
|
padding: "10px 14px",
|
|
15754
15757
|
cursor: "pointer",
|
|
15755
|
-
borderBottom:
|
|
15758
|
+
borderBottom: B < y.length - 1 ? `1px solid ${c.border}` : "none",
|
|
15756
15759
|
background: c.cardBackground,
|
|
15757
15760
|
transition: "background 0.15s"
|
|
15758
15761
|
},
|
|
15759
|
-
onMouseEnter: (
|
|
15760
|
-
|
|
15762
|
+
onMouseEnter: (A) => {
|
|
15763
|
+
A.currentTarget.style.background = c.cardHover || "#f3f4f6";
|
|
15761
15764
|
},
|
|
15762
|
-
onMouseLeave: (
|
|
15763
|
-
|
|
15765
|
+
onMouseLeave: (A) => {
|
|
15766
|
+
A.currentTarget.style.background = c.cardBackground || "#f9fafb";
|
|
15764
15767
|
},
|
|
15765
15768
|
children: [
|
|
15766
15769
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
15767
15770
|
fontSize: "14px",
|
|
15768
15771
|
fontWeight: 500,
|
|
15769
|
-
color:
|
|
15770
|
-
marginBottom:
|
|
15771
|
-
}, children:
|
|
15772
|
-
|
|
15772
|
+
color: E.color || c.text,
|
|
15773
|
+
marginBottom: E.notes ? "2px" : 0
|
|
15774
|
+
}, children: E.label }),
|
|
15775
|
+
E.notes && /* @__PURE__ */ h.jsx("div", { style: {
|
|
15773
15776
|
fontSize: "12px",
|
|
15774
15777
|
color: c.textSecondary,
|
|
15775
15778
|
whiteSpace: "nowrap",
|
|
15776
15779
|
overflow: "hidden",
|
|
15777
15780
|
textOverflow: "ellipsis"
|
|
15778
|
-
}, children:
|
|
15781
|
+
}, children: E.notes })
|
|
15779
15782
|
]
|
|
15780
15783
|
},
|
|
15781
|
-
|
|
15784
|
+
E.id
|
|
15782
15785
|
)) })
|
|
15783
15786
|
]
|
|
15784
15787
|
}
|
|
@@ -15800,7 +15803,7 @@ function Ly({
|
|
|
15800
15803
|
columnClassName: f = "",
|
|
15801
15804
|
itemClassName: p = ""
|
|
15802
15805
|
}) {
|
|
15803
|
-
const [g, m] = O(null), [x,
|
|
15806
|
+
const [g, m] = O(null), [x, b] = O(null), [y, _] = O(null), C = me(null), k = e.reduce((F, R) => {
|
|
15804
15807
|
let D = r.filter((N) => n(N) === R.id);
|
|
15805
15808
|
return i && (D = D.sort((N, M) => i(N) - i(M))), F[R.id] = D, F;
|
|
15806
15809
|
}, {}), w = Q((F, R) => {
|
|
@@ -15809,18 +15812,18 @@ function Ly({
|
|
|
15809
15812
|
const M = F.target;
|
|
15810
15813
|
M.style.opacity = "0.5";
|
|
15811
15814
|
});
|
|
15812
|
-
}, [t, n]),
|
|
15815
|
+
}, [t, n]), v = Q((F) => {
|
|
15813
15816
|
const R = F.target;
|
|
15814
|
-
R.style.opacity = "1", m(null),
|
|
15815
|
-
}, []),
|
|
15816
|
-
F.preventDefault(), F.dataTransfer.dropEffect = "move",
|
|
15817
|
+
R.style.opacity = "1", m(null), b(null), _(null), C.current = null;
|
|
15818
|
+
}, []), E = Q((F, R, D) => {
|
|
15819
|
+
F.preventDefault(), F.dataTransfer.dropEffect = "move", b(R), _(D);
|
|
15817
15820
|
}, []), B = Q((F) => {
|
|
15818
15821
|
const R = F.relatedTarget;
|
|
15819
|
-
R != null && R.closest("[data-kanban-column]") || (
|
|
15822
|
+
R != null && R.closest("[data-kanban-column]") || (b(null), _(null));
|
|
15820
15823
|
}, []), A = Q((F, R, D) => {
|
|
15821
15824
|
if (F.preventDefault(), !g) return;
|
|
15822
15825
|
const N = C.current;
|
|
15823
|
-
N === R ? l == null || l(g, R, D) : N && o(g, N, R, D), m(null),
|
|
15826
|
+
N === R ? l == null || l(g, R, D) : N && o(g, N, R, D), m(null), b(null), _(null), C.current = null;
|
|
15824
15827
|
}, [g, o, l]), T = (F, R) => /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
15825
15828
|
/* @__PURE__ */ h.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15826
15829
|
F.color && /* @__PURE__ */ h.jsx(
|
|
@@ -15840,14 +15843,14 @@ function Ly({
|
|
|
15840
15843
|
className: `flex gap-4 overflow-x-auto pb-4 ${d}`,
|
|
15841
15844
|
style: { minHeight: "400px" },
|
|
15842
15845
|
children: e.map((F) => {
|
|
15843
|
-
const R =
|
|
15846
|
+
const R = k[F.id] || [], D = x === F.id;
|
|
15844
15847
|
return /* @__PURE__ */ h.jsxs(
|
|
15845
15848
|
"div",
|
|
15846
15849
|
{
|
|
15847
15850
|
"data-kanban-column": F.id,
|
|
15848
15851
|
className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
|
|
15849
15852
|
onDragOver: (N) => {
|
|
15850
|
-
N.preventDefault(), g && !D &&
|
|
15853
|
+
N.preventDefault(), g && !D && b(F.id);
|
|
15851
15854
|
},
|
|
15852
15855
|
onDragLeave: B,
|
|
15853
15856
|
onDrop: (N) => A(N, F.id, y ?? R.length),
|
|
@@ -15867,8 +15870,8 @@ function Ly({
|
|
|
15867
15870
|
{
|
|
15868
15871
|
draggable: !0,
|
|
15869
15872
|
onDragStart: (re) => w(re, N),
|
|
15870
|
-
onDragEnd:
|
|
15871
|
-
onDragOver: (re) =>
|
|
15873
|
+
onDragEnd: v,
|
|
15874
|
+
onDragOver: (re) => E(re, F.id, M),
|
|
15872
15875
|
onClick: () => a == null ? void 0 : a(N),
|
|
15873
15876
|
className: `cursor-grab active:cursor-grabbing transition-all ${V ? "opacity-50 scale-95" : ""} ${p}`,
|
|
15874
15877
|
children: s(N, V)
|
|
@@ -15881,7 +15884,7 @@ function Ly({
|
|
|
15881
15884
|
{
|
|
15882
15885
|
className: "min-h-[40px] flex-1",
|
|
15883
15886
|
onDragOver: (N) => {
|
|
15884
|
-
N.preventDefault(),
|
|
15887
|
+
N.preventDefault(), E(N, F.id, R.length);
|
|
15885
15888
|
},
|
|
15886
15889
|
children: D && y === R.length && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mx-1 mt-1" })
|
|
15887
15890
|
}
|
|
@@ -15940,34 +15943,34 @@ function Py({
|
|
|
15940
15943
|
className: p = "",
|
|
15941
15944
|
theme: g = {}
|
|
15942
15945
|
}) {
|
|
15943
|
-
const m = { ...pg, ...g }, { allDayItems: x, timedItems:
|
|
15944
|
-
const
|
|
15946
|
+
const m = { ...pg, ...g }, { allDayItems: x, timedItems: b } = ct(() => {
|
|
15947
|
+
const v = [], E = [];
|
|
15945
15948
|
for (const B of r)
|
|
15946
|
-
l(B) ?
|
|
15947
|
-
return { allDayItems:
|
|
15948
|
-
}, [r, l]), y =
|
|
15949
|
-
const
|
|
15950
|
-
for (let
|
|
15951
|
-
|
|
15952
|
-
return
|
|
15953
|
-
}, [t, n]),
|
|
15954
|
-
(
|
|
15955
|
-
const
|
|
15956
|
-
if (!
|
|
15957
|
-
const B = gg(
|
|
15949
|
+
l(B) ? v.push(B) : E.push(B);
|
|
15950
|
+
return { allDayItems: v, timedItems: E };
|
|
15951
|
+
}, [r, l]), y = ct(() => {
|
|
15952
|
+
const v = [];
|
|
15953
|
+
for (let E = t; E <= n; E++)
|
|
15954
|
+
v.push(E);
|
|
15955
|
+
return v;
|
|
15956
|
+
}, [t, n]), _ = (n - t + 1) * i, C = Q(
|
|
15957
|
+
(v) => {
|
|
15958
|
+
const E = s(v);
|
|
15959
|
+
if (!E) return null;
|
|
15960
|
+
const B = gg(E);
|
|
15958
15961
|
if (!B) return null;
|
|
15959
|
-
const { hours: A, minutes: T } = B, F = Math.max(t, Math.min(n, A)), R = A < t ? 0 : T, D = (F - t) * i + R / 60 * i, N = o(
|
|
15962
|
+
const { hours: A, minutes: T } = B, F = Math.max(t, Math.min(n, A)), R = A < t ? 0 : T, D = (F - t) * i + R / 60 * i, N = o(v), M = Math.max(20, N / 60 * i);
|
|
15960
15963
|
return { top: D, height: M };
|
|
15961
15964
|
},
|
|
15962
15965
|
[s, o, t, n, i]
|
|
15963
|
-
),
|
|
15966
|
+
), k = ct(() => {
|
|
15964
15967
|
if (!f || !yg(e)) return null;
|
|
15965
|
-
const
|
|
15966
|
-
return
|
|
15968
|
+
const v = /* @__PURE__ */ new Date(), E = v.getHours(), B = v.getMinutes();
|
|
15969
|
+
return E < t || E > n ? null : (E - t) * i + B / 60 * i;
|
|
15967
15970
|
}, [e, f, t, n, i]), w = Q(
|
|
15968
|
-
(
|
|
15971
|
+
(v) => {
|
|
15969
15972
|
if (!d) return;
|
|
15970
|
-
const
|
|
15973
|
+
const E = v.currentTarget.getBoundingClientRect(), A = (v.clientY - E.top) / i * 60, T = Math.floor(A / 60) + t, F = Math.round(A % 60 / 15) * 15, R = Math.min(n, Math.max(t, T)), D = F >= 60 ? 0 : F, N = `${R.toString().padStart(2, "0")}:${D.toString().padStart(2, "0")}`;
|
|
15971
15974
|
d(N);
|
|
15972
15975
|
},
|
|
15973
15976
|
[d, i, t, n]
|
|
@@ -15995,20 +15998,20 @@ function Py({
|
|
|
15995
15998
|
children: "All Day"
|
|
15996
15999
|
}
|
|
15997
16000
|
),
|
|
15998
|
-
/* @__PURE__ */ h.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: x.map((
|
|
16001
|
+
/* @__PURE__ */ h.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: x.map((v) => /* @__PURE__ */ h.jsx(
|
|
15999
16002
|
"div",
|
|
16000
16003
|
{
|
|
16001
|
-
onClick: () => c == null ? void 0 : c(
|
|
16004
|
+
onClick: () => c == null ? void 0 : c(v),
|
|
16002
16005
|
style: { cursor: c ? "pointer" : "default" },
|
|
16003
|
-
children: u(
|
|
16006
|
+
children: u(v)
|
|
16004
16007
|
},
|
|
16005
|
-
a(
|
|
16008
|
+
a(v)
|
|
16006
16009
|
)) })
|
|
16007
16010
|
]
|
|
16008
16011
|
}
|
|
16009
16012
|
),
|
|
16010
|
-
/* @__PURE__ */ h.jsxs("div", { style: { position: "relative", height:
|
|
16011
|
-
y.map((
|
|
16013
|
+
/* @__PURE__ */ h.jsxs("div", { style: { position: "relative", height: _ }, children: [
|
|
16014
|
+
y.map((v, E) => /* @__PURE__ */ h.jsxs("div", { style: { position: "absolute", top: E * i, left: 0, right: 0 }, children: [
|
|
16012
16015
|
/* @__PURE__ */ h.jsx(
|
|
16013
16016
|
"div",
|
|
16014
16017
|
{
|
|
@@ -16022,7 +16025,7 @@ function Py({
|
|
|
16022
16025
|
fontSize: "11px",
|
|
16023
16026
|
color: m.hourTextColor
|
|
16024
16027
|
},
|
|
16025
|
-
children: mg(
|
|
16028
|
+
children: mg(v)
|
|
16026
16029
|
}
|
|
16027
16030
|
),
|
|
16028
16031
|
/* @__PURE__ */ h.jsx(
|
|
@@ -16038,7 +16041,7 @@ function Py({
|
|
|
16038
16041
|
}
|
|
16039
16042
|
}
|
|
16040
16043
|
),
|
|
16041
|
-
|
|
16044
|
+
E < y.length - 1 && /* @__PURE__ */ h.jsx(
|
|
16042
16045
|
"div",
|
|
16043
16046
|
{
|
|
16044
16047
|
style: {
|
|
@@ -16051,7 +16054,7 @@ function Py({
|
|
|
16051
16054
|
}
|
|
16052
16055
|
}
|
|
16053
16056
|
)
|
|
16054
|
-
] },
|
|
16057
|
+
] }, v)),
|
|
16055
16058
|
/* @__PURE__ */ h.jsx(
|
|
16056
16059
|
"div",
|
|
16057
16060
|
{
|
|
@@ -16066,14 +16069,14 @@ function Py({
|
|
|
16066
16069
|
onClick: w
|
|
16067
16070
|
}
|
|
16068
16071
|
),
|
|
16069
|
-
|
|
16072
|
+
k !== null && /* @__PURE__ */ h.jsxs(
|
|
16070
16073
|
"div",
|
|
16071
16074
|
{
|
|
16072
16075
|
style: {
|
|
16073
16076
|
position: "absolute",
|
|
16074
16077
|
left: "55px",
|
|
16075
16078
|
right: 0,
|
|
16076
|
-
top:
|
|
16079
|
+
top: k,
|
|
16077
16080
|
zIndex: 20,
|
|
16078
16081
|
pointerEvents: "none"
|
|
16079
16082
|
},
|
|
@@ -16105,36 +16108,36 @@ function Py({
|
|
|
16105
16108
|
]
|
|
16106
16109
|
}
|
|
16107
16110
|
),
|
|
16108
|
-
|
|
16109
|
-
const
|
|
16110
|
-
return
|
|
16111
|
+
b.map((v) => {
|
|
16112
|
+
const E = C(v);
|
|
16113
|
+
return E ? /* @__PURE__ */ h.jsx(
|
|
16111
16114
|
"div",
|
|
16112
16115
|
{
|
|
16113
16116
|
style: {
|
|
16114
16117
|
position: "absolute",
|
|
16115
16118
|
left: "64px",
|
|
16116
16119
|
right: "8px",
|
|
16117
|
-
top:
|
|
16118
|
-
height:
|
|
16120
|
+
top: E.top,
|
|
16121
|
+
height: E.height,
|
|
16119
16122
|
zIndex: 10,
|
|
16120
16123
|
cursor: c ? "pointer" : "default"
|
|
16121
16124
|
},
|
|
16122
16125
|
onClick: (B) => {
|
|
16123
|
-
B.stopPropagation(), c == null || c(
|
|
16126
|
+
B.stopPropagation(), c == null || c(v);
|
|
16124
16127
|
},
|
|
16125
|
-
children: u(
|
|
16128
|
+
children: u(v)
|
|
16126
16129
|
},
|
|
16127
|
-
a(
|
|
16130
|
+
a(v)
|
|
16128
16131
|
) : null;
|
|
16129
16132
|
})
|
|
16130
16133
|
] })
|
|
16131
16134
|
] });
|
|
16132
16135
|
}
|
|
16133
16136
|
function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: i = "widget", hideSaveButton: s = !1, maxDuration: o = 180 }) {
|
|
16134
|
-
const l = i === "widget", [a, u] = O("idle"), [c, d] = O(0), [f, p] = O(0), [g, m] = O(!1), [x,
|
|
16137
|
+
const l = i === "widget", [a, u] = O("idle"), [c, d] = O(0), [f, p] = O(0), [g, m] = O(!1), [x, b] = O(0), [y, _] = O(null), [C, k] = O(!1), [w, v] = O(null), [E, B] = O(!0), [A, T] = O([]), [F, R] = O({ completed: 0, total: 0 }), D = me(!1), N = me(!0);
|
|
16135
16138
|
Te(() => {
|
|
16136
|
-
N.current =
|
|
16137
|
-
}, [
|
|
16139
|
+
N.current = E;
|
|
16140
|
+
}, [E]);
|
|
16138
16141
|
const M = me(null), I = me(null), V = me(null), U = me(null), re = me(null), q = me([]), J = me(null), W = me(null), se = me(null), ce = me(null), fe = me(!1), ge = me([]), Ne = me(null), _e = me(null), Z = me([]), Ee = me([]), ie = me("insert"), Re = me(!1), ke = me(0), Se = me(0), qe = me(0), ze = (ee) => {
|
|
16139
16142
|
const j = Math.floor(ee / 60), ue = Math.floor(ee % 60);
|
|
16140
16143
|
return `${j.toString().padStart(2, "0")}:${ue.toString().padStart(2, "0")}`;
|
|
@@ -16150,25 +16153,25 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16150
16153
|
const it = [];
|
|
16151
16154
|
for (let Qe = 0; Qe < j; Qe++)
|
|
16152
16155
|
it.push(ee.getChannelData(Qe));
|
|
16153
|
-
let
|
|
16156
|
+
let at = 44;
|
|
16154
16157
|
for (let Qe = 0; Qe < ee.length; Qe++)
|
|
16155
16158
|
for (let Ue = 0; Ue < j; Ue++) {
|
|
16156
16159
|
const pt = Math.max(-1, Math.min(1, it[Ue][Qe])), gt = pt < 0 ? pt * 32768 : pt * 32767;
|
|
16157
|
-
Ce.setInt16(
|
|
16160
|
+
Ce.setInt16(at, gt, !0), at += 2;
|
|
16158
16161
|
}
|
|
16159
16162
|
return new Blob([Ve], { type: "audio/wav" });
|
|
16160
16163
|
}, L = async (ee, j, ue, he) => {
|
|
16161
16164
|
const G = new AudioContext(), De = ee.sampleRate, ve = Math.max(ee.numberOfChannels, j.numberOfChannels), we = Math.min(ue, ee.length), Ie = Math.max(0, ee.length - ue), Ve = he === "insert" ? we + j.length + Ie : we + j.length, Ce = G.createBuffer(ve, Ve, De);
|
|
16162
16165
|
for (let Ae = 0; Ae < ve; Ae++) {
|
|
16163
|
-
const it = Ce.getChannelData(Ae),
|
|
16166
|
+
const it = Ce.getChannelData(Ae), at = Ae < ee.numberOfChannels ? ee.getChannelData(Ae) : ee.getChannelData(0);
|
|
16164
16167
|
for (let Ue = 0; Ue < we; Ue++)
|
|
16165
|
-
it[Ue] =
|
|
16168
|
+
it[Ue] = at[Ue];
|
|
16166
16169
|
const Qe = Ae < j.numberOfChannels ? j.getChannelData(Ae) : j.getChannelData(0);
|
|
16167
16170
|
for (let Ue = 0; Ue < j.length; Ue++)
|
|
16168
16171
|
it[we + Ue] = Qe[Ue];
|
|
16169
16172
|
if (he === "insert")
|
|
16170
16173
|
for (let Ue = 0; Ue < Ie; Ue++)
|
|
16171
|
-
it[we + j.length + Ue] =
|
|
16174
|
+
it[we + j.length + Ue] = at[ue + Ue];
|
|
16172
16175
|
}
|
|
16173
16176
|
return await G.close(), Ce;
|
|
16174
16177
|
}, xe = Q(() => {
|
|
@@ -16184,8 +16187,8 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16184
16187
|
Ae.addColorStop(0, "transparent"), Ae.addColorStop(1, Ve), j.fillStyle = Ae, j.fillRect(0, G - Ie, he, Ie);
|
|
16185
16188
|
const it = j.createLinearGradient(0, 0, Ie, 0);
|
|
16186
16189
|
it.addColorStop(0, Ve), it.addColorStop(1, "transparent"), j.fillStyle = it, j.fillRect(0, 0, Ie, G);
|
|
16187
|
-
const
|
|
16188
|
-
|
|
16190
|
+
const at = j.createLinearGradient(he - Ie, 0, he, 0);
|
|
16191
|
+
at.addColorStop(0, "transparent"), at.addColorStop(1, Ve), j.fillStyle = at, j.fillRect(he - Ie, 0, Ie, G), j.strokeStyle = "#5a6b62", j.lineWidth = 1, j.beginPath(), j.moveTo(0, G / 2), j.lineTo(he, G / 2), j.stroke();
|
|
16189
16192
|
const Qe = he / 2;
|
|
16190
16193
|
if (De.length > 0)
|
|
16191
16194
|
if (a === "recording")
|
|
@@ -16219,7 +16222,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16219
16222
|
ge.current.push(De), xe(), fe.current && (W.current = requestAnimationFrame(Ke));
|
|
16220
16223
|
}, z = async () => {
|
|
16221
16224
|
try {
|
|
16222
|
-
|
|
16225
|
+
_(null), k(!1), Ne.current === null && (ge.current = []);
|
|
16223
16226
|
const ee = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
16224
16227
|
V.current = ee;
|
|
16225
16228
|
const j = new AudioContext();
|
|
@@ -16232,20 +16235,20 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16232
16235
|
}, G.onstop = async () => {
|
|
16233
16236
|
try {
|
|
16234
16237
|
if (fe.current = !1, q.current.length === 0) {
|
|
16235
|
-
|
|
16238
|
+
_("No audio was recorded. Please try again."), u("idle"), ee.getTracks().forEach((Ce) => Ce.stop());
|
|
16236
16239
|
return;
|
|
16237
16240
|
}
|
|
16238
16241
|
const De = new Blob(q.current, { type: "audio/webm" });
|
|
16239
16242
|
let ve, we;
|
|
16240
16243
|
if (Ne.current !== null && _e.current)
|
|
16241
16244
|
try {
|
|
16242
|
-
const Ce = await He(De), Ae = _e.current.sampleRate, it = Math.floor(Ne.current * Ae),
|
|
16245
|
+
const Ce = await He(De), Ae = _e.current.sampleRate, it = Math.floor(Ne.current * Ae), at = await L(
|
|
16243
16246
|
_e.current,
|
|
16244
16247
|
Ce,
|
|
16245
16248
|
it,
|
|
16246
16249
|
ie.current
|
|
16247
16250
|
);
|
|
16248
|
-
ve = Y(
|
|
16251
|
+
ve = Y(at), we = at.length / at.sampleRate, ie.current === "insert" && (ge.current = [
|
|
16249
16252
|
...ge.current,
|
|
16250
16253
|
...Ee.current
|
|
16251
16254
|
]), Ne.current = null, _e.current = null, Z.current = [], Ee.current = [];
|
|
@@ -16255,28 +16258,28 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16255
16258
|
else
|
|
16256
16259
|
ve = De, we = ke.current > 0 ? ke.current : 1;
|
|
16257
16260
|
if (ce.current = ve, ee.getTracks().forEach((Ce) => Ce.stop()), N.current && t) {
|
|
16258
|
-
T((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [],
|
|
16261
|
+
T((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [], b(0), p(0), d(0), u("idle");
|
|
16259
16262
|
return;
|
|
16260
16263
|
}
|
|
16261
16264
|
const Ie = URL.createObjectURL(ve), Ve = new Audio(Ie);
|
|
16262
16265
|
Ve.ontimeupdate = () => {
|
|
16263
|
-
|
|
16266
|
+
b(Ve.currentTime);
|
|
16264
16267
|
}, Ve.onended = () => {
|
|
16265
16268
|
m(!1);
|
|
16266
|
-
}, se.current = Ve, p(we),
|
|
16269
|
+
}, se.current = Ve, p(we), b(we), u("editing");
|
|
16267
16270
|
} catch {
|
|
16268
|
-
|
|
16271
|
+
_("Failed to process recording"), u("idle");
|
|
16269
16272
|
}
|
|
16270
16273
|
}, G.start(100), fe.current = !0, u("recording"), d(0), ke.current = 0, J.current = setInterval(() => {
|
|
16271
|
-
ke.current += 1, d(ke.current), ke.current >= o && (I.current && I.current.state !== "inactive" && I.current.stop(), fe.current = !1,
|
|
16274
|
+
ke.current += 1, d(ke.current), ke.current >= o && (I.current && I.current.state !== "inactive" && I.current.stop(), fe.current = !1, v(null), J.current && (clearInterval(J.current), J.current = null), W.current && (cancelAnimationFrame(W.current), W.current = null), setTimeout(() => {
|
|
16272
16275
|
alert(`Maximum recording time of ${Math.floor(o / 60)} minutes reached.`);
|
|
16273
16276
|
}, 100));
|
|
16274
16277
|
}, 1e3);
|
|
16275
16278
|
} catch {
|
|
16276
|
-
|
|
16279
|
+
_("Could not access microphone. Please allow microphone access.");
|
|
16277
16280
|
}
|
|
16278
16281
|
}, le = () => {
|
|
16279
|
-
fe.current = !1,
|
|
16282
|
+
fe.current = !1, k(!1), v(null), W.current && (cancelAnimationFrame(W.current), W.current = null), J.current && (clearInterval(J.current), J.current = null), I.current && I.current.state !== "inactive" && I.current.stop();
|
|
16280
16283
|
}, ye = (ee) => {
|
|
16281
16284
|
const j = M.current;
|
|
16282
16285
|
if (!j) return;
|
|
@@ -16285,15 +16288,15 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16285
16288
|
const he = ge.current;
|
|
16286
16289
|
if (he.length === 0) return;
|
|
16287
16290
|
const G = j.getBoundingClientRect(), De = ee - Se.current, ve = 4, we = G.width / j.width, Ie = he.length / ue * ve, Ve = -De / (Ie * we), Ce = qe.current + Ve, Ae = Math.max(0, Math.min(Ce, ue));
|
|
16288
|
-
se.current && (se.current.currentTime = Ae),
|
|
16291
|
+
se.current && (se.current.currentTime = Ae), b(Ae);
|
|
16289
16292
|
}, be = () => {
|
|
16290
|
-
se.current && (se.current.currentTime = 0),
|
|
16293
|
+
se.current && (se.current.currentTime = 0), b(0);
|
|
16291
16294
|
}, Ge = () => {
|
|
16292
16295
|
const ee = f || c;
|
|
16293
|
-
se.current && (se.current.currentTime = ee),
|
|
16296
|
+
se.current && (se.current.currentTime = ee), b(ee);
|
|
16294
16297
|
}, vt = () => {
|
|
16295
16298
|
const ee = se.current;
|
|
16296
|
-
ee && (g ? (ee.pause(),
|
|
16299
|
+
ee && (g ? (ee.pause(), b(ee.currentTime), m(!1)) : (ee.currentTime = x, ee.play().catch(() => {
|
|
16297
16300
|
}), m(!0)));
|
|
16298
16301
|
}, wt = async (ee) => {
|
|
16299
16302
|
if (!ce.current) {
|
|
@@ -16307,10 +16310,10 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16307
16310
|
const ue = j > 0 ? x / j : 0, he = Math.floor(ue * ge.current.length);
|
|
16308
16311
|
Z.current = ge.current.slice(0, he), Ee.current = ge.current.slice(he), ge.current = [...Z.current], z();
|
|
16309
16312
|
} catch {
|
|
16310
|
-
|
|
16313
|
+
_("Failed to prepare recording. Please try again.");
|
|
16311
16314
|
}
|
|
16312
16315
|
}, oe = () => {
|
|
16313
|
-
se.current && (se.current.pause(), se.current = null), ce.current = null, _e.current = null, Ne.current = null, Z.current = [], m(!1),
|
|
16316
|
+
se.current && (se.current.pause(), se.current = null), ce.current = null, _e.current = null, Ne.current = null, Z.current = [], m(!1), b(0), p(0), d(0), z();
|
|
16314
16317
|
}, de = () => {
|
|
16315
16318
|
ce.current ? r(ce.current, f || c) : alert("No audio recorded yet!");
|
|
16316
16319
|
};
|
|
@@ -16377,8 +16380,8 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16377
16380
|
if (G) {
|
|
16378
16381
|
const De = he.getBoundingClientRect(), ve = De.width, we = De.height, Ie = ge.current, Ve = f || c || 1, Ce = ue.currentTime;
|
|
16379
16382
|
G.fillStyle = "#2d3b35", G.fillRect(0, 0, ve, we);
|
|
16380
|
-
const Ae = 8, it = "rgba(0, 0, 0, 0.4)",
|
|
16381
|
-
|
|
16383
|
+
const Ae = 8, it = "rgba(0, 0, 0, 0.4)", at = G.createLinearGradient(0, 0, 0, Ae);
|
|
16384
|
+
at.addColorStop(0, it), at.addColorStop(1, "transparent"), G.fillStyle = at, G.fillRect(0, 0, ve, Ae);
|
|
16382
16385
|
const Qe = G.createLinearGradient(0, we - Ae, 0, we);
|
|
16383
16386
|
Qe.addColorStop(0, "transparent"), Qe.addColorStop(1, it), G.fillStyle = Qe, G.fillRect(0, we - Ae, ve, Ae);
|
|
16384
16387
|
const Ue = G.createLinearGradient(0, 0, Ae, 0);
|
|
@@ -16411,7 +16414,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16411
16414
|
"button",
|
|
16412
16415
|
{
|
|
16413
16416
|
onClick: () => {
|
|
16414
|
-
|
|
16417
|
+
_(null), z();
|
|
16415
16418
|
},
|
|
16416
16419
|
style: { padding: "8px 16px", fontSize: "14px", background: "#171717", color: "white", borderRadius: "8px", border: "none", cursor: "pointer" },
|
|
16417
16420
|
children: "Try Again"
|
|
@@ -16483,7 +16486,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16483
16486
|
onClick: () => {
|
|
16484
16487
|
if (a === "recording") {
|
|
16485
16488
|
const ee = I.current;
|
|
16486
|
-
ee && (ee.state === "recording" ? (ee.pause(),
|
|
16489
|
+
ee && (ee.state === "recording" ? (ee.pause(), k(!0)) : ee.state === "paused" && (ee.resume(), k(!1)));
|
|
16487
16490
|
} else
|
|
16488
16491
|
vt();
|
|
16489
16492
|
},
|
|
@@ -16508,7 +16511,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16508
16511
|
"button",
|
|
16509
16512
|
{
|
|
16510
16513
|
onClick: () => {
|
|
16511
|
-
w === "insert" ? le() : a === "idle" ? (
|
|
16514
|
+
w === "insert" ? le() : a === "idle" ? (v("insert"), z()) : a === "editing" && (v("insert"), wt("insert"));
|
|
16512
16515
|
},
|
|
16513
16516
|
disabled: a === "recording" && w !== "insert" || g,
|
|
16514
16517
|
style: a === "recording" && w !== "insert" || g ? rt : tt,
|
|
@@ -16520,10 +16523,10 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16520
16523
|
"button",
|
|
16521
16524
|
{
|
|
16522
16525
|
onClick: () => {
|
|
16523
|
-
N.current || (w === "mic" ? le() : a === "idle" ? (
|
|
16526
|
+
N.current || (w === "mic" ? le() : a === "idle" ? (v("mic"), z()) : a === "editing" && (v("mic"), wt("replace")));
|
|
16524
16527
|
},
|
|
16525
16528
|
onMouseDown: () => {
|
|
16526
|
-
N.current && a === "idle" && !g && (
|
|
16529
|
+
N.current && a === "idle" && !g && (v("mic"), z());
|
|
16527
16530
|
},
|
|
16528
16531
|
onMouseUp: () => {
|
|
16529
16532
|
N.current && a === "recording" && w === "mic" && le();
|
|
@@ -16532,14 +16535,14 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16532
16535
|
N.current && a === "recording" && w === "mic" && le();
|
|
16533
16536
|
},
|
|
16534
16537
|
onTouchStart: () => {
|
|
16535
|
-
N.current && a === "idle" && !g && (
|
|
16538
|
+
N.current && a === "idle" && !g && (v("mic"), z());
|
|
16536
16539
|
},
|
|
16537
16540
|
onTouchEnd: () => {
|
|
16538
16541
|
N.current && a === "recording" && w === "mic" && le();
|
|
16539
16542
|
},
|
|
16540
16543
|
disabled: a === "recording" && w !== "mic" || g,
|
|
16541
16544
|
style: a === "recording" && w !== "mic" || g ? rt : tt,
|
|
16542
|
-
title:
|
|
16545
|
+
title: E ? "Hold to record (walkie-talkie)" : w === "mic" ? "Stop recording" : "Record",
|
|
16543
16546
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: w === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
16544
16547
|
}
|
|
16545
16548
|
),
|
|
@@ -16547,7 +16550,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16547
16550
|
"button",
|
|
16548
16551
|
{
|
|
16549
16552
|
onClick: () => {
|
|
16550
|
-
w === "startover" ? le() : a === "editing" && (
|
|
16553
|
+
w === "startover" ? le() : a === "editing" && (v("startover"), oe());
|
|
16551
16554
|
},
|
|
16552
16555
|
disabled: a === "idle" || a === "recording" && w !== "startover" || g,
|
|
16553
16556
|
style: a === "idle" || a === "recording" && w !== "startover" || g ? rt : tt,
|
|
@@ -16577,19 +16580,19 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16577
16580
|
/* @__PURE__ */ h.jsx(
|
|
16578
16581
|
"button",
|
|
16579
16582
|
{
|
|
16580
|
-
onClick: () => B(!
|
|
16583
|
+
onClick: () => B(!E),
|
|
16581
16584
|
style: {
|
|
16582
16585
|
width: "28px",
|
|
16583
16586
|
height: "16px",
|
|
16584
16587
|
borderRadius: "8px",
|
|
16585
16588
|
border: "none",
|
|
16586
|
-
background:
|
|
16589
|
+
background: E ? "#10b981" : "#9ca3af",
|
|
16587
16590
|
cursor: "pointer",
|
|
16588
16591
|
position: "relative",
|
|
16589
16592
|
transition: "background 0.2s",
|
|
16590
16593
|
padding: 0
|
|
16591
16594
|
},
|
|
16592
|
-
title:
|
|
16595
|
+
title: E ? "Auto-transcribe ON" : "Auto-transcribe OFF",
|
|
16593
16596
|
children: /* @__PURE__ */ h.jsx("div", { style: {
|
|
16594
16597
|
width: "12px",
|
|
16595
16598
|
height: "12px",
|
|
@@ -16597,7 +16600,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16597
16600
|
background: "white",
|
|
16598
16601
|
position: "absolute",
|
|
16599
16602
|
top: "2px",
|
|
16600
|
-
left:
|
|
16603
|
+
left: E ? "14px" : "2px",
|
|
16601
16604
|
transition: "left 0.2s",
|
|
16602
16605
|
boxShadow: "0 1px 2px rgba(0,0,0,0.2)"
|
|
16603
16606
|
} })
|
|
@@ -16614,7 +16617,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16614
16617
|
disabled: a !== "editing",
|
|
16615
16618
|
style: a !== "editing" ? rt : tt,
|
|
16616
16619
|
title: "Transcribe audio",
|
|
16617
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
16620
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E ? "#10b981" : "#171717" }, children: "subtitles" })
|
|
16618
16621
|
}
|
|
16619
16622
|
)
|
|
16620
16623
|
] }),
|
|
@@ -16662,15 +16665,15 @@ ${y}` : y);
|
|
|
16662
16665
|
if (!(!e.trim() || a || !i)) {
|
|
16663
16666
|
u(!0), d(y), p(!1);
|
|
16664
16667
|
try {
|
|
16665
|
-
const
|
|
16666
|
-
t(
|
|
16667
|
-
} catch (
|
|
16668
|
-
console.error(`${y} failed:`,
|
|
16668
|
+
const _ = await i(y, e);
|
|
16669
|
+
t(_);
|
|
16670
|
+
} catch (_) {
|
|
16671
|
+
console.error(`${y} failed:`, _);
|
|
16669
16672
|
} finally {
|
|
16670
16673
|
u(!1), d(null);
|
|
16671
16674
|
}
|
|
16672
16675
|
}
|
|
16673
|
-
},
|
|
16676
|
+
}, b = () => {
|
|
16674
16677
|
setTimeout(() => {
|
|
16675
16678
|
var y;
|
|
16676
16679
|
(y = g.current) != null && y.contains(document.activeElement) || p(!1);
|
|
@@ -16725,7 +16728,7 @@ ${y}` : y);
|
|
|
16725
16728
|
"div",
|
|
16726
16729
|
{
|
|
16727
16730
|
className: "absolute right-0 top-full mt-1 bg-white border border-neutral-200 rounded-lg shadow-lg z-50 min-w-[180px] py-1",
|
|
16728
|
-
onBlur:
|
|
16731
|
+
onBlur: b,
|
|
16729
16732
|
children: [
|
|
16730
16733
|
/* @__PURE__ */ h.jsxs(
|
|
16731
16734
|
"button",
|
|
@@ -16809,7 +16812,7 @@ function Oy({
|
|
|
16809
16812
|
outputQuality: s = 0.9,
|
|
16810
16813
|
theme: o = "dark"
|
|
16811
16814
|
}) {
|
|
16812
|
-
const l = me(null), a = me(null), u = me(null), [c, d] = O(!0), [f, p] = O(null), [g, m] = O(n), [x,
|
|
16815
|
+
const l = me(null), a = me(null), u = me(null), [c, d] = O(!0), [f, p] = O(null), [g, m] = O(n), [x, b] = O(0), [y, _] = O({ x: 0, y: 0, width: 100, height: 100 }), [C, k] = O(!1), [w, v] = O(null), [E, B] = O({ x: 0, y: 0 }), [A, T] = O({ x: 0, y: 0, width: 100, height: 100 }), F = o === "dark", R = Q(() => {
|
|
16813
16816
|
const Z = u.current;
|
|
16814
16817
|
return Z ? x === 90 || x === 270 ? { width: Z.height, height: Z.width } : { width: Z.width, height: Z.height } : { width: 100, height: 100 };
|
|
16815
16818
|
}, [x]), D = Q((Z, Ee) => {
|
|
@@ -16832,14 +16835,14 @@ function Oy({
|
|
|
16832
16835
|
const N = Q(() => {
|
|
16833
16836
|
const { width: Z, height: Ee } = R(), ie = vi[g];
|
|
16834
16837
|
if (ie === null) {
|
|
16835
|
-
|
|
16838
|
+
_({ x: 0, y: 0, width: 100, height: 100 });
|
|
16836
16839
|
return;
|
|
16837
16840
|
}
|
|
16838
16841
|
const Re = Z / Ee;
|
|
16839
16842
|
let ke, Se;
|
|
16840
16843
|
Re > ie ? (Se = 100, ke = ie / Re * 100) : (ke = 100, Se = Re / ie * 100);
|
|
16841
16844
|
const qe = (100 - ke) / 2, ze = (100 - Se) / 2;
|
|
16842
|
-
|
|
16845
|
+
_({ x: qe, y: ze, width: ke, height: Se });
|
|
16843
16846
|
}, [g, R]);
|
|
16844
16847
|
Te(() => {
|
|
16845
16848
|
u.current && N();
|
|
@@ -16878,22 +16881,22 @@ function Oy({
|
|
|
16878
16881
|
];
|
|
16879
16882
|
for (const ze of qe)
|
|
16880
16883
|
if (Math.abs(Re - ze.x) < Se && Math.abs(ke - ze.y) < Se) {
|
|
16881
|
-
|
|
16884
|
+
v(ze.name), B({ x: Re, y: ke }), T({ ...y });
|
|
16882
16885
|
return;
|
|
16883
16886
|
}
|
|
16884
|
-
Re >= y.x && Re <= y.x + y.width && ke >= y.y && ke <= y.y + y.height && (
|
|
16887
|
+
Re >= y.x && Re <= y.x + y.width && ke >= y.y && ke <= y.y + y.height && (k(!0), B({ x: Re, y: ke }), T({ ...y }));
|
|
16885
16888
|
}, I = (Z) => {
|
|
16886
16889
|
const Ee = a.current;
|
|
16887
16890
|
if (!Ee) return;
|
|
16888
16891
|
const ie = Ee.getBoundingClientRect(), Re = (Z.clientX - ie.left) / ie.width * 100, ke = (Z.clientY - ie.top) / ie.height * 100;
|
|
16889
16892
|
if (C) {
|
|
16890
|
-
const Se = Re -
|
|
16893
|
+
const Se = Re - E.x, qe = ke - E.y;
|
|
16891
16894
|
let ze = A.x + Se, He = A.y + qe;
|
|
16892
|
-
ze = Math.max(0, Math.min(ze, 100 - A.width)), He = Math.max(0, Math.min(He, 100 - A.height)),
|
|
16895
|
+
ze = Math.max(0, Math.min(ze, 100 - A.width)), He = Math.max(0, Math.min(He, 100 - A.height)), _({ ...A, x: ze, y: He });
|
|
16893
16896
|
} else if (w) {
|
|
16894
16897
|
const Se = vi[g], { width: qe, height: ze } = R(), He = qe / ze, Y = Se ? Se / He : null;
|
|
16895
16898
|
let L = { ...A };
|
|
16896
|
-
const xe = Re -
|
|
16899
|
+
const xe = Re - E.x, Ke = ke - E.y;
|
|
16897
16900
|
if (w === "se")
|
|
16898
16901
|
L.width = Math.max(10, Math.min(100 - L.x, A.width + xe)), Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y)) : L.height = Math.max(10, Math.min(100 - L.y, A.height + Ke));
|
|
16899
16902
|
else if (w === "sw") {
|
|
@@ -16918,12 +16921,12 @@ function Oy({
|
|
|
16918
16921
|
vt >= 0 && (L.height = Ge, L.y = vt);
|
|
16919
16922
|
}
|
|
16920
16923
|
}
|
|
16921
|
-
L.x = Math.max(0, L.x), L.y = Math.max(0, L.y), L.width = Math.min(L.width, 100 - L.x), L.height = Math.min(L.height, 100 - L.y),
|
|
16924
|
+
L.x = Math.max(0, L.x), L.y = Math.max(0, L.y), L.width = Math.min(L.width, 100 - L.x), L.height = Math.min(L.height, 100 - L.y), _(L);
|
|
16922
16925
|
}
|
|
16923
16926
|
}, V = () => {
|
|
16924
|
-
|
|
16927
|
+
k(!1), v(null);
|
|
16925
16928
|
}, U = (Z) => {
|
|
16926
|
-
|
|
16929
|
+
b((Ee) => Z === "right" ? (Ee + 90) % 360 : (Ee - 90 + 360) % 360);
|
|
16927
16930
|
}, re = () => {
|
|
16928
16931
|
const Z = u.current;
|
|
16929
16932
|
if (!Z) return;
|
|
@@ -17263,12 +17266,12 @@ function Wg(r, e) {
|
|
|
17263
17266
|
var t = e ? qg : $g, n = this._parents, i = this._groups;
|
|
17264
17267
|
typeof r != "function" && (r = zg(r));
|
|
17265
17268
|
for (var s = i.length, o = new Array(s), l = new Array(s), a = new Array(s), u = 0; u < s; ++u) {
|
|
17266
|
-
var c = n[u], d = i[u], f = d.length, p = Hg(r.call(c, c && c.__data__, u, n)), g = p.length, m = l[u] = new Array(g), x = o[u] = new Array(g),
|
|
17267
|
-
t(c, d, m, x,
|
|
17268
|
-
for (var y = 0,
|
|
17269
|
+
var c = n[u], d = i[u], f = d.length, p = Hg(r.call(c, c && c.__data__, u, n)), g = p.length, m = l[u] = new Array(g), x = o[u] = new Array(g), b = a[u] = new Array(f);
|
|
17270
|
+
t(c, d, m, x, b, p, e);
|
|
17271
|
+
for (var y = 0, _ = 0, C, k; y < g; ++y)
|
|
17269
17272
|
if (C = m[y]) {
|
|
17270
|
-
for (y >=
|
|
17271
|
-
C._next =
|
|
17273
|
+
for (y >= _ && (_ = y + 1); !(k = x[_]) && ++_ < g; ) ;
|
|
17274
|
+
C._next = k || null;
|
|
17272
17275
|
}
|
|
17273
17276
|
}
|
|
17274
17277
|
return o = new Ft(o, n), o._enter = l, o._exit = a, o;
|
|
@@ -18138,27 +18141,27 @@ function Sm(r) {
|
|
|
18138
18141
|
}
|
|
18139
18142
|
const Am = function r(e, t, n) {
|
|
18140
18143
|
function i(s, o) {
|
|
18141
|
-
var l = s[0], a = s[1], u = s[2], c = o[0], d = o[1], f = o[2], p = c - l, g = d - a, m = p * p + g * g, x,
|
|
18144
|
+
var l = s[0], a = s[1], u = s[2], c = o[0], d = o[1], f = o[2], p = c - l, g = d - a, m = p * p + g * g, x, b;
|
|
18142
18145
|
if (m < Em)
|
|
18143
|
-
|
|
18146
|
+
b = Math.log(f / u) / e, x = function(v) {
|
|
18144
18147
|
return [
|
|
18145
|
-
l +
|
|
18146
|
-
a +
|
|
18147
|
-
u * Math.exp(e *
|
|
18148
|
+
l + v * p,
|
|
18149
|
+
a + v * g,
|
|
18150
|
+
u * Math.exp(e * v * b)
|
|
18148
18151
|
];
|
|
18149
18152
|
};
|
|
18150
18153
|
else {
|
|
18151
|
-
var y = Math.sqrt(m),
|
|
18152
|
-
|
|
18153
|
-
var
|
|
18154
|
+
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y), C = (f * f - u * u - n * m) / (2 * f * t * y), k = Math.log(Math.sqrt(_ * _ + 1) - _), w = Math.log(Math.sqrt(C * C + 1) - C);
|
|
18155
|
+
b = (w - k) / e, x = function(v) {
|
|
18156
|
+
var E = v * b, B = Jl(k), A = u / (t * y) * (B * Sm(e * E + k) - km(k));
|
|
18154
18157
|
return [
|
|
18155
18158
|
l + A * p,
|
|
18156
18159
|
a + A * g,
|
|
18157
|
-
u * B / Jl(e *
|
|
18160
|
+
u * B / Jl(e * E + k)
|
|
18158
18161
|
];
|
|
18159
18162
|
};
|
|
18160
18163
|
}
|
|
18161
|
-
return x.duration =
|
|
18164
|
+
return x.duration = b * 1e3 * e / Math.SQRT2, x;
|
|
18162
18165
|
}
|
|
18163
18166
|
return i.rho = function(s) {
|
|
18164
18167
|
var o = Math.max(1e-3, +s), l = o * o, a = l * l;
|
|
@@ -18832,33 +18835,33 @@ function H2(r, e, t) {
|
|
|
18832
18835
|
}
|
|
18833
18836
|
function V2() {
|
|
18834
18837
|
var r = $2, e = q2, t = H2, n = U2, i = W2, s = [0, 1 / 0], o = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], l = 250, a = Am, u = da("start", "zoom", "end"), c, d, f, p = 500, g = 150, m = 0, x = 10;
|
|
18835
|
-
function
|
|
18836
|
-
D.property("__zoom", nu).on("wheel.zoom",
|
|
18838
|
+
function b(D) {
|
|
18839
|
+
D.property("__zoom", nu).on("wheel.zoom", E, { passive: !1 }).on("mousedown.zoom", B).on("dblclick.zoom", A).filter(i).on("touchstart.zoom", T).on("touchmove.zoom", F).on("touchend.zoom touchcancel.zoom", R).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
18837
18840
|
}
|
|
18838
|
-
|
|
18841
|
+
b.transform = function(D, N, M, I) {
|
|
18839
18842
|
var V = D.selection ? D.selection() : D;
|
|
18840
|
-
V.property("__zoom", nu), D !== V ?
|
|
18843
|
+
V.property("__zoom", nu), D !== V ? k(D, N, M, I) : V.interrupt().each(function() {
|
|
18841
18844
|
w(this, arguments).event(I).start().zoom(null, typeof N == "function" ? N.apply(this, arguments) : N).end();
|
|
18842
18845
|
});
|
|
18843
|
-
},
|
|
18844
|
-
|
|
18846
|
+
}, b.scaleBy = function(D, N, M, I) {
|
|
18847
|
+
b.scaleTo(D, function() {
|
|
18845
18848
|
var V = this.__zoom.k, U = typeof N == "function" ? N.apply(this, arguments) : N;
|
|
18846
18849
|
return V * U;
|
|
18847
18850
|
}, M, I);
|
|
18848
|
-
},
|
|
18849
|
-
|
|
18851
|
+
}, b.scaleTo = function(D, N, M, I) {
|
|
18852
|
+
b.transform(D, function() {
|
|
18850
18853
|
var V = e.apply(this, arguments), U = this.__zoom, re = M == null ? C(V) : typeof M == "function" ? M.apply(this, arguments) : M, q = U.invert(re), J = typeof N == "function" ? N.apply(this, arguments) : N;
|
|
18851
|
-
return t(
|
|
18854
|
+
return t(_(y(U, J), re, q), V, o);
|
|
18852
18855
|
}, M, I);
|
|
18853
|
-
},
|
|
18854
|
-
|
|
18856
|
+
}, b.translateBy = function(D, N, M, I) {
|
|
18857
|
+
b.transform(D, function() {
|
|
18855
18858
|
return t(this.__zoom.translate(
|
|
18856
18859
|
typeof N == "function" ? N.apply(this, arguments) : N,
|
|
18857
18860
|
typeof M == "function" ? M.apply(this, arguments) : M
|
|
18858
18861
|
), e.apply(this, arguments), o);
|
|
18859
18862
|
}, null, I);
|
|
18860
|
-
},
|
|
18861
|
-
|
|
18863
|
+
}, b.translateTo = function(D, N, M, I, V) {
|
|
18864
|
+
b.transform(D, function() {
|
|
18862
18865
|
var U = e.apply(this, arguments), re = this.__zoom, q = I == null ? C(U) : typeof I == "function" ? I.apply(this, arguments) : I;
|
|
18863
18866
|
return t(as.translate(q[0], q[1]).scale(re.k).translate(
|
|
18864
18867
|
typeof N == "function" ? -N.apply(this, arguments) : -N,
|
|
@@ -18869,14 +18872,14 @@ function V2() {
|
|
|
18869
18872
|
function y(D, N) {
|
|
18870
18873
|
return N = Math.max(s[0], Math.min(s[1], N)), N === D.k ? D : new lr(N, D.x, D.y);
|
|
18871
18874
|
}
|
|
18872
|
-
function
|
|
18875
|
+
function _(D, N, M) {
|
|
18873
18876
|
var I = N[0] - M[0] * D.k, V = N[1] - M[1] * D.k;
|
|
18874
18877
|
return I === D.x && V === D.y ? D : new lr(D.k, I, V);
|
|
18875
18878
|
}
|
|
18876
18879
|
function C(D) {
|
|
18877
18880
|
return [(+D[0][0] + +D[1][0]) / 2, (+D[0][1] + +D[1][1]) / 2];
|
|
18878
18881
|
}
|
|
18879
|
-
function
|
|
18882
|
+
function k(D, N, M, I) {
|
|
18880
18883
|
D.on("start.zoom", function() {
|
|
18881
18884
|
w(this, arguments).event(I).start();
|
|
18882
18885
|
}).on("interrupt.zoom end.zoom", function() {
|
|
@@ -18894,12 +18897,12 @@ function V2() {
|
|
|
18894
18897
|
});
|
|
18895
18898
|
}
|
|
18896
18899
|
function w(D, N, M) {
|
|
18897
|
-
return !M && D.__zooming || new
|
|
18900
|
+
return !M && D.__zooming || new v(D, N);
|
|
18898
18901
|
}
|
|
18899
|
-
function
|
|
18902
|
+
function v(D, N) {
|
|
18900
18903
|
this.that = D, this.args = N, this.active = 0, this.sourceEvent = null, this.extent = e.apply(D, N), this.taps = 0;
|
|
18901
18904
|
}
|
|
18902
|
-
|
|
18905
|
+
v.prototype = {
|
|
18903
18906
|
event: function(D) {
|
|
18904
18907
|
return D && (this.sourceEvent = D), this;
|
|
18905
18908
|
},
|
|
@@ -18919,7 +18922,7 @@ function V2() {
|
|
|
18919
18922
|
this.that,
|
|
18920
18923
|
new z2(D, {
|
|
18921
18924
|
sourceEvent: this.sourceEvent,
|
|
18922
|
-
target:
|
|
18925
|
+
target: b,
|
|
18923
18926
|
transform: this.that.__zoom,
|
|
18924
18927
|
dispatch: u
|
|
18925
18928
|
}),
|
|
@@ -18927,7 +18930,7 @@ function V2() {
|
|
|
18927
18930
|
);
|
|
18928
18931
|
}
|
|
18929
18932
|
};
|
|
18930
|
-
function
|
|
18933
|
+
function E(D, ...N) {
|
|
18931
18934
|
if (!r.apply(this, arguments)) return;
|
|
18932
18935
|
var M = w(this, N).event(D), I = this.__zoom, V = Math.max(s[0], Math.min(s[1], I.k * Math.pow(2, n.apply(this, arguments)))), U = Sr(D);
|
|
18933
18936
|
if (M.wheel)
|
|
@@ -18936,7 +18939,7 @@ function V2() {
|
|
|
18936
18939
|
if (I.k === V) return;
|
|
18937
18940
|
M.mouse = [U, I.invert(U)], Bi(this), M.start();
|
|
18938
18941
|
}
|
|
18939
|
-
Cn(D), M.wheel = setTimeout(re, g), M.zoom("mouse", t(
|
|
18942
|
+
Cn(D), M.wheel = setTimeout(re, g), M.zoom("mouse", t(_(y(I, V), M.mouse[0], M.mouse[1]), M.extent, o));
|
|
18940
18943
|
function re() {
|
|
18941
18944
|
M.wheel = null, M.end();
|
|
18942
18945
|
}
|
|
@@ -18950,7 +18953,7 @@ function V2() {
|
|
|
18950
18953
|
var ce = se.clientX - re, fe = se.clientY - q;
|
|
18951
18954
|
I.moved = ce * ce + fe * fe > m;
|
|
18952
18955
|
}
|
|
18953
|
-
I.event(se).zoom("mouse", t(
|
|
18956
|
+
I.event(se).zoom("mouse", t(_(I.that.__zoom, I.mouse[0] = Sr(se, M), I.mouse[1]), I.extent, o));
|
|
18954
18957
|
}
|
|
18955
18958
|
function W(se) {
|
|
18956
18959
|
V.on("mousemove.zoom mouseup.zoom", null), rm(se.view, I.moved), Cn(se), I.event(se).end();
|
|
@@ -18958,8 +18961,8 @@ function V2() {
|
|
|
18958
18961
|
}
|
|
18959
18962
|
function A(D, ...N) {
|
|
18960
18963
|
if (r.apply(this, arguments)) {
|
|
18961
|
-
var M = this.__zoom, I = Sr(D.changedTouches ? D.changedTouches[0] : D, this), V = M.invert(I), U = M.k * (D.shiftKey ? 0.5 : 2), re = t(
|
|
18962
|
-
Cn(D), l > 0 ? $t(this).transition().duration(l).call(
|
|
18964
|
+
var M = this.__zoom, I = Sr(D.changedTouches ? D.changedTouches[0] : D, this), V = M.invert(I), U = M.k * (D.shiftKey ? 0.5 : 2), re = t(_(y(M, U), I, V), e.apply(this, N), o);
|
|
18965
|
+
Cn(D), l > 0 ? $t(this).transition().duration(l).call(k, re, I, D) : $t(this).call(b.transform, re, I, D);
|
|
18963
18966
|
}
|
|
18964
18967
|
}
|
|
18965
18968
|
function T(D, ...N) {
|
|
@@ -18982,7 +18985,7 @@ function V2() {
|
|
|
18982
18985
|
re = y(re, Math.sqrt(ge / Ne)), q = [(W[0] + ce[0]) / 2, (W[1] + ce[1]) / 2], J = [(se[0] + fe[0]) / 2, (se[1] + fe[1]) / 2];
|
|
18983
18986
|
} else if (M.touch0) q = M.touch0[0], J = M.touch0[1];
|
|
18984
18987
|
else return;
|
|
18985
|
-
M.zoom("touch", t(
|
|
18988
|
+
M.zoom("touch", t(_(re, q, J), M.extent, o));
|
|
18986
18989
|
}
|
|
18987
18990
|
}
|
|
18988
18991
|
function R(D, ...N) {
|
|
@@ -18999,32 +19002,32 @@ function V2() {
|
|
|
18999
19002
|
}
|
|
19000
19003
|
}
|
|
19001
19004
|
}
|
|
19002
|
-
return
|
|
19003
|
-
return arguments.length ? (n = typeof D == "function" ? D : Ei(+D),
|
|
19004
|
-
},
|
|
19005
|
-
return arguments.length ? (r = typeof D == "function" ? D : Ei(!!D),
|
|
19006
|
-
},
|
|
19007
|
-
return arguments.length ? (i = typeof D == "function" ? D : Ei(!!D),
|
|
19008
|
-
},
|
|
19009
|
-
return arguments.length ? (e = typeof D == "function" ? D : Ei([[+D[0][0], +D[0][1]], [+D[1][0], +D[1][1]]]),
|
|
19010
|
-
},
|
|
19011
|
-
return arguments.length ? (s[0] = +D[0], s[1] = +D[1],
|
|
19012
|
-
},
|
|
19013
|
-
return arguments.length ? (o[0][0] = +D[0][0], o[1][0] = +D[1][0], o[0][1] = +D[0][1], o[1][1] = +D[1][1],
|
|
19014
|
-
},
|
|
19015
|
-
return arguments.length ? (t = D,
|
|
19016
|
-
},
|
|
19017
|
-
return arguments.length ? (l = +D,
|
|
19018
|
-
},
|
|
19019
|
-
return arguments.length ? (a = D,
|
|
19020
|
-
},
|
|
19005
|
+
return b.wheelDelta = function(D) {
|
|
19006
|
+
return arguments.length ? (n = typeof D == "function" ? D : Ei(+D), b) : n;
|
|
19007
|
+
}, b.filter = function(D) {
|
|
19008
|
+
return arguments.length ? (r = typeof D == "function" ? D : Ei(!!D), b) : r;
|
|
19009
|
+
}, b.touchable = function(D) {
|
|
19010
|
+
return arguments.length ? (i = typeof D == "function" ? D : Ei(!!D), b) : i;
|
|
19011
|
+
}, b.extent = function(D) {
|
|
19012
|
+
return arguments.length ? (e = typeof D == "function" ? D : Ei([[+D[0][0], +D[0][1]], [+D[1][0], +D[1][1]]]), b) : e;
|
|
19013
|
+
}, b.scaleExtent = function(D) {
|
|
19014
|
+
return arguments.length ? (s[0] = +D[0], s[1] = +D[1], b) : [s[0], s[1]];
|
|
19015
|
+
}, b.translateExtent = function(D) {
|
|
19016
|
+
return arguments.length ? (o[0][0] = +D[0][0], o[1][0] = +D[1][0], o[0][1] = +D[0][1], o[1][1] = +D[1][1], b) : [[o[0][0], o[0][1]], [o[1][0], o[1][1]]];
|
|
19017
|
+
}, b.constrain = function(D) {
|
|
19018
|
+
return arguments.length ? (t = D, b) : t;
|
|
19019
|
+
}, b.duration = function(D) {
|
|
19020
|
+
return arguments.length ? (l = +D, b) : l;
|
|
19021
|
+
}, b.interpolate = function(D) {
|
|
19022
|
+
return arguments.length ? (a = D, b) : a;
|
|
19023
|
+
}, b.on = function() {
|
|
19021
19024
|
var D = u.on.apply(u, arguments);
|
|
19022
|
-
return D === u ?
|
|
19023
|
-
},
|
|
19024
|
-
return arguments.length ? (m = (D = +D) * D,
|
|
19025
|
-
},
|
|
19026
|
-
return arguments.length ? (x = +D,
|
|
19027
|
-
},
|
|
19025
|
+
return D === u ? b : D;
|
|
19026
|
+
}, b.clickDistance = function(D) {
|
|
19027
|
+
return arguments.length ? (m = (D = +D) * D, b) : Math.sqrt(m);
|
|
19028
|
+
}, b.tapDistance = function(D) {
|
|
19029
|
+
return arguments.length ? (x = +D, b) : x;
|
|
19030
|
+
}, b;
|
|
19028
19031
|
}
|
|
19029
19032
|
function G2(r = {}) {
|
|
19030
19033
|
const {
|
|
@@ -19040,50 +19043,50 @@ function G2(r = {}) {
|
|
|
19040
19043
|
Te(() => {
|
|
19041
19044
|
if (!l.current) return;
|
|
19042
19045
|
const x = V2().scaleExtent([e, t]).filter((y) => !i && y.type === "wheel" || !s && (y.type === "mousedown" || y.type === "touchstart") ? !1 : y.type === "wheel" ? i : y.type === "mousedown" || y.type === "touchstart" ? y.target.closest("[data-qmap-node]") ? !1 : s : !0).on("zoom", (y) => {
|
|
19043
|
-
const
|
|
19046
|
+
const _ = {
|
|
19044
19047
|
x: y.transform.x,
|
|
19045
19048
|
y: y.transform.y,
|
|
19046
19049
|
k: y.transform.k
|
|
19047
19050
|
};
|
|
19048
|
-
c(
|
|
19051
|
+
c(_), o == null || o(_);
|
|
19049
19052
|
});
|
|
19050
19053
|
a.current = x;
|
|
19051
|
-
const
|
|
19052
|
-
return
|
|
19054
|
+
const b = $t(l.current);
|
|
19055
|
+
return b.call(x), b.on("dblclick.zoom", null), n && b.call(
|
|
19053
19056
|
x.transform,
|
|
19054
19057
|
as.translate(n.x, n.y).scale(n.k)
|
|
19055
19058
|
), () => {
|
|
19056
|
-
|
|
19059
|
+
b.on(".zoom", null);
|
|
19057
19060
|
};
|
|
19058
19061
|
}, [e, t, i, s]), Te(() => {
|
|
19059
19062
|
a.current && a.current.on("zoom", (x) => {
|
|
19060
|
-
const
|
|
19063
|
+
const b = {
|
|
19061
19064
|
x: x.transform.x,
|
|
19062
19065
|
y: x.transform.y,
|
|
19063
19066
|
k: x.transform.k
|
|
19064
19067
|
};
|
|
19065
|
-
c(
|
|
19068
|
+
c(b), o == null || o(b);
|
|
19066
19069
|
});
|
|
19067
19070
|
}, [o]);
|
|
19068
|
-
const d = Q((x,
|
|
19071
|
+
const d = Q((x, b, y, _ = !0) => {
|
|
19069
19072
|
if (!l.current || !a.current) return;
|
|
19070
|
-
const C = $t(l.current),
|
|
19071
|
-
C.call(a.current.transform,
|
|
19073
|
+
const C = $t(l.current), k = as.translate(x, b).scale(y);
|
|
19074
|
+
C.call(a.current.transform, k);
|
|
19072
19075
|
}, []), f = Q(() => {
|
|
19073
19076
|
!l.current || !a.current || $t(l.current).call(a.current.scaleBy, 1.3);
|
|
19074
19077
|
}, []), p = Q(() => {
|
|
19075
19078
|
!l.current || !a.current || $t(l.current).call(a.current.scaleBy, 0.7);
|
|
19076
19079
|
}, []), g = Q(() => {
|
|
19077
19080
|
d(0, 0, 1, !0);
|
|
19078
|
-
}, [d]), m = Q((x,
|
|
19081
|
+
}, [d]), m = Q((x, b = 50) => {
|
|
19079
19082
|
if (!l.current || !a.current || x.length === 0) return;
|
|
19080
|
-
const
|
|
19081
|
-
let C = 1 / 0,
|
|
19083
|
+
const _ = l.current.getBoundingClientRect();
|
|
19084
|
+
let C = 1 / 0, k = 1 / 0, w = -1 / 0, v = -1 / 0;
|
|
19082
19085
|
for (const I of x) {
|
|
19083
19086
|
const V = I.width || 200, U = I.height || 100;
|
|
19084
|
-
C = Math.min(C, I.x),
|
|
19087
|
+
C = Math.min(C, I.x), k = Math.min(k, I.y), w = Math.max(w, I.x + V), v = Math.max(v, I.y + U);
|
|
19085
19088
|
}
|
|
19086
|
-
const
|
|
19089
|
+
const E = w - C, B = v - k, A = (_.width - b * 2) / E, T = (_.height - b * 2) / B, F = Math.min(A, T, t), R = (C + w) / 2, D = (k + v) / 2, N = _.width / 2 - R * F, M = _.height / 2 - D * F;
|
|
19087
19090
|
d(N, M, F, !0);
|
|
19088
19091
|
}, [t, d]);
|
|
19089
19092
|
return {
|
|
@@ -19107,47 +19110,47 @@ function K2(r) {
|
|
|
19107
19110
|
Te(() => {
|
|
19108
19111
|
g.current = e;
|
|
19109
19112
|
}, [e]);
|
|
19110
|
-
const m = Q((
|
|
19111
|
-
const
|
|
19113
|
+
const m = Q((_, C) => {
|
|
19114
|
+
const k = g.current;
|
|
19112
19115
|
return {
|
|
19113
|
-
x: (
|
|
19114
|
-
y: (C -
|
|
19116
|
+
x: (_ - k.x) / k.k,
|
|
19117
|
+
y: (C - k.y) / k.k
|
|
19115
19118
|
};
|
|
19116
|
-
}, []), x = Q((
|
|
19119
|
+
}, []), x = Q((_, C) => {
|
|
19117
19120
|
if (s) return;
|
|
19118
19121
|
C.preventDefault(), C.stopPropagation();
|
|
19119
|
-
const
|
|
19122
|
+
const k = C.currentTarget, w = parseFloat(k.dataset.x || "0"), v = parseFloat(k.dataset.y || "0");
|
|
19120
19123
|
f.current = {
|
|
19121
19124
|
x: C.clientX,
|
|
19122
19125
|
y: C.clientY,
|
|
19123
19126
|
nodeX: w,
|
|
19124
|
-
nodeY:
|
|
19125
|
-
}, p.current = { x: w, y:
|
|
19126
|
-
}, [s, m, t]),
|
|
19127
|
+
nodeY: v
|
|
19128
|
+
}, p.current = { x: w, y: v }, l(_), u(!0), d({ x: 0, y: 0 }), t == null || t(_);
|
|
19129
|
+
}, [s, m, t]), b = Q((_) => {
|
|
19127
19130
|
if (!a || !o || !f.current) return;
|
|
19128
|
-
const C = g.current,
|
|
19129
|
-
p.current = { x: A, y: T }, d({ x:
|
|
19131
|
+
const C = g.current, k = f.current, w = _.clientX - k.x, v = _.clientY - k.y, E = w / C.k, B = v / C.k, A = k.nodeX + E, T = k.nodeY + B;
|
|
19132
|
+
p.current = { x: A, y: T }, d({ x: E, y: B }), n == null || n(o, A, T, E, B);
|
|
19130
19133
|
}, [a, o, n]), y = Q(() => {
|
|
19131
19134
|
if (!a || !o) return;
|
|
19132
|
-
const
|
|
19133
|
-
i == null || i(o,
|
|
19135
|
+
const _ = p.current;
|
|
19136
|
+
i == null || i(o, _.x, _.y), l(null), u(!1), d({ x: 0, y: 0 }), f.current = null;
|
|
19134
19137
|
}, [a, o, i]);
|
|
19135
19138
|
return Te(() => {
|
|
19136
19139
|
if (!a) return;
|
|
19137
|
-
const
|
|
19138
|
-
|
|
19140
|
+
const _ = (k) => {
|
|
19141
|
+
b(k);
|
|
19139
19142
|
}, C = () => {
|
|
19140
19143
|
y();
|
|
19141
19144
|
};
|
|
19142
|
-
return window.addEventListener("mousemove",
|
|
19143
|
-
window.removeEventListener("mousemove",
|
|
19145
|
+
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", C), () => {
|
|
19146
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", C);
|
|
19144
19147
|
};
|
|
19145
|
-
}, [a,
|
|
19148
|
+
}, [a, b, y]), {
|
|
19146
19149
|
draggedNodeId: o,
|
|
19147
19150
|
isDragging: a,
|
|
19148
19151
|
dragOffset: c,
|
|
19149
19152
|
startDrag: x,
|
|
19150
|
-
updateDrag:
|
|
19153
|
+
updateDrag: b,
|
|
19151
19154
|
endDrag: y
|
|
19152
19155
|
};
|
|
19153
19156
|
}
|
|
@@ -19161,11 +19164,11 @@ function Y2(r) {
|
|
|
19161
19164
|
} = r, [o, l] = O(/* @__PURE__ */ new Set()), a = i !== void 0, u = a ? new Set(i) : o, c = a ? (A) => {
|
|
19162
19165
|
const T = typeof A == "function" ? A(u) : A;
|
|
19163
19166
|
s == null || s(Array.from(T));
|
|
19164
|
-
} : l, [d, f] = O(null), [p, g] = O(!1), m = me(null), x = me(e),
|
|
19167
|
+
} : l, [d, f] = O(null), [p, g] = O(!1), m = me(null), x = me(e), b = me(t);
|
|
19165
19168
|
Te(() => {
|
|
19166
19169
|
x.current = e;
|
|
19167
19170
|
}, [e]), Te(() => {
|
|
19168
|
-
|
|
19171
|
+
b.current = t;
|
|
19169
19172
|
}, [t]);
|
|
19170
19173
|
const y = Q((A, T) => {
|
|
19171
19174
|
const F = x.current;
|
|
@@ -19173,8 +19176,8 @@ function Y2(r) {
|
|
|
19173
19176
|
x: (A - F.x) / F.k,
|
|
19174
19177
|
y: (T - F.y) / F.k
|
|
19175
19178
|
};
|
|
19176
|
-
}, []),
|
|
19177
|
-
const F =
|
|
19179
|
+
}, []), _ = Q((A, T) => {
|
|
19180
|
+
const F = b.current.get(A);
|
|
19178
19181
|
if (!F) return !1;
|
|
19179
19182
|
const R = F.width || 200, D = F.height || 100;
|
|
19180
19183
|
return F.x < T.x + T.width && F.x + R > T.x && F.y < T.y + T.height && F.y + D > T.y;
|
|
@@ -19188,7 +19191,7 @@ function Y2(r) {
|
|
|
19188
19191
|
width: 0,
|
|
19189
19192
|
height: 0
|
|
19190
19193
|
}), g(!0), A.shiftKey || c(/* @__PURE__ */ new Set());
|
|
19191
|
-
}, [n, y]),
|
|
19194
|
+
}, [n, y]), k = Q((A) => {
|
|
19192
19195
|
if (!p || !m.current) return;
|
|
19193
19196
|
const T = m.current, F = y(A.clientX, A.clientY), R = {
|
|
19194
19197
|
x: Math.min(T.x, F.x),
|
|
@@ -19198,30 +19201,30 @@ function Y2(r) {
|
|
|
19198
19201
|
};
|
|
19199
19202
|
f(R);
|
|
19200
19203
|
const D = /* @__PURE__ */ new Set();
|
|
19201
|
-
for (const [N] of
|
|
19202
|
-
|
|
19204
|
+
for (const [N] of b.current)
|
|
19205
|
+
_(N, R) && D.add(N);
|
|
19203
19206
|
c(D);
|
|
19204
|
-
}, [p, y,
|
|
19207
|
+
}, [p, y, _]), w = Q(() => {
|
|
19205
19208
|
p && (s == null || s(Array.from(u)), g(!1), f(null), m.current = null);
|
|
19206
19209
|
}, [p, u, s]);
|
|
19207
19210
|
Te(() => {
|
|
19208
19211
|
if (!p) return;
|
|
19209
19212
|
const A = (F) => {
|
|
19210
|
-
|
|
19213
|
+
k(F);
|
|
19211
19214
|
}, T = () => {
|
|
19212
19215
|
w();
|
|
19213
19216
|
};
|
|
19214
19217
|
return window.addEventListener("mousemove", A), window.addEventListener("mouseup", T), () => {
|
|
19215
19218
|
window.removeEventListener("mousemove", A), window.removeEventListener("mouseup", T);
|
|
19216
19219
|
};
|
|
19217
|
-
}, [p,
|
|
19218
|
-
const
|
|
19220
|
+
}, [p, k, w]);
|
|
19221
|
+
const v = Q((A, T = !1) => {
|
|
19219
19222
|
c((F) => {
|
|
19220
19223
|
const R = new Set(T ? F : []);
|
|
19221
19224
|
return F.has(A) && T ? R.delete(A) : R.add(A), s == null || s(Array.from(R)), R;
|
|
19222
19225
|
});
|
|
19223
|
-
}, [s]),
|
|
19224
|
-
const A = new Set(
|
|
19226
|
+
}, [s]), E = Q(() => {
|
|
19227
|
+
const A = new Set(b.current.keys());
|
|
19225
19228
|
c(A), s == null || s(Array.from(A));
|
|
19226
19229
|
}, [s]), B = Q(() => {
|
|
19227
19230
|
c(/* @__PURE__ */ new Set()), s == null || s([]);
|
|
@@ -19232,10 +19235,10 @@ function Y2(r) {
|
|
|
19232
19235
|
selectionBox: d,
|
|
19233
19236
|
isSelecting: p,
|
|
19234
19237
|
startSelection: C,
|
|
19235
|
-
updateSelection:
|
|
19238
|
+
updateSelection: k,
|
|
19236
19239
|
endSelection: w,
|
|
19237
|
-
toggleSelect:
|
|
19238
|
-
selectAll:
|
|
19240
|
+
toggleSelect: v,
|
|
19241
|
+
selectAll: E,
|
|
19239
19242
|
clearSelection: B
|
|
19240
19243
|
};
|
|
19241
19244
|
}
|
|
@@ -19259,7 +19262,7 @@ const Q2 = us(function({
|
|
|
19259
19262
|
y.stopPropagation(), a == null || a(y);
|
|
19260
19263
|
}, [a]), g = Q((y) => {
|
|
19261
19264
|
y.preventDefault(), y.stopPropagation(), u == null || u(y);
|
|
19262
|
-
}, [u]), m = t.width || 200, x = t.height || 100,
|
|
19265
|
+
}, [u]), m = t.width || 200, x = t.height || 100, b = t.rotation || 0;
|
|
19263
19266
|
return /* @__PURE__ */ h.jsx(
|
|
19264
19267
|
"div",
|
|
19265
19268
|
{
|
|
@@ -19272,7 +19275,7 @@ const Q2 = us(function({
|
|
|
19272
19275
|
top: t.y,
|
|
19273
19276
|
width: m,
|
|
19274
19277
|
height: x,
|
|
19275
|
-
transform:
|
|
19278
|
+
transform: b !== 0 ? `rotate(${b}deg)` : void 0,
|
|
19276
19279
|
transformOrigin: "center center",
|
|
19277
19280
|
cursor: s ? i ? "grabbing" : "grab" : "pointer",
|
|
19278
19281
|
userSelect: "none",
|
|
@@ -19387,7 +19390,7 @@ const ey = us(function({
|
|
|
19387
19390
|
width: o,
|
|
19388
19391
|
onClick: l
|
|
19389
19392
|
}) {
|
|
19390
|
-
const [a, u] = O(!1), c =
|
|
19393
|
+
const [a, u] = O(!1), c = ct(() => X2(t, n, i), [t, n, i]), d = Q((x) => {
|
|
19391
19394
|
x.stopPropagation(), l == null || l(e, x);
|
|
19392
19395
|
}, [e, l]), f = Q(() => {
|
|
19393
19396
|
u(!0);
|
|
@@ -19437,7 +19440,7 @@ const ey = us(function({
|
|
|
19437
19440
|
] });
|
|
19438
19441
|
}, (r, e) => r.edge.id === e.edge.id && r.sourcePosition.x === e.sourcePosition.x && r.sourcePosition.y === e.sourcePosition.y && r.sourcePosition.width === e.sourcePosition.width && r.sourcePosition.height === e.sourcePosition.height && r.targetPosition.x === e.targetPosition.x && r.targetPosition.y === e.targetPosition.y && r.targetPosition.width === e.targetPosition.width && r.targetPosition.height === e.targetPosition.height && r.style === e.style && r.color === e.color && r.width === e.width && r.edge.label === e.edge.label && r.edge.color === e.edge.color && r.edge.width === e.edge.width);
|
|
19439
19442
|
function ty({ pathD: r, label: e, color: t }) {
|
|
19440
|
-
const n =
|
|
19443
|
+
const n = ct(() => `edge-label-${Math.random().toString(36).substr(2, 9)}`, []);
|
|
19441
19444
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
19442
19445
|
/* @__PURE__ */ h.jsx("defs", { children: /* @__PURE__ */ h.jsx("path", { id: n, d: r }) }),
|
|
19443
19446
|
/* @__PURE__ */ h.jsx(
|
|
@@ -19468,15 +19471,7 @@ const ry = us(function({
|
|
|
19468
19471
|
defaultWidth: s,
|
|
19469
19472
|
onEdgeClick: o
|
|
19470
19473
|
}) {
|
|
19471
|
-
const l =
|
|
19472
|
-
if (t.size === 0) return "0 0 1000 1000";
|
|
19473
|
-
let u = 1 / 0, c = 1 / 0, d = -1 / 0, f = -1 / 0;
|
|
19474
|
-
for (const p of t.values()) {
|
|
19475
|
-
const g = p.width || 200, m = p.height || 100;
|
|
19476
|
-
u = Math.min(u, p.x - 100), c = Math.min(c, p.y - 100), d = Math.max(d, p.x + g + 100), f = Math.max(f, p.y + m + 100);
|
|
19477
|
-
}
|
|
19478
|
-
return u -= 1e3, c -= 1e3, d += 1e3, f += 1e3, `${u} ${c} ${d - u} ${f - c}`;
|
|
19479
|
-
}, [t]);
|
|
19474
|
+
const l = ct(() => e.filter((a) => t.has(a.source) && t.has(a.target)), [e, t]);
|
|
19480
19475
|
return /* @__PURE__ */ h.jsx(
|
|
19481
19476
|
"svg",
|
|
19482
19477
|
{
|
|
@@ -19484,27 +19479,25 @@ const ry = us(function({
|
|
|
19484
19479
|
position: "absolute",
|
|
19485
19480
|
top: 0,
|
|
19486
19481
|
left: 0,
|
|
19487
|
-
width:
|
|
19488
|
-
height:
|
|
19482
|
+
width: 1,
|
|
19483
|
+
height: 1,
|
|
19489
19484
|
overflow: "visible",
|
|
19490
19485
|
pointerEvents: "none"
|
|
19491
19486
|
},
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
children: /* @__PURE__ */ h.jsx("g", { style: { pointerEvents: "auto" }, children: l.map((u) => {
|
|
19495
|
-
const c = t.get(u.source), d = t.get(u.target);
|
|
19487
|
+
children: /* @__PURE__ */ h.jsx("g", { style: { pointerEvents: "auto" }, children: l.map((a) => {
|
|
19488
|
+
const u = t.get(a.source), c = t.get(a.target);
|
|
19496
19489
|
return /* @__PURE__ */ h.jsx(
|
|
19497
19490
|
ey,
|
|
19498
19491
|
{
|
|
19499
|
-
edge:
|
|
19500
|
-
sourcePosition:
|
|
19501
|
-
targetPosition:
|
|
19502
|
-
style:
|
|
19503
|
-
color:
|
|
19504
|
-
width:
|
|
19492
|
+
edge: a,
|
|
19493
|
+
sourcePosition: u,
|
|
19494
|
+
targetPosition: c,
|
|
19495
|
+
style: a.style || n,
|
|
19496
|
+
color: a.color || i,
|
|
19497
|
+
width: a.width || s,
|
|
19505
19498
|
onClick: o
|
|
19506
19499
|
},
|
|
19507
|
-
|
|
19500
|
+
a.id
|
|
19508
19501
|
);
|
|
19509
19502
|
}) })
|
|
19510
19503
|
}
|
|
@@ -19513,7 +19506,7 @@ const ry = us(function({
|
|
|
19513
19506
|
box: e,
|
|
19514
19507
|
transform: t
|
|
19515
19508
|
}) {
|
|
19516
|
-
const n =
|
|
19509
|
+
const n = ct(() => ({
|
|
19517
19510
|
x: e.x * t.k + t.x,
|
|
19518
19511
|
y: e.y * t.k + t.y,
|
|
19519
19512
|
width: e.width * t.k,
|
|
@@ -19555,21 +19548,21 @@ function Vy({
|
|
|
19555
19548
|
onTransformChange: g,
|
|
19556
19549
|
minZoom: m = uy,
|
|
19557
19550
|
maxZoom: x = cy,
|
|
19558
|
-
initialTransform:
|
|
19551
|
+
initialTransform: b,
|
|
19559
19552
|
defaultEdgeStyle: y = oy,
|
|
19560
|
-
defaultEdgeColor:
|
|
19553
|
+
defaultEdgeColor: _ = ay,
|
|
19561
19554
|
defaultEdgeWidth: C = ly,
|
|
19562
|
-
draggable:
|
|
19555
|
+
draggable: k = !0,
|
|
19563
19556
|
selectable: w = !0,
|
|
19564
|
-
zoomable:
|
|
19565
|
-
pannable:
|
|
19557
|
+
zoomable: v = !0,
|
|
19558
|
+
pannable: E = !0,
|
|
19566
19559
|
className: B = "",
|
|
19567
19560
|
style: A,
|
|
19568
19561
|
background: T = "#f8fafc",
|
|
19569
19562
|
showGrid: F = !1,
|
|
19570
19563
|
gridSize: R = 20
|
|
19571
19564
|
}) {
|
|
19572
|
-
const D = r.data || { positions: {} }, N = D.positions || {}, M =
|
|
19565
|
+
const D = r.data || { positions: {} }, N = D.positions || {}, M = ct(() => {
|
|
19573
19566
|
const Y = /* @__PURE__ */ new Map();
|
|
19574
19567
|
for (const L of e) {
|
|
19575
19568
|
const xe = N[L._id] || { x: 0, y: 0 };
|
|
@@ -19593,9 +19586,9 @@ function Vy({
|
|
|
19593
19586
|
} = G2({
|
|
19594
19587
|
minZoom: m,
|
|
19595
19588
|
maxZoom: x,
|
|
19596
|
-
initialTransform:
|
|
19597
|
-
zoomable:
|
|
19598
|
-
pannable:
|
|
19589
|
+
initialTransform: b || D.transform,
|
|
19590
|
+
zoomable: v,
|
|
19591
|
+
pannable: E,
|
|
19599
19592
|
onTransformChange: (Y) => {
|
|
19600
19593
|
g == null || g(Y);
|
|
19601
19594
|
const L = {
|
|
@@ -19611,7 +19604,7 @@ function Vy({
|
|
|
19611
19604
|
// endDrag - handled internally by hook
|
|
19612
19605
|
} = K2({
|
|
19613
19606
|
transform: I,
|
|
19614
|
-
disabled: !
|
|
19607
|
+
disabled: !k,
|
|
19615
19608
|
onDragStart: (Y) => {
|
|
19616
19609
|
const L = M.get(Y);
|
|
19617
19610
|
L && se(/* @__PURE__ */ new Map([[Y, { x: L.x, y: L.y }]]));
|
|
@@ -19639,7 +19632,7 @@ function Vy({
|
|
|
19639
19632
|
}), Re = Q((Y) => {
|
|
19640
19633
|
const L = M.get(Y) || { x: 0, y: 0, width: i, height: s }, xe = W.get(Y);
|
|
19641
19634
|
return xe ? { ...L, x: xe.x, y: xe.y } : L;
|
|
19642
|
-
}, [M, W, i, s]), ke =
|
|
19635
|
+
}, [M, W, i, s]), ke = ct(() => {
|
|
19643
19636
|
const Y = /* @__PURE__ */ new Map();
|
|
19644
19637
|
for (const L of M.keys())
|
|
19645
19638
|
Y.set(L, Re(L));
|
|
@@ -19667,7 +19660,7 @@ function Vy({
|
|
|
19667
19660
|
background: T,
|
|
19668
19661
|
backgroundImage: He,
|
|
19669
19662
|
backgroundSize: F ? `${R}px ${R}px` : void 0,
|
|
19670
|
-
cursor: _e ? "crosshair" :
|
|
19663
|
+
cursor: _e ? "crosshair" : E ? "grab" : "default",
|
|
19671
19664
|
...A
|
|
19672
19665
|
},
|
|
19673
19666
|
onMouseDown: ze,
|
|
@@ -19690,7 +19683,7 @@ function Vy({
|
|
|
19690
19683
|
edges: t,
|
|
19691
19684
|
nodePositions: ke,
|
|
19692
19685
|
defaultStyle: y,
|
|
19693
|
-
defaultColor:
|
|
19686
|
+
defaultColor: _,
|
|
19694
19687
|
defaultWidth: C,
|
|
19695
19688
|
onEdgeClick: f
|
|
19696
19689
|
}
|
|
@@ -19704,7 +19697,7 @@ function Vy({
|
|
|
19704
19697
|
position: L,
|
|
19705
19698
|
isSelected: xe,
|
|
19706
19699
|
isDragging: Ke,
|
|
19707
|
-
draggable:
|
|
19700
|
+
draggable: k,
|
|
19708
19701
|
onDragStart: fe,
|
|
19709
19702
|
onClick: (z) => Se(Y, z),
|
|
19710
19703
|
onDoubleClick: (z) => a == null ? void 0 : a(Y, z),
|