@object-ui/plugin-map 0.3.0 β†’ 0.5.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,286 +1,3694 @@
1
- import ne, { useState as R, useEffect as G, useMemo as X } from "react";
2
- import { ComponentRegistry as ae } from "@object-ui/core";
3
- var S = { exports: {} }, N = {};
4
- var B;
5
- function oe() {
6
- if (B) return N;
7
- B = 1;
8
- var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
9
- function n(s, l, m) {
10
- var h = null;
11
- if (m !== void 0 && (h = "" + m), l.key !== void 0 && (h = "" + l.key), "key" in l) {
12
- m = {};
13
- for (var v in l)
14
- v !== "key" && (m[v] = l[v]);
15
- } else m = l;
16
- return l = m.ref, {
17
- $$typeof: t,
18
- type: s,
19
- key: h,
20
- ref: l !== void 0 ? l : null,
21
- props: m
1
+ import * as X from "react";
2
+ import _n, { useLayoutEffect as vn, useEffect as F, useContext as Oe, useState as oe, useRef as ae, useImperativeHandle as Ze, useMemo as Y, memo as B, forwardRef as Je } from "react";
3
+ import { ComponentRegistry as yn } from "@object-ui/core";
4
+ import { useSchemaContext as bn } from "@object-ui/react";
5
+ import { createPortal as At } from "react-dom";
6
+ var ve = { exports: {} }, fe = {};
7
+ var ot;
8
+ function wn() {
9
+ if (ot) return fe;
10
+ ot = 1;
11
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
+ function n(r, o, i) {
13
+ var s = null;
14
+ if (i !== void 0 && (s = "" + i), o.key !== void 0 && (s = "" + o.key), "key" in o) {
15
+ i = {};
16
+ for (var a in o)
17
+ a !== "key" && (i[a] = o[a]);
18
+ } else i = o;
19
+ return o = i.ref, {
20
+ $$typeof: e,
21
+ type: r,
22
+ key: s,
23
+ ref: o !== void 0 ? o : null,
24
+ props: i
22
25
  };
23
26
  }
24
- return N.Fragment = i, N.jsx = n, N.jsxs = n, N;
25
- }
26
- var y = {};
27
- var H;
28
- function ie() {
29
- return H || (H = 1, process.env.NODE_ENV !== "production" && (function() {
30
- function t(e) {
31
- if (e == null) return null;
32
- if (typeof e == "function")
33
- return e.$$typeof === ee ? null : e.displayName || e.name || null;
34
- if (typeof e == "string") return e;
35
- switch (e) {
36
- case j:
27
+ return fe.Fragment = t, fe.jsx = n, fe.jsxs = n, fe;
28
+ }
29
+ var de = {};
30
+ var it;
31
+ function zn() {
32
+ return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function e(f) {
34
+ if (f == null) return null;
35
+ if (typeof f == "function")
36
+ return f.$$typeof === q ? null : f.displayName || f.name || null;
37
+ if (typeof f == "string") return f;
38
+ switch (f) {
39
+ case Z:
37
40
  return "Fragment";
38
- case k:
41
+ case V:
39
42
  return "Profiler";
40
- case g:
43
+ case N:
41
44
  return "StrictMode";
42
- case M:
45
+ case S:
43
46
  return "Suspense";
44
- case C:
47
+ case w:
45
48
  return "SuspenseList";
46
- case K:
49
+ case le:
47
50
  return "Activity";
48
51
  }
49
- if (typeof e == "object")
50
- switch (typeof e.tag == "number" && console.error(
52
+ if (typeof f == "object")
53
+ switch (typeof f.tag == "number" && console.error(
51
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
52
- ), e.$$typeof) {
53
- case b:
55
+ ), f.$$typeof) {
56
+ case k:
54
57
  return "Portal";
55
- case f:
56
- return e.displayName || "Context";
57
- case o:
58
- return (e._context.displayName || "Context") + ".Consumer";
59
- case x:
60
- var r = e.render;
61
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
- case Z:
63
- return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
58
+ case v:
59
+ return f.displayName || "Context";
60
+ case b:
61
+ return (f._context.displayName || "Context") + ".Consumer";
62
+ case E:
63
+ var _ = f.render;
64
+ return f = f.displayName, f || (f = _.displayName || _.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
65
+ case A:
66
+ return _ = f.displayName || null, _ !== null ? _ : e(f.type) || "Memo";
64
67
  case L:
65
- r = e._payload, e = e._init;
68
+ _ = f._payload, f = f._init;
66
69
  try {
67
- return t(e(r));
70
+ return e(f(_));
68
71
  } catch {
69
72
  }
70
73
  }
71
74
  return null;
72
75
  }
73
- function i(e) {
74
- return "" + e;
76
+ function t(f) {
77
+ return "" + f;
75
78
  }
76
- function n(e) {
79
+ function n(f) {
77
80
  try {
78
- i(e);
79
- var r = !1;
81
+ t(f);
82
+ var _ = !1;
80
83
  } catch {
81
- r = !0;
84
+ _ = !0;
82
85
  }
83
- if (r) {
84
- r = console;
85
- var c = r.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
- return c.call(
87
- r,
86
+ if (_) {
87
+ _ = console;
88
+ var T = _.error, C = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
89
+ return T.call(
90
+ _,
88
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
- u
90
- ), i(e);
92
+ C
93
+ ), t(f);
91
94
  }
92
95
  }
93
- function s(e) {
94
- if (e === j) return "<>";
95
- if (typeof e == "object" && e !== null && e.$$typeof === L)
96
+ function r(f) {
97
+ if (f === Z) return "<>";
98
+ if (typeof f == "object" && f !== null && f.$$typeof === L)
96
99
  return "<...>";
97
100
  try {
98
- var r = t(e);
99
- return r ? "<" + r + ">" : "<...>";
101
+ var _ = e(f);
102
+ return _ ? "<" + _ + ">" : "<...>";
100
103
  } catch {
101
104
  return "<...>";
102
105
  }
103
106
  }
104
- function l() {
105
- var e = D.A;
106
- return e === null ? null : e.getOwner();
107
+ function o() {
108
+ var f = U.A;
109
+ return f === null ? null : f.getOwner();
107
110
  }
108
- function m() {
111
+ function i() {
109
112
  return Error("react-stack-top-frame");
110
113
  }
111
- function h(e) {
112
- if (W.call(e, "key")) {
113
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
114
- if (r && r.isReactWarning) return !1;
114
+ function s(f) {
115
+ if (Xe.call(f, "key")) {
116
+ var _ = Object.getOwnPropertyDescriptor(f, "key").get;
117
+ if (_ && _.isReactWarning) return !1;
115
118
  }
116
- return e.key !== void 0;
119
+ return f.key !== void 0;
117
120
  }
118
- function v(e, r) {
119
- function c() {
120
- q || (q = !0, console.error(
121
+ function a(f, _) {
122
+ function T() {
123
+ Qe || (Qe = !0, console.error(
121
124
  "%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)",
122
- r
125
+ _
123
126
  ));
124
127
  }
125
- c.isReactWarning = !0, Object.defineProperty(e, "key", {
126
- get: c,
128
+ T.isReactWarning = !0, Object.defineProperty(f, "key", {
129
+ get: T,
127
130
  configurable: !0
128
131
  });
129
132
  }
130
- function T() {
131
- var e = t(this.type);
132
- return U[e] || (U[e] = !0, console.error(
133
+ function c() {
134
+ var f = e(this.type);
135
+ return et[f] || (et[f] = !0, console.error(
133
136
  "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."
134
- )), e = this.props.ref, e !== void 0 ? e : null;
135
- }
136
- function F(e, r, c, u, A, Y) {
137
- var d = c.ref;
138
- return e = {
139
- $$typeof: p,
140
- type: e,
141
- key: r,
142
- props: c,
143
- _owner: u
144
- }, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
137
+ )), f = this.props.ref, f !== void 0 ? f : null;
138
+ }
139
+ function u(f, _, T, C, _e, Re) {
140
+ var R = T.ref;
141
+ return f = {
142
+ $$typeof: z,
143
+ type: f,
144
+ key: _,
145
+ props: T,
146
+ _owner: C
147
+ }, (R !== void 0 ? R : null) !== null ? Object.defineProperty(f, "ref", {
145
148
  enumerable: !1,
146
- get: T
147
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
149
+ get: c
150
+ }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
148
151
  configurable: !1,
149
152
  enumerable: !1,
150
153
  writable: !0,
151
154
  value: 0
152
- }), Object.defineProperty(e, "_debugInfo", {
155
+ }), Object.defineProperty(f, "_debugInfo", {
153
156
  configurable: !1,
154
157
  enumerable: !1,
155
158
  writable: !0,
156
159
  value: null
157
- }), Object.defineProperty(e, "_debugStack", {
160
+ }), Object.defineProperty(f, "_debugStack", {
158
161
  configurable: !1,
159
162
  enumerable: !1,
160
163
  writable: !0,
161
- value: A
162
- }), Object.defineProperty(e, "_debugTask", {
164
+ value: _e
165
+ }), Object.defineProperty(f, "_debugTask", {
163
166
  configurable: !1,
164
167
  enumerable: !1,
165
168
  writable: !0,
166
- value: Y
167
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
168
- }
169
- function P(e, r, c, u, A, Y) {
170
- var d = r.children;
171
- if (d !== void 0)
172
- if (u)
173
- if (te(d)) {
174
- for (u = 0; u < d.length; u++)
175
- w(d[u]);
176
- Object.freeze && Object.freeze(d);
169
+ value: Re
170
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
171
+ }
172
+ function d(f, _, T, C, _e, Re) {
173
+ var R = _.children;
174
+ if (R !== void 0)
175
+ if (C)
176
+ if (hn(R)) {
177
+ for (C = 0; C < R.length; C++)
178
+ m(R[C]);
179
+ Object.freeze && Object.freeze(R);
177
180
  } else
178
181
  console.error(
179
182
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
183
  );
181
- else w(d);
182
- if (W.call(r, "key")) {
183
- d = t(e);
184
- var _ = Object.keys(r).filter(function(re) {
185
- return re !== "key";
184
+ else m(R);
185
+ if (Xe.call(_, "key")) {
186
+ R = e(f);
187
+ var re = Object.keys(_).filter(function(gn) {
188
+ return gn !== "key";
186
189
  });
187
- u = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", J[d + u] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ C = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", rt[R + C] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
188
191
  `A props object containing a "key" prop is being spread into JSX:
189
192
  let props = %s;
190
193
  <%s {...props} />
191
194
  React keys must be passed directly to JSX without using spread:
192
195
  let props = %s;
193
196
  <%s key={someKey} {...props} />`,
194
- u,
195
- d,
196
- _,
197
- d
198
- ), J[d + u] = !0);
199
- }
200
- if (d = null, c !== void 0 && (n(c), d = "" + c), h(r) && (n(r.key), d = "" + r.key), "key" in r) {
201
- c = {};
202
- for (var I in r)
203
- I !== "key" && (c[I] = r[I]);
204
- } else c = r;
205
- return d && v(
206
- c,
207
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
208
- ), F(
209
- e,
210
- d,
211
- c,
212
- l(),
213
- A,
214
- Y
197
+ C,
198
+ R,
199
+ re,
200
+ R
201
+ ), rt[R + C] = !0);
202
+ }
203
+ if (R = null, T !== void 0 && (n(T), R = "" + T), s(_) && (n(_.key), R = "" + _.key), "key" in _) {
204
+ T = {};
205
+ for (var xe in _)
206
+ xe !== "key" && (T[xe] = _[xe]);
207
+ } else T = _;
208
+ return R && a(
209
+ T,
210
+ typeof f == "function" ? f.displayName || f.name || "Unknown" : f
211
+ ), u(
212
+ f,
213
+ R,
214
+ T,
215
+ o(),
216
+ _e,
217
+ Re
215
218
  );
216
219
  }
217
- function w(e) {
218
- O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === L && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
220
+ function m(f) {
221
+ p(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === L && (f._payload.status === "fulfilled" ? p(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
219
222
  }
220
- function O(e) {
221
- return typeof e == "object" && e !== null && e.$$typeof === p;
223
+ function p(f) {
224
+ return typeof f == "object" && f !== null && f.$$typeof === z;
222
225
  }
223
- var E = ne, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), k = /* @__PURE__ */ Symbol.for("react.profiler"), o = /* @__PURE__ */ Symbol.for("react.consumer"), f = /* @__PURE__ */ Symbol.for("react.context"), x = /* @__PURE__ */ Symbol.for("react.forward_ref"), M = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), Z = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), ee = /* @__PURE__ */ Symbol.for("react.client.reference"), D = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, te = Array.isArray, $ = console.createTask ? console.createTask : function() {
226
+ var h = _n, z = /* @__PURE__ */ Symbol.for("react.transitional.element"), k = /* @__PURE__ */ Symbol.for("react.portal"), Z = /* @__PURE__ */ Symbol.for("react.fragment"), N = /* @__PURE__ */ Symbol.for("react.strict_mode"), V = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.consumer"), v = /* @__PURE__ */ Symbol.for("react.context"), E = /* @__PURE__ */ Symbol.for("react.forward_ref"), S = /* @__PURE__ */ Symbol.for("react.suspense"), w = /* @__PURE__ */ Symbol.for("react.suspense_list"), A = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), le = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), U = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Xe = Object.prototype.hasOwnProperty, hn = Array.isArray, Ce = console.createTask ? console.createTask : function() {
224
227
  return null;
225
228
  };
226
- E = {
227
- react_stack_bottom_frame: function(e) {
228
- return e();
229
+ h = {
230
+ react_stack_bottom_frame: function(f) {
231
+ return f();
229
232
  }
230
233
  };
231
- var q, U = {}, z = E.react_stack_bottom_frame.bind(
232
- E,
233
- m
234
- )(), V = $(s(m)), J = {};
235
- y.Fragment = j, y.jsx = function(e, r, c) {
236
- var u = 1e4 > D.recentlyCreatedOwnerStacks++;
237
- return P(
238
- e,
239
- r,
240
- c,
234
+ var Qe, et = {}, tt = h.react_stack_bottom_frame.bind(
235
+ h,
236
+ i
237
+ )(), nt = Ce(r(i)), rt = {};
238
+ de.Fragment = Z, de.jsx = function(f, _, T) {
239
+ var C = 1e4 > U.recentlyCreatedOwnerStacks++;
240
+ return d(
241
+ f,
242
+ _,
243
+ T,
241
244
  !1,
242
- u ? Error("react-stack-top-frame") : z,
243
- u ? $(s(e)) : V
245
+ C ? Error("react-stack-top-frame") : tt,
246
+ C ? Ce(r(f)) : nt
244
247
  );
245
- }, y.jsxs = function(e, r, c) {
246
- var u = 1e4 > D.recentlyCreatedOwnerStacks++;
247
- return P(
248
- e,
249
- r,
250
- c,
248
+ }, de.jsxs = function(f, _, T) {
249
+ var C = 1e4 > U.recentlyCreatedOwnerStacks++;
250
+ return d(
251
+ f,
252
+ _,
253
+ T,
251
254
  !0,
252
- u ? Error("react-stack-top-frame") : z,
253
- u ? $(s(e)) : V
255
+ C ? Error("react-stack-top-frame") : tt,
256
+ C ? Ce(r(f)) : nt
254
257
  );
255
258
  };
256
- })()), y;
259
+ })()), de;
260
+ }
261
+ var st;
262
+ function kn() {
263
+ return st || (st = 1, process.env.NODE_ENV === "production" ? ve.exports = wn() : ve.exports = zn()), ve.exports;
264
+ }
265
+ var I = kn();
266
+ function l(e, t, n) {
267
+ function r(a, c) {
268
+ if (a._zod || Object.defineProperty(a, "_zod", {
269
+ value: {
270
+ def: c,
271
+ constr: s,
272
+ traits: /* @__PURE__ */ new Set()
273
+ },
274
+ enumerable: !1
275
+ }), a._zod.traits.has(e))
276
+ return;
277
+ a._zod.traits.add(e), t(a, c);
278
+ const u = s.prototype, d = Object.keys(u);
279
+ for (let m = 0; m < d.length; m++) {
280
+ const p = d[m];
281
+ p in a || (a[p] = u[p].bind(a));
282
+ }
283
+ }
284
+ const o = n?.Parent ?? Object;
285
+ class i extends o {
286
+ }
287
+ Object.defineProperty(i, "name", { value: e });
288
+ function s(a) {
289
+ var c;
290
+ const u = n?.Parent ? new i() : this;
291
+ r(u, a), (c = u._zod).deferred ?? (c.deferred = []);
292
+ for (const d of u._zod.deferred)
293
+ d();
294
+ return u;
295
+ }
296
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
297
+ value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
298
+ }), Object.defineProperty(s, "name", { value: e }), s;
299
+ }
300
+ class se extends Error {
301
+ constructor() {
302
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
303
+ }
304
+ }
305
+ class Ft extends Error {
306
+ constructor(t) {
307
+ super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
308
+ }
309
+ }
310
+ const Mt = {};
311
+ function Q(e) {
312
+ return Mt;
313
+ }
314
+ function Dt(e) {
315
+ const t = Object.values(e).filter((r) => typeof r == "number");
316
+ return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
317
+ }
318
+ function De(e, t) {
319
+ return typeof t == "bigint" ? t.toString() : t;
320
+ }
321
+ function Ve(e) {
322
+ return {
323
+ get value() {
324
+ {
325
+ const t = e();
326
+ return Object.defineProperty(this, "value", { value: t }), t;
327
+ }
328
+ }
329
+ };
330
+ }
331
+ function We(e) {
332
+ return e == null;
333
+ }
334
+ function Ye(e) {
335
+ const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
336
+ return e.slice(t, n);
337
+ }
338
+ function En(e, t) {
339
+ const n = (e.toString().split(".")[1] || "").length, r = t.toString();
340
+ let o = (r.split(".")[1] || "").length;
341
+ if (o === 0 && /\d?e-\d?/.test(r)) {
342
+ const c = r.match(/\d?e-(\d?)/);
343
+ c?.[1] && (o = Number.parseInt(c[1]));
344
+ }
345
+ const i = n > o ? n : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), a = Number.parseInt(t.toFixed(i).replace(".", ""));
346
+ return s % a / 10 ** i;
347
+ }
348
+ const at = /* @__PURE__ */ Symbol("evaluating");
349
+ function y(e, t, n) {
350
+ let r;
351
+ Object.defineProperty(e, t, {
352
+ get() {
353
+ if (r !== at)
354
+ return r === void 0 && (r = at, r = n()), r;
355
+ },
356
+ set(o) {
357
+ Object.defineProperty(e, t, {
358
+ value: o
359
+ // configurable: true,
360
+ });
361
+ },
362
+ configurable: !0
363
+ });
364
+ }
365
+ function te(e, t, n) {
366
+ Object.defineProperty(e, t, {
367
+ value: n,
368
+ writable: !0,
369
+ enumerable: !0,
370
+ configurable: !0
371
+ });
372
+ }
373
+ function H(...e) {
374
+ const t = {};
375
+ for (const n of e) {
376
+ const r = Object.getOwnPropertyDescriptors(n);
377
+ Object.assign(t, r);
378
+ }
379
+ return Object.defineProperties({}, t);
380
+ }
381
+ function ct(e) {
382
+ return JSON.stringify(e);
383
+ }
384
+ function Sn(e) {
385
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
386
+ }
387
+ const Lt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
388
+ };
389
+ function ke(e) {
390
+ return typeof e == "object" && e !== null && !Array.isArray(e);
391
+ }
392
+ const $n = Ve(() => {
393
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
394
+ return !1;
395
+ try {
396
+ const e = Function;
397
+ return new e(""), !0;
398
+ } catch {
399
+ return !1;
400
+ }
401
+ });
402
+ function he(e) {
403
+ if (ke(e) === !1)
404
+ return !1;
405
+ const t = e.constructor;
406
+ if (t === void 0 || typeof t != "function")
407
+ return !0;
408
+ const n = t.prototype;
409
+ return !(ke(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
410
+ }
411
+ function Ut(e) {
412
+ return he(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
413
+ }
414
+ const On = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
415
+ function Te(e) {
416
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
417
+ }
418
+ function K(e, t, n) {
419
+ const r = new e._zod.constr(t ?? e._zod.def);
420
+ return (!t || n?.parent) && (r._zod.parent = e), r;
421
+ }
422
+ function g(e) {
423
+ const t = e;
424
+ if (!t)
425
+ return {};
426
+ if (typeof t == "string")
427
+ return { error: () => t };
428
+ if (t?.message !== void 0) {
429
+ if (t?.error !== void 0)
430
+ throw new Error("Cannot specify both `message` and `error` params");
431
+ t.error = t.message;
432
+ }
433
+ return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
434
+ }
435
+ function Zn(e) {
436
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
437
+ }
438
+ const Tn = {
439
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
440
+ int32: [-2147483648, 2147483647],
441
+ uint32: [0, 4294967295],
442
+ float32: [-34028234663852886e22, 34028234663852886e22],
443
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
444
+ };
445
+ function Pn(e, t) {
446
+ const n = e._zod.def, r = n.checks;
447
+ if (r && r.length > 0)
448
+ throw new Error(".pick() cannot be used on object schemas containing refinements");
449
+ const i = H(e._zod.def, {
450
+ get shape() {
451
+ const s = {};
452
+ for (const a in t) {
453
+ if (!(a in n.shape))
454
+ throw new Error(`Unrecognized key: "${a}"`);
455
+ t[a] && (s[a] = n.shape[a]);
456
+ }
457
+ return te(this, "shape", s), s;
458
+ },
459
+ checks: []
460
+ });
461
+ return K(e, i);
462
+ }
463
+ function jn(e, t) {
464
+ const n = e._zod.def, r = n.checks;
465
+ if (r && r.length > 0)
466
+ throw new Error(".omit() cannot be used on object schemas containing refinements");
467
+ const i = H(e._zod.def, {
468
+ get shape() {
469
+ const s = { ...e._zod.def.shape };
470
+ for (const a in t) {
471
+ if (!(a in n.shape))
472
+ throw new Error(`Unrecognized key: "${a}"`);
473
+ t[a] && delete s[a];
474
+ }
475
+ return te(this, "shape", s), s;
476
+ },
477
+ checks: []
478
+ });
479
+ return K(e, i);
480
+ }
481
+ function Nn(e, t) {
482
+ if (!he(t))
483
+ throw new Error("Invalid input to extend: expected a plain object");
484
+ const n = e._zod.def.checks;
485
+ if (n && n.length > 0) {
486
+ const i = e._zod.def.shape;
487
+ for (const s in t)
488
+ if (Object.getOwnPropertyDescriptor(i, s) !== void 0)
489
+ throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
490
+ }
491
+ const o = H(e._zod.def, {
492
+ get shape() {
493
+ const i = { ...e._zod.def.shape, ...t };
494
+ return te(this, "shape", i), i;
495
+ }
496
+ });
497
+ return K(e, o);
498
+ }
499
+ function In(e, t) {
500
+ if (!he(t))
501
+ throw new Error("Invalid input to safeExtend: expected a plain object");
502
+ const n = H(e._zod.def, {
503
+ get shape() {
504
+ const r = { ...e._zod.def.shape, ...t };
505
+ return te(this, "shape", r), r;
506
+ }
507
+ });
508
+ return K(e, n);
509
+ }
510
+ function Cn(e, t) {
511
+ const n = H(e._zod.def, {
512
+ get shape() {
513
+ const r = { ...e._zod.def.shape, ...t._zod.def.shape };
514
+ return te(this, "shape", r), r;
515
+ },
516
+ get catchall() {
517
+ return t._zod.def.catchall;
518
+ },
519
+ checks: []
520
+ // delete existing checks
521
+ });
522
+ return K(e, n);
523
+ }
524
+ function Rn(e, t, n) {
525
+ const o = t._zod.def.checks;
526
+ if (o && o.length > 0)
527
+ throw new Error(".partial() cannot be used on object schemas containing refinements");
528
+ const s = H(t._zod.def, {
529
+ get shape() {
530
+ const a = t._zod.def.shape, c = { ...a };
531
+ if (n)
532
+ for (const u in n) {
533
+ if (!(u in a))
534
+ throw new Error(`Unrecognized key: "${u}"`);
535
+ n[u] && (c[u] = e ? new e({
536
+ type: "optional",
537
+ innerType: a[u]
538
+ }) : a[u]);
539
+ }
540
+ else
541
+ for (const u in a)
542
+ c[u] = e ? new e({
543
+ type: "optional",
544
+ innerType: a[u]
545
+ }) : a[u];
546
+ return te(this, "shape", c), c;
547
+ },
548
+ checks: []
549
+ });
550
+ return K(t, s);
551
+ }
552
+ function xn(e, t, n) {
553
+ const r = H(t._zod.def, {
554
+ get shape() {
555
+ const o = t._zod.def.shape, i = { ...o };
556
+ if (n)
557
+ for (const s in n) {
558
+ if (!(s in i))
559
+ throw new Error(`Unrecognized key: "${s}"`);
560
+ n[s] && (i[s] = new e({
561
+ type: "nonoptional",
562
+ innerType: o[s]
563
+ }));
564
+ }
565
+ else
566
+ for (const s in o)
567
+ i[s] = new e({
568
+ type: "nonoptional",
569
+ innerType: o[s]
570
+ });
571
+ return te(this, "shape", i), i;
572
+ }
573
+ });
574
+ return K(t, r);
575
+ }
576
+ function ie(e, t = 0) {
577
+ if (e.aborted === !0)
578
+ return !0;
579
+ for (let n = t; n < e.issues.length; n++)
580
+ if (e.issues[n]?.continue !== !0)
581
+ return !0;
582
+ return !1;
583
+ }
584
+ function Be(e, t) {
585
+ return t.map((n) => {
586
+ var r;
587
+ return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
588
+ });
589
+ }
590
+ function ye(e) {
591
+ return typeof e == "string" ? e : e?.message;
592
+ }
593
+ function ee(e, t, n) {
594
+ const r = { ...e, path: e.path ?? [] };
595
+ if (!e.message) {
596
+ const o = ye(e.inst?._zod.def?.error?.(e)) ?? ye(t?.error?.(e)) ?? ye(n.customError?.(e)) ?? ye(n.localeError?.(e)) ?? "Invalid input";
597
+ r.message = o;
598
+ }
599
+ return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
600
+ }
601
+ function Ge(e) {
602
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
603
+ }
604
+ function ge(...e) {
605
+ const [t, n, r] = e;
606
+ return typeof t == "string" ? {
607
+ message: t,
608
+ code: "custom",
609
+ input: n,
610
+ inst: r
611
+ } : { ...t };
612
+ }
613
+ const Jt = (e, t) => {
614
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
615
+ value: e._zod,
616
+ enumerable: !1
617
+ }), Object.defineProperty(e, "issues", {
618
+ value: t,
619
+ enumerable: !1
620
+ }), e.message = JSON.stringify(t, De, 2), Object.defineProperty(e, "toString", {
621
+ value: () => e.message,
622
+ enumerable: !1
623
+ });
624
+ }, Vt = l("$ZodError", Jt), Wt = l("$ZodError", Jt, { Parent: Error });
625
+ function An(e, t = (n) => n.message) {
626
+ const n = {}, r = [];
627
+ for (const o of e.issues)
628
+ o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
629
+ return { formErrors: r, fieldErrors: n };
630
+ }
631
+ function Fn(e, t = (n) => n.message) {
632
+ const n = { _errors: [] }, r = (o) => {
633
+ for (const i of o.issues)
634
+ if (i.code === "invalid_union" && i.errors.length)
635
+ i.errors.map((s) => r({ issues: s }));
636
+ else if (i.code === "invalid_key")
637
+ r({ issues: i.issues });
638
+ else if (i.code === "invalid_element")
639
+ r({ issues: i.issues });
640
+ else if (i.path.length === 0)
641
+ n._errors.push(t(i));
642
+ else {
643
+ let s = n, a = 0;
644
+ for (; a < i.path.length; ) {
645
+ const c = i.path[a];
646
+ a === i.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(t(i))) : s[c] = s[c] || { _errors: [] }, s = s[c], a++;
647
+ }
648
+ }
649
+ };
650
+ return r(e), n;
651
+ }
652
+ const qe = (e) => (t, n, r, o) => {
653
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
654
+ if (s instanceof Promise)
655
+ throw new se();
656
+ if (s.issues.length) {
657
+ const a = new (o?.Err ?? e)(s.issues.map((c) => ee(c, i, Q())));
658
+ throw Lt(a, o?.callee), a;
659
+ }
660
+ return s.value;
661
+ }, He = (e) => async (t, n, r, o) => {
662
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
663
+ let s = t._zod.run({ value: n, issues: [] }, i);
664
+ if (s instanceof Promise && (s = await s), s.issues.length) {
665
+ const a = new (o?.Err ?? e)(s.issues.map((c) => ee(c, i, Q())));
666
+ throw Lt(a, o?.callee), a;
667
+ }
668
+ return s.value;
669
+ }, Pe = (e) => (t, n, r) => {
670
+ const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
671
+ if (i instanceof Promise)
672
+ throw new se();
673
+ return i.issues.length ? {
674
+ success: !1,
675
+ error: new (e ?? Vt)(i.issues.map((s) => ee(s, o, Q())))
676
+ } : { success: !0, data: i.value };
677
+ }, Mn = /* @__PURE__ */ Pe(Wt), je = (e) => async (t, n, r) => {
678
+ const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
679
+ let i = t._zod.run({ value: n, issues: [] }, o);
680
+ return i instanceof Promise && (i = await i), i.issues.length ? {
681
+ success: !1,
682
+ error: new e(i.issues.map((s) => ee(s, o, Q())))
683
+ } : { success: !0, data: i.value };
684
+ }, Dn = /* @__PURE__ */ je(Wt), Ln = (e) => (t, n, r) => {
685
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
686
+ return qe(e)(t, n, o);
687
+ }, Un = (e) => (t, n, r) => qe(e)(t, n, r), Jn = (e) => async (t, n, r) => {
688
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
689
+ return He(e)(t, n, o);
690
+ }, Vn = (e) => async (t, n, r) => He(e)(t, n, r), Wn = (e) => (t, n, r) => {
691
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
692
+ return Pe(e)(t, n, o);
693
+ }, Yn = (e) => (t, n, r) => Pe(e)(t, n, r), Bn = (e) => async (t, n, r) => {
694
+ const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
695
+ return je(e)(t, n, o);
696
+ }, Gn = (e) => async (t, n, r) => je(e)(t, n, r), qn = /^[cC][^\s-]{8,}$/, Hn = /^[0-9a-z]+$/, Kn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Xn = /^[0-9a-vA-V]{20}$/, Qn = /^[A-Za-z0-9]{27}$/, er = /^[a-zA-Z0-9_-]{21}$/, tr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, nr = /^([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})$/, ut = (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)$/, rr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, or = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
697
+ function ir() {
698
+ return new RegExp(or, "u");
699
+ }
700
+ const 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])$/, ar = /^(([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}|:))$/, cr = /^((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])$/, ur = /^(([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])$/, lr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Yt = /^[A-Za-z0-9_-]*$/, fr = /^\+[1-9]\d{6,14}$/, Bt = "(?:(?:\\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(`^${Bt}$`);
701
+ function Gt(e) {
702
+ const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
703
+ 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+)?)?`;
704
+ }
705
+ function pr(e) {
706
+ return new RegExp(`^${Gt(e)}$`);
707
+ }
708
+ function mr(e) {
709
+ const t = Gt({ precision: e.precision }), n = ["Z"];
710
+ e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
711
+ const r = `${t}(?:${n.join("|")})`;
712
+ return new RegExp(`^${Bt}T(?:${r})$`);
713
+ }
714
+ const hr = (e) => {
715
+ const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
716
+ return new RegExp(`^${t}$`);
717
+ }, gr = /^-?\d+$/, _r = /^-?\d+(?:\.\d+)?$/, vr = /^[^A-Z]*$/, yr = /^[^a-z]*$/, D = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
718
+ var n;
719
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
720
+ }), qt = {
721
+ number: "number",
722
+ bigint: "bigint",
723
+ object: "date"
724
+ }, Ht = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
725
+ D.init(e, t);
726
+ const n = qt[typeof t.value];
727
+ e._zod.onattach.push((r) => {
728
+ const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
729
+ t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
730
+ }), e._zod.check = (r) => {
731
+ (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
732
+ origin: n,
733
+ code: "too_big",
734
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
735
+ input: r.value,
736
+ inclusive: t.inclusive,
737
+ inst: e,
738
+ continue: !t.abort
739
+ });
740
+ };
741
+ }), Kt = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
742
+ D.init(e, t);
743
+ const n = qt[typeof t.value];
744
+ e._zod.onattach.push((r) => {
745
+ const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
746
+ t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
747
+ }), e._zod.check = (r) => {
748
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
749
+ origin: n,
750
+ code: "too_small",
751
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
752
+ input: r.value,
753
+ inclusive: t.inclusive,
754
+ inst: e,
755
+ continue: !t.abort
756
+ });
757
+ };
758
+ }), br = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
759
+ D.init(e, t), e._zod.onattach.push((n) => {
760
+ var r;
761
+ (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
762
+ }), e._zod.check = (n) => {
763
+ if (typeof n.value != typeof t.value)
764
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
765
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : En(n.value, t.value) === 0) || n.issues.push({
766
+ origin: typeof n.value,
767
+ code: "not_multiple_of",
768
+ divisor: t.value,
769
+ input: n.value,
770
+ inst: e,
771
+ continue: !t.abort
772
+ });
773
+ };
774
+ }), wr = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
775
+ D.init(e, t), t.format = t.format || "float64";
776
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = Tn[t.format];
777
+ e._zod.onattach.push((s) => {
778
+ const a = s._zod.bag;
779
+ a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern = gr);
780
+ }), e._zod.check = (s) => {
781
+ const a = s.value;
782
+ if (n) {
783
+ if (!Number.isInteger(a)) {
784
+ s.issues.push({
785
+ expected: r,
786
+ format: t.format,
787
+ code: "invalid_type",
788
+ continue: !1,
789
+ input: a,
790
+ inst: e
791
+ });
792
+ return;
793
+ }
794
+ if (!Number.isSafeInteger(a)) {
795
+ a > 0 ? s.issues.push({
796
+ input: a,
797
+ code: "too_big",
798
+ maximum: Number.MAX_SAFE_INTEGER,
799
+ note: "Integers must be within the safe integer range.",
800
+ inst: e,
801
+ origin: r,
802
+ inclusive: !0,
803
+ continue: !t.abort
804
+ }) : s.issues.push({
805
+ input: a,
806
+ code: "too_small",
807
+ minimum: Number.MIN_SAFE_INTEGER,
808
+ note: "Integers must be within the safe integer range.",
809
+ inst: e,
810
+ origin: r,
811
+ inclusive: !0,
812
+ continue: !t.abort
813
+ });
814
+ return;
815
+ }
816
+ }
817
+ a < o && s.issues.push({
818
+ origin: "number",
819
+ input: a,
820
+ code: "too_small",
821
+ minimum: o,
822
+ inclusive: !0,
823
+ inst: e,
824
+ continue: !t.abort
825
+ }), a > i && s.issues.push({
826
+ origin: "number",
827
+ input: a,
828
+ code: "too_big",
829
+ maximum: i,
830
+ inclusive: !0,
831
+ inst: e,
832
+ continue: !t.abort
833
+ });
834
+ };
835
+ }), zr = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
836
+ var n;
837
+ D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
838
+ const o = r.value;
839
+ return !We(o) && o.length !== void 0;
840
+ }), e._zod.onattach.push((r) => {
841
+ const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
842
+ t.maximum < o && (r._zod.bag.maximum = t.maximum);
843
+ }), e._zod.check = (r) => {
844
+ const o = r.value;
845
+ if (o.length <= t.maximum)
846
+ return;
847
+ const s = Ge(o);
848
+ r.issues.push({
849
+ origin: s,
850
+ code: "too_big",
851
+ maximum: t.maximum,
852
+ inclusive: !0,
853
+ input: o,
854
+ inst: e,
855
+ continue: !t.abort
856
+ });
857
+ };
858
+ }), kr = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
859
+ var n;
860
+ D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
861
+ const o = r.value;
862
+ return !We(o) && o.length !== void 0;
863
+ }), e._zod.onattach.push((r) => {
864
+ const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
865
+ t.minimum > o && (r._zod.bag.minimum = t.minimum);
866
+ }), e._zod.check = (r) => {
867
+ const o = r.value;
868
+ if (o.length >= t.minimum)
869
+ return;
870
+ const s = Ge(o);
871
+ r.issues.push({
872
+ origin: s,
873
+ code: "too_small",
874
+ minimum: t.minimum,
875
+ inclusive: !0,
876
+ input: o,
877
+ inst: e,
878
+ continue: !t.abort
879
+ });
880
+ };
881
+ }), Er = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
882
+ var n;
883
+ D.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
884
+ const o = r.value;
885
+ return !We(o) && o.length !== void 0;
886
+ }), e._zod.onattach.push((r) => {
887
+ const o = r._zod.bag;
888
+ o.minimum = t.length, o.maximum = t.length, o.length = t.length;
889
+ }), e._zod.check = (r) => {
890
+ const o = r.value, i = o.length;
891
+ if (i === t.length)
892
+ return;
893
+ const s = Ge(o), a = i > t.length;
894
+ r.issues.push({
895
+ origin: s,
896
+ ...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
897
+ inclusive: !0,
898
+ exact: !0,
899
+ input: r.value,
900
+ inst: e,
901
+ continue: !t.abort
902
+ });
903
+ };
904
+ }), Ne = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
905
+ var n, r;
906
+ D.init(e, t), e._zod.onattach.push((o) => {
907
+ const i = o._zod.bag;
908
+ i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
909
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
910
+ t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
911
+ origin: "string",
912
+ code: "invalid_format",
913
+ format: t.format,
914
+ input: o.value,
915
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
916
+ inst: e,
917
+ continue: !t.abort
918
+ });
919
+ }) : (r = e._zod).check ?? (r.check = () => {
920
+ });
921
+ }), Sr = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
922
+ Ne.init(e, t), e._zod.check = (n) => {
923
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
924
+ origin: "string",
925
+ code: "invalid_format",
926
+ format: "regex",
927
+ input: n.value,
928
+ pattern: t.pattern.toString(),
929
+ inst: e,
930
+ continue: !t.abort
931
+ });
932
+ };
933
+ }), $r = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
934
+ t.pattern ?? (t.pattern = vr), Ne.init(e, t);
935
+ }), Or = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
936
+ t.pattern ?? (t.pattern = yr), Ne.init(e, t);
937
+ }), Zr = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
938
+ D.init(e, t);
939
+ const n = Te(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
940
+ t.pattern = r, e._zod.onattach.push((o) => {
941
+ const i = o._zod.bag;
942
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
943
+ }), e._zod.check = (o) => {
944
+ o.value.includes(t.includes, t.position) || o.issues.push({
945
+ origin: "string",
946
+ code: "invalid_format",
947
+ format: "includes",
948
+ includes: t.includes,
949
+ input: o.value,
950
+ inst: e,
951
+ continue: !t.abort
952
+ });
953
+ };
954
+ }), Tr = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
955
+ D.init(e, t);
956
+ const n = new RegExp(`^${Te(t.prefix)}.*`);
957
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
958
+ const o = r._zod.bag;
959
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
960
+ }), e._zod.check = (r) => {
961
+ r.value.startsWith(t.prefix) || r.issues.push({
962
+ origin: "string",
963
+ code: "invalid_format",
964
+ format: "starts_with",
965
+ prefix: t.prefix,
966
+ input: r.value,
967
+ inst: e,
968
+ continue: !t.abort
969
+ });
970
+ };
971
+ }), Pr = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
972
+ D.init(e, t);
973
+ const n = new RegExp(`.*${Te(t.suffix)}$`);
974
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
975
+ const o = r._zod.bag;
976
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
977
+ }), e._zod.check = (r) => {
978
+ r.value.endsWith(t.suffix) || r.issues.push({
979
+ origin: "string",
980
+ code: "invalid_format",
981
+ format: "ends_with",
982
+ suffix: t.suffix,
983
+ input: r.value,
984
+ inst: e,
985
+ continue: !t.abort
986
+ });
987
+ };
988
+ }), jr = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
989
+ D.init(e, t), e._zod.check = (n) => {
990
+ n.value = t.tx(n.value);
991
+ };
992
+ });
993
+ class Nr {
994
+ constructor(t = []) {
995
+ this.content = [], this.indent = 0, this && (this.args = t);
996
+ }
997
+ indented(t) {
998
+ this.indent += 1, t(this), this.indent -= 1;
999
+ }
1000
+ write(t) {
1001
+ if (typeof t == "function") {
1002
+ t(this, { execution: "sync" }), t(this, { execution: "async" });
1003
+ return;
1004
+ }
1005
+ const r = t.split(`
1006
+ `).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);
1007
+ for (const s of i)
1008
+ this.content.push(s);
1009
+ }
1010
+ compile() {
1011
+ const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
1012
+ return new t(...n, o.join(`
1013
+ `));
1014
+ }
1015
+ }
1016
+ const Ir = {
1017
+ major: 4,
1018
+ minor: 3,
1019
+ patch: 6
1020
+ }, P = /* @__PURE__ */ l("$ZodType", (e, t) => {
1021
+ var n;
1022
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Ir;
1023
+ const r = [...e._zod.def.checks ?? []];
1024
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
1025
+ for (const o of r)
1026
+ for (const i of o._zod.onattach)
1027
+ i(e);
1028
+ if (r.length === 0)
1029
+ (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
1030
+ e._zod.run = e._zod.parse;
1031
+ });
1032
+ else {
1033
+ const o = (s, a, c) => {
1034
+ let u = ie(s), d;
1035
+ for (const m of a) {
1036
+ if (m._zod.def.when) {
1037
+ if (!m._zod.def.when(s))
1038
+ continue;
1039
+ } else if (u)
1040
+ continue;
1041
+ const p = s.issues.length, h = m._zod.check(s);
1042
+ if (h instanceof Promise && c?.async === !1)
1043
+ throw new se();
1044
+ if (d || h instanceof Promise)
1045
+ d = (d ?? Promise.resolve()).then(async () => {
1046
+ await h, s.issues.length !== p && (u || (u = ie(s, p)));
1047
+ });
1048
+ else {
1049
+ if (s.issues.length === p)
1050
+ continue;
1051
+ u || (u = ie(s, p));
1052
+ }
1053
+ }
1054
+ return d ? d.then(() => s) : s;
1055
+ }, i = (s, a, c) => {
1056
+ if (ie(s))
1057
+ return s.aborted = !0, s;
1058
+ const u = o(a, r, c);
1059
+ if (u instanceof Promise) {
1060
+ if (c.async === !1)
1061
+ throw new se();
1062
+ return u.then((d) => e._zod.parse(d, c));
1063
+ }
1064
+ return e._zod.parse(u, c);
1065
+ };
1066
+ e._zod.run = (s, a) => {
1067
+ if (a.skipChecks)
1068
+ return e._zod.parse(s, a);
1069
+ if (a.direction === "backward") {
1070
+ const u = e._zod.parse({ value: s.value, issues: [] }, { ...a, skipChecks: !0 });
1071
+ return u instanceof Promise ? u.then((d) => i(d, s, a)) : i(u, s, a);
1072
+ }
1073
+ const c = e._zod.parse(s, a);
1074
+ if (c instanceof Promise) {
1075
+ if (a.async === !1)
1076
+ throw new se();
1077
+ return c.then((u) => o(u, r, a));
1078
+ }
1079
+ return o(c, r, a);
1080
+ };
1081
+ }
1082
+ y(e, "~standard", () => ({
1083
+ validate: (o) => {
1084
+ try {
1085
+ const i = Mn(e, o);
1086
+ return i.success ? { value: i.data } : { issues: i.error?.issues };
1087
+ } catch {
1088
+ return Dn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
1089
+ }
1090
+ },
1091
+ vendor: "zod",
1092
+ version: 1
1093
+ }));
1094
+ }), Ke = /* @__PURE__ */ l("$ZodString", (e, t) => {
1095
+ P.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? hr(e._zod.bag), e._zod.parse = (n, r) => {
1096
+ if (t.coerce)
1097
+ try {
1098
+ n.value = String(n.value);
1099
+ } catch {
1100
+ }
1101
+ return typeof n.value == "string" || n.issues.push({
1102
+ expected: "string",
1103
+ code: "invalid_type",
1104
+ input: n.value,
1105
+ inst: e
1106
+ }), n;
1107
+ };
1108
+ }), $ = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
1109
+ Ne.init(e, t), Ke.init(e, t);
1110
+ }), Cr = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
1111
+ t.pattern ?? (t.pattern = nr), $.init(e, t);
1112
+ }), Rr = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
1113
+ if (t.version) {
1114
+ const r = {
1115
+ v1: 1,
1116
+ v2: 2,
1117
+ v3: 3,
1118
+ v4: 4,
1119
+ v5: 5,
1120
+ v6: 6,
1121
+ v7: 7,
1122
+ v8: 8
1123
+ }[t.version];
1124
+ if (r === void 0)
1125
+ throw new Error(`Invalid UUID version: "${t.version}"`);
1126
+ t.pattern ?? (t.pattern = ut(r));
1127
+ } else
1128
+ t.pattern ?? (t.pattern = ut());
1129
+ $.init(e, t);
1130
+ }), xr = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
1131
+ t.pattern ?? (t.pattern = rr), $.init(e, t);
1132
+ }), Ar = /* @__PURE__ */ l("$ZodURL", (e, t) => {
1133
+ $.init(e, t), e._zod.check = (n) => {
1134
+ try {
1135
+ const r = n.value.trim(), o = new URL(r);
1136
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
1137
+ code: "invalid_format",
1138
+ format: "url",
1139
+ note: "Invalid hostname",
1140
+ pattern: t.hostname.source,
1141
+ input: n.value,
1142
+ inst: e,
1143
+ continue: !t.abort
1144
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || n.issues.push({
1145
+ code: "invalid_format",
1146
+ format: "url",
1147
+ note: "Invalid protocol",
1148
+ pattern: t.protocol.source,
1149
+ input: n.value,
1150
+ inst: e,
1151
+ continue: !t.abort
1152
+ })), t.normalize ? n.value = o.href : n.value = r;
1153
+ return;
1154
+ } catch {
1155
+ n.issues.push({
1156
+ code: "invalid_format",
1157
+ format: "url",
1158
+ input: n.value,
1159
+ inst: e,
1160
+ continue: !t.abort
1161
+ });
1162
+ }
1163
+ };
1164
+ }), Fr = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
1165
+ t.pattern ?? (t.pattern = ir()), $.init(e, t);
1166
+ }), Mr = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
1167
+ t.pattern ?? (t.pattern = er), $.init(e, t);
1168
+ }), Dr = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
1169
+ t.pattern ?? (t.pattern = qn), $.init(e, t);
1170
+ }), Lr = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
1171
+ t.pattern ?? (t.pattern = Hn), $.init(e, t);
1172
+ }), Ur = /* @__PURE__ */ l("$ZodULID", (e, t) => {
1173
+ t.pattern ?? (t.pattern = Kn), $.init(e, t);
1174
+ }), Jr = /* @__PURE__ */ l("$ZodXID", (e, t) => {
1175
+ t.pattern ?? (t.pattern = Xn), $.init(e, t);
1176
+ }), Vr = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
1177
+ t.pattern ?? (t.pattern = Qn), $.init(e, t);
1178
+ }), Wr = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
1179
+ t.pattern ?? (t.pattern = mr(t)), $.init(e, t);
1180
+ }), Yr = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
1181
+ t.pattern ?? (t.pattern = dr), $.init(e, t);
1182
+ }), Br = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
1183
+ t.pattern ?? (t.pattern = pr(t)), $.init(e, t);
1184
+ }), Gr = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
1185
+ t.pattern ?? (t.pattern = tr), $.init(e, t);
1186
+ }), qr = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
1187
+ t.pattern ?? (t.pattern = sr), $.init(e, t), e._zod.bag.format = "ipv4";
1188
+ }), Hr = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
1189
+ t.pattern ?? (t.pattern = ar), $.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1190
+ try {
1191
+ new URL(`http://[${n.value}]`);
1192
+ } catch {
1193
+ n.issues.push({
1194
+ code: "invalid_format",
1195
+ format: "ipv6",
1196
+ input: n.value,
1197
+ inst: e,
1198
+ continue: !t.abort
1199
+ });
1200
+ }
1201
+ };
1202
+ }), Kr = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
1203
+ t.pattern ?? (t.pattern = cr), $.init(e, t);
1204
+ }), Xr = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
1205
+ t.pattern ?? (t.pattern = ur), $.init(e, t), e._zod.check = (n) => {
1206
+ const r = n.value.split("/");
1207
+ try {
1208
+ if (r.length !== 2)
1209
+ throw new Error();
1210
+ const [o, i] = r;
1211
+ if (!i)
1212
+ throw new Error();
1213
+ const s = Number(i);
1214
+ if (`${s}` !== i)
1215
+ throw new Error();
1216
+ if (s < 0 || s > 128)
1217
+ throw new Error();
1218
+ new URL(`http://[${o}]`);
1219
+ } catch {
1220
+ n.issues.push({
1221
+ code: "invalid_format",
1222
+ format: "cidrv6",
1223
+ input: n.value,
1224
+ inst: e,
1225
+ continue: !t.abort
1226
+ });
1227
+ }
1228
+ };
1229
+ });
1230
+ function Xt(e) {
1231
+ if (e === "")
1232
+ return !0;
1233
+ if (e.length % 4 !== 0)
1234
+ return !1;
1235
+ try {
1236
+ return atob(e), !0;
1237
+ } catch {
1238
+ return !1;
1239
+ }
1240
+ }
1241
+ const Qr = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
1242
+ t.pattern ?? (t.pattern = lr), $.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1243
+ Xt(n.value) || n.issues.push({
1244
+ code: "invalid_format",
1245
+ format: "base64",
1246
+ input: n.value,
1247
+ inst: e,
1248
+ continue: !t.abort
1249
+ });
1250
+ };
1251
+ });
1252
+ function eo(e) {
1253
+ if (!Yt.test(e))
1254
+ return !1;
1255
+ const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1256
+ return Xt(n);
1257
+ }
1258
+ const to = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
1259
+ t.pattern ?? (t.pattern = Yt), $.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1260
+ eo(n.value) || n.issues.push({
1261
+ code: "invalid_format",
1262
+ format: "base64url",
1263
+ input: n.value,
1264
+ inst: e,
1265
+ continue: !t.abort
1266
+ });
1267
+ };
1268
+ }), no = /* @__PURE__ */ l("$ZodE164", (e, t) => {
1269
+ t.pattern ?? (t.pattern = fr), $.init(e, t);
1270
+ });
1271
+ function ro(e, t = null) {
1272
+ try {
1273
+ const n = e.split(".");
1274
+ if (n.length !== 3)
1275
+ return !1;
1276
+ const [r] = n;
1277
+ if (!r)
1278
+ return !1;
1279
+ const o = JSON.parse(atob(r));
1280
+ return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
1281
+ } catch {
1282
+ return !1;
1283
+ }
1284
+ }
1285
+ const oo = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
1286
+ $.init(e, t), e._zod.check = (n) => {
1287
+ ro(n.value, t.alg) || n.issues.push({
1288
+ code: "invalid_format",
1289
+ format: "jwt",
1290
+ input: n.value,
1291
+ inst: e,
1292
+ continue: !t.abort
1293
+ });
1294
+ };
1295
+ }), Qt = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
1296
+ P.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? _r, e._zod.parse = (n, r) => {
1297
+ if (t.coerce)
1298
+ try {
1299
+ n.value = Number(n.value);
1300
+ } catch {
1301
+ }
1302
+ const o = n.value;
1303
+ if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
1304
+ return n;
1305
+ const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
1306
+ return n.issues.push({
1307
+ expected: "number",
1308
+ code: "invalid_type",
1309
+ input: o,
1310
+ inst: e,
1311
+ ...i ? { received: i } : {}
1312
+ }), n;
1313
+ };
1314
+ }), io = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
1315
+ wr.init(e, t), Qt.init(e, t);
1316
+ }), so = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
1317
+ P.init(e, t), e._zod.parse = (n) => n;
1318
+ }), ao = /* @__PURE__ */ l("$ZodNever", (e, t) => {
1319
+ P.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1320
+ expected: "never",
1321
+ code: "invalid_type",
1322
+ input: n.value,
1323
+ inst: e
1324
+ }), n);
1325
+ });
1326
+ function lt(e, t, n) {
1327
+ e.issues.length && t.issues.push(...Be(n, e.issues)), t.value[n] = e.value;
1328
+ }
1329
+ const co = /* @__PURE__ */ l("$ZodArray", (e, t) => {
1330
+ P.init(e, t), e._zod.parse = (n, r) => {
1331
+ const o = n.value;
1332
+ if (!Array.isArray(o))
1333
+ return n.issues.push({
1334
+ expected: "array",
1335
+ code: "invalid_type",
1336
+ input: o,
1337
+ inst: e
1338
+ }), n;
1339
+ n.value = Array(o.length);
1340
+ const i = [];
1341
+ for (let s = 0; s < o.length; s++) {
1342
+ const a = o[s], c = t.element._zod.run({
1343
+ value: a,
1344
+ issues: []
1345
+ }, r);
1346
+ c instanceof Promise ? i.push(c.then((u) => lt(u, n, s))) : lt(c, n, s);
1347
+ }
1348
+ return i.length ? Promise.all(i).then(() => n) : n;
1349
+ };
1350
+ });
1351
+ function Ee(e, t, n, r, o) {
1352
+ if (e.issues.length) {
1353
+ if (o && !(n in r))
1354
+ return;
1355
+ t.issues.push(...Be(n, e.issues));
1356
+ }
1357
+ e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1358
+ }
1359
+ function en(e) {
1360
+ const t = Object.keys(e.shape);
1361
+ for (const r of t)
1362
+ if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1363
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1364
+ const n = Zn(e.shape);
1365
+ return {
1366
+ ...e,
1367
+ keys: t,
1368
+ keySet: new Set(t),
1369
+ numKeys: t.length,
1370
+ optionalKeys: new Set(n)
1371
+ };
1372
+ }
1373
+ function tn(e, t, n, r, o, i) {
1374
+ const s = [], a = o.keySet, c = o.catchall._zod, u = c.def.type, d = c.optout === "optional";
1375
+ for (const m in t) {
1376
+ if (a.has(m))
1377
+ continue;
1378
+ if (u === "never") {
1379
+ s.push(m);
1380
+ continue;
1381
+ }
1382
+ const p = c.run({ value: t[m], issues: [] }, r);
1383
+ p instanceof Promise ? e.push(p.then((h) => Ee(h, n, m, t, d))) : Ee(p, n, m, t, d);
1384
+ }
1385
+ return s.length && n.issues.push({
1386
+ code: "unrecognized_keys",
1387
+ keys: s,
1388
+ input: t,
1389
+ inst: i
1390
+ }), e.length ? Promise.all(e).then(() => n) : n;
1391
+ }
1392
+ const uo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
1393
+ if (P.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1394
+ const a = t.shape;
1395
+ Object.defineProperty(t, "shape", {
1396
+ get: () => {
1397
+ const c = { ...a };
1398
+ return Object.defineProperty(t, "shape", {
1399
+ value: c
1400
+ }), c;
1401
+ }
1402
+ });
1403
+ }
1404
+ const r = Ve(() => en(t));
1405
+ y(e._zod, "propValues", () => {
1406
+ const a = t.shape, c = {};
1407
+ for (const u in a) {
1408
+ const d = a[u]._zod;
1409
+ if (d.values) {
1410
+ c[u] ?? (c[u] = /* @__PURE__ */ new Set());
1411
+ for (const m of d.values)
1412
+ c[u].add(m);
1413
+ }
1414
+ }
1415
+ return c;
1416
+ });
1417
+ const o = ke, i = t.catchall;
1418
+ let s;
1419
+ e._zod.parse = (a, c) => {
1420
+ s ?? (s = r.value);
1421
+ const u = a.value;
1422
+ if (!o(u))
1423
+ return a.issues.push({
1424
+ expected: "object",
1425
+ code: "invalid_type",
1426
+ input: u,
1427
+ inst: e
1428
+ }), a;
1429
+ a.value = {};
1430
+ const d = [], m = s.shape;
1431
+ for (const p of s.keys) {
1432
+ const h = m[p], z = h._zod.optout === "optional", k = h._zod.run({ value: u[p], issues: [] }, c);
1433
+ k instanceof Promise ? d.push(k.then((Z) => Ee(Z, a, p, u, z))) : Ee(k, a, p, u, z);
1434
+ }
1435
+ return i ? tn(d, u, a, c, r.value, e) : d.length ? Promise.all(d).then(() => a) : a;
1436
+ };
1437
+ }), lo = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
1438
+ uo.init(e, t);
1439
+ const n = e._zod.parse, r = Ve(() => en(t)), o = (p) => {
1440
+ const h = new Nr(["shape", "payload", "ctx"]), z = r.value, k = (b) => {
1441
+ const v = ct(b);
1442
+ return `shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`;
1443
+ };
1444
+ h.write("const input = payload.value;");
1445
+ const Z = /* @__PURE__ */ Object.create(null);
1446
+ let N = 0;
1447
+ for (const b of z.keys)
1448
+ Z[b] = `key_${N++}`;
1449
+ h.write("const newResult = {};");
1450
+ for (const b of z.keys) {
1451
+ const v = Z[b], E = ct(b), w = p[b]?._zod?.optout === "optional";
1452
+ h.write(`const ${v} = ${k(b)};`), w ? h.write(`
1453
+ if (${v}.issues.length) {
1454
+ if (${E} in input) {
1455
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
1456
+ ...iss,
1457
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
1458
+ })));
1459
+ }
1460
+ }
1461
+
1462
+ if (${v}.value === undefined) {
1463
+ if (${E} in input) {
1464
+ newResult[${E}] = undefined;
1465
+ }
1466
+ } else {
1467
+ newResult[${E}] = ${v}.value;
1468
+ }
1469
+
1470
+ `) : h.write(`
1471
+ if (${v}.issues.length) {
1472
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
1473
+ ...iss,
1474
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
1475
+ })));
1476
+ }
1477
+
1478
+ if (${v}.value === undefined) {
1479
+ if (${E} in input) {
1480
+ newResult[${E}] = undefined;
1481
+ }
1482
+ } else {
1483
+ newResult[${E}] = ${v}.value;
1484
+ }
1485
+
1486
+ `);
1487
+ }
1488
+ h.write("payload.value = newResult;"), h.write("return payload;");
1489
+ const V = h.compile();
1490
+ return (b, v) => V(p, b, v);
1491
+ };
1492
+ let i;
1493
+ const s = ke, a = !Mt.jitless, u = a && $n.value, d = t.catchall;
1494
+ let m;
1495
+ e._zod.parse = (p, h) => {
1496
+ m ?? (m = r.value);
1497
+ const z = p.value;
1498
+ return s(z) ? a && u && h?.async === !1 && h.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, h), d ? tn([], z, p, h, m, e) : p) : n(p, h) : (p.issues.push({
1499
+ expected: "object",
1500
+ code: "invalid_type",
1501
+ input: z,
1502
+ inst: e
1503
+ }), p);
1504
+ };
1505
+ });
1506
+ function ft(e, t, n, r) {
1507
+ for (const i of e)
1508
+ if (i.issues.length === 0)
1509
+ return t.value = i.value, t;
1510
+ const o = e.filter((i) => !ie(i));
1511
+ return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
1512
+ code: "invalid_union",
1513
+ input: t.value,
1514
+ inst: n,
1515
+ errors: e.map((i) => i.issues.map((s) => ee(s, r, Q())))
1516
+ }), t);
1517
+ }
1518
+ const fo = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
1519
+ P.init(e, t), y(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), y(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), y(e._zod, "values", () => {
1520
+ if (t.options.every((o) => o._zod.values))
1521
+ return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
1522
+ }), y(e._zod, "pattern", () => {
1523
+ if (t.options.every((o) => o._zod.pattern)) {
1524
+ const o = t.options.map((i) => i._zod.pattern);
1525
+ return new RegExp(`^(${o.map((i) => Ye(i.source)).join("|")})$`);
1526
+ }
1527
+ });
1528
+ const n = t.options.length === 1, r = t.options[0]._zod.run;
1529
+ e._zod.parse = (o, i) => {
1530
+ if (n)
1531
+ return r(o, i);
1532
+ let s = !1;
1533
+ const a = [];
1534
+ for (const c of t.options) {
1535
+ const u = c._zod.run({
1536
+ value: o.value,
1537
+ issues: []
1538
+ }, i);
1539
+ if (u instanceof Promise)
1540
+ a.push(u), s = !0;
1541
+ else {
1542
+ if (u.issues.length === 0)
1543
+ return u;
1544
+ a.push(u);
1545
+ }
1546
+ }
1547
+ return s ? Promise.all(a).then((c) => ft(c, o, e, i)) : ft(a, o, e, i);
1548
+ };
1549
+ }), po = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
1550
+ P.init(e, t), e._zod.parse = (n, r) => {
1551
+ const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
1552
+ return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, u]) => dt(n, c, u)) : dt(n, i, s);
1553
+ };
1554
+ });
1555
+ function Le(e, t) {
1556
+ if (e === t)
1557
+ return { valid: !0, data: e };
1558
+ if (e instanceof Date && t instanceof Date && +e == +t)
1559
+ return { valid: !0, data: e };
1560
+ if (he(e) && he(t)) {
1561
+ const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
1562
+ for (const i of r) {
1563
+ const s = Le(e[i], t[i]);
1564
+ if (!s.valid)
1565
+ return {
1566
+ valid: !1,
1567
+ mergeErrorPath: [i, ...s.mergeErrorPath]
1568
+ };
1569
+ o[i] = s.data;
1570
+ }
1571
+ return { valid: !0, data: o };
1572
+ }
1573
+ if (Array.isArray(e) && Array.isArray(t)) {
1574
+ if (e.length !== t.length)
1575
+ return { valid: !1, mergeErrorPath: [] };
1576
+ const n = [];
1577
+ for (let r = 0; r < e.length; r++) {
1578
+ const o = e[r], i = t[r], s = Le(o, i);
1579
+ if (!s.valid)
1580
+ return {
1581
+ valid: !1,
1582
+ mergeErrorPath: [r, ...s.mergeErrorPath]
1583
+ };
1584
+ n.push(s.data);
1585
+ }
1586
+ return { valid: !0, data: n };
1587
+ }
1588
+ return { valid: !1, mergeErrorPath: [] };
1589
+ }
1590
+ function dt(e, t, n) {
1591
+ const r = /* @__PURE__ */ new Map();
1592
+ let o;
1593
+ for (const a of t.issues)
1594
+ if (a.code === "unrecognized_keys") {
1595
+ o ?? (o = a);
1596
+ for (const c of a.keys)
1597
+ r.has(c) || r.set(c, {}), r.get(c).l = !0;
1598
+ } else
1599
+ e.issues.push(a);
1600
+ for (const a of n.issues)
1601
+ if (a.code === "unrecognized_keys")
1602
+ for (const c of a.keys)
1603
+ r.has(c) || r.set(c, {}), r.get(c).r = !0;
1604
+ else
1605
+ e.issues.push(a);
1606
+ const i = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
1607
+ if (i.length && o && e.issues.push({ ...o, keys: i }), ie(e))
1608
+ return e;
1609
+ const s = Le(t.value, n.value);
1610
+ if (!s.valid)
1611
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
1612
+ return e.value = s.data, e;
1613
+ }
1614
+ const mo = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
1615
+ P.init(e, t);
1616
+ const n = t.items;
1617
+ e._zod.parse = (r, o) => {
1618
+ const i = r.value;
1619
+ if (!Array.isArray(i))
1620
+ return r.issues.push({
1621
+ input: i,
1622
+ inst: e,
1623
+ expected: "tuple",
1624
+ code: "invalid_type"
1625
+ }), r;
1626
+ r.value = [];
1627
+ const s = [], a = [...n].reverse().findIndex((d) => d._zod.optin !== "optional"), c = a === -1 ? 0 : n.length - a;
1628
+ if (!t.rest) {
1629
+ const d = i.length > n.length, m = i.length < c - 1;
1630
+ if (d || m)
1631
+ return r.issues.push({
1632
+ ...d ? { code: "too_big", maximum: n.length, inclusive: !0 } : { code: "too_small", minimum: n.length },
1633
+ input: i,
1634
+ inst: e,
1635
+ origin: "array"
1636
+ }), r;
1637
+ }
1638
+ let u = -1;
1639
+ for (const d of n) {
1640
+ if (u++, u >= i.length && u >= c)
1641
+ continue;
1642
+ const m = d._zod.run({
1643
+ value: i[u],
1644
+ issues: []
1645
+ }, o);
1646
+ m instanceof Promise ? s.push(m.then((p) => be(p, r, u))) : be(m, r, u);
1647
+ }
1648
+ if (t.rest) {
1649
+ const d = i.slice(n.length);
1650
+ for (const m of d) {
1651
+ u++;
1652
+ const p = t.rest._zod.run({
1653
+ value: m,
1654
+ issues: []
1655
+ }, o);
1656
+ p instanceof Promise ? s.push(p.then((h) => be(h, r, u))) : be(p, r, u);
1657
+ }
1658
+ }
1659
+ return s.length ? Promise.all(s).then(() => r) : r;
1660
+ };
1661
+ });
1662
+ function be(e, t, n) {
1663
+ e.issues.length && t.issues.push(...Be(n, e.issues)), t.value[n] = e.value;
1664
+ }
1665
+ const ho = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
1666
+ P.init(e, t);
1667
+ const n = Dt(t.entries), r = new Set(n);
1668
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => On.has(typeof o)).map((o) => typeof o == "string" ? Te(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1669
+ const s = o.value;
1670
+ return r.has(s) || o.issues.push({
1671
+ code: "invalid_value",
1672
+ values: n,
1673
+ input: s,
1674
+ inst: e
1675
+ }), o;
1676
+ };
1677
+ }), go = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
1678
+ P.init(e, t), e._zod.parse = (n, r) => {
1679
+ if (r.direction === "backward")
1680
+ throw new Ft(e.constructor.name);
1681
+ const o = t.transform(n.value, n);
1682
+ if (r.async)
1683
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
1684
+ if (o instanceof Promise)
1685
+ throw new se();
1686
+ return n.value = o, n;
1687
+ };
1688
+ });
1689
+ function pt(e, t) {
1690
+ return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1691
+ }
1692
+ const nn = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
1693
+ P.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", y(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), y(e._zod, "pattern", () => {
1694
+ const n = t.innerType._zod.pattern;
1695
+ return n ? new RegExp(`^(${Ye(n.source)})?$`) : void 0;
1696
+ }), e._zod.parse = (n, r) => {
1697
+ if (t.innerType._zod.optin === "optional") {
1698
+ const o = t.innerType._zod.run(n, r);
1699
+ return o instanceof Promise ? o.then((i) => pt(i, n.value)) : pt(o, n.value);
1700
+ }
1701
+ return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1702
+ };
1703
+ }), _o = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
1704
+ nn.init(e, t), y(e._zod, "values", () => t.innerType._zod.values), y(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
1705
+ }), vo = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
1706
+ P.init(e, t), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "pattern", () => {
1707
+ const n = t.innerType._zod.pattern;
1708
+ return n ? new RegExp(`^(${Ye(n.source)}|null)$`) : void 0;
1709
+ }), y(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);
1710
+ }), yo = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
1711
+ P.init(e, t), e._zod.optin = "optional", y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1712
+ if (r.direction === "backward")
1713
+ return t.innerType._zod.run(n, r);
1714
+ if (n.value === void 0)
1715
+ return n.value = t.defaultValue, n;
1716
+ const o = t.innerType._zod.run(n, r);
1717
+ return o instanceof Promise ? o.then((i) => mt(i, t)) : mt(o, t);
1718
+ };
1719
+ });
1720
+ function mt(e, t) {
1721
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1722
+ }
1723
+ const bo = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
1724
+ P.init(e, t), e._zod.optin = "optional", y(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));
1725
+ }), wo = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
1726
+ P.init(e, t), y(e._zod, "values", () => {
1727
+ const n = t.innerType._zod.values;
1728
+ return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1729
+ }), e._zod.parse = (n, r) => {
1730
+ const o = t.innerType._zod.run(n, r);
1731
+ return o instanceof Promise ? o.then((i) => ht(i, e)) : ht(o, e);
1732
+ };
1733
+ });
1734
+ function ht(e, t) {
1735
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1736
+ code: "invalid_type",
1737
+ expected: "nonoptional",
1738
+ input: e.value,
1739
+ inst: t
1740
+ }), e;
1741
+ }
1742
+ const zo = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
1743
+ P.init(e, t), y(e._zod, "optin", () => t.innerType._zod.optin), y(e._zod, "optout", () => t.innerType._zod.optout), y(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1744
+ if (r.direction === "backward")
1745
+ return t.innerType._zod.run(n, r);
1746
+ const o = t.innerType._zod.run(n, r);
1747
+ return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
1748
+ ...n,
1749
+ error: {
1750
+ issues: i.issues.map((s) => ee(s, r, Q()))
1751
+ },
1752
+ input: n.value
1753
+ }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
1754
+ ...n,
1755
+ error: {
1756
+ issues: o.issues.map((i) => ee(i, r, Q()))
1757
+ },
1758
+ input: n.value
1759
+ }), n.issues = []), n);
1760
+ };
1761
+ }), ko = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
1762
+ P.init(e, t), y(e._zod, "values", () => t.in._zod.values), y(e._zod, "optin", () => t.in._zod.optin), y(e._zod, "optout", () => t.out._zod.optout), y(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1763
+ if (r.direction === "backward") {
1764
+ const i = t.out._zod.run(n, r);
1765
+ return i instanceof Promise ? i.then((s) => we(s, t.in, r)) : we(i, t.in, r);
1766
+ }
1767
+ const o = t.in._zod.run(n, r);
1768
+ return o instanceof Promise ? o.then((i) => we(i, t.out, r)) : we(o, t.out, r);
1769
+ };
1770
+ });
1771
+ function we(e, t, n) {
1772
+ return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
1773
+ }
1774
+ const Eo = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
1775
+ P.init(e, t), y(e._zod, "propValues", () => t.innerType._zod.propValues), y(e._zod, "values", () => t.innerType._zod.values), y(e._zod, "optin", () => t.innerType?._zod?.optin), y(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
1776
+ if (r.direction === "backward")
1777
+ return t.innerType._zod.run(n, r);
1778
+ const o = t.innerType._zod.run(n, r);
1779
+ return o instanceof Promise ? o.then(gt) : gt(o);
1780
+ };
1781
+ });
1782
+ function gt(e) {
1783
+ return e.value = Object.freeze(e.value), e;
1784
+ }
1785
+ const So = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
1786
+ D.init(e, t), P.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1787
+ const r = n.value, o = t.fn(r);
1788
+ if (o instanceof Promise)
1789
+ return o.then((i) => _t(i, n, r, e));
1790
+ _t(o, n, r, e);
1791
+ };
1792
+ });
1793
+ function _t(e, t, n, r) {
1794
+ if (!e) {
1795
+ const o = {
1796
+ code: "custom",
1797
+ input: n,
1798
+ inst: r,
1799
+ // incorporates params.error into issue reporting
1800
+ path: [...r._zod.def.path ?? []],
1801
+ // incorporates params.error into issue reporting
1802
+ continue: !r._zod.def.abort
1803
+ // params: inst._zod.def.params,
1804
+ };
1805
+ r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(ge(o));
1806
+ }
1807
+ }
1808
+ var vt;
1809
+ class $o {
1810
+ constructor() {
1811
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1812
+ }
1813
+ add(t, ...n) {
1814
+ const r = n[0];
1815
+ return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
1816
+ }
1817
+ clear() {
1818
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1819
+ }
1820
+ remove(t) {
1821
+ const n = this._map.get(t);
1822
+ return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
1823
+ }
1824
+ get(t) {
1825
+ const n = t._zod.parent;
1826
+ if (n) {
1827
+ const r = { ...this.get(n) ?? {} };
1828
+ delete r.id;
1829
+ const o = { ...r, ...this._map.get(t) };
1830
+ return Object.keys(o).length ? o : void 0;
1831
+ }
1832
+ return this._map.get(t);
1833
+ }
1834
+ has(t) {
1835
+ return this._map.has(t);
1836
+ }
257
1837
  }
