@reforma/components 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/Scrollable/Scrollable.d.ts +1 -2
  2. package/dist/Scrollable/Scrollable.d.ts.map +1 -1
  3. package/dist/Scrollable/Scrollable.js +45 -38
  4. package/dist/Scrollable/Scrollable.js.map +1 -1
  5. package/dist/Scrollable/useScrollChrome.d.ts +1 -2
  6. package/dist/Scrollable/useScrollChrome.d.ts.map +1 -1
  7. package/dist/Scrollable/useScrollChrome.js +125 -110
  8. package/dist/Scrollable/useScrollChrome.js.map +1 -1
  9. package/dist/chat/ComposerBanner/ComposerBanner.d.ts +2 -1
  10. package/dist/chat/ComposerBanner/ComposerBanner.d.ts.map +1 -1
  11. package/dist/chat/ComposerBanner/ComposerBanner.js +37 -29
  12. package/dist/chat/ComposerBanner/ComposerBanner.js.map +1 -1
  13. package/dist/chat/ComposerBanner/ComposerBanner.module.css +1 -1
  14. package/dist/chat/ComposerBanner/ComposerBanner.module.css.js +5 -3
  15. package/dist/chat/ComposerBanner/ComposerBanner.module.css.js.map +1 -1
  16. package/dist/chat/Tool/agent/AgentTool.d.ts.map +1 -1
  17. package/dist/chat/Tool/agent/AgentTool.js +89 -90
  18. package/dist/chat/Tool/agent/AgentTool.js.map +1 -1
  19. package/dist/chat/Tool/edit/EditTool.js +1 -1
  20. package/dist/chat/Tool/edit/EditTool.js.map +1 -1
  21. package/dist/node_modules/zod/v4/classic/errors.js +38 -0
  22. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  23. package/dist/node_modules/zod/v4/classic/parse.js +21 -0
  24. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  25. package/dist/node_modules/zod/v4/classic/schemas.js +822 -0
  26. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  27. package/dist/node_modules/zod/v4/core/api.js +561 -0
  28. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  29. package/dist/node_modules/zod/v4/core/checks.js +262 -0
  30. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  31. package/dist/node_modules/zod/v4/core/core.js +97 -0
  32. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  33. package/dist/node_modules/zod/v4/core/doc.js +35 -0
  34. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  35. package/dist/node_modules/zod/v4/core/errors.js +79 -0
  36. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  37. package/dist/node_modules/zod/v4/core/json-schema-processors.js +308 -0
  38. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
  39. package/dist/node_modules/zod/v4/core/memoizer.js +203 -0
  40. package/dist/node_modules/zod/v4/core/memoizer.js.map +1 -0
  41. package/dist/node_modules/zod/v4/core/parse.js +113 -0
  42. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  43. package/dist/node_modules/zod/v4/core/regexes.js +59 -0
  44. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  45. package/dist/node_modules/zod/v4/core/registries.js +41 -0
  46. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  47. package/dist/node_modules/zod/v4/core/schemas.js +1104 -0
  48. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  49. package/dist/node_modules/zod/v4/core/to-json-schema.js +380 -0
  50. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  51. package/dist/node_modules/zod/v4/core/util.js +465 -0
  52. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  53. package/dist/node_modules/zod/v4/core/versions.js +9 -0
  54. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  55. package/dist/node_modules/zod/v4/locales/en.js +97 -0
  56. package/dist/node_modules/zod/v4/locales/en.js.map +1 -0
  57. package/dist/openui/actions.d.ts +16 -0
  58. package/dist/openui/actions.d.ts.map +1 -0
  59. package/dist/openui/actions.js +58 -0
  60. package/dist/openui/actions.js.map +1 -0
  61. package/dist/openui/components/controls.d.ts +34 -0
  62. package/dist/openui/components/controls.d.ts.map +1 -0
  63. package/dist/openui/components/controls.js +40 -0
  64. package/dist/openui/components/controls.js.map +1 -0
  65. package/dist/openui/components/layout.d.ts +74 -0
  66. package/dist/openui/components/layout.d.ts.map +1 -0
  67. package/dist/openui/components/layout.js +154 -0
  68. package/dist/openui/components/layout.js.map +1 -0
  69. package/dist/openui/components/list.d.ts +17 -0
  70. package/dist/openui/components/list.d.ts.map +1 -0
  71. package/dist/openui/components/list.js +96 -0
  72. package/dist/openui/components/list.js.map +1 -0
  73. package/dist/openui/components/svg.d.ts +100 -0
  74. package/dist/openui/components/svg.d.ts.map +1 -0
  75. package/dist/openui/components/svg.js +246 -0
  76. package/dist/openui/components/svg.js.map +1 -0
  77. package/dist/openui/components/table.d.ts +6 -0
  78. package/dist/openui/components/table.d.ts.map +1 -0
  79. package/dist/openui/components/table.js +54 -0
  80. package/dist/openui/components/table.js.map +1 -0
  81. package/dist/openui/components/text.d.ts +89 -0
  82. package/dist/openui/components/text.d.ts.map +1 -0
  83. package/dist/openui/components/text.js +181 -0
  84. package/dist/openui/components/text.js.map +1 -0
  85. package/dist/openui/functions/colors.d.ts +12 -0
  86. package/dist/openui/functions/colors.d.ts.map +1 -0
  87. package/dist/openui/functions/colors.js +32 -0
  88. package/dist/openui/functions/colors.js.map +1 -0
  89. package/dist/openui/functions/data.d.ts +170 -0
  90. package/dist/openui/functions/data.d.ts.map +1 -0
  91. package/dist/openui/functions/data.js +308 -0
  92. package/dist/openui/functions/data.js.map +1 -0
  93. package/dist/openui/functions/dates.d.ts +57 -0
  94. package/dist/openui/functions/dates.d.ts.map +1 -0
  95. package/dist/openui/functions/dates.js +184 -0
  96. package/dist/openui/functions/dates.js.map +1 -0
  97. package/dist/openui/functions/index.d.ts +136 -0
  98. package/dist/openui/functions/index.d.ts.map +1 -0
  99. package/dist/openui/functions/index.js +11 -0
  100. package/dist/openui/functions/index.js.map +1 -0
  101. package/dist/openui/functions/lists.d.ts +102 -0
  102. package/dist/openui/functions/lists.d.ts.map +1 -0
  103. package/dist/openui/functions/lists.js +305 -0
  104. package/dist/openui/functions/lists.js.map +1 -0
  105. package/dist/openui/functions/numbers.d.ts +72 -0
  106. package/dist/openui/functions/numbers.d.ts.map +1 -0
  107. package/dist/openui/functions/numbers.js +201 -0
  108. package/dist/openui/functions/numbers.js.map +1 -0
  109. package/dist/openui/functions/shared.d.ts +28 -0
  110. package/dist/openui/functions/shared.d.ts.map +1 -0
  111. package/dist/openui/functions/shared.js +69 -0
  112. package/dist/openui/functions/shared.js.map +1 -0
  113. package/dist/openui/functions/text.d.ts +97 -0
  114. package/dist/openui/functions/text.d.ts.map +1 -0
  115. package/dist/openui/functions/text.js +223 -0
  116. package/dist/openui/functions/text.js.map +1 -0
  117. package/dist/openui/index.d.ts +5 -0
  118. package/dist/openui/index.d.ts.map +1 -0
  119. package/dist/openui/index.js +14 -0
  120. package/dist/openui/index.js.map +1 -0
  121. package/dist/openui/library.d.ts +8 -0
  122. package/dist/openui/library.d.ts.map +1 -0
  123. package/dist/openui/library.js +37 -0
  124. package/dist/openui/library.js.map +1 -0
  125. package/dist/openui/schema.d.ts +36 -0
  126. package/dist/openui/schema.d.ts.map +1 -0
  127. package/dist/openui/schema.js +24 -0
  128. package/dist/openui/schema.js.map +1 -0
  129. package/package.json +4 -2
