@basemaps/server 8.1.0 → 8.3.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.
@@ -9308,9 +9308,9 @@ __export(tslib_es6_exports, {
9308
9308
  __asyncValues: () => __asyncValues,
9309
9309
  __await: () => __await,
9310
9310
  __awaiter: () => __awaiter,
9311
- __classPrivateFieldGet: () => __classPrivateFieldGet,
9311
+ __classPrivateFieldGet: () => __classPrivateFieldGet2,
9312
9312
  __classPrivateFieldIn: () => __classPrivateFieldIn,
9313
- __classPrivateFieldSet: () => __classPrivateFieldSet,
9313
+ __classPrivateFieldSet: () => __classPrivateFieldSet2,
9314
9314
  __createBinding: () => __createBinding,
9315
9315
  __decorate: () => __decorate,
9316
9316
  __disposeResources: () => __disposeResources,
@@ -9704,14 +9704,14 @@ function __importStar(mod) {
9704
9704
  function __importDefault(mod) {
9705
9705
  return mod && mod.__esModule ? mod : { default: mod };
9706
9706
  }
9707
- function __classPrivateFieldGet(receiver, state, kind, f) {
9707
+ function __classPrivateFieldGet2(receiver, state, kind, f) {
9708
9708
  if (kind === "a" && !f)
9709
9709
  throw new TypeError("Private accessor was defined without a getter");
9710
9710
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
9711
9711
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
9712
9712
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9713
9713
  }
9714
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
9714
+ function __classPrivateFieldSet2(receiver, state, value, kind, f) {
9715
9715
  if (kind === "m")
9716
9716
  throw new TypeError("Private method is not writable");
9717
9717
  if (kind === "a" && !f)
@@ -9883,8 +9883,8 @@ var init_tslib_es6 = __esm({
9883
9883
  __makeTemplateObject,
9884
9884
  __importStar,
9885
9885
  __importDefault,
9886
- __classPrivateFieldGet,
9887
- __classPrivateFieldSet,
9886
+ __classPrivateFieldGet: __classPrivateFieldGet2,
9887
+ __classPrivateFieldSet: __classPrivateFieldSet2,
9888
9888
  __classPrivateFieldIn,
9889
9889
  __addDisposableResource,
9890
9890
  __disposeResources,
@@ -13644,8 +13644,8 @@ __export(tslib_es6_exports2, {
13644
13644
  __asyncValues: () => __asyncValues2,
13645
13645
  __await: () => __await2,
13646
13646
  __awaiter: () => __awaiter2,
13647
- __classPrivateFieldGet: () => __classPrivateFieldGet2,
13648
- __classPrivateFieldSet: () => __classPrivateFieldSet2,
13647
+ __classPrivateFieldGet: () => __classPrivateFieldGet3,
13648
+ __classPrivateFieldSet: () => __classPrivateFieldSet3,
13649
13649
  __createBinding: () => __createBinding2,
13650
13650
  __decorate: () => __decorate2,
13651
13651
  __exportStar: () => __exportStar2,
@@ -13956,13 +13956,13 @@ function __importStar2(mod) {
13956
13956
  function __importDefault2(mod) {
13957
13957
  return mod && mod.__esModule ? mod : { default: mod };
13958
13958
  }
13959
- function __classPrivateFieldGet2(receiver, privateMap) {
13959
+ function __classPrivateFieldGet3(receiver, privateMap) {
13960
13960
  if (!privateMap.has(receiver)) {
13961
13961
  throw new TypeError("attempted to get private field on non-instance");
13962
13962
  }
13963
13963
  return privateMap.get(receiver);
13964
13964
  }
13965
- function __classPrivateFieldSet2(receiver, privateMap, value) {
13965
+ function __classPrivateFieldSet3(receiver, privateMap, value) {
13966
13966
  if (!privateMap.has(receiver)) {
13967
13967
  throw new TypeError("attempted to set private field on non-instance");
13968
13968
  }
@@ -42134,8 +42134,8 @@ __export(tslib_es6_exports3, {
42134
42134
  __asyncValues: () => __asyncValues3,
42135
42135
  __await: () => __await3,
42136
42136
  __awaiter: () => __awaiter3,
42137
- __classPrivateFieldGet: () => __classPrivateFieldGet3,
42138
- __classPrivateFieldSet: () => __classPrivateFieldSet3,
42137
+ __classPrivateFieldGet: () => __classPrivateFieldGet4,
42138
+ __classPrivateFieldSet: () => __classPrivateFieldSet4,
42139
42139
  __createBinding: () => __createBinding3,
42140
42140
  __decorate: () => __decorate3,
42141
42141
  __exportStar: () => __exportStar3,
@@ -42446,13 +42446,13 @@ function __importStar3(mod) {
42446
42446
  function __importDefault3(mod) {
42447
42447
  return mod && mod.__esModule ? mod : { default: mod };
42448
42448
  }
42449
- function __classPrivateFieldGet3(receiver, privateMap) {
42449
+ function __classPrivateFieldGet4(receiver, privateMap) {
42450
42450
  if (!privateMap.has(receiver)) {
42451
42451
  throw new TypeError("attempted to get private field on non-instance");
42452
42452
  }
42453
42453
  return privateMap.get(receiver);
42454
42454
  }
42455
- function __classPrivateFieldSet3(receiver, privateMap, value) {
42455
+ function __classPrivateFieldSet4(receiver, privateMap, value) {
42456
42456
  if (!privateMap.has(receiver)) {
42457
42457
  throw new TypeError("attempted to set private field on non-instance");
42458
42458
  }
@@ -124913,9 +124913,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
124913
124913
  var CliInfo = {
124914
124914
  // Detect unlinked packages looks for this string since its a package name, slightly work around it
124915
124915
  package: "@basemaps/cli",
124916
- version: "v8.0.0-4-g14a4364d",
124917
- hash: "14a4364d39e226b7ed0396fee9c3adc534d1142b",
124918
- buildId: "15100600846-1"
124916
+ version: "v8.2.0-8-gfe8bbf9d",
124917
+ hash: "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8",
124918
+ buildId: "15719849199-1"
124919
124919
  };
124920
124920
  var CliDate = (/* @__PURE__ */ new Date()).toISOString();
124921
124921
  var CliId = ulid2.ulid();
@@ -125222,7 +125222,10 @@ var quotelessJson = (obj) => {
125222
125222
  const json = JSON.stringify(obj, null, 2);
125223
125223
  return json.replace(/"([^"]+)":/g, "$1:");
125224
125224
  };
125225
- var ZodError = class extends Error {
125225
+ var ZodError = class _ZodError extends Error {
125226
+ get errors() {
125227
+ return this.issues;
125228
+ }
125226
125229
  constructor(issues) {
125227
125230
  super();
125228
125231
  this.issues = [];
@@ -125241,9 +125244,6 @@ var ZodError = class extends Error {
125241
125244
  this.name = "ZodError";
125242
125245
  this.issues = issues;
125243
125246
  }
125244
- get errors() {
125245
- return this.issues;
125246
- }
125247
125247
  format(_mapper) {
125248
125248
  const mapper = _mapper || function(issue) {
125249
125249
  return issue.message;
@@ -125280,6 +125280,11 @@ var ZodError = class extends Error {
125280
125280
  processError(this);
125281
125281
  return fieldErrors;
125282
125282
  }
125283
+ static assert(value) {
125284
+ if (!(value instanceof _ZodError)) {
125285
+ throw new Error(`Not a ZodError: ${value}`);
125286
+ }
125287
+ }
125283
125288
  toString() {
125284
125289
  return this.message;
125285
125290
  }
@@ -125422,6 +125427,13 @@ var makeIssue = (params) => {
125422
125427
  ...issueData,
125423
125428
  path: fullPath
125424
125429
  };
125430
+ if (issueData.message !== void 0) {
125431
+ return {
125432
+ ...issueData,
125433
+ path: fullPath,
125434
+ message: issueData.message
125435
+ };
125436
+ }
125425
125437
  let errorMessage = "";
125426
125438
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
125427
125439
  for (const map of maps) {
@@ -125430,20 +125442,24 @@ var makeIssue = (params) => {
125430
125442
  return {
125431
125443
  ...issueData,
125432
125444
  path: fullPath,
125433
- message: issueData.message || errorMessage
125445
+ message: errorMessage
125434
125446
  };
125435
125447
  };
125436
125448
  var EMPTY_PATH = [];
125437
125449
  function addIssueToContext(ctx, issueData) {
125450
+ const overrideMap = getErrorMap();
125438
125451
  const issue = makeIssue({
125439
125452
  issueData,
125440
125453
  data: ctx.data,
125441
125454
  path: ctx.path,
125442
125455
  errorMaps: [
125443
125456
  ctx.common.contextualErrorMap,
125457
+ // contextual error map is first priority
125444
125458
  ctx.schemaErrorMap,
125445
- getErrorMap(),
125446
- errorMap
125459
+ // then schema-bound map if available
125460
+ overrideMap,
125461
+ // then global override map
125462
+ overrideMap === errorMap ? void 0 : errorMap
125447
125463
  // then global default map
125448
125464
  ].filter((x) => !!x)
125449
125465
  });
@@ -125475,9 +125491,11 @@ var ParseStatus = class _ParseStatus {
125475
125491
  static async mergeObjectAsync(status, pairs) {
125476
125492
  const syncPairs = [];
125477
125493
  for (const pair of pairs) {
125494
+ const key = await pair.key;
125495
+ const value = await pair.value;
125478
125496
  syncPairs.push({
125479
- key: await pair.key,
125480
- value: await pair.value
125497
+ key,
125498
+ value
125481
125499
  });
125482
125500
  }
125483
125501
  return _ParseStatus.mergeObjectSync(status, syncPairs);
@@ -125510,11 +125528,29 @@ var isAborted = (x) => x.status === "aborted";
125510
125528
  var isDirty = (x) => x.status === "dirty";
125511
125529
  var isValid = (x) => x.status === "valid";
125512
125530
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
125531
+ function __classPrivateFieldGet(receiver, state, kind, f) {
125532
+ if (kind === "a" && !f)
125533
+ throw new TypeError("Private accessor was defined without a getter");
125534
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
125535
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
125536
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
125537
+ }
125538
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
125539
+ if (kind === "m")
125540
+ throw new TypeError("Private method is not writable");
125541
+ if (kind === "a" && !f)
125542
+ throw new TypeError("Private accessor was defined without a setter");
125543
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
125544
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
125545
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
125546
+ }
125513
125547
  var errorUtil;
125514
125548
  (function(errorUtil2) {
125515
125549
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
125516
125550
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
125517
125551
  })(errorUtil || (errorUtil = {}));
125552
+ var _ZodEnum_cache;
125553
+ var _ZodNativeEnum_cache;
125518
125554
  var ParseInputLazyPath = class {
125519
125555
  constructor(parent, value, path3, key) {
125520
125556
  this._cachedPath = [];
@@ -125563,44 +125599,21 @@ function processCreateParams(params) {
125563
125599
  if (errorMap2)
125564
125600
  return { errorMap: errorMap2, description };
125565
125601
  const customMap = (iss, ctx) => {
125566
- if (iss.code !== "invalid_type")
125567
- return { message: ctx.defaultError };
125602
+ var _a2, _b;
125603
+ const { message } = params;
125604
+ if (iss.code === "invalid_enum_value") {
125605
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
125606
+ }
125568
125607
  if (typeof ctx.data === "undefined") {
125569
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
125608
+ return { message: (_a2 = message !== null && message !== void 0 ? message : required_error) !== null && _a2 !== void 0 ? _a2 : ctx.defaultError };
125570
125609
  }
125571
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
125610
+ if (iss.code !== "invalid_type")
125611
+ return { message: ctx.defaultError };
125612
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
125572
125613
  };
125573
125614
  return { errorMap: customMap, description };
125574
125615
  }
125575
125616
  var ZodType = class {
125576
- constructor(def) {
125577
- this.spa = this.safeParseAsync;
125578
- this._def = def;
125579
- this.parse = this.parse.bind(this);
125580
- this.safeParse = this.safeParse.bind(this);
125581
- this.parseAsync = this.parseAsync.bind(this);
125582
- this.safeParseAsync = this.safeParseAsync.bind(this);
125583
- this.spa = this.spa.bind(this);
125584
- this.refine = this.refine.bind(this);
125585
- this.refinement = this.refinement.bind(this);
125586
- this.superRefine = this.superRefine.bind(this);
125587
- this.optional = this.optional.bind(this);
125588
- this.nullable = this.nullable.bind(this);
125589
- this.nullish = this.nullish.bind(this);
125590
- this.array = this.array.bind(this);
125591
- this.promise = this.promise.bind(this);
125592
- this.or = this.or.bind(this);
125593
- this.and = this.and.bind(this);
125594
- this.transform = this.transform.bind(this);
125595
- this.brand = this.brand.bind(this);
125596
- this.default = this.default.bind(this);
125597
- this.catch = this.catch.bind(this);
125598
- this.describe = this.describe.bind(this);
125599
- this.pipe = this.pipe.bind(this);
125600
- this.readonly = this.readonly.bind(this);
125601
- this.isNullable = this.isNullable.bind(this);
125602
- this.isOptional = this.isOptional.bind(this);
125603
- }
125604
125617
  get description() {
125605
125618
  return this._def.description;
125606
125619
  }
@@ -125664,6 +125677,43 @@ var ZodType = class {
125664
125677
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
125665
125678
  return handleResult(ctx, result);
125666
125679
  }
125680
+ "~validate"(data) {
125681
+ var _a2, _b;
125682
+ const ctx = {
125683
+ common: {
125684
+ issues: [],
125685
+ async: !!this["~standard"].async
125686
+ },
125687
+ path: [],
125688
+ schemaErrorMap: this._def.errorMap,
125689
+ parent: null,
125690
+ data,
125691
+ parsedType: getParsedType(data)
125692
+ };
125693
+ if (!this["~standard"].async) {
125694
+ try {
125695
+ const result = this._parseSync({ data, path: [], parent: ctx });
125696
+ return isValid(result) ? {
125697
+ value: result.value
125698
+ } : {
125699
+ issues: ctx.common.issues
125700
+ };
125701
+ } catch (err) {
125702
+ if ((_b = (_a2 = err === null || err === void 0 ? void 0 : err.message) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
125703
+ this["~standard"].async = true;
125704
+ }
125705
+ ctx.common = {
125706
+ issues: [],
125707
+ async: true
125708
+ };
125709
+ }
125710
+ }
125711
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
125712
+ value: result.value
125713
+ } : {
125714
+ issues: ctx.common.issues
125715
+ });
125716
+ }
125667
125717
  async parseAsync(data, params) {
125668
125718
  const result = await this.safeParseAsync(data, params);
125669
125719
  if (result.success)
@@ -125741,6 +125791,39 @@ var ZodType = class {
125741
125791
  superRefine(refinement) {
125742
125792
  return this._refinement(refinement);
125743
125793
  }
125794
+ constructor(def) {
125795
+ this.spa = this.safeParseAsync;
125796
+ this._def = def;
125797
+ this.parse = this.parse.bind(this);
125798
+ this.safeParse = this.safeParse.bind(this);
125799
+ this.parseAsync = this.parseAsync.bind(this);
125800
+ this.safeParseAsync = this.safeParseAsync.bind(this);
125801
+ this.spa = this.spa.bind(this);
125802
+ this.refine = this.refine.bind(this);
125803
+ this.refinement = this.refinement.bind(this);
125804
+ this.superRefine = this.superRefine.bind(this);
125805
+ this.optional = this.optional.bind(this);
125806
+ this.nullable = this.nullable.bind(this);
125807
+ this.nullish = this.nullish.bind(this);
125808
+ this.array = this.array.bind(this);
125809
+ this.promise = this.promise.bind(this);
125810
+ this.or = this.or.bind(this);
125811
+ this.and = this.and.bind(this);
125812
+ this.transform = this.transform.bind(this);
125813
+ this.brand = this.brand.bind(this);
125814
+ this.default = this.default.bind(this);
125815
+ this.catch = this.catch.bind(this);
125816
+ this.describe = this.describe.bind(this);
125817
+ this.pipe = this.pipe.bind(this);
125818
+ this.readonly = this.readonly.bind(this);
125819
+ this.isNullable = this.isNullable.bind(this);
125820
+ this.isOptional = this.isOptional.bind(this);
125821
+ this["~standard"] = {
125822
+ version: 1,
125823
+ vendor: "zod",
125824
+ validate: (data) => this["~validate"](data)
125825
+ };
125826
+ }
125744
125827
  optional() {
125745
125828
  return ZodOptional.create(this, this._def);
125746
125829
  }
@@ -125751,7 +125834,7 @@ var ZodType = class {
125751
125834
  return this.nullable().optional();
125752
125835
  }
125753
125836
  array() {
125754
- return ZodArray.create(this, this._def);
125837
+ return ZodArray.create(this);
125755
125838
  }
125756
125839
  promise() {
125757
125840
  return ZodPromise.create(this, this._def);
@@ -125816,35 +125899,45 @@ var ZodType = class {
125816
125899
  }
125817
125900
  };
125818
125901
  var cuidRegex = /^c[^\s-]{8,}$/i;
125819
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
125820
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
125902
+ var cuid2Regex = /^[0-9a-z]+$/;
125903
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
125821
125904
  var 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;
125822
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
125905
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
125906
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
125907
+ var 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)?)??$/;
125908
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
125823
125909
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
125824
125910
  var emojiRegex;
125825
- var ipv4Regex = /^(((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}))$/;
125826
- var 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})))$/;
125827
- var datetimeRegex = (args) => {
125911
+ var 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])$/;
125912
+ var 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])$/;
125913
+ var 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]))$/;
125914
+ var 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])$/;
125915
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
125916
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
125917
+ var 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])))`;
125918
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
125919
+ function timeRegexSource(args) {
125920
+ let secondsRegexSource = `[0-5]\\d`;
125828
125921
  if (args.precision) {
125829
- if (args.offset) {
125830
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
125831
- } else {
125832
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
125833
- }
125834
- } else if (args.precision === 0) {
125835
- if (args.offset) {
125836
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
125837
- } else {
125838
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
125839
- }
125840
- } else {
125841
- if (args.offset) {
125842
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
125843
- } else {
125844
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
125845
- }
125922
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
125923
+ } else if (args.precision == null) {
125924
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
125846
125925
  }
125847
- };
125926
+ const secondsQuantifier = args.precision ? "+" : "?";
125927
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
125928
+ }
125929
+ function timeRegex(args) {
125930
+ return new RegExp(`^${timeRegexSource(args)}$`);
125931
+ }
125932
+ function datetimeRegex(args) {
125933
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
125934
+ const opts = [];
125935
+ opts.push(args.local ? `Z?` : `Z`);
125936
+ if (args.offset)
125937
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
125938
+ regex = `${regex}(${opts.join("|")})`;
125939
+ return new RegExp(`^${regex}$`);
125940
+ }
125848
125941
  function isValidIP(ip, version3) {
125849
125942
  if ((version3 === "v4" || !version3) && ipv4Regex.test(ip)) {
125850
125943
  return true;
@@ -125854,6 +125947,33 @@ function isValidIP(ip, version3) {
125854
125947
  }
125855
125948
  return false;
125856
125949
  }
125950
+ function isValidJWT(jwt, alg) {
125951
+ if (!jwtRegex.test(jwt))
125952
+ return false;
125953
+ try {
125954
+ const [header] = jwt.split(".");
125955
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
125956
+ const decoded = JSON.parse(atob(base64));
125957
+ if (typeof decoded !== "object" || decoded === null)
125958
+ return false;
125959
+ if (!decoded.typ || !decoded.alg)
125960
+ return false;
125961
+ if (alg && decoded.alg !== alg)
125962
+ return false;
125963
+ return true;
125964
+ } catch (_a2) {
125965
+ return false;
125966
+ }
125967
+ }
125968
+ function isValidCidr(ip, version3) {
125969
+ if ((version3 === "v4" || !version3) && ipv4CidrRegex.test(ip)) {
125970
+ return true;
125971
+ }
125972
+ if ((version3 === "v6" || !version3) && ipv6CidrRegex.test(ip)) {
125973
+ return true;
125974
+ }
125975
+ return false;
125976
+ }
125857
125977
  var ZodString = class _ZodString extends ZodType {
125858
125978
  _parse(input) {
125859
125979
  if (this._def.coerce) {
@@ -125862,15 +125982,11 @@ var ZodString = class _ZodString extends ZodType {
125862
125982
  const parsedType = this._getType(input);
125863
125983
  if (parsedType !== ZodParsedType.string) {
125864
125984
  const ctx2 = this._getOrReturnCtx(input);
125865
- addIssueToContext(
125866
- ctx2,
125867
- {
125868
- code: ZodIssueCode.invalid_type,
125869
- expected: ZodParsedType.string,
125870
- received: ctx2.parsedType
125871
- }
125872
- //
125873
- );
125985
+ addIssueToContext(ctx2, {
125986
+ code: ZodIssueCode.invalid_type,
125987
+ expected: ZodParsedType.string,
125988
+ received: ctx2.parsedType
125989
+ });
125874
125990
  return INVALID;
125875
125991
  }
125876
125992
  const status = new ParseStatus();
@@ -125961,6 +126077,16 @@ var ZodString = class _ZodString extends ZodType {
125961
126077
  });
125962
126078
  status.dirty();
125963
126079
  }
126080
+ } else if (check.kind === "nanoid") {
126081
+ if (!nanoidRegex.test(input.data)) {
126082
+ ctx = this._getOrReturnCtx(input, ctx);
126083
+ addIssueToContext(ctx, {
126084
+ validation: "nanoid",
126085
+ code: ZodIssueCode.invalid_string,
126086
+ message: check.message
126087
+ });
126088
+ status.dirty();
126089
+ }
125964
126090
  } else if (check.kind === "cuid") {
125965
126091
  if (!cuidRegex.test(input.data)) {
125966
126092
  ctx = this._getOrReturnCtx(input, ctx);
@@ -126062,6 +126188,38 @@ var ZodString = class _ZodString extends ZodType {
126062
126188
  });
126063
126189
  status.dirty();
126064
126190
  }
126191
+ } else if (check.kind === "date") {
126192
+ const regex = dateRegex;
126193
+ if (!regex.test(input.data)) {
126194
+ ctx = this._getOrReturnCtx(input, ctx);
126195
+ addIssueToContext(ctx, {
126196
+ code: ZodIssueCode.invalid_string,
126197
+ validation: "date",
126198
+ message: check.message
126199
+ });
126200
+ status.dirty();
126201
+ }
126202
+ } else if (check.kind === "time") {
126203
+ const regex = timeRegex(check);
126204
+ if (!regex.test(input.data)) {
126205
+ ctx = this._getOrReturnCtx(input, ctx);
126206
+ addIssueToContext(ctx, {
126207
+ code: ZodIssueCode.invalid_string,
126208
+ validation: "time",
126209
+ message: check.message
126210
+ });
126211
+ status.dirty();
126212
+ }
126213
+ } else if (check.kind === "duration") {
126214
+ if (!durationRegex.test(input.data)) {
126215
+ ctx = this._getOrReturnCtx(input, ctx);
126216
+ addIssueToContext(ctx, {
126217
+ validation: "duration",
126218
+ code: ZodIssueCode.invalid_string,
126219
+ message: check.message
126220
+ });
126221
+ status.dirty();
126222
+ }
126065
126223
  } else if (check.kind === "ip") {
126066
126224
  if (!isValidIP(input.data, check.version)) {
126067
126225
  ctx = this._getOrReturnCtx(input, ctx);
@@ -126072,6 +126230,46 @@ var ZodString = class _ZodString extends ZodType {
126072
126230
  });
126073
126231
  status.dirty();
126074
126232
  }
126233
+ } else if (check.kind === "jwt") {
126234
+ if (!isValidJWT(input.data, check.alg)) {
126235
+ ctx = this._getOrReturnCtx(input, ctx);
126236
+ addIssueToContext(ctx, {
126237
+ validation: "jwt",
126238
+ code: ZodIssueCode.invalid_string,
126239
+ message: check.message
126240
+ });
126241
+ status.dirty();
126242
+ }
126243
+ } else if (check.kind === "cidr") {
126244
+ if (!isValidCidr(input.data, check.version)) {
126245
+ ctx = this._getOrReturnCtx(input, ctx);
126246
+ addIssueToContext(ctx, {
126247
+ validation: "cidr",
126248
+ code: ZodIssueCode.invalid_string,
126249
+ message: check.message
126250
+ });
126251
+ status.dirty();
126252
+ }
126253
+ } else if (check.kind === "base64") {
126254
+ if (!base64Regex.test(input.data)) {
126255
+ ctx = this._getOrReturnCtx(input, ctx);
126256
+ addIssueToContext(ctx, {
126257
+ validation: "base64",
126258
+ code: ZodIssueCode.invalid_string,
126259
+ message: check.message
126260
+ });
126261
+ status.dirty();
126262
+ }
126263
+ } else if (check.kind === "base64url") {
126264
+ if (!base64urlRegex.test(input.data)) {
126265
+ ctx = this._getOrReturnCtx(input, ctx);
126266
+ addIssueToContext(ctx, {
126267
+ validation: "base64url",
126268
+ code: ZodIssueCode.invalid_string,
126269
+ message: check.message
126270
+ });
126271
+ status.dirty();
126272
+ }
126075
126273
  } else {
126076
126274
  util.assertNever(check);
126077
126275
  }
@@ -126103,6 +126301,9 @@ var ZodString = class _ZodString extends ZodType {
126103
126301
  uuid(message) {
126104
126302
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
126105
126303
  }
126304
+ nanoid(message) {
126305
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
126306
+ }
126106
126307
  cuid(message) {
126107
126308
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
126108
126309
  }
@@ -126112,16 +126313,32 @@ var ZodString = class _ZodString extends ZodType {
126112
126313
  ulid(message) {
126113
126314
  return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
126114
126315
  }
126316
+ base64(message) {
126317
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
126318
+ }
126319
+ base64url(message) {
126320
+ return this._addCheck({
126321
+ kind: "base64url",
126322
+ ...errorUtil.errToObj(message)
126323
+ });
126324
+ }
126325
+ jwt(options) {
126326
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
126327
+ }
126115
126328
  ip(options) {
126116
126329
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
126117
126330
  }
126331
+ cidr(options) {
126332
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
126333
+ }
126118
126334
  datetime(options) {
126119
- var _a2;
126335
+ var _a2, _b;
126120
126336
  if (typeof options === "string") {
126121
126337
  return this._addCheck({
126122
126338
  kind: "datetime",
126123
126339
  precision: null,
126124
126340
  offset: false,
126341
+ local: false,
126125
126342
  message: options
126126
126343
  });
126127
126344
  }
@@ -126129,9 +126346,30 @@ var ZodString = class _ZodString extends ZodType {
126129
126346
  kind: "datetime",
126130
126347
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
126131
126348
  offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
126349
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
126350
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
126351
+ });
126352
+ }
126353
+ date(message) {
126354
+ return this._addCheck({ kind: "date", message });
126355
+ }
126356
+ time(options) {
126357
+ if (typeof options === "string") {
126358
+ return this._addCheck({
126359
+ kind: "time",
126360
+ precision: null,
126361
+ message: options
126362
+ });
126363
+ }
126364
+ return this._addCheck({
126365
+ kind: "time",
126366
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
126132
126367
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
126133
126368
  });
126134
126369
  }
126370
+ duration(message) {
126371
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
126372
+ }
126135
126373
  regex(regex, message) {
126136
126374
  return this._addCheck({
126137
126375
  kind: "regex",
@@ -126183,8 +126421,7 @@ var ZodString = class _ZodString extends ZodType {
126183
126421
  });
126184
126422
  }
126185
126423
  /**
126186
- * @deprecated Use z.string().min(1) instead.
126187
- * @see {@link ZodString.min}
126424
+ * Equivalent to `.min(1)`
126188
126425
  */
126189
126426
  nonempty(message) {
126190
126427
  return this.min(1, errorUtil.errToObj(message));
@@ -126210,6 +126447,15 @@ var ZodString = class _ZodString extends ZodType {
126210
126447
  get isDatetime() {
126211
126448
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
126212
126449
  }
126450
+ get isDate() {
126451
+ return !!this._def.checks.find((ch) => ch.kind === "date");
126452
+ }
126453
+ get isTime() {
126454
+ return !!this._def.checks.find((ch) => ch.kind === "time");
126455
+ }
126456
+ get isDuration() {
126457
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
126458
+ }
126213
126459
  get isEmail() {
126214
126460
  return !!this._def.checks.find((ch) => ch.kind === "email");
126215
126461
  }
@@ -126222,6 +126468,9 @@ var ZodString = class _ZodString extends ZodType {
126222
126468
  get isUUID() {
126223
126469
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
126224
126470
  }
126471
+ get isNANOID() {
126472
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
126473
+ }
126225
126474
  get isCUID() {
126226
126475
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
126227
126476
  }
@@ -126234,6 +126483,15 @@ var ZodString = class _ZodString extends ZodType {
126234
126483
  get isIP() {
126235
126484
  return !!this._def.checks.find((ch) => ch.kind === "ip");
126236
126485
  }
126486
+ get isCIDR() {
126487
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
126488
+ }
126489
+ get isBase64() {
126490
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
126491
+ }
126492
+ get isBase64url() {
126493
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
126494
+ }
126237
126495
  get minLength() {
126238
126496
  let min = null;
126239
126497
  for (const ch of this._def.checks) {
@@ -126511,17 +126769,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
126511
126769
  }
126512
126770
  _parse(input) {
126513
126771
  if (this._def.coerce) {
126514
- input.data = BigInt(input.data);
126772
+ try {
126773
+ input.data = BigInt(input.data);
126774
+ } catch (_a2) {
126775
+ return this._getInvalidInput(input);
126776
+ }
126515
126777
  }
126516
126778
  const parsedType = this._getType(input);
126517
126779
  if (parsedType !== ZodParsedType.bigint) {
126518
- const ctx2 = this._getOrReturnCtx(input);
126519
- addIssueToContext(ctx2, {
126520
- code: ZodIssueCode.invalid_type,
126521
- expected: ZodParsedType.bigint,
126522
- received: ctx2.parsedType
126523
- });
126524
- return INVALID;
126780
+ return this._getInvalidInput(input);
126525
126781
  }
126526
126782
  let ctx = void 0;
126527
126783
  const status = new ParseStatus();
@@ -126568,6 +126824,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
126568
126824
  }
126569
126825
  return { status: status.value, value: input.data };
126570
126826
  }
126827
+ _getInvalidInput(input) {
126828
+ const ctx = this._getOrReturnCtx(input);
126829
+ addIssueToContext(ctx, {
126830
+ code: ZodIssueCode.invalid_type,
126831
+ expected: ZodParsedType.bigint,
126832
+ received: ctx.parsedType
126833
+ });
126834
+ return INVALID;
126835
+ }
126571
126836
  gte(value, message) {
126572
126837
  return this.setLimit("min", value, true, errorUtil.toString(message));
126573
126838
  }
@@ -127147,9 +127412,10 @@ var ZodObject = class _ZodObject extends ZodType {
127147
127412
  const syncPairs = [];
127148
127413
  for (const pair of pairs) {
127149
127414
  const key = await pair.key;
127415
+ const value = await pair.value;
127150
127416
  syncPairs.push({
127151
127417
  key,
127152
- value: await pair.value,
127418
+ value,
127153
127419
  alwaysSet: pair.alwaysSet
127154
127420
  });
127155
127421
  }
@@ -127500,15 +127766,25 @@ var getDiscriminator = (type) => {
127500
127766
  } else if (type instanceof ZodEnum) {
127501
127767
  return type.options;
127502
127768
  } else if (type instanceof ZodNativeEnum) {
127503
- return Object.keys(type.enum);
127769
+ return util.objectValues(type.enum);
127504
127770
  } else if (type instanceof ZodDefault) {
127505
127771
  return getDiscriminator(type._def.innerType);
127506
127772
  } else if (type instanceof ZodUndefined) {
127507
127773
  return [void 0];
127508
127774
  } else if (type instanceof ZodNull) {
127509
127775
  return [null];
127776
+ } else if (type instanceof ZodOptional) {
127777
+ return [void 0, ...getDiscriminator(type.unwrap())];
127778
+ } else if (type instanceof ZodNullable) {
127779
+ return [null, ...getDiscriminator(type.unwrap())];
127780
+ } else if (type instanceof ZodBranded) {
127781
+ return getDiscriminator(type.unwrap());
127782
+ } else if (type instanceof ZodReadonly) {
127783
+ return getDiscriminator(type.unwrap());
127784
+ } else if (type instanceof ZodCatch) {
127785
+ return getDiscriminator(type._def.innerType);
127510
127786
  } else {
127511
- return null;
127787
+ return [];
127512
127788
  }
127513
127789
  };
127514
127790
  var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
@@ -127568,7 +127844,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
127568
127844
  const optionsMap = /* @__PURE__ */ new Map();
127569
127845
  for (const type of options) {
127570
127846
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
127571
- if (!discriminatorValues) {
127847
+ if (!discriminatorValues.length) {
127572
127848
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
127573
127849
  }
127574
127850
  for (const value of discriminatorValues) {
@@ -127768,7 +128044,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
127768
128044
  for (const key in ctx.data) {
127769
128045
  pairs.push({
127770
128046
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
127771
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
128047
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
128048
+ alwaysSet: key in ctx.data
127772
128049
  });
127773
128050
  }
127774
128051
  if (ctx.common.async) {
@@ -128112,6 +128389,10 @@ function createZodEnum(values, params) {
128112
128389
  });
128113
128390
  }
128114
128391
  var ZodEnum = class _ZodEnum extends ZodType {
128392
+ constructor() {
128393
+ super(...arguments);
128394
+ _ZodEnum_cache.set(this, void 0);
128395
+ }
128115
128396
  _parse(input) {
128116
128397
  if (typeof input.data !== "string") {
128117
128398
  const ctx = this._getOrReturnCtx(input);
@@ -128123,7 +128404,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
128123
128404
  });
128124
128405
  return INVALID;
128125
128406
  }
128126
- if (this._def.values.indexOf(input.data) === -1) {
128407
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
128408
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
128409
+ }
128410
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
128127
128411
  const ctx = this._getOrReturnCtx(input);
128128
128412
  const expectedValues = this._def.values;
128129
128413
  addIssueToContext(ctx, {
@@ -128159,15 +128443,26 @@ var ZodEnum = class _ZodEnum extends ZodType {
128159
128443
  }
128160
128444
  return enumValues;
128161
128445
  }
128162
- extract(values) {
128163
- return _ZodEnum.create(values);
128446
+ extract(values, newDef = this._def) {
128447
+ return _ZodEnum.create(values, {
128448
+ ...this._def,
128449
+ ...newDef
128450
+ });
128164
128451
  }
128165
- exclude(values) {
128166
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
128452
+ exclude(values, newDef = this._def) {
128453
+ return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
128454
+ ...this._def,
128455
+ ...newDef
128456
+ });
128167
128457
  }
128168
128458
  };
128459
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
128169
128460
  ZodEnum.create = createZodEnum;
128170
128461
  var ZodNativeEnum = class extends ZodType {
128462
+ constructor() {
128463
+ super(...arguments);
128464
+ _ZodNativeEnum_cache.set(this, void 0);
128465
+ }
128171
128466
  _parse(input) {
128172
128467
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
128173
128468
  const ctx = this._getOrReturnCtx(input);
@@ -128180,7 +128475,10 @@ var ZodNativeEnum = class extends ZodType {
128180
128475
  });
128181
128476
  return INVALID;
128182
128477
  }
128183
- if (nativeEnumValues.indexOf(input.data) === -1) {
128478
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
128479
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
128480
+ }
128481
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
128184
128482
  const expectedValues = util.objectValues(nativeEnumValues);
128185
128483
  addIssueToContext(ctx, {
128186
128484
  received: ctx.data,
@@ -128195,6 +128493,7 @@ var ZodNativeEnum = class extends ZodType {
128195
128493
  return this._def.values;
128196
128494
  }
128197
128495
  };
128496
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
128198
128497
  ZodNativeEnum.create = (values, params) => {
128199
128498
  return new ZodNativeEnum({
128200
128499
  values,
@@ -128258,26 +128557,38 @@ var ZodEffects = class extends ZodType {
128258
128557
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
128259
128558
  if (effect.type === "preprocess") {
128260
128559
  const processed = effect.transform(ctx.data, checkCtx);
128261
- if (ctx.common.issues.length) {
128262
- return {
128263
- status: "dirty",
128264
- value: ctx.data
128265
- };
128266
- }
128267
128560
  if (ctx.common.async) {
128268
- return Promise.resolve(processed).then((processed2) => {
128269
- return this._def.schema._parseAsync({
128561
+ return Promise.resolve(processed).then(async (processed2) => {
128562
+ if (status.value === "aborted")
128563
+ return INVALID;
128564
+ const result = await this._def.schema._parseAsync({
128270
128565
  data: processed2,
128271
128566
  path: ctx.path,
128272
128567
  parent: ctx
128273
128568
  });
128569
+ if (result.status === "aborted")
128570
+ return INVALID;
128571
+ if (result.status === "dirty")
128572
+ return DIRTY(result.value);
128573
+ if (status.value === "dirty")
128574
+ return DIRTY(result.value);
128575
+ return result;
128274
128576
  });
128275
128577
  } else {
128276
- return this._def.schema._parseSync({
128578
+ if (status.value === "aborted")
128579
+ return INVALID;
128580
+ const result = this._def.schema._parseSync({
128277
128581
  data: processed,
128278
128582
  path: ctx.path,
128279
128583
  parent: ctx
128280
128584
  });
128585
+ if (result.status === "aborted")
128586
+ return INVALID;
128587
+ if (result.status === "dirty")
128588
+ return DIRTY(result.value);
128589
+ if (status.value === "dirty")
128590
+ return DIRTY(result.value);
128591
+ return result;
128281
128592
  }
128282
128593
  }
128283
128594
  if (effect.type === "refinement") {
@@ -128566,10 +128877,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
128566
128877
  var ZodReadonly = class extends ZodType {
128567
128878
  _parse(input) {
128568
128879
  const result = this._def.innerType._parse(input);
128569
- if (isValid(result)) {
128570
- result.value = Object.freeze(result.value);
128571
- }
128572
- return result;
128880
+ const freeze = (data) => {
128881
+ if (isValid(data)) {
128882
+ data.value = Object.freeze(data.value);
128883
+ }
128884
+ return data;
128885
+ };
128886
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
128887
+ }
128888
+ unwrap() {
128889
+ return this._def.innerType;
128573
128890
  }
128574
128891
  };
128575
128892
  ZodReadonly.create = (type, params) => {
@@ -128579,19 +128896,35 @@ ZodReadonly.create = (type, params) => {
128579
128896
  ...processCreateParams(params)
128580
128897
  });
128581
128898
  };
128582
- var custom = (check, params = {}, fatal) => {
128899
+ function cleanParams(params, data) {
128900
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
128901
+ const p2 = typeof p === "string" ? { message: p } : p;
128902
+ return p2;
128903
+ }
128904
+ function custom(check, _params = {}, fatal) {
128583
128905
  if (check)
128584
128906
  return ZodAny.create().superRefine((data, ctx) => {
128585
128907
  var _a2, _b;
128586
- if (!check(data)) {
128587
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
128588
- const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
128589
- const p2 = typeof p === "string" ? { message: p } : p;
128590
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
128908
+ const r = check(data);
128909
+ if (r instanceof Promise) {
128910
+ return r.then((r2) => {
128911
+ var _a3, _b2;
128912
+ if (!r2) {
128913
+ const params = cleanParams(_params, data);
128914
+ const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
128915
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
128916
+ }
128917
+ });
128591
128918
  }
128919
+ if (!r) {
128920
+ const params = cleanParams(_params, data);
128921
+ const _fatal = (_b = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
128922
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
128923
+ }
128924
+ return;
128592
128925
  });
128593
128926
  return ZodAny.create();
128594
- };
128927
+ }
128595
128928
  var late = {
128596
128929
  object: ZodObject.lazycreate
128597
128930
  };
@@ -128710,6 +129043,7 @@ var z = /* @__PURE__ */ Object.freeze({
128710
129043
  ZodParsedType,
128711
129044
  getParsedType,
128712
129045
  ZodType,
129046
+ datetimeRegex,
128713
129047
  ZodString,
128714
129048
  ZodNumber,
128715
129049
  ZodBigInt,
@@ -130742,6 +131076,7 @@ fsa.register("https://", new FsHttp());
130742
131076
  fsa.register("s3://", s3Fs);
130743
131077
  fsa.register("s3://nz-imagery", s3FsPublic);
130744
131078
  fsa.register("s3://nz-elevation", s3FsPublic);
131079
+ fsa.register("s3://nz-coastal", s3FsPublic);
130745
131080
  var Fsa = fsa;
130746
131081
  var FsaChunk = new SourceChunk({ size: 128 * 1024 });
130747
131082
  fsa.middleware.push(FsaChunk);
@@ -131939,48 +132274,6 @@ Object.defineProperty(Projection, "AllowedFloatingError", {
131939
132274
  value: 1e-8
131940
132275
  });
131941
132276
 
131942
- // ../geo/build/proj/projection.loader.js
131943
- var ProjectionLoader = class {
131944
- /**
131945
- * Ensure that a projection EPSG code is avialable for use in Proj4js
131946
- *
131947
- * If its not already loaded, lookup definition from spatialreference.org
131948
- * @param code
131949
- */
131950
- static async load(code) {
131951
- if (Projection.tryGet(code) != null)
131952
- return Epsg.get(code);
131953
- const url = `https://spatialreference.org/ref/epsg/${code}/ogcwkt/`;
131954
- const res = await this._fetch(url);
131955
- if (!res.ok)
131956
- throw new Error("Failed to load projection information for:" + code);
131957
- let epsg = Epsg.tryGet(code);
131958
- if (epsg == null)
131959
- epsg = new Epsg(code);
131960
- const text = await res.text();
131961
- Projection.define(epsg, text);
131962
- return epsg;
131963
- }
131964
- };
131965
- Object.defineProperty(ProjectionLoader, "_fetch", {
131966
- enumerable: true,
131967
- configurable: true,
131968
- writable: true,
131969
- value: fetch
131970
- });
131971
-
131972
- // ../geo/build/proj/tile.set.name.js
131973
- var TileSetName;
131974
- (function(TileSetName2) {
131975
- TileSetName2["aerial"] = "aerial";
131976
- })(TileSetName || (TileSetName = {}));
131977
-
131978
- // ../geo/build/quad.key.js
131979
- var CHAR_0 = "0".charCodeAt(0);
131980
- var CHAR_1 = "1".charCodeAt(0);
131981
- var CHAR_2 = "2".charCodeAt(0);
131982
- var CHAR_3 = "3".charCodeAt(0);
131983
-
131984
132277
  // ../geo/build/xy.order.js
131985
132278
  function getXyOrder(epsg) {
131986
132279
  const code = typeof epsg === "number" ? epsg : epsg.code;
@@ -132266,25 +132559,25 @@ var TileMatrixSet = class {
132266
132559
  }
132267
132560
  };
132268
132561
 
132269
- // ../geo/build/tms/citm2000.js
132270
- var Citm2000Tmst = {
132562
+ // ../geo/build/tms/google.js
132563
+ var GoogleTmst = {
132271
132564
  type: "TileMatrixSetType",
132272
- title: "Debug tile matrix for EPSG:3793",
132273
- abstract: "",
132274
- identifier: "CITM2000Quad",
132275
- supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3793",
132565
+ title: "Google Maps Compatible for the World",
132566
+ identifier: "WebMercatorQuad",
132276
132567
  boundingBox: {
132277
132568
  type: "BoundingBoxType",
132278
- crs: "https://www.opengis.net/def/crs/EPSG/0/3793",
132279
- lowerCorner: [5051234111622438e-9, 3.4301543757978342e6],
132280
- upperCorner: [5207777145550478e-9, 3.5866974097258747e6]
132569
+ crs: "http://www.opengis.net/def/crs/EPSG/0/3857",
132570
+ lowerCorner: [-200375083427892e-7, -200375083427892e-7],
132571
+ upperCorner: [200375083427892e-7, 200375083427892e-7]
132281
132572
  },
132573
+ supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3857",
132574
+ wellKnownScaleSet: "https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",
132282
132575
  tileMatrix: [
132283
132576
  {
132284
132577
  type: "TileMatrixType",
132285
132578
  identifier: "0",
132286
- scaleDenominator: 218391509386217e-8,
132287
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132579
+ scaleDenominator: 559082264028717e-6,
132580
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132288
132581
  tileWidth: 256,
132289
132582
  tileHeight: 256,
132290
132583
  matrixWidth: 1,
@@ -132293,8 +132586,8 @@ var Citm2000Tmst = {
132293
132586
  {
132294
132587
  type: "TileMatrixType",
132295
132588
  identifier: "1",
132296
- scaleDenominator: 109195754693108e-8,
132297
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132589
+ scaleDenominator: 279541132014358e-6,
132590
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132298
132591
  tileWidth: 256,
132299
132592
  tileHeight: 256,
132300
132593
  matrixWidth: 2,
@@ -132303,8 +132596,8 @@ var Citm2000Tmst = {
132303
132596
  {
132304
132597
  type: "TileMatrixType",
132305
132598
  identifier: "2",
132306
- scaleDenominator: 545978.773465544,
132307
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132599
+ scaleDenominator: 139770566007179e-6,
132600
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132308
132601
  tileWidth: 256,
132309
132602
  tileHeight: 256,
132310
132603
  matrixWidth: 4,
@@ -132313,8 +132606,8 @@ var Citm2000Tmst = {
132313
132606
  {
132314
132607
  type: "TileMatrixType",
132315
132608
  identifier: "3",
132316
- scaleDenominator: 272989.386732772,
132317
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132609
+ scaleDenominator: 698852830035897e-7,
132610
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132318
132611
  tileWidth: 256,
132319
132612
  tileHeight: 256,
132320
132613
  matrixWidth: 8,
@@ -132323,8 +132616,8 @@ var Citm2000Tmst = {
132323
132616
  {
132324
132617
  type: "TileMatrixType",
132325
132618
  identifier: "4",
132326
- scaleDenominator: 136494.693366386,
132327
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132619
+ scaleDenominator: 349426415017948e-7,
132620
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132328
132621
  tileWidth: 256,
132329
132622
  tileHeight: 256,
132330
132623
  matrixWidth: 16,
@@ -132333,8 +132626,8 @@ var Citm2000Tmst = {
132333
132626
  {
132334
132627
  type: "TileMatrixType",
132335
132628
  identifier: "5",
132336
- scaleDenominator: 68247.346683193,
132337
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132629
+ scaleDenominator: 174713207508974e-7,
132630
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132338
132631
  tileWidth: 256,
132339
132632
  tileHeight: 256,
132340
132633
  matrixWidth: 32,
@@ -132343,8 +132636,8 @@ var Citm2000Tmst = {
132343
132636
  {
132344
132637
  type: "TileMatrixType",
132345
132638
  identifier: "6",
132346
- scaleDenominator: 34123.6733415964,
132347
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132639
+ scaleDenominator: 873566037544871e-8,
132640
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132348
132641
  tileWidth: 256,
132349
132642
  tileHeight: 256,
132350
132643
  matrixWidth: 64,
@@ -132353,8 +132646,8 @@ var Citm2000Tmst = {
132353
132646
  {
132354
132647
  type: "TileMatrixType",
132355
132648
  identifier: "7",
132356
- scaleDenominator: 17061.8366707982,
132357
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132649
+ scaleDenominator: 436783018772435e-8,
132650
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132358
132651
  tileWidth: 256,
132359
132652
  tileHeight: 256,
132360
132653
  matrixWidth: 128,
@@ -132363,8 +132656,8 @@ var Citm2000Tmst = {
132363
132656
  {
132364
132657
  type: "TileMatrixType",
132365
132658
  identifier: "8",
132366
- scaleDenominator: 8530.91833539913,
132367
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132659
+ scaleDenominator: 218391509386217e-8,
132660
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132368
132661
  tileWidth: 256,
132369
132662
  tileHeight: 256,
132370
132663
  matrixWidth: 256,
@@ -132373,8 +132666,8 @@ var Citm2000Tmst = {
132373
132666
  {
132374
132667
  type: "TileMatrixType",
132375
132668
  identifier: "9",
132376
- scaleDenominator: 4265.45916769956,
132377
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132669
+ scaleDenominator: 109195754693108e-8,
132670
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132378
132671
  tileWidth: 256,
132379
132672
  tileHeight: 256,
132380
132673
  matrixWidth: 512,
@@ -132383,8 +132676,8 @@ var Citm2000Tmst = {
132383
132676
  {
132384
132677
  type: "TileMatrixType",
132385
132678
  identifier: "10",
132386
- scaleDenominator: 2132.72958384978,
132387
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132679
+ scaleDenominator: 545978.773465544,
132680
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132388
132681
  tileWidth: 256,
132389
132682
  tileHeight: 256,
132390
132683
  matrixWidth: 1024,
@@ -132393,8 +132686,8 @@ var Citm2000Tmst = {
132393
132686
  {
132394
132687
  type: "TileMatrixType",
132395
132688
  identifier: "11",
132396
- scaleDenominator: 1066.36479192489,
132397
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132689
+ scaleDenominator: 272989.386732772,
132690
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132398
132691
  tileWidth: 256,
132399
132692
  tileHeight: 256,
132400
132693
  matrixWidth: 2048,
@@ -132403,8 +132696,8 @@ var Citm2000Tmst = {
132403
132696
  {
132404
132697
  type: "TileMatrixType",
132405
132698
  identifier: "12",
132406
- scaleDenominator: 533.182395962445,
132407
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132699
+ scaleDenominator: 136494.693366386,
132700
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132408
132701
  tileWidth: 256,
132409
132702
  tileHeight: 256,
132410
132703
  matrixWidth: 4096,
@@ -132413,8 +132706,8 @@ var Citm2000Tmst = {
132413
132706
  {
132414
132707
  type: "TileMatrixType",
132415
132708
  identifier: "13",
132416
- scaleDenominator: 266.591197981222,
132417
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132709
+ scaleDenominator: 68247.346683193,
132710
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132418
132711
  tileWidth: 256,
132419
132712
  tileHeight: 256,
132420
132713
  matrixWidth: 8192,
@@ -132423,8 +132716,8 @@ var Citm2000Tmst = {
132423
132716
  {
132424
132717
  type: "TileMatrixType",
132425
132718
  identifier: "14",
132426
- scaleDenominator: 133.295598990611,
132427
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132719
+ scaleDenominator: 34123.6733415964,
132720
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132428
132721
  tileWidth: 256,
132429
132722
  tileHeight: 256,
132430
132723
  matrixWidth: 16384,
@@ -132433,8 +132726,8 @@ var Citm2000Tmst = {
132433
132726
  {
132434
132727
  type: "TileMatrixType",
132435
132728
  identifier: "15",
132436
- scaleDenominator: 66.6477994953056,
132437
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132729
+ scaleDenominator: 17061.8366707982,
132730
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132438
132731
  tileWidth: 256,
132439
132732
  tileHeight: 256,
132440
132733
  matrixWidth: 32768,
@@ -132443,294 +132736,336 @@ var Citm2000Tmst = {
132443
132736
  {
132444
132737
  type: "TileMatrixType",
132445
132738
  identifier: "16",
132446
- scaleDenominator: 33.3238997476528,
132447
- topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132739
+ scaleDenominator: 8530.91833539913,
132740
+ topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132448
132741
  tileWidth: 256,
132449
132742
  tileHeight: 256,
132450
132743
  matrixWidth: 65536,
132451
132744
  matrixHeight: 65536
132452
- }
132453
- ],
132454
- $generated: {
132455
- package: "@basemaps/cli",
132456
- version: "v7.14.0-4-g2766010d",
132457
- hash: "2766010d8d2bb8b673f6bcbef2fe2636f2e0f4ea",
132458
- createdAt: "2025-02-10T20:34:46.643Z"
132459
- },
132460
- $options: {
132461
- sourceTileMatrix: "WebMercatorQuad",
132462
- zoomOffset: 8
132463
- }
132464
- };
132465
- var Citm2000Tms = new TileMatrixSet(Citm2000Tmst);
132466
-
132467
- // ../geo/build/tms/google.js
132468
- var GoogleTmst = {
132469
- type: "TileMatrixSetType",
132470
- title: "Google Maps Compatible for the World",
132471
- identifier: "WebMercatorQuad",
132472
- boundingBox: {
132473
- type: "BoundingBoxType",
132474
- crs: "http://www.opengis.net/def/crs/EPSG/0/3857",
132475
- lowerCorner: [-200375083427892e-7, -200375083427892e-7],
132476
- upperCorner: [200375083427892e-7, 200375083427892e-7]
132477
- },
132478
- supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3857",
132479
- wellKnownScaleSet: "https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",
132480
- tileMatrix: [
132745
+ },
132481
132746
  {
132482
132747
  type: "TileMatrixType",
132483
- identifier: "0",
132484
- scaleDenominator: 559082264028717e-6,
132748
+ identifier: "17",
132749
+ scaleDenominator: 4265.45916769956,
132485
132750
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132486
132751
  tileWidth: 256,
132487
132752
  tileHeight: 256,
132488
- matrixWidth: 1,
132489
- matrixHeight: 1
132753
+ matrixWidth: 131072,
132754
+ matrixHeight: 131072
132490
132755
  },
132491
132756
  {
132492
132757
  type: "TileMatrixType",
132493
- identifier: "1",
132494
- scaleDenominator: 279541132014358e-6,
132758
+ identifier: "18",
132759
+ scaleDenominator: 2132.72958384978,
132495
132760
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132496
132761
  tileWidth: 256,
132497
132762
  tileHeight: 256,
132498
- matrixWidth: 2,
132499
- matrixHeight: 2
132763
+ matrixWidth: 262144,
132764
+ matrixHeight: 262144
132500
132765
  },
132501
132766
  {
132502
132767
  type: "TileMatrixType",
132503
- identifier: "2",
132504
- scaleDenominator: 139770566007179e-6,
132768
+ identifier: "19",
132769
+ scaleDenominator: 1066.36479192489,
132505
132770
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132506
132771
  tileWidth: 256,
132507
132772
  tileHeight: 256,
132508
- matrixWidth: 4,
132509
- matrixHeight: 4
132773
+ matrixWidth: 524288,
132774
+ matrixHeight: 524288
132510
132775
  },
132511
132776
  {
132512
132777
  type: "TileMatrixType",
132513
- identifier: "3",
132514
- scaleDenominator: 698852830035897e-7,
132778
+ identifier: "20",
132779
+ scaleDenominator: 533.182395962445,
132515
132780
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132516
132781
  tileWidth: 256,
132517
132782
  tileHeight: 256,
132518
- matrixWidth: 8,
132519
- matrixHeight: 8
132783
+ matrixWidth: 1048576,
132784
+ matrixHeight: 1048576
132520
132785
  },
132521
132786
  {
132522
132787
  type: "TileMatrixType",
132523
- identifier: "4",
132524
- scaleDenominator: 349426415017948e-7,
132788
+ identifier: "21",
132789
+ scaleDenominator: 266.591197981222,
132525
132790
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132526
132791
  tileWidth: 256,
132527
132792
  tileHeight: 256,
132528
- matrixWidth: 16,
132529
- matrixHeight: 16
132793
+ matrixWidth: 2097152,
132794
+ matrixHeight: 2097152
132530
132795
  },
132531
132796
  {
132532
132797
  type: "TileMatrixType",
132533
- identifier: "5",
132534
- scaleDenominator: 174713207508974e-7,
132798
+ identifier: "22",
132799
+ scaleDenominator: 133.295598990611,
132535
132800
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132536
132801
  tileWidth: 256,
132537
132802
  tileHeight: 256,
132538
- matrixWidth: 32,
132539
- matrixHeight: 32
132803
+ matrixWidth: 4194304,
132804
+ matrixHeight: 4194304
132540
132805
  },
132541
132806
  {
132542
132807
  type: "TileMatrixType",
132543
- identifier: "6",
132544
- scaleDenominator: 873566037544871e-8,
132808
+ identifier: "23",
132809
+ scaleDenominator: 66.6477994953056,
132545
132810
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132546
132811
  tileWidth: 256,
132547
132812
  tileHeight: 256,
132548
- matrixWidth: 64,
132549
- matrixHeight: 64
132813
+ matrixWidth: 8388608,
132814
+ matrixHeight: 8388608
132550
132815
  },
132551
132816
  {
132552
132817
  type: "TileMatrixType",
132553
- identifier: "7",
132554
- scaleDenominator: 436783018772435e-8,
132818
+ identifier: "24",
132819
+ scaleDenominator: 33.3238997476528,
132555
132820
  topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132556
132821
  tileWidth: 256,
132557
132822
  tileHeight: 256,
132558
- matrixWidth: 128,
132559
- matrixHeight: 128
132560
- },
132823
+ matrixWidth: 16777216,
132824
+ matrixHeight: 16777216
132825
+ }
132826
+ ]
132827
+ };
132828
+ var GoogleTms = new TileMatrixSet(GoogleTmst);
132829
+
132830
+ // ../geo/build/proj/projection.loader.js
132831
+ var ProjectionLoader = class {
132832
+ /**
132833
+ * Ensure that a projection EPSG code is avialable for use in Proj4js
132834
+ *
132835
+ * If its not already loaded, lookup definition from spatialreference.org
132836
+ * @param code
132837
+ */
132838
+ static async load(code) {
132839
+ if (Projection.tryGet(code) != null)
132840
+ return Epsg.get(code);
132841
+ const url = `https://spatialreference.org/ref/epsg/${code}/ogcwkt/`;
132842
+ const res = await this._fetch(url);
132843
+ if (!res.ok)
132844
+ throw new Error("Failed to load projection information for:" + code);
132845
+ let epsg = Epsg.tryGet(code);
132846
+ if (epsg == null)
132847
+ epsg = new Epsg(code);
132848
+ const text = await res.text();
132849
+ Projection.define(epsg, text);
132850
+ return epsg;
132851
+ }
132852
+ };
132853
+ Object.defineProperty(ProjectionLoader, "_fetch", {
132854
+ enumerable: true,
132855
+ configurable: true,
132856
+ writable: true,
132857
+ value: fetch
132858
+ });
132859
+
132860
+ // ../geo/build/proj/tile.set.name.js
132861
+ var TileSetName;
132862
+ (function(TileSetName2) {
132863
+ TileSetName2["aerial"] = "aerial";
132864
+ })(TileSetName || (TileSetName = {}));
132865
+
132866
+ // ../geo/build/quad.key.js
132867
+ var CHAR_0 = "0".charCodeAt(0);
132868
+ var CHAR_1 = "1".charCodeAt(0);
132869
+ var CHAR_2 = "2".charCodeAt(0);
132870
+ var CHAR_3 = "3".charCodeAt(0);
132871
+
132872
+ // ../geo/build/tms/citm2000.js
132873
+ var Citm2000Tmst = {
132874
+ type: "TileMatrixSetType",
132875
+ title: "Debug tile matrix for EPSG:3793",
132876
+ abstract: "",
132877
+ identifier: "CITM2000Quad",
132878
+ supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3793",
132879
+ boundingBox: {
132880
+ type: "BoundingBoxType",
132881
+ crs: "https://www.opengis.net/def/crs/EPSG/0/3793",
132882
+ lowerCorner: [5051234111622438e-9, 3.4301543757978342e6],
132883
+ upperCorner: [5207777145550478e-9, 3.5866974097258747e6]
132884
+ },
132885
+ tileMatrix: [
132561
132886
  {
132562
132887
  type: "TileMatrixType",
132563
- identifier: "8",
132888
+ identifier: "0",
132564
132889
  scaleDenominator: 218391509386217e-8,
132565
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132890
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132566
132891
  tileWidth: 256,
132567
132892
  tileHeight: 256,
132568
- matrixWidth: 256,
132569
- matrixHeight: 256
132893
+ matrixWidth: 1,
132894
+ matrixHeight: 1
132570
132895
  },
132571
132896
  {
132572
132897
  type: "TileMatrixType",
132573
- identifier: "9",
132898
+ identifier: "1",
132574
132899
  scaleDenominator: 109195754693108e-8,
132575
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132900
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132576
132901
  tileWidth: 256,
132577
132902
  tileHeight: 256,
132578
- matrixWidth: 512,
132579
- matrixHeight: 512
132903
+ matrixWidth: 2,
132904
+ matrixHeight: 2
132580
132905
  },
132581
132906
  {
132582
132907
  type: "TileMatrixType",
132583
- identifier: "10",
132908
+ identifier: "2",
132584
132909
  scaleDenominator: 545978.773465544,
132585
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132910
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132586
132911
  tileWidth: 256,
132587
132912
  tileHeight: 256,
132588
- matrixWidth: 1024,
132589
- matrixHeight: 1024
132913
+ matrixWidth: 4,
132914
+ matrixHeight: 4
132590
132915
  },
132591
132916
  {
132592
132917
  type: "TileMatrixType",
132593
- identifier: "11",
132918
+ identifier: "3",
132594
132919
  scaleDenominator: 272989.386732772,
132595
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132920
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132596
132921
  tileWidth: 256,
132597
132922
  tileHeight: 256,
132598
- matrixWidth: 2048,
132599
- matrixHeight: 2048
132923
+ matrixWidth: 8,
132924
+ matrixHeight: 8
132600
132925
  },
132601
132926
  {
132602
132927
  type: "TileMatrixType",
132603
- identifier: "12",
132928
+ identifier: "4",
132604
132929
  scaleDenominator: 136494.693366386,
132605
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132930
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132606
132931
  tileWidth: 256,
132607
132932
  tileHeight: 256,
132608
- matrixWidth: 4096,
132609
- matrixHeight: 4096
132933
+ matrixWidth: 16,
132934
+ matrixHeight: 16
132610
132935
  },
132611
132936
  {
132612
132937
  type: "TileMatrixType",
132613
- identifier: "13",
132938
+ identifier: "5",
132614
132939
  scaleDenominator: 68247.346683193,
132615
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132940
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132616
132941
  tileWidth: 256,
132617
132942
  tileHeight: 256,
132618
- matrixWidth: 8192,
132619
- matrixHeight: 8192
132943
+ matrixWidth: 32,
132944
+ matrixHeight: 32
132620
132945
  },
132621
132946
  {
132622
132947
  type: "TileMatrixType",
132623
- identifier: "14",
132948
+ identifier: "6",
132624
132949
  scaleDenominator: 34123.6733415964,
132625
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132950
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132626
132951
  tileWidth: 256,
132627
132952
  tileHeight: 256,
132628
- matrixWidth: 16384,
132629
- matrixHeight: 16384
132953
+ matrixWidth: 64,
132954
+ matrixHeight: 64
132630
132955
  },
132631
132956
  {
132632
132957
  type: "TileMatrixType",
132633
- identifier: "15",
132958
+ identifier: "7",
132634
132959
  scaleDenominator: 17061.8366707982,
132635
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132960
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132636
132961
  tileWidth: 256,
132637
132962
  tileHeight: 256,
132638
- matrixWidth: 32768,
132639
- matrixHeight: 32768
132963
+ matrixWidth: 128,
132964
+ matrixHeight: 128
132640
132965
  },
132641
132966
  {
132642
132967
  type: "TileMatrixType",
132643
- identifier: "16",
132968
+ identifier: "8",
132644
132969
  scaleDenominator: 8530.91833539913,
132645
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132970
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132646
132971
  tileWidth: 256,
132647
132972
  tileHeight: 256,
132648
- matrixWidth: 65536,
132649
- matrixHeight: 65536
132973
+ matrixWidth: 256,
132974
+ matrixHeight: 256
132650
132975
  },
132651
132976
  {
132652
132977
  type: "TileMatrixType",
132653
- identifier: "17",
132978
+ identifier: "9",
132654
132979
  scaleDenominator: 4265.45916769956,
132655
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132980
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132656
132981
  tileWidth: 256,
132657
132982
  tileHeight: 256,
132658
- matrixWidth: 131072,
132659
- matrixHeight: 131072
132983
+ matrixWidth: 512,
132984
+ matrixHeight: 512
132660
132985
  },
132661
132986
  {
132662
132987
  type: "TileMatrixType",
132663
- identifier: "18",
132988
+ identifier: "10",
132664
132989
  scaleDenominator: 2132.72958384978,
132665
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
132990
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132666
132991
  tileWidth: 256,
132667
132992
  tileHeight: 256,
132668
- matrixWidth: 262144,
132669
- matrixHeight: 262144
132993
+ matrixWidth: 1024,
132994
+ matrixHeight: 1024
132670
132995
  },
132671
132996
  {
132672
132997
  type: "TileMatrixType",
132673
- identifier: "19",
132998
+ identifier: "11",
132674
132999
  scaleDenominator: 1066.36479192489,
132675
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133000
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132676
133001
  tileWidth: 256,
132677
133002
  tileHeight: 256,
132678
- matrixWidth: 524288,
132679
- matrixHeight: 524288
133003
+ matrixWidth: 2048,
133004
+ matrixHeight: 2048
132680
133005
  },
132681
133006
  {
132682
133007
  type: "TileMatrixType",
132683
- identifier: "20",
133008
+ identifier: "12",
132684
133009
  scaleDenominator: 533.182395962445,
132685
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133010
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132686
133011
  tileWidth: 256,
132687
133012
  tileHeight: 256,
132688
- matrixWidth: 1048576,
132689
- matrixHeight: 1048576
133013
+ matrixWidth: 4096,
133014
+ matrixHeight: 4096
132690
133015
  },
132691
133016
  {
132692
133017
  type: "TileMatrixType",
132693
- identifier: "21",
133018
+ identifier: "13",
132694
133019
  scaleDenominator: 266.591197981222,
132695
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133020
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132696
133021
  tileWidth: 256,
132697
133022
  tileHeight: 256,
132698
- matrixWidth: 2097152,
132699
- matrixHeight: 2097152
133023
+ matrixWidth: 8192,
133024
+ matrixHeight: 8192
132700
133025
  },
132701
133026
  {
132702
133027
  type: "TileMatrixType",
132703
- identifier: "22",
133028
+ identifier: "14",
132704
133029
  scaleDenominator: 133.295598990611,
132705
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133030
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132706
133031
  tileWidth: 256,
132707
133032
  tileHeight: 256,
132708
- matrixWidth: 4194304,
132709
- matrixHeight: 4194304
133033
+ matrixWidth: 16384,
133034
+ matrixHeight: 16384
132710
133035
  },
132711
133036
  {
132712
133037
  type: "TileMatrixType",
132713
- identifier: "23",
133038
+ identifier: "15",
132714
133039
  scaleDenominator: 66.6477994953056,
132715
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133040
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132716
133041
  tileWidth: 256,
132717
133042
  tileHeight: 256,
132718
- matrixWidth: 8388608,
132719
- matrixHeight: 8388608
133043
+ matrixWidth: 32768,
133044
+ matrixHeight: 32768
132720
133045
  },
132721
133046
  {
132722
133047
  type: "TileMatrixType",
132723
- identifier: "24",
133048
+ identifier: "16",
132724
133049
  scaleDenominator: 33.3238997476528,
132725
- topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
133050
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132726
133051
  tileWidth: 256,
132727
133052
  tileHeight: 256,
132728
- matrixWidth: 16777216,
132729
- matrixHeight: 16777216
133053
+ matrixWidth: 65536,
133054
+ matrixHeight: 65536
132730
133055
  }
132731
- ]
133056
+ ],
133057
+ $generated: {
133058
+ package: "@basemaps/cli",
133059
+ version: "v7.14.0-4-g2766010d",
133060
+ hash: "2766010d8d2bb8b673f6bcbef2fe2636f2e0f4ea",
133061
+ createdAt: "2025-02-10T20:34:46.643Z"
133062
+ },
133063
+ $options: {
133064
+ sourceTileMatrix: "WebMercatorQuad",
133065
+ zoomOffset: 8
133066
+ }
132732
133067
  };
132733
- var GoogleTms = new TileMatrixSet(GoogleTmst);
133068
+ var Citm2000Tms = new TileMatrixSet(Citm2000Tmst);
132734
133069
 
132735
133070
  // ../geo/build/tms/nztm2000.js
132736
133071
  var Nztm20002 = __toESM(require_src3(), 1);
@@ -136034,9 +136369,9 @@ var Router = class {
136034
136369
  };
136035
136370
 
136036
136371
  // ../../node_modules/@linzjs/lambda/build/src/function.js
136037
- var version2 = "v8.0.0-4-g14a4364d";
136038
- var hash = "14a4364d39e226b7ed0396fee9c3adc534d1142b";
136039
- var buildId = "15100600846-1";
136372
+ var version2 = "v8.2.0-8-gfe8bbf9d";
136373
+ var hash = "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8";
136374
+ var buildId = "15719849199-1";
136040
136375
  var versionInfo = { version: version2, hash, buildId };
136041
136376
  async function runFunction(req, fn) {
136042
136377
  if (!req.timer.timers.has("lambda"))
@@ -139066,6 +139401,12 @@ var Queue = class {
139066
139401
  __privateWrapper(this, _size)._--;
139067
139402
  return current.value;
139068
139403
  }
139404
+ peek() {
139405
+ if (!__privateGet(this, _head)) {
139406
+ return;
139407
+ }
139408
+ return __privateGet(this, _head).value;
139409
+ }
139069
139410
  clear() {
139070
139411
  __privateSet(this, _head, void 0);
139071
139412
  __privateSet(this, _tail, void 0);
@@ -139081,6 +139422,11 @@ var Queue = class {
139081
139422
  current = current.next;
139082
139423
  }
139083
139424
  }
139425
+ *drain() {
139426
+ while (__privateGet(this, _head)) {
139427
+ yield this.dequeue();
139428
+ }
139429
+ }
139084
139430
  };
139085
139431
  _head = new WeakMap();
139086
139432
  _tail = new WeakMap();
@@ -140468,18 +140814,18 @@ async function versionGet(req) {
140468
140814
  * last git version tag
140469
140815
  * @example "v6.42.1"
140470
140816
  */
140471
- version: "v8.0.0-4-g14a4364d",
140817
+ version: "v8.2.0-8-gfe8bbf9d",
140472
140818
  /**
140473
140819
  * Full git commit hash
140474
140820
  * @example "e4231b1ee62c276c8657c56677ced02681dfe5d6"
140475
140821
  */
140476
- hash: "14a4364d39e226b7ed0396fee9c3adc534d1142b",
140822
+ hash: "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8",
140477
140823
  /**
140478
140824
  *
140479
140825
  * The exact build that this release was run from
140480
140826
  * @example "1658821493-3"
140481
140827
  */
140482
- buildId: "15100600846-1",
140828
+ buildId: "15719849199-1",
140483
140829
  /**
140484
140830
  * Configuration id that was used to power this config
140485
140831
  * @example { "id": "cb_01JTQ7ZK49F8EY4N5DRJ3XFT73", hash: "HcByZ8WS2zpaTxFJp6wSKg2eUpwahLqAGEQdcDxKxqp6" }