@abduljebar/text-editor 1.1.3 → 1.2.0

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.js CHANGED
@@ -1,6 +1,6 @@
1
- import Q, { useEffect as Ie, useRef as vt, useState as bt, useCallback as F } from "react";
2
- import { Save as Jt, FileDown as Gt, Trash2 as qt, Bold as Xt, Italic as Kt, Underline as Qt, Strikethrough as en, List as tn, ListOrdered as nn, Heading1 as rn, Heading2 as on, Type as sn, AlignLeft as cn, AlignCenter as an, AlignRight as un, Link as ln } from "lucide-react";
3
- var oe = { exports: {} }, X = {};
1
+ import Ft, { useState as ae, useEffect as Ee, useRef as Mt, useCallback as P } from "react";
2
+ import { Save as Vt, FileDown as Wt, Trash2 as Bt, Bold as Yt, Italic as qt, Underline as Jt, Strikethrough as Gt, List as Ht, ListOrdered as Xt, Heading1 as Kt, Heading2 as Qt, Type as en, AlignLeft as tn, AlignCenter as nn, AlignRight as rn, Link as on } from "lucide-react";
3
+ var ne = { exports: {} }, G = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var oe = { exports: {} }, X = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var We;
14
- function dn() {
15
- if (We) return X;
16
- We = 1;
13
+ var Fe;
14
+ function cn() {
15
+ if (Fe) return G;
16
+ Fe = 1;
17
17
  var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
18
18
  function n(r, o, i) {
19
- var s = null;
20
- if (i !== void 0 && (s = "" + i), o.key !== void 0 && (s = "" + o.key), "key" in o) {
19
+ var c = null;
20
+ if (i !== void 0 && (c = "" + i), o.key !== void 0 && (c = "" + o.key), "key" in o) {
21
21
  i = {};
22
- for (var c in o)
23
- c !== "key" && (i[c] = o[c]);
22
+ for (var s in o)
23
+ s !== "key" && (i[s] = o[s]);
24
24
  } else i = o;
25
25
  return o = i.ref, {
26
26
  $$typeof: e,
27
27
  type: r,
28
- key: s,
28
+ key: c,
29
29
  ref: o !== void 0 ? o : null,
30
30
  props: i
31
31
  };
32
32
  }
33
- return X.Fragment = t, X.jsx = n, X.jsxs = n, X;
33
+ return G.Fragment = t, G.jsx = n, G.jsxs = n, G;
34
34
  }
35
- var K = {};
35
+ var H = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,47 +42,47 @@ var K = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var Be;
46
- function fn() {
47
- return Be || (Be = 1, process.env.NODE_ENV !== "production" && (function() {
45
+ var Me;
46
+ function sn() {
47
+ return Me || (Me = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function e(u) {
49
49
  if (u == null) return null;
50
50
  if (typeof u == "function")
51
- return u.$$typeof === D ? null : u.displayName || u.name || null;
51
+ return u.$$typeof === Dt ? null : u.displayName || u.name || null;
52
52
  if (typeof u == "string") return u;
53
53
  switch (u) {
54
- case C:
54
+ case j:
55
55
  return "Fragment";
56
- case k:
56
+ case S:
57
57
  return "Profiler";
58
- case N:
58
+ case U:
59
59
  return "StrictMode";
60
- case _e:
60
+ case $:
61
61
  return "Suspense";
62
- case ve:
62
+ case F:
63
63
  return "SuspenseList";
64
- case E:
64
+ case Nt:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof u == "object")
68
68
  switch (typeof u.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), u.$$typeof) {
71
- case b:
71
+ case R:
72
72
  return "Portal";
73
- case z:
73
+ case A:
74
74
  return u.displayName || "Context";
75
- case $:
75
+ case C:
76
76
  return (u._context.displayName || "Context") + ".Consumer";
77
- case P:
78
- var v = u.render;
79
- return u = u.displayName, u || (u = v.displayName || v.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
80
- case be:
81
- return v = u.displayName || null, v !== null ? v : e(u.type) || "Memo";
82
- case q:
83
- v = u._payload, u = u._init;
77
+ case N:
78
+ var g = u.render;
79
+ return u = u.displayName, u || (u = g.displayName || g.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
80
+ case ee:
81
+ return g = u.displayName || null, g !== null ? g : e(u.type) || "Memo";
82
+ case D:
83
+ g = u._payload, u = u._init;
84
84
  try {
85
- return e(u(v));
85
+ return e(u(g));
86
86
  } catch {
87
87
  }
88
88
  }
@@ -94,74 +94,74 @@ function fn() {
94
94
  function n(u) {
95
95
  try {
96
96
  t(u);
97
- var v = !1;
97
+ var g = !1;
98
98
  } catch {
99
- v = !0;
99
+ g = !0;
100
100
  }
101
- if (v) {
102
- v = console;
103
- var x = v.error, j = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
104
- return x.call(
105
- v,
101
+ if (g) {
102
+ g = console;
103
+ var y = g.error, x = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
104
+ return y.call(
105
+ g,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- j
107
+ x
108
108
  ), t(u);
109
109
  }
110
110
  }
111
111
  function r(u) {
112
- if (u === C) return "<>";
113
- if (typeof u == "object" && u !== null && u.$$typeof === q)
112
+ if (u === j) return "<>";
113
+ if (typeof u == "object" && u !== null && u.$$typeof === D)
114
114
  return "<...>";
115
115
  try {
116
- var v = e(u);
117
- return v ? "<" + v + ">" : "<...>";
116
+ var g = e(u);
117
+ return g ? "<" + g + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function o() {
123
- var u = Y.A;
123
+ var u = _e.A;
124
124
  return u === null ? null : u.getOwner();
125
125
  }
126
126
  function i() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function s(u) {
130
- if (U.call(u, "key")) {
131
- var v = Object.getOwnPropertyDescriptor(u, "key").get;
132
- if (v && v.isReactWarning) return !1;
129
+ function c(u) {
130
+ if (Re.call(u, "key")) {
131
+ var g = Object.getOwnPropertyDescriptor(u, "key").get;
132
+ if (g && g.isReactWarning) return !1;
133
133
  }
134
134
  return u.key !== void 0;
135
135
  }
136
- function c(u, v) {
137
- function x() {
138
- Ue || (Ue = !0, console.error(
136
+ function s(u, g) {
137
+ function y() {
138
+ Pe || (Pe = !0, console.error(
139
139
  "%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://react.dev/link/special-props)",
140
- v
140
+ g
141
141
  ));
142
142
  }
143
- x.isReactWarning = !0, Object.defineProperty(u, "key", {
144
- get: x,
143
+ y.isReactWarning = !0, Object.defineProperty(u, "key", {
144
+ get: y,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function d() {
148
+ function f() {
149
149
  var u = e(this.type);
150
- return Fe[u] || (Fe[u] = !0, console.error(
150
+ return Ne[u] || (Ne[u] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), u = this.props.ref, u !== void 0 ? u : null;
153
153
  }
154
- function l(u, v, x, j, re, ke) {
155
- var A = x.ref;
154
+ function d(u, g, y, x, te, ve) {
155
+ var T = y.ref;
156
156
  return u = {
157
- $$typeof: T,
157
+ $$typeof: b,
158
158
  type: u,
159
- key: v,
160
- props: x,
161
- _owner: j
162
- }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(u, "ref", {
159
+ key: g,
160
+ props: y,
161
+ _owner: x
162
+ }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(u, "ref", {
163
163
  enumerable: !1,
164
- get: d
164
+ get: f
165
165
  }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
@@ -176,315 +176,363 @@ function fn() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: re
179
+ value: te
180
180
  }), Object.defineProperty(u, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: ke
184
+ value: ve
185
185
  }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
186
186
  }
187
- function f(u, v, x, j, re, ke) {
188
- var A = v.children;
189
- if (A !== void 0)
190
- if (j)
191
- if (Yt(A)) {
192
- for (j = 0; j < A.length; j++)
193
- h(A[j]);
194
- Object.freeze && Object.freeze(A);
187
+ function h(u, g, y, x, te, ve) {
188
+ var T = g.children;
189
+ if (T !== void 0)
190
+ if (x)
191
+ if (Ut(T)) {
192
+ for (x = 0; x < T.length; x++)
193
+ v(T[x]);
194
+ Object.freeze && Object.freeze(T);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else h(A);
200
- if (U.call(v, "key")) {
201
- A = e(u);
202
- var H = Object.keys(v).filter(function(Ht) {
203
- return Ht !== "key";
199
+ else v(T);
200
+ if (Re.call(g, "key")) {
201
+ T = e(u);
202
+ var Y = Object.keys(g).filter(function(Lt) {
203
+ return Lt !== "key";
204
204
  });
205
- j = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", Ve[A + j] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ x = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", Le[T + x] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
- j,
213
- A,
214
- H,
215
- A
216
- ), Ve[A + j] = !0);
212
+ x,
213
+ T,
214
+ Y,
215
+ T
216
+ ), Le[T + x] = !0);
217
217
  }
218
- if (A = null, x !== void 0 && (n(x), A = "" + x), s(v) && (n(v.key), A = "" + v.key), "key" in v) {
219
- x = {};
220
- for (var ze in v)
221
- ze !== "key" && (x[ze] = v[ze]);
222
- } else x = v;
223
- return A && c(
224
- x,
218
+ if (T = null, y !== void 0 && (n(y), T = "" + y), c(g) && (n(g.key), T = "" + g.key), "key" in g) {
219
+ y = {};
220
+ for (var be in g)
221
+ be !== "key" && (y[be] = g[be]);
222
+ } else y = g;
223
+ return T && s(
224
+ y,
225
225
  typeof u == "function" ? u.displayName || u.name || "Unknown" : u
226
- ), l(
226
+ ), d(
227
227
  u,
228
- A,
229
- x,
228
+ T,
229
+ y,
230
230
  o(),
231
- re,
232
- ke
231
+ te,
232
+ ve
233
233
  );
234
234
  }
235
- function h(u) {
236
- p(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === q && (u._payload.status === "fulfilled" ? p(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
235
+ function v(u) {
236
+ _(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === D && (u._payload.status === "fulfilled" ? _(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
237
237
  }
238
- function p(u) {
239
- return typeof u == "object" && u !== null && u.$$typeof === T;
238
+ function _(u) {
239
+ return typeof u == "object" && u !== null && u.$$typeof === b;
240
240
  }
241
- var g = Q, T = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), z = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), _e = Symbol.for("react.suspense"), ve = Symbol.for("react.suspense_list"), be = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), E = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), Y = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, Yt = Array.isArray, we = console.createTask ? console.createTask : function() {
241
+ var l = Ft, b = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), A = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), Nt = Symbol.for("react.activity"), Dt = Symbol.for("react.client.reference"), _e = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Re = Object.prototype.hasOwnProperty, Ut = Array.isArray, ge = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- g = {
244
+ l = {
245
245
  react_stack_bottom_frame: function(u) {
246
246
  return u();
247
247
  }
248
248
  };
249
- var Ue, Fe = {}, Le = g.react_stack_bottom_frame.bind(
250
- g,
249
+ var Pe, Ne = {}, De = l.react_stack_bottom_frame.bind(
250
+ l,
251
251
  i
252
- )(), Me = we(r(i)), Ve = {};
253
- K.Fragment = C, K.jsx = function(u, v, x) {
254
- var j = 1e4 > Y.recentlyCreatedOwnerStacks++;
255
- return f(
252
+ )(), Ue = ge(r(i)), Le = {};
253
+ H.Fragment = j, H.jsx = function(u, g, y) {
254
+ var x = 1e4 > _e.recentlyCreatedOwnerStacks++;
255
+ return h(
256
256
  u,
257
- v,
258
- x,
257
+ g,
258
+ y,
259
259
  !1,
260
- j ? Error("react-stack-top-frame") : Le,
261
- j ? we(r(u)) : Me
260
+ x ? Error("react-stack-top-frame") : De,
261
+ x ? ge(r(u)) : Ue
262
262
  );
263
- }, K.jsxs = function(u, v, x) {
264
- var j = 1e4 > Y.recentlyCreatedOwnerStacks++;
265
- return f(
263
+ }, H.jsxs = function(u, g, y) {
264
+ var x = 1e4 > _e.recentlyCreatedOwnerStacks++;
265
+ return h(
266
266
  u,
267
- v,
268
- x,
267
+ g,
268
+ y,
269
269
  !0,
270
- j ? Error("react-stack-top-frame") : Le,
271
- j ? we(r(u)) : Me
270
+ x ? Error("react-stack-top-frame") : De,
271
+ x ? ge(r(u)) : Ue
272
272
  );
273
273
  };
274
- })()), K;
275
- }
276
- var Ye;
277
- function hn() {
278
- return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? oe.exports = dn() : oe.exports = fn()), oe.exports;
279
- }
280
- var _ = hn();
281
- const He = (e) => {
282
- let t;
283
- const n = /* @__PURE__ */ new Set(), r = (l, f) => {
284
- const h = typeof l == "function" ? l(t) : l;
285
- if (!Object.is(h, t)) {
286
- const p = t;
287
- t = f ?? (typeof h != "object" || h === null) ? h : Object.assign({}, t, h), n.forEach((g) => g(t, p));
288
- }
289
- }, o = () => t, c = { setState: r, getState: o, getInitialState: () => d, subscribe: (l) => (n.add(l), () => n.delete(l)) }, d = t = e(r, o, c);
290
- return c;
291
- }, mn = ((e) => e ? He(e) : He), pn = (e) => e;
292
- function gn(e, t = pn) {
293
- const n = Q.useSyncExternalStore(
294
- e.subscribe,
295
- Q.useCallback(() => t(e.getState()), [e, t]),
296
- Q.useCallback(() => t(e.getInitialState()), [e, t])
297
- );
298
- return Q.useDebugValue(n), n;
274
+ })()), H;
299
275
  }
300
- const _n = (e) => {
301
- const t = mn(e), n = (r) => gn(t, r);
302
- return Object.assign(n, t), n;
303
- }, vn = ((e) => _n);
304
- function bn(e, t) {
305
- let n;
306
- try {
307
- n = e();
308
- } catch {
309
- return;
310
- }
311
- return {
312
- getItem: (o) => {
313
- var i;
314
- const s = (d) => d === null ? null : JSON.parse(d, void 0), c = (i = n.getItem(o)) != null ? i : null;
315
- return c instanceof Promise ? c.then(s) : s(c);
316
- },
317
- setItem: (o, i) => n.setItem(o, JSON.stringify(i, void 0)),
318
- removeItem: (o) => n.removeItem(o)
319
- };
276
+ var Ve;
277
+ function an() {
278
+ return Ve || (Ve = 1, process.env.NODE_ENV === "production" ? ne.exports = cn() : ne.exports = sn()), ne.exports;
320
279
  }
321
- const Ze = (e) => (t) => {
322
- try {
323
- const n = e(t);
324
- return n instanceof Promise ? n : {
325
- then(r) {
326
- return Ze(r)(n);
327
- },
328
- catch(r) {
329
- return this;
280
+ var p = an();
281
+ const un = ({
282
+ onCommand: e,
283
+ onSave: t,
284
+ onExport: n,
285
+ onClear: r,
286
+ showButtons: o = !1,
287
+ hasUnsavedChanges: i
288
+ }) => {
289
+ const [c, s] = ae([]), [f, d] = ae("p"), h = () => {
290
+ const l = [];
291
+ let b = "p";
292
+ document.queryCommandState("bold") && l.push("bold"), document.queryCommandState("italic") && l.push("italic"), document.queryCommandState("underline") && l.push("underline"), document.queryCommandState("strikeThrough") && l.push("strikeThrough"), document.queryCommandState("insertUnorderedList") && l.push("insertUnorderedList"), document.queryCommandState("insertOrderedList") && l.push("insertOrderedList"), document.queryCommandState("justifyLeft") && l.push("justifyLeft"), document.queryCommandState("justifyCenter") && l.push("justifyCenter"), document.queryCommandState("justifyRight") && l.push("justifyRight");
293
+ const R = window.getSelection();
294
+ if (R && R.rangeCount > 0) {
295
+ let j = R.getRangeAt(0).commonAncestorContainer;
296
+ for (; j && j.nodeType === Node.ELEMENT_NODE; ) {
297
+ const U = j, S = U.tagName.toLowerCase();
298
+ if (["h1", "h2", "p", "div"].includes(S)) {
299
+ S === "h1" || S === "h2" ? (b = S, l.push(`formatBlock:${S}`)) : (S === "p" || S === "div" && !b) && (b = "p");
300
+ break;
301
+ }
302
+ j = U.parentNode;
330
303
  }
304
+ }
305
+ d(b), s(l);
306
+ };
307
+ Ee(() => {
308
+ const l = () => {
309
+ h();
310
+ }, b = () => {
311
+ setTimeout(h, 10);
331
312
  };
332
- } catch (n) {
333
- return {
334
- then(r) {
335
- return this;
336
- },
337
- catch(r) {
338
- return Ze(r)(n);
339
- }
313
+ return document.addEventListener("selectionchange", l), document.addEventListener("click", b), document.addEventListener("keyup", b), () => {
314
+ document.removeEventListener("selectionchange", l), document.removeEventListener("click", b), document.removeEventListener("keyup", b);
340
315
  };
341
- }
342
- }, wn = (e, t) => (n, r, o) => {
343
- let i = {
344
- storage: bn(() => localStorage),
345
- partialize: (b) => b,
346
- version: 0,
347
- merge: (b, C) => ({
348
- ...C,
349
- ...b
350
- }),
351
- ...t
352
- }, s = !1;
353
- const c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
354
- let l = i.storage;
355
- if (!l)
356
- return e(
357
- (...b) => {
358
- console.warn(
359
- `[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`
360
- ), n(...b);
361
- },
362
- r,
363
- o
364
- );
365
- const f = () => {
366
- const b = i.partialize({ ...r() });
367
- return l.setItem(i.name, {
368
- state: b,
369
- version: i.version
370
- });
371
- }, h = o.setState;
372
- o.setState = (b, C) => (h(b, C), f());
373
- const p = e(
374
- (...b) => (n(...b), f()),
375
- r,
376
- o
377
- );
378
- o.getInitialState = () => p;
379
- let g;
380
- const T = () => {
381
- var b, C;
382
- if (!l) return;
383
- s = !1, c.forEach((k) => {
384
- var $;
385
- return k(($ = r()) != null ? $ : p);
386
- });
387
- const N = ((C = i.onRehydrateStorage) == null ? void 0 : C.call(i, (b = r()) != null ? b : p)) || void 0;
388
- return Ze(l.getItem.bind(l))(i.name).then((k) => {
389
- if (k)
390
- if (typeof k.version == "number" && k.version !== i.version) {
391
- if (i.migrate) {
392
- const $ = i.migrate(
393
- k.state,
394
- k.version
395
- );
396
- return $ instanceof Promise ? $.then((z) => [!0, z]) : [!0, $];
397
- }
398
- console.error(
399
- "State loaded from storage couldn't be migrated since no migrate function was provided"
400
- );
401
- } else
402
- return [!1, k.state];
403
- return [!1, void 0];
404
- }).then((k) => {
405
- var $;
406
- const [z, P] = k;
407
- if (g = i.merge(
408
- P,
409
- ($ = r()) != null ? $ : p
410
- ), n(g, !0), z)
411
- return f();
412
- }).then(() => {
413
- N?.(g, void 0), g = r(), s = !0, d.forEach((k) => k(g));
414
- }).catch((k) => {
415
- N?.(void 0, k);
416
- });
417
- };
418
- return o.persist = {
419
- setOptions: (b) => {
420
- i = {
421
- ...i,
422
- ...b
423
- }, b.storage && (l = b.storage);
316
+ }, []);
317
+ const v = () => {
318
+ const l = prompt("Enter URL:");
319
+ l && e("createLink", l);
320
+ }, _ = [
321
+ {
322
+ id: "bold",
323
+ command: "bold",
324
+ icon: /* @__PURE__ */ p.jsx(Yt, { size: 18 }),
325
+ title: "Bold"
326
+ },
327
+ {
328
+ id: "italic",
329
+ command: "italic",
330
+ icon: /* @__PURE__ */ p.jsx(qt, { size: 18 }),
331
+ title: "Italic"
332
+ },
333
+ {
334
+ id: "underline",
335
+ command: "underline",
336
+ icon: /* @__PURE__ */ p.jsx(Jt, { size: 18 }),
337
+ title: "Underline"
338
+ },
339
+ {
340
+ id: "strikeThrough",
341
+ command: "strikeThrough",
342
+ icon: /* @__PURE__ */ p.jsx(Gt, { size: 18 }),
343
+ title: "Strikethrough"
344
+ },
345
+ { id: "separator-1", separator: !0 },
346
+ {
347
+ id: "unordered-list",
348
+ command: "insertUnorderedList",
349
+ icon: /* @__PURE__ */ p.jsx(Ht, { size: 18 }),
350
+ title: "Bullet List"
351
+ },
352
+ {
353
+ id: "ordered-list",
354
+ command: "insertOrderedList",
355
+ icon: /* @__PURE__ */ p.jsx(Xt, { size: 18 }),
356
+ title: "Numbered List"
357
+ },
358
+ { id: "separator-2", separator: !0 },
359
+ {
360
+ id: "heading-1",
361
+ command: "formatBlock",
362
+ value: "h1",
363
+ icon: /* @__PURE__ */ p.jsx(Kt, { size: 18 }),
364
+ title: "Heading 1",
365
+ isActive: f === "h1"
424
366
  },
425
- clearStorage: () => {
426
- l?.removeItem(i.name);
367
+ {
368
+ id: "heading-2",
369
+ command: "formatBlock",
370
+ value: "h2",
371
+ icon: /* @__PURE__ */ p.jsx(Qt, { size: 18 }),
372
+ title: "Heading 2",
373
+ isActive: f === "h2"
374
+ },
375
+ {
376
+ id: "paragraph",
377
+ command: "formatBlock",
378
+ value: "p",
379
+ icon: /* @__PURE__ */ p.jsx(en, { size: 18 }),
380
+ title: "Paragraph",
381
+ isActive: f === "p"
427
382
  },
428
- getOptions: () => i,
429
- rehydrate: () => T(),
430
- hasHydrated: () => s,
431
- onHydrate: (b) => (c.add(b), () => {
432
- c.delete(b);
433
- }),
434
- onFinishHydration: (b) => (d.add(b), () => {
435
- d.delete(b);
436
- })
437
- }, i.skipHydration || T(), g || p;
438
- }, kn = wn;
383
+ { id: "separator-3", separator: !0 },
384
+ {
385
+ id: "align-left",
386
+ command: "justifyLeft",
387
+ icon: /* @__PURE__ */ p.jsx(tn, { size: 18 }),
388
+ title: "Align Left"
389
+ },
390
+ {
391
+ id: "align-center",
392
+ command: "justifyCenter",
393
+ icon: /* @__PURE__ */ p.jsx(nn, { size: 18 }),
394
+ title: "Center"
395
+ },
396
+ {
397
+ id: "align-right",
398
+ command: "justifyRight",
399
+ icon: /* @__PURE__ */ p.jsx(rn, { size: 18 }),
400
+ title: "Align Right"
401
+ },
402
+ { id: "separator-4", separator: !0 },
403
+ {
404
+ id: "link",
405
+ command: "createLink",
406
+ icon: /* @__PURE__ */ p.jsx(on, { size: 18 }),
407
+ title: "Insert Link",
408
+ onClick: v
409
+ }
410
+ ];
411
+ return /* @__PURE__ */ p.jsxs("div", { className: "flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200", children: [
412
+ /* @__PURE__ */ p.jsx("div", { className: "flex flex-wrap items-center gap-1", children: _.map((l) => {
413
+ if ("separator" in l)
414
+ return /* @__PURE__ */ p.jsx("div", { className: "w-px h-6 bg-gray-300 mx-2" }, l.id);
415
+ const b = l.isActive !== void 0 ? l.isActive : c.includes(l.command);
416
+ return /* @__PURE__ */ p.jsx(
417
+ "button",
418
+ {
419
+ onClick: () => l.onClick ? l.onClick() : e(l.command, l.value),
420
+ title: l.title,
421
+ type: "button",
422
+ className: `w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
423
+ ${b ? "bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,
424
+ children: l.icon
425
+ },
426
+ l.id
427
+ );
428
+ }) }),
429
+ o && /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-2 mt-2 sm:mt-0", children: [
430
+ /* @__PURE__ */ p.jsxs(
431
+ "button",
432
+ {
433
+ onClick: t,
434
+ disabled: !i,
435
+ title: "Save Document",
436
+ className: "flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",
437
+ children: [
438
+ /* @__PURE__ */ p.jsx(Vt, { size: 16 }),
439
+ /* @__PURE__ */ p.jsx("span", { children: "Save" })
440
+ ]
441
+ }
442
+ ),
443
+ /* @__PURE__ */ p.jsxs(
444
+ "button",
445
+ {
446
+ onClick: n,
447
+ title: "Export as HTML",
448
+ className: "flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",
449
+ children: [
450
+ /* @__PURE__ */ p.jsx(Wt, { size: 16 }),
451
+ /* @__PURE__ */ p.jsx("span", { children: "Export" })
452
+ ]
453
+ }
454
+ ),
455
+ /* @__PURE__ */ p.jsxs(
456
+ "button",
457
+ {
458
+ onClick: r,
459
+ title: "Clear Editor",
460
+ className: "flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",
461
+ children: [
462
+ /* @__PURE__ */ p.jsx(Bt, { size: 16 }),
463
+ /* @__PURE__ */ p.jsx("span", { children: "Clear" })
464
+ ]
465
+ }
466
+ )
467
+ ] })
468
+ ] });
469
+ }, ln = ({
470
+ wordCount: e,
471
+ characterCount: t,
472
+ hasUnsavedChanges: n
473
+ }) => /* @__PURE__ */ p.jsx("div", { className: "flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600", children: /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-6", children: [
474
+ /* @__PURE__ */ p.jsxs("div", { children: [
475
+ "Words: ",
476
+ /* @__PURE__ */ p.jsx("strong", { className: "text-gray-800", children: e })
477
+ ] }),
478
+ /* @__PURE__ */ p.jsxs("div", { children: [
479
+ "Characters: ",
480
+ /* @__PURE__ */ p.jsx("strong", { className: "text-gray-800", children: t })
481
+ ] }),
482
+ /* @__PURE__ */ p.jsxs("div", { children: [
483
+ "Status: ",
484
+ /* @__PURE__ */ p.jsx("strong", { className: n ? "text-orange-600" : "text-green-600", children: n ? "Unsaved Changes" : "Saved" })
485
+ ] })
486
+ ] }) });
439
487
  function a(e, t, n) {
440
- function r(c, d) {
441
- var l;
442
- Object.defineProperty(c, "_zod", {
443
- value: c._zod ?? {},
488
+ function r(s, f) {
489
+ var d;
490
+ Object.defineProperty(s, "_zod", {
491
+ value: s._zod ?? {},
444
492
  enumerable: !1
445
- }), (l = c._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(e), t(c, d);
446
- for (const f in s.prototype)
447
- f in c || Object.defineProperty(c, f, { value: s.prototype[f].bind(c) });
448
- c._zod.constr = s, c._zod.def = d;
493
+ }), (d = s._zod).traits ?? (d.traits = /* @__PURE__ */ new Set()), s._zod.traits.add(e), t(s, f);
494
+ for (const h in c.prototype)
495
+ h in s || Object.defineProperty(s, h, { value: c.prototype[h].bind(s) });
496
+ s._zod.constr = c, s._zod.def = f;
449
497
  }
450
498
  const o = n?.Parent ?? Object;
451
499
  class i extends o {
452
500
  }
453
501
  Object.defineProperty(i, "name", { value: e });
454
- function s(c) {
455
- var d;
456
- const l = n?.Parent ? new i() : this;
457
- r(l, c), (d = l._zod).deferred ?? (d.deferred = []);
458
- for (const f of l._zod.deferred)
459
- f();
460
- return l;
502
+ function c(s) {
503
+ var f;
504
+ const d = n?.Parent ? new i() : this;
505
+ r(d, s), (f = d._zod).deferred ?? (f.deferred = []);
506
+ for (const h of d._zod.deferred)
507
+ h();
508
+ return d;
461
509
  }
462
- return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
463
- value: (c) => n?.Parent && c instanceof n.Parent ? !0 : c?._zod?.traits?.has(e)
464
- }), Object.defineProperty(s, "name", { value: e }), s;
510
+ return Object.defineProperty(c, "init", { value: r }), Object.defineProperty(c, Symbol.hasInstance, {
511
+ value: (s) => n?.Parent && s instanceof n.Parent ? !0 : s?._zod?.traits?.has(e)
512
+ }), Object.defineProperty(c, "name", { value: e }), c;
465
513
  }
466
- class G extends Error {
514
+ class J extends Error {
467
515
  constructor() {
468
516
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
469
517
  }
470
518
  }
471
- class wt extends Error {
519
+ class ht extends Error {
472
520
  constructor(t) {
473
521
  super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
474
522
  }
475
523
  }
476
- const kt = {};
524
+ const mt = {};
477
525
  function M(e) {
478
- return kt;
526
+ return mt;
479
527
  }
480
- function zn(e) {
528
+ function dn(e) {
481
529
  const t = Object.values(e).filter((r) => typeof r == "number");
482
530
  return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
483
531
  }
484
- function Ee(e, t) {
532
+ function ze(e, t) {
485
533
  return typeof t == "bigint" ? t.toString() : t;
486
534
  }
487
- function je(e) {
535
+ function xe(e) {
488
536
  return {
489
537
  get value() {
490
538
  {
@@ -494,30 +542,30 @@ function je(e) {
494
542
  }
495
543
  };
496
544
  }
497
- function Ae(e) {
545
+ function Te(e) {
498
546
  return e == null;
499
547
  }
500
- function Ce(e) {
548
+ function Ae(e) {
501
549
  const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
502
550
  return e.slice(t, n);
503
551
  }
504
- function yn(e, t) {
552
+ function fn(e, t) {
505
553
  const n = (e.toString().split(".")[1] || "").length, r = t.toString();
506
554
  let o = (r.split(".")[1] || "").length;
507
555
  if (o === 0 && /\d?e-\d?/.test(r)) {
508
- const d = r.match(/\d?e-(\d?)/);
509
- d?.[1] && (o = Number.parseInt(d[1]));
556
+ const f = r.match(/\d?e-(\d?)/);
557
+ f?.[1] && (o = Number.parseInt(f[1]));
510
558
  }
511
- const i = n > o ? n : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), c = Number.parseInt(t.toFixed(i).replace(".", ""));
512
- return s % c / 10 ** i;
559
+ const i = n > o ? n : o, c = Number.parseInt(e.toFixed(i).replace(".", "")), s = Number.parseInt(t.toFixed(i).replace(".", ""));
560
+ return c % s / 10 ** i;
513
561
  }
514
- const Je = Symbol("evaluating");
562
+ const We = Symbol("evaluating");
515
563
  function w(e, t, n) {
516
564
  let r;
517
565
  Object.defineProperty(e, t, {
518
566
  get() {
519
- if (r !== Je)
520
- return r === void 0 && (r = Je, r = n()), r;
567
+ if (r !== We)
568
+ return r === void 0 && (r = We, r = n()), r;
521
569
  },
522
570
  set(o) {
523
571
  Object.defineProperty(e, t, {
@@ -544,15 +592,15 @@ function B(...e) {
544
592
  }
545
593
  return Object.defineProperties({}, t);
546
594
  }
547
- function Ge(e) {
595
+ function Be(e) {
548
596
  return JSON.stringify(e);
549
597
  }
550
- const zt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
598
+ const pt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
551
599
  };
552
- function le(e) {
600
+ function ue(e) {
553
601
  return typeof e == "object" && e !== null && !Array.isArray(e);
554
602
  }
555
- const $n = je(() => {
603
+ const hn = xe(() => {
556
604
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
557
605
  return !1;
558
606
  try {
@@ -562,20 +610,20 @@ const $n = je(() => {
562
610
  return !1;
563
611
  }
564
612
  });
565
- function ee(e) {
566
- if (le(e) === !1)
613
+ function X(e) {
614
+ if (ue(e) === !1)
567
615
  return !1;
568
616
  const t = e.constructor;
569
617
  if (t === void 0)
570
618
  return !0;
571
619
  const n = t.prototype;
572
- return !(le(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
620
+ return !(ue(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
573
621
  }
574
- function yt(e) {
575
- return ee(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
622
+ function _t(e) {
623
+ return X(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
576
624
  }
577
- const Zn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
578
- function he(e) {
625
+ const mn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
626
+ function fe(e) {
579
627
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
580
628
  }
581
629
  function L(e, t, n) {
@@ -595,17 +643,17 @@ function m(e) {
595
643
  }
596
644
  return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
597
645
  }
598
- function En(e) {
646
+ function pn(e) {
599
647
  return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
600
648
  }
601
- const xn = {
649
+ const _n = {
602
650
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
603
651
  int32: [-2147483648, 2147483647],
604
652
  uint32: [0, 4294967295],
605
653
  float32: [-34028234663852886e22, 34028234663852886e22],
606
654
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
607
655
  };
608
- function Tn(e, t) {
656
+ function gn(e, t) {
609
657
  const n = e._zod.def, r = B(e._zod.def, {
610
658
  get shape() {
611
659
  const o = {};
@@ -620,7 +668,7 @@ function Tn(e, t) {
620
668
  });
621
669
  return L(e, r);
622
670
  }
623
- function Sn(e, t) {
671
+ function vn(e, t) {
624
672
  const n = e._zod.def, r = B(e._zod.def, {
625
673
  get shape() {
626
674
  const o = { ...e._zod.def.shape };
@@ -635,8 +683,8 @@ function Sn(e, t) {
635
683
  });
636
684
  return L(e, r);
637
685
  }
638
- function In(e, t) {
639
- if (!ee(t))
686
+ function bn(e, t) {
687
+ if (!X(t))
640
688
  throw new Error("Invalid input to extend: expected a plain object");
641
689
  const n = e._zod.def.checks;
642
690
  if (n && n.length > 0)
@@ -650,8 +698,8 @@ function In(e, t) {
650
698
  });
651
699
  return L(e, o);
652
700
  }
653
- function jn(e, t) {
654
- if (!ee(t))
701
+ function wn(e, t) {
702
+ if (!X(t))
655
703
  throw new Error("Invalid input to safeExtend: expected a plain object");
656
704
  const n = {
657
705
  ...e._zod.def,
@@ -663,7 +711,7 @@ function jn(e, t) {
663
711
  };
664
712
  return L(e, n);
665
713
  }
666
- function An(e, t) {
714
+ function kn(e, t) {
667
715
  const n = B(e._zod.def, {
668
716
  get shape() {
669
717
  const r = { ...e._zod.def.shape, ...t._zod.def.shape };
@@ -677,49 +725,49 @@ function An(e, t) {
677
725
  });
678
726
  return L(e, n);
679
727
  }
680
- function Cn(e, t, n) {
728
+ function zn(e, t, n) {
681
729
  const r = B(t._zod.def, {
682
730
  get shape() {
683
731
  const o = t._zod.def.shape, i = { ...o };
684
732
  if (n)
685
- for (const s in n) {
686
- if (!(s in o))
687
- throw new Error(`Unrecognized key: "${s}"`);
688
- n[s] && (i[s] = e ? new e({
733
+ for (const c in n) {
734
+ if (!(c in o))
735
+ throw new Error(`Unrecognized key: "${c}"`);
736
+ n[c] && (i[c] = e ? new e({
689
737
  type: "optional",
690
- innerType: o[s]
691
- }) : o[s]);
738
+ innerType: o[c]
739
+ }) : o[c]);
692
740
  }
693
741
  else
694
- for (const s in o)
695
- i[s] = e ? new e({
742
+ for (const c in o)
743
+ i[c] = e ? new e({
696
744
  type: "optional",
697
- innerType: o[s]
698
- }) : o[s];
745
+ innerType: o[c]
746
+ }) : o[c];
699
747
  return W(this, "shape", i), i;
700
748
  },
701
749
  checks: []
702
750
  });
703
751
  return L(t, r);
704
752
  }
705
- function On(e, t, n) {
753
+ function yn(e, t, n) {
706
754
  const r = B(t._zod.def, {
707
755
  get shape() {
708
756
  const o = t._zod.def.shape, i = { ...o };
709
757
  if (n)
710
- for (const s in n) {
711
- if (!(s in i))
712
- throw new Error(`Unrecognized key: "${s}"`);
713
- n[s] && (i[s] = new e({
758
+ for (const c in n) {
759
+ if (!(c in i))
760
+ throw new Error(`Unrecognized key: "${c}"`);
761
+ n[c] && (i[c] = new e({
714
762
  type: "nonoptional",
715
- innerType: o[s]
763
+ innerType: o[c]
716
764
  }));
717
765
  }
718
766
  else
719
- for (const s in o)
720
- i[s] = new e({
767
+ for (const c in o)
768
+ i[c] = new e({
721
769
  type: "nonoptional",
722
- innerType: o[s]
770
+ innerType: o[c]
723
771
  });
724
772
  return W(this, "shape", i), i;
725
773
  },
@@ -727,7 +775,7 @@ function On(e, t, n) {
727
775
  });
728
776
  return L(t, r);
729
777
  }
730
- function J(e, t = 0) {
778
+ function q(e, t = 0) {
731
779
  if (e.aborted === !0)
732
780
  return !0;
733
781
  for (let n = t; n < e.issues.length; n++)
@@ -735,27 +783,27 @@ function J(e, t = 0) {
735
783
  return !0;
736
784
  return !1;
737
785
  }
738
- function $t(e, t) {
786
+ function gt(e, t) {
739
787
  return t.map((n) => {
740
788
  var r;
741
789
  return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
742
790
  });
743
791
  }
744
- function ie(e) {
792
+ function re(e) {
745
793
  return typeof e == "string" ? e : e?.message;
746
794
  }
747
795
  function V(e, t, n) {
748
796
  const r = { ...e, path: e.path ?? [] };
749
797
  if (!e.message) {
750
- const o = ie(e.inst?._zod.def?.error?.(e)) ?? ie(t?.error?.(e)) ?? ie(n.customError?.(e)) ?? ie(n.localeError?.(e)) ?? "Invalid input";
798
+ const o = re(e.inst?._zod.def?.error?.(e)) ?? re(t?.error?.(e)) ?? re(n.customError?.(e)) ?? re(n.localeError?.(e)) ?? "Invalid input";
751
799
  r.message = o;
752
800
  }
753
801
  return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
754
802
  }
755
- function Oe(e) {
803
+ function je(e) {
756
804
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
757
805
  }
758
- function te(...e) {
806
+ function K(...e) {
759
807
  const [t, n, r] = e;
760
808
  return typeof t == "string" ? {
761
809
  message: t,
@@ -764,122 +812,122 @@ function te(...e) {
764
812
  inst: r
765
813
  } : { ...t };
766
814
  }
767
- const Zt = (e, t) => {
815
+ const vt = (e, t) => {
768
816
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
769
817
  value: e._zod,
770
818
  enumerable: !1
771
819
  }), Object.defineProperty(e, "issues", {
772
820
  value: t,
773
821
  enumerable: !1
774
- }), e.message = JSON.stringify(t, Ee, 2), Object.defineProperty(e, "toString", {
822
+ }), e.message = JSON.stringify(t, ze, 2), Object.defineProperty(e, "toString", {
775
823
  value: () => e.message,
776
824
  enumerable: !1
777
825
  });
778
- }, Et = a("$ZodError", Zt), xt = a("$ZodError", Zt, { Parent: Error });
779
- function Rn(e, t = (n) => n.message) {
826
+ }, bt = a("$ZodError", vt), wt = a("$ZodError", vt, { Parent: Error });
827
+ function $n(e, t = (n) => n.message) {
780
828
  const n = {}, r = [];
781
829
  for (const o of e.issues)
782
830
  o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
783
831
  return { formErrors: r, fieldErrors: n };
784
832
  }
785
- function Pn(e, t) {
833
+ function Zn(e, t) {
786
834
  const n = t || function(i) {
787
835
  return i.message;
788
836
  }, r = { _errors: [] }, o = (i) => {
789
- for (const s of i.issues)
790
- if (s.code === "invalid_union" && s.errors.length)
791
- s.errors.map((c) => o({ issues: c }));
792
- else if (s.code === "invalid_key")
793
- o({ issues: s.issues });
794
- else if (s.code === "invalid_element")
795
- o({ issues: s.issues });
796
- else if (s.path.length === 0)
797
- r._errors.push(n(s));
837
+ for (const c of i.issues)
838
+ if (c.code === "invalid_union" && c.errors.length)
839
+ c.errors.map((s) => o({ issues: s }));
840
+ else if (c.code === "invalid_key")
841
+ o({ issues: c.issues });
842
+ else if (c.code === "invalid_element")
843
+ o({ issues: c.issues });
844
+ else if (c.path.length === 0)
845
+ r._errors.push(n(c));
798
846
  else {
799
- let c = r, d = 0;
800
- for (; d < s.path.length; ) {
801
- const l = s.path[d];
802
- d === s.path.length - 1 ? (c[l] = c[l] || { _errors: [] }, c[l]._errors.push(n(s))) : c[l] = c[l] || { _errors: [] }, c = c[l], d++;
847
+ let s = r, f = 0;
848
+ for (; f < c.path.length; ) {
849
+ const d = c.path[f];
850
+ f === c.path.length - 1 ? (s[d] = s[d] || { _errors: [] }, s[d]._errors.push(n(c))) : s[d] = s[d] || { _errors: [] }, s = s[d], f++;
803
851
  }
804
852
  }
805
853
  };
806
854
  return o(e), r;
807
855
  }
808
- const Re = (e) => (t, n, r, o) => {
809
- const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
810
- if (s instanceof Promise)
811
- throw new G();
812
- if (s.issues.length) {
813
- const c = new (o?.Err ?? e)(s.issues.map((d) => V(d, i, M())));
814
- throw zt(c, o?.callee), c;
856
+ const Ie = (e) => (t, n, r, o) => {
857
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, i);
858
+ if (c instanceof Promise)
859
+ throw new J();
860
+ if (c.issues.length) {
861
+ const s = new (o?.Err ?? e)(c.issues.map((f) => V(f, i, M())));
862
+ throw pt(s, o?.callee), s;
815
863
  }
816
- return s.value;
817
- }, Pe = (e) => async (t, n, r, o) => {
864
+ return c.value;
865
+ }, Se = (e) => async (t, n, r, o) => {
818
866
  const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
819
- let s = t._zod.run({ value: n, issues: [] }, i);
820
- if (s instanceof Promise && (s = await s), s.issues.length) {
821
- const c = new (o?.Err ?? e)(s.issues.map((d) => V(d, i, M())));
822
- throw zt(c, o?.callee), c;
867
+ let c = t._zod.run({ value: n, issues: [] }, i);
868
+ if (c instanceof Promise && (c = await c), c.issues.length) {
869
+ const s = new (o?.Err ?? e)(c.issues.map((f) => V(f, i, M())));
870
+ throw pt(s, o?.callee), s;
823
871
  }
824
- return s.value;
825
- }, me = (e) => (t, n, r) => {
872
+ return c.value;
873
+ }, he = (e) => (t, n, r) => {
826
874
  const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
827
875
  if (i instanceof Promise)
828
- throw new G();
876
+ throw new J();
829
877
  return i.issues.length ? {
830
878
  success: !1,
831
- error: new (e ?? Et)(i.issues.map((s) => V(s, o, M())))
879
+ error: new (e ?? bt)(i.issues.map((c) => V(c, o, M())))
832
880
  } : { success: !0, data: i.value };
833
- }, Nn = /* @__PURE__ */ me(xt), pe = (e) => async (t, n, r) => {
881
+ }, En = /* @__PURE__ */ he(wt), me = (e) => async (t, n, r) => {
834
882
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
835
883
  let i = t._zod.run({ value: n, issues: [] }, o);
836
884
  return i instanceof Promise && (i = await i), i.issues.length ? {
837
885
  success: !1,
838
- error: new e(i.issues.map((s) => V(s, o, M())))
886
+ error: new e(i.issues.map((c) => V(c, o, M())))
839
887
  } : { success: !0, data: i.value };
840
- }, Dn = /* @__PURE__ */ pe(xt), Un = (e) => (t, n, r) => {
888
+ }, xn = /* @__PURE__ */ me(wt), Tn = (e) => (t, n, r) => {
841
889
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
842
- return Re(e)(t, n, o);
843
- }, Fn = (e) => (t, n, r) => Re(e)(t, n, r), Ln = (e) => async (t, n, r) => {
890
+ return Ie(e)(t, n, o);
891
+ }, An = (e) => (t, n, r) => Ie(e)(t, n, r), jn = (e) => async (t, n, r) => {
844
892
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
845
- return Pe(e)(t, n, o);
846
- }, Mn = (e) => async (t, n, r) => Pe(e)(t, n, r), Vn = (e) => (t, n, r) => {
893
+ return Se(e)(t, n, o);
894
+ }, In = (e) => async (t, n, r) => Se(e)(t, n, r), Sn = (e) => (t, n, r) => {
847
895
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
848
- return me(e)(t, n, o);
849
- }, Wn = (e) => (t, n, r) => me(e)(t, n, r), Bn = (e) => async (t, n, r) => {
896
+ return he(e)(t, n, o);
897
+ }, Cn = (e) => (t, n, r) => he(e)(t, n, r), On = (e) => async (t, n, r) => {
850
898
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
851
- return pe(e)(t, n, o);
852
- }, Yn = (e) => async (t, n, r) => pe(e)(t, n, r), Hn = /^[cC][^\s-]{8,}$/, Jn = /^[0-9a-z]+$/, Gn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, qn = /^[0-9a-vA-V]{20}$/, Xn = /^[A-Za-z0-9]{27}$/, Kn = /^[a-zA-Z0-9_-]{21}$/, Qn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, er = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, qe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, tr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, nr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
853
- function rr() {
854
- return new RegExp(nr, "u");
899
+ return me(e)(t, n, o);
900
+ }, Rn = (e) => async (t, n, r) => me(e)(t, n, r), Pn = /^[cC][^\s-]{8,}$/, Nn = /^[0-9a-z]+$/, Dn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Un = /^[0-9a-vA-V]{20}$/, Ln = /^[A-Za-z0-9]{27}$/, Fn = /^[a-zA-Z0-9_-]{21}$/, Mn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Vn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Ye = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Wn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Bn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
901
+ function Yn() {
902
+ return new RegExp(Bn, "u");
855
903
  }
856
- const or = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ir = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, sr = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ar = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Tt = /^[A-Za-z0-9_-]*$/, ur = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, lr = /^\+(?:[0-9]){6,14}[0-9]$/, St = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", dr = /* @__PURE__ */ new RegExp(`^${St}$`);
857
- function It(e) {
904
+ const qn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Jn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Gn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, kt = /^[A-Za-z0-9_-]*$/, Kn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Qn = /^\+(?:[0-9]){6,14}[0-9]$/, zt = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", er = /* @__PURE__ */ new RegExp(`^${zt}$`);
905
+ function yt(e) {
858
906
  const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
859
907
  return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
860
908
  }
861
- function fr(e) {
862
- return new RegExp(`^${It(e)}$`);
909
+ function tr(e) {
910
+ return new RegExp(`^${yt(e)}$`);
863
911
  }
864
- function hr(e) {
865
- const t = It({ precision: e.precision }), n = ["Z"];
912
+ function nr(e) {
913
+ const t = yt({ precision: e.precision }), n = ["Z"];
866
914
  e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
867
915
  const r = `${t}(?:${n.join("|")})`;
868
- return new RegExp(`^${St}T(?:${r})$`);
916
+ return new RegExp(`^${zt}T(?:${r})$`);
869
917
  }
870
- const mr = (e) => {
918
+ const rr = (e) => {
871
919
  const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
872
920
  return new RegExp(`^${t}$`);
873
- }, pr = /^-?\d+$/, gr = /^-?\d+(?:\.\d+)?/, _r = /^(?:true|false)$/i, vr = /^[^A-Z]*$/, br = /^[^a-z]*$/, O = /* @__PURE__ */ a("$ZodCheck", (e, t) => {
921
+ }, or = /^-?\d+$/, ir = /^-?\d+(?:\.\d+)?/, cr = /^(?:true|false)$/i, sr = /^[^A-Z]*$/, ar = /^[^a-z]*$/, I = /* @__PURE__ */ a("$ZodCheck", (e, t) => {
874
922
  var n;
875
923
  e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
876
- }), jt = {
924
+ }), $t = {
877
925
  number: "number",
878
926
  bigint: "bigint",
879
927
  object: "date"
880
- }, At = /* @__PURE__ */ a("$ZodCheckLessThan", (e, t) => {
881
- O.init(e, t);
882
- const n = jt[typeof t.value];
928
+ }, Zt = /* @__PURE__ */ a("$ZodCheckLessThan", (e, t) => {
929
+ I.init(e, t);
930
+ const n = $t[typeof t.value];
883
931
  e._zod.onattach.push((r) => {
884
932
  const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
885
933
  t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
@@ -894,9 +942,9 @@ const mr = (e) => {
894
942
  continue: !t.abort
895
943
  });
896
944
  };
897
- }), Ct = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, t) => {
898
- O.init(e, t);
899
- const n = jt[typeof t.value];
945
+ }), Et = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, t) => {
946
+ I.init(e, t);
947
+ const n = $t[typeof t.value];
900
948
  e._zod.onattach.push((r) => {
901
949
  const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
902
950
  t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
@@ -911,14 +959,14 @@ const mr = (e) => {
911
959
  continue: !t.abort
912
960
  });
913
961
  };
914
- }), wr = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, t) => {
915
- O.init(e, t), e._zod.onattach.push((n) => {
962
+ }), ur = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, t) => {
963
+ I.init(e, t), e._zod.onattach.push((n) => {
916
964
  var r;
917
965
  (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
918
966
  }), e._zod.check = (n) => {
919
967
  if (typeof n.value != typeof t.value)
920
968
  throw new Error("Cannot mix number and bigint in multiple_of check.");
921
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : yn(n.value, t.value) === 0) || n.issues.push({
969
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : fn(n.value, t.value) === 0) || n.issues.push({
922
970
  origin: typeof n.value,
923
971
  code: "not_multiple_of",
924
972
  divisor: t.value,
@@ -927,37 +975,37 @@ const mr = (e) => {
927
975
  continue: !t.abort
928
976
  });
929
977
  };
930
- }), kr = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, t) => {
931
- O.init(e, t), t.format = t.format || "float64";
932
- const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = xn[t.format];
933
- e._zod.onattach.push((s) => {
934
- const c = s._zod.bag;
935
- c.format = t.format, c.minimum = o, c.maximum = i, n && (c.pattern = pr);
936
- }), e._zod.check = (s) => {
937
- const c = s.value;
978
+ }), lr = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, t) => {
979
+ I.init(e, t), t.format = t.format || "float64";
980
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = _n[t.format];
981
+ e._zod.onattach.push((c) => {
982
+ const s = c._zod.bag;
983
+ s.format = t.format, s.minimum = o, s.maximum = i, n && (s.pattern = or);
984
+ }), e._zod.check = (c) => {
985
+ const s = c.value;
938
986
  if (n) {
939
- if (!Number.isInteger(c)) {
940
- s.issues.push({
987
+ if (!Number.isInteger(s)) {
988
+ c.issues.push({
941
989
  expected: r,
942
990
  format: t.format,
943
991
  code: "invalid_type",
944
992
  continue: !1,
945
- input: c,
993
+ input: s,
946
994
  inst: e
947
995
  });
948
996
  return;
949
997
  }
950
- if (!Number.isSafeInteger(c)) {
951
- c > 0 ? s.issues.push({
952
- input: c,
998
+ if (!Number.isSafeInteger(s)) {
999
+ s > 0 ? c.issues.push({
1000
+ input: s,
953
1001
  code: "too_big",
954
1002
  maximum: Number.MAX_SAFE_INTEGER,
955
1003
  note: "Integers must be within the safe integer range.",
956
1004
  inst: e,
957
1005
  origin: r,
958
1006
  continue: !t.abort
959
- }) : s.issues.push({
960
- input: c,
1007
+ }) : c.issues.push({
1008
+ input: s,
961
1009
  code: "too_small",
962
1010
  minimum: Number.MIN_SAFE_INTEGER,
963
1011
  note: "Integers must be within the safe integer range.",
@@ -968,27 +1016,27 @@ const mr = (e) => {
968
1016
  return;
969
1017
  }
970
1018
  }
971
- c < o && s.issues.push({
1019
+ s < o && c.issues.push({
972
1020
  origin: "number",
973
- input: c,
1021
+ input: s,
974
1022
  code: "too_small",
975
1023
  minimum: o,
976
1024
  inclusive: !0,
977
1025
  inst: e,
978
1026
  continue: !t.abort
979
- }), c > i && s.issues.push({
1027
+ }), s > i && c.issues.push({
980
1028
  origin: "number",
981
- input: c,
1029
+ input: s,
982
1030
  code: "too_big",
983
1031
  maximum: i,
984
1032
  inst: e
985
1033
  });
986
1034
  };
987
- }), zr = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, t) => {
1035
+ }), dr = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, t) => {
988
1036
  var n;
989
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1037
+ I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
990
1038
  const o = r.value;
991
- return !Ae(o) && o.length !== void 0;
1039
+ return !Te(o) && o.length !== void 0;
992
1040
  }), e._zod.onattach.push((r) => {
993
1041
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
994
1042
  t.maximum < o && (r._zod.bag.maximum = t.maximum);
@@ -996,9 +1044,9 @@ const mr = (e) => {
996
1044
  const o = r.value;
997
1045
  if (o.length <= t.maximum)
998
1046
  return;
999
- const s = Oe(o);
1047
+ const c = je(o);
1000
1048
  r.issues.push({
1001
- origin: s,
1049
+ origin: c,
1002
1050
  code: "too_big",
1003
1051
  maximum: t.maximum,
1004
1052
  inclusive: !0,
@@ -1007,11 +1055,11 @@ const mr = (e) => {
1007
1055
  continue: !t.abort
1008
1056
  });
1009
1057
  };
1010
- }), yr = /* @__PURE__ */ a("$ZodCheckMinLength", (e, t) => {
1058
+ }), fr = /* @__PURE__ */ a("$ZodCheckMinLength", (e, t) => {
1011
1059
  var n;
1012
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1060
+ I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1013
1061
  const o = r.value;
1014
- return !Ae(o) && o.length !== void 0;
1062
+ return !Te(o) && o.length !== void 0;
1015
1063
  }), e._zod.onattach.push((r) => {
1016
1064
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1017
1065
  t.minimum > o && (r._zod.bag.minimum = t.minimum);
@@ -1019,9 +1067,9 @@ const mr = (e) => {
1019
1067
  const o = r.value;
1020
1068
  if (o.length >= t.minimum)
1021
1069
  return;
1022
- const s = Oe(o);
1070
+ const c = je(o);
1023
1071
  r.issues.push({
1024
- origin: s,
1072
+ origin: c,
1025
1073
  code: "too_small",
1026
1074
  minimum: t.minimum,
1027
1075
  inclusive: !0,
@@ -1030,11 +1078,11 @@ const mr = (e) => {
1030
1078
  continue: !t.abort
1031
1079
  });
1032
1080
  };
1033
- }), $r = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, t) => {
1081
+ }), hr = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, t) => {
1034
1082
  var n;
1035
- O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1083
+ I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1036
1084
  const o = r.value;
1037
- return !Ae(o) && o.length !== void 0;
1085
+ return !Te(o) && o.length !== void 0;
1038
1086
  }), e._zod.onattach.push((r) => {
1039
1087
  const o = r._zod.bag;
1040
1088
  o.minimum = t.length, o.maximum = t.length, o.length = t.length;
@@ -1042,10 +1090,10 @@ const mr = (e) => {
1042
1090
  const o = r.value, i = o.length;
1043
1091
  if (i === t.length)
1044
1092
  return;
1045
- const s = Oe(o), c = i > t.length;
1093
+ const c = je(o), s = i > t.length;
1046
1094
  r.issues.push({
1047
- origin: s,
1048
- ...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1095
+ origin: c,
1096
+ ...s ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1049
1097
  inclusive: !0,
1050
1098
  exact: !0,
1051
1099
  input: r.value,
@@ -1053,9 +1101,9 @@ const mr = (e) => {
1053
1101
  continue: !t.abort
1054
1102
  });
1055
1103
  };
1056
- }), ge = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, t) => {
1104
+ }), pe = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, t) => {
1057
1105
  var n, r;
1058
- O.init(e, t), e._zod.onattach.push((o) => {
1106
+ I.init(e, t), e._zod.onattach.push((o) => {
1059
1107
  const i = o._zod.bag;
1060
1108
  i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
1061
1109
  }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
@@ -1070,8 +1118,8 @@ const mr = (e) => {
1070
1118
  });
1071
1119
  }) : (r = e._zod).check ?? (r.check = () => {
1072
1120
  });
1073
- }), Zr = /* @__PURE__ */ a("$ZodCheckRegex", (e, t) => {
1074
- ge.init(e, t), e._zod.check = (n) => {
1121
+ }), mr = /* @__PURE__ */ a("$ZodCheckRegex", (e, t) => {
1122
+ pe.init(e, t), e._zod.check = (n) => {
1075
1123
  t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
1076
1124
  origin: "string",
1077
1125
  code: "invalid_format",
@@ -1082,13 +1130,13 @@ const mr = (e) => {
1082
1130
  continue: !t.abort
1083
1131
  });
1084
1132
  };
1085
- }), Er = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, t) => {
1086
- t.pattern ?? (t.pattern = vr), ge.init(e, t);
1087
- }), xr = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, t) => {
1088
- t.pattern ?? (t.pattern = br), ge.init(e, t);
1089
- }), Tr = /* @__PURE__ */ a("$ZodCheckIncludes", (e, t) => {
1090
- O.init(e, t);
1091
- const n = he(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1133
+ }), pr = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, t) => {
1134
+ t.pattern ?? (t.pattern = sr), pe.init(e, t);
1135
+ }), _r = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, t) => {
1136
+ t.pattern ?? (t.pattern = ar), pe.init(e, t);
1137
+ }), gr = /* @__PURE__ */ a("$ZodCheckIncludes", (e, t) => {
1138
+ I.init(e, t);
1139
+ const n = fe(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1092
1140
  t.pattern = r, e._zod.onattach.push((o) => {
1093
1141
  const i = o._zod.bag;
1094
1142
  i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
@@ -1103,9 +1151,9 @@ const mr = (e) => {
1103
1151
  continue: !t.abort
1104
1152
  });
1105
1153
  };
1106
- }), Sr = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, t) => {
1107
- O.init(e, t);
1108
- const n = new RegExp(`^${he(t.prefix)}.*`);
1154
+ }), vr = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, t) => {
1155
+ I.init(e, t);
1156
+ const n = new RegExp(`^${fe(t.prefix)}.*`);
1109
1157
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1110
1158
  const o = r._zod.bag;
1111
1159
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
@@ -1120,9 +1168,9 @@ const mr = (e) => {
1120
1168
  continue: !t.abort
1121
1169
  });
1122
1170
  };
1123
- }), Ir = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, t) => {
1124
- O.init(e, t);
1125
- const n = new RegExp(`.*${he(t.suffix)}$`);
1171
+ }), br = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, t) => {
1172
+ I.init(e, t);
1173
+ const n = new RegExp(`.*${fe(t.suffix)}$`);
1126
1174
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1127
1175
  const o = r._zod.bag;
1128
1176
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
@@ -1137,12 +1185,12 @@ const mr = (e) => {
1137
1185
  continue: !t.abort
1138
1186
  });
1139
1187
  };
1140
- }), jr = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, t) => {
1141
- O.init(e, t), e._zod.check = (n) => {
1188
+ }), wr = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, t) => {
1189
+ I.init(e, t), e._zod.check = (n) => {
1142
1190
  n.value = t.tx(n.value);
1143
1191
  };
1144
1192
  });
1145
- class Ar {
1193
+ class kr {
1146
1194
  constructor(t = []) {
1147
1195
  this.content = [], this.indent = 0, this && (this.args = t);
1148
1196
  }
@@ -1155,9 +1203,9 @@ class Ar {
1155
1203
  return;
1156
1204
  }
1157
1205
  const r = t.split(`
1158
- `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
1159
- for (const s of i)
1160
- this.content.push(s);
1206
+ `).filter((c) => c), o = Math.min(...r.map((c) => c.length - c.trimStart().length)), i = r.map((c) => c.slice(o)).map((c) => " ".repeat(this.indent * 2) + c);
1207
+ for (const c of i)
1208
+ this.content.push(c);
1161
1209
  }
1162
1210
  compile() {
1163
1211
  const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
@@ -1165,13 +1213,13 @@ class Ar {
1165
1213
  `));
1166
1214
  }
1167
1215
  }
1168
- const Cr = {
1216
+ const zr = {
1169
1217
  major: 4,
1170
1218
  minor: 1,
1171
1219
  patch: 11
1172
- }, S = /* @__PURE__ */ a("$ZodType", (e, t) => {
1220
+ }, Z = /* @__PURE__ */ a("$ZodType", (e, t) => {
1173
1221
  var n;
1174
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Cr;
1222
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = zr;
1175
1223
  const r = [...e._zod.def.checks ?? []];
1176
1224
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
1177
1225
  for (const o of r)
@@ -1182,69 +1230,69 @@ const Cr = {
1182
1230
  e._zod.run = e._zod.parse;
1183
1231
  });
1184
1232
  else {
1185
- const o = (s, c, d) => {
1186
- let l = J(s), f;
1187
- for (const h of c) {
1188
- if (h._zod.def.when) {
1189
- if (!h._zod.def.when(s))
1233
+ const o = (c, s, f) => {
1234
+ let d = q(c), h;
1235
+ for (const v of s) {
1236
+ if (v._zod.def.when) {
1237
+ if (!v._zod.def.when(c))
1190
1238
  continue;
1191
- } else if (l)
1239
+ } else if (d)
1192
1240
  continue;
1193
- const p = s.issues.length, g = h._zod.check(s);
1194
- if (g instanceof Promise && d?.async === !1)
1195
- throw new G();
1196
- if (f || g instanceof Promise)
1197
- f = (f ?? Promise.resolve()).then(async () => {
1198
- await g, s.issues.length !== p && (l || (l = J(s, p)));
1241
+ const _ = c.issues.length, l = v._zod.check(c);
1242
+ if (l instanceof Promise && f?.async === !1)
1243
+ throw new J();
1244
+ if (h || l instanceof Promise)
1245
+ h = (h ?? Promise.resolve()).then(async () => {
1246
+ await l, c.issues.length !== _ && (d || (d = q(c, _)));
1199
1247
  });
1200
1248
  else {
1201
- if (s.issues.length === p)
1249
+ if (c.issues.length === _)
1202
1250
  continue;
1203
- l || (l = J(s, p));
1251
+ d || (d = q(c, _));
1204
1252
  }
1205
1253
  }
1206
- return f ? f.then(() => s) : s;
1207
- }, i = (s, c, d) => {
1208
- if (J(s))
1209
- return s.aborted = !0, s;
1210
- const l = o(c, r, d);
1211
- if (l instanceof Promise) {
1212
- if (d.async === !1)
1213
- throw new G();
1214
- return l.then((f) => e._zod.parse(f, d));
1254
+ return h ? h.then(() => c) : c;
1255
+ }, i = (c, s, f) => {
1256
+ if (q(c))
1257
+ return c.aborted = !0, c;
1258
+ const d = o(s, r, f);
1259
+ if (d instanceof Promise) {
1260
+ if (f.async === !1)
1261
+ throw new J();
1262
+ return d.then((h) => e._zod.parse(h, f));
1215
1263
  }
1216
- return e._zod.parse(l, d);
1264
+ return e._zod.parse(d, f);
1217
1265
  };
1218
- e._zod.run = (s, c) => {
1219
- if (c.skipChecks)
1220
- return e._zod.parse(s, c);
1221
- if (c.direction === "backward") {
1222
- const l = e._zod.parse({ value: s.value, issues: [] }, { ...c, skipChecks: !0 });
1223
- return l instanceof Promise ? l.then((f) => i(f, s, c)) : i(l, s, c);
1266
+ e._zod.run = (c, s) => {
1267
+ if (s.skipChecks)
1268
+ return e._zod.parse(c, s);
1269
+ if (s.direction === "backward") {
1270
+ const d = e._zod.parse({ value: c.value, issues: [] }, { ...s, skipChecks: !0 });
1271
+ return d instanceof Promise ? d.then((h) => i(h, c, s)) : i(d, c, s);
1224
1272
  }
1225
- const d = e._zod.parse(s, c);
1226
- if (d instanceof Promise) {
1227
- if (c.async === !1)
1228
- throw new G();
1229
- return d.then((l) => o(l, r, c));
1273
+ const f = e._zod.parse(c, s);
1274
+ if (f instanceof Promise) {
1275
+ if (s.async === !1)
1276
+ throw new J();
1277
+ return f.then((d) => o(d, r, s));
1230
1278
  }
1231
- return o(d, r, c);
1279
+ return o(f, r, s);
1232
1280
  };
1233
1281
  }
1234
1282
  e["~standard"] = {
1235
1283
  validate: (o) => {
1236
1284
  try {
1237
- const i = Nn(e, o);
1285
+ const i = En(e, o);
1238
1286
  return i.success ? { value: i.data } : { issues: i.error?.issues };
1239
1287
  } catch {
1240
- return Dn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
1288
+ return xn(e, o).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
1241
1289
  }
1242
1290
  },
1243
1291
  vendor: "zod",
1244
1292
  version: 1
1245
1293
  };
1246
- }), Ne = /* @__PURE__ */ a("$ZodString", (e, t) => {
1247
- S.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? mr(e._zod.bag), e._zod.parse = (n, r) => {
1294
+ }), Ce = /* @__PURE__ */ a("$ZodString", (e, t) => {
1295
+ Z.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rr(e._zod.bag), e._zod.parse = (n, r) => {
1248
1296
  if (t.coerce)
1249
1297
  try {
1250
1298
  n.value = String(n.value);
@@ -1257,11 +1305,11 @@ const Cr = {
1257
1305
  inst: e
1258
1306
  }), n;
1259
1307
  };
1260
- }), y = /* @__PURE__ */ a("$ZodStringFormat", (e, t) => {
1261
- ge.init(e, t), Ne.init(e, t);
1262
- }), Or = /* @__PURE__ */ a("$ZodGUID", (e, t) => {
1263
- t.pattern ?? (t.pattern = er), y.init(e, t);
1264
- }), Rr = /* @__PURE__ */ a("$ZodUUID", (e, t) => {
1308
+ }), k = /* @__PURE__ */ a("$ZodStringFormat", (e, t) => {
1309
+ pe.init(e, t), Ce.init(e, t);
1310
+ }), yr = /* @__PURE__ */ a("$ZodGUID", (e, t) => {
1311
+ t.pattern ?? (t.pattern = Vn), k.init(e, t);
1312
+ }), $r = /* @__PURE__ */ a("$ZodUUID", (e, t) => {
1265
1313
  if (t.version) {
1266
1314
  const r = {
1267
1315
  v1: 1,
@@ -1275,21 +1323,21 @@ const Cr = {
1275
1323
  }[t.version];
1276
1324
  if (r === void 0)
1277
1325
  throw new Error(`Invalid UUID version: "${t.version}"`);
1278
- t.pattern ?? (t.pattern = qe(r));
1326
+ t.pattern ?? (t.pattern = Ye(r));
1279
1327
  } else
1280
- t.pattern ?? (t.pattern = qe());
1281
- y.init(e, t);
1282
- }), Pr = /* @__PURE__ */ a("$ZodEmail", (e, t) => {
1283
- t.pattern ?? (t.pattern = tr), y.init(e, t);
1284
- }), Nr = /* @__PURE__ */ a("$ZodURL", (e, t) => {
1285
- y.init(e, t), e._zod.check = (n) => {
1328
+ t.pattern ?? (t.pattern = Ye());
1329
+ k.init(e, t);
1330
+ }), Zr = /* @__PURE__ */ a("$ZodEmail", (e, t) => {
1331
+ t.pattern ?? (t.pattern = Wn), k.init(e, t);
1332
+ }), Er = /* @__PURE__ */ a("$ZodURL", (e, t) => {
1333
+ k.init(e, t), e._zod.check = (n) => {
1286
1334
  try {
1287
1335
  const r = n.value.trim(), o = new URL(r);
1288
1336
  t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
1289
1337
  code: "invalid_format",
1290
1338
  format: "url",
1291
1339
  note: "Invalid hostname",
1292
- pattern: ur.source,
1340
+ pattern: Kn.source,
1293
1341
  input: n.value,
1294
1342
  inst: e,
1295
1343
  continue: !t.abort
@@ -1313,35 +1361,35 @@ const Cr = {
1313
1361
  });
1314
1362
  }
1315
1363
  };
1316
- }), Dr = /* @__PURE__ */ a("$ZodEmoji", (e, t) => {
1317
- t.pattern ?? (t.pattern = rr()), y.init(e, t);
1318
- }), Ur = /* @__PURE__ */ a("$ZodNanoID", (e, t) => {
1319
- t.pattern ?? (t.pattern = Kn), y.init(e, t);
1320
- }), Fr = /* @__PURE__ */ a("$ZodCUID", (e, t) => {
1321
- t.pattern ?? (t.pattern = Hn), y.init(e, t);
1322
- }), Lr = /* @__PURE__ */ a("$ZodCUID2", (e, t) => {
1323
- t.pattern ?? (t.pattern = Jn), y.init(e, t);
1324
- }), Mr = /* @__PURE__ */ a("$ZodULID", (e, t) => {
1325
- t.pattern ?? (t.pattern = Gn), y.init(e, t);
1326
- }), Vr = /* @__PURE__ */ a("$ZodXID", (e, t) => {
1327
- t.pattern ?? (t.pattern = qn), y.init(e, t);
1328
- }), Wr = /* @__PURE__ */ a("$ZodKSUID", (e, t) => {
1329
- t.pattern ?? (t.pattern = Xn), y.init(e, t);
1330
- }), Br = /* @__PURE__ */ a("$ZodISODateTime", (e, t) => {
1331
- t.pattern ?? (t.pattern = hr(t)), y.init(e, t);
1332
- }), Yr = /* @__PURE__ */ a("$ZodISODate", (e, t) => {
1333
- t.pattern ?? (t.pattern = dr), y.init(e, t);
1334
- }), Hr = /* @__PURE__ */ a("$ZodISOTime", (e, t) => {
1335
- t.pattern ?? (t.pattern = fr(t)), y.init(e, t);
1336
- }), Jr = /* @__PURE__ */ a("$ZodISODuration", (e, t) => {
1337
- t.pattern ?? (t.pattern = Qn), y.init(e, t);
1338
- }), Gr = /* @__PURE__ */ a("$ZodIPv4", (e, t) => {
1339
- t.pattern ?? (t.pattern = or), y.init(e, t), e._zod.onattach.push((n) => {
1364
+ }), xr = /* @__PURE__ */ a("$ZodEmoji", (e, t) => {
1365
+ t.pattern ?? (t.pattern = Yn()), k.init(e, t);
1366
+ }), Tr = /* @__PURE__ */ a("$ZodNanoID", (e, t) => {
1367
+ t.pattern ?? (t.pattern = Fn), k.init(e, t);
1368
+ }), Ar = /* @__PURE__ */ a("$ZodCUID", (e, t) => {
1369
+ t.pattern ?? (t.pattern = Pn), k.init(e, t);
1370
+ }), jr = /* @__PURE__ */ a("$ZodCUID2", (e, t) => {
1371
+ t.pattern ?? (t.pattern = Nn), k.init(e, t);
1372
+ }), Ir = /* @__PURE__ */ a("$ZodULID", (e, t) => {
1373
+ t.pattern ?? (t.pattern = Dn), k.init(e, t);
1374
+ }), Sr = /* @__PURE__ */ a("$ZodXID", (e, t) => {
1375
+ t.pattern ?? (t.pattern = Un), k.init(e, t);
1376
+ }), Cr = /* @__PURE__ */ a("$ZodKSUID", (e, t) => {
1377
+ t.pattern ?? (t.pattern = Ln), k.init(e, t);
1378
+ }), Or = /* @__PURE__ */ a("$ZodISODateTime", (e, t) => {
1379
+ t.pattern ?? (t.pattern = nr(t)), k.init(e, t);
1380
+ }), Rr = /* @__PURE__ */ a("$ZodISODate", (e, t) => {
1381
+ t.pattern ?? (t.pattern = er), k.init(e, t);
1382
+ }), Pr = /* @__PURE__ */ a("$ZodISOTime", (e, t) => {
1383
+ t.pattern ?? (t.pattern = tr(t)), k.init(e, t);
1384
+ }), Nr = /* @__PURE__ */ a("$ZodISODuration", (e, t) => {
1385
+ t.pattern ?? (t.pattern = Mn), k.init(e, t);
1386
+ }), Dr = /* @__PURE__ */ a("$ZodIPv4", (e, t) => {
1387
+ t.pattern ?? (t.pattern = qn), k.init(e, t), e._zod.onattach.push((n) => {
1340
1388
  const r = n._zod.bag;
1341
1389
  r.format = "ipv4";
1342
1390
  });
1343
- }), qr = /* @__PURE__ */ a("$ZodIPv6", (e, t) => {
1344
- t.pattern ?? (t.pattern = ir), y.init(e, t), e._zod.onattach.push((n) => {
1391
+ }), Ur = /* @__PURE__ */ a("$ZodIPv6", (e, t) => {
1392
+ t.pattern ?? (t.pattern = Jn), k.init(e, t), e._zod.onattach.push((n) => {
1345
1393
  const r = n._zod.bag;
1346
1394
  r.format = "ipv6";
1347
1395
  }), e._zod.check = (n) => {
@@ -1357,10 +1405,10 @@ const Cr = {
1357
1405
  });
1358
1406
  }
1359
1407
  };
1360
- }), Xr = /* @__PURE__ */ a("$ZodCIDRv4", (e, t) => {
1361
- t.pattern ?? (t.pattern = sr), y.init(e, t);
1362
- }), Kr = /* @__PURE__ */ a("$ZodCIDRv6", (e, t) => {
1363
- t.pattern ?? (t.pattern = cr), y.init(e, t), e._zod.check = (n) => {
1408
+ }), Lr = /* @__PURE__ */ a("$ZodCIDRv4", (e, t) => {
1409
+ t.pattern ?? (t.pattern = Gn), k.init(e, t);
1410
+ }), Fr = /* @__PURE__ */ a("$ZodCIDRv6", (e, t) => {
1411
+ t.pattern ?? (t.pattern = Hn), k.init(e, t), e._zod.check = (n) => {
1364
1412
  const r = n.value.split("/");
1365
1413
  try {
1366
1414
  if (r.length !== 2)
@@ -1368,10 +1416,10 @@ const Cr = {
1368
1416
  const [o, i] = r;
1369
1417
  if (!i)
1370
1418
  throw new Error();
1371
- const s = Number(i);
1372
- if (`${s}` !== i)
1419
+ const c = Number(i);
1420
+ if (`${c}` !== i)
1373
1421
  throw new Error();
1374
- if (s < 0 || s > 128)
1422
+ if (c < 0 || c > 128)
1375
1423
  throw new Error();
1376
1424
  new URL(`http://[${o}]`);
1377
1425
  } catch {
@@ -1385,7 +1433,7 @@ const Cr = {
1385
1433
  }
1386
1434
  };
1387
1435
  });
1388
- function Ot(e) {
1436
+ function xt(e) {
1389
1437
  if (e === "")
1390
1438
  return !0;
1391
1439
  if (e.length % 4 !== 0)
@@ -1396,11 +1444,11 @@ function Ot(e) {
1396
1444
  return !1;
1397
1445
  }
1398
1446
  }
1399
- const Qr = /* @__PURE__ */ a("$ZodBase64", (e, t) => {
1400
- t.pattern ?? (t.pattern = ar), y.init(e, t), e._zod.onattach.push((n) => {
1447
+ const Mr = /* @__PURE__ */ a("$ZodBase64", (e, t) => {
1448
+ t.pattern ?? (t.pattern = Xn), k.init(e, t), e._zod.onattach.push((n) => {
1401
1449
  n._zod.bag.contentEncoding = "base64";
1402
1450
  }), e._zod.check = (n) => {
1403
- Ot(n.value) || n.issues.push({
1451
+ xt(n.value) || n.issues.push({
1404
1452
  code: "invalid_format",
1405
1453
  format: "base64",
1406
1454
  input: n.value,
@@ -1409,17 +1457,17 @@ const Qr = /* @__PURE__ */ a("$ZodBase64", (e, t) => {
1409
1457
  });
1410
1458
  };
1411
1459
  });
1412
- function eo(e) {
1413
- if (!Tt.test(e))
1460
+ function Vr(e) {
1461
+ if (!kt.test(e))
1414
1462
  return !1;
1415
1463
  const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1416
- return Ot(n);
1464
+ return xt(n);
1417
1465
  }
1418
- const to = /* @__PURE__ */ a("$ZodBase64URL", (e, t) => {
1419
- t.pattern ?? (t.pattern = Tt), y.init(e, t), e._zod.onattach.push((n) => {
1466
+ const Wr = /* @__PURE__ */ a("$ZodBase64URL", (e, t) => {
1467
+ t.pattern ?? (t.pattern = kt), k.init(e, t), e._zod.onattach.push((n) => {
1420
1468
  n._zod.bag.contentEncoding = "base64url";
1421
1469
  }), e._zod.check = (n) => {
1422
- eo(n.value) || n.issues.push({
1470
+ Vr(n.value) || n.issues.push({
1423
1471
  code: "invalid_format",
1424
1472
  format: "base64url",
1425
1473
  input: n.value,
@@ -1427,10 +1475,10 @@ const to = /* @__PURE__ */ a("$ZodBase64URL", (e, t) => {
1427
1475
  continue: !t.abort
1428
1476
  });
1429
1477
  };
1430
- }), no = /* @__PURE__ */ a("$ZodE164", (e, t) => {
1431
- t.pattern ?? (t.pattern = lr), y.init(e, t);
1478
+ }), Br = /* @__PURE__ */ a("$ZodE164", (e, t) => {
1479
+ t.pattern ?? (t.pattern = Qn), k.init(e, t);
1432
1480
  });
1433
- function ro(e, t = null) {
1481
+ function Yr(e, t = null) {
1434
1482
  try {
1435
1483
  const n = e.split(".");
1436
1484
  if (n.length !== 3)
@@ -1444,9 +1492,9 @@ function ro(e, t = null) {
1444
1492
  return !1;
1445
1493
  }
1446
1494
  }
1447
- const oo = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1448
- y.init(e, t), e._zod.check = (n) => {
1449
- ro(n.value, t.alg) || n.issues.push({
1495
+ const qr = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1496
+ k.init(e, t), e._zod.check = (n) => {
1497
+ Yr(n.value, t.alg) || n.issues.push({
1450
1498
  code: "invalid_format",
1451
1499
  format: "jwt",
1452
1500
  input: n.value,
@@ -1454,8 +1502,8 @@ const oo = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1454
1502
  continue: !t.abort
1455
1503
  });
1456
1504
  };
1457
- }), Rt = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1458
- S.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? gr, e._zod.parse = (n, r) => {
1505
+ }), Tt = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1506
+ Z.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? ir, e._zod.parse = (n, r) => {
1459
1507
  if (t.coerce)
1460
1508
  try {
1461
1509
  n.value = Number(n.value);
@@ -1473,10 +1521,10 @@ const oo = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1473
1521
  ...i ? { received: i } : {}
1474
1522
  }), n;
1475
1523
  };
1476
- }), io = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1477
- kr.init(e, t), Rt.init(e, t);
1478
- }), so = /* @__PURE__ */ a("$ZodBoolean", (e, t) => {
1479
- S.init(e, t), e._zod.pattern = _r, e._zod.parse = (n, r) => {
1524
+ }), Jr = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1525
+ lr.init(e, t), Tt.init(e, t);
1526
+ }), Gr = /* @__PURE__ */ a("$ZodBoolean", (e, t) => {
1527
+ Z.init(e, t), e._zod.pattern = cr, e._zod.parse = (n, r) => {
1480
1528
  if (t.coerce)
1481
1529
  try {
1482
1530
  n.value = !!n.value;
@@ -1490,21 +1538,21 @@ const oo = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1490
1538
  inst: e
1491
1539
  }), n;
1492
1540
  };
1493
- }), co = /* @__PURE__ */ a("$ZodUnknown", (e, t) => {
1494
- S.init(e, t), e._zod.parse = (n) => n;
1495
- }), ao = /* @__PURE__ */ a("$ZodNever", (e, t) => {
1496
- S.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1541
+ }), Hr = /* @__PURE__ */ a("$ZodUnknown", (e, t) => {
1542
+ Z.init(e, t), e._zod.parse = (n) => n;
1543
+ }), Xr = /* @__PURE__ */ a("$ZodNever", (e, t) => {
1544
+ Z.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1497
1545
  expected: "never",
1498
1546
  code: "invalid_type",
1499
1547
  input: n.value,
1500
1548
  inst: e
1501
1549
  }), n);
1502
1550
  });
1503
- function Xe(e, t, n) {
1504
- e.issues.length && t.issues.push(...$t(n, e.issues)), t.value[n] = e.value;
1551
+ function qe(e, t, n) {
1552
+ e.issues.length && t.issues.push(...gt(n, e.issues)), t.value[n] = e.value;
1505
1553
  }
1506
- const uo = /* @__PURE__ */ a("$ZodArray", (e, t) => {
1507
- S.init(e, t), e._zod.parse = (n, r) => {
1554
+ const Kr = /* @__PURE__ */ a("$ZodArray", (e, t) => {
1555
+ Z.init(e, t), e._zod.parse = (n, r) => {
1508
1556
  const o = n.value;
1509
1557
  if (!Array.isArray(o))
1510
1558
  return n.issues.push({
@@ -1515,25 +1563,25 @@ const uo = /* @__PURE__ */ a("$ZodArray", (e, t) => {
1515
1563
  }), n;
1516
1564
  n.value = Array(o.length);
1517
1565
  const i = [];
1518
- for (let s = 0; s < o.length; s++) {
1519
- const c = o[s], d = t.element._zod.run({
1520
- value: c,
1566
+ for (let c = 0; c < o.length; c++) {
1567
+ const s = o[c], f = t.element._zod.run({
1568
+ value: s,
1521
1569
  issues: []
1522
1570
  }, r);
1523
- d instanceof Promise ? i.push(d.then((l) => Xe(l, n, s))) : Xe(d, n, s);
1571
+ f instanceof Promise ? i.push(f.then((d) => qe(d, n, c))) : qe(f, n, c);
1524
1572
  }
1525
1573
  return i.length ? Promise.all(i).then(() => n) : n;
1526
1574
  };
1527
1575
  });
1528
- function de(e, t, n, r) {
1529
- e.issues.length && t.issues.push(...$t(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1576
+ function le(e, t, n, r) {
1577
+ e.issues.length && t.issues.push(...gt(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1530
1578
  }
1531
- function Pt(e) {
1579
+ function At(e) {
1532
1580
  const t = Object.keys(e.shape);
1533
1581
  for (const r of t)
1534
1582
  if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1535
1583
  throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1536
- const n = En(e.shape);
1584
+ const n = pn(e.shape);
1537
1585
  return {
1538
1586
  ...e,
1539
1587
  keys: t,
@@ -1542,186 +1590,186 @@ function Pt(e) {
1542
1590
  optionalKeys: new Set(n)
1543
1591
  };
1544
1592
  }
1545
- function Nt(e, t, n, r, o, i) {
1546
- const s = [], c = o.keySet, d = o.catchall._zod, l = d.def.type;
1547
- for (const f of Object.keys(t)) {
1548
- if (c.has(f))
1593
+ function jt(e, t, n, r, o, i) {
1594
+ const c = [], s = o.keySet, f = o.catchall._zod, d = f.def.type;
1595
+ for (const h of Object.keys(t)) {
1596
+ if (s.has(h))
1549
1597
  continue;
1550
- if (l === "never") {
1551
- s.push(f);
1598
+ if (d === "never") {
1599
+ c.push(h);
1552
1600
  continue;
1553
1601
  }
1554
- const h = d.run({ value: t[f], issues: [] }, r);
1555
- h instanceof Promise ? e.push(h.then((p) => de(p, n, f, t))) : de(h, n, f, t);
1602
+ const v = f.run({ value: t[h], issues: [] }, r);
1603
+ v instanceof Promise ? e.push(v.then((_) => le(_, n, h, t))) : le(v, n, h, t);
1556
1604
  }
1557
- return s.length && n.issues.push({
1605
+ return c.length && n.issues.push({
1558
1606
  code: "unrecognized_keys",
1559
- keys: s,
1607
+ keys: c,
1560
1608
  input: t,
1561
1609
  inst: i
1562
1610
  }), e.length ? Promise.all(e).then(() => n) : n;
1563
1611
  }
1564
- const lo = /* @__PURE__ */ a("$ZodObject", (e, t) => {
1565
- if (S.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1566
- const c = t.shape;
1612
+ const Qr = /* @__PURE__ */ a("$ZodObject", (e, t) => {
1613
+ if (Z.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1614
+ const s = t.shape;
1567
1615
  Object.defineProperty(t, "shape", {
1568
1616
  get: () => {
1569
- const d = { ...c };
1617
+ const f = { ...s };
1570
1618
  return Object.defineProperty(t, "shape", {
1571
- value: d
1572
- }), d;
1619
+ value: f
1620
+ }), f;
1573
1621
  }
1574
1622
  });
1575
1623
  }
1576
- const r = je(() => Pt(t));
1624
+ const r = xe(() => At(t));
1577
1625
  w(e._zod, "propValues", () => {
1578
- const c = t.shape, d = {};
1579
- for (const l in c) {
1580
- const f = c[l]._zod;
1581
- if (f.values) {
1582
- d[l] ?? (d[l] = /* @__PURE__ */ new Set());
1583
- for (const h of f.values)
1584
- d[l].add(h);
1626
+ const s = t.shape, f = {};
1627
+ for (const d in s) {
1628
+ const h = s[d]._zod;
1629
+ if (h.values) {
1630
+ f[d] ?? (f[d] = /* @__PURE__ */ new Set());
1631
+ for (const v of h.values)
1632
+ f[d].add(v);
1585
1633
  }
1586
1634
  }
1587
- return d;
1588
- });
1589
- const o = le, i = t.catchall;
1590
- let s;
1591
- e._zod.parse = (c, d) => {
1592
- s ?? (s = r.value);
1593
- const l = c.value;
1594
- if (!o(l))
1595
- return c.issues.push({
1635
+ return f;
1636
+ });
1637
+ const o = ue, i = t.catchall;
1638
+ let c;
1639
+ e._zod.parse = (s, f) => {
1640
+ c ?? (c = r.value);
1641
+ const d = s.value;
1642
+ if (!o(d))
1643
+ return s.issues.push({
1596
1644
  expected: "object",
1597
1645
  code: "invalid_type",
1598
- input: l,
1646
+ input: d,
1599
1647
  inst: e
1600
- }), c;
1601
- c.value = {};
1602
- const f = [], h = s.shape;
1603
- for (const p of s.keys) {
1604
- const T = h[p]._zod.run({ value: l[p], issues: [] }, d);
1605
- T instanceof Promise ? f.push(T.then((b) => de(b, c, p, l))) : de(T, c, p, l);
1648
+ }), s;
1649
+ s.value = {};
1650
+ const h = [], v = c.shape;
1651
+ for (const _ of c.keys) {
1652
+ const b = v[_]._zod.run({ value: d[_], issues: [] }, f);
1653
+ b instanceof Promise ? h.push(b.then((R) => le(R, s, _, d))) : le(b, s, _, d);
1606
1654
  }
1607
- return i ? Nt(f, l, c, d, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
1655
+ return i ? jt(h, d, s, f, r.value, e) : h.length ? Promise.all(h).then(() => s) : s;
1608
1656
  };
1609
- }), fo = /* @__PURE__ */ a("$ZodObjectJIT", (e, t) => {
1610
- lo.init(e, t);
1611
- const n = e._zod.parse, r = je(() => Pt(t)), o = (p) => {
1612
- const g = new Ar(["shape", "payload", "ctx"]), T = r.value, b = ($) => {
1613
- const z = Ge($);
1614
- return `shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`;
1657
+ }), eo = /* @__PURE__ */ a("$ZodObjectJIT", (e, t) => {
1658
+ Qr.init(e, t);
1659
+ const n = e._zod.parse, r = xe(() => At(t)), o = (_) => {
1660
+ const l = new kr(["shape", "payload", "ctx"]), b = r.value, R = (C) => {
1661
+ const A = Be(C);
1662
+ return `shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`;
1615
1663
  };
1616
- g.write("const input = payload.value;");
1617
- const C = /* @__PURE__ */ Object.create(null);
1618
- let N = 0;
1619
- for (const $ of T.keys)
1620
- C[$] = `key_${N++}`;
1621
- g.write("const newResult = {};");
1622
- for (const $ of T.keys) {
1623
- const z = C[$], P = Ge($);
1624
- g.write(`const ${z} = ${b($)};`), g.write(`
1625
- if (${z}.issues.length) {
1626
- payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
1664
+ l.write("const input = payload.value;");
1665
+ const j = /* @__PURE__ */ Object.create(null);
1666
+ let U = 0;
1667
+ for (const C of b.keys)
1668
+ j[C] = `key_${U++}`;
1669
+ l.write("const newResult = {};");
1670
+ for (const C of b.keys) {
1671
+ const A = j[C], N = Be(C);
1672
+ l.write(`const ${A} = ${R(C)};`), l.write(`
1673
+ if (${A}.issues.length) {
1674
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
1627
1675
  ...iss,
1628
- path: iss.path ? [${P}, ...iss.path] : [${P}]
1676
+ path: iss.path ? [${N}, ...iss.path] : [${N}]
1629
1677
  })));
1630
1678
  }
1631
1679
 
1632
1680
 
1633
- if (${z}.value === undefined) {
1634
- if (${P} in input) {
1635
- newResult[${P}] = undefined;
1681
+ if (${A}.value === undefined) {
1682
+ if (${N} in input) {
1683
+ newResult[${N}] = undefined;
1636
1684
  }
1637
1685
  } else {
1638
- newResult[${P}] = ${z}.value;
1686
+ newResult[${N}] = ${A}.value;
1639
1687
  }
1640
1688
 
1641
1689
  `);
1642
1690
  }
1643
- g.write("payload.value = newResult;"), g.write("return payload;");
1644
- const k = g.compile();
1645
- return ($, z) => k(p, $, z);
1691
+ l.write("payload.value = newResult;"), l.write("return payload;");
1692
+ const S = l.compile();
1693
+ return (C, A) => S(_, C, A);
1646
1694
  };
1647
1695
  let i;
1648
- const s = le, c = !kt.jitless, l = c && $n.value, f = t.catchall;
1649
- let h;
1650
- e._zod.parse = (p, g) => {
1651
- h ?? (h = r.value);
1652
- const T = p.value;
1653
- return s(T) ? c && l && g?.async === !1 && g.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, g), f ? Nt([], T, p, g, h, e) : p) : n(p, g) : (p.issues.push({
1696
+ const c = ue, s = !mt.jitless, d = s && hn.value, h = t.catchall;
1697
+ let v;
1698
+ e._zod.parse = (_, l) => {
1699
+ v ?? (v = r.value);
1700
+ const b = _.value;
1701
+ return c(b) ? s && d && l?.async === !1 && l.jitless !== !0 ? (i || (i = o(t.shape)), _ = i(_, l), h ? jt([], b, _, l, v, e) : _) : n(_, l) : (_.issues.push({
1654
1702
  expected: "object",
1655
1703
  code: "invalid_type",
1656
- input: T,
1704
+ input: b,
1657
1705
  inst: e
1658
- }), p);
1706
+ }), _);
1659
1707
  };
1660
1708
  });
1661
- function Ke(e, t, n, r) {
1709
+ function Je(e, t, n, r) {
1662
1710
  for (const i of e)
1663
1711
  if (i.issues.length === 0)
1664
1712
  return t.value = i.value, t;
1665
- const o = e.filter((i) => !J(i));
1713
+ const o = e.filter((i) => !q(i));
1666
1714
  return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
1667
1715
  code: "invalid_union",
1668
1716
  input: t.value,
1669
1717
  inst: n,
1670
- errors: e.map((i) => i.issues.map((s) => V(s, r, M())))
1718
+ errors: e.map((i) => i.issues.map((c) => V(c, r, M())))
1671
1719
  }), t);
1672
1720
  }
1673
- const ho = /* @__PURE__ */ a("$ZodUnion", (e, t) => {
1674
- S.init(e, t), w(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), w(e._zod, "values", () => {
1721
+ const to = /* @__PURE__ */ a("$ZodUnion", (e, t) => {
1722
+ Z.init(e, t), w(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), w(e._zod, "values", () => {
1675
1723
  if (t.options.every((o) => o._zod.values))
1676
1724
  return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
1677
1725
  }), w(e._zod, "pattern", () => {
1678
1726
  if (t.options.every((o) => o._zod.pattern)) {
1679
1727
  const o = t.options.map((i) => i._zod.pattern);
1680
- return new RegExp(`^(${o.map((i) => Ce(i.source)).join("|")})$`);
1728
+ return new RegExp(`^(${o.map((i) => Ae(i.source)).join("|")})$`);
1681
1729
  }
1682
1730
  });
1683
1731
  const n = t.options.length === 1, r = t.options[0]._zod.run;
1684
1732
  e._zod.parse = (o, i) => {
1685
1733
  if (n)
1686
1734
  return r(o, i);
1687
- let s = !1;
1688
- const c = [];
1689
- for (const d of t.options) {
1690
- const l = d._zod.run({
1735
+ let c = !1;
1736
+ const s = [];
1737
+ for (const f of t.options) {
1738
+ const d = f._zod.run({
1691
1739
  value: o.value,
1692
1740
  issues: []
1693
1741
  }, i);
1694
- if (l instanceof Promise)
1695
- c.push(l), s = !0;
1742
+ if (d instanceof Promise)
1743
+ s.push(d), c = !0;
1696
1744
  else {
1697
- if (l.issues.length === 0)
1698
- return l;
1699
- c.push(l);
1745
+ if (d.issues.length === 0)
1746
+ return d;
1747
+ s.push(d);
1700
1748
  }
1701
1749
  }
1702
- return s ? Promise.all(c).then((d) => Ke(d, o, e, i)) : Ke(c, o, e, i);
1750
+ return c ? Promise.all(s).then((f) => Je(f, o, e, i)) : Je(s, o, e, i);
1703
1751
  };
1704
- }), mo = /* @__PURE__ */ a("$ZodIntersection", (e, t) => {
1705
- S.init(e, t), e._zod.parse = (n, r) => {
1706
- const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
1707
- return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([d, l]) => Qe(n, d, l)) : Qe(n, i, s);
1752
+ }), no = /* @__PURE__ */ a("$ZodIntersection", (e, t) => {
1753
+ Z.init(e, t), e._zod.parse = (n, r) => {
1754
+ const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), c = t.right._zod.run({ value: o, issues: [] }, r);
1755
+ return i instanceof Promise || c instanceof Promise ? Promise.all([i, c]).then(([f, d]) => Ge(n, f, d)) : Ge(n, i, c);
1708
1756
  };
1709
1757
  });
1710
- function xe(e, t) {
1758
+ function ye(e, t) {
1711
1759
  if (e === t)
1712
1760
  return { valid: !0, data: e };
1713
1761
  if (e instanceof Date && t instanceof Date && +e == +t)
1714
1762
  return { valid: !0, data: e };
1715
- if (ee(e) && ee(t)) {
1763
+ if (X(e) && X(t)) {
1716
1764
  const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
1717
1765
  for (const i of r) {
1718
- const s = xe(e[i], t[i]);
1719
- if (!s.valid)
1766
+ const c = ye(e[i], t[i]);
1767
+ if (!c.valid)
1720
1768
  return {
1721
1769
  valid: !1,
1722
- mergeErrorPath: [i, ...s.mergeErrorPath]
1770
+ mergeErrorPath: [i, ...c.mergeErrorPath]
1723
1771
  };
1724
- o[i] = s.data;
1772
+ o[i] = c.data;
1725
1773
  }
1726
1774
  return { valid: !0, data: o };
1727
1775
  }
@@ -1730,94 +1778,94 @@ function xe(e, t) {
1730
1778
  return { valid: !1, mergeErrorPath: [] };
1731
1779
  const n = [];
1732
1780
  for (let r = 0; r < e.length; r++) {
1733
- const o = e[r], i = t[r], s = xe(o, i);
1734
- if (!s.valid)
1781
+ const o = e[r], i = t[r], c = ye(o, i);
1782
+ if (!c.valid)
1735
1783
  return {
1736
1784
  valid: !1,
1737
- mergeErrorPath: [r, ...s.mergeErrorPath]
1785
+ mergeErrorPath: [r, ...c.mergeErrorPath]
1738
1786
  };
1739
- n.push(s.data);
1787
+ n.push(c.data);
1740
1788
  }
1741
1789
  return { valid: !0, data: n };
1742
1790
  }
1743
1791
  return { valid: !1, mergeErrorPath: [] };
1744
1792
  }
1745
- function Qe(e, t, n) {
1746
- if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), J(e))
1793
+ function Ge(e, t, n) {
1794
+ if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), q(e))
1747
1795
  return e;
1748
- const r = xe(t.value, n.value);
1796
+ const r = ye(t.value, n.value);
1749
1797
  if (!r.valid)
1750
1798
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1751
1799
  return e.value = r.data, e;
1752
1800
  }
1753
- const po = /* @__PURE__ */ a("$ZodEnum", (e, t) => {
1754
- S.init(e, t);
1755
- const n = zn(t.entries), r = new Set(n);
1756
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Zn.has(typeof o)).map((o) => typeof o == "string" ? he(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1757
- const s = o.value;
1758
- return r.has(s) || o.issues.push({
1801
+ const ro = /* @__PURE__ */ a("$ZodEnum", (e, t) => {
1802
+ Z.init(e, t);
1803
+ const n = dn(t.entries), r = new Set(n);
1804
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => mn.has(typeof o)).map((o) => typeof o == "string" ? fe(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1805
+ const c = o.value;
1806
+ return r.has(c) || o.issues.push({
1759
1807
  code: "invalid_value",
1760
1808
  values: n,
1761
- input: s,
1809
+ input: c,
1762
1810
  inst: e
1763
1811
  }), o;
1764
1812
  };
1765
- }), go = /* @__PURE__ */ a("$ZodTransform", (e, t) => {
1766
- S.init(e, t), e._zod.parse = (n, r) => {
1813
+ }), oo = /* @__PURE__ */ a("$ZodTransform", (e, t) => {
1814
+ Z.init(e, t), e._zod.parse = (n, r) => {
1767
1815
  if (r.direction === "backward")
1768
- throw new wt(e.constructor.name);
1816
+ throw new ht(e.constructor.name);
1769
1817
  const o = t.transform(n.value, n);
1770
1818
  if (r.async)
1771
- return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
1819
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((c) => (n.value = c, n));
1772
1820
  if (o instanceof Promise)
1773
- throw new G();
1821
+ throw new J();
1774
1822
  return n.value = o, n;
1775
1823
  };
1776
1824
  });
1777
- function et(e, t) {
1825
+ function He(e, t) {
1778
1826
  return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1779
1827
  }
1780
- const _o = /* @__PURE__ */ a("$ZodOptional", (e, t) => {
1781
- S.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
1828
+ const io = /* @__PURE__ */ a("$ZodOptional", (e, t) => {
1829
+ Z.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
1782
1830
  const n = t.innerType._zod.pattern;
1783
- return n ? new RegExp(`^(${Ce(n.source)})?$`) : void 0;
1831
+ return n ? new RegExp(`^(${Ae(n.source)})?$`) : void 0;
1784
1832
  }), e._zod.parse = (n, r) => {
1785
1833
  if (t.innerType._zod.optin === "optional") {
1786
1834
  const o = t.innerType._zod.run(n, r);
1787
- return o instanceof Promise ? o.then((i) => et(i, n.value)) : et(o, n.value);
1835
+ return o instanceof Promise ? o.then((i) => He(i, n.value)) : He(o, n.value);
1788
1836
  }
1789
1837
  return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1790
1838
  };
1791
- }), vo = /* @__PURE__ */ a("$ZodNullable", (e, t) => {
1792
- S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
1839
+ }), co = /* @__PURE__ */ a("$ZodNullable", (e, t) => {
1840
+ Z.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
1793
1841
  const n = t.innerType._zod.pattern;
1794
- return n ? new RegExp(`^(${Ce(n.source)}|null)$`) : void 0;
1842
+ return n ? new RegExp(`^(${Ae(n.source)}|null)$`) : void 0;
1795
1843
  }), w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
1796
- }), bo = /* @__PURE__ */ a("$ZodDefault", (e, t) => {
1797
- S.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1844
+ }), so = /* @__PURE__ */ a("$ZodDefault", (e, t) => {
1845
+ Z.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1798
1846
  if (r.direction === "backward")
1799
1847
  return t.innerType._zod.run(n, r);
1800
1848
  if (n.value === void 0)
1801
1849
  return n.value = t.defaultValue, n;
1802
1850
  const o = t.innerType._zod.run(n, r);
1803
- return o instanceof Promise ? o.then((i) => tt(i, t)) : tt(o, t);
1851
+ return o instanceof Promise ? o.then((i) => Xe(i, t)) : Xe(o, t);
1804
1852
  };
1805
1853
  });
1806
- function tt(e, t) {
1854
+ function Xe(e, t) {
1807
1855
  return e.value === void 0 && (e.value = t.defaultValue), e;
1808
1856
  }
1809
- const wo = /* @__PURE__ */ a("$ZodPrefault", (e, t) => {
1810
- S.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1811
- }), ko = /* @__PURE__ */ a("$ZodNonOptional", (e, t) => {
1812
- S.init(e, t), w(e._zod, "values", () => {
1857
+ const ao = /* @__PURE__ */ a("$ZodPrefault", (e, t) => {
1858
+ Z.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1859
+ }), uo = /* @__PURE__ */ a("$ZodNonOptional", (e, t) => {
1860
+ Z.init(e, t), w(e._zod, "values", () => {
1813
1861
  const n = t.innerType._zod.values;
1814
1862
  return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1815
1863
  }), e._zod.parse = (n, r) => {
1816
1864
  const o = t.innerType._zod.run(n, r);
1817
- return o instanceof Promise ? o.then((i) => nt(i, e)) : nt(o, e);
1865
+ return o instanceof Promise ? o.then((i) => Ke(i, e)) : Ke(o, e);
1818
1866
  };
1819
1867
  });
1820
- function nt(e, t) {
1868
+ function Ke(e, t) {
1821
1869
  return !e.issues.length && e.value === void 0 && e.issues.push({
1822
1870
  code: "invalid_type",
1823
1871
  expected: "nonoptional",
@@ -1825,15 +1873,15 @@ function nt(e, t) {
1825
1873
  inst: t
1826
1874
  }), e;
1827
1875
  }
1828
- const zo = /* @__PURE__ */ a("$ZodCatch", (e, t) => {
1829
- S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1876
+ const lo = /* @__PURE__ */ a("$ZodCatch", (e, t) => {
1877
+ Z.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1830
1878
  if (r.direction === "backward")
1831
1879
  return t.innerType._zod.run(n, r);
1832
1880
  const o = t.innerType._zod.run(n, r);
1833
1881
  return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
1834
1882
  ...n,
1835
1883
  error: {
1836
- issues: i.issues.map((s) => V(s, r, M()))
1884
+ issues: i.issues.map((c) => V(c, r, M()))
1837
1885
  },
1838
1886
  input: n.value
1839
1887
  }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
@@ -1844,39 +1892,39 @@ const zo = /* @__PURE__ */ a("$ZodCatch", (e, t) => {
1844
1892
  input: n.value
1845
1893
  }), n.issues = []), n);
1846
1894
  };
1847
- }), yo = /* @__PURE__ */ a("$ZodPipe", (e, t) => {
1848
- S.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), w(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1895
+ }), fo = /* @__PURE__ */ a("$ZodPipe", (e, t) => {
1896
+ Z.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), w(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1849
1897
  if (r.direction === "backward") {
1850
1898
  const i = t.out._zod.run(n, r);
1851
- return i instanceof Promise ? i.then((s) => se(s, t.in, r)) : se(i, t.in, r);
1899
+ return i instanceof Promise ? i.then((c) => oe(c, t.in, r)) : oe(i, t.in, r);
1852
1900
  }
1853
1901
  const o = t.in._zod.run(n, r);
1854
- return o instanceof Promise ? o.then((i) => se(i, t.out, r)) : se(o, t.out, r);
1902
+ return o instanceof Promise ? o.then((i) => oe(i, t.out, r)) : oe(o, t.out, r);
1855
1903
  };
1856
1904
  });
1857
- function se(e, t, n) {
1905
+ function oe(e, t, n) {
1858
1906
  return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
1859
1907
  }
1860
- const $o = /* @__PURE__ */ a("$ZodReadonly", (e, t) => {
1861
- S.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
1908
+ const ho = /* @__PURE__ */ a("$ZodReadonly", (e, t) => {
1909
+ Z.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
1862
1910
  if (r.direction === "backward")
1863
1911
  return t.innerType._zod.run(n, r);
1864
1912
  const o = t.innerType._zod.run(n, r);
1865
- return o instanceof Promise ? o.then(rt) : rt(o);
1913
+ return o instanceof Promise ? o.then(Qe) : Qe(o);
1866
1914
  };
1867
1915
  });
1868
- function rt(e) {
1916
+ function Qe(e) {
1869
1917
  return e.value = Object.freeze(e.value), e;
1870
1918
  }
1871
- const Zo = /* @__PURE__ */ a("$ZodCustom", (e, t) => {
1872
- O.init(e, t), S.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1919
+ const mo = /* @__PURE__ */ a("$ZodCustom", (e, t) => {
1920
+ I.init(e, t), Z.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1873
1921
  const r = n.value, o = t.fn(r);
1874
1922
  if (o instanceof Promise)
1875
- return o.then((i) => ot(i, n, r, e));
1876
- ot(o, n, r, e);
1923
+ return o.then((i) => et(i, n, r, e));
1924
+ et(o, n, r, e);
1877
1925
  };
1878
1926
  });
1879
- function ot(e, t, n, r) {
1927
+ function et(e, t, n, r) {
1880
1928
  if (!e) {
1881
1929
  const o = {
1882
1930
  code: "custom",
@@ -1888,10 +1936,10 @@ function ot(e, t, n, r) {
1888
1936
  continue: !r._zod.def.abort
1889
1937
  // params: inst._zod.def.params,
1890
1938
  };
1891
- r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(te(o));
1939
+ r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(K(o));
1892
1940
  }
1893
1941
  }
1894
- class Eo {
1942
+ class po {
1895
1943
  constructor() {
1896
1944
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1897
1945
  }
@@ -1925,17 +1973,17 @@ class Eo {
1925
1973
  return this._map.has(t);
1926
1974
  }
1927
1975
  }
1928
- function xo() {
1929
- return new Eo();
1976
+ function _o() {
1977
+ return new po();
1930
1978
  }
1931
- const ce = /* @__PURE__ */ xo();
1932
- function To(e, t) {
1979
+ const ie = /* @__PURE__ */ _o();
1980
+ function go(e, t) {
1933
1981
  return new e({
1934
1982
  type: "string",
1935
1983
  ...m(t)
1936
1984
  });
1937
1985
  }
1938
- function So(e, t) {
1986
+ function vo(e, t) {
1939
1987
  return new e({
1940
1988
  type: "string",
1941
1989
  format: "email",
@@ -1944,7 +1992,7 @@ function So(e, t) {
1944
1992
  ...m(t)
1945
1993
  });
1946
1994
  }
1947
- function it(e, t) {
1995
+ function tt(e, t) {
1948
1996
  return new e({
1949
1997
  type: "string",
1950
1998
  format: "guid",
@@ -1953,7 +2001,7 @@ function it(e, t) {
1953
2001
  ...m(t)
1954
2002
  });
1955
2003
  }
1956
- function Io(e, t) {
2004
+ function bo(e, t) {
1957
2005
  return new e({
1958
2006
  type: "string",
1959
2007
  format: "uuid",
@@ -1962,7 +2010,7 @@ function Io(e, t) {
1962
2010
  ...m(t)
1963
2011
  });
1964
2012
  }
1965
- function jo(e, t) {
2013
+ function wo(e, t) {
1966
2014
  return new e({
1967
2015
  type: "string",
1968
2016
  format: "uuid",
@@ -1972,7 +2020,7 @@ function jo(e, t) {
1972
2020
  ...m(t)
1973
2021
  });
1974
2022
  }
1975
- function Ao(e, t) {
2023
+ function ko(e, t) {
1976
2024
  return new e({
1977
2025
  type: "string",
1978
2026
  format: "uuid",
@@ -1982,7 +2030,7 @@ function Ao(e, t) {
1982
2030
  ...m(t)
1983
2031
  });
1984
2032
  }
1985
- function Co(e, t) {
2033
+ function zo(e, t) {
1986
2034
  return new e({
1987
2035
  type: "string",
1988
2036
  format: "uuid",
@@ -1992,7 +2040,7 @@ function Co(e, t) {
1992
2040
  ...m(t)
1993
2041
  });
1994
2042
  }
1995
- function Oo(e, t) {
2043
+ function yo(e, t) {
1996
2044
  return new e({
1997
2045
  type: "string",
1998
2046
  format: "url",
@@ -2001,7 +2049,7 @@ function Oo(e, t) {
2001
2049
  ...m(t)
2002
2050
  });
2003
2051
  }
2004
- function Ro(e, t) {
2052
+ function $o(e, t) {
2005
2053
  return new e({
2006
2054
  type: "string",
2007
2055
  format: "emoji",
@@ -2010,7 +2058,7 @@ function Ro(e, t) {
2010
2058
  ...m(t)
2011
2059
  });
2012
2060
  }
2013
- function Po(e, t) {
2061
+ function Zo(e, t) {
2014
2062
  return new e({
2015
2063
  type: "string",
2016
2064
  format: "nanoid",
@@ -2019,7 +2067,7 @@ function Po(e, t) {
2019
2067
  ...m(t)
2020
2068
  });
2021
2069
  }
2022
- function No(e, t) {
2070
+ function Eo(e, t) {
2023
2071
  return new e({
2024
2072
  type: "string",
2025
2073
  format: "cuid",
@@ -2028,7 +2076,7 @@ function No(e, t) {
2028
2076
  ...m(t)
2029
2077
  });
2030
2078
  }
2031
- function Do(e, t) {
2079
+ function xo(e, t) {
2032
2080
  return new e({
2033
2081
  type: "string",
2034
2082
  format: "cuid2",
@@ -2037,7 +2085,7 @@ function Do(e, t) {
2037
2085
  ...m(t)
2038
2086
  });
2039
2087
  }
2040
- function Uo(e, t) {
2088
+ function To(e, t) {
2041
2089
  return new e({
2042
2090
  type: "string",
2043
2091
  format: "ulid",
@@ -2046,7 +2094,7 @@ function Uo(e, t) {
2046
2094
  ...m(t)
2047
2095
  });
2048
2096
  }
2049
- function Fo(e, t) {
2097
+ function Ao(e, t) {
2050
2098
  return new e({
2051
2099
  type: "string",
2052
2100
  format: "xid",
@@ -2055,7 +2103,7 @@ function Fo(e, t) {
2055
2103
  ...m(t)
2056
2104
  });
2057
2105
  }
2058
- function Lo(e, t) {
2106
+ function jo(e, t) {
2059
2107
  return new e({
2060
2108
  type: "string",
2061
2109
  format: "ksuid",
@@ -2064,7 +2112,7 @@ function Lo(e, t) {
2064
2112
  ...m(t)
2065
2113
  });
2066
2114
  }
2067
- function Mo(e, t) {
2115
+ function Io(e, t) {
2068
2116
  return new e({
2069
2117
  type: "string",
2070
2118
  format: "ipv4",
@@ -2073,7 +2121,7 @@ function Mo(e, t) {
2073
2121
  ...m(t)
2074
2122
  });
2075
2123
  }
2076
- function Vo(e, t) {
2124
+ function So(e, t) {
2077
2125
  return new e({
2078
2126
  type: "string",
2079
2127
  format: "ipv6",
@@ -2082,7 +2130,7 @@ function Vo(e, t) {
2082
2130
  ...m(t)
2083
2131
  });
2084
2132
  }
2085
- function Wo(e, t) {
2133
+ function Co(e, t) {
2086
2134
  return new e({
2087
2135
  type: "string",
2088
2136
  format: "cidrv4",
@@ -2091,7 +2139,7 @@ function Wo(e, t) {
2091
2139
  ...m(t)
2092
2140
  });
2093
2141
  }
2094
- function Bo(e, t) {
2142
+ function Oo(e, t) {
2095
2143
  return new e({
2096
2144
  type: "string",
2097
2145
  format: "cidrv6",
@@ -2100,7 +2148,7 @@ function Bo(e, t) {
2100
2148
  ...m(t)
2101
2149
  });
2102
2150
  }
2103
- function Yo(e, t) {
2151
+ function Ro(e, t) {
2104
2152
  return new e({
2105
2153
  type: "string",
2106
2154
  format: "base64",
@@ -2109,7 +2157,7 @@ function Yo(e, t) {
2109
2157
  ...m(t)
2110
2158
  });
2111
2159
  }
2112
- function Ho(e, t) {
2160
+ function Po(e, t) {
2113
2161
  return new e({
2114
2162
  type: "string",
2115
2163
  format: "base64url",
@@ -2118,7 +2166,7 @@ function Ho(e, t) {
2118
2166
  ...m(t)
2119
2167
  });
2120
2168
  }
2121
- function Jo(e, t) {
2169
+ function No(e, t) {
2122
2170
  return new e({
2123
2171
  type: "string",
2124
2172
  format: "e164",
@@ -2127,7 +2175,7 @@ function Jo(e, t) {
2127
2175
  ...m(t)
2128
2176
  });
2129
2177
  }
2130
- function Go(e, t) {
2178
+ function Do(e, t) {
2131
2179
  return new e({
2132
2180
  type: "string",
2133
2181
  format: "jwt",
@@ -2136,7 +2184,7 @@ function Go(e, t) {
2136
2184
  ...m(t)
2137
2185
  });
2138
2186
  }
2139
- function qo(e, t) {
2187
+ function Uo(e, t) {
2140
2188
  return new e({
2141
2189
  type: "string",
2142
2190
  format: "datetime",
@@ -2147,7 +2195,7 @@ function qo(e, t) {
2147
2195
  ...m(t)
2148
2196
  });
2149
2197
  }
2150
- function Xo(e, t) {
2198
+ function Lo(e, t) {
2151
2199
  return new e({
2152
2200
  type: "string",
2153
2201
  format: "date",
@@ -2155,7 +2203,7 @@ function Xo(e, t) {
2155
2203
  ...m(t)
2156
2204
  });
2157
2205
  }
2158
- function Ko(e, t) {
2206
+ function Fo(e, t) {
2159
2207
  return new e({
2160
2208
  type: "string",
2161
2209
  format: "time",
@@ -2164,7 +2212,7 @@ function Ko(e, t) {
2164
2212
  ...m(t)
2165
2213
  });
2166
2214
  }
2167
- function Qo(e, t) {
2215
+ function Mo(e, t) {
2168
2216
  return new e({
2169
2217
  type: "string",
2170
2218
  format: "duration",
@@ -2172,14 +2220,14 @@ function Qo(e, t) {
2172
2220
  ...m(t)
2173
2221
  });
2174
2222
  }
2175
- function ei(e, t) {
2223
+ function Vo(e, t) {
2176
2224
  return new e({
2177
2225
  type: "number",
2178
2226
  checks: [],
2179
2227
  ...m(t)
2180
2228
  });
2181
2229
  }
2182
- function ti(e, t) {
2230
+ function Wo(e, t) {
2183
2231
  return new e({
2184
2232
  type: "number",
2185
2233
  check: "number_format",
@@ -2188,148 +2236,148 @@ function ti(e, t) {
2188
2236
  ...m(t)
2189
2237
  });
2190
2238
  }
2191
- function ni(e, t) {
2239
+ function Bo(e, t) {
2192
2240
  return new e({
2193
2241
  type: "boolean",
2194
2242
  ...m(t)
2195
2243
  });
2196
2244
  }
2197
- function ri(e) {
2245
+ function Yo(e) {
2198
2246
  return new e({
2199
2247
  type: "unknown"
2200
2248
  });
2201
2249
  }
2202
- function oi(e, t) {
2250
+ function qo(e, t) {
2203
2251
  return new e({
2204
2252
  type: "never",
2205
2253
  ...m(t)
2206
2254
  });
2207
2255
  }
2208
- function st(e, t) {
2209
- return new At({
2256
+ function nt(e, t) {
2257
+ return new Zt({
2210
2258
  check: "less_than",
2211
2259
  ...m(t),
2212
2260
  value: e,
2213
2261
  inclusive: !1
2214
2262
  });
2215
2263
  }
2216
- function ye(e, t) {
2217
- return new At({
2264
+ function we(e, t) {
2265
+ return new Zt({
2218
2266
  check: "less_than",
2219
2267
  ...m(t),
2220
2268
  value: e,
2221
2269
  inclusive: !0
2222
2270
  });
2223
2271
  }
2224
- function ct(e, t) {
2225
- return new Ct({
2272
+ function rt(e, t) {
2273
+ return new Et({
2226
2274
  check: "greater_than",
2227
2275
  ...m(t),
2228
2276
  value: e,
2229
2277
  inclusive: !1
2230
2278
  });
2231
2279
  }
2232
- function $e(e, t) {
2233
- return new Ct({
2280
+ function ke(e, t) {
2281
+ return new Et({
2234
2282
  check: "greater_than",
2235
2283
  ...m(t),
2236
2284
  value: e,
2237
2285
  inclusive: !0
2238
2286
  });
2239
2287
  }
2240
- function at(e, t) {
2241
- return new wr({
2288
+ function ot(e, t) {
2289
+ return new ur({
2242
2290
  check: "multiple_of",
2243
2291
  ...m(t),
2244
2292
  value: e
2245
2293
  });
2246
2294
  }
2247
- function Dt(e, t) {
2248
- return new zr({
2295
+ function It(e, t) {
2296
+ return new dr({
2249
2297
  check: "max_length",
2250
2298
  ...m(t),
2251
2299
  maximum: e
2252
2300
  });
2253
2301
  }
2254
- function fe(e, t) {
2255
- return new yr({
2302
+ function de(e, t) {
2303
+ return new fr({
2256
2304
  check: "min_length",
2257
2305
  ...m(t),
2258
2306
  minimum: e
2259
2307
  });
2260
2308
  }
2261
- function Ut(e, t) {
2262
- return new $r({
2309
+ function St(e, t) {
2310
+ return new hr({
2263
2311
  check: "length_equals",
2264
2312
  ...m(t),
2265
2313
  length: e
2266
2314
  });
2267
2315
  }
2268
- function ii(e, t) {
2269
- return new Zr({
2316
+ function Jo(e, t) {
2317
+ return new mr({
2270
2318
  check: "string_format",
2271
2319
  format: "regex",
2272
2320
  ...m(t),
2273
2321
  pattern: e
2274
2322
  });
2275
2323
  }
2276
- function si(e) {
2277
- return new Er({
2324
+ function Go(e) {
2325
+ return new pr({
2278
2326
  check: "string_format",
2279
2327
  format: "lowercase",
2280
2328
  ...m(e)
2281
2329
  });
2282
2330
  }
2283
- function ci(e) {
2284
- return new xr({
2331
+ function Ho(e) {
2332
+ return new _r({
2285
2333
  check: "string_format",
2286
2334
  format: "uppercase",
2287
2335
  ...m(e)
2288
2336
  });
2289
2337
  }
2290
- function ai(e, t) {
2291
- return new Tr({
2338
+ function Xo(e, t) {
2339
+ return new gr({
2292
2340
  check: "string_format",
2293
2341
  format: "includes",
2294
2342
  ...m(t),
2295
2343
  includes: e
2296
2344
  });
2297
2345
  }
2298
- function ui(e, t) {
2299
- return new Sr({
2346
+ function Ko(e, t) {
2347
+ return new vr({
2300
2348
  check: "string_format",
2301
2349
  format: "starts_with",
2302
2350
  ...m(t),
2303
2351
  prefix: e
2304
2352
  });
2305
2353
  }
2306
- function li(e, t) {
2307
- return new Ir({
2354
+ function Qo(e, t) {
2355
+ return new br({
2308
2356
  check: "string_format",
2309
2357
  format: "ends_with",
2310
2358
  ...m(t),
2311
2359
  suffix: e
2312
2360
  });
2313
2361
  }
2314
- function ne(e) {
2315
- return new jr({
2362
+ function Q(e) {
2363
+ return new wr({
2316
2364
  check: "overwrite",
2317
2365
  tx: e
2318
2366
  });
2319
2367
  }
2320
- function di(e) {
2321
- return ne((t) => t.normalize(e));
2368
+ function ei(e) {
2369
+ return Q((t) => t.normalize(e));
2322
2370
  }
2323
- function fi() {
2324
- return ne((e) => e.trim());
2371
+ function ti() {
2372
+ return Q((e) => e.trim());
2325
2373
  }
2326
- function hi() {
2327
- return ne((e) => e.toLowerCase());
2374
+ function ni() {
2375
+ return Q((e) => e.toLowerCase());
2328
2376
  }
2329
- function mi() {
2330
- return ne((e) => e.toUpperCase());
2377
+ function ri() {
2378
+ return Q((e) => e.toUpperCase());
2331
2379
  }
2332
- function pi(e, t, n) {
2380
+ function oi(e, t, n) {
2333
2381
  return new e({
2334
2382
  type: "array",
2335
2383
  element: t,
@@ -2339,7 +2387,7 @@ function pi(e, t, n) {
2339
2387
  ...m(n)
2340
2388
  });
2341
2389
  }
2342
- function gi(e, t, n) {
2390
+ function ii(e, t, n) {
2343
2391
  return new e({
2344
2392
  type: "custom",
2345
2393
  check: "custom",
@@ -2347,67 +2395,67 @@ function gi(e, t, n) {
2347
2395
  ...m(n)
2348
2396
  });
2349
2397
  }
2350
- function _i(e) {
2351
- const t = vi((n) => (n.addIssue = (r) => {
2398
+ function ci(e) {
2399
+ const t = si((n) => (n.addIssue = (r) => {
2352
2400
  if (typeof r == "string")
2353
- n.issues.push(te(r, n.value, t._zod.def));
2401
+ n.issues.push(K(r, n.value, t._zod.def));
2354
2402
  else {
2355
2403
  const o = r;
2356
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(te(o));
2404
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(K(o));
2357
2405
  }
2358
2406
  }, e(n.value, n)));
2359
2407
  return t;
2360
2408
  }
2361
- function vi(e, t) {
2362
- const n = new O({
2409
+ function si(e, t) {
2410
+ const n = new I({
2363
2411
  check: "custom",
2364
2412
  ...m(t)
2365
2413
  });
2366
2414
  return n._zod.check = e, n;
2367
2415
  }
2368
- const bi = /* @__PURE__ */ a("ZodISODateTime", (e, t) => {
2369
- Br.init(e, t), Z.init(e, t);
2416
+ const ai = /* @__PURE__ */ a("ZodISODateTime", (e, t) => {
2417
+ Or.init(e, t), z.init(e, t);
2370
2418
  });
2371
- function wi(e) {
2372
- return qo(bi, e);
2419
+ function ui(e) {
2420
+ return Uo(ai, e);
2373
2421
  }
2374
- const ki = /* @__PURE__ */ a("ZodISODate", (e, t) => {
2375
- Yr.init(e, t), Z.init(e, t);
2422
+ const li = /* @__PURE__ */ a("ZodISODate", (e, t) => {
2423
+ Rr.init(e, t), z.init(e, t);
2376
2424
  });
2377
- function zi(e) {
2378
- return Xo(ki, e);
2425
+ function di(e) {
2426
+ return Lo(li, e);
2379
2427
  }
2380
- const yi = /* @__PURE__ */ a("ZodISOTime", (e, t) => {
2381
- Hr.init(e, t), Z.init(e, t);
2428
+ const fi = /* @__PURE__ */ a("ZodISOTime", (e, t) => {
2429
+ Pr.init(e, t), z.init(e, t);
2382
2430
  });
2383
- function $i(e) {
2384
- return Ko(yi, e);
2431
+ function hi(e) {
2432
+ return Fo(fi, e);
2385
2433
  }
2386
- const Zi = /* @__PURE__ */ a("ZodISODuration", (e, t) => {
2387
- Jr.init(e, t), Z.init(e, t);
2434
+ const mi = /* @__PURE__ */ a("ZodISODuration", (e, t) => {
2435
+ Nr.init(e, t), z.init(e, t);
2388
2436
  });
2389
- function Ei(e) {
2390
- return Qo(Zi, e);
2437
+ function pi(e) {
2438
+ return Mo(mi, e);
2391
2439
  }
2392
- const xi = (e, t) => {
2393
- Et.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2440
+ const _i = (e, t) => {
2441
+ bt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2394
2442
  format: {
2395
- value: (n) => Pn(e, n)
2443
+ value: (n) => Zn(e, n)
2396
2444
  // enumerable: false,
2397
2445
  },
2398
2446
  flatten: {
2399
- value: (n) => Rn(e, n)
2447
+ value: (n) => $n(e, n)
2400
2448
  // enumerable: false,
2401
2449
  },
2402
2450
  addIssue: {
2403
2451
  value: (n) => {
2404
- e.issues.push(n), e.message = JSON.stringify(e.issues, Ee, 2);
2452
+ e.issues.push(n), e.message = JSON.stringify(e.issues, ze, 2);
2405
2453
  }
2406
2454
  // enumerable: false,
2407
2455
  },
2408
2456
  addIssues: {
2409
2457
  value: (n) => {
2410
- e.issues.push(...n), e.message = JSON.stringify(e.issues, Ee, 2);
2458
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, ze, 2);
2411
2459
  }
2412
2460
  // enumerable: false,
2413
2461
  },
@@ -2418,156 +2466,156 @@ const xi = (e, t) => {
2418
2466
  // enumerable: false,
2419
2467
  }
2420
2468
  });
2421
- }, R = a("ZodError", xi, {
2469
+ }, O = a("ZodError", _i, {
2422
2470
  Parent: Error
2423
- }), Ti = /* @__PURE__ */ Re(R), Si = /* @__PURE__ */ Pe(R), Ii = /* @__PURE__ */ me(R), ji = /* @__PURE__ */ pe(R), Ai = /* @__PURE__ */ Un(R), Ci = /* @__PURE__ */ Fn(R), Oi = /* @__PURE__ */ Ln(R), Ri = /* @__PURE__ */ Mn(R), Pi = /* @__PURE__ */ Vn(R), Ni = /* @__PURE__ */ Wn(R), Di = /* @__PURE__ */ Bn(R), Ui = /* @__PURE__ */ Yn(R), I = /* @__PURE__ */ a("ZodType", (e, t) => (S.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
2471
+ }), gi = /* @__PURE__ */ Ie(O), vi = /* @__PURE__ */ Se(O), bi = /* @__PURE__ */ he(O), wi = /* @__PURE__ */ me(O), ki = /* @__PURE__ */ Tn(O), zi = /* @__PURE__ */ An(O), yi = /* @__PURE__ */ jn(O), $i = /* @__PURE__ */ In(O), Zi = /* @__PURE__ */ Sn(O), Ei = /* @__PURE__ */ Cn(O), xi = /* @__PURE__ */ On(O), Ti = /* @__PURE__ */ Rn(O), E = /* @__PURE__ */ a("ZodType", (e, t) => (Z.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
2424
2472
  checks: [
2425
2473
  ...t.checks ?? [],
2426
2474
  ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2427
2475
  ]
2428
- })), e.clone = (n, r) => L(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Ti(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ii(e, n, r), e.parseAsync = async (n, r) => Si(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ji(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Ai(e, n, r), e.decode = (n, r) => Ci(e, n, r), e.encodeAsync = async (n, r) => Oi(e, n, r), e.decodeAsync = async (n, r) => Ri(e, n, r), e.safeEncode = (n, r) => Pi(e, n, r), e.safeDecode = (n, r) => Ni(e, n, r), e.safeEncodeAsync = async (n, r) => Di(e, n, r), e.safeDecodeAsync = async (n, r) => Ui(e, n, r), e.refine = (n, r) => e.check(Is(n, r)), e.superRefine = (n) => e.check(js(n)), e.overwrite = (n) => e.check(ne(n)), e.optional = () => mt(e), e.nullable = () => pt(e), e.nullish = () => mt(pt(e)), e.nonoptional = (n) => ys(e, n), e.array = () => ls(e), e.or = (n) => hs([e, n]), e.and = (n) => ps(e, n), e.transform = (n) => gt(e, _s(n)), e.default = (n) => ws(e, n), e.prefault = (n) => zs(e, n), e.catch = (n) => Zs(e, n), e.pipe = (n) => gt(e, n), e.readonly = () => Ts(e), e.describe = (n) => {
2476
+ })), e.clone = (n, r) => L(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => gi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => bi(e, n, r), e.parseAsync = async (n, r) => vi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => wi(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => ki(e, n, r), e.decode = (n, r) => zi(e, n, r), e.encodeAsync = async (n, r) => yi(e, n, r), e.decodeAsync = async (n, r) => $i(e, n, r), e.safeEncode = (n, r) => Zi(e, n, r), e.safeDecode = (n, r) => Ei(e, n, r), e.safeEncodeAsync = async (n, r) => xi(e, n, r), e.safeDecodeAsync = async (n, r) => Ti(e, n, r), e.refine = (n, r) => e.check(bc(n, r)), e.superRefine = (n) => e.check(wc(n)), e.overwrite = (n) => e.check(Q(n)), e.optional = () => lt(e), e.nullable = () => dt(e), e.nullish = () => lt(dt(e)), e.nonoptional = (n) => fc(e, n), e.array = () => Qi(e), e.or = (n) => nc([e, n]), e.and = (n) => oc(e, n), e.transform = (n) => ft(e, cc(n)), e.default = (n) => uc(e, n), e.prefault = (n) => dc(e, n), e.catch = (n) => mc(e, n), e.pipe = (n) => ft(e, n), e.readonly = () => gc(e), e.describe = (n) => {
2429
2477
  const r = e.clone();
2430
- return ce.add(r, { description: n }), r;
2478
+ return ie.add(r, { description: n }), r;
2431
2479
  }, Object.defineProperty(e, "description", {
2432
2480
  get() {
2433
- return ce.get(e)?.description;
2481
+ return ie.get(e)?.description;
2434
2482
  },
2435
2483
  configurable: !0
2436
2484
  }), e.meta = (...n) => {
2437
2485
  if (n.length === 0)
2438
- return ce.get(e);
2486
+ return ie.get(e);
2439
2487
  const r = e.clone();
2440
- return ce.add(r, n[0]), r;
2441
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ft = /* @__PURE__ */ a("_ZodString", (e, t) => {
2442
- Ne.init(e, t), I.init(e, t);
2488
+ return ie.add(r, n[0]), r;
2489
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ct = /* @__PURE__ */ a("_ZodString", (e, t) => {
2490
+ Ce.init(e, t), E.init(e, t);
2443
2491
  const n = e._zod.bag;
2444
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(ii(...r)), e.includes = (...r) => e.check(ai(...r)), e.startsWith = (...r) => e.check(ui(...r)), e.endsWith = (...r) => e.check(li(...r)), e.min = (...r) => e.check(fe(...r)), e.max = (...r) => e.check(Dt(...r)), e.length = (...r) => e.check(Ut(...r)), e.nonempty = (...r) => e.check(fe(1, ...r)), e.lowercase = (r) => e.check(si(r)), e.uppercase = (r) => e.check(ci(r)), e.trim = () => e.check(fi()), e.normalize = (...r) => e.check(di(...r)), e.toLowerCase = () => e.check(hi()), e.toUpperCase = () => e.check(mi());
2445
- }), Fi = /* @__PURE__ */ a("ZodString", (e, t) => {
2446
- Ne.init(e, t), Ft.init(e, t), e.email = (n) => e.check(So(Li, n)), e.url = (n) => e.check(Oo(Mi, n)), e.jwt = (n) => e.check(Go(rs, n)), e.emoji = (n) => e.check(Ro(Vi, n)), e.guid = (n) => e.check(it(ut, n)), e.uuid = (n) => e.check(Io(ue, n)), e.uuidv4 = (n) => e.check(jo(ue, n)), e.uuidv6 = (n) => e.check(Ao(ue, n)), e.uuidv7 = (n) => e.check(Co(ue, n)), e.nanoid = (n) => e.check(Po(Wi, n)), e.guid = (n) => e.check(it(ut, n)), e.cuid = (n) => e.check(No(Bi, n)), e.cuid2 = (n) => e.check(Do(Yi, n)), e.ulid = (n) => e.check(Uo(Hi, n)), e.base64 = (n) => e.check(Yo(es, n)), e.base64url = (n) => e.check(Ho(ts, n)), e.xid = (n) => e.check(Fo(Ji, n)), e.ksuid = (n) => e.check(Lo(Gi, n)), e.ipv4 = (n) => e.check(Mo(qi, n)), e.ipv6 = (n) => e.check(Vo(Xi, n)), e.cidrv4 = (n) => e.check(Wo(Ki, n)), e.cidrv6 = (n) => e.check(Bo(Qi, n)), e.e164 = (n) => e.check(Jo(ns, n)), e.datetime = (n) => e.check(wi(n)), e.date = (n) => e.check(zi(n)), e.time = (n) => e.check($i(n)), e.duration = (n) => e.check(Ei(n));
2492
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Jo(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(de(...r)), e.max = (...r) => e.check(It(...r)), e.length = (...r) => e.check(St(...r)), e.nonempty = (...r) => e.check(de(1, ...r)), e.lowercase = (r) => e.check(Go(r)), e.uppercase = (r) => e.check(Ho(r)), e.trim = () => e.check(ti()), e.normalize = (...r) => e.check(ei(...r)), e.toLowerCase = () => e.check(ni()), e.toUpperCase = () => e.check(ri());
2493
+ }), Ai = /* @__PURE__ */ a("ZodString", (e, t) => {
2494
+ Ce.init(e, t), Ct.init(e, t), e.email = (n) => e.check(vo(ji, n)), e.url = (n) => e.check(yo(Ii, n)), e.jwt = (n) => e.check(Do(Yi, n)), e.emoji = (n) => e.check($o(Si, n)), e.guid = (n) => e.check(tt(it, n)), e.uuid = (n) => e.check(bo(se, n)), e.uuidv4 = (n) => e.check(wo(se, n)), e.uuidv6 = (n) => e.check(ko(se, n)), e.uuidv7 = (n) => e.check(zo(se, n)), e.nanoid = (n) => e.check(Zo(Ci, n)), e.guid = (n) => e.check(tt(it, n)), e.cuid = (n) => e.check(Eo(Oi, n)), e.cuid2 = (n) => e.check(xo(Ri, n)), e.ulid = (n) => e.check(To(Pi, n)), e.base64 = (n) => e.check(Ro(Vi, n)), e.base64url = (n) => e.check(Po(Wi, n)), e.xid = (n) => e.check(Ao(Ni, n)), e.ksuid = (n) => e.check(jo(Di, n)), e.ipv4 = (n) => e.check(Io(Ui, n)), e.ipv6 = (n) => e.check(So(Li, n)), e.cidrv4 = (n) => e.check(Co(Fi, n)), e.cidrv6 = (n) => e.check(Oo(Mi, n)), e.e164 = (n) => e.check(No(Bi, n)), e.datetime = (n) => e.check(ui(n)), e.date = (n) => e.check(di(n)), e.time = (n) => e.check(hi(n)), e.duration = (n) => e.check(pi(n));
2447
2495
  });
2448
- function ae(e) {
2449
- return To(Fi, e);
2450
- }
2451
- const Z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
2452
- y.init(e, t), Ft.init(e, t);
2453
- }), Li = /* @__PURE__ */ a("ZodEmail", (e, t) => {
2454
- Pr.init(e, t), Z.init(e, t);
2455
- }), ut = /* @__PURE__ */ a("ZodGUID", (e, t) => {
2456
- Or.init(e, t), Z.init(e, t);
2457
- }), ue = /* @__PURE__ */ a("ZodUUID", (e, t) => {
2458
- Rr.init(e, t), Z.init(e, t);
2459
- }), Mi = /* @__PURE__ */ a("ZodURL", (e, t) => {
2460
- Nr.init(e, t), Z.init(e, t);
2461
- }), Vi = /* @__PURE__ */ a("ZodEmoji", (e, t) => {
2462
- Dr.init(e, t), Z.init(e, t);
2463
- }), Wi = /* @__PURE__ */ a("ZodNanoID", (e, t) => {
2464
- Ur.init(e, t), Z.init(e, t);
2465
- }), Bi = /* @__PURE__ */ a("ZodCUID", (e, t) => {
2466
- Fr.init(e, t), Z.init(e, t);
2467
- }), Yi = /* @__PURE__ */ a("ZodCUID2", (e, t) => {
2468
- Lr.init(e, t), Z.init(e, t);
2469
- }), Hi = /* @__PURE__ */ a("ZodULID", (e, t) => {
2470
- Mr.init(e, t), Z.init(e, t);
2471
- }), Ji = /* @__PURE__ */ a("ZodXID", (e, t) => {
2472
- Vr.init(e, t), Z.init(e, t);
2473
- }), Gi = /* @__PURE__ */ a("ZodKSUID", (e, t) => {
2474
- Wr.init(e, t), Z.init(e, t);
2475
- }), qi = /* @__PURE__ */ a("ZodIPv4", (e, t) => {
2476
- Gr.init(e, t), Z.init(e, t);
2477
- }), Xi = /* @__PURE__ */ a("ZodIPv6", (e, t) => {
2478
- qr.init(e, t), Z.init(e, t);
2479
- }), Ki = /* @__PURE__ */ a("ZodCIDRv4", (e, t) => {
2480
- Xr.init(e, t), Z.init(e, t);
2481
- }), Qi = /* @__PURE__ */ a("ZodCIDRv6", (e, t) => {
2482
- Kr.init(e, t), Z.init(e, t);
2483
- }), es = /* @__PURE__ */ a("ZodBase64", (e, t) => {
2484
- Qr.init(e, t), Z.init(e, t);
2485
- }), ts = /* @__PURE__ */ a("ZodBase64URL", (e, t) => {
2486
- to.init(e, t), Z.init(e, t);
2487
- }), ns = /* @__PURE__ */ a("ZodE164", (e, t) => {
2488
- no.init(e, t), Z.init(e, t);
2489
- }), rs = /* @__PURE__ */ a("ZodJWT", (e, t) => {
2490
- oo.init(e, t), Z.init(e, t);
2491
- }), Lt = /* @__PURE__ */ a("ZodNumber", (e, t) => {
2492
- Rt.init(e, t), I.init(e, t), e.gt = (r, o) => e.check(ct(r, o)), e.gte = (r, o) => e.check($e(r, o)), e.min = (r, o) => e.check($e(r, o)), e.lt = (r, o) => e.check(st(r, o)), e.lte = (r, o) => e.check(ye(r, o)), e.max = (r, o) => e.check(ye(r, o)), e.int = (r) => e.check(dt(r)), e.safe = (r) => e.check(dt(r)), e.positive = (r) => e.check(ct(0, r)), e.nonnegative = (r) => e.check($e(0, r)), e.negative = (r) => e.check(st(0, r)), e.nonpositive = (r) => e.check(ye(0, r)), e.multipleOf = (r, o) => e.check(at(r, o)), e.step = (r, o) => e.check(at(r, o)), e.finite = () => e;
2496
+ function ce(e) {
2497
+ return go(Ai, e);
2498
+ }
2499
+ const z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
2500
+ k.init(e, t), Ct.init(e, t);
2501
+ }), ji = /* @__PURE__ */ a("ZodEmail", (e, t) => {
2502
+ Zr.init(e, t), z.init(e, t);
2503
+ }), it = /* @__PURE__ */ a("ZodGUID", (e, t) => {
2504
+ yr.init(e, t), z.init(e, t);
2505
+ }), se = /* @__PURE__ */ a("ZodUUID", (e, t) => {
2506
+ $r.init(e, t), z.init(e, t);
2507
+ }), Ii = /* @__PURE__ */ a("ZodURL", (e, t) => {
2508
+ Er.init(e, t), z.init(e, t);
2509
+ }), Si = /* @__PURE__ */ a("ZodEmoji", (e, t) => {
2510
+ xr.init(e, t), z.init(e, t);
2511
+ }), Ci = /* @__PURE__ */ a("ZodNanoID", (e, t) => {
2512
+ Tr.init(e, t), z.init(e, t);
2513
+ }), Oi = /* @__PURE__ */ a("ZodCUID", (e, t) => {
2514
+ Ar.init(e, t), z.init(e, t);
2515
+ }), Ri = /* @__PURE__ */ a("ZodCUID2", (e, t) => {
2516
+ jr.init(e, t), z.init(e, t);
2517
+ }), Pi = /* @__PURE__ */ a("ZodULID", (e, t) => {
2518
+ Ir.init(e, t), z.init(e, t);
2519
+ }), Ni = /* @__PURE__ */ a("ZodXID", (e, t) => {
2520
+ Sr.init(e, t), z.init(e, t);
2521
+ }), Di = /* @__PURE__ */ a("ZodKSUID", (e, t) => {
2522
+ Cr.init(e, t), z.init(e, t);
2523
+ }), Ui = /* @__PURE__ */ a("ZodIPv4", (e, t) => {
2524
+ Dr.init(e, t), z.init(e, t);
2525
+ }), Li = /* @__PURE__ */ a("ZodIPv6", (e, t) => {
2526
+ Ur.init(e, t), z.init(e, t);
2527
+ }), Fi = /* @__PURE__ */ a("ZodCIDRv4", (e, t) => {
2528
+ Lr.init(e, t), z.init(e, t);
2529
+ }), Mi = /* @__PURE__ */ a("ZodCIDRv6", (e, t) => {
2530
+ Fr.init(e, t), z.init(e, t);
2531
+ }), Vi = /* @__PURE__ */ a("ZodBase64", (e, t) => {
2532
+ Mr.init(e, t), z.init(e, t);
2533
+ }), Wi = /* @__PURE__ */ a("ZodBase64URL", (e, t) => {
2534
+ Wr.init(e, t), z.init(e, t);
2535
+ }), Bi = /* @__PURE__ */ a("ZodE164", (e, t) => {
2536
+ Br.init(e, t), z.init(e, t);
2537
+ }), Yi = /* @__PURE__ */ a("ZodJWT", (e, t) => {
2538
+ qr.init(e, t), z.init(e, t);
2539
+ }), Ot = /* @__PURE__ */ a("ZodNumber", (e, t) => {
2540
+ Tt.init(e, t), E.init(e, t), e.gt = (r, o) => e.check(rt(r, o)), e.gte = (r, o) => e.check(ke(r, o)), e.min = (r, o) => e.check(ke(r, o)), e.lt = (r, o) => e.check(nt(r, o)), e.lte = (r, o) => e.check(we(r, o)), e.max = (r, o) => e.check(we(r, o)), e.int = (r) => e.check(st(r)), e.safe = (r) => e.check(st(r)), e.positive = (r) => e.check(rt(0, r)), e.nonnegative = (r) => e.check(ke(0, r)), e.negative = (r) => e.check(nt(0, r)), e.nonpositive = (r) => e.check(we(0, r)), e.multipleOf = (r, o) => e.check(ot(r, o)), e.step = (r, o) => e.check(ot(r, o)), e.finite = () => e;
2493
2541
  const n = e._zod.bag;
2494
2542
  e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
2495
2543
  });
2496
- function lt(e) {
2497
- return ei(Lt, e);
2544
+ function ct(e) {
2545
+ return Vo(Ot, e);
2498
2546
  }
2499
- const os = /* @__PURE__ */ a("ZodNumberFormat", (e, t) => {
2500
- io.init(e, t), Lt.init(e, t);
2547
+ const qi = /* @__PURE__ */ a("ZodNumberFormat", (e, t) => {
2548
+ Jr.init(e, t), Ot.init(e, t);
2501
2549
  });
2502
- function dt(e) {
2503
- return ti(os, e);
2550
+ function st(e) {
2551
+ return Wo(qi, e);
2504
2552
  }
2505
- const is = /* @__PURE__ */ a("ZodBoolean", (e, t) => {
2506
- so.init(e, t), I.init(e, t);
2553
+ const Ji = /* @__PURE__ */ a("ZodBoolean", (e, t) => {
2554
+ Gr.init(e, t), E.init(e, t);
2507
2555
  });
2508
- function ft(e) {
2509
- return ni(is, e);
2556
+ function at(e) {
2557
+ return Bo(Ji, e);
2510
2558
  }
2511
- const ss = /* @__PURE__ */ a("ZodUnknown", (e, t) => {
2512
- co.init(e, t), I.init(e, t);
2559
+ const Gi = /* @__PURE__ */ a("ZodUnknown", (e, t) => {
2560
+ Hr.init(e, t), E.init(e, t);
2513
2561
  });
2514
- function ht() {
2515
- return ri(ss);
2562
+ function ut() {
2563
+ return Yo(Gi);
2516
2564
  }
2517
- const cs = /* @__PURE__ */ a("ZodNever", (e, t) => {
2518
- ao.init(e, t), I.init(e, t);
2565
+ const Hi = /* @__PURE__ */ a("ZodNever", (e, t) => {
2566
+ Xr.init(e, t), E.init(e, t);
2519
2567
  });
2520
- function as(e) {
2521
- return oi(cs, e);
2568
+ function Xi(e) {
2569
+ return qo(Hi, e);
2522
2570
  }
2523
- const us = /* @__PURE__ */ a("ZodArray", (e, t) => {
2524
- uo.init(e, t), I.init(e, t), e.element = t.element, e.min = (n, r) => e.check(fe(n, r)), e.nonempty = (n) => e.check(fe(1, n)), e.max = (n, r) => e.check(Dt(n, r)), e.length = (n, r) => e.check(Ut(n, r)), e.unwrap = () => e.element;
2571
+ const Ki = /* @__PURE__ */ a("ZodArray", (e, t) => {
2572
+ Kr.init(e, t), E.init(e, t), e.element = t.element, e.min = (n, r) => e.check(de(n, r)), e.nonempty = (n) => e.check(de(1, n)), e.max = (n, r) => e.check(It(n, r)), e.length = (n, r) => e.check(St(n, r)), e.unwrap = () => e.element;
2525
2573
  });
2526
- function ls(e, t) {
2527
- return pi(us, e, t);
2574
+ function Qi(e, t) {
2575
+ return oi(Ki, e, t);
2528
2576
  }
2529
- const ds = /* @__PURE__ */ a("ZodObject", (e, t) => {
2530
- fo.init(e, t), I.init(e, t), w(e, "shape", () => t.shape), e.keyof = () => De(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ht() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ht() }), e.strict = () => e.clone({ ...e._zod.def, catchall: as() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => In(e, n), e.safeExtend = (n) => jn(e, n), e.merge = (n) => An(e, n), e.pick = (n) => Tn(e, n), e.omit = (n) => Sn(e, n), e.partial = (...n) => Cn(Mt, e, n[0]), e.required = (...n) => On(Vt, e, n[0]);
2577
+ const ec = /* @__PURE__ */ a("ZodObject", (e, t) => {
2578
+ eo.init(e, t), E.init(e, t), w(e, "shape", () => t.shape), e.keyof = () => Oe(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ut() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ut() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Xi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => bn(e, n), e.safeExtend = (n) => wn(e, n), e.merge = (n) => kn(e, n), e.pick = (n) => gn(e, n), e.omit = (n) => vn(e, n), e.partial = (...n) => zn(Rt, e, n[0]), e.required = (...n) => yn(Pt, e, n[0]);
2531
2579
  });
2532
- function Te(e, t) {
2580
+ function $e(e, t) {
2533
2581
  const n = {
2534
2582
  type: "object",
2535
2583
  shape: e ?? {},
2536
2584
  ...m(t)
2537
2585
  };
2538
- return new ds(n);
2586
+ return new ec(n);
2539
2587
  }
2540
- const fs = /* @__PURE__ */ a("ZodUnion", (e, t) => {
2541
- ho.init(e, t), I.init(e, t), e.options = t.options;
2588
+ const tc = /* @__PURE__ */ a("ZodUnion", (e, t) => {
2589
+ to.init(e, t), E.init(e, t), e.options = t.options;
2542
2590
  });
2543
- function hs(e, t) {
2544
- return new fs({
2591
+ function nc(e, t) {
2592
+ return new tc({
2545
2593
  type: "union",
2546
2594
  options: e,
2547
2595
  ...m(t)
2548
2596
  });
2549
2597
  }
2550
- const ms = /* @__PURE__ */ a("ZodIntersection", (e, t) => {
2551
- mo.init(e, t), I.init(e, t);
2598
+ const rc = /* @__PURE__ */ a("ZodIntersection", (e, t) => {
2599
+ no.init(e, t), E.init(e, t);
2552
2600
  });
2553
- function ps(e, t) {
2554
- return new ms({
2601
+ function oc(e, t) {
2602
+ return new rc({
2555
2603
  type: "intersection",
2556
2604
  left: e,
2557
2605
  right: t
2558
2606
  });
2559
2607
  }
2560
- const Se = /* @__PURE__ */ a("ZodEnum", (e, t) => {
2561
- po.init(e, t), I.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2608
+ const Ze = /* @__PURE__ */ a("ZodEnum", (e, t) => {
2609
+ ro.init(e, t), E.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2562
2610
  const n = new Set(Object.keys(t.entries));
2563
2611
  e.extract = (r, o) => {
2564
2612
  const i = {};
2565
- for (const s of r)
2566
- if (n.has(s))
2567
- i[s] = t.entries[s];
2613
+ for (const c of r)
2614
+ if (n.has(c))
2615
+ i[c] = t.entries[c];
2568
2616
  else
2569
- throw new Error(`Key ${s} not found in enum`);
2570
- return new Se({
2617
+ throw new Error(`Key ${c} not found in enum`);
2618
+ return new Ze({
2571
2619
  ...t,
2572
2620
  checks: [],
2573
2621
  ...m(o),
@@ -2575,12 +2623,12 @@ const Se = /* @__PURE__ */ a("ZodEnum", (e, t) => {
2575
2623
  });
2576
2624
  }, e.exclude = (r, o) => {
2577
2625
  const i = { ...t.entries };
2578
- for (const s of r)
2579
- if (n.has(s))
2580
- delete i[s];
2626
+ for (const c of r)
2627
+ if (n.has(c))
2628
+ delete i[c];
2581
2629
  else
2582
- throw new Error(`Key ${s} not found in enum`);
2583
- return new Se({
2630
+ throw new Error(`Key ${c} not found in enum`);
2631
+ return new Ze({
2584
2632
  ...t,
2585
2633
  checks: [],
2586
2634
  ...m(o),
@@ -2588,618 +2636,179 @@ const Se = /* @__PURE__ */ a("ZodEnum", (e, t) => {
2588
2636
  });
2589
2637
  };
2590
2638
  });
2591
- function De(e, t) {
2639
+ function Oe(e, t) {
2592
2640
  const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2593
- return new Se({
2641
+ return new Ze({
2594
2642
  type: "enum",
2595
2643
  entries: n,
2596
2644
  ...m(t)
2597
2645
  });
2598
2646
  }
2599
- const gs = /* @__PURE__ */ a("ZodTransform", (e, t) => {
2600
- go.init(e, t), I.init(e, t), e._zod.parse = (n, r) => {
2647
+ const ic = /* @__PURE__ */ a("ZodTransform", (e, t) => {
2648
+ oo.init(e, t), E.init(e, t), e._zod.parse = (n, r) => {
2601
2649
  if (r.direction === "backward")
2602
- throw new wt(e.constructor.name);
2650
+ throw new ht(e.constructor.name);
2603
2651
  n.addIssue = (i) => {
2604
2652
  if (typeof i == "string")
2605
- n.issues.push(te(i, n.value, t));
2653
+ n.issues.push(K(i, n.value, t));
2606
2654
  else {
2607
- const s = i;
2608
- s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(te(s));
2655
+ const c = i;
2656
+ c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = n.value), c.inst ?? (c.inst = e), n.issues.push(K(c));
2609
2657
  }
2610
2658
  };
2611
2659
  const o = t.transform(n.value, n);
2612
2660
  return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
2613
2661
  };
2614
2662
  });
2615
- function _s(e) {
2616
- return new gs({
2663
+ function cc(e) {
2664
+ return new ic({
2617
2665
  type: "transform",
2618
2666
  transform: e
2619
2667
  });
2620
2668
  }
2621
- const Mt = /* @__PURE__ */ a("ZodOptional", (e, t) => {
2622
- _o.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2669
+ const Rt = /* @__PURE__ */ a("ZodOptional", (e, t) => {
2670
+ io.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType;
2623
2671
  });
2624
- function mt(e) {
2625
- return new Mt({
2672
+ function lt(e) {
2673
+ return new Rt({
2626
2674
  type: "optional",
2627
2675
  innerType: e
2628
2676
  });
2629
2677
  }
2630
- const vs = /* @__PURE__ */ a("ZodNullable", (e, t) => {
2631
- vo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2678
+ const sc = /* @__PURE__ */ a("ZodNullable", (e, t) => {
2679
+ co.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType;
2632
2680
  });
2633
- function pt(e) {
2634
- return new vs({
2681
+ function dt(e) {
2682
+ return new sc({
2635
2683
  type: "nullable",
2636
2684
  innerType: e
2637
2685
  });
2638
2686
  }
2639
- const bs = /* @__PURE__ */ a("ZodDefault", (e, t) => {
2640
- bo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2687
+ const ac = /* @__PURE__ */ a("ZodDefault", (e, t) => {
2688
+ so.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2641
2689
  });
2642
- function ws(e, t) {
2643
- return new bs({
2690
+ function uc(e, t) {
2691
+ return new ac({
2644
2692
  type: "default",
2645
2693
  innerType: e,
2646
2694
  get defaultValue() {
2647
- return typeof t == "function" ? t() : yt(t);
2695
+ return typeof t == "function" ? t() : _t(t);
2648
2696
  }
2649
2697
  });
2650
2698
  }
2651
- const ks = /* @__PURE__ */ a("ZodPrefault", (e, t) => {
2652
- wo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2699
+ const lc = /* @__PURE__ */ a("ZodPrefault", (e, t) => {
2700
+ ao.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType;
2653
2701
  });
2654
- function zs(e, t) {
2655
- return new ks({
2702
+ function dc(e, t) {
2703
+ return new lc({
2656
2704
  type: "prefault",
2657
2705
  innerType: e,
2658
2706
  get defaultValue() {
2659
- return typeof t == "function" ? t() : yt(t);
2707
+ return typeof t == "function" ? t() : _t(t);
2660
2708
  }
2661
2709
  });
2662
2710
  }
2663
- const Vt = /* @__PURE__ */ a("ZodNonOptional", (e, t) => {
2664
- ko.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2711
+ const Pt = /* @__PURE__ */ a("ZodNonOptional", (e, t) => {
2712
+ uo.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType;
2665
2713
  });
2666
- function ys(e, t) {
2667
- return new Vt({
2714
+ function fc(e, t) {
2715
+ return new Pt({
2668
2716
  type: "nonoptional",
2669
2717
  innerType: e,
2670
2718
  ...m(t)
2671
2719
  });
2672
2720
  }
2673
- const $s = /* @__PURE__ */ a("ZodCatch", (e, t) => {
2674
- zo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2721
+ const hc = /* @__PURE__ */ a("ZodCatch", (e, t) => {
2722
+ lo.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2675
2723
  });
2676
- function Zs(e, t) {
2677
- return new $s({
2724
+ function mc(e, t) {
2725
+ return new hc({
2678
2726
  type: "catch",
2679
2727
  innerType: e,
2680
2728
  catchValue: typeof t == "function" ? t : () => t
2681
2729
  });
2682
2730
  }
2683
- const Es = /* @__PURE__ */ a("ZodPipe", (e, t) => {
2684
- yo.init(e, t), I.init(e, t), e.in = t.in, e.out = t.out;
2731
+ const pc = /* @__PURE__ */ a("ZodPipe", (e, t) => {
2732
+ fo.init(e, t), E.init(e, t), e.in = t.in, e.out = t.out;
2685
2733
  });
2686
- function gt(e, t) {
2687
- return new Es({
2734
+ function ft(e, t) {
2735
+ return new pc({
2688
2736
  type: "pipe",
2689
2737
  in: e,
2690
2738
  out: t
2691
2739
  // ...util.normalizeParams(params),
2692
2740
  });
2693
2741
  }
2694
- const xs = /* @__PURE__ */ a("ZodReadonly", (e, t) => {
2695
- $o.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2742
+ const _c = /* @__PURE__ */ a("ZodReadonly", (e, t) => {
2743
+ ho.init(e, t), E.init(e, t), e.unwrap = () => e._zod.def.innerType;
2696
2744
  });
2697
- function Ts(e) {
2698
- return new xs({
2745
+ function gc(e) {
2746
+ return new _c({
2699
2747
  type: "readonly",
2700
2748
  innerType: e
2701
2749
  });
2702
2750
  }
2703
- const Ss = /* @__PURE__ */ a("ZodCustom", (e, t) => {
2704
- Zo.init(e, t), I.init(e, t);
2751
+ const vc = /* @__PURE__ */ a("ZodCustom", (e, t) => {
2752
+ mo.init(e, t), E.init(e, t);
2705
2753
  });
2706
- function Is(e, t = {}) {
2707
- return gi(Ss, e, t);
2708
- }
2709
- function js(e) {
2710
- return _i(e);
2711
- }
2712
- const Wt = Te({
2713
- title: ae().min(1, "Title is required").max(200, "Title too long"),
2714
- content: ae().min(1, "Content is required"),
2715
- format: De(["html", "markdown"]).default("html"),
2716
- metadata: Te({
2717
- createdAt: ae().datetime(),
2718
- updatedAt: ae().datetime(),
2719
- wordCount: lt().min(0),
2720
- characterCount: lt().min(0)
2754
+ function bc(e, t = {}) {
2755
+ return ii(vc, e, t);
2756
+ }
2757
+ function wc(e) {
2758
+ return ci(e);
2759
+ }
2760
+ const kc = $e({
2761
+ title: ce().min(1, "Title is required").max(200, "Title too long"),
2762
+ content: ce().min(1, "Content is required"),
2763
+ format: Oe(["html", "markdown"]).default("html"),
2764
+ metadata: $e({
2765
+ createdAt: ce().datetime(),
2766
+ updatedAt: ce().datetime(),
2767
+ wordCount: ct().min(0),
2768
+ characterCount: ct().min(0)
2721
2769
  }).optional()
2722
2770
  });
2723
- Te({
2724
- includeStyles: ft().default(!0),
2725
- includeMeta: ft().default(!0),
2726
- format: De(["html", "txt"]).default("html")
2771
+ $e({
2772
+ includeStyles: at().default(!0),
2773
+ includeMeta: at().default(!0),
2774
+ format: Oe(["html", "txt"]).default("html")
2727
2775
  });
2728
- const _t = {
2729
- content: "",
2730
- title: "Untitled Document",
2731
- wordCount: 0,
2732
- characterCount: 0,
2733
- hasUnsavedChanges: !1,
2734
- activeFormats: []
2735
- }, As = (e) => ({
2736
- wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
2737
- characterCount: e.length
2738
- }), Bt = vn()(
2739
- kn(
2740
- (e, t) => ({
2741
- ..._t,
2742
- updateContent: (n) => {
2743
- const r = As(n);
2744
- e({
2745
- content: n,
2746
- ...r,
2747
- hasUnsavedChanges: !0
2748
- });
2749
- },
2750
- updateTitle: (n) => {
2751
- e({
2752
- title: n,
2753
- hasUnsavedChanges: !0
2754
- });
2755
- },
2756
- setActiveFormats: (n) => {
2757
- e({ activeFormats: n });
2758
- },
2759
- clearEditor: () => {
2760
- e({
2761
- ..._t,
2762
- content: "",
2763
- title: "Untitled Document"
2764
- });
2765
- },
2766
- setHasUnsavedChanges: (n) => {
2767
- e({ hasUnsavedChanges: n });
2768
- },
2769
- executeCommand: (n, r) => {
2770
- document.execCommand(n, !1, r);
2771
- const o = document.querySelector('[contenteditable="true"]');
2772
- o && o.focus(), setTimeout(() => {
2773
- t().updateActiveFormats();
2774
- }, 10);
2775
- },
2776
- updateActiveFormats: () => {
2777
- const n = [
2778
- "bold",
2779
- "italic",
2780
- "underline",
2781
- "strikeThrough",
2782
- "justifyLeft",
2783
- "justifyCenter",
2784
- "justifyRight"
2785
- ], r = [];
2786
- n.forEach((o) => {
2787
- document.queryCommandState(o) && r.push(o);
2788
- }), e({ activeFormats: r });
2789
- },
2790
- getValidationResult: () => {
2791
- const n = t();
2792
- try {
2793
- return { success: !0, data: Wt.parse({
2794
- title: n.title,
2795
- content: n.content,
2796
- metadata: {
2797
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2798
- updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2799
- wordCount: n.wordCount,
2800
- characterCount: n.characterCount
2801
- }
2802
- }) };
2803
- } catch (r) {
2804
- return { success: !1, error: r instanceof Error ? r.message : "Validation failed" };
2805
- }
2806
- },
2807
- exportToHTML: (n = { includeStyles: !0, includeMeta: !0 }) => {
2808
- const o = t().getValidationResult();
2809
- if (!o.success)
2810
- throw new Error(o.error);
2811
- const { data: i } = o;
2812
- let s = `<!DOCTYPE html>
2813
- <html>
2814
- <head>
2815
- <meta charset="UTF-8">
2816
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
2817
- <title>${i?.title}</title>`;
2818
- return n.includeStyles && (s += `
2819
- <style>
2820
- body {
2821
- font-family: Arial, sans-serif;
2822
- line-height: 1.6;
2823
- margin: 40px;
2824
- max-width: 800px;
2825
- }
2826
- .editor-content {
2827
- border: 1px solid #ddd;
2828
- padding: 20px;
2829
- border-radius: 8px;
2830
- background: white;
2831
- }
2832
- </style>`), s += `
2833
- </head>
2834
- <body>`, n.includeMeta && (s += `
2835
- <div class="document-meta">
2836
- <h1>${i?.title}</h1>
2837
- <p><small>Created: ${new Date(i?.metadata.createdAt ?? "").toLocaleString()} |
2838
- Words: ${i?.metadata.wordCount} |
2839
- Characters: ${i?.metadata.characterCount}</small></p>
2840
- <hr>
2841
- </div>`), s += `
2842
- <div class="editor-content">
2843
- ${i?.content}
2844
- </div>
2845
- </body>
2846
- </html>`, s;
2847
- }
2848
- }),
2849
- {
2850
- name: "editor-storage",
2851
- partialize: (e) => ({
2852
- content: e.content,
2853
- title: e.title,
2854
- wordCount: e.wordCount,
2855
- characterCount: e.characterCount
2856
- })
2857
- }
2858
- )
2859
- ), Cs = ({
2860
- onSave: e,
2861
- onExport: t,
2862
- onClear: n,
2863
- showButtons: r = !1
2864
- }) => {
2865
- const {
2866
- activeFormats: o,
2867
- hasUnsavedChanges: i,
2868
- executeCommand: s,
2869
- updateActiveFormats: c
2870
- } = Bt();
2871
- Ie(() => {
2872
- const h = () => {
2873
- c();
2874
- };
2875
- return document.addEventListener("selectionchange", h), () => document.removeEventListener("selectionchange", h);
2876
- }, [c]);
2877
- const d = () => {
2878
- const h = prompt("Enter URL:");
2879
- h && s("createLink", h);
2880
- }, l = (h) => {
2881
- s("formatBlock", h);
2882
- }, f = [
2883
- {
2884
- id: "bold",
2885
- command: "bold",
2886
- icon: /* @__PURE__ */ _.jsx(Xt, { size: 18 }),
2887
- title: "Bold",
2888
- onClick: () => s("bold")
2889
- },
2890
- {
2891
- id: "italic",
2892
- command: "italic",
2893
- icon: /* @__PURE__ */ _.jsx(Kt, { size: 18 }),
2894
- title: "Italic",
2895
- onClick: () => s("italic")
2896
- },
2897
- {
2898
- id: "underline",
2899
- command: "underline",
2900
- icon: /* @__PURE__ */ _.jsx(Qt, { size: 18 }),
2901
- title: "Underline",
2902
- onClick: () => s("underline")
2903
- },
2904
- {
2905
- id: "strikeThrough",
2906
- command: "strikeThrough",
2907
- icon: /* @__PURE__ */ _.jsx(en, { size: 18 }),
2908
- title: "Strikethrough",
2909
- onClick: () => s("strikeThrough")
2910
- },
2911
- { id: "separator-1", separator: !0 },
2912
- {
2913
- id: "unordered-list",
2914
- command: "insertUnorderedList",
2915
- icon: /* @__PURE__ */ _.jsx(tn, { size: 18 }),
2916
- title: "Bullet List",
2917
- onClick: () => s("insertUnorderedList")
2918
- },
2919
- {
2920
- id: "ordered-list",
2921
- command: "insertOrderedList",
2922
- icon: /* @__PURE__ */ _.jsx(nn, { size: 18 }),
2923
- title: "Numbered List",
2924
- onClick: () => s("insertOrderedList")
2925
- },
2926
- { id: "separator-2", separator: !0 },
2927
- {
2928
- id: "heading-1",
2929
- command: "formatBlock",
2930
- value: "h1",
2931
- icon: /* @__PURE__ */ _.jsx(rn, { size: 18 }),
2932
- title: "Heading 1",
2933
- onClick: () => l("<h1>")
2934
- },
2935
- {
2936
- id: "heading-2",
2937
- command: "formatBlock",
2938
- value: "h2",
2939
- icon: /* @__PURE__ */ _.jsx(on, { size: 18 }),
2940
- title: "Heading 2",
2941
- onClick: () => l("<h2>")
2942
- },
2943
- {
2944
- id: "paragraph",
2945
- command: "formatBlock",
2946
- value: "p",
2947
- icon: /* @__PURE__ */ _.jsx(sn, { size: 18 }),
2948
- title: "Paragraph",
2949
- onClick: () => l("<p>")
2950
- },
2951
- { id: "separator-3", separator: !0 },
2952
- {
2953
- id: "align-left",
2954
- command: "justifyLeft",
2955
- icon: /* @__PURE__ */ _.jsx(cn, { size: 18 }),
2956
- title: "Align Left",
2957
- onClick: () => s("justifyLeft")
2958
- },
2959
- {
2960
- id: "align-center",
2961
- command: "justifyCenter",
2962
- icon: /* @__PURE__ */ _.jsx(an, { size: 18 }),
2963
- title: "Center",
2964
- onClick: () => s("justifyCenter")
2965
- },
2966
- {
2967
- id: "align-right",
2968
- command: "justifyRight",
2969
- icon: /* @__PURE__ */ _.jsx(un, { size: 18 }),
2970
- title: "Align Right",
2971
- onClick: () => s("justifyRight")
2972
- },
2973
- { id: "separator-4", separator: !0 },
2974
- {
2975
- id: "link",
2976
- command: "createLink",
2977
- icon: /* @__PURE__ */ _.jsx(ln, { size: 18 }),
2978
- title: "Insert Link",
2979
- onClick: d
2980
- }
2981
- ];
2982
- return /* @__PURE__ */ _.jsxs("div", { className: "flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200", children: [
2983
- /* @__PURE__ */ _.jsx("div", { className: "flex flex-wrap items-center gap-1", children: f.map((h) => {
2984
- if ("separator" in h)
2985
- return /* @__PURE__ */ _.jsx("div", { className: "w-px h-6 bg-gray-300 mx-2" }, h.id);
2986
- const p = o.includes(h.command);
2987
- return /* @__PURE__ */ _.jsx(
2988
- "button",
2989
- {
2990
- onClick: h.onClick,
2991
- title: h.title,
2992
- type: "button",
2993
- className: `w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
2994
- ${p ? "bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,
2995
- children: h.icon
2996
- },
2997
- h.id
2998
- );
2999
- }) }),
3000
- r && /* @__PURE__ */ _.jsxs("div", { className: "flex items-center gap-2 mt-2 sm:mt-0", children: [
3001
- /* @__PURE__ */ _.jsxs(
3002
- "button",
3003
- {
3004
- onClick: e,
3005
- disabled: !i,
3006
- title: "Save Document",
3007
- className: "flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",
3008
- children: [
3009
- /* @__PURE__ */ _.jsx(Jt, { size: 16 }),
3010
- /* @__PURE__ */ _.jsx("span", { children: "Save" })
3011
- ]
3012
- }
3013
- ),
3014
- /* @__PURE__ */ _.jsxs(
3015
- "button",
3016
- {
3017
- onClick: t,
3018
- title: "Export as HTML",
3019
- className: "flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",
3020
- children: [
3021
- /* @__PURE__ */ _.jsx(Gt, { size: 16 }),
3022
- /* @__PURE__ */ _.jsx("span", { children: "Export" })
3023
- ]
3024
- }
3025
- ),
3026
- /* @__PURE__ */ _.jsxs(
3027
- "button",
3028
- {
3029
- onClick: n,
3030
- title: "Clear Editor",
3031
- className: "flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",
3032
- children: [
3033
- /* @__PURE__ */ _.jsx(qt, { size: 16 }),
3034
- /* @__PURE__ */ _.jsx("span", { children: "Clear" })
3035
- ]
3036
- }
3037
- )
3038
- ] })
3039
- ] });
3040
- }, Os = ({
3041
- wordCount: e,
3042
- characterCount: t,
3043
- hasUnsavedChanges: n
3044
- }) => /* @__PURE__ */ _.jsx("div", { className: "flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600", children: /* @__PURE__ */ _.jsxs("div", { className: "flex items-center gap-6", children: [
3045
- /* @__PURE__ */ _.jsxs("div", { children: [
3046
- "Words: ",
3047
- /* @__PURE__ */ _.jsx("strong", { className: "text-gray-800", children: e })
3048
- ] }),
3049
- /* @__PURE__ */ _.jsxs("div", { children: [
3050
- "Characters: ",
3051
- /* @__PURE__ */ _.jsx("strong", { className: "text-gray-800", children: t })
3052
- ] }),
3053
- /* @__PURE__ */ _.jsxs("div", { children: [
3054
- "Status: ",
3055
- /* @__PURE__ */ _.jsx("strong", { className: n ? "text-orange-600" : "text-green-600", children: n ? "Unsaved Changes" : "Saved" })
3056
- ] })
3057
- ] }) }), Ns = ({
3058
- initialContent: e = "",
3059
- onSave: t,
3060
- onExport: n,
3061
- onChange: r,
3062
- // Add onChange prop
3063
- showButtons: o = !1,
3064
- // Add option to hide toolbar
3065
- showSaveTitle: i = !1,
3066
- // Add option to hide title section
3067
- showStatusBar: s = !1
3068
- // Add option to hide status bar
3069
- }) => {
3070
- const c = vt(null), [d, l] = bt(!1), {
3071
- content: f,
3072
- title: h,
3073
- wordCount: p,
3074
- characterCount: g,
3075
- hasUnsavedChanges: T,
3076
- updateContent: b,
3077
- updateTitle: C,
3078
- getValidationResult: N,
3079
- exportToHTML: k,
3080
- clearEditor: $,
3081
- setHasUnsavedChanges: z
3082
- } = Bt();
3083
- Ie(() => {
3084
- c.current && e && e !== f && (c.current.innerHTML = e, b(e), z(!1));
3085
- }, [e, f, b, z]);
3086
- const P = F(
3087
- (E) => {
3088
- if (b(E), z(!0), r) {
3089
- const D = k();
3090
- r(E, D);
3091
- }
3092
- },
3093
- [b, z, r, k]
3094
- ), _e = F(
3095
- (E) => {
3096
- if (C(E), z(!0), r) {
3097
- const D = k();
3098
- r(f, D, E);
3099
- }
3100
- },
3101
- [C, z, r, k, f]
3102
- ), ve = () => {
3103
- if (N().success) {
3104
- const D = k();
3105
- t?.(f, D), z(!1);
3106
- } else
3107
- l(!0), setTimeout(() => l(!1), 3e3);
3108
- }, be = () => {
3109
- try {
3110
- const E = k();
3111
- n?.(E);
3112
- const D = new Blob([E], { type: "text/html" }), Y = URL.createObjectURL(D), U = document.createElement("a");
3113
- U.href = Y, U.download = `${h.replace(/\s+/g, "_")}.html`, document.body.appendChild(U), U.click(), document.body.removeChild(U), URL.revokeObjectURL(Y);
3114
- } catch (E) {
3115
- alert(
3116
- "Export failed: " + (E instanceof Error ? E.message : "Unknown error")
3117
- );
3118
- }
3119
- }, q = () => {
3120
- confirm(
3121
- "Are you sure you want to clear the editor? All unsaved changes will be lost."
3122
- ) && ($(), c.current && (c.current.innerHTML = ""), r && r("", ""));
3123
- };
3124
- return /* @__PURE__ */ _.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: [
3125
- i && /* @__PURE__ */ _.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50 rounded-t-xl", children: [
3126
- /* @__PURE__ */ _.jsx(
3127
- "input",
3128
- {
3129
- type: "text",
3130
- className: "w-full bg-transparent text-2xl font-bold text-gray-800 placeholder-gray-500 outline-none border-none focus:ring-0",
3131
- value: h,
3132
- onChange: (E) => _e(E.target.value),
3133
- placeholder: "Document Title"
3134
- }
3135
- ),
3136
- d && /* @__PURE__ */ _.jsx("div", { className: "mt-2 px-3 py-2 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm animate-pulse", children: "Please add content before saving" })
3137
- ] }),
3138
- /* @__PURE__ */ _.jsx(
3139
- Cs,
3140
- {
3141
- onSave: ve,
3142
- onExport: be,
3143
- onClear: q,
3144
- showButtons: o
3145
- }
3146
- ),
3147
- /* @__PURE__ */ _.jsx(
3148
- "div",
3149
- {
3150
- ref: c,
3151
- className: `min-h-[500px] p-8 prose max-w-none border-none outline-none resize-none text-gray-700 leading-relaxed bg-white focus:bg-gray-50 transition-colors duration-200 ${i ? "rounded-t-xl" : ""} ${o ? "border-t-0" : ""}`,
3152
- contentEditable: !0,
3153
- onInput: (E) => P(E.currentTarget.innerHTML),
3154
- onFocus: (E) => E.currentTarget.classList.add("bg-gray-50"),
3155
- onBlur: (E) => E.currentTarget.classList.remove("bg-gray-50")
3156
- }
3157
- ),
3158
- s && /* @__PURE__ */ _.jsx(
3159
- Os,
3160
- {
3161
- wordCount: p,
3162
- characterCount: g,
3163
- hasUnsavedChanges: T
3164
- }
3165
- )
3166
- ] });
3167
- }, Ds = (e = "") => {
3168
- const [t, n] = bt({
2776
+ const zc = (e = "") => {
2777
+ const [t, n] = ae({
3169
2778
  content: e,
3170
2779
  title: "Untitled Document",
3171
2780
  wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
3172
2781
  characterCount: e.length,
3173
2782
  hasUnsavedChanges: !1
3174
- }), r = vt(null);
3175
- Ie(() => {
3176
- r.current && e !== t.content && (r.current.innerHTML = e, n((f) => ({
3177
- ...f,
2783
+ }), r = Mt(null);
2784
+ Ee(() => {
2785
+ r.current && e !== t.content && (r.current.innerHTML = e, n((h) => ({
2786
+ ...h,
3178
2787
  content: e,
3179
2788
  wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
3180
2789
  characterCount: e.length
3181
2790
  })));
3182
2791
  }, [e]);
3183
- const o = F((f) => {
3184
- const h = f.trim() ? f.trim().split(/\s+/).length : 0, p = f.length;
3185
- n((g) => ({
3186
- ...g,
3187
- content: f,
3188
- wordCount: h,
3189
- characterCount: p,
2792
+ const o = P((h) => {
2793
+ const v = h.trim() ? h.trim().split(/\s+/).length : 0, _ = h.length;
2794
+ n((l) => ({
2795
+ ...l,
2796
+ content: h,
2797
+ wordCount: v,
2798
+ characterCount: _,
3190
2799
  hasUnsavedChanges: !0
3191
2800
  }));
3192
- }, []), i = F((f) => {
3193
- n((h) => ({
3194
- ...h,
3195
- title: f,
2801
+ }, []), i = P((h) => {
2802
+ n((v) => ({
2803
+ ...v,
2804
+ title: h,
3196
2805
  hasUnsavedChanges: !0
3197
2806
  }));
3198
- }, []), s = F((f, h) => {
3199
- document.execCommand(f, !1, h), r.current?.focus();
3200
- }, []), c = F(() => {
2807
+ }, []), c = P((h, v) => {
2808
+ document.execCommand(h, !1, v), r.current?.focus();
2809
+ }, []), s = P(() => {
3201
2810
  try {
3202
- return { success: !0, data: Wt.parse({
2811
+ return { success: !0, data: kc.parse({
3203
2812
  title: t.title,
3204
2813
  content: t.content,
3205
2814
  metadata: {
@@ -3209,22 +2818,22 @@ const _t = {
3209
2818
  characterCount: t.characterCount
3210
2819
  }
3211
2820
  }) };
3212
- } catch (f) {
3213
- return { success: !1, error: f instanceof Error ? f.message : "Validation failed" };
2821
+ } catch (h) {
2822
+ return { success: !1, error: h instanceof Error ? h.message : "Validation failed" };
3214
2823
  }
3215
- }, [t]), d = F(
3216
- (f = { includeStyles: !0, includeMeta: !0 }) => {
3217
- const h = c();
3218
- if (!h.success)
3219
- throw new Error(h.error);
3220
- const { data: p } = h;
3221
- let g = `<!DOCTYPE html>
2824
+ }, [t]), f = P(
2825
+ (h = { includeStyles: !0, includeMeta: !0 }) => {
2826
+ const v = s();
2827
+ if (!v.success)
2828
+ throw new Error(v.error);
2829
+ const { data: _ } = v;
2830
+ let l = `<!DOCTYPE html>
3222
2831
  <html>
3223
2832
  <head>
3224
2833
  <meta charset="UTF-8">
3225
2834
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
3226
- <title>${p?.title}</title>`;
3227
- return f.includeStyles && (g += `
2835
+ <title>${_?.title}</title>`;
2836
+ return h.includeStyles && (l += `
3228
2837
  <style>
3229
2838
  body {
3230
2839
  font-family: Arial, sans-serif;
@@ -3238,24 +2847,24 @@ const _t = {
3238
2847
  border-radius: 8px;
3239
2848
  background: white;
3240
2849
  }
3241
- </style>`), g += `
2850
+ </style>`), l += `
3242
2851
  </head>
3243
- <body>`, f.includeMeta && (g += `
2852
+ <body>`, h.includeMeta && (l += `
3244
2853
  <div class="document-meta">
3245
- <h1>${p?.title}</h1>
3246
- <p><small>Created: ${new Date(p?.metadata.createdAt ?? "").toLocaleString()} |
3247
- Words: ${p?.metadata.wordCount} |
3248
- Characters: ${p?.metadata.characterCount}</small></p>
2854
+ <h1>${_?.title}</h1>
2855
+ <p><small>Created: ${new Date(_?.metadata.createdAt ?? "").toLocaleString()} |
2856
+ Words: ${_?.metadata.wordCount} |
2857
+ Characters: ${_?.metadata.characterCount}</small></p>
3249
2858
  <hr>
3250
- </div>`), g += `
2859
+ </div>`), l += `
3251
2860
  <div class="editor-content">
3252
- ${p?.content}
2861
+ ${_?.content}
3253
2862
  </div>
3254
2863
  </body>
3255
- </html>`, g;
2864
+ </html>`, l;
3256
2865
  },
3257
- [c]
3258
- ), l = F(() => {
2866
+ [s]
2867
+ ), d = P(() => {
3259
2868
  n({
3260
2869
  content: "",
3261
2870
  title: "Untitled Document",
@@ -3269,13 +2878,119 @@ const _t = {
3269
2878
  editorRef: r,
3270
2879
  updateContent: o,
3271
2880
  updateTitle: i,
3272
- executeCommand: s,
3273
- getValidationResult: c,
3274
- exportToHTML: d,
3275
- clearEditor: l
2881
+ executeCommand: c,
2882
+ getValidationResult: s,
2883
+ exportToHTML: f,
2884
+ clearEditor: d
3276
2885
  };
2886
+ }, Zc = ({
2887
+ initialContent: e = "",
2888
+ onSave: t,
2889
+ onExport: n,
2890
+ onChange: r,
2891
+ showButtons: o = !1,
2892
+ showSaveTitle: i = !1,
2893
+ showStatusBar: c = !1
2894
+ }) => {
2895
+ const {
2896
+ editorState: s,
2897
+ editorRef: f,
2898
+ updateContent: d,
2899
+ updateTitle: h,
2900
+ executeCommand: v,
2901
+ getValidationResult: _,
2902
+ exportToHTML: l,
2903
+ clearEditor: b
2904
+ } = zc(e), [R, j] = ae(!1);
2905
+ Ee(() => {
2906
+ if (r)
2907
+ try {
2908
+ const $ = l({ includeStyles: !1, includeMeta: !1 });
2909
+ r(s.content, $, s.title);
2910
+ } catch {
2911
+ const F = `<!DOCTYPE html><html><body>${s.content}</body></html>`;
2912
+ r(s.content, F, s.title);
2913
+ }
2914
+ }, [s.content, s.title, r, l]);
2915
+ const U = P(() => {
2916
+ if (_().success) {
2917
+ const F = l();
2918
+ t?.(s.content, F);
2919
+ } else
2920
+ j(!0), setTimeout(() => j(!1), 3e3);
2921
+ }, [s.content, _, l, t]), S = P(() => {
2922
+ try {
2923
+ const $ = l();
2924
+ n?.($);
2925
+ const F = new Blob([$], { type: "text/html" }), ee = URL.createObjectURL(F), D = document.createElement("a");
2926
+ D.href = ee, D.download = `${s.title.replace(/\s+/g, "_") || "document"}.html`, document.body.appendChild(D), D.click(), document.body.removeChild(D), URL.revokeObjectURL(ee);
2927
+ } catch ($) {
2928
+ alert(
2929
+ "Export failed: " + ($ instanceof Error ? $.message : "Unknown error")
2930
+ );
2931
+ }
2932
+ }, [l, s.title, n]), C = P(() => {
2933
+ confirm(
2934
+ "Are you sure you want to clear the editor? All unsaved changes will be lost."
2935
+ ) && b();
2936
+ }, [b]), A = P(
2937
+ ($) => {
2938
+ d($);
2939
+ },
2940
+ [d]
2941
+ ), N = P(
2942
+ ($) => {
2943
+ h($);
2944
+ },
2945
+ [h]
2946
+ );
2947
+ return /* @__PURE__ */ p.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden", children: [
2948
+ i && /* @__PURE__ */ p.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50", children: [
2949
+ /* @__PURE__ */ p.jsx(
2950
+ "input",
2951
+ {
2952
+ type: "text",
2953
+ className: "w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",
2954
+ value: s.title,
2955
+ onChange: ($) => N($.target.value),
2956
+ placeholder: "Document Title"
2957
+ }
2958
+ ),
2959
+ R && /* @__PURE__ */ p.jsx("div", { className: "text-red-600 text-sm mt-2 animate-fadeIn", children: "Please add content before saving" })
2960
+ ] }),
2961
+ /* @__PURE__ */ p.jsx(
2962
+ un,
2963
+ {
2964
+ onCommand: v,
2965
+ onSave: U,
2966
+ onExport: S,
2967
+ showButtons: o,
2968
+ onClear: C,
2969
+ hasUnsavedChanges: s.hasUnsavedChanges
2970
+ }
2971
+ ),
2972
+ /* @__PURE__ */ p.jsx(
2973
+ "div",
2974
+ {
2975
+ ref: f,
2976
+ className: "editor-content min-h-[500px] p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",
2977
+ contentEditable: !0,
2978
+ onInput: ($) => A($.currentTarget.innerHTML),
2979
+ onBlur: ($) => A($.currentTarget.innerHTML),
2980
+ suppressContentEditableWarning: !0
2981
+ }
2982
+ ),
2983
+ c && /* @__PURE__ */ p.jsx(
2984
+ ln,
2985
+ {
2986
+ wordCount: s.wordCount,
2987
+ characterCount: s.characterCount,
2988
+ hasUnsavedChanges: s.hasUnsavedChanges
2989
+ }
2990
+ )
2991
+ ] });
3277
2992
  };
3278
2993
  export {
3279
- Ns as TextEditor,
3280
- Ds as useTextEditor
2994
+ Zc as TextEditor,
2995
+ zc as useTextEditor
3281
2996
  };