@rpcbase/auth 0.35.0 → 0.37.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/{handler-DAT7ZSyq.js → handler-B7-O9saD.js} +1 -1
- package/dist/{handler-agHFe1sA.js → handler-H2V5Ku7j.js} +1 -1
- package/dist/{handler-BGIQUixx.js → handler-rzI-pkuD.js} +1 -1
- package/dist/index-A8RBq0oF.js +25 -0
- package/dist/index-uirCke8f.js +21 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +176 -8
- package/dist/{index-DGbE-dXC.js → isValidNumber-By4qnIex.js} +14 -3201
- package/dist/routes.js +9 -0
- package/dist/schemas-DKK0lkQz.js +2972 -0
- package/package.json +13 -1
|
@@ -1,3076 +1,3 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useLocation, Link } from "@rpcbase/router";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { useFormContext, useForm, zodResolver, FormProvider } from "@rpcbase/form";
|
|
5
|
-
import { useEffect } from "react";
|
|
6
|
-
const LINKS_REDIRECTION_MAP = {
|
|
7
|
-
"/auth/sign-in": {
|
|
8
|
-
"title": "Sign Up",
|
|
9
|
-
"location": "/auth/sign-up"
|
|
10
|
-
},
|
|
11
|
-
"/auth/sign-up": {
|
|
12
|
-
"title": "Sign In",
|
|
13
|
-
"location": "/auth/sign-in"
|
|
14
|
-
},
|
|
15
|
-
"/auth/forgot-password": {
|
|
16
|
-
"title": "Sign In",
|
|
17
|
-
"location": "/auth/sign-in"
|
|
18
|
-
},
|
|
19
|
-
"/auth/logout-success": {
|
|
20
|
-
"title": "Sign In",
|
|
21
|
-
"location": "/auth/sign-in"
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const AuthLayout = ({
|
|
25
|
-
sidePanel = null,
|
|
26
|
-
children
|
|
27
|
-
}) => {
|
|
28
|
-
const location = useLocation();
|
|
29
|
-
const linkTitle = LINKS_REDIRECTION_MAP[location.pathname]?.title;
|
|
30
|
-
const linkLocation = LINKS_REDIRECTION_MAP[location.pathname]?.location;
|
|
31
|
-
return /* @__PURE__ */ jsxs("div", { className: "container relative hidden h-dvh flex-col items-center justify-center md:grid md:w-full lg:max-w-none lg:grid-cols-2 lg:px-0", children: [
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
Link,
|
|
34
|
-
{
|
|
35
|
-
className: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 absolute right-4 top-4 md:right-8 md:top-8",
|
|
36
|
-
to: linkLocation,
|
|
37
|
-
children: linkTitle
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ jsx("div", { className: "relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex", children: sidePanel }),
|
|
41
|
-
/* @__PURE__ */ jsx("div", { className: "mx-auto flex w-full flex-col justify-center gap-6 /*sm:w-[350px]*/", children })
|
|
42
|
-
] });
|
|
43
|
-
};
|
|
44
|
-
const AppleSignInButton = ({
|
|
45
|
-
onPress,
|
|
46
|
-
className
|
|
47
|
-
}) => {
|
|
48
|
-
return /* @__PURE__ */ jsxs(
|
|
49
|
-
"button",
|
|
50
|
-
{
|
|
51
|
-
onClick: onPress,
|
|
52
|
-
className: clsx(`
|
|
53
|
-
w-full
|
|
54
|
-
bg-black text-white hover:bg-gray-800
|
|
55
|
-
flex items-center justify-center
|
|
56
|
-
px-6 py-2
|
|
57
|
-
rounded-lg
|
|
58
|
-
font-medium
|
|
59
|
-
transition duration-150 ease-in-out
|
|
60
|
-
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black
|
|
61
|
-
`, className),
|
|
62
|
-
children: [
|
|
63
|
-
/* @__PURE__ */ jsx(
|
|
64
|
-
"svg",
|
|
65
|
-
{
|
|
66
|
-
className: "w-5 h-5 mr-3",
|
|
67
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
68
|
-
viewBox: "0 0 24 24",
|
|
69
|
-
fill: "white",
|
|
70
|
-
children: /* @__PURE__ */ jsx("path", { d: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.539 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701" })
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
/* @__PURE__ */ jsx("span", { children: "Continue with Apple" })
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
const EmailOrPhoneInput = ({
|
|
79
|
-
id,
|
|
80
|
-
className,
|
|
81
|
-
placeholder
|
|
82
|
-
}) => {
|
|
83
|
-
const { register, formState } = useFormContext();
|
|
84
|
-
const error = formState.errors.email_or_phone;
|
|
85
|
-
let errorMessage;
|
|
86
|
-
if (typeof error === "string") {
|
|
87
|
-
errorMessage = error;
|
|
88
|
-
} else if (error && typeof error.message === "string") {
|
|
89
|
-
errorMessage = error.message;
|
|
90
|
-
}
|
|
91
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
-
/* @__PURE__ */ jsx(
|
|
93
|
-
"input",
|
|
94
|
-
{
|
|
95
|
-
id,
|
|
96
|
-
type: "text",
|
|
97
|
-
required: true,
|
|
98
|
-
autoComplete: "on",
|
|
99
|
-
className,
|
|
100
|
-
placeholder,
|
|
101
|
-
...register("email_or_phone")
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
errorMessage ? /* @__PURE__ */ jsx("p", { className: "mt-1 -mb-2 text-sm/6 text-red-500", children: errorMessage }) : null
|
|
105
|
-
] });
|
|
106
|
-
};
|
|
107
|
-
function $constructor(name, initializer2, params) {
|
|
108
|
-
function init(inst, def) {
|
|
109
|
-
var _a;
|
|
110
|
-
Object.defineProperty(inst, "_zod", {
|
|
111
|
-
value: inst._zod ?? {},
|
|
112
|
-
enumerable: false
|
|
113
|
-
});
|
|
114
|
-
(_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
|
|
115
|
-
inst._zod.traits.add(name);
|
|
116
|
-
initializer2(inst, def);
|
|
117
|
-
for (const k in _.prototype) {
|
|
118
|
-
if (!(k in inst))
|
|
119
|
-
Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
|
|
120
|
-
}
|
|
121
|
-
inst._zod.constr = _;
|
|
122
|
-
inst._zod.def = def;
|
|
123
|
-
}
|
|
124
|
-
const Parent = params?.Parent ?? Object;
|
|
125
|
-
class Definition extends Parent {
|
|
126
|
-
}
|
|
127
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
128
|
-
function _(def) {
|
|
129
|
-
var _a;
|
|
130
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
131
|
-
init(inst, def);
|
|
132
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
133
|
-
for (const fn of inst._zod.deferred) {
|
|
134
|
-
fn();
|
|
135
|
-
}
|
|
136
|
-
return inst;
|
|
137
|
-
}
|
|
138
|
-
Object.defineProperty(_, "init", { value: init });
|
|
139
|
-
Object.defineProperty(_, Symbol.hasInstance, {
|
|
140
|
-
value: (inst) => {
|
|
141
|
-
if (params?.Parent && inst instanceof params.Parent)
|
|
142
|
-
return true;
|
|
143
|
-
return inst?._zod?.traits?.has(name);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(_, "name", { value: name });
|
|
147
|
-
return _;
|
|
148
|
-
}
|
|
149
|
-
class $ZodAsyncError extends Error {
|
|
150
|
-
constructor() {
|
|
151
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
class $ZodEncodeError extends Error {
|
|
155
|
-
constructor(name) {
|
|
156
|
-
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
157
|
-
this.name = "ZodEncodeError";
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
const globalConfig = {};
|
|
161
|
-
function config(newConfig) {
|
|
162
|
-
return globalConfig;
|
|
163
|
-
}
|
|
164
|
-
function getEnumValues(entries) {
|
|
165
|
-
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
166
|
-
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
167
|
-
return values;
|
|
168
|
-
}
|
|
169
|
-
function jsonStringifyReplacer(_, value) {
|
|
170
|
-
if (typeof value === "bigint")
|
|
171
|
-
return value.toString();
|
|
172
|
-
return value;
|
|
173
|
-
}
|
|
174
|
-
function cached(getter) {
|
|
175
|
-
return {
|
|
176
|
-
get value() {
|
|
177
|
-
{
|
|
178
|
-
const value = getter();
|
|
179
|
-
Object.defineProperty(this, "value", { value });
|
|
180
|
-
return value;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function nullish(input) {
|
|
186
|
-
return input === null || input === void 0;
|
|
187
|
-
}
|
|
188
|
-
function cleanRegex(source) {
|
|
189
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
190
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
191
|
-
return source.slice(start, end);
|
|
192
|
-
}
|
|
193
|
-
const EVALUATING = Symbol("evaluating");
|
|
194
|
-
function defineLazy(object2, key, getter) {
|
|
195
|
-
let value = void 0;
|
|
196
|
-
Object.defineProperty(object2, key, {
|
|
197
|
-
get() {
|
|
198
|
-
if (value === EVALUATING) {
|
|
199
|
-
return void 0;
|
|
200
|
-
}
|
|
201
|
-
if (value === void 0) {
|
|
202
|
-
value = EVALUATING;
|
|
203
|
-
value = getter();
|
|
204
|
-
}
|
|
205
|
-
return value;
|
|
206
|
-
},
|
|
207
|
-
set(v) {
|
|
208
|
-
Object.defineProperty(object2, key, {
|
|
209
|
-
value: v
|
|
210
|
-
// configurable: true,
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
configurable: true
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function assignProp(target, prop, value) {
|
|
217
|
-
Object.defineProperty(target, prop, {
|
|
218
|
-
value,
|
|
219
|
-
writable: true,
|
|
220
|
-
enumerable: true,
|
|
221
|
-
configurable: true
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
function mergeDefs(...defs) {
|
|
225
|
-
const mergedDescriptors = {};
|
|
226
|
-
for (const def of defs) {
|
|
227
|
-
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
228
|
-
Object.assign(mergedDescriptors, descriptors);
|
|
229
|
-
}
|
|
230
|
-
return Object.defineProperties({}, mergedDescriptors);
|
|
231
|
-
}
|
|
232
|
-
function esc(str) {
|
|
233
|
-
return JSON.stringify(str);
|
|
234
|
-
}
|
|
235
|
-
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
236
|
-
};
|
|
237
|
-
function isObject$1(data) {
|
|
238
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
239
|
-
}
|
|
240
|
-
const allowsEval = cached(() => {
|
|
241
|
-
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
242
|
-
return false;
|
|
243
|
-
}
|
|
244
|
-
try {
|
|
245
|
-
const F = Function;
|
|
246
|
-
new F("");
|
|
247
|
-
return true;
|
|
248
|
-
} catch (_) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
function isPlainObject(o) {
|
|
253
|
-
if (isObject$1(o) === false)
|
|
254
|
-
return false;
|
|
255
|
-
const ctor = o.constructor;
|
|
256
|
-
if (ctor === void 0)
|
|
257
|
-
return true;
|
|
258
|
-
const prot = ctor.prototype;
|
|
259
|
-
if (isObject$1(prot) === false)
|
|
260
|
-
return false;
|
|
261
|
-
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
function shallowClone(o) {
|
|
267
|
-
if (isPlainObject(o))
|
|
268
|
-
return { ...o };
|
|
269
|
-
if (Array.isArray(o))
|
|
270
|
-
return [...o];
|
|
271
|
-
return o;
|
|
272
|
-
}
|
|
273
|
-
const propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
274
|
-
function escapeRegex(str) {
|
|
275
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
276
|
-
}
|
|
277
|
-
function clone(inst, def, params) {
|
|
278
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
279
|
-
if (!def || params?.parent)
|
|
280
|
-
cl._zod.parent = inst;
|
|
281
|
-
return cl;
|
|
282
|
-
}
|
|
283
|
-
function normalizeParams(_params) {
|
|
284
|
-
const params = _params;
|
|
285
|
-
if (!params)
|
|
286
|
-
return {};
|
|
287
|
-
if (typeof params === "string")
|
|
288
|
-
return { error: () => params };
|
|
289
|
-
if (params?.message !== void 0) {
|
|
290
|
-
if (params?.error !== void 0)
|
|
291
|
-
throw new Error("Cannot specify both `message` and `error` params");
|
|
292
|
-
params.error = params.message;
|
|
293
|
-
}
|
|
294
|
-
delete params.message;
|
|
295
|
-
if (typeof params.error === "string")
|
|
296
|
-
return { ...params, error: () => params.error };
|
|
297
|
-
return params;
|
|
298
|
-
}
|
|
299
|
-
function optionalKeys(shape) {
|
|
300
|
-
return Object.keys(shape).filter((k) => {
|
|
301
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
function pick(schema, mask) {
|
|
305
|
-
const currDef = schema._zod.def;
|
|
306
|
-
const def = mergeDefs(schema._zod.def, {
|
|
307
|
-
get shape() {
|
|
308
|
-
const newShape = {};
|
|
309
|
-
for (const key in mask) {
|
|
310
|
-
if (!(key in currDef.shape)) {
|
|
311
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
312
|
-
}
|
|
313
|
-
if (!mask[key])
|
|
314
|
-
continue;
|
|
315
|
-
newShape[key] = currDef.shape[key];
|
|
316
|
-
}
|
|
317
|
-
assignProp(this, "shape", newShape);
|
|
318
|
-
return newShape;
|
|
319
|
-
},
|
|
320
|
-
checks: []
|
|
321
|
-
});
|
|
322
|
-
return clone(schema, def);
|
|
323
|
-
}
|
|
324
|
-
function omit(schema, mask) {
|
|
325
|
-
const currDef = schema._zod.def;
|
|
326
|
-
const def = mergeDefs(schema._zod.def, {
|
|
327
|
-
get shape() {
|
|
328
|
-
const newShape = { ...schema._zod.def.shape };
|
|
329
|
-
for (const key in mask) {
|
|
330
|
-
if (!(key in currDef.shape)) {
|
|
331
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
332
|
-
}
|
|
333
|
-
if (!mask[key])
|
|
334
|
-
continue;
|
|
335
|
-
delete newShape[key];
|
|
336
|
-
}
|
|
337
|
-
assignProp(this, "shape", newShape);
|
|
338
|
-
return newShape;
|
|
339
|
-
},
|
|
340
|
-
checks: []
|
|
341
|
-
});
|
|
342
|
-
return clone(schema, def);
|
|
343
|
-
}
|
|
344
|
-
function extend(schema, shape) {
|
|
345
|
-
if (!isPlainObject(shape)) {
|
|
346
|
-
throw new Error("Invalid input to extend: expected a plain object");
|
|
347
|
-
}
|
|
348
|
-
const checks = schema._zod.def.checks;
|
|
349
|
-
const hasChecks = checks && checks.length > 0;
|
|
350
|
-
if (hasChecks) {
|
|
351
|
-
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
352
|
-
}
|
|
353
|
-
const def = mergeDefs(schema._zod.def, {
|
|
354
|
-
get shape() {
|
|
355
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
356
|
-
assignProp(this, "shape", _shape);
|
|
357
|
-
return _shape;
|
|
358
|
-
},
|
|
359
|
-
checks: []
|
|
360
|
-
});
|
|
361
|
-
return clone(schema, def);
|
|
362
|
-
}
|
|
363
|
-
function safeExtend(schema, shape) {
|
|
364
|
-
if (!isPlainObject(shape)) {
|
|
365
|
-
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
366
|
-
}
|
|
367
|
-
const def = {
|
|
368
|
-
...schema._zod.def,
|
|
369
|
-
get shape() {
|
|
370
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
371
|
-
assignProp(this, "shape", _shape);
|
|
372
|
-
return _shape;
|
|
373
|
-
},
|
|
374
|
-
checks: schema._zod.def.checks
|
|
375
|
-
};
|
|
376
|
-
return clone(schema, def);
|
|
377
|
-
}
|
|
378
|
-
function merge$1(a, b) {
|
|
379
|
-
const def = mergeDefs(a._zod.def, {
|
|
380
|
-
get shape() {
|
|
381
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
382
|
-
assignProp(this, "shape", _shape);
|
|
383
|
-
return _shape;
|
|
384
|
-
},
|
|
385
|
-
get catchall() {
|
|
386
|
-
return b._zod.def.catchall;
|
|
387
|
-
},
|
|
388
|
-
checks: []
|
|
389
|
-
// delete existing checks
|
|
390
|
-
});
|
|
391
|
-
return clone(a, def);
|
|
392
|
-
}
|
|
393
|
-
function partial(Class, schema, mask) {
|
|
394
|
-
const def = mergeDefs(schema._zod.def, {
|
|
395
|
-
get shape() {
|
|
396
|
-
const oldShape = schema._zod.def.shape;
|
|
397
|
-
const shape = { ...oldShape };
|
|
398
|
-
if (mask) {
|
|
399
|
-
for (const key in mask) {
|
|
400
|
-
if (!(key in oldShape)) {
|
|
401
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
402
|
-
}
|
|
403
|
-
if (!mask[key])
|
|
404
|
-
continue;
|
|
405
|
-
shape[key] = Class ? new Class({
|
|
406
|
-
type: "optional",
|
|
407
|
-
innerType: oldShape[key]
|
|
408
|
-
}) : oldShape[key];
|
|
409
|
-
}
|
|
410
|
-
} else {
|
|
411
|
-
for (const key in oldShape) {
|
|
412
|
-
shape[key] = Class ? new Class({
|
|
413
|
-
type: "optional",
|
|
414
|
-
innerType: oldShape[key]
|
|
415
|
-
}) : oldShape[key];
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
assignProp(this, "shape", shape);
|
|
419
|
-
return shape;
|
|
420
|
-
},
|
|
421
|
-
checks: []
|
|
422
|
-
});
|
|
423
|
-
return clone(schema, def);
|
|
424
|
-
}
|
|
425
|
-
function required(Class, schema, mask) {
|
|
426
|
-
const def = mergeDefs(schema._zod.def, {
|
|
427
|
-
get shape() {
|
|
428
|
-
const oldShape = schema._zod.def.shape;
|
|
429
|
-
const shape = { ...oldShape };
|
|
430
|
-
if (mask) {
|
|
431
|
-
for (const key in mask) {
|
|
432
|
-
if (!(key in shape)) {
|
|
433
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
434
|
-
}
|
|
435
|
-
if (!mask[key])
|
|
436
|
-
continue;
|
|
437
|
-
shape[key] = new Class({
|
|
438
|
-
type: "nonoptional",
|
|
439
|
-
innerType: oldShape[key]
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
} else {
|
|
443
|
-
for (const key in oldShape) {
|
|
444
|
-
shape[key] = new Class({
|
|
445
|
-
type: "nonoptional",
|
|
446
|
-
innerType: oldShape[key]
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
assignProp(this, "shape", shape);
|
|
451
|
-
return shape;
|
|
452
|
-
},
|
|
453
|
-
checks: []
|
|
454
|
-
});
|
|
455
|
-
return clone(schema, def);
|
|
456
|
-
}
|
|
457
|
-
function aborted(x, startIndex = 0) {
|
|
458
|
-
if (x.aborted === true)
|
|
459
|
-
return true;
|
|
460
|
-
for (let i = startIndex; i < x.issues.length; i++) {
|
|
461
|
-
if (x.issues[i]?.continue !== true) {
|
|
462
|
-
return true;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
return false;
|
|
466
|
-
}
|
|
467
|
-
function prefixIssues(path, issues) {
|
|
468
|
-
return issues.map((iss) => {
|
|
469
|
-
var _a;
|
|
470
|
-
(_a = iss).path ?? (_a.path = []);
|
|
471
|
-
iss.path.unshift(path);
|
|
472
|
-
return iss;
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
function unwrapMessage(message) {
|
|
476
|
-
return typeof message === "string" ? message : message?.message;
|
|
477
|
-
}
|
|
478
|
-
function finalizeIssue(iss, ctx, config2) {
|
|
479
|
-
const full = { ...iss, path: iss.path ?? [] };
|
|
480
|
-
if (!iss.message) {
|
|
481
|
-
const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
482
|
-
full.message = message;
|
|
483
|
-
}
|
|
484
|
-
delete full.inst;
|
|
485
|
-
delete full.continue;
|
|
486
|
-
if (!ctx?.reportInput) {
|
|
487
|
-
delete full.input;
|
|
488
|
-
}
|
|
489
|
-
return full;
|
|
490
|
-
}
|
|
491
|
-
function getLengthableOrigin(input) {
|
|
492
|
-
if (Array.isArray(input))
|
|
493
|
-
return "array";
|
|
494
|
-
if (typeof input === "string")
|
|
495
|
-
return "string";
|
|
496
|
-
return "unknown";
|
|
497
|
-
}
|
|
498
|
-
function issue(...args) {
|
|
499
|
-
const [iss, input, inst] = args;
|
|
500
|
-
if (typeof iss === "string") {
|
|
501
|
-
return {
|
|
502
|
-
message: iss,
|
|
503
|
-
code: "custom",
|
|
504
|
-
input,
|
|
505
|
-
inst
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
return { ...iss };
|
|
509
|
-
}
|
|
510
|
-
const initializer$1 = (inst, def) => {
|
|
511
|
-
inst.name = "$ZodError";
|
|
512
|
-
Object.defineProperty(inst, "_zod", {
|
|
513
|
-
value: inst._zod,
|
|
514
|
-
enumerable: false
|
|
515
|
-
});
|
|
516
|
-
Object.defineProperty(inst, "issues", {
|
|
517
|
-
value: def,
|
|
518
|
-
enumerable: false
|
|
519
|
-
});
|
|
520
|
-
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
521
|
-
Object.defineProperty(inst, "toString", {
|
|
522
|
-
value: () => inst.message,
|
|
523
|
-
enumerable: false
|
|
524
|
-
});
|
|
525
|
-
};
|
|
526
|
-
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
527
|
-
const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
|
|
528
|
-
function flattenError(error, mapper = (issue2) => issue2.message) {
|
|
529
|
-
const fieldErrors = {};
|
|
530
|
-
const formErrors = [];
|
|
531
|
-
for (const sub of error.issues) {
|
|
532
|
-
if (sub.path.length > 0) {
|
|
533
|
-
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
534
|
-
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
535
|
-
} else {
|
|
536
|
-
formErrors.push(mapper(sub));
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
return { formErrors, fieldErrors };
|
|
540
|
-
}
|
|
541
|
-
function formatError(error, mapper = (issue2) => issue2.message) {
|
|
542
|
-
const fieldErrors = { _errors: [] };
|
|
543
|
-
const processError = (error2) => {
|
|
544
|
-
for (const issue2 of error2.issues) {
|
|
545
|
-
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
546
|
-
issue2.errors.map((issues) => processError({ issues }));
|
|
547
|
-
} else if (issue2.code === "invalid_key") {
|
|
548
|
-
processError({ issues: issue2.issues });
|
|
549
|
-
} else if (issue2.code === "invalid_element") {
|
|
550
|
-
processError({ issues: issue2.issues });
|
|
551
|
-
} else if (issue2.path.length === 0) {
|
|
552
|
-
fieldErrors._errors.push(mapper(issue2));
|
|
553
|
-
} else {
|
|
554
|
-
let curr = fieldErrors;
|
|
555
|
-
let i = 0;
|
|
556
|
-
while (i < issue2.path.length) {
|
|
557
|
-
const el = issue2.path[i];
|
|
558
|
-
const terminal = i === issue2.path.length - 1;
|
|
559
|
-
if (!terminal) {
|
|
560
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
561
|
-
} else {
|
|
562
|
-
curr[el] = curr[el] || { _errors: [] };
|
|
563
|
-
curr[el]._errors.push(mapper(issue2));
|
|
564
|
-
}
|
|
565
|
-
curr = curr[el];
|
|
566
|
-
i++;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
processError(error);
|
|
572
|
-
return fieldErrors;
|
|
573
|
-
}
|
|
574
|
-
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
575
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
576
|
-
const result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
577
|
-
if (result2 instanceof Promise) {
|
|
578
|
-
throw new $ZodAsyncError();
|
|
579
|
-
}
|
|
580
|
-
if (result2.issues.length) {
|
|
581
|
-
const e = new (_params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
582
|
-
captureStackTrace(e, _params?.callee);
|
|
583
|
-
throw e;
|
|
584
|
-
}
|
|
585
|
-
return result2.value;
|
|
586
|
-
};
|
|
587
|
-
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
588
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
589
|
-
let result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
590
|
-
if (result2 instanceof Promise)
|
|
591
|
-
result2 = await result2;
|
|
592
|
-
if (result2.issues.length) {
|
|
593
|
-
const e = new (params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
594
|
-
captureStackTrace(e, params?.callee);
|
|
595
|
-
throw e;
|
|
596
|
-
}
|
|
597
|
-
return result2.value;
|
|
598
|
-
};
|
|
599
|
-
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
600
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
601
|
-
const result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
602
|
-
if (result2 instanceof Promise) {
|
|
603
|
-
throw new $ZodAsyncError();
|
|
604
|
-
}
|
|
605
|
-
return result2.issues.length ? {
|
|
606
|
-
success: false,
|
|
607
|
-
error: new (_Err ?? $ZodError)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
608
|
-
} : { success: true, data: result2.value };
|
|
609
|
-
};
|
|
610
|
-
const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
611
|
-
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
612
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
613
|
-
let result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
614
|
-
if (result2 instanceof Promise)
|
|
615
|
-
result2 = await result2;
|
|
616
|
-
return result2.issues.length ? {
|
|
617
|
-
success: false,
|
|
618
|
-
error: new _Err(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
619
|
-
} : { success: true, data: result2.value };
|
|
620
|
-
};
|
|
621
|
-
const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
622
|
-
const _encode = (_Err) => (schema, value, _ctx) => {
|
|
623
|
-
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
624
|
-
return _parse(_Err)(schema, value, ctx);
|
|
625
|
-
};
|
|
626
|
-
const _decode = (_Err) => (schema, value, _ctx) => {
|
|
627
|
-
return _parse(_Err)(schema, value, _ctx);
|
|
628
|
-
};
|
|
629
|
-
const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
630
|
-
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
631
|
-
return _parseAsync(_Err)(schema, value, ctx);
|
|
632
|
-
};
|
|
633
|
-
const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
634
|
-
return _parseAsync(_Err)(schema, value, _ctx);
|
|
635
|
-
};
|
|
636
|
-
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
637
|
-
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
638
|
-
return _safeParse(_Err)(schema, value, ctx);
|
|
639
|
-
};
|
|
640
|
-
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
641
|
-
return _safeParse(_Err)(schema, value, _ctx);
|
|
642
|
-
};
|
|
643
|
-
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
644
|
-
const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
|
|
645
|
-
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
646
|
-
};
|
|
647
|
-
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
648
|
-
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
649
|
-
};
|
|
650
|
-
const cuid = /^[cC][^\s-]{8,}$/;
|
|
651
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
652
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
653
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
654
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
655
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
656
|
-
const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
657
|
-
const guid = /^([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})$/;
|
|
658
|
-
const uuid = (version2) => {
|
|
659
|
-
if (!version2)
|
|
660
|
-
return /^([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)$/;
|
|
661
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
662
|
-
};
|
|
663
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
664
|
-
const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
665
|
-
function emoji() {
|
|
666
|
-
return new RegExp(_emoji$1, "u");
|
|
667
|
-
}
|
|
668
|
-
const ipv4 = /^(?:(?: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])$/;
|
|
669
|
-
const ipv6 = /^(([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}|:))$/;
|
|
670
|
-
const cidrv4 = /^((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])$/;
|
|
671
|
-
const cidrv6 = /^(([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])$/;
|
|
672
|
-
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
673
|
-
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
674
|
-
const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
675
|
-
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
676
|
-
const dateSource = `(?:(?:\\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])))`;
|
|
677
|
-
const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
678
|
-
function timeSource(args) {
|
|
679
|
-
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
680
|
-
const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
681
|
-
return regex;
|
|
682
|
-
}
|
|
683
|
-
function time$1(args) {
|
|
684
|
-
return new RegExp(`^${timeSource(args)}$`);
|
|
685
|
-
}
|
|
686
|
-
function datetime$1(args) {
|
|
687
|
-
const time2 = timeSource({ precision: args.precision });
|
|
688
|
-
const opts = ["Z"];
|
|
689
|
-
if (args.local)
|
|
690
|
-
opts.push("");
|
|
691
|
-
if (args.offset)
|
|
692
|
-
opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
693
|
-
const timeRegex = `${time2}(?:${opts.join("|")})`;
|
|
694
|
-
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
695
|
-
}
|
|
696
|
-
const string$1 = (params) => {
|
|
697
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
698
|
-
return new RegExp(`^${regex}$`);
|
|
699
|
-
};
|
|
700
|
-
const boolean$1 = /^(?:true|false)$/i;
|
|
701
|
-
const lowercase = /^[^A-Z]*$/;
|
|
702
|
-
const uppercase = /^[^a-z]*$/;
|
|
703
|
-
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
704
|
-
var _a;
|
|
705
|
-
inst._zod ?? (inst._zod = {});
|
|
706
|
-
inst._zod.def = def;
|
|
707
|
-
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
708
|
-
});
|
|
709
|
-
const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
710
|
-
var _a;
|
|
711
|
-
$ZodCheck.init(inst, def);
|
|
712
|
-
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
713
|
-
const val = payload.value;
|
|
714
|
-
return !nullish(val) && val.length !== void 0;
|
|
715
|
-
});
|
|
716
|
-
inst._zod.onattach.push((inst2) => {
|
|
717
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
718
|
-
if (def.maximum < curr)
|
|
719
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
720
|
-
});
|
|
721
|
-
inst._zod.check = (payload) => {
|
|
722
|
-
const input = payload.value;
|
|
723
|
-
const length = input.length;
|
|
724
|
-
if (length <= def.maximum)
|
|
725
|
-
return;
|
|
726
|
-
const origin = getLengthableOrigin(input);
|
|
727
|
-
payload.issues.push({
|
|
728
|
-
origin,
|
|
729
|
-
code: "too_big",
|
|
730
|
-
maximum: def.maximum,
|
|
731
|
-
inclusive: true,
|
|
732
|
-
input,
|
|
733
|
-
inst,
|
|
734
|
-
continue: !def.abort
|
|
735
|
-
});
|
|
736
|
-
};
|
|
737
|
-
});
|
|
738
|
-
const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
739
|
-
var _a;
|
|
740
|
-
$ZodCheck.init(inst, def);
|
|
741
|
-
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
742
|
-
const val = payload.value;
|
|
743
|
-
return !nullish(val) && val.length !== void 0;
|
|
744
|
-
});
|
|
745
|
-
inst._zod.onattach.push((inst2) => {
|
|
746
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
747
|
-
if (def.minimum > curr)
|
|
748
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
749
|
-
});
|
|
750
|
-
inst._zod.check = (payload) => {
|
|
751
|
-
const input = payload.value;
|
|
752
|
-
const length = input.length;
|
|
753
|
-
if (length >= def.minimum)
|
|
754
|
-
return;
|
|
755
|
-
const origin = getLengthableOrigin(input);
|
|
756
|
-
payload.issues.push({
|
|
757
|
-
origin,
|
|
758
|
-
code: "too_small",
|
|
759
|
-
minimum: def.minimum,
|
|
760
|
-
inclusive: true,
|
|
761
|
-
input,
|
|
762
|
-
inst,
|
|
763
|
-
continue: !def.abort
|
|
764
|
-
});
|
|
765
|
-
};
|
|
766
|
-
});
|
|
767
|
-
const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
768
|
-
var _a;
|
|
769
|
-
$ZodCheck.init(inst, def);
|
|
770
|
-
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
771
|
-
const val = payload.value;
|
|
772
|
-
return !nullish(val) && val.length !== void 0;
|
|
773
|
-
});
|
|
774
|
-
inst._zod.onattach.push((inst2) => {
|
|
775
|
-
const bag = inst2._zod.bag;
|
|
776
|
-
bag.minimum = def.length;
|
|
777
|
-
bag.maximum = def.length;
|
|
778
|
-
bag.length = def.length;
|
|
779
|
-
});
|
|
780
|
-
inst._zod.check = (payload) => {
|
|
781
|
-
const input = payload.value;
|
|
782
|
-
const length = input.length;
|
|
783
|
-
if (length === def.length)
|
|
784
|
-
return;
|
|
785
|
-
const origin = getLengthableOrigin(input);
|
|
786
|
-
const tooBig = length > def.length;
|
|
787
|
-
payload.issues.push({
|
|
788
|
-
origin,
|
|
789
|
-
...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
|
|
790
|
-
inclusive: true,
|
|
791
|
-
exact: true,
|
|
792
|
-
input: payload.value,
|
|
793
|
-
inst,
|
|
794
|
-
continue: !def.abort
|
|
795
|
-
});
|
|
796
|
-
};
|
|
797
|
-
});
|
|
798
|
-
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
799
|
-
var _a, _b;
|
|
800
|
-
$ZodCheck.init(inst, def);
|
|
801
|
-
inst._zod.onattach.push((inst2) => {
|
|
802
|
-
const bag = inst2._zod.bag;
|
|
803
|
-
bag.format = def.format;
|
|
804
|
-
if (def.pattern) {
|
|
805
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
806
|
-
bag.patterns.add(def.pattern);
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
if (def.pattern)
|
|
810
|
-
(_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
811
|
-
def.pattern.lastIndex = 0;
|
|
812
|
-
if (def.pattern.test(payload.value))
|
|
813
|
-
return;
|
|
814
|
-
payload.issues.push({
|
|
815
|
-
origin: "string",
|
|
816
|
-
code: "invalid_format",
|
|
817
|
-
format: def.format,
|
|
818
|
-
input: payload.value,
|
|
819
|
-
...def.pattern ? { pattern: def.pattern.toString() } : {},
|
|
820
|
-
inst,
|
|
821
|
-
continue: !def.abort
|
|
822
|
-
});
|
|
823
|
-
});
|
|
824
|
-
else
|
|
825
|
-
(_b = inst._zod).check ?? (_b.check = () => {
|
|
826
|
-
});
|
|
827
|
-
});
|
|
828
|
-
const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
829
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
830
|
-
inst._zod.check = (payload) => {
|
|
831
|
-
def.pattern.lastIndex = 0;
|
|
832
|
-
if (def.pattern.test(payload.value))
|
|
833
|
-
return;
|
|
834
|
-
payload.issues.push({
|
|
835
|
-
origin: "string",
|
|
836
|
-
code: "invalid_format",
|
|
837
|
-
format: "regex",
|
|
838
|
-
input: payload.value,
|
|
839
|
-
pattern: def.pattern.toString(),
|
|
840
|
-
inst,
|
|
841
|
-
continue: !def.abort
|
|
842
|
-
});
|
|
843
|
-
};
|
|
844
|
-
});
|
|
845
|
-
const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
846
|
-
def.pattern ?? (def.pattern = lowercase);
|
|
847
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
848
|
-
});
|
|
849
|
-
const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
850
|
-
def.pattern ?? (def.pattern = uppercase);
|
|
851
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
852
|
-
});
|
|
853
|
-
const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
854
|
-
$ZodCheck.init(inst, def);
|
|
855
|
-
const escapedRegex = escapeRegex(def.includes);
|
|
856
|
-
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
857
|
-
def.pattern = pattern;
|
|
858
|
-
inst._zod.onattach.push((inst2) => {
|
|
859
|
-
const bag = inst2._zod.bag;
|
|
860
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
861
|
-
bag.patterns.add(pattern);
|
|
862
|
-
});
|
|
863
|
-
inst._zod.check = (payload) => {
|
|
864
|
-
if (payload.value.includes(def.includes, def.position))
|
|
865
|
-
return;
|
|
866
|
-
payload.issues.push({
|
|
867
|
-
origin: "string",
|
|
868
|
-
code: "invalid_format",
|
|
869
|
-
format: "includes",
|
|
870
|
-
includes: def.includes,
|
|
871
|
-
input: payload.value,
|
|
872
|
-
inst,
|
|
873
|
-
continue: !def.abort
|
|
874
|
-
});
|
|
875
|
-
};
|
|
876
|
-
});
|
|
877
|
-
const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
878
|
-
$ZodCheck.init(inst, def);
|
|
879
|
-
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
880
|
-
def.pattern ?? (def.pattern = pattern);
|
|
881
|
-
inst._zod.onattach.push((inst2) => {
|
|
882
|
-
const bag = inst2._zod.bag;
|
|
883
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
884
|
-
bag.patterns.add(pattern);
|
|
885
|
-
});
|
|
886
|
-
inst._zod.check = (payload) => {
|
|
887
|
-
if (payload.value.startsWith(def.prefix))
|
|
888
|
-
return;
|
|
889
|
-
payload.issues.push({
|
|
890
|
-
origin: "string",
|
|
891
|
-
code: "invalid_format",
|
|
892
|
-
format: "starts_with",
|
|
893
|
-
prefix: def.prefix,
|
|
894
|
-
input: payload.value,
|
|
895
|
-
inst,
|
|
896
|
-
continue: !def.abort
|
|
897
|
-
});
|
|
898
|
-
};
|
|
899
|
-
});
|
|
900
|
-
const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
901
|
-
$ZodCheck.init(inst, def);
|
|
902
|
-
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
903
|
-
def.pattern ?? (def.pattern = pattern);
|
|
904
|
-
inst._zod.onattach.push((inst2) => {
|
|
905
|
-
const bag = inst2._zod.bag;
|
|
906
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
907
|
-
bag.patterns.add(pattern);
|
|
908
|
-
});
|
|
909
|
-
inst._zod.check = (payload) => {
|
|
910
|
-
if (payload.value.endsWith(def.suffix))
|
|
911
|
-
return;
|
|
912
|
-
payload.issues.push({
|
|
913
|
-
origin: "string",
|
|
914
|
-
code: "invalid_format",
|
|
915
|
-
format: "ends_with",
|
|
916
|
-
suffix: def.suffix,
|
|
917
|
-
input: payload.value,
|
|
918
|
-
inst,
|
|
919
|
-
continue: !def.abort
|
|
920
|
-
});
|
|
921
|
-
};
|
|
922
|
-
});
|
|
923
|
-
const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
924
|
-
$ZodCheck.init(inst, def);
|
|
925
|
-
inst._zod.check = (payload) => {
|
|
926
|
-
payload.value = def.tx(payload.value);
|
|
927
|
-
};
|
|
928
|
-
});
|
|
929
|
-
class Doc {
|
|
930
|
-
constructor(args = []) {
|
|
931
|
-
this.content = [];
|
|
932
|
-
this.indent = 0;
|
|
933
|
-
if (this)
|
|
934
|
-
this.args = args;
|
|
935
|
-
}
|
|
936
|
-
indented(fn) {
|
|
937
|
-
this.indent += 1;
|
|
938
|
-
fn(this);
|
|
939
|
-
this.indent -= 1;
|
|
940
|
-
}
|
|
941
|
-
write(arg) {
|
|
942
|
-
if (typeof arg === "function") {
|
|
943
|
-
arg(this, { execution: "sync" });
|
|
944
|
-
arg(this, { execution: "async" });
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
const content = arg;
|
|
948
|
-
const lines = content.split("\n").filter((x) => x);
|
|
949
|
-
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
950
|
-
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
951
|
-
for (const line of dedented) {
|
|
952
|
-
this.content.push(line);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
compile() {
|
|
956
|
-
const F = Function;
|
|
957
|
-
const args = this?.args;
|
|
958
|
-
const content = this?.content ?? [``];
|
|
959
|
-
const lines = [...content.map((x) => ` ${x}`)];
|
|
960
|
-
return new F(...args, lines.join("\n"));
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
const version = {
|
|
964
|
-
major: 4,
|
|
965
|
-
minor: 1,
|
|
966
|
-
patch: 12
|
|
967
|
-
};
|
|
968
|
-
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
969
|
-
var _a;
|
|
970
|
-
inst ?? (inst = {});
|
|
971
|
-
inst._zod.def = def;
|
|
972
|
-
inst._zod.bag = inst._zod.bag || {};
|
|
973
|
-
inst._zod.version = version;
|
|
974
|
-
const checks = [...inst._zod.def.checks ?? []];
|
|
975
|
-
if (inst._zod.traits.has("$ZodCheck")) {
|
|
976
|
-
checks.unshift(inst);
|
|
977
|
-
}
|
|
978
|
-
for (const ch of checks) {
|
|
979
|
-
for (const fn of ch._zod.onattach) {
|
|
980
|
-
fn(inst);
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
if (checks.length === 0) {
|
|
984
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
985
|
-
inst._zod.deferred?.push(() => {
|
|
986
|
-
inst._zod.run = inst._zod.parse;
|
|
987
|
-
});
|
|
988
|
-
} else {
|
|
989
|
-
const runChecks = (payload, checks2, ctx) => {
|
|
990
|
-
let isAborted = aborted(payload);
|
|
991
|
-
let asyncResult;
|
|
992
|
-
for (const ch of checks2) {
|
|
993
|
-
if (ch._zod.def.when) {
|
|
994
|
-
const shouldRun = ch._zod.def.when(payload);
|
|
995
|
-
if (!shouldRun)
|
|
996
|
-
continue;
|
|
997
|
-
} else if (isAborted) {
|
|
998
|
-
continue;
|
|
999
|
-
}
|
|
1000
|
-
const currLen = payload.issues.length;
|
|
1001
|
-
const _ = ch._zod.check(payload);
|
|
1002
|
-
if (_ instanceof Promise && ctx?.async === false) {
|
|
1003
|
-
throw new $ZodAsyncError();
|
|
1004
|
-
}
|
|
1005
|
-
if (asyncResult || _ instanceof Promise) {
|
|
1006
|
-
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
1007
|
-
await _;
|
|
1008
|
-
const nextLen = payload.issues.length;
|
|
1009
|
-
if (nextLen === currLen)
|
|
1010
|
-
return;
|
|
1011
|
-
if (!isAborted)
|
|
1012
|
-
isAborted = aborted(payload, currLen);
|
|
1013
|
-
});
|
|
1014
|
-
} else {
|
|
1015
|
-
const nextLen = payload.issues.length;
|
|
1016
|
-
if (nextLen === currLen)
|
|
1017
|
-
continue;
|
|
1018
|
-
if (!isAborted)
|
|
1019
|
-
isAborted = aborted(payload, currLen);
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
if (asyncResult) {
|
|
1023
|
-
return asyncResult.then(() => {
|
|
1024
|
-
return payload;
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
return payload;
|
|
1028
|
-
};
|
|
1029
|
-
const handleCanaryResult = (canary, payload, ctx) => {
|
|
1030
|
-
if (aborted(canary)) {
|
|
1031
|
-
canary.aborted = true;
|
|
1032
|
-
return canary;
|
|
1033
|
-
}
|
|
1034
|
-
const checkResult = runChecks(payload, checks, ctx);
|
|
1035
|
-
if (checkResult instanceof Promise) {
|
|
1036
|
-
if (ctx.async === false)
|
|
1037
|
-
throw new $ZodAsyncError();
|
|
1038
|
-
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
1039
|
-
}
|
|
1040
|
-
return inst._zod.parse(checkResult, ctx);
|
|
1041
|
-
};
|
|
1042
|
-
inst._zod.run = (payload, ctx) => {
|
|
1043
|
-
if (ctx.skipChecks) {
|
|
1044
|
-
return inst._zod.parse(payload, ctx);
|
|
1045
|
-
}
|
|
1046
|
-
if (ctx.direction === "backward") {
|
|
1047
|
-
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
1048
|
-
if (canary instanceof Promise) {
|
|
1049
|
-
return canary.then((canary2) => {
|
|
1050
|
-
return handleCanaryResult(canary2, payload, ctx);
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
1054
|
-
}
|
|
1055
|
-
const result2 = inst._zod.parse(payload, ctx);
|
|
1056
|
-
if (result2 instanceof Promise) {
|
|
1057
|
-
if (ctx.async === false)
|
|
1058
|
-
throw new $ZodAsyncError();
|
|
1059
|
-
return result2.then((result3) => runChecks(result3, checks, ctx));
|
|
1060
|
-
}
|
|
1061
|
-
return runChecks(result2, checks, ctx);
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
|
-
inst["~standard"] = {
|
|
1065
|
-
validate: (value) => {
|
|
1066
|
-
try {
|
|
1067
|
-
const r = safeParse$1(inst, value);
|
|
1068
|
-
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
1069
|
-
} catch (_) {
|
|
1070
|
-
return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
1071
|
-
}
|
|
1072
|
-
},
|
|
1073
|
-
vendor: "zod",
|
|
1074
|
-
version: 1
|
|
1075
|
-
};
|
|
1076
|
-
});
|
|
1077
|
-
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
1078
|
-
$ZodType.init(inst, def);
|
|
1079
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
1080
|
-
inst._zod.parse = (payload, _) => {
|
|
1081
|
-
if (def.coerce)
|
|
1082
|
-
try {
|
|
1083
|
-
payload.value = String(payload.value);
|
|
1084
|
-
} catch (_2) {
|
|
1085
|
-
}
|
|
1086
|
-
if (typeof payload.value === "string")
|
|
1087
|
-
return payload;
|
|
1088
|
-
payload.issues.push({
|
|
1089
|
-
expected: "string",
|
|
1090
|
-
code: "invalid_type",
|
|
1091
|
-
input: payload.value,
|
|
1092
|
-
inst
|
|
1093
|
-
});
|
|
1094
|
-
return payload;
|
|
1095
|
-
};
|
|
1096
|
-
});
|
|
1097
|
-
const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1098
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
1099
|
-
$ZodString.init(inst, def);
|
|
1100
|
-
});
|
|
1101
|
-
const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
|
|
1102
|
-
def.pattern ?? (def.pattern = guid);
|
|
1103
|
-
$ZodStringFormat.init(inst, def);
|
|
1104
|
-
});
|
|
1105
|
-
const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
1106
|
-
if (def.version) {
|
|
1107
|
-
const versionMap = {
|
|
1108
|
-
v1: 1,
|
|
1109
|
-
v2: 2,
|
|
1110
|
-
v3: 3,
|
|
1111
|
-
v4: 4,
|
|
1112
|
-
v5: 5,
|
|
1113
|
-
v6: 6,
|
|
1114
|
-
v7: 7,
|
|
1115
|
-
v8: 8
|
|
1116
|
-
};
|
|
1117
|
-
const v = versionMap[def.version];
|
|
1118
|
-
if (v === void 0)
|
|
1119
|
-
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1120
|
-
def.pattern ?? (def.pattern = uuid(v));
|
|
1121
|
-
} else
|
|
1122
|
-
def.pattern ?? (def.pattern = uuid());
|
|
1123
|
-
$ZodStringFormat.init(inst, def);
|
|
1124
|
-
});
|
|
1125
|
-
const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
1126
|
-
def.pattern ?? (def.pattern = email);
|
|
1127
|
-
$ZodStringFormat.init(inst, def);
|
|
1128
|
-
});
|
|
1129
|
-
const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
1130
|
-
$ZodStringFormat.init(inst, def);
|
|
1131
|
-
inst._zod.check = (payload) => {
|
|
1132
|
-
try {
|
|
1133
|
-
const trimmed = payload.value.trim();
|
|
1134
|
-
const url = new URL(trimmed);
|
|
1135
|
-
if (def.hostname) {
|
|
1136
|
-
def.hostname.lastIndex = 0;
|
|
1137
|
-
if (!def.hostname.test(url.hostname)) {
|
|
1138
|
-
payload.issues.push({
|
|
1139
|
-
code: "invalid_format",
|
|
1140
|
-
format: "url",
|
|
1141
|
-
note: "Invalid hostname",
|
|
1142
|
-
pattern: hostname.source,
|
|
1143
|
-
input: payload.value,
|
|
1144
|
-
inst,
|
|
1145
|
-
continue: !def.abort
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
if (def.protocol) {
|
|
1150
|
-
def.protocol.lastIndex = 0;
|
|
1151
|
-
if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
|
|
1152
|
-
payload.issues.push({
|
|
1153
|
-
code: "invalid_format",
|
|
1154
|
-
format: "url",
|
|
1155
|
-
note: "Invalid protocol",
|
|
1156
|
-
pattern: def.protocol.source,
|
|
1157
|
-
input: payload.value,
|
|
1158
|
-
inst,
|
|
1159
|
-
continue: !def.abort
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
if (def.normalize) {
|
|
1164
|
-
payload.value = url.href;
|
|
1165
|
-
} else {
|
|
1166
|
-
payload.value = trimmed;
|
|
1167
|
-
}
|
|
1168
|
-
return;
|
|
1169
|
-
} catch (_) {
|
|
1170
|
-
payload.issues.push({
|
|
1171
|
-
code: "invalid_format",
|
|
1172
|
-
format: "url",
|
|
1173
|
-
input: payload.value,
|
|
1174
|
-
inst,
|
|
1175
|
-
continue: !def.abort
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
1178
|
-
};
|
|
1179
|
-
});
|
|
1180
|
-
const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
|
|
1181
|
-
def.pattern ?? (def.pattern = emoji());
|
|
1182
|
-
$ZodStringFormat.init(inst, def);
|
|
1183
|
-
});
|
|
1184
|
-
const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
|
|
1185
|
-
def.pattern ?? (def.pattern = nanoid);
|
|
1186
|
-
$ZodStringFormat.init(inst, def);
|
|
1187
|
-
});
|
|
1188
|
-
const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
|
|
1189
|
-
def.pattern ?? (def.pattern = cuid);
|
|
1190
|
-
$ZodStringFormat.init(inst, def);
|
|
1191
|
-
});
|
|
1192
|
-
const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
|
|
1193
|
-
def.pattern ?? (def.pattern = cuid2);
|
|
1194
|
-
$ZodStringFormat.init(inst, def);
|
|
1195
|
-
});
|
|
1196
|
-
const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
|
|
1197
|
-
def.pattern ?? (def.pattern = ulid);
|
|
1198
|
-
$ZodStringFormat.init(inst, def);
|
|
1199
|
-
});
|
|
1200
|
-
const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
|
|
1201
|
-
def.pattern ?? (def.pattern = xid);
|
|
1202
|
-
$ZodStringFormat.init(inst, def);
|
|
1203
|
-
});
|
|
1204
|
-
const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
1205
|
-
def.pattern ?? (def.pattern = ksuid);
|
|
1206
|
-
$ZodStringFormat.init(inst, def);
|
|
1207
|
-
});
|
|
1208
|
-
const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1209
|
-
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1210
|
-
$ZodStringFormat.init(inst, def);
|
|
1211
|
-
});
|
|
1212
|
-
const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
1213
|
-
def.pattern ?? (def.pattern = date$1);
|
|
1214
|
-
$ZodStringFormat.init(inst, def);
|
|
1215
|
-
});
|
|
1216
|
-
const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
|
|
1217
|
-
def.pattern ?? (def.pattern = time$1(def));
|
|
1218
|
-
$ZodStringFormat.init(inst, def);
|
|
1219
|
-
});
|
|
1220
|
-
const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
|
|
1221
|
-
def.pattern ?? (def.pattern = duration$1);
|
|
1222
|
-
$ZodStringFormat.init(inst, def);
|
|
1223
|
-
});
|
|
1224
|
-
const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
1225
|
-
def.pattern ?? (def.pattern = ipv4);
|
|
1226
|
-
$ZodStringFormat.init(inst, def);
|
|
1227
|
-
inst._zod.onattach.push((inst2) => {
|
|
1228
|
-
const bag = inst2._zod.bag;
|
|
1229
|
-
bag.format = `ipv4`;
|
|
1230
|
-
});
|
|
1231
|
-
});
|
|
1232
|
-
const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
1233
|
-
def.pattern ?? (def.pattern = ipv6);
|
|
1234
|
-
$ZodStringFormat.init(inst, def);
|
|
1235
|
-
inst._zod.onattach.push((inst2) => {
|
|
1236
|
-
const bag = inst2._zod.bag;
|
|
1237
|
-
bag.format = `ipv6`;
|
|
1238
|
-
});
|
|
1239
|
-
inst._zod.check = (payload) => {
|
|
1240
|
-
try {
|
|
1241
|
-
new URL(`http://[${payload.value}]`);
|
|
1242
|
-
} catch {
|
|
1243
|
-
payload.issues.push({
|
|
1244
|
-
code: "invalid_format",
|
|
1245
|
-
format: "ipv6",
|
|
1246
|
-
input: payload.value,
|
|
1247
|
-
inst,
|
|
1248
|
-
continue: !def.abort
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
});
|
|
1253
|
-
const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1254
|
-
def.pattern ?? (def.pattern = cidrv4);
|
|
1255
|
-
$ZodStringFormat.init(inst, def);
|
|
1256
|
-
});
|
|
1257
|
-
const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1258
|
-
def.pattern ?? (def.pattern = cidrv6);
|
|
1259
|
-
$ZodStringFormat.init(inst, def);
|
|
1260
|
-
inst._zod.check = (payload) => {
|
|
1261
|
-
const parts = payload.value.split("/");
|
|
1262
|
-
try {
|
|
1263
|
-
if (parts.length !== 2)
|
|
1264
|
-
throw new Error();
|
|
1265
|
-
const [address, prefix] = parts;
|
|
1266
|
-
if (!prefix)
|
|
1267
|
-
throw new Error();
|
|
1268
|
-
const prefixNum = Number(prefix);
|
|
1269
|
-
if (`${prefixNum}` !== prefix)
|
|
1270
|
-
throw new Error();
|
|
1271
|
-
if (prefixNum < 0 || prefixNum > 128)
|
|
1272
|
-
throw new Error();
|
|
1273
|
-
new URL(`http://[${address}]`);
|
|
1274
|
-
} catch {
|
|
1275
|
-
payload.issues.push({
|
|
1276
|
-
code: "invalid_format",
|
|
1277
|
-
format: "cidrv6",
|
|
1278
|
-
input: payload.value,
|
|
1279
|
-
inst,
|
|
1280
|
-
continue: !def.abort
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
});
|
|
1285
|
-
function isValidBase64(data) {
|
|
1286
|
-
if (data === "")
|
|
1287
|
-
return true;
|
|
1288
|
-
if (data.length % 4 !== 0)
|
|
1289
|
-
return false;
|
|
1290
|
-
try {
|
|
1291
|
-
atob(data);
|
|
1292
|
-
return true;
|
|
1293
|
-
} catch {
|
|
1294
|
-
return false;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
1298
|
-
def.pattern ?? (def.pattern = base64);
|
|
1299
|
-
$ZodStringFormat.init(inst, def);
|
|
1300
|
-
inst._zod.onattach.push((inst2) => {
|
|
1301
|
-
inst2._zod.bag.contentEncoding = "base64";
|
|
1302
|
-
});
|
|
1303
|
-
inst._zod.check = (payload) => {
|
|
1304
|
-
if (isValidBase64(payload.value))
|
|
1305
|
-
return;
|
|
1306
|
-
payload.issues.push({
|
|
1307
|
-
code: "invalid_format",
|
|
1308
|
-
format: "base64",
|
|
1309
|
-
input: payload.value,
|
|
1310
|
-
inst,
|
|
1311
|
-
continue: !def.abort
|
|
1312
|
-
});
|
|
1313
|
-
};
|
|
1314
|
-
});
|
|
1315
|
-
function isValidBase64URL(data) {
|
|
1316
|
-
if (!base64url.test(data))
|
|
1317
|
-
return false;
|
|
1318
|
-
const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1319
|
-
const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
|
|
1320
|
-
return isValidBase64(padded);
|
|
1321
|
-
}
|
|
1322
|
-
const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1323
|
-
def.pattern ?? (def.pattern = base64url);
|
|
1324
|
-
$ZodStringFormat.init(inst, def);
|
|
1325
|
-
inst._zod.onattach.push((inst2) => {
|
|
1326
|
-
inst2._zod.bag.contentEncoding = "base64url";
|
|
1327
|
-
});
|
|
1328
|
-
inst._zod.check = (payload) => {
|
|
1329
|
-
if (isValidBase64URL(payload.value))
|
|
1330
|
-
return;
|
|
1331
|
-
payload.issues.push({
|
|
1332
|
-
code: "invalid_format",
|
|
1333
|
-
format: "base64url",
|
|
1334
|
-
input: payload.value,
|
|
1335
|
-
inst,
|
|
1336
|
-
continue: !def.abort
|
|
1337
|
-
});
|
|
1338
|
-
};
|
|
1339
|
-
});
|
|
1340
|
-
const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
|
|
1341
|
-
def.pattern ?? (def.pattern = e164);
|
|
1342
|
-
$ZodStringFormat.init(inst, def);
|
|
1343
|
-
});
|
|
1344
|
-
function isValidJWT(token, algorithm = null) {
|
|
1345
|
-
try {
|
|
1346
|
-
const tokensParts = token.split(".");
|
|
1347
|
-
if (tokensParts.length !== 3)
|
|
1348
|
-
return false;
|
|
1349
|
-
const [header] = tokensParts;
|
|
1350
|
-
if (!header)
|
|
1351
|
-
return false;
|
|
1352
|
-
const parsedHeader = JSON.parse(atob(header));
|
|
1353
|
-
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
1354
|
-
return false;
|
|
1355
|
-
if (!parsedHeader.alg)
|
|
1356
|
-
return false;
|
|
1357
|
-
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
|
|
1358
|
-
return false;
|
|
1359
|
-
return true;
|
|
1360
|
-
} catch {
|
|
1361
|
-
return false;
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
1365
|
-
$ZodStringFormat.init(inst, def);
|
|
1366
|
-
inst._zod.check = (payload) => {
|
|
1367
|
-
if (isValidJWT(payload.value, def.alg))
|
|
1368
|
-
return;
|
|
1369
|
-
payload.issues.push({
|
|
1370
|
-
code: "invalid_format",
|
|
1371
|
-
format: "jwt",
|
|
1372
|
-
input: payload.value,
|
|
1373
|
-
inst,
|
|
1374
|
-
continue: !def.abort
|
|
1375
|
-
});
|
|
1376
|
-
};
|
|
1377
|
-
});
|
|
1378
|
-
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
1379
|
-
$ZodType.init(inst, def);
|
|
1380
|
-
inst._zod.pattern = boolean$1;
|
|
1381
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1382
|
-
if (def.coerce)
|
|
1383
|
-
try {
|
|
1384
|
-
payload.value = Boolean(payload.value);
|
|
1385
|
-
} catch (_) {
|
|
1386
|
-
}
|
|
1387
|
-
const input = payload.value;
|
|
1388
|
-
if (typeof input === "boolean")
|
|
1389
|
-
return payload;
|
|
1390
|
-
payload.issues.push({
|
|
1391
|
-
expected: "boolean",
|
|
1392
|
-
code: "invalid_type",
|
|
1393
|
-
input,
|
|
1394
|
-
inst
|
|
1395
|
-
});
|
|
1396
|
-
return payload;
|
|
1397
|
-
};
|
|
1398
|
-
});
|
|
1399
|
-
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
1400
|
-
$ZodType.init(inst, def);
|
|
1401
|
-
inst._zod.parse = (payload) => payload;
|
|
1402
|
-
});
|
|
1403
|
-
const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
1404
|
-
$ZodType.init(inst, def);
|
|
1405
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1406
|
-
payload.issues.push({
|
|
1407
|
-
expected: "never",
|
|
1408
|
-
code: "invalid_type",
|
|
1409
|
-
input: payload.value,
|
|
1410
|
-
inst
|
|
1411
|
-
});
|
|
1412
|
-
return payload;
|
|
1413
|
-
};
|
|
1414
|
-
});
|
|
1415
|
-
function handleArrayResult(result2, final, index) {
|
|
1416
|
-
if (result2.issues.length) {
|
|
1417
|
-
final.issues.push(...prefixIssues(index, result2.issues));
|
|
1418
|
-
}
|
|
1419
|
-
final.value[index] = result2.value;
|
|
1420
|
-
}
|
|
1421
|
-
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1422
|
-
$ZodType.init(inst, def);
|
|
1423
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1424
|
-
const input = payload.value;
|
|
1425
|
-
if (!Array.isArray(input)) {
|
|
1426
|
-
payload.issues.push({
|
|
1427
|
-
expected: "array",
|
|
1428
|
-
code: "invalid_type",
|
|
1429
|
-
input,
|
|
1430
|
-
inst
|
|
1431
|
-
});
|
|
1432
|
-
return payload;
|
|
1433
|
-
}
|
|
1434
|
-
payload.value = Array(input.length);
|
|
1435
|
-
const proms = [];
|
|
1436
|
-
for (let i = 0; i < input.length; i++) {
|
|
1437
|
-
const item = input[i];
|
|
1438
|
-
const result2 = def.element._zod.run({
|
|
1439
|
-
value: item,
|
|
1440
|
-
issues: []
|
|
1441
|
-
}, ctx);
|
|
1442
|
-
if (result2 instanceof Promise) {
|
|
1443
|
-
proms.push(result2.then((result3) => handleArrayResult(result3, payload, i)));
|
|
1444
|
-
} else {
|
|
1445
|
-
handleArrayResult(result2, payload, i);
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
if (proms.length) {
|
|
1449
|
-
return Promise.all(proms).then(() => payload);
|
|
1450
|
-
}
|
|
1451
|
-
return payload;
|
|
1452
|
-
};
|
|
1453
|
-
});
|
|
1454
|
-
function handlePropertyResult(result2, final, key, input) {
|
|
1455
|
-
if (result2.issues.length) {
|
|
1456
|
-
final.issues.push(...prefixIssues(key, result2.issues));
|
|
1457
|
-
}
|
|
1458
|
-
if (result2.value === void 0) {
|
|
1459
|
-
if (key in input) {
|
|
1460
|
-
final.value[key] = void 0;
|
|
1461
|
-
}
|
|
1462
|
-
} else {
|
|
1463
|
-
final.value[key] = result2.value;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
function normalizeDef(def) {
|
|
1467
|
-
const keys = Object.keys(def.shape);
|
|
1468
|
-
for (const k of keys) {
|
|
1469
|
-
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1470
|
-
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
const okeys = optionalKeys(def.shape);
|
|
1474
|
-
return {
|
|
1475
|
-
...def,
|
|
1476
|
-
keys,
|
|
1477
|
-
keySet: new Set(keys),
|
|
1478
|
-
numKeys: keys.length,
|
|
1479
|
-
optionalKeys: new Set(okeys)
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1483
|
-
const unrecognized = [];
|
|
1484
|
-
const keySet = def.keySet;
|
|
1485
|
-
const _catchall = def.catchall._zod;
|
|
1486
|
-
const t = _catchall.def.type;
|
|
1487
|
-
for (const key of Object.keys(input)) {
|
|
1488
|
-
if (keySet.has(key))
|
|
1489
|
-
continue;
|
|
1490
|
-
if (t === "never") {
|
|
1491
|
-
unrecognized.push(key);
|
|
1492
|
-
continue;
|
|
1493
|
-
}
|
|
1494
|
-
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1495
|
-
if (r instanceof Promise) {
|
|
1496
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1497
|
-
} else {
|
|
1498
|
-
handlePropertyResult(r, payload, key, input);
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
if (unrecognized.length) {
|
|
1502
|
-
payload.issues.push({
|
|
1503
|
-
code: "unrecognized_keys",
|
|
1504
|
-
keys: unrecognized,
|
|
1505
|
-
input,
|
|
1506
|
-
inst
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
if (!proms.length)
|
|
1510
|
-
return payload;
|
|
1511
|
-
return Promise.all(proms).then(() => {
|
|
1512
|
-
return payload;
|
|
1513
|
-
});
|
|
1514
|
-
}
|
|
1515
|
-
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1516
|
-
$ZodType.init(inst, def);
|
|
1517
|
-
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1518
|
-
if (!desc?.get) {
|
|
1519
|
-
const sh = def.shape;
|
|
1520
|
-
Object.defineProperty(def, "shape", {
|
|
1521
|
-
get: () => {
|
|
1522
|
-
const newSh = { ...sh };
|
|
1523
|
-
Object.defineProperty(def, "shape", {
|
|
1524
|
-
value: newSh
|
|
1525
|
-
});
|
|
1526
|
-
return newSh;
|
|
1527
|
-
}
|
|
1528
|
-
});
|
|
1529
|
-
}
|
|
1530
|
-
const _normalized = cached(() => normalizeDef(def));
|
|
1531
|
-
defineLazy(inst._zod, "propValues", () => {
|
|
1532
|
-
const shape = def.shape;
|
|
1533
|
-
const propValues = {};
|
|
1534
|
-
for (const key in shape) {
|
|
1535
|
-
const field = shape[key]._zod;
|
|
1536
|
-
if (field.values) {
|
|
1537
|
-
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1538
|
-
for (const v of field.values)
|
|
1539
|
-
propValues[key].add(v);
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
return propValues;
|
|
1543
|
-
});
|
|
1544
|
-
const isObject2 = isObject$1;
|
|
1545
|
-
const catchall = def.catchall;
|
|
1546
|
-
let value;
|
|
1547
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1548
|
-
value ?? (value = _normalized.value);
|
|
1549
|
-
const input = payload.value;
|
|
1550
|
-
if (!isObject2(input)) {
|
|
1551
|
-
payload.issues.push({
|
|
1552
|
-
expected: "object",
|
|
1553
|
-
code: "invalid_type",
|
|
1554
|
-
input,
|
|
1555
|
-
inst
|
|
1556
|
-
});
|
|
1557
|
-
return payload;
|
|
1558
|
-
}
|
|
1559
|
-
payload.value = {};
|
|
1560
|
-
const proms = [];
|
|
1561
|
-
const shape = value.shape;
|
|
1562
|
-
for (const key of value.keys) {
|
|
1563
|
-
const el = shape[key];
|
|
1564
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1565
|
-
if (r instanceof Promise) {
|
|
1566
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1567
|
-
} else {
|
|
1568
|
-
handlePropertyResult(r, payload, key, input);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
if (!catchall) {
|
|
1572
|
-
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1573
|
-
}
|
|
1574
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1575
|
-
};
|
|
1576
|
-
});
|
|
1577
|
-
const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
1578
|
-
$ZodObject.init(inst, def);
|
|
1579
|
-
const superParse = inst._zod.parse;
|
|
1580
|
-
const _normalized = cached(() => normalizeDef(def));
|
|
1581
|
-
const generateFastpass = (shape) => {
|
|
1582
|
-
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
1583
|
-
const normalized = _normalized.value;
|
|
1584
|
-
const parseStr = (key) => {
|
|
1585
|
-
const k = esc(key);
|
|
1586
|
-
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1587
|
-
};
|
|
1588
|
-
doc.write(`const input = payload.value;`);
|
|
1589
|
-
const ids = /* @__PURE__ */ Object.create(null);
|
|
1590
|
-
let counter = 0;
|
|
1591
|
-
for (const key of normalized.keys) {
|
|
1592
|
-
ids[key] = `key_${counter++}`;
|
|
1593
|
-
}
|
|
1594
|
-
doc.write(`const newResult = {};`);
|
|
1595
|
-
for (const key of normalized.keys) {
|
|
1596
|
-
const id = ids[key];
|
|
1597
|
-
const k = esc(key);
|
|
1598
|
-
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1599
|
-
doc.write(`
|
|
1600
|
-
if (${id}.issues.length) {
|
|
1601
|
-
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1602
|
-
...iss,
|
|
1603
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1604
|
-
})));
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
if (${id}.value === undefined) {
|
|
1609
|
-
if (${k} in input) {
|
|
1610
|
-
newResult[${k}] = undefined;
|
|
1611
|
-
}
|
|
1612
|
-
} else {
|
|
1613
|
-
newResult[${k}] = ${id}.value;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
`);
|
|
1617
|
-
}
|
|
1618
|
-
doc.write(`payload.value = newResult;`);
|
|
1619
|
-
doc.write(`return payload;`);
|
|
1620
|
-
const fn = doc.compile();
|
|
1621
|
-
return (payload, ctx) => fn(shape, payload, ctx);
|
|
1622
|
-
};
|
|
1623
|
-
let fastpass;
|
|
1624
|
-
const isObject2 = isObject$1;
|
|
1625
|
-
const jit = !globalConfig.jitless;
|
|
1626
|
-
const allowsEval$1 = allowsEval;
|
|
1627
|
-
const fastEnabled = jit && allowsEval$1.value;
|
|
1628
|
-
const catchall = def.catchall;
|
|
1629
|
-
let value;
|
|
1630
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1631
|
-
value ?? (value = _normalized.value);
|
|
1632
|
-
const input = payload.value;
|
|
1633
|
-
if (!isObject2(input)) {
|
|
1634
|
-
payload.issues.push({
|
|
1635
|
-
expected: "object",
|
|
1636
|
-
code: "invalid_type",
|
|
1637
|
-
input,
|
|
1638
|
-
inst
|
|
1639
|
-
});
|
|
1640
|
-
return payload;
|
|
1641
|
-
}
|
|
1642
|
-
if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
|
|
1643
|
-
if (!fastpass)
|
|
1644
|
-
fastpass = generateFastpass(def.shape);
|
|
1645
|
-
payload = fastpass(payload, ctx);
|
|
1646
|
-
if (!catchall)
|
|
1647
|
-
return payload;
|
|
1648
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
1649
|
-
}
|
|
1650
|
-
return superParse(payload, ctx);
|
|
1651
|
-
};
|
|
1652
|
-
});
|
|
1653
|
-
function handleUnionResults(results, final, inst, ctx) {
|
|
1654
|
-
for (const result2 of results) {
|
|
1655
|
-
if (result2.issues.length === 0) {
|
|
1656
|
-
final.value = result2.value;
|
|
1657
|
-
return final;
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
const nonaborted = results.filter((r) => !aborted(r));
|
|
1661
|
-
if (nonaborted.length === 1) {
|
|
1662
|
-
final.value = nonaborted[0].value;
|
|
1663
|
-
return nonaborted[0];
|
|
1664
|
-
}
|
|
1665
|
-
final.issues.push({
|
|
1666
|
-
code: "invalid_union",
|
|
1667
|
-
input: final.value,
|
|
1668
|
-
inst,
|
|
1669
|
-
errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1670
|
-
});
|
|
1671
|
-
return final;
|
|
1672
|
-
}
|
|
1673
|
-
const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
1674
|
-
$ZodType.init(inst, def);
|
|
1675
|
-
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1676
|
-
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1677
|
-
defineLazy(inst._zod, "values", () => {
|
|
1678
|
-
if (def.options.every((o) => o._zod.values)) {
|
|
1679
|
-
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1680
|
-
}
|
|
1681
|
-
return void 0;
|
|
1682
|
-
});
|
|
1683
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1684
|
-
if (def.options.every((o) => o._zod.pattern)) {
|
|
1685
|
-
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1686
|
-
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
1687
|
-
}
|
|
1688
|
-
return void 0;
|
|
1689
|
-
});
|
|
1690
|
-
const single = def.options.length === 1;
|
|
1691
|
-
const first = def.options[0]._zod.run;
|
|
1692
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1693
|
-
if (single) {
|
|
1694
|
-
return first(payload, ctx);
|
|
1695
|
-
}
|
|
1696
|
-
let async = false;
|
|
1697
|
-
const results = [];
|
|
1698
|
-
for (const option of def.options) {
|
|
1699
|
-
const result2 = option._zod.run({
|
|
1700
|
-
value: payload.value,
|
|
1701
|
-
issues: []
|
|
1702
|
-
}, ctx);
|
|
1703
|
-
if (result2 instanceof Promise) {
|
|
1704
|
-
results.push(result2);
|
|
1705
|
-
async = true;
|
|
1706
|
-
} else {
|
|
1707
|
-
if (result2.issues.length === 0)
|
|
1708
|
-
return result2;
|
|
1709
|
-
results.push(result2);
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
if (!async)
|
|
1713
|
-
return handleUnionResults(results, payload, inst, ctx);
|
|
1714
|
-
return Promise.all(results).then((results2) => {
|
|
1715
|
-
return handleUnionResults(results2, payload, inst, ctx);
|
|
1716
|
-
});
|
|
1717
|
-
};
|
|
1718
|
-
});
|
|
1719
|
-
const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
1720
|
-
$ZodType.init(inst, def);
|
|
1721
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1722
|
-
const input = payload.value;
|
|
1723
|
-
const left = def.left._zod.run({ value: input, issues: [] }, ctx);
|
|
1724
|
-
const right = def.right._zod.run({ value: input, issues: [] }, ctx);
|
|
1725
|
-
const async = left instanceof Promise || right instanceof Promise;
|
|
1726
|
-
if (async) {
|
|
1727
|
-
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
1728
|
-
return handleIntersectionResults(payload, left2, right2);
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1731
|
-
return handleIntersectionResults(payload, left, right);
|
|
1732
|
-
};
|
|
1733
|
-
});
|
|
1734
|
-
function mergeValues(a, b) {
|
|
1735
|
-
if (a === b) {
|
|
1736
|
-
return { valid: true, data: a };
|
|
1737
|
-
}
|
|
1738
|
-
if (a instanceof Date && b instanceof Date && +a === +b) {
|
|
1739
|
-
return { valid: true, data: a };
|
|
1740
|
-
}
|
|
1741
|
-
if (isPlainObject(a) && isPlainObject(b)) {
|
|
1742
|
-
const bKeys = Object.keys(b);
|
|
1743
|
-
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
1744
|
-
const newObj = { ...a, ...b };
|
|
1745
|
-
for (const key of sharedKeys) {
|
|
1746
|
-
const sharedValue = mergeValues(a[key], b[key]);
|
|
1747
|
-
if (!sharedValue.valid) {
|
|
1748
|
-
return {
|
|
1749
|
-
valid: false,
|
|
1750
|
-
mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
|
|
1751
|
-
};
|
|
1752
|
-
}
|
|
1753
|
-
newObj[key] = sharedValue.data;
|
|
1754
|
-
}
|
|
1755
|
-
return { valid: true, data: newObj };
|
|
1756
|
-
}
|
|
1757
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
1758
|
-
if (a.length !== b.length) {
|
|
1759
|
-
return { valid: false, mergeErrorPath: [] };
|
|
1760
|
-
}
|
|
1761
|
-
const newArray = [];
|
|
1762
|
-
for (let index = 0; index < a.length; index++) {
|
|
1763
|
-
const itemA = a[index];
|
|
1764
|
-
const itemB = b[index];
|
|
1765
|
-
const sharedValue = mergeValues(itemA, itemB);
|
|
1766
|
-
if (!sharedValue.valid) {
|
|
1767
|
-
return {
|
|
1768
|
-
valid: false,
|
|
1769
|
-
mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
|
|
1770
|
-
};
|
|
1771
|
-
}
|
|
1772
|
-
newArray.push(sharedValue.data);
|
|
1773
|
-
}
|
|
1774
|
-
return { valid: true, data: newArray };
|
|
1775
|
-
}
|
|
1776
|
-
return { valid: false, mergeErrorPath: [] };
|
|
1777
|
-
}
|
|
1778
|
-
function handleIntersectionResults(result2, left, right) {
|
|
1779
|
-
if (left.issues.length) {
|
|
1780
|
-
result2.issues.push(...left.issues);
|
|
1781
|
-
}
|
|
1782
|
-
if (right.issues.length) {
|
|
1783
|
-
result2.issues.push(...right.issues);
|
|
1784
|
-
}
|
|
1785
|
-
if (aborted(result2))
|
|
1786
|
-
return result2;
|
|
1787
|
-
const merged = mergeValues(left.value, right.value);
|
|
1788
|
-
if (!merged.valid) {
|
|
1789
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
|
1790
|
-
}
|
|
1791
|
-
result2.value = merged.data;
|
|
1792
|
-
return result2;
|
|
1793
|
-
}
|
|
1794
|
-
const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
1795
|
-
$ZodType.init(inst, def);
|
|
1796
|
-
const values = getEnumValues(def.entries);
|
|
1797
|
-
const valuesSet = new Set(values);
|
|
1798
|
-
inst._zod.values = valuesSet;
|
|
1799
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
1800
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1801
|
-
const input = payload.value;
|
|
1802
|
-
if (valuesSet.has(input)) {
|
|
1803
|
-
return payload;
|
|
1804
|
-
}
|
|
1805
|
-
payload.issues.push({
|
|
1806
|
-
code: "invalid_value",
|
|
1807
|
-
values,
|
|
1808
|
-
input,
|
|
1809
|
-
inst
|
|
1810
|
-
});
|
|
1811
|
-
return payload;
|
|
1812
|
-
};
|
|
1813
|
-
});
|
|
1814
|
-
const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
|
|
1815
|
-
$ZodType.init(inst, def);
|
|
1816
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1817
|
-
if (ctx.direction === "backward") {
|
|
1818
|
-
throw new $ZodEncodeError(inst.constructor.name);
|
|
1819
|
-
}
|
|
1820
|
-
const _out = def.transform(payload.value, payload);
|
|
1821
|
-
if (ctx.async) {
|
|
1822
|
-
const output = _out instanceof Promise ? _out : Promise.resolve(_out);
|
|
1823
|
-
return output.then((output2) => {
|
|
1824
|
-
payload.value = output2;
|
|
1825
|
-
return payload;
|
|
1826
|
-
});
|
|
1827
|
-
}
|
|
1828
|
-
if (_out instanceof Promise) {
|
|
1829
|
-
throw new $ZodAsyncError();
|
|
1830
|
-
}
|
|
1831
|
-
payload.value = _out;
|
|
1832
|
-
return payload;
|
|
1833
|
-
};
|
|
1834
|
-
});
|
|
1835
|
-
function handleOptionalResult(result2, input) {
|
|
1836
|
-
if (result2.issues.length && input === void 0) {
|
|
1837
|
-
return { issues: [], value: void 0 };
|
|
1838
|
-
}
|
|
1839
|
-
return result2;
|
|
1840
|
-
}
|
|
1841
|
-
const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
1842
|
-
$ZodType.init(inst, def);
|
|
1843
|
-
inst._zod.optin = "optional";
|
|
1844
|
-
inst._zod.optout = "optional";
|
|
1845
|
-
defineLazy(inst._zod, "values", () => {
|
|
1846
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
1847
|
-
});
|
|
1848
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1849
|
-
const pattern = def.innerType._zod.pattern;
|
|
1850
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
1851
|
-
});
|
|
1852
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1853
|
-
if (def.innerType._zod.optin === "optional") {
|
|
1854
|
-
const result2 = def.innerType._zod.run(payload, ctx);
|
|
1855
|
-
if (result2 instanceof Promise)
|
|
1856
|
-
return result2.then((r) => handleOptionalResult(r, payload.value));
|
|
1857
|
-
return handleOptionalResult(result2, payload.value);
|
|
1858
|
-
}
|
|
1859
|
-
if (payload.value === void 0) {
|
|
1860
|
-
return payload;
|
|
1861
|
-
}
|
|
1862
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1863
|
-
};
|
|
1864
|
-
});
|
|
1865
|
-
const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
1866
|
-
$ZodType.init(inst, def);
|
|
1867
|
-
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
1868
|
-
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
1869
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1870
|
-
const pattern = def.innerType._zod.pattern;
|
|
1871
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
1872
|
-
});
|
|
1873
|
-
defineLazy(inst._zod, "values", () => {
|
|
1874
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
1875
|
-
});
|
|
1876
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1877
|
-
if (payload.value === null)
|
|
1878
|
-
return payload;
|
|
1879
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1880
|
-
};
|
|
1881
|
-
});
|
|
1882
|
-
const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
1883
|
-
$ZodType.init(inst, def);
|
|
1884
|
-
inst._zod.optin = "optional";
|
|
1885
|
-
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
1886
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1887
|
-
if (ctx.direction === "backward") {
|
|
1888
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1889
|
-
}
|
|
1890
|
-
if (payload.value === void 0) {
|
|
1891
|
-
payload.value = def.defaultValue;
|
|
1892
|
-
return payload;
|
|
1893
|
-
}
|
|
1894
|
-
const result2 = def.innerType._zod.run(payload, ctx);
|
|
1895
|
-
if (result2 instanceof Promise) {
|
|
1896
|
-
return result2.then((result3) => handleDefaultResult(result3, def));
|
|
1897
|
-
}
|
|
1898
|
-
return handleDefaultResult(result2, def);
|
|
1899
|
-
};
|
|
1900
|
-
});
|
|
1901
|
-
function handleDefaultResult(payload, def) {
|
|
1902
|
-
if (payload.value === void 0) {
|
|
1903
|
-
payload.value = def.defaultValue;
|
|
1904
|
-
}
|
|
1905
|
-
return payload;
|
|
1906
|
-
}
|
|
1907
|
-
const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
|
|
1908
|
-
$ZodType.init(inst, def);
|
|
1909
|
-
inst._zod.optin = "optional";
|
|
1910
|
-
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
1911
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1912
|
-
if (ctx.direction === "backward") {
|
|
1913
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1914
|
-
}
|
|
1915
|
-
if (payload.value === void 0) {
|
|
1916
|
-
payload.value = def.defaultValue;
|
|
1917
|
-
}
|
|
1918
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1919
|
-
};
|
|
1920
|
-
});
|
|
1921
|
-
const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
|
|
1922
|
-
$ZodType.init(inst, def);
|
|
1923
|
-
defineLazy(inst._zod, "values", () => {
|
|
1924
|
-
const v = def.innerType._zod.values;
|
|
1925
|
-
return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
|
|
1926
|
-
});
|
|
1927
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1928
|
-
const result2 = def.innerType._zod.run(payload, ctx);
|
|
1929
|
-
if (result2 instanceof Promise) {
|
|
1930
|
-
return result2.then((result3) => handleNonOptionalResult(result3, inst));
|
|
1931
|
-
}
|
|
1932
|
-
return handleNonOptionalResult(result2, inst);
|
|
1933
|
-
};
|
|
1934
|
-
});
|
|
1935
|
-
function handleNonOptionalResult(payload, inst) {
|
|
1936
|
-
if (!payload.issues.length && payload.value === void 0) {
|
|
1937
|
-
payload.issues.push({
|
|
1938
|
-
code: "invalid_type",
|
|
1939
|
-
expected: "nonoptional",
|
|
1940
|
-
input: payload.value,
|
|
1941
|
-
inst
|
|
1942
|
-
});
|
|
1943
|
-
}
|
|
1944
|
-
return payload;
|
|
1945
|
-
}
|
|
1946
|
-
const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
1947
|
-
$ZodType.init(inst, def);
|
|
1948
|
-
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
1949
|
-
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
1950
|
-
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
1951
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1952
|
-
if (ctx.direction === "backward") {
|
|
1953
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1954
|
-
}
|
|
1955
|
-
const result2 = def.innerType._zod.run(payload, ctx);
|
|
1956
|
-
if (result2 instanceof Promise) {
|
|
1957
|
-
return result2.then((result3) => {
|
|
1958
|
-
payload.value = result3.value;
|
|
1959
|
-
if (result3.issues.length) {
|
|
1960
|
-
payload.value = def.catchValue({
|
|
1961
|
-
...payload,
|
|
1962
|
-
error: {
|
|
1963
|
-
issues: result3.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
1964
|
-
},
|
|
1965
|
-
input: payload.value
|
|
1966
|
-
});
|
|
1967
|
-
payload.issues = [];
|
|
1968
|
-
}
|
|
1969
|
-
return payload;
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
payload.value = result2.value;
|
|
1973
|
-
if (result2.issues.length) {
|
|
1974
|
-
payload.value = def.catchValue({
|
|
1975
|
-
...payload,
|
|
1976
|
-
error: {
|
|
1977
|
-
issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
1978
|
-
},
|
|
1979
|
-
input: payload.value
|
|
1980
|
-
});
|
|
1981
|
-
payload.issues = [];
|
|
1982
|
-
}
|
|
1983
|
-
return payload;
|
|
1984
|
-
};
|
|
1985
|
-
});
|
|
1986
|
-
const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
1987
|
-
$ZodType.init(inst, def);
|
|
1988
|
-
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
1989
|
-
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
1990
|
-
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
1991
|
-
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
1992
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1993
|
-
if (ctx.direction === "backward") {
|
|
1994
|
-
const right = def.out._zod.run(payload, ctx);
|
|
1995
|
-
if (right instanceof Promise) {
|
|
1996
|
-
return right.then((right2) => handlePipeResult(right2, def.in, ctx));
|
|
1997
|
-
}
|
|
1998
|
-
return handlePipeResult(right, def.in, ctx);
|
|
1999
|
-
}
|
|
2000
|
-
const left = def.in._zod.run(payload, ctx);
|
|
2001
|
-
if (left instanceof Promise) {
|
|
2002
|
-
return left.then((left2) => handlePipeResult(left2, def.out, ctx));
|
|
2003
|
-
}
|
|
2004
|
-
return handlePipeResult(left, def.out, ctx);
|
|
2005
|
-
};
|
|
2006
|
-
});
|
|
2007
|
-
function handlePipeResult(left, next, ctx) {
|
|
2008
|
-
if (left.issues.length) {
|
|
2009
|
-
left.aborted = true;
|
|
2010
|
-
return left;
|
|
2011
|
-
}
|
|
2012
|
-
return next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
2013
|
-
}
|
|
2014
|
-
const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
|
|
2015
|
-
$ZodType.init(inst, def);
|
|
2016
|
-
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
2017
|
-
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2018
|
-
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2019
|
-
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2020
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2021
|
-
if (ctx.direction === "backward") {
|
|
2022
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2023
|
-
}
|
|
2024
|
-
const result2 = def.innerType._zod.run(payload, ctx);
|
|
2025
|
-
if (result2 instanceof Promise) {
|
|
2026
|
-
return result2.then(handleReadonlyResult);
|
|
2027
|
-
}
|
|
2028
|
-
return handleReadonlyResult(result2);
|
|
2029
|
-
};
|
|
2030
|
-
});
|
|
2031
|
-
function handleReadonlyResult(payload) {
|
|
2032
|
-
payload.value = Object.freeze(payload.value);
|
|
2033
|
-
return payload;
|
|
2034
|
-
}
|
|
2035
|
-
const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
2036
|
-
$ZodCheck.init(inst, def);
|
|
2037
|
-
$ZodType.init(inst, def);
|
|
2038
|
-
inst._zod.parse = (payload, _) => {
|
|
2039
|
-
return payload;
|
|
2040
|
-
};
|
|
2041
|
-
inst._zod.check = (payload) => {
|
|
2042
|
-
const input = payload.value;
|
|
2043
|
-
const r = def.fn(input);
|
|
2044
|
-
if (r instanceof Promise) {
|
|
2045
|
-
return r.then((r2) => handleRefineResult(r2, payload, input, inst));
|
|
2046
|
-
}
|
|
2047
|
-
handleRefineResult(r, payload, input, inst);
|
|
2048
|
-
return;
|
|
2049
|
-
};
|
|
2050
|
-
});
|
|
2051
|
-
function handleRefineResult(result2, payload, input, inst) {
|
|
2052
|
-
if (!result2) {
|
|
2053
|
-
const _iss = {
|
|
2054
|
-
code: "custom",
|
|
2055
|
-
input,
|
|
2056
|
-
inst,
|
|
2057
|
-
// incorporates params.error into issue reporting
|
|
2058
|
-
path: [...inst._zod.def.path ?? []],
|
|
2059
|
-
// incorporates params.error into issue reporting
|
|
2060
|
-
continue: !inst._zod.def.abort
|
|
2061
|
-
// params: inst._zod.def.params,
|
|
2062
|
-
};
|
|
2063
|
-
if (inst._zod.def.params)
|
|
2064
|
-
_iss.params = inst._zod.def.params;
|
|
2065
|
-
payload.issues.push(issue(_iss));
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
class $ZodRegistry {
|
|
2069
|
-
constructor() {
|
|
2070
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
2071
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
2072
|
-
}
|
|
2073
|
-
add(schema, ..._meta) {
|
|
2074
|
-
const meta = _meta[0];
|
|
2075
|
-
this._map.set(schema, meta);
|
|
2076
|
-
if (meta && typeof meta === "object" && "id" in meta) {
|
|
2077
|
-
if (this._idmap.has(meta.id)) {
|
|
2078
|
-
throw new Error(`ID ${meta.id} already exists in the registry`);
|
|
2079
|
-
}
|
|
2080
|
-
this._idmap.set(meta.id, schema);
|
|
2081
|
-
}
|
|
2082
|
-
return this;
|
|
2083
|
-
}
|
|
2084
|
-
clear() {
|
|
2085
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
2086
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
2087
|
-
return this;
|
|
2088
|
-
}
|
|
2089
|
-
remove(schema) {
|
|
2090
|
-
const meta = this._map.get(schema);
|
|
2091
|
-
if (meta && typeof meta === "object" && "id" in meta) {
|
|
2092
|
-
this._idmap.delete(meta.id);
|
|
2093
|
-
}
|
|
2094
|
-
this._map.delete(schema);
|
|
2095
|
-
return this;
|
|
2096
|
-
}
|
|
2097
|
-
get(schema) {
|
|
2098
|
-
const p = schema._zod.parent;
|
|
2099
|
-
if (p) {
|
|
2100
|
-
const pm = { ...this.get(p) ?? {} };
|
|
2101
|
-
delete pm.id;
|
|
2102
|
-
const f = { ...pm, ...this._map.get(schema) };
|
|
2103
|
-
return Object.keys(f).length ? f : void 0;
|
|
2104
|
-
}
|
|
2105
|
-
return this._map.get(schema);
|
|
2106
|
-
}
|
|
2107
|
-
has(schema) {
|
|
2108
|
-
return this._map.has(schema);
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
function registry() {
|
|
2112
|
-
return new $ZodRegistry();
|
|
2113
|
-
}
|
|
2114
|
-
const globalRegistry = /* @__PURE__ */ registry();
|
|
2115
|
-
function _string(Class, params) {
|
|
2116
|
-
return new Class({
|
|
2117
|
-
type: "string",
|
|
2118
|
-
...normalizeParams(params)
|
|
2119
|
-
});
|
|
2120
|
-
}
|
|
2121
|
-
function _email(Class, params) {
|
|
2122
|
-
return new Class({
|
|
2123
|
-
type: "string",
|
|
2124
|
-
format: "email",
|
|
2125
|
-
check: "string_format",
|
|
2126
|
-
abort: false,
|
|
2127
|
-
...normalizeParams(params)
|
|
2128
|
-
});
|
|
2129
|
-
}
|
|
2130
|
-
function _guid(Class, params) {
|
|
2131
|
-
return new Class({
|
|
2132
|
-
type: "string",
|
|
2133
|
-
format: "guid",
|
|
2134
|
-
check: "string_format",
|
|
2135
|
-
abort: false,
|
|
2136
|
-
...normalizeParams(params)
|
|
2137
|
-
});
|
|
2138
|
-
}
|
|
2139
|
-
function _uuid(Class, params) {
|
|
2140
|
-
return new Class({
|
|
2141
|
-
type: "string",
|
|
2142
|
-
format: "uuid",
|
|
2143
|
-
check: "string_format",
|
|
2144
|
-
abort: false,
|
|
2145
|
-
...normalizeParams(params)
|
|
2146
|
-
});
|
|
2147
|
-
}
|
|
2148
|
-
function _uuidv4(Class, params) {
|
|
2149
|
-
return new Class({
|
|
2150
|
-
type: "string",
|
|
2151
|
-
format: "uuid",
|
|
2152
|
-
check: "string_format",
|
|
2153
|
-
abort: false,
|
|
2154
|
-
version: "v4",
|
|
2155
|
-
...normalizeParams(params)
|
|
2156
|
-
});
|
|
2157
|
-
}
|
|
2158
|
-
function _uuidv6(Class, params) {
|
|
2159
|
-
return new Class({
|
|
2160
|
-
type: "string",
|
|
2161
|
-
format: "uuid",
|
|
2162
|
-
check: "string_format",
|
|
2163
|
-
abort: false,
|
|
2164
|
-
version: "v6",
|
|
2165
|
-
...normalizeParams(params)
|
|
2166
|
-
});
|
|
2167
|
-
}
|
|
2168
|
-
function _uuidv7(Class, params) {
|
|
2169
|
-
return new Class({
|
|
2170
|
-
type: "string",
|
|
2171
|
-
format: "uuid",
|
|
2172
|
-
check: "string_format",
|
|
2173
|
-
abort: false,
|
|
2174
|
-
version: "v7",
|
|
2175
|
-
...normalizeParams(params)
|
|
2176
|
-
});
|
|
2177
|
-
}
|
|
2178
|
-
function _url(Class, params) {
|
|
2179
|
-
return new Class({
|
|
2180
|
-
type: "string",
|
|
2181
|
-
format: "url",
|
|
2182
|
-
check: "string_format",
|
|
2183
|
-
abort: false,
|
|
2184
|
-
...normalizeParams(params)
|
|
2185
|
-
});
|
|
2186
|
-
}
|
|
2187
|
-
function _emoji(Class, params) {
|
|
2188
|
-
return new Class({
|
|
2189
|
-
type: "string",
|
|
2190
|
-
format: "emoji",
|
|
2191
|
-
check: "string_format",
|
|
2192
|
-
abort: false,
|
|
2193
|
-
...normalizeParams(params)
|
|
2194
|
-
});
|
|
2195
|
-
}
|
|
2196
|
-
function _nanoid(Class, params) {
|
|
2197
|
-
return new Class({
|
|
2198
|
-
type: "string",
|
|
2199
|
-
format: "nanoid",
|
|
2200
|
-
check: "string_format",
|
|
2201
|
-
abort: false,
|
|
2202
|
-
...normalizeParams(params)
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
function _cuid(Class, params) {
|
|
2206
|
-
return new Class({
|
|
2207
|
-
type: "string",
|
|
2208
|
-
format: "cuid",
|
|
2209
|
-
check: "string_format",
|
|
2210
|
-
abort: false,
|
|
2211
|
-
...normalizeParams(params)
|
|
2212
|
-
});
|
|
2213
|
-
}
|
|
2214
|
-
function _cuid2(Class, params) {
|
|
2215
|
-
return new Class({
|
|
2216
|
-
type: "string",
|
|
2217
|
-
format: "cuid2",
|
|
2218
|
-
check: "string_format",
|
|
2219
|
-
abort: false,
|
|
2220
|
-
...normalizeParams(params)
|
|
2221
|
-
});
|
|
2222
|
-
}
|
|
2223
|
-
function _ulid(Class, params) {
|
|
2224
|
-
return new Class({
|
|
2225
|
-
type: "string",
|
|
2226
|
-
format: "ulid",
|
|
2227
|
-
check: "string_format",
|
|
2228
|
-
abort: false,
|
|
2229
|
-
...normalizeParams(params)
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
|
-
function _xid(Class, params) {
|
|
2233
|
-
return new Class({
|
|
2234
|
-
type: "string",
|
|
2235
|
-
format: "xid",
|
|
2236
|
-
check: "string_format",
|
|
2237
|
-
abort: false,
|
|
2238
|
-
...normalizeParams(params)
|
|
2239
|
-
});
|
|
2240
|
-
}
|
|
2241
|
-
function _ksuid(Class, params) {
|
|
2242
|
-
return new Class({
|
|
2243
|
-
type: "string",
|
|
2244
|
-
format: "ksuid",
|
|
2245
|
-
check: "string_format",
|
|
2246
|
-
abort: false,
|
|
2247
|
-
...normalizeParams(params)
|
|
2248
|
-
});
|
|
2249
|
-
}
|
|
2250
|
-
function _ipv4(Class, params) {
|
|
2251
|
-
return new Class({
|
|
2252
|
-
type: "string",
|
|
2253
|
-
format: "ipv4",
|
|
2254
|
-
check: "string_format",
|
|
2255
|
-
abort: false,
|
|
2256
|
-
...normalizeParams(params)
|
|
2257
|
-
});
|
|
2258
|
-
}
|
|
2259
|
-
function _ipv6(Class, params) {
|
|
2260
|
-
return new Class({
|
|
2261
|
-
type: "string",
|
|
2262
|
-
format: "ipv6",
|
|
2263
|
-
check: "string_format",
|
|
2264
|
-
abort: false,
|
|
2265
|
-
...normalizeParams(params)
|
|
2266
|
-
});
|
|
2267
|
-
}
|
|
2268
|
-
function _cidrv4(Class, params) {
|
|
2269
|
-
return new Class({
|
|
2270
|
-
type: "string",
|
|
2271
|
-
format: "cidrv4",
|
|
2272
|
-
check: "string_format",
|
|
2273
|
-
abort: false,
|
|
2274
|
-
...normalizeParams(params)
|
|
2275
|
-
});
|
|
2276
|
-
}
|
|
2277
|
-
function _cidrv6(Class, params) {
|
|
2278
|
-
return new Class({
|
|
2279
|
-
type: "string",
|
|
2280
|
-
format: "cidrv6",
|
|
2281
|
-
check: "string_format",
|
|
2282
|
-
abort: false,
|
|
2283
|
-
...normalizeParams(params)
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
|
-
function _base64(Class, params) {
|
|
2287
|
-
return new Class({
|
|
2288
|
-
type: "string",
|
|
2289
|
-
format: "base64",
|
|
2290
|
-
check: "string_format",
|
|
2291
|
-
abort: false,
|
|
2292
|
-
...normalizeParams(params)
|
|
2293
|
-
});
|
|
2294
|
-
}
|
|
2295
|
-
function _base64url(Class, params) {
|
|
2296
|
-
return new Class({
|
|
2297
|
-
type: "string",
|
|
2298
|
-
format: "base64url",
|
|
2299
|
-
check: "string_format",
|
|
2300
|
-
abort: false,
|
|
2301
|
-
...normalizeParams(params)
|
|
2302
|
-
});
|
|
2303
|
-
}
|
|
2304
|
-
function _e164(Class, params) {
|
|
2305
|
-
return new Class({
|
|
2306
|
-
type: "string",
|
|
2307
|
-
format: "e164",
|
|
2308
|
-
check: "string_format",
|
|
2309
|
-
abort: false,
|
|
2310
|
-
...normalizeParams(params)
|
|
2311
|
-
});
|
|
2312
|
-
}
|
|
2313
|
-
function _jwt(Class, params) {
|
|
2314
|
-
return new Class({
|
|
2315
|
-
type: "string",
|
|
2316
|
-
format: "jwt",
|
|
2317
|
-
check: "string_format",
|
|
2318
|
-
abort: false,
|
|
2319
|
-
...normalizeParams(params)
|
|
2320
|
-
});
|
|
2321
|
-
}
|
|
2322
|
-
function _isoDateTime(Class, params) {
|
|
2323
|
-
return new Class({
|
|
2324
|
-
type: "string",
|
|
2325
|
-
format: "datetime",
|
|
2326
|
-
check: "string_format",
|
|
2327
|
-
offset: false,
|
|
2328
|
-
local: false,
|
|
2329
|
-
precision: null,
|
|
2330
|
-
...normalizeParams(params)
|
|
2331
|
-
});
|
|
2332
|
-
}
|
|
2333
|
-
function _isoDate(Class, params) {
|
|
2334
|
-
return new Class({
|
|
2335
|
-
type: "string",
|
|
2336
|
-
format: "date",
|
|
2337
|
-
check: "string_format",
|
|
2338
|
-
...normalizeParams(params)
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
|
-
function _isoTime(Class, params) {
|
|
2342
|
-
return new Class({
|
|
2343
|
-
type: "string",
|
|
2344
|
-
format: "time",
|
|
2345
|
-
check: "string_format",
|
|
2346
|
-
precision: null,
|
|
2347
|
-
...normalizeParams(params)
|
|
2348
|
-
});
|
|
2349
|
-
}
|
|
2350
|
-
function _isoDuration(Class, params) {
|
|
2351
|
-
return new Class({
|
|
2352
|
-
type: "string",
|
|
2353
|
-
format: "duration",
|
|
2354
|
-
check: "string_format",
|
|
2355
|
-
...normalizeParams(params)
|
|
2356
|
-
});
|
|
2357
|
-
}
|
|
2358
|
-
function _boolean(Class, params) {
|
|
2359
|
-
return new Class({
|
|
2360
|
-
type: "boolean",
|
|
2361
|
-
...normalizeParams(params)
|
|
2362
|
-
});
|
|
2363
|
-
}
|
|
2364
|
-
function _unknown(Class) {
|
|
2365
|
-
return new Class({
|
|
2366
|
-
type: "unknown"
|
|
2367
|
-
});
|
|
2368
|
-
}
|
|
2369
|
-
function _never(Class, params) {
|
|
2370
|
-
return new Class({
|
|
2371
|
-
type: "never",
|
|
2372
|
-
...normalizeParams(params)
|
|
2373
|
-
});
|
|
2374
|
-
}
|
|
2375
|
-
function _maxLength(maximum, params) {
|
|
2376
|
-
const ch = new $ZodCheckMaxLength({
|
|
2377
|
-
check: "max_length",
|
|
2378
|
-
...normalizeParams(params),
|
|
2379
|
-
maximum
|
|
2380
|
-
});
|
|
2381
|
-
return ch;
|
|
2382
|
-
}
|
|
2383
|
-
function _minLength(minimum, params) {
|
|
2384
|
-
return new $ZodCheckMinLength({
|
|
2385
|
-
check: "min_length",
|
|
2386
|
-
...normalizeParams(params),
|
|
2387
|
-
minimum
|
|
2388
|
-
});
|
|
2389
|
-
}
|
|
2390
|
-
function _length(length, params) {
|
|
2391
|
-
return new $ZodCheckLengthEquals({
|
|
2392
|
-
check: "length_equals",
|
|
2393
|
-
...normalizeParams(params),
|
|
2394
|
-
length
|
|
2395
|
-
});
|
|
2396
|
-
}
|
|
2397
|
-
function _regex(pattern, params) {
|
|
2398
|
-
return new $ZodCheckRegex({
|
|
2399
|
-
check: "string_format",
|
|
2400
|
-
format: "regex",
|
|
2401
|
-
...normalizeParams(params),
|
|
2402
|
-
pattern
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
function _lowercase(params) {
|
|
2406
|
-
return new $ZodCheckLowerCase({
|
|
2407
|
-
check: "string_format",
|
|
2408
|
-
format: "lowercase",
|
|
2409
|
-
...normalizeParams(params)
|
|
2410
|
-
});
|
|
2411
|
-
}
|
|
2412
|
-
function _uppercase(params) {
|
|
2413
|
-
return new $ZodCheckUpperCase({
|
|
2414
|
-
check: "string_format",
|
|
2415
|
-
format: "uppercase",
|
|
2416
|
-
...normalizeParams(params)
|
|
2417
|
-
});
|
|
2418
|
-
}
|
|
2419
|
-
function _includes(includes, params) {
|
|
2420
|
-
return new $ZodCheckIncludes({
|
|
2421
|
-
check: "string_format",
|
|
2422
|
-
format: "includes",
|
|
2423
|
-
...normalizeParams(params),
|
|
2424
|
-
includes
|
|
2425
|
-
});
|
|
2426
|
-
}
|
|
2427
|
-
function _startsWith(prefix, params) {
|
|
2428
|
-
return new $ZodCheckStartsWith({
|
|
2429
|
-
check: "string_format",
|
|
2430
|
-
format: "starts_with",
|
|
2431
|
-
...normalizeParams(params),
|
|
2432
|
-
prefix
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
function _endsWith(suffix, params) {
|
|
2436
|
-
return new $ZodCheckEndsWith({
|
|
2437
|
-
check: "string_format",
|
|
2438
|
-
format: "ends_with",
|
|
2439
|
-
...normalizeParams(params),
|
|
2440
|
-
suffix
|
|
2441
|
-
});
|
|
2442
|
-
}
|
|
2443
|
-
function _overwrite(tx) {
|
|
2444
|
-
return new $ZodCheckOverwrite({
|
|
2445
|
-
check: "overwrite",
|
|
2446
|
-
tx
|
|
2447
|
-
});
|
|
2448
|
-
}
|
|
2449
|
-
function _normalize(form) {
|
|
2450
|
-
return _overwrite((input) => input.normalize(form));
|
|
2451
|
-
}
|
|
2452
|
-
function _trim() {
|
|
2453
|
-
return _overwrite((input) => input.trim());
|
|
2454
|
-
}
|
|
2455
|
-
function _toLowerCase() {
|
|
2456
|
-
return _overwrite((input) => input.toLowerCase());
|
|
2457
|
-
}
|
|
2458
|
-
function _toUpperCase() {
|
|
2459
|
-
return _overwrite((input) => input.toUpperCase());
|
|
2460
|
-
}
|
|
2461
|
-
function _array(Class, element, params) {
|
|
2462
|
-
return new Class({
|
|
2463
|
-
type: "array",
|
|
2464
|
-
element,
|
|
2465
|
-
// get element() {
|
|
2466
|
-
// return element;
|
|
2467
|
-
// },
|
|
2468
|
-
...normalizeParams(params)
|
|
2469
|
-
});
|
|
2470
|
-
}
|
|
2471
|
-
function _refine(Class, fn, _params) {
|
|
2472
|
-
const schema = new Class({
|
|
2473
|
-
type: "custom",
|
|
2474
|
-
check: "custom",
|
|
2475
|
-
fn,
|
|
2476
|
-
...normalizeParams(_params)
|
|
2477
|
-
});
|
|
2478
|
-
return schema;
|
|
2479
|
-
}
|
|
2480
|
-
function _superRefine(fn) {
|
|
2481
|
-
const ch = _check((payload) => {
|
|
2482
|
-
payload.addIssue = (issue$1) => {
|
|
2483
|
-
if (typeof issue$1 === "string") {
|
|
2484
|
-
payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
|
|
2485
|
-
} else {
|
|
2486
|
-
const _issue = issue$1;
|
|
2487
|
-
if (_issue.fatal)
|
|
2488
|
-
_issue.continue = false;
|
|
2489
|
-
_issue.code ?? (_issue.code = "custom");
|
|
2490
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
2491
|
-
_issue.inst ?? (_issue.inst = ch);
|
|
2492
|
-
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
2493
|
-
payload.issues.push(issue(_issue));
|
|
2494
|
-
}
|
|
2495
|
-
};
|
|
2496
|
-
return fn(payload.value, payload);
|
|
2497
|
-
});
|
|
2498
|
-
return ch;
|
|
2499
|
-
}
|
|
2500
|
-
function _check(fn, params) {
|
|
2501
|
-
const ch = new $ZodCheck({
|
|
2502
|
-
check: "custom",
|
|
2503
|
-
...normalizeParams(params)
|
|
2504
|
-
});
|
|
2505
|
-
ch._zod.check = fn;
|
|
2506
|
-
return ch;
|
|
2507
|
-
}
|
|
2508
|
-
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
2509
|
-
$ZodISODateTime.init(inst, def);
|
|
2510
|
-
ZodStringFormat.init(inst, def);
|
|
2511
|
-
});
|
|
2512
|
-
function datetime(params) {
|
|
2513
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
2514
|
-
}
|
|
2515
|
-
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
2516
|
-
$ZodISODate.init(inst, def);
|
|
2517
|
-
ZodStringFormat.init(inst, def);
|
|
2518
|
-
});
|
|
2519
|
-
function date(params) {
|
|
2520
|
-
return _isoDate(ZodISODate, params);
|
|
2521
|
-
}
|
|
2522
|
-
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
2523
|
-
$ZodISOTime.init(inst, def);
|
|
2524
|
-
ZodStringFormat.init(inst, def);
|
|
2525
|
-
});
|
|
2526
|
-
function time(params) {
|
|
2527
|
-
return _isoTime(ZodISOTime, params);
|
|
2528
|
-
}
|
|
2529
|
-
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
2530
|
-
$ZodISODuration.init(inst, def);
|
|
2531
|
-
ZodStringFormat.init(inst, def);
|
|
2532
|
-
});
|
|
2533
|
-
function duration(params) {
|
|
2534
|
-
return _isoDuration(ZodISODuration, params);
|
|
2535
|
-
}
|
|
2536
|
-
const initializer = (inst, issues) => {
|
|
2537
|
-
$ZodError.init(inst, issues);
|
|
2538
|
-
inst.name = "ZodError";
|
|
2539
|
-
Object.defineProperties(inst, {
|
|
2540
|
-
format: {
|
|
2541
|
-
value: (mapper) => formatError(inst, mapper)
|
|
2542
|
-
// enumerable: false,
|
|
2543
|
-
},
|
|
2544
|
-
flatten: {
|
|
2545
|
-
value: (mapper) => flattenError(inst, mapper)
|
|
2546
|
-
// enumerable: false,
|
|
2547
|
-
},
|
|
2548
|
-
addIssue: {
|
|
2549
|
-
value: (issue2) => {
|
|
2550
|
-
inst.issues.push(issue2);
|
|
2551
|
-
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
2552
|
-
}
|
|
2553
|
-
// enumerable: false,
|
|
2554
|
-
},
|
|
2555
|
-
addIssues: {
|
|
2556
|
-
value: (issues2) => {
|
|
2557
|
-
inst.issues.push(...issues2);
|
|
2558
|
-
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
2559
|
-
}
|
|
2560
|
-
// enumerable: false,
|
|
2561
|
-
},
|
|
2562
|
-
isEmpty: {
|
|
2563
|
-
get() {
|
|
2564
|
-
return inst.issues.length === 0;
|
|
2565
|
-
}
|
|
2566
|
-
// enumerable: false,
|
|
2567
|
-
}
|
|
2568
|
-
});
|
|
2569
|
-
};
|
|
2570
|
-
const ZodRealError = $constructor("ZodError", initializer, {
|
|
2571
|
-
Parent: Error
|
|
2572
|
-
});
|
|
2573
|
-
const parse$1 = /* @__PURE__ */ _parse(ZodRealError);
|
|
2574
|
-
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
2575
|
-
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
2576
|
-
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
2577
|
-
const encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
2578
|
-
const decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
2579
|
-
const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
2580
|
-
const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
2581
|
-
const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
2582
|
-
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
2583
|
-
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
2584
|
-
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
2585
|
-
const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
2586
|
-
$ZodType.init(inst, def);
|
|
2587
|
-
inst.def = def;
|
|
2588
|
-
inst.type = def.type;
|
|
2589
|
-
Object.defineProperty(inst, "_def", { value: def });
|
|
2590
|
-
inst.check = (...checks) => {
|
|
2591
|
-
return inst.clone(mergeDefs(def, {
|
|
2592
|
-
checks: [
|
|
2593
|
-
...def.checks ?? [],
|
|
2594
|
-
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
2595
|
-
]
|
|
2596
|
-
}));
|
|
2597
|
-
};
|
|
2598
|
-
inst.clone = (def2, params) => clone(inst, def2, params);
|
|
2599
|
-
inst.brand = () => inst;
|
|
2600
|
-
inst.register = ((reg, meta) => {
|
|
2601
|
-
reg.add(inst, meta);
|
|
2602
|
-
return inst;
|
|
2603
|
-
});
|
|
2604
|
-
inst.parse = (data, params) => parse$1(inst, data, params, { callee: inst.parse });
|
|
2605
|
-
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
2606
|
-
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
2607
|
-
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
2608
|
-
inst.spa = inst.safeParseAsync;
|
|
2609
|
-
inst.encode = (data, params) => encode(inst, data, params);
|
|
2610
|
-
inst.decode = (data, params) => decode(inst, data, params);
|
|
2611
|
-
inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
|
|
2612
|
-
inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
|
|
2613
|
-
inst.safeEncode = (data, params) => safeEncode(inst, data, params);
|
|
2614
|
-
inst.safeDecode = (data, params) => safeDecode(inst, data, params);
|
|
2615
|
-
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
|
|
2616
|
-
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
|
|
2617
|
-
inst.refine = (check, params) => inst.check(refine(check, params));
|
|
2618
|
-
inst.superRefine = (refinement) => inst.check(superRefine(refinement));
|
|
2619
|
-
inst.overwrite = (fn) => inst.check(_overwrite(fn));
|
|
2620
|
-
inst.optional = () => optional(inst);
|
|
2621
|
-
inst.nullable = () => nullable(inst);
|
|
2622
|
-
inst.nullish = () => optional(nullable(inst));
|
|
2623
|
-
inst.nonoptional = (params) => nonoptional(inst, params);
|
|
2624
|
-
inst.array = () => array(inst);
|
|
2625
|
-
inst.or = (arg) => union([inst, arg]);
|
|
2626
|
-
inst.and = (arg) => intersection(inst, arg);
|
|
2627
|
-
inst.transform = (tx) => pipe(inst, transform(tx));
|
|
2628
|
-
inst.default = (def2) => _default(inst, def2);
|
|
2629
|
-
inst.prefault = (def2) => prefault(inst, def2);
|
|
2630
|
-
inst.catch = (params) => _catch(inst, params);
|
|
2631
|
-
inst.pipe = (target) => pipe(inst, target);
|
|
2632
|
-
inst.readonly = () => readonly(inst);
|
|
2633
|
-
inst.describe = (description) => {
|
|
2634
|
-
const cl = inst.clone();
|
|
2635
|
-
globalRegistry.add(cl, { description });
|
|
2636
|
-
return cl;
|
|
2637
|
-
};
|
|
2638
|
-
Object.defineProperty(inst, "description", {
|
|
2639
|
-
get() {
|
|
2640
|
-
return globalRegistry.get(inst)?.description;
|
|
2641
|
-
},
|
|
2642
|
-
configurable: true
|
|
2643
|
-
});
|
|
2644
|
-
inst.meta = (...args) => {
|
|
2645
|
-
if (args.length === 0) {
|
|
2646
|
-
return globalRegistry.get(inst);
|
|
2647
|
-
}
|
|
2648
|
-
const cl = inst.clone();
|
|
2649
|
-
globalRegistry.add(cl, args[0]);
|
|
2650
|
-
return cl;
|
|
2651
|
-
};
|
|
2652
|
-
inst.isOptional = () => inst.safeParse(void 0).success;
|
|
2653
|
-
inst.isNullable = () => inst.safeParse(null).success;
|
|
2654
|
-
return inst;
|
|
2655
|
-
});
|
|
2656
|
-
const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
2657
|
-
$ZodString.init(inst, def);
|
|
2658
|
-
ZodType.init(inst, def);
|
|
2659
|
-
const bag = inst._zod.bag;
|
|
2660
|
-
inst.format = bag.format ?? null;
|
|
2661
|
-
inst.minLength = bag.minimum ?? null;
|
|
2662
|
-
inst.maxLength = bag.maximum ?? null;
|
|
2663
|
-
inst.regex = (...args) => inst.check(_regex(...args));
|
|
2664
|
-
inst.includes = (...args) => inst.check(_includes(...args));
|
|
2665
|
-
inst.startsWith = (...args) => inst.check(_startsWith(...args));
|
|
2666
|
-
inst.endsWith = (...args) => inst.check(_endsWith(...args));
|
|
2667
|
-
inst.min = (...args) => inst.check(_minLength(...args));
|
|
2668
|
-
inst.max = (...args) => inst.check(_maxLength(...args));
|
|
2669
|
-
inst.length = (...args) => inst.check(_length(...args));
|
|
2670
|
-
inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
|
|
2671
|
-
inst.lowercase = (params) => inst.check(_lowercase(params));
|
|
2672
|
-
inst.uppercase = (params) => inst.check(_uppercase(params));
|
|
2673
|
-
inst.trim = () => inst.check(_trim());
|
|
2674
|
-
inst.normalize = (...args) => inst.check(_normalize(...args));
|
|
2675
|
-
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
2676
|
-
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
2677
|
-
});
|
|
2678
|
-
const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
2679
|
-
$ZodString.init(inst, def);
|
|
2680
|
-
_ZodString.init(inst, def);
|
|
2681
|
-
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
2682
|
-
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
2683
|
-
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
2684
|
-
inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
|
|
2685
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2686
|
-
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
2687
|
-
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
2688
|
-
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
2689
|
-
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
2690
|
-
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
2691
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
2692
|
-
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
2693
|
-
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
2694
|
-
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
2695
|
-
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
2696
|
-
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
2697
|
-
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
2698
|
-
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
2699
|
-
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
2700
|
-
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
2701
|
-
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
2702
|
-
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
2703
|
-
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
2704
|
-
inst.datetime = (params) => inst.check(datetime(params));
|
|
2705
|
-
inst.date = (params) => inst.check(date(params));
|
|
2706
|
-
inst.time = (params) => inst.check(time(params));
|
|
2707
|
-
inst.duration = (params) => inst.check(duration(params));
|
|
2708
|
-
});
|
|
2709
|
-
function string(params) {
|
|
2710
|
-
return _string(ZodString, params);
|
|
2711
|
-
}
|
|
2712
|
-
const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
2713
|
-
$ZodStringFormat.init(inst, def);
|
|
2714
|
-
_ZodString.init(inst, def);
|
|
2715
|
-
});
|
|
2716
|
-
const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
2717
|
-
$ZodEmail.init(inst, def);
|
|
2718
|
-
ZodStringFormat.init(inst, def);
|
|
2719
|
-
});
|
|
2720
|
-
const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
2721
|
-
$ZodGUID.init(inst, def);
|
|
2722
|
-
ZodStringFormat.init(inst, def);
|
|
2723
|
-
});
|
|
2724
|
-
const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
2725
|
-
$ZodUUID.init(inst, def);
|
|
2726
|
-
ZodStringFormat.init(inst, def);
|
|
2727
|
-
});
|
|
2728
|
-
const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
2729
|
-
$ZodURL.init(inst, def);
|
|
2730
|
-
ZodStringFormat.init(inst, def);
|
|
2731
|
-
});
|
|
2732
|
-
const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
2733
|
-
$ZodEmoji.init(inst, def);
|
|
2734
|
-
ZodStringFormat.init(inst, def);
|
|
2735
|
-
});
|
|
2736
|
-
const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
2737
|
-
$ZodNanoID.init(inst, def);
|
|
2738
|
-
ZodStringFormat.init(inst, def);
|
|
2739
|
-
});
|
|
2740
|
-
const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
2741
|
-
$ZodCUID.init(inst, def);
|
|
2742
|
-
ZodStringFormat.init(inst, def);
|
|
2743
|
-
});
|
|
2744
|
-
const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
2745
|
-
$ZodCUID2.init(inst, def);
|
|
2746
|
-
ZodStringFormat.init(inst, def);
|
|
2747
|
-
});
|
|
2748
|
-
const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
2749
|
-
$ZodULID.init(inst, def);
|
|
2750
|
-
ZodStringFormat.init(inst, def);
|
|
2751
|
-
});
|
|
2752
|
-
const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
2753
|
-
$ZodXID.init(inst, def);
|
|
2754
|
-
ZodStringFormat.init(inst, def);
|
|
2755
|
-
});
|
|
2756
|
-
const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
2757
|
-
$ZodKSUID.init(inst, def);
|
|
2758
|
-
ZodStringFormat.init(inst, def);
|
|
2759
|
-
});
|
|
2760
|
-
const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
2761
|
-
$ZodIPv4.init(inst, def);
|
|
2762
|
-
ZodStringFormat.init(inst, def);
|
|
2763
|
-
});
|
|
2764
|
-
const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
2765
|
-
$ZodIPv6.init(inst, def);
|
|
2766
|
-
ZodStringFormat.init(inst, def);
|
|
2767
|
-
});
|
|
2768
|
-
const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
2769
|
-
$ZodCIDRv4.init(inst, def);
|
|
2770
|
-
ZodStringFormat.init(inst, def);
|
|
2771
|
-
});
|
|
2772
|
-
const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
2773
|
-
$ZodCIDRv6.init(inst, def);
|
|
2774
|
-
ZodStringFormat.init(inst, def);
|
|
2775
|
-
});
|
|
2776
|
-
const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
2777
|
-
$ZodBase64.init(inst, def);
|
|
2778
|
-
ZodStringFormat.init(inst, def);
|
|
2779
|
-
});
|
|
2780
|
-
const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
2781
|
-
$ZodBase64URL.init(inst, def);
|
|
2782
|
-
ZodStringFormat.init(inst, def);
|
|
2783
|
-
});
|
|
2784
|
-
const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
2785
|
-
$ZodE164.init(inst, def);
|
|
2786
|
-
ZodStringFormat.init(inst, def);
|
|
2787
|
-
});
|
|
2788
|
-
const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
2789
|
-
$ZodJWT.init(inst, def);
|
|
2790
|
-
ZodStringFormat.init(inst, def);
|
|
2791
|
-
});
|
|
2792
|
-
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
2793
|
-
$ZodBoolean.init(inst, def);
|
|
2794
|
-
ZodType.init(inst, def);
|
|
2795
|
-
});
|
|
2796
|
-
function boolean(params) {
|
|
2797
|
-
return _boolean(ZodBoolean, params);
|
|
2798
|
-
}
|
|
2799
|
-
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
2800
|
-
$ZodUnknown.init(inst, def);
|
|
2801
|
-
ZodType.init(inst, def);
|
|
2802
|
-
});
|
|
2803
|
-
function unknown() {
|
|
2804
|
-
return _unknown(ZodUnknown);
|
|
2805
|
-
}
|
|
2806
|
-
const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
2807
|
-
$ZodNever.init(inst, def);
|
|
2808
|
-
ZodType.init(inst, def);
|
|
2809
|
-
});
|
|
2810
|
-
function never(params) {
|
|
2811
|
-
return _never(ZodNever, params);
|
|
2812
|
-
}
|
|
2813
|
-
const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
2814
|
-
$ZodArray.init(inst, def);
|
|
2815
|
-
ZodType.init(inst, def);
|
|
2816
|
-
inst.element = def.element;
|
|
2817
|
-
inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
|
|
2818
|
-
inst.nonempty = (params) => inst.check(_minLength(1, params));
|
|
2819
|
-
inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
|
|
2820
|
-
inst.length = (len, params) => inst.check(_length(len, params));
|
|
2821
|
-
inst.unwrap = () => inst.element;
|
|
2822
|
-
});
|
|
2823
|
-
function array(element, params) {
|
|
2824
|
-
return _array(ZodArray, element, params);
|
|
2825
|
-
}
|
|
2826
|
-
const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
2827
|
-
$ZodObjectJIT.init(inst, def);
|
|
2828
|
-
ZodType.init(inst, def);
|
|
2829
|
-
defineLazy(inst, "shape", () => {
|
|
2830
|
-
return def.shape;
|
|
2831
|
-
});
|
|
2832
|
-
inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
|
|
2833
|
-
inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
|
|
2834
|
-
inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
|
|
2835
|
-
inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
|
|
2836
|
-
inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
|
|
2837
|
-
inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
|
|
2838
|
-
inst.extend = (incoming) => {
|
|
2839
|
-
return extend(inst, incoming);
|
|
2840
|
-
};
|
|
2841
|
-
inst.safeExtend = (incoming) => {
|
|
2842
|
-
return safeExtend(inst, incoming);
|
|
2843
|
-
};
|
|
2844
|
-
inst.merge = (other) => merge$1(inst, other);
|
|
2845
|
-
inst.pick = (mask) => pick(inst, mask);
|
|
2846
|
-
inst.omit = (mask) => omit(inst, mask);
|
|
2847
|
-
inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
|
|
2848
|
-
inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
|
|
2849
|
-
});
|
|
2850
|
-
function object(shape, params) {
|
|
2851
|
-
const def = {
|
|
2852
|
-
type: "object",
|
|
2853
|
-
shape: shape ?? {},
|
|
2854
|
-
...normalizeParams(params)
|
|
2855
|
-
};
|
|
2856
|
-
return new ZodObject(def);
|
|
2857
|
-
}
|
|
2858
|
-
const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
2859
|
-
$ZodUnion.init(inst, def);
|
|
2860
|
-
ZodType.init(inst, def);
|
|
2861
|
-
inst.options = def.options;
|
|
2862
|
-
});
|
|
2863
|
-
function union(options, params) {
|
|
2864
|
-
return new ZodUnion({
|
|
2865
|
-
type: "union",
|
|
2866
|
-
options,
|
|
2867
|
-
...normalizeParams(params)
|
|
2868
|
-
});
|
|
2869
|
-
}
|
|
2870
|
-
const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
2871
|
-
$ZodIntersection.init(inst, def);
|
|
2872
|
-
ZodType.init(inst, def);
|
|
2873
|
-
});
|
|
2874
|
-
function intersection(left, right) {
|
|
2875
|
-
return new ZodIntersection({
|
|
2876
|
-
type: "intersection",
|
|
2877
|
-
left,
|
|
2878
|
-
right
|
|
2879
|
-
});
|
|
2880
|
-
}
|
|
2881
|
-
const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
2882
|
-
$ZodEnum.init(inst, def);
|
|
2883
|
-
ZodType.init(inst, def);
|
|
2884
|
-
inst.enum = def.entries;
|
|
2885
|
-
inst.options = Object.values(def.entries);
|
|
2886
|
-
const keys = new Set(Object.keys(def.entries));
|
|
2887
|
-
inst.extract = (values, params) => {
|
|
2888
|
-
const newEntries = {};
|
|
2889
|
-
for (const value of values) {
|
|
2890
|
-
if (keys.has(value)) {
|
|
2891
|
-
newEntries[value] = def.entries[value];
|
|
2892
|
-
} else
|
|
2893
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
2894
|
-
}
|
|
2895
|
-
return new ZodEnum({
|
|
2896
|
-
...def,
|
|
2897
|
-
checks: [],
|
|
2898
|
-
...normalizeParams(params),
|
|
2899
|
-
entries: newEntries
|
|
2900
|
-
});
|
|
2901
|
-
};
|
|
2902
|
-
inst.exclude = (values, params) => {
|
|
2903
|
-
const newEntries = { ...def.entries };
|
|
2904
|
-
for (const value of values) {
|
|
2905
|
-
if (keys.has(value)) {
|
|
2906
|
-
delete newEntries[value];
|
|
2907
|
-
} else
|
|
2908
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
2909
|
-
}
|
|
2910
|
-
return new ZodEnum({
|
|
2911
|
-
...def,
|
|
2912
|
-
checks: [],
|
|
2913
|
-
...normalizeParams(params),
|
|
2914
|
-
entries: newEntries
|
|
2915
|
-
});
|
|
2916
|
-
};
|
|
2917
|
-
});
|
|
2918
|
-
function _enum(values, params) {
|
|
2919
|
-
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
2920
|
-
return new ZodEnum({
|
|
2921
|
-
type: "enum",
|
|
2922
|
-
entries,
|
|
2923
|
-
...normalizeParams(params)
|
|
2924
|
-
});
|
|
2925
|
-
}
|
|
2926
|
-
const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
2927
|
-
$ZodTransform.init(inst, def);
|
|
2928
|
-
ZodType.init(inst, def);
|
|
2929
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
2930
|
-
if (_ctx.direction === "backward") {
|
|
2931
|
-
throw new $ZodEncodeError(inst.constructor.name);
|
|
2932
|
-
}
|
|
2933
|
-
payload.addIssue = (issue$1) => {
|
|
2934
|
-
if (typeof issue$1 === "string") {
|
|
2935
|
-
payload.issues.push(issue(issue$1, payload.value, def));
|
|
2936
|
-
} else {
|
|
2937
|
-
const _issue = issue$1;
|
|
2938
|
-
if (_issue.fatal)
|
|
2939
|
-
_issue.continue = false;
|
|
2940
|
-
_issue.code ?? (_issue.code = "custom");
|
|
2941
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
2942
|
-
_issue.inst ?? (_issue.inst = inst);
|
|
2943
|
-
payload.issues.push(issue(_issue));
|
|
2944
|
-
}
|
|
2945
|
-
};
|
|
2946
|
-
const output = def.transform(payload.value, payload);
|
|
2947
|
-
if (output instanceof Promise) {
|
|
2948
|
-
return output.then((output2) => {
|
|
2949
|
-
payload.value = output2;
|
|
2950
|
-
return payload;
|
|
2951
|
-
});
|
|
2952
|
-
}
|
|
2953
|
-
payload.value = output;
|
|
2954
|
-
return payload;
|
|
2955
|
-
};
|
|
2956
|
-
});
|
|
2957
|
-
function transform(fn) {
|
|
2958
|
-
return new ZodTransform({
|
|
2959
|
-
type: "transform",
|
|
2960
|
-
transform: fn
|
|
2961
|
-
});
|
|
2962
|
-
}
|
|
2963
|
-
const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
2964
|
-
$ZodOptional.init(inst, def);
|
|
2965
|
-
ZodType.init(inst, def);
|
|
2966
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
2967
|
-
});
|
|
2968
|
-
function optional(innerType) {
|
|
2969
|
-
return new ZodOptional({
|
|
2970
|
-
type: "optional",
|
|
2971
|
-
innerType
|
|
2972
|
-
});
|
|
2973
|
-
}
|
|
2974
|
-
const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
2975
|
-
$ZodNullable.init(inst, def);
|
|
2976
|
-
ZodType.init(inst, def);
|
|
2977
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
2978
|
-
});
|
|
2979
|
-
function nullable(innerType) {
|
|
2980
|
-
return new ZodNullable({
|
|
2981
|
-
type: "nullable",
|
|
2982
|
-
innerType
|
|
2983
|
-
});
|
|
2984
|
-
}
|
|
2985
|
-
const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
2986
|
-
$ZodDefault.init(inst, def);
|
|
2987
|
-
ZodType.init(inst, def);
|
|
2988
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
2989
|
-
inst.removeDefault = inst.unwrap;
|
|
2990
|
-
});
|
|
2991
|
-
function _default(innerType, defaultValue) {
|
|
2992
|
-
return new ZodDefault({
|
|
2993
|
-
type: "default",
|
|
2994
|
-
innerType,
|
|
2995
|
-
get defaultValue() {
|
|
2996
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
2997
|
-
}
|
|
2998
|
-
});
|
|
2999
|
-
}
|
|
3000
|
-
const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
3001
|
-
$ZodPrefault.init(inst, def);
|
|
3002
|
-
ZodType.init(inst, def);
|
|
3003
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
3004
|
-
});
|
|
3005
|
-
function prefault(innerType, defaultValue) {
|
|
3006
|
-
return new ZodPrefault({
|
|
3007
|
-
type: "prefault",
|
|
3008
|
-
innerType,
|
|
3009
|
-
get defaultValue() {
|
|
3010
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
3011
|
-
}
|
|
3012
|
-
});
|
|
3013
|
-
}
|
|
3014
|
-
const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
3015
|
-
$ZodNonOptional.init(inst, def);
|
|
3016
|
-
ZodType.init(inst, def);
|
|
3017
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
3018
|
-
});
|
|
3019
|
-
function nonoptional(innerType, params) {
|
|
3020
|
-
return new ZodNonOptional({
|
|
3021
|
-
type: "nonoptional",
|
|
3022
|
-
innerType,
|
|
3023
|
-
...normalizeParams(params)
|
|
3024
|
-
});
|
|
3025
|
-
}
|
|
3026
|
-
const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
3027
|
-
$ZodCatch.init(inst, def);
|
|
3028
|
-
ZodType.init(inst, def);
|
|
3029
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
3030
|
-
inst.removeCatch = inst.unwrap;
|
|
3031
|
-
});
|
|
3032
|
-
function _catch(innerType, catchValue) {
|
|
3033
|
-
return new ZodCatch({
|
|
3034
|
-
type: "catch",
|
|
3035
|
-
innerType,
|
|
3036
|
-
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
3037
|
-
});
|
|
3038
|
-
}
|
|
3039
|
-
const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
3040
|
-
$ZodPipe.init(inst, def);
|
|
3041
|
-
ZodType.init(inst, def);
|
|
3042
|
-
inst.in = def.in;
|
|
3043
|
-
inst.out = def.out;
|
|
3044
|
-
});
|
|
3045
|
-
function pipe(in_, out) {
|
|
3046
|
-
return new ZodPipe({
|
|
3047
|
-
type: "pipe",
|
|
3048
|
-
in: in_,
|
|
3049
|
-
out
|
|
3050
|
-
// ...util.normalizeParams(params),
|
|
3051
|
-
});
|
|
3052
|
-
}
|
|
3053
|
-
const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
3054
|
-
$ZodReadonly.init(inst, def);
|
|
3055
|
-
ZodType.init(inst, def);
|
|
3056
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
3057
|
-
});
|
|
3058
|
-
function readonly(innerType) {
|
|
3059
|
-
return new ZodReadonly({
|
|
3060
|
-
type: "readonly",
|
|
3061
|
-
innerType
|
|
3062
|
-
});
|
|
3063
|
-
}
|
|
3064
|
-
const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
3065
|
-
$ZodCustom.init(inst, def);
|
|
3066
|
-
ZodType.init(inst, def);
|
|
3067
|
-
});
|
|
3068
|
-
function refine(fn, _params = {}) {
|
|
3069
|
-
return _refine(ZodCustom, fn, _params);
|
|
3070
|
-
}
|
|
3071
|
-
function superRefine(fn) {
|
|
3072
|
-
return _superRefine(fn);
|
|
3073
|
-
}
|
|
3074
1
|
const metadata = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0"], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268"], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264"], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0"], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0"], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1"], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684"], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]", "(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "(?:[025-7]\\d|44)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[024-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "(?:01\\d|8)\\d{7}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["0"]]]], "BL": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "8001\\d{5}|(?:[2-467]\\d|50)\\d{6}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[235]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37|86)", "300|4(?:0(?:0|20)|370|864)"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[178]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "(?:[27]\\d{3}|8776)\\d{4}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[278]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["60|809"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9(?:10|[2-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|9[14]"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, "528[89]"], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0"], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]]], "ET": ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0"], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", 0, "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))"], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0"], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1"], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, "0|180020", 0, 0, 0, [["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}", [9, 10]], ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473"], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0"], "GF": ["594", "00", "(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0"], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0|180020", "1481$1", 0, 0, [["1481[25-9]\\d{5}", [10]], ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]]], "GH": ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0"], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]]], "GP": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671"], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]]], "HR": ["385", "00", "[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}", [7, 8, 9], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0"], "HT": ["509", "00", "[2-589]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06"], "ID": ["62", "00[89]", "00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0"], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0"], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0|180020", "1624$1", 0, "74576|(?:16|7[56])24"], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["1(?:6|8[06])", "1(?:6|8[06]0)"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], 0, 0, 0, 0, 0, 0, [["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0|180020", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["3|4(?:2[09]|7[01])|6[1-9]", "3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[25-9]"], "0$1"]], "0", 0, "(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "(?:33622|8\\d{8})\\d{5}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "33622|7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["3"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["2(?:[0367]|4[3-8])"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|78|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[45]"], "0$1"], ["(\\d{4})(\\d{5})", "$1-$2", ["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8"], "0$1"], ["(\\d{3})(\\d{6})", "$1-$2", ["[5-7]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-8]|5[0-5]|8[0-7]))\\d{6}"], ["80[0-7]\\d{6}"], ["89\\d{7}"], 0, 0, 0, 0, ["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]], "MC": ["377", "00", "(?:[3489]|[67]\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[67]"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1"], "NG": ["234", "009", "(?:20|9\\d)\\d{8}|[78]\\d{9,13}", [10, 11, 12, 13, 14], [["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0"], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0"], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]"], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0"], "NR": ["674", "00", "(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[24-9]"]]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, 0, "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], "PM": ["508", "00", "[45]\\d{5}|(?:708|8\\d\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "PY": ["595", "00", "59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[136]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "709\\d{6}|(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"], ["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, 0, [["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}", [10]], ["9\\d{9}", [10]], ["8(?:0[04]|108\\d{3})\\d{7}"], ["80[39]\\d{7}", [10]], ["808\\d{7}", [10]]], "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "(?:[15]\\d|800|92)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|7[67]|9[2-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|[6-8]\\d|90)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "(?:[267]\\d\\d|500)\\d{5}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[25-7]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-359]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-4]|5[1-3]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[59]"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|30|[689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[236-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "(?:[0-57-9]\\d|66)\\d{7}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["\\d"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|61[06])", "5(?:[0-59]|61[06]1)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0"], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868"], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0"], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0"], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"], 0, 0, 0, ["305209\\d{4}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{4,5})", "$1", ["21"]], ["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}", [9], 0, "0", 0, 0, 0, 0, 0, [["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"], ["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|[579]\\d|63)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[579]"], "0$1"]], "0"], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[235-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"], 0, 0, 0, 0, 0, 0, ["2\\d{8}", [9]]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
|
|
3075
2
|
function withMetadataArgument(func, _arguments) {
|
|
3076
3
|
var args = Array.prototype.slice.call(_arguments);
|
|
@@ -3096,8 +23,8 @@ function compare(a, b) {
|
|
|
3096
23
|
return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;
|
|
3097
24
|
}
|
|
3098
25
|
var objectConstructor = {}.constructor;
|
|
3099
|
-
function isObject(
|
|
3100
|
-
return
|
|
26
|
+
function isObject(object) {
|
|
27
|
+
return object !== void 0 && object !== null && object.constructor === objectConstructor;
|
|
3101
28
|
}
|
|
3102
29
|
function _typeof$2(o) {
|
|
3103
30
|
"@babel/helpers - typeof";
|
|
@@ -3611,18 +538,18 @@ function getCountryCallingCode(country, metadata2) {
|
|
|
3611
538
|
throw new Error("Unknown country: ".concat(country));
|
|
3612
539
|
}
|
|
3613
540
|
function setVersion(metadata2) {
|
|
3614
|
-
var
|
|
3615
|
-
if (typeof
|
|
3616
|
-
this.v1 =
|
|
3617
|
-
this.v2 =
|
|
3618
|
-
this.v3 =
|
|
3619
|
-
this.v4 =
|
|
541
|
+
var version = metadata2.version;
|
|
542
|
+
if (typeof version === "number") {
|
|
543
|
+
this.v1 = version === 1;
|
|
544
|
+
this.v2 = version === 2;
|
|
545
|
+
this.v3 = version === 3;
|
|
546
|
+
this.v4 = version === 4;
|
|
3620
547
|
} else {
|
|
3621
|
-
if (!
|
|
548
|
+
if (!version) {
|
|
3622
549
|
this.v1 = true;
|
|
3623
|
-
} else if (compare(
|
|
550
|
+
} else if (compare(version, V3) === -1) {
|
|
3624
551
|
this.v2 = true;
|
|
3625
|
-
} else if (compare(
|
|
552
|
+
} else if (compare(version, V4) === -1) {
|
|
3626
553
|
this.v3 = true;
|
|
3627
554
|
} else {
|
|
3628
555
|
this.v4 = true;
|
|
@@ -4660,9 +1587,9 @@ function _arrayLikeToArray(r, a) {
|
|
|
4660
1587
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4661
1588
|
return n;
|
|
4662
1589
|
}
|
|
4663
|
-
function parseIncompletePhoneNumber(
|
|
1590
|
+
function parseIncompletePhoneNumber(string) {
|
|
4664
1591
|
var result2 = "";
|
|
4665
|
-
for (var _iterator = _createForOfIteratorHelperLoose(
|
|
1592
|
+
for (var _iterator = _createForOfIteratorHelperLoose(string.split("")), _step; !(_step = _iterator()).done; ) {
|
|
4666
1593
|
var character = _step.value;
|
|
4667
1594
|
result2 += parsePhoneNumberCharacter(character, result2) || "";
|
|
4668
1595
|
}
|
|
@@ -4970,120 +1897,6 @@ function isValidNumber$1() {
|
|
|
4970
1897
|
function isValidNumber() {
|
|
4971
1898
|
return withMetadataArgument(isValidNumber$1, arguments);
|
|
4972
1899
|
}
|
|
4973
|
-
const Route$1 = "/api/rb/auth/sign-in";
|
|
4974
|
-
const requestSchema$1 = object({
|
|
4975
|
-
email_or_phone: string().nonempty("Email or phone number is required").default("").refine(
|
|
4976
|
-
(value) => {
|
|
4977
|
-
const isEmail = string().email().safeParse(value).success;
|
|
4978
|
-
const isPhone = isValidNumber(value);
|
|
4979
|
-
return isEmail || isPhone;
|
|
4980
|
-
},
|
|
4981
|
-
"Please enter a valid email address or phone number"
|
|
4982
|
-
),
|
|
4983
|
-
remember_me: boolean().default(true)
|
|
4984
|
-
});
|
|
4985
|
-
object({
|
|
4986
|
-
success: boolean()
|
|
4987
|
-
});
|
|
4988
|
-
const SignInForm = ({
|
|
4989
|
-
children,
|
|
4990
|
-
className
|
|
4991
|
-
}) => {
|
|
4992
|
-
const methods = useForm({
|
|
4993
|
-
defaultValues: {
|
|
4994
|
-
email_or_phone: "",
|
|
4995
|
-
remember_me: true
|
|
4996
|
-
},
|
|
4997
|
-
resolver: zodResolver(requestSchema$1)
|
|
4998
|
-
});
|
|
4999
|
-
const onSubmit = async (data) => {
|
|
5000
|
-
console.log("SUBMIT SIGNIN", data);
|
|
5001
|
-
};
|
|
5002
|
-
useEffect(() => {
|
|
5003
|
-
console.log(methods.formState.errors);
|
|
5004
|
-
}, [methods.formState.errors]);
|
|
5005
|
-
return /* @__PURE__ */ jsx(FormProvider, { ...methods, children: /* @__PURE__ */ jsx("form", { method: "post", noValidate: true, className, onSubmit: methods.handleSubmit(onSubmit), children }) });
|
|
5006
|
-
};
|
|
5007
|
-
const Route = "/api/rb/auth/sign-up";
|
|
5008
|
-
const requestSchema = object({
|
|
5009
|
-
email_or_phone: string().nonempty("Email or phone number is required").refine(
|
|
5010
|
-
(value) => {
|
|
5011
|
-
const isEmail = string().email().safeParse(value).success;
|
|
5012
|
-
const isPhone = isValidNumber(value);
|
|
5013
|
-
return isEmail || isPhone;
|
|
5014
|
-
},
|
|
5015
|
-
"Please enter a valid email address or phone number"
|
|
5016
|
-
),
|
|
5017
|
-
password: string().min(8, { message: "Password must be at least 8 characters long." }),
|
|
5018
|
-
password_confirmation: string().nonempty({ message: "Please confirm your password." })
|
|
5019
|
-
}).refine((data) => data.password === data.password_confirmation, {
|
|
5020
|
-
message: "Passwords do not match.",
|
|
5021
|
-
path: ["password_confirmation"]
|
|
5022
|
-
});
|
|
5023
|
-
object({
|
|
5024
|
-
success: boolean()
|
|
5025
|
-
});
|
|
5026
|
-
const SignUpForm = ({
|
|
5027
|
-
children,
|
|
5028
|
-
className
|
|
5029
|
-
}) => {
|
|
5030
|
-
const methods = useForm({
|
|
5031
|
-
defaultValues: {
|
|
5032
|
-
email_or_phone: "",
|
|
5033
|
-
password: "",
|
|
5034
|
-
password_confirmation: ""
|
|
5035
|
-
},
|
|
5036
|
-
resolver: zodResolver(requestSchema)
|
|
5037
|
-
});
|
|
5038
|
-
const onSubmit = async (data) => {
|
|
5039
|
-
console.log("SUBMIT SIGNUp", data);
|
|
5040
|
-
};
|
|
5041
|
-
useEffect(() => {
|
|
5042
|
-
console.log(methods.formState.errors);
|
|
5043
|
-
}, [methods.formState.errors]);
|
|
5044
|
-
return /* @__PURE__ */ jsx(FormProvider, { ...methods, children: /* @__PURE__ */ jsx("form", { method: "post", noValidate: true, className, onSubmit: methods.handleSubmit(onSubmit), children }) });
|
|
5045
|
-
};
|
|
5046
|
-
const RememberMeCheckbox = ({
|
|
5047
|
-
label,
|
|
5048
|
-
as: Component = "input"
|
|
5049
|
-
}) => {
|
|
5050
|
-
const { register } = useFormContext();
|
|
5051
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5052
|
-
/* @__PURE__ */ jsx(
|
|
5053
|
-
Component,
|
|
5054
|
-
{
|
|
5055
|
-
id: "remember_me",
|
|
5056
|
-
...register("remember_me")
|
|
5057
|
-
}
|
|
5058
|
-
),
|
|
5059
|
-
/* @__PURE__ */ jsx(
|
|
5060
|
-
"label",
|
|
5061
|
-
{
|
|
5062
|
-
htmlFor: "remember_me",
|
|
5063
|
-
className: "pl-2 block text-sm/6 text-gray-900",
|
|
5064
|
-
children: label
|
|
5065
|
-
}
|
|
5066
|
-
)
|
|
5067
|
-
] });
|
|
5068
|
-
};
|
|
5069
|
-
const routes = Object.entries({
|
|
5070
|
-
.../* @__PURE__ */ Object.assign({ "./api/sign-in/handler.ts": () => import("./handler-agHFe1sA.js"), "./api/sign-out/handler.ts": () => import("./handler-BGIQUixx.js"), "./api/sign-up/handler.ts": () => import("./handler-DAT7ZSyq.js") })
|
|
5071
|
-
}).reduce((acc, [path, mod]) => {
|
|
5072
|
-
acc[path.replace("./api/", "@rpcbase/auth/api/")] = mod;
|
|
5073
|
-
return acc;
|
|
5074
|
-
}, {});
|
|
5075
1900
|
export {
|
|
5076
|
-
|
|
5077
|
-
EmailOrPhoneInput as E,
|
|
5078
|
-
Route$1 as R,
|
|
5079
|
-
SignInForm as S,
|
|
5080
|
-
Route as a,
|
|
5081
|
-
boolean as b,
|
|
5082
|
-
requestSchema as c,
|
|
5083
|
-
AppleSignInButton as d,
|
|
5084
|
-
SignUpForm as e,
|
|
5085
|
-
RememberMeCheckbox as f,
|
|
5086
|
-
routes as g,
|
|
5087
|
-
object as o,
|
|
5088
|
-
requestSchema$1 as r
|
|
1901
|
+
isValidNumber as i
|
|
5089
1902
|
};
|