@basemaps/cli-raster 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.
- package/dist/index.cjs +885 -539
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -9303,9 +9303,9 @@ __export(tslib_es6_exports, {
|
|
|
9303
9303
|
__asyncValues: () => __asyncValues,
|
|
9304
9304
|
__await: () => __await,
|
|
9305
9305
|
__awaiter: () => __awaiter,
|
|
9306
|
-
__classPrivateFieldGet: () =>
|
|
9306
|
+
__classPrivateFieldGet: () => __classPrivateFieldGet2,
|
|
9307
9307
|
__classPrivateFieldIn: () => __classPrivateFieldIn,
|
|
9308
|
-
__classPrivateFieldSet: () =>
|
|
9308
|
+
__classPrivateFieldSet: () => __classPrivateFieldSet2,
|
|
9309
9309
|
__createBinding: () => __createBinding,
|
|
9310
9310
|
__decorate: () => __decorate,
|
|
9311
9311
|
__disposeResources: () => __disposeResources,
|
|
@@ -9699,14 +9699,14 @@ function __importStar(mod) {
|
|
|
9699
9699
|
function __importDefault(mod) {
|
|
9700
9700
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
9701
9701
|
}
|
|
9702
|
-
function
|
|
9702
|
+
function __classPrivateFieldGet2(receiver, state, kind, f) {
|
|
9703
9703
|
if (kind === "a" && !f)
|
|
9704
9704
|
throw new TypeError("Private accessor was defined without a getter");
|
|
9705
9705
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
9706
9706
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
9707
9707
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9708
9708
|
}
|
|
9709
|
-
function
|
|
9709
|
+
function __classPrivateFieldSet2(receiver, state, value, kind, f) {
|
|
9710
9710
|
if (kind === "m")
|
|
9711
9711
|
throw new TypeError("Private method is not writable");
|
|
9712
9712
|
if (kind === "a" && !f)
|
|
@@ -9878,8 +9878,8 @@ var init_tslib_es6 = __esm({
|
|
|
9878
9878
|
__makeTemplateObject,
|
|
9879
9879
|
__importStar,
|
|
9880
9880
|
__importDefault,
|
|
9881
|
-
__classPrivateFieldGet,
|
|
9882
|
-
__classPrivateFieldSet,
|
|
9881
|
+
__classPrivateFieldGet: __classPrivateFieldGet2,
|
|
9882
|
+
__classPrivateFieldSet: __classPrivateFieldSet2,
|
|
9883
9883
|
__classPrivateFieldIn,
|
|
9884
9884
|
__addDisposableResource,
|
|
9885
9885
|
__disposeResources,
|
|
@@ -13639,8 +13639,8 @@ __export(tslib_es6_exports2, {
|
|
|
13639
13639
|
__asyncValues: () => __asyncValues2,
|
|
13640
13640
|
__await: () => __await2,
|
|
13641
13641
|
__awaiter: () => __awaiter2,
|
|
13642
|
-
__classPrivateFieldGet: () =>
|
|
13643
|
-
__classPrivateFieldSet: () =>
|
|
13642
|
+
__classPrivateFieldGet: () => __classPrivateFieldGet3,
|
|
13643
|
+
__classPrivateFieldSet: () => __classPrivateFieldSet3,
|
|
13644
13644
|
__createBinding: () => __createBinding2,
|
|
13645
13645
|
__decorate: () => __decorate2,
|
|
13646
13646
|
__exportStar: () => __exportStar2,
|
|
@@ -13951,13 +13951,13 @@ function __importStar2(mod) {
|
|
|
13951
13951
|
function __importDefault2(mod) {
|
|
13952
13952
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
13953
13953
|
}
|
|
13954
|
-
function
|
|
13954
|
+
function __classPrivateFieldGet3(receiver, privateMap) {
|
|
13955
13955
|
if (!privateMap.has(receiver)) {
|
|
13956
13956
|
throw new TypeError("attempted to get private field on non-instance");
|
|
13957
13957
|
}
|
|
13958
13958
|
return privateMap.get(receiver);
|
|
13959
13959
|
}
|
|
13960
|
-
function
|
|
13960
|
+
function __classPrivateFieldSet3(receiver, privateMap, value) {
|
|
13961
13961
|
if (!privateMap.has(receiver)) {
|
|
13962
13962
|
throw new TypeError("attempted to set private field on non-instance");
|
|
13963
13963
|
}
|
|
@@ -42129,8 +42129,8 @@ __export(tslib_es6_exports3, {
|
|
|
42129
42129
|
__asyncValues: () => __asyncValues3,
|
|
42130
42130
|
__await: () => __await3,
|
|
42131
42131
|
__awaiter: () => __awaiter3,
|
|
42132
|
-
__classPrivateFieldGet: () =>
|
|
42133
|
-
__classPrivateFieldSet: () =>
|
|
42132
|
+
__classPrivateFieldGet: () => __classPrivateFieldGet4,
|
|
42133
|
+
__classPrivateFieldSet: () => __classPrivateFieldSet4,
|
|
42134
42134
|
__createBinding: () => __createBinding3,
|
|
42135
42135
|
__decorate: () => __decorate3,
|
|
42136
42136
|
__exportStar: () => __exportStar3,
|
|
@@ -42441,13 +42441,13 @@ function __importStar3(mod) {
|
|
|
42441
42441
|
function __importDefault3(mod) {
|
|
42442
42442
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
42443
42443
|
}
|
|
42444
|
-
function
|
|
42444
|
+
function __classPrivateFieldGet4(receiver, privateMap) {
|
|
42445
42445
|
if (!privateMap.has(receiver)) {
|
|
42446
42446
|
throw new TypeError("attempted to get private field on non-instance");
|
|
42447
42447
|
}
|
|
42448
42448
|
return privateMap.get(receiver);
|
|
42449
42449
|
}
|
|
42450
|
-
function
|
|
42450
|
+
function __classPrivateFieldSet4(receiver, privateMap, value) {
|
|
42451
42451
|
if (!privateMap.has(receiver)) {
|
|
42452
42452
|
throw new TypeError("attempted to set private field on non-instance");
|
|
42453
42453
|
}
|
|
@@ -72934,9 +72934,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
|
|
|
72934
72934
|
var CliInfo = {
|
|
72935
72935
|
// Detect unlinked packages looks for this string since its a package name, slightly work around it
|
|
72936
72936
|
package: "@basemaps/cli",
|
|
72937
|
-
version: "v8.
|
|
72938
|
-
hash: "
|
|
72939
|
-
buildId: "
|
|
72937
|
+
version: "v8.3.0",
|
|
72938
|
+
hash: "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8",
|
|
72939
|
+
buildId: "15719849199-1"
|
|
72940
72940
|
};
|
|
72941
72941
|
var CliDate = (/* @__PURE__ */ new Date()).toISOString();
|
|
72942
72942
|
var CliId = ulid2.ulid();
|
|
@@ -73239,7 +73239,10 @@ var quotelessJson = (obj) => {
|
|
|
73239
73239
|
const json = JSON.stringify(obj, null, 2);
|
|
73240
73240
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
73241
73241
|
};
|
|
73242
|
-
var ZodError = class extends Error {
|
|
73242
|
+
var ZodError = class _ZodError extends Error {
|
|
73243
|
+
get errors() {
|
|
73244
|
+
return this.issues;
|
|
73245
|
+
}
|
|
73243
73246
|
constructor(issues) {
|
|
73244
73247
|
super();
|
|
73245
73248
|
this.issues = [];
|
|
@@ -73258,9 +73261,6 @@ var ZodError = class extends Error {
|
|
|
73258
73261
|
this.name = "ZodError";
|
|
73259
73262
|
this.issues = issues;
|
|
73260
73263
|
}
|
|
73261
|
-
get errors() {
|
|
73262
|
-
return this.issues;
|
|
73263
|
-
}
|
|
73264
73264
|
format(_mapper) {
|
|
73265
73265
|
const mapper = _mapper || function(issue) {
|
|
73266
73266
|
return issue.message;
|
|
@@ -73297,6 +73297,11 @@ var ZodError = class extends Error {
|
|
|
73297
73297
|
processError(this);
|
|
73298
73298
|
return fieldErrors;
|
|
73299
73299
|
}
|
|
73300
|
+
static assert(value) {
|
|
73301
|
+
if (!(value instanceof _ZodError)) {
|
|
73302
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
73303
|
+
}
|
|
73304
|
+
}
|
|
73300
73305
|
toString() {
|
|
73301
73306
|
return this.message;
|
|
73302
73307
|
}
|
|
@@ -73439,6 +73444,13 @@ var makeIssue = (params) => {
|
|
|
73439
73444
|
...issueData,
|
|
73440
73445
|
path: fullPath
|
|
73441
73446
|
};
|
|
73447
|
+
if (issueData.message !== void 0) {
|
|
73448
|
+
return {
|
|
73449
|
+
...issueData,
|
|
73450
|
+
path: fullPath,
|
|
73451
|
+
message: issueData.message
|
|
73452
|
+
};
|
|
73453
|
+
}
|
|
73442
73454
|
let errorMessage = "";
|
|
73443
73455
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
73444
73456
|
for (const map of maps) {
|
|
@@ -73447,20 +73459,24 @@ var makeIssue = (params) => {
|
|
|
73447
73459
|
return {
|
|
73448
73460
|
...issueData,
|
|
73449
73461
|
path: fullPath,
|
|
73450
|
-
message:
|
|
73462
|
+
message: errorMessage
|
|
73451
73463
|
};
|
|
73452
73464
|
};
|
|
73453
73465
|
var EMPTY_PATH = [];
|
|
73454
73466
|
function addIssueToContext(ctx, issueData) {
|
|
73467
|
+
const overrideMap = getErrorMap();
|
|
73455
73468
|
const issue = makeIssue({
|
|
73456
73469
|
issueData,
|
|
73457
73470
|
data: ctx.data,
|
|
73458
73471
|
path: ctx.path,
|
|
73459
73472
|
errorMaps: [
|
|
73460
73473
|
ctx.common.contextualErrorMap,
|
|
73474
|
+
// contextual error map is first priority
|
|
73461
73475
|
ctx.schemaErrorMap,
|
|
73462
|
-
|
|
73463
|
-
|
|
73476
|
+
// then schema-bound map if available
|
|
73477
|
+
overrideMap,
|
|
73478
|
+
// then global override map
|
|
73479
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
73464
73480
|
// then global default map
|
|
73465
73481
|
].filter((x) => !!x)
|
|
73466
73482
|
});
|
|
@@ -73492,9 +73508,11 @@ var ParseStatus = class _ParseStatus {
|
|
|
73492
73508
|
static async mergeObjectAsync(status, pairs) {
|
|
73493
73509
|
const syncPairs = [];
|
|
73494
73510
|
for (const pair of pairs) {
|
|
73511
|
+
const key = await pair.key;
|
|
73512
|
+
const value = await pair.value;
|
|
73495
73513
|
syncPairs.push({
|
|
73496
|
-
key
|
|
73497
|
-
value
|
|
73514
|
+
key,
|
|
73515
|
+
value
|
|
73498
73516
|
});
|
|
73499
73517
|
}
|
|
73500
73518
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
|
@@ -73527,11 +73545,29 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
73527
73545
|
var isDirty = (x) => x.status === "dirty";
|
|
73528
73546
|
var isValid = (x) => x.status === "valid";
|
|
73529
73547
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
73548
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
73549
|
+
if (kind === "a" && !f)
|
|
73550
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
73551
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
73552
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
73553
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
73554
|
+
}
|
|
73555
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
73556
|
+
if (kind === "m")
|
|
73557
|
+
throw new TypeError("Private method is not writable");
|
|
73558
|
+
if (kind === "a" && !f)
|
|
73559
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
73560
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
73561
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
73562
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
73563
|
+
}
|
|
73530
73564
|
var errorUtil;
|
|
73531
73565
|
(function(errorUtil2) {
|
|
73532
73566
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
73533
73567
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
73534
73568
|
})(errorUtil || (errorUtil = {}));
|
|
73569
|
+
var _ZodEnum_cache;
|
|
73570
|
+
var _ZodNativeEnum_cache;
|
|
73535
73571
|
var ParseInputLazyPath = class {
|
|
73536
73572
|
constructor(parent, value, path3, key) {
|
|
73537
73573
|
this._cachedPath = [];
|
|
@@ -73580,44 +73616,21 @@ function processCreateParams(params) {
|
|
|
73580
73616
|
if (errorMap2)
|
|
73581
73617
|
return { errorMap: errorMap2, description };
|
|
73582
73618
|
const customMap = (iss, ctx) => {
|
|
73583
|
-
|
|
73584
|
-
|
|
73619
|
+
var _a2, _b;
|
|
73620
|
+
const { message } = params;
|
|
73621
|
+
if (iss.code === "invalid_enum_value") {
|
|
73622
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
73623
|
+
}
|
|
73585
73624
|
if (typeof ctx.data === "undefined") {
|
|
73586
|
-
return { message:
|
|
73625
|
+
return { message: (_a2 = message !== null && message !== void 0 ? message : required_error) !== null && _a2 !== void 0 ? _a2 : ctx.defaultError };
|
|
73587
73626
|
}
|
|
73588
|
-
|
|
73627
|
+
if (iss.code !== "invalid_type")
|
|
73628
|
+
return { message: ctx.defaultError };
|
|
73629
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
73589
73630
|
};
|
|
73590
73631
|
return { errorMap: customMap, description };
|
|
73591
73632
|
}
|
|
73592
73633
|
var ZodType = class {
|
|
73593
|
-
constructor(def) {
|
|
73594
|
-
this.spa = this.safeParseAsync;
|
|
73595
|
-
this._def = def;
|
|
73596
|
-
this.parse = this.parse.bind(this);
|
|
73597
|
-
this.safeParse = this.safeParse.bind(this);
|
|
73598
|
-
this.parseAsync = this.parseAsync.bind(this);
|
|
73599
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
73600
|
-
this.spa = this.spa.bind(this);
|
|
73601
|
-
this.refine = this.refine.bind(this);
|
|
73602
|
-
this.refinement = this.refinement.bind(this);
|
|
73603
|
-
this.superRefine = this.superRefine.bind(this);
|
|
73604
|
-
this.optional = this.optional.bind(this);
|
|
73605
|
-
this.nullable = this.nullable.bind(this);
|
|
73606
|
-
this.nullish = this.nullish.bind(this);
|
|
73607
|
-
this.array = this.array.bind(this);
|
|
73608
|
-
this.promise = this.promise.bind(this);
|
|
73609
|
-
this.or = this.or.bind(this);
|
|
73610
|
-
this.and = this.and.bind(this);
|
|
73611
|
-
this.transform = this.transform.bind(this);
|
|
73612
|
-
this.brand = this.brand.bind(this);
|
|
73613
|
-
this.default = this.default.bind(this);
|
|
73614
|
-
this.catch = this.catch.bind(this);
|
|
73615
|
-
this.describe = this.describe.bind(this);
|
|
73616
|
-
this.pipe = this.pipe.bind(this);
|
|
73617
|
-
this.readonly = this.readonly.bind(this);
|
|
73618
|
-
this.isNullable = this.isNullable.bind(this);
|
|
73619
|
-
this.isOptional = this.isOptional.bind(this);
|
|
73620
|
-
}
|
|
73621
73634
|
get description() {
|
|
73622
73635
|
return this._def.description;
|
|
73623
73636
|
}
|
|
@@ -73681,6 +73694,43 @@ var ZodType = class {
|
|
|
73681
73694
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
73682
73695
|
return handleResult(ctx, result);
|
|
73683
73696
|
}
|
|
73697
|
+
"~validate"(data) {
|
|
73698
|
+
var _a2, _b;
|
|
73699
|
+
const ctx = {
|
|
73700
|
+
common: {
|
|
73701
|
+
issues: [],
|
|
73702
|
+
async: !!this["~standard"].async
|
|
73703
|
+
},
|
|
73704
|
+
path: [],
|
|
73705
|
+
schemaErrorMap: this._def.errorMap,
|
|
73706
|
+
parent: null,
|
|
73707
|
+
data,
|
|
73708
|
+
parsedType: getParsedType(data)
|
|
73709
|
+
};
|
|
73710
|
+
if (!this["~standard"].async) {
|
|
73711
|
+
try {
|
|
73712
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
|
73713
|
+
return isValid(result) ? {
|
|
73714
|
+
value: result.value
|
|
73715
|
+
} : {
|
|
73716
|
+
issues: ctx.common.issues
|
|
73717
|
+
};
|
|
73718
|
+
} catch (err) {
|
|
73719
|
+
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")) {
|
|
73720
|
+
this["~standard"].async = true;
|
|
73721
|
+
}
|
|
73722
|
+
ctx.common = {
|
|
73723
|
+
issues: [],
|
|
73724
|
+
async: true
|
|
73725
|
+
};
|
|
73726
|
+
}
|
|
73727
|
+
}
|
|
73728
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
|
73729
|
+
value: result.value
|
|
73730
|
+
} : {
|
|
73731
|
+
issues: ctx.common.issues
|
|
73732
|
+
});
|
|
73733
|
+
}
|
|
73684
73734
|
async parseAsync(data, params) {
|
|
73685
73735
|
const result = await this.safeParseAsync(data, params);
|
|
73686
73736
|
if (result.success)
|
|
@@ -73758,6 +73808,39 @@ var ZodType = class {
|
|
|
73758
73808
|
superRefine(refinement) {
|
|
73759
73809
|
return this._refinement(refinement);
|
|
73760
73810
|
}
|
|
73811
|
+
constructor(def) {
|
|
73812
|
+
this.spa = this.safeParseAsync;
|
|
73813
|
+
this._def = def;
|
|
73814
|
+
this.parse = this.parse.bind(this);
|
|
73815
|
+
this.safeParse = this.safeParse.bind(this);
|
|
73816
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
73817
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
73818
|
+
this.spa = this.spa.bind(this);
|
|
73819
|
+
this.refine = this.refine.bind(this);
|
|
73820
|
+
this.refinement = this.refinement.bind(this);
|
|
73821
|
+
this.superRefine = this.superRefine.bind(this);
|
|
73822
|
+
this.optional = this.optional.bind(this);
|
|
73823
|
+
this.nullable = this.nullable.bind(this);
|
|
73824
|
+
this.nullish = this.nullish.bind(this);
|
|
73825
|
+
this.array = this.array.bind(this);
|
|
73826
|
+
this.promise = this.promise.bind(this);
|
|
73827
|
+
this.or = this.or.bind(this);
|
|
73828
|
+
this.and = this.and.bind(this);
|
|
73829
|
+
this.transform = this.transform.bind(this);
|
|
73830
|
+
this.brand = this.brand.bind(this);
|
|
73831
|
+
this.default = this.default.bind(this);
|
|
73832
|
+
this.catch = this.catch.bind(this);
|
|
73833
|
+
this.describe = this.describe.bind(this);
|
|
73834
|
+
this.pipe = this.pipe.bind(this);
|
|
73835
|
+
this.readonly = this.readonly.bind(this);
|
|
73836
|
+
this.isNullable = this.isNullable.bind(this);
|
|
73837
|
+
this.isOptional = this.isOptional.bind(this);
|
|
73838
|
+
this["~standard"] = {
|
|
73839
|
+
version: 1,
|
|
73840
|
+
vendor: "zod",
|
|
73841
|
+
validate: (data) => this["~validate"](data)
|
|
73842
|
+
};
|
|
73843
|
+
}
|
|
73761
73844
|
optional() {
|
|
73762
73845
|
return ZodOptional.create(this, this._def);
|
|
73763
73846
|
}
|
|
@@ -73768,7 +73851,7 @@ var ZodType = class {
|
|
|
73768
73851
|
return this.nullable().optional();
|
|
73769
73852
|
}
|
|
73770
73853
|
array() {
|
|
73771
|
-
return ZodArray.create(this
|
|
73854
|
+
return ZodArray.create(this);
|
|
73772
73855
|
}
|
|
73773
73856
|
promise() {
|
|
73774
73857
|
return ZodPromise.create(this, this._def);
|
|
@@ -73833,35 +73916,45 @@ var ZodType = class {
|
|
|
73833
73916
|
}
|
|
73834
73917
|
};
|
|
73835
73918
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
73836
|
-
var cuid2Regex = /^[
|
|
73837
|
-
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
|
73919
|
+
var cuid2Regex = /^[0-9a-z]+$/;
|
|
73920
|
+
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
73838
73921
|
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;
|
|
73839
|
-
var
|
|
73922
|
+
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
73923
|
+
var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
73924
|
+
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)?)??$/;
|
|
73925
|
+
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
73840
73926
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
73841
73927
|
var emojiRegex;
|
|
73842
|
-
var ipv4Regex = /^((
|
|
73843
|
-
var
|
|
73844
|
-
var
|
|
73928
|
+
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])$/;
|
|
73929
|
+
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])$/;
|
|
73930
|
+
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]))$/;
|
|
73931
|
+
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])$/;
|
|
73932
|
+
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
73933
|
+
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
73934
|
+
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])))`;
|
|
73935
|
+
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
73936
|
+
function timeRegexSource(args) {
|
|
73937
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
73845
73938
|
if (args.precision) {
|
|
73846
|
-
|
|
73847
|
-
|
|
73848
|
-
|
|
73849
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
73850
|
-
}
|
|
73851
|
-
} else if (args.precision === 0) {
|
|
73852
|
-
if (args.offset) {
|
|
73853
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
73854
|
-
} else {
|
|
73855
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
73856
|
-
}
|
|
73857
|
-
} else {
|
|
73858
|
-
if (args.offset) {
|
|
73859
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
73860
|
-
} else {
|
|
73861
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
73862
|
-
}
|
|
73939
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
73940
|
+
} else if (args.precision == null) {
|
|
73941
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
73863
73942
|
}
|
|
73864
|
-
|
|
73943
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
73944
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
73945
|
+
}
|
|
73946
|
+
function timeRegex(args) {
|
|
73947
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
73948
|
+
}
|
|
73949
|
+
function datetimeRegex(args) {
|
|
73950
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
73951
|
+
const opts = [];
|
|
73952
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
73953
|
+
if (args.offset)
|
|
73954
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
73955
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
73956
|
+
return new RegExp(`^${regex}$`);
|
|
73957
|
+
}
|
|
73865
73958
|
function isValidIP(ip, version2) {
|
|
73866
73959
|
if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
|
|
73867
73960
|
return true;
|
|
@@ -73871,6 +73964,33 @@ function isValidIP(ip, version2) {
|
|
|
73871
73964
|
}
|
|
73872
73965
|
return false;
|
|
73873
73966
|
}
|
|
73967
|
+
function isValidJWT(jwt, alg) {
|
|
73968
|
+
if (!jwtRegex.test(jwt))
|
|
73969
|
+
return false;
|
|
73970
|
+
try {
|
|
73971
|
+
const [header] = jwt.split(".");
|
|
73972
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
73973
|
+
const decoded = JSON.parse(atob(base64));
|
|
73974
|
+
if (typeof decoded !== "object" || decoded === null)
|
|
73975
|
+
return false;
|
|
73976
|
+
if (!decoded.typ || !decoded.alg)
|
|
73977
|
+
return false;
|
|
73978
|
+
if (alg && decoded.alg !== alg)
|
|
73979
|
+
return false;
|
|
73980
|
+
return true;
|
|
73981
|
+
} catch (_a2) {
|
|
73982
|
+
return false;
|
|
73983
|
+
}
|
|
73984
|
+
}
|
|
73985
|
+
function isValidCidr(ip, version2) {
|
|
73986
|
+
if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
|
|
73987
|
+
return true;
|
|
73988
|
+
}
|
|
73989
|
+
if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
|
|
73990
|
+
return true;
|
|
73991
|
+
}
|
|
73992
|
+
return false;
|
|
73993
|
+
}
|
|
73874
73994
|
var ZodString = class _ZodString extends ZodType {
|
|
73875
73995
|
_parse(input) {
|
|
73876
73996
|
if (this._def.coerce) {
|
|
@@ -73879,15 +73999,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
73879
73999
|
const parsedType = this._getType(input);
|
|
73880
74000
|
if (parsedType !== ZodParsedType.string) {
|
|
73881
74001
|
const ctx2 = this._getOrReturnCtx(input);
|
|
73882
|
-
addIssueToContext(
|
|
73883
|
-
|
|
73884
|
-
|
|
73885
|
-
|
|
73886
|
-
|
|
73887
|
-
received: ctx2.parsedType
|
|
73888
|
-
}
|
|
73889
|
-
//
|
|
73890
|
-
);
|
|
74002
|
+
addIssueToContext(ctx2, {
|
|
74003
|
+
code: ZodIssueCode.invalid_type,
|
|
74004
|
+
expected: ZodParsedType.string,
|
|
74005
|
+
received: ctx2.parsedType
|
|
74006
|
+
});
|
|
73891
74007
|
return INVALID;
|
|
73892
74008
|
}
|
|
73893
74009
|
const status = new ParseStatus();
|
|
@@ -73978,6 +74094,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
73978
74094
|
});
|
|
73979
74095
|
status.dirty();
|
|
73980
74096
|
}
|
|
74097
|
+
} else if (check.kind === "nanoid") {
|
|
74098
|
+
if (!nanoidRegex.test(input.data)) {
|
|
74099
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74100
|
+
addIssueToContext(ctx, {
|
|
74101
|
+
validation: "nanoid",
|
|
74102
|
+
code: ZodIssueCode.invalid_string,
|
|
74103
|
+
message: check.message
|
|
74104
|
+
});
|
|
74105
|
+
status.dirty();
|
|
74106
|
+
}
|
|
73981
74107
|
} else if (check.kind === "cuid") {
|
|
73982
74108
|
if (!cuidRegex.test(input.data)) {
|
|
73983
74109
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -74079,6 +74205,38 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74079
74205
|
});
|
|
74080
74206
|
status.dirty();
|
|
74081
74207
|
}
|
|
74208
|
+
} else if (check.kind === "date") {
|
|
74209
|
+
const regex = dateRegex;
|
|
74210
|
+
if (!regex.test(input.data)) {
|
|
74211
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74212
|
+
addIssueToContext(ctx, {
|
|
74213
|
+
code: ZodIssueCode.invalid_string,
|
|
74214
|
+
validation: "date",
|
|
74215
|
+
message: check.message
|
|
74216
|
+
});
|
|
74217
|
+
status.dirty();
|
|
74218
|
+
}
|
|
74219
|
+
} else if (check.kind === "time") {
|
|
74220
|
+
const regex = timeRegex(check);
|
|
74221
|
+
if (!regex.test(input.data)) {
|
|
74222
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74223
|
+
addIssueToContext(ctx, {
|
|
74224
|
+
code: ZodIssueCode.invalid_string,
|
|
74225
|
+
validation: "time",
|
|
74226
|
+
message: check.message
|
|
74227
|
+
});
|
|
74228
|
+
status.dirty();
|
|
74229
|
+
}
|
|
74230
|
+
} else if (check.kind === "duration") {
|
|
74231
|
+
if (!durationRegex.test(input.data)) {
|
|
74232
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74233
|
+
addIssueToContext(ctx, {
|
|
74234
|
+
validation: "duration",
|
|
74235
|
+
code: ZodIssueCode.invalid_string,
|
|
74236
|
+
message: check.message
|
|
74237
|
+
});
|
|
74238
|
+
status.dirty();
|
|
74239
|
+
}
|
|
74082
74240
|
} else if (check.kind === "ip") {
|
|
74083
74241
|
if (!isValidIP(input.data, check.version)) {
|
|
74084
74242
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -74089,6 +74247,46 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74089
74247
|
});
|
|
74090
74248
|
status.dirty();
|
|
74091
74249
|
}
|
|
74250
|
+
} else if (check.kind === "jwt") {
|
|
74251
|
+
if (!isValidJWT(input.data, check.alg)) {
|
|
74252
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74253
|
+
addIssueToContext(ctx, {
|
|
74254
|
+
validation: "jwt",
|
|
74255
|
+
code: ZodIssueCode.invalid_string,
|
|
74256
|
+
message: check.message
|
|
74257
|
+
});
|
|
74258
|
+
status.dirty();
|
|
74259
|
+
}
|
|
74260
|
+
} else if (check.kind === "cidr") {
|
|
74261
|
+
if (!isValidCidr(input.data, check.version)) {
|
|
74262
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74263
|
+
addIssueToContext(ctx, {
|
|
74264
|
+
validation: "cidr",
|
|
74265
|
+
code: ZodIssueCode.invalid_string,
|
|
74266
|
+
message: check.message
|
|
74267
|
+
});
|
|
74268
|
+
status.dirty();
|
|
74269
|
+
}
|
|
74270
|
+
} else if (check.kind === "base64") {
|
|
74271
|
+
if (!base64Regex.test(input.data)) {
|
|
74272
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74273
|
+
addIssueToContext(ctx, {
|
|
74274
|
+
validation: "base64",
|
|
74275
|
+
code: ZodIssueCode.invalid_string,
|
|
74276
|
+
message: check.message
|
|
74277
|
+
});
|
|
74278
|
+
status.dirty();
|
|
74279
|
+
}
|
|
74280
|
+
} else if (check.kind === "base64url") {
|
|
74281
|
+
if (!base64urlRegex.test(input.data)) {
|
|
74282
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
74283
|
+
addIssueToContext(ctx, {
|
|
74284
|
+
validation: "base64url",
|
|
74285
|
+
code: ZodIssueCode.invalid_string,
|
|
74286
|
+
message: check.message
|
|
74287
|
+
});
|
|
74288
|
+
status.dirty();
|
|
74289
|
+
}
|
|
74092
74290
|
} else {
|
|
74093
74291
|
util.assertNever(check);
|
|
74094
74292
|
}
|
|
@@ -74120,6 +74318,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74120
74318
|
uuid(message) {
|
|
74121
74319
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
|
74122
74320
|
}
|
|
74321
|
+
nanoid(message) {
|
|
74322
|
+
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
|
74323
|
+
}
|
|
74123
74324
|
cuid(message) {
|
|
74124
74325
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
|
74125
74326
|
}
|
|
@@ -74129,16 +74330,32 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74129
74330
|
ulid(message) {
|
|
74130
74331
|
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
|
74131
74332
|
}
|
|
74333
|
+
base64(message) {
|
|
74334
|
+
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
74335
|
+
}
|
|
74336
|
+
base64url(message) {
|
|
74337
|
+
return this._addCheck({
|
|
74338
|
+
kind: "base64url",
|
|
74339
|
+
...errorUtil.errToObj(message)
|
|
74340
|
+
});
|
|
74341
|
+
}
|
|
74342
|
+
jwt(options) {
|
|
74343
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
|
74344
|
+
}
|
|
74132
74345
|
ip(options) {
|
|
74133
74346
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
74134
74347
|
}
|
|
74348
|
+
cidr(options) {
|
|
74349
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
74350
|
+
}
|
|
74135
74351
|
datetime(options) {
|
|
74136
|
-
var _a2;
|
|
74352
|
+
var _a2, _b;
|
|
74137
74353
|
if (typeof options === "string") {
|
|
74138
74354
|
return this._addCheck({
|
|
74139
74355
|
kind: "datetime",
|
|
74140
74356
|
precision: null,
|
|
74141
74357
|
offset: false,
|
|
74358
|
+
local: false,
|
|
74142
74359
|
message: options
|
|
74143
74360
|
});
|
|
74144
74361
|
}
|
|
@@ -74146,9 +74363,30 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74146
74363
|
kind: "datetime",
|
|
74147
74364
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
74148
74365
|
offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
|
|
74366
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
|
74367
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
74368
|
+
});
|
|
74369
|
+
}
|
|
74370
|
+
date(message) {
|
|
74371
|
+
return this._addCheck({ kind: "date", message });
|
|
74372
|
+
}
|
|
74373
|
+
time(options) {
|
|
74374
|
+
if (typeof options === "string") {
|
|
74375
|
+
return this._addCheck({
|
|
74376
|
+
kind: "time",
|
|
74377
|
+
precision: null,
|
|
74378
|
+
message: options
|
|
74379
|
+
});
|
|
74380
|
+
}
|
|
74381
|
+
return this._addCheck({
|
|
74382
|
+
kind: "time",
|
|
74383
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
74149
74384
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
74150
74385
|
});
|
|
74151
74386
|
}
|
|
74387
|
+
duration(message) {
|
|
74388
|
+
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
|
74389
|
+
}
|
|
74152
74390
|
regex(regex, message) {
|
|
74153
74391
|
return this._addCheck({
|
|
74154
74392
|
kind: "regex",
|
|
@@ -74200,8 +74438,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74200
74438
|
});
|
|
74201
74439
|
}
|
|
74202
74440
|
/**
|
|
74203
|
-
*
|
|
74204
|
-
* @see {@link ZodString.min}
|
|
74441
|
+
* Equivalent to `.min(1)`
|
|
74205
74442
|
*/
|
|
74206
74443
|
nonempty(message) {
|
|
74207
74444
|
return this.min(1, errorUtil.errToObj(message));
|
|
@@ -74227,6 +74464,15 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74227
74464
|
get isDatetime() {
|
|
74228
74465
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
74229
74466
|
}
|
|
74467
|
+
get isDate() {
|
|
74468
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
74469
|
+
}
|
|
74470
|
+
get isTime() {
|
|
74471
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
74472
|
+
}
|
|
74473
|
+
get isDuration() {
|
|
74474
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
74475
|
+
}
|
|
74230
74476
|
get isEmail() {
|
|
74231
74477
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
74232
74478
|
}
|
|
@@ -74239,6 +74485,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74239
74485
|
get isUUID() {
|
|
74240
74486
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
74241
74487
|
}
|
|
74488
|
+
get isNANOID() {
|
|
74489
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
74490
|
+
}
|
|
74242
74491
|
get isCUID() {
|
|
74243
74492
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
74244
74493
|
}
|
|
@@ -74251,6 +74500,15 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
74251
74500
|
get isIP() {
|
|
74252
74501
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
74253
74502
|
}
|
|
74503
|
+
get isCIDR() {
|
|
74504
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
74505
|
+
}
|
|
74506
|
+
get isBase64() {
|
|
74507
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
74508
|
+
}
|
|
74509
|
+
get isBase64url() {
|
|
74510
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
74511
|
+
}
|
|
74254
74512
|
get minLength() {
|
|
74255
74513
|
let min = null;
|
|
74256
74514
|
for (const ch of this._def.checks) {
|
|
@@ -74528,17 +74786,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
74528
74786
|
}
|
|
74529
74787
|
_parse(input) {
|
|
74530
74788
|
if (this._def.coerce) {
|
|
74531
|
-
|
|
74789
|
+
try {
|
|
74790
|
+
input.data = BigInt(input.data);
|
|
74791
|
+
} catch (_a2) {
|
|
74792
|
+
return this._getInvalidInput(input);
|
|
74793
|
+
}
|
|
74532
74794
|
}
|
|
74533
74795
|
const parsedType = this._getType(input);
|
|
74534
74796
|
if (parsedType !== ZodParsedType.bigint) {
|
|
74535
|
-
|
|
74536
|
-
addIssueToContext(ctx2, {
|
|
74537
|
-
code: ZodIssueCode.invalid_type,
|
|
74538
|
-
expected: ZodParsedType.bigint,
|
|
74539
|
-
received: ctx2.parsedType
|
|
74540
|
-
});
|
|
74541
|
-
return INVALID;
|
|
74797
|
+
return this._getInvalidInput(input);
|
|
74542
74798
|
}
|
|
74543
74799
|
let ctx = void 0;
|
|
74544
74800
|
const status = new ParseStatus();
|
|
@@ -74585,6 +74841,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
74585
74841
|
}
|
|
74586
74842
|
return { status: status.value, value: input.data };
|
|
74587
74843
|
}
|
|
74844
|
+
_getInvalidInput(input) {
|
|
74845
|
+
const ctx = this._getOrReturnCtx(input);
|
|
74846
|
+
addIssueToContext(ctx, {
|
|
74847
|
+
code: ZodIssueCode.invalid_type,
|
|
74848
|
+
expected: ZodParsedType.bigint,
|
|
74849
|
+
received: ctx.parsedType
|
|
74850
|
+
});
|
|
74851
|
+
return INVALID;
|
|
74852
|
+
}
|
|
74588
74853
|
gte(value, message) {
|
|
74589
74854
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
74590
74855
|
}
|
|
@@ -75164,9 +75429,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
75164
75429
|
const syncPairs = [];
|
|
75165
75430
|
for (const pair of pairs) {
|
|
75166
75431
|
const key = await pair.key;
|
|
75432
|
+
const value = await pair.value;
|
|
75167
75433
|
syncPairs.push({
|
|
75168
75434
|
key,
|
|
75169
|
-
value
|
|
75435
|
+
value,
|
|
75170
75436
|
alwaysSet: pair.alwaysSet
|
|
75171
75437
|
});
|
|
75172
75438
|
}
|
|
@@ -75517,15 +75783,25 @@ var getDiscriminator = (type) => {
|
|
|
75517
75783
|
} else if (type instanceof ZodEnum) {
|
|
75518
75784
|
return type.options;
|
|
75519
75785
|
} else if (type instanceof ZodNativeEnum) {
|
|
75520
|
-
return
|
|
75786
|
+
return util.objectValues(type.enum);
|
|
75521
75787
|
} else if (type instanceof ZodDefault) {
|
|
75522
75788
|
return getDiscriminator(type._def.innerType);
|
|
75523
75789
|
} else if (type instanceof ZodUndefined) {
|
|
75524
75790
|
return [void 0];
|
|
75525
75791
|
} else if (type instanceof ZodNull) {
|
|
75526
75792
|
return [null];
|
|
75793
|
+
} else if (type instanceof ZodOptional) {
|
|
75794
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
75795
|
+
} else if (type instanceof ZodNullable) {
|
|
75796
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
75797
|
+
} else if (type instanceof ZodBranded) {
|
|
75798
|
+
return getDiscriminator(type.unwrap());
|
|
75799
|
+
} else if (type instanceof ZodReadonly) {
|
|
75800
|
+
return getDiscriminator(type.unwrap());
|
|
75801
|
+
} else if (type instanceof ZodCatch) {
|
|
75802
|
+
return getDiscriminator(type._def.innerType);
|
|
75527
75803
|
} else {
|
|
75528
|
-
return
|
|
75804
|
+
return [];
|
|
75529
75805
|
}
|
|
75530
75806
|
};
|
|
75531
75807
|
var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
@@ -75585,7 +75861,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
75585
75861
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
75586
75862
|
for (const type of options) {
|
|
75587
75863
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
75588
|
-
if (!discriminatorValues) {
|
|
75864
|
+
if (!discriminatorValues.length) {
|
|
75589
75865
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
75590
75866
|
}
|
|
75591
75867
|
for (const value of discriminatorValues) {
|
|
@@ -75785,7 +76061,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
|
|
|
75785
76061
|
for (const key in ctx.data) {
|
|
75786
76062
|
pairs.push({
|
|
75787
76063
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
75788
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
|
76064
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
76065
|
+
alwaysSet: key in ctx.data
|
|
75789
76066
|
});
|
|
75790
76067
|
}
|
|
75791
76068
|
if (ctx.common.async) {
|
|
@@ -76129,6 +76406,10 @@ function createZodEnum(values, params) {
|
|
|
76129
76406
|
});
|
|
76130
76407
|
}
|
|
76131
76408
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
76409
|
+
constructor() {
|
|
76410
|
+
super(...arguments);
|
|
76411
|
+
_ZodEnum_cache.set(this, void 0);
|
|
76412
|
+
}
|
|
76132
76413
|
_parse(input) {
|
|
76133
76414
|
if (typeof input.data !== "string") {
|
|
76134
76415
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -76140,7 +76421,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
76140
76421
|
});
|
|
76141
76422
|
return INVALID;
|
|
76142
76423
|
}
|
|
76143
|
-
if (this
|
|
76424
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
76425
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
76426
|
+
}
|
|
76427
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
76144
76428
|
const ctx = this._getOrReturnCtx(input);
|
|
76145
76429
|
const expectedValues = this._def.values;
|
|
76146
76430
|
addIssueToContext(ctx, {
|
|
@@ -76176,15 +76460,26 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
76176
76460
|
}
|
|
76177
76461
|
return enumValues;
|
|
76178
76462
|
}
|
|
76179
|
-
extract(values) {
|
|
76180
|
-
return _ZodEnum.create(values
|
|
76463
|
+
extract(values, newDef = this._def) {
|
|
76464
|
+
return _ZodEnum.create(values, {
|
|
76465
|
+
...this._def,
|
|
76466
|
+
...newDef
|
|
76467
|
+
});
|
|
76181
76468
|
}
|
|
76182
|
-
exclude(values) {
|
|
76183
|
-
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt))
|
|
76469
|
+
exclude(values, newDef = this._def) {
|
|
76470
|
+
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
|
76471
|
+
...this._def,
|
|
76472
|
+
...newDef
|
|
76473
|
+
});
|
|
76184
76474
|
}
|
|
76185
76475
|
};
|
|
76476
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
76186
76477
|
ZodEnum.create = createZodEnum;
|
|
76187
76478
|
var ZodNativeEnum = class extends ZodType {
|
|
76479
|
+
constructor() {
|
|
76480
|
+
super(...arguments);
|
|
76481
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
76482
|
+
}
|
|
76188
76483
|
_parse(input) {
|
|
76189
76484
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
76190
76485
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -76197,7 +76492,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
76197
76492
|
});
|
|
76198
76493
|
return INVALID;
|
|
76199
76494
|
}
|
|
76200
|
-
if (
|
|
76495
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
76496
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
76497
|
+
}
|
|
76498
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
76201
76499
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
76202
76500
|
addIssueToContext(ctx, {
|
|
76203
76501
|
received: ctx.data,
|
|
@@ -76212,6 +76510,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
76212
76510
|
return this._def.values;
|
|
76213
76511
|
}
|
|
76214
76512
|
};
|
|
76513
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
76215
76514
|
ZodNativeEnum.create = (values, params) => {
|
|
76216
76515
|
return new ZodNativeEnum({
|
|
76217
76516
|
values,
|
|
@@ -76275,26 +76574,38 @@ var ZodEffects = class extends ZodType {
|
|
|
76275
76574
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
76276
76575
|
if (effect.type === "preprocess") {
|
|
76277
76576
|
const processed = effect.transform(ctx.data, checkCtx);
|
|
76278
|
-
if (ctx.common.issues.length) {
|
|
76279
|
-
return {
|
|
76280
|
-
status: "dirty",
|
|
76281
|
-
value: ctx.data
|
|
76282
|
-
};
|
|
76283
|
-
}
|
|
76284
76577
|
if (ctx.common.async) {
|
|
76285
|
-
return Promise.resolve(processed).then((processed2) => {
|
|
76286
|
-
|
|
76578
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
76579
|
+
if (status.value === "aborted")
|
|
76580
|
+
return INVALID;
|
|
76581
|
+
const result = await this._def.schema._parseAsync({
|
|
76287
76582
|
data: processed2,
|
|
76288
76583
|
path: ctx.path,
|
|
76289
76584
|
parent: ctx
|
|
76290
76585
|
});
|
|
76586
|
+
if (result.status === "aborted")
|
|
76587
|
+
return INVALID;
|
|
76588
|
+
if (result.status === "dirty")
|
|
76589
|
+
return DIRTY(result.value);
|
|
76590
|
+
if (status.value === "dirty")
|
|
76591
|
+
return DIRTY(result.value);
|
|
76592
|
+
return result;
|
|
76291
76593
|
});
|
|
76292
76594
|
} else {
|
|
76293
|
-
|
|
76595
|
+
if (status.value === "aborted")
|
|
76596
|
+
return INVALID;
|
|
76597
|
+
const result = this._def.schema._parseSync({
|
|
76294
76598
|
data: processed,
|
|
76295
76599
|
path: ctx.path,
|
|
76296
76600
|
parent: ctx
|
|
76297
76601
|
});
|
|
76602
|
+
if (result.status === "aborted")
|
|
76603
|
+
return INVALID;
|
|
76604
|
+
if (result.status === "dirty")
|
|
76605
|
+
return DIRTY(result.value);
|
|
76606
|
+
if (status.value === "dirty")
|
|
76607
|
+
return DIRTY(result.value);
|
|
76608
|
+
return result;
|
|
76298
76609
|
}
|
|
76299
76610
|
}
|
|
76300
76611
|
if (effect.type === "refinement") {
|
|
@@ -76583,10 +76894,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
76583
76894
|
var ZodReadonly = class extends ZodType {
|
|
76584
76895
|
_parse(input) {
|
|
76585
76896
|
const result = this._def.innerType._parse(input);
|
|
76586
|
-
|
|
76587
|
-
|
|
76588
|
-
|
|
76589
|
-
|
|
76897
|
+
const freeze = (data) => {
|
|
76898
|
+
if (isValid(data)) {
|
|
76899
|
+
data.value = Object.freeze(data.value);
|
|
76900
|
+
}
|
|
76901
|
+
return data;
|
|
76902
|
+
};
|
|
76903
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
76904
|
+
}
|
|
76905
|
+
unwrap() {
|
|
76906
|
+
return this._def.innerType;
|
|
76590
76907
|
}
|
|
76591
76908
|
};
|
|
76592
76909
|
ZodReadonly.create = (type, params) => {
|
|
@@ -76596,19 +76913,35 @@ ZodReadonly.create = (type, params) => {
|
|
|
76596
76913
|
...processCreateParams(params)
|
|
76597
76914
|
});
|
|
76598
76915
|
};
|
|
76599
|
-
|
|
76916
|
+
function cleanParams(params, data) {
|
|
76917
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
76918
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
76919
|
+
return p2;
|
|
76920
|
+
}
|
|
76921
|
+
function custom(check, _params = {}, fatal) {
|
|
76600
76922
|
if (check)
|
|
76601
76923
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
76602
76924
|
var _a2, _b;
|
|
76603
|
-
|
|
76604
|
-
|
|
76605
|
-
|
|
76606
|
-
|
|
76607
|
-
|
|
76925
|
+
const r = check(data);
|
|
76926
|
+
if (r instanceof Promise) {
|
|
76927
|
+
return r.then((r2) => {
|
|
76928
|
+
var _a3, _b2;
|
|
76929
|
+
if (!r2) {
|
|
76930
|
+
const params = cleanParams(_params, data);
|
|
76931
|
+
const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
76932
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
76933
|
+
}
|
|
76934
|
+
});
|
|
76608
76935
|
}
|
|
76936
|
+
if (!r) {
|
|
76937
|
+
const params = cleanParams(_params, data);
|
|
76938
|
+
const _fatal = (_b = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
|
|
76939
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
76940
|
+
}
|
|
76941
|
+
return;
|
|
76609
76942
|
});
|
|
76610
76943
|
return ZodAny.create();
|
|
76611
|
-
}
|
|
76944
|
+
}
|
|
76612
76945
|
var late = {
|
|
76613
76946
|
object: ZodObject.lazycreate
|
|
76614
76947
|
};
|
|
@@ -76727,6 +77060,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
76727
77060
|
ZodParsedType,
|
|
76728
77061
|
getParsedType,
|
|
76729
77062
|
ZodType,
|
|
77063
|
+
datetimeRegex,
|
|
76730
77064
|
ZodString,
|
|
76731
77065
|
ZodNumber,
|
|
76732
77066
|
ZodBigInt,
|
|
@@ -78717,6 +79051,7 @@ fsa.register("https://", new FsHttp());
|
|
|
78717
79051
|
fsa.register("s3://", s3Fs);
|
|
78718
79052
|
fsa.register("s3://nz-imagery", s3FsPublic);
|
|
78719
79053
|
fsa.register("s3://nz-elevation", s3FsPublic);
|
|
79054
|
+
fsa.register("s3://nz-coastal", s3FsPublic);
|
|
78720
79055
|
var Fsa = fsa;
|
|
78721
79056
|
var FsaChunk = new SourceChunk({ size: 128 * 1024 });
|
|
78722
79057
|
fsa.middleware.push(FsaChunk);
|
|
@@ -80037,143 +80372,6 @@ Object.defineProperty(Projection, "AllowedFloatingError", {
|
|
|
80037
80372
|
value: 1e-8
|
|
80038
80373
|
});
|
|
80039
80374
|
|
|
80040
|
-
// ../geo/build/proj/projection.loader.js
|
|
80041
|
-
var ProjectionLoader = class {
|
|
80042
|
-
/**
|
|
80043
|
-
* Ensure that a projection EPSG code is avialable for use in Proj4js
|
|
80044
|
-
*
|
|
80045
|
-
* If its not already loaded, lookup definition from spatialreference.org
|
|
80046
|
-
* @param code
|
|
80047
|
-
*/
|
|
80048
|
-
static async load(code) {
|
|
80049
|
-
if (Projection.tryGet(code) != null)
|
|
80050
|
-
return Epsg.get(code);
|
|
80051
|
-
const url = `https://spatialreference.org/ref/epsg/${code}/ogcwkt/`;
|
|
80052
|
-
const res = await this._fetch(url);
|
|
80053
|
-
if (!res.ok)
|
|
80054
|
-
throw new Error("Failed to load projection information for:" + code);
|
|
80055
|
-
let epsg = Epsg.tryGet(code);
|
|
80056
|
-
if (epsg == null)
|
|
80057
|
-
epsg = new Epsg(code);
|
|
80058
|
-
const text = await res.text();
|
|
80059
|
-
Projection.define(epsg, text);
|
|
80060
|
-
return epsg;
|
|
80061
|
-
}
|
|
80062
|
-
};
|
|
80063
|
-
Object.defineProperty(ProjectionLoader, "_fetch", {
|
|
80064
|
-
enumerable: true,
|
|
80065
|
-
configurable: true,
|
|
80066
|
-
writable: true,
|
|
80067
|
-
value: fetch
|
|
80068
|
-
});
|
|
80069
|
-
|
|
80070
|
-
// ../geo/build/proj/tile.set.name.js
|
|
80071
|
-
var TileSetName;
|
|
80072
|
-
(function(TileSetName2) {
|
|
80073
|
-
TileSetName2["aerial"] = "aerial";
|
|
80074
|
-
})(TileSetName || (TileSetName = {}));
|
|
80075
|
-
|
|
80076
|
-
// ../geo/build/quad.key.js
|
|
80077
|
-
var CHAR_0 = "0".charCodeAt(0);
|
|
80078
|
-
var CHAR_1 = "1".charCodeAt(0);
|
|
80079
|
-
var CHAR_2 = "2".charCodeAt(0);
|
|
80080
|
-
var CHAR_3 = "3".charCodeAt(0);
|
|
80081
|
-
|
|
80082
|
-
// ../geo/build/simplify.js
|
|
80083
|
-
function getDistance(p1, p2) {
|
|
80084
|
-
const dx = p1[0] - p2[0];
|
|
80085
|
-
const dy = p1[1] - p2[1];
|
|
80086
|
-
return dx * dx + dy * dy;
|
|
80087
|
-
}
|
|
80088
|
-
function getSqSegDist(p, p1, p2) {
|
|
80089
|
-
let x = p1[0];
|
|
80090
|
-
let y = p1[1];
|
|
80091
|
-
let dx = p2[0] - x;
|
|
80092
|
-
let dy = p2[1] - y;
|
|
80093
|
-
if (dx !== 0 || dy !== 0) {
|
|
80094
|
-
const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
|
|
80095
|
-
if (t > 1) {
|
|
80096
|
-
x = p2[0];
|
|
80097
|
-
y = p2[1];
|
|
80098
|
-
} else if (t > 0) {
|
|
80099
|
-
x += dx * t;
|
|
80100
|
-
y += dy * t;
|
|
80101
|
-
}
|
|
80102
|
-
}
|
|
80103
|
-
dx = p[0] - x;
|
|
80104
|
-
dy = p[1] - y;
|
|
80105
|
-
return dx * dx + dy * dy;
|
|
80106
|
-
}
|
|
80107
|
-
function simplifyRadialDist(points, sqTolerance) {
|
|
80108
|
-
let prevPoint = points[0];
|
|
80109
|
-
let point = points[1];
|
|
80110
|
-
const newPoints = [prevPoint];
|
|
80111
|
-
for (let i = 1, len = points.length; i < len; i++) {
|
|
80112
|
-
point = points[i];
|
|
80113
|
-
if (getDistance(point, prevPoint) > sqTolerance) {
|
|
80114
|
-
newPoints.push(point);
|
|
80115
|
-
prevPoint = point;
|
|
80116
|
-
}
|
|
80117
|
-
}
|
|
80118
|
-
if (prevPoint !== point)
|
|
80119
|
-
newPoints.push(point);
|
|
80120
|
-
return newPoints;
|
|
80121
|
-
}
|
|
80122
|
-
function simplifyDPStep(points, first, last, sqTolerance, simplified) {
|
|
80123
|
-
let maxSqDist = sqTolerance;
|
|
80124
|
-
let index = 0;
|
|
80125
|
-
for (let i = first + 1; i < last; i++) {
|
|
80126
|
-
const sqDist = getSqSegDist(points[i], points[first], points[last]);
|
|
80127
|
-
if (sqDist > maxSqDist) {
|
|
80128
|
-
index = i;
|
|
80129
|
-
maxSqDist = sqDist;
|
|
80130
|
-
}
|
|
80131
|
-
}
|
|
80132
|
-
if (maxSqDist > sqTolerance) {
|
|
80133
|
-
if (index - first > 1)
|
|
80134
|
-
simplifyDPStep(points, first, index, sqTolerance, simplified);
|
|
80135
|
-
simplified.push(points[index]);
|
|
80136
|
-
if (last - index > 1)
|
|
80137
|
-
simplifyDPStep(points, index, last, sqTolerance, simplified);
|
|
80138
|
-
}
|
|
80139
|
-
}
|
|
80140
|
-
function simplifyDouglasPeucker(points, sqTolerance) {
|
|
80141
|
-
const last = points.length - 1;
|
|
80142
|
-
const simplified = [points[0]];
|
|
80143
|
-
simplifyDPStep(points, 0, last, sqTolerance, simplified);
|
|
80144
|
-
simplified.push(points[last]);
|
|
80145
|
-
return simplified;
|
|
80146
|
-
}
|
|
80147
|
-
var Simplify = {
|
|
80148
|
-
points(points, tolerance, highestQuality) {
|
|
80149
|
-
if (points.length <= 2)
|
|
80150
|
-
return points;
|
|
80151
|
-
const sqTolerance = tolerance * tolerance;
|
|
80152
|
-
points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
|
|
80153
|
-
points = simplifyDouglasPeucker(points, sqTolerance);
|
|
80154
|
-
return points;
|
|
80155
|
-
},
|
|
80156
|
-
multiPolygon(coordinates, tolerance, removeArea = 1e-8) {
|
|
80157
|
-
const output = [];
|
|
80158
|
-
for (let k = 0; k < coordinates.length; k++) {
|
|
80159
|
-
const outPoints = [];
|
|
80160
|
-
for (let l = 0; l < coordinates[k].length; l++) {
|
|
80161
|
-
const point = Simplify.points(coordinates[k][l], tolerance);
|
|
80162
|
-
if (point.length > 2)
|
|
80163
|
-
outPoints.push(point);
|
|
80164
|
-
}
|
|
80165
|
-
if (outPoints.length > 0) {
|
|
80166
|
-
if (removeArea > 0 && Area.polygon(outPoints) < removeArea)
|
|
80167
|
-
continue;
|
|
80168
|
-
output.push(outPoints);
|
|
80169
|
-
}
|
|
80170
|
-
}
|
|
80171
|
-
if (output.length === 0)
|
|
80172
|
-
return null;
|
|
80173
|
-
return output;
|
|
80174
|
-
}
|
|
80175
|
-
};
|
|
80176
|
-
|
|
80177
80375
|
// ../geo/build/xy.order.js
|
|
80178
80376
|
function getXyOrder(epsg) {
|
|
80179
80377
|
const code = typeof epsg === "number" ? epsg : epsg.code;
|
|
@@ -80459,6 +80657,411 @@ var TileMatrixSet = class {
|
|
|
80459
80657
|
}
|
|
80460
80658
|
};
|
|
80461
80659
|
|
|
80660
|
+
// ../geo/build/tms/google.js
|
|
80661
|
+
var GoogleTmst = {
|
|
80662
|
+
type: "TileMatrixSetType",
|
|
80663
|
+
title: "Google Maps Compatible for the World",
|
|
80664
|
+
identifier: "WebMercatorQuad",
|
|
80665
|
+
boundingBox: {
|
|
80666
|
+
type: "BoundingBoxType",
|
|
80667
|
+
crs: "http://www.opengis.net/def/crs/EPSG/0/3857",
|
|
80668
|
+
lowerCorner: [-200375083427892e-7, -200375083427892e-7],
|
|
80669
|
+
upperCorner: [200375083427892e-7, 200375083427892e-7]
|
|
80670
|
+
},
|
|
80671
|
+
supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3857",
|
|
80672
|
+
wellKnownScaleSet: "https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",
|
|
80673
|
+
tileMatrix: [
|
|
80674
|
+
{
|
|
80675
|
+
type: "TileMatrixType",
|
|
80676
|
+
identifier: "0",
|
|
80677
|
+
scaleDenominator: 559082264028717e-6,
|
|
80678
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80679
|
+
tileWidth: 256,
|
|
80680
|
+
tileHeight: 256,
|
|
80681
|
+
matrixWidth: 1,
|
|
80682
|
+
matrixHeight: 1
|
|
80683
|
+
},
|
|
80684
|
+
{
|
|
80685
|
+
type: "TileMatrixType",
|
|
80686
|
+
identifier: "1",
|
|
80687
|
+
scaleDenominator: 279541132014358e-6,
|
|
80688
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80689
|
+
tileWidth: 256,
|
|
80690
|
+
tileHeight: 256,
|
|
80691
|
+
matrixWidth: 2,
|
|
80692
|
+
matrixHeight: 2
|
|
80693
|
+
},
|
|
80694
|
+
{
|
|
80695
|
+
type: "TileMatrixType",
|
|
80696
|
+
identifier: "2",
|
|
80697
|
+
scaleDenominator: 139770566007179e-6,
|
|
80698
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80699
|
+
tileWidth: 256,
|
|
80700
|
+
tileHeight: 256,
|
|
80701
|
+
matrixWidth: 4,
|
|
80702
|
+
matrixHeight: 4
|
|
80703
|
+
},
|
|
80704
|
+
{
|
|
80705
|
+
type: "TileMatrixType",
|
|
80706
|
+
identifier: "3",
|
|
80707
|
+
scaleDenominator: 698852830035897e-7,
|
|
80708
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80709
|
+
tileWidth: 256,
|
|
80710
|
+
tileHeight: 256,
|
|
80711
|
+
matrixWidth: 8,
|
|
80712
|
+
matrixHeight: 8
|
|
80713
|
+
},
|
|
80714
|
+
{
|
|
80715
|
+
type: "TileMatrixType",
|
|
80716
|
+
identifier: "4",
|
|
80717
|
+
scaleDenominator: 349426415017948e-7,
|
|
80718
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80719
|
+
tileWidth: 256,
|
|
80720
|
+
tileHeight: 256,
|
|
80721
|
+
matrixWidth: 16,
|
|
80722
|
+
matrixHeight: 16
|
|
80723
|
+
},
|
|
80724
|
+
{
|
|
80725
|
+
type: "TileMatrixType",
|
|
80726
|
+
identifier: "5",
|
|
80727
|
+
scaleDenominator: 174713207508974e-7,
|
|
80728
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80729
|
+
tileWidth: 256,
|
|
80730
|
+
tileHeight: 256,
|
|
80731
|
+
matrixWidth: 32,
|
|
80732
|
+
matrixHeight: 32
|
|
80733
|
+
},
|
|
80734
|
+
{
|
|
80735
|
+
type: "TileMatrixType",
|
|
80736
|
+
identifier: "6",
|
|
80737
|
+
scaleDenominator: 873566037544871e-8,
|
|
80738
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80739
|
+
tileWidth: 256,
|
|
80740
|
+
tileHeight: 256,
|
|
80741
|
+
matrixWidth: 64,
|
|
80742
|
+
matrixHeight: 64
|
|
80743
|
+
},
|
|
80744
|
+
{
|
|
80745
|
+
type: "TileMatrixType",
|
|
80746
|
+
identifier: "7",
|
|
80747
|
+
scaleDenominator: 436783018772435e-8,
|
|
80748
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80749
|
+
tileWidth: 256,
|
|
80750
|
+
tileHeight: 256,
|
|
80751
|
+
matrixWidth: 128,
|
|
80752
|
+
matrixHeight: 128
|
|
80753
|
+
},
|
|
80754
|
+
{
|
|
80755
|
+
type: "TileMatrixType",
|
|
80756
|
+
identifier: "8",
|
|
80757
|
+
scaleDenominator: 218391509386217e-8,
|
|
80758
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80759
|
+
tileWidth: 256,
|
|
80760
|
+
tileHeight: 256,
|
|
80761
|
+
matrixWidth: 256,
|
|
80762
|
+
matrixHeight: 256
|
|
80763
|
+
},
|
|
80764
|
+
{
|
|
80765
|
+
type: "TileMatrixType",
|
|
80766
|
+
identifier: "9",
|
|
80767
|
+
scaleDenominator: 109195754693108e-8,
|
|
80768
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80769
|
+
tileWidth: 256,
|
|
80770
|
+
tileHeight: 256,
|
|
80771
|
+
matrixWidth: 512,
|
|
80772
|
+
matrixHeight: 512
|
|
80773
|
+
},
|
|
80774
|
+
{
|
|
80775
|
+
type: "TileMatrixType",
|
|
80776
|
+
identifier: "10",
|
|
80777
|
+
scaleDenominator: 545978.773465544,
|
|
80778
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80779
|
+
tileWidth: 256,
|
|
80780
|
+
tileHeight: 256,
|
|
80781
|
+
matrixWidth: 1024,
|
|
80782
|
+
matrixHeight: 1024
|
|
80783
|
+
},
|
|
80784
|
+
{
|
|
80785
|
+
type: "TileMatrixType",
|
|
80786
|
+
identifier: "11",
|
|
80787
|
+
scaleDenominator: 272989.386732772,
|
|
80788
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80789
|
+
tileWidth: 256,
|
|
80790
|
+
tileHeight: 256,
|
|
80791
|
+
matrixWidth: 2048,
|
|
80792
|
+
matrixHeight: 2048
|
|
80793
|
+
},
|
|
80794
|
+
{
|
|
80795
|
+
type: "TileMatrixType",
|
|
80796
|
+
identifier: "12",
|
|
80797
|
+
scaleDenominator: 136494.693366386,
|
|
80798
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80799
|
+
tileWidth: 256,
|
|
80800
|
+
tileHeight: 256,
|
|
80801
|
+
matrixWidth: 4096,
|
|
80802
|
+
matrixHeight: 4096
|
|
80803
|
+
},
|
|
80804
|
+
{
|
|
80805
|
+
type: "TileMatrixType",
|
|
80806
|
+
identifier: "13",
|
|
80807
|
+
scaleDenominator: 68247.346683193,
|
|
80808
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80809
|
+
tileWidth: 256,
|
|
80810
|
+
tileHeight: 256,
|
|
80811
|
+
matrixWidth: 8192,
|
|
80812
|
+
matrixHeight: 8192
|
|
80813
|
+
},
|
|
80814
|
+
{
|
|
80815
|
+
type: "TileMatrixType",
|
|
80816
|
+
identifier: "14",
|
|
80817
|
+
scaleDenominator: 34123.6733415964,
|
|
80818
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80819
|
+
tileWidth: 256,
|
|
80820
|
+
tileHeight: 256,
|
|
80821
|
+
matrixWidth: 16384,
|
|
80822
|
+
matrixHeight: 16384
|
|
80823
|
+
},
|
|
80824
|
+
{
|
|
80825
|
+
type: "TileMatrixType",
|
|
80826
|
+
identifier: "15",
|
|
80827
|
+
scaleDenominator: 17061.8366707982,
|
|
80828
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80829
|
+
tileWidth: 256,
|
|
80830
|
+
tileHeight: 256,
|
|
80831
|
+
matrixWidth: 32768,
|
|
80832
|
+
matrixHeight: 32768
|
|
80833
|
+
},
|
|
80834
|
+
{
|
|
80835
|
+
type: "TileMatrixType",
|
|
80836
|
+
identifier: "16",
|
|
80837
|
+
scaleDenominator: 8530.91833539913,
|
|
80838
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80839
|
+
tileWidth: 256,
|
|
80840
|
+
tileHeight: 256,
|
|
80841
|
+
matrixWidth: 65536,
|
|
80842
|
+
matrixHeight: 65536
|
|
80843
|
+
},
|
|
80844
|
+
{
|
|
80845
|
+
type: "TileMatrixType",
|
|
80846
|
+
identifier: "17",
|
|
80847
|
+
scaleDenominator: 4265.45916769956,
|
|
80848
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80849
|
+
tileWidth: 256,
|
|
80850
|
+
tileHeight: 256,
|
|
80851
|
+
matrixWidth: 131072,
|
|
80852
|
+
matrixHeight: 131072
|
|
80853
|
+
},
|
|
80854
|
+
{
|
|
80855
|
+
type: "TileMatrixType",
|
|
80856
|
+
identifier: "18",
|
|
80857
|
+
scaleDenominator: 2132.72958384978,
|
|
80858
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80859
|
+
tileWidth: 256,
|
|
80860
|
+
tileHeight: 256,
|
|
80861
|
+
matrixWidth: 262144,
|
|
80862
|
+
matrixHeight: 262144
|
|
80863
|
+
},
|
|
80864
|
+
{
|
|
80865
|
+
type: "TileMatrixType",
|
|
80866
|
+
identifier: "19",
|
|
80867
|
+
scaleDenominator: 1066.36479192489,
|
|
80868
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80869
|
+
tileWidth: 256,
|
|
80870
|
+
tileHeight: 256,
|
|
80871
|
+
matrixWidth: 524288,
|
|
80872
|
+
matrixHeight: 524288
|
|
80873
|
+
},
|
|
80874
|
+
{
|
|
80875
|
+
type: "TileMatrixType",
|
|
80876
|
+
identifier: "20",
|
|
80877
|
+
scaleDenominator: 533.182395962445,
|
|
80878
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80879
|
+
tileWidth: 256,
|
|
80880
|
+
tileHeight: 256,
|
|
80881
|
+
matrixWidth: 1048576,
|
|
80882
|
+
matrixHeight: 1048576
|
|
80883
|
+
},
|
|
80884
|
+
{
|
|
80885
|
+
type: "TileMatrixType",
|
|
80886
|
+
identifier: "21",
|
|
80887
|
+
scaleDenominator: 266.591197981222,
|
|
80888
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80889
|
+
tileWidth: 256,
|
|
80890
|
+
tileHeight: 256,
|
|
80891
|
+
matrixWidth: 2097152,
|
|
80892
|
+
matrixHeight: 2097152
|
|
80893
|
+
},
|
|
80894
|
+
{
|
|
80895
|
+
type: "TileMatrixType",
|
|
80896
|
+
identifier: "22",
|
|
80897
|
+
scaleDenominator: 133.295598990611,
|
|
80898
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80899
|
+
tileWidth: 256,
|
|
80900
|
+
tileHeight: 256,
|
|
80901
|
+
matrixWidth: 4194304,
|
|
80902
|
+
matrixHeight: 4194304
|
|
80903
|
+
},
|
|
80904
|
+
{
|
|
80905
|
+
type: "TileMatrixType",
|
|
80906
|
+
identifier: "23",
|
|
80907
|
+
scaleDenominator: 66.6477994953056,
|
|
80908
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80909
|
+
tileWidth: 256,
|
|
80910
|
+
tileHeight: 256,
|
|
80911
|
+
matrixWidth: 8388608,
|
|
80912
|
+
matrixHeight: 8388608
|
|
80913
|
+
},
|
|
80914
|
+
{
|
|
80915
|
+
type: "TileMatrixType",
|
|
80916
|
+
identifier: "24",
|
|
80917
|
+
scaleDenominator: 33.3238997476528,
|
|
80918
|
+
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80919
|
+
tileWidth: 256,
|
|
80920
|
+
tileHeight: 256,
|
|
80921
|
+
matrixWidth: 16777216,
|
|
80922
|
+
matrixHeight: 16777216
|
|
80923
|
+
}
|
|
80924
|
+
]
|
|
80925
|
+
};
|
|
80926
|
+
var GoogleTms = new TileMatrixSet(GoogleTmst);
|
|
80927
|
+
|
|
80928
|
+
// ../geo/build/proj/projection.loader.js
|
|
80929
|
+
var ProjectionLoader = class {
|
|
80930
|
+
/**
|
|
80931
|
+
* Ensure that a projection EPSG code is avialable for use in Proj4js
|
|
80932
|
+
*
|
|
80933
|
+
* If its not already loaded, lookup definition from spatialreference.org
|
|
80934
|
+
* @param code
|
|
80935
|
+
*/
|
|
80936
|
+
static async load(code) {
|
|
80937
|
+
if (Projection.tryGet(code) != null)
|
|
80938
|
+
return Epsg.get(code);
|
|
80939
|
+
const url = `https://spatialreference.org/ref/epsg/${code}/ogcwkt/`;
|
|
80940
|
+
const res = await this._fetch(url);
|
|
80941
|
+
if (!res.ok)
|
|
80942
|
+
throw new Error("Failed to load projection information for:" + code);
|
|
80943
|
+
let epsg = Epsg.tryGet(code);
|
|
80944
|
+
if (epsg == null)
|
|
80945
|
+
epsg = new Epsg(code);
|
|
80946
|
+
const text = await res.text();
|
|
80947
|
+
Projection.define(epsg, text);
|
|
80948
|
+
return epsg;
|
|
80949
|
+
}
|
|
80950
|
+
};
|
|
80951
|
+
Object.defineProperty(ProjectionLoader, "_fetch", {
|
|
80952
|
+
enumerable: true,
|
|
80953
|
+
configurable: true,
|
|
80954
|
+
writable: true,
|
|
80955
|
+
value: fetch
|
|
80956
|
+
});
|
|
80957
|
+
|
|
80958
|
+
// ../geo/build/proj/tile.set.name.js
|
|
80959
|
+
var TileSetName;
|
|
80960
|
+
(function(TileSetName2) {
|
|
80961
|
+
TileSetName2["aerial"] = "aerial";
|
|
80962
|
+
})(TileSetName || (TileSetName = {}));
|
|
80963
|
+
|
|
80964
|
+
// ../geo/build/quad.key.js
|
|
80965
|
+
var CHAR_0 = "0".charCodeAt(0);
|
|
80966
|
+
var CHAR_1 = "1".charCodeAt(0);
|
|
80967
|
+
var CHAR_2 = "2".charCodeAt(0);
|
|
80968
|
+
var CHAR_3 = "3".charCodeAt(0);
|
|
80969
|
+
|
|
80970
|
+
// ../geo/build/simplify.js
|
|
80971
|
+
function getDistance(p1, p2) {
|
|
80972
|
+
const dx = p1[0] - p2[0];
|
|
80973
|
+
const dy = p1[1] - p2[1];
|
|
80974
|
+
return dx * dx + dy * dy;
|
|
80975
|
+
}
|
|
80976
|
+
function getSqSegDist(p, p1, p2) {
|
|
80977
|
+
let x = p1[0];
|
|
80978
|
+
let y = p1[1];
|
|
80979
|
+
let dx = p2[0] - x;
|
|
80980
|
+
let dy = p2[1] - y;
|
|
80981
|
+
if (dx !== 0 || dy !== 0) {
|
|
80982
|
+
const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
|
|
80983
|
+
if (t > 1) {
|
|
80984
|
+
x = p2[0];
|
|
80985
|
+
y = p2[1];
|
|
80986
|
+
} else if (t > 0) {
|
|
80987
|
+
x += dx * t;
|
|
80988
|
+
y += dy * t;
|
|
80989
|
+
}
|
|
80990
|
+
}
|
|
80991
|
+
dx = p[0] - x;
|
|
80992
|
+
dy = p[1] - y;
|
|
80993
|
+
return dx * dx + dy * dy;
|
|
80994
|
+
}
|
|
80995
|
+
function simplifyRadialDist(points, sqTolerance) {
|
|
80996
|
+
let prevPoint = points[0];
|
|
80997
|
+
let point = points[1];
|
|
80998
|
+
const newPoints = [prevPoint];
|
|
80999
|
+
for (let i = 1, len = points.length; i < len; i++) {
|
|
81000
|
+
point = points[i];
|
|
81001
|
+
if (getDistance(point, prevPoint) > sqTolerance) {
|
|
81002
|
+
newPoints.push(point);
|
|
81003
|
+
prevPoint = point;
|
|
81004
|
+
}
|
|
81005
|
+
}
|
|
81006
|
+
if (prevPoint !== point)
|
|
81007
|
+
newPoints.push(point);
|
|
81008
|
+
return newPoints;
|
|
81009
|
+
}
|
|
81010
|
+
function simplifyDPStep(points, first, last, sqTolerance, simplified) {
|
|
81011
|
+
let maxSqDist = sqTolerance;
|
|
81012
|
+
let index = 0;
|
|
81013
|
+
for (let i = first + 1; i < last; i++) {
|
|
81014
|
+
const sqDist = getSqSegDist(points[i], points[first], points[last]);
|
|
81015
|
+
if (sqDist > maxSqDist) {
|
|
81016
|
+
index = i;
|
|
81017
|
+
maxSqDist = sqDist;
|
|
81018
|
+
}
|
|
81019
|
+
}
|
|
81020
|
+
if (maxSqDist > sqTolerance) {
|
|
81021
|
+
if (index - first > 1)
|
|
81022
|
+
simplifyDPStep(points, first, index, sqTolerance, simplified);
|
|
81023
|
+
simplified.push(points[index]);
|
|
81024
|
+
if (last - index > 1)
|
|
81025
|
+
simplifyDPStep(points, index, last, sqTolerance, simplified);
|
|
81026
|
+
}
|
|
81027
|
+
}
|
|
81028
|
+
function simplifyDouglasPeucker(points, sqTolerance) {
|
|
81029
|
+
const last = points.length - 1;
|
|
81030
|
+
const simplified = [points[0]];
|
|
81031
|
+
simplifyDPStep(points, 0, last, sqTolerance, simplified);
|
|
81032
|
+
simplified.push(points[last]);
|
|
81033
|
+
return simplified;
|
|
81034
|
+
}
|
|
81035
|
+
var Simplify = {
|
|
81036
|
+
points(points, tolerance, highestQuality) {
|
|
81037
|
+
if (points.length <= 2)
|
|
81038
|
+
return points;
|
|
81039
|
+
const sqTolerance = tolerance * tolerance;
|
|
81040
|
+
points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
|
|
81041
|
+
points = simplifyDouglasPeucker(points, sqTolerance);
|
|
81042
|
+
return points;
|
|
81043
|
+
},
|
|
81044
|
+
multiPolygon(coordinates, tolerance, removeArea = 1e-8) {
|
|
81045
|
+
const output = [];
|
|
81046
|
+
for (let k = 0; k < coordinates.length; k++) {
|
|
81047
|
+
const outPoints = [];
|
|
81048
|
+
for (let l = 0; l < coordinates[k].length; l++) {
|
|
81049
|
+
const point = Simplify.points(coordinates[k][l], tolerance);
|
|
81050
|
+
if (point.length > 2)
|
|
81051
|
+
outPoints.push(point);
|
|
81052
|
+
}
|
|
81053
|
+
if (outPoints.length > 0) {
|
|
81054
|
+
if (removeArea > 0 && Area.polygon(outPoints) < removeArea)
|
|
81055
|
+
continue;
|
|
81056
|
+
output.push(outPoints);
|
|
81057
|
+
}
|
|
81058
|
+
}
|
|
81059
|
+
if (output.length === 0)
|
|
81060
|
+
return null;
|
|
81061
|
+
return output;
|
|
81062
|
+
}
|
|
81063
|
+
};
|
|
81064
|
+
|
|
80462
81065
|
// ../geo/build/tms/citm2000.js
|
|
80463
81066
|
var Citm2000Tmst = {
|
|
80464
81067
|
type: "TileMatrixSetType",
|
|
@@ -80657,274 +81260,6 @@ var Citm2000Tmst = {
|
|
|
80657
81260
|
};
|
|
80658
81261
|
var Citm2000Tms = new TileMatrixSet(Citm2000Tmst);
|
|
80659
81262
|
|
|
80660
|
-
// ../geo/build/tms/google.js
|
|
80661
|
-
var GoogleTmst = {
|
|
80662
|
-
type: "TileMatrixSetType",
|
|
80663
|
-
title: "Google Maps Compatible for the World",
|
|
80664
|
-
identifier: "WebMercatorQuad",
|
|
80665
|
-
boundingBox: {
|
|
80666
|
-
type: "BoundingBoxType",
|
|
80667
|
-
crs: "http://www.opengis.net/def/crs/EPSG/0/3857",
|
|
80668
|
-
lowerCorner: [-200375083427892e-7, -200375083427892e-7],
|
|
80669
|
-
upperCorner: [200375083427892e-7, 200375083427892e-7]
|
|
80670
|
-
},
|
|
80671
|
-
supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3857",
|
|
80672
|
-
wellKnownScaleSet: "https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",
|
|
80673
|
-
tileMatrix: [
|
|
80674
|
-
{
|
|
80675
|
-
type: "TileMatrixType",
|
|
80676
|
-
identifier: "0",
|
|
80677
|
-
scaleDenominator: 559082264028717e-6,
|
|
80678
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80679
|
-
tileWidth: 256,
|
|
80680
|
-
tileHeight: 256,
|
|
80681
|
-
matrixWidth: 1,
|
|
80682
|
-
matrixHeight: 1
|
|
80683
|
-
},
|
|
80684
|
-
{
|
|
80685
|
-
type: "TileMatrixType",
|
|
80686
|
-
identifier: "1",
|
|
80687
|
-
scaleDenominator: 279541132014358e-6,
|
|
80688
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80689
|
-
tileWidth: 256,
|
|
80690
|
-
tileHeight: 256,
|
|
80691
|
-
matrixWidth: 2,
|
|
80692
|
-
matrixHeight: 2
|
|
80693
|
-
},
|
|
80694
|
-
{
|
|
80695
|
-
type: "TileMatrixType",
|
|
80696
|
-
identifier: "2",
|
|
80697
|
-
scaleDenominator: 139770566007179e-6,
|
|
80698
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80699
|
-
tileWidth: 256,
|
|
80700
|
-
tileHeight: 256,
|
|
80701
|
-
matrixWidth: 4,
|
|
80702
|
-
matrixHeight: 4
|
|
80703
|
-
},
|
|
80704
|
-
{
|
|
80705
|
-
type: "TileMatrixType",
|
|
80706
|
-
identifier: "3",
|
|
80707
|
-
scaleDenominator: 698852830035897e-7,
|
|
80708
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80709
|
-
tileWidth: 256,
|
|
80710
|
-
tileHeight: 256,
|
|
80711
|
-
matrixWidth: 8,
|
|
80712
|
-
matrixHeight: 8
|
|
80713
|
-
},
|
|
80714
|
-
{
|
|
80715
|
-
type: "TileMatrixType",
|
|
80716
|
-
identifier: "4",
|
|
80717
|
-
scaleDenominator: 349426415017948e-7,
|
|
80718
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80719
|
-
tileWidth: 256,
|
|
80720
|
-
tileHeight: 256,
|
|
80721
|
-
matrixWidth: 16,
|
|
80722
|
-
matrixHeight: 16
|
|
80723
|
-
},
|
|
80724
|
-
{
|
|
80725
|
-
type: "TileMatrixType",
|
|
80726
|
-
identifier: "5",
|
|
80727
|
-
scaleDenominator: 174713207508974e-7,
|
|
80728
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80729
|
-
tileWidth: 256,
|
|
80730
|
-
tileHeight: 256,
|
|
80731
|
-
matrixWidth: 32,
|
|
80732
|
-
matrixHeight: 32
|
|
80733
|
-
},
|
|
80734
|
-
{
|
|
80735
|
-
type: "TileMatrixType",
|
|
80736
|
-
identifier: "6",
|
|
80737
|
-
scaleDenominator: 873566037544871e-8,
|
|
80738
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80739
|
-
tileWidth: 256,
|
|
80740
|
-
tileHeight: 256,
|
|
80741
|
-
matrixWidth: 64,
|
|
80742
|
-
matrixHeight: 64
|
|
80743
|
-
},
|
|
80744
|
-
{
|
|
80745
|
-
type: "TileMatrixType",
|
|
80746
|
-
identifier: "7",
|
|
80747
|
-
scaleDenominator: 436783018772435e-8,
|
|
80748
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80749
|
-
tileWidth: 256,
|
|
80750
|
-
tileHeight: 256,
|
|
80751
|
-
matrixWidth: 128,
|
|
80752
|
-
matrixHeight: 128
|
|
80753
|
-
},
|
|
80754
|
-
{
|
|
80755
|
-
type: "TileMatrixType",
|
|
80756
|
-
identifier: "8",
|
|
80757
|
-
scaleDenominator: 218391509386217e-8,
|
|
80758
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80759
|
-
tileWidth: 256,
|
|
80760
|
-
tileHeight: 256,
|
|
80761
|
-
matrixWidth: 256,
|
|
80762
|
-
matrixHeight: 256
|
|
80763
|
-
},
|
|
80764
|
-
{
|
|
80765
|
-
type: "TileMatrixType",
|
|
80766
|
-
identifier: "9",
|
|
80767
|
-
scaleDenominator: 109195754693108e-8,
|
|
80768
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80769
|
-
tileWidth: 256,
|
|
80770
|
-
tileHeight: 256,
|
|
80771
|
-
matrixWidth: 512,
|
|
80772
|
-
matrixHeight: 512
|
|
80773
|
-
},
|
|
80774
|
-
{
|
|
80775
|
-
type: "TileMatrixType",
|
|
80776
|
-
identifier: "10",
|
|
80777
|
-
scaleDenominator: 545978.773465544,
|
|
80778
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80779
|
-
tileWidth: 256,
|
|
80780
|
-
tileHeight: 256,
|
|
80781
|
-
matrixWidth: 1024,
|
|
80782
|
-
matrixHeight: 1024
|
|
80783
|
-
},
|
|
80784
|
-
{
|
|
80785
|
-
type: "TileMatrixType",
|
|
80786
|
-
identifier: "11",
|
|
80787
|
-
scaleDenominator: 272989.386732772,
|
|
80788
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80789
|
-
tileWidth: 256,
|
|
80790
|
-
tileHeight: 256,
|
|
80791
|
-
matrixWidth: 2048,
|
|
80792
|
-
matrixHeight: 2048
|
|
80793
|
-
},
|
|
80794
|
-
{
|
|
80795
|
-
type: "TileMatrixType",
|
|
80796
|
-
identifier: "12",
|
|
80797
|
-
scaleDenominator: 136494.693366386,
|
|
80798
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80799
|
-
tileWidth: 256,
|
|
80800
|
-
tileHeight: 256,
|
|
80801
|
-
matrixWidth: 4096,
|
|
80802
|
-
matrixHeight: 4096
|
|
80803
|
-
},
|
|
80804
|
-
{
|
|
80805
|
-
type: "TileMatrixType",
|
|
80806
|
-
identifier: "13",
|
|
80807
|
-
scaleDenominator: 68247.346683193,
|
|
80808
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80809
|
-
tileWidth: 256,
|
|
80810
|
-
tileHeight: 256,
|
|
80811
|
-
matrixWidth: 8192,
|
|
80812
|
-
matrixHeight: 8192
|
|
80813
|
-
},
|
|
80814
|
-
{
|
|
80815
|
-
type: "TileMatrixType",
|
|
80816
|
-
identifier: "14",
|
|
80817
|
-
scaleDenominator: 34123.6733415964,
|
|
80818
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80819
|
-
tileWidth: 256,
|
|
80820
|
-
tileHeight: 256,
|
|
80821
|
-
matrixWidth: 16384,
|
|
80822
|
-
matrixHeight: 16384
|
|
80823
|
-
},
|
|
80824
|
-
{
|
|
80825
|
-
type: "TileMatrixType",
|
|
80826
|
-
identifier: "15",
|
|
80827
|
-
scaleDenominator: 17061.8366707982,
|
|
80828
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80829
|
-
tileWidth: 256,
|
|
80830
|
-
tileHeight: 256,
|
|
80831
|
-
matrixWidth: 32768,
|
|
80832
|
-
matrixHeight: 32768
|
|
80833
|
-
},
|
|
80834
|
-
{
|
|
80835
|
-
type: "TileMatrixType",
|
|
80836
|
-
identifier: "16",
|
|
80837
|
-
scaleDenominator: 8530.91833539913,
|
|
80838
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80839
|
-
tileWidth: 256,
|
|
80840
|
-
tileHeight: 256,
|
|
80841
|
-
matrixWidth: 65536,
|
|
80842
|
-
matrixHeight: 65536
|
|
80843
|
-
},
|
|
80844
|
-
{
|
|
80845
|
-
type: "TileMatrixType",
|
|
80846
|
-
identifier: "17",
|
|
80847
|
-
scaleDenominator: 4265.45916769956,
|
|
80848
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80849
|
-
tileWidth: 256,
|
|
80850
|
-
tileHeight: 256,
|
|
80851
|
-
matrixWidth: 131072,
|
|
80852
|
-
matrixHeight: 131072
|
|
80853
|
-
},
|
|
80854
|
-
{
|
|
80855
|
-
type: "TileMatrixType",
|
|
80856
|
-
identifier: "18",
|
|
80857
|
-
scaleDenominator: 2132.72958384978,
|
|
80858
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80859
|
-
tileWidth: 256,
|
|
80860
|
-
tileHeight: 256,
|
|
80861
|
-
matrixWidth: 262144,
|
|
80862
|
-
matrixHeight: 262144
|
|
80863
|
-
},
|
|
80864
|
-
{
|
|
80865
|
-
type: "TileMatrixType",
|
|
80866
|
-
identifier: "19",
|
|
80867
|
-
scaleDenominator: 1066.36479192489,
|
|
80868
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80869
|
-
tileWidth: 256,
|
|
80870
|
-
tileHeight: 256,
|
|
80871
|
-
matrixWidth: 524288,
|
|
80872
|
-
matrixHeight: 524288
|
|
80873
|
-
},
|
|
80874
|
-
{
|
|
80875
|
-
type: "TileMatrixType",
|
|
80876
|
-
identifier: "20",
|
|
80877
|
-
scaleDenominator: 533.182395962445,
|
|
80878
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80879
|
-
tileWidth: 256,
|
|
80880
|
-
tileHeight: 256,
|
|
80881
|
-
matrixWidth: 1048576,
|
|
80882
|
-
matrixHeight: 1048576
|
|
80883
|
-
},
|
|
80884
|
-
{
|
|
80885
|
-
type: "TileMatrixType",
|
|
80886
|
-
identifier: "21",
|
|
80887
|
-
scaleDenominator: 266.591197981222,
|
|
80888
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80889
|
-
tileWidth: 256,
|
|
80890
|
-
tileHeight: 256,
|
|
80891
|
-
matrixWidth: 2097152,
|
|
80892
|
-
matrixHeight: 2097152
|
|
80893
|
-
},
|
|
80894
|
-
{
|
|
80895
|
-
type: "TileMatrixType",
|
|
80896
|
-
identifier: "22",
|
|
80897
|
-
scaleDenominator: 133.295598990611,
|
|
80898
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80899
|
-
tileWidth: 256,
|
|
80900
|
-
tileHeight: 256,
|
|
80901
|
-
matrixWidth: 4194304,
|
|
80902
|
-
matrixHeight: 4194304
|
|
80903
|
-
},
|
|
80904
|
-
{
|
|
80905
|
-
type: "TileMatrixType",
|
|
80906
|
-
identifier: "23",
|
|
80907
|
-
scaleDenominator: 66.6477994953056,
|
|
80908
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80909
|
-
tileWidth: 256,
|
|
80910
|
-
tileHeight: 256,
|
|
80911
|
-
matrixWidth: 8388608,
|
|
80912
|
-
matrixHeight: 8388608
|
|
80913
|
-
},
|
|
80914
|
-
{
|
|
80915
|
-
type: "TileMatrixType",
|
|
80916
|
-
identifier: "24",
|
|
80917
|
-
scaleDenominator: 33.3238997476528,
|
|
80918
|
-
topLeftCorner: [-200375083427892e-7, 200375083427892e-7],
|
|
80919
|
-
tileWidth: 256,
|
|
80920
|
-
tileHeight: 256,
|
|
80921
|
-
matrixWidth: 16777216,
|
|
80922
|
-
matrixHeight: 16777216
|
|
80923
|
-
}
|
|
80924
|
-
]
|
|
80925
|
-
};
|
|
80926
|
-
var GoogleTms = new TileMatrixSet(GoogleTmst);
|
|
80927
|
-
|
|
80928
81263
|
// ../geo/build/tms/nztm2000.js
|
|
80929
81264
|
var Nztm20002 = __toESM(require_src3(), 1);
|
|
80930
81265
|
var Nztm2000Tms = new TileMatrixSet(Nztm20002.Nztm2000);
|
|
@@ -83256,6 +83591,12 @@ var Queue = class {
|
|
|
83256
83591
|
__privateWrapper(this, _size)._--;
|
|
83257
83592
|
return current.value;
|
|
83258
83593
|
}
|
|
83594
|
+
peek() {
|
|
83595
|
+
if (!__privateGet(this, _head)) {
|
|
83596
|
+
return;
|
|
83597
|
+
}
|
|
83598
|
+
return __privateGet(this, _head).value;
|
|
83599
|
+
}
|
|
83259
83600
|
clear() {
|
|
83260
83601
|
__privateSet(this, _head, void 0);
|
|
83261
83602
|
__privateSet(this, _tail, void 0);
|
|
@@ -83271,6 +83612,11 @@ var Queue = class {
|
|
|
83271
83612
|
current = current.next;
|
|
83272
83613
|
}
|
|
83273
83614
|
}
|
|
83615
|
+
*drain() {
|
|
83616
|
+
while (__privateGet(this, _head)) {
|
|
83617
|
+
yield this.dequeue();
|
|
83618
|
+
}
|
|
83619
|
+
}
|
|
83274
83620
|
};
|
|
83275
83621
|
_head = new WeakMap();
|
|
83276
83622
|
_tail = new WeakMap();
|