drizzle-kit 0.31.1-d1468f0 → 0.31.2-6baabce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (9) hide show
  1. package/api.d.mts +421 -421
  2. package/api.d.ts +421 -421
  3. package/api.js +598 -438
  4. package/api.mjs +598 -437
  5. package/bin.cjs +21467 -20122
  6. package/index.js +3 -3
  7. package/package.json +10 -11
  8. package/utils.js +266 -152
  9. package/utils.mjs +266 -152
package/api.mjs CHANGED
@@ -40,7 +40,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
40
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
41
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
42
42
 
43
- // ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
43
+ // ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js
44
44
  function assembleStyles() {
45
45
  const codes = /* @__PURE__ */ new Map();
46
46
  for (const [groupName, group] of Object.entries(styles)) {
@@ -157,7 +157,7 @@ function assembleStyles() {
157
157
  }
158
158
  var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
159
159
  var init_ansi_styles = __esm({
160
- "../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
160
+ "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
161
161
  "use strict";
162
162
  ANSI_BACKGROUND_OFFSET = 10;
163
163
  wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -232,7 +232,7 @@ var init_ansi_styles = __esm({
232
232
  }
233
233
  });
234
234
 
235
- // ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
235
+ // ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
236
236
  import process2 from "process";
237
237
  import os from "os";
238
238
  import tty from "tty";
@@ -299,10 +299,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
299
299
  return 1;
300
300
  }
301
301
  if ("CI" in env) {
302
- if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
302
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
303
303
  return 3;
304
304
  }
305
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
305
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
306
306
  return 1;
307
307
  }
308
308
  return min2;
@@ -347,7 +347,7 @@ function createSupportsColor(stream, options = {}) {
347
347
  }
348
348
  var env, flagForceColor, supportsColor, supports_color_default;
349
349
  var init_supports_color = __esm({
350
- "../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
350
+ "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js"() {
351
351
  "use strict";
352
352
  ({ env } = process2);
353
353
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
@@ -363,7 +363,7 @@ var init_supports_color = __esm({
363
363
  }
364
364
  });
365
365
 
366
- // ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
366
+ // ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js
367
367
  function stringReplaceAll(string, substring, replacer) {
368
368
  let index6 = string.indexOf(substring);
369
369
  if (index6 === -1) {
@@ -393,18 +393,18 @@ function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index6) {
393
393
  return returnValue;
394
394
  }
395
395
  var init_utilities = __esm({
396
- "../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js"() {
396
+ "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/utilities.js"() {
397
397
  "use strict";
398
398
  }
399
399
  });
400
400
 
401
- // ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
401
+ // ../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js
402
402
  function createChalk(options) {
403
403
  return chalkFactory(options);
404
404
  }
405
405
  var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
406
406
  var init_source = __esm({
407
- "../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"() {
407
+ "../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"() {
408
408
  "use strict";
409
409
  init_ansi_styles();
410
410
  init_supports_color();
@@ -1311,6 +1311,7 @@ var require_minimatch = __commonJS({
1311
1311
  continue;
1312
1312
  }
1313
1313
  switch (c) {
1314
+ /* istanbul ignore next */
1314
1315
  case "/": {
1315
1316
  return false;
1316
1317
  }
@@ -1322,6 +1323,8 @@ var require_minimatch = __commonJS({
1322
1323
  clearStateChar();
1323
1324
  escaping = true;
1324
1325
  continue;
1326
+ // the various stateChar values
1327
+ // for the "extglob" stuff.
1325
1328
  case "?":
1326
1329
  case "*":
1327
1330
  case "+":
@@ -1396,6 +1399,7 @@ var require_minimatch = __commonJS({
1396
1399
  }
1397
1400
  continue;
1398
1401
  }
1402
+ // these are mostly the same in regexp and glob
1399
1403
  case "[":
1400
1404
  clearStateChar();
1401
1405
  if (inClass) {
@@ -1904,6 +1908,7 @@ var require_sync = __commonJS({
1904
1908
  }
1905
1909
  var prefix2;
1906
1910
  switch (n) {
1911
+ // if not, then this is rather simple
1907
1912
  case pattern.length:
1908
1913
  this._processSimple(pattern.join("/"), index6);
1909
1914
  return;
@@ -2065,6 +2070,7 @@ var require_sync = __commonJS({
2065
2070
  GlobSync.prototype._readdirError = function(f, er) {
2066
2071
  switch (er.code) {
2067
2072
  case "ENOTSUP":
2073
+ // https://github.com/isaacs/node-glob/issues/205
2068
2074
  case "ENOTDIR":
2069
2075
  var abs = this._makeAbs(f);
2070
2076
  this.cache[abs] = "FILE";
@@ -2076,6 +2082,7 @@ var require_sync = __commonJS({
2076
2082
  }
2077
2083
  break;
2078
2084
  case "ENOENT":
2085
+ // not terribly unusual
2079
2086
  case "ELOOP":
2080
2087
  case "ENAMETOOLONG":
2081
2088
  case "UNKNOWN":
@@ -2527,6 +2534,7 @@ var require_glob = __commonJS({
2527
2534
  }
2528
2535
  var prefix2;
2529
2536
  switch (n) {
2537
+ // if not, then this is rather simple
2530
2538
  case pattern.length:
2531
2539
  this._processSimple(pattern.join("/"), index6, cb);
2532
2540
  return;
@@ -2716,6 +2724,7 @@ var require_glob = __commonJS({
2716
2724
  return;
2717
2725
  switch (er.code) {
2718
2726
  case "ENOTSUP":
2727
+ // https://github.com/isaacs/node-glob/issues/205
2719
2728
  case "ENOTDIR":
2720
2729
  var abs = this._makeAbs(f);
2721
2730
  this.cache[abs] = "FILE";
@@ -2728,6 +2737,7 @@ var require_glob = __commonJS({
2728
2737
  }
2729
2738
  break;
2730
2739
  case "ENOENT":
2740
+ // not terribly unusual
2731
2741
  case "ELOOP":
2732
2742
  case "ENAMETOOLONG":
2733
2743
  case "UNKNOWN":
@@ -3433,176 +3443,14 @@ var init_global = __esm({
3433
3443
  }
3434
3444
  });
3435
3445
 
3436
- // ../node_modules/.pnpm/zod@3.23.7/node_modules/zod/lib/index.mjs
3437
- function getErrorMap() {
3438
- return overrideErrorMap;
3439
- }
3440
- function addIssueToContext(ctx, issueData) {
3441
- const overrideMap = getErrorMap();
3442
- const issue = makeIssue({
3443
- issueData,
3444
- data: ctx.data,
3445
- path: ctx.path,
3446
- errorMaps: [
3447
- ctx.common.contextualErrorMap,
3448
- ctx.schemaErrorMap,
3449
- overrideMap,
3450
- overrideMap === errorMap ? void 0 : errorMap
3451
- // then global default map
3452
- ].filter((x) => !!x)
3453
- });
3454
- ctx.common.issues.push(issue);
3455
- }
3456
- function __classPrivateFieldGet(receiver, state, kind, f) {
3457
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3458
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3459
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
3460
- }
3461
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
3462
- if (kind === "m") throw new TypeError("Private method is not writable");
3463
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
3464
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3465
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
3466
- }
3467
- function processCreateParams(params) {
3468
- if (!params)
3469
- return {};
3470
- const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
3471
- if (errorMap2 && (invalid_type_error || required_error)) {
3472
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
3473
- }
3474
- if (errorMap2)
3475
- return { errorMap: errorMap2, description };
3476
- const customMap = (iss, ctx) => {
3477
- var _a437, _b326;
3478
- const { message } = params;
3479
- if (iss.code === "invalid_enum_value") {
3480
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
3481
- }
3482
- if (typeof ctx.data === "undefined") {
3483
- return { message: (_a437 = message !== null && message !== void 0 ? message : required_error) !== null && _a437 !== void 0 ? _a437 : ctx.defaultError };
3484
- }
3485
- if (iss.code !== "invalid_type")
3486
- return { message: ctx.defaultError };
3487
- return { message: (_b326 = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b326 !== void 0 ? _b326 : ctx.defaultError };
3488
- };
3489
- return { errorMap: customMap, description };
3490
- }
3491
- function timeRegexSource(args) {
3492
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
3493
- if (args.precision) {
3494
- regex = `${regex}\\.\\d{${args.precision}}`;
3495
- } else if (args.precision == null) {
3496
- regex = `${regex}(\\.\\d+)?`;
3497
- }
3498
- return regex;
3499
- }
3500
- function timeRegex(args) {
3501
- return new RegExp(`^${timeRegexSource(args)}$`);
3502
- }
3503
- function datetimeRegex(args) {
3504
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
3505
- const opts = [];
3506
- opts.push(args.local ? `Z?` : `Z`);
3507
- if (args.offset)
3508
- opts.push(`([+-]\\d{2}:?\\d{2})`);
3509
- regex = `${regex}(${opts.join("|")})`;
3510
- return new RegExp(`^${regex}$`);
3511
- }
3512
- function isValidIP(ip, version2) {
3513
- if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
3514
- return true;
3515
- }
3516
- if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
3517
- return true;
3518
- }
3519
- return false;
3520
- }
3521
- function floatSafeRemainder(val, step) {
3522
- const valDecCount = (val.toString().split(".")[1] || "").length;
3523
- const stepDecCount = (step.toString().split(".")[1] || "").length;
3524
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
3525
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
3526
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
3527
- return valInt % stepInt / Math.pow(10, decCount);
3528
- }
3529
- function deepPartialify(schema5) {
3530
- if (schema5 instanceof ZodObject) {
3531
- const newShape = {};
3532
- for (const key in schema5.shape) {
3533
- const fieldSchema = schema5.shape[key];
3534
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
3535
- }
3536
- return new ZodObject({
3537
- ...schema5._def,
3538
- shape: () => newShape
3539
- });
3540
- } else if (schema5 instanceof ZodArray) {
3541
- return new ZodArray({
3542
- ...schema5._def,
3543
- type: deepPartialify(schema5.element)
3544
- });
3545
- } else if (schema5 instanceof ZodOptional) {
3546
- return ZodOptional.create(deepPartialify(schema5.unwrap()));
3547
- } else if (schema5 instanceof ZodNullable) {
3548
- return ZodNullable.create(deepPartialify(schema5.unwrap()));
3549
- } else if (schema5 instanceof ZodTuple) {
3550
- return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
3551
- } else {
3552
- return schema5;
3553
- }
3554
- }
3555
- function mergeValues(a, b) {
3556
- const aType = getParsedType(a);
3557
- const bType = getParsedType(b);
3558
- if (a === b) {
3559
- return { valid: true, data: a };
3560
- } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
3561
- const bKeys = util.objectKeys(b);
3562
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
3563
- const newObj = { ...a, ...b };
3564
- for (const key of sharedKeys) {
3565
- const sharedValue = mergeValues(a[key], b[key]);
3566
- if (!sharedValue.valid) {
3567
- return { valid: false };
3568
- }
3569
- newObj[key] = sharedValue.data;
3570
- }
3571
- return { valid: true, data: newObj };
3572
- } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
3573
- if (a.length !== b.length) {
3574
- return { valid: false };
3575
- }
3576
- const newArray = [];
3577
- for (let index6 = 0; index6 < a.length; index6++) {
3578
- const itemA = a[index6];
3579
- const itemB = b[index6];
3580
- const sharedValue = mergeValues(itemA, itemB);
3581
- if (!sharedValue.valid) {
3582
- return { valid: false };
3583
- }
3584
- newArray.push(sharedValue.data);
3585
- }
3586
- return { valid: true, data: newArray };
3587
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
3588
- return { valid: true, data: a };
3589
- } else {
3590
- return { valid: false };
3591
- }
3592
- }
3593
- function createZodEnum(values, params) {
3594
- return new ZodEnum({
3595
- values,
3596
- typeName: ZodFirstPartyTypeKind.ZodEnum,
3597
- ...processCreateParams(params)
3598
- });
3599
- }
3600
- var util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv6Regex, base64Regex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, coerce;
3601
- var init_lib = __esm({
3602
- "../node_modules/.pnpm/zod@3.23.7/node_modules/zod/lib/index.mjs"() {
3446
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js
3447
+ var util, objectUtil, ZodParsedType, getParsedType;
3448
+ var init_util = __esm({
3449
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/util.js"() {
3603
3450
  "use strict";
3604
3451
  (function(util2) {
3605
- util2.assertEqual = (val) => val;
3452
+ util2.assertEqual = (_2) => {
3453
+ };
3606
3454
  function assertIs(_arg) {
3607
3455
  }
3608
3456
  util2.assertIs = assertIs;
@@ -3646,7 +3494,7 @@ var init_lib = __esm({
3646
3494
  }
3647
3495
  return void 0;
3648
3496
  };
3649
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
3497
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
3650
3498
  function joinValues(array2, separator = " | ") {
3651
3499
  return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
3652
3500
  }
@@ -3697,7 +3545,7 @@ var init_lib = __esm({
3697
3545
  case "string":
3698
3546
  return ZodParsedType.string;
3699
3547
  case "number":
3700
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
3548
+ return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
3701
3549
  case "boolean":
3702
3550
  return ZodParsedType.boolean;
3703
3551
  case "function":
@@ -3730,6 +3578,15 @@ var init_lib = __esm({
3730
3578
  return ZodParsedType.unknown;
3731
3579
  }
3732
3580
  };
3581
+ }
3582
+ });
3583
+
3584
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js
3585
+ var ZodIssueCode, ZodError;
3586
+ var init_ZodError = __esm({
3587
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/ZodError.js"() {
3588
+ "use strict";
3589
+ init_util();
3733
3590
  ZodIssueCode = util.arrayToEnum([
3734
3591
  "invalid_type",
3735
3592
  "invalid_literal",
@@ -3749,6 +3606,9 @@ var init_lib = __esm({
3749
3606
  "not_finite"
3750
3607
  ]);
3751
3608
  ZodError = class _ZodError extends Error {
3609
+ get errors() {
3610
+ return this.issues;
3611
+ }
3752
3612
  constructor(issues) {
3753
3613
  super();
3754
3614
  this.issues = [];
@@ -3767,9 +3627,6 @@ var init_lib = __esm({
3767
3627
  this.name = "ZodError";
3768
3628
  this.issues = issues;
3769
3629
  }
3770
- get errors() {
3771
- return this.issues;
3772
- }
3773
3630
  format(_mapper) {
3774
3631
  const mapper = _mapper || function(issue) {
3775
3632
  return issue.message;
@@ -3841,6 +3698,16 @@ var init_lib = __esm({
3841
3698
  const error2 = new ZodError(issues);
3842
3699
  return error2;
3843
3700
  };
3701
+ }
3702
+ });
3703
+
3704
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js
3705
+ var errorMap, en_default;
3706
+ var init_en = __esm({
3707
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/locales/en.js"() {
3708
+ "use strict";
3709
+ init_ZodError();
3710
+ init_util();
3844
3711
  errorMap = (issue, _ctx) => {
3845
3712
  let message;
3846
3713
  switch (issue.code) {
@@ -3939,7 +3806,49 @@ var init_lib = __esm({
3939
3806
  }
3940
3807
  return { message };
3941
3808
  };
3942
- overrideErrorMap = errorMap;
3809
+ en_default = errorMap;
3810
+ }
3811
+ });
3812
+
3813
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js
3814
+ function getErrorMap() {
3815
+ return overrideErrorMap;
3816
+ }
3817
+ var overrideErrorMap;
3818
+ var init_errors = __esm({
3819
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/errors.js"() {
3820
+ "use strict";
3821
+ init_en();
3822
+ overrideErrorMap = en_default;
3823
+ }
3824
+ });
3825
+
3826
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js
3827
+ function addIssueToContext(ctx, issueData) {
3828
+ const overrideMap = getErrorMap();
3829
+ const issue = makeIssue({
3830
+ issueData,
3831
+ data: ctx.data,
3832
+ path: ctx.path,
3833
+ errorMaps: [
3834
+ ctx.common.contextualErrorMap,
3835
+ // contextual error map is first priority
3836
+ ctx.schemaErrorMap,
3837
+ // then schema-bound map if available
3838
+ overrideMap,
3839
+ // then global override map
3840
+ overrideMap === en_default ? void 0 : en_default
3841
+ // then global default map
3842
+ ].filter((x) => !!x)
3843
+ });
3844
+ ctx.common.issues.push(issue);
3845
+ }
3846
+ var makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync;
3847
+ var init_parseUtil = __esm({
3848
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/parseUtil.js"() {
3849
+ "use strict";
3850
+ init_errors();
3851
+ init_en();
3943
3852
  makeIssue = (params) => {
3944
3853
  const { data, path: path2, errorMaps, issueData } = params;
3945
3854
  const fullPath = [...path2, ...issueData.path || []];
@@ -4028,10 +3937,200 @@ var init_lib = __esm({
4028
3937
  isDirty = (x) => x.status === "dirty";
4029
3938
  isValid = (x) => x.status === "valid";
4030
3939
  isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
3940
+ }
3941
+ });
3942
+
3943
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js
3944
+ var init_typeAliases = __esm({
3945
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/typeAliases.js"() {
3946
+ "use strict";
3947
+ }
3948
+ });
3949
+
3950
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js
3951
+ var errorUtil;
3952
+ var init_errorUtil = __esm({
3953
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/helpers/errorUtil.js"() {
3954
+ "use strict";
4031
3955
  (function(errorUtil2) {
4032
3956
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
4033
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
3957
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
4034
3958
  })(errorUtil || (errorUtil = {}));
3959
+ }
3960
+ });
3961
+
3962
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js
3963
+ function processCreateParams(params) {
3964
+ if (!params)
3965
+ return {};
3966
+ const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
3967
+ if (errorMap2 && (invalid_type_error || required_error)) {
3968
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
3969
+ }
3970
+ if (errorMap2)
3971
+ return { errorMap: errorMap2, description };
3972
+ const customMap = (iss, ctx) => {
3973
+ const { message } = params;
3974
+ if (iss.code === "invalid_enum_value") {
3975
+ return { message: message ?? ctx.defaultError };
3976
+ }
3977
+ if (typeof ctx.data === "undefined") {
3978
+ return { message: message ?? required_error ?? ctx.defaultError };
3979
+ }
3980
+ if (iss.code !== "invalid_type")
3981
+ return { message: ctx.defaultError };
3982
+ return { message: message ?? invalid_type_error ?? ctx.defaultError };
3983
+ };
3984
+ return { errorMap: customMap, description };
3985
+ }
3986
+ function timeRegexSource(args) {
3987
+ let secondsRegexSource = `[0-5]\\d`;
3988
+ if (args.precision) {
3989
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
3990
+ } else if (args.precision == null) {
3991
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
3992
+ }
3993
+ const secondsQuantifier = args.precision ? "+" : "?";
3994
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
3995
+ }
3996
+ function timeRegex(args) {
3997
+ return new RegExp(`^${timeRegexSource(args)}$`);
3998
+ }
3999
+ function datetimeRegex(args) {
4000
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
4001
+ const opts = [];
4002
+ opts.push(args.local ? `Z?` : `Z`);
4003
+ if (args.offset)
4004
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
4005
+ regex = `${regex}(${opts.join("|")})`;
4006
+ return new RegExp(`^${regex}$`);
4007
+ }
4008
+ function isValidIP(ip, version2) {
4009
+ if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
4010
+ return true;
4011
+ }
4012
+ if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
4013
+ return true;
4014
+ }
4015
+ return false;
4016
+ }
4017
+ function isValidJWT(jwt, alg) {
4018
+ if (!jwtRegex.test(jwt))
4019
+ return false;
4020
+ try {
4021
+ const [header] = jwt.split(".");
4022
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
4023
+ const decoded = JSON.parse(atob(base64));
4024
+ if (typeof decoded !== "object" || decoded === null)
4025
+ return false;
4026
+ if ("typ" in decoded && decoded?.typ !== "JWT")
4027
+ return false;
4028
+ if (!decoded.alg)
4029
+ return false;
4030
+ if (alg && decoded.alg !== alg)
4031
+ return false;
4032
+ return true;
4033
+ } catch {
4034
+ return false;
4035
+ }
4036
+ }
4037
+ function isValidCidr(ip, version2) {
4038
+ if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
4039
+ return true;
4040
+ }
4041
+ if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
4042
+ return true;
4043
+ }
4044
+ return false;
4045
+ }
4046
+ function floatSafeRemainder(val, step) {
4047
+ const valDecCount = (val.toString().split(".")[1] || "").length;
4048
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
4049
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
4050
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
4051
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
4052
+ return valInt % stepInt / 10 ** decCount;
4053
+ }
4054
+ function deepPartialify(schema5) {
4055
+ if (schema5 instanceof ZodObject) {
4056
+ const newShape = {};
4057
+ for (const key in schema5.shape) {
4058
+ const fieldSchema = schema5.shape[key];
4059
+ newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
4060
+ }
4061
+ return new ZodObject({
4062
+ ...schema5._def,
4063
+ shape: () => newShape
4064
+ });
4065
+ } else if (schema5 instanceof ZodArray) {
4066
+ return new ZodArray({
4067
+ ...schema5._def,
4068
+ type: deepPartialify(schema5.element)
4069
+ });
4070
+ } else if (schema5 instanceof ZodOptional) {
4071
+ return ZodOptional.create(deepPartialify(schema5.unwrap()));
4072
+ } else if (schema5 instanceof ZodNullable) {
4073
+ return ZodNullable.create(deepPartialify(schema5.unwrap()));
4074
+ } else if (schema5 instanceof ZodTuple) {
4075
+ return ZodTuple.create(schema5.items.map((item) => deepPartialify(item)));
4076
+ } else {
4077
+ return schema5;
4078
+ }
4079
+ }
4080
+ function mergeValues(a, b) {
4081
+ const aType = getParsedType(a);
4082
+ const bType = getParsedType(b);
4083
+ if (a === b) {
4084
+ return { valid: true, data: a };
4085
+ } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
4086
+ const bKeys = util.objectKeys(b);
4087
+ const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
4088
+ const newObj = { ...a, ...b };
4089
+ for (const key of sharedKeys) {
4090
+ const sharedValue = mergeValues(a[key], b[key]);
4091
+ if (!sharedValue.valid) {
4092
+ return { valid: false };
4093
+ }
4094
+ newObj[key] = sharedValue.data;
4095
+ }
4096
+ return { valid: true, data: newObj };
4097
+ } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
4098
+ if (a.length !== b.length) {
4099
+ return { valid: false };
4100
+ }
4101
+ const newArray = [];
4102
+ for (let index6 = 0; index6 < a.length; index6++) {
4103
+ const itemA = a[index6];
4104
+ const itemB = b[index6];
4105
+ const sharedValue = mergeValues(itemA, itemB);
4106
+ if (!sharedValue.valid) {
4107
+ return { valid: false };
4108
+ }
4109
+ newArray.push(sharedValue.data);
4110
+ }
4111
+ return { valid: true, data: newArray };
4112
+ } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
4113
+ return { valid: true, data: a };
4114
+ } else {
4115
+ return { valid: false };
4116
+ }
4117
+ }
4118
+ function createZodEnum(values, params) {
4119
+ return new ZodEnum({
4120
+ values,
4121
+ typeName: ZodFirstPartyTypeKind.ZodEnum,
4122
+ ...processCreateParams(params)
4123
+ });
4124
+ }
4125
+ var ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, coerce;
4126
+ var init_types = __esm({
4127
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/types.js"() {
4128
+ "use strict";
4129
+ init_ZodError();
4130
+ init_errors();
4131
+ init_errorUtil();
4132
+ init_parseUtil();
4133
+ init_util();
4035
4134
  ParseInputLazyPath = class {
4036
4135
  constructor(parent, value, path2, key) {
4037
4136
  this._cachedPath = [];
@@ -4042,7 +4141,7 @@ var init_lib = __esm({
4042
4141
  }
4043
4142
  get path() {
4044
4143
  if (!this._cachedPath.length) {
4045
- if (this._key instanceof Array) {
4144
+ if (Array.isArray(this._key)) {
4046
4145
  this._cachedPath.push(...this._path, ...this._key);
4047
4146
  } else {
4048
4147
  this._cachedPath.push(...this._path, this._key);
@@ -4071,34 +4170,6 @@ var init_lib = __esm({
4071
4170
  }
4072
4171
  };
4073
4172
  ZodType = class {
4074
- constructor(def) {
4075
- this.spa = this.safeParseAsync;
4076
- this._def = def;
4077
- this.parse = this.parse.bind(this);
4078
- this.safeParse = this.safeParse.bind(this);
4079
- this.parseAsync = this.parseAsync.bind(this);
4080
- this.safeParseAsync = this.safeParseAsync.bind(this);
4081
- this.spa = this.spa.bind(this);
4082
- this.refine = this.refine.bind(this);
4083
- this.refinement = this.refinement.bind(this);
4084
- this.superRefine = this.superRefine.bind(this);
4085
- this.optional = this.optional.bind(this);
4086
- this.nullable = this.nullable.bind(this);
4087
- this.nullish = this.nullish.bind(this);
4088
- this.array = this.array.bind(this);
4089
- this.promise = this.promise.bind(this);
4090
- this.or = this.or.bind(this);
4091
- this.and = this.and.bind(this);
4092
- this.transform = this.transform.bind(this);
4093
- this.brand = this.brand.bind(this);
4094
- this.default = this.default.bind(this);
4095
- this.catch = this.catch.bind(this);
4096
- this.describe = this.describe.bind(this);
4097
- this.pipe = this.pipe.bind(this);
4098
- this.readonly = this.readonly.bind(this);
4099
- this.isNullable = this.isNullable.bind(this);
4100
- this.isOptional = this.isOptional.bind(this);
4101
- }
4102
4173
  get description() {
4103
4174
  return this._def.description;
4104
4175
  }
@@ -4146,14 +4217,13 @@ var init_lib = __esm({
4146
4217
  throw result.error;
4147
4218
  }
4148
4219
  safeParse(data, params) {
4149
- var _a437;
4150
4220
  const ctx = {
4151
4221
  common: {
4152
4222
  issues: [],
4153
- async: (_a437 = params === null || params === void 0 ? void 0 : params.async) !== null && _a437 !== void 0 ? _a437 : false,
4154
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
4223
+ async: params?.async ?? false,
4224
+ contextualErrorMap: params?.errorMap
4155
4225
  },
4156
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
4226
+ path: params?.path || [],
4157
4227
  schemaErrorMap: this._def.errorMap,
4158
4228
  parent: null,
4159
4229
  data,
@@ -4162,6 +4232,42 @@ var init_lib = __esm({
4162
4232
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
4163
4233
  return handleResult(ctx, result);
4164
4234
  }
4235
+ "~validate"(data) {
4236
+ const ctx = {
4237
+ common: {
4238
+ issues: [],
4239
+ async: !!this["~standard"].async
4240
+ },
4241
+ path: [],
4242
+ schemaErrorMap: this._def.errorMap,
4243
+ parent: null,
4244
+ data,
4245
+ parsedType: getParsedType(data)
4246
+ };
4247
+ if (!this["~standard"].async) {
4248
+ try {
4249
+ const result = this._parseSync({ data, path: [], parent: ctx });
4250
+ return isValid(result) ? {
4251
+ value: result.value
4252
+ } : {
4253
+ issues: ctx.common.issues
4254
+ };
4255
+ } catch (err) {
4256
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
4257
+ this["~standard"].async = true;
4258
+ }
4259
+ ctx.common = {
4260
+ issues: [],
4261
+ async: true
4262
+ };
4263
+ }
4264
+ }
4265
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
4266
+ value: result.value
4267
+ } : {
4268
+ issues: ctx.common.issues
4269
+ });
4270
+ }
4165
4271
  async parseAsync(data, params) {
4166
4272
  const result = await this.safeParseAsync(data, params);
4167
4273
  if (result.success)
@@ -4172,10 +4278,10 @@ var init_lib = __esm({
4172
4278
  const ctx = {
4173
4279
  common: {
4174
4280
  issues: [],
4175
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
4281
+ contextualErrorMap: params?.errorMap,
4176
4282
  async: true
4177
4283
  },
4178
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
4284
+ path: params?.path || [],
4179
4285
  schemaErrorMap: this._def.errorMap,
4180
4286
  parent: null,
4181
4287
  data,
@@ -4239,6 +4345,39 @@ var init_lib = __esm({
4239
4345
  superRefine(refinement) {
4240
4346
  return this._refinement(refinement);
4241
4347
  }
4348
+ constructor(def) {
4349
+ this.spa = this.safeParseAsync;
4350
+ this._def = def;
4351
+ this.parse = this.parse.bind(this);
4352
+ this.safeParse = this.safeParse.bind(this);
4353
+ this.parseAsync = this.parseAsync.bind(this);
4354
+ this.safeParseAsync = this.safeParseAsync.bind(this);
4355
+ this.spa = this.spa.bind(this);
4356
+ this.refine = this.refine.bind(this);
4357
+ this.refinement = this.refinement.bind(this);
4358
+ this.superRefine = this.superRefine.bind(this);
4359
+ this.optional = this.optional.bind(this);
4360
+ this.nullable = this.nullable.bind(this);
4361
+ this.nullish = this.nullish.bind(this);
4362
+ this.array = this.array.bind(this);
4363
+ this.promise = this.promise.bind(this);
4364
+ this.or = this.or.bind(this);
4365
+ this.and = this.and.bind(this);
4366
+ this.transform = this.transform.bind(this);
4367
+ this.brand = this.brand.bind(this);
4368
+ this.default = this.default.bind(this);
4369
+ this.catch = this.catch.bind(this);
4370
+ this.describe = this.describe.bind(this);
4371
+ this.pipe = this.pipe.bind(this);
4372
+ this.readonly = this.readonly.bind(this);
4373
+ this.isNullable = this.isNullable.bind(this);
4374
+ this.isOptional = this.isOptional.bind(this);
4375
+ this["~standard"] = {
4376
+ version: 1,
4377
+ vendor: "zod",
4378
+ validate: (data) => this["~validate"](data)
4379
+ };
4380
+ }
4242
4381
  optional() {
4243
4382
  return ZodOptional.create(this, this._def);
4244
4383
  }
@@ -4249,7 +4388,7 @@ var init_lib = __esm({
4249
4388
  return this.nullable().optional();
4250
4389
  }
4251
4390
  array() {
4252
- return ZodArray.create(this, this._def);
4391
+ return ZodArray.create(this);
4253
4392
  }
4254
4393
  promise() {
4255
4394
  return ZodPromise.create(this, this._def);
@@ -4315,15 +4454,19 @@ var init_lib = __esm({
4315
4454
  };
4316
4455
  cuidRegex = /^c[^\s-]{8,}$/i;
4317
4456
  cuid2Regex = /^[0-9a-z]+$/;
4318
- ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
4457
+ ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
4319
4458
  uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
4320
4459
  nanoidRegex = /^[a-z0-9_-]{21}$/i;
4460
+ jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
4321
4461
  durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
4322
4462
  emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
4323
4463
  _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
4324
4464
  ipv4Regex = /^(?:(?: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])$/;
4325
- ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
4465
+ ipv4CidrRegex = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/;
4466
+ ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
4467
+ ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
4326
4468
  base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
4469
+ base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
4327
4470
  dateRegexSource = `((\\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])))`;
4328
4471
  dateRegex = new RegExp(`^${dateRegexSource}$`);
4329
4472
  ZodString = class _ZodString extends ZodType {
@@ -4472,7 +4615,7 @@ var init_lib = __esm({
4472
4615
  } else if (check.kind === "url") {
4473
4616
  try {
4474
4617
  new URL(input.data);
4475
- } catch (_a437) {
4618
+ } catch {
4476
4619
  ctx = this._getOrReturnCtx(input, ctx);
4477
4620
  addIssueToContext(ctx, {
4478
4621
  validation: "url",
@@ -4582,6 +4725,26 @@ var init_lib = __esm({
4582
4725
  });
4583
4726
  status.dirty();
4584
4727
  }
4728
+ } else if (check.kind === "jwt") {
4729
+ if (!isValidJWT(input.data, check.alg)) {
4730
+ ctx = this._getOrReturnCtx(input, ctx);
4731
+ addIssueToContext(ctx, {
4732
+ validation: "jwt",
4733
+ code: ZodIssueCode.invalid_string,
4734
+ message: check.message
4735
+ });
4736
+ status.dirty();
4737
+ }
4738
+ } else if (check.kind === "cidr") {
4739
+ if (!isValidCidr(input.data, check.version)) {
4740
+ ctx = this._getOrReturnCtx(input, ctx);
4741
+ addIssueToContext(ctx, {
4742
+ validation: "cidr",
4743
+ code: ZodIssueCode.invalid_string,
4744
+ message: check.message
4745
+ });
4746
+ status.dirty();
4747
+ }
4585
4748
  } else if (check.kind === "base64") {
4586
4749
  if (!base64Regex.test(input.data)) {
4587
4750
  ctx = this._getOrReturnCtx(input, ctx);
@@ -4592,6 +4755,16 @@ var init_lib = __esm({
4592
4755
  });
4593
4756
  status.dirty();
4594
4757
  }
4758
+ } else if (check.kind === "base64url") {
4759
+ if (!base64urlRegex.test(input.data)) {
4760
+ ctx = this._getOrReturnCtx(input, ctx);
4761
+ addIssueToContext(ctx, {
4762
+ validation: "base64url",
4763
+ code: ZodIssueCode.invalid_string,
4764
+ message: check.message
4765
+ });
4766
+ status.dirty();
4767
+ }
4595
4768
  } else {
4596
4769
  util.assertNever(check);
4597
4770
  }
@@ -4638,11 +4811,22 @@ var init_lib = __esm({
4638
4811
  base64(message) {
4639
4812
  return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
4640
4813
  }
4814
+ base64url(message) {
4815
+ return this._addCheck({
4816
+ kind: "base64url",
4817
+ ...errorUtil.errToObj(message)
4818
+ });
4819
+ }
4820
+ jwt(options) {
4821
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
4822
+ }
4641
4823
  ip(options) {
4642
4824
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
4643
4825
  }
4826
+ cidr(options) {
4827
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
4828
+ }
4644
4829
  datetime(options) {
4645
- var _a437, _b326;
4646
4830
  if (typeof options === "string") {
4647
4831
  return this._addCheck({
4648
4832
  kind: "datetime",
@@ -4654,10 +4838,10 @@ var init_lib = __esm({
4654
4838
  }
4655
4839
  return this._addCheck({
4656
4840
  kind: "datetime",
4657
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
4658
- offset: (_a437 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a437 !== void 0 ? _a437 : false,
4659
- local: (_b326 = options === null || options === void 0 ? void 0 : options.local) !== null && _b326 !== void 0 ? _b326 : false,
4660
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
4841
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
4842
+ offset: options?.offset ?? false,
4843
+ local: options?.local ?? false,
4844
+ ...errorUtil.errToObj(options?.message)
4661
4845
  });
4662
4846
  }
4663
4847
  date(message) {
@@ -4673,8 +4857,8 @@ var init_lib = __esm({
4673
4857
  }
4674
4858
  return this._addCheck({
4675
4859
  kind: "time",
4676
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
4677
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
4860
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
4861
+ ...errorUtil.errToObj(options?.message)
4678
4862
  });
4679
4863
  }
4680
4864
  duration(message) {
@@ -4691,8 +4875,8 @@ var init_lib = __esm({
4691
4875
  return this._addCheck({
4692
4876
  kind: "includes",
4693
4877
  value,
4694
- position: options === null || options === void 0 ? void 0 : options.position,
4695
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
4878
+ position: options?.position,
4879
+ ...errorUtil.errToObj(options?.message)
4696
4880
  });
4697
4881
  }
4698
4882
  startsWith(value, message) {
@@ -4731,8 +4915,7 @@ var init_lib = __esm({
4731
4915
  });
4732
4916
  }
4733
4917
  /**
4734
- * @deprecated Use z.string().min(1) instead.
4735
- * @see {@link ZodString.min}
4918
+ * Equivalent to `.min(1)`
4736
4919
  */
4737
4920
  nonempty(message) {
4738
4921
  return this.min(1, errorUtil.errToObj(message));
@@ -4794,9 +4977,15 @@ var init_lib = __esm({
4794
4977
  get isIP() {
4795
4978
  return !!this._def.checks.find((ch) => ch.kind === "ip");
4796
4979
  }
4980
+ get isCIDR() {
4981
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
4982
+ }
4797
4983
  get isBase64() {
4798
4984
  return !!this._def.checks.find((ch) => ch.kind === "base64");
4799
4985
  }
4986
+ get isBase64url() {
4987
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
4988
+ }
4800
4989
  get minLength() {
4801
4990
  let min2 = null;
4802
4991
  for (const ch of this._def.checks) {
@@ -4819,11 +5008,10 @@ var init_lib = __esm({
4819
5008
  }
4820
5009
  };
4821
5010
  ZodString.create = (params) => {
4822
- var _a437;
4823
5011
  return new ZodString({
4824
5012
  checks: [],
4825
5013
  typeName: ZodFirstPartyTypeKind.ZodString,
4826
- coerce: (_a437 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a437 !== void 0 ? _a437 : false,
5014
+ coerce: params?.coerce ?? false,
4827
5015
  ...processCreateParams(params)
4828
5016
  });
4829
5017
  };
@@ -5035,7 +5223,8 @@ var init_lib = __esm({
5035
5223
  return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
5036
5224
  }
5037
5225
  get isFinite() {
5038
- let max2 = null, min2 = null;
5226
+ let max2 = null;
5227
+ let min2 = null;
5039
5228
  for (const ch of this._def.checks) {
5040
5229
  if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
5041
5230
  return true;
@@ -5054,7 +5243,7 @@ var init_lib = __esm({
5054
5243
  return new ZodNumber({
5055
5244
  checks: [],
5056
5245
  typeName: ZodFirstPartyTypeKind.ZodNumber,
5057
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
5246
+ coerce: params?.coerce || false,
5058
5247
  ...processCreateParams(params)
5059
5248
  });
5060
5249
  };
@@ -5066,17 +5255,15 @@ var init_lib = __esm({
5066
5255
  }
5067
5256
  _parse(input) {
5068
5257
  if (this._def.coerce) {
5069
- input.data = BigInt(input.data);
5258
+ try {
5259
+ input.data = BigInt(input.data);
5260
+ } catch {
5261
+ return this._getInvalidInput(input);
5262
+ }
5070
5263
  }
5071
5264
  const parsedType = this._getType(input);
5072
5265
  if (parsedType !== ZodParsedType.bigint) {
5073
- const ctx2 = this._getOrReturnCtx(input);
5074
- addIssueToContext(ctx2, {
5075
- code: ZodIssueCode.invalid_type,
5076
- expected: ZodParsedType.bigint,
5077
- received: ctx2.parsedType
5078
- });
5079
- return INVALID;
5266
+ return this._getInvalidInput(input);
5080
5267
  }
5081
5268
  let ctx = void 0;
5082
5269
  const status = new ParseStatus();
@@ -5123,6 +5310,15 @@ var init_lib = __esm({
5123
5310
  }
5124
5311
  return { status: status.value, value: input.data };
5125
5312
  }
5313
+ _getInvalidInput(input) {
5314
+ const ctx = this._getOrReturnCtx(input);
5315
+ addIssueToContext(ctx, {
5316
+ code: ZodIssueCode.invalid_type,
5317
+ expected: ZodParsedType.bigint,
5318
+ received: ctx.parsedType
5319
+ });
5320
+ return INVALID;
5321
+ }
5126
5322
  gte(value, message) {
5127
5323
  return this.setLimit("min", value, true, errorUtil.toString(message));
5128
5324
  }
@@ -5216,11 +5412,10 @@ var init_lib = __esm({
5216
5412
  }
5217
5413
  };
5218
5414
  ZodBigInt.create = (params) => {
5219
- var _a437;
5220
5415
  return new ZodBigInt({
5221
5416
  checks: [],
5222
5417
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
5223
- coerce: (_a437 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a437 !== void 0 ? _a437 : false,
5418
+ coerce: params?.coerce ?? false,
5224
5419
  ...processCreateParams(params)
5225
5420
  });
5226
5421
  };
@@ -5245,7 +5440,7 @@ var init_lib = __esm({
5245
5440
  ZodBoolean.create = (params) => {
5246
5441
  return new ZodBoolean({
5247
5442
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
5248
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
5443
+ coerce: params?.coerce || false,
5249
5444
  ...processCreateParams(params)
5250
5445
  });
5251
5446
  };
@@ -5264,7 +5459,7 @@ var init_lib = __esm({
5264
5459
  });
5265
5460
  return INVALID;
5266
5461
  }
5267
- if (isNaN(input.data.getTime())) {
5462
+ if (Number.isNaN(input.data.getTime())) {
5268
5463
  const ctx2 = this._getOrReturnCtx(input);
5269
5464
  addIssueToContext(ctx2, {
5270
5465
  code: ZodIssueCode.invalid_date
@@ -5353,7 +5548,7 @@ var init_lib = __esm({
5353
5548
  ZodDate.create = (params) => {
5354
5549
  return new ZodDate({
5355
5550
  checks: [],
5356
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
5551
+ coerce: params?.coerce || false,
5357
5552
  typeName: ZodFirstPartyTypeKind.ZodDate,
5358
5553
  ...processCreateParams(params)
5359
5554
  });
@@ -5602,7 +5797,8 @@ var init_lib = __esm({
5602
5797
  return this._cached;
5603
5798
  const shape = this._def.shape();
5604
5799
  const keys = util.objectKeys(shape);
5605
- return this._cached = { shape, keys };
5800
+ this._cached = { shape, keys };
5801
+ return this._cached;
5606
5802
  }
5607
5803
  _parse(input) {
5608
5804
  const parsedType = this._getType(input);
@@ -5652,8 +5848,8 @@ var init_lib = __esm({
5652
5848
  });
5653
5849
  status.dirty();
5654
5850
  }
5655
- } else if (unknownKeys === "strip") ;
5656
- else {
5851
+ } else if (unknownKeys === "strip") {
5852
+ } else {
5657
5853
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
5658
5854
  }
5659
5855
  } else {
@@ -5700,11 +5896,10 @@ var init_lib = __esm({
5700
5896
  unknownKeys: "strict",
5701
5897
  ...message !== void 0 ? {
5702
5898
  errorMap: (issue, ctx) => {
5703
- var _a437, _b326, _c14, _d6;
5704
- const defaultError = (_c14 = (_b326 = (_a437 = this._def).errorMap) === null || _b326 === void 0 ? void 0 : _b326.call(_a437, issue, ctx).message) !== null && _c14 !== void 0 ? _c14 : ctx.defaultError;
5899
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
5705
5900
  if (issue.code === "unrecognized_keys")
5706
5901
  return {
5707
- message: (_d6 = errorUtil.errToObj(message).message) !== null && _d6 !== void 0 ? _d6 : defaultError
5902
+ message: errorUtil.errToObj(message).message ?? defaultError
5708
5903
  };
5709
5904
  return {
5710
5905
  message: defaultError
@@ -5835,11 +6030,11 @@ var init_lib = __esm({
5835
6030
  }
5836
6031
  pick(mask) {
5837
6032
  const shape = {};
5838
- util.objectKeys(mask).forEach((key) => {
6033
+ for (const key of util.objectKeys(mask)) {
5839
6034
  if (mask[key] && this.shape[key]) {
5840
6035
  shape[key] = this.shape[key];
5841
6036
  }
5842
- });
6037
+ }
5843
6038
  return new _ZodObject({
5844
6039
  ...this._def,
5845
6040
  shape: () => shape
@@ -5847,11 +6042,11 @@ var init_lib = __esm({
5847
6042
  }
5848
6043
  omit(mask) {
5849
6044
  const shape = {};
5850
- util.objectKeys(this.shape).forEach((key) => {
6045
+ for (const key of util.objectKeys(this.shape)) {
5851
6046
  if (!mask[key]) {
5852
6047
  shape[key] = this.shape[key];
5853
6048
  }
5854
- });
6049
+ }
5855
6050
  return new _ZodObject({
5856
6051
  ...this._def,
5857
6052
  shape: () => shape
@@ -5865,14 +6060,14 @@ var init_lib = __esm({
5865
6060
  }
5866
6061
  partial(mask) {
5867
6062
  const newShape = {};
5868
- util.objectKeys(this.shape).forEach((key) => {
6063
+ for (const key of util.objectKeys(this.shape)) {
5869
6064
  const fieldSchema = this.shape[key];
5870
6065
  if (mask && !mask[key]) {
5871
6066
  newShape[key] = fieldSchema;
5872
6067
  } else {
5873
6068
  newShape[key] = fieldSchema.optional();
5874
6069
  }
5875
- });
6070
+ }
5876
6071
  return new _ZodObject({
5877
6072
  ...this._def,
5878
6073
  shape: () => newShape
@@ -5880,7 +6075,7 @@ var init_lib = __esm({
5880
6075
  }
5881
6076
  required(mask) {
5882
6077
  const newShape = {};
5883
- util.objectKeys(this.shape).forEach((key) => {
6078
+ for (const key of util.objectKeys(this.shape)) {
5884
6079
  if (mask && !mask[key]) {
5885
6080
  newShape[key] = this.shape[key];
5886
6081
  } else {
@@ -5891,7 +6086,7 @@ var init_lib = __esm({
5891
6086
  }
5892
6087
  newShape[key] = newField;
5893
6088
  }
5894
- });
6089
+ }
5895
6090
  return new _ZodObject({
5896
6091
  ...this._def,
5897
6092
  shape: () => newShape
@@ -6469,12 +6664,7 @@ var init_lib = __esm({
6469
6664
  return makeIssue({
6470
6665
  data: args,
6471
6666
  path: ctx.path,
6472
- errorMaps: [
6473
- ctx.common.contextualErrorMap,
6474
- ctx.schemaErrorMap,
6475
- getErrorMap(),
6476
- errorMap
6477
- ].filter((x) => !!x),
6667
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
6478
6668
  issueData: {
6479
6669
  code: ZodIssueCode.invalid_arguments,
6480
6670
  argumentsError: error2
@@ -6485,12 +6675,7 @@ var init_lib = __esm({
6485
6675
  return makeIssue({
6486
6676
  data: returns,
6487
6677
  path: ctx.path,
6488
- errorMaps: [
6489
- ctx.common.contextualErrorMap,
6490
- ctx.schemaErrorMap,
6491
- getErrorMap(),
6492
- errorMap
6493
- ].filter((x) => !!x),
6678
+ errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
6494
6679
  issueData: {
6495
6680
  code: ZodIssueCode.invalid_return_type,
6496
6681
  returnTypeError: error2
@@ -6607,10 +6792,6 @@ var init_lib = __esm({
6607
6792
  });
6608
6793
  };
6609
6794
  ZodEnum = class _ZodEnum extends ZodType {
6610
- constructor() {
6611
- super(...arguments);
6612
- _ZodEnum_cache.set(this, void 0);
6613
- }
6614
6795
  _parse(input) {
6615
6796
  if (typeof input.data !== "string") {
6616
6797
  const ctx = this._getOrReturnCtx(input);
@@ -6622,10 +6803,10 @@ var init_lib = __esm({
6622
6803
  });
6623
6804
  return INVALID;
6624
6805
  }
6625
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
6626
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
6806
+ if (!this._cache) {
6807
+ this._cache = new Set(this._def.values);
6627
6808
  }
6628
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
6809
+ if (!this._cache.has(input.data)) {
6629
6810
  const ctx = this._getOrReturnCtx(input);
6630
6811
  const expectedValues = this._def.values;
6631
6812
  addIssueToContext(ctx, {
@@ -6674,13 +6855,8 @@ var init_lib = __esm({
6674
6855
  });
6675
6856
  }
6676
6857
  };
6677
- _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
6678
6858
  ZodEnum.create = createZodEnum;
6679
6859
  ZodNativeEnum = class extends ZodType {
6680
- constructor() {
6681
- super(...arguments);
6682
- _ZodNativeEnum_cache.set(this, void 0);
6683
- }
6684
6860
  _parse(input) {
6685
6861
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
6686
6862
  const ctx = this._getOrReturnCtx(input);
@@ -6693,10 +6869,10 @@ var init_lib = __esm({
6693
6869
  });
6694
6870
  return INVALID;
6695
6871
  }
6696
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
6697
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
6872
+ if (!this._cache) {
6873
+ this._cache = new Set(util.getValidEnumValues(this._def.values));
6698
6874
  }
6699
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
6875
+ if (!this._cache.has(input.data)) {
6700
6876
  const expectedValues = util.objectValues(nativeEnumValues);
6701
6877
  addIssueToContext(ctx, {
6702
6878
  received: ctx.data,
@@ -6711,7 +6887,6 @@ var init_lib = __esm({
6711
6887
  return this._def.values;
6712
6888
  }
6713
6889
  };
6714
- _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
6715
6890
  ZodNativeEnum.create = (values, params) => {
6716
6891
  return new ZodNativeEnum({
6717
6892
  values,
@@ -6852,7 +7027,7 @@ var init_lib = __esm({
6852
7027
  parent: ctx
6853
7028
  });
6854
7029
  if (!isValid(base))
6855
- return base;
7030
+ return INVALID;
6856
7031
  const result = effect.transform(base.value, checkCtx);
6857
7032
  if (result instanceof Promise) {
6858
7033
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
@@ -6861,8 +7036,11 @@ var init_lib = __esm({
6861
7036
  } else {
6862
7037
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
6863
7038
  if (!isValid(base))
6864
- return base;
6865
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
7039
+ return INVALID;
7040
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
7041
+ status: status.value,
7042
+ value: result
7043
+ }));
6866
7044
  });
6867
7045
  }
6868
7046
  }
@@ -7202,13 +7380,44 @@ var init_lib = __esm({
7202
7380
  }
7203
7381
  });
7204
7382
 
7383
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js
7384
+ var init_external = __esm({
7385
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/external.js"() {
7386
+ "use strict";
7387
+ init_errors();
7388
+ init_parseUtil();
7389
+ init_typeAliases();
7390
+ init_util();
7391
+ init_types();
7392
+ init_ZodError();
7393
+ }
7394
+ });
7395
+
7396
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js
7397
+ var init_v3 = __esm({
7398
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/v3/index.js"() {
7399
+ "use strict";
7400
+ init_external();
7401
+ init_external();
7402
+ }
7403
+ });
7404
+
7405
+ // ../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js
7406
+ var init_esm = __esm({
7407
+ "../node_modules/.pnpm/zod@3.25.42/node_modules/zod/dist/esm/index.js"() {
7408
+ "use strict";
7409
+ init_v3();
7410
+ init_v3();
7411
+ }
7412
+ });
7413
+
7205
7414
  // src/serializer/gelSchema.ts
7206
7415
  var enumSchema, enumSchemaV1, indexColumn, index, fk, sequenceSchema, roleSchema, sequenceSquashed, column, checkConstraint, columnSquashed, compositePK, uniqueConstraint, policy, policySquashed, viewWithOption, matViewWithOption, mergedViewWithOption, view, table, schemaHash, kitInternals, gelSchemaExternal, gelSchemaInternal, tableSquashed, gelSchemaSquashed, gelSchema, dryGel;
7207
7416
  var init_gelSchema = __esm({
7208
7417
  "src/serializer/gelSchema.ts"() {
7209
7418
  "use strict";
7210
7419
  init_global();
7211
- init_lib();
7420
+ init_esm();
7212
7421
  enumSchema = objectType({
7213
7422
  name: stringType(),
7214
7423
  schema: stringType(),
@@ -7472,7 +7681,7 @@ var index2, fk2, column2, tableV3, compositePK2, uniqueConstraint2, checkConstra
7472
7681
  var init_mysqlSchema = __esm({
7473
7682
  "src/serializer/mysqlSchema.ts"() {
7474
7683
  "use strict";
7475
- init_lib();
7684
+ init_esm();
7476
7685
  init_global();
7477
7686
  index2 = objectType({
7478
7687
  name: stringType(),
@@ -7801,7 +8010,7 @@ var init_pgSchema = __esm({
7801
8010
  "src/serializer/pgSchema.ts"() {
7802
8011
  "use strict";
7803
8012
  init_global();
7804
- init_lib();
8013
+ init_esm();
7805
8014
  indexV2 = objectType({
7806
8015
  name: stringType(),
7807
8016
  columns: recordType(
@@ -8551,7 +8760,7 @@ var index4, column4, compositePK4, uniqueConstraint4, table4, viewMeta2, kitInte
8551
8760
  var init_singlestoreSchema = __esm({
8552
8761
  "src/serializer/singlestoreSchema.ts"() {
8553
8762
  "use strict";
8554
- init_lib();
8763
+ init_esm();
8555
8764
  init_global();
8556
8765
  index4 = objectType({
8557
8766
  name: stringType(),
@@ -8748,7 +8957,7 @@ var index5, fk4, compositePK5, column5, tableV33, uniqueConstraint5, checkConstr
8748
8957
  var init_sqliteSchema = __esm({
8749
8958
  "src/serializer/sqliteSchema.ts"() {
8750
8959
  "use strict";
8751
- init_lib();
8960
+ init_esm();
8752
8961
  init_global();
8753
8962
  index5 = objectType({
8754
8963
  name: stringType(),
@@ -17249,7 +17458,7 @@ var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema
17249
17458
  var init_snapshotsDiffer = __esm({
17250
17459
  "src/snapshotsDiffer.ts"() {
17251
17460
  "use strict";
17252
- init_lib();
17461
+ init_esm();
17253
17462
  init_jsonDiffer();
17254
17463
  init_sqlgenerator();
17255
17464
  init_jsonStatements();
@@ -20161,7 +20370,7 @@ var dialects, dialect4, commonSquashedSchema, commonSchema;
20161
20370
  var init_schemaValidator = __esm({
20162
20371
  "src/schemaValidator.ts"() {
20163
20372
  "use strict";
20164
- init_lib();
20373
+ init_esm();
20165
20374
  init_mysqlSchema();
20166
20375
  init_pgSchema();
20167
20376
  init_singlestoreSchema();
@@ -20183,7 +20392,7 @@ var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTy
20183
20392
  var init_common = __esm({
20184
20393
  "src/cli/validations/common.ts"() {
20185
20394
  "use strict";
20186
- init_lib();
20395
+ init_esm();
20187
20396
  init_schemaValidator();
20188
20397
  init_outputs();
20189
20398
  sqliteDriversLiterals = [
@@ -21496,13 +21705,18 @@ var init_mjs = __esm({
21496
21705
  continue;
21497
21706
  }
21498
21707
  switch (c) {
21708
+ // Should already be path-split by now.
21709
+ /* c8 ignore start */
21499
21710
  case "/": {
21500
21711
  return false;
21501
21712
  }
21713
+ /* c8 ignore stop */
21502
21714
  case "\\":
21503
21715
  clearStateChar();
21504
21716
  escaping = true;
21505
21717
  continue;
21718
+ // the various stateChar values
21719
+ // for the "extglob" stuff.
21506
21720
  case "?":
21507
21721
  case "*":
21508
21722
  case "+":
@@ -21568,6 +21782,7 @@ var init_mjs = __esm({
21568
21782
  }
21569
21783
  continue;
21570
21784
  }
21785
+ // these are mostly the same in regexp and glob
21571
21786
  case "[":
21572
21787
  clearStateChar();
21573
21788
  const [src, needUflag, consumed, magic] = parseClass(pattern, i);
@@ -21955,8 +22170,7 @@ var init_column_builder = __esm({
21955
22170
  }
21956
22171
  /** @internal Sets the name of the column to the key within the table definition if a name was not given. */
21957
22172
  setName(name2) {
21958
- if (this.config.name !== "")
21959
- return;
22173
+ if (this.config.name !== "") return;
21960
22174
  this.config.name = name2;
21961
22175
  }
21962
22176
  };
@@ -22388,8 +22602,7 @@ var init_common2 = __esm({
22388
22602
  const a = value.map(
22389
22603
  (v) => v === null ? null : is(this.baseColumn, _PgArray) ? this.baseColumn.mapToDriverValue(v, true) : this.baseColumn.mapToDriverValue(v)
22390
22604
  );
22391
- if (isNestedArray)
22392
- return a;
22605
+ if (isNestedArray) return a;
22393
22606
  return makePgArray(a);
22394
22607
  }
22395
22608
  };
@@ -22522,7 +22735,7 @@ var version;
22522
22735
  var init_version = __esm({
22523
22736
  "../drizzle-orm/dist/version.js"() {
22524
22737
  "use strict";
22525
- version = "0.43.1";
22738
+ version = "0.44.2";
22526
22739
  }
22527
22740
  });
22528
22741
 
@@ -23198,7 +23411,7 @@ var init_alias = __esm({
23198
23411
 
23199
23412
  // ../drizzle-orm/dist/errors.js
23200
23413
  var _a31, _b13, DrizzleError, _a32, _b14, TransactionRollbackError;
23201
- var init_errors = __esm({
23414
+ var init_errors2 = __esm({
23202
23415
  "../drizzle-orm/dist/errors.js"() {
23203
23416
  "use strict";
23204
23417
  init_entity();
@@ -23302,7 +23515,6 @@ var init_query_promise = __esm({
23302
23515
  });
23303
23516
 
23304
23517
  // ../drizzle-orm/dist/utils.js
23305
- import * as crypto from "crypto";
23306
23518
  function mapResultRow(columns, row, joinsNotNullableMap) {
23307
23519
  const nullifyMap = {};
23308
23520
  const result = columns.reduce(
@@ -23393,8 +23605,7 @@ function mapUpdateSet(table6, values) {
23393
23605
  function applyMixins(baseClass, extendedClasses) {
23394
23606
  for (const extendedClass of extendedClasses) {
23395
23607
  for (const name2 of Object.getOwnPropertyNames(extendedClass.prototype)) {
23396
- if (name2 === "constructor")
23397
- continue;
23608
+ if (name2 === "constructor") continue;
23398
23609
  Object.defineProperty(
23399
23610
  baseClass.prototype,
23400
23611
  name2,
@@ -23409,15 +23620,6 @@ function getTableColumns(table6) {
23409
23620
  function getViewSelectedFields(view5) {
23410
23621
  return view5[ViewBaseConfig].selectedFields;
23411
23622
  }
23412
- async function hashQuery(sql2, params) {
23413
- const dataToHash = `${sql2}-${JSON.stringify(params)}`;
23414
- const encoder = new TextEncoder();
23415
- const data = encoder.encode(dataToHash);
23416
- const hashBuffer = await crypto.subtle.digest("SHA-256", data);
23417
- const hashArray = [...new Uint8Array(hashBuffer)];
23418
- const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
23419
- return hashHex;
23420
- }
23421
23623
  function getTableLikeName(table6) {
23422
23624
  return is(table6, Subquery) ? table6._.alias : is(table6, View3) ? table6[ViewBaseConfig].name : is(table6, SQL) ? void 0 : table6[Table2.Symbol.IsAlias] ? table6[Table2.Symbol.Name] : table6[Table2.Symbol.BaseName];
23423
23625
  }
@@ -23428,47 +23630,38 @@ function getColumnNameAndConfig(a, b) {
23428
23630
  };
23429
23631
  }
23430
23632
  function isConfig(data) {
23431
- if (typeof data !== "object" || data === null)
23432
- return false;
23433
- if (data.constructor.name !== "Object")
23434
- return false;
23633
+ if (typeof data !== "object" || data === null) return false;
23634
+ if (data.constructor.name !== "Object") return false;
23435
23635
  if ("logger" in data) {
23436
23636
  const type = typeof data["logger"];
23437
- if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined")
23438
- return false;
23637
+ if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false;
23439
23638
  return true;
23440
23639
  }
23441
23640
  if ("schema" in data) {
23442
23641
  const type = typeof data["schema"];
23443
- if (type !== "object" && type !== "undefined")
23444
- return false;
23642
+ if (type !== "object" && type !== "undefined") return false;
23445
23643
  return true;
23446
23644
  }
23447
23645
  if ("casing" in data) {
23448
23646
  const type = typeof data["casing"];
23449
- if (type !== "string" && type !== "undefined")
23450
- return false;
23647
+ if (type !== "string" && type !== "undefined") return false;
23451
23648
  return true;
23452
23649
  }
23453
23650
  if ("mode" in data) {
23454
- if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0)
23455
- return false;
23651
+ if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false;
23456
23652
  return true;
23457
23653
  }
23458
23654
  if ("connection" in data) {
23459
23655
  const type = typeof data["connection"];
23460
- if (type !== "string" && type !== "object" && type !== "undefined")
23461
- return false;
23656
+ if (type !== "string" && type !== "object" && type !== "undefined") return false;
23462
23657
  return true;
23463
23658
  }
23464
23659
  if ("client" in data) {
23465
23660
  const type = typeof data["client"];
23466
- if (type !== "object" && type !== "function" && type !== "undefined")
23467
- return false;
23661
+ if (type !== "object" && type !== "function" && type !== "undefined") return false;
23468
23662
  return true;
23469
23663
  }
23470
- if (Object.keys(data).length === 0)
23471
- return true;
23664
+ if (Object.keys(data).length === 0) return true;
23472
23665
  return false;
23473
23666
  }
23474
23667
  var init_utils2 = __esm({
@@ -24286,8 +24479,7 @@ var init_numeric = __esm({
24286
24479
  this.scale = config.scale;
24287
24480
  }
24288
24481
  mapFromDriverValue(value) {
24289
- if (typeof value === "string")
24290
- return value;
24482
+ if (typeof value === "string") return value;
24291
24483
  return String(value);
24292
24484
  }
24293
24485
  getSQLType() {
@@ -24326,8 +24518,7 @@ var init_numeric = __esm({
24326
24518
  this.scale = config.scale;
24327
24519
  }
24328
24520
  mapFromDriverValue(value) {
24329
- if (typeof value === "number")
24330
- return value;
24521
+ if (typeof value === "number") return value;
24331
24522
  return Number(value);
24332
24523
  }
24333
24524
  getSQLType() {
@@ -25941,7 +26132,6 @@ __export(dist_exports, {
25941
26132
  gte: () => gte,
25942
26133
  hammingDistance: () => hammingDistance,
25943
26134
  hasOwnEntityKind: () => hasOwnEntityKind,
25944
- hashQuery: () => hashQuery,
25945
26135
  haveSameKeys: () => haveSameKeys,
25946
26136
  ilike: () => ilike,
25947
26137
  inArray: () => inArray,
@@ -25995,7 +26185,7 @@ var init_dist = __esm({
25995
26185
  init_column_builder();
25996
26186
  init_column();
25997
26187
  init_entity();
25998
- init_errors();
26188
+ init_errors2();
25999
26189
  init_logger();
26000
26190
  init_operations();
26001
26191
  init_query_promise();
@@ -26364,8 +26554,7 @@ var init_casing = __esm({
26364
26554
  this.convert = casing2 === "snake_case" ? toSnakeCase : casing2 === "camelCase" ? toCamelCase : noopCase;
26365
26555
  }
26366
26556
  getColumnCasing(column6) {
26367
- if (!column6.keyAsName)
26368
- return column6.name;
26557
+ if (!column6.keyAsName) return column6.name;
26369
26558
  const schema5 = column6.table[Table2.Symbol.Schema] ?? "public";
26370
26559
  const tableName = column6.table[Table2.Symbol.OriginalName];
26371
26560
  const key = `${schema5}.${tableName}.${column6.name}`;
@@ -26417,7 +26606,7 @@ var init_dialect = __esm({
26417
26606
  init_casing();
26418
26607
  init_column();
26419
26608
  init_entity();
26420
- init_errors();
26609
+ init_errors2();
26421
26610
  init_columns();
26422
26611
  init_table2();
26423
26612
  init_relations();
@@ -26474,8 +26663,7 @@ var init_dialect = __esm({
26474
26663
  return `'${str.replace(/'/g, "''")}'`;
26475
26664
  }
26476
26665
  buildWithCTE(queries) {
26477
- if (!queries?.length)
26478
- return void 0;
26666
+ if (!queries?.length) return void 0;
26479
26667
  const withSqlChunks = [sql`with `];
26480
26668
  for (const [i, w] of queries.entries()) {
26481
26669
  withSqlChunks.push(sql`${sql.identifier(w._.alias)} as (${w._.sql})`);
@@ -28025,8 +28213,7 @@ var init_select2 = __esm({
28025
28213
  };
28026
28214
  this.tableName = getTableLikeName(table6);
28027
28215
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
28028
- for (const item of extractUsedTable(table6))
28029
- this.usedTables.add(item);
28216
+ for (const item of extractUsedTable(table6)) this.usedTables.add(item);
28030
28217
  }
28031
28218
  /** @internal */
28032
28219
  getUsedTables() {
@@ -28036,8 +28223,7 @@ var init_select2 = __esm({
28036
28223
  return (table6, on) => {
28037
28224
  const baseTableName = this.tableName;
28038
28225
  const tableName = getTableLikeName(table6);
28039
- for (const item of extractUsedTable(table6))
28040
- this.usedTables.add(item);
28226
+ for (const item of extractUsedTable(table6)) this.usedTables.add(item);
28041
28227
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
28042
28228
  throw new Error(`Alias "${tableName}" is already used in this query`);
28043
28229
  }
@@ -28298,8 +28484,7 @@ var init_select2 = __esm({
28298
28484
  const usedTables = [];
28299
28485
  usedTables.push(...extractUsedTable(this.config.table));
28300
28486
  if (this.config.joins) {
28301
- for (const it of this.config.joins)
28302
- usedTables.push(...extractUsedTable(it.table));
28487
+ for (const it of this.config.joins) usedTables.push(...extractUsedTable(it.table));
28303
28488
  }
28304
28489
  return new Proxy(
28305
28490
  new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),
@@ -30081,6 +30266,15 @@ var init_schema = __esm({
30081
30266
  });
30082
30267
 
30083
30268
  // ../drizzle-orm/dist/cache/core/cache.js
30269
+ async function hashQuery(sql2, params) {
30270
+ const dataToHash = `${sql2}-${JSON.stringify(params)}`;
30271
+ const encoder = new TextEncoder();
30272
+ const data = encoder.encode(dataToHash);
30273
+ const hashBuffer = await crypto.subtle.digest("SHA-256", data);
30274
+ const hashArray = [...new Uint8Array(hashBuffer)];
30275
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
30276
+ return hashHex;
30277
+ }
30084
30278
  var _a165, Cache, _a166, _b119, NoopCache;
30085
30279
  var init_cache = __esm({
30086
30280
  "../drizzle-orm/dist/cache/core/cache.js"() {
@@ -30108,7 +30302,7 @@ var init_cache = __esm({
30108
30302
 
30109
30303
  // ../drizzle-orm/dist/errors/index.js
30110
30304
  var DrizzleQueryError;
30111
- var init_errors2 = __esm({
30305
+ var init_errors3 = __esm({
30112
30306
  "../drizzle-orm/dist/errors/index.js"() {
30113
30307
  "use strict";
30114
30308
  DrizzleQueryError = class _DrizzleQueryError extends Error {
@@ -30119,8 +30313,7 @@ params: ${params}`);
30119
30313
  this.params = params;
30120
30314
  this.cause = cause;
30121
30315
  Error.captureStackTrace(this, _DrizzleQueryError);
30122
- if (cause)
30123
- this.cause = cause;
30316
+ if (cause) this.cause = cause;
30124
30317
  }
30125
30318
  };
30126
30319
  }
@@ -30133,11 +30326,10 @@ var init_session = __esm({
30133
30326
  "use strict";
30134
30327
  init_cache();
30135
30328
  init_entity();
30136
- init_errors();
30137
30329
  init_errors2();
30330
+ init_errors3();
30138
30331
  init_sql2();
30139
30332
  init_tracing();
30140
- init_utils2();
30141
30333
  init_db();
30142
30334
  _a167 = entityKind;
30143
30335
  PgPreparedQuery = class {
@@ -32568,8 +32760,7 @@ var init_numeric2 = __esm({
32568
32760
  __publicField(SQLiteNumericBuilder, _a195, "SQLiteNumericBuilder");
32569
32761
  SQLiteNumeric = class extends (_b140 = SQLiteColumn, _a196 = entityKind, _b140) {
32570
32762
  mapFromDriverValue(value) {
32571
- if (typeof value === "string")
32572
- return value;
32763
+ if (typeof value === "string") return value;
32573
32764
  return String(value);
32574
32765
  }
32575
32766
  getSQLType() {
@@ -32596,8 +32787,7 @@ var init_numeric2 = __esm({
32596
32787
  __publicField(this, "mapToDriverValue", String);
32597
32788
  }
32598
32789
  mapFromDriverValue(value) {
32599
- if (typeof value === "number")
32600
- return value;
32790
+ if (typeof value === "number") return value;
32601
32791
  return Number(value);
32602
32792
  }
32603
32793
  getSQLType() {
@@ -33132,7 +33322,7 @@ var init_dialect2 = __esm({
33132
33322
  init_casing();
33133
33323
  init_column();
33134
33324
  init_entity();
33135
- init_errors();
33325
+ init_errors2();
33136
33326
  init_relations();
33137
33327
  init_sql2();
33138
33328
  init_sql();
@@ -33160,8 +33350,7 @@ var init_dialect2 = __esm({
33160
33350
  return `'${str.replace(/'/g, "''")}'`;
33161
33351
  }
33162
33352
  buildWithCTE(queries) {
33163
- if (!queries?.length)
33164
- return void 0;
33353
+ if (!queries?.length) return void 0;
33165
33354
  const withSqlChunks = [sql`with `];
33166
33355
  for (const [i, w] of queries.entries()) {
33167
33356
  withSqlChunks.push(sql`${sql.identifier(w._.alias)} as (${w._.sql})`);
@@ -34112,8 +34301,7 @@ var init_select3 = __esm({
34112
34301
  };
34113
34302
  this.tableName = getTableLikeName(table6);
34114
34303
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
34115
- for (const item of extractUsedTable2(table6))
34116
- this.usedTables.add(item);
34304
+ for (const item of extractUsedTable2(table6)) this.usedTables.add(item);
34117
34305
  }
34118
34306
  /** @internal */
34119
34307
  getUsedTables() {
@@ -34123,8 +34311,7 @@ var init_select3 = __esm({
34123
34311
  return (table6, on) => {
34124
34312
  const baseTableName = this.tableName;
34125
34313
  const tableName = getTableLikeName(table6);
34126
- for (const item of extractUsedTable2(table6))
34127
- this.usedTables.add(item);
34314
+ for (const item of extractUsedTable2(table6)) this.usedTables.add(item);
34128
34315
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
34129
34316
  throw new Error(`Alias "${tableName}" is already used in this query`);
34130
34317
  }
@@ -34371,8 +34558,7 @@ var init_select3 = __esm({
34371
34558
  const usedTables = [];
34372
34559
  usedTables.push(...extractUsedTable2(this.config.table));
34373
34560
  if (this.config.joins) {
34374
- for (const it of this.config.joins)
34375
- usedTables.push(...extractUsedTable2(it.table));
34561
+ for (const it of this.config.joins) usedTables.push(...extractUsedTable2(it.table));
34376
34562
  }
34377
34563
  return new Proxy(
34378
34564
  new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),
@@ -34630,8 +34816,7 @@ var init_insert2 = __esm({
34630
34816
  * ```
34631
34817
  */
34632
34818
  onConflictDoNothing(config = {}) {
34633
- if (!this.config.onConflict)
34634
- this.config.onConflict = [];
34819
+ if (!this.config.onConflict) this.config.onConflict = [];
34635
34820
  if (config.target === void 0) {
34636
34821
  this.config.onConflict.push(sql` on conflict do nothing`);
34637
34822
  } else {
@@ -34676,8 +34861,7 @@ var init_insert2 = __esm({
34676
34861
  'You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.'
34677
34862
  );
34678
34863
  }
34679
- if (!this.config.onConflict)
34680
- this.config.onConflict = [];
34864
+ if (!this.config.onConflict) this.config.onConflict = [];
34681
34865
  const whereSql = config.where ? sql` where ${config.where}` : void 0;
34682
34866
  const targetWhereSql = config.targetWhere ? sql` where ${config.targetWhere}` : void 0;
34683
34867
  const setWhereSql = config.setWhere ? sql` where ${config.setWhere}` : void 0;
@@ -35483,10 +35667,9 @@ var init_session2 = __esm({
35483
35667
  "use strict";
35484
35668
  init_cache();
35485
35669
  init_entity();
35486
- init_errors();
35487
35670
  init_errors2();
35671
+ init_errors3();
35488
35672
  init_query_promise();
35489
- init_utils2();
35490
35673
  init_db2();
35491
35674
  ExecuteResultSync = class extends (_b164 = QueryPromise, _a232 = entityKind, _b164) {
35492
35675
  constructor(resultCb) {
@@ -36855,10 +37038,8 @@ var init_binary = __esm({
36855
37038
  __publicField(this, "length", this.config.length);
36856
37039
  }
36857
37040
  mapFromDriverValue(value) {
36858
- if (typeof value === "string")
36859
- return value;
36860
- if (Buffer.isBuffer(value))
36861
- return value.toString();
37041
+ if (typeof value === "string") return value;
37042
+ if (Buffer.isBuffer(value)) return value.toString();
36862
37043
  const str = [];
36863
37044
  for (const v of value) {
36864
37045
  str.push(v === 49 ? "1" : "0");
@@ -37180,8 +37361,7 @@ var init_decimal = __esm({
37180
37361
  __publicField(this, "unsigned", this.config.unsigned);
37181
37362
  }
37182
37363
  mapFromDriverValue(value) {
37183
- if (typeof value === "string")
37184
- return value;
37364
+ if (typeof value === "string") return value;
37185
37365
  return String(value);
37186
37366
  }
37187
37367
  getSQLType() {
@@ -37223,8 +37403,7 @@ var init_decimal = __esm({
37223
37403
  __publicField(this, "mapToDriverValue", String);
37224
37404
  }
37225
37405
  mapFromDriverValue(value) {
37226
- if (typeof value === "number")
37227
- return value;
37406
+ if (typeof value === "number") return value;
37228
37407
  return Number(value);
37229
37408
  }
37230
37409
  getSQLType() {
@@ -37953,10 +38132,8 @@ var init_varbinary = __esm({
37953
38132
  __publicField(this, "length", this.config.length);
37954
38133
  }
37955
38134
  mapFromDriverValue(value) {
37956
- if (typeof value === "string")
37957
- return value;
37958
- if (Buffer.isBuffer(value))
37959
- return value.toString();
38135
+ if (typeof value === "string") return value;
38136
+ if (Buffer.isBuffer(value)) return value.toString();
37960
38137
  const str = [];
37961
38138
  for (const v of value) {
37962
38139
  str.push(v === 49 ? "1" : "0");
@@ -38565,7 +38742,7 @@ var init_dialect3 = __esm({
38565
38742
  init_casing();
38566
38743
  init_column();
38567
38744
  init_entity();
38568
- init_errors();
38745
+ init_errors2();
38569
38746
  init_relations();
38570
38747
  init_expressions();
38571
38748
  init_sql();
@@ -38620,8 +38797,7 @@ var init_dialect3 = __esm({
38620
38797
  return `'${str.replace(/'/g, "''")}'`;
38621
38798
  }
38622
38799
  buildWithCTE(queries) {
38623
- if (!queries?.length)
38624
- return void 0;
38800
+ if (!queries?.length) return void 0;
38625
38801
  const withSqlChunks = [sql`with `];
38626
38802
  for (const [i, w] of queries.entries()) {
38627
38803
  withSqlChunks.push(sql`${sql.identifier(w._.alias)} as (${w._.sql})`);
@@ -39901,8 +40077,7 @@ var init_select4 = __esm({
39901
40077
  };
39902
40078
  this.tableName = getTableLikeName(table6);
39903
40079
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
39904
- for (const item of extractUsedTable3(table6))
39905
- this.usedTables.add(item);
40080
+ for (const item of extractUsedTable3(table6)) this.usedTables.add(item);
39906
40081
  }
39907
40082
  /** @internal */
39908
40083
  getUsedTables() {
@@ -39915,8 +40090,7 @@ var init_select4 = __esm({
39915
40090
  const onIndex = isCrossJoin ? a : b;
39916
40091
  const baseTableName = this.tableName;
39917
40092
  const tableName = getTableLikeName(table6);
39918
- for (const item of extractUsedTable3(table6))
39919
- this.usedTables.add(item);
40093
+ for (const item of extractUsedTable3(table6)) this.usedTables.add(item);
39920
40094
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
39921
40095
  throw new Error(`Alias "${tableName}" is already used in this query`);
39922
40096
  }
@@ -40184,8 +40358,7 @@ var init_select4 = __esm({
40184
40358
  const usedTables = [];
40185
40359
  usedTables.push(...extractUsedTable3(this.config.table));
40186
40360
  if (this.config.joins) {
40187
- for (const it of this.config.joins)
40188
- usedTables.push(...extractUsedTable3(it.table));
40361
+ for (const it of this.config.joins) usedTables.push(...extractUsedTable3(it.table));
40189
40362
  }
40190
40363
  return new Proxy(
40191
40364
  new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),
@@ -41134,10 +41307,9 @@ var init_session3 = __esm({
41134
41307
  "use strict";
41135
41308
  init_cache();
41136
41309
  init_entity();
41137
- init_errors();
41138
41310
  init_errors2();
41311
+ init_errors3();
41139
41312
  init_sql();
41140
- init_utils2();
41141
41313
  init_db3();
41142
41314
  _a341 = entityKind;
41143
41315
  MySqlPreparedQuery = class {
@@ -42064,7 +42236,7 @@ var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
42064
42236
  var init_cli = __esm({
42065
42237
  "src/cli/validations/cli.ts"() {
42066
42238
  "use strict";
42067
- init_lib();
42239
+ init_esm();
42068
42240
  init_schemaValidator();
42069
42241
  init_common();
42070
42242
  cliConfigGenerate = objectType({
@@ -42132,7 +42304,7 @@ var gelCredentials;
42132
42304
  var init_gel = __esm({
42133
42305
  "src/cli/validations/gel.ts"() {
42134
42306
  "use strict";
42135
- init_lib();
42307
+ init_esm();
42136
42308
  init_views();
42137
42309
  init_common();
42138
42310
  gelCredentials = unionType([
@@ -42180,7 +42352,7 @@ var libSQLCredentials;
42180
42352
  var init_libsql = __esm({
42181
42353
  "src/cli/validations/libsql.ts"() {
42182
42354
  "use strict";
42183
- init_lib();
42355
+ init_esm();
42184
42356
  init_views();
42185
42357
  init_common();
42186
42358
  libSQLCredentials = objectType({
@@ -42195,7 +42367,7 @@ var mysqlCredentials;
42195
42367
  var init_mysql = __esm({
42196
42368
  "src/cli/validations/mysql.ts"() {
42197
42369
  "use strict";
42198
- init_lib();
42370
+ init_esm();
42199
42371
  init_views();
42200
42372
  init_common();
42201
42373
  init_outputs();
@@ -42232,7 +42404,7 @@ var postgresCredentials;
42232
42404
  var init_postgres = __esm({
42233
42405
  "src/cli/validations/postgres.ts"() {
42234
42406
  "use strict";
42235
- init_lib();
42407
+ init_esm();
42236
42408
  init_views();
42237
42409
  init_common();
42238
42410
  postgresCredentials = unionType([
@@ -42281,7 +42453,7 @@ var singlestoreCredentials;
42281
42453
  var init_singlestore = __esm({
42282
42454
  "src/cli/validations/singlestore.ts"() {
42283
42455
  "use strict";
42284
- init_lib();
42456
+ init_esm();
42285
42457
  init_views();
42286
42458
  init_common();
42287
42459
  init_outputs();
@@ -42319,7 +42491,7 @@ var init_sqlite = __esm({
42319
42491
  "src/cli/validations/sqlite.ts"() {
42320
42492
  "use strict";
42321
42493
  init_global();
42322
- init_lib();
42494
+ init_esm();
42323
42495
  init_views();
42324
42496
  init_common();
42325
42497
  sqliteCredentials = unionType([
@@ -42350,7 +42522,7 @@ var credentials, studioCliParams, studioConfig;
42350
42522
  var init_studio = __esm({
42351
42523
  "src/cli/validations/studio.ts"() {
42352
42524
  "use strict";
42353
- init_lib();
42525
+ init_esm();
42354
42526
  init_schemaValidator();
42355
42527
  init_mysql();
42356
42528
  init_postgres();
@@ -42392,7 +42564,7 @@ var init_utils9 = __esm({
42392
42564
  "src/cli/commands/utils.ts"() {
42393
42565
  "use strict";
42394
42566
  import_hanji7 = __toESM(require_hanji());
42395
- init_lib();
42567
+ init_esm();
42396
42568
  init_getTablesFilterByExtensions();
42397
42569
  init_global();
42398
42570
  init_schemaValidator();
@@ -42723,10 +42895,8 @@ var init_binary2 = __esm({
42723
42895
  __publicField(this, "length", this.config.length);
42724
42896
  }
42725
42897
  mapFromDriverValue(value) {
42726
- if (typeof value === "string")
42727
- return value;
42728
- if (Buffer.isBuffer(value))
42729
- return value.toString();
42898
+ if (typeof value === "string") return value;
42899
+ if (Buffer.isBuffer(value)) return value.toString();
42730
42900
  const str = [];
42731
42901
  for (const v of value) {
42732
42902
  str.push(v === 49 ? "1" : "0");
@@ -43053,8 +43223,7 @@ var init_decimal2 = __esm({
43053
43223
  __publicField(this, "unsigned", this.config.unsigned);
43054
43224
  }
43055
43225
  mapFromDriverValue(value) {
43056
- if (typeof value === "string")
43057
- return value;
43226
+ if (typeof value === "string") return value;
43058
43227
  return String(value);
43059
43228
  }
43060
43229
  getSQLType() {
@@ -43096,8 +43265,7 @@ var init_decimal2 = __esm({
43096
43265
  __publicField(this, "mapToDriverValue", String);
43097
43266
  }
43098
43267
  mapFromDriverValue(value) {
43099
- if (typeof value === "number")
43100
- return value;
43268
+ if (typeof value === "number") return value;
43101
43269
  return Number(value);
43102
43270
  }
43103
43271
  getSQLType() {
@@ -43806,10 +43974,8 @@ var init_varbinary2 = __esm({
43806
43974
  __publicField(this, "length", this.config.length);
43807
43975
  }
43808
43976
  mapFromDriverValue(value) {
43809
- if (typeof value === "string")
43810
- return value;
43811
- if (Buffer.isBuffer(value))
43812
- return value.toString();
43977
+ if (typeof value === "string") return value;
43978
+ if (Buffer.isBuffer(value)) return value.toString();
43813
43979
  const str = [];
43814
43980
  for (const v of value) {
43815
43981
  str.push(v === 49 ? "1" : "0");
@@ -44548,7 +44714,7 @@ var init_dialect4 = __esm({
44548
44714
  init_casing();
44549
44715
  init_column();
44550
44716
  init_entity();
44551
- init_errors();
44717
+ init_errors2();
44552
44718
  init_relations();
44553
44719
  init_expressions();
44554
44720
  init_sql();
@@ -44602,8 +44768,7 @@ var init_dialect4 = __esm({
44602
44768
  return `'${str.replace(/'/g, "''")}'`;
44603
44769
  }
44604
44770
  buildWithCTE(queries) {
44605
- if (!queries?.length)
44606
- return void 0;
44771
+ if (!queries?.length) return void 0;
44607
44772
  const withSqlChunks = [sql`with `];
44608
44773
  for (const [i, w] of queries.entries()) {
44609
44774
  withSqlChunks.push(sql`${sql.identifier(w._.alias)} as (${w._.sql})`);
@@ -45537,8 +45702,7 @@ var init_select5 = __esm({
45537
45702
  };
45538
45703
  this.tableName = getTableLikeName(table6);
45539
45704
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
45540
- for (const item of extractUsedTable4(table6))
45541
- this.usedTables.add(item);
45705
+ for (const item of extractUsedTable4(table6)) this.usedTables.add(item);
45542
45706
  }
45543
45707
  /** @internal */
45544
45708
  getUsedTables() {
@@ -45548,8 +45712,7 @@ var init_select5 = __esm({
45548
45712
  return (table6, on) => {
45549
45713
  const baseTableName = this.tableName;
45550
45714
  const tableName = getTableLikeName(table6);
45551
- for (const item of extractUsedTable4(table6))
45552
- this.usedTables.add(item);
45715
+ for (const item of extractUsedTable4(table6)) this.usedTables.add(item);
45553
45716
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
45554
45717
  throw new Error(`Alias "${tableName}" is already used in this query`);
45555
45718
  }
@@ -45808,8 +45971,7 @@ var init_select5 = __esm({
45808
45971
  const usedTables = [];
45809
45972
  usedTables.push(...extractUsedTable4(this.config.table));
45810
45973
  if (this.config.joins) {
45811
- for (const it of this.config.joins)
45812
- usedTables.push(...extractUsedTable4(it.table));
45974
+ for (const it of this.config.joins) usedTables.push(...extractUsedTable4(it.table));
45813
45975
  }
45814
45976
  return new Proxy(
45815
45977
  new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),
@@ -46367,10 +46529,9 @@ var init_session4 = __esm({
46367
46529
  "use strict";
46368
46530
  init_cache();
46369
46531
  init_entity();
46370
- init_errors();
46371
46532
  init_errors2();
46533
+ init_errors3();
46372
46534
  init_sql();
46373
- init_utils2();
46374
46535
  init_db4();
46375
46536
  _a434 = entityKind;
46376
46537
  SingleStorePreparedQuery = class {