@qwanyx/stack 0.2.64 → 0.2.65

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,7 +2,7 @@ var au = Object.defineProperty;
2
2
  var uu = (r, e, t) => e in r ? au(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var Et = (r, e, t) => uu(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as Ps from "react";
5
- import de, { useState as K, useCallback as re, useEffect as Te, useMemo as bt, useRef as _e, createContext as cu, useContext as du, useLayoutEffect as Wr, Suspense as fu, forwardRef as wl } from "react";
5
+ import de, { useState as K, useCallback as re, useEffect as Ae, useMemo as bt, useRef as ge, createContext as cu, useContext as du, useLayoutEffect as Wr, Suspense as fu, forwardRef as wl } from "react";
6
6
  import { flushSync as hu, createPortal as pu } from "react-dom";
7
7
  class rh {
8
8
  constructor(e) {
@@ -3630,11 +3630,11 @@ class Lu {
3630
3630
  for (const h of c.messages)
3631
3631
  h.uid && d.set(h.uid, h);
3632
3632
  const f = l.map((h) => {
3633
- var D, C, A, b, v;
3633
+ var D, _, A, b, v;
3634
3634
  const p = d.get(h);
3635
3635
  if (!p) return null;
3636
- const m = ((D = p.flags) == null ? void 0 : D.some((E) => E.includes("Seen"))) || !1, y = ((A = (C = p.envelope) == null ? void 0 : C.from) == null ? void 0 : A.email) || "Unknown", w = ((b = p.envelope) == null ? void 0 : b.subject) || "(No subject)", x = ((v = p.envelope) == null ? void 0 : v.date) || "";
3637
- return { uid: h, from: y, subject: w, date: x, seen: m };
3636
+ const m = ((D = p.flags) == null ? void 0 : D.some((E) => E.includes("Seen"))) || !1, y = ((A = (_ = p.envelope) == null ? void 0 : _.from) == null ? void 0 : A.email) || "Unknown", C = ((b = p.envelope) == null ? void 0 : b.subject) || "(No subject)", x = ((v = p.envelope) == null ? void 0 : v.date) || "";
3637
+ return { uid: h, from: y, subject: C, date: x, seen: m };
3638
3638
  }).filter(Boolean);
3639
3639
  return {
3640
3640
  account: { id: e, label: "", email: "" },
@@ -3682,30 +3682,30 @@ class Lu {
3682
3682
  * This handles CID embedded images by converting them to base64 data URIs
3683
3683
  */
3684
3684
  async getEmailParsed(e, t, n = "INBOX") {
3685
- var p, m, y, w, x, D;
3685
+ var p, m, y, C, x, D;
3686
3686
  const i = (await this.imapExec(e, [
3687
3687
  `SELECT "${n}"`,
3688
3688
  `UID FETCH ${t} (FLAGS BODY[])`
3689
- ])).responses.find((C) => C.command === "UID FETCH");
3689
+ ])).responses.find((_) => _.command === "UID FETCH");
3690
3690
  if (!(i != null && i.ok) || !((p = i.messages) != null && p[0]))
3691
3691
  return console.error("Failed to fetch raw email:", i == null ? void 0 : i.error), null;
3692
3692
  const o = i.messages[0], a = o.body || o.raw;
3693
3693
  if (!a)
3694
3694
  return console.error("No raw email content in response"), null;
3695
3695
  const u = await new Hn().parse(a);
3696
- console.log("[MailClient] Parsed email - attachments count:", ((m = u.attachments) == null ? void 0 : m.length) || 0), console.log("[MailClient] Parsed attachments:", (y = u.attachments) == null ? void 0 : y.map((C) => ({ filename: C.filename, mimeType: C.mimeType, contentId: C.contentId })));
3696
+ console.log("[MailClient] Parsed email - attachments count:", ((m = u.attachments) == null ? void 0 : m.length) || 0), console.log("[MailClient] Parsed attachments:", (y = u.attachments) == null ? void 0 : y.map((_) => ({ filename: _.filename, mimeType: _.mimeType, contentId: _.contentId })));
3697
3697
  const c = /* @__PURE__ */ new Map();
3698
- for (const C of u.attachments || [])
3699
- if (C.contentId) {
3700
- const A = this.contentToBase64(C.content), b = `data:${C.mimeType};base64,${A}`, v = C.contentId.replace(/^<|>$/g, "");
3698
+ for (const _ of u.attachments || [])
3699
+ if (_.contentId) {
3700
+ const A = this.contentToBase64(_.content), b = `data:${_.mimeType};base64,${A}`, v = _.contentId.replace(/^<|>$/g, "");
3701
3701
  c.set(v, b), c.set(`<${v}>`, b);
3702
3702
  }
3703
3703
  let d = u.html || "";
3704
- d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C, A) => {
3704
+ d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (_, A) => {
3705
3705
  const b = c.get(A) || c.get(`<${A}>`);
3706
- return b ? `src="${b}"` : C;
3706
+ return b ? `src="${b}"` : _;
3707
3707
  }));
3708
- const f = ((w = o.flags) == null ? void 0 : w.some((C) => C.toLowerCase().includes("seen"))) || !1, h = ((x = u.from) == null ? void 0 : x.address) || ((D = u.from) == null ? void 0 : D.name) || "Unknown";
3708
+ const f = ((C = o.flags) == null ? void 0 : C.some((_) => _.toLowerCase().includes("seen"))) || !1, h = ((x = u.from) == null ? void 0 : x.address) || ((D = u.from) == null ? void 0 : D.name) || "Unknown";
3709
3709
  return {
3710
3710
  uid: t,
3711
3711
  from: h,
@@ -3715,10 +3715,10 @@ class Lu {
3715
3715
  html: d,
3716
3716
  text: u.text || "",
3717
3717
  seen: f,
3718
- attachments: (u.attachments || []).map((C) => ({
3719
- filename: C.filename || "attachment",
3720
- mimeType: C.mimeType || "application/octet-stream",
3721
- size: this.getContentSize(C.content)
3718
+ attachments: (u.attachments || []).map((_) => ({
3719
+ filename: _.filename || "attachment",
3720
+ mimeType: _.mimeType || "application/octet-stream",
3721
+ size: this.getContentSize(_.content)
3722
3722
  }))
3723
3723
  };
3724
3724
  }
@@ -3978,7 +3978,7 @@ function Mu(r, e, t = {}) {
3978
3978
  }
3979
3979
  }
3980
3980
  }, [r, JSON.stringify(e), n, i, o]);
3981
- return Te(() => {
3981
+ return Ae(() => {
3982
3982
  s && h();
3983
3983
  }, [h, s]), {
3984
3984
  data: a,
@@ -4068,57 +4068,57 @@ var ao;
4068
4068
  function Iu() {
4069
4069
  return ao || (ao = 1, process.env.NODE_ENV !== "production" && function() {
4070
4070
  var r = de, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), p = Symbol.iterator, m = "@@iterator";
4071
- function y(_) {
4072
- if (_ === null || typeof _ != "object")
4071
+ function y(w) {
4072
+ if (w === null || typeof w != "object")
4073
4073
  return null;
4074
- var L = p && _[p] || _[m];
4074
+ var L = p && w[p] || w[m];
4075
4075
  return typeof L == "function" ? L : null;
4076
4076
  }
4077
- var w = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4078
- function x(_) {
4077
+ var C = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4078
+ function x(w) {
4079
4079
  {
4080
4080
  for (var L = arguments.length, q = new Array(L > 1 ? L - 1 : 0), X = 1; X < L; X++)
4081
4081
  q[X - 1] = arguments[X];
4082
- D("error", _, q);
4082
+ D("error", w, q);
4083
4083
  }
4084
4084
  }
4085
- function D(_, L, q) {
4085
+ function D(w, L, q) {
4086
4086
  {
4087
- var X = w.ReactDebugCurrentFrame, ce = X.getStackAddendum();
4087
+ var X = C.ReactDebugCurrentFrame, ce = X.getStackAddendum();
4088
4088
  ce !== "" && (L += "%s", q = q.concat([ce]));
4089
4089
  var Ce = q.map(function(ae) {
4090
4090
  return String(ae);
4091
4091
  });
4092
- Ce.unshift("Warning: " + L), Function.prototype.apply.call(console[_], console, Ce);
4092
+ Ce.unshift("Warning: " + L), Function.prototype.apply.call(console[w], console, Ce);
4093
4093
  }
4094
4094
  }
4095
- var C = !1, A = !1, b = !1, v = !1, E = !1, S;
4095
+ var _ = !1, A = !1, b = !1, v = !1, E = !1, S;
4096
4096
  S = Symbol.for("react.module.reference");
4097
- function j(_) {
4098
- return !!(typeof _ == "string" || typeof _ == "function" || _ === n || _ === i || E || _ === s || _ === u || _ === c || v || _ === h || C || A || b || typeof _ == "object" && _ !== null && (_.$$typeof === f || _.$$typeof === d || _.$$typeof === o || _.$$typeof === a || _.$$typeof === l || // This needs to include all possible module reference object
4097
+ function j(w) {
4098
+ return !!(typeof w == "string" || typeof w == "function" || w === n || w === i || E || w === s || w === u || w === c || v || w === h || _ || A || b || typeof w == "object" && w !== null && (w.$$typeof === f || w.$$typeof === d || w.$$typeof === o || w.$$typeof === a || w.$$typeof === l || // 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
- _.$$typeof === S || _.getModuleId !== void 0));
4102
+ w.$$typeof === S || w.getModuleId !== void 0));
4103
4103
  }
4104
- function k(_, L, q) {
4105
- var X = _.displayName;
4104
+ function k(w, L, q) {
4105
+ var X = w.displayName;
4106
4106
  if (X)
4107
4107
  return X;
4108
4108
  var ce = L.displayName || L.name || "";
4109
4109
  return ce !== "" ? q + "(" + ce + ")" : q;
4110
4110
  }
4111
- function N(_) {
4112
- return _.displayName || "Context";
4111
+ function N(w) {
4112
+ return w.displayName || "Context";
4113
4113
  }
4114
- function R(_) {
4115
- if (_ == null)
4114
+ function R(w) {
4115
+ if (w == null)
4116
4116
  return null;
4117
- if (typeof _.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof _ == "function")
4118
- return _.displayName || _.name || null;
4119
- if (typeof _ == "string")
4120
- return _;
4121
- switch (_) {
4117
+ if (typeof w.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof w == "function")
4118
+ return w.displayName || w.name || null;
4119
+ if (typeof w == "string")
4120
+ return w;
4121
+ switch (w) {
4122
4122
  case n:
4123
4123
  return "Fragment";
4124
4124
  case t:
@@ -4132,21 +4132,21 @@ function Iu() {
4132
4132
  case c:
4133
4133
  return "SuspenseList";
4134
4134
  }
4135
- if (typeof _ == "object")
4136
- switch (_.$$typeof) {
4135
+ if (typeof w == "object")
4136
+ switch (w.$$typeof) {
4137
4137
  case a:
4138
- var L = _;
4138
+ var L = w;
4139
4139
  return N(L) + ".Consumer";
4140
4140
  case o:
4141
- var q = _;
4141
+ var q = w;
4142
4142
  return N(q._context) + ".Provider";
4143
4143
  case l:
4144
- return k(_, _.render, "ForwardRef");
4144
+ return k(w, w.render, "ForwardRef");
4145
4145
  case d:
4146
- var X = _.displayName || null;
4147
- return X !== null ? X : R(_.type) || "Memo";
4146
+ var X = w.displayName || null;
4147
+ return X !== null ? X : R(w.type) || "Memo";
4148
4148
  case f: {
4149
- var ce = _, Ce = ce._payload, ae = ce._init;
4149
+ var ce = w, Ce = ce._payload, ae = ce._init;
4150
4150
  try {
4151
4151
  return R(ae(Ce));
4152
4152
  } catch {
@@ -4156,28 +4156,28 @@ function Iu() {
4156
4156
  }
4157
4157
  return null;
4158
4158
  }
4159
- var F = Object.assign, P = 0, Q, ie, ve, le, Ne, ge, pe;
4160
- function me() {
4161
- }
4162
- me.__reactDisabledLog = !0;
4159
+ var F = Object.assign, P = 0, Q, ie, ve, le, Ne, me, pe;
4163
4160
  function ye() {
4161
+ }
4162
+ ye.__reactDisabledLog = !0;
4163
+ function xe() {
4164
4164
  {
4165
4165
  if (P === 0) {
4166
- Q = console.log, ie = console.info, ve = console.warn, le = console.error, Ne = console.group, ge = console.groupCollapsed, pe = console.groupEnd;
4167
- var _ = {
4166
+ Q = console.log, ie = console.info, ve = console.warn, le = console.error, Ne = console.group, me = console.groupCollapsed, pe = console.groupEnd;
4167
+ var w = {
4168
4168
  configurable: !0,
4169
4169
  enumerable: !0,
4170
- value: me,
4170
+ value: ye,
4171
4171
  writable: !0
4172
4172
  };
4173
4173
  Object.defineProperties(console, {
4174
- info: _,
4175
- log: _,
4176
- warn: _,
4177
- error: _,
4178
- group: _,
4179
- groupCollapsed: _,
4180
- groupEnd: _
4174
+ info: w,
4175
+ log: w,
4176
+ warn: w,
4177
+ error: w,
4178
+ group: w,
4179
+ groupCollapsed: w,
4180
+ groupEnd: w
4181
4181
  });
4182
4182
  }
4183
4183
  P++;
@@ -4186,31 +4186,31 @@ function Iu() {
4186
4186
  function Be() {
4187
4187
  {
4188
4188
  if (P--, P === 0) {
4189
- var _ = {
4189
+ var w = {
4190
4190
  configurable: !0,
4191
4191
  enumerable: !0,
4192
4192
  writable: !0
4193
4193
  };
4194
4194
  Object.defineProperties(console, {
4195
- log: F({}, _, {
4195
+ log: F({}, w, {
4196
4196
  value: Q
4197
4197
  }),
4198
- info: F({}, _, {
4198
+ info: F({}, w, {
4199
4199
  value: ie
4200
4200
  }),
4201
- warn: F({}, _, {
4201
+ warn: F({}, w, {
4202
4202
  value: ve
4203
4203
  }),
4204
- error: F({}, _, {
4204
+ error: F({}, w, {
4205
4205
  value: le
4206
4206
  }),
4207
- group: F({}, _, {
4207
+ group: F({}, w, {
4208
4208
  value: Ne
4209
4209
  }),
4210
- groupCollapsed: F({}, _, {
4211
- value: ge
4210
+ groupCollapsed: F({}, w, {
4211
+ value: me
4212
4212
  }),
4213
- groupEnd: F({}, _, {
4213
+ groupEnd: F({}, w, {
4214
4214
  value: pe
4215
4215
  })
4216
4216
  });
@@ -4218,18 +4218,18 @@ function Iu() {
4218
4218
  P < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
4219
4219
  }
4220
4220
  }
4221
- var we = w.ReactCurrentDispatcher, Ae;
4222
- function Me(_, L, q) {
4221
+ var we = C.ReactCurrentDispatcher, Se;
4222
+ function Me(w, L, q) {
4223
4223
  {
4224
- if (Ae === void 0)
4224
+ if (Se === void 0)
4225
4225
  try {
4226
4226
  throw Error();
4227
4227
  } catch (ce) {
4228
4228
  var X = ce.stack.trim().match(/\n( *(at )?)/);
4229
- Ae = X && X[1] || "";
4229
+ Se = X && X[1] || "";
4230
4230
  }
4231
4231
  return `
4232
- ` + Ae + _;
4232
+ ` + Se + w;
4233
4233
  }
4234
4234
  }
4235
4235
  var fe = !1, ze;
@@ -4237,11 +4237,11 @@ function Iu() {
4237
4237
  var ft = typeof WeakMap == "function" ? WeakMap : Map;
4238
4238
  ze = new ft();
4239
4239
  }
4240
- function Rt(_, L) {
4241
- if (!_ || fe)
4240
+ function Rt(w, L) {
4241
+ if (!w || fe)
4242
4242
  return "";
4243
4243
  {
4244
- var q = ze.get(_);
4244
+ var q = ze.get(w);
4245
4245
  if (q !== void 0)
4246
4246
  return q;
4247
4247
  }
@@ -4250,7 +4250,7 @@ function Iu() {
4250
4250
  var ce = Error.prepareStackTrace;
4251
4251
  Error.prepareStackTrace = void 0;
4252
4252
  var Ce;
4253
- Ce = we.current, we.current = null, ye();
4253
+ Ce = we.current, we.current = null, xe();
4254
4254
  try {
4255
4255
  if (L) {
4256
4256
  var ae = function() {
@@ -4266,14 +4266,14 @@ function Iu() {
4266
4266
  } catch (at) {
4267
4267
  X = at;
4268
4268
  }
4269
- Reflect.construct(_, [], ae);
4269
+ Reflect.construct(w, [], ae);
4270
4270
  } else {
4271
4271
  try {
4272
4272
  ae.call();
4273
4273
  } catch (at) {
4274
4274
  X = at;
4275
4275
  }
4276
- _.call(ae.prototype);
4276
+ w.call(ae.prototype);
4277
4277
  }
4278
4278
  } else {
4279
4279
  try {
@@ -4281,7 +4281,7 @@ function Iu() {
4281
4281
  } catch (at) {
4282
4282
  X = at;
4283
4283
  }
4284
- _();
4284
+ w();
4285
4285
  }
4286
4286
  } catch (at) {
4287
4287
  if (at && X && typeof at.stack == "string") {
@@ -4296,7 +4296,7 @@ function Iu() {
4296
4296
  if (We--, Ve--, Ve < 0 || ue[We] !== nt[Ve]) {
4297
4297
  var xt = `
4298
4298
  ` + ue[We].replace(" at new ", " at ");
4299
- return _.displayName && xt.includes("<anonymous>") && (xt = xt.replace("<anonymous>", _.displayName)), typeof _ == "function" && ze.set(_, xt), xt;
4299
+ return w.displayName && xt.includes("<anonymous>") && (xt = xt.replace("<anonymous>", w.displayName)), typeof w == "function" && ze.set(w, xt), xt;
4300
4300
  }
4301
4301
  while (We >= 1 && Ve >= 0);
4302
4302
  break;
@@ -4305,37 +4305,37 @@ function Iu() {
4305
4305
  } finally {
4306
4306
  fe = !1, we.current = Ce, Be(), Error.prepareStackTrace = ce;
4307
4307
  }
4308
- var Tr = _ ? _.displayName || _.name : "", hr = Tr ? Me(Tr) : "";
4309
- return typeof _ == "function" && ze.set(_, hr), hr;
4308
+ var Tr = w ? w.displayName || w.name : "", hr = Tr ? Me(Tr) : "";
4309
+ return typeof w == "function" && ze.set(w, hr), hr;
4310
4310
  }
4311
- function Vt(_, L, q) {
4312
- return Rt(_, !1);
4311
+ function Vt(w, L, q) {
4312
+ return Rt(w, !1);
4313
4313
  }
4314
- function lt(_) {
4315
- var L = _.prototype;
4314
+ function lt(w) {
4315
+ var L = w.prototype;
4316
4316
  return !!(L && L.isReactComponent);
4317
4317
  }
4318
- function vt(_, L, q) {
4319
- if (_ == null)
4318
+ function vt(w, L, q) {
4319
+ if (w == null)
4320
4320
  return "";
4321
- if (typeof _ == "function")
4322
- return Rt(_, lt(_));
4323
- if (typeof _ == "string")
4324
- return Me(_);
4325
- switch (_) {
4321
+ if (typeof w == "function")
4322
+ return Rt(w, lt(w));
4323
+ if (typeof w == "string")
4324
+ return Me(w);
4325
+ switch (w) {
4326
4326
  case u:
4327
4327
  return Me("Suspense");
4328
4328
  case c:
4329
4329
  return Me("SuspenseList");
4330
4330
  }
4331
- if (typeof _ == "object")
4332
- switch (_.$$typeof) {
4331
+ if (typeof w == "object")
4332
+ switch (w.$$typeof) {
4333
4333
  case l:
4334
- return Vt(_.render);
4334
+ return Vt(w.render);
4335
4335
  case d:
4336
- return vt(_.type, L, q);
4336
+ return vt(w.type, L, q);
4337
4337
  case f: {
4338
- var X = _, ce = X._payload, Ce = X._init;
4338
+ var X = w, ce = X._payload, Ce = X._init;
4339
4339
  try {
4340
4340
  return vt(Ce(ce), L, q);
4341
4341
  } catch {
@@ -4344,26 +4344,26 @@ function Iu() {
4344
4344
  }
4345
4345
  return "";
4346
4346
  }
4347
- var mt = Object.prototype.hasOwnProperty, rr = {}, Kt = w.ReactDebugCurrentFrame;
4348
- function Lt(_) {
4349
- if (_) {
4350
- var L = _._owner, q = vt(_.type, _._source, L ? L.type : null);
4347
+ var mt = Object.prototype.hasOwnProperty, rr = {}, Kt = C.ReactDebugCurrentFrame;
4348
+ function Lt(w) {
4349
+ if (w) {
4350
+ var L = w._owner, q = vt(w.type, w._source, L ? L.type : null);
4351
4351
  Kt.setExtraStackFrame(q);
4352
4352
  } else
4353
4353
  Kt.setExtraStackFrame(null);
4354
4354
  }
4355
- function Pt(_, L, q, X, ce) {
4355
+ function Pt(w, L, q, X, ce) {
4356
4356
  {
4357
4357
  var Ce = Function.call.bind(mt);
4358
- for (var ae in _)
4359
- if (Ce(_, ae)) {
4358
+ for (var ae in w)
4359
+ if (Ce(w, ae)) {
4360
4360
  var ue = void 0;
4361
4361
  try {
4362
- if (typeof _[ae] != "function") {
4363
- var nt = Error((X || "React class") + ": " + q + " type `" + ae + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof _[ae] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
4362
+ if (typeof w[ae] != "function") {
4363
+ var nt = Error((X || "React class") + ": " + q + " type `" + ae + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof w[ae] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
4364
4364
  throw nt.name = "Invariant Violation", nt;
4365
4365
  }
4366
- ue = _[ae](L, ae, X, q, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
4366
+ ue = w[ae](L, ae, X, q, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
4367
4367
  } catch (We) {
4368
4368
  ue = We;
4369
4369
  }
@@ -4372,82 +4372,82 @@ function Iu() {
4372
4372
  }
4373
4373
  }
4374
4374
  var ht = Array.isArray;
4375
- function wt(_) {
4376
- return ht(_);
4375
+ function wt(w) {
4376
+ return ht(w);
4377
4377
  }
4378
- function U(_) {
4378
+ function U(w) {
4379
4379
  {
4380
- var L = typeof Symbol == "function" && Symbol.toStringTag, q = L && _[Symbol.toStringTag] || _.constructor.name || "Object";
4380
+ var L = typeof Symbol == "function" && Symbol.toStringTag, q = L && w[Symbol.toStringTag] || w.constructor.name || "Object";
4381
4381
  return q;
4382
4382
  }
4383
4383
  }
4384
- function Se(_) {
4384
+ function ke(w) {
4385
4385
  try {
4386
- return Re(_), !1;
4386
+ return Re(w), !1;
4387
4387
  } catch {
4388
4388
  return !0;
4389
4389
  }
4390
4390
  }
4391
- function Re(_) {
4392
- return "" + _;
4391
+ function Re(w) {
4392
+ return "" + w;
4393
4393
  }
4394
- function Fe(_) {
4395
- if (Se(_))
4396
- return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", U(_)), Re(_);
4394
+ function Fe(w) {
4395
+ if (ke(w))
4396
+ return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", U(w)), Re(w);
4397
4397
  }
4398
- var jt = w.ReactCurrentOwner, Mt = {
4398
+ var jt = C.ReactCurrentOwner, Mt = {
4399
4399
  key: !0,
4400
4400
  ref: !0,
4401
4401
  __self: !0,
4402
4402
  __source: !0
4403
4403
  }, Ht, G;
4404
- function J(_) {
4405
- if (mt.call(_, "ref")) {
4406
- var L = Object.getOwnPropertyDescriptor(_, "ref").get;
4404
+ function J(w) {
4405
+ if (mt.call(w, "ref")) {
4406
+ var L = Object.getOwnPropertyDescriptor(w, "ref").get;
4407
4407
  if (L && L.isReactWarning)
4408
4408
  return !1;
4409
4409
  }
4410
- return _.ref !== void 0;
4410
+ return w.ref !== void 0;
4411
4411
  }
4412
- function Le(_) {
4413
- if (mt.call(_, "key")) {
4414
- var L = Object.getOwnPropertyDescriptor(_, "key").get;
4412
+ function Le(w) {
4413
+ if (mt.call(w, "key")) {
4414
+ var L = Object.getOwnPropertyDescriptor(w, "key").get;
4415
4415
  if (L && L.isReactWarning)
4416
4416
  return !1;
4417
4417
  }
4418
- return _.key !== void 0;
4418
+ return w.key !== void 0;
4419
4419
  }
4420
- function qe(_, L) {
4421
- typeof _.ref == "string" && jt.current;
4420
+ function qe(w, L) {
4421
+ typeof w.ref == "string" && jt.current;
4422
4422
  }
4423
- function Ue(_, L) {
4423
+ function Ue(w, L) {
4424
4424
  {
4425
4425
  var q = function() {
4426
4426
  Ht || (Ht = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", L));
4427
4427
  };
4428
- q.isReactWarning = !0, Object.defineProperty(_, "key", {
4428
+ q.isReactWarning = !0, Object.defineProperty(w, "key", {
4429
4429
  get: q,
4430
4430
  configurable: !0
4431
4431
  });
4432
4432
  }
4433
4433
  }
4434
- function Ct(_, L) {
4434
+ function Ct(w, L) {
4435
4435
  {
4436
4436
  var q = function() {
4437
4437
  G || (G = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", L));
4438
4438
  };
4439
- q.isReactWarning = !0, Object.defineProperty(_, "ref", {
4439
+ q.isReactWarning = !0, Object.defineProperty(w, "ref", {
4440
4440
  get: q,
4441
4441
  configurable: !0
4442
4442
  });
4443
4443
  }
4444
4444
  }
4445
- var z = function(_, L, q, X, ce, Ce, ae) {
4445
+ var z = function(w, L, q, X, ce, Ce, ae) {
4446
4446
  var ue = {
4447
4447
  // This tag allows us to uniquely identify this as a React Element
4448
4448
  $$typeof: e,
4449
4449
  // Built-in properties that belong on the element
4450
- type: _,
4450
+ type: w,
4451
4451
  key: L,
4452
4452
  ref: q,
4453
4453
  props: ae,
@@ -4471,58 +4471,58 @@ function Iu() {
4471
4471
  value: ce
4472
4472
  }), Object.freeze && (Object.freeze(ue.props), Object.freeze(ue)), ue;
4473
4473
  };
4474
- function T(_, L, q, X, ce) {
4474
+ function T(w, L, q, X, ce) {
4475
4475
  {
4476
4476
  var Ce, ae = {}, ue = null, nt = null;
4477
4477
  q !== void 0 && (Fe(q), ue = "" + q), Le(L) && (Fe(L.key), ue = "" + L.key), J(L) && (nt = L.ref, qe(L, ce));
4478
4478
  for (Ce in L)
4479
4479
  mt.call(L, Ce) && !Mt.hasOwnProperty(Ce) && (ae[Ce] = L[Ce]);
4480
- if (_ && _.defaultProps) {
4481
- var We = _.defaultProps;
4480
+ if (w && w.defaultProps) {
4481
+ var We = w.defaultProps;
4482
4482
  for (Ce in We)
4483
4483
  ae[Ce] === void 0 && (ae[Ce] = We[Ce]);
4484
4484
  }
4485
4485
  if (ue || nt) {
4486
- var Ve = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _;
4486
+ var Ve = typeof w == "function" ? w.displayName || w.name || "Unknown" : w;
4487
4487
  ue && Ue(ae, Ve), nt && Ct(ae, Ve);
4488
4488
  }
4489
- return z(_, ue, nt, ce, X, jt.current, ae);
4489
+ return z(w, ue, nt, ce, X, jt.current, ae);
4490
4490
  }
4491
4491
  }
4492
- var H = w.ReactCurrentOwner, Y = w.ReactDebugCurrentFrame;
4493
- function O(_) {
4494
- if (_) {
4495
- var L = _._owner, q = vt(_.type, _._source, L ? L.type : null);
4492
+ var H = C.ReactCurrentOwner, Y = C.ReactDebugCurrentFrame;
4493
+ function O(w) {
4494
+ if (w) {
4495
+ var L = w._owner, q = vt(w.type, w._source, L ? L.type : null);
4496
4496
  Y.setExtraStackFrame(q);
4497
4497
  } else
4498
4498
  Y.setExtraStackFrame(null);
4499
4499
  }
4500
4500
  var ne;
4501
4501
  ne = !1;
4502
- function Z(_) {
4503
- return typeof _ == "object" && _ !== null && _.$$typeof === e;
4502
+ function Z(w) {
4503
+ return typeof w == "object" && w !== null && w.$$typeof === e;
4504
4504
  }
4505
4505
  function ee() {
4506
4506
  {
4507
4507
  if (H.current) {
4508
- var _ = R(H.current.type);
4509
- if (_)
4508
+ var w = R(H.current.type);
4509
+ if (w)
4510
4510
  return `
4511
4511
 
4512
- Check the render method of \`` + _ + "`.";
4512
+ Check the render method of \`` + w + "`.";
4513
4513
  }
4514
4514
  return "";
4515
4515
  }
4516
4516
  }
4517
- function xe(_) {
4517
+ function be(w) {
4518
4518
  return "";
4519
4519
  }
4520
- var ke = {};
4521
- function te(_) {
4520
+ var Te = {};
4521
+ function te(w) {
4522
4522
  {
4523
4523
  var L = ee();
4524
4524
  if (!L) {
4525
- var q = typeof _ == "string" ? _ : _.displayName || _.name;
4525
+ var q = typeof w == "string" ? w : w.displayName || w.name;
4526
4526
  q && (L = `
4527
4527
 
4528
4528
  Check the top-level render call using <` + q + ">.");
@@ -4530,41 +4530,41 @@ Check the top-level render call using <` + q + ">.");
4530
4530
  return L;
4531
4531
  }
4532
4532
  }
4533
- function se(_, L) {
4533
+ function se(w, L) {
4534
4534
  {
4535
- if (!_._store || _._store.validated || _.key != null)
4535
+ if (!w._store || w._store.validated || w.key != null)
4536
4536
  return;
4537
- _._store.validated = !0;
4537
+ w._store.validated = !0;
4538
4538
  var q = te(L);
4539
- if (ke[q])
4539
+ if (Te[q])
4540
4540
  return;
4541
- ke[q] = !0;
4541
+ Te[q] = !0;
4542
4542
  var X = "";
4543
- _ && _._owner && _._owner !== H.current && (X = " It was passed a child from " + R(_._owner.type) + "."), O(_), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', q, X), O(null);
4543
+ w && w._owner && w._owner !== H.current && (X = " It was passed a child from " + R(w._owner.type) + "."), O(w), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', q, X), O(null);
4544
4544
  }
4545
4545
  }
4546
- function Ge(_, L) {
4546
+ function Ge(w, L) {
4547
4547
  {
4548
- if (typeof _ != "object")
4548
+ if (typeof w != "object")
4549
4549
  return;
4550
- if (wt(_))
4551
- for (var q = 0; q < _.length; q++) {
4552
- var X = _[q];
4550
+ if (wt(w))
4551
+ for (var q = 0; q < w.length; q++) {
4552
+ var X = w[q];
4553
4553
  Z(X) && se(X, L);
4554
4554
  }
4555
- else if (Z(_))
4556
- _._store && (_._store.validated = !0);
4557
- else if (_) {
4558
- var ce = y(_);
4559
- if (typeof ce == "function" && ce !== _.entries)
4560
- for (var Ce = ce.call(_), ae; !(ae = Ce.next()).done; )
4555
+ else if (Z(w))
4556
+ w._store && (w._store.validated = !0);
4557
+ else if (w) {
4558
+ var ce = y(w);
4559
+ if (typeof ce == "function" && ce !== w.entries)
4560
+ for (var Ce = ce.call(w), ae; !(ae = Ce.next()).done; )
4561
4561
  Z(ae.value) && se(ae.value, L);
4562
4562
  }
4563
4563
  }
4564
4564
  }
4565
- function He(_) {
4565
+ function He(w) {
4566
4566
  {
4567
- var L = _.type;
4567
+ var L = w.type;
4568
4568
  if (L == null || typeof L == "string")
4569
4569
  return;
4570
4570
  var q;
@@ -4578,7 +4578,7 @@ Check the top-level render call using <` + q + ">.");
4578
4578
  return;
4579
4579
  if (q) {
4580
4580
  var X = R(L);
4581
- Pt(q, _.props, "prop", X, _);
4581
+ Pt(q, w.props, "prop", X, w);
4582
4582
  } else if (L.PropTypes !== void 0 && !ne) {
4583
4583
  ne = !0;
4584
4584
  var ce = R(L);
@@ -4587,31 +4587,31 @@ Check the top-level render call using <` + q + ">.");
4587
4587
  typeof L.getDefaultProps == "function" && !L.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
4588
4588
  }
4589
4589
  }
4590
- function Pe(_) {
4590
+ function Pe(w) {
4591
4591
  {
4592
- for (var L = Object.keys(_.props), q = 0; q < L.length; q++) {
4592
+ for (var L = Object.keys(w.props), q = 0; q < L.length; q++) {
4593
4593
  var X = L[q];
4594
4594
  if (X !== "children" && X !== "key") {
4595
- O(_), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", X), O(null);
4595
+ O(w), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", X), O(null);
4596
4596
  break;
4597
4597
  }
4598
4598
  }
4599
- _.ref !== null && (O(_), x("Invalid attribute `ref` supplied to `React.Fragment`."), O(null));
4599
+ w.ref !== null && (O(w), x("Invalid attribute `ref` supplied to `React.Fragment`."), O(null));
4600
4600
  }
4601
4601
  }
4602
4602
  var De = {};
4603
- function et(_, L, q, X, ce, Ce) {
4603
+ function et(w, L, q, X, ce, Ce) {
4604
4604
  {
4605
- var ae = j(_);
4605
+ var ae = j(w);
4606
4606
  if (!ae) {
4607
4607
  var ue = "";
4608
- (_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (ue += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
4609
- var nt = xe();
4608
+ (w === void 0 || typeof w == "object" && w !== null && Object.keys(w).length === 0) && (ue += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
4609
+ var nt = be();
4610
4610
  nt ? ue += nt : ue += ee();
4611
4611
  var We;
4612
- _ === null ? We = "null" : wt(_) ? We = "array" : _ !== void 0 && _.$$typeof === e ? (We = "<" + (R(_.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : We = typeof _, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", We, ue);
4612
+ w === null ? We = "null" : wt(w) ? We = "array" : w !== void 0 && w.$$typeof === e ? (We = "<" + (R(w.type) || "Unknown") + " />", ue = " Did you accidentally export a JSX literal instead of a component?") : We = typeof w, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", We, ue);
4613
4613
  }
4614
- var Ve = T(_, L, q, ce, Ce);
4614
+ var Ve = T(w, L, q, ce, Ce);
4615
4615
  if (Ve == null)
4616
4616
  return Ve;
4617
4617
  if (ae) {
@@ -4620,15 +4620,15 @@ Check the top-level render call using <` + q + ">.");
4620
4620
  if (X)
4621
4621
  if (wt(xt)) {
4622
4622
  for (var Tr = 0; Tr < xt.length; Tr++)
4623
- Ge(xt[Tr], _);
4623
+ Ge(xt[Tr], w);
4624
4624
  Object.freeze && Object.freeze(xt);
4625
4625
  } else
4626
4626
  x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
4627
4627
  else
4628
- Ge(xt, _);
4628
+ Ge(xt, w);
4629
4629
  }
4630
4630
  if (mt.call(L, "key")) {
4631
- var hr = R(_), at = Object.keys(L).filter(function(lu) {
4631
+ var hr = R(w), at = Object.keys(L).filter(function(lu) {
4632
4632
  return lu !== "key";
4633
4633
  }), Ls = at.length > 0 ? "{key: someKey, " + at.join(": ..., ") + ": ...}" : "{key: someKey}";
4634
4634
  if (!De[hr + Ls]) {
@@ -4641,14 +4641,14 @@ React keys must be passed directly to JSX without using spread:
4641
4641
  <%s key={someKey} {...props} />`, Ls, hr, ou, hr), De[hr + Ls] = !0;
4642
4642
  }
4643
4643
  }
4644
- return _ === n ? Pe(Ve) : He(Ve), Ve;
4644
+ return w === n ? Pe(Ve) : He(Ve), Ve;
4645
4645
  }
4646
4646
  }
4647
- function tt(_, L, q) {
4648
- return et(_, L, q, !0);
4647
+ function tt(w, L, q) {
4648
+ return et(w, L, q, !0);
4649
4649
  }
4650
- function yt(_, L, q) {
4651
- return et(_, L, q, !1);
4650
+ function yt(w, L, q) {
4651
+ return et(w, L, q, !1);
4652
4652
  }
4653
4653
  var Qt = yt, Dt = tt;
4654
4654
  Jr.Fragment = n, Jr.jsx = Qt, Jr.jsxs = Dt;
@@ -4758,16 +4758,16 @@ function ih({
4758
4758
  onRefresh: h,
4759
4759
  theme: p = {}
4760
4760
  }) {
4761
- const { data: m, loading: y, error: w, refetch: x } = Mu(r, e), [D, C] = K(""), [A, b] = K({}), [v, E] = K(1), S = bt(() => {
4761
+ const { data: m, loading: y, error: C, refetch: x } = Mu(r, e), [D, _] = K(""), [A, b] = K({}), [v, E] = K(1), S = bt(() => {
4762
4762
  if (!m) return { data: [], total: 0, totalPages: 0 };
4763
4763
  let F = m;
4764
4764
  return a && D && l.length > 0 && (F = $s.search(F, D, l)), Object.keys(A).length > 0 && (F = $s.filterByFields(F, A)), $s.paginate(F, v, d);
4765
4765
  }, [m, D, A, v, d, a, l]);
4766
- Te(() => {
4766
+ Ae(() => {
4767
4767
  E(1);
4768
4768
  }, [D, A]);
4769
4769
  const j = () => {
4770
- C(""), b({}), E(1), x(), h == null || h();
4770
+ _(""), b({}), E(1), x(), h == null || h();
4771
4771
  }, k = {
4772
4772
  background: p.background || "#ffffff",
4773
4773
  cardBackground: p.cardBackground || "#f9fafb",
@@ -4788,13 +4788,13 @@ function ih({
4788
4788
  justifyContent: "center",
4789
4789
  padding: "48px",
4790
4790
  color: k.textSecondary
4791
- }, children: "Loading..." }) : w ? /* @__PURE__ */ g.jsxs("div", { style: {
4791
+ }, children: "Loading..." }) : C ? /* @__PURE__ */ g.jsxs("div", { style: {
4792
4792
  padding: "24px",
4793
4793
  textAlign: "center",
4794
4794
  color: "#ef4444"
4795
4795
  }, children: [
4796
4796
  /* @__PURE__ */ g.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
4797
- /* @__PURE__ */ g.jsx("div", { style: { fontSize: "14px" }, children: w.message }),
4797
+ /* @__PURE__ */ g.jsx("div", { style: { fontSize: "14px" }, children: C.message }),
4798
4798
  /* @__PURE__ */ g.jsx(
4799
4799
  "button",
4800
4800
  {
@@ -4855,7 +4855,7 @@ function ih({
4855
4855
  type: "text",
4856
4856
  placeholder: u,
4857
4857
  value: D,
4858
- onChange: (F) => C(F.target.value),
4858
+ onChange: (F) => _(F.target.value),
4859
4859
  style: {
4860
4860
  width: "100%",
4861
4861
  padding: "8px 12px",
@@ -5049,31 +5049,31 @@ function ah({
5049
5049
  cardSize: i = "medium",
5050
5050
  className: o = ""
5051
5051
  }) {
5052
- const a = Math.min(Math.max(e, 1), 5), [l, u] = K([]), [c, d] = K([]), [f, h] = K(Array(a).fill(!1)), [p, m] = K(Array(a).fill(!1)), y = _e([]), w = re((b) => {
5052
+ const a = Math.min(Math.max(e, 1), 5), [l, u] = K([]), [c, d] = K([]), [f, h] = K(Array(a).fill(!1)), [p, m] = K(Array(a).fill(!1)), y = ge([]), C = re((b) => {
5053
5053
  const v = r.filter((S) => !b.includes(S._id));
5054
5054
  if (v.length === 0) return null;
5055
5055
  const E = Math.floor(Math.random() * v.length);
5056
5056
  return v[E];
5057
5057
  }, [r]), x = re(() => Math.random() * (n - t) + t, [t, n]);
5058
- Te(() => {
5058
+ Ae(() => {
5059
5059
  if (r.length === 0) {
5060
5060
  u([]), d([]);
5061
5061
  return;
5062
5062
  }
5063
5063
  const b = [], v = [], E = [];
5064
5064
  for (let S = 0; S < a && S < r.length; S++) {
5065
- const j = w(E);
5065
+ const j = C(E);
5066
5066
  j && (b.push(j), E.push(j._id));
5067
5067
  }
5068
5068
  for (let S = 0; S < b.length; S++) {
5069
5069
  const j = [
5070
5070
  b[S]._id,
5071
5071
  ...b.filter((N, R) => R !== S).map((N) => N._id)
5072
- ], k = w(j);
5072
+ ], k = C(j);
5073
5073
  k ? v.push(k) : v.push(b[S]);
5074
5074
  }
5075
5075
  u(b), d(v);
5076
- }, [r, a, w]);
5076
+ }, [r, a, C]);
5077
5077
  const D = re((b) => {
5078
5078
  const v = x(), E = setTimeout(() => {
5079
5079
  h((S) => {
@@ -5093,7 +5093,7 @@ function ah({
5093
5093
  (S ? c[b] : l[b])._id,
5094
5094
  ...l.filter((P, Q) => Q !== b).map((P) => P._id),
5095
5095
  ...j.filter((P, Q) => Q !== b).map((P) => P._id)
5096
- ], F = w(R);
5096
+ ], F = C(R);
5097
5097
  return F && (k[b] = F), k;
5098
5098
  }), setTimeout(() => {
5099
5099
  D(b);
@@ -5102,14 +5102,14 @@ function ah({
5102
5102
  }, 150);
5103
5103
  }, v);
5104
5104
  y.current[b] = E;
5105
- }, [x, w, l, c, p]), C = _e(!1);
5106
- Te(() => {
5107
- if (!(l.length === 0 || r.length <= 1) && !C.current) {
5108
- C.current = !0;
5105
+ }, [x, C, l, c, p]), _ = ge(!1);
5106
+ Ae(() => {
5107
+ if (!(l.length === 0 || r.length <= 1) && !_.current) {
5108
+ _.current = !0;
5109
5109
  for (let b = 0; b < l.length; b++)
5110
5110
  D(b);
5111
5111
  return () => {
5112
- y.current.forEach((b) => clearTimeout(b)), y.current = [], C.current = !1;
5112
+ y.current.forEach((b) => clearTimeout(b)), y.current = [], _.current = !1;
5113
5113
  };
5114
5114
  }
5115
5115
  }, [l.length, r.length]);
@@ -5252,14 +5252,14 @@ function uh({
5252
5252
  onDelete: p,
5253
5253
  onError: m,
5254
5254
  onLoad: y,
5255
- renderItem: w,
5255
+ renderItem: C,
5256
5256
  renderDetail: x,
5257
5257
  renderActions: D,
5258
- renderEmpty: C,
5258
+ renderEmpty: _,
5259
5259
  renderLoading: A,
5260
5260
  theme: b = {}
5261
5261
  }) {
5262
- const v = { ...zu, ...b }, [E, S] = K([]), [j, k] = K(!1), [N, R] = K(null), [F, P] = K(/* @__PURE__ */ new Set()), [Q, ie] = K(null), [ve, le] = K(null), [Ne, ge] = K(null), [pe, me] = K(!1), [ye, Be] = K(""), we = l !== void 0 ? l : ye, Ae = (G) => {
5262
+ const v = { ...zu, ...b }, [E, S] = K([]), [j, k] = K(!1), [N, R] = K(null), [F, P] = K(/* @__PURE__ */ new Set()), [Q, ie] = K(null), [ve, le] = K(null), [Ne, me] = K(null), [pe, ye] = K(!1), [xe, Be] = K(""), we = l !== void 0 ? l : xe, Se = (G) => {
5263
5263
  u ? u(G) : Be(G);
5264
5264
  }, Me = bt(() => {
5265
5265
  if (!we.trim()) return E;
@@ -5280,19 +5280,19 @@ function uh({
5280
5280
  k(!1);
5281
5281
  }
5282
5282
  }, [fe, t, n, s, m, y]);
5283
- Te(() => {
5283
+ Ae(() => {
5284
5284
  S([]), P(/* @__PURE__ */ new Set()), le(null), R(null), l === void 0 && Be(""), d && ze();
5285
5285
  }, [s, d]);
5286
5286
  const ft = re(async (G) => {
5287
5287
  if (fe) {
5288
- le(G), ge(null), me(!0);
5288
+ le(G), me(null), ye(!0);
5289
5289
  try {
5290
5290
  const J = await fe.getEmailParsed(t, G.uid, s || "INBOX");
5291
- J != null && J.body && ge(J.body);
5291
+ J != null && J.body && me(J.body);
5292
5292
  } catch (J) {
5293
5293
  console.error("Failed to fetch email body:", J);
5294
5294
  }
5295
- me(!1);
5295
+ ye(!1);
5296
5296
  }
5297
5297
  }, [fe, t, s]), Rt = re((G) => {
5298
5298
  f == null || f(G), o && ft(G);
@@ -5504,11 +5504,11 @@ function uh({
5504
5504
  padding: "48px",
5505
5505
  textAlign: "center",
5506
5506
  color: v.textSecondary
5507
- }, children: c }), Se = () => /* @__PURE__ */ g.jsx("div", { style: {
5507
+ }, children: c }), ke = () => /* @__PURE__ */ g.jsx("div", { style: {
5508
5508
  padding: "48px",
5509
5509
  textAlign: "center",
5510
5510
  color: v.textSecondary
5511
- }, children: "Loading..." }), Re = w || Pt, Fe = x || ht, jt = D || wt, Mt = C || U, Ht = A || Se;
5511
+ }, children: "Loading..." }), Re = C || Pt, Fe = x || ht, jt = D || wt, Mt = _ || U, Ht = A || ke;
5512
5512
  return j && E.length === 0 ? /* @__PURE__ */ g.jsx("div", { style: { background: v.background, width: "100%", height: "100%" }, children: Ht() }) : /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", background: v.background, width: "100%", height: "100%" }, children: [
5513
5513
  /* @__PURE__ */ g.jsxs("div", { style: {
5514
5514
  flex: o && ve ? "0 0 50%" : "1",
@@ -5540,7 +5540,7 @@ function uh({
5540
5540
  type: "text",
5541
5541
  placeholder: "Search by email or subject...",
5542
5542
  value: we,
5543
- onChange: (G) => Ae(G.target.value),
5543
+ onChange: (G) => Se(G.target.value),
5544
5544
  style: {
5545
5545
  flex: 1,
5546
5546
  border: "none",
@@ -5554,7 +5554,7 @@ function uh({
5554
5554
  we && /* @__PURE__ */ g.jsx(
5555
5555
  "button",
5556
5556
  {
5557
- onClick: () => Ae(""),
5557
+ onClick: () => Se(""),
5558
5558
  style: {
5559
5559
  border: "none",
5560
5560
  background: "transparent",
@@ -5599,28 +5599,28 @@ function ch({
5599
5599
  showSelectAll: a = !0,
5600
5600
  className: l = ""
5601
5601
  }) {
5602
- const [u, c] = K(/* @__PURE__ */ new Set()), [d, f] = K(-1), h = r.filter((C) => u.has(C.id)), p = d >= 0 && d < h.length ? h[d] : null, m = re((C) => {
5602
+ const [u, c] = K(/* @__PURE__ */ new Set()), [d, f] = K(-1), h = r.filter((_) => u.has(_.id)), p = d >= 0 && d < h.length ? h[d] : null, m = re((_) => {
5603
5603
  c((A) => {
5604
5604
  const b = new Set(A);
5605
- return b.has(C) ? b.delete(C) : b.add(C), t == null || t(Array.from(b)), b;
5605
+ return b.has(_) ? b.delete(_) : b.add(_), t == null || t(Array.from(b)), b;
5606
5606
  });
5607
5607
  }, [t]), y = 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((A) => A.id));
5612
- c(C), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((A) => A.id));
5611
+ const _ = new Set(r.map((A) => A.id));
5612
+ c(_), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((A) => A.id));
5613
5613
  }
5614
- }, [r, u.size, t, n]), w = re(() => {
5614
+ }, [r, u.size, t, n]), C = re(() => {
5615
5615
  if (h.length === 0) return;
5616
- const C = d <= 0 ? h.length - 1 : d - 1;
5617
- f(C), n == null || n(h[C], C);
5616
+ const _ = d <= 0 ? h.length - 1 : d - 1;
5617
+ f(_), n == null || n(h[_], _);
5618
5618
  }, [h, d, n]), x = re(() => {
5619
5619
  if (h.length === 0) return;
5620
- const C = d >= h.length - 1 ? 0 : d + 1;
5621
- f(C), n == null || n(h[C], C);
5622
- }, [h, d, n]), D = re((C) => {
5623
- s == null || s(C, h, p);
5620
+ const _ = d >= h.length - 1 ? 0 : d + 1;
5621
+ f(_), n == null || n(h[_], _);
5622
+ }, [h, d, n]), D = re((_) => {
5623
+ s == null || s(_, h, p);
5624
5624
  }, [s, h, p]);
5625
5625
  return de.useEffect(() => {
5626
5626
  h.length === 0 ? f(-1) : d >= h.length ? f(h.length - 1) : d < 0 && h.length > 0 && (f(0), n == null || n(h[0], 0));
@@ -5648,7 +5648,7 @@ function ch({
5648
5648
  /* @__PURE__ */ g.jsx(
5649
5649
  "button",
5650
5650
  {
5651
- onClick: w,
5651
+ onClick: C,
5652
5652
  className: "p-1 hover:bg-neutral-100 rounded transition-colors",
5653
5653
  title: "Previous",
5654
5654
  children: /* @__PURE__ */ g.jsx("span", { className: "material-icons text-sm", children: "chevron_left" })
@@ -5670,36 +5670,36 @@ function ch({
5670
5670
  )
5671
5671
  ] })
5672
5672
  ] }),
5673
- /* @__PURE__ */ g.jsx("div", { className: "space-y-1", children: r.map((C) => {
5674
- const A = u.has(C.id), b = (p == null ? void 0 : p.id) === C.id;
5673
+ /* @__PURE__ */ g.jsx("div", { className: "space-y-1", children: r.map((_) => {
5674
+ const A = u.has(_.id), b = (p == null ? void 0 : p.id) === _.id;
5675
5675
  return /* @__PURE__ */ g.jsxs(
5676
5676
  "div",
5677
5677
  {
5678
5678
  className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${b ? "bg-blue-50 ring-1 ring-blue-200" : A ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
5679
- onClick: () => m(C.id),
5679
+ onClick: () => m(_.id),
5680
5680
  children: [
5681
5681
  /* @__PURE__ */ g.jsx("span", { className: `material-icons text-lg ${A ? "text-blue-500" : "text-neutral-300"}`, children: A ? "check_box" : "check_box_outline_blank" }),
5682
- /* @__PURE__ */ g.jsx("div", { className: "flex-1 min-w-0", children: e(C, A, b) })
5682
+ /* @__PURE__ */ g.jsx("div", { className: "flex-1 min-w-0", children: e(_, A, b) })
5683
5683
  ]
5684
5684
  },
5685
- C.id
5685
+ _.id
5686
5686
  );
5687
5687
  }) }),
5688
- i.length > 0 && u.size > 0 && /* @__PURE__ */ g.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: i.map((C) => {
5688
+ i.length > 0 && u.size > 0 && /* @__PURE__ */ g.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: i.map((_) => {
5689
5689
  var b;
5690
- const A = ((b = C.disabled) == null ? void 0 : b.call(C, h)) ?? !1;
5690
+ const A = ((b = _.disabled) == null ? void 0 : b.call(_, h)) ?? !1;
5691
5691
  return /* @__PURE__ */ g.jsxs(
5692
5692
  "button",
5693
5693
  {
5694
- onClick: () => D(C.id),
5694
+ onClick: () => D(_.id),
5695
5695
  disabled: A,
5696
5696
  className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${A ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
5697
5697
  children: [
5698
- C.icon && /* @__PURE__ */ g.jsx("span", { className: "material-icons text-sm", children: C.icon }),
5699
- C.label
5698
+ _.icon && /* @__PURE__ */ g.jsx("span", { className: "material-icons text-sm", children: _.icon }),
5699
+ _.label
5700
5700
  ]
5701
5701
  },
5702
- C.id
5702
+ _.id
5703
5703
  );
5704
5704
  }) })
5705
5705
  ] });
@@ -5790,7 +5790,7 @@ function ql(r, e, t) {
5790
5790
  for (let f = 0; f < e.length; f++) {
5791
5791
  const h = e[f], p = h.type, m = h.target, y = Ec(m, r, a, o);
5792
5792
  if (!y) continue;
5793
- const [w, x] = y;
5793
+ const [C, x] = y;
5794
5794
  if (p === "characterData") n && $(x) && Dc(s, m, x) && Cc(m, x, r);
5795
5795
  else if (p === "childList") {
5796
5796
  u = !0;
@@ -5805,14 +5805,14 @@ function ql(r, e, t) {
5805
5805
  S.removeChild(v);
5806
5806
  }
5807
5807
  }
5808
- const C = h.removedNodes, A = C.length;
5808
+ const _ = h.removedNodes, A = _.length;
5809
5809
  if (A > 0) {
5810
5810
  let b = 0;
5811
5811
  for (let v = 0; v < A; v++) {
5812
- const E = C[v];
5812
+ const E = _[v];
5813
5813
  (zs(E, m, r) || l === E) && (m.appendChild(E), b++);
5814
5814
  }
5815
- A !== b && i.set(w, x);
5815
+ A !== b && i.set(C, x);
5816
5816
  }
5817
5817
  }
5818
5818
  }
@@ -5822,8 +5822,8 @@ function ql(r, e, t) {
5822
5822
  for (let f = 0; f < d.length; f++) {
5823
5823
  const h = d[f], p = h.addedNodes, m = h.target;
5824
5824
  for (let y = 0; y < p.length; y++) {
5825
- const w = p[y], x = w.parentNode;
5826
- x == null || w.nodeName !== "BR" || zs(w, m, r) || x.removeChild(w);
5825
+ const C = p[y], x = C.parentNode;
5826
+ x == null || C.nodeName !== "BR" || zs(C, m, r) || x.removeChild(C);
5827
5827
  }
5828
5828
  }
5829
5829
  t.takeRecords();
@@ -6508,12 +6508,12 @@ function $c(r, e, t) {
6508
6508
  const m = ui(f), y = ls(h, null);
6509
6509
  try {
6510
6510
  d.replaceChild(y, m);
6511
- } catch (w) {
6512
- if (typeof w == "object" && w != null) {
6513
- const x = `${w.toString()} Parent: ${d.tagName}, new child: {tag: ${y.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;
6511
+ } catch (C) {
6512
+ if (typeof C == "object" && C != null) {
6513
+ const x = `${C.toString()} Parent: ${d.tagName}, new child: {tag: ${y.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;
6514
6514
  throw new Error(x);
6515
6515
  }
6516
- throw w;
6516
+ throw C;
6517
6517
  }
6518
6518
  os(f, null);
6519
6519
  }
@@ -6527,10 +6527,10 @@ function $c(r, e, t) {
6527
6527
  const p = a.after == null && a.before == null && a.element.__lexicalLineBreak == null;
6528
6528
  li(f, 0, u - 1, p ? null : d), p && (d.textContent = "");
6529
6529
  }
6530
- } else (function(p, m, y, w, x, D) {
6531
- const C = w - 1, A = x - 1;
6530
+ } else (function(p, m, y, C, x, D) {
6531
+ const _ = C - 1, A = x - 1;
6532
6532
  let b, v, E = D.getFirstChild(), S = 0, j = 0;
6533
- for (; S <= C && j <= A; ) {
6533
+ for (; S <= _ && j <= A; ) {
6534
6534
  const R = m[S], F = y[j];
6535
6535
  if (R === F) E = Ws(sn(F, D.element)), S++, j++;
6536
6536
  else {
@@ -6545,11 +6545,11 @@ function $c(r, e, t) {
6545
6545
  const P = Nt.get(F);
6546
6546
  P !== null && $(P) && (Ot === null && (Ot = P.getFormat()), St === "" && (St = P.getStyle()));
6547
6547
  }
6548
- const k = S > C, N = j > A;
6548
+ const k = S > _, N = j > A;
6549
6549
  if (k && !N) {
6550
6550
  const R = y[A + 1], F = R === void 0 ? null : ot.getElementByKey(R);
6551
6551
  ai(y, p, j, A, D.withBefore(F));
6552
- } else N && !k && li(m, S, C, D.element);
6552
+ } else N && !k && li(m, S, _, D.element);
6553
6553
  })(o, f, h, u, c, a);
6554
6554
  }
6555
6555
  Cs(o) && (Je += Xt), d.__lexicalTextContent = Je, Je = l + Je;
@@ -6790,8 +6790,8 @@ Yn && di.push(["beforeinput", (r, e) => function(t, n) {
6790
6790
  }
6791
6791
  } else {
6792
6792
  Ze(null), t.preventDefault();
6793
- const p = o.anchor.getNode(), m = p.getTextContent(), y = p.canInsertTextAfter(), w = o.anchor.offset === 0 && o.focus.offset === m.length;
6794
- ac && h && !w && y || W(n, yr, !0);
6793
+ const p = o.anchor.getNode(), m = p.getTextContent(), y = p.canInsertTextAfter(), C = o.anchor.offset === 0 && o.focus.offset === m.length;
6794
+ ac && h && !C && y || W(n, yr, !0);
6795
6795
  }
6796
6796
  return;
6797
6797
  }
@@ -6897,7 +6897,7 @@ function So(r, e, t) {
6897
6897
  const l = a.anchor, u = l.getNode();
6898
6898
  if (a.isCollapsed()) {
6899
6899
  r.type === "Range" && r.anchorNode === r.focusNode && (a.dirty = !0);
6900
- const c = Ds(e).event, d = c ? c.timeStamp : performance.now(), [f, h, p, m, y] = ca, w = je(), x = e.isComposing() === !1 && w.getTextContent() === "";
6900
+ const c = Ds(e).event, d = c ? c.timeStamp : performance.now(), [f, h, p, m, y] = ca, C = je(), x = e.isComposing() === !1 && C.getTextContent() === "";
6901
6901
  if (d < y + 200 && l.offset === p && l.key === m) a.format = f, a.style = h;
6902
6902
  else if (l.type === "text") $(u) || I(141), a.format = u.getFormat(), a.style = u.getStyle();
6903
6903
  else if (l.type === "element" && !x) {
@@ -6905,13 +6905,13 @@ function So(r, e, t) {
6905
6905
  a.style = "", D instanceof Vr && D.getChildrenSize() === 0 ? (a.format = D.getTextFormat(), a.style = D.getTextStyle()) : a.format = 0;
6906
6906
  }
6907
6907
  } else {
6908
- const c = l.key, d = a.focus.key, f = a.getNodes(), h = f.length, p = a.isBackward(), m = p ? o : s, y = p ? s : o, w = p ? d : c, x = p ? c : d;
6909
- let D = fc, C = !1;
6908
+ const c = l.key, d = a.focus.key, f = a.getNodes(), h = f.length, p = a.isBackward(), m = p ? o : s, y = p ? s : o, C = p ? d : c, x = p ? c : d;
6909
+ let D = fc, _ = !1;
6910
6910
  for (let A = 0; A < h; A++) {
6911
6911
  const b = f[A], v = b.getTextContentSize();
6912
- if ($(b) && v !== 0 && !(A === 0 && b.__key === w && m === v || A === h - 1 && b.__key === x && y === 0) && (C = !0, D &= b.getFormat(), D === 0)) break;
6912
+ if ($(b) && v !== 0 && !(A === 0 && b.__key === C && m === v || A === h - 1 && b.__key === x && y === 0) && (_ = !0, D &= b.getFormat(), D === 0)) break;
6913
6913
  }
6914
- a.format = C ? D : 0;
6914
+ a.format = _ ? D : 0;
6915
6915
  }
6916
6916
  }
6917
6917
  W(e, Di, void 0);
@@ -7611,19 +7611,19 @@ class Gr extends As {
7611
7611
  const d = a[0], f = t.getParent();
7612
7612
  let h;
7613
7613
  const p = t.getFormat(), m = t.getStyle(), y = t.__detail;
7614
- let w = !1;
7615
- t.isSegmented() ? (h = Qe(d), h.__format = p, h.__style = m, h.__detail = y, w = !0) : (h = t.getWritable(), h.__text = d);
7614
+ let C = !1;
7615
+ t.isSegmented() ? (h = Qe(d), h.__format = p, h.__style = m, h.__detail = y, C = !0) : (h = t.getWritable(), h.__text = d);
7616
7616
  const x = V(), D = [h];
7617
- let C = d.length;
7617
+ let _ = d.length;
7618
7618
  for (let A = 1; A < c; A++) {
7619
7619
  const b = a[A], v = b.length, E = Qe(b).getWritable();
7620
7620
  E.__format = p, E.__style = m, E.__detail = y;
7621
- const S = E.__key, j = C + v;
7621
+ const S = E.__key, j = _ + v;
7622
7622
  if (M(x)) {
7623
7623
  const k = x.anchor, N = x.focus;
7624
- k.key === s && k.type === "text" && k.offset > C && k.offset <= j && (k.key = S, k.offset -= C, x.dirty = !0), N.key === s && N.type === "text" && N.offset > C && N.offset <= j && (N.key = S, N.offset -= C, x.dirty = !0);
7624
+ k.key === s && k.type === "text" && k.offset > _ && k.offset <= j && (k.key = S, k.offset -= _, x.dirty = !0), N.key === s && N.type === "text" && N.offset > _ && N.offset <= j && (N.key = S, N.offset -= _, x.dirty = !0);
7625
7625
  }
7626
- i === s && Ze(S), C = j, D.push(E);
7626
+ i === s && Ze(S), _ = j, D.push(E);
7627
7627
  }
7628
7628
  if (f !== null) {
7629
7629
  (function(v) {
@@ -7631,7 +7631,7 @@ class Gr extends As {
7631
7631
  E !== null && ns(E), S !== null && ns(S);
7632
7632
  })(this);
7633
7633
  const A = f.getWritable(), b = this.getIndexWithinParent();
7634
- w ? (A.splice(b, 0, D), this.remove()) : A.splice(b, 1, D), M(x) && cs(x, f, b, c - 1);
7634
+ C ? (A.splice(b, 0, D), this.remove()) : A.splice(b, 1, D), M(x) && cs(x, f, b, c - 1);
7635
7635
  }
7636
7636
  return D;
7637
7637
  }
@@ -8007,9 +8007,9 @@ class fr {
8007
8007
  insertText(e) {
8008
8008
  const t = this.anchor, n = this.focus, s = this.format, i = this.style;
8009
8009
  let o = t, a = n;
8010
- !this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(y, w, x, D) {
8011
- const C = y.getNode(), A = C.getChildAtIndex(y.offset), b = Qe(), v = it(C) ? Ke().append(b) : b;
8012
- b.setFormat(x), b.setStyle(D), A === null ? C.append(v) : A.insertBefore(v), y.is(w) && w.set(b.__key, 0, "text"), y.set(b.__key, 0, "text");
8010
+ !this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(y, C, x, D) {
8011
+ const _ = y.getNode(), A = _.getChildAtIndex(y.offset), b = Qe(), v = it(_) ? Ke().append(b) : b;
8012
+ b.setFormat(x), b.setStyle(D), A === null ? _.append(v) : A.insertBefore(v), y.is(C) && C.set(b.__key, 0, "text"), y.set(b.__key, 0, "text");
8013
8013
  }(o, a, s, i);
8014
8014
  const l = o.offset;
8015
8015
  let u = a.offset;
@@ -8036,8 +8036,8 @@ class fr {
8036
8036
  const D = Qe(e);
8037
8037
  return D.select(), void f.replace(D);
8038
8038
  }
8039
- const y = f.getFormat(), w = f.getStyle();
8040
- if (l !== u || y === s && w === i) {
8039
+ const y = f.getFormat(), C = f.getStyle();
8040
+ if (l !== u || y === s && C === i) {
8041
8041
  if (Qc(f)) {
8042
8042
  const D = Qe(e);
8043
8043
  return D.setFormat(s), D.setStyle(i), D.select(), void f.replace(D);
@@ -8047,19 +8047,19 @@ class fr {
8047
8047
  const D = Qe(e);
8048
8048
  if (D.setFormat(s), D.setStyle(i), D.select(), l === 0) f.insertBefore(D, !1);
8049
8049
  else {
8050
- const [C] = f.splitText(l);
8051
- C.insertAfter(D, !1);
8050
+ const [_] = f.splitText(l);
8051
+ _.insertAfter(D, !1);
8052
8052
  }
8053
8053
  return void (D.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
8054
8054
  }
8055
8055
  f.setFormat(s), f.setStyle(i);
8056
8056
  }
8057
8057
  const x = u - l;
8058
- f = f.spliceText(l, x, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = y, this.style = w));
8058
+ f = f.spliceText(l, x, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = y, this.style = C));
8059
8059
  } else {
8060
- const y = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]), w = B(f) ? f : f.getParentOrThrow();
8060
+ const y = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]), C = B(f) ? f : f.getParentOrThrow();
8061
8061
  let x = B(m) ? m : m.getParentOrThrow(), D = m;
8062
- if (!w.is(x) && x.isInline()) do
8062
+ if (!C.is(x) && x.isInline()) do
8063
8063
  D = x, x = x.getParentOrThrow();
8064
8064
  while (x.isInline());
8065
8065
  if (a.type === "text" && (u !== 0 || m.getTextContent() === "") || a.type === "element" && m.getIndexWithinParent() < u) if ($(m) && !m.isToken() && u !== m.getTextContentSize()) {
@@ -8073,9 +8073,9 @@ class fr {
8073
8073
  E.canBeEmpty() || E.getChildrenSize() !== 1 ? m.remove() : E.remove();
8074
8074
  }
8075
8075
  else y.add(m.__key);
8076
- const C = x.getChildren(), A = new Set(c), b = w.is(x), v = w.isInline() && f.getNextSibling() === null ? w : f;
8077
- for (let E = C.length - 1; E >= 0; E--) {
8078
- const S = C[E];
8076
+ const _ = x.getChildren(), A = new Set(c), b = C.is(x), v = C.isInline() && f.getNextSibling() === null ? C : f;
8077
+ for (let E = _.length - 1; E >= 0; E--) {
8078
+ const S = _[E];
8079
8079
  if (S.is(f) || B(S) && S.isParentOf(f)) break;
8080
8080
  S.isAttached() && (!A.has(S) || S.is(D) ? b || v.insertAfter(S, !1) : S.remove());
8081
8081
  }
@@ -8126,11 +8126,11 @@ class fr {
8126
8126
  formatText(e, t = null) {
8127
8127
  if (this.isCollapsed()) return this.toggleFormat(e), void Ze(null);
8128
8128
  const n = this.getNodes(), s = [];
8129
- for (const C of n) $(C) && s.push(C);
8130
- const i = (C) => {
8129
+ for (const _ of n) $(_) && s.push(_);
8130
+ const i = (_) => {
8131
8131
  n.forEach((A) => {
8132
8132
  if (Ur(A)) {
8133
- const b = A.getFormatFlags(e, C);
8133
+ const b = A.getFormatFlags(e, _);
8134
8134
  A.setTextFormat(b);
8135
8135
  }
8136
8136
  });
@@ -8142,25 +8142,25 @@ class fr {
8142
8142
  const m = h.getFormatFlags(e, t);
8143
8143
  i(m);
8144
8144
  const y = o - 1;
8145
- let w = s[y];
8146
- const x = d.type === "text" ? d.offset : w.getTextContentSize();
8147
- if (h.is(w)) {
8145
+ let C = s[y];
8146
+ const x = d.type === "text" ? d.offset : C.getTextContentSize();
8147
+ if (h.is(C)) {
8148
8148
  if (p === x) return;
8149
8149
  if (gr(h) || p === 0 && x === h.getTextContentSize()) h.setFormat(m);
8150
8150
  else {
8151
- const C = h.splitText(p, x), A = p === 0 ? C[0] : C[1];
8151
+ const _ = h.splitText(p, x), A = p === 0 ? _[0] : _[1];
8152
8152
  A.setFormat(m), c.type === "text" && c.set(A.__key, 0, "text"), d.type === "text" && d.set(A.__key, x - p, "text");
8153
8153
  }
8154
8154
  return void (this.format = m);
8155
8155
  }
8156
8156
  p === 0 || gr(h) || ([, h] = h.splitText(p), p = 0), h.setFormat(m);
8157
- const D = w.getFormatFlags(e, m);
8158
- x > 0 && (x === w.getTextContentSize() || gr(w) || ([w] = w.splitText(x)), w.setFormat(D));
8159
- for (let C = f + 1; C < y; C++) {
8160
- const A = s[C], b = A.getFormatFlags(e, D);
8157
+ const D = C.getFormatFlags(e, m);
8158
+ x > 0 && (x === C.getTextContentSize() || gr(C) || ([C] = C.splitText(x)), C.setFormat(D));
8159
+ for (let _ = f + 1; _ < y; _++) {
8160
+ const A = s[_], b = A.getFormatFlags(e, D);
8161
8161
  A.setFormat(b);
8162
8162
  }
8163
- c.type === "text" && c.set(h.__key, p, "text"), d.type === "text" && d.set(w.__key, x, "text"), this.format = m | D;
8163
+ c.type === "text" && c.set(h.__key, p, "text"), d.type === "text" && d.set(C.__key, x, "text"), this.format = m | D;
8164
8164
  }
8165
8165
  insertNodes(e) {
8166
8166
  if (e.length === 0) return;
@@ -8186,8 +8186,8 @@ class fr {
8186
8186
  const i = function(p) {
8187
8187
  const m = Ke();
8188
8188
  let y = null;
8189
- for (let w = 0; w < p.length; w++) {
8190
- const x = p[w], D = br(x);
8189
+ for (let C = 0; C < p.length; C++) {
8190
+ const x = p[C], D = br(x);
8191
8191
  if (D || Ee(x) && x.isInline() || B(x) && x.isInline() || $(x) || x.isParentRequired()) {
8192
8192
  if (y === null && (y = x.createParentElementNode(), m.append(y), D)) continue;
8193
8193
  y !== null && y.append(x);
@@ -8198,12 +8198,12 @@ class fr {
8198
8198
  let c = a[0];
8199
8199
  var d;
8200
8200
  B(d = c) && sr(d) && !d.isEmpty() && B(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (B(n) || I(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = a[1]), c && (n === null && I(212, t.constructor.name, t.getType()), function(p, m, y) {
8201
- const w = m.getParentOrThrow().getLastChild();
8201
+ const C = m.getParentOrThrow().getLastChild();
8202
8202
  let x = m;
8203
8203
  const D = [m];
8204
- for (; x !== w; ) x.getNextSibling() || I(140), x = x.getNextSibling(), D.push(x);
8205
- let C = p;
8206
- for (const A of D) C = C.insertAfter(A);
8204
+ for (; x !== C; ) x.getNextSibling() || I(140), x = x.getNextSibling(), D.push(x);
8205
+ let _ = p;
8206
+ for (const A of D) _ = _.insertAfter(A);
8207
8207
  }(n, c));
8208
8208
  const f = Zr(o, sr);
8209
8209
  l && B(f) && (l.canMergeWhenEmpty() || sr(u)) && (f.append(...l.getChildren()), l.remove()), B(n) && n.isEmpty() && n.remove(), o.selectEnd();
@@ -8277,12 +8277,12 @@ class fr {
8277
8277
  const f = u.getRangeAt(0), h = this.anchor.getNode(), p = it(h) ? h : Fc(h);
8278
8278
  if (this.applyDOMRange(f), this.dirty = !0, !o) {
8279
8279
  const m = this.getNodes(), y = [];
8280
- let w = !1;
8280
+ let C = !1;
8281
8281
  for (let x = 0; x < m.length; x++) {
8282
8282
  const D = m[x];
8283
- dn(D, p) ? y.push(D) : w = !0;
8283
+ dn(D, p) ? y.push(D) : C = !0;
8284
8284
  }
8285
- if (w && y.length > 0) if (t) {
8285
+ if (C && y.length > 0) if (t) {
8286
8286
  const x = y[0];
8287
8287
  B(x) ? x.selectStart() : x.getParentOrThrow().selectStart();
8288
8288
  } else {
@@ -8290,8 +8290,8 @@ class fr {
8290
8290
  B(x) ? x.selectEnd() : x.getParentOrThrow().selectEnd();
8291
8291
  }
8292
8292
  u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(x) {
8293
- const D = x.focus, C = x.anchor, A = C.key, b = C.offset, v = C.type;
8294
- ir(C, D.key, D.offset, D.type), ir(D, A, b, v), x._cachedNodes = null;
8293
+ const D = x.focus, _ = x.anchor, A = _.key, b = _.offset, v = _.type;
8294
+ ir(_, D.key, D.offset, D.type), ir(D, A, b, v), x._cachedNodes = null;
8295
8295
  }(this);
8296
8296
  }
8297
8297
  }
@@ -8335,8 +8335,8 @@ class fr {
8335
8335
  (function(l, u) {
8336
8336
  const c = l.anchor, d = l.focus, f = c.getNode(), h = d.getNode();
8337
8337
  if (f === h && c.type === "text" && d.type === "text") {
8338
- const p = c.offset, m = d.offset, y = p < m, w = y ? p : m, x = y ? m : p, D = x - 1;
8339
- w !== D && (Yl(f.getTextContent().slice(w, x)) || (u ? d.offset = D : c.offset = D));
8338
+ const p = c.offset, m = d.offset, y = p < m, C = y ? p : m, x = y ? m : p, D = x - 1;
8339
+ C !== D && (Yl(f.getTextContent().slice(C, x)) || (u ? d.offset = D : c.offset = D));
8340
8340
  }
8341
8341
  })(this, e);
8342
8342
  }
@@ -8419,7 +8419,7 @@ function jo(r, e, t, n) {
8419
8419
  const h = n.getElementByKey(f.getKey());
8420
8420
  h === null && I(214), [f, i] = f.getDOMSlot(h).resolveChildIndex(f, h, r, e), B(f) || I(215), o && i >= f.getChildrenSize() && (i = Math.max(0, f.getChildrenSize() - 1));
8421
8421
  let m = f.getChildAtIndex(i);
8422
- if (B(m) && function(y, w, x) {
8422
+ if (B(m) && function(y, C, x) {
8423
8423
  const D = y.getParent();
8424
8424
  return x === null || D === null || !D.canBeEmpty() || D !== x.getNode();
8425
8425
  }(m, 0, t)) {
@@ -8571,15 +8571,15 @@ function Xc(r, e, t, n, s, i, o) {
8571
8571
  const a = n.anchorNode, l = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
8572
8572
  if (s.has("collaboration") && d !== i || d !== null && Mi(d)) return;
8573
8573
  if (!M(e)) return void (r !== null && An(t, a, l) && n.removeAllRanges());
8574
- const f = e.anchor, h = e.focus, p = f.key, m = h.key, y = ss(t, p), w = ss(t, m), x = f.offset, D = h.offset, C = e.format, A = e.style, b = e.isCollapsed();
8575
- let v = y, E = w, S = !1;
8574
+ const f = e.anchor, h = e.focus, p = f.key, m = h.key, y = ss(t, p), C = ss(t, m), x = f.offset, D = h.offset, _ = e.format, A = e.style, b = e.isCollapsed();
8575
+ let v = y, E = C, S = !1;
8576
8576
  if (f.type === "text") {
8577
8577
  v = ts(y);
8578
8578
  const P = f.getNode();
8579
- S = P.getFormat() !== C || P.getStyle() !== A;
8579
+ S = P.getFormat() !== _ || P.getStyle() !== A;
8580
8580
  } else M(r) && r.anchor.type === "text" && (S = !0);
8581
8581
  var j, k, N, R, F;
8582
- if (h.type === "text" && (E = ts(w)), v !== null && E !== null && (b && (r === null || S || M(r) && (r.format !== C || r.style !== A)) && (j = C, k = A, N = x, R = p, F = performance.now(), ca = [j, k, N, R, F]), u !== x || c !== D || a !== v || l !== E || n.type === "Range" && b || (d !== null && i.contains(d) || i.focus({ preventScroll: !0 }), f.type === "element"))) {
8582
+ if (h.type === "text" && (E = ts(C)), v !== null && E !== null && (b && (r === null || S || M(r) && (r.format !== _ || r.style !== A)) && (j = _, k = A, N = x, R = p, F = performance.now(), ca = [j, k, N, R, F]), u !== x || c !== D || a !== v || l !== E || n.type === "Range" && b || (d !== null && i.contains(d) || i.focus({ preventScroll: !0 }), f.type === "element"))) {
8583
8583
  try {
8584
8584
  n.setBaseAndExtent(v, x, E, D);
8585
8585
  } catch {
@@ -8593,25 +8593,25 @@ function Xc(r, e, t, n, s, i, o) {
8593
8593
  ie.selectNode(P), Q = ie.getBoundingClientRect();
8594
8594
  } else Q = P.getBoundingClientRect();
8595
8595
  (function(ie, ve, le) {
8596
- const Ne = le.ownerDocument, ge = Ne.defaultView;
8597
- if (ge === null) return;
8598
- let { top: pe, bottom: me } = ve, ye = 0, Be = 0, we = le;
8596
+ const Ne = le.ownerDocument, me = Ne.defaultView;
8597
+ if (me === null) return;
8598
+ let { top: pe, bottom: ye } = ve, xe = 0, Be = 0, we = le;
8599
8599
  for (; we !== null; ) {
8600
- const Ae = we === Ne.body;
8601
- if (Ae) ye = 0, Be = Ds(ie).innerHeight;
8600
+ const Se = we === Ne.body;
8601
+ if (Se) xe = 0, Be = Ds(ie).innerHeight;
8602
8602
  else {
8603
8603
  const fe = we.getBoundingClientRect();
8604
- ye = fe.top, Be = fe.bottom;
8604
+ xe = fe.top, Be = fe.bottom;
8605
8605
  }
8606
8606
  let Me = 0;
8607
- if (pe < ye ? Me = -(ye - pe) : me > Be && (Me = me - Be), Me !== 0) if (Ae) ge.scrollBy(0, Me);
8607
+ if (pe < xe ? Me = -(xe - pe) : ye > Be && (Me = ye - Be), Me !== 0) if (Se) me.scrollBy(0, Me);
8608
8608
  else {
8609
8609
  const fe = we.scrollTop;
8610
8610
  we.scrollTop += Me;
8611
8611
  const ze = we.scrollTop - fe;
8612
- pe -= ze, me -= ze;
8612
+ pe -= ze, ye -= ze;
8613
8613
  }
8614
- if (Ae) break;
8614
+ if (Se) break;
8615
8615
  we = Sn(we);
8616
8616
  }
8617
8617
  })(t, Q, i);
@@ -8750,7 +8750,7 @@ function lr(r, e) {
8750
8750
  }
8751
8751
  }
8752
8752
  t._readOnly || (t._readOnly = !0);
8753
- const m = r._dirtyLeaves, y = r._dirtyElements, w = r._normalizedNodes, x = r._updateTags, D = r._deferred;
8753
+ const m = r._dirtyLeaves, y = r._dirtyElements, C = r._normalizedNodes, x = r._updateTags, D = r._deferred;
8754
8754
  l && (r._dirtyType = _r, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(b, v) {
8755
8755
  const E = b._decorators;
8756
8756
  let S = b._pendingDecorators || E;
@@ -8758,13 +8758,13 @@ function lr(r, e) {
8758
8758
  let k;
8759
8759
  for (k in S) j.has(k) || (S === E && (S = Ql(b)), delete S[k]);
8760
8760
  }(r, t);
8761
- const C = s ? null : _t(r._window);
8762
- if (r._editable && C !== null && (l || a === null || a.dirty)) {
8761
+ const _ = s ? null : _t(r._window);
8762
+ if (r._editable && _ !== null && (l || a === null || a.dirty)) {
8763
8763
  Xe = r, Ye = t;
8764
8764
  try {
8765
8765
  if (h !== null && h.disconnect(), l || a === null || a.dirty) {
8766
8766
  const b = r._blockCursorElement;
8767
- b !== null && Ui(b, r, n), Xc(o, a, r, C, x, n);
8767
+ b !== null && Ui(b, r, n), Xc(o, a, r, _, x, n);
8768
8768
  }
8769
8769
  Rc(r, n, a), h !== null && h.observe(n, zo);
8770
8770
  } finally {
@@ -8782,7 +8782,7 @@ function lr(r, e) {
8782
8782
  A !== null && (r._decorators = A, r._pendingDecorators = null, pn("decorator", r, !0, A)), function(b, v, E) {
8783
8783
  const S = mo(v), j = mo(E);
8784
8784
  S !== j && pn("textcontent", b, !0, j);
8785
- }(r, e || i, t), pn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: w, prevEditorState: e || i, tags: x }), function(b, v) {
8785
+ }(r, e || i, t), pn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: C, prevEditorState: e || i, tags: x }), function(b, v) {
8786
8786
  if (b._deferred = [], v.length !== 0) {
8787
8787
  const E = b._updating;
8788
8788
  b._updating = !0;
@@ -8863,30 +8863,30 @@ function Ea(r, e, t) {
8863
8863
  const c = Ye, d = ct, f = Xe, h = r._updating;
8864
8864
  Ye = l, ct = !1, r._updating = !0, Xe = r;
8865
8865
  try {
8866
- u && (r._headless ? a._selection !== null && (l._selection = a._selection.clone()) : l._selection = function(w) {
8867
- const x = w.getEditorState()._selection, D = _t(w._window);
8868
- return M(x) || x == null ? Ki(x, D, w, null) : x.clone();
8866
+ u && (r._headless ? a._selection !== null && (l._selection = a._selection.clone()) : l._selection = function(C) {
8867
+ const x = C.getEditorState()._selection, D = _t(C._window);
8868
+ return M(x) || x == null ? Ki(x, D, C, null) : x.clone();
8869
8869
  }(r));
8870
8870
  const m = r._compositionKey;
8871
- e(), i = Go(r, i), function(w, x) {
8872
- const D = x.getEditorState()._selection, C = w._selection;
8873
- if (M(C)) {
8874
- const A = C.anchor, b = C.focus;
8871
+ e(), i = Go(r, i), function(C, x) {
8872
+ const D = x.getEditorState()._selection, _ = C._selection;
8873
+ if (M(_)) {
8874
+ const A = _.anchor, b = _.focus;
8875
8875
  let v;
8876
- if (A.type === "text" && (v = A.getNode(), v.selectionTransform(D, C)), b.type === "text") {
8876
+ if (A.type === "text" && (v = A.getNode(), v.selectionTransform(D, _)), b.type === "text") {
8877
8877
  const E = b.getNode();
8878
- v !== E && E.selectionTransform(D, C);
8878
+ v !== E && E.selectionTransform(D, _);
8879
8879
  }
8880
8880
  }
8881
- }(l, r), r._dirtyType !== _r && (i ? function(w, x) {
8882
- const D = x._dirtyLeaves, C = w._nodeMap;
8881
+ }(l, r), r._dirtyType !== _r && (i ? function(C, x) {
8882
+ const D = x._dirtyLeaves, _ = C._nodeMap;
8883
8883
  for (const A of D) {
8884
- const b = C.get(A);
8884
+ const b = _.get(A);
8885
8885
  $(b) && b.isAttached() && b.isSimpleText() && !b.isUnmergeable() && po(b);
8886
8886
  }
8887
- }(l, r) : function(w, x) {
8888
- const D = x._dirtyLeaves, C = x._dirtyElements, A = w._nodeMap, b = or(), v = /* @__PURE__ */ new Map();
8889
- let E = D, S = E.size, j = C, k = j.size;
8887
+ }(l, r) : function(C, x) {
8888
+ const D = x._dirtyLeaves, _ = x._dirtyElements, A = C._nodeMap, b = or(), v = /* @__PURE__ */ new Map();
8889
+ let E = D, S = E.size, j = _, k = j.size;
8890
8890
  for (; S > 0 || k > 0; ) {
8891
8891
  if (S > 0) {
8892
8892
  x._dirtyLeaves = /* @__PURE__ */ new Set();
@@ -8904,16 +8904,16 @@ function Ea(r, e, t) {
8904
8904
  const R = N[0], F = N[1];
8905
8905
  if (R !== "root" && !F) continue;
8906
8906
  const P = A.get(R);
8907
- P !== void 0 && Uo(P, b) && qo(x, P, v), C.set(R, F);
8907
+ P !== void 0 && Uo(P, b) && qo(x, P, v), _.set(R, F);
8908
8908
  }
8909
8909
  E = x._dirtyLeaves, S = E.size, j = x._dirtyElements, k = j.size, Kn++;
8910
8910
  }
8911
- x._dirtyLeaves = D, x._dirtyElements = C;
8912
- }(l, r), Go(r), function(w, x, D, C) {
8913
- const A = w._nodeMap, b = x._nodeMap, v = [];
8914
- for (const [E] of C) {
8911
+ x._dirtyLeaves = D, x._dirtyElements = _;
8912
+ }(l, r), Go(r), function(C, x, D, _) {
8913
+ const A = C._nodeMap, b = x._nodeMap, v = [];
8914
+ for (const [E] of _) {
8915
8915
  const S = b.get(E);
8916
- S !== void 0 && (S.isAttached() || (B(S) && ta(S, E, A, b, v, C), A.has(E) || C.delete(E), v.push(E)));
8916
+ S !== void 0 && (S.isAttached() || (B(S) && ta(S, E, A, b, v, _), A.has(E) || _.delete(E), v.push(E)));
8917
8917
  }
8918
8918
  for (const E of v) b.delete(E);
8919
8919
  for (const E of D) {
@@ -8923,8 +8923,8 @@ function Ea(r, e, t) {
8923
8923
  }(a, l, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (l._flushSync = !0);
8924
8924
  const y = l._selection;
8925
8925
  if (M(y)) {
8926
- const w = l._nodeMap, x = y.anchor.key, D = y.focus.key;
8927
- w.get(x) !== void 0 && w.get(D) !== void 0 || I(19);
8926
+ const C = l._nodeMap, x = y.anchor.key, D = y.focus.key;
8927
+ C.get(x) !== void 0 && C.get(D) !== void 0 || I(19);
8928
8928
  } else It(y) && y._nodes.size === 0 && (l._selection = null);
8929
8929
  } catch (m) {
8930
8930
  return m instanceof Error && r._onError(m), r._pendingEditorState = a, r._dirtyType = zr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void lr(r);
@@ -8932,10 +8932,10 @@ function Ea(r, e, t) {
8932
8932
  Ye = c, ct = d, Xe = f, r._updating = h, Kn = 0;
8933
8933
  }
8934
8934
  r._dirtyType !== _r || function(m, y) {
8935
- const w = y.getEditorState()._selection, x = m._selection;
8935
+ const C = y.getEditorState()._selection, x = m._selection;
8936
8936
  if (x !== null) {
8937
- if (x.dirty || !x.is(w)) return !0;
8938
- } else if (w !== null) return !0;
8937
+ if (x.dirty || !x.is(C)) return !0;
8938
+ } else if (C !== null) return !0;
8939
8939
  return !1;
8940
8940
  }(l, r) ? l._flushSync ? (l._flushSync = !1, lr(r)) : u && Sc(() => {
8941
8941
  lr(r);
@@ -9240,8 +9240,8 @@ class tr extends As {
9240
9240
  let p = d === null ? this.getFirstChild() : d.getNextSibling();
9241
9241
  for (let m = 0; m < t; m++) {
9242
9242
  p === null && I(100);
9243
- const y = p.getNextSibling(), w = p.__key;
9244
- xr(p.getWritable()), u.push(w), p = y;
9243
+ const y = p.getNextSibling(), C = p.__key;
9244
+ xr(p.getWritable()), u.push(C), p = y;
9245
9245
  }
9246
9246
  }
9247
9247
  let h = d;
@@ -9250,13 +9250,13 @@ class tr extends As {
9250
9250
  h !== null && m.is(h) && (d = h = h.getPreviousSibling());
9251
9251
  const y = m.getWritable();
9252
9252
  y.__parent === a && f--, xr(y);
9253
- const w = m.__key;
9254
- if (h === null) o.__first = w, y.__prev = null;
9253
+ const C = m.__key;
9254
+ if (h === null) o.__first = C, y.__prev = null;
9255
9255
  else {
9256
9256
  const x = h.getWritable();
9257
- x.__next = w, y.__prev = x.__key;
9257
+ x.__next = C, y.__prev = x.__key;
9258
9258
  }
9259
- m.__key === a && I(76), y.__parent = a, l.push(w), h = m;
9259
+ m.__key === a && I(76), y.__parent = a, l.push(C), h = m;
9260
9260
  }
9261
9261
  if (e + t === i)
9262
9262
  h !== null && (h.getWritable().__next = null, o.__last = h.__key);
@@ -9270,8 +9270,8 @@ class tr extends As {
9270
9270
  if (o.__size = f, u.length) {
9271
9271
  const p = V();
9272
9272
  if (M(p)) {
9273
- const m = new Set(u), y = new Set(l), { anchor: w, focus: x } = p;
9274
- Ko(w, m, y) && ds(w, w.getNode(), this, d, c), Ko(x, m, y) && ds(x, x.getNode(), this, d, c), f !== 0 || this.canBeEmpty() || Ut(this) || this.remove();
9273
+ const m = new Set(u), y = new Set(l), { anchor: C, focus: x } = p;
9274
+ Ko(C, m, y) && ds(C, C.getNode(), this, d, c), Ko(x, m, y) && ds(x, x.getNode(), this, d, c), f !== 0 || this.canBeEmpty() || Ut(this) || this.remove();
9275
9275
  }
9276
9276
  }
9277
9277
  return o;
@@ -9558,7 +9558,7 @@ function Ke() {
9558
9558
  function Ur(r) {
9559
9559
  return r instanceof Vr;
9560
9560
  }
9561
- const be = 0, Pr = 1, nd = 4;
9561
+ const _e = 0, Pr = 1, nd = 4;
9562
9562
  function ka(r, e, t, n) {
9563
9563
  const s = r._keyToDOMMap;
9564
9564
  s.clear(), r._editorState = Ji(), r._pendingEditorState = n, r._compositionKey = null, r._dirtyType = _r, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set(), r._updates = [], r._blockCursorElement = null;
@@ -9572,29 +9572,29 @@ function sd(r) {
9572
9572
  else {
9573
9573
  h = /* @__PURE__ */ new Map();
9574
9574
  for (let m = 0; m < u.length; m++) {
9575
- let y = u[m], w = null, x = null;
9575
+ let y = u[m], C = null, x = null;
9576
9576
  if (typeof y != "function") {
9577
9577
  const b = y;
9578
- y = b.replace, w = b.with, x = b.withKlass || null;
9578
+ y = b.replace, C = b.with, x = b.withKlass || null;
9579
9579
  }
9580
- const D = y.getType(), C = y.transform(), A = /* @__PURE__ */ new Set();
9581
- C !== null && A.add(C), h.set(D, { exportDOM: d && d.export ? d.export.get(y) : void 0, klass: y, replace: w, replaceWithKlass: x, transforms: A });
9580
+ const D = y.getType(), _ = y.transform(), A = /* @__PURE__ */ new Set();
9581
+ _ !== null && A.add(_), h.set(D, { exportDOM: d && d.export ? d.export.get(y) : void 0, klass: y, replace: C, replaceWithKlass: x, transforms: A });
9582
9582
  }
9583
9583
  }
9584
9584
  const p = new Ts(o, s, h, { disableEvents: i, namespace: a, theme: n }, c || console.error, function(m, y) {
9585
- const w = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), D = (C) => {
9586
- Object.keys(C).forEach((A) => {
9587
- let b = w.get(A);
9588
- b === void 0 && (b = [], w.set(A, b)), b.push(C[A]);
9585
+ const C = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), D = (_) => {
9586
+ Object.keys(_).forEach((A) => {
9587
+ let b = C.get(A);
9588
+ b === void 0 && (b = [], C.set(A, b)), b.push(_[A]);
9589
9589
  });
9590
9590
  };
9591
- return m.forEach((C) => {
9592
- const A = C.klass.importDOM;
9591
+ return m.forEach((_) => {
9592
+ const A = _.klass.importDOM;
9593
9593
  if (A == null || x.has(A)) return;
9594
9594
  x.add(A);
9595
- const b = A.call(C.klass);
9595
+ const b = A.call(_.klass);
9596
9596
  b !== null && D(b);
9597
- }), y && D(y), w;
9597
+ }), y && D(y), C;
9598
9598
  }(h, d ? d.import : void 0), f);
9599
9599
  return l !== void 0 && (p._pendingEditorState = l, p._dirtyType = zr), p;
9600
9600
  }
@@ -9727,26 +9727,26 @@ class Ts {
9727
9727
  } : (y) => {
9728
9728
  if (To(y)) return;
9729
9729
  ko(y);
9730
- const w = l.isEditable();
9730
+ const C = l.isEditable();
9731
9731
  switch (h) {
9732
9732
  case "cut":
9733
- return w && W(l, Si, y);
9733
+ return C && W(l, Si, y);
9734
9734
  case "copy":
9735
9735
  return W(l, xs, y);
9736
9736
  case "paste":
9737
- return w && W(l, ys, y);
9737
+ return C && W(l, ys, y);
9738
9738
  case "dragstart":
9739
- return w && W(l, jl, y);
9739
+ return C && W(l, jl, y);
9740
9740
  case "dragover":
9741
- return w && W(l, Ml, y);
9741
+ return C && W(l, Ml, y);
9742
9742
  case "dragend":
9743
- return w && W(l, ec, y);
9743
+ return C && W(l, ec, y);
9744
9744
  case "focus":
9745
- return w && W(l, nc, y);
9745
+ return C && W(l, nc, y);
9746
9746
  case "blur":
9747
- return w && W(l, sc, y);
9747
+ return C && W(l, sc, y);
9748
9748
  case "drop":
9749
- return w && W(l, Pl, y);
9749
+ return C && W(l, Pl, y);
9750
9750
  }
9751
9751
  };
9752
9752
  a.addEventListener(h, m), d.push(() => {
@@ -9818,7 +9818,7 @@ class Ts {
9818
9818
  }
9819
9819
  }
9820
9820
  Ts.version = "0.21.0+prod.esm";
9821
- const Ta = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, id = Ta ? Wr : Te, qn = { tag: "history-merge" };
9821
+ const Ta = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, id = Ta ? Wr : Ae, qn = { tag: "history-merge" };
9822
9822
  function od({ initialConfig: r, children: e }) {
9823
9823
  const t = bt(() => {
9824
9824
  const { theme: n, namespace: s, nodes: i, onError: o, editorState: a, html: l } = r, u = Wu(null, n), c = sd({ editable: r.editable, html: l, namespace: s, nodes: i, onError: (d) => o(d, c), theme: n });
@@ -9855,13 +9855,13 @@ function od({ initialConfig: r, children: e }) {
9855
9855
  s.setEditable(n === void 0 || n);
9856
9856
  }, []), g.jsx(Al.Provider, { value: t, children: e });
9857
9857
  }
9858
- const ld = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Te;
9858
+ const ld = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Ae;
9859
9859
  function ad(r) {
9860
9860
  return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
9861
9861
  }
9862
9862
  function ud() {
9863
9863
  return function(r) {
9864
- const [e] = Bt(), t = bt(() => r(e), [e, r]), [n, s] = K(() => t.initialValueFn()), i = _e(n);
9864
+ const [e] = Bt(), t = bt(() => r(e), [e, r]), [n, s] = K(() => t.initialValueFn()), i = ge(n);
9865
9865
  return ld(() => {
9866
9866
  const { initialValueFn: o, subscribe: a } = t, l = o();
9867
9867
  return i.current !== l && (i.current = l, s(l)), a((u) => {
@@ -10061,11 +10061,11 @@ function Sd(r) {
10061
10061
  const m = V();
10062
10062
  if (M(m)) {
10063
10063
  const y = m.anchor;
10064
- let w = y.getNode(), x = 0, D = 0;
10065
- if ($(w) && u >= 0 && c >= 0 && (x = u, D = u + c, m.setTextNodeRange(w, x, w, D)), x === D && d === "" || (m.insertRawText(d), w = y.getNode()), $(w)) {
10064
+ let C = y.getNode(), x = 0, D = 0;
10065
+ if ($(C) && u >= 0 && c >= 0 && (x = u, D = u + c, m.setTextNodeRange(C, x, C, D)), x === D && d === "" || (m.insertRawText(d), C = y.getNode()), $(C)) {
10066
10066
  x = f, D = f + h;
10067
- const C = w.getTextContentSize();
10068
- x = x > C ? C : x, D = D > C ? C : D, m.setTextNodeRange(w, x, w, D);
10067
+ const _ = C.getTextContentSize();
10068
+ x = x > _ ? _ : x, D = D > _ ? _ : D, m.setTextNodeRange(C, x, C, D);
10069
10069
  }
10070
10070
  n.stopImmediatePropagation();
10071
10071
  }
@@ -10138,11 +10138,11 @@ function Ia(r, e, t, n, s = /* @__PURE__ */ new Map(), i) {
10138
10138
  if (Oa.has(r.nodeName)) return o;
10139
10139
  let a = null;
10140
10140
  const l = function(p, m) {
10141
- const { nodeName: y } = p, w = m._htmlConversions.get(y.toLowerCase());
10141
+ const { nodeName: y } = p, C = m._htmlConversions.get(y.toLowerCase());
10142
10142
  let x = null;
10143
- if (w !== void 0) for (const D of w) {
10144
- const C = D(p);
10145
- C !== null && (x === null || (x.priority || 0) <= (C.priority || 0)) && (x = C);
10143
+ if (C !== void 0) for (const D of C) {
10144
+ const _ = D(p);
10145
+ _ !== null && (x === null || (x.priority || 0) <= (_.priority || 0)) && (x = _);
10146
10146
  }
10147
10147
  return x !== null ? x.conversion : null;
10148
10148
  }(r, e), u = l ? l(r) : null;
@@ -10501,13 +10501,13 @@ function Ud(r) {
10501
10501
  }, 0), r.registerCommand(yr, (e) => {
10502
10502
  const t = V();
10503
10503
  return !!M(t) && (t.deleteCharacter(e), !0);
10504
- }, be), r.registerCommand(yn, (e) => {
10504
+ }, _e), r.registerCommand(yn, (e) => {
10505
10505
  const t = V();
10506
10506
  return !!M(t) && (t.deleteWord(e), !0);
10507
- }, be), r.registerCommand(xn, (e) => {
10507
+ }, _e), r.registerCommand(xn, (e) => {
10508
10508
  const t = V();
10509
10509
  return !!M(t) && (t.deleteLine(e), !0);
10510
- }, be), r.registerCommand(Or, (e) => {
10510
+ }, _e), r.registerCommand(Or, (e) => {
10511
10511
  const t = V();
10512
10512
  if (typeof e == "string") t !== null && t.insertText(e);
10513
10513
  else {
@@ -10520,13 +10520,13 @@ function Ud(r) {
10520
10520
  }
10521
10521
  }
10522
10522
  return !0;
10523
- }, be), r.registerCommand(ei, () => {
10523
+ }, _e), r.registerCommand(ei, () => {
10524
10524
  const e = V();
10525
10525
  return !!M(e) && (e.removeText(), !0);
10526
- }, be), r.registerCommand(Tt, (e) => {
10526
+ }, _e), r.registerCommand(Tt, (e) => {
10527
10527
  const t = V();
10528
10528
  return !!M(t) && (t.formatText(e), !0);
10529
- }, be), r.registerCommand(Zu, (e) => {
10529
+ }, _e), r.registerCommand(Zu, (e) => {
10530
10530
  const t = V();
10531
10531
  if (!M(t) && !It(t)) return !1;
10532
10532
  const n = t.getNodes();
@@ -10535,19 +10535,19 @@ function Ud(r) {
10535
10535
  i !== null && i.setFormat(e);
10536
10536
  }
10537
10537
  return !0;
10538
- }, be), r.registerCommand(Mr, (e) => {
10538
+ }, _e), r.registerCommand(Mr, (e) => {
10539
10539
  const t = V();
10540
10540
  return !!M(t) && (t.insertLineBreak(e), !0);
10541
- }, be), r.registerCommand(mn, () => {
10541
+ }, _e), r.registerCommand(mn, () => {
10542
10542
  const e = V();
10543
10543
  return !!M(e) && (e.insertParagraph(), !0);
10544
- }, be), r.registerCommand(Yu, () => (_a([Nn()]), !0), be), r.registerCommand(Xu, () => il((e) => {
10544
+ }, _e), r.registerCommand(Yu, () => (_a([Nn()]), !0), _e), r.registerCommand(Xu, () => il((e) => {
10545
10545
  const t = e.getIndent();
10546
10546
  e.setIndent(t + 1);
10547
- }), be), r.registerCommand(uo, () => il((e) => {
10547
+ }), _e), r.registerCommand(uo, () => il((e) => {
10548
10548
  const t = e.getIndent();
10549
10549
  t > 0 && e.setIndent(t - 1);
10550
- }), be), r.registerCommand(Nl, (e) => {
10550
+ }), _e), r.registerCommand(Nl, (e) => {
10551
10551
  const t = V();
10552
10552
  if (It(t) && !Wn(e.target)) {
10553
10553
  const n = t.getNodes();
@@ -10557,7 +10557,7 @@ function Ud(r) {
10557
10557
  if (!e.shiftKey && Ee(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
10558
10558
  }
10559
10559
  return !1;
10560
- }, be), r.registerCommand(Bl, (e) => {
10560
+ }, _e), r.registerCommand(Bl, (e) => {
10561
10561
  const t = V();
10562
10562
  if (It(t)) {
10563
10563
  const n = t.getNodes();
@@ -10571,7 +10571,7 @@ function Ud(r) {
10571
10571
  if (!e.shiftKey && Ee(n) && !n.isIsolated() && !n.isInline()) return n.selectNext(), e.preventDefault(), !0;
10572
10572
  }
10573
10573
  return !1;
10574
- }, be), r.registerCommand(Tl, (e) => {
10574
+ }, _e), r.registerCommand(Tl, (e) => {
10575
10575
  const t = V();
10576
10576
  if (It(t)) {
10577
10577
  const n = t.getNodes();
@@ -10583,7 +10583,7 @@ function Ud(r) {
10583
10583
  return e.preventDefault(), Qo(t, n, !0), !0;
10584
10584
  }
10585
10585
  return !1;
10586
- }, be), r.registerCommand(kl, (e) => {
10586
+ }, _e), r.registerCommand(kl, (e) => {
10587
10587
  const t = V();
10588
10588
  if (It(t) && !Wn(e.target)) {
10589
10589
  const s = t.getNodes();
@@ -10592,17 +10592,17 @@ function Ud(r) {
10592
10592
  if (!M(t)) return !1;
10593
10593
  const n = e.shiftKey;
10594
10594
  return !!Ho(t, !1) && (e.preventDefault(), Qo(t, n, !1), !0);
10595
- }, be), r.registerCommand(Fl, (e) => {
10595
+ }, _e), r.registerCommand(Fl, (e) => {
10596
10596
  if (Wn(e.target)) return !1;
10597
10597
  const t = V();
10598
10598
  if (!M(t)) return !1;
10599
10599
  const { anchor: n } = t, s = n.getNode();
10600
10600
  return t.isCollapsed() && n.offset === 0 && !it(s) && Ad(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(uo, void 0)) : (!rl || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(yr, !0));
10601
- }, be), r.registerCommand(Ll, (e) => {
10601
+ }, _e), r.registerCommand(Ll, (e) => {
10602
10602
  if (Wn(e.target)) return !1;
10603
10603
  const t = V();
10604
10604
  return !!M(t) && (e.preventDefault(), r.dispatchCommand(yr, !1));
10605
- }, be), r.registerCommand(Jn, (e) => {
10605
+ }, _e), r.registerCommand(Jn, (e) => {
10606
10606
  const t = V();
10607
10607
  if (!M(t)) return !1;
10608
10608
  if (e !== null) {
@@ -10610,10 +10610,10 @@ function Ud(r) {
10610
10610
  if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(Mr, !1);
10611
10611
  }
10612
10612
  return r.dispatchCommand(mn, void 0);
10613
- }, be), r.registerCommand(Rl, () => {
10613
+ }, _e), r.registerCommand(Rl, () => {
10614
10614
  const e = V();
10615
10615
  return !!M(e) && (r.blur(), !0);
10616
- }, be), r.registerCommand(Pl, (e) => {
10616
+ }, _e), r.registerCommand(Pl, (e) => {
10617
10617
  const [, t] = Un(e);
10618
10618
  if (t.length > 0) {
10619
10619
  const s = tl(e.clientX, e.clientY);
@@ -10635,10 +10635,10 @@ function Ud(r) {
10635
10635
  }
10636
10636
  const n = V();
10637
10637
  return !!M(n);
10638
- }, be), r.registerCommand(jl, (e) => {
10638
+ }, _e), r.registerCommand(jl, (e) => {
10639
10639
  const [t] = Un(e), n = V();
10640
10640
  return !(t && !M(n));
10641
- }, be), r.registerCommand(Ml, (e) => {
10641
+ }, _e), r.registerCommand(Ml, (e) => {
10642
10642
  const [t] = Un(e), n = V();
10643
10643
  if (t && !M(n)) return !1;
10644
10644
  const s = tl(e.clientX, e.clientY);
@@ -10647,12 +10647,12 @@ function Ud(r) {
10647
10647
  Ee(i) && e.preventDefault();
10648
10648
  }
10649
10649
  return !0;
10650
- }, be), r.registerCommand(ti, () => (Bc(), !0), be), r.registerCommand(xs, (e) => (Zo(r, ar(e, ClipboardEvent) ? e : null), !0), be), r.registerCommand(Si, (e) => (async function(t, n) {
10650
+ }, _e), r.registerCommand(ti, () => (Bc(), !0), _e), r.registerCommand(xs, (e) => (Zo(r, ar(e, ClipboardEvent) ? e : null), !0), _e), r.registerCommand(Si, (e) => (async function(t, n) {
10651
10651
  await Zo(n, ar(t, ClipboardEvent) ? t : null), n.update(() => {
10652
10652
  const s = V();
10653
10653
  M(s) ? s.removeText() : It(s) && s.getNodes().forEach((i) => i.remove());
10654
10654
  });
10655
- }(e, r), !0), be), r.registerCommand(ys, (e) => {
10655
+ }(e, r), !0), _e), r.registerCommand(ys, (e) => {
10656
10656
  const [, t, n] = Un(e);
10657
10657
  return t.length > 0 && !n ? (r.dispatchCommand(nl, t), !0) : Mi(e.target) ? !1 : V() !== null && (function(s, i) {
10658
10658
  s.preventDefault(), i.update(() => {
@@ -10660,9 +10660,9 @@ function Ud(r) {
10660
10660
  a != null && o !== null && Yo(a, o, i);
10661
10661
  }, { tag: "paste" });
10662
10662
  }(e, r), !0);
10663
- }, be));
10663
+ }, _e));
10664
10664
  }
10665
- const yi = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Te;
10665
+ const yi = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Ae;
10666
10666
  function ol(r) {
10667
10667
  return r.getEditorState().read(Na(r.isComposing()));
10668
10668
  }
@@ -10673,7 +10673,7 @@ function Wd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
10673
10673
  hu(() => {
10674
10674
  l(u);
10675
10675
  });
10676
- }), [i]), Te(() => {
10676
+ }), [i]), Ae(() => {
10677
10677
  l(i.getDecorators());
10678
10678
  }, [i]), bt(() => {
10679
10679
  const u = [], c = Object.keys(a);
@@ -10705,8 +10705,8 @@ function Gd({ content: r }) {
10705
10705
  }(e), n = ud();
10706
10706
  return t ? typeof r == "function" ? r(n) : r : null;
10707
10707
  }
10708
- const za = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Te;
10709
- function Vd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: i, ariaExpanded: o, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: p, id: m, role: y = "textbox", spellCheck: w = !0, style: x, tabIndex: D, "data-testid": C, ...A }, b) {
10708
+ const za = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Ae;
10709
+ function Vd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: i, ariaExpanded: o, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: p, id: m, role: y = "textbox", spellCheck: C = !0, style: x, tabIndex: D, "data-testid": _, ...A }, b) {
10710
10710
  const [v, E] = K(r.isEditable()), S = re((k) => {
10711
10711
  k && k.ownerDocument && k.ownerDocument.defaultView ? r.setRootElement(k) : r.setRootElement(null);
10712
10712
  }, [r]), j = bt(() => /* @__PURE__ */ function(...k) {
@@ -10718,7 +10718,7 @@ function Vd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
10718
10718
  }(b, S), [S, b]);
10719
10719
  return za(() => (E(r.isEditable()), r.registerEditableListener((k) => {
10720
10720
  E(k);
10721
- })), [r]), g.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": s, ...i != null ? { "aria-errormessage": i } : {}, "aria-expanded": v && y === "combobox" ? !!o : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": f, autoCapitalize: h, className: p, contentEditable: v, "data-testid": C, id: m, ref: j, role: v ? y : void 0, spellCheck: w, style: x, tabIndex: D, ...A });
10721
+ })), [r]), g.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": s, ...i != null ? { "aria-errormessage": i } : {}, "aria-expanded": v && y === "combobox" ? !!o : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": f, autoCapitalize: h, className: p, contentEditable: v, "data-testid": _, id: m, ref: j, role: v ? y : void 0, spellCheck: C, style: x, tabIndex: D, ...A });
10722
10722
  }
10723
10723
  const Kd = wl(Vd);
10724
10724
  function ll(r) {
@@ -10756,22 +10756,22 @@ function ef(r, e, t, n, s) {
10756
10756
  const i = e._selection, o = r._selection;
10757
10757
  if (s) return Yd;
10758
10758
  if (!(M(i) && M(o) && o.isCollapsed() && i.isCollapsed())) return kt;
10759
- const a = function(w, x, D) {
10760
- const C = w._nodeMap, A = [];
10759
+ const a = function(C, x, D) {
10760
+ const _ = C._nodeMap, A = [];
10761
10761
  for (const b of x) {
10762
- const v = C.get(b);
10762
+ const v = _.get(b);
10763
10763
  v !== void 0 && A.push(v);
10764
10764
  }
10765
10765
  for (const [b, v] of D) {
10766
10766
  if (!v) continue;
10767
- const E = C.get(b);
10767
+ const E = _.get(b);
10768
10768
  E === void 0 || it(E) || A.push(E);
10769
10769
  }
10770
10770
  return A;
10771
10771
  }(e, t, n);
10772
10772
  if (a.length === 0) return kt;
10773
10773
  if (a.length > 1) {
10774
- const w = e._nodeMap, x = w.get(i.anchor.key), D = w.get(o.anchor.key);
10774
+ const C = e._nodeMap, x = C.get(i.anchor.key), D = C.get(o.anchor.key);
10775
10775
  return x && D && !r._nodeMap.has(x.__key) && $(x) && x.__text.length === 1 && i.anchor.offset === 1 ? al : kt;
10776
10776
  }
10777
10777
  const l = a[0], u = r._nodeMap.get(l.__key);
@@ -10793,9 +10793,9 @@ function tf(r, e) {
10793
10793
  if (!p && h && u.has("history-merge")) return Gn;
10794
10794
  if (s === null) return xi;
10795
10795
  const m = i._selection;
10796
- return a.size > 0 || l.size > 0 ? p === !1 && d !== kt && d === n && c < t + e && h || a.size === 1 && function(y, w, x) {
10797
- const D = w._nodeMap.get(y), C = x._nodeMap.get(y), A = w._selection, b = x._selection;
10798
- return !(M(A) && M(b) && A.anchor.type === "element" && A.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !$(D) || !$(C) || D.__parent !== C.__parent) && JSON.stringify(w.read(() => D.exportJSON())) === JSON.stringify(x.read(() => C.exportJSON()));
10796
+ return a.size > 0 || l.size > 0 ? p === !1 && d !== kt && d === n && c < t + e && h || a.size === 1 && function(y, C, x) {
10797
+ const D = C._nodeMap.get(y), _ = x._nodeMap.get(y), A = C._selection, b = x._selection;
10798
+ return !(M(A) && M(b) && A.anchor.type === "element" && A.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !$(D) || !$(_) || D.__parent !== _.__parent) && JSON.stringify(C.read(() => D.exportJSON())) === JSON.stringify(x.read(() => _.exportJSON()));
10799
10799
  }(Array.from(a)[0], s, i) ? Gn : xi : m !== null ? Gn : bi;
10800
10800
  })();
10801
10801
  return t = c, n = d, f;
@@ -10812,7 +10812,7 @@ function rf(r, e, t) {
10812
10812
  const u = o.current, c = l.pop();
10813
10813
  u !== null && (a.push(u), i.dispatchCommand(On, !0)), l.length === 0 && i.dispatchCommand(In, !1), o.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
10814
10814
  }
10815
- }(r, e), !0), be), r.registerCommand(Ai, () => (function(i, o) {
10815
+ }(r, e), !0), _e), r.registerCommand(Ai, () => (function(i, o) {
10816
10816
  const a = o.redoStack, l = o.undoStack;
10817
10817
  if (a.length !== 0) {
10818
10818
  const u = o.current;
@@ -10820,7 +10820,7 @@ function rf(r, e, t) {
10820
10820
  const c = a.pop();
10821
10821
  a.length === 0 && i.dispatchCommand(On, !1), o.current = c || null, c && c.editor.setEditorState(c.editorState, { tag: "historic" });
10822
10822
  }
10823
- }(r, e), !0), be), r.registerCommand(tc, () => (ul(e), !1), be), r.registerCommand(rc, () => (ul(e), r.dispatchCommand(On, !1), r.dispatchCommand(In, !1), !0), be), r.registerUpdateListener(({ editorState: i, prevEditorState: o, dirtyLeaves: a, dirtyElements: l, tags: u }) => {
10823
+ }(r, e), !0), _e), r.registerCommand(tc, () => (ul(e), !1), _e), r.registerCommand(rc, () => (ul(e), r.dispatchCommand(On, !1), r.dispatchCommand(In, !1), !0), _e), r.registerUpdateListener(({ editorState: i, prevEditorState: o, dirtyLeaves: a, dirtyElements: l, tags: u }) => {
10824
10824
  const c = e.current, d = e.redoStack, f = e.undoStack, h = c === null ? null : c.editorState;
10825
10825
  if (c !== null && i === h) return;
10826
10826
  const p = n(o, i, c, a, l, u);
@@ -10836,10 +10836,10 @@ function sf({ delay: r, externalHistoryState: e }) {
10836
10836
  const [t] = Bt();
10837
10837
  return function(n, s, i = 1e3) {
10838
10838
  const o = bt(() => s || nf(), [s]);
10839
- Te(() => rf(n, o, i), [i, n, o]);
10839
+ Ae(() => rf(n, o, i), [i, n, o]);
10840
10840
  }(t, e, r), null;
10841
10841
  }
10842
- const of = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Te;
10842
+ const of = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Wr : Ae;
10843
10843
  function lf({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
10844
10844
  const [n] = Bt();
10845
10845
  return of(() => {
@@ -11447,10 +11447,10 @@ function _f(r) {
11447
11447
  }
11448
11448
  function vf() {
11449
11449
  const [r] = Bt();
11450
- return Te(() => {
11450
+ return Ae(() => {
11451
11451
  if (!r.hasNodes([Hr, Sr])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
11452
11452
  }, [r]), function(e) {
11453
- Te(() => _f(e), [e]);
11453
+ Ae(() => _f(e), [e]);
11454
11454
  }(r), null;
11455
11455
  }
11456
11456
  const wf = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
@@ -11651,7 +11651,7 @@ function Ys(r, e = {}) {
11651
11651
  }
11652
11652
  function Ef({ validateUrl: r, attributes: e }) {
11653
11653
  const [t] = Bt();
11654
- return Te(() => {
11654
+ return Ae(() => {
11655
11655
  if (!t.hasNodes([kr])) throw new Error("LinkPlugin: LinkNode not registered on editor");
11656
11656
  return Ar(t.registerCommand(_l, (n) => {
11657
11657
  if (n === null) return Ys(n), !0;
@@ -11860,9 +11860,9 @@ var Er;
11860
11860
  throw new RangeError("Invalid value");
11861
11861
  let p, m;
11862
11862
  for (p = c; ; p++) {
11863
- const D = oe.getNumDataCodewords(p, u) * 8, C = o.getTotalBits(l, p);
11864
- if (C <= D) {
11865
- m = C;
11863
+ const D = oe.getNumDataCodewords(p, u) * 8, _ = o.getTotalBits(l, p);
11864
+ if (_ <= D) {
11865
+ m = _;
11866
11866
  break;
11867
11867
  }
11868
11868
  if (p >= d)
@@ -11873,18 +11873,18 @@ var Er;
11873
11873
  let y = [];
11874
11874
  for (const D of l) {
11875
11875
  t(D.mode.modeBits, 4, y), t(D.numChars, D.mode.numCharCountBits(p), y);
11876
- for (const C of D.getData())
11877
- y.push(C);
11876
+ for (const _ of D.getData())
11877
+ y.push(_);
11878
11878
  }
11879
11879
  s(y.length == m);
11880
- const w = oe.getNumDataCodewords(p, u) * 8;
11881
- s(y.length <= w), t(0, Math.min(4, w - y.length), y), t(0, (8 - y.length % 8) % 8, y), s(y.length % 8 == 0);
11882
- for (let D = 236; y.length < w; D ^= 253)
11880
+ const C = oe.getNumDataCodewords(p, u) * 8;
11881
+ s(y.length <= C), t(0, Math.min(4, C - y.length), y), t(0, (8 - y.length % 8) % 8, y), s(y.length % 8 == 0);
11882
+ for (let D = 236; y.length < C; D ^= 253)
11883
11883
  t(D, 8, y);
11884
11884
  let x = [];
11885
11885
  for (; x.length * 8 < y.length; )
11886
11886
  x.push(0);
11887
- return y.forEach((D, C) => x[C >>> 3] |= D << 7 - (C & 7)), new oe(p, u, x, f);
11887
+ return y.forEach((D, _) => x[_ >>> 3] |= D << 7 - (_ & 7)), new oe(p, u, x, f);
11888
11888
  }
11889
11889
  /*-- Accessor methods --*/
11890
11890
  // Returns the color of the module (pixel) at the given coordinates, which is false
@@ -11974,17 +11974,17 @@ var Er;
11974
11974
  throw new RangeError("Invalid argument");
11975
11975
  const d = oe.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][u], f = oe.ECC_CODEWORDS_PER_BLOCK[c.ordinal][u], h = Math.floor(oe.getNumRawDataModules(u) / 8), p = d - h % d, m = Math.floor(h / d);
11976
11976
  let y = [];
11977
- const w = oe.reedSolomonComputeDivisor(f);
11978
- for (let D = 0, C = 0; D < d; D++) {
11979
- let A = l.slice(C, C + m - f + (D < p ? 0 : 1));
11980
- C += A.length;
11981
- const b = oe.reedSolomonComputeRemainder(A, w);
11977
+ const C = oe.reedSolomonComputeDivisor(f);
11978
+ for (let D = 0, _ = 0; D < d; D++) {
11979
+ let A = l.slice(_, _ + m - f + (D < p ? 0 : 1));
11980
+ _ += A.length;
11981
+ const b = oe.reedSolomonComputeRemainder(A, C);
11982
11982
  D < p && A.push(0), y.push(A.concat(b));
11983
11983
  }
11984
11984
  let x = [];
11985
11985
  for (let D = 0; D < y[0].length; D++)
11986
- y.forEach((C, A) => {
11987
- (D != m - f || A >= p) && x.push(C[D]);
11986
+ y.forEach((_, A) => {
11987
+ (D != m - f || A >= p) && x.push(_[D]);
11988
11988
  });
11989
11989
  return s(x.length == h), x;
11990
11990
  }
@@ -12375,8 +12375,8 @@ function Rf(r, e, t, n) {
12375
12375
  const s = r.length + t * 2, i = Math.floor(e * Ff), o = s / e, a = (n.width || i) * o, l = (n.height || i) * o, u = n.x == null ? r.length / 2 - a / 2 : n.x * o, c = n.y == null ? r.length / 2 - l / 2 : n.y * o, d = n.opacity == null ? 1 : n.opacity;
12376
12376
  let f = null;
12377
12377
  if (n.excavate) {
12378
- let p = Math.floor(u), m = Math.floor(c), y = Math.ceil(a + u - p), w = Math.ceil(l + c - m);
12379
- f = { x: p, y: m, w: y, h: w };
12378
+ let p = Math.floor(u), m = Math.floor(c), y = Math.ceil(a + u - p), C = Math.ceil(l + c - m);
12379
+ f = { x: p, y: m, w: y, h: C };
12380
12380
  }
12381
12381
  const h = n.crossOrigin;
12382
12382
  return { x: u, y: c, h: l, w: a, excavation: f, opacity: d, crossOrigin: h };
@@ -12459,7 +12459,7 @@ var Pf = function() {
12459
12459
  "boostLevel",
12460
12460
  "marginSize",
12461
12461
  "imageSettings"
12462
- ]), { style: y } = m, w = Ci(m, ["style"]), x = h == null ? void 0 : h.src, D = de.useRef(null), C = de.useRef(null), A = de.useCallback(
12462
+ ]), { style: y } = m, C = Ci(m, ["style"]), x = h == null ? void 0 : h.src, D = de.useRef(null), _ = de.useRef(null), A = de.useCallback(
12463
12463
  (F) => {
12464
12464
  D.current = F, typeof t == "function" ? t(F) : t && (t.current = F);
12465
12465
  },
@@ -12480,7 +12480,7 @@ var Pf = function() {
12480
12480
  if (!P)
12481
12481
  return;
12482
12482
  let Q = S;
12483
- const ie = C.current, ve = k != null && ie !== null && ie.complete && ie.naturalHeight !== 0 && ie.naturalWidth !== 0;
12483
+ const ie = _.current, ve = k != null && ie !== null && ie.complete && ie.naturalHeight !== 0 && ie.naturalWidth !== 0;
12484
12484
  ve && k.excavation != null && (Q = ru(
12485
12485
  S,
12486
12486
  k.excavation
@@ -12488,9 +12488,9 @@ var Pf = function() {
12488
12488
  const le = window.devicePixelRatio || 1;
12489
12489
  F.height = F.width = i * le;
12490
12490
  const Ne = i / j * le;
12491
- P.scale(Ne, Ne), P.fillStyle = a, P.fillRect(0, 0, j, j), P.fillStyle = l, Pf ? P.fill(new Path2D(tu(Q, E))) : S.forEach(function(ge, pe) {
12492
- ge.forEach(function(me, ye) {
12493
- me && P.fillRect(ye + E, pe + E, 1, 1);
12491
+ P.scale(Ne, Ne), P.fillStyle = a, P.fillRect(0, 0, j, j), P.fillStyle = l, Pf ? P.fill(new Path2D(tu(Q, E))) : S.forEach(function(me, pe) {
12492
+ me.forEach(function(ye, xe) {
12493
+ ye && P.fillRect(xe + E, pe + E, 1, 1);
12494
12494
  });
12495
12495
  }), k && (P.globalAlpha = k.opacity), ve && P.drawImage(
12496
12496
  ie,
@@ -12514,7 +12514,7 @@ var Pf = function() {
12514
12514
  onLoad: () => {
12515
12515
  v(!0);
12516
12516
  },
12517
- ref: C,
12517
+ ref: _,
12518
12518
  crossOrigin: k == null ? void 0 : k.crossOrigin
12519
12519
  }
12520
12520
  )), /* @__PURE__ */ de.createElement(de.Fragment, null, /* @__PURE__ */ de.createElement(
@@ -12525,7 +12525,7 @@ var Pf = function() {
12525
12525
  width: i,
12526
12526
  ref: A,
12527
12527
  role: "img"
12528
- }, w)
12528
+ }, C)
12529
12529
  ), R);
12530
12530
  }
12531
12531
  );
@@ -12556,7 +12556,7 @@ var su = de.forwardRef(
12556
12556
  "title",
12557
12557
  "marginSize",
12558
12558
  "imageSettings"
12559
- ]), { margin: y, cells: w, numCells: x, calculatedImageSettings: D } = nu({
12559
+ ]), { margin: y, cells: C, numCells: x, calculatedImageSettings: D } = nu({
12560
12560
  value: s,
12561
12561
  level: o,
12562
12562
  minVersion: c,
@@ -12566,9 +12566,9 @@ var su = de.forwardRef(
12566
12566
  imageSettings: p,
12567
12567
  size: i
12568
12568
  });
12569
- let C = w, A = null;
12570
- p != null && D != null && (D.excavation != null && (C = ru(
12571
- w,
12569
+ let _ = C, A = null;
12570
+ p != null && D != null && (D.excavation != null && (_ = ru(
12571
+ C,
12572
12572
  D.excavation
12573
12573
  )), A = /* @__PURE__ */ de.createElement(
12574
12574
  "image",
@@ -12583,7 +12583,7 @@ var su = de.forwardRef(
12583
12583
  crossOrigin: D.crossOrigin
12584
12584
  }
12585
12585
  ));
12586
- const b = tu(C, y);
12586
+ const b = tu(_, y);
12587
12587
  return /* @__PURE__ */ de.createElement(
12588
12588
  "svg",
12589
12589
  wi({
@@ -12720,7 +12720,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12720
12720
  u.dispatchCommand(Tt, "italic");
12721
12721
  }, [u]), y = re(() => {
12722
12722
  u.dispatchCommand(Tt, "underline");
12723
- }, [u]), w = re(() => {
12723
+ }, [u]), C = re(() => {
12724
12724
  u.dispatchCommand(Wa, void 0);
12725
12725
  }, [u]), x = re(() => {
12726
12726
  u.dispatchCommand(Ga, void 0);
@@ -12729,7 +12729,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12729
12729
  const v = V();
12730
12730
  M(v) && bd(v, () => Xi());
12731
12731
  });
12732
- }, [u]), C = {
12732
+ }, [u]), _ = {
12733
12733
  display: "flex",
12734
12734
  alignItems: "center",
12735
12735
  justifyContent: "center",
@@ -12774,7 +12774,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12774
12774
  className: "mail-editor-toolbar-btn",
12775
12775
  onClick: p,
12776
12776
  disabled: e,
12777
- style: C,
12777
+ style: _,
12778
12778
  title: "Bold (Ctrl+B)",
12779
12779
  children: "B"
12780
12780
  }
@@ -12786,7 +12786,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12786
12786
  className: "mail-editor-toolbar-btn",
12787
12787
  onClick: m,
12788
12788
  disabled: e,
12789
- style: { ...C, fontStyle: "italic" },
12789
+ style: { ..._, fontStyle: "italic" },
12790
12790
  title: "Italic (Ctrl+I)",
12791
12791
  children: "I"
12792
12792
  }
@@ -12798,7 +12798,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12798
12798
  className: "mail-editor-toolbar-btn",
12799
12799
  onClick: y,
12800
12800
  disabled: e,
12801
- style: { ...C, textDecoration: "underline" },
12801
+ style: { ..._, textDecoration: "underline" },
12802
12802
  title: "Underline (Ctrl+U)",
12803
12803
  children: "U"
12804
12804
  }
@@ -12819,9 +12819,9 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12819
12819
  {
12820
12820
  type: "button",
12821
12821
  className: "mail-editor-toolbar-btn",
12822
- onClick: w,
12822
+ onClick: C,
12823
12823
  disabled: e,
12824
- style: C,
12824
+ style: _,
12825
12825
  title: "Bullet List",
12826
12826
  children: /* @__PURE__ */ g.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
12827
12827
  /* @__PURE__ */ g.jsx("circle", { cx: "4", cy: "6", r: "2" }),
@@ -12840,7 +12840,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12840
12840
  className: "mail-editor-toolbar-btn",
12841
12841
  onClick: x,
12842
12842
  disabled: e,
12843
- style: C,
12843
+ style: _,
12844
12844
  title: "Numbered List",
12845
12845
  children: /* @__PURE__ */ g.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
12846
12846
  /* @__PURE__ */ g.jsx("text", { x: "2", y: "8", fontSize: "8", fontFamily: "sans-serif", children: "1" }),
@@ -12870,7 +12870,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
12870
12870
  className: "mail-editor-toolbar-btn",
12871
12871
  onClick: D,
12872
12872
  disabled: e,
12873
- style: C,
12873
+ style: _,
12874
12874
  title: "Quote",
12875
12875
  children: /* @__PURE__ */ g.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ g.jsx("path", { d: "M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z" }) })
12876
12876
  }
@@ -13026,7 +13026,7 @@ function zf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
13026
13026
  }
13027
13027
  function qf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
13028
13028
  const [n] = Bt(), s = de.useRef(!1);
13029
- return Te(() => {
13029
+ return Ae(() => {
13030
13030
  r && (s.current && !e || (s.current = !0, n.update(
13031
13031
  () => {
13032
13032
  const i = je();
@@ -13044,7 +13044,7 @@ function qf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
13044
13044
  }
13045
13045
  function Uf({ text: r, trigger: e }) {
13046
13046
  const [t] = Bt(), n = de.useRef(void 0);
13047
- return Te(() => {
13047
+ return Ae(() => {
13048
13048
  if (e === void 0 || e === n.current || !r) return;
13049
13049
  n.current = e;
13050
13050
  const s = r.trim();
@@ -13141,24 +13141,24 @@ function Gf({
13141
13141
  aiProcessingAction: m,
13142
13142
  renderAboveToolbar: y
13143
13143
  }) {
13144
- const w = { ...If, ...s }, [x, D] = de.useState(!1), C = de.useRef(void 0), [A, b] = de.useState(r), [v, E] = de.useState(!1), [S, j] = de.useState(null), k = p ?? v, N = m ?? S;
13144
+ const C = { ...If, ...s }, [x, D] = de.useState(!1), _ = de.useRef(void 0), [A, b] = de.useState(r), [v, E] = de.useState(!1), [S, j] = de.useState(null), k = p ?? v, N = m ?? S;
13145
13145
  de.useEffect(() => {
13146
- l !== void 0 && l !== C.current && (C.current = l, D(!0));
13146
+ l !== void 0 && l !== _.current && (_.current = l, D(!0));
13147
13147
  }, [l]);
13148
13148
  const R = re(() => {
13149
13149
  D(!1);
13150
- }, []), F = (ge) => ge.replace(/<[^>]*>/g, "").trim(), P = (ge) => ge.split(`
13151
- `).map((pe) => `<p>${pe || "<br>"}</p>`).join(""), Q = async (ge) => {
13150
+ }, []), F = (me) => me.replace(/<[^>]*>/g, "").trim(), P = (me) => me.split(`
13151
+ `).map((pe) => `<p>${pe || "<br>"}</p>`).join(""), Q = async (me) => {
13152
13152
  const pe = F(A);
13153
13153
  if (!pe) return;
13154
- const me = ge === "restructure" ? d : ge === "proofread" ? f : h;
13155
- if (me) {
13156
- E(!0), j(ge);
13154
+ const ye = me === "restructure" ? d : me === "proofread" ? f : h;
13155
+ if (ye) {
13156
+ E(!0), j(me);
13157
13157
  try {
13158
- const ye = await me(pe), Be = P(ye);
13159
- b(Be), e == null || e(Be), C.current = Date.now(), D(!0);
13160
- } catch (ye) {
13161
- console.error(`AI ${ge} failed:`, ye);
13158
+ const xe = await ye(pe), Be = P(xe);
13159
+ b(Be), e == null || e(Be), _.current = Date.now(), D(!0);
13160
+ } catch (xe) {
13161
+ console.error(`AI ${me} failed:`, xe);
13162
13162
  } finally {
13163
13163
  E(!1), j(null);
13164
13164
  }
@@ -13166,16 +13166,16 @@ function Gf({
13166
13166
  }, ie = F(A).length > 0, ve = {
13167
13167
  namespace: "MailEditor",
13168
13168
  theme: $f,
13169
- onError: (ge) => {
13170
- console.error("Lexical error:", ge);
13169
+ onError: (me) => {
13170
+ console.error("Lexical error:", me);
13171
13171
  },
13172
13172
  nodes: [Hr, Sr, kr, Pn, Fs, Bs, Rs, jn],
13173
13173
  editable: !i
13174
13174
  }, le = re(
13175
- (ge, pe) => {
13176
- ge.read(() => {
13177
- const me = ja(pe, null);
13178
- b(me), e == null || e(me);
13175
+ (me, pe) => {
13176
+ me.read(() => {
13177
+ const ye = ja(pe, null);
13178
+ b(ye), e == null || e(ye);
13179
13179
  });
13180
13180
  },
13181
13181
  [e]
@@ -13201,15 +13201,15 @@ function Gf({
13201
13201
  margin: 4px 0;
13202
13202
  }
13203
13203
  .mail-editor-link {
13204
- color: ${w.primary};
13204
+ color: ${C.primary};
13205
13205
  text-decoration: underline;
13206
13206
  }
13207
13207
  .mail-editor-quote {
13208
13208
  margin: 8px 0;
13209
13209
  padding: 8px 16px;
13210
- border-left: 3px solid ${w.quoteBorder};
13211
- background: ${w.quoteBackground};
13212
- color: ${w.textSecondary};
13210
+ border-left: 3px solid ${C.quoteBorder};
13211
+ background: ${C.quoteBackground};
13212
+ color: ${C.textSecondary};
13213
13213
  }
13214
13214
  .mail-editor-h1 {
13215
13215
  font-size: 24px;
@@ -13232,7 +13232,7 @@ function Gf({
13232
13232
  padding: 16px;
13233
13233
  font-size: 14px;
13234
13234
  line-height: 1.6;
13235
- color: ${w.text};
13235
+ color: ${C.text};
13236
13236
  }
13237
13237
  .mail-editor-content:focus {
13238
13238
  outline: none;
@@ -13241,7 +13241,7 @@ function Gf({
13241
13241
  position: absolute;
13242
13242
  top: 16px;
13243
13243
  left: 16px;
13244
- color: ${w.textSecondary};
13244
+ color: ${C.textSecondary};
13245
13245
  pointer-events: none;
13246
13246
  font-size: 14px;
13247
13247
  }
@@ -13255,9 +13255,9 @@ function Gf({
13255
13255
  {
13256
13256
  className: o,
13257
13257
  style: {
13258
- border: `1px solid ${w.border}`,
13258
+ border: `1px solid ${C.border}`,
13259
13259
  borderRadius: "8px",
13260
- background: w.background,
13260
+ background: C.background,
13261
13261
  overflow: "hidden",
13262
13262
  display: "flex",
13263
13263
  flexDirection: "column",
@@ -13271,7 +13271,7 @@ function Gf({
13271
13271
  /* @__PURE__ */ g.jsx(
13272
13272
  zf,
13273
13273
  {
13274
- theme: w,
13274
+ theme: C,
13275
13275
  disabled: i,
13276
13276
  onAiRestructure: d,
13277
13277
  onAiProofread: f,
@@ -13296,7 +13296,7 @@ function Gf({
13296
13296
  padding: "16px",
13297
13297
  fontSize: "14px",
13298
13298
  lineHeight: 1.6,
13299
- color: w.text
13299
+ color: C.text
13300
13300
  }
13301
13301
  }
13302
13302
  ),
@@ -13324,7 +13324,7 @@ function Gf({
13324
13324
  }
13325
13325
  )
13326
13326
  ] }),
13327
- n && /* @__PURE__ */ g.jsx(Wf, { replyTo: n, theme: w })
13327
+ n && /* @__PURE__ */ g.jsx(Wf, { replyTo: n, theme: C })
13328
13328
  ]
13329
13329
  }
13330
13330
  );
@@ -13366,22 +13366,22 @@ function ph({
13366
13366
  className: p = "",
13367
13367
  minHeight: m = "200px",
13368
13368
  sendButtonText: y = "Send",
13369
- hideCancelButton: w = !1,
13369
+ hideCancelButton: C = !1,
13370
13370
  onAiRestructure: x,
13371
13371
  onAiProofread: D,
13372
- onAiRewrite: C,
13372
+ onAiRewrite: _,
13373
13373
  renderAboveToolbar: A
13374
13374
  }) {
13375
- const b = { ...Vf, ...c }, [v, E] = K(r), [S, j] = K(""), [k, N] = K(""), [R, F] = K(e), [P, Q] = K(t), [ie, ve] = K([]), [le, Ne] = K(!1), [ge, pe] = K(""), [me, ye] = K(f), [Be, we] = K(!1), Ae = de.useRef(void 0);
13375
+ const b = { ...Vf, ...c }, [v, E] = K(r), [S, j] = K(""), [k, N] = K(""), [R, F] = K(e), [P, Q] = K(t), [ie, ve] = K([]), [le, Ne] = K(!1), [me, pe] = K(""), [ye, xe] = K(f), [Be, we] = K(!1), Se = de.useRef(void 0);
13376
13376
  de.useEffect(() => {
13377
- a !== void 0 && a !== Ae.current && (Ae.current = a, Q(t), we(!0));
13377
+ a !== void 0 && a !== Se.current && (Se.current = a, Q(t), we(!0));
13378
13378
  }, [a, t]);
13379
13379
  const Me = (U) => {
13380
13380
  Q(U), we(!1), o == null || o(U);
13381
- }, fe = _e(null), [ze, ft] = K(!1), Rt = (U) => {
13382
- const Se = U.target.files;
13383
- if (Se) {
13384
- const Re = Array.from(Se);
13381
+ }, fe = ge(null), [ze, ft] = K(!1), Rt = (U) => {
13382
+ const ke = U.target.files;
13383
+ if (ke) {
13384
+ const Re = Array.from(ke);
13385
13385
  console.log("[MailComposer] Files selected:", Re.map((Fe) => ({ name: Fe.name, size: Fe.size, type: Fe.type }))), ve((Fe) => [...Fe, ...Re]);
13386
13386
  }
13387
13387
  fe.current && (fe.current.value = "");
@@ -13391,12 +13391,12 @@ function ph({
13391
13391
  U.preventDefault(), U.stopPropagation(), ft(!1);
13392
13392
  }, vt = (U) => {
13393
13393
  if (U.preventDefault(), U.stopPropagation(), ft(!1), U.dataTransfer.files && U.dataTransfer.files.length > 0) {
13394
- const Se = Array.from(U.dataTransfer.files);
13395
- console.log("[MailComposer] Files dropped:", Se.map((Re) => ({ name: Re.name, size: Re.size, type: Re.type }))), ve((Re) => [...Re, ...Se]);
13394
+ const ke = Array.from(U.dataTransfer.files);
13395
+ console.log("[MailComposer] Files dropped:", ke.map((Re) => ({ name: Re.name, size: Re.size, type: Re.type }))), ve((Re) => [...Re, ...ke]);
13396
13396
  } else
13397
13397
  console.log("[MailComposer] Drop event but no files:", U.dataTransfer.types);
13398
13398
  }, mt = (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", rr = (U) => {
13399
- ve((Se) => Se.filter((Re, Fe) => Fe !== U));
13399
+ ve((ke) => ke.filter((Re, Fe) => Fe !== U));
13400
13400
  }, Kt = (U) => U < 1024 ? `${U} B` : U < 1024 * 1024 ? `${(U / 1024).toFixed(1)} KB` : `${(U / (1024 * 1024)).toFixed(1)} MB`, Lt = async () => {
13401
13401
  if (!v.trim()) {
13402
13402
  pe("Recipient email is required");
@@ -13420,12 +13420,12 @@ function ph({
13420
13420
  size: Fe.size
13421
13421
  };
13422
13422
  })
13423
- ), Se = P.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Re = {
13423
+ ), ke = P.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), Re = {
13424
13424
  to: v.trim(),
13425
13425
  cc: S.trim() || void 0,
13426
13426
  bcc: k.trim() || void 0,
13427
13427
  subject: R.trim(),
13428
- html: Se,
13428
+ html: ke,
13429
13429
  attachments: U,
13430
13430
  inReplyTo: n == null ? void 0 : n.messageId
13431
13431
  };
@@ -13454,14 +13454,14 @@ function ph({
13454
13454
  color: b.textSecondary,
13455
13455
  marginBottom: "4px",
13456
13456
  textTransform: "uppercase"
13457
- }, wt = (U, Se = !1) => ({
13457
+ }, wt = (U, ke = !1) => ({
13458
13458
  padding: "10px 20px",
13459
13459
  fontSize: "14px",
13460
13460
  fontWeight: 500,
13461
13461
  border: "none",
13462
13462
  borderRadius: "6px",
13463
- cursor: Se ? "not-allowed" : "pointer",
13464
- opacity: Se ? 0.6 : 1,
13463
+ cursor: ke ? "not-allowed" : "pointer",
13464
+ opacity: ke ? 0.6 : 1,
13465
13465
  background: U ? b.buttonPrimary : b.buttonSecondary,
13466
13466
  color: U ? "#ffffff" : b.text,
13467
13467
  display: "flex",
@@ -13480,7 +13480,7 @@ function ph({
13480
13480
  background: b.background
13481
13481
  },
13482
13482
  children: [
13483
- ge && /* @__PURE__ */ g.jsx(
13483
+ me && /* @__PURE__ */ g.jsx(
13484
13484
  "div",
13485
13485
  {
13486
13486
  style: {
@@ -13491,7 +13491,7 @@ function ph({
13491
13491
  color: "#dc2626",
13492
13492
  fontSize: "14px"
13493
13493
  },
13494
- children: ge
13494
+ children: me
13495
13495
  }
13496
13496
  ),
13497
13497
  /* @__PURE__ */ g.jsxs("div", { children: [
@@ -13508,11 +13508,11 @@ function ph({
13508
13508
  }
13509
13509
  )
13510
13510
  ] }),
13511
- !me && /* @__PURE__ */ g.jsx(
13511
+ !ye && /* @__PURE__ */ g.jsx(
13512
13512
  "button",
13513
13513
  {
13514
13514
  type: "button",
13515
- onClick: () => ye(!0),
13515
+ onClick: () => xe(!0),
13516
13516
  disabled: d || le,
13517
13517
  style: {
13518
13518
  background: "none",
@@ -13526,7 +13526,7 @@ function ph({
13526
13526
  children: "+ Add CC/BCC"
13527
13527
  }
13528
13528
  ),
13529
- me && /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
13529
+ ye && /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
13530
13530
  /* @__PURE__ */ g.jsxs("div", { children: [
13531
13531
  /* @__PURE__ */ g.jsx("label", { style: ht, children: "CC" }),
13532
13532
  /* @__PURE__ */ g.jsx(
@@ -13585,7 +13585,7 @@ function ph({
13585
13585
  insertTextTrigger: u,
13586
13586
  onAiRestructure: x,
13587
13587
  onAiProofread: D,
13588
- onAiRewrite: C,
13588
+ onAiRewrite: _,
13589
13589
  renderAboveToolbar: A
13590
13590
  }
13591
13591
  ) }) }),
@@ -13633,7 +13633,7 @@ function ph({
13633
13633
  ]
13634
13634
  }
13635
13635
  ),
13636
- ie.length > 0 && /* @__PURE__ */ g.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: ie.map((U, Se) => /* @__PURE__ */ g.jsxs(
13636
+ ie.length > 0 && /* @__PURE__ */ g.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: ie.map((U, ke) => /* @__PURE__ */ g.jsxs(
13637
13637
  "div",
13638
13638
  {
13639
13639
  style: {
@@ -13654,7 +13654,7 @@ function ph({
13654
13654
  "button",
13655
13655
  {
13656
13656
  type: "button",
13657
- onClick: () => rr(Se),
13657
+ onClick: () => rr(ke),
13658
13658
  disabled: d || le,
13659
13659
  style: {
13660
13660
  background: "none",
@@ -13670,11 +13670,11 @@ function ph({
13670
13670
  )
13671
13671
  ]
13672
13672
  },
13673
- `${U.name}-${Se}`
13673
+ `${U.name}-${ke}`
13674
13674
  )) })
13675
13675
  ] }),
13676
13676
  /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
13677
- !w && i && /* @__PURE__ */ g.jsx(
13677
+ !C && i && /* @__PURE__ */ g.jsx(
13678
13678
  "button",
13679
13679
  {
13680
13680
  type: "button",
@@ -13743,14 +13743,14 @@ function gh({
13743
13743
  theme: d = {},
13744
13744
  className: f = ""
13745
13745
  }) {
13746
- const h = { ...Kf, ...d }, [p, m] = K(!1), [y, w] = K(""), x = _e(null), D = _e(null);
13747
- Te(() => {
13746
+ const h = { ...Kf, ...d }, [p, m] = K(!1), [y, C] = K(""), x = ge(null), D = ge(null);
13747
+ Ae(() => {
13748
13748
  function k(N) {
13749
- x.current && !x.current.contains(N.target) && (m(!1), w(""));
13749
+ x.current && !x.current.contains(N.target) && (m(!1), C(""));
13750
13750
  }
13751
13751
  return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
13752
13752
  }, []);
13753
- const C = r.filter(
13753
+ const _ = r.filter(
13754
13754
  (k) => {
13755
13755
  var N;
13756
13756
  return ((N = k.label) == null ? void 0 : N.toLowerCase().includes(y.toLowerCase())) && !e.includes(k.id);
@@ -13760,16 +13760,16 @@ function gh({
13760
13760
  return ((N = k.label) == null ? void 0 : N.toLowerCase()) === y.toLowerCase();
13761
13761
  }), b = e.map((k) => r.find((N) => N.id === k)).filter(Boolean), v = re((k) => {
13762
13762
  var N;
13763
- c > 0 && e.length >= c || (t([...e, k]), w(""), c === 1 ? m(!1) : (N = D.current) == null || N.focus());
13763
+ c > 0 && e.length >= c || (t([...e, k]), C(""), c === 1 ? m(!1) : (N = D.current) == null || N.focus());
13764
13764
  }, [e, t, c]), E = re((k) => {
13765
13765
  t(e.filter((N) => N !== k));
13766
13766
  }, [e, t]), S = re(async () => {
13767
13767
  if (!A) return;
13768
13768
  const k = await (i == null ? void 0 : i(y.trim()));
13769
- k && v(k.id), w("");
13769
+ k && v(k.id), C("");
13770
13770
  }, [A, y, i, v]), j = re((k) => {
13771
- k.key === "Enter" ? (k.preventDefault(), A ? S() : C.length > 0 && v(C[0].id)) : k.key === "Backspace" && !y && e.length > 0 ? E(e[e.length - 1]) : k.key === "Escape" && (m(!1), w(""));
13772
- }, [A, C, y, e, S, v, E]);
13771
+ k.key === "Enter" ? (k.preventDefault(), A ? S() : _.length > 0 && v(_[0].id)) : k.key === "Backspace" && !y && e.length > 0 ? E(e[e.length - 1]) : k.key === "Escape" && (m(!1), C(""));
13772
+ }, [A, _, y, e, S, v, E]);
13773
13773
  return /* @__PURE__ */ g.jsxs("div", { ref: x, className: f, style: { position: "relative" }, children: [
13774
13774
  l && /* @__PURE__ */ g.jsx(
13775
13775
  "label",
@@ -13846,7 +13846,7 @@ function gh({
13846
13846
  type: "text",
13847
13847
  value: y,
13848
13848
  onChange: (k) => {
13849
- w(k.target.value), p || m(!0);
13849
+ C(k.target.value), p || m(!0);
13850
13850
  },
13851
13851
  onFocus: () => m(!0),
13852
13852
  onKeyDown: j,
@@ -13883,7 +13883,7 @@ function gh({
13883
13883
  overflowY: "auto",
13884
13884
  zIndex: 50
13885
13885
  },
13886
- children: C.length === 0 && !A ? /* @__PURE__ */ g.jsx(
13886
+ children: _.length === 0 && !A ? /* @__PURE__ */ g.jsx(
13887
13887
  "div",
13888
13888
  {
13889
13889
  style: {
@@ -13895,7 +13895,7 @@ function gh({
13895
13895
  children: y ? "No matches" : "No options available"
13896
13896
  }
13897
13897
  ) : /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
13898
- C.map((k) => /* @__PURE__ */ g.jsxs(
13898
+ _.map((k) => /* @__PURE__ */ g.jsxs(
13899
13899
  "div",
13900
13900
  {
13901
13901
  onClick: () => v(k.id),
@@ -13954,7 +13954,7 @@ function gh({
13954
13954
  fontSize: "14px",
13955
13955
  cursor: "pointer",
13956
13956
  color: h.primary,
13957
- borderTop: C.length > 0 ? `1px solid ${h.border}` : "none"
13957
+ borderTop: _.length > 0 ? `1px solid ${h.border}` : "none"
13958
13958
  },
13959
13959
  onMouseEnter: (k) => {
13960
13960
  k.currentTarget.style.background = h.hoverBackground || "";
@@ -13986,140 +13986,166 @@ const Hf = {
13986
13986
  function mh({
13987
13987
  options: r,
13988
13988
  type: e,
13989
- placeholder: t = "Rechercher...",
13989
+ placeholder: t = "Search...",
13990
13990
  onItemClick: n,
13991
13991
  onCreate: s,
13992
- maxHeight: i = 400,
13992
+ maxHeight: i = 300,
13993
13993
  className: o = "",
13994
13994
  theme: a = {}
13995
13995
  }) {
13996
- const l = { ...Hf, ...a }, [u, c] = K(""), d = _e(null), f = bt(() => {
13996
+ const l = { ...Hf, ...a }, [u, c] = K(""), [d, f] = K(!1), h = ge(null), p = ge(null), m = bt(() => {
13997
13997
  if (!u.trim()) return r;
13998
- const m = u.toLowerCase();
13998
+ const _ = u.toLowerCase();
13999
13999
  return r.filter(
14000
- (y) => {
14001
- var w, x;
14002
- return ((w = y.label) == null ? void 0 : w.toLowerCase().includes(m)) || ((x = y.notes) == null ? void 0 : x.toLowerCase().includes(m));
14000
+ (A) => {
14001
+ var b, v;
14002
+ return ((b = A.label) == null ? void 0 : b.toLowerCase().includes(_)) || ((v = A.notes) == null ? void 0 : v.toLowerCase().includes(_));
14003
14003
  }
14004
14004
  );
14005
- }, [r, u]), h = (m) => {
14006
- n && n(m);
14007
- }, p = () => {
14008
- s && s();
14005
+ }, [r, u]);
14006
+ Ae(() => {
14007
+ const _ = (A) => {
14008
+ h.current && !h.current.contains(A.target) && f(!1);
14009
+ };
14010
+ return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
14011
+ }, []);
14012
+ const y = (_) => {
14013
+ n && n(_), f(!1), c("");
14014
+ }, C = () => {
14015
+ s && s(), f(!1);
14016
+ }, x = () => {
14017
+ f(!0);
14018
+ }, D = (_) => {
14019
+ c(_.target.value), d || f(!0);
14009
14020
  };
14010
- return /* @__PURE__ */ g.jsxs("div", { className: `combostack ${o}`, style: { width: "100%" }, children: [
14011
- /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", gap: "8px", marginBottom: "12px" }, children: [
14012
- /* @__PURE__ */ g.jsxs("div", { style: {
14013
- flex: 1,
14014
- position: "relative"
14015
- }, children: [
14016
- /* @__PURE__ */ g.jsx("span", { style: {
14021
+ return /* @__PURE__ */ g.jsxs(
14022
+ "div",
14023
+ {
14024
+ ref: h,
14025
+ className: `combostack ${o}`,
14026
+ style: { position: "relative", width: "100%" },
14027
+ children: [
14028
+ /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
14029
+ /* @__PURE__ */ g.jsxs("div", { style: { flex: 1, position: "relative" }, children: [
14030
+ /* @__PURE__ */ g.jsx("span", { style: {
14031
+ position: "absolute",
14032
+ left: "12px",
14033
+ top: "50%",
14034
+ transform: "translateY(-50%)",
14035
+ color: l.textSecondary,
14036
+ fontSize: "14px",
14037
+ pointerEvents: "none"
14038
+ }, children: "🔍" }),
14039
+ /* @__PURE__ */ g.jsx(
14040
+ "input",
14041
+ {
14042
+ ref: p,
14043
+ type: "text",
14044
+ value: u,
14045
+ onChange: D,
14046
+ onFocus: x,
14047
+ placeholder: t,
14048
+ style: {
14049
+ width: "100%",
14050
+ padding: "8px 12px 8px 36px",
14051
+ fontSize: "14px",
14052
+ border: `1px solid ${d ? l.primary : l.border}`,
14053
+ borderRadius: "6px",
14054
+ background: l.background,
14055
+ color: l.text,
14056
+ outline: "none",
14057
+ boxSizing: "border-box",
14058
+ transition: "border-color 0.15s"
14059
+ }
14060
+ }
14061
+ )
14062
+ ] }),
14063
+ s && /* @__PURE__ */ g.jsx(
14064
+ "button",
14065
+ {
14066
+ onClick: C,
14067
+ style: {
14068
+ width: "36px",
14069
+ height: "36px",
14070
+ display: "flex",
14071
+ alignItems: "center",
14072
+ justifyContent: "center",
14073
+ border: `1px solid ${l.border}`,
14074
+ borderRadius: "6px",
14075
+ background: l.background,
14076
+ color: l.primary,
14077
+ cursor: "pointer",
14078
+ fontSize: "18px",
14079
+ fontWeight: "bold",
14080
+ transition: "background 0.15s"
14081
+ },
14082
+ onMouseEnter: (_) => {
14083
+ _.currentTarget.style.background = l.cardHover || "#f3f4f6";
14084
+ },
14085
+ onMouseLeave: (_) => {
14086
+ _.currentTarget.style.background = l.background || "#ffffff";
14087
+ },
14088
+ title: `Create ${e || "item"}`,
14089
+ children: "+"
14090
+ }
14091
+ )
14092
+ ] }),
14093
+ d && /* @__PURE__ */ g.jsx("div", { style: {
14017
14094
  position: "absolute",
14018
- left: "12px",
14019
- top: "50%",
14020
- transform: "translateY(-50%)",
14095
+ top: "100%",
14096
+ left: 0,
14097
+ right: 0,
14098
+ marginTop: "4px",
14099
+ maxHeight: typeof i == "number" ? `${i}px` : i,
14100
+ overflowY: "auto",
14101
+ border: `1px solid ${l.border}`,
14102
+ borderRadius: "8px",
14103
+ background: l.background,
14104
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
14105
+ zIndex: 50
14106
+ }, children: m.length === 0 ? /* @__PURE__ */ g.jsx("div", { style: {
14107
+ padding: "16px",
14108
+ textAlign: "center",
14021
14109
  color: l.textSecondary,
14022
- fontSize: "16px"
14023
- }, children: "🔍" }),
14024
- /* @__PURE__ */ g.jsx(
14025
- "input",
14110
+ fontSize: "14px"
14111
+ }, children: u ? `No results for "${u}"` : "No items" }) : m.map((_, A) => /* @__PURE__ */ g.jsxs(
14112
+ "div",
14026
14113
  {
14027
- ref: d,
14028
- type: "text",
14029
- value: u,
14030
- onChange: (m) => c(m.target.value),
14031
- placeholder: t,
14114
+ onClick: () => y(_),
14032
14115
  style: {
14033
- width: "100%",
14034
- padding: "10px 12px 10px 40px",
14035
- fontSize: "14px",
14036
- border: `1px solid ${l.border}`,
14037
- borderRadius: "8px",
14038
- background: l.background,
14039
- color: l.text,
14040
- outline: "none",
14041
- boxSizing: "border-box"
14042
- }
14043
- }
14044
- )
14045
- ] }),
14046
- s && /* @__PURE__ */ g.jsx(
14047
- "button",
14048
- {
14049
- onClick: p,
14050
- style: {
14051
- width: "42px",
14052
- height: "42px",
14053
- display: "flex",
14054
- alignItems: "center",
14055
- justifyContent: "center",
14056
- border: `1px solid ${l.border}`,
14057
- borderRadius: "8px",
14058
- background: l.background,
14059
- color: l.primary,
14060
- cursor: "pointer",
14061
- fontSize: "20px",
14062
- fontWeight: "bold",
14063
- transition: "background 0.15s"
14064
- },
14065
- onMouseEnter: (m) => {
14066
- m.currentTarget.style.background = l.cardHover || "#f3f4f6";
14067
- },
14068
- onMouseLeave: (m) => {
14069
- m.currentTarget.style.background = l.background || "#ffffff";
14116
+ padding: "10px 14px",
14117
+ cursor: "pointer",
14118
+ borderBottom: A < m.length - 1 ? `1px solid ${l.border}` : "none",
14119
+ background: l.cardBackground,
14120
+ transition: "background 0.15s"
14121
+ },
14122
+ onMouseEnter: (b) => {
14123
+ b.currentTarget.style.background = l.cardHover || "#f3f4f6";
14124
+ },
14125
+ onMouseLeave: (b) => {
14126
+ b.currentTarget.style.background = l.cardBackground || "#f9fafb";
14127
+ },
14128
+ children: [
14129
+ /* @__PURE__ */ g.jsx("div", { style: {
14130
+ fontSize: "14px",
14131
+ fontWeight: 500,
14132
+ color: _.color || l.text,
14133
+ marginBottom: _.notes ? "2px" : 0
14134
+ }, children: _.label }),
14135
+ _.notes && /* @__PURE__ */ g.jsx("div", { style: {
14136
+ fontSize: "12px",
14137
+ color: l.textSecondary,
14138
+ whiteSpace: "nowrap",
14139
+ overflow: "hidden",
14140
+ textOverflow: "ellipsis"
14141
+ }, children: _.notes })
14142
+ ]
14070
14143
  },
14071
- title: `Créer ${e || "item"}`,
14072
- children: "+"
14073
- }
14074
- )
14075
- ] }),
14076
- /* @__PURE__ */ g.jsx("div", { style: {
14077
- maxHeight: typeof i == "number" ? `${i}px` : i,
14078
- overflowY: "auto",
14079
- border: `1px solid ${l.border}`,
14080
- borderRadius: "8px",
14081
- background: l.background
14082
- }, children: f.length === 0 ? /* @__PURE__ */ g.jsx("div", { style: {
14083
- padding: "24px",
14084
- textAlign: "center",
14085
- color: l.textSecondary,
14086
- fontSize: "14px"
14087
- }, children: u ? `Aucun résultat pour "${u}"` : "Aucun élément" }) : f.map((m, y) => /* @__PURE__ */ g.jsxs(
14088
- "div",
14089
- {
14090
- onClick: () => h(m),
14091
- style: {
14092
- padding: "12px 16px",
14093
- cursor: "pointer",
14094
- borderBottom: y < f.length - 1 ? `1px solid ${l.border}` : "none",
14095
- background: l.cardBackground,
14096
- transition: "background 0.15s"
14097
- },
14098
- onMouseEnter: (w) => {
14099
- w.currentTarget.style.background = l.cardHover || "#f3f4f6";
14100
- },
14101
- onMouseLeave: (w) => {
14102
- w.currentTarget.style.background = l.cardBackground || "#f9fafb";
14103
- },
14104
- children: [
14105
- /* @__PURE__ */ g.jsx("div", { style: {
14106
- fontSize: "14px",
14107
- fontWeight: 500,
14108
- color: m.color || l.text,
14109
- marginBottom: m.notes ? "4px" : 0
14110
- }, children: m.label }),
14111
- m.notes && /* @__PURE__ */ g.jsx("div", { style: {
14112
- fontSize: "13px",
14113
- color: l.textSecondary,
14114
- whiteSpace: "nowrap",
14115
- overflow: "hidden",
14116
- textOverflow: "ellipsis"
14117
- }, children: m.notes })
14118
- ]
14119
- },
14120
- m.id
14121
- )) })
14122
- ] });
14144
+ _.id
14145
+ )) })
14146
+ ]
14147
+ }
14148
+ );
14123
14149
  }
14124
14150
  function yh({
14125
14151
  items: r,
@@ -14137,27 +14163,27 @@ function yh({
14137
14163
  columnClassName: f = "",
14138
14164
  itemClassName: h = ""
14139
14165
  }) {
14140
- const [p, m] = K(null), [y, w] = K(null), [x, D] = K(null), C = _e(null), A = e.reduce((N, R) => {
14166
+ const [p, m] = K(null), [y, C] = K(null), [x, D] = K(null), _ = ge(null), A = e.reduce((N, R) => {
14141
14167
  let F = r.filter((P) => n(P) === R.id);
14142
14168
  return s && (F = F.sort((P, Q) => s(P) - s(Q))), N[R.id] = F, N;
14143
14169
  }, {}), b = re((N, R) => {
14144
14170
  const F = t(R), P = n(R);
14145
- m(F), C.current = P, N.dataTransfer.effectAllowed = "move", N.dataTransfer.setData("text/plain", F), requestAnimationFrame(() => {
14171
+ m(F), _.current = P, N.dataTransfer.effectAllowed = "move", N.dataTransfer.setData("text/plain", F), requestAnimationFrame(() => {
14146
14172
  const Q = N.target;
14147
14173
  Q.style.opacity = "0.5";
14148
14174
  });
14149
14175
  }, [t, n]), v = re((N) => {
14150
14176
  const R = N.target;
14151
- R.style.opacity = "1", m(null), w(null), D(null), C.current = null;
14177
+ R.style.opacity = "1", m(null), C(null), D(null), _.current = null;
14152
14178
  }, []), E = re((N, R, F) => {
14153
- N.preventDefault(), N.dataTransfer.dropEffect = "move", w(R), D(F);
14179
+ N.preventDefault(), N.dataTransfer.dropEffect = "move", C(R), D(F);
14154
14180
  }, []), S = re((N) => {
14155
14181
  const R = N.relatedTarget;
14156
- R != null && R.closest("[data-kanban-column]") || (w(null), D(null));
14182
+ R != null && R.closest("[data-kanban-column]") || (C(null), D(null));
14157
14183
  }, []), j = re((N, R, F) => {
14158
14184
  if (N.preventDefault(), !p) return;
14159
- const P = C.current;
14160
- P === R ? a == null || a(p, R, F) : P && o(p, P, R, F), m(null), w(null), D(null), C.current = null;
14185
+ const P = _.current;
14186
+ P === R ? a == null || a(p, R, F) : P && o(p, P, R, F), m(null), C(null), D(null), _.current = null;
14161
14187
  }, [p, o, a]), k = (N, R) => /* @__PURE__ */ g.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
14162
14188
  /* @__PURE__ */ g.jsxs("div", { className: "flex items-center gap-2", children: [
14163
14189
  N.color && /* @__PURE__ */ g.jsx(
@@ -14184,7 +14210,7 @@ function yh({
14184
14210
  "data-kanban-column": N.id,
14185
14211
  className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
14186
14212
  onDragOver: (P) => {
14187
- P.preventDefault(), p && !F && w(N.id);
14213
+ P.preventDefault(), p && !F && C(N.id);
14188
14214
  },
14189
14215
  onDragLeave: S,
14190
14216
  onDrop: (P) => j(P, N.id, x ?? R.length),
@@ -14277,7 +14303,7 @@ function xh({
14277
14303
  className: h = "",
14278
14304
  theme: p = {}
14279
14305
  }) {
14280
- const m = { ...Qf, ...p }, { allDayItems: y, timedItems: w } = bt(() => {
14306
+ const m = { ...Qf, ...p }, { allDayItems: y, timedItems: C } = bt(() => {
14281
14307
  const v = [], E = [];
14282
14308
  for (const S of r)
14283
14309
  a(S) ? v.push(S) : E.push(S);
@@ -14287,7 +14313,7 @@ function xh({
14287
14313
  for (let E = t; E <= n; E++)
14288
14314
  v.push(E);
14289
14315
  return v;
14290
- }, [t, n]), D = (n - t + 1) * s, C = re(
14316
+ }, [t, n]), D = (n - t + 1) * s, _ = re(
14291
14317
  (v) => {
14292
14318
  const E = i(v);
14293
14319
  if (!E) return null;
@@ -14442,8 +14468,8 @@ function xh({
14442
14468
  ]
14443
14469
  }
14444
14470
  ),
14445
- w.map((v) => {
14446
- const E = C(v);
14471
+ C.map((v) => {
14472
+ const E = _(v);
14447
14473
  return E ? /* @__PURE__ */ g.jsx(
14448
14474
  "div",
14449
14475
  {
@@ -14468,22 +14494,22 @@ function xh({
14468
14494
  ] });
14469
14495
  }
14470
14496
  function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: s = "widget", hideSaveButton: i = !1, maxDuration: o = 180 }) {
14471
- const a = s === "widget", [l, u] = K("idle"), [c, d] = K(0), [f, h] = K(0), [p, m] = K(!1), [y, w] = K(0), [x, D] = K(null), [C, A] = K(!1), [b, v] = K(null), [E, S] = K(!0), [j, k] = K([]), [N, R] = K({ completed: 0, total: 0 }), F = _e(!1), P = _e(!0);
14472
- Te(() => {
14497
+ const a = s === "widget", [l, u] = K("idle"), [c, d] = K(0), [f, h] = K(0), [p, m] = K(!1), [y, C] = K(0), [x, D] = K(null), [_, A] = K(!1), [b, v] = K(null), [E, S] = K(!0), [j, k] = K([]), [N, R] = K({ completed: 0, total: 0 }), F = ge(!1), P = ge(!0);
14498
+ Ae(() => {
14473
14499
  P.current = E;
14474
14500
  }, [E]);
14475
- const Q = _e(null), ie = _e(null), ve = _e(null), le = _e(null), Ne = _e(null), ge = _e([]), pe = _e(null), me = _e(null), ye = _e(null), Be = _e(null), we = _e(!1), Ae = _e([]), Me = _e(null), fe = _e(null), ze = _e([]), ft = _e([]), Rt = _e("insert"), Vt = _e(!1), lt = _e(0), vt = _e(0), mt = _e(0), rr = (z) => {
14501
+ const Q = ge(null), ie = ge(null), ve = ge(null), le = ge(null), Ne = ge(null), me = ge([]), pe = ge(null), ye = ge(null), xe = ge(null), Be = ge(null), we = ge(!1), Se = ge([]), Me = ge(null), fe = ge(null), ze = ge([]), ft = ge([]), Rt = ge("insert"), Vt = ge(!1), lt = ge(0), vt = ge(0), mt = ge(0), rr = (z) => {
14476
14502
  const T = Math.floor(z / 60), H = Math.floor(z % 60);
14477
14503
  return `${T.toString().padStart(2, "0")}:${H.toString().padStart(2, "0")}`;
14478
14504
  }, Kt = async (z) => {
14479
14505
  const T = await z.arrayBuffer(), H = new AudioContext(), Y = await H.decodeAudioData(T);
14480
14506
  return await H.close(), Y;
14481
14507
  }, Lt = (z) => {
14482
- const T = z.numberOfChannels, H = z.sampleRate, Y = 1, O = 16, ne = O / 8, Z = T * ne, ee = H * Z, xe = z.length * Z, ke = new ArrayBuffer(44 + xe), te = new DataView(ke), se = (Pe, De) => {
14508
+ const T = z.numberOfChannels, H = z.sampleRate, Y = 1, O = 16, ne = O / 8, Z = T * ne, ee = H * Z, be = z.length * Z, Te = new ArrayBuffer(44 + be), te = new DataView(Te), se = (Pe, De) => {
14483
14509
  for (let et = 0; et < De.length; et++)
14484
14510
  te.setUint8(Pe + et, De.charCodeAt(et));
14485
14511
  };
14486
- se(0, "RIFF"), te.setUint32(4, 36 + xe, !0), se(8, "WAVE"), se(12, "fmt "), te.setUint32(16, 16, !0), te.setUint16(20, Y, !0), te.setUint16(22, T, !0), te.setUint32(24, H, !0), te.setUint32(28, ee, !0), te.setUint16(32, Z, !0), te.setUint16(34, O, !0), se(36, "data"), te.setUint32(40, xe, !0);
14512
+ se(0, "RIFF"), te.setUint32(4, 36 + be, !0), se(8, "WAVE"), se(12, "fmt "), te.setUint32(16, 16, !0), te.setUint16(20, Y, !0), te.setUint16(22, T, !0), te.setUint32(24, H, !0), te.setUint32(28, ee, !0), te.setUint16(32, Z, !0), te.setUint16(34, O, !0), se(36, "data"), te.setUint32(40, be, !0);
14487
14513
  const Ge = [];
14488
14514
  for (let Pe = 0; Pe < T; Pe++)
14489
14515
  Ge.push(z.getChannelData(Pe));
@@ -14493,9 +14519,9 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14493
14519
  const et = Math.max(-1, Math.min(1, Ge[De][Pe])), tt = et < 0 ? et * 32768 : et * 32767;
14494
14520
  te.setInt16(He, tt, !0), He += 2;
14495
14521
  }
14496
- return new Blob([ke], { type: "audio/wav" });
14522
+ return new Blob([Te], { type: "audio/wav" });
14497
14523
  }, Pt = async (z, T, H, Y) => {
14498
- const O = new AudioContext(), ne = z.sampleRate, Z = Math.max(z.numberOfChannels, T.numberOfChannels), ee = Math.min(H, z.length), xe = Math.max(0, z.length - H), ke = Y === "insert" ? ee + T.length + xe : ee + T.length, te = O.createBuffer(Z, ke, ne);
14524
+ const O = new AudioContext(), ne = z.sampleRate, Z = Math.max(z.numberOfChannels, T.numberOfChannels), ee = Math.min(H, z.length), be = Math.max(0, z.length - H), Te = Y === "insert" ? ee + T.length + be : ee + T.length, te = O.createBuffer(Z, Te, ne);
14499
14525
  for (let se = 0; se < Z; se++) {
14500
14526
  const Ge = te.getChannelData(se), He = se < z.numberOfChannels ? z.getChannelData(se) : z.getChannelData(0);
14501
14527
  for (let De = 0; De < ee; De++)
@@ -14504,7 +14530,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14504
14530
  for (let De = 0; De < T.length; De++)
14505
14531
  Ge[ee + De] = Pe[De];
14506
14532
  if (Y === "insert")
14507
- for (let De = 0; De < xe; De++)
14533
+ for (let De = 0; De < be; De++)
14508
14534
  Ge[ee + T.length + De] = He[H + De];
14509
14535
  }
14510
14536
  return await O.close(), te;
@@ -14513,32 +14539,32 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14513
14539
  if (!z) return;
14514
14540
  const T = z.getContext("2d");
14515
14541
  if (!T) return;
14516
- const H = z.getBoundingClientRect(), Y = H.width, O = H.height, ne = Ae.current, Z = f || c || 1, ee = l === "recording" ? c : y;
14542
+ const H = z.getBoundingClientRect(), Y = H.width, O = H.height, ne = Se.current, Z = f || c || 1, ee = l === "recording" ? c : y;
14517
14543
  T.fillStyle = "#2d3b35", T.fillRect(0, 0, Y, O);
14518
- const xe = 8, ke = "rgba(0, 0, 0, 0.4)", te = T.createLinearGradient(0, 0, 0, xe);
14519
- te.addColorStop(0, ke), te.addColorStop(1, "transparent"), T.fillStyle = te, T.fillRect(0, 0, Y, xe);
14520
- const se = T.createLinearGradient(0, O - xe, 0, O);
14521
- se.addColorStop(0, "transparent"), se.addColorStop(1, ke), T.fillStyle = se, T.fillRect(0, O - xe, Y, xe);
14522
- const Ge = T.createLinearGradient(0, 0, xe, 0);
14523
- Ge.addColorStop(0, ke), Ge.addColorStop(1, "transparent"), T.fillStyle = Ge, T.fillRect(0, 0, xe, O);
14524
- const He = T.createLinearGradient(Y - xe, 0, Y, 0);
14525
- He.addColorStop(0, "transparent"), He.addColorStop(1, ke), T.fillStyle = He, T.fillRect(Y - xe, 0, xe, O), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, O / 2), T.lineTo(Y, O / 2), T.stroke();
14544
+ const be = 8, Te = "rgba(0, 0, 0, 0.4)", te = T.createLinearGradient(0, 0, 0, be);
14545
+ te.addColorStop(0, Te), te.addColorStop(1, "transparent"), T.fillStyle = te, T.fillRect(0, 0, Y, be);
14546
+ const se = T.createLinearGradient(0, O - be, 0, O);
14547
+ se.addColorStop(0, "transparent"), se.addColorStop(1, Te), T.fillStyle = se, T.fillRect(0, O - be, Y, be);
14548
+ const Ge = T.createLinearGradient(0, 0, be, 0);
14549
+ Ge.addColorStop(0, Te), Ge.addColorStop(1, "transparent"), T.fillStyle = Ge, T.fillRect(0, 0, be, O);
14550
+ const He = T.createLinearGradient(Y - be, 0, Y, 0);
14551
+ He.addColorStop(0, "transparent"), He.addColorStop(1, Te), T.fillStyle = He, T.fillRect(Y - be, 0, be, O), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, O / 2), T.lineTo(Y, O / 2), T.stroke();
14526
14552
  const Pe = Y / 2;
14527
14553
  if (ne.length > 0)
14528
14554
  if (l === "recording")
14529
14555
  for (let tt = 0; tt < ne.length; tt++) {
14530
14556
  const yt = ne.length - 1 - tt, Qt = Pe - yt * 4;
14531
14557
  if (Qt < -3 || Qt > Y) continue;
14532
- const Dt = ne[tt] * (O / 2 - 12), _ = O / 2 - Dt;
14533
- T.fillStyle = "#10b981", T.fillRect(Qt, _, 3, Dt * 2);
14558
+ const Dt = ne[tt] * (O / 2 - 12), w = O / 2 - Dt;
14559
+ T.fillStyle = "#10b981", T.fillRect(Qt, w, 3, Dt * 2);
14534
14560
  }
14535
14561
  else {
14536
14562
  const tt = Z > 0 ? ee / Z * ne.length : 0;
14537
14563
  for (let yt = 0; yt < ne.length; yt++) {
14538
14564
  const Qt = tt - yt, Dt = Pe - Qt * 4;
14539
14565
  if (Dt < -3 || Dt > Y) continue;
14540
- const _ = ne[yt] * (O / 2 - 12), L = O / 2 - _;
14541
- T.fillStyle = yt <= tt ? "#10b981" : "#4b5563", T.fillRect(Dt, L, 3, _ * 2);
14566
+ const w = ne[yt] * (O / 2 - 12), L = O / 2 - w;
14567
+ T.fillStyle = yt <= tt ? "#10b981" : "#4b5563", T.fillRect(Dt, L, 3, w * 2);
14542
14568
  }
14543
14569
  }
14544
14570
  T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(Pe, 0), T.lineTo(Pe, O), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText(rr(ee), Pe, O - 6), l === "recording" && (T.fillStyle = "#ef4444", T.beginPath(), T.arc(20, 20, 8, 0, Math.PI * 2), T.fill(), T.fillStyle = "#fff", T.font = "10px sans-serif", T.textAlign = "left", T.fillText("REC", 34, 24)), T.textAlign = "left";
@@ -14553,10 +14579,10 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14553
14579
  Y += ee * ee;
14554
14580
  }
14555
14581
  const O = Math.sqrt(Y / T), ne = Math.min(1, O * 3);
14556
- Ae.current.push(ne), ht(), we.current && (me.current = requestAnimationFrame(wt));
14582
+ Se.current.push(ne), ht(), we.current && (ye.current = requestAnimationFrame(wt));
14557
14583
  }, U = async () => {
14558
14584
  try {
14559
- D(null), A(!1), Me.current === null && (Ae.current = []);
14585
+ D(null), A(!1), Me.current === null && (Se.current = []);
14560
14586
  const z = await navigator.mediaDevices.getUserMedia({ audio: !0 });
14561
14587
  ve.current = z;
14562
14588
  const T = new AudioContext();
@@ -14564,15 +14590,15 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14564
14590
  const H = T.createAnalyser();
14565
14591
  H.fftSize = 2048, Ne.current = H, T.createMediaStreamSource(z).connect(H);
14566
14592
  const O = new MediaRecorder(z);
14567
- ie.current = O, ge.current = [], O.ondataavailable = (ne) => {
14568
- ne.data.size > 0 && ge.current.push(ne.data);
14593
+ ie.current = O, me.current = [], O.ondataavailable = (ne) => {
14594
+ ne.data.size > 0 && me.current.push(ne.data);
14569
14595
  }, O.onstop = async () => {
14570
14596
  try {
14571
- if (we.current = !1, ge.current.length === 0) {
14597
+ if (we.current = !1, me.current.length === 0) {
14572
14598
  D("No audio was recorded. Please try again."), u("idle"), z.getTracks().forEach((te) => te.stop());
14573
14599
  return;
14574
14600
  }
14575
- const ne = new Blob(ge.current, { type: "audio/webm" });
14601
+ const ne = new Blob(me.current, { type: "audio/webm" });
14576
14602
  let Z, ee;
14577
14603
  if (Me.current !== null && fe.current)
14578
14604
  try {
@@ -14582,8 +14608,8 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14582
14608
  Ge,
14583
14609
  Rt.current
14584
14610
  );
14585
- Z = Lt(He), ee = He.length / He.sampleRate, Rt.current === "insert" && (Ae.current = [
14586
- ...Ae.current,
14611
+ Z = Lt(He), ee = He.length / He.sampleRate, Rt.current === "insert" && (Se.current = [
14612
+ ...Se.current,
14587
14613
  ...ft.current
14588
14614
  ]), Me.current = null, fe.current = null, ze.current = [], ft.current = [];
14589
14615
  } catch {
@@ -14592,45 +14618,45 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14592
14618
  else
14593
14619
  Z = ne, ee = lt.current > 0 ? lt.current : 1;
14594
14620
  if (Be.current = Z, z.getTracks().forEach((te) => te.stop()), P.current && t) {
14595
- k((te) => [...te, Z]), R((te) => ({ ...te, total: te.total + 1 })), Be.current = null, Ae.current = [], w(0), h(0), d(0), u("idle");
14621
+ k((te) => [...te, Z]), R((te) => ({ ...te, total: te.total + 1 })), Be.current = null, Se.current = [], C(0), h(0), d(0), u("idle");
14596
14622
  return;
14597
14623
  }
14598
- const xe = URL.createObjectURL(Z), ke = new Audio(xe);
14599
- ke.ontimeupdate = () => {
14600
- w(ke.currentTime);
14601
- }, ke.onended = () => {
14624
+ const be = URL.createObjectURL(Z), Te = new Audio(be);
14625
+ Te.ontimeupdate = () => {
14626
+ C(Te.currentTime);
14627
+ }, Te.onended = () => {
14602
14628
  m(!1);
14603
- }, ye.current = ke, h(ee), w(ee), u("editing");
14629
+ }, xe.current = Te, h(ee), C(ee), u("editing");
14604
14630
  } catch {
14605
14631
  D("Failed to process recording"), u("idle");
14606
14632
  }
14607
14633
  }, O.start(100), we.current = !0, u("recording"), d(0), lt.current = 0, pe.current = setInterval(() => {
14608
- lt.current += 1, d(lt.current), lt.current >= o && (ie.current && ie.current.state !== "inactive" && ie.current.stop(), we.current = !1, v(null), pe.current && (clearInterval(pe.current), pe.current = null), me.current && (cancelAnimationFrame(me.current), me.current = null), setTimeout(() => {
14634
+ lt.current += 1, d(lt.current), lt.current >= o && (ie.current && ie.current.state !== "inactive" && ie.current.stop(), we.current = !1, v(null), pe.current && (clearInterval(pe.current), pe.current = null), ye.current && (cancelAnimationFrame(ye.current), ye.current = null), setTimeout(() => {
14609
14635
  alert(`Maximum recording time of ${Math.floor(o / 60)} minutes reached.`);
14610
14636
  }, 100));
14611
14637
  }, 1e3);
14612
14638
  } catch {
14613
14639
  D("Could not access microphone. Please allow microphone access.");
14614
14640
  }
14615
- }, Se = () => {
14616
- we.current = !1, A(!1), v(null), me.current && (cancelAnimationFrame(me.current), me.current = null), pe.current && (clearInterval(pe.current), pe.current = null), ie.current && ie.current.state !== "inactive" && ie.current.stop();
14641
+ }, ke = () => {
14642
+ we.current = !1, A(!1), v(null), ye.current && (cancelAnimationFrame(ye.current), ye.current = null), pe.current && (clearInterval(pe.current), pe.current = null), ie.current && ie.current.state !== "inactive" && ie.current.stop();
14617
14643
  }, Re = (z) => {
14618
14644
  const T = Q.current;
14619
14645
  if (!T) return;
14620
14646
  const H = f || c;
14621
14647
  if (H <= 0) return;
14622
- const Y = Ae.current;
14648
+ const Y = Se.current;
14623
14649
  if (Y.length === 0) return;
14624
- const O = T.getBoundingClientRect(), ne = z - vt.current, Z = 4, ee = O.width / T.width, xe = Y.length / H * Z, ke = -ne / (xe * ee), te = mt.current + ke, se = Math.max(0, Math.min(te, H));
14625
- ye.current && (ye.current.currentTime = se), w(se);
14650
+ const O = T.getBoundingClientRect(), ne = z - vt.current, Z = 4, ee = O.width / T.width, be = Y.length / H * Z, Te = -ne / (be * ee), te = mt.current + Te, se = Math.max(0, Math.min(te, H));
14651
+ xe.current && (xe.current.currentTime = se), C(se);
14626
14652
  }, Fe = () => {
14627
- ye.current && (ye.current.currentTime = 0), w(0);
14653
+ xe.current && (xe.current.currentTime = 0), C(0);
14628
14654
  }, jt = () => {
14629
14655
  const z = f || c;
14630
- ye.current && (ye.current.currentTime = z), w(z);
14656
+ xe.current && (xe.current.currentTime = z), C(z);
14631
14657
  }, Mt = () => {
14632
- const z = ye.current;
14633
- z && (p ? (z.pause(), w(z.currentTime), m(!1)) : (z.currentTime = y, z.play().catch(() => {
14658
+ const z = xe.current;
14659
+ z && (p ? (z.pause(), C(z.currentTime), m(!1)) : (z.currentTime = y, z.play().catch(() => {
14634
14660
  }), m(!0)));
14635
14661
  }, Ht = async (z) => {
14636
14662
  if (!Be.current) {
@@ -14638,22 +14664,22 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14638
14664
  return;
14639
14665
  }
14640
14666
  try {
14641
- ye.current && (ye.current.pause(), m(!1)), Rt.current = z, fe.current = await Kt(Be.current);
14667
+ xe.current && (xe.current.pause(), m(!1)), Rt.current = z, fe.current = await Kt(Be.current);
14642
14668
  const T = f || c;
14643
14669
  Me.current = y;
14644
- const H = T > 0 ? y / T : 0, Y = Math.floor(H * Ae.current.length);
14645
- ze.current = Ae.current.slice(0, Y), ft.current = Ae.current.slice(Y), Ae.current = [...ze.current], U();
14670
+ const H = T > 0 ? y / T : 0, Y = Math.floor(H * Se.current.length);
14671
+ ze.current = Se.current.slice(0, Y), ft.current = Se.current.slice(Y), Se.current = [...ze.current], U();
14646
14672
  } catch {
14647
14673
  D("Failed to prepare recording. Please try again.");
14648
14674
  }
14649
14675
  }, G = () => {
14650
- ye.current && (ye.current.pause(), ye.current = null), Be.current = null, fe.current = null, Me.current = null, ze.current = [], m(!1), w(0), h(0), d(0), U();
14676
+ xe.current && (xe.current.pause(), xe.current = null), Be.current = null, fe.current = null, Me.current = null, ze.current = [], m(!1), C(0), h(0), d(0), U();
14651
14677
  }, J = () => {
14652
14678
  Be.current ? r(Be.current, f || c) : alert("No audio recorded yet!");
14653
14679
  };
14654
- Te(() => {
14655
- l === "recording" && Q.current && Ne.current && we.current && (me.current = requestAnimationFrame(wt));
14656
- }, [l]), Te(() => {
14680
+ Ae(() => {
14681
+ l === "recording" && Q.current && Ne.current && we.current && (ye.current = requestAnimationFrame(wt));
14682
+ }, [l]), Ae(() => {
14657
14683
  const z = Q.current;
14658
14684
  if (!z) return;
14659
14685
  const T = () => {
@@ -14663,7 +14689,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14663
14689
  O && O.scale(H, H);
14664
14690
  };
14665
14691
  return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
14666
- }, []), Te(() => {
14692
+ }, []), Ae(() => {
14667
14693
  if (l === "idle") {
14668
14694
  const z = Q.current;
14669
14695
  if (!z) return;
@@ -14673,10 +14699,10 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14673
14699
  T.fillStyle = "#2d3b35", T.fillRect(0, 0, Y, O);
14674
14700
  const ne = 8, Z = "rgba(0, 0, 0, 0.4)", ee = T.createLinearGradient(0, 0, 0, ne);
14675
14701
  ee.addColorStop(0, Z), ee.addColorStop(1, "transparent"), T.fillStyle = ee, T.fillRect(0, 0, Y, ne);
14676
- const xe = T.createLinearGradient(0, O - ne, 0, O);
14677
- xe.addColorStop(0, "transparent"), xe.addColorStop(1, Z), T.fillStyle = xe, T.fillRect(0, O - ne, Y, ne);
14678
- const ke = T.createLinearGradient(0, 0, ne, 0);
14679
- ke.addColorStop(0, Z), ke.addColorStop(1, "transparent"), T.fillStyle = ke, T.fillRect(0, 0, ne, O);
14702
+ const be = T.createLinearGradient(0, O - ne, 0, O);
14703
+ be.addColorStop(0, "transparent"), be.addColorStop(1, Z), T.fillStyle = be, T.fillRect(0, O - ne, Y, ne);
14704
+ const Te = T.createLinearGradient(0, 0, ne, 0);
14705
+ Te.addColorStop(0, Z), Te.addColorStop(1, "transparent"), T.fillStyle = Te, T.fillRect(0, 0, ne, O);
14680
14706
  const te = T.createLinearGradient(Y - ne, 0, Y, 0);
14681
14707
  te.addColorStop(0, "transparent"), te.addColorStop(1, Z), T.fillStyle = te, T.fillRect(Y - ne, 0, ne, O), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, O / 2), T.lineTo(Y, O / 2), T.stroke();
14682
14708
  const se = Y / 2;
@@ -14686,7 +14712,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14686
14712
  const Le = re((z) => {
14687
14713
  k((T) => [...T, z]), R((T) => ({ ...T, total: T.total + 1 }));
14688
14714
  }, []);
14689
- if (Te(() => {
14715
+ if (Ae(() => {
14690
14716
  (async () => {
14691
14717
  if (F.current || j.length === 0 || !t) return;
14692
14718
  F.current = !0;
@@ -14700,19 +14726,19 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14700
14726
  k((H) => H.slice(1)), R((H) => ({ ...H, completed: H.completed + 1 })), F.current = !1;
14701
14727
  }
14702
14728
  })();
14703
- }, [j, t, n]), Te(() => () => {
14704
- we.current = !1, pe.current && clearInterval(pe.current), me.current && cancelAnimationFrame(me.current), ve.current && ve.current.getTracks().forEach((z) => z.stop()), le.current && le.current.state !== "closed" && le.current.close();
14705
- }, []), Te(() => {
14729
+ }, [j, t, n]), Ae(() => () => {
14730
+ we.current = !1, pe.current && clearInterval(pe.current), ye.current && cancelAnimationFrame(ye.current), ve.current && ve.current.getTracks().forEach((z) => z.stop()), le.current && le.current.state !== "closed" && le.current.close();
14731
+ }, []), Ae(() => {
14706
14732
  if (l === "editing" && p) {
14707
14733
  let z;
14708
14734
  const T = () => {
14709
- const H = ye.current;
14735
+ const H = xe.current;
14710
14736
  if (H && p) {
14711
14737
  const Y = Q.current;
14712
14738
  if (Y) {
14713
14739
  const O = Y.getContext("2d");
14714
14740
  if (O) {
14715
- const ne = Y.getBoundingClientRect(), Z = ne.width, ee = ne.height, xe = Ae.current, ke = f || c || 1, te = H.currentTime;
14741
+ const ne = Y.getBoundingClientRect(), Z = ne.width, ee = ne.height, be = Se.current, Te = f || c || 1, te = H.currentTime;
14716
14742
  O.fillStyle = "#2d3b35", O.fillRect(0, 0, Z, ee);
14717
14743
  const se = 8, Ge = "rgba(0, 0, 0, 0.4)", He = O.createLinearGradient(0, 0, 0, se);
14718
14744
  He.addColorStop(0, Ge), He.addColorStop(1, "transparent"), O.fillStyle = He, O.fillRect(0, 0, Z, se);
@@ -14722,16 +14748,16 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14722
14748
  De.addColorStop(0, Ge), De.addColorStop(1, "transparent"), O.fillStyle = De, O.fillRect(0, 0, se, ee);
14723
14749
  const et = O.createLinearGradient(Z - se, 0, Z, 0);
14724
14750
  et.addColorStop(0, "transparent"), et.addColorStop(1, Ge), O.fillStyle = et, O.fillRect(Z - se, 0, se, ee), O.strokeStyle = "#5a6b62", O.lineWidth = 1, O.beginPath(), O.moveTo(0, ee / 2), O.lineTo(Z, ee / 2), O.stroke();
14725
- const tt = Z / 2, yt = 3, Qt = 4, Dt = ke > 0 ? te / ke * xe.length : 0;
14726
- for (let q = 0; q < xe.length; q++) {
14751
+ const tt = Z / 2, yt = 3, Qt = 4, Dt = Te > 0 ? te / Te * be.length : 0;
14752
+ for (let q = 0; q < be.length; q++) {
14727
14753
  const X = Dt - q, ce = tt - X * Qt;
14728
14754
  if (ce < -yt || ce > Z) continue;
14729
- const Ce = xe[q] * (ee / 2 - 12), ae = ee / 2 - Ce;
14755
+ const Ce = be[q] * (ee / 2 - 12), ae = ee / 2 - Ce;
14730
14756
  O.fillStyle = q <= Dt ? "#10b981" : "#4b5563", O.fillRect(ce, ae, yt, Ce * 2);
14731
14757
  }
14732
14758
  O.strokeStyle = "#ef4444", O.lineWidth = 1, O.beginPath(), O.moveTo(tt, 0), O.lineTo(tt, ee), O.stroke(), O.fillStyle = "#fff", O.font = "bold 18px monospace", O.textAlign = "center";
14733
- const _ = Math.floor(te / 60), L = Math.floor(te % 60);
14734
- O.fillText(`${_.toString().padStart(2, "0")}:${L.toString().padStart(2, "0")}`, tt, ee - 6), O.textAlign = "left";
14759
+ const w = Math.floor(te / 60), L = Math.floor(te % 60);
14760
+ O.fillText(`${w.toString().padStart(2, "0")}:${L.toString().padStart(2, "0")}`, tt, ee - 6), O.textAlign = "left";
14735
14761
  }
14736
14762
  }
14737
14763
  z = requestAnimationFrame(T);
@@ -14739,7 +14765,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14739
14765
  };
14740
14766
  return z = requestAnimationFrame(T), () => cancelAnimationFrame(z);
14741
14767
  }
14742
- }, [l, p, f, c]), Te(() => {
14768
+ }, [l, p, f, c]), Ae(() => {
14743
14769
  l === "editing" && !p && ht();
14744
14770
  }, [l, y, p, ht]), x)
14745
14771
  return /* @__PURE__ */ g.jsxs("div", { style: { border: "1px solid #fecaca", borderRadius: "12px", padding: "16px", background: "#fef2f2" }, children: [
@@ -14826,8 +14852,8 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14826
14852
  },
14827
14853
  disabled: l === "idle",
14828
14854
  style: l === "idle" ? Ue : qe,
14829
- title: p || l === "recording" && !C ? "Pause" : "Play",
14830
- children: /* @__PURE__ */ g.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: p || l === "recording" && !C ? "pause" : "play_arrow" })
14855
+ title: p || l === "recording" && !_ ? "Pause" : "Play",
14856
+ children: /* @__PURE__ */ g.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: p || l === "recording" && !_ ? "pause" : "play_arrow" })
14831
14857
  }
14832
14858
  ),
14833
14859
  /* @__PURE__ */ g.jsx(
@@ -14845,7 +14871,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14845
14871
  "button",
14846
14872
  {
14847
14873
  onClick: () => {
14848
- b === "insert" ? Se() : l === "idle" ? (v("insert"), U()) : l === "editing" && (v("insert"), Ht("insert"));
14874
+ b === "insert" ? ke() : l === "idle" ? (v("insert"), U()) : l === "editing" && (v("insert"), Ht("insert"));
14849
14875
  },
14850
14876
  disabled: l === "recording" && b !== "insert" || p,
14851
14877
  style: l === "recording" && b !== "insert" || p ? Ue : qe,
@@ -14857,22 +14883,22 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14857
14883
  "button",
14858
14884
  {
14859
14885
  onClick: () => {
14860
- P.current || (b === "mic" ? Se() : l === "idle" ? (v("mic"), U()) : l === "editing" && (v("mic"), Ht("replace")));
14886
+ P.current || (b === "mic" ? ke() : l === "idle" ? (v("mic"), U()) : l === "editing" && (v("mic"), Ht("replace")));
14861
14887
  },
14862
14888
  onMouseDown: () => {
14863
14889
  P.current && l === "idle" && !p && (v("mic"), U());
14864
14890
  },
14865
14891
  onMouseUp: () => {
14866
- P.current && l === "recording" && b === "mic" && Se();
14892
+ P.current && l === "recording" && b === "mic" && ke();
14867
14893
  },
14868
14894
  onMouseLeave: () => {
14869
- P.current && l === "recording" && b === "mic" && Se();
14895
+ P.current && l === "recording" && b === "mic" && ke();
14870
14896
  },
14871
14897
  onTouchStart: () => {
14872
14898
  P.current && l === "idle" && !p && (v("mic"), U());
14873
14899
  },
14874
14900
  onTouchEnd: () => {
14875
- P.current && l === "recording" && b === "mic" && Se();
14901
+ P.current && l === "recording" && b === "mic" && ke();
14876
14902
  },
14877
14903
  disabled: l === "recording" && b !== "mic" || p,
14878
14904
  style: l === "recording" && b !== "mic" || p ? Ue : qe,
@@ -14884,7 +14910,7 @@ function bh({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
14884
14910
  "button",
14885
14911
  {
14886
14912
  onClick: () => {
14887
- b === "startover" ? Se() : l === "editing" && (v("startover"), G());
14913
+ b === "startover" ? ke() : l === "editing" && (v("startover"), G());
14888
14914
  },
14889
14915
  disabled: l === "idle" || l === "recording" && b !== "startover" || p,
14890
14916
  style: l === "idle" || l === "recording" && b !== "startover" || p ? Ue : qe,