@@ -0,0 +1,262 @@
1
+ import { $constructor as r } from "./core.js";
2
+ import { uppercase as k, lowercase as b } from "./regexes.js";
3
+ import { codePointLength as m, getLengthableOrigin as l, nullish as $, escapeRegex as g, floatSafeRemainder as C, NUMBER_FORMAT_RANGES as x } from "./util.js";
4
+ const s = /* @__PURE__ */ r("$ZodCheck", (e, t) => {
5
+ var n;
6
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
7
+ }), v = (e) => {
8
+ const t = e.value;
9
+ return !$(t) && t.length !== void 0;
10
+ }, a = {
11
+ number: "number",
12
+ bigint: "bigint",
13
+ object: "date"
14
+ }, E = /* @__PURE__ */ r("$ZodCheckLessThan", (e, t) => {
15
+ s.init(e, t);
16
+ const n = a[typeof t.value];
17
+ e._zod.check = (i) => {
18
+ (t.inclusive ? i.value <= t.value : i.value < t.value) || i.issues.push({
19
+ origin: a[typeof i.value] ?? n,
20
+ code: "too_big",
21
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
22
+ input: i.value,
23
+ inclusive: t.inclusive,
24
+ inst: e,
25
+ continue: !t.abort
26
+ });
27
+ };
28
+ }), I = /* @__PURE__ */ r("$ZodCheckGreaterThan", (e, t) => {
29
+ s.init(e, t);
30
+ const n = a[typeof t.value];
31
+ e._zod.check = (i) => {
32
+ (t.inclusive ? i.value >= t.value : i.value > t.value) || i.issues.push({
33
+ origin: a[typeof i.value] ?? n,
34
+ code: "too_small",
35
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
36
+ input: i.value,
37
+ inclusive: t.inclusive,
38
+ inst: e,
39
+ continue: !t.abort
40
+ });
41
+ };
42
+ }), L = /* @__PURE__ */ r("$ZodCheckMultipleOf", (e, t) => {
43
+ s.init(e, t), e._zod.check = (n) => {
44
+ if (typeof n.value != typeof t.value)
45
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
46
+ (typeof n.value == "bigint" ? (
47
+ // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN
48
+ t.value !== BigInt(0) && n.value % t.value === BigInt(0)
49
+ ) : C(n.value, t.value) === 0) || n.issues.push({
50
+ origin: typeof n.value,
51
+ code: "not_multiple_of",
52
+ divisor: t.value,
53
+ input: n.value,
54
+ inst: e,
55
+ continue: !t.abort
56
+ });
57
+ };
58
+ }), M = /* @__PURE__ */ r("$ZodCheckNumberFormat", (e, t) => {
59
+ s.init(e, t), t.format = t.format || "float64";
60
+ const n = t.format?.includes("int"), i = n ? "int" : "number", [o, c] = x[t.format];
61
+ e._zod.check = (h) => {
62
+ const u = h.value;
63
+ if (n) {
64
+ if (!Number.isInteger(u)) {
65
+ h.issues.push({
66
+ expected: i,
67
+ format: t.format,
68
+ code: "invalid_type",
69
+ continue: !1,
70
+ input: u,
71
+ inst: e
72
+ });
73
+ return;
74
+ }
75
+ if (!Number.isSafeInteger(u)) {
76
+ u > 0 ? h.issues.push({
77
+ input: u,
78
+ code: "too_big",
79
+ maximum: Number.MAX_SAFE_INTEGER,
80
+ note: "Integers must be within the safe integer range.",
81
+ inst: e,
82
+ origin: i,
83
+ inclusive: !0,
84
+ continue: !t.abort
85
+ }) : h.issues.push({
86
+ input: u,
87
+ code: "too_small",
88
+ minimum: Number.MIN_SAFE_INTEGER,
89
+ note: "Integers must be within the safe integer range.",
90
+ inst: e,
91
+ origin: i,
92
+ inclusive: !0,
93
+ continue: !t.abort
94
+ });
95
+ return;
96
+ }
97
+ }
98
+ u < o && h.issues.push({
99
+ origin: "number",
100
+ input: u,
101
+ code: "too_small",
102
+ minimum: o,
103
+ inclusive: !0,
104
+ inst: e,
105
+ continue: !t.abort
106
+ }), u > c && h.issues.push({
107
+ origin: "number",
108
+ input: u,
109
+ code: "too_big",
110
+ maximum: c,
111
+ inclusive: !0,
112
+ inst: e,
113
+ continue: !t.abort
114
+ });
115
+ };
116
+ }), R = /* @__PURE__ */ r("$ZodCheckMaxLength", (e, t) => {
117
+ var n;
118
+ s.init(e, t), (n = e._zod.def).when ?? (n.when = v), e._zod.check = (i) => {
119
+ const o = i.value, c = o.length;
120
+ if ((typeof o == "string" && c > t.maximum ? m(o) : c) <= t.maximum)
121
+ return;
122
+ const u = l(o);
123
+ i.issues.push({
124
+ origin: u,
125
+ code: "too_big",
126
+ maximum: t.maximum,
127
+ inclusive: !0,
128
+ input: o,
129
+ inst: e,
130
+ continue: !t.abort
131
+ });
132
+ };
133
+ }), N = /* @__PURE__ */ r("$ZodCheckMinLength", (e, t) => {
134
+ var n;
135
+ s.init(e, t), (n = e._zod.def).when ?? (n.when = v), e._zod.check = (i) => {
136
+ const o = i.value, c = o.length;
137
+ if ((typeof o == "string" && c >= t.minimum && c < t.minimum * 2 ? m(o) : c) >= t.minimum)
138
+ return;
139
+ const u = l(o);
140
+ i.issues.push({
141
+ origin: u,
142
+ code: "too_small",
143
+ minimum: t.minimum,
144
+ inclusive: !0,
145
+ input: o,
146
+ inst: e,
147
+ continue: !t.abort
148
+ });
149
+ };
150
+ }), S = /* @__PURE__ */ r("$ZodCheckLengthEquals", (e, t) => {
151
+ var n;
152
+ s.init(e, t), (n = e._zod.def).when ?? (n.when = v), e._zod.check = (i) => {
153
+ const o = i.value, c = o.length, h = typeof o == "string" && c >= t.length && c <= t.length * 2 ? m(o) : c;
154
+ if (h === t.length)
155
+ return;
156
+ const u = l(o), _ = h > t.length;
157
+ i.issues.push({
158
+ origin: u,
159
+ ..._ ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
160
+ inclusive: !0,
161
+ exact: !0,
162
+ input: i.value,
163
+ inst: e,
164
+ continue: !t.abort
165
+ });
166
+ };
167
+ }), p = /* @__PURE__ */ r("$ZodCheckStringFormat", (e, t) => {
168
+ var n, i;
169
+ s.init(e, t), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
170
+ t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
171
+ origin: "string",
172
+ code: "invalid_format",
173
+ format: t.format,
174
+ input: o.value,
175
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
176
+ inst: e,
177
+ continue: !t.abort
178
+ });
179
+ }) : (i = e._zod).check ?? (i.check = () => {
180
+ });
181
+ }), T = /* @__PURE__ */ r("$ZodCheckRegex", (e, t) => {
182
+ p.init(e, t), e._zod.check = (n) => {
183
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
184
+ origin: "string",
185
+ code: "invalid_format",
186
+ format: "regex",
187
+ input: n.value,
188
+ pattern: t.pattern.toString(),
189
+ inst: e,
190
+ continue: !t.abort
191
+ });
192
+ };
193
+ }), F = /* @__PURE__ */ r("$ZodCheckLowerCase", (e, t) => {
194
+ t.pattern ?? (t.pattern = b), p.init(e, t);
195
+ }), O = /* @__PURE__ */ r("$ZodCheckUpperCase", (e, t) => {
196
+ t.pattern ?? (t.pattern = k), p.init(e, t);
197
+ }), W = /* @__PURE__ */ r("$ZodCheckIncludes", (e, t) => {
198
+ s.init(e, t);
199
+ const n = g(t.includes), i = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
200
+ t.pattern = i, e._zod.check = (o) => {
201
+ o.value.includes(t.includes, t.position) || o.issues.push({
202
+ origin: "string",
203
+ code: "invalid_format",
204
+ format: "includes",
205
+ includes: t.includes,
206
+ input: o.value,
207
+ inst: e,
208
+ continue: !t.abort
209
+ });
210
+ };
211
+ }), A = /* @__PURE__ */ r("$ZodCheckStartsWith", (e, t) => {
212
+ s.init(e, t);
213
+ const n = new RegExp(`^${g(t.prefix)}.*`);
214
+ t.pattern ?? (t.pattern = n), e._zod.check = (i) => {
215
+ i.value.startsWith(t.prefix) || i.issues.push({
216
+ origin: "string",
217
+ code: "invalid_format",
218
+ format: "starts_with",
219
+ prefix: t.prefix,
220
+ input: i.value,
221
+ inst: e,
222
+ continue: !t.abort
223
+ });
224
+ };
225
+ }), G = /* @__PURE__ */ r("$ZodCheckEndsWith", (e, t) => {
226
+ s.init(e, t);
227
+ const n = new RegExp(`.*${g(t.suffix)}$`);
228
+ t.pattern ?? (t.pattern = n), e._zod.check = (i) => {
229
+ i.value.endsWith(t.suffix) || i.issues.push({
230
+ origin: "string",
231
+ code: "invalid_format",
232
+ format: "ends_with",
233
+ suffix: t.suffix,
234
+ input: i.value,
235
+ inst: e,
236
+ continue: !t.abort
237
+ });
238
+ };
239
+ }), B = /* @__PURE__ */ r("$ZodCheckOverwrite", (e, t) => {
240
+ s.init(e, t), e._zod.check = (n) => {
241
+ n.value = t.tx(n.value);
242
+ };
243
+ });
244
+ export {
245
+ s as $ZodCheck,
246
+ G as $ZodCheckEndsWith,
247
+ I as $ZodCheckGreaterThan,
248
+ W as $ZodCheckIncludes,
249
+ S as $ZodCheckLengthEquals,
250
+ E as $ZodCheckLessThan,
251
+ F as $ZodCheckLowerCase,
252
+ R as $ZodCheckMaxLength,
253
+ N as $ZodCheckMinLength,
254
+ L as $ZodCheckMultipleOf,
255
+ M as $ZodCheckNumberFormat,
256
+ B as $ZodCheckOverwrite,
257
+ T as $ZodCheckRegex,
258
+ A as $ZodCheckStartsWith,
259
+ p as $ZodCheckStringFormat,
260
+ O as $ZodCheckUpperCase
261
+ };
262
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sources":["../../../../../../../node_modules/zod/v4/core/checks.js"],"sourcesContent":["// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\n/** Default `when` for size-based checks: run only on non-nullish values with a `size`. */\nconst _whenHasSize = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n};\n/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */\nconst _whenHasLength = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n};\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin: numericOriginMap[typeof payload.value] ?? origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN\n def.value !== BigInt(0) && payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // Strings are measured in Unicode code points, not UTF-16 units. A code point is at most two units, so a string that already fits in units fits in code points; only an overflow has to be counted.\n const length = typeof input === \"string\" && units > def.maximum ? util.codePointLength(input) : units;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so fewer units than the floor can never reach it and twice the floor always clears it. Only in between is the exact count in doubt.\n const length = typeof input === \"string\" && units >= def.minimum && units < def.minimum * 2\n ? util.codePointLength(input)\n : units;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n inst._zod.check = (payload) => {\n const input = payload.value;\n const units = input.length;\n // A code point is one or two UTF-16 units, so outside `[length, length * 2]` units the target is missed either way — and missed in the same direction in both measures.\n const length = typeof input === \"string\" && units >= def.length && units <= def.length * 2\n ? util.codePointLength(input)\n : units;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n // `String.prototype.includes(sub, position)` matches `sub` at `position`\n // OR LATER, so the pattern must allow at least `position` leading chars\n // (`{N,}`), not exactly `position` chars (`{N}`).\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckProperties = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperties\", (inst, def) => {\n $ZodCheck.init(inst, def);\n util.hide(inst, Symbol.iterator, function* () {\n yield inst;\n });\n // key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema\n let entries;\n inst._zod.check = (payload) => {\n // the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length\n if (payload.value == null) {\n payload.issues.push({ expected: \"object\", code: \"invalid_type\", input: payload.value, inst });\n return undefined;\n }\n entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));\n const input = payload.value;\n let proms;\n for (const [key, schema] of entries) {\n const result = schema._zod.run({ value: input[key], issues: [] }, {});\n if (result instanceof Promise) {\n proms ?? (proms = []);\n proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));\n }\n else {\n handleCheckPropertyResult(result, payload, key);\n }\n }\n if (proms)\n return Promise.all(proms).then(() => undefined);\n return undefined;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n"],"names":["$ZodCheck","core.$constructor","inst","def","_a","_whenHasLength","payload","val","util.nullish","numericOriginMap","$ZodCheckLessThan","origin","$ZodCheckGreaterThan","$ZodCheckMultipleOf","util.floatSafeRemainder","$ZodCheckNumberFormat","isInt","minimum","maximum","util.NUMBER_FORMAT_RANGES","input","$ZodCheckMaxLength","units","util.codePointLength","util.getLengthableOrigin","$ZodCheckMinLength","$ZodCheckLengthEquals","length","tooBig","$ZodCheckStringFormat","_b","$ZodCheckRegex","$ZodCheckLowerCase","regexes.lowercase","$ZodCheckUpperCase","regexes.uppercase","$ZodCheckIncludes","escapedRegex","util.escapeRegex","pattern","$ZodCheckStartsWith","$ZodCheckEndsWith","$ZodCheckOverwrite"],"mappings":";;;AAIY,MAACA,IAA0BC,gBAAAA,EAAkB,aAAa,CAACC,GAAMC,MAAQ;AACjF,MAAIC;AACJ,EAAAF,EAAK,SAASA,EAAK,OAAO,CAAA,IAC1BA,EAAK,KAAK,MAAMC,IACfC,IAAKF,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K,KAAK,QAAQ,CAACI,MAAY;AAC3B,IAAAA,EAAQ,QAAQH,EAAI,GAAGG,EAAQ,KAAK;AAAA,EACxC;AACJ,CAAC;","x_google_ignoreList":[0]}
@@ -0,0 +1,97 @@
1
+ import { members as j } from "./util.js";
2
+ var P;
3
+ const p = { value: void 0, enumerable: !1 };
4
+ let h = "captureStackTrace" in Error ? Error : null;
5
+ function m(r) {
6
+ const o = h;
7
+ if (o) {
8
+ const a = o.stackTraceLimit;
9
+ if (typeof a == "number") {
10
+ try {
11
+ o.stackTraceLimit = 0;
12
+ } catch {
13
+ return h = null, new r();
14
+ }
15
+ try {
16
+ return new r();
17
+ } finally {
18
+ o.stackTraceLimit = a;
19
+ }
20
+ }
21
+ }
22
+ return new r();
23
+ }
24
+ function w(r, o, a, d) {
25
+ const E = {};
26
+ function b(e) {
27
+ this.def = e, this.constr = c, this.traits = /* @__PURE__ */ new Set();
28
+ }
29
+ b.prototype = E;
30
+ const _ = a, f = _ && /* @__PURE__ */ new WeakSet();
31
+ function y(e, n) {
32
+ if (e._zod) {
33
+ if (e._zod.traits.has(r))
34
+ return;
35
+ } else {
36
+ p.value = new b(n);
37
+ try {
38
+ Object.defineProperty(e, "_zod", p);
39
+ } finally {
40
+ p.value = void 0;
41
+ }
42
+ }
43
+ if (e._zod.traits.add(r), o(e, n), f) {
44
+ const t = Object.getPrototypeOf(e), l = e._zod.constr.prototype;
45
+ let i = t;
46
+ for (; i && i !== l; )
47
+ i = Object.getPrototypeOf(i);
48
+ const u = i ?? t;
49
+ f.has(u) || (f.add(u), j(u, _));
50
+ }
51
+ const s = c.prototype;
52
+ for (const t in s)
53
+ Object.prototype.hasOwnProperty.call(s, t) && (t in e || (e[t] = s[t].bind(e)));
54
+ }
55
+ const O = d?.Parent ?? Object;
56
+ class g extends O {
57
+ }
58
+ Object.defineProperty(g, "name", { value: r });
59
+ function c(e) {
60
+ const n = d?.Parent ? m(g) : this;
61
+ y(n, e);
62
+ const s = n._zod.deferred;
63
+ if (s) {
64
+ for (const l of s)
65
+ l();
66
+ n._zod.deferred = void 0;
67
+ }
68
+ const t = globalThis.__zod_globalConfig?.postProcessor;
69
+ return t && t(n), n;
70
+ }
71
+ return Object.defineProperty(c, "init", { value: y }), Object.defineProperty(c, Symbol.hasInstance, {
72
+ value: (e) => d?.Parent && e instanceof d.Parent ? !0 : e?._zod?.traits?.has(r)
73
+ }), Object.defineProperty(c, "name", { value: r }), c;
74
+ }
75
+ class T extends Error {
76
+ constructor() {
77
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
78
+ }
79
+ }
80
+ class k extends Error {
81
+ constructor(o) {
82
+ super(`Encountered unidirectional transform during encode: ${o}`), this.name = "ZodEncodeError";
83
+ }
84
+ }
85
+ (P = globalThis).__zod_globalConfig ?? (P.__zod_globalConfig = {});
86
+ const z = globalThis.__zod_globalConfig;
87
+ function x(r) {
88
+ return r && Object.assign(z, r), z;
89
+ }
90
+ export {
91
+ T as $ZodAsyncError,
92
+ k as $ZodEncodeError,
93
+ w as $constructor,
94
+ x as config,
95
+ z as globalConfig
96
+ };
97
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sources":["../../../../../../../node_modules/zod/v4/core/core.js"],"sourcesContent":["var _a;\nimport { members as installMembers } from \"./util.js\";\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n status: \"aborted\",\n});\n/* Shared descriptor for installing `_zod`; defineProperty reads it\n * synchronously, so reusing one object avoids a per-instance allocation. */\nconst _zodDesc = { value: undefined, enumerable: false };\n// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error\nlet _E = \"captureStackTrace\" in Error ? Error : null;\n// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot\nfunction newError(Definition) {\n const E = _E;\n if (E) {\n const saved = E.stackTraceLimit;\n if (typeof saved === \"number\") {\n try {\n E.stackTraceLimit = 0;\n }\n catch {\n _E = null;\n return new Definition();\n }\n try {\n return new Definition();\n }\n finally {\n E.stackTraceLimit = saved;\n }\n }\n }\n return new Definition();\n}\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, \n/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */\nproto, params) {\n // Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.\n const zodProto = {};\n // Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.\n function Internals(def) {\n this.def = def;\n this.constr = _;\n this.traits = new Set();\n }\n Internals.prototype = zodProto;\n const protoMembers = proto;\n // One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.\n const initialized = protoMembers && new WeakSet();\n function init(inst, def) {\n if (!inst._zod) {\n _zodDesc.value = new Internals(def);\n try {\n Object.defineProperty(inst, \"_zod\", _zodDesc);\n }\n finally {\n // Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.\n _zodDesc.value = undefined;\n }\n }\n else if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n if (initialized) {\n // `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.\n const own = Object.getPrototypeOf(inst);\n const ctorProto = inst._zod.constr.prototype;\n let up = own;\n while (up && up !== ctorProto)\n up = Object.getPrototypeOf(up);\n const target = up ?? own;\n if (!initialized.has(target)) {\n initialized.add(target);\n installMembers(target, protoMembers);\n }\n }\n // support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype\n const proto = _.prototype;\n for (const k in proto) {\n if (!Object.prototype.hasOwnProperty.call(proto, k))\n continue;\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n const inst = params?.Parent ? newError(Definition) : this;\n init(inst, def);\n const deferred = inst._zod.deferred;\n if (deferred) {\n for (const fn of deferred) {\n fn();\n }\n // Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.\n inst._zod.deferred = undefined;\n }\n // Global post-processor hook. Internal: installed by `import \"zod/compile\"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.\n const pp = globalThis.__zod_globalConfig?.postProcessor;\n if (pp)\n pp(inst);\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = /*@__PURE__*/ Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n"],"names":["_a","_zodDesc","_E","newError","Definition","E","saved","$constructor","name","initializer","proto","params","zodProto","Internals","def","_","protoMembers","initialized","init","inst","own","ctorProto","up","target","installMembers","k","Parent","deferred","fn","pp","$ZodAsyncError","$ZodEncodeError","globalConfig","config","newConfig"],"mappings":";AAAA,IAAIA;AAQJ,MAAMC,IAAW,EAAE,OAAO,QAAW,YAAY,GAAK;AAEtD,IAAIC,IAAK,uBAAuB,QAAQ,QAAQ;AAEhD,SAASC,EAASC,GAAY;AAC1B,QAAMC,IAAIH;AACV,MAAIG,GAAG;AACH,UAAMC,IAAQD,EAAE;AAChB,QAAI,OAAOC,KAAU,UAAU;AAC3B,UAAI;AACA,QAAAD,EAAE,kBAAkB;AAAA,MACxB,QACM;AACF,eAAAH,IAAK,MACE,IAAIE,EAAU;AAAA,MACzB;AACA,UAAI;AACA,eAAO,IAAIA,EAAU;AAAA,MACzB,UACZ;AACgB,QAAAC,EAAE,kBAAkBC;AAAA,MACxB;AAAA,IACJ;AAAA,EACJ;AACA,SAAO,IAAIF,EAAU;AACzB;AACgC,SAASG,EAAaC,GAAMC,GAE5DC,GAAOC,GAAQ;AAEX,QAAMC,IAAW,CAAA;AAEjB,WAASC,EAAUC,GAAK;AACpB,SAAK,MAAMA,GACX,KAAK,SAASC,GACd,KAAK,SAAS,oBAAI,IAAG;AAAA,EACzB;AACA,EAAAF,EAAU,YAAYD;AACtB,QAAMI,IAAeN,GAEfO,IAAcD,KAAgB,oBAAI,QAAO;AAC/C,WAASE,EAAKC,GAAML,GAAK;AACrB,QAAKK,EAAK;AAUL,UAAIA,EAAK,KAAK,OAAO,IAAIX,CAAI;AAC9B;AAAA,WAXY;AACZ,MAAAP,EAAS,QAAQ,IAAIY,EAAUC,CAAG;AAClC,UAAI;AACA,eAAO,eAAeK,GAAM,QAAQlB,CAAQ;AAAA,MAChD,UACZ;AAEgB,QAAAA,EAAS,QAAQ;AAAA,MACrB;AAAA,IACJ;AAMA,QAFAkB,EAAK,KAAK,OAAO,IAAIX,CAAI,GACzBC,EAAYU,GAAML,CAAG,GACjBG,GAAa;AAEb,YAAMG,IAAM,OAAO,eAAeD,CAAI,G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,EACpF;AACJ;AACO,MAAMC,UAAwB,MAAM;AAAA,EACvC,YAAYvB,GAAM;AACd,UAAM,uDAAuDA,CAAI,EAAE,GACnE,KAAK,OAAO;AAAA,EAChB;AACJ;AAAA,CACCR,IAAK,YAAY,uBAAuBA,EAAG,qBAAqB,CAAA;AACrD,MAACgC,IAAe,WAAW;AAChC,SAASC,EAAOC,GAAW;AAC9B,SAAIA,KACA,OAAO,OAAOF,GAAcE,CAAS,GAClCF;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,35 @@
1
+ class h {
2
+ constructor(t = [], e = {}) {
3
+ this.content = [], this.indent = 0, this.args = t, this.closed = e;
4
+ }
5
+ // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
6
+ indented(t) {
7
+ this.indent += 1;
8
+ try {
9
+ t(this);
10
+ } finally {
11
+ this.indent -= 1;
12
+ }
13
+ }
14
+ write(t) {
15
+ if (typeof t == "function") {
16
+ t(this, { execution: "sync" }), t(this, { execution: "async" });
17
+ return;
18
+ }
19
+ const i = t.split(`
20
+ `).filter((n) => n), s = Math.min(...i.map((n) => n.length - n.trimStart().length)), c = i.map((n) => n.slice(s)).map((n) => " ".repeat(this.indent * 2) + n);
21
+ for (const n of c)
22
+ this.content.push(n);
23
+ }
24
+ compile() {
25
+ const t = Function, e = this?.content ?? [""];
26
+ return new t(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
27
+ ${e.join(`
28
+ `)}
29
+ };`)(...Object.values(this.closed));
30
+ }
31
+ }
32
+ export {
33
+ h as Doc
34
+ };
35
+ //# sourceMappingURL=doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc.js","sources":["../../../../../../../node_modules/zod/v4/core/doc.js"],"sourcesContent":["export class Doc {\n constructor(args = [], closed = {}) {\n this.content = [];\n this.indent = 0;\n this.args = args;\n this.closed = closed;\n }\n // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it\n indented(fn) {\n this.indent += 1;\n try {\n fn(this);\n }\n finally {\n this.indent -= 1;\n }\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const content = this?.content ?? [``];\n const factory = new F(...Object.keys(this.closed), `return function (${this.args.join(\", \")}) {\\n${content.join(\"\\n\")}\\n};`);\n return factory(...Object.values(this.closed));\n }\n}\n"],"names":["Doc","args","closed","fn","arg","lines","x","minIndent","dedented","line","F","content"],"mappings":"AAAO,MAAMA,EAAI;AAAA,EACb,YAAYC,IAAO,IAAIC,IAAS,CAAA,GAAI;AAChC,SAAK,UAAU,CAAA,GACf,KAAK,SAAS,GACd,KAAK,OAAOD,GACZ,KAAK,SAASC;AAAA,EAClB;AAAA;AAAA,EAEA,SAASC,GAAI;AACT,SAAK,UAAU;AACf,QAAI;AACA,MAAAA,EAAG,IAAI;AAAA,IACX,UACR;AACY,WAAK,UAAU;AAAA,IACnB;AAAA,EACJ;AAAA,EACA,MAAMC,GAAK;AACP,QAAI,OAAOA,KAAQ,YAAY;AAC3B,MAAAA,EAAI,MAAM,EAAE,WAAW,OAAM,CAAE,GAC/BA,EAAI,MAAM,EAAE,WAAW,QAAO,CAAE;AAChC;AAAA,IACJ;AAEA,UAAMC,IADUD,EACM,MAAM;AAAA,CAAI,EAAE,OAAO,CAACE,MAAMA,CAAC,GAC3CC,IAAY,KAAK,IAAI,GAAGF,EAAM,IAAI,CAACC,MAAMA,EAAE,SAASA,EAAE,UAAS,EAAG,MAAM,CAAC,GACzEE,IAAWH,EAAM,IAAI,CAACC,MAAMA,EAAE,MAAMC,CAAS,CAAC,EAAE,IAAI,CAACD,MAAM,IAAI,OAAO,KAAK,SAAS,CAAC,IAAIA,CAAC;AAChG,eAAWG,KAAQD;AACf,WAAK,QAAQ,KAAKC,CAAI;AAAA,EAE9B;AAAA,EACA,UAAU;AACN,UAAMC,IAAI,UACJC,IAAU,MAAM,WAAW,CAAC,EAAE;AAEpC,WADgB,IAAID,EAAE,GAAG,OAAO,KAAK,KAAK,MAAM,GAAG,oBAAoB,KAAK,KAAK,KAAK,IAAI,CAAC;AAAA,EAAQC,EAAQ,KAAK;AAAA,CAAI,CAAC;AAAA,GAAM,EAC5G,GAAG,OAAO,OAAO,KAAK,MAAM,CAAC;AAAA,EAChD;AACJ;","x_google_ignoreList":[0]}
@@ -0,0 +1,79 @@
1
+ import { $constructor as b } from "./core.js";
2
+ import { jsonStringifyReplacer as h } from "./util.js";
3
+ function m() {
4
+ const e = this._zod;
5
+ return e.message ?? (e.message = JSON.stringify(e.def, h, 2)), e.message;
6
+ }
7
+ function _(e) {
8
+ this._zod.message = e;
9
+ }
10
+ const O = {
11
+ get: m,
12
+ set: _,
13
+ enumerable: !0,
14
+ configurable: !0
15
+ }, f = { value: void 0, enumerable: !1 }, p = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]), y = (e, t) => {
16
+ e.name = "$ZodError", f.value = t, Object.defineProperty(e, "issues", f), f.value = void 0, Object.defineProperty(e, "message", O);
17
+ const r = Object.getPrototypeOf(e);
18
+ p.has(r) || (p.add(r), Object.defineProperty(r, "toString", {
19
+ configurable: !0,
20
+ enumerable: !1,
21
+ get() {
22
+ const o = () => this.message;
23
+ return Object.defineProperty(this, "toString", { value: o, configurable: !0, writable: !0 }), o;
24
+ },
25
+ set(o) {
26
+ Object.defineProperty(this, "toString", { value: o, configurable: !0, writable: !0 });
27
+ }
28
+ }));
29
+ }, v = b("$ZodError", y);
30
+ function E(e, t, r) {
31
+ return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, { value: r(), writable: !0, enumerable: !0, configurable: !0 }) : e[t] = r()), e[t];
32
+ }
33
+ function w(e, t = (r) => r.message) {
34
+ const r = {}, o = [];
35
+ for (const n of e.issues)
36
+ n.path.length > 0 ? E(r, n.path[0], () => []).push(t(n)) : o.push(t(n));
37
+ return { formErrors: o, fieldErrors: r };
38
+ }
39
+ function S(e, t = (r) => r.message) {
40
+ const r = { _errors: [] }, o = (n, a = []) => {
41
+ for (const s of n.issues)
42
+ if (s.code === "invalid_union" && s.errors.length)
43
+ s.errors.map((i) => o({ issues: i }, [...a, ...s.path]));
44
+ else if (s.code === "invalid_key")
45
+ o({ issues: s.issues }, [...a, ...s.path]);
46
+ else if (s.code === "invalid_element")
47
+ o({ issues: s.issues }, [...a, ...s.path]);
48
+ else {
49
+ const i = [...a, ...s.path];
50
+ if (i.length === 0)
51
+ r._errors.push(t(s));
52
+ else {
53
+ let u = r, l = 0;
54
+ for (; l < i.length; ) {
55
+ const c = i[l], g = l === i.length - 1;
56
+ if (c === "_errors") {
57
+ g && u._errors.push(t(s)), l++;
58
+ continue;
59
+ }
60
+ Object.prototype.hasOwnProperty.call(u, c) || Object.defineProperty(u, c, {
61
+ value: { _errors: [] },
62
+ enumerable: !0,
63
+ writable: !0,
64
+ configurable: !0
65
+ });
66
+ const d = u[c];
67
+ g && d._errors.push(t(s)), u = d, l++;
68
+ }
69
+ }
70
+ }
71
+ };
72
+ return o(e), r;
73
+ }
74
+ export {
75
+ v as $ZodError,
76
+ w as flattenError,
77
+ S as formatError
78
+ };
79
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../../../../../../../node_modules/zod/v4/core/errors.js"],"sourcesContent":["import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\n/* Computing the message eagerly is expensive (pretty-printed JSON of all\n * issues), so defer it until first read. The accessor functions and\n * descriptors are shared across instances to keep error construction\n * cheap; the computed message is cached on the internals object. The\n * setter preserves plain assignment semantics for consumers that\n * overwrite `message`. */\nfunction _getMessage() {\n const internals = this._zod;\n internals.message ?? (internals.message = JSON.stringify(internals.def, util.jsonStringifyReplacer, 2));\n return internals.message;\n}\nfunction _setMessage(value) {\n this._zod.message = value;\n}\nconst _messageDesc = {\n get: _getMessage,\n set: _setMessage,\n enumerable: true,\n configurable: true,\n};\nconst _issuesDesc = { value: undefined, enumerable: false };\n/* Prototypes that already carry the lazy `toString`. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n // `_zod` is already non-enumerable: $constructor's init defined it with this same descriptor\n _issuesDesc.value = def;\n Object.defineProperty(inst, \"issues\", _issuesDesc);\n // Clear the shared slot; a retained `value` pins the last error's issues.\n _issuesDesc.value = undefined;\n Object.defineProperty(inst, \"message\", _messageDesc);\n /* `toString` lives as a non-enumerable lazy getter on the shared\n * prototype; on first access it caches a per-instance closure so\n * detached usage still works. */\n const proto = Object.getPrototypeOf(inst);\n if (!_installedToString.has(proto)) {\n _installedToString.add(proto);\n Object.defineProperty(proto, \"toString\", {\n configurable: true,\n enumerable: false,\n get() {\n const value = () => this.message;\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n return value;\n },\n set(value) {\n Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n },\n });\n }\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, undefined, {\n Parent: Error,\n});\n/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member\n * (\"toString\", \"constructor\") would otherwise read through to the prototype, and assigning\n * \"__proto__\" would hit the setter instead of creating a key. */\nfunction node(obj, key, make) {\n if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n if (key === \"__proto__\") {\n Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });\n }\n else {\n obj[key] = make();\n }\n }\n return obj[key];\n}\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n node(fieldErrors, sub.path[0], () => []).push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error, path = []) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n // `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.\n if (el === \"_errors\") {\n if (terminal)\n curr._errors.push(mapper(issue));\n i++;\n continue;\n }\n // A path element may collide with an inherited property name such as\n // \"__proto__\" or \"constructor\". Truthiness checks read the prototype\n // (so no node is created, then ._errors.push throws), and bracket\n // assignment of \"__proto__\" hits the setter instead of creating an\n // own key. Guard the read with hasOwnProperty and create the node\n // with defineProperty so any path element becomes a real own key.\n if (!Object.prototype.hasOwnProperty.call(curr, el)) {\n Object.defineProperty(curr, el, {\n value: { _errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n const node = curr[el];\n if (terminal) {\n node._errors.push(mapper(issue));\n }\n curr = node;\n i++;\n }\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, [...path, ...issue.path]);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n // el may collide with an inherited property name (\"__proto__\",\n // \"constructor\", ...); ??= reads the prototype so the node is never\n // created and curr.errors.push throws. Guard with hasOwnProperty and\n // create the node with defineProperty so \"__proto__\" becomes a real\n // own key rather than invoking the prototype setter.\n if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {\n Object.defineProperty(curr.properties, el, {\n value: { errors: [] },\n enumerable: true,\n writable: true,\n configurable: true,\n });\n }\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_a = curr.items)[el] ?? (_a[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n"],"names":["_getMessage","internals","util.jsonStringifyReplacer","_setMessage","value","_messageDesc","_issuesDesc","_installedToString","initializer","inst","def","proto","$ZodError","$constructor","node","obj","key","make","flattenError","error","mapper","issue","fieldErrors","formErrors","sub","formatError","processError","path","issues","fullpath","curr","i","el","terminal"],"mappings":";;AAQA,SAASA,IAAc;AACnB,QAAMC,IAAY,KAAK;AACvB,SAAAA,EAAU,YAAYA,EAAU,UAAU,KAAK,UAAUA,EAAU,KAAKC,GAA4B,CAAC,IAC9FD,EAAU;AACrB;AACA,SAASE,EAAYC,GAAO;AACxB,OAAK,KAAK,UAAUA;AACxB;AACA,MAAMC,IAAe;AAAA,EACjB,KAAKL;AAAA,EACL,KAAKG;AAAA,EACL,YAAY;AAAA,EACZ,cAAc;AAClB,GACMG,IAAc,EAAE,OAAO,QAAW,YAAY,GAAK,GAInDC,IAAqC,oBAAI,QAAQ,CAAC,OAAO,WAAW,MAAM,SAAS,CAAC,GACpFC,IAAc,CAACC,GAAMC,MAAQ;AAC/B,EAAAD,EAAK,OAAO,aAEZH,EAAY,QAAQI,GACpB,OAAO,eAAeD,GAAM,UAAUH,CAAW,GAEjDA,EAAY,QAAQ,QACpB,OAAO,eAAeG,GAAM,WAAWJ,CAAY;AAInD,QAAMM,IAAQ,OAAO,eAAeF,CAAI;AAC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