@qwanyx/stack 0.2.61 → 0.2.62

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.esm.js CHANGED
@@ -2,9 +2,9 @@ var qa = Object.defineProperty;
2
2
  var Ua = (r, e, t) => e in r ? qa(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var wt = (r, e, t) => Ua(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as Bs from "react";
5
- import tt, { useState as K, useCallback as re, useEffect as De, useMemo as St, useRef as ye, createContext as Wa, useContext as Ga, useLayoutEffect as $r, Suspense as Va, forwardRef as pl } from "react";
5
+ import tt, { useState as K, useCallback as re, useEffect as De, useMemo as Et, useRef as ye, createContext as Wa, useContext as Ga, useLayoutEffect as $r, Suspense as Va, forwardRef as pl } from "react";
6
6
  import { flushSync as Ka, createPortal as Ha } from "react-dom";
7
- class Ef {
7
+ class Sf {
8
8
  constructor(e) {
9
9
  wt(this, "config");
10
10
  // ===== FILE OPERATIONS =====
@@ -3630,10 +3630,10 @@ class pu {
3630
3630
  for (const h of c.messages)
3631
3631
  h.uid && d.set(h.uid, h);
3632
3632
  const f = a.map((h) => {
3633
- var A, C, E, y, b;
3633
+ var A, C, S, y, b;
3634
3634
  const g = d.get(h);
3635
3635
  if (!g) return null;
3636
- const m = ((A = g.flags) == null ? void 0 : A.some((D) => D.includes("Seen"))) || !1, _ = ((E = (C = g.envelope) == null ? void 0 : C.from) == null ? void 0 : E.email) || "Unknown", w = ((y = g.envelope) == null ? void 0 : y.subject) || "(No subject)", v = ((b = g.envelope) == null ? void 0 : b.date) || "";
3636
+ const m = ((A = g.flags) == null ? void 0 : A.some((D) => D.includes("Seen"))) || !1, _ = ((S = (C = g.envelope) == null ? void 0 : C.from) == null ? void 0 : S.email) || "Unknown", w = ((y = g.envelope) == null ? void 0 : y.subject) || "(No subject)", v = ((b = g.envelope) == null ? void 0 : b.date) || "";
3637
3637
  return { uid: h, from: _, subject: w, date: v, seen: m };
3638
3638
  }).filter(Boolean);
3639
3639
  return {
@@ -3697,12 +3697,12 @@ class pu {
3697
3697
  const c = /* @__PURE__ */ new Map();
3698
3698
  for (const C of u.attachments || [])
3699
3699
  if (C.contentId) {
3700
- const E = this.contentToBase64(C.content), y = `data:${C.mimeType};base64,${E}`, b = C.contentId.replace(/^<|>$/g, "");
3700
+ const S = this.contentToBase64(C.content), y = `data:${C.mimeType};base64,${S}`, b = C.contentId.replace(/^<|>$/g, "");
3701
3701
  c.set(b, y), c.set(`<${b}>`, y);
3702
3702
  }
3703
3703
  let d = u.html || "";
3704
- d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C, E) => {
3705
- const y = c.get(E) || c.get(`<${E}>`);
3704
+ d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C, S) => {
3705
+ const y = c.get(S) || c.get(`<${S}>`);
3706
3706
  return y ? `src="${y}"` : C;
3707
3707
  }));
3708
3708
  const f = ((w = i.flags) == null ? void 0 : w.some((C) => C.toLowerCase().includes("seen"))) || !1, h = ((v = u.from) == null ? void 0 : v.address) || ((A = u.from) == null ? void 0 : A.name) || "Unknown";
@@ -3950,7 +3950,7 @@ class mu {
3950
3950
  }
3951
3951
  }
3952
3952
  let Gn = null;
3953
- function Sf(r) {
3953
+ function Ef(r) {
3954
3954
  return Gn = new mu(r), Gn;
3955
3955
  }
3956
3956
  function yl() {
@@ -4092,14 +4092,14 @@ function _u() {
4092
4092
  me.unshift("Warning: " + L), Function.prototype.apply.call(console[x], console, me);
4093
4093
  }
4094
4094
  }
4095
- var C = !1, E = !1, y = !1, b = !1, D = !1, S;
4096
- S = Symbol.for("react.module.reference");
4095
+ var C = !1, S = !1, y = !1, b = !1, D = !1, E;
4096
+ E = Symbol.for("react.module.reference");
4097
4097
  function M(x) {
4098
- return !!(typeof x == "string" || typeof x == "function" || x === n || x === o || D || x === s || x === u || x === c || b || x === h || C || E || y || typeof x == "object" && x !== null && (x.$$typeof === f || x.$$typeof === d || x.$$typeof === i || x.$$typeof === l || x.$$typeof === a || // This needs to include all possible module reference object
4098
+ return !!(typeof x == "string" || typeof x == "function" || x === n || x === o || D || x === s || x === u || x === c || b || x === h || C || S || y || typeof x == "object" && x !== null && (x.$$typeof === f || x.$$typeof === d || x.$$typeof === i || x.$$typeof === l || x.$$typeof === a || // This needs to include all possible module reference object
4099
4099
  // types supported by any Flight configuration anywhere since
4100
4100
  // we don't know which Flight build this will end up being used
4101
4101
  // with.
4102
- x.$$typeof === S || x.getModuleId !== void 0));
4102
+ x.$$typeof === E || x.getModuleId !== void 0));
4103
4103
  }
4104
4104
  function T(x, L, q) {
4105
4105
  var Y = x.displayName;
@@ -4305,7 +4305,7 @@ function _u() {
4305
4305
  } finally {
4306
4306
  ue = !1, ge.current = me, ke(), Error.prepareStackTrace = le;
4307
4307
  }
4308
- var Er = x ? x.displayName || x.name : "", dr = Er ? Le(Er) : "";
4308
+ var Sr = x ? x.displayName || x.name : "", dr = Sr ? Le(Sr) : "";
4309
4309
  return typeof x == "function" && Me.set(x, dr), dr;
4310
4310
  }
4311
4311
  function Wt(x, L, q) {
@@ -4381,7 +4381,7 @@ function _u() {
4381
4381
  return q;
4382
4382
  }
4383
4383
  }
4384
- function Ee(x) {
4384
+ function Se(x) {
4385
4385
  try {
4386
4386
  return Be(x), !1;
4387
4387
  } catch {
@@ -4392,7 +4392,7 @@ function _u() {
4392
4392
  return "" + x;
4393
4393
  }
4394
4394
  function Te(x) {
4395
- if (Ee(x))
4395
+ if (Se(x))
4396
4396
  return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", U(x)), Be(x);
4397
4397
  }
4398
4398
  var Lt = w.ReactCurrentOwner, Rt = {
@@ -4517,7 +4517,7 @@ Check the render method of \`` + x + "`.";
4517
4517
  function fe(x) {
4518
4518
  return "";
4519
4519
  }
4520
- var Se = {};
4520
+ var Ee = {};
4521
4521
  function te(x) {
4522
4522
  {
4523
4523
  var L = ee();
@@ -4536,9 +4536,9 @@ Check the top-level render call using <` + q + ">.");
4536
4536
  return;
4537
4537
  x._store.validated = !0;
4538
4538
  var q = te(L);
4539
- if (Se[q])
4539
+ if (Ee[q])
4540
4540
  return;
4541
- Se[q] = !0;
4541
+ Ee[q] = !0;
4542
4542
  var Y = "";
4543
4543
  x && x._owner && x._owner !== H.current && (Y = " It was passed a child from " + F(x._owner.type) + "."), P(x), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', q, Y), P(null);
4544
4544
  }
@@ -4619,8 +4619,8 @@ Check the top-level render call using <` + q + ">.");
4619
4619
  if (mt !== void 0)
4620
4620
  if (Y)
4621
4621
  if (_t(mt)) {
4622
- for (var Er = 0; Er < mt.length; Er++)
4623
- qe(mt[Er], x);
4622
+ for (var Sr = 0; Sr < mt.length; Sr++)
4623
+ qe(mt[Sr], x);
4624
4624
  Object.freeze && Object.freeze(mt);
4625
4625
  } else
4626
4626
  v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
@@ -4758,14 +4758,14 @@ function Tf({
4758
4758
  onRefresh: h,
4759
4759
  theme: g = {}
4760
4760
  }) {
4761
- const { data: m, loading: _, error: w, refetch: v } = yu(r, e), [A, C] = K(""), [E, y] = K({}), [b, D] = K(1), S = St(() => {
4761
+ const { data: m, loading: _, error: w, refetch: v } = yu(r, e), [A, C] = K(""), [S, y] = K({}), [b, D] = K(1), E = Et(() => {
4762
4762
  if (!m) return { data: [], total: 0, totalPages: 0 };
4763
4763
  let j = m;
4764
- return l && A && a.length > 0 && (j = Rs.search(j, A, a)), Object.keys(E).length > 0 && (j = Rs.filterByFields(j, E)), Rs.paginate(j, b, d);
4765
- }, [m, A, E, b, d, l, a]);
4764
+ return l && A && a.length > 0 && (j = Rs.search(j, A, a)), Object.keys(S).length > 0 && (j = Rs.filterByFields(j, S)), Rs.paginate(j, b, d);
4765
+ }, [m, A, S, b, d, l, a]);
4766
4766
  De(() => {
4767
4767
  D(1);
4768
- }, [A, E]);
4768
+ }, [A, S]);
4769
4769
  const M = () => {
4770
4770
  C(""), y({}), D(1), v(), h == null || h();
4771
4771
  }, T = {
@@ -4873,11 +4873,11 @@ function Tf({
4873
4873
  gridTemplateColumns: t === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
4874
4874
  gap: t === "list" ? "0" : "16px",
4875
4875
  padding: t === "list" ? "0" : "16px"
4876
- }, children: S.data.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: {
4876
+ }, children: E.data.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: {
4877
4877
  padding: "48px",
4878
4878
  textAlign: "center",
4879
4879
  color: T.textSecondary
4880
- }, children: s }) : S.data.map((j, I) => /* @__PURE__ */ p.jsx(
4880
+ }, children: s }) : E.data.map((j, I) => /* @__PURE__ */ p.jsx(
4881
4881
  "div",
4882
4882
  {
4883
4883
  onClick: () => f == null ? void 0 : f(j),
@@ -4897,7 +4897,7 @@ function Tf({
4897
4897
  },
4898
4898
  i(j, I)
4899
4899
  )) }),
4900
- S.totalPages > 1 && /* @__PURE__ */ p.jsxs("div", { style: {
4900
+ E.totalPages > 1 && /* @__PURE__ */ p.jsxs("div", { style: {
4901
4901
  padding: "16px",
4902
4902
  borderTop: `1px solid ${T.border}`,
4903
4903
  display: "flex",
@@ -4908,7 +4908,7 @@ function Tf({
4908
4908
  "Page ",
4909
4909
  b,
4910
4910
  " of ",
4911
- S.totalPages
4911
+ E.totalPages
4912
4912
  ] }),
4913
4913
  /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
4914
4914
  /* @__PURE__ */ p.jsx(
@@ -4930,15 +4930,15 @@ function Tf({
4930
4930
  /* @__PURE__ */ p.jsx(
4931
4931
  "button",
4932
4932
  {
4933
- onClick: () => D((j) => Math.min(S.totalPages, j + 1)),
4934
- disabled: b === S.totalPages,
4933
+ onClick: () => D((j) => Math.min(E.totalPages, j + 1)),
4934
+ disabled: b === E.totalPages,
4935
4935
  style: {
4936
4936
  padding: "6px 12px",
4937
4937
  border: `1px solid ${T.border}`,
4938
4938
  borderRadius: "6px",
4939
4939
  background: "white",
4940
- cursor: b === S.totalPages ? "not-allowed" : "pointer",
4941
- opacity: b === S.totalPages ? 0.5 : 1
4940
+ cursor: b === E.totalPages ? "not-allowed" : "pointer",
4941
+ opacity: b === E.totalPages ? 0.5 : 1
4942
4942
  },
4943
4943
  children: "Next"
4944
4944
  }
@@ -5050,7 +5050,7 @@ function Ff({
5050
5050
  className: i = ""
5051
5051
  }) {
5052
5052
  const l = Math.min(Math.max(e, 1), 5), [a, u] = K([]), [c, d] = K([]), [f, h] = K(Array(l).fill(!1)), [g, m] = K(Array(l).fill(!1)), _ = ye([]), w = re((y) => {
5053
- const b = r.filter((S) => !y.includes(S._id));
5053
+ const b = r.filter((E) => !y.includes(E._id));
5054
5054
  if (b.length === 0) return null;
5055
5055
  const D = Math.floor(Math.random() * b.length);
5056
5056
  return b[D];
@@ -5061,36 +5061,36 @@ function Ff({
5061
5061
  return;
5062
5062
  }
5063
5063
  const y = [], b = [], D = [];
5064
- for (let S = 0; S < l && S < r.length; S++) {
5064
+ for (let E = 0; E < l && E < r.length; E++) {
5065
5065
  const M = w(D);
5066
5066
  M && (y.push(M), D.push(M._id));
5067
5067
  }
5068
- for (let S = 0; S < y.length; S++) {
5068
+ for (let E = 0; E < y.length; E++) {
5069
5069
  const M = [
5070
- y[S]._id,
5071
- ...y.filter((B, F) => F !== S).map((B) => B._id)
5070
+ y[E]._id,
5071
+ ...y.filter((B, F) => F !== E).map((B) => B._id)
5072
5072
  ], T = w(M);
5073
- T ? b.push(T) : b.push(y[S]);
5073
+ T ? b.push(T) : b.push(y[E]);
5074
5074
  }
5075
5075
  u(y), d(b);
5076
5076
  }, [r, l, w]);
5077
5077
  const A = re((y) => {
5078
5078
  const b = v(), D = setTimeout(() => {
5079
- h((S) => {
5080
- const M = [...S];
5079
+ h((E) => {
5080
+ const M = [...E];
5081
5081
  return M[y] = !M[y], M;
5082
5082
  }), setTimeout(() => {
5083
- m((S) => {
5084
- const M = [...S];
5083
+ m((E) => {
5084
+ const M = [...E];
5085
5085
  return M[y] = !M[y], M;
5086
5086
  }), setTimeout(() => {
5087
- const S = !g[y];
5088
- S && u((M) => {
5087
+ const E = !g[y];
5088
+ E && u((M) => {
5089
5089
  const T = [...M];
5090
5090
  return T[y] = c[y], T;
5091
5091
  }), d((M) => {
5092
5092
  const T = [...M], F = [
5093
- (S ? c[y] : a[y])._id,
5093
+ (E ? c[y] : a[y])._id,
5094
5094
  ...a.filter((I, X) => X !== y).map((I) => I._id),
5095
5095
  ...M.filter((I, X) => X !== y).map((I) => I._id)
5096
5096
  ], j = w(F);
@@ -5113,17 +5113,17 @@ function Ff({
5113
5113
  };
5114
5114
  }
5115
5115
  }, [a.length, r.length]);
5116
- const E = (y) => {
5116
+ const S = (y) => {
5117
5117
  s && s(y);
5118
5118
  };
5119
5119
  return r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : a.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `flex items-center justify-center p-8 ${i}`, children: /* @__PURE__ */ p.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ p.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${i}`, children: a.map((y, b) => {
5120
- const D = c[b], S = g[b];
5120
+ const D = c[b], E = g[b];
5121
5121
  return /* @__PURE__ */ p.jsx(
5122
5122
  "div",
5123
5123
  {
5124
5124
  className: `relative ${bu[o]}`,
5125
5125
  style: { perspective: "1000px" },
5126
- onClick: () => E(S ? D : y),
5126
+ onClick: () => S(E ? D : y),
5127
5127
  children: /* @__PURE__ */ p.jsxs(
5128
5128
  "div",
5129
5129
  {
@@ -5139,7 +5139,7 @@ function Ff({
5139
5139
  {
5140
5140
  className: "absolute inset-0 transition-opacity duration-200",
5141
5141
  style: {
5142
- opacity: S ? 0 : 1
5142
+ opacity: E ? 0 : 1
5143
5143
  },
5144
5144
  children: /* @__PURE__ */ p.jsxs(
5145
5145
  "div",
@@ -5169,7 +5169,7 @@ function Ff({
5169
5169
  {
5170
5170
  className: "absolute inset-0 transition-opacity duration-200",
5171
5171
  style: {
5172
- opacity: S ? 1 : 0
5172
+ opacity: E ? 1 : 0
5173
5173
  },
5174
5174
  children: /* @__PURE__ */ p.jsxs(
5175
5175
  "div",
@@ -5202,7 +5202,7 @@ function Ff({
5202
5202
  );
5203
5203
  }) });
5204
5204
  }
5205
- function Sr(r) {
5205
+ function Er(r) {
5206
5206
  if (!r) return "";
5207
5207
  const e = /=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;
5208
5208
  return r.replace(e, (t, n, s, o) => {
@@ -5256,23 +5256,23 @@ function jf({
5256
5256
  renderDetail: v,
5257
5257
  renderActions: A,
5258
5258
  renderEmpty: C,
5259
- renderLoading: E,
5259
+ renderLoading: S,
5260
5260
  theme: y = {}
5261
5261
  }) {
5262
- const b = { ...vu, ...y }, [D, S] = K([]), [M, T] = K(!1), [B, F] = K(null), [j, I] = K(/* @__PURE__ */ new Set()), [X, de] = K(null), [Ce, ae] = K(null), [Oe, xe] = K(null), [pe, _e] = K(!1), [be, ke] = K(""), ge = a !== void 0 ? a : be, Ae = (G) => {
5262
+ const b = { ...vu, ...y }, [D, E] = K([]), [M, T] = K(!1), [B, F] = K(null), [j, I] = K(/* @__PURE__ */ new Set()), [X, de] = K(null), [Ce, ae] = K(null), [Oe, xe] = K(null), [pe, _e] = K(!1), [be, ke] = K(""), ge = a !== void 0 ? a : be, Ae = (G) => {
5263
5263
  u ? u(G) : ke(G);
5264
- }, Le = St(() => {
5264
+ }, Le = Et(() => {
5265
5265
  if (!ge.trim()) return D;
5266
5266
  const G = ge.toLowerCase();
5267
5267
  return D.filter(
5268
- (J) => Sr(J.from).toLowerCase().includes(G) || Sr(J.subject).toLowerCase().includes(G)
5268
+ (J) => Er(J.from).toLowerCase().includes(G) || Er(J.subject).toLowerCase().includes(G)
5269
5269
  );
5270
- }, [D, ge]), ue = St(() => e ? new pu({ baseUrl: r, system_id: e }) : null, [r, e]), Me = re(async () => {
5270
+ }, [D, ge]), ue = Et(() => e ? new pu({ baseUrl: r, system_id: e }) : null, [r, e]), Me = re(async () => {
5271
5271
  if (ue) {
5272
5272
  T(!0), F(null);
5273
5273
  try {
5274
5274
  const G = await ue.listEmails(t, n, s);
5275
- G != null && G.messages && (S(G.messages), _ == null || _(G.messages));
5275
+ G != null && G.messages && (E(G.messages), _ == null || _(G.messages));
5276
5276
  } catch (G) {
5277
5277
  const J = G instanceof Error ? G : new Error("Failed to fetch emails");
5278
5278
  F(J.message), m == null || m(J);
@@ -5281,7 +5281,7 @@ function jf({
5281
5281
  }
5282
5282
  }, [ue, t, n, s, m, _]);
5283
5283
  De(() => {
5284
- S([]), I(/* @__PURE__ */ new Set()), ae(null), F(null), a === void 0 && ke(""), d && Me();
5284
+ E([]), I(/* @__PURE__ */ new Set()), ae(null), F(null), a === void 0 && ke(""), d && Me();
5285
5285
  }, [s, d]);
5286
5286
  const ct = re(async (G) => {
5287
5287
  if (ue) {
@@ -5320,7 +5320,7 @@ function jf({
5320
5320
  try {
5321
5321
  const J = await ue.trashEmails(t, Array.from(j), G);
5322
5322
  if (console.log("Trash result:", J), J.success && J.moved > 0) {
5323
- S((Ie) => Ie.filter(($e) => !j.has($e.uid)));
5323
+ E((Ie) => Ie.filter(($e) => !j.has($e.uid)));
5324
5324
  const Ne = Array.from(j);
5325
5325
  I(/* @__PURE__ */ new Set()), g == null || g(Ne);
5326
5326
  } else
@@ -5335,7 +5335,7 @@ function jf({
5335
5335
  try {
5336
5336
  const J = await ue.archiveEmails(t, Array.from(j), G);
5337
5337
  if (console.log("Archive result:", J), J.success && J.archived > 0) {
5338
- S((Ie) => Ie.filter(($e) => !j.has($e.uid)));
5338
+ E((Ie) => Ie.filter(($e) => !j.has($e.uid)));
5339
5339
  const Ne = Array.from(j);
5340
5340
  I(/* @__PURE__ */ new Set()), g == null || g(Ne);
5341
5341
  } else
@@ -5378,7 +5378,7 @@ function jf({
5378
5378
  whiteSpace: "nowrap",
5379
5379
  overflow: "hidden",
5380
5380
  textOverflow: "ellipsis"
5381
- }, children: Sr(G.from).split("@")[0] }),
5381
+ }, children: Er(G.from).split("@")[0] }),
5382
5382
  /* @__PURE__ */ p.jsx("div", { style: {
5383
5383
  fontSize: "14px",
5384
5384
  fontWeight: G.seen ? 400 : 500,
@@ -5387,7 +5387,7 @@ function jf({
5387
5387
  whiteSpace: "nowrap",
5388
5388
  overflow: "hidden",
5389
5389
  textOverflow: "ellipsis"
5390
- }, children: Sr(G.subject) || "(No subject)" })
5390
+ }, children: Er(G.subject) || "(No subject)" })
5391
5391
  ] }),
5392
5392
  /* @__PURE__ */ p.jsx("div", { style: {
5393
5393
  fontSize: "12px",
@@ -5395,10 +5395,10 @@ function jf({
5395
5395
  flexShrink: 0
5396
5396
  }, children: Ft(G.date) })
5397
5397
  ] }) }), dt = (G) => /* @__PURE__ */ p.jsxs("div", { style: { padding: "24px" }, children: [
5398
- /* @__PURE__ */ p.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: b.text }, children: Sr(G.subject) || "(No subject)" }),
5398
+ /* @__PURE__ */ p.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: b.text }, children: Er(G.subject) || "(No subject)" }),
5399
5399
  /* @__PURE__ */ p.jsxs("div", { style: { fontSize: "14px", color: b.textSecondary, marginBottom: "16px" }, children: [
5400
5400
  "From: ",
5401
- Sr(G.from),
5401
+ Er(G.from),
5402
5402
  " • ",
5403
5403
  new Date(G.date).toLocaleString()
5404
5404
  ] }),
@@ -5504,11 +5504,11 @@ function jf({
5504
5504
  padding: "48px",
5505
5505
  textAlign: "center",
5506
5506
  color: b.textSecondary
5507
- }, children: c }), Ee = () => /* @__PURE__ */ p.jsx("div", { style: {
5507
+ }, children: c }), Se = () => /* @__PURE__ */ p.jsx("div", { style: {
5508
5508
  padding: "48px",
5509
5509
  textAlign: "center",
5510
5510
  color: b.textSecondary
5511
- }, children: "Loading..." }), Be = w || jt, Te = v || dt, Lt = A || _t, Rt = C || U, Vt = E || Ee;
5511
+ }, children: "Loading..." }), Be = w || jt, Te = v || dt, Lt = A || _t, Rt = C || U, Vt = S || Se;
5512
5512
  return M && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background: b.background, width: "100%", height: "100%" }, children: Vt() }) : /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", background: b.background, width: "100%", height: "100%" }, children: [
5513
5513
  /* @__PURE__ */ p.jsxs("div", { style: {
5514
5514
  flex: i && Ce ? "0 0 50%" : "1",
@@ -5600,16 +5600,16 @@ function Lf({
5600
5600
  className: a = ""
5601
5601
  }) {
5602
5602
  const [u, c] = K(/* @__PURE__ */ new Set()), [d, f] = K(-1), h = r.filter((C) => u.has(C.id)), g = d >= 0 && d < h.length ? h[d] : null, m = re((C) => {
5603
- c((E) => {
5604
- const y = new Set(E);
5603
+ c((S) => {
5604
+ const y = new Set(S);
5605
5605
  return y.has(C) ? y.delete(C) : y.add(C), t == null || t(Array.from(y)), y;
5606
5606
  });
5607
5607
  }, [t]), _ = re(() => {
5608
5608
  if (u.size === r.length)
5609
5609
  c(/* @__PURE__ */ new Set()), f(-1), t == null || t([]);
5610
5610
  else {
5611
- const C = new Set(r.map((E) => E.id));
5612
- c(C), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((E) => E.id));
5611
+ const C = new Set(r.map((S) => S.id));
5612
+ c(C), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((S) => S.id));
5613
5613
  }
5614
5614
  }, [r, u.size, t, n]), w = re(() => {
5615
5615
  if (h.length === 0) return;
@@ -5671,15 +5671,15 @@ function Lf({
5671
5671
  ] })
5672
5672
  ] }),
5673
5673
  /* @__PURE__ */ p.jsx("div", { className: "space-y-1", children: r.map((C) => {
5674
- const E = u.has(C.id), y = (g == null ? void 0 : g.id) === C.id;
5674
+ const S = u.has(C.id), y = (g == null ? void 0 : g.id) === C.id;
5675
5675
  return /* @__PURE__ */ p.jsxs(
5676
5676
  "div",
5677
5677
  {
5678
- className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${y ? "bg-blue-50 ring-1 ring-blue-200" : E ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
5678
+ className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${y ? "bg-blue-50 ring-1 ring-blue-200" : S ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
5679
5679
  onClick: () => m(C.id),
5680
5680
  children: [
5681
- /* @__PURE__ */ p.jsx("span", { className: `material-icons text-lg ${E ? "text-blue-500" : "text-neutral-300"}`, children: E ? "check_box" : "check_box_outline_blank" }),
5682
- /* @__PURE__ */ p.jsx("div", { className: "flex-1 min-w-0", children: e(C, E, y) })
5681
+ /* @__PURE__ */ p.jsx("span", { className: `material-icons text-lg ${S ? "text-blue-500" : "text-neutral-300"}`, children: S ? "check_box" : "check_box_outline_blank" }),
5682
+ /* @__PURE__ */ p.jsx("div", { className: "flex-1 min-w-0", children: e(C, S, y) })
5683
5683
  ]
5684
5684
  },
5685
5685
  C.id
@@ -5687,13 +5687,13 @@ function Lf({
5687
5687
  }) }),
5688
5688
  o.length > 0 && u.size > 0 && /* @__PURE__ */ p.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: o.map((C) => {
5689
5689
  var y;
5690
- const E = ((y = C.disabled) == null ? void 0 : y.call(C, h)) ?? !1;
5690
+ const S = ((y = C.disabled) == null ? void 0 : y.call(C, h)) ?? !1;
5691
5691
  return /* @__PURE__ */ p.jsxs(
5692
5692
  "button",
5693
5693
  {
5694
5694
  onClick: () => A(C.id),
5695
- disabled: E,
5696
- className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${E ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
5695
+ disabled: S,
5696
+ className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${S ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
5697
5697
  children: [
5698
5698
  C.icon && /* @__PURE__ */ p.jsx("span", { className: "material-icons text-sm", children: C.icon }),
5699
5699
  C.label
@@ -5726,9 +5726,9 @@ function Tt() {
5726
5726
  function _n(r) {
5727
5727
  return {};
5728
5728
  }
5729
- const yi = {}, Au = {}, _l = {}, gr = {}, jr = {}, fn = {}, Lr = {}, fs = {}, Js = {}, hn = {}, pn = {}, Et = {}, xi = {}, _i = {}, Eu = {}, bl = {}, Su = {}, vl = {}, ku = {}, wl = {}, Cl = {}, Vn = {}, Tu = {}, Dl = {}, Al = {}, El = {}, Bu = {}, Nu = {}, Fu = {}, ro = {}, Sl = {}, ju = {}, kl = {}, Tl = {}, Lu = {}, hs = {}, bi = {}, Qs = {}, Ru = {}, Pu = {}, Ln = {}, Rn = {}, Ou = {}, Mu = {}, Iu = {}, Bt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $u = Bt && "documentMode" in document ? document.documentMode : null, Ct = Bt && /Mac|iPod|iPhone|iPad/.test(navigator.platform), lr = Bt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Kn = !(!Bt || !("InputEvent" in window) || $u) && "getTargetRanges" in new window.InputEvent("input"), ps = Bt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), bn = Bt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, zu = Bt && /Android/.test(navigator.userAgent), Bl = Bt && /^(?=.*Chrome).*/i.test(navigator.userAgent), qu = Bt && zu && Bl, vi = Bt && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Bl, vn = 1, ur = 3, xr = 0, Nl = 1, Or = 2, Uu = 0, Wu = 1, Gu = 2, Hn = 4, Jn = 8, wi = 128, Vu = 112 | (3 | Hn | Jn) | wi, Ci = 1, Di = 2, Ai = 3, Ei = 4, Si = 5, ki = 6, gs = ps || bn || vi ? " " : "​", Qt = `
5729
+ const yi = {}, Au = {}, _l = {}, gr = {}, jr = {}, fn = {}, Lr = {}, fs = {}, Js = {}, hn = {}, pn = {}, St = {}, xi = {}, _i = {}, Su = {}, bl = {}, Eu = {}, vl = {}, ku = {}, wl = {}, Cl = {}, Vn = {}, Tu = {}, Dl = {}, Al = {}, Sl = {}, Bu = {}, Nu = {}, Fu = {}, ro = {}, El = {}, ju = {}, kl = {}, Tl = {}, Lu = {}, hs = {}, bi = {}, Qs = {}, Ru = {}, Pu = {}, Ln = {}, Rn = {}, Ou = {}, Mu = {}, Iu = {}, Bt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, $u = Bt && "documentMode" in document ? document.documentMode : null, Ct = Bt && /Mac|iPod|iPhone|iPad/.test(navigator.platform), lr = Bt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Kn = !(!Bt || !("InputEvent" in window) || $u) && "getTargetRanges" in new window.InputEvent("input"), ps = Bt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), bn = Bt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, zu = Bt && /Android/.test(navigator.userAgent), Bl = Bt && /^(?=.*Chrome).*/i.test(navigator.userAgent), qu = Bt && zu && Bl, vi = Bt && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Bl, vn = 1, ur = 3, xr = 0, Nl = 1, Or = 2, Uu = 0, Wu = 1, Gu = 2, Hn = 4, Jn = 8, wi = 128, Vu = 112 | (3 | Hn | Jn) | wi, Ci = 1, Di = 2, Ai = 3, Si = 4, Ei = 5, ki = 6, gs = ps || bn || vi ? " " : "​", Qt = `
5730
5730
 
5731
- `, Ku = lr ? " " : gs, Fl = "֑-߿יִ-﷽ﹰ-ﻼ", jl = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿", Hu = new RegExp("^[^" + jl + "]*[" + Fl + "]"), Ju = new RegExp("^[^" + Fl + "]*[" + jl + "]"), _r = { bold: 1, code: 16, highlight: wi, italic: 2, strikethrough: Hn, subscript: 32, superscript: 64, underline: Jn }, Qu = { directionless: 1, unmergeable: 2 }, no = { center: Di, end: ki, justify: Ei, left: Ci, right: Ai, start: Si }, Yu = { [Di]: "center", [ki]: "end", [Ei]: "justify", [Ci]: "left", [Ai]: "right", [Si]: "start" }, Xu = { normal: 0, segmented: 2, token: 1 }, Zu = { [Uu]: "normal", [Gu]: "segmented", [Wu]: "token" };
5731
+ `, Ku = lr ? " " : gs, Fl = "֑-߿יִ-﷽ﹰ-ﻼ", jl = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿", Hu = new RegExp("^[^" + jl + "]*[" + Fl + "]"), Ju = new RegExp("^[^" + Fl + "]*[" + jl + "]"), _r = { bold: 1, code: 16, highlight: wi, italic: 2, strikethrough: Hn, subscript: 32, superscript: 64, underline: Jn }, Qu = { directionless: 1, unmergeable: 2 }, no = { center: Di, end: ki, justify: Si, left: Ci, right: Ai, start: Ei }, Yu = { [Di]: "center", [ki]: "end", [Si]: "justify", [Ci]: "left", [Ai]: "right", [Ei]: "start" }, Xu = { normal: 0, segmented: 2, token: 1 }, Zu = { [Uu]: "normal", [Gu]: "segmented", [Wu]: "token" };
5732
5732
  function ec(r) {
5733
5733
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
5734
5734
  }
@@ -5796,23 +5796,23 @@ function Ll(r, e, t) {
5796
5796
  u = !0;
5797
5797
  const A = h.addedNodes;
5798
5798
  for (let y = 0; y < A.length; y++) {
5799
- const b = A[y], D = $l(b), S = b.parentNode;
5800
- if (S != null && b !== a && D === null && !Ps(b, S, r)) {
5799
+ const b = A[y], D = $l(b), E = b.parentNode;
5800
+ if (E != null && b !== a && D === null && !Ps(b, E, r)) {
5801
5801
  if (lr) {
5802
5802
  const M = b.innerText || b.nodeValue;
5803
5803
  M && (c += M);
5804
5804
  }
5805
- S.removeChild(b);
5805
+ E.removeChild(b);
5806
5806
  }
5807
5807
  }
5808
- const C = h.removedNodes, E = C.length;
5809
- if (E > 0) {
5808
+ const C = h.removedNodes, S = C.length;
5809
+ if (S > 0) {
5810
5810
  let y = 0;
5811
- for (let b = 0; b < E; b++) {
5811
+ for (let b = 0; b < S; b++) {
5812
5812
  const D = C[b];
5813
5813
  (Ps(D, m, r) || a === D) && (m.appendChild(D), y++);
5814
5814
  }
5815
- E !== y && o.set(w, v);
5815
+ S !== y && o.set(w, v);
5816
5816
  }
5817
5817
  }
5818
5818
  }
@@ -6123,7 +6123,7 @@ function Li(r, e, t, n, s) {
6123
6123
  }
6124
6124
  return;
6125
6125
  }
6126
- const u = o.getParent(), c = Sn(), d = o.getTextContentSize(), f = sr(), h = o.getKey();
6126
+ const u = o.getParent(), c = En(), d = o.getTextContentSize(), f = sr(), h = o.getKey();
6127
6127
  if (o.isToken() || f !== null && h === f && !i || R(c) && (u !== null && !u.canInsertTextBefore() && c.anchor.offset === 0 || c.anchor.key === r.__key && c.anchor.offset === 0 && !o.canInsertTextBefore() && !i || c.focus.key === r.__key && c.focus.offset === d && !o.canInsertTextAfter() && !i)) return void o.markDirty();
6128
6128
  const g = V();
6129
6129
  if (!R(g) || t === null || n === null) return void o.setTextContent(l);
@@ -6405,7 +6405,7 @@ function Jl(r, e) {
6405
6405
  }
6406
6406
  function Ql(r, e) {
6407
6407
  const t = r.style;
6408
- e === 0 ? fr(t, "") : e === Ci ? fr(t, "left") : e === Di ? fr(t, "center") : e === Ai ? fr(t, "right") : e === Ei ? fr(t, "justify") : e === Si ? fr(t, "start") : e === ki && fr(t, "end");
6408
+ e === 0 ? fr(t, "") : e === Ci ? fr(t, "left") : e === Di ? fr(t, "center") : e === Ai ? fr(t, "right") : e === Si ? fr(t, "justify") : e === Ei ? fr(t, "start") : e === ki && fr(t, "end");
6409
6409
  }
6410
6410
  function ns(r, e) {
6411
6411
  const t = kt.get(r);
@@ -6528,28 +6528,28 @@ function bc(r, e, t) {
6528
6528
  ri(f, 0, u - 1, g ? null : d), g && (d.textContent = "");
6529
6529
  }
6530
6530
  } else (function(g, m, _, w, v, A) {
6531
- const C = w - 1, E = v - 1;
6532
- let y, b, D = A.getFirstChild(), S = 0, M = 0;
6533
- for (; S <= C && M <= E; ) {
6534
- const F = m[S], j = _[M];
6535
- if (F === j) D = Is(en(j, A.element)), S++, M++;
6531
+ const C = w - 1, S = v - 1;
6532
+ let y, b, D = A.getFirstChild(), E = 0, M = 0;
6533
+ for (; E <= C && M <= S; ) {
6534
+ const F = m[E], j = _[M];
6535
+ if (F === j) D = Is(en(j, A.element)), E++, M++;
6536
6536
  else {
6537
6537
  y === void 0 && (y = new Set(m)), b === void 0 && (b = new Set(_));
6538
6538
  const X = b.has(F), de = y.has(j);
6539
6539
  if (X) if (de) {
6540
6540
  const Ce = es(st, j);
6541
- Ce === D ? D = Is(en(j, A.element)) : (A.withBefore(D).insertChild(Ce), en(j, A.element)), S++, M++;
6541
+ Ce === D ? D = Is(en(j, A.element)) : (A.withBefore(D).insertChild(Ce), en(j, A.element)), E++, M++;
6542
6542
  } else ns(j, A.withBefore(D)), M++;
6543
- else D = Is(si(F)), rs(F, A.element), S++;
6543
+ else D = Is(si(F)), rs(F, A.element), E++;
6544
6544
  }
6545
6545
  const I = kt.get(j);
6546
6546
  I !== null && $(I) && (Pt === null && (Pt = I.getFormat()), Dt === "" && (Dt = I.getStyle()));
6547
6547
  }
6548
- const T = S > C, B = M > E;
6548
+ const T = E > C, B = M > S;
6549
6549
  if (T && !B) {
6550
- const F = _[E + 1], j = F === void 0 ? null : st.getElementByKey(F);
6551
- ni(_, g, M, E, A.withBefore(j));
6552
- } else B && !T && ri(m, S, C, A.element);
6550
+ const F = _[S + 1], j = F === void 0 ? null : st.getElementByKey(F);
6551
+ ni(_, g, M, S, A.withBefore(j));
6552
+ } else B && !T && ri(m, E, C, A.element);
6553
6553
  })(i, f, h, u, c, l);
6554
6554
  }
6555
6555
  xs(i) && (Ke += Qt), d.__lexicalTextContent = Ke, Ke = a + Ke;
@@ -6631,13 +6631,13 @@ function si(r) {
6631
6631
  const Ht = Object.freeze({}), ii = 30, oi = [["keydown", function(r, e) {
6632
6632
  if (an = r.timeStamp, ea = r.key, e.isComposing()) return;
6633
6633
  const { key: t, shiftKey: n, ctrlKey: s, metaKey: o, altKey: i } = r;
6634
- if (!W(e, Eu, r) && t != null) {
6634
+ if (!W(e, Su, r) && t != null) {
6635
6635
  if (function(l, a, u, c) {
6636
6636
  return fo(l) && !a && !c && !u;
6637
6637
  }(t, s, i, o)) W(e, bl, r);
6638
6638
  else if (function(l, a, u, c, d) {
6639
6639
  return fo(l) && !c && !u && (a || d);
6640
- }(t, s, n, i, o)) W(e, Su, r);
6640
+ }(t, s, n, i, o)) W(e, Eu, r);
6641
6641
  else if (function(l, a, u, c) {
6642
6642
  return co(l) && !a && !c && !u;
6643
6643
  }(t, s, i, o)) W(e, vl, r);
@@ -6674,7 +6674,7 @@ const Ht = Object.freeze({}), ii = 30, oi = [["keydown", function(r, e) {
6674
6674
  }(t)) W(e, Al, r);
6675
6675
  else if (function(l, a, u, c, d) {
6676
6676
  return Ct ? !(u || c || d) && (Hr(l) || l.toLowerCase() === "d" && a) : !(a || c || d) && Hr(l);
6677
- }(t, s, n, i, o)) Hr(t) ? W(e, El, r) : (r.preventDefault(), W(e, gr, !1));
6677
+ }(t, s, n, i, o)) Hr(t) ? W(e, Sl, r) : (r.preventDefault(), W(e, gr, !1));
6678
6678
  else if (function(l, a, u) {
6679
6679
  return Kr(l) && (Ct ? a : u);
6680
6680
  }(t, i, s)) r.preventDefault(), W(e, hn, !0);
@@ -6689,13 +6689,13 @@ const Ht = Object.freeze({}), ii = 30, oi = [["keydown", function(r, e) {
6689
6689
  }(t, o)) r.preventDefault(), W(e, pn, !1);
6690
6690
  else if (function(l, a, u, c) {
6691
6691
  return l.toLowerCase() === "b" && !a && Zr(u, c);
6692
- }(t, i, o, s)) r.preventDefault(), W(e, Et, "bold");
6692
+ }(t, i, o, s)) r.preventDefault(), W(e, St, "bold");
6693
6693
  else if (function(l, a, u, c) {
6694
6694
  return l.toLowerCase() === "u" && !a && Zr(u, c);
6695
- }(t, i, o, s)) r.preventDefault(), W(e, Et, "underline");
6695
+ }(t, i, o, s)) r.preventDefault(), W(e, St, "underline");
6696
6696
  else if (function(l, a, u, c) {
6697
6697
  return l.toLowerCase() === "i" && !a && Zr(u, c);
6698
- }(t, i, o, s)) r.preventDefault(), W(e, Et, "italic");
6698
+ }(t, i, o, s)) r.preventDefault(), W(e, St, "italic");
6699
6699
  else if (/* @__PURE__ */ function(l, a, u, c) {
6700
6700
  return l === "Tab" && !a && !u && !c;
6701
6701
  }(t, i, s, o)) W(e, Bu, r);
@@ -6751,7 +6751,7 @@ const Ht = Object.freeze({}), ii = 30, oi = [["keydown", function(r, e) {
6751
6751
  }), Br = null;
6752
6752
  }], ["click", function(r, e) {
6753
6753
  ft(e, () => {
6754
- const t = V(), n = yt(e._window), s = Sn();
6754
+ const t = V(), n = yt(e._window), s = En();
6755
6755
  if (n) {
6756
6756
  if (R(t)) {
6757
6757
  const o = t.anchor, i = o.getNode();
@@ -6773,7 +6773,7 @@ Kn && oi.push(["beforeinput", (r, e) => function(t, n) {
6773
6773
  const i = V();
6774
6774
  if (s === "deleteContentBackward") {
6775
6775
  if (i === null) {
6776
- const h = Sn();
6776
+ const h = En();
6777
6777
  if (!R(h)) return;
6778
6778
  $t(h.clone());
6779
6779
  }
@@ -6848,16 +6848,16 @@ Kn && oi.push(["beforeinput", (r, e) => function(t, n) {
6848
6848
  W(n, pn, !1);
6849
6849
  break;
6850
6850
  case "formatStrikeThrough":
6851
- W(n, Et, "strikethrough");
6851
+ W(n, St, "strikethrough");
6852
6852
  break;
6853
6853
  case "formatBold":
6854
- W(n, Et, "bold");
6854
+ W(n, St, "bold");
6855
6855
  break;
6856
6856
  case "formatItalic":
6857
- W(n, Et, "italic");
6857
+ W(n, St, "italic");
6858
6858
  break;
6859
6859
  case "formatUnderline":
6860
- W(n, Et, "underline");
6860
+ W(n, St, "underline");
6861
6861
  break;
6862
6862
  case "historyUndo":
6863
6863
  W(n, xi, void 0);
@@ -6907,9 +6907,9 @@ function bo(r, e, t) {
6907
6907
  } else {
6908
6908
  const c = a.key, d = l.focus.key, f = l.getNodes(), h = f.length, g = l.isBackward(), m = g ? i : s, _ = g ? s : i, w = g ? d : c, v = g ? c : d;
6909
6909
  let A = Vu, C = !1;
6910
- for (let E = 0; E < h; E++) {
6911
- const y = f[E], b = y.getTextContentSize();
6912
- if ($(y) && b !== 0 && !(E === 0 && y.__key === w && m === b || E === h - 1 && y.__key === v && _ === 0) && (C = !0, A &= y.getFormat(), A === 0)) break;
6910
+ for (let S = 0; S < h; S++) {
6911
+ const y = f[S], b = y.getTextContentSize();
6912
+ if ($(y) && b !== 0 && !(S === 0 && y.__key === w && m === b || S === h - 1 && y.__key === v && _ === 0) && (C = !0, A &= y.getFormat(), A === 0)) break;
6913
6913
  }
6914
6914
  l.format = C ? A : 0;
6915
6915
  }
@@ -6951,7 +6951,7 @@ function oa(r) {
6951
6951
  const n = Ml(t.anchorNode);
6952
6952
  if (n === null) return;
6953
6953
  ai && (ai = !1, ft(n, () => {
6954
- const u = Sn(), c = t.anchorNode;
6954
+ const u = En(), c = t.anchorNode;
6955
6955
  if (c === null) return;
6956
6956
  const d = c.nodeType;
6957
6957
  d !== vn && d !== ur || $t($i(u, t, n, r));
@@ -7243,7 +7243,7 @@ class vs {
7243
7243
  })), R(n)) {
7244
7244
  $t(n);
7245
7245
  const m = n.anchor, _ = n.focus;
7246
- m.key === o && Eo(m, l), _.key === o && Eo(_, l);
7246
+ m.key === o && So(m, l), _.key === o && So(_, l);
7247
7247
  }
7248
7248
  return sr() === o && Qe(i), l;
7249
7249
  }
@@ -7509,7 +7509,7 @@ class zr extends vs {
7509
7509
  return h !== g && (t.style.cssText = g), !1;
7510
7510
  }
7511
7511
  static importDOM() {
7512
- return { "#text": () => ({ conversion: Sc, priority: 0 }), b: () => ({ conversion: Ac, priority: 0 }), code: () => ({ conversion: tr, priority: 0 }), em: () => ({ conversion: tr, priority: 0 }), i: () => ({ conversion: tr, priority: 0 }), s: () => ({ conversion: tr, priority: 0 }), span: () => ({ conversion: Dc, priority: 0 }), strong: () => ({ conversion: tr, priority: 0 }), sub: () => ({ conversion: tr, priority: 0 }), sup: () => ({ conversion: tr, priority: 0 }), u: () => ({ conversion: tr, priority: 0 }) };
7512
+ return { "#text": () => ({ conversion: Ec, priority: 0 }), b: () => ({ conversion: Ac, priority: 0 }), code: () => ({ conversion: tr, priority: 0 }), em: () => ({ conversion: tr, priority: 0 }), i: () => ({ conversion: tr, priority: 0 }), s: () => ({ conversion: tr, priority: 0 }), span: () => ({ conversion: Dc, priority: 0 }), strong: () => ({ conversion: tr, priority: 0 }), sub: () => ({ conversion: tr, priority: 0 }), sup: () => ({ conversion: tr, priority: 0 }), u: () => ({ conversion: tr, priority: 0 }) };
7513
7513
  }
7514
7514
  static importJSON(e) {
7515
7515
  const t = Ve(e.text);
@@ -7603,7 +7603,7 @@ class zr extends vs {
7603
7603
  lt();
7604
7604
  const t = this.getLatest(), n = t.getTextContent(), s = t.__key, o = sr(), i = new Set(e), l = [], a = n.length;
7605
7605
  let u = "";
7606
- for (let E = 0; E < a; E++) u !== "" && i.has(E) && (l.push(u), u = ""), u += n[E];
7606
+ for (let S = 0; S < a; S++) u !== "" && i.has(S) && (l.push(u), u = ""), u += n[S];
7607
7607
  u !== "" && l.push(u);
7608
7608
  const c = l.length;
7609
7609
  if (c === 0) return [];
@@ -7615,23 +7615,23 @@ class zr extends vs {
7615
7615
  t.isSegmented() ? (h = Ve(d), h.__format = g, h.__style = m, h.__detail = _, w = !0) : (h = t.getWritable(), h.__text = d);
7616
7616
  const v = V(), A = [h];
7617
7617
  let C = d.length;
7618
- for (let E = 1; E < c; E++) {
7619
- const y = l[E], b = y.length, D = Ve(y).getWritable();
7618
+ for (let S = 1; S < c; S++) {
7619
+ const y = l[S], b = y.length, D = Ve(y).getWritable();
7620
7620
  D.__format = g, D.__style = m, D.__detail = _;
7621
- const S = D.__key, M = C + b;
7621
+ const E = D.__key, M = C + b;
7622
7622
  if (R(v)) {
7623
7623
  const T = v.anchor, B = v.focus;
7624
- T.key === s && T.type === "text" && T.offset > C && T.offset <= M && (T.key = S, T.offset -= C, v.dirty = !0), B.key === s && B.type === "text" && B.offset > C && B.offset <= M && (B.key = S, B.offset -= C, v.dirty = !0);
7624
+ T.key === s && T.type === "text" && T.offset > C && T.offset <= M && (T.key = E, T.offset -= C, v.dirty = !0), B.key === s && B.type === "text" && B.offset > C && B.offset <= M && (B.key = E, B.offset -= C, v.dirty = !0);
7625
7625
  }
7626
- o === s && Qe(S), C = M, A.push(D);
7626
+ o === s && Qe(E), C = M, A.push(D);
7627
7627
  }
7628
7628
  if (f !== null) {
7629
7629
  (function(b) {
7630
- const D = b.getPreviousSibling(), S = b.getNextSibling();
7631
- D !== null && Zn(D), S !== null && Zn(S);
7630
+ const D = b.getPreviousSibling(), E = b.getNextSibling();
7631
+ D !== null && Zn(D), E !== null && Zn(E);
7632
7632
  })(this);
7633
- const E = f.getWritable(), y = this.getIndexWithinParent();
7634
- w ? (E.splice(y, 0, A), this.remove()) : E.splice(y, 1, A), R(v) && os(v, f, y, c - 1);
7633
+ const S = f.getWritable(), y = this.getIndexWithinParent();
7634
+ w ? (S.splice(y, 0, A), this.remove()) : S.splice(y, 1, A), R(v) && os(v, f, y, c - 1);
7635
7635
  }
7636
7636
  return A;
7637
7637
  }
@@ -7662,17 +7662,17 @@ function Ac(r) {
7662
7662
  return { forChild: Ii(e.style, t ? void 0 : "bold"), node: null };
7663
7663
  }
7664
7664
  const Do = /* @__PURE__ */ new WeakMap();
7665
- function Ec(r) {
7665
+ function Sc(r) {
7666
7666
  return r.nodeName === "PRE" || r.nodeType === vn && r.style !== void 0 && r.style.whiteSpace !== void 0 && r.style.whiteSpace.startsWith("pre");
7667
7667
  }
7668
- function Sc(r) {
7668
+ function Ec(r) {
7669
7669
  const e = r;
7670
7670
  r.parentElement === null && O(129);
7671
7671
  let t = e.textContent || "";
7672
7672
  if (function(n) {
7673
7673
  let s, o = n.parentNode;
7674
7674
  const i = [n];
7675
- for (; o !== null && (s = Do.get(o)) === void 0 && !Ec(o); ) i.push(o), o = o.parentNode;
7675
+ for (; o !== null && (s = Do.get(o)) === void 0 && !Sc(o); ) i.push(o), o = o.parentNode;
7676
7676
  const l = s === void 0 ? o : s;
7677
7677
  for (let a = 0; a < i.length; a++) Do.set(i[a], l);
7678
7678
  return l;
@@ -7682,7 +7682,7 @@ function Sc(r) {
7682
7682
  const l = n[i];
7683
7683
  l === `
7684
7684
  ` || l === `\r
7685
- ` ? s.push(vr()) : l === " " ? s.push(En()) : l !== "" && s.push(Ve(l));
7685
+ ` ? s.push(vr()) : l === " " ? s.push(Sn()) : l !== "" && s.push(Ve(l));
7686
7686
  }
7687
7687
  return { node: s };
7688
7688
  }
@@ -7760,7 +7760,7 @@ class An extends zr {
7760
7760
  return null;
7761
7761
  }
7762
7762
  static importJSON(e) {
7763
- const t = En();
7763
+ const t = Sn();
7764
7764
  return t.setFormat(e.format), t.setStyle(e.style), t;
7765
7765
  }
7766
7766
  exportJSON() {
@@ -7782,7 +7782,7 @@ class An extends zr {
7782
7782
  return !1;
7783
7783
  }
7784
7784
  }
7785
- function En() {
7785
+ function Sn() {
7786
7786
  return Ut(new An());
7787
7787
  }
7788
7788
  function Tc(r) {
@@ -7836,7 +7836,7 @@ function Us(r, e) {
7836
7836
  }
7837
7837
  r.set(t, n, s);
7838
7838
  }
7839
- function Eo(r, e) {
7839
+ function So(r, e) {
7840
7840
  if (N(e)) {
7841
7841
  const t = e.getLastDescendant();
7842
7842
  N(t) || $(t) ? Us(r, t) : Us(r, e);
@@ -8000,7 +8000,7 @@ class cr {
8000
8000
  const i = t[o];
8001
8001
  i === `
8002
8002
  ` || i === `\r
8003
- ` ? n.push(vr()) : i === " " ? n.push(En()) : n.push(Ve(i));
8003
+ ` ? n.push(vr()) : i === " " ? n.push(Sn()) : n.push(Ve(i));
8004
8004
  }
8005
8005
  this.insertNodes(n);
8006
8006
  }
@@ -8008,8 +8008,8 @@ class cr {
8008
8008
  const t = this.anchor, n = this.focus, s = this.format, o = this.style;
8009
8009
  let i = t, l = n;
8010
8010
  !this.isCollapsed() && n.isBefore(t) && (i = n, l = t), i.type === "element" && function(_, w, v, A) {
8011
- const C = _.getNode(), E = C.getChildAtIndex(_.offset), y = Ve(), b = nt(C) ? We().append(y) : y;
8012
- y.setFormat(v), y.setStyle(A), E === null ? C.append(b) : E.insertBefore(b), _.is(w) && w.set(y.__key, 0, "text"), _.set(y.__key, 0, "text");
8011
+ const C = _.getNode(), S = C.getChildAtIndex(_.offset), y = Ve(), b = nt(C) ? We().append(y) : y;
8012
+ y.setFormat(v), y.setStyle(A), S === null ? C.append(b) : S.insertBefore(b), _.is(w) && w.set(y.__key, 0, "text"), _.set(y.__key, 0, "text");
8013
8013
  }(i, l, s, o);
8014
8014
  const a = i.offset;
8015
8015
  let u = l.offset;
@@ -8073,17 +8073,17 @@ class cr {
8073
8073
  D.canBeEmpty() || D.getChildrenSize() !== 1 ? m.remove() : D.remove();
8074
8074
  }
8075
8075
  else _.add(m.__key);
8076
- const C = v.getChildren(), E = new Set(c), y = w.is(v), b = w.isInline() && f.getNextSibling() === null ? w : f;
8076
+ const C = v.getChildren(), S = new Set(c), y = w.is(v), b = w.isInline() && f.getNextSibling() === null ? w : f;
8077
8077
  for (let D = C.length - 1; D >= 0; D--) {
8078
- const S = C[D];
8079
- if (S.is(f) || N(S) && S.isParentOf(f)) break;
8080
- S.isAttached() && (!E.has(S) || S.is(A) ? y || b.insertAfter(S, !1) : S.remove());
8078
+ const E = C[D];
8079
+ if (E.is(f) || N(E) && E.isParentOf(f)) break;
8080
+ E.isAttached() && (!S.has(E) || E.is(A) ? y || b.insertAfter(E, !1) : E.remove());
8081
8081
  }
8082
8082
  if (!y) {
8083
- let D = v, S = null;
8083
+ let D = v, E = null;
8084
8084
  for (; D !== null; ) {
8085
8085
  const M = D.getChildren(), T = M.length;
8086
- (T === 0 || M[T - 1].is(S)) && (_.delete(D.__key), S = D), D = D.getParent();
8086
+ (T === 0 || M[T - 1].is(E)) && (_.delete(D.__key), E = D), D = D.getParent();
8087
8087
  }
8088
8088
  }
8089
8089
  if (f.isToken()) if (a === h) f.select();
@@ -8093,8 +8093,8 @@ class cr {
8093
8093
  }
8094
8094
  else f = f.spliceText(a, h - a, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
8095
8095
  for (let D = 1; D < d; D++) {
8096
- const S = c[D], M = S.__key;
8097
- _.has(M) || S.remove();
8096
+ const E = c[D], M = E.__key;
8097
+ _.has(M) || E.remove();
8098
8098
  }
8099
8099
  }
8100
8100
  }
@@ -8128,10 +8128,10 @@ class cr {
8128
8128
  const n = this.getNodes(), s = [];
8129
8129
  for (const C of n) $(C) && s.push(C);
8130
8130
  const o = (C) => {
8131
- n.forEach((E) => {
8132
- if (Ir(E)) {
8133
- const y = E.getFormatFlags(e, C);
8134
- E.setTextFormat(y);
8131
+ n.forEach((S) => {
8132
+ if (Ir(S)) {
8133
+ const y = S.getFormatFlags(e, C);
8134
+ S.setTextFormat(y);
8135
8135
  }
8136
8136
  });
8137
8137
  }, i = s.length;
@@ -8148,8 +8148,8 @@ class cr {
8148
8148
  if (g === v) return;
8149
8149
  if (hr(h) || g === 0 && v === h.getTextContentSize()) h.setFormat(m);
8150
8150
  else {
8151
- const C = h.splitText(g, v), E = g === 0 ? C[0] : C[1];
8152
- E.setFormat(m), c.type === "text" && c.set(E.__key, 0, "text"), d.type === "text" && d.set(E.__key, v - g, "text");
8151
+ const C = h.splitText(g, v), S = g === 0 ? C[0] : C[1];
8152
+ S.setFormat(m), c.type === "text" && c.set(S.__key, 0, "text"), d.type === "text" && d.set(S.__key, v - g, "text");
8153
8153
  }
8154
8154
  return void (this.format = m);
8155
8155
  }
@@ -8157,8 +8157,8 @@ class cr {
8157
8157
  const A = w.getFormatFlags(e, m);
8158
8158
  v > 0 && (v === w.getTextContentSize() || hr(w) || ([w] = w.splitText(v)), w.setFormat(A));
8159
8159
  for (let C = f + 1; C < _; C++) {
8160
- const E = s[C], y = E.getFormatFlags(e, A);
8161
- E.setFormat(y);
8160
+ const S = s[C], y = S.getFormatFlags(e, A);
8161
+ S.setFormat(y);
8162
8162
  }
8163
8163
  c.type === "text" && c.set(h.__key, g, "text"), d.type === "text" && d.set(w.__key, v, "text"), this.format = m | A;
8164
8164
  }
@@ -8203,7 +8203,7 @@ class cr {
8203
8203
  const A = [m];
8204
8204
  for (; v !== w; ) v.getNextSibling() || O(140), v = v.getNextSibling(), A.push(v);
8205
8205
  let C = g;
8206
- for (const E of A) C = C.insertAfter(E);
8206
+ for (const S of A) C = C.insertAfter(S);
8207
8207
  }(n, c));
8208
8208
  const f = Jr(i, rr);
8209
8209
  a && N(f) && (a.canMergeWhenEmpty() || rr(u)) && (f.append(...a.getChildren()), a.remove()), N(n) && n.isEmpty() && n.remove(), i.selectEnd();
@@ -8290,8 +8290,8 @@ class cr {
8290
8290
  N(v) ? v.selectEnd() : v.getParentOrThrow().selectEnd();
8291
8291
  }
8292
8292
  u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(v) {
8293
- const A = v.focus, C = v.anchor, E = C.key, y = C.offset, b = C.type;
8294
- nr(C, A.key, A.offset, A.type), nr(A, E, y, b), v._cachedNodes = null;
8293
+ const A = v.focus, C = v.anchor, S = C.key, y = C.offset, b = C.type;
8294
+ nr(C, A.key, A.offset, A.type), nr(A, S, y, b), v._cachedNodes = null;
8295
8295
  }(this);
8296
8296
  }
8297
8297
  }
@@ -8374,7 +8374,7 @@ class cr {
8374
8374
  function Ot(r) {
8375
8375
  return r instanceof ws;
8376
8376
  }
8377
- function So(r) {
8377
+ function Eo(r) {
8378
8378
  const e = r.offset;
8379
8379
  if (r.type === "text") return e;
8380
8380
  const t = r.getNode();
@@ -8384,7 +8384,7 @@ function ci(r) {
8384
8384
  const e = r.getStartEndPoints();
8385
8385
  if (e === null) return [0, 0];
8386
8386
  const [t, n] = e;
8387
- return t.type === "element" && n.type === "element" && t.key === n.key && t.offset === n.offset ? [0, 0] : [So(t), So(n)];
8387
+ return t.type === "element" && n.type === "element" && t.key === n.key && t.offset === n.offset ? [0, 0] : [Eo(t), Eo(n)];
8388
8388
  }
8389
8389
  function ko(r, e, t) {
8390
8390
  const n = r, s = n.getTextContent().split(/(?=\s)/g), o = s.length;
@@ -8508,7 +8508,7 @@ function $i(r, e, t, n) {
8508
8508
  function V() {
8509
8509
  return Xt()._selection;
8510
8510
  }
8511
- function Sn() {
8511
+ function En() {
8512
8512
  return Pe()._editorState._selection;
8513
8513
  }
8514
8514
  function os(r, e, t, n = 1) {
@@ -8571,15 +8571,15 @@ function Fc(r, e, t, n, s, o, i) {
8571
8571
  const l = n.anchorNode, a = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
8572
8572
  if (s.has("collaboration") && d !== o || d !== null && Bi(d)) return;
8573
8573
  if (!R(e)) return void (r !== null && wn(t, l, a) && n.removeAllRanges());
8574
- const f = e.anchor, h = e.focus, g = f.key, m = h.key, _ = es(t, g), w = es(t, m), v = f.offset, A = h.offset, C = e.format, E = e.style, y = e.isCollapsed();
8575
- let b = _, D = w, S = !1;
8574
+ const f = e.anchor, h = e.focus, g = f.key, m = h.key, _ = es(t, g), w = es(t, m), v = f.offset, A = h.offset, C = e.format, S = e.style, y = e.isCollapsed();
8575
+ let b = _, D = w, E = !1;
8576
8576
  if (f.type === "text") {
8577
8577
  b = Yn(_);
8578
8578
  const I = f.getNode();
8579
- S = I.getFormat() !== C || I.getStyle() !== E;
8580
- } else R(r) && r.anchor.type === "text" && (S = !0);
8579
+ E = I.getFormat() !== C || I.getStyle() !== S;
8580
+ } else R(r) && r.anchor.type === "text" && (E = !0);
8581
8581
  var M, T, B, F, j;
8582
- if (h.type === "text" && (D = Yn(w)), b !== null && D !== null && (y && (r === null || S || R(r) && (r.format !== C || r.style !== E)) && (M = C, T = E, B = v, F = g, j = performance.now(), ra = [M, T, B, F, j]), u !== v || c !== A || l !== b || a !== D || n.type === "Range" && y || (d !== null && o.contains(d) || o.focus({ preventScroll: !0 }), f.type === "element"))) {
8582
+ if (h.type === "text" && (D = Yn(w)), b !== null && D !== null && (y && (r === null || E || R(r) && (r.format !== C || r.style !== S)) && (M = C, T = S, B = v, F = g, j = performance.now(), ra = [M, T, B, F, j]), u !== v || c !== A || l !== b || a !== D || n.type === "Range" && y || (d !== null && o.contains(d) || o.focus({ preventScroll: !0 }), f.type === "element"))) {
8583
8583
  try {
8584
8584
  n.setBaseAndExtent(b, v, D, A);
8585
8585
  } catch {
@@ -8621,7 +8621,7 @@ function Fc(r, e, t, n, s, o, i) {
8621
8621
  }
8622
8622
  }
8623
8623
  function fa(r) {
8624
- let e = V() || Sn();
8624
+ let e = V() || En();
8625
8625
  e === null && (e = je().selectEnd()), e.insertNodes(r);
8626
8626
  }
8627
8627
  function Ws(r) {
@@ -8753,10 +8753,10 @@ function ir(r, e) {
8753
8753
  const m = r._dirtyLeaves, _ = r._dirtyElements, w = r._normalizedNodes, v = r._updateTags, A = r._deferred;
8754
8754
  a && (r._dirtyType = xr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(y, b) {
8755
8755
  const D = y._decorators;
8756
- let S = y._pendingDecorators || D;
8756
+ let E = y._pendingDecorators || D;
8757
8757
  const M = b._nodeMap;
8758
8758
  let T;
8759
- for (T in S) M.has(T) || (S === D && (S = zl(y)), delete S[T]);
8759
+ for (T in E) M.has(T) || (E === D && (E = zl(y)), delete E[T]);
8760
8760
  }(r, t);
8761
8761
  const C = s ? null : yt(r._window);
8762
8762
  if (r._editable && C !== null && (a || l === null || l.dirty)) {
@@ -8771,23 +8771,23 @@ function ir(r, e) {
8771
8771
  Je = d, He = u;
8772
8772
  }
8773
8773
  }
8774
- g !== null && function(y, b, D, S, M) {
8774
+ g !== null && function(y, b, D, E, M) {
8775
8775
  const T = Array.from(y._listeners.mutation), B = T.length;
8776
8776
  for (let F = 0; F < B; F++) {
8777
8777
  const [j, I] = T[F], X = b.get(I);
8778
- X !== void 0 && j(X, { dirtyLeaves: S, prevEditorState: M, updateTags: D });
8778
+ X !== void 0 && j(X, { dirtyLeaves: E, prevEditorState: M, updateTags: D });
8779
8779
  }
8780
8780
  }(r, g, v, m, o), R(l) || l === null || i !== null && i.is(l) || r.dispatchCommand(yi, void 0);
8781
- const E = r._pendingDecorators;
8782
- E !== null && (r._decorators = E, r._pendingDecorators = null, cn("decorator", r, !0, E)), function(y, b, D) {
8783
- const S = ao(b), M = ao(D);
8784
- S !== M && cn("textcontent", y, !0, M);
8781
+ const S = r._pendingDecorators;
8782
+ S !== null && (r._decorators = S, r._pendingDecorators = null, cn("decorator", r, !0, S)), function(y, b, D) {
8783
+ const E = ao(b), M = ao(D);
8784
+ E !== M && cn("textcontent", y, !0, M);
8785
8785
  }(r, e || o, t), cn("update", r, !0, { dirtyElements: _, dirtyLeaves: m, editorState: t, normalizedNodes: w, prevEditorState: e || o, tags: v }), function(y, b) {
8786
8786
  if (y._deferred = [], b.length !== 0) {
8787
8787
  const D = y._updating;
8788
8788
  y._updating = !0;
8789
8789
  try {
8790
- for (let S = 0; S < b.length; S++) b[S]();
8790
+ for (let E = 0; E < b.length; E++) b[E]();
8791
8791
  } finally {
8792
8792
  y._updating = D;
8793
8793
  }
@@ -8797,8 +8797,8 @@ function ir(r, e) {
8797
8797
  if (b.length !== 0) {
8798
8798
  const D = b.shift();
8799
8799
  if (D) {
8800
- const [S, M] = D;
8801
- ya(y, S, M);
8800
+ const [E, M] = D;
8801
+ ya(y, E, M);
8802
8802
  }
8803
8803
  }
8804
8804
  }(r);
@@ -8871,30 +8871,30 @@ function ya(r, e, t) {
8871
8871
  e(), o = Mo(r, o), function(w, v) {
8872
8872
  const A = v.getEditorState()._selection, C = w._selection;
8873
8873
  if (R(C)) {
8874
- const E = C.anchor, y = C.focus;
8874
+ const S = C.anchor, y = C.focus;
8875
8875
  let b;
8876
- if (E.type === "text" && (b = E.getNode(), b.selectionTransform(A, C)), y.type === "text") {
8876
+ if (S.type === "text" && (b = S.getNode(), b.selectionTransform(A, C)), y.type === "text") {
8877
8877
  const D = y.getNode();
8878
8878
  b !== D && D.selectionTransform(A, C);
8879
8879
  }
8880
8880
  }
8881
8881
  }(a, r), r._dirtyType !== xr && (o ? function(w, v) {
8882
8882
  const A = v._dirtyLeaves, C = w._nodeMap;
8883
- for (const E of A) {
8884
- const y = C.get(E);
8883
+ for (const S of A) {
8884
+ const y = C.get(S);
8885
8885
  $(y) && y.isAttached() && y.isSimpleText() && !y.isUnmergeable() && oo(y);
8886
8886
  }
8887
8887
  }(a, r) : function(w, v) {
8888
- const A = v._dirtyLeaves, C = v._dirtyElements, E = w._nodeMap, y = sr(), b = /* @__PURE__ */ new Map();
8889
- let D = A, S = D.size, M = C, T = M.size;
8890
- for (; S > 0 || T > 0; ) {
8891
- if (S > 0) {
8888
+ const A = v._dirtyLeaves, C = v._dirtyElements, S = w._nodeMap, y = sr(), b = /* @__PURE__ */ new Map();
8889
+ let D = A, E = D.size, M = C, T = M.size;
8890
+ for (; E > 0 || T > 0; ) {
8891
+ if (E > 0) {
8892
8892
  v._dirtyLeaves = /* @__PURE__ */ new Set();
8893
8893
  for (const B of D) {
8894
- const F = E.get(B);
8894
+ const F = S.get(B);
8895
8895
  $(F) && F.isAttached() && F.isSimpleText() && !F.isUnmergeable() && oo(F), F !== void 0 && Po(F, y) && Ro(v, F, b), A.add(B);
8896
8896
  }
8897
- if (D = v._dirtyLeaves, S = D.size, S > 0) {
8897
+ if (D = v._dirtyLeaves, E = D.size, E > 0) {
8898
8898
  Un++;
8899
8899
  continue;
8900
8900
  }
@@ -8903,22 +8903,22 @@ function ya(r, e, t) {
8903
8903
  for (const B of M) {
8904
8904
  const F = B[0], j = B[1];
8905
8905
  if (F !== "root" && !j) continue;
8906
- const I = E.get(F);
8906
+ const I = S.get(F);
8907
8907
  I !== void 0 && Po(I, y) && Ro(v, I, b), C.set(F, j);
8908
8908
  }
8909
- D = v._dirtyLeaves, S = D.size, M = v._dirtyElements, T = M.size, Un++;
8909
+ D = v._dirtyLeaves, E = D.size, M = v._dirtyElements, T = M.size, Un++;
8910
8910
  }
8911
8911
  v._dirtyLeaves = A, v._dirtyElements = C;
8912
8912
  }(a, r), Mo(r), function(w, v, A, C) {
8913
- const E = w._nodeMap, y = v._nodeMap, b = [];
8913
+ const S = w._nodeMap, y = v._nodeMap, b = [];
8914
8914
  for (const [D] of C) {
8915
- const S = y.get(D);
8916
- S !== void 0 && (S.isAttached() || (N(S) && Kl(S, D, E, y, b, C), E.has(D) || C.delete(D), b.push(D)));
8915
+ const E = y.get(D);
8916
+ E !== void 0 && (E.isAttached() || (N(E) && Kl(E, D, S, y, b, C), S.has(D) || C.delete(D), b.push(D)));
8917
8917
  }
8918
8918
  for (const D of b) y.delete(D);
8919
8919
  for (const D of A) {
8920
- const S = y.get(D);
8921
- S === void 0 || S.isAttached() || (E.has(D) || A.delete(D), y.delete(D));
8920
+ const E = y.get(D);
8921
+ E === void 0 || E.isAttached() || (S.has(D) || A.delete(D), y.delete(D));
8922
8922
  }
8923
8923
  }(l, a, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (a._flushSync = !0);
8924
8924
  const _ = a._selection;
@@ -9577,22 +9577,22 @@ function Mc(r) {
9577
9577
  const y = _;
9578
9578
  _ = y.replace, w = y.with, v = y.withKlass || null;
9579
9579
  }
9580
- const A = _.getType(), C = _.transform(), E = /* @__PURE__ */ new Set();
9581
- C !== null && E.add(C), h.set(A, { exportDOM: d && d.export ? d.export.get(_) : void 0, klass: _, replace: w, replaceWithKlass: v, transforms: E });
9580
+ const A = _.getType(), C = _.transform(), S = /* @__PURE__ */ new Set();
9581
+ C !== null && S.add(C), h.set(A, { exportDOM: d && d.export ? d.export.get(_) : void 0, klass: _, replace: w, replaceWithKlass: v, transforms: S });
9582
9582
  }
9583
9583
  }
9584
9584
  const g = new Ds(i, s, h, { disableEvents: o, namespace: l, theme: n }, c || console.error, function(m, _) {
9585
9585
  const w = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Set(), A = (C) => {
9586
- Object.keys(C).forEach((E) => {
9587
- let y = w.get(E);
9588
- y === void 0 && (y = [], w.set(E, y)), y.push(C[E]);
9586
+ Object.keys(C).forEach((S) => {
9587
+ let y = w.get(S);
9588
+ y === void 0 && (y = [], w.set(S, y)), y.push(C[S]);
9589
9589
  });
9590
9590
  };
9591
9591
  return m.forEach((C) => {
9592
- const E = C.klass.importDOM;
9593
- if (E == null || v.has(E)) return;
9594
- v.add(E);
9595
- const y = E.call(C.klass);
9592
+ const S = C.klass.importDOM;
9593
+ if (S == null || v.has(S)) return;
9594
+ v.add(S);
9595
+ const y = S.call(C.klass);
9596
9596
  y !== null && A(y);
9597
9597
  }), _ && A(_), w;
9598
9598
  }(h, d ? d.import : void 0), f);
@@ -9746,7 +9746,7 @@ class Ds {
9746
9746
  case "blur":
9747
9747
  return w && W(a, Mu, _);
9748
9748
  case "drop":
9749
- return w && W(a, Sl, _);
9749
+ return w && W(a, El, _);
9750
9750
  }
9751
9751
  };
9752
9752
  l.addEventListener(h, m), d.push(() => {
@@ -9820,7 +9820,7 @@ class Ds {
9820
9820
  Ds.version = "0.21.0+prod.esm";
9821
9821
  const va = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Ic = va ? $r : De, Mn = { tag: "history-merge" };
9822
9822
  function $c({ initialConfig: r, children: e }) {
9823
- const t = St(() => {
9823
+ const t = Et(() => {
9824
9824
  const { theme: n, namespace: s, nodes: o, onError: i, editorState: l, html: a } = r, u = Du(null, n), c = Mc({ editable: r.editable, html: a, namespace: s, nodes: o, onError: (d) => i(d, c), theme: n });
9825
9825
  return function(d, f) {
9826
9826
  if (f !== null) {
@@ -9861,7 +9861,7 @@ function qc(r) {
9861
9861
  }
9862
9862
  function Uc() {
9863
9863
  return function(r) {
9864
- const [e] = Tt(), t = St(() => r(e), [e, r]), [n, s] = K(() => t.initialValueFn()), o = ye(n);
9864
+ const [e] = Tt(), t = Et(() => r(e), [e, r]), [n, s] = K(() => t.initialValueFn()), o = ye(n);
9865
9865
  return zc(() => {
9866
9866
  const { initialValueFn: i, subscribe: l } = t, a = i();
9867
9867
  return o.current !== a && (o.current = a, s(a)), l((u) => {
@@ -10011,7 +10011,7 @@ function Bn(r, ...e) {
10011
10011
  const t = Aa(...e);
10012
10012
  t.length > 0 && r.classList.add(...t);
10013
10013
  }
10014
- function Ea(r, ...e) {
10014
+ function Sa(r, ...e) {
10015
10015
  const t = Aa(...e);
10016
10016
  t.length > 0 && r.classList.remove(...t);
10017
10017
  }
@@ -10079,7 +10079,7 @@ function ld(r) {
10079
10079
  window.removeEventListener("message", t, !0);
10080
10080
  };
10081
10081
  }
10082
- function Sa(r, e) {
10082
+ function Ea(r, e) {
10083
10083
  const t = e.body ? e.body.childNodes : [];
10084
10084
  let n = [];
10085
10085
  const s = [];
@@ -10208,7 +10208,7 @@ function Wo(r, e, t) {
10208
10208
  const i = new DOMParser().parseFromString(function(l) {
10209
10209
  return window.trustedTypes && window.trustedTypes.createPolicy ? window.trustedTypes.createPolicy("lexical", { createHTML: (a) => a }).createHTML(l) : l;
10210
10210
  }(s), "text/html");
10211
- return Go(t, Sa(t, i), e);
10211
+ return Go(t, Ea(t, i), e);
10212
10212
  } catch {
10213
10213
  }
10214
10214
  const o = r.getData("text/plain") || r.getData("text/uri-list");
@@ -10221,7 +10221,7 @@ function Wo(r, e, t) {
10221
10221
  const u = i[l];
10222
10222
  u === `
10223
10223
  ` || u === `\r
10224
- ` ? a.insertParagraph() : u === " " ? a.insertNodes([En()]) : a.insertText(u);
10224
+ ` ? a.insertParagraph() : u === " " ? a.insertNodes([Sn()]) : a.insertText(u);
10225
10225
  }
10226
10226
  }
10227
10227
  } else e.insertRawText(o);
@@ -10338,12 +10338,12 @@ function Ho(r, e) {
10338
10338
  return null;
10339
10339
  }
10340
10340
  const Ur = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, yd = Ur && "documentMode" in document ? document.documentMode : null, xd = !(!Ur || !("InputEvent" in window) || yd) && "getTargetRanges" in new window.InputEvent("input"), _d = Ur && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Jo = Ur && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, bd = Ur && /^(?=.*Chrome).*/i.test(navigator.userAgent), vd = Ur && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !bd, Qo = _n();
10341
- class Es extends Zt {
10341
+ class Ss extends Zt {
10342
10342
  static getType() {
10343
10343
  return "quote";
10344
10344
  }
10345
10345
  static clone(e) {
10346
- return new Es(e.__key);
10346
+ return new Ss(e.__key);
10347
10347
  }
10348
10348
  constructor(e) {
10349
10349
  super(e);
@@ -10389,14 +10389,14 @@ class Es extends Zt {
10389
10389
  }
10390
10390
  }
10391
10391
  function Gi() {
10392
- return Ut(new Es());
10392
+ return Ut(new Ss());
10393
10393
  }
10394
- class Ss extends Zt {
10394
+ class Es extends Zt {
10395
10395
  static getType() {
10396
10396
  return "heading";
10397
10397
  }
10398
10398
  static clone(e) {
10399
- return new Ss(e.__tag, e.__key);
10399
+ return new Es(e.__tag, e.__key);
10400
10400
  }
10401
10401
  constructor(e, t) {
10402
10402
  super(t), this.__tag = e;
@@ -10468,7 +10468,7 @@ function wd(r) {
10468
10468
  return r.style !== null && (e.setFormat(r.style.textAlign), Mi(r, e)), { node: e };
10469
10469
  }
10470
10470
  function tn(r) {
10471
- return Ut(new Ss(r));
10471
+ return Ut(new Es(r));
10472
10472
  }
10473
10473
  function In(r) {
10474
10474
  let e = null;
@@ -10523,7 +10523,7 @@ function Cd(r) {
10523
10523
  }, he), r.registerCommand(Js, () => {
10524
10524
  const e = V();
10525
10525
  return !!R(e) && (e.removeText(), !0);
10526
- }, he), r.registerCommand(Et, (e) => {
10526
+ }, he), r.registerCommand(St, (e) => {
10527
10527
  const t = V();
10528
10528
  return !!R(t) && (t.formatText(e), !0);
10529
10529
  }, he), r.registerCommand(ju, (e) => {
@@ -10541,7 +10541,7 @@ function Cd(r) {
10541
10541
  }, he), r.registerCommand(fn, () => {
10542
10542
  const e = V();
10543
10543
  return !!R(e) && (e.insertParagraph(), !0);
10544
- }, he), r.registerCommand(Nu, () => (fa([En()]), !0), he), r.registerCommand(Fu, () => Xo((e) => {
10544
+ }, he), r.registerCommand(Nu, () => (fa([Sn()]), !0), he), r.registerCommand(Fu, () => Xo((e) => {
10545
10545
  const t = e.getIndent();
10546
10546
  e.setIndent(t + 1);
10547
10547
  }), he), r.registerCommand(ro, () => Xo((e) => {
@@ -10598,7 +10598,7 @@ function Cd(r) {
10598
10598
  if (!R(t)) return !1;
10599
10599
  const { anchor: n } = t, s = n.getNode();
10600
10600
  return t.isCollapsed() && n.offset === 0 && !nt(s) && od(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(ro, void 0)) : (!Jo || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(gr, !0));
10601
- }, he), r.registerCommand(El, (e) => {
10601
+ }, he), r.registerCommand(Sl, (e) => {
10602
10602
  if ($n(e.target)) return !1;
10603
10603
  const t = V();
10604
10604
  return !!R(t) && (e.preventDefault(), r.dispatchCommand(gr, !1));
@@ -10613,7 +10613,7 @@ function Cd(r) {
10613
10613
  }, he), r.registerCommand(Al, () => {
10614
10614
  const e = V();
10615
10615
  return !!R(e) && (r.blur(), !0);
10616
- }, he), r.registerCommand(Sl, (e) => {
10616
+ }, he), r.registerCommand(El, (e) => {
10617
10617
  const [, t] = In(e);
10618
10618
  if (t.length > 0) {
10619
10619
  const s = Ho(e.clientX, e.clientY);
@@ -10675,7 +10675,7 @@ function Dd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
10675
10675
  });
10676
10676
  }), [o]), De(() => {
10677
10677
  a(o.getDecorators());
10678
- }, [o]), St(() => {
10678
+ }, [o]), Et(() => {
10679
10679
  const u = [], c = Object.keys(l);
10680
10680
  for (let d = 0; d < c.length; d++) {
10681
10681
  const f = c[d], h = p.jsx(i, { onError: (m) => o._onError(m), children: p.jsx(Va, { fallback: null, children: l[f] }) }), g = o.getElementByKey(f);
@@ -10706,28 +10706,28 @@ function Ad({ content: r }) {
10706
10706
  return t ? typeof r == "function" ? r(n) : r : null;
10707
10707
  }
10708
10708
  const ja = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? $r : De;
10709
- function Ed({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: g, id: m, role: _ = "textbox", spellCheck: w = !0, style: v, tabIndex: A, "data-testid": C, ...E }, y) {
10710
- const [b, D] = K(r.isEditable()), S = re((T) => {
10709
+ function Sd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: g, id: m, role: _ = "textbox", spellCheck: w = !0, style: v, tabIndex: A, "data-testid": C, ...S }, y) {
10710
+ const [b, D] = K(r.isEditable()), E = re((T) => {
10711
10711
  T && T.ownerDocument && T.ownerDocument.defaultView ? r.setRootElement(T) : r.setRootElement(null);
10712
- }, [r]), M = St(() => /* @__PURE__ */ function(...T) {
10712
+ }, [r]), M = Et(() => /* @__PURE__ */ function(...T) {
10713
10713
  return (B) => {
10714
10714
  T.forEach((F) => {
10715
10715
  typeof F == "function" ? F(B) : F != null && (F.current = B);
10716
10716
  });
10717
10717
  };
10718
- }(y, S), [S, y]);
10718
+ }(y, E), [E, y]);
10719
10719
  return ja(() => (D(r.isEditable()), r.registerEditableListener((T) => {
10720
10720
  D(T);
10721
- })), [r]), p.jsx("div", { "aria-activedescendant": b ? e : void 0, "aria-autocomplete": b ? t : "none", "aria-controls": b ? n : void 0, "aria-describedby": s, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": b && _ === "combobox" ? !!i : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": b ? d : void 0, "aria-readonly": !b || void 0, "aria-required": f, autoCapitalize: h, className: g, contentEditable: b, "data-testid": C, id: m, ref: M, role: b ? _ : void 0, spellCheck: w, style: v, tabIndex: A, ...E });
10721
+ })), [r]), p.jsx("div", { "aria-activedescendant": b ? e : void 0, "aria-autocomplete": b ? t : "none", "aria-controls": b ? n : void 0, "aria-describedby": s, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": b && _ === "combobox" ? !!i : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": b ? d : void 0, "aria-readonly": !b || void 0, "aria-required": f, autoCapitalize: h, className: g, contentEditable: b, "data-testid": C, id: m, ref: M, role: b ? _ : void 0, spellCheck: w, style: v, tabIndex: A, ...S });
10722
10722
  }
10723
- const Sd = pl(Ed);
10723
+ const Ed = pl(Sd);
10724
10724
  function el(r) {
10725
10725
  return r.getEditorState().read(wa(r.isComposing()));
10726
10726
  }
10727
10727
  const kd = pl(Td);
10728
10728
  function Td(r, e) {
10729
10729
  const { placeholder: t, ...n } = r, [s] = Tt();
10730
- return p.jsxs(p.Fragment, { children: [p.jsx(Sd, { editor: s, ...n, ref: e }), t != null && p.jsx(Bd, { editor: s, content: t })] });
10730
+ return p.jsxs(p.Fragment, { children: [p.jsx(Ed, { editor: s, ...n, ref: e }), t != null && p.jsx(Bd, { editor: s, content: t })] });
10731
10731
  }
10732
10732
  function Bd({ content: r, editor: e }) {
10733
10733
  const t = function(i) {
@@ -10757,17 +10757,17 @@ function Ld(r, e, t, n, s) {
10757
10757
  if (s) return Nd;
10758
10758
  if (!(R(o) && R(i) && i.isCollapsed() && o.isCollapsed())) return At;
10759
10759
  const l = function(w, v, A) {
10760
- const C = w._nodeMap, E = [];
10760
+ const C = w._nodeMap, S = [];
10761
10761
  for (const y of v) {
10762
10762
  const b = C.get(y);
10763
- b !== void 0 && E.push(b);
10763
+ b !== void 0 && S.push(b);
10764
10764
  }
10765
10765
  for (const [y, b] of A) {
10766
10766
  if (!b) continue;
10767
10767
  const D = C.get(y);
10768
- D === void 0 || nt(D) || E.push(D);
10768
+ D === void 0 || nt(D) || S.push(D);
10769
10769
  }
10770
- return E;
10770
+ return S;
10771
10771
  }(e, t, n);
10772
10772
  if (l.length === 0) return At;
10773
10773
  if (l.length > 1) {
@@ -10794,8 +10794,8 @@ function Rd(r, e) {
10794
10794
  if (s === null) return hi;
10795
10795
  const m = o._selection;
10796
10796
  return l.size > 0 || a.size > 0 ? g === !1 && d !== At && d === n && c < t + e && h || l.size === 1 && function(_, w, v) {
10797
- const A = w._nodeMap.get(_), C = v._nodeMap.get(_), E = w._selection, y = v._selection;
10798
- return !(R(E) && R(y) && E.anchor.type === "element" && E.focus.type === "element" && y.anchor.type === "text" && y.focus.type === "text" || !$(A) || !$(C) || A.__parent !== C.__parent) && JSON.stringify(w.read(() => A.exportJSON())) === JSON.stringify(v.read(() => C.exportJSON()));
10797
+ const A = w._nodeMap.get(_), C = v._nodeMap.get(_), S = w._selection, y = v._selection;
10798
+ return !(R(S) && R(y) && S.anchor.type === "element" && S.focus.type === "element" && y.anchor.type === "text" && y.focus.type === "text" || !$(A) || !$(C) || A.__parent !== C.__parent) && JSON.stringify(w.read(() => A.exportJSON())) === JSON.stringify(v.read(() => C.exportJSON()));
10799
10799
  }(Array.from(l)[0], s, o) ? zn : hi : m !== null ? zn : pi;
10800
10800
  })();
10801
10801
  return t = c, n = d, f;
@@ -10835,7 +10835,7 @@ function Od() {
10835
10835
  function Md({ delay: r, externalHistoryState: e }) {
10836
10836
  const [t] = Tt();
10837
10837
  return function(n, s, o = 1e3) {
10838
- const i = St(() => s || Od(), [s]);
10838
+ const i = Et(() => s || Od(), [s]);
10839
10839
  De(() => Pd(n, i, o), [o, n, i]);
10840
10840
  }(t, e, r), null;
10841
10841
  }
@@ -11286,7 +11286,7 @@ function ll(r, e, t) {
11286
11286
  const a = us(l);
11287
11287
  t.getChildren().some((u) => ce(u)) ? n.push(...a) : s.push(...a);
11288
11288
  }
11289
- s.length > 0 && Ea(r, ...s), n.length > 0 && Bn(r, ...n);
11289
+ s.length > 0 && Sa(r, ...s), n.length > 0 && Bn(r, ...n);
11290
11290
  }
11291
11291
  function al(r, e, t, n) {
11292
11292
  ce(e.getFirstChild()) ? (r.removeAttribute("role"), r.removeAttribute("tabIndex"), r.removeAttribute("aria-checked")) : (r.setAttribute("role", "checkbox"), r.setAttribute("tabIndex", "-1"), t && e.__checked === t.__checked || r.setAttribute("aria-checked", e.getChecked() ? "true" : "false"));
@@ -11409,7 +11409,7 @@ function ul(r, e, t) {
11409
11409
  l > 1 ? n.push(...g) : s.push(...g);
11410
11410
  }
11411
11411
  }
11412
- s.length > 0 && Ea(r, ...s), n.length > 0 && Bn(r, ...n);
11412
+ s.length > 0 && Sa(r, ...s), n.length > 0 && Bn(r, ...n);
11413
11413
  }
11414
11414
  function Yd(r) {
11415
11415
  const e = [];
@@ -11785,11 +11785,17 @@ function af(r) {
11785
11785
  function uf({ data: r, size: e = 150 }) {
11786
11786
  const [t, n] = K(null), [s, o] = K(!1);
11787
11787
  return De(() => {
11788
- import("./stack-BDMct_Gn.mjs").then((i) => {
11789
- n(() => i.QRCodeSVG || i.default);
11790
- }).catch(() => {
11791
- o(!0);
11792
- });
11788
+ let i = !0;
11789
+ return import("./stack-BDMct_Gn.mjs").then((l) => {
11790
+ var u;
11791
+ if (!i) return;
11792
+ const a = l.QRCodeSVG || ((u = l.default) == null ? void 0 : u.QRCodeSVG) || l.default;
11793
+ typeof a == "function" ? n(() => a) : (console.error("[QRCodeNode] QRCodeSVG is not a function:", typeof a, a), o(!0));
11794
+ }).catch((l) => {
11795
+ console.error("[QRCodeNode] Failed to import qrcode.react:", l), i && o(!0);
11796
+ }), () => {
11797
+ i = !1;
11798
+ };
11793
11799
  }, []), s ? /* @__PURE__ */ p.jsx("div", { style: {
11794
11800
  width: e,
11795
11801
  height: e,
@@ -11909,11 +11915,11 @@ const cf = {
11909
11915
  };
11910
11916
  function ff({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiRewrite: s, aiProcessing: o, aiProcessingAction: i, onAiAction: l, hasContent: a }) {
11911
11917
  const [u] = Tt(), [c, d] = tt.useState(!1), f = tt.useRef(null), h = t || n || s, g = re(() => {
11912
- u.dispatchCommand(Et, "bold");
11918
+ u.dispatchCommand(St, "bold");
11913
11919
  }, [u]), m = re(() => {
11914
- u.dispatchCommand(Et, "italic");
11920
+ u.dispatchCommand(St, "italic");
11915
11921
  }, [u]), _ = re(() => {
11916
- u.dispatchCommand(Et, "underline");
11922
+ u.dispatchCommand(St, "underline");
11917
11923
  }, [u]), w = re(() => {
11918
11924
  u.dispatchCommand(Pa, void 0);
11919
11925
  }, [u]), v = re(() => {
@@ -11937,7 +11943,7 @@ function ff({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
11937
11943
  fontSize: "14px",
11938
11944
  fontWeight: 600,
11939
11945
  opacity: e ? 0.5 : 1
11940
- }, E = `
11946
+ }, S = `
11941
11947
  .mail-editor-toolbar-btn:hover:not(:disabled) {
11942
11948
  background: ${r.border};
11943
11949
  }
@@ -11959,7 +11965,7 @@ function ff({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
11959
11965
  background: r.toolbarBackground
11960
11966
  },
11961
11967
  children: [
11962
- /* @__PURE__ */ p.jsx("style", { children: E }),
11968
+ /* @__PURE__ */ p.jsx("style", { children: S }),
11963
11969
  /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px" }, children: [
11964
11970
  /* @__PURE__ */ p.jsx(
11965
11971
  "button",
@@ -12227,7 +12233,7 @@ function hf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
12227
12233
  o.clear();
12228
12234
  const i = We();
12229
12235
  o.append(i), i.select();
12230
- const a = new DOMParser().parseFromString(r, "text/html"), c = Sa(n, a).filter((d) => d.getParent() === null);
12236
+ const a = new DOMParser().parseFromString(r, "text/html"), c = Ea(n, a).filter((d) => d.getParent() === null);
12231
12237
  c.length > 0 && fa(c), i.getTextContent() === "" && o.getChildrenSize() > 1 && i.remove(), o.selectEnd();
12232
12238
  },
12233
12239
  { discrete: !0 }
@@ -12335,7 +12341,7 @@ function mf({
12335
12341
  aiProcessingAction: m,
12336
12342
  renderAboveToolbar: _
12337
12343
  }) {
12338
- const w = { ...cf, ...s }, [v, A] = tt.useState(!1), C = tt.useRef(void 0), [E, y] = tt.useState(r), [b, D] = tt.useState(!1), [S, M] = tt.useState(null), T = g ?? b, B = m ?? S;
12344
+ const w = { ...cf, ...s }, [v, A] = tt.useState(!1), C = tt.useRef(void 0), [S, y] = tt.useState(r), [b, D] = tt.useState(!1), [E, M] = tt.useState(null), T = g ?? b, B = m ?? E;
12339
12345
  tt.useEffect(() => {
12340
12346
  a !== void 0 && a !== C.current && (C.current = a, A(!0));
12341
12347
  }, [a]);
@@ -12343,7 +12349,7 @@ function mf({
12343
12349
  A(!1);
12344
12350
  }, []), j = (xe) => xe.replace(/<[^>]*>/g, "").trim(), I = (xe) => xe.split(`
12345
12351
  `).map((pe) => `<p>${pe || "<br>"}</p>`).join(""), X = async (xe) => {
12346
- const pe = j(E);
12352
+ const pe = j(S);
12347
12353
  if (!pe) return;
12348
12354
  const _e = xe === "restructure" ? d : xe === "proofread" ? f : h;
12349
12355
  if (_e) {
@@ -12357,13 +12363,13 @@ function mf({
12357
12363
  D(!1), M(null);
12358
12364
  }
12359
12365
  }
12360
- }, de = j(E).length > 0, Ce = {
12366
+ }, de = j(S).length > 0, Ce = {
12361
12367
  namespace: "MailEditor",
12362
12368
  theme: df,
12363
12369
  onError: (xe) => {
12364
12370
  console.error("Lexical error:", xe);
12365
12371
  },
12366
- nodes: [Wr, Dr, Ar, Nn, Ss, Es, ks, Fn],
12372
+ nodes: [Wr, Dr, Ar, Nn, Es, Ss, ks, Fn],
12367
12373
  editable: !o
12368
12374
  }, ae = re(
12369
12375
  (xe, pe) => {
@@ -12505,7 +12511,7 @@ function mf({
12505
12511
  /* @__PURE__ */ p.jsx(
12506
12512
  hf,
12507
12513
  {
12508
- html: v ? E : r,
12514
+ html: v ? S : r,
12509
12515
  isExternalUpdate: v,
12510
12516
  onImportComplete: F
12511
12517
  }
@@ -12564,18 +12570,18 @@ function Pf({
12564
12570
  onAiRestructure: v,
12565
12571
  onAiProofread: A,
12566
12572
  onAiRewrite: C,
12567
- renderAboveToolbar: E
12573
+ renderAboveToolbar: S
12568
12574
  }) {
12569
- const y = { ...yf, ...c }, [b, D] = K(r), [S, M] = K(""), [T, B] = K(""), [F, j] = K(e), [I, X] = K(t), [de, Ce] = K([]), [ae, Oe] = K(!1), [xe, pe] = K(""), [_e, be] = K(f), [ke, ge] = K(!1), Ae = tt.useRef(void 0);
12575
+ const y = { ...yf, ...c }, [b, D] = K(r), [E, M] = K(""), [T, B] = K(""), [F, j] = K(e), [I, X] = K(t), [de, Ce] = K([]), [ae, Oe] = K(!1), [xe, pe] = K(""), [_e, be] = K(f), [ke, ge] = K(!1), Ae = tt.useRef(void 0);
12570
12576
  tt.useEffect(() => {
12571
12577
  l !== void 0 && l !== Ae.current && (Ae.current = l, X(t), ge(!0));
12572
12578
  }, [l, t]);
12573
12579
  const Le = (U) => {
12574
12580
  X(U), ge(!1), i == null || i(U);
12575
12581
  }, ue = ye(null), [Me, ct] = K(!1), Nt = (U) => {
12576
- const Ee = U.target.files;
12577
- if (Ee) {
12578
- const Be = Array.from(Ee);
12582
+ const Se = U.target.files;
12583
+ if (Se) {
12584
+ const Be = Array.from(Se);
12579
12585
  console.log("[MailComposer] Files selected:", Be.map((Te) => ({ name: Te.name, size: Te.size, type: Te.type }))), Ce((Te) => [...Te, ...Be]);
12580
12586
  }
12581
12587
  ue.current && (ue.current.value = "");
@@ -12585,12 +12591,12 @@ function Pf({
12585
12591
  U.preventDefault(), U.stopPropagation(), ct(!1);
12586
12592
  }, xt = (U) => {
12587
12593
  if (U.preventDefault(), U.stopPropagation(), ct(!1), U.dataTransfer.files && U.dataTransfer.files.length > 0) {
12588
- const Ee = Array.from(U.dataTransfer.files);
12589
- console.log("[MailComposer] Files dropped:", Ee.map((Be) => ({ name: Be.name, size: Be.size, type: Be.type }))), Ce((Be) => [...Be, ...Ee]);
12594
+ const Se = Array.from(U.dataTransfer.files);
12595
+ console.log("[MailComposer] Files dropped:", Se.map((Be) => ({ name: Be.name, size: Be.size, type: Be.type }))), Ce((Be) => [...Be, ...Se]);
12590
12596
  } else
12591
12597
  console.log("[MailComposer] Drop event but no files:", U.dataTransfer.types);
12592
12598
  }, pt = (U) => U.type.startsWith("image/") ? "image" : U.type === "application/pdf" ? "picture_as_pdf" : U.type.includes("spreadsheet") || U.type.includes("excel") ? "table_chart" : U.type.includes("document") || U.type.includes("word") ? "description" : "attach_file", er = (U) => {
12593
- Ce((Ee) => Ee.filter((Be, Te) => Te !== U));
12599
+ Ce((Se) => Se.filter((Be, Te) => Te !== U));
12594
12600
  }, Gt = (U) => U < 1024 ? `${U} B` : U < 1024 * 1024 ? `${(U / 1024).toFixed(1)} KB` : `${(U / (1024 * 1024)).toFixed(1)} MB`, Ft = async () => {
12595
12601
  if (!b.trim()) {
12596
12602
  pe("Recipient email is required");
@@ -12614,12 +12620,12 @@ function Pf({
12614
12620
  size: Te.size
12615
12621
  };
12616
12622
  })
12617
- ), Ee = I.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Be = {
12623
+ ), Se = I.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Be = {
12618
12624
  to: b.trim(),
12619
- cc: S.trim() || void 0,
12625
+ cc: E.trim() || void 0,
12620
12626
  bcc: T.trim() || void 0,
12621
12627
  subject: F.trim(),
12622
- html: Ee,
12628
+ html: Se,
12623
12629
  attachments: U,
12624
12630
  inReplyTo: n == null ? void 0 : n.messageId
12625
12631
  };
@@ -12648,14 +12654,14 @@ function Pf({
12648
12654
  color: y.textSecondary,
12649
12655
  marginBottom: "4px",
12650
12656
  textTransform: "uppercase"
12651
- }, _t = (U, Ee = !1) => ({
12657
+ }, _t = (U, Se = !1) => ({
12652
12658
  padding: "10px 20px",
12653
12659
  fontSize: "14px",
12654
12660
  fontWeight: 500,
12655
12661
  border: "none",
12656
12662
  borderRadius: "6px",
12657
- cursor: Ee ? "not-allowed" : "pointer",
12658
- opacity: Ee ? 0.6 : 1,
12663
+ cursor: Se ? "not-allowed" : "pointer",
12664
+ opacity: Se ? 0.6 : 1,
12659
12665
  background: U ? y.buttonPrimary : y.buttonSecondary,
12660
12666
  color: U ? "#ffffff" : y.text,
12661
12667
  display: "flex",
@@ -12727,7 +12733,7 @@ function Pf({
12727
12733
  "input",
12728
12734
  {
12729
12735
  type: "email",
12730
- value: S,
12736
+ value: E,
12731
12737
  onChange: (U) => M(U.target.value),
12732
12738
  placeholder: "cc@example.com",
12733
12739
  disabled: d || ae,
@@ -12780,7 +12786,7 @@ function Pf({
12780
12786
  onAiRestructure: v,
12781
12787
  onAiProofread: A,
12782
12788
  onAiRewrite: C,
12783
- renderAboveToolbar: E
12789
+ renderAboveToolbar: S
12784
12790
  }
12785
12791
  ) }) }),
12786
12792
  /* @__PURE__ */ p.jsxs("div", { children: [
@@ -12827,7 +12833,7 @@ function Pf({
12827
12833
  ]
12828
12834
  }
12829
12835
  ),
12830
- de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((U, Ee) => /* @__PURE__ */ p.jsxs(
12836
+ de.length > 0 && /* @__PURE__ */ p.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: de.map((U, Se) => /* @__PURE__ */ p.jsxs(
12831
12837
  "div",
12832
12838
  {
12833
12839
  style: {
@@ -12848,7 +12854,7 @@ function Pf({
12848
12854
  "button",
12849
12855
  {
12850
12856
  type: "button",
12851
- onClick: () => er(Ee),
12857
+ onClick: () => er(Se),
12852
12858
  disabled: d || ae,
12853
12859
  style: {
12854
12860
  background: "none",
@@ -12864,7 +12870,7 @@ function Pf({
12864
12870
  )
12865
12871
  ]
12866
12872
  },
12867
- `${U.name}-${Ee}`
12873
+ `${U.name}-${Se}`
12868
12874
  )) })
12869
12875
  ] }),
12870
12876
  /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
@@ -12949,7 +12955,7 @@ function Of({
12949
12955
  var B;
12950
12956
  return ((B = T.label) == null ? void 0 : B.toLowerCase().includes(_.toLowerCase())) && !e.includes(T.id);
12951
12957
  }
12952
- ), E = s && _.trim() && !r.some((T) => {
12958
+ ), S = s && _.trim() && !r.some((T) => {
12953
12959
  var B;
12954
12960
  return ((B = T.label) == null ? void 0 : B.toLowerCase()) === _.toLowerCase();
12955
12961
  }), y = e.map((T) => r.find((B) => B.id === T)).filter(Boolean), b = re((T) => {
@@ -12957,13 +12963,13 @@ function Of({
12957
12963
  c > 0 && e.length >= c || (t([...e, T]), w(""), c === 1 ? m(!1) : (B = A.current) == null || B.focus());
12958
12964
  }, [e, t, c]), D = re((T) => {
12959
12965
  t(e.filter((B) => B !== T));
12960
- }, [e, t]), S = re(async () => {
12961
- if (!E) return;
12966
+ }, [e, t]), E = re(async () => {
12967
+ if (!S) return;
12962
12968
  const T = await (o == null ? void 0 : o(_.trim()));
12963
12969
  T && b(T.id), w("");
12964
- }, [E, _, o, b]), M = re((T) => {
12965
- T.key === "Enter" ? (T.preventDefault(), E ? S() : C.length > 0 && b(C[0].id)) : T.key === "Backspace" && !_ && e.length > 0 ? D(e[e.length - 1]) : T.key === "Escape" && (m(!1), w(""));
12966
- }, [E, C, _, e, S, b, D]);
12970
+ }, [S, _, o, b]), M = re((T) => {
12971
+ T.key === "Enter" ? (T.preventDefault(), S ? E() : C.length > 0 && b(C[0].id)) : T.key === "Backspace" && !_ && e.length > 0 ? D(e[e.length - 1]) : T.key === "Escape" && (m(!1), w(""));
12972
+ }, [S, C, _, e, E, b, D]);
12967
12973
  return /* @__PURE__ */ p.jsxs("div", { ref: v, className: f, style: { position: "relative" }, children: [
12968
12974
  a && /* @__PURE__ */ p.jsx(
12969
12975
  "label",
@@ -13077,7 +13083,7 @@ function Of({
13077
13083
  overflowY: "auto",
13078
13084
  zIndex: 50
13079
13085
  },
13080
- children: C.length === 0 && !E ? /* @__PURE__ */ p.jsx(
13086
+ children: C.length === 0 && !S ? /* @__PURE__ */ p.jsx(
13081
13087
  "div",
13082
13088
  {
13083
13089
  style: {
@@ -13139,10 +13145,10 @@ function Of({
13139
13145
  },
13140
13146
  T.id
13141
13147
  )),
13142
- E && /* @__PURE__ */ p.jsxs(
13148
+ S && /* @__PURE__ */ p.jsxs(
13143
13149
  "div",
13144
13150
  {
13145
- onClick: S,
13151
+ onClick: E,
13146
13152
  style: {
13147
13153
  padding: "10px 12px",
13148
13154
  fontSize: "14px",
@@ -13184,7 +13190,7 @@ function Mf({
13184
13190
  columnClassName: f = "",
13185
13191
  itemClassName: h = ""
13186
13192
  }) {
13187
- const [g, m] = K(null), [_, w] = K(null), [v, A] = K(null), C = ye(null), E = e.reduce((B, F) => {
13193
+ const [g, m] = K(null), [_, w] = K(null), [v, A] = K(null), C = ye(null), S = e.reduce((B, F) => {
13188
13194
  let j = r.filter((I) => n(I) === F.id);
13189
13195
  return s && (j = j.sort((I, X) => s(I) - s(X))), B[F.id] = j, B;
13190
13196
  }, {}), y = re((B, F) => {
@@ -13198,7 +13204,7 @@ function Mf({
13198
13204
  F.style.opacity = "1", m(null), w(null), A(null), C.current = null;
13199
13205
  }, []), D = re((B, F, j) => {
13200
13206
  B.preventDefault(), B.dataTransfer.dropEffect = "move", w(F), A(j);
13201
- }, []), S = re((B) => {
13207
+ }, []), E = re((B) => {
13202
13208
  const F = B.relatedTarget;
13203
13209
  F != null && F.closest("[data-kanban-column]") || (w(null), A(null));
13204
13210
  }, []), M = re((B, F, j) => {
@@ -13224,7 +13230,7 @@ function Mf({
13224
13230
  className: `flex gap-4 overflow-x-auto pb-4 ${d}`,
13225
13231
  style: { minHeight: "400px" },
13226
13232
  children: e.map((B) => {
13227
- const F = E[B.id] || [], j = _ === B.id;
13233
+ const F = S[B.id] || [], j = _ === B.id;
13228
13234
  return /* @__PURE__ */ p.jsxs(
13229
13235
  "div",
13230
13236
  {
@@ -13233,7 +13239,7 @@ function Mf({
13233
13239
  onDragOver: (I) => {
13234
13240
  I.preventDefault(), g && !j && w(B.id);
13235
13241
  },
13236
- onDragLeave: S,
13242
+ onDragLeave: E,
13237
13243
  onDrop: (I) => M(I, B.id, v ?? F.length),
13238
13244
  children: [
13239
13245
  /* @__PURE__ */ p.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(B, F.length) : T(B, F.length) }),
@@ -13324,12 +13330,12 @@ function If({
13324
13330
  className: h = "",
13325
13331
  theme: g = {}
13326
13332
  }) {
13327
- const m = { ..._f, ...g }, { allDayItems: _, timedItems: w } = St(() => {
13333
+ const m = { ..._f, ...g }, { allDayItems: _, timedItems: w } = Et(() => {
13328
13334
  const b = [], D = [];
13329
- for (const S of r)
13330
- l(S) ? b.push(S) : D.push(S);
13335
+ for (const E of r)
13336
+ l(E) ? b.push(E) : D.push(E);
13331
13337
  return { allDayItems: b, timedItems: D };
13332
- }, [r, l]), v = St(() => {
13338
+ }, [r, l]), v = Et(() => {
13333
13339
  const b = [];
13334
13340
  for (let D = t; D <= n; D++)
13335
13341
  b.push(D);
@@ -13338,16 +13344,16 @@ function If({
13338
13344
  (b) => {
13339
13345
  const D = o(b);
13340
13346
  if (!D) return null;
13341
- const S = bf(D);
13342
- if (!S) return null;
13343
- const { hours: M, minutes: T } = S, B = Math.max(t, Math.min(n, M)), F = M < t ? 0 : T, j = (B - t) * s + F / 60 * s, I = i(b), X = Math.max(20, I / 60 * s);
13347
+ const E = bf(D);
13348
+ if (!E) return null;
13349
+ const { hours: M, minutes: T } = E, B = Math.max(t, Math.min(n, M)), F = M < t ? 0 : T, j = (B - t) * s + F / 60 * s, I = i(b), X = Math.max(20, I / 60 * s);
13344
13350
  return { top: j, height: X };
13345
13351
  },
13346
13352
  [o, i, t, n, s]
13347
- ), E = St(() => {
13353
+ ), S = Et(() => {
13348
13354
  if (!f || !wf(e)) return null;
13349
- const b = /* @__PURE__ */ new Date(), D = b.getHours(), S = b.getMinutes();
13350
- return D < t || D > n ? null : (D - t) * s + S / 60 * s;
13355
+ const b = /* @__PURE__ */ new Date(), D = b.getHours(), E = b.getMinutes();
13356
+ return D < t || D > n ? null : (D - t) * s + E / 60 * s;
13351
13357
  }, [e, f, t, n, s]), y = re(
13352
13358
  (b) => {
13353
13359
  if (!d) return;
@@ -13450,14 +13456,14 @@ function If({
13450
13456
  onClick: y
13451
13457
  }
13452
13458
  ),
13453
- E !== null && /* @__PURE__ */ p.jsxs(
13459
+ S !== null && /* @__PURE__ */ p.jsxs(
13454
13460
  "div",
13455
13461
  {
13456
13462
  style: {
13457
13463
  position: "absolute",
13458
13464
  left: "55px",
13459
13465
  right: 0,
13460
- top: E,
13466
+ top: S,
13461
13467
  zIndex: 20,
13462
13468
  pointerEvents: "none"
13463
13469
  },
@@ -13503,8 +13509,8 @@ function If({
13503
13509
  zIndex: 10,
13504
13510
  cursor: c ? "pointer" : "default"
13505
13511
  },
13506
- onClick: (S) => {
13507
- S.stopPropagation(), c == null || c(b);
13512
+ onClick: (E) => {
13513
+ E.stopPropagation(), c == null || c(b);
13508
13514
  },
13509
13515
  children: u(b)
13510
13516
  },
@@ -13515,7 +13521,7 @@ function If({
13515
13521
  ] });
13516
13522
  }
13517
13523
  function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: s = "widget", hideSaveButton: o = !1, maxDuration: i = 180 }) {
13518
- const l = s === "widget", [a, u] = K("idle"), [c, d] = K(0), [f, h] = K(0), [g, m] = K(!1), [_, w] = K(0), [v, A] = K(null), [C, E] = K(!1), [y, b] = K(null), [D, S] = K(!0), [M, T] = K([]), [B, F] = K({ completed: 0, total: 0 }), j = ye(!1), I = ye(!0);
13524
+ const l = s === "widget", [a, u] = K("idle"), [c, d] = K(0), [f, h] = K(0), [g, m] = K(!1), [_, w] = K(0), [v, A] = K(null), [C, S] = K(!1), [y, b] = K(null), [D, E] = K(!0), [M, T] = K([]), [B, F] = K({ completed: 0, total: 0 }), j = ye(!1), I = ye(!0);
13519
13525
  De(() => {
13520
13526
  I.current = D;
13521
13527
  }, [D]);
@@ -13526,7 +13532,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13526
13532
  const k = await z.arrayBuffer(), H = new AudioContext(), Q = await H.decodeAudioData(k);
13527
13533
  return await H.close(), Q;
13528
13534
  }, Ft = (z) => {
13529
- const k = z.numberOfChannels, H = z.sampleRate, Q = 1, P = 16, ne = P / 8, Z = k * ne, ee = H * Z, fe = z.length * Z, Se = new ArrayBuffer(44 + fe), te = new DataView(Se), se = (Fe, ve) => {
13535
+ const k = z.numberOfChannels, H = z.sampleRate, Q = 1, P = 16, ne = P / 8, Z = k * ne, ee = H * Z, fe = z.length * Z, Ee = new ArrayBuffer(44 + fe), te = new DataView(Ee), se = (Fe, ve) => {
13530
13536
  for (let Ye = 0; Ye < ve.length; Ye++)
13531
13537
  te.setUint8(Fe + Ye, ve.charCodeAt(Ye));
13532
13538
  };
@@ -13540,9 +13546,9 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13540
13546
  const Ye = Math.max(-1, Math.min(1, qe[ve][Fe])), Xe = Ye < 0 ? Ye * 32768 : Ye * 32767;
13541
13547
  te.setInt16(Ge, Xe, !0), Ge += 2;
13542
13548
  }
13543
- return new Blob([Se], { type: "audio/wav" });
13549
+ return new Blob([Ee], { type: "audio/wav" });
13544
13550
  }, jt = async (z, k, H, Q) => {
13545
- const P = new AudioContext(), ne = z.sampleRate, Z = Math.max(z.numberOfChannels, k.numberOfChannels), ee = Math.min(H, z.length), fe = Math.max(0, z.length - H), Se = Q === "insert" ? ee + k.length + fe : ee + k.length, te = P.createBuffer(Z, Se, ne);
13551
+ const P = new AudioContext(), ne = z.sampleRate, Z = Math.max(z.numberOfChannels, k.numberOfChannels), ee = Math.min(H, z.length), fe = Math.max(0, z.length - H), Ee = Q === "insert" ? ee + k.length + fe : ee + k.length, te = P.createBuffer(Z, Ee, ne);
13546
13552
  for (let se = 0; se < Z; se++) {
13547
13553
  const qe = te.getChannelData(se), Ge = se < z.numberOfChannels ? z.getChannelData(se) : z.getChannelData(0);
13548
13554
  for (let ve = 0; ve < ee; ve++)
@@ -13562,14 +13568,14 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13562
13568
  if (!k) return;
13563
13569
  const H = z.getBoundingClientRect(), Q = H.width, P = H.height, ne = Ae.current, Z = f || c || 1, ee = a === "recording" ? c : _;
13564
13570
  k.fillStyle = "#2d3b35", k.fillRect(0, 0, Q, P);
13565
- const fe = 8, Se = "rgba(0, 0, 0, 0.4)", te = k.createLinearGradient(0, 0, 0, fe);
13566
- te.addColorStop(0, Se), te.addColorStop(1, "transparent"), k.fillStyle = te, k.fillRect(0, 0, Q, fe);
13571
+ const fe = 8, Ee = "rgba(0, 0, 0, 0.4)", te = k.createLinearGradient(0, 0, 0, fe);
13572
+ te.addColorStop(0, Ee), te.addColorStop(1, "transparent"), k.fillStyle = te, k.fillRect(0, 0, Q, fe);
13567
13573
  const se = k.createLinearGradient(0, P - fe, 0, P);
13568
- se.addColorStop(0, "transparent"), se.addColorStop(1, Se), k.fillStyle = se, k.fillRect(0, P - fe, Q, fe);
13574
+ se.addColorStop(0, "transparent"), se.addColorStop(1, Ee), k.fillStyle = se, k.fillRect(0, P - fe, Q, fe);
13569
13575
  const qe = k.createLinearGradient(0, 0, fe, 0);
13570
- qe.addColorStop(0, Se), qe.addColorStop(1, "transparent"), k.fillStyle = qe, k.fillRect(0, 0, fe, P);
13576
+ qe.addColorStop(0, Ee), qe.addColorStop(1, "transparent"), k.fillStyle = qe, k.fillRect(0, 0, fe, P);
13571
13577
  const Ge = k.createLinearGradient(Q - fe, 0, Q, 0);
13572
- Ge.addColorStop(0, "transparent"), Ge.addColorStop(1, Se), k.fillStyle = Ge, k.fillRect(Q - fe, 0, fe, P), k.strokeStyle = "#5a6b62", k.lineWidth = 1, k.beginPath(), k.moveTo(0, P / 2), k.lineTo(Q, P / 2), k.stroke();
13578
+ Ge.addColorStop(0, "transparent"), Ge.addColorStop(1, Ee), k.fillStyle = Ge, k.fillRect(Q - fe, 0, fe, P), k.strokeStyle = "#5a6b62", k.lineWidth = 1, k.beginPath(), k.moveTo(0, P / 2), k.lineTo(Q, P / 2), k.stroke();
13573
13579
  const Fe = Q / 2;
13574
13580
  if (ne.length > 0)
13575
13581
  if (a === "recording")
@@ -13603,7 +13609,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13603
13609
  Ae.current.push(ne), dt(), ge.current && (_e.current = requestAnimationFrame(_t));
13604
13610
  }, U = async () => {
13605
13611
  try {
13606
- A(null), E(!1), Le.current === null && (Ae.current = []);
13612
+ A(null), S(!1), Le.current === null && (Ae.current = []);
13607
13613
  const z = await navigator.mediaDevices.getUserMedia({ audio: !0 });
13608
13614
  Ce.current = z;
13609
13615
  const k = new AudioContext();
@@ -13642,12 +13648,12 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13642
13648
  T((te) => [...te, Z]), F((te) => ({ ...te, total: te.total + 1 })), ke.current = null, Ae.current = [], w(0), h(0), d(0), u("idle");
13643
13649
  return;
13644
13650
  }
13645
- const fe = URL.createObjectURL(Z), Se = new Audio(fe);
13646
- Se.ontimeupdate = () => {
13647
- w(Se.currentTime);
13648
- }, Se.onended = () => {
13651
+ const fe = URL.createObjectURL(Z), Ee = new Audio(fe);
13652
+ Ee.ontimeupdate = () => {
13653
+ w(Ee.currentTime);
13654
+ }, Ee.onended = () => {
13649
13655
  m(!1);
13650
- }, be.current = Se, h(ee), w(ee), u("editing");
13656
+ }, be.current = Ee, h(ee), w(ee), u("editing");
13651
13657
  } catch {
13652
13658
  A("Failed to process recording"), u("idle");
13653
13659
  }
@@ -13659,8 +13665,8 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13659
13665
  } catch {
13660
13666
  A("Could not access microphone. Please allow microphone access.");
13661
13667
  }
13662
- }, Ee = () => {
13663
- ge.current = !1, E(!1), b(null), _e.current && (cancelAnimationFrame(_e.current), _e.current = null), pe.current && (clearInterval(pe.current), pe.current = null), de.current && de.current.state !== "inactive" && de.current.stop();
13668
+ }, Se = () => {
13669
+ ge.current = !1, S(!1), b(null), _e.current && (cancelAnimationFrame(_e.current), _e.current = null), pe.current && (clearInterval(pe.current), pe.current = null), de.current && de.current.state !== "inactive" && de.current.stop();
13664
13670
  }, Be = (z) => {
13665
13671
  const k = X.current;
13666
13672
  if (!k) return;
@@ -13668,7 +13674,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13668
13674
  if (H <= 0) return;
13669
13675
  const Q = Ae.current;
13670
13676
  if (Q.length === 0) return;
13671
- const P = k.getBoundingClientRect(), ne = z - xt.current, Z = 4, ee = P.width / k.width, fe = Q.length / H * Z, Se = -ne / (fe * ee), te = pt.current + Se, se = Math.max(0, Math.min(te, H));
13677
+ const P = k.getBoundingClientRect(), ne = z - xt.current, Z = 4, ee = P.width / k.width, fe = Q.length / H * Z, Ee = -ne / (fe * ee), te = pt.current + Ee, se = Math.max(0, Math.min(te, H));
13672
13678
  be.current && (be.current.currentTime = se), w(se);
13673
13679
  }, Te = () => {
13674
13680
  be.current && (be.current.currentTime = 0), w(0);
@@ -13722,8 +13728,8 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13722
13728
  ee.addColorStop(0, Z), ee.addColorStop(1, "transparent"), k.fillStyle = ee, k.fillRect(0, 0, Q, ne);
13723
13729
  const fe = k.createLinearGradient(0, P - ne, 0, P);
13724
13730
  fe.addColorStop(0, "transparent"), fe.addColorStop(1, Z), k.fillStyle = fe, k.fillRect(0, P - ne, Q, ne);
13725
- const Se = k.createLinearGradient(0, 0, ne, 0);
13726
- Se.addColorStop(0, Z), Se.addColorStop(1, "transparent"), k.fillStyle = Se, k.fillRect(0, 0, ne, P);
13731
+ const Ee = k.createLinearGradient(0, 0, ne, 0);
13732
+ Ee.addColorStop(0, Z), Ee.addColorStop(1, "transparent"), k.fillStyle = Ee, k.fillRect(0, 0, ne, P);
13727
13733
  const te = k.createLinearGradient(Q - ne, 0, Q, 0);
13728
13734
  te.addColorStop(0, "transparent"), te.addColorStop(1, Z), k.fillStyle = te, k.fillRect(Q - ne, 0, ne, P), k.strokeStyle = "#5a6b62", k.lineWidth = 1, k.beginPath(), k.moveTo(0, P / 2), k.lineTo(Q, P / 2), k.stroke();
13729
13735
  const se = Q / 2;
@@ -13759,7 +13765,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13759
13765
  if (Q) {
13760
13766
  const P = Q.getContext("2d");
13761
13767
  if (P) {
13762
- const ne = Q.getBoundingClientRect(), Z = ne.width, ee = ne.height, fe = Ae.current, Se = f || c || 1, te = H.currentTime;
13768
+ const ne = Q.getBoundingClientRect(), Z = ne.width, ee = ne.height, fe = Ae.current, Ee = f || c || 1, te = H.currentTime;
13763
13769
  P.fillStyle = "#2d3b35", P.fillRect(0, 0, Z, ee);
13764
13770
  const se = 8, qe = "rgba(0, 0, 0, 0.4)", Ge = P.createLinearGradient(0, 0, 0, se);
13765
13771
  Ge.addColorStop(0, qe), Ge.addColorStop(1, "transparent"), P.fillStyle = Ge, P.fillRect(0, 0, Z, se);
@@ -13769,7 +13775,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13769
13775
  ve.addColorStop(0, qe), ve.addColorStop(1, "transparent"), P.fillStyle = ve, P.fillRect(0, 0, se, ee);
13770
13776
  const Ye = P.createLinearGradient(Z - se, 0, Z, 0);
13771
13777
  Ye.addColorStop(0, "transparent"), Ye.addColorStop(1, qe), P.fillStyle = Ye, P.fillRect(Z - se, 0, se, ee), P.strokeStyle = "#5a6b62", P.lineWidth = 1, P.beginPath(), P.moveTo(0, ee / 2), P.lineTo(Z, ee / 2), P.stroke();
13772
- const Xe = Z / 2, gt = 3, Kt = 4, vt = Se > 0 ? te / Se * fe.length : 0;
13778
+ const Xe = Z / 2, gt = 3, Kt = 4, vt = Ee > 0 ? te / Ee * fe.length : 0;
13773
13779
  for (let q = 0; q < fe.length; q++) {
13774
13780
  const Y = vt - q, le = Xe - Y * Kt;
13775
13781
  if (le < -gt || le > Z) continue;
@@ -13867,7 +13873,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13867
13873
  onClick: () => {
13868
13874
  if (a === "recording") {
13869
13875
  const z = de.current;
13870
- z && (z.state === "recording" ? (z.pause(), E(!0)) : z.state === "paused" && (z.resume(), E(!1)));
13876
+ z && (z.state === "recording" ? (z.pause(), S(!0)) : z.state === "paused" && (z.resume(), S(!1)));
13871
13877
  } else
13872
13878
  Rt();
13873
13879
  },
@@ -13892,7 +13898,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13892
13898
  "button",
13893
13899
  {
13894
13900
  onClick: () => {
13895
- y === "insert" ? Ee() : a === "idle" ? (b("insert"), U()) : a === "editing" && (b("insert"), Vt("insert"));
13901
+ y === "insert" ? Se() : a === "idle" ? (b("insert"), U()) : a === "editing" && (b("insert"), Vt("insert"));
13896
13902
  },
13897
13903
  disabled: a === "recording" && y !== "insert" || g,
13898
13904
  style: a === "recording" && y !== "insert" || g ? $e : Ie,
@@ -13904,22 +13910,22 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13904
13910
  "button",
13905
13911
  {
13906
13912
  onClick: () => {
13907
- I.current || (y === "mic" ? Ee() : a === "idle" ? (b("mic"), U()) : a === "editing" && (b("mic"), Vt("replace")));
13913
+ I.current || (y === "mic" ? Se() : a === "idle" ? (b("mic"), U()) : a === "editing" && (b("mic"), Vt("replace")));
13908
13914
  },
13909
13915
  onMouseDown: () => {
13910
13916
  I.current && a === "idle" && !g && (b("mic"), U());
13911
13917
  },
13912
13918
  onMouseUp: () => {
13913
- I.current && a === "recording" && y === "mic" && Ee();
13919
+ I.current && a === "recording" && y === "mic" && Se();
13914
13920
  },
13915
13921
  onMouseLeave: () => {
13916
- I.current && a === "recording" && y === "mic" && Ee();
13922
+ I.current && a === "recording" && y === "mic" && Se();
13917
13923
  },
13918
13924
  onTouchStart: () => {
13919
13925
  I.current && a === "idle" && !g && (b("mic"), U());
13920
13926
  },
13921
13927
  onTouchEnd: () => {
13922
- I.current && a === "recording" && y === "mic" && Ee();
13928
+ I.current && a === "recording" && y === "mic" && Se();
13923
13929
  },
13924
13930
  disabled: a === "recording" && y !== "mic" || g,
13925
13931
  style: a === "recording" && y !== "mic" || g ? $e : Ie,
@@ -13931,7 +13937,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13931
13937
  "button",
13932
13938
  {
13933
13939
  onClick: () => {
13934
- y === "startover" ? Ee() : a === "editing" && (b("startover"), G());
13940
+ y === "startover" ? Se() : a === "editing" && (b("startover"), G());
13935
13941
  },
13936
13942
  disabled: a === "idle" || a === "recording" && y !== "startover" || g,
13937
13943
  style: a === "idle" || a === "recording" && y !== "startover" || g ? $e : Ie,
@@ -13961,7 +13967,7 @@ function $f({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
13961
13967
  /* @__PURE__ */ p.jsx(
13962
13968
  "button",
13963
13969
  {
13964
- onClick: () => S(!D),
13970
+ onClick: () => E(!D),
13965
13971
  style: {
13966
13972
  width: "28px",
13967
13973
  height: "16px",
@@ -14039,7 +14045,7 @@ export {
14039
14045
  Of as ComboBox,
14040
14046
  Rs as DataOperations,
14041
14047
  Nf as Detail,
14042
- Ef as GraphClient,
14048
+ Sf as GraphClient,
14043
14049
  Mf as KanbanBoard,
14044
14050
  jf as Mail,
14045
14051
  pu as MailClient,
@@ -14050,7 +14056,7 @@ export {
14050
14056
  Tf as Stack,
14051
14057
  If as Timeline,
14052
14058
  yl as getApiClient,
14053
- Sf as initializeApiClient,
14059
+ Ef as initializeApiClient,
14054
14060
  kf as useMutation,
14055
14061
  yu as useQuery
14056
14062
  };