258
- var Q;
259
- function se() {
260
- return Q || (Q = 1, process.env.NODE_ENV === "production" ? S.exports = oe() : S.exports = ie()), S.exports;
1838
+ function Oo() {
1839
+ return new $o();
261
1840
  }
262
- var a = se();
263
- function le(t) {
264
- return t.data ? t.data : t.staticData ? {
1841
+ (vt = globalThis).__zod_globalRegistry ?? (vt.__zod_globalRegistry = Oo());
1842
+ const me = globalThis.__zod_globalRegistry;
1843
+ // @__NO_SIDE_EFFECTS__
1844
+ function Zo(e, t) {
1845
+ return new e({
1846
+ type: "string",
1847
+ ...g(t)
1848
+ });
1849
+ }
1850
+ // @__NO_SIDE_EFFECTS__
1851
+ function To(e, t) {
1852
+ return new e({
1853
+ type: "string",
1854
+ format: "email",
1855
+ check: "string_format",
1856
+ abort: !1,
1857
+ ...g(t)
1858
+ });
1859
+ }
1860
+ // @__NO_SIDE_EFFECTS__
1861
+ function yt(e, t) {
1862
+ return new e({
1863
+ type: "string",
1864
+ format: "guid",
1865
+ check: "string_format",
1866
+ abort: !1,
1867
+ ...g(t)
1868
+ });
1869
+ }
1870
+ // @__NO_SIDE_EFFECTS__
1871
+ function Po(e, t) {
1872
+ return new e({
1873
+ type: "string",
1874
+ format: "uuid",
1875
+ check: "string_format",
1876
+ abort: !1,
1877
+ ...g(t)
1878
+ });
1879
+ }
1880
+ // @__NO_SIDE_EFFECTS__
1881
+ function jo(e, t) {
1882
+ return new e({
1883
+ type: "string",
1884
+ format: "uuid",
1885
+ check: "string_format",
1886
+ abort: !1,
1887
+ version: "v4",
1888
+ ...g(t)
1889
+ });
1890
+ }
1891
+ // @__NO_SIDE_EFFECTS__
1892
+ function No(e, t) {
1893
+ return new e({
1894
+ type: "string",
1895
+ format: "uuid",
1896
+ check: "string_format",
1897
+ abort: !1,
1898
+ version: "v6",
1899
+ ...g(t)
1900
+ });
1901
+ }
1902
+ // @__NO_SIDE_EFFECTS__
1903
+ function Io(e, t) {
1904
+ return new e({
1905
+ type: "string",
1906
+ format: "uuid",
1907
+ check: "string_format",
1908
+ abort: !1,
1909
+ version: "v7",
1910
+ ...g(t)
1911
+ });
1912
+ }
1913
+ // @__NO_SIDE_EFFECTS__
1914
+ function Co(e, t) {
1915
+ return new e({
1916
+ type: "string",
1917
+ format: "url",
1918
+ check: "string_format",
1919
+ abort: !1,
1920
+ ...g(t)
1921
+ });
1922
+ }
1923
+ // @__NO_SIDE_EFFECTS__
1924
+ function Ro(e, t) {
1925
+ return new e({
1926
+ type: "string",
1927
+ format: "emoji",
1928
+ check: "string_format",
1929
+ abort: !1,
1930
+ ...g(t)
1931
+ });
1932
+ }
1933
+ // @__NO_SIDE_EFFECTS__
1934
+ function xo(e, t) {
1935
+ return new e({
1936
+ type: "string",
1937
+ format: "nanoid",
1938
+ check: "string_format",
1939
+ abort: !1,
1940
+ ...g(t)
1941
+ });
1942
+ }
1943
+ // @__NO_SIDE_EFFECTS__
1944
+ function Ao(e, t) {
1945
+ return new e({
1946
+ type: "string",
1947
+ format: "cuid",
1948
+ check: "string_format",
1949
+ abort: !1,
1950
+ ...g(t)
1951
+ });
1952
+ }
1953
+ // @__NO_SIDE_EFFECTS__
1954
+ function Fo(e, t) {
1955
+ return new e({
1956
+ type: "string",
1957
+ format: "cuid2",
1958
+ check: "string_format",
1959
+ abort: !1,
1960
+ ...g(t)
1961
+ });
1962
+ }
1963
+ // @__NO_SIDE_EFFECTS__
1964
+ function Mo(e, t) {
1965
+ return new e({
1966
+ type: "string",
1967
+ format: "ulid",
1968
+ check: "string_format",
1969
+ abort: !1,
1970
+ ...g(t)
1971
+ });
1972
+ }
1973
+ // @__NO_SIDE_EFFECTS__
1974
+ function Do(e, t) {
1975
+ return new e({
1976
+ type: "string",
1977
+ format: "xid",
1978
+ check: "string_format",
1979
+ abort: !1,
1980
+ ...g(t)
1981
+ });
1982
+ }
1983
+ // @__NO_SIDE_EFFECTS__
1984
+ function Lo(e, t) {
1985
+ return new e({
1986
+ type: "string",
1987
+ format: "ksuid",
1988
+ check: "string_format",
1989
+ abort: !1,
1990
+ ...g(t)
1991
+ });
1992
+ }
1993
+ // @__NO_SIDE_EFFECTS__
1994
+ function Uo(e, t) {
1995
+ return new e({
1996
+ type: "string",
1997
+ format: "ipv4",
1998
+ check: "string_format",
1999
+ abort: !1,
2000
+ ...g(t)
2001
+ });
2002
+ }
2003
+ // @__NO_SIDE_EFFECTS__
2004
+ function Jo(e, t) {
2005
+ return new e({
2006
+ type: "string",
2007
+ format: "ipv6",
2008
+ check: "string_format",
2009
+ abort: !1,
2010
+ ...g(t)
2011
+ });
2012
+ }
2013
+ // @__NO_SIDE_EFFECTS__
2014
+ function Vo(e, t) {
2015
+ return new e({
2016
+ type: "string",
2017
+ format: "cidrv4",
2018
+ check: "string_format",
2019
+ abort: !1,
2020
+ ...g(t)
2021
+ });
2022
+ }
2023
+ // @__NO_SIDE_EFFECTS__
2024
+ function Wo(e, t) {
2025
+ return new e({
2026
+ type: "string",
2027
+ format: "cidrv6",
2028
+ check: "string_format",
2029
+ abort: !1,
2030
+ ...g(t)
2031
+ });
2032
+ }
2033
+ // @__NO_SIDE_EFFECTS__
2034
+ function Yo(e, t) {
2035
+ return new e({
2036
+ type: "string",
2037
+ format: "base64",
2038
+ check: "string_format",
2039
+ abort: !1,
2040
+ ...g(t)
2041
+ });
2042
+ }
2043
+ // @__NO_SIDE_EFFECTS__
2044
+ function Bo(e, t) {
2045
+ return new e({
2046
+ type: "string",
2047
+ format: "base64url",
2048
+ check: "string_format",
2049
+ abort: !1,
2050
+ ...g(t)
2051
+ });
2052
+ }
2053
+ // @__NO_SIDE_EFFECTS__
2054
+ function Go(e, t) {
2055
+ return new e({
2056
+ type: "string",
2057
+ format: "e164",
2058
+ check: "string_format",
2059
+ abort: !1,
2060
+ ...g(t)
2061
+ });
2062
+ }
2063
+ // @__NO_SIDE_EFFECTS__
2064
+ function qo(e, t) {
2065
+ return new e({
2066
+ type: "string",
2067
+ format: "jwt",
2068
+ check: "string_format",
2069
+ abort: !1,
2070
+ ...g(t)
2071
+ });
2072
+ }
2073
+ // @__NO_SIDE_EFFECTS__
2074
+ function Ho(e, t) {
2075
+ return new e({
2076
+ type: "string",
2077
+ format: "datetime",
2078
+ check: "string_format",
2079
+ offset: !1,
2080
+ local: !1,
2081
+ precision: null,
2082
+ ...g(t)
2083
+ });
2084
+ }
2085
+ // @__NO_SIDE_EFFECTS__
2086
+ function Ko(e, t) {
2087
+ return new e({
2088
+ type: "string",
2089
+ format: "date",
2090
+ check: "string_format",
2091
+ ...g(t)
2092
+ });
2093
+ }
2094
+ // @__NO_SIDE_EFFECTS__
2095
+ function Xo(e, t) {
2096
+ return new e({
2097
+ type: "string",
2098
+ format: "time",
2099
+ check: "string_format",
2100
+ precision: null,
2101
+ ...g(t)
2102
+ });
2103
+ }
2104
+ // @__NO_SIDE_EFFECTS__
2105
+ function Qo(e, t) {
2106
+ return new e({
2107
+ type: "string",
2108
+ format: "duration",
2109
+ check: "string_format",
2110
+ ...g(t)
2111
+ });
2112
+ }
2113
+ // @__NO_SIDE_EFFECTS__
2114
+ function ei(e, t) {
2115
+ return new e({
2116
+ type: "number",
2117
+ checks: [],
2118
+ ...g(t)
2119
+ });
2120
+ }
2121
+ // @__NO_SIDE_EFFECTS__
2122
+ function ti(e, t) {
2123
+ return new e({
2124
+ type: "number",
2125
+ check: "number_format",
2126
+ abort: !1,
2127
+ format: "safeint",
2128
+ ...g(t)
2129
+ });
2130
+ }
2131
+ // @__NO_SIDE_EFFECTS__
2132
+ function ni(e) {
2133
+ return new e({
2134
+ type: "unknown"
2135
+ });
2136
+ }
2137
+ // @__NO_SIDE_EFFECTS__
2138
+ function ri(e, t) {
2139
+ return new e({
2140
+ type: "never",
2141
+ ...g(t)
2142
+ });
2143
+ }
2144
+ // @__NO_SIDE_EFFECTS__
2145
+ function bt(e, t) {
2146
+ return new Ht({
2147
+ check: "less_than",
2148
+ ...g(t),
2149
+ value: e,
2150
+ inclusive: !1
2151
+ });
2152
+ }
2153
+ // @__NO_SIDE_EFFECTS__
2154
+ function Ae(e, t) {
2155
+ return new Ht({
2156
+ check: "less_than",
2157
+ ...g(t),
2158
+ value: e,
2159
+ inclusive: !0
2160
+ });
2161
+ }
2162
+ // @__NO_SIDE_EFFECTS__
2163
+ function wt(e, t) {
2164
+ return new Kt({
2165
+ check: "greater_than",
2166
+ ...g(t),
2167
+ value: e,
2168
+ inclusive: !1
2169
+ });
2170
+ }
2171
+ // @__NO_SIDE_EFFECTS__
2172
+ function Fe(e, t) {
2173
+ return new Kt({
2174
+ check: "greater_than",
2175
+ ...g(t),
2176
+ value: e,
2177
+ inclusive: !0
2178
+ });
2179
+ }
2180
+ // @__NO_SIDE_EFFECTS__
2181
+ function zt(e, t) {
2182
+ return new br({
2183
+ check: "multiple_of",
2184
+ ...g(t),
2185
+ value: e
2186
+ });
2187
+ }
2188
+ // @__NO_SIDE_EFFECTS__
2189
+ function rn(e, t) {
2190
+ return new zr({
2191
+ check: "max_length",
2192
+ ...g(t),
2193
+ maximum: e
2194
+ });
2195
+ }
2196
+ // @__NO_SIDE_EFFECTS__
2197
+ function Se(e, t) {
2198
+ return new kr({
2199
+ check: "min_length",
2200
+ ...g(t),
2201
+ minimum: e
2202
+ });
2203
+ }
2204
+ // @__NO_SIDE_EFFECTS__
2205
+ function on(e, t) {
2206
+ return new Er({
2207
+ check: "length_equals",
2208
+ ...g(t),
2209
+ length: e
2210
+ });
2211
+ }
2212
+ // @__NO_SIDE_EFFECTS__
2213
+ function oi(e, t) {
2214
+ return new Sr({
2215
+ check: "string_format",
2216
+ format: "regex",
2217
+ ...g(t),
2218
+ pattern: e
2219
+ });
2220
+ }
2221
+ // @__NO_SIDE_EFFECTS__
2222
+ function ii(e) {
2223
+ return new $r({
2224
+ check: "string_format",
2225
+ format: "lowercase",
2226
+ ...g(e)
2227
+ });
2228
+ }
2229
+ // @__NO_SIDE_EFFECTS__
2230
+ function si(e) {
2231
+ return new Or({
2232
+ check: "string_format",
2233
+ format: "uppercase",
2234
+ ...g(e)
2235
+ });
2236
+ }
2237
+ // @__NO_SIDE_EFFECTS__
2238
+ function ai(e, t) {
2239
+ return new Zr({
2240
+ check: "string_format",
2241
+ format: "includes",
2242
+ ...g(t),
2243
+ includes: e
2244
+ });
2245
+ }
2246
+ // @__NO_SIDE_EFFECTS__
2247
+ function ci(e, t) {
2248
+ return new Tr({
2249
+ check: "string_format",
2250
+ format: "starts_with",
2251
+ ...g(t),
2252
+ prefix: e
2253
+ });
2254
+ }
2255
+ // @__NO_SIDE_EFFECTS__
2256
+ function ui(e, t) {
2257
+ return new Pr({
2258
+ check: "string_format",
2259
+ format: "ends_with",
2260
+ ...g(t),
2261
+ suffix: e
2262
+ });
2263
+ }
2264
+ // @__NO_SIDE_EFFECTS__
2265
+ function ue(e) {
2266
+ return new jr({
2267
+ check: "overwrite",
2268
+ tx: e
2269
+ });
2270
+ }
2271
+ // @__NO_SIDE_EFFECTS__
2272
+ function li(e) {
2273
+ return /* @__PURE__ */ ue((t) => t.normalize(e));
2274
+ }
2275
+ // @__NO_SIDE_EFFECTS__
2276
+ function fi() {
2277
+ return /* @__PURE__ */ ue((e) => e.trim());
2278
+ }
2279
+ // @__NO_SIDE_EFFECTS__
2280
+ function di() {
2281
+ return /* @__PURE__ */ ue((e) => e.toLowerCase());
2282
+ }
2283
+ // @__NO_SIDE_EFFECTS__
2284
+ function pi() {
2285
+ return /* @__PURE__ */ ue((e) => e.toUpperCase());
2286
+ }
2287
+ // @__NO_SIDE_EFFECTS__
2288
+ function mi() {
2289
+ return /* @__PURE__ */ ue((e) => Sn(e));
2290
+ }
2291
+ // @__NO_SIDE_EFFECTS__
2292
+ function hi(e, t, n) {
2293
+ return new e({
2294
+ type: "array",
2295
+ element: t,
2296
+ // get element() {
2297
+ // return element;
2298
+ // },
2299
+ ...g(n)
2300
+ });
2301
+ }
2302
+ // @__NO_SIDE_EFFECTS__
2303
+ function gi(e, t, n) {
2304
+ return new e({
2305
+ type: "custom",
2306
+ check: "custom",
2307
+ fn: t,
2308
+ ...g(n)
2309
+ });
2310
+ }
2311
+ // @__NO_SIDE_EFFECTS__
2312
+ function _i(e) {
2313
+ const t = /* @__PURE__ */ vi((n) => (n.addIssue = (r) => {
2314
+ if (typeof r == "string")
2315
+ n.issues.push(ge(r, n.value, t._zod.def));
2316
+ else {
2317
+ const o = r;
2318
+ 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(ge(o));
2319
+ }
2320
+ }, e(n.value, n)));
2321
+ return t;
2322
+ }
2323
+ // @__NO_SIDE_EFFECTS__
2324
+ function vi(e, t) {
2325
+ const n = new D({
2326
+ check: "custom",
2327
+ ...g(t)
2328
+ });
2329
+ return n._zod.check = e, n;
2330
+ }
2331
+ function sn(e) {
2332
+ let t = e?.target ?? "draft-2020-12";
2333
+ return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2334
+ processors: e.processors ?? {},
2335
+ metadataRegistry: e?.metadata ?? me,
2336
+ target: t,
2337
+ unrepresentable: e?.unrepresentable ?? "throw",
2338
+ override: e?.override ?? (() => {
2339
+ }),
2340
+ io: e?.io ?? "output",
2341
+ counter: 0,
2342
+ seen: /* @__PURE__ */ new Map(),
2343
+ cycles: e?.cycles ?? "ref",
2344
+ reused: e?.reused ?? "inline",
2345
+ external: e?.external ?? void 0
2346
+ };
2347
+ }
2348
+ function x(e, t, n = { path: [], schemaPath: [] }) {
2349
+ var r;
2350
+ const o = e._zod.def, i = t.seen.get(e);
2351
+ if (i)
2352
+ return i.count++, n.schemaPath.includes(e) && (i.cycle = n.path), i.schema;
2353
+ const s = { schema: {}, count: 1, cycle: void 0, path: n.path };
2354
+ t.seen.set(e, s);
2355
+ const a = e._zod.toJSONSchema?.();
2356
+ if (a)
2357
+ s.schema = a;
2358
+ else {
2359
+ const d = {
2360
+ ...n,
2361
+ schemaPath: [...n.schemaPath, e],
2362
+ path: n.path
2363
+ };
2364
+ if (e._zod.processJSONSchema)
2365
+ e._zod.processJSONSchema(t, s.schema, d);
2366
+ else {
2367
+ const p = s.schema, h = t.processors[o.type];
2368
+ if (!h)
2369
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
2370
+ h(e, t, p, d);
2371
+ }
2372
+ const m = e._zod.parent;
2373
+ m && (s.ref || (s.ref = m), x(m, t, d), t.seen.get(m).isParent = !0);
2374
+ }
2375
+ const c = t.metadataRegistry.get(e);
2376
+ return c && Object.assign(s.schema, c), t.io === "input" && M(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && s.schema._prefault && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
2377
+ }
2378
+ function an(e, t) {
2379
+ const n = e.seen.get(t);
2380
+ if (!n)
2381
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
2382
+ const r = /* @__PURE__ */ new Map();
2383
+ for (const s of e.seen.entries()) {
2384
+ const a = e.metadataRegistry.get(s[0])?.id;
2385
+ if (a) {
2386
+ const c = r.get(a);
2387
+ if (c && c !== s[0])
2388
+ throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2389
+ r.set(a, s[0]);
2390
+ }
2391
+ }
2392
+ const o = (s) => {
2393
+ const a = e.target === "draft-2020-12" ? "$defs" : "definitions";
2394
+ if (e.external) {
2395
+ const m = e.external.registry.get(s[0])?.id, p = e.external.uri ?? ((z) => z);
2396
+ if (m)
2397
+ return { ref: p(m) };
2398
+ const h = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
2399
+ return s[1].defId = h, { defId: h, ref: `${p("__shared")}#/${a}/${h}` };
2400
+ }
2401
+ if (s[1] === n)
2402
+ return { ref: "#" };
2403
+ const u = `#/${a}/`, d = s[1].schema.id ?? `__schema${e.counter++}`;
2404
+ return { defId: d, ref: u + d };
2405
+ }, i = (s) => {
2406
+ if (s[1].schema.$ref)
2407
+ return;
2408
+ const a = s[1], { ref: c, defId: u } = o(s);
2409
+ a.def = { ...a.schema }, u && (a.defId = u);
2410
+ const d = a.schema;
2411
+ for (const m in d)
2412
+ delete d[m];
2413
+ d.$ref = c;
2414
+ };
2415
+ if (e.cycles === "throw")
2416
+ for (const s of e.seen.entries()) {
2417
+ const a = s[1];
2418
+ if (a.cycle)
2419
+ throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
2420
+
2421
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2422
+ }
2423
+ for (const s of e.seen.entries()) {
2424
+ const a = s[1];
2425
+ if (t === s[0]) {
2426
+ i(s);
2427
+ continue;
2428
+ }
2429
+ if (e.external) {
2430
+ const u = e.external.registry.get(s[0])?.id;
2431
+ if (t !== s[0] && u) {
2432
+ i(s);
2433
+ continue;
2434
+ }
2435
+ }
2436
+ if (e.metadataRegistry.get(s[0])?.id) {
2437
+ i(s);
2438
+ continue;
2439
+ }
2440
+ if (a.cycle) {
2441
+ i(s);
2442
+ continue;
2443
+ }
2444
+ if (a.count > 1 && e.reused === "ref") {
2445
+ i(s);
2446
+ continue;
2447
+ }
2448
+ }
2449
+ }
2450
+ function cn(e, t) {
2451
+ const n = e.seen.get(t);
2452
+ if (!n)
2453
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
2454
+ const r = (s) => {
2455
+ const a = e.seen.get(s);
2456
+ if (a.ref === null)
2457
+ return;
2458
+ const c = a.def ?? a.schema, u = { ...c }, d = a.ref;
2459
+ if (a.ref = null, d) {
2460
+ r(d);
2461
+ const p = e.seen.get(d), h = p.schema;
2462
+ if (h.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(h)) : Object.assign(c, h), Object.assign(c, u), s._zod.parent === d)
2463
+ for (const k in c)
2464
+ k === "$ref" || k === "allOf" || k in u || delete c[k];
2465
+ if (h.$ref && p.def)
2466
+ for (const k in c)
2467
+ k === "$ref" || k === "allOf" || k in p.def && JSON.stringify(c[k]) === JSON.stringify(p.def[k]) && delete c[k];
2468
+ }
2469
+ const m = s._zod.parent;
2470
+ if (m && m !== d) {
2471
+ r(m);
2472
+ const p = e.seen.get(m);
2473
+ if (p?.schema.$ref && (c.$ref = p.schema.$ref, p.def))
2474
+ for (const h in c)
2475
+ h === "$ref" || h === "allOf" || h in p.def && JSON.stringify(c[h]) === JSON.stringify(p.def[h]) && delete c[h];
2476
+ }
2477
+ e.override({
2478
+ zodSchema: s,
2479
+ jsonSchema: c,
2480
+ path: a.path ?? []
2481
+ });
2482
+ };
2483
+ for (const s of [...e.seen.entries()].reverse())
2484
+ r(s[0]);
2485
+ const o = {};
2486
+ if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
2487
+ const s = e.external.registry.get(t)?.id;
2488
+ if (!s)
2489
+ throw new Error("Schema is missing an `id` property");
2490
+ o.$id = e.external.uri(s);
2491
+ }
2492
+ Object.assign(o, n.def ?? n.schema);
2493
+ const i = e.external?.defs ?? {};
2494
+ for (const s of e.seen.entries()) {
2495
+ const a = s[1];
2496
+ a.def && a.defId && (i[a.defId] = a.def);
2497
+ }
2498
+ e.external || Object.keys(i).length > 0 && (e.target === "draft-2020-12" ? o.$defs = i : o.definitions = i);
2499
+ try {
2500
+ const s = JSON.parse(JSON.stringify(o));
2501
+ return Object.defineProperty(s, "~standard", {
2502
+ value: {
2503
+ ...t["~standard"],
2504
+ jsonSchema: {
2505
+ input: $e(t, "input", e.processors),
2506
+ output: $e(t, "output", e.processors)
2507
+ }
2508
+ },
2509
+ enumerable: !1,
2510
+ writable: !1
2511
+ }), s;
2512
+ } catch {
2513
+ throw new Error("Error converting schema to JSON.");
2514
+ }
2515
+ }
2516
+ function M(e, t) {
2517
+ const n = t ?? { seen: /* @__PURE__ */ new Set() };
2518
+ if (n.seen.has(e))
2519
+ return !1;
2520
+ n.seen.add(e);
2521
+ const r = e._zod.def;
2522
+ if (r.type === "transform")
2523
+ return !0;
2524
+ if (r.type === "array")
2525
+ return M(r.element, n);
2526
+ if (r.type === "set")
2527
+ return M(r.valueType, n);
2528
+ if (r.type === "lazy")
2529
+ return M(r.getter(), n);
2530
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
2531
+ return M(r.innerType, n);
2532
+ if (r.type === "intersection")
2533
+ return M(r.left, n) || M(r.right, n);
2534
+ if (r.type === "record" || r.type === "map")
2535
+ return M(r.keyType, n) || M(r.valueType, n);
2536
+ if (r.type === "pipe")
2537
+ return M(r.in, n) || M(r.out, n);
2538
+ if (r.type === "object") {
2539
+ for (const o in r.shape)
2540
+ if (M(r.shape[o], n))
2541
+ return !0;
2542
+ return !1;
2543
+ }
2544
+ if (r.type === "union") {
2545
+ for (const o of r.options)
2546
+ if (M(o, n))
2547
+ return !0;
2548
+ return !1;
2549
+ }
2550
+ if (r.type === "tuple") {
2551
+ for (const o of r.items)
2552
+ if (M(o, n))
2553
+ return !0;
2554
+ return !!(r.rest && M(r.rest, n));
2555
+ }
2556
+ return !1;
2557
+ }
2558
+ const yi = (e, t = {}) => (n) => {
2559
+ const r = sn({ ...n, processors: t });
2560
+ return x(e, r), an(r, e), cn(r, e);
2561
+ }, $e = (e, t, n = {}) => (r) => {
2562
+ const { libraryOptions: o, target: i } = r ?? {}, s = sn({ ...o ?? {}, target: i, io: t, processors: n });
2563
+ return x(e, s), an(s, e), cn(s, e);
2564
+ }, bi = {
2565
+ guid: "uuid",
2566
+ url: "uri",
2567
+ datetime: "date-time",
2568
+ json_string: "json-string",
2569
+ regex: ""
2570
+ // do not set
2571
+ }, wi = (e, t, n, r) => {
2572
+ const o = n;
2573
+ o.type = "string";
2574
+ const { minimum: i, maximum: s, format: a, patterns: c, contentEncoding: u } = e._zod.bag;
2575
+ if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), a && (o.format = bi[a] ?? a, o.format === "" && delete o.format, a === "time" && delete o.format), u && (o.contentEncoding = u), c && c.size > 0) {
2576
+ const d = [...c];
2577
+ d.length === 1 ? o.pattern = d[0].source : d.length > 1 && (o.allOf = [
2578
+ ...d.map((m) => ({
2579
+ ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2580
+ pattern: m.source
2581
+ }))
2582
+ ]);
2583
+ }
2584
+ }, zi = (e, t, n, r) => {
2585
+ const o = n, { minimum: i, maximum: s, format: a, multipleOf: c, exclusiveMaximum: u, exclusiveMinimum: d } = e._zod.bag;
2586
+ typeof a == "string" && a.includes("int") ? o.type = "integer" : o.type = "number", typeof d == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = d, o.exclusiveMinimum = !0) : o.exclusiveMinimum = d), typeof i == "number" && (o.minimum = i, typeof d == "number" && t.target !== "draft-04" && (d >= i ? delete o.minimum : delete o.exclusiveMinimum)), typeof u == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = u, o.exclusiveMaximum = !0) : o.exclusiveMaximum = u), typeof s == "number" && (o.maximum = s, typeof u == "number" && t.target !== "draft-04" && (u <= s ? delete o.maximum : delete o.exclusiveMaximum)), typeof c == "number" && (o.multipleOf = c);
2587
+ }, ki = (e, t, n, r) => {
2588
+ n.not = {};
2589
+ }, Ei = (e, t, n, r) => {
2590
+ }, Si = (e, t, n, r) => {
2591
+ const o = e._zod.def, i = Dt(o.entries);
2592
+ i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
2593
+ }, $i = (e, t, n, r) => {
2594
+ if (t.unrepresentable === "throw")
2595
+ throw new Error("Custom types cannot be represented in JSON Schema");
2596
+ }, Oi = (e, t, n, r) => {
2597
+ if (t.unrepresentable === "throw")
2598
+ throw new Error("Transforms cannot be represented in JSON Schema");
2599
+ }, Zi = (e, t, n, r) => {
2600
+ const o = n, i = e._zod.def, { minimum: s, maximum: a } = e._zod.bag;
2601
+ typeof s == "number" && (o.minItems = s), typeof a == "number" && (o.maxItems = a), o.type = "array", o.items = x(i.element, t, { ...r, path: [...r.path, "items"] });
2602
+ }, Ti = (e, t, n, r) => {
2603
+ const o = n, i = e._zod.def;
2604
+ o.type = "object", o.properties = {};
2605
+ const s = i.shape;
2606
+ for (const u in s)
2607
+ o.properties[u] = x(s[u], t, {
2608
+ ...r,
2609
+ path: [...r.path, "properties", u]
2610
+ });
2611
+ const a = new Set(Object.keys(s)), c = new Set([...a].filter((u) => {
2612
+ const d = i.shape[u]._zod;
2613
+ return t.io === "input" ? d.optin === void 0 : d.optout === void 0;
2614
+ }));
2615
+ c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = x(i.catchall, t, {
2616
+ ...r,
2617
+ path: [...r.path, "additionalProperties"]
2618
+ })) : t.io === "output" && (o.additionalProperties = !1);
2619
+ }, Pi = (e, t, n, r) => {
2620
+ const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((a, c) => x(a, t, {
2621
+ ...r,
2622
+ path: [...r.path, i ? "oneOf" : "anyOf", c]
2623
+ }));
2624
+ i ? n.oneOf = s : n.anyOf = s;
2625
+ }, ji = (e, t, n, r) => {
2626
+ const o = e._zod.def, i = x(o.left, t, {
2627
+ ...r,
2628
+ path: [...r.path, "allOf", 0]
2629
+ }), s = x(o.right, t, {
2630
+ ...r,
2631
+ path: [...r.path, "allOf", 1]
2632
+ }), a = (u) => "allOf" in u && Object.keys(u).length === 1, c = [
2633
+ ...a(i) ? i.allOf : [i],
2634
+ ...a(s) ? s.allOf : [s]
2635
+ ];
2636
+ n.allOf = c;
2637
+ }, Ni = (e, t, n, r) => {
2638
+ const o = n, i = e._zod.def;
2639
+ o.type = "array";
2640
+ const s = t.target === "draft-2020-12" ? "prefixItems" : "items", a = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = i.items.map((p, h) => x(p, t, {
2641
+ ...r,
2642
+ path: [...r.path, s, h]
2643
+ })), u = i.rest ? x(i.rest, t, {
2644
+ ...r,
2645
+ path: [...r.path, a, ...t.target === "openapi-3.0" ? [i.items.length] : []]
2646
+ }) : null;
2647
+ t.target === "draft-2020-12" ? (o.prefixItems = c, u && (o.items = u)) : t.target === "openapi-3.0" ? (o.items = {
2648
+ anyOf: c
2649
+ }, u && o.items.anyOf.push(u), o.minItems = c.length, u || (o.maxItems = c.length)) : (o.items = c, u && (o.additionalItems = u));
2650
+ const { minimum: d, maximum: m } = e._zod.bag;
2651
+ typeof d == "number" && (o.minItems = d), typeof m == "number" && (o.maxItems = m);
2652
+ }, Ii = (e, t, n, r) => {
2653
+ const o = e._zod.def, i = x(o.innerType, t, r), s = t.seen.get(e);
2654
+ t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
2655
+ }, Ci = (e, t, n, r) => {
2656
+ const o = e._zod.def;
2657
+ x(o.innerType, t, r);
2658
+ const i = t.seen.get(e);
2659
+ i.ref = o.innerType;
2660
+ }, Ri = (e, t, n, r) => {
2661
+ const o = e._zod.def;
2662
+ x(o.innerType, t, r);
2663
+ const i = t.seen.get(e);
2664
+ i.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
2665
+ }, xi = (e, t, n, r) => {
2666
+ const o = e._zod.def;
2667
+ x(o.innerType, t, r);
2668
+ const i = t.seen.get(e);
2669
+ i.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
2670
+ }, Ai = (e, t, n, r) => {
2671
+ const o = e._zod.def;
2672
+ x(o.innerType, t, r);
2673
+ const i = t.seen.get(e);
2674
+ i.ref = o.innerType;
2675
+ let s;
2676
+ try {
2677
+ s = o.catchValue(void 0);
2678
+ } catch {
2679
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
2680
+ }
2681
+ n.default = s;
2682
+ }, Fi = (e, t, n, r) => {
2683
+ const o = e._zod.def, i = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
2684
+ x(i, t, r);
2685
+ const s = t.seen.get(e);
2686
+ s.ref = i;
2687
+ }, Mi = (e, t, n, r) => {
2688
+ const o = e._zod.def;
2689
+ x(o.innerType, t, r);
2690
+ const i = t.seen.get(e);
2691
+ i.ref = o.innerType, n.readOnly = !0;
2692
+ }, un = (e, t, n, r) => {
2693
+ const o = e._zod.def;
2694
+ x(o.innerType, t, r);
2695
+ const i = t.seen.get(e);
2696
+ i.ref = o.innerType;
2697
+ }, Di = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
2698
+ Wr.init(e, t), O.init(e, t);
2699
+ });
2700
+ function Li(e) {
2701
+ return /* @__PURE__ */ Ho(Di, e);
2702
+ }
2703
+ const Ui = /* @__PURE__ */ l("ZodISODate", (e, t) => {
2704
+ Yr.init(e, t), O.init(e, t);
2705
+ });
2706
+ function Ji(e) {
2707
+ return /* @__PURE__ */ Ko(Ui, e);
2708
+ }
2709
+ const Vi = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
2710
+ Br.init(e, t), O.init(e, t);
2711
+ });
2712
+ function Wi(e) {
2713
+ return /* @__PURE__ */ Xo(Vi, e);
2714
+ }
2715
+ const Yi = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
2716
+ Gr.init(e, t), O.init(e, t);
2717
+ });
2718
+ function Bi(e) {
2719
+ return /* @__PURE__ */ Qo(Yi, e);
2720
+ }
2721
+ const Gi = (e, t) => {
2722
+ Vt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2723
+ format: {
2724
+ value: (n) => Fn(e, n)
2725
+ // enumerable: false,
2726
+ },
2727
+ flatten: {
2728
+ value: (n) => An(e, n)
2729
+ // enumerable: false,
2730
+ },
2731
+ addIssue: {
2732
+ value: (n) => {
2733
+ e.issues.push(n), e.message = JSON.stringify(e.issues, De, 2);
2734
+ }
2735
+ // enumerable: false,
2736
+ },
2737
+ addIssues: {
2738
+ value: (n) => {
2739
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, De, 2);
2740
+ }
2741
+ // enumerable: false,
2742
+ },
2743
+ isEmpty: {
2744
+ get() {
2745
+ return e.issues.length === 0;
2746
+ }
2747
+ // enumerable: false,
2748
+ }
2749
+ });
2750
+ }, J = l("ZodError", Gi, {
2751
+ Parent: Error
2752
+ }), qi = /* @__PURE__ */ qe(J), Hi = /* @__PURE__ */ He(J), Ki = /* @__PURE__ */ Pe(J), Xi = /* @__PURE__ */ je(J), Qi = /* @__PURE__ */ Ln(J), es = /* @__PURE__ */ Un(J), ts = /* @__PURE__ */ Jn(J), ns = /* @__PURE__ */ Vn(J), rs = /* @__PURE__ */ Wn(J), os = /* @__PURE__ */ Yn(J), is = /* @__PURE__ */ Bn(J), ss = /* @__PURE__ */ Gn(J), j = /* @__PURE__ */ l("ZodType", (e, t) => (P.init(e, t), Object.assign(e["~standard"], {
2753
+ jsonSchema: {
2754
+ input: $e(e, "input"),
2755
+ output: $e(e, "output")
2756
+ }
2757
+ }), e.toJSONSchema = yi(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(H(t, {
2758
+ checks: [
2759
+ ...t.checks ?? [],
2760
+ ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2761
+ ]
2762
+ }), {
2763
+ parent: !0
2764
+ }), e.with = e.check, e.clone = (n, r) => K(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => qi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ki(e, n, r), e.parseAsync = async (n, r) => Hi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => Xi(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Qi(e, n, r), e.decode = (n, r) => es(e, n, r), e.encodeAsync = async (n, r) => ts(e, n, r), e.decodeAsync = async (n, r) => ns(e, n, r), e.safeEncode = (n, r) => rs(e, n, r), e.safeDecode = (n, r) => os(e, n, r), e.safeEncodeAsync = async (n, r) => is(e, n, r), e.safeDecodeAsync = async (n, r) => ss(e, n, r), e.refine = (n, r) => e.check(na(n, r)), e.superRefine = (n) => e.check(ra(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ ue(n)), e.optional = () => $t(e), e.exactOptional = () => Js(e), e.nullable = () => Ot(e), e.nullish = () => $t(Ot(e)), e.nonoptional = (n) => qs(e, n), e.array = () => Ps(e), e.or = (n) => Cs([e, n]), e.and = (n) => xs(e, n), e.transform = (n) => Zt(e, Ls(n)), e.default = (n) => Ys(e, n), e.prefault = (n) => Gs(e, n), e.catch = (n) => Ks(e, n), e.pipe = (n) => Zt(e, n), e.readonly = () => ea(e), e.describe = (n) => {
2765
+ const r = e.clone();
2766
+ return me.add(r, { description: n }), r;
2767
+ }, Object.defineProperty(e, "description", {
2768
+ get() {
2769
+ return me.get(e)?.description;
2770
+ },
2771
+ configurable: !0
2772
+ }), e.meta = (...n) => {
2773
+ if (n.length === 0)
2774
+ return me.get(e);
2775
+ const r = e.clone();
2776
+ return me.add(r, n[0]), r;
2777
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), ln = /* @__PURE__ */ l("_ZodString", (e, t) => {
2778
+ Ke.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => wi(e, r, o);
2779
+ const n = e._zod.bag;
2780
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ oi(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ ai(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ ci(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ ui(...r)), e.min = (...r) => e.check(/* @__PURE__ */ Se(...r)), e.max = (...r) => e.check(/* @__PURE__ */ rn(...r)), e.length = (...r) => e.check(/* @__PURE__ */ on(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ Se(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ ii(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ si(r)), e.trim = () => e.check(/* @__PURE__ */ fi()), e.normalize = (...r) => e.check(/* @__PURE__ */ li(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ di()), e.toUpperCase = () => e.check(/* @__PURE__ */ pi()), e.slugify = () => e.check(/* @__PURE__ */ mi());
2781
+ }), as = /* @__PURE__ */ l("ZodString", (e, t) => {
2782
+ Ke.init(e, t), ln.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ To(cs, n)), e.url = (n) => e.check(/* @__PURE__ */ Co(us, n)), e.jwt = (n) => e.check(/* @__PURE__ */ qo(Es, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Ro(ls, n)), e.guid = (n) => e.check(/* @__PURE__ */ yt(kt, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Po(ze, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ jo(ze, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ No(ze, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Io(ze, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ xo(fs, n)), e.guid = (n) => e.check(/* @__PURE__ */ yt(kt, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Ao(ds, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Fo(ps, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Mo(ms, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Yo(ws, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Bo(zs, n)), e.xid = (n) => e.check(/* @__PURE__ */ Do(hs, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Lo(gs, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Uo(_s, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Jo(vs, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Vo(ys, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Wo(bs, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Go(ks, n)), e.datetime = (n) => e.check(Li(n)), e.date = (n) => e.check(Ji(n)), e.time = (n) => e.check(Wi(n)), e.duration = (n) => e.check(Bi(n));
2783
+ });
2784
+ function pe(e) {
2785
+ return /* @__PURE__ */ Zo(as, e);
2786
+ }
2787
+ const O = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
2788
+ $.init(e, t), ln.init(e, t);
2789
+ }), cs = /* @__PURE__ */ l("ZodEmail", (e, t) => {
2790
+ xr.init(e, t), O.init(e, t);
2791
+ }), kt = /* @__PURE__ */ l("ZodGUID", (e, t) => {
2792
+ Cr.init(e, t), O.init(e, t);
2793
+ }), ze = /* @__PURE__ */ l("ZodUUID", (e, t) => {
2794
+ Rr.init(e, t), O.init(e, t);
2795
+ }), us = /* @__PURE__ */ l("ZodURL", (e, t) => {
2796
+ Ar.init(e, t), O.init(e, t);
2797
+ }), ls = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
2798
+ Fr.init(e, t), O.init(e, t);
2799
+ }), fs = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
2800
+ Mr.init(e, t), O.init(e, t);
2801
+ }), ds = /* @__PURE__ */ l("ZodCUID", (e, t) => {
2802
+ Dr.init(e, t), O.init(e, t);
2803
+ }), ps = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
2804
+ Lr.init(e, t), O.init(e, t);
2805
+ }), ms = /* @__PURE__ */ l("ZodULID", (e, t) => {
2806
+ Ur.init(e, t), O.init(e, t);
2807
+ }), hs = /* @__PURE__ */ l("ZodXID", (e, t) => {
2808
+ Jr.init(e, t), O.init(e, t);
2809
+ }), gs = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
2810
+ Vr.init(e, t), O.init(e, t);
2811
+ }), _s = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
2812
+ qr.init(e, t), O.init(e, t);
2813
+ }), vs = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
2814
+ Hr.init(e, t), O.init(e, t);
2815
+ }), ys = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
2816
+ Kr.init(e, t), O.init(e, t);
2817
+ }), bs = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
2818
+ Xr.init(e, t), O.init(e, t);
2819
+ }), ws = /* @__PURE__ */ l("ZodBase64", (e, t) => {
2820
+ Qr.init(e, t), O.init(e, t);
2821
+ }), zs = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
2822
+ to.init(e, t), O.init(e, t);
2823
+ }), ks = /* @__PURE__ */ l("ZodE164", (e, t) => {
2824
+ no.init(e, t), O.init(e, t);
2825
+ }), Es = /* @__PURE__ */ l("ZodJWT", (e, t) => {
2826
+ oo.init(e, t), O.init(e, t);
2827
+ }), fn = /* @__PURE__ */ l("ZodNumber", (e, t) => {
2828
+ Qt.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => zi(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ wt(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ Fe(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ Fe(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ bt(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ Ae(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ Ae(r, o)), e.int = (r) => e.check(Et(r)), e.safe = (r) => e.check(Et(r)), e.positive = (r) => e.check(/* @__PURE__ */ wt(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ Fe(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ bt(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ Ae(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ zt(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ zt(r, o)), e.finite = () => e;
2829
+ const n = e._zod.bag;
2830
+ 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;
2831
+ });
2832
+ function Me(e) {
2833
+ return /* @__PURE__ */ ei(fn, e);
2834
+ }
2835
+ const Ss = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
2836
+ io.init(e, t), fn.init(e, t);
2837
+ });
2838
+ function Et(e) {
2839
+ return /* @__PURE__ */ ti(Ss, e);
2840
+ }
2841
+ const $s = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
2842
+ so.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ei();
2843
+ });
2844
+ function St() {
2845
+ return /* @__PURE__ */ ni($s);
2846
+ }
2847
+ const Os = /* @__PURE__ */ l("ZodNever", (e, t) => {
2848
+ ao.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => ki(e, n, r);
2849
+ });
2850
+ function Zs(e) {
2851
+ return /* @__PURE__ */ ri(Os, e);
2852
+ }
2853
+ const Ts = /* @__PURE__ */ l("ZodArray", (e, t) => {
2854
+ co.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Zi(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ Se(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ Se(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ rn(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ on(n, r)), e.unwrap = () => e.element;
2855
+ });
2856
+ function Ps(e, t) {
2857
+ return /* @__PURE__ */ hi(Ts, e, t);
2858
+ }
2859
+ const js = /* @__PURE__ */ l("ZodObject", (e, t) => {
2860
+ lo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ti(e, n, r, o), y(e, "shape", () => t.shape), e.keyof = () => Ms(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: St() }), e.loose = () => e.clone({ ...e._zod.def, catchall: St() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Zs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Nn(e, n), e.safeExtend = (n) => In(e, n), e.merge = (n) => Cn(e, n), e.pick = (n) => Pn(e, n), e.omit = (n) => jn(e, n), e.partial = (...n) => Rn(dn, e, n[0]), e.required = (...n) => xn(pn, e, n[0]);
2861
+ });
2862
+ function Ns(e, t) {
2863
+ const n = {
2864
+ type: "object",
2865
+ shape: e ?? {},
2866
+ ...g(t)
2867
+ };
2868
+ return new js(n);
2869
+ }
2870
+ const Is = /* @__PURE__ */ l("ZodUnion", (e, t) => {
2871
+ fo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pi(e, n, r, o), e.options = t.options;
2872
+ });
2873
+ function Cs(e, t) {
2874
+ return new Is({
2875
+ type: "union",
2876
+ options: e,
2877
+ ...g(t)
2878
+ });
2879
+ }
2880
+ const Rs = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
2881
+ po.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => ji(e, n, r, o);
2882
+ });
2883
+ function xs(e, t) {
2884
+ return new Rs({
2885
+ type: "intersection",
2886
+ left: e,
2887
+ right: t
2888
+ });
2889
+ }
2890
+ const As = /* @__PURE__ */ l("ZodTuple", (e, t) => {
2891
+ mo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ni(e, n, r, o), e.rest = (n) => e.clone({
2892
+ ...e._zod.def,
2893
+ rest: n
2894
+ });
2895
+ });
2896
+ function Fs(e, t, n) {
2897
+ const r = t instanceof P, o = r ? n : t, i = r ? t : null;
2898
+ return new As({
2899
+ type: "tuple",
2900
+ items: e,
2901
+ rest: i,
2902
+ ...g(o)
2903
+ });
2904
+ }
2905
+ const Ue = /* @__PURE__ */ l("ZodEnum", (e, t) => {
2906
+ ho.init(e, t), j.init(e, t), e._zod.processJSONSchema = (r, o, i) => Si(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
2907
+ const n = new Set(Object.keys(t.entries));
2908
+ e.extract = (r, o) => {
2909
+ const i = {};
2910
+ for (const s of r)
2911
+ if (n.has(s))
2912
+ i[s] = t.entries[s];
2913
+ else
2914
+ throw new Error(`Key ${s} not found in enum`);
2915
+ return new Ue({
2916
+ ...t,
2917
+ checks: [],
2918
+ ...g(o),
2919
+ entries: i
2920
+ });
2921
+ }, e.exclude = (r, o) => {
2922
+ const i = { ...t.entries };
2923
+ for (const s of r)
2924
+ if (n.has(s))
2925
+ delete i[s];
2926
+ else
2927
+ throw new Error(`Key ${s} not found in enum`);
2928
+ return new Ue({
2929
+ ...t,
2930
+ checks: [],
2931
+ ...g(o),
2932
+ entries: i
2933
+ });
2934
+ };
2935
+ });
2936
+ function Ms(e, t) {
2937
+ const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2938
+ return new Ue({
2939
+ type: "enum",
2940
+ entries: n,
2941
+ ...g(t)
2942
+ });
2943
+ }
2944
+ const Ds = /* @__PURE__ */ l("ZodTransform", (e, t) => {
2945
+ go.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Oi(e, n), e._zod.parse = (n, r) => {
2946
+ if (r.direction === "backward")
2947
+ throw new Ft(e.constructor.name);
2948
+ n.addIssue = (i) => {
2949
+ if (typeof i == "string")
2950
+ n.issues.push(ge(i, n.value, t));
2951
+ else {
2952
+ const s = i;
2953
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(ge(s));
2954
+ }
2955
+ };
2956
+ const o = t.transform(n.value, n);
2957
+ return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
2958
+ };
2959
+ });
2960
+ function Ls(e) {
2961
+ return new Ds({
2962
+ type: "transform",
2963
+ transform: e
2964
+ });
2965
+ }
2966
+ const dn = /* @__PURE__ */ l("ZodOptional", (e, t) => {
2967
+ nn.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => un(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2968
+ });
2969
+ function $t(e) {
2970
+ return new dn({
2971
+ type: "optional",
2972
+ innerType: e
2973
+ });
2974
+ }
2975
+ const Us = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
2976
+ _o.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => un(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2977
+ });
2978
+ function Js(e) {
2979
+ return new Us({
2980
+ type: "optional",
2981
+ innerType: e
2982
+ });
2983
+ }
2984
+ const Vs = /* @__PURE__ */ l("ZodNullable", (e, t) => {
2985
+ vo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ii(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2986
+ });
2987
+ function Ot(e) {
2988
+ return new Vs({
2989
+ type: "nullable",
2990
+ innerType: e
2991
+ });
2992
+ }
2993
+ const Ws = /* @__PURE__ */ l("ZodDefault", (e, t) => {
2994
+ yo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ri(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2995
+ });
2996
+ function Ys(e, t) {
2997
+ return new Ws({
2998
+ type: "default",
2999
+ innerType: e,
3000
+ get defaultValue() {
3001
+ return typeof t == "function" ? t() : Ut(t);
3002
+ }
3003
+ });
3004
+ }
3005
+ const Bs = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
3006
+ bo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => xi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3007
+ });
3008
+ function Gs(e, t) {
3009
+ return new Bs({
3010
+ type: "prefault",
3011
+ innerType: e,
3012
+ get defaultValue() {
3013
+ return typeof t == "function" ? t() : Ut(t);
3014
+ }
3015
+ });
3016
+ }
3017
+ const pn = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
3018
+ wo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ci(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3019
+ });
3020
+ function qs(e, t) {
3021
+ return new pn({
3022
+ type: "nonoptional",
3023
+ innerType: e,
3024
+ ...g(t)
3025
+ });
3026
+ }
3027
+ const Hs = /* @__PURE__ */ l("ZodCatch", (e, t) => {
3028
+ zo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ai(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3029
+ });
3030
+ function Ks(e, t) {
3031
+ return new Hs({
3032
+ type: "catch",
3033
+ innerType: e,
3034
+ catchValue: typeof t == "function" ? t : () => t
3035
+ });
3036
+ }
3037
+ const Xs = /* @__PURE__ */ l("ZodPipe", (e, t) => {
3038
+ ko.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fi(e, n, r, o), e.in = t.in, e.out = t.out;
3039
+ });
3040
+ function Zt(e, t) {
3041
+ return new Xs({
3042
+ type: "pipe",
3043
+ in: e,
3044
+ out: t
3045
+ // ...util.normalizeParams(params),
3046
+ });
3047
+ }
3048
+ const Qs = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
3049
+ Eo.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => Mi(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3050
+ });
3051
+ function ea(e) {
3052
+ return new Qs({
3053
+ type: "readonly",
3054
+ innerType: e
3055
+ });
3056
+ }
3057
+ const ta = /* @__PURE__ */ l("ZodCustom", (e, t) => {
3058
+ So.init(e, t), j.init(e, t), e._zod.processJSONSchema = (n, r, o) => $i(e, n);
3059
+ });
3060
+ function na(e, t = {}) {
3061
+ return /* @__PURE__ */ gi(ta, e, t);
3062
+ }
3063
+ function ra(e) {
3064
+ return /* @__PURE__ */ _i(e);
3065
+ }
3066
+ const oa = X.createContext(null);
3067
+ function ia(e, t) {
3068
+ const n = Array.isArray(e) ? e[0] : e ? e.x : 0, r = Array.isArray(e) ? e[1] : e ? e.y : 0, o = Array.isArray(t) ? t[0] : t ? t.x : 0, i = Array.isArray(t) ? t[1] : t ? t.y : 0;
3069
+ return n === o && r === i;
3070
+ }
3071
+ function W(e, t) {
3072
+ if (e === t)
3073
+ return !0;
3074
+ if (!e || !t)
3075
+ return !1;
3076
+ if (Array.isArray(e)) {
3077
+ if (!Array.isArray(t) || e.length !== t.length)
3078
+ return !1;
3079
+ for (let n = 0; n < e.length; n++)
3080
+ if (!W(e[n], t[n]))
3081
+ return !1;
3082
+ return !0;
3083
+ } else if (Array.isArray(t))
3084
+ return !1;
3085
+ if (typeof e == "object" && typeof t == "object") {
3086
+ const n = Object.keys(e), r = Object.keys(t);
3087
+ if (n.length !== r.length)
3088
+ return !1;
3089
+ for (const o of n)
3090
+ if (!t.hasOwnProperty(o) || !W(e[o], t[o]))
3091
+ return !1;
3092
+ return !0;
3093
+ }
3094
+ return !1;
3095
+ }
3096
+ function Tt(e) {
3097
+ return {
3098
+ longitude: e.center.lng,
3099
+ latitude: e.center.lat,
3100
+ zoom: e.zoom,
3101
+ pitch: e.pitch,
3102
+ bearing: e.bearing,
3103
+ padding: e.padding
3104
+ };
3105
+ }
3106
+ function Pt(e, t) {
3107
+ const n = t.viewState || t, r = {};
3108
+ if ("longitude" in n && "latitude" in n && (n.longitude !== e.center.lng || n.latitude !== e.center.lat)) {
3109
+ const o = e.center.constructor;
3110
+ r.center = new o(n.longitude, n.latitude);
3111
+ }
3112
+ return "zoom" in n && n.zoom !== e.zoom && (r.zoom = n.zoom), "bearing" in n && n.bearing !== e.bearing && (r.bearing = n.bearing), "pitch" in n && n.pitch !== e.pitch && (r.pitch = n.pitch), n.padding && e.padding && !W(n.padding, e.padding) && (r.padding = n.padding), r;
3113
+ }
3114
+ const sa = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
3115
+ function jt(e) {
3116
+ if (!e)
3117
+ return null;
3118
+ if (typeof e == "string" || ("toJS" in e && (e = e.toJS()), !e.layers))
3119
+ return e;
3120
+ const t = {};
3121
+ for (const r of e.layers)
3122
+ t[r.id] = r;
3123
+ const n = e.layers.map((r) => {
3124
+ let o = null;
3125
+ "interactive" in r && (o = Object.assign({}, r), delete o.interactive);
3126
+ const i = t[r.ref];
3127
+ if (i) {
3128
+ o = o || Object.assign({}, r), delete o.ref;
3129
+ for (const s of sa)
3130
+ s in i && (o[s] = i[s]);
3131
+ }
3132
+ return o || r;
3133
+ });
3134
+ return { ...e, layers: n };
3135
+ }
3136
+ const Nt = { version: 8, sources: {}, layers: [] }, It = {
3137
+ mousedown: "onMouseDown",
3138
+ mouseup: "onMouseUp",
3139
+ mouseover: "onMouseOver",
3140
+ mousemove: "onMouseMove",
3141
+ click: "onClick",
3142
+ dblclick: "onDblClick",
3143
+ mouseenter: "onMouseEnter",
3144
+ mouseleave: "onMouseLeave",
3145
+ mouseout: "onMouseOut",
3146
+ contextmenu: "onContextMenu",
3147
+ touchstart: "onTouchStart",
3148
+ touchend: "onTouchEnd",
3149
+ touchmove: "onTouchMove",
3150
+ touchcancel: "onTouchCancel"
3151
+ }, Ct = {
3152
+ movestart: "onMoveStart",
3153
+ move: "onMove",
3154
+ moveend: "onMoveEnd",
3155
+ dragstart: "onDragStart",
3156
+ drag: "onDrag",
3157
+ dragend: "onDragEnd",
3158
+ zoomstart: "onZoomStart",
3159
+ zoom: "onZoom",
3160
+ zoomend: "onZoomEnd",
3161
+ rotatestart: "onRotateStart",
3162
+ rotate: "onRotate",
3163
+ rotateend: "onRotateEnd",
3164
+ pitchstart: "onPitchStart",
3165
+ pitch: "onPitch",
3166
+ pitchend: "onPitchEnd"
3167
+ }, Rt = {
3168
+ wheel: "onWheel",
3169
+ boxzoomstart: "onBoxZoomStart",
3170
+ boxzoomend: "onBoxZoomEnd",
3171
+ boxzoomcancel: "onBoxZoomCancel",
3172
+ resize: "onResize",
3173
+ load: "onLoad",
3174
+ render: "onRender",
3175
+ idle: "onIdle",
3176
+ remove: "onRemove",
3177
+ data: "onData",
3178
+ styledata: "onStyleData",
3179
+ sourcedata: "onSourceData",
3180
+ error: "onError"
3181
+ }, aa = [
3182
+ "minZoom",
3183
+ "maxZoom",
3184
+ "minPitch",
3185
+ "maxPitch",
3186
+ "maxBounds",
3187
+ "projection",
3188
+ "renderWorldCopies"
3189
+ ], ca = [
3190
+ "scrollZoom",
3191
+ "boxZoom",
3192
+ "dragRotate",
3193
+ "dragPan",
3194
+ "keyboard",
3195
+ "doubleClickZoom",
3196
+ "touchZoomRotate",
3197
+ "touchPitch"
3198
+ ];
3199
+ class ce {
3200
+ constructor(t, n, r) {
3201
+ this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (o) => {
3202
+ const i = this.props[Rt[o.type]];
3203
+ i ? i(o) : o.type === "error" && console.error(o.error);
3204
+ }, this._onCameraEvent = (o) => {
3205
+ if (this._internalUpdate)
3206
+ return;
3207
+ o.viewState = this._propsedCameraUpdate || Tt(this._map.transform);
3208
+ const i = this.props[Ct[o.type]];
3209
+ i && i(o);
3210
+ }, this._onCameraUpdate = (o) => this._internalUpdate ? o : (this._propsedCameraUpdate = Tt(o), Pt(o, this.props)), this._onPointerEvent = (o) => {
3211
+ (o.type === "mousemove" || o.type === "mouseout") && this._updateHover(o);
3212
+ const i = this.props[It[o.type]];
3213
+ i && (this.props.interactiveLayerIds && o.type !== "mouseover" && o.type !== "mouseout" && (o.features = this._hoveredFeatures || this._queryRenderedFeatures(o.point)), i(o), delete o.features);
3214
+ }, this._MapClass = t, this.props = n, this._initialize(r);
3215
+ }
3216
+ get map() {
3217
+ return this._map;
3218
+ }
3219
+ setProps(t) {
3220
+ const n = this.props;
3221
+ this.props = t;
3222
+ const r = this._updateSettings(t, n), o = this._updateSize(t), i = this._updateViewState(t);
3223
+ this._updateStyle(t, n), this._updateStyleComponents(t), this._updateHandlers(t, n), (r || o || i && !this._map.isMoving()) && this.redraw();
3224
+ }
3225
+ static reuse(t, n) {
3226
+ const r = ce.savedMaps.pop();
3227
+ if (!r)
3228
+ return null;
3229
+ const o = r.map, i = o.getContainer();
3230
+ for (n.className = i.className; i.childNodes.length > 0; )
3231
+ n.appendChild(i.childNodes[0]);
3232
+ o._container = n;
3233
+ const s = o._resizeObserver;
3234
+ s && (s.disconnect(), s.observe(n)), r.setProps({ ...t, styleDiffing: !1 }), o.resize();
3235
+ const { initialViewState: a } = t;
3236
+ return a && (a.bounds ? o.fitBounds(a.bounds, { ...a.fitBoundsOptions, duration: 0 }) : r._updateViewState(a)), o.isStyleLoaded() ? o.fire("load") : o.once("style.load", () => o.fire("load")), o._update(), r;
3237
+ }
3238
+ /* eslint-disable complexity,max-statements */
3239
+ _initialize(t) {
3240
+ const { props: n } = this, { mapStyle: r = Nt } = n, o = {
3241
+ ...n,
3242
+ ...n.initialViewState,
3243
+ container: t,
3244
+ style: jt(r)
3245
+ }, i = o.initialViewState || o.viewState || o;
3246
+ if (Object.assign(o, {
3247
+ center: [i.longitude || 0, i.latitude || 0],
3248
+ zoom: i.zoom || 0,
3249
+ pitch: i.pitch || 0,
3250
+ bearing: i.bearing || 0
3251
+ }), n.gl) {
3252
+ const a = HTMLCanvasElement.prototype.getContext;
3253
+ HTMLCanvasElement.prototype.getContext = () => (HTMLCanvasElement.prototype.getContext = a, n.gl);
3254
+ }
3255
+ const s = new this._MapClass(o);
3256
+ i.padding && s.setPadding(i.padding), n.cursor && (s.getCanvas().style.cursor = n.cursor), s.transformCameraUpdate = this._onCameraUpdate, s.on("style.load", () => {
3257
+ this._styleComponents = {
3258
+ light: s.getLight(),
3259
+ sky: s.getSky(),
3260
+ // @ts-ignore getProjection() does not exist in v4
3261
+ projection: s.getProjection?.(),
3262
+ terrain: s.getTerrain()
3263
+ }, this._updateStyleComponents(this.props);
3264
+ }), s.on("sourcedata", () => {
3265
+ this._updateStyleComponents(this.props);
3266
+ });
3267
+ for (const a in It)
3268
+ s.on(a, this._onPointerEvent);
3269
+ for (const a in Ct)
3270
+ s.on(a, this._onCameraEvent);
3271
+ for (const a in Rt)
3272
+ s.on(a, this._onEvent);
3273
+ this._map = s;
3274
+ }
3275
+ /* eslint-enable complexity,max-statements */
3276
+ recycle() {
3277
+ this.map.getContainer().querySelector("[mapboxgl-children]")?.remove(), ce.savedMaps.push(this);
3278
+ }
3279
+ destroy() {
3280
+ this._map.remove();
3281
+ }
3282
+ // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next
3283
+ // render cycle, which is managed by Mapbox's animation loop.
3284
+ // This removes the synchronization issue caused by requestAnimationFrame.
3285
+ redraw() {
3286
+ const t = this._map;
3287
+ t.style && (t._frame && (t._frame.cancel(), t._frame = null), t._render());
3288
+ }
3289
+ /* Trigger map resize if size is controlled
3290
+ @param {object} nextProps
3291
+ @returns {bool} true if size has changed
3292
+ */
3293
+ _updateSize(t) {
3294
+ const { viewState: n } = t;
3295
+ if (n) {
3296
+ const r = this._map;
3297
+ if (n.width !== r.transform.width || n.height !== r.transform.height)
3298
+ return r.resize(), !0;
3299
+ }
3300
+ return !1;
3301
+ }
3302
+ // Adapted from map.jumpTo
3303
+ /* Update camera to match props
3304
+ @param {object} nextProps
3305
+ @param {bool} triggerEvents - should fire camera events
3306
+ @returns {bool} true if anything is changed
3307
+ */
3308
+ _updateViewState(t) {
3309
+ const n = this._map, r = n.transform;
3310
+ if (!n.isMoving()) {
3311
+ const i = Pt(r, t);
3312
+ if (Object.keys(i).length > 0)
3313
+ return this._internalUpdate = !0, n.jumpTo(i), this._internalUpdate = !1, !0;
3314
+ }
3315
+ return !1;
3316
+ }
3317
+ /* Update camera constraints and projection settings to match props
3318
+ @param {object} nextProps
3319
+ @param {object} currProps
3320
+ @returns {bool} true if anything is changed
3321
+ */
3322
+ _updateSettings(t, n) {
3323
+ const r = this._map;
3324
+ let o = !1;
3325
+ for (const i of aa)
3326
+ i in t && !W(t[i], n[i]) && (o = !0, r[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(r, t[i]));
3327
+ return o;
3328
+ }
3329
+ /* Update map style to match props */
3330
+ _updateStyle(t, n) {
3331
+ if (t.cursor !== n.cursor && (this._map.getCanvas().style.cursor = t.cursor || ""), t.mapStyle !== n.mapStyle) {
3332
+ const { mapStyle: r = Nt, styleDiffing: o = !0 } = t, i = {
3333
+ diff: o
3334
+ };
3335
+ "localIdeographFontFamily" in t && (i.localIdeographFontFamily = t.localIdeographFontFamily), this._map.setStyle(jt(r), i);
3336
+ }
3337
+ }
3338
+ /* Update fog, light, projection and terrain to match props
3339
+ * These props are special because
3340
+ * 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met
3341
+ * 2. They can be overwritten by mapStyle
3342
+ */
3343
+ _updateStyleComponents({ light: t, projection: n, sky: r, terrain: o }) {
3344
+ const i = this._map, s = this._styleComponents;
3345
+ i.style._loaded && (t && !W(t, s.light) && (s.light = t, i.setLight(t)), n && !W(n, s.projection) && n !== s.projection?.type && (s.projection = typeof n == "string" ? { type: n } : n, i.setProjection?.(s.projection)), r && !W(r, s.sky) && (s.sky = r, i.setSky(r)), o !== void 0 && !W(o, s.terrain) && (!o || i.getSource(o.source)) && (s.terrain = o, i.setTerrain(o)));
3346
+ }
3347
+ /* Update interaction handlers to match props */
3348
+ _updateHandlers(t, n) {
3349
+ const r = this._map;
3350
+ for (const o of ca) {
3351
+ const i = t[o] ?? !0, s = n[o] ?? !0;
3352
+ W(i, s) || (i ? r[o].enable(i) : r[o].disable());
3353
+ }
3354
+ }
3355
+ _queryRenderedFeatures(t) {
3356
+ const n = this._map, { interactiveLayerIds: r = [] } = this.props;
3357
+ try {
3358
+ return n.queryRenderedFeatures(t, {
3359
+ layers: r.filter(n.getLayer.bind(n))
3360
+ });
3361
+ } catch {
3362
+ return [];
3363
+ }
3364
+ }
3365
+ _updateHover(t) {
3366
+ const { props: n } = this;
3367
+ if (n.interactiveLayerIds && (n.onMouseMove || n.onMouseEnter || n.onMouseLeave)) {
3368
+ const o = t.type, i = this._hoveredFeatures?.length > 0, s = this._queryRenderedFeatures(t.point), a = s.length > 0;
3369
+ !a && i && (t.type = "mouseleave", this._onPointerEvent(t)), this._hoveredFeatures = s, a && !i && (t.type = "mouseenter", this._onPointerEvent(t)), t.type = o;
3370
+ } else
3371
+ this._hoveredFeatures = null;
3372
+ }
3373
+ }
3374
+ ce.savedMaps = [];
3375
+ const ua = [
3376
+ "setMaxBounds",
3377
+ "setMinZoom",
3378
+ "setMaxZoom",
3379
+ "setMinPitch",
3380
+ "setMaxPitch",
3381
+ "setRenderWorldCopies",
3382
+ "setProjection",
3383
+ "setStyle",
3384
+ "addSource",
3385
+ "removeSource",
3386
+ "addLayer",
3387
+ "removeLayer",
3388
+ "setLayerZoomRange",
3389
+ "setFilter",
3390
+ "setPaintProperty",
3391
+ "setLayoutProperty",
3392
+ "setLight",
3393
+ "setTerrain",
3394
+ "setFog",
3395
+ "remove"
3396
+ ];
3397
+ function la(e) {
3398
+ if (!e)
3399
+ return null;
3400
+ const t = e.map, n = {
3401
+ getMap: () => t
3402
+ };
3403
+ for (const r of fa(t))
3404
+ !(r in n) && !ua.includes(r) && (n[r] = t[r].bind(t));
3405
+ return n;
3406
+ }
3407
+ function fa(e) {
3408
+ const t = /* @__PURE__ */ new Set();
3409
+ let n = e;
3410
+ for (; n; ) {
3411
+ for (const r of Object.getOwnPropertyNames(n))
3412
+ r[0] !== "_" && typeof e[r] == "function" && r !== "fire" && r !== "setEventedParent" && t.add(r);
3413
+ n = Object.getPrototypeOf(n);
3414
+ }
3415
+ return Array.from(t);
3416
+ }
3417
+ const da = typeof document < "u" ? vn : F;
3418
+ function pa(e, t) {
3419
+ const { RTLTextPlugin: n, maxParallelImageRequests: r, workerCount: o, workerUrl: i } = t;
3420
+ if (n && e.getRTLTextPluginStatus && e.getRTLTextPluginStatus() === "unavailable") {
3421
+ const { pluginUrl: s, lazy: a = !0 } = typeof n == "string" ? { pluginUrl: n } : n;
3422
+ e.setRTLTextPlugin(s, (c) => {
3423
+ c && console.error(c);
3424
+ }, a);
3425
+ }
3426
+ r !== void 0 && e.setMaxParallelImageRequests(r), o !== void 0 && e.setWorkerCount(o), i !== void 0 && e.setWorkerUrl(i);
3427
+ }
3428
+ const Ie = X.createContext(null);
3429
+ function ma(e, t) {
3430
+ const n = Oe(oa), [r, o] = oe(null), i = ae(), { current: s } = ae({ mapLib: null, map: null });
3431
+ F(() => {
3432
+ const u = e.mapLib;
3433
+ let d = !0, m;
3434
+ return Promise.resolve(u || import("./maplibre-gl-CNsW26De.js").then((p) => p.m)).then((p) => {
3435
+ if (!d)
3436
+ return;
3437
+ if (!p)
3438
+ throw new Error("Invalid mapLib");
3439
+ const h = "Map" in p ? p : p.default;
3440
+ if (!h.Map)
3441
+ throw new Error("Invalid mapLib");
3442
+ pa(h, e), e.reuseMaps && (m = ce.reuse(e, i.current)), m || (m = new ce(h.Map, e, i.current)), s.map = la(m), s.mapLib = h, o(m), n?.onMapMount(s.map, e.id);
3443
+ }).catch((p) => {
3444
+ const { onError: h } = e;
3445
+ h ? h({
3446
+ type: "error",
3447
+ target: null,
3448
+ originalEvent: null,
3449
+ error: p
3450
+ }) : console.error(p);
3451
+ }), () => {
3452
+ d = !1, m && (n?.onMapUnmount(e.id), e.reuseMaps ? m.recycle() : m.destroy());
3453
+ };
3454
+ }, []), da(() => {
3455
+ r && r.setProps(e);
3456
+ }), Ze(t, () => s.map, [r]);
3457
+ const a = Y(() => ({
3458
+ position: "relative",
3459
+ width: "100%",
3460
+ height: "100%",
3461
+ ...e.style
3462
+ }), [e.style]), c = {
3463
+ height: "100%"
3464
+ };
3465
+ return X.createElement("div", { id: e.id, ref: i, style: a }, r && X.createElement(
3466
+ Ie.Provider,
3467
+ { value: s },
3468
+ X.createElement("div", { "mapboxgl-children": "", style: c }, e.children)
3469
+ ));
3470
+ }
3471
+ const ha = X.forwardRef(ma), ga = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
3472
+ function G(e, t) {
3473
+ if (!e || !t)
3474
+ return;
3475
+ const n = e.style;
3476
+ for (const r in t) {
3477
+ const o = t[r];
3478
+ Number.isFinite(o) && !ga.test(r) ? n[r] = `${o}px` : n[r] = o;
3479
+ }
3480
+ }
3481
+ function mn(e, t) {
3482
+ if (e === t)
3483
+ return null;
3484
+ const n = xt(e), r = xt(t), o = [];
3485
+ for (const i of r)
3486
+ n.has(i) || o.push(i);
3487
+ for (const i of n)
3488
+ r.has(i) || o.push(i);
3489
+ return o.length === 0 ? null : o;
3490
+ }
3491
+ function xt(e) {
3492
+ return new Set(e ? e.trim().split(/\s+/) : []);
3493
+ }
3494
+ const _a = B(Je((e, t) => {
3495
+ const { map: n, mapLib: r } = Oe(Ie), o = ae({ props: e }), i = Y(() => {
3496
+ let N = !1;
3497
+ X.Children.forEach(e.children, (v) => {
3498
+ v && (N = !0);
3499
+ });
3500
+ const V = {
3501
+ ...e,
3502
+ element: N ? document.createElement("div") : void 0
3503
+ }, b = new r.Marker(V);
3504
+ return b.setLngLat([e.longitude, e.latitude]), b.getElement().addEventListener("click", (v) => {
3505
+ o.current.props.onClick?.({
3506
+ type: "click",
3507
+ target: b,
3508
+ originalEvent: v
3509
+ });
3510
+ }), b.on("dragstart", (v) => {
3511
+ const E = v;
3512
+ E.lngLat = i.getLngLat(), o.current.props.onDragStart?.(E);
3513
+ }), b.on("drag", (v) => {
3514
+ const E = v;
3515
+ E.lngLat = i.getLngLat(), o.current.props.onDrag?.(E);
3516
+ }), b.on("dragend", (v) => {
3517
+ const E = v;
3518
+ E.lngLat = i.getLngLat(), o.current.props.onDragEnd?.(E);
3519
+ }), b;
3520
+ }, []);
3521
+ F(() => (i.addTo(n.getMap()), () => {
3522
+ i.remove();
3523
+ }), []);
3524
+ const { longitude: s, latitude: a, offset: c, style: u, draggable: d = !1, popup: m = null, rotation: p = 0, rotationAlignment: h = "auto", pitchAlignment: z = "auto" } = e;
3525
+ F(() => {
3526
+ G(i.getElement(), u);
3527
+ }, [u]), Ze(t, () => i, []);
3528
+ const k = o.current.props;
3529
+ (i.getLngLat().lng !== s || i.getLngLat().lat !== a) && i.setLngLat([s, a]), c && !ia(i.getOffset(), c) && i.setOffset(c), i.isDraggable() !== d && i.setDraggable(d), i.getRotation() !== p && i.setRotation(p), i.getRotationAlignment() !== h && i.setRotationAlignment(h), i.getPitchAlignment() !== z && i.setPitchAlignment(z), i.getPopup() !== m && i.setPopup(m);
3530
+ const Z = mn(k.className, e.className);
3531
+ if (Z)
3532
+ for (const N of Z)
3533
+ i.toggleClassName(N);
3534
+ return o.current.props = e, At(e.children, i.getElement());
3535
+ })), va = B(Je((e, t) => {
3536
+ const { map: n, mapLib: r } = Oe(Ie), o = Y(() => document.createElement("div"), []), i = ae({ props: e }), s = Y(() => {
3537
+ const a = { ...e }, c = new r.Popup(a);
3538
+ return c.setLngLat([e.longitude, e.latitude]), c.once("open", (u) => {
3539
+ i.current.props.onOpen?.(u);
3540
+ }), c;
3541
+ }, []);
3542
+ if (F(() => {
3543
+ const a = (c) => {
3544
+ i.current.props.onClose?.(c);
3545
+ };
3546
+ return s.on("close", a), s.setDOMContent(o).addTo(n.getMap()), () => {
3547
+ s.off("close", a), s.isOpen() && s.remove();
3548
+ };
3549
+ }, []), F(() => {
3550
+ G(s.getElement(), e.style);
3551
+ }, [e.style]), Ze(t, () => s, []), s.isOpen()) {
3552
+ const a = i.current.props;
3553
+ (s.getLngLat().lng !== e.longitude || s.getLngLat().lat !== e.latitude) && s.setLngLat([e.longitude, e.latitude]), e.offset && !W(a.offset, e.offset) && s.setOffset(e.offset), (a.anchor !== e.anchor || a.maxWidth !== e.maxWidth) && (s.options.anchor = e.anchor, s.setMaxWidth(e.maxWidth));
3554
+ const c = mn(a.className, e.className);
3555
+ if (c)
3556
+ for (const u of c)
3557
+ s.toggleClassName(u);
3558
+ i.current.props = e;
3559
+ }
3560
+ return At(e.children, o);
3561
+ }));
3562
+ function ne(e, t, n, r) {
3563
+ const o = Oe(Ie), i = Y(() => e(o), []);
3564
+ return F(() => {
3565
+ const s = t, a = null, c = typeof t == "function" ? t : null, { map: u } = o;
3566
+ return u.hasControl(i) || (u.addControl(i, s?.position), a && a(o)), () => {
3567
+ c && c(o), u.hasControl(i) && u.removeControl(i);
3568
+ };
3569
+ }, []), i;
3570
+ }
3571
+ function ya(e) {
3572
+ const t = ne(({ mapLib: n }) => new n.AttributionControl(e), {
3573
+ position: e.position
3574
+ });
3575
+ return F(() => {
3576
+ G(t._container, e.style);
3577
+ }, [e.style]), null;
3578
+ }
3579
+ B(ya);
3580
+ function ba(e) {
3581
+ const t = ne(({ mapLib: n }) => new n.FullscreenControl({
3582
+ container: e.containerId && document.getElementById(e.containerId)
3583
+ }), { position: e.position });
3584
+ return F(() => {
3585
+ G(t._controlContainer, e.style);
3586
+ }, [e.style]), null;
3587
+ }
3588
+ B(ba);
3589
+ function wa(e, t) {
3590
+ const n = ae({ props: e }), r = ne(({ mapLib: o }) => {
3591
+ const i = new o.GeolocateControl(e), s = i._setupUI;
3592
+ return i._setupUI = () => {
3593
+ i._container.hasChildNodes() || s();
3594
+ }, i.on("geolocate", (a) => {
3595
+ n.current.props.onGeolocate?.(a);
3596
+ }), i.on("error", (a) => {
3597
+ n.current.props.onError?.(a);
3598
+ }), i.on("outofmaxbounds", (a) => {
3599
+ n.current.props.onOutOfMaxBounds?.(a);
3600
+ }), i.on("trackuserlocationstart", (a) => {
3601
+ n.current.props.onTrackUserLocationStart?.(a);
3602
+ }), i.on("trackuserlocationend", (a) => {
3603
+ n.current.props.onTrackUserLocationEnd?.(a);
3604
+ }), i;
3605
+ }, { position: e.position });
3606
+ return n.current.props = e, Ze(t, () => r, []), F(() => {
3607
+ G(r._container, e.style);
3608
+ }, [e.style]), null;
3609
+ }
3610
+ B(Je(wa));
3611
+ function za(e) {
3612
+ const t = ne(({ mapLib: n }) => new n.NavigationControl(e), {
3613
+ position: e.position
3614
+ });
3615
+ return F(() => {
3616
+ G(t._container, e.style);
3617
+ }, [e.style]), null;
3618
+ }
3619
+ const ka = B(za);
3620
+ function Ea(e) {
3621
+ const t = ne(({ mapLib: i }) => new i.ScaleControl(e), {
3622
+ position: e.position
3623
+ }), n = ae(e), r = n.current;
3624
+ n.current = e;
3625
+ const { style: o } = e;
3626
+ return e.maxWidth !== void 0 && e.maxWidth !== r.maxWidth && (t.options.maxWidth = e.maxWidth), e.unit !== void 0 && e.unit !== r.unit && t.setUnit(e.unit), F(() => {
3627
+ G(t._container, o);
3628
+ }, [o]), null;
3629
+ }
3630
+ B(Ea);
3631
+ function Sa(e) {
3632
+ const t = ne(({ mapLib: n }) => new n.TerrainControl(e), {
3633
+ position: e.position
3634
+ });
3635
+ return F(() => {
3636
+ G(t._container, e.style);
3637
+ }, [e.style]), null;
3638
+ }
3639
+ B(Sa);
3640
+ function $a(e) {
3641
+ const t = ne(({ mapLib: n }) => new n.LogoControl(e), { position: e.position });
3642
+ return F(() => {
3643
+ G(t._container, e.style);
3644
+ }, [e.style]), null;
3645
+ }
3646
+ B($a);
3647
+ const Oa = Ns({
3648
+ latitudeField: pe().optional(),
3649
+ longitudeField: pe().optional(),
3650
+ locationField: pe().optional(),
3651
+ titleField: pe().optional(),
3652
+ descriptionField: pe().optional(),
3653
+ zoom: Me().optional(),
3654
+ center: Fs([Me(), Me()]).optional()
3655
+ });
3656
+ function Za(e) {
3657
+ return e.data ? e.data : e.staticData ? {
265
3658
  provider: "value",
266
- items: t.staticData
267
- } : t.objectName ? {
3659
+ items: e.staticData
3660
+ } : e.objectName ? {
268
3661
  provider: "object",
269
- object: t.objectName
3662
+ object: e.objectName
270
3663
  } : null;
271
3664
  }
272
- function ce(t) {
273
- if (t) {
274
- if (typeof t == "string") {
275
- const i = t.split(" "), n = i[0], s = i[1]?.toLowerCase() === "desc" ? "desc" : "asc";
276
- return { [n]: s };
3665
+ function Ta(e) {
3666
+ if (e) {
3667
+ if (typeof e == "string") {
3668
+ const t = e.split(" "), n = t[0], r = t[1]?.toLowerCase() === "desc" ? "desc" : "asc";
3669
+ return { [n]: r };
277
3670
  }
278
- if (Array.isArray(t))
279
- return t.reduce((i, n) => (n.field && n.order && (i[n.field] = n.order), i), {});
3671
+ if (Array.isArray(e))
3672
+ return e.reduce((t, n) => (n.field && n.order && (t[n.field] = n.order), t), {});
280
3673
  }
281
3674
  }
282
- function ue(t) {
283
- return t.filter && typeof t.filter == "object" && "map" in t.filter ? t.filter.map : t.map ? t.map : {
3675
+ function Pa(e) {
3676
+ if (e.locationField || e.latitudeField)
3677
+ return {
3678
+ locationField: e.locationField,
3679
+ latitudeField: e.latitudeField,
3680
+ longitudeField: e.longitudeField,
3681
+ titleField: e.titleField || "name",
3682
+ descriptionField: e.descriptionField,
3683
+ zoom: e.zoom,
3684
+ center: e.center
3685
+ };
3686
+ let t = null;
3687
+ if (e.filter && typeof e.filter == "object" && "map" in e.filter ? t = e.filter.map : e.map && (t = e.map), t) {
3688
+ const n = Oa.safeParse(t);
3689
+ return n.success || console.warn("[ObjectMap] Invalid map configuration:", n.error.format()), t;
3690
+ }
3691
+ return {
284
3692
  latitudeField: "latitude",
285
3693
  longitudeField: "longitude",
286
3694
  locationField: "location",
@@ -290,165 +3698,171 @@ function ue(t) {
290
3698
  center: [0, 0]
291
3699
  };
292
3700
  }
293
- function de(t, i) {
294
- if (i.latitudeField && i.longitudeField) {
295
- const n = t[i.latitudeField], s = t[i.longitudeField];
296
- if (typeof n == "number" && typeof s == "number")
297
- return [n, s];
3701
+ function ja(e, t) {
3702
+ if (t.latitudeField && t.longitudeField) {
3703
+ const n = e[t.latitudeField], r = e[t.longitudeField];
3704
+ if (typeof n == "number" && typeof r == "number")
3705
+ return [n, r];
298
3706
  }
299
- if (i.locationField) {
300
- const n = t[i.locationField];
3707
+ if (t.locationField) {
3708
+ const n = e[t.locationField];
301
3709
  if (typeof n == "object" && n !== null) {
302
- const s = n.lat || n.latitude, l = n.lng || n.lon || n.longitude;
303
- if (typeof s == "number" && typeof l == "number")
304
- return [s, l];
3710
+ const r = n.lat || n.latitude, o = n.lng || n.lon || n.longitude;
3711
+ if (typeof r == "number" && typeof o == "number")
3712
+ return [r, o];
305
3713
  }
306
3714
  if (typeof n == "string") {
307
- const s = n.split(",").map((l) => parseFloat(l.trim()));
308
- if (s.length === 2 && !isNaN(s[0]) && !isNaN(s[1]))
309
- return [s[0], s[1]];
3715
+ const r = n.split(",").map((o) => parseFloat(o.trim()));
3716
+ if (r.length === 2 && !isNaN(r[0]) && !isNaN(r[1]))
3717
+ return [r[0], r[1]];
310
3718
  }
311
3719
  if (Array.isArray(n) && n.length === 2) {
312
- const s = parseFloat(n[0]), l = parseFloat(n[1]);
313
- if (!isNaN(s) && !isNaN(l))
314
- return [s, l];
3720
+ const r = parseFloat(n[0]), o = parseFloat(n[1]);
3721
+ if (!isNaN(r) && !isNaN(o))
3722
+ return [r, o];
315
3723
  }
316
3724
  }
317
3725
  return null;
318
3726
  }
319
- const fe = ({
320
- schema: t,
321
- dataSource: i,
3727
+ const Na = ({
3728
+ schema: e,
3729
+ dataSource: t,
322
3730
  className: n,
323
- onMarkerClick: s
3731
+ onMarkerClick: r,
3732
+ ...o
324
3733
  }) => {
325
- const [l, m] = R([]), [h, v] = R(!0), [T, F] = R(null), [P, w] = R(null), [O, E] = R(null), p = le(t), b = ue(t), j = p?.provider === "value";
326
- G(() => {
3734
+ const [i, s] = oe([]), [a, c] = oe(!0), [u, d] = oe(null), [m, p] = oe(null), [h, z] = oe(null), k = Za(e), Z = Y(() => k, [JSON.stringify(k)]), N = Pa(e), V = Z?.provider === "value";
3735
+ F(() => {
327
3736
  (async () => {
328
3737
  try {
329
- if (v(!0), j && p?.provider === "value") {
330
- m(p.items), v(!1);
3738
+ if (c(!0), o.data) {
3739
+ const w = o.data;
3740
+ if (Array.isArray(w)) {
3741
+ s(w), c(!1);
3742
+ return;
3743
+ }
3744
+ }
3745
+ if (e.data) {
3746
+ const w = e.data;
3747
+ if (Array.isArray(w)) {
3748
+ s(w), c(!1);
3749
+ return;
3750
+ }
3751
+ }
3752
+ if (V && Z?.provider === "value") {
3753
+ s(Z.items), c(!1);
331
3754
  return;
332
3755
  }
333
- if (!i)
3756
+ if (!t)
334
3757
  throw new Error("DataSource required for object/api providers");
335
- if (p?.provider === "object") {
336
- const f = p.object, x = await i.find(f, {
337
- $filter: t.filter,
338
- $orderby: ce(t.sort)
3758
+ if (Z?.provider === "object") {
3759
+ const w = Z.object, A = await t.find(w, {
3760
+ $filter: e.filter,
3761
+ $orderby: Ta(e.sort)
339
3762
  });
340
- m(x?.data || []);
341
- } else p?.provider === "api" && (console.warn("API provider not yet implemented for ObjectMap"), m([]));
342
- v(!1);
343
- } catch (f) {
344
- F(f), v(!1);
3763
+ let L = [];
3764
+ Array.isArray(A) ? L = A : A && typeof A == "object" && (Array.isArray(A.data) ? L = A.data : Array.isArray(A.value) && (L = A.value)), s(L);
3765
+ } else Z?.provider === "api" && (console.warn("API provider not yet implemented for ObjectMap"), s([]));
3766
+ c(!1);
3767
+ } catch (w) {
3768
+ d(w), c(!1);
345
3769
  }
346
3770
  })();
347
- }, [p, i, j, t.filter, t.sort]), G(() => {
348
- !j && i && (async () => {
3771
+ }, [Z, t, V, e.filter, e.sort]), F(() => {
3772
+ !V && t && (async () => {
349
3773
  try {
350
- if (!i) return;
351
- const f = p?.provider === "object" ? p.object : t.objectName;
352
- if (!f) return;
353
- const x = await i.getObjectSchema(f);
354
- w(x);
355
- } catch (f) {
356
- console.error("Failed to fetch object schema:", f);
3774
+ if (!t) return;
3775
+ const w = Z?.provider === "object" ? Z.object : e.objectName;
3776
+ if (!w) return;
3777
+ const A = await t.getObjectSchema(w);
3778
+ p(A);
3779
+ } catch (w) {
3780
+ console.error("Failed to fetch object schema:", w);
357
3781
  }
358
3782
  })();
359
- }, [t.objectName, i, j, p]);
360
- const g = X(() => l.map((o, f) => {
361
- const x = de(o, b);
362
- if (!x) return null;
363
- const M = b.titleField ? o[b.titleField] : "Marker", C = b.descriptionField ? o[b.descriptionField] : void 0;
364
- return {
365
- id: o.id || o._id || `marker-${f}`,
366
- title: M,
367
- description: C,
368
- coordinates: x,
369
- data: o
3783
+ }, [e.objectName, t, V, Z]);
3784
+ const b = Y(() => i.map((S, w) => {
3785
+ const A = ja(S, N);
3786
+ if (!A) return null;
3787
+ const L = N.titleField ? S[N.titleField] : "Marker", le = N.descriptionField ? S[N.descriptionField] : void 0, [q, U] = A;
3788
+ return q < -90 || q > 90 || U < -180 || U > 180 ? (console.warn(`Invalid coordinates for marker ${w}: [${q}, ${U}]`), null) : {
3789
+ id: S.id || S._id || `marker-${w}`,
3790
+ title: L,
3791
+ description: le,
3792
+ coordinates: [U, q],
3793
+ // maplibre uses [lng, lat]
3794
+ data: S
370
3795
  };
371
- }).filter((o) => o !== null), [l, b]), k = X(() => {
372
- if (!g.length)
3796
+ }).filter((S) => S !== null), [i, N]), v = Y(
3797
+ () => b.find((S) => S.id === h),
3798
+ [b, h]
3799
+ ), E = Y(() => {
3800
+ if (!b.length)
373
3801
  return {
374
- center: b.center || [0, 0],
375
- minLat: (b.center?.[0] || 0) - 0.1,
376
- maxLat: (b.center?.[0] || 0) + 0.1,
377
- minLng: (b.center?.[1] || 0) - 0.1,
378
- maxLng: (b.center?.[1] || 0) + 0.1
3802
+ longitude: N.center?.[1] || 0,
3803
+ latitude: N.center?.[0] || 0,
3804
+ zoom: N.zoom || 2
379
3805
  };
380
- const o = g.map((x) => x.coordinates[0]), f = g.map((x) => x.coordinates[1]);
3806
+ const S = b.map((U) => U.coordinates[0]), w = b.map((U) => U.coordinates[1]), A = Math.min(...S), L = Math.max(...S), le = Math.min(...w), q = Math.max(...w);
381
3807
  return {
382
- center: [
383
- (Math.min(...o) + Math.max(...o)) / 2,
384
- (Math.min(...f) + Math.max(...f)) / 2
385
- ],
386
- minLat: Math.min(...o),
387
- maxLat: Math.max(...o),
388
- minLng: Math.min(...f),
389
- maxLng: Math.max(...f)
3808
+ longitude: (A + L) / 2,
3809
+ latitude: (le + q) / 2,
3810
+ zoom: N.zoom || 3
3811
+ // Auto-zoom logic could be improved here
390
3812
  };
391
- }, [g, b.center]);
392
- return h ? /* @__PURE__ */ a.jsx("div", { className: n, children: /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg", children: /* @__PURE__ */ a.jsx("div", { className: "text-muted-foreground", children: "Loading map..." }) }) }) : T ? /* @__PURE__ */ a.jsx("div", { className: n, children: /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg", children: /* @__PURE__ */ a.jsxs("div", { className: "text-destructive", children: [
3813
+ }, [b, N]);
3814
+ return a ? /* @__PURE__ */ I.jsx("div", { className: n, children: /* @__PURE__ */ I.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg border", children: /* @__PURE__ */ I.jsx("div", { className: "text-muted-foreground", children: "Loading map..." }) }) }) : u ? /* @__PURE__ */ I.jsx("div", { className: n, children: /* @__PURE__ */ I.jsx("div", { className: "flex items-center justify-center h-96 bg-muted rounded-lg border", children: /* @__PURE__ */ I.jsxs("div", { className: "text-destructive", children: [
393
3815
  "Error: ",
394
- T.message
395
- ] }) }) }) : /* @__PURE__ */ a.jsx("div", { className: n, children: /* @__PURE__ */ a.jsxs("div", { className: "relative border rounded-lg overflow-hidden bg-muted", style: { height: "600px" }, children: [
396
- /* @__PURE__ */ a.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gradient-to-br from-blue-50 to-green-50 dark:from-blue-950 dark:to-green-950", children: /* @__PURE__ */ a.jsxs("div", { className: "text-center", children: [
397
- /* @__PURE__ */ a.jsx("div", { className: "text-4xl mb-2", children: "πŸ—ΊοΈ" }),
398
- /* @__PURE__ */ a.jsx("div", { className: "text-sm text-muted-foreground mb-4", children: "Map Visualization (Placeholder)" }),
399
- /* @__PURE__ */ a.jsxs("div", { className: "text-xs text-muted-foreground max-w-md mx-auto", children: [
400
- "This is a basic map placeholder. For production, integrate with Mapbox, Leaflet, or Google Maps.",
401
- /* @__PURE__ */ a.jsx("br", {}),
402
- /* @__PURE__ */ a.jsx("br", {}),
403
- /* @__PURE__ */ a.jsx("strong", { children: "Map Info:" }),
404
- /* @__PURE__ */ a.jsx("br", {}),
405
- "Center: [",
406
- k.center[0].toFixed(4),
407
- ", ",
408
- k.center[1].toFixed(4),
409
- "]",
410
- /* @__PURE__ */ a.jsx("br", {}),
411
- "Markers: ",
412
- g.length
413
- ] })
414
- ] }) }),
415
- /* @__PURE__ */ a.jsxs("div", { className: "absolute top-4 right-4 w-64 bg-background border rounded-lg shadow-lg max-h-96 overflow-y-auto", children: [
416
- /* @__PURE__ */ a.jsxs("div", { className: "p-3 border-b font-semibold bg-muted", children: [
417
- "Locations (",
418
- g.length,
419
- ")"
420
- ] }),
421
- g.length === 0 ? /* @__PURE__ */ a.jsx("div", { className: "p-4 text-sm text-muted-foreground text-center", children: "No locations found with valid coordinates" }) : /* @__PURE__ */ a.jsx("div", { children: g.map((o) => /* @__PURE__ */ a.jsxs(
422
- "div",
423
- {
424
- className: `p-3 border-b hover:bg-muted/50 cursor-pointer transition-colors ${O === o.id ? "bg-muted" : ""}`,
425
- onClick: () => {
426
- E(o.id), s?.(o.data);
3816
+ u.message
3817
+ ] }) }) }) : /* @__PURE__ */ I.jsx("div", { className: n, children: /* @__PURE__ */ I.jsx("div", { className: "relative border rounded-lg overflow-hidden bg-muted", style: { height: "600px", width: "100%" }, children: /* @__PURE__ */ I.jsxs(
3818
+ ha,
3819
+ {
3820
+ initialViewState: E,
3821
+ style: { width: "100%", height: "100%" },
3822
+ mapStyle: "https://demotiles.maplibre.org/style.json",
3823
+ children: [
3824
+ /* @__PURE__ */ I.jsx(ka, { position: "top-right" }),
3825
+ b.map((S) => /* @__PURE__ */ I.jsx(
3826
+ _a,
3827
+ {
3828
+ longitude: S.coordinates[0],
3829
+ latitude: S.coordinates[1],
3830
+ anchor: "bottom",
3831
+ onClick: (w) => {
3832
+ w.originalEvent.stopPropagation(), z(S.id), r?.(S.data);
3833
+ },
3834
+ children: /* @__PURE__ */ I.jsx("div", { className: "text-2xl cursor-pointer hover:scale-110 transition-transform", children: "πŸ“" })
427
3835
  },
428
- children: [
429
- /* @__PURE__ */ a.jsx("div", { className: "font-medium text-sm", children: o.title }),
430
- o.description && /* @__PURE__ */ a.jsx("div", { className: "text-xs text-muted-foreground mt-1 line-clamp-2", children: o.description }),
431
- /* @__PURE__ */ a.jsxs("div", { className: "text-xs text-muted-foreground mt-1", children: [
432
- "πŸ“ ",
433
- o.coordinates[0].toFixed(4),
434
- ", ",
435
- o.coordinates[1].toFixed(4)
3836
+ S.id
3837
+ )),
3838
+ v && /* @__PURE__ */ I.jsx(
3839
+ va,
3840
+ {
3841
+ longitude: v.coordinates[0],
3842
+ latitude: v.coordinates[1],
3843
+ anchor: "top",
3844
+ onClose: () => z(null),
3845
+ closeOnClick: !1,
3846
+ children: /* @__PURE__ */ I.jsxs("div", { className: "p-2 min-w-[200px]", children: [
3847
+ /* @__PURE__ */ I.jsx("h3", { className: "font-bold text-sm mb-1", children: v.title }),
3848
+ v.description && /* @__PURE__ */ I.jsx("p", { className: "text-xs text-muted-foreground", children: v.description }),
3849
+ /* @__PURE__ */ I.jsxs("div", { className: "mt-2 text-xs flex gap-2", children: [
3850
+ onEdit && /* @__PURE__ */ I.jsx("button", { className: "text-blue-500 hover:underline", onClick: () => onEdit(v.data), children: "Edit" }),
3851
+ onDelete && /* @__PURE__ */ I.jsx("button", { className: "text-red-500 hover:underline", onClick: () => onDelete(v.data), children: "Delete" })
3852
+ ] })
436
3853
  ] })
437
- ]
438
- },
439
- o.id
440
- )) })
441
- ] }),
442
- /* @__PURE__ */ a.jsxs("div", { className: "absolute bottom-4 left-4 bg-background border rounded-lg shadow-lg p-3", children: [
443
- /* @__PURE__ */ a.jsx("div", { className: "text-xs font-semibold mb-2", children: "Legend" }),
444
- /* @__PURE__ */ a.jsx("div", { className: "text-xs space-y-1", children: /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
445
- /* @__PURE__ */ a.jsx("div", { className: "w-3 h-3 rounded-full bg-blue-500" }),
446
- /* @__PURE__ */ a.jsx("span", { children: "Location Marker" })
447
- ] }) })
448
- ] })
449
- ] }) });
450
- }, me = ({ schema: t }) => /* @__PURE__ */ a.jsx(fe, { schema: t, dataSource: null });
451
- ae.register("object-map", me, {
3854
+ }
3855
+ )
3856
+ ]
3857
+ }
3858
+ ) }) });
3859
+ }, Ia = ({ schema: e, ...t }) => {
3860
+ const { dataSource: n } = bn();
3861
+ return /* @__PURE__ */ I.jsx(Na, { schema: e, dataSource: n, ...t });
3862
+ };
3863
+ console.log("Registering object-map...");
3864
+ yn.register("object-map", Ia, {
3865
+ namespace: "plugin-map",
452
3866
  label: "Object Map",
453
3867
  category: "plugin",
454
3868
  inputs: [
@@ -457,5 +3871,6 @@ ae.register("object-map", me, {
457
3871
  ]
458
3872
  });
459
3873
  export {
460
- fe as ObjectMap
3874
+ Na as ObjectMap,
3875
+ Ia as ObjectMapRenderer
461
3876
  };