@equinor/fusion-framework-vite-plugin-spa 3.0.1 → 3.0.3
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/CHANGELOG.md +16 -0
- package/dist/esm/version.js +1 -1
- package/dist/html/bootstrap.js +693 -456
- package/dist/html/bootstrap.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/html/index.html.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -4
- package/src/version.ts +1 -1
package/dist/html/bootstrap.js
CHANGED
|
@@ -2916,7 +2916,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
2916
2916
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2917
2917
|
};
|
|
2918
2918
|
|
|
2919
|
-
function isFunction(value) {
|
|
2919
|
+
function isFunction$1(value) {
|
|
2920
2920
|
return typeof value === 'function';
|
|
2921
2921
|
}
|
|
2922
2922
|
|
|
@@ -2984,7 +2984,7 @@ var Subscription = (function () {
|
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
var initialFinalizer = this.initialTeardown;
|
|
2987
|
-
if (isFunction(initialFinalizer)) {
|
|
2987
|
+
if (isFunction$1(initialFinalizer)) {
|
|
2988
2988
|
try {
|
|
2989
2989
|
initialFinalizer();
|
|
2990
2990
|
}
|
|
@@ -3076,10 +3076,10 @@ var Subscription = (function () {
|
|
|
3076
3076
|
var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
|
|
3077
3077
|
function isSubscription(value) {
|
|
3078
3078
|
return (value instanceof Subscription ||
|
|
3079
|
-
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
3079
|
+
(value && 'closed' in value && isFunction$1(value.remove) && isFunction$1(value.add) && isFunction$1(value.unsubscribe)));
|
|
3080
3080
|
}
|
|
3081
3081
|
function execFinalizer(finalizer) {
|
|
3082
|
-
if (isFunction(finalizer)) {
|
|
3082
|
+
if (isFunction$1(finalizer)) {
|
|
3083
3083
|
finalizer();
|
|
3084
3084
|
}
|
|
3085
3085
|
else {
|
|
@@ -3234,7 +3234,7 @@ var SafeSubscriber = (function (_super) {
|
|
|
3234
3234
|
function SafeSubscriber(observerOrNext, error, complete) {
|
|
3235
3235
|
var _this = _super.call(this) || this;
|
|
3236
3236
|
var partialObserver;
|
|
3237
|
-
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
3237
|
+
if (isFunction$1(observerOrNext) || !observerOrNext) {
|
|
3238
3238
|
partialObserver = {
|
|
3239
3239
|
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
3240
3240
|
error: error !== null && error !== void 0 ? error : undefined,
|
|
@@ -3372,14 +3372,14 @@ function getPromiseCtor(promiseCtor) {
|
|
|
3372
3372
|
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config$1.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
3373
3373
|
}
|
|
3374
3374
|
function isObserver(value) {
|
|
3375
|
-
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
3375
|
+
return value && isFunction$1(value.next) && isFunction$1(value.error) && isFunction$1(value.complete);
|
|
3376
3376
|
}
|
|
3377
3377
|
function isSubscriber(value) {
|
|
3378
3378
|
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
3379
3379
|
}
|
|
3380
3380
|
|
|
3381
3381
|
function hasLift(source) {
|
|
3382
|
-
return isFunction(source === null || source === void 0 ? void 0 : source.lift);
|
|
3382
|
+
return isFunction$1(source === null || source === void 0 ? void 0 : source.lift);
|
|
3383
3383
|
}
|
|
3384
3384
|
function operate(init) {
|
|
3385
3385
|
return function (source) {
|
|
@@ -3874,14 +3874,14 @@ var async = asyncScheduler;
|
|
|
3874
3874
|
var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });
|
|
3875
3875
|
|
|
3876
3876
|
function isScheduler(value) {
|
|
3877
|
-
return value && isFunction(value.schedule);
|
|
3877
|
+
return value && isFunction$1(value.schedule);
|
|
3878
3878
|
}
|
|
3879
3879
|
|
|
3880
3880
|
function last$1(arr) {
|
|
3881
3881
|
return arr[arr.length - 1];
|
|
3882
3882
|
}
|
|
3883
3883
|
function popResultSelector(args) {
|
|
3884
|
-
return isFunction(last$1(args)) ? args.pop() : undefined;
|
|
3884
|
+
return isFunction$1(last$1(args)) ? args.pop() : undefined;
|
|
3885
3885
|
}
|
|
3886
3886
|
function popScheduler(args) {
|
|
3887
3887
|
return isScheduler(last$1(args)) ? args.pop() : undefined;
|
|
@@ -3893,15 +3893,15 @@ function popNumber(args, defaultValue) {
|
|
|
3893
3893
|
var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
|
3894
3894
|
|
|
3895
3895
|
function isPromise(value) {
|
|
3896
|
-
return isFunction(value === null || value === void 0 ? void 0 : value.then);
|
|
3896
|
+
return isFunction$1(value === null || value === void 0 ? void 0 : value.then);
|
|
3897
3897
|
}
|
|
3898
3898
|
|
|
3899
3899
|
function isInteropObservable(input) {
|
|
3900
|
-
return isFunction(input[observable]);
|
|
3900
|
+
return isFunction$1(input[observable]);
|
|
3901
3901
|
}
|
|
3902
3902
|
|
|
3903
3903
|
function isAsyncIterable(obj) {
|
|
3904
|
-
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
|
|
3904
|
+
return Symbol.asyncIterator && isFunction$1(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
|
|
3905
3905
|
}
|
|
3906
3906
|
|
|
3907
3907
|
function createInvalidObservableTypeError(input) {
|
|
@@ -3917,7 +3917,7 @@ function getSymbolIterator() {
|
|
|
3917
3917
|
var iterator = getSymbolIterator();
|
|
3918
3918
|
|
|
3919
3919
|
function isIterable(input) {
|
|
3920
|
-
return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
|
|
3920
|
+
return isFunction$1(input === null || input === void 0 ? void 0 : input[iterator]);
|
|
3921
3921
|
}
|
|
3922
3922
|
|
|
3923
3923
|
function readableStreamLikeToAsyncGenerator(readableStream) {
|
|
@@ -3953,7 +3953,7 @@ function readableStreamLikeToAsyncGenerator(readableStream) {
|
|
|
3953
3953
|
});
|
|
3954
3954
|
}
|
|
3955
3955
|
function isReadableStreamLike(obj) {
|
|
3956
|
-
return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
|
|
3956
|
+
return isFunction$1(obj === null || obj === void 0 ? void 0 : obj.getReader);
|
|
3957
3957
|
}
|
|
3958
3958
|
|
|
3959
3959
|
function innerFrom(input) {
|
|
@@ -3985,7 +3985,7 @@ function innerFrom(input) {
|
|
|
3985
3985
|
function fromInteropObservable(obj) {
|
|
3986
3986
|
return new Observable(function (subscriber) {
|
|
3987
3987
|
var obs = obj[observable]();
|
|
3988
|
-
if (isFunction(obs.subscribe)) {
|
|
3988
|
+
if (isFunction$1(obs.subscribe)) {
|
|
3989
3989
|
return obs.subscribe(subscriber);
|
|
3990
3990
|
}
|
|
3991
3991
|
throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
|
@@ -4168,7 +4168,7 @@ function scheduleIterable(input, scheduler) {
|
|
|
4168
4168
|
}
|
|
4169
4169
|
}, 0, true);
|
|
4170
4170
|
});
|
|
4171
|
-
return function () { return isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return(); };
|
|
4171
|
+
return function () { return isFunction$1(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return(); };
|
|
4172
4172
|
});
|
|
4173
4173
|
}
|
|
4174
4174
|
|
|
@@ -4235,13 +4235,13 @@ function of() {
|
|
|
4235
4235
|
}
|
|
4236
4236
|
|
|
4237
4237
|
function throwError(errorOrErrorFactory, scheduler) {
|
|
4238
|
-
var errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : function () { return errorOrErrorFactory; };
|
|
4238
|
+
var errorFactory = isFunction$1(errorOrErrorFactory) ? errorOrErrorFactory : function () { return errorOrErrorFactory; };
|
|
4239
4239
|
var init = function (subscriber) { return subscriber.error(errorFactory()); };
|
|
4240
4240
|
return new Observable(init);
|
|
4241
4241
|
}
|
|
4242
4242
|
|
|
4243
4243
|
function isObservable(obj) {
|
|
4244
|
-
return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe)));
|
|
4244
|
+
return !!obj && (obj instanceof Observable || (isFunction$1(obj.lift) && isFunction$1(obj.subscribe)));
|
|
4245
4245
|
}
|
|
4246
4246
|
|
|
4247
4247
|
var EmptyError = createErrorClass(function (_super) {
|
|
@@ -4365,9 +4365,9 @@ function map$1(project, thisArg) {
|
|
|
4365
4365
|
});
|
|
4366
4366
|
}
|
|
4367
4367
|
|
|
4368
|
-
var isArray = Array.isArray;
|
|
4368
|
+
var isArray$1 = Array.isArray;
|
|
4369
4369
|
function callOrApply(fn, args) {
|
|
4370
|
-
return isArray(args) ? fn.apply(void 0, __spreadArray([], __read$1(args))) : fn(args);
|
|
4370
|
+
return isArray$1(args) ? fn.apply(void 0, __spreadArray([], __read$1(args))) : fn(args);
|
|
4371
4371
|
}
|
|
4372
4372
|
function mapOneOrManyArgs(fn) {
|
|
4373
4373
|
return map$1(function (args) { return callOrApply(fn, args); });
|
|
@@ -4431,7 +4431,7 @@ function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, e
|
|
|
4431
4431
|
|
|
4432
4432
|
function mergeMap(project, resultSelector, concurrent) {
|
|
4433
4433
|
if (concurrent === void 0) { concurrent = Infinity; }
|
|
4434
|
-
if (isFunction(resultSelector)) {
|
|
4434
|
+
if (isFunction$1(resultSelector)) {
|
|
4435
4435
|
return mergeMap(function (a, i) { return map$1(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);
|
|
4436
4436
|
}
|
|
4437
4437
|
else if (typeof resultSelector === 'number') {
|
|
@@ -4449,7 +4449,7 @@ var nodeEventEmitterMethods = ['addListener', 'removeListener'];
|
|
|
4449
4449
|
var eventTargetMethods = ['addEventListener', 'removeEventListener'];
|
|
4450
4450
|
var jqueryMethods = ['on', 'off'];
|
|
4451
4451
|
function fromEvent(target, eventName, options, resultSelector) {
|
|
4452
|
-
if (isFunction(options)) {
|
|
4452
|
+
if (isFunction$1(options)) {
|
|
4453
4453
|
resultSelector = options;
|
|
4454
4454
|
options = undefined;
|
|
4455
4455
|
}
|
|
@@ -4488,13 +4488,13 @@ function toCommonHandlerRegistry(target, eventName) {
|
|
|
4488
4488
|
return function (methodName) { return function (handler) { return target[methodName](eventName, handler); }; };
|
|
4489
4489
|
}
|
|
4490
4490
|
function isNodeStyleEventEmitter(target) {
|
|
4491
|
-
return isFunction(target.addListener) && isFunction(target.removeListener);
|
|
4491
|
+
return isFunction$1(target.addListener) && isFunction$1(target.removeListener);
|
|
4492
4492
|
}
|
|
4493
4493
|
function isJQueryStyleEventEmitter(target) {
|
|
4494
|
-
return isFunction(target.on) && isFunction(target.off);
|
|
4494
|
+
return isFunction$1(target.on) && isFunction$1(target.off);
|
|
4495
4495
|
}
|
|
4496
4496
|
function isEventTarget(target) {
|
|
4497
|
-
return isFunction(target.addEventListener) && isFunction(target.removeEventListener);
|
|
4497
|
+
return isFunction$1(target.addEventListener) && isFunction$1(target.removeEventListener);
|
|
4498
4498
|
}
|
|
4499
4499
|
|
|
4500
4500
|
function timer(dueTime, intervalOrScheduler, scheduler) {
|
|
@@ -4609,7 +4609,7 @@ function reduce(accumulator, seed) {
|
|
|
4609
4609
|
}
|
|
4610
4610
|
|
|
4611
4611
|
function concatMap(project, resultSelector) {
|
|
4612
|
-
return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
|
|
4612
|
+
return isFunction$1(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);
|
|
4613
4613
|
}
|
|
4614
4614
|
|
|
4615
4615
|
function defaultIfEmpty(defaultValue) {
|
|
@@ -4885,7 +4885,7 @@ function takeWhile(predicate, inclusive) {
|
|
|
4885
4885
|
}
|
|
4886
4886
|
|
|
4887
4887
|
function tap(observerOrNext, error, complete) {
|
|
4888
|
-
var tapObserver = isFunction(observerOrNext) || error || complete
|
|
4888
|
+
var tapObserver = isFunction$1(observerOrNext) || error || complete
|
|
4889
4889
|
?
|
|
4890
4890
|
{ next: observerOrNext, error: error, complete: complete }
|
|
4891
4891
|
: observerOrNext;
|
|
@@ -6181,21 +6181,30 @@ const NEVER = Object.freeze({
|
|
|
6181
6181
|
});
|
|
6182
6182
|
function $constructor(name, initializer, params) {
|
|
6183
6183
|
function init(inst, def) {
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6184
|
+
if (!inst._zod) {
|
|
6185
|
+
Object.defineProperty(inst, "_zod", {
|
|
6186
|
+
value: {
|
|
6187
|
+
def,
|
|
6188
|
+
constr: _,
|
|
6189
|
+
traits: new Set(),
|
|
6190
|
+
},
|
|
6191
|
+
enumerable: false,
|
|
6192
|
+
});
|
|
6193
|
+
}
|
|
6194
|
+
if (inst._zod.traits.has(name)) {
|
|
6195
|
+
return;
|
|
6196
|
+
}
|
|
6190
6197
|
inst._zod.traits.add(name);
|
|
6191
6198
|
initializer(inst, def);
|
|
6192
6199
|
// support prototype modifications
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6200
|
+
const proto = _.prototype;
|
|
6201
|
+
const keys = Object.keys(proto);
|
|
6202
|
+
for (let i = 0; i < keys.length; i++) {
|
|
6203
|
+
const k = keys[i];
|
|
6204
|
+
if (!(k in inst)) {
|
|
6205
|
+
inst[k] = proto[k].bind(inst);
|
|
6206
|
+
}
|
|
6196
6207
|
}
|
|
6197
|
-
inst._zod.constr = _;
|
|
6198
|
-
inst._zod.def = def;
|
|
6199
6208
|
}
|
|
6200
6209
|
// doesn't work if Parent has a constructor with arguments
|
|
6201
6210
|
const Parent = params?.Parent ?? Object;
|
|
@@ -6378,6 +6387,14 @@ function randomString(length = 10) {
|
|
|
6378
6387
|
function esc(str) {
|
|
6379
6388
|
return JSON.stringify(str);
|
|
6380
6389
|
}
|
|
6390
|
+
function slugify(input) {
|
|
6391
|
+
return input
|
|
6392
|
+
.toLowerCase()
|
|
6393
|
+
.trim()
|
|
6394
|
+
.replace(/[^\w\s-]/g, "")
|
|
6395
|
+
.replace(/[\s_-]+/g, "-")
|
|
6396
|
+
.replace(/^-+|-+$/g, "");
|
|
6397
|
+
}
|
|
6381
6398
|
const captureStackTrace = ("captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { });
|
|
6382
6399
|
function isObject(data) {
|
|
6383
6400
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
@@ -6403,6 +6420,8 @@ function isPlainObject$1(o) {
|
|
|
6403
6420
|
const ctor = o.constructor;
|
|
6404
6421
|
if (ctor === undefined)
|
|
6405
6422
|
return true;
|
|
6423
|
+
if (typeof ctor !== "function")
|
|
6424
|
+
return true;
|
|
6406
6425
|
// modified prototype
|
|
6407
6426
|
const prot = ctor.prototype;
|
|
6408
6427
|
if (isObject(prot) === false)
|
|
@@ -6900,6 +6919,7 @@ var util = /*#__PURE__*/Object.freeze({
|
|
|
6900
6919
|
required: required,
|
|
6901
6920
|
safeExtend: safeExtend,
|
|
6902
6921
|
shallowClone: shallowClone,
|
|
6922
|
+
slugify: slugify,
|
|
6903
6923
|
stringifyPrimitive: stringifyPrimitive,
|
|
6904
6924
|
uint8ArrayToBase64: uint8ArrayToBase64,
|
|
6905
6925
|
uint8ArrayToBase64url: uint8ArrayToBase64url,
|
|
@@ -7219,6 +7239,10 @@ function emoji$1() {
|
|
|
7219
7239
|
}
|
|
7220
7240
|
const ipv4$1 = /^(?:(?: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])$/;
|
|
7221
7241
|
const ipv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
7242
|
+
const mac$1 = (delimiter) => {
|
|
7243
|
+
const escapedDelim = escapeRegex(delimiter ?? ":");
|
|
7244
|
+
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
7245
|
+
};
|
|
7222
7246
|
const cidrv4$1 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
7223
7247
|
const cidrv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
7224
7248
|
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
@@ -7334,6 +7358,7 @@ var regexes = /*#__PURE__*/Object.freeze({
|
|
|
7334
7358
|
ipv6: ipv6$1,
|
|
7335
7359
|
ksuid: ksuid$1,
|
|
7336
7360
|
lowercase: lowercase,
|
|
7361
|
+
mac: mac$1,
|
|
7337
7362
|
md5_base64: md5_base64,
|
|
7338
7363
|
md5_base64url: md5_base64url,
|
|
7339
7364
|
md5_hex: md5_hex,
|
|
@@ -7972,7 +7997,7 @@ class Doc {
|
|
|
7972
7997
|
const version$7 = {
|
|
7973
7998
|
major: 4,
|
|
7974
7999
|
minor: 1,
|
|
7975
|
-
patch:
|
|
8000
|
+
patch: 13,
|
|
7976
8001
|
};
|
|
7977
8002
|
|
|
7978
8003
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
@@ -8175,7 +8200,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
|
8175
8200
|
code: "invalid_format",
|
|
8176
8201
|
format: "url",
|
|
8177
8202
|
note: "Invalid hostname",
|
|
8178
|
-
pattern: hostname
|
|
8203
|
+
pattern: def.hostname.source,
|
|
8179
8204
|
input: payload.value,
|
|
8180
8205
|
inst,
|
|
8181
8206
|
continue: !def.abort,
|
|
@@ -8265,18 +8290,12 @@ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def
|
|
|
8265
8290
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
8266
8291
|
def.pattern ?? (def.pattern = ipv4$1);
|
|
8267
8292
|
$ZodStringFormat.init(inst, def);
|
|
8268
|
-
inst._zod.
|
|
8269
|
-
const bag = inst._zod.bag;
|
|
8270
|
-
bag.format = `ipv4`;
|
|
8271
|
-
});
|
|
8293
|
+
inst._zod.bag.format = `ipv4`;
|
|
8272
8294
|
});
|
|
8273
8295
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
8274
8296
|
def.pattern ?? (def.pattern = ipv6$1);
|
|
8275
8297
|
$ZodStringFormat.init(inst, def);
|
|
8276
|
-
inst._zod.
|
|
8277
|
-
const bag = inst._zod.bag;
|
|
8278
|
-
bag.format = `ipv6`;
|
|
8279
|
-
});
|
|
8298
|
+
inst._zod.bag.format = `ipv6`;
|
|
8280
8299
|
inst._zod.check = (payload) => {
|
|
8281
8300
|
try {
|
|
8282
8301
|
// @ts-ignore
|
|
@@ -8294,6 +8313,11 @@ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
8294
8313
|
}
|
|
8295
8314
|
};
|
|
8296
8315
|
});
|
|
8316
|
+
const $ZodMAC = /*@__PURE__*/ $constructor("$ZodMAC", (inst, def) => {
|
|
8317
|
+
def.pattern ?? (def.pattern = mac$1(def.delimiter));
|
|
8318
|
+
$ZodStringFormat.init(inst, def);
|
|
8319
|
+
inst._zod.bag.format = `mac`;
|
|
8320
|
+
});
|
|
8297
8321
|
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
8298
8322
|
def.pattern ?? (def.pattern = cidrv4$1);
|
|
8299
8323
|
$ZodStringFormat.init(inst, def);
|
|
@@ -8346,9 +8370,7 @@ function isValidBase64(data) {
|
|
|
8346
8370
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
8347
8371
|
def.pattern ?? (def.pattern = base64$1);
|
|
8348
8372
|
$ZodStringFormat.init(inst, def);
|
|
8349
|
-
inst._zod.
|
|
8350
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
8351
|
-
});
|
|
8373
|
+
inst._zod.bag.contentEncoding = "base64";
|
|
8352
8374
|
inst._zod.check = (payload) => {
|
|
8353
8375
|
if (isValidBase64(payload.value))
|
|
8354
8376
|
return;
|
|
@@ -8372,9 +8394,7 @@ function isValidBase64URL(data) {
|
|
|
8372
8394
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
8373
8395
|
def.pattern ?? (def.pattern = base64url$1);
|
|
8374
8396
|
$ZodStringFormat.init(inst, def);
|
|
8375
|
-
inst._zod.
|
|
8376
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
8377
|
-
});
|
|
8397
|
+
inst._zod.bag.contentEncoding = "base64url";
|
|
8378
8398
|
inst._zod.check = (payload) => {
|
|
8379
8399
|
if (isValidBase64URL(payload.value))
|
|
8380
8400
|
return;
|
|
@@ -8472,9 +8492,9 @@ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
|
8472
8492
|
return payload;
|
|
8473
8493
|
};
|
|
8474
8494
|
});
|
|
8475
|
-
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$
|
|
8495
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
8476
8496
|
$ZodCheckNumberFormat.init(inst, def);
|
|
8477
|
-
$ZodNumber.init(inst, def); // no format
|
|
8497
|
+
$ZodNumber.init(inst, def); // no format checks
|
|
8478
8498
|
});
|
|
8479
8499
|
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
8480
8500
|
$ZodType.init(inst, def);
|
|
@@ -8517,7 +8537,7 @@ const $ZodBigInt = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
|
|
|
8517
8537
|
return payload;
|
|
8518
8538
|
};
|
|
8519
8539
|
});
|
|
8520
|
-
const $ZodBigIntFormat = /*@__PURE__*/ $constructor("$
|
|
8540
|
+
const $ZodBigIntFormat = /*@__PURE__*/ $constructor("$ZodBigIntFormat", (inst, def) => {
|
|
8521
8541
|
$ZodCheckBigIntFormat.init(inst, def);
|
|
8522
8542
|
$ZodBigInt.init(inst, def); // no format checks
|
|
8523
8543
|
});
|
|
@@ -8706,7 +8726,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
8706
8726
|
const keySet = def.keySet;
|
|
8707
8727
|
const _catchall = def.catchall._zod;
|
|
8708
8728
|
const t = _catchall.def.type;
|
|
8709
|
-
for (const key
|
|
8729
|
+
for (const key in input) {
|
|
8710
8730
|
if (keySet.has(key))
|
|
8711
8731
|
continue;
|
|
8712
8732
|
if (t === "never") {
|
|
@@ -9094,7 +9114,6 @@ function handleIntersectionResults(result, left, right) {
|
|
|
9094
9114
|
const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
9095
9115
|
$ZodType.init(inst, def);
|
|
9096
9116
|
const items = def.items;
|
|
9097
|
-
const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
|
|
9098
9117
|
inst._zod.parse = (payload, ctx) => {
|
|
9099
9118
|
const input = payload.value;
|
|
9100
9119
|
if (!Array.isArray(input)) {
|
|
@@ -9108,6 +9127,8 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
|
9108
9127
|
}
|
|
9109
9128
|
payload.value = [];
|
|
9110
9129
|
const proms = [];
|
|
9130
|
+
const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
|
|
9131
|
+
const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
|
|
9111
9132
|
if (!def.rest) {
|
|
9112
9133
|
const tooBig = input.length > items.length;
|
|
9113
9134
|
const tooSmall = input.length < optStart - 1;
|
|
@@ -9179,11 +9200,13 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9179
9200
|
return payload;
|
|
9180
9201
|
}
|
|
9181
9202
|
const proms = [];
|
|
9182
|
-
|
|
9183
|
-
|
|
9203
|
+
const values = def.keyType._zod.values;
|
|
9204
|
+
if (values) {
|
|
9184
9205
|
payload.value = {};
|
|
9206
|
+
const recordKeys = new Set();
|
|
9185
9207
|
for (const key of values) {
|
|
9186
9208
|
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
9209
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
9187
9210
|
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
9188
9211
|
if (result instanceof Promise) {
|
|
9189
9212
|
proms.push(result.then((result) => {
|
|
@@ -9203,7 +9226,7 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
9203
9226
|
}
|
|
9204
9227
|
let unrecognized;
|
|
9205
9228
|
for (const key in input) {
|
|
9206
|
-
if (!
|
|
9229
|
+
if (!recordKeys.has(key)) {
|
|
9207
9230
|
unrecognized = unrecognized ?? [];
|
|
9208
9231
|
unrecognized.push(key);
|
|
9209
9232
|
}
|
|
@@ -9387,13 +9410,14 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
9387
9410
|
if (def.values.length === 0) {
|
|
9388
9411
|
throw new Error("Cannot create literal schema with no valid values");
|
|
9389
9412
|
}
|
|
9390
|
-
|
|
9413
|
+
const values = new Set(def.values);
|
|
9414
|
+
inst._zod.values = values;
|
|
9391
9415
|
inst._zod.pattern = new RegExp(`^(${def.values
|
|
9392
9416
|
.map((o) => (typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)))
|
|
9393
9417
|
.join("|")})$`);
|
|
9394
9418
|
inst._zod.parse = (payload, _ctx) => {
|
|
9395
9419
|
const input = payload.value;
|
|
9396
|
-
if (
|
|
9420
|
+
if (values.has(input)) {
|
|
9397
9421
|
return payload;
|
|
9398
9422
|
}
|
|
9399
9423
|
payload.issues.push({
|
|
@@ -9721,8 +9745,8 @@ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
|
9721
9745
|
$ZodType.init(inst, def);
|
|
9722
9746
|
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
9723
9747
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
9724
|
-
defineLazy(inst._zod, "optin", () => def.innerType
|
|
9725
|
-
defineLazy(inst._zod, "optout", () => def.innerType
|
|
9748
|
+
defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
|
|
9749
|
+
defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
|
|
9726
9750
|
inst._zod.parse = (payload, ctx) => {
|
|
9727
9751
|
if (ctx.direction === "backward") {
|
|
9728
9752
|
return def.innerType._zod.run(payload, ctx);
|
|
@@ -9882,10 +9906,10 @@ const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
|
|
|
9882
9906
|
// return () => _innerType;
|
|
9883
9907
|
// });
|
|
9884
9908
|
defineLazy(inst._zod, "innerType", () => def.getter());
|
|
9885
|
-
defineLazy(inst._zod, "pattern", () => inst._zod.innerType
|
|
9886
|
-
defineLazy(inst._zod, "propValues", () => inst._zod.innerType
|
|
9887
|
-
defineLazy(inst._zod, "optin", () => inst._zod.innerType
|
|
9888
|
-
defineLazy(inst._zod, "optout", () => inst._zod.innerType
|
|
9909
|
+
defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
|
|
9910
|
+
defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
|
|
9911
|
+
defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
|
|
9912
|
+
defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
|
|
9889
9913
|
inst._zod.parse = (payload, ctx) => {
|
|
9890
9914
|
const inner = inst._zod.innerType;
|
|
9891
9915
|
return inner._zod.run(payload, ctx);
|
|
@@ -10997,6 +11021,7 @@ const error$A = () => {
|
|
|
10997
11021
|
duration: "ISO duration",
|
|
10998
11022
|
ipv4: "IPv4 address",
|
|
10999
11023
|
ipv6: "IPv6 address",
|
|
11024
|
+
mac: "MAC address",
|
|
11000
11025
|
cidrv4: "IPv4 range",
|
|
11001
11026
|
cidrv6: "IPv6 range",
|
|
11002
11027
|
base64: "base64-encoded string",
|
|
@@ -11806,111 +11831,222 @@ function frCA () {
|
|
|
11806
11831
|
}
|
|
11807
11832
|
|
|
11808
11833
|
const error$t = () => {
|
|
11834
|
+
// Hebrew labels + grammatical gender
|
|
11835
|
+
const TypeNames = {
|
|
11836
|
+
string: { label: "מחרוזת", gender: "f" },
|
|
11837
|
+
number: { label: "מספר", gender: "m" },
|
|
11838
|
+
boolean: { label: "ערך בוליאני", gender: "m" },
|
|
11839
|
+
bigint: { label: "BigInt", gender: "m" },
|
|
11840
|
+
date: { label: "תאריך", gender: "m" },
|
|
11841
|
+
array: { label: "מערך", gender: "m" },
|
|
11842
|
+
object: { label: "אובייקט", gender: "m" },
|
|
11843
|
+
null: { label: "ערך ריק (null)", gender: "m" },
|
|
11844
|
+
undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" },
|
|
11845
|
+
symbol: { label: "סימבול (Symbol)", gender: "m" },
|
|
11846
|
+
function: { label: "פונקציה", gender: "f" },
|
|
11847
|
+
map: { label: "מפה (Map)", gender: "f" },
|
|
11848
|
+
set: { label: "קבוצה (Set)", gender: "f" },
|
|
11849
|
+
file: { label: "קובץ", gender: "m" },
|
|
11850
|
+
promise: { label: "Promise", gender: "m" },
|
|
11851
|
+
NaN: { label: "NaN", gender: "m" },
|
|
11852
|
+
unknown: { label: "ערך לא ידוע", gender: "m" },
|
|
11853
|
+
value: { label: "ערך", gender: "m" },
|
|
11854
|
+
};
|
|
11855
|
+
// Sizing units for size-related messages + localized origin labels
|
|
11809
11856
|
const Sizable = {
|
|
11810
|
-
string: { unit: "
|
|
11811
|
-
file: { unit: "בייטים",
|
|
11812
|
-
array: { unit: "פריטים",
|
|
11813
|
-
set: { unit: "פריטים",
|
|
11814
|
-
|
|
11815
|
-
|
|
11857
|
+
string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" },
|
|
11858
|
+
file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" },
|
|
11859
|
+
array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
|
|
11860
|
+
set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
|
|
11861
|
+
number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }, // no unit
|
|
11862
|
+
};
|
|
11863
|
+
// Helpers — labels, articles, and verbs
|
|
11864
|
+
const typeEntry = (t) => (t ? TypeNames[t] : undefined);
|
|
11865
|
+
const typeLabel = (t) => {
|
|
11866
|
+
const e = typeEntry(t);
|
|
11867
|
+
if (e)
|
|
11868
|
+
return e.label;
|
|
11869
|
+
// fallback: show raw string if unknown
|
|
11870
|
+
return t ?? TypeNames.unknown.label;
|
|
11871
|
+
};
|
|
11872
|
+
const withDefinite = (t) => `ה${typeLabel(t)}`;
|
|
11873
|
+
const verbFor = (t) => {
|
|
11874
|
+
const e = typeEntry(t);
|
|
11875
|
+
const gender = e?.gender ?? "m";
|
|
11876
|
+
return gender === "f" ? "צריכה להיות" : "צריך להיות";
|
|
11877
|
+
};
|
|
11878
|
+
const getSizing = (origin) => {
|
|
11879
|
+
if (!origin)
|
|
11880
|
+
return null;
|
|
11816
11881
|
return Sizable[origin] ?? null;
|
|
11817
|
-
}
|
|
11882
|
+
};
|
|
11883
|
+
// Robust type parser for "received" — returns a key we understand or a constructor name
|
|
11818
11884
|
const parsedType = (data) => {
|
|
11819
11885
|
const t = typeof data;
|
|
11820
11886
|
switch (t) {
|
|
11821
|
-
case "number":
|
|
11887
|
+
case "number":
|
|
11822
11888
|
return Number.isNaN(data) ? "NaN" : "number";
|
|
11823
|
-
}
|
|
11824
11889
|
case "object": {
|
|
11825
|
-
if (Array.isArray(data))
|
|
11890
|
+
if (Array.isArray(data))
|
|
11826
11891
|
return "array";
|
|
11827
|
-
|
|
11828
|
-
if (data === null) {
|
|
11892
|
+
if (data === null)
|
|
11829
11893
|
return "null";
|
|
11830
|
-
}
|
|
11831
11894
|
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
|
|
11832
|
-
return data.constructor.name;
|
|
11895
|
+
return data.constructor.name; // keep as-is (e.g., "Date")
|
|
11833
11896
|
}
|
|
11897
|
+
return "object";
|
|
11834
11898
|
}
|
|
11899
|
+
default:
|
|
11900
|
+
return t;
|
|
11835
11901
|
}
|
|
11836
|
-
return t;
|
|
11837
11902
|
};
|
|
11838
11903
|
const Nouns = {
|
|
11839
|
-
regex: "קלט",
|
|
11840
|
-
email: "כתובת אימייל",
|
|
11841
|
-
url: "כתובת רשת",
|
|
11842
|
-
emoji: "אימוג'י",
|
|
11843
|
-
uuid: "UUID",
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11904
|
+
regex: { label: "קלט", gender: "m" },
|
|
11905
|
+
email: { label: "כתובת אימייל", gender: "f" },
|
|
11906
|
+
url: { label: "כתובת רשת", gender: "f" },
|
|
11907
|
+
emoji: { label: "אימוג'י", gender: "m" },
|
|
11908
|
+
uuid: { label: "UUID", gender: "m" },
|
|
11909
|
+
nanoid: { label: "nanoid", gender: "m" },
|
|
11910
|
+
guid: { label: "GUID", gender: "m" },
|
|
11911
|
+
cuid: { label: "cuid", gender: "m" },
|
|
11912
|
+
cuid2: { label: "cuid2", gender: "m" },
|
|
11913
|
+
ulid: { label: "ULID", gender: "m" },
|
|
11914
|
+
xid: { label: "XID", gender: "m" },
|
|
11915
|
+
ksuid: { label: "KSUID", gender: "m" },
|
|
11916
|
+
datetime: { label: "תאריך וזמן ISO", gender: "m" },
|
|
11917
|
+
date: { label: "תאריך ISO", gender: "m" },
|
|
11918
|
+
time: { label: "זמן ISO", gender: "m" },
|
|
11919
|
+
duration: { label: "משך זמן ISO", gender: "m" },
|
|
11920
|
+
ipv4: { label: "כתובת IPv4", gender: "f" },
|
|
11921
|
+
ipv6: { label: "כתובת IPv6", gender: "f" },
|
|
11922
|
+
cidrv4: { label: "טווח IPv4", gender: "m" },
|
|
11923
|
+
cidrv6: { label: "טווח IPv6", gender: "m" },
|
|
11924
|
+
base64: { label: "מחרוזת בבסיס 64", gender: "f" },
|
|
11925
|
+
base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" },
|
|
11926
|
+
json_string: { label: "מחרוזת JSON", gender: "f" },
|
|
11927
|
+
e164: { label: "מספר E.164", gender: "m" },
|
|
11928
|
+
jwt: { label: "JWT", gender: "m" },
|
|
11929
|
+
ends_with: { label: "קלט", gender: "m" },
|
|
11930
|
+
includes: { label: "קלט", gender: "m" },
|
|
11931
|
+
lowercase: { label: "קלט", gender: "m" },
|
|
11932
|
+
starts_with: { label: "קלט", gender: "m" },
|
|
11933
|
+
uppercase: { label: "קלט", gender: "m" },
|
|
11867
11934
|
};
|
|
11868
11935
|
return (issue) => {
|
|
11869
11936
|
switch (issue.code) {
|
|
11870
|
-
case "invalid_type":
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
if
|
|
11875
|
-
|
|
11876
|
-
|
|
11937
|
+
case "invalid_type": {
|
|
11938
|
+
// Expected type: show without definite article for clearer Hebrew
|
|
11939
|
+
const expectedKey = issue.expected;
|
|
11940
|
+
const expected = typeLabel(expectedKey);
|
|
11941
|
+
// Received: show localized label if known, otherwise constructor/raw
|
|
11942
|
+
const receivedKey = parsedType(issue.input);
|
|
11943
|
+
const received = TypeNames[receivedKey]?.label ?? receivedKey;
|
|
11944
|
+
return `קלט לא תקין: צריך להיות ${expected}, התקבל ${received}`;
|
|
11945
|
+
}
|
|
11946
|
+
case "invalid_value": {
|
|
11947
|
+
if (issue.values.length === 1) {
|
|
11948
|
+
return `ערך לא תקין: הערך חייב להיות ${stringifyPrimitive(issue.values[0])}`;
|
|
11949
|
+
}
|
|
11950
|
+
// Join values with proper Hebrew formatting
|
|
11951
|
+
const stringified = issue.values.map((v) => stringifyPrimitive(v));
|
|
11952
|
+
if (issue.values.length === 2) {
|
|
11953
|
+
return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`;
|
|
11954
|
+
}
|
|
11955
|
+
// For 3+ values: "a", "b" או "c"
|
|
11956
|
+
const lastValue = stringified[stringified.length - 1];
|
|
11957
|
+
const restValues = stringified.slice(0, -1).join(", ");
|
|
11958
|
+
return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`;
|
|
11959
|
+
}
|
|
11877
11960
|
case "too_big": {
|
|
11878
|
-
const adj = issue.inclusive ? "<=" : "<";
|
|
11879
11961
|
const sizing = getSizing(issue.origin);
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11962
|
+
const subject = withDefinite(issue.origin ?? "value");
|
|
11963
|
+
if (issue.origin === "string") {
|
|
11964
|
+
// Special handling for strings - more natural Hebrew
|
|
11965
|
+
return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue.maximum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או פחות" : "לכל היותר"}`.trim();
|
|
11966
|
+
}
|
|
11967
|
+
if (issue.origin === "number") {
|
|
11968
|
+
// Natural Hebrew for numbers
|
|
11969
|
+
const comparison = issue.inclusive ? `קטן או שווה ל-${issue.maximum}` : `קטן מ-${issue.maximum}`;
|
|
11970
|
+
return `גדול מדי: ${subject} צריך להיות ${comparison}`;
|
|
11971
|
+
}
|
|
11972
|
+
if (issue.origin === "array" || issue.origin === "set") {
|
|
11973
|
+
// Natural Hebrew for arrays and sets
|
|
11974
|
+
const verb = issue.origin === "set" ? "צריכה" : "צריך";
|
|
11975
|
+
const comparison = issue.inclusive
|
|
11976
|
+
? `${issue.maximum} ${sizing?.unit ?? ""} או פחות`
|
|
11977
|
+
: `פחות מ-${issue.maximum} ${sizing?.unit ?? ""}`;
|
|
11978
|
+
return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
|
|
11979
|
+
}
|
|
11980
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
11981
|
+
const be = verbFor(issue.origin ?? "value");
|
|
11982
|
+
if (sizing?.unit) {
|
|
11983
|
+
return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
|
|
11984
|
+
}
|
|
11985
|
+
return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()}`;
|
|
11883
11986
|
}
|
|
11884
11987
|
case "too_small": {
|
|
11885
|
-
const adj = issue.inclusive ? ">=" : ">";
|
|
11886
11988
|
const sizing = getSizing(issue.origin);
|
|
11887
|
-
|
|
11888
|
-
|
|
11989
|
+
const subject = withDefinite(issue.origin ?? "value");
|
|
11990
|
+
if (issue.origin === "string") {
|
|
11991
|
+
// Special handling for strings - more natural Hebrew
|
|
11992
|
+
return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue.minimum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או יותר" : "לפחות"}`.trim();
|
|
11993
|
+
}
|
|
11994
|
+
if (issue.origin === "number") {
|
|
11995
|
+
// Natural Hebrew for numbers
|
|
11996
|
+
const comparison = issue.inclusive ? `גדול או שווה ל-${issue.minimum}` : `גדול מ-${issue.minimum}`;
|
|
11997
|
+
return `קטן מדי: ${subject} צריך להיות ${comparison}`;
|
|
11998
|
+
}
|
|
11999
|
+
if (issue.origin === "array" || issue.origin === "set") {
|
|
12000
|
+
// Natural Hebrew for arrays and sets
|
|
12001
|
+
const verb = issue.origin === "set" ? "צריכה" : "צריך";
|
|
12002
|
+
// Special case for singular (minimum === 1)
|
|
12003
|
+
if (issue.minimum === 1 && issue.inclusive) {
|
|
12004
|
+
const singularPhrase = issue.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד";
|
|
12005
|
+
return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`;
|
|
12006
|
+
}
|
|
12007
|
+
const comparison = issue.inclusive
|
|
12008
|
+
? `${issue.minimum} ${sizing?.unit ?? ""} או יותר`
|
|
12009
|
+
: `יותר מ-${issue.minimum} ${sizing?.unit ?? ""}`;
|
|
12010
|
+
return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
|
|
11889
12011
|
}
|
|
11890
|
-
|
|
12012
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
12013
|
+
const be = verbFor(issue.origin ?? "value");
|
|
12014
|
+
if (sizing?.unit) {
|
|
12015
|
+
return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
12016
|
+
}
|
|
12017
|
+
return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()}`;
|
|
11891
12018
|
}
|
|
11892
12019
|
case "invalid_format": {
|
|
11893
12020
|
const _issue = issue;
|
|
12021
|
+
// These apply to strings — use feminine grammar + ה׳ הידיעה
|
|
11894
12022
|
if (_issue.format === "starts_with")
|
|
11895
|
-
return
|
|
12023
|
+
return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`;
|
|
11896
12024
|
if (_issue.format === "ends_with")
|
|
11897
|
-
return
|
|
12025
|
+
return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`;
|
|
11898
12026
|
if (_issue.format === "includes")
|
|
11899
|
-
return
|
|
12027
|
+
return `המחרוזת חייבת לכלול "${_issue.includes}"`;
|
|
11900
12028
|
if (_issue.format === "regex")
|
|
11901
|
-
return
|
|
11902
|
-
|
|
12029
|
+
return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`;
|
|
12030
|
+
// Handle gender agreement for formats
|
|
12031
|
+
const nounEntry = Nouns[_issue.format];
|
|
12032
|
+
const noun = nounEntry?.label ?? _issue.format;
|
|
12033
|
+
const gender = nounEntry?.gender ?? "m";
|
|
12034
|
+
const adjective = gender === "f" ? "תקינה" : "תקין";
|
|
12035
|
+
return `${noun} לא ${adjective}`;
|
|
11903
12036
|
}
|
|
11904
12037
|
case "not_multiple_of":
|
|
11905
12038
|
return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
|
|
11906
12039
|
case "unrecognized_keys":
|
|
11907
12040
|
return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${joinValues(issue.keys, ", ")}`;
|
|
11908
|
-
case "invalid_key":
|
|
11909
|
-
return
|
|
12041
|
+
case "invalid_key": {
|
|
12042
|
+
return `שדה לא תקין באובייקט`;
|
|
12043
|
+
}
|
|
11910
12044
|
case "invalid_union":
|
|
11911
12045
|
return "קלט לא תקין";
|
|
11912
|
-
case "invalid_element":
|
|
11913
|
-
|
|
12046
|
+
case "invalid_element": {
|
|
12047
|
+
const place = withDefinite(issue.origin ?? "array");
|
|
12048
|
+
return `ערך לא תקין ב${place}`;
|
|
12049
|
+
}
|
|
11914
12050
|
default:
|
|
11915
12051
|
return `קלט לא תקין`;
|
|
11916
12052
|
}
|
|
@@ -13338,10 +13474,10 @@ function ms () {
|
|
|
13338
13474
|
|
|
13339
13475
|
const error$h = () => {
|
|
13340
13476
|
const Sizable = {
|
|
13341
|
-
string: { unit: "tekens" },
|
|
13342
|
-
file: { unit: "bytes" },
|
|
13343
|
-
array: { unit: "elementen" },
|
|
13344
|
-
set: { unit: "elementen" },
|
|
13477
|
+
string: { unit: "tekens", verb: "te hebben" },
|
|
13478
|
+
file: { unit: "bytes", verb: "te hebben" },
|
|
13479
|
+
array: { unit: "elementen", verb: "te hebben" },
|
|
13480
|
+
set: { unit: "elementen", verb: "te hebben" },
|
|
13345
13481
|
};
|
|
13346
13482
|
function getSizing(origin) {
|
|
13347
13483
|
return Sizable[origin] ?? null;
|
|
@@ -13408,16 +13544,16 @@ const error$h = () => {
|
|
|
13408
13544
|
const adj = issue.inclusive ? "<=" : "<";
|
|
13409
13545
|
const sizing = getSizing(issue.origin);
|
|
13410
13546
|
if (sizing)
|
|
13411
|
-
return `Te
|
|
13412
|
-
return `Te
|
|
13547
|
+
return `Te groot: verwacht dat ${issue.origin ?? "waarde"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"}`;
|
|
13548
|
+
return `Te groot: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
|
|
13413
13549
|
}
|
|
13414
13550
|
case "too_small": {
|
|
13415
13551
|
const adj = issue.inclusive ? ">=" : ">";
|
|
13416
13552
|
const sizing = getSizing(issue.origin);
|
|
13417
13553
|
if (sizing) {
|
|
13418
|
-
return `Te
|
|
13554
|
+
return `Te klein: verwacht dat ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
13419
13555
|
}
|
|
13420
|
-
return `Te
|
|
13556
|
+
return `Te klein: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
|
|
13421
13557
|
}
|
|
13422
13558
|
case "invalid_format": {
|
|
13423
13559
|
const _issue = issue;
|
|
@@ -15543,6 +15679,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
15543
15679
|
zhTW: zhTW
|
|
15544
15680
|
});
|
|
15545
15681
|
|
|
15682
|
+
var _a;
|
|
15546
15683
|
const $output = Symbol("ZodOutput");
|
|
15547
15684
|
const $input = Symbol("ZodInput");
|
|
15548
15685
|
class $ZodRegistry {
|
|
@@ -15594,7 +15731,8 @@ class $ZodRegistry {
|
|
|
15594
15731
|
function registry() {
|
|
15595
15732
|
return new $ZodRegistry();
|
|
15596
15733
|
}
|
|
15597
|
-
|
|
15734
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
15735
|
+
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
15598
15736
|
|
|
15599
15737
|
function _string(Class, params) {
|
|
15600
15738
|
return new Class({
|
|
@@ -15756,6 +15894,15 @@ function _ipv6(Class, params) {
|
|
|
15756
15894
|
...normalizeParams(params),
|
|
15757
15895
|
});
|
|
15758
15896
|
}
|
|
15897
|
+
function _mac(Class, params) {
|
|
15898
|
+
return new Class({
|
|
15899
|
+
type: "string",
|
|
15900
|
+
format: "mac",
|
|
15901
|
+
check: "string_format",
|
|
15902
|
+
abort: false,
|
|
15903
|
+
...normalizeParams(params),
|
|
15904
|
+
});
|
|
15905
|
+
}
|
|
15759
15906
|
function _cidrv4(Class, params) {
|
|
15760
15907
|
return new Class({
|
|
15761
15908
|
type: "string",
|
|
@@ -16196,6 +16343,10 @@ function _toLowerCase() {
|
|
|
16196
16343
|
function _toUpperCase() {
|
|
16197
16344
|
return _overwrite((input) => input.toUpperCase());
|
|
16198
16345
|
}
|
|
16346
|
+
// slugify
|
|
16347
|
+
function _slugify() {
|
|
16348
|
+
return _overwrite((input) => slugify(input));
|
|
16349
|
+
}
|
|
16199
16350
|
function _array(Class, element, params) {
|
|
16200
16351
|
return new Class({
|
|
16201
16352
|
type: "array",
|
|
@@ -16443,6 +16594,28 @@ function _check(fn, params) {
|
|
|
16443
16594
|
ch._zod.check = fn;
|
|
16444
16595
|
return ch;
|
|
16445
16596
|
}
|
|
16597
|
+
function describe$1(description) {
|
|
16598
|
+
const ch = new $ZodCheck({ check: "describe" });
|
|
16599
|
+
ch._zod.onattach = [
|
|
16600
|
+
(inst) => {
|
|
16601
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
16602
|
+
globalRegistry.add(inst, { ...existing, description });
|
|
16603
|
+
},
|
|
16604
|
+
];
|
|
16605
|
+
ch._zod.check = () => { }; // no-op check
|
|
16606
|
+
return ch;
|
|
16607
|
+
}
|
|
16608
|
+
function meta$1(metadata) {
|
|
16609
|
+
const ch = new $ZodCheck({ check: "meta" });
|
|
16610
|
+
ch._zod.onattach = [
|
|
16611
|
+
(inst) => {
|
|
16612
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
16613
|
+
globalRegistry.add(inst, { ...existing, ...metadata });
|
|
16614
|
+
},
|
|
16615
|
+
];
|
|
16616
|
+
ch._zod.check = () => { }; // no-op check
|
|
16617
|
+
return ch;
|
|
16618
|
+
}
|
|
16446
16619
|
function _stringbool(Classes, _params) {
|
|
16447
16620
|
const params = normalizeParams(_params);
|
|
16448
16621
|
let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
|
|
@@ -16761,11 +16934,19 @@ class JSONSchemaGenerator {
|
|
|
16761
16934
|
}
|
|
16762
16935
|
case "union": {
|
|
16763
16936
|
const json = _json;
|
|
16937
|
+
// Discriminated unions use oneOf (exactly one match) instead of anyOf (one or more matches)
|
|
16938
|
+
// because the discriminator field ensures mutual exclusivity between options in JSON Schema
|
|
16939
|
+
const isDiscriminated = def.discriminator !== undefined;
|
|
16764
16940
|
const options = def.options.map((x, i) => this.process(x, {
|
|
16765
16941
|
...params,
|
|
16766
|
-
path: [...params.path, "anyOf", i],
|
|
16942
|
+
path: [...params.path, isDiscriminated ? "oneOf" : "anyOf", i],
|
|
16767
16943
|
}));
|
|
16768
|
-
|
|
16944
|
+
if (isDiscriminated) {
|
|
16945
|
+
json.oneOf = options;
|
|
16946
|
+
}
|
|
16947
|
+
else {
|
|
16948
|
+
json.anyOf = options;
|
|
16949
|
+
}
|
|
16769
16950
|
break;
|
|
16770
16951
|
}
|
|
16771
16952
|
case "intersection": {
|
|
@@ -17318,100 +17499,57 @@ function isTransforming(_schema, _ctx) {
|
|
|
17318
17499
|
if (ctx.seen.has(_schema))
|
|
17319
17500
|
return false;
|
|
17320
17501
|
ctx.seen.add(_schema);
|
|
17321
|
-
const
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
}
|
|
17352
|
-
case "union": {
|
|
17353
|
-
for (const option of def.options) {
|
|
17354
|
-
if (isTransforming(option, ctx))
|
|
17355
|
-
return true;
|
|
17356
|
-
}
|
|
17357
|
-
return false;
|
|
17358
|
-
}
|
|
17359
|
-
case "intersection": {
|
|
17360
|
-
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
17361
|
-
}
|
|
17362
|
-
case "tuple": {
|
|
17363
|
-
for (const item of def.items) {
|
|
17364
|
-
if (isTransforming(item, ctx))
|
|
17365
|
-
return true;
|
|
17366
|
-
}
|
|
17367
|
-
if (def.rest && isTransforming(def.rest, ctx))
|
|
17502
|
+
const def = _schema._zod.def;
|
|
17503
|
+
if (def.type === "transform")
|
|
17504
|
+
return true;
|
|
17505
|
+
if (def.type === "array")
|
|
17506
|
+
return isTransforming(def.element, ctx);
|
|
17507
|
+
if (def.type === "set")
|
|
17508
|
+
return isTransforming(def.valueType, ctx);
|
|
17509
|
+
if (def.type === "lazy")
|
|
17510
|
+
return isTransforming(def.getter(), ctx);
|
|
17511
|
+
if (def.type === "promise" ||
|
|
17512
|
+
def.type === "optional" ||
|
|
17513
|
+
def.type === "nonoptional" ||
|
|
17514
|
+
def.type === "nullable" ||
|
|
17515
|
+
def.type === "readonly" ||
|
|
17516
|
+
def.type === "default" ||
|
|
17517
|
+
def.type === "prefault") {
|
|
17518
|
+
return isTransforming(def.innerType, ctx);
|
|
17519
|
+
}
|
|
17520
|
+
if (def.type === "intersection") {
|
|
17521
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
17522
|
+
}
|
|
17523
|
+
if (def.type === "record" || def.type === "map") {
|
|
17524
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
17525
|
+
}
|
|
17526
|
+
if (def.type === "pipe") {
|
|
17527
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
17528
|
+
}
|
|
17529
|
+
if (def.type === "object") {
|
|
17530
|
+
for (const key in def.shape) {
|
|
17531
|
+
if (isTransforming(def.shape[key], ctx))
|
|
17368
17532
|
return true;
|
|
17369
|
-
return false;
|
|
17370
|
-
}
|
|
17371
|
-
case "record": {
|
|
17372
|
-
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
17373
|
-
}
|
|
17374
|
-
case "map": {
|
|
17375
|
-
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
17376
|
-
}
|
|
17377
|
-
case "set": {
|
|
17378
|
-
return isTransforming(def.valueType, ctx);
|
|
17379
17533
|
}
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
return isTransforming(def.innerType, ctx);
|
|
17387
|
-
case "lazy":
|
|
17388
|
-
return isTransforming(def.getter(), ctx);
|
|
17389
|
-
case "default": {
|
|
17390
|
-
return isTransforming(def.innerType, ctx);
|
|
17391
|
-
}
|
|
17392
|
-
case "prefault": {
|
|
17393
|
-
return isTransforming(def.innerType, ctx);
|
|
17534
|
+
return false;
|
|
17535
|
+
}
|
|
17536
|
+
if (def.type === "union") {
|
|
17537
|
+
for (const option of def.options) {
|
|
17538
|
+
if (isTransforming(option, ctx))
|
|
17539
|
+
return true;
|
|
17394
17540
|
}
|
|
17395
|
-
|
|
17396
|
-
|
|
17541
|
+
return false;
|
|
17542
|
+
}
|
|
17543
|
+
if (def.type === "tuple") {
|
|
17544
|
+
for (const item of def.items) {
|
|
17545
|
+
if (isTransforming(item, ctx))
|
|
17546
|
+
return true;
|
|
17397
17547
|
}
|
|
17398
|
-
|
|
17548
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
17399
17549
|
return true;
|
|
17400
|
-
|
|
17401
|
-
case "pipe": {
|
|
17402
|
-
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
17403
|
-
}
|
|
17404
|
-
case "success": {
|
|
17405
|
-
return false;
|
|
17406
|
-
}
|
|
17407
|
-
case "catch": {
|
|
17408
|
-
return false;
|
|
17409
|
-
}
|
|
17410
|
-
case "function": {
|
|
17411
|
-
return false;
|
|
17412
|
-
}
|
|
17550
|
+
return false;
|
|
17413
17551
|
}
|
|
17414
|
-
|
|
17552
|
+
return false;
|
|
17415
17553
|
}
|
|
17416
17554
|
|
|
17417
17555
|
var jsonSchema = /*#__PURE__*/Object.freeze({
|
|
@@ -17481,6 +17619,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
17481
17619
|
$ZodKSUID: $ZodKSUID,
|
|
17482
17620
|
$ZodLazy: $ZodLazy,
|
|
17483
17621
|
$ZodLiteral: $ZodLiteral,
|
|
17622
|
+
$ZodMAC: $ZodMAC,
|
|
17484
17623
|
$ZodMap: $ZodMap,
|
|
17485
17624
|
$ZodNaN: $ZodNaN,
|
|
17486
17625
|
$ZodNanoID: $ZodNanoID,
|
|
@@ -17581,6 +17720,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
17581
17720
|
_lowercase: _lowercase,
|
|
17582
17721
|
_lt: _lt,
|
|
17583
17722
|
_lte: _lte,
|
|
17723
|
+
_mac: _mac,
|
|
17584
17724
|
_map: _map,
|
|
17585
17725
|
_max: _lte,
|
|
17586
17726
|
_maxLength: _maxLength,
|
|
@@ -17622,6 +17762,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
17622
17762
|
_safeParseAsync: _safeParseAsync,
|
|
17623
17763
|
_set: _set,
|
|
17624
17764
|
_size: _size,
|
|
17765
|
+
_slugify: _slugify,
|
|
17625
17766
|
_startsWith: _startsWith,
|
|
17626
17767
|
_string: _string,
|
|
17627
17768
|
_stringFormat: _stringFormat,
|
|
@@ -17653,6 +17794,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
17653
17794
|
config: config,
|
|
17654
17795
|
decode: decode$1,
|
|
17655
17796
|
decodeAsync: decodeAsync$1,
|
|
17797
|
+
describe: describe$1,
|
|
17656
17798
|
encode: encode$1,
|
|
17657
17799
|
encodeAsync: encodeAsync$1,
|
|
17658
17800
|
flattenError: flattenError,
|
|
@@ -17663,6 +17805,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
17663
17805
|
isValidBase64URL: isValidBase64URL,
|
|
17664
17806
|
isValidJWT: isValidJWT,
|
|
17665
17807
|
locales: index$1,
|
|
17808
|
+
meta: meta$1,
|
|
17666
17809
|
parse: parse$2,
|
|
17667
17810
|
parseAsync: parseAsync$1,
|
|
17668
17811
|
prettifyError: prettifyError,
|
|
@@ -17885,6 +18028,7 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
17885
18028
|
inst.normalize = (...args) => inst.check(_normalize(...args));
|
|
17886
18029
|
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
17887
18030
|
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
18031
|
+
inst.slugify = () => inst.check(_slugify());
|
|
17888
18032
|
});
|
|
17889
18033
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
17890
18034
|
$ZodString.init(inst, def);
|
|
@@ -18039,6 +18183,14 @@ const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
|
|
|
18039
18183
|
function ipv4(params) {
|
|
18040
18184
|
return _ipv4(ZodIPv4, params);
|
|
18041
18185
|
}
|
|
18186
|
+
const ZodMAC = /*@__PURE__*/ $constructor("ZodMAC", (inst, def) => {
|
|
18187
|
+
// ZodStringFormat.init(inst, def);
|
|
18188
|
+
$ZodMAC.init(inst, def);
|
|
18189
|
+
ZodStringFormat.init(inst, def);
|
|
18190
|
+
});
|
|
18191
|
+
function mac(params) {
|
|
18192
|
+
return _mac(ZodMAC, params);
|
|
18193
|
+
}
|
|
18042
18194
|
const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
|
|
18043
18195
|
// ZodStringFormat.init(inst, def);
|
|
18044
18196
|
$ZodIPv6.init(inst, def);
|
|
@@ -18780,6 +18932,9 @@ function refine(fn, _params = {}) {
|
|
|
18780
18932
|
function superRefine(fn) {
|
|
18781
18933
|
return _superRefine(fn);
|
|
18782
18934
|
}
|
|
18935
|
+
// Re-export describe and meta from core
|
|
18936
|
+
const describe = describe$1;
|
|
18937
|
+
const meta = meta$1;
|
|
18783
18938
|
function _instanceof(cls, params = {
|
|
18784
18939
|
error: `Input not instance of ${cls.name}`,
|
|
18785
18940
|
}) {
|
|
@@ -18914,6 +19069,7 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
18914
19069
|
ZodKSUID: ZodKSUID,
|
|
18915
19070
|
ZodLazy: ZodLazy,
|
|
18916
19071
|
ZodLiteral: ZodLiteral,
|
|
19072
|
+
ZodMAC: ZodMAC,
|
|
18917
19073
|
ZodMap: ZodMap,
|
|
18918
19074
|
ZodNaN: ZodNaN,
|
|
18919
19075
|
ZodNanoID: ZodNanoID,
|
|
@@ -18972,6 +19128,7 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
18972
19128
|
date: date$1,
|
|
18973
19129
|
decode: decode,
|
|
18974
19130
|
decodeAsync: decodeAsync,
|
|
19131
|
+
describe: describe,
|
|
18975
19132
|
discriminatedUnion: discriminatedUnion,
|
|
18976
19133
|
e164: e164,
|
|
18977
19134
|
email: email,
|
|
@@ -19016,9 +19173,11 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
19016
19173
|
lowercase: _lowercase,
|
|
19017
19174
|
lt: _lt,
|
|
19018
19175
|
lte: _lte,
|
|
19176
|
+
mac: mac,
|
|
19019
19177
|
map: map,
|
|
19020
19178
|
maxLength: _maxLength,
|
|
19021
19179
|
maxSize: _maxSize,
|
|
19180
|
+
meta: meta,
|
|
19022
19181
|
mime: _mime,
|
|
19023
19182
|
minLength: _minLength,
|
|
19024
19183
|
minSize: _minSize,
|
|
@@ -19064,6 +19223,7 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
19064
19223
|
set: set$1,
|
|
19065
19224
|
setErrorMap: setErrorMap,
|
|
19066
19225
|
size: _size,
|
|
19226
|
+
slugify: _slugify,
|
|
19067
19227
|
startsWith: _startsWith,
|
|
19068
19228
|
strictObject: strictObject,
|
|
19069
19229
|
string: string$1,
|
|
@@ -20179,7 +20339,7 @@ var errors = process.env.NODE_ENV !== "production" ? [
|
|
|
20179
20339
|
function die(error, ...args) {
|
|
20180
20340
|
if (process.env.NODE_ENV !== "production") {
|
|
20181
20341
|
const e = errors[error];
|
|
20182
|
-
const msg =
|
|
20342
|
+
const msg = isFunction(e) ? e.apply(null, args) : e;
|
|
20183
20343
|
throw new Error(`[Immer] ${msg}`);
|
|
20184
20344
|
}
|
|
20185
20345
|
throw new Error(
|
|
@@ -20188,27 +20348,32 @@ function die(error, ...args) {
|
|
|
20188
20348
|
}
|
|
20189
20349
|
|
|
20190
20350
|
// src/utils/common.ts
|
|
20191
|
-
var
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20351
|
+
var O = Object;
|
|
20352
|
+
var getPrototypeOf = O.getPrototypeOf;
|
|
20353
|
+
var CONSTRUCTOR = "constructor";
|
|
20354
|
+
var PROTOTYPE = "prototype";
|
|
20355
|
+
var CONFIGURABLE = "configurable";
|
|
20356
|
+
var ENUMERABLE = "enumerable";
|
|
20357
|
+
var WRITABLE = "writable";
|
|
20358
|
+
var VALUE = "value";
|
|
20359
|
+
var isDraft = (value) => !!value && !!value[DRAFT_STATE];
|
|
20195
20360
|
function isDraftable(value) {
|
|
20196
20361
|
if (!value)
|
|
20197
20362
|
return false;
|
|
20198
|
-
return isPlainObject(value) ||
|
|
20363
|
+
return isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value);
|
|
20199
20364
|
}
|
|
20200
|
-
var objectCtorString =
|
|
20365
|
+
var objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();
|
|
20201
20366
|
var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
|
|
20202
20367
|
function isPlainObject(value) {
|
|
20203
|
-
if (!value ||
|
|
20368
|
+
if (!value || !isObjectish(value))
|
|
20204
20369
|
return false;
|
|
20205
|
-
const proto =
|
|
20206
|
-
if (proto === null || proto ===
|
|
20370
|
+
const proto = getPrototypeOf(value);
|
|
20371
|
+
if (proto === null || proto === O[PROTOTYPE])
|
|
20207
20372
|
return true;
|
|
20208
|
-
const Ctor =
|
|
20373
|
+
const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];
|
|
20209
20374
|
if (Ctor === Object)
|
|
20210
20375
|
return true;
|
|
20211
|
-
if (
|
|
20376
|
+
if (!isFunction(Ctor))
|
|
20212
20377
|
return false;
|
|
20213
20378
|
let ctorString = cachedCtorStrings.get(Ctor);
|
|
20214
20379
|
if (ctorString === void 0) {
|
|
@@ -20219,7 +20384,7 @@ function isPlainObject(value) {
|
|
|
20219
20384
|
}
|
|
20220
20385
|
function each(obj, iter, strict = true) {
|
|
20221
20386
|
if (getArchtype(obj) === 0 /* Object */) {
|
|
20222
|
-
const keys = strict ? Reflect.ownKeys(obj) :
|
|
20387
|
+
const keys = strict ? Reflect.ownKeys(obj) : O.keys(obj);
|
|
20223
20388
|
keys.forEach((key) => {
|
|
20224
20389
|
iter(key, obj[key], obj);
|
|
20225
20390
|
});
|
|
@@ -20229,20 +20394,21 @@ function each(obj, iter, strict = true) {
|
|
|
20229
20394
|
}
|
|
20230
20395
|
function getArchtype(thing) {
|
|
20231
20396
|
const state = thing[DRAFT_STATE];
|
|
20232
|
-
return state ? state.type_ :
|
|
20233
|
-
}
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20397
|
+
return state ? state.type_ : isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;
|
|
20398
|
+
}
|
|
20399
|
+
var has = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);
|
|
20400
|
+
var get = (thing, prop, type = getArchtype(thing)) => (
|
|
20401
|
+
// @ts-ignore
|
|
20402
|
+
type === 2 /* Map */ ? thing.get(prop) : thing[prop]
|
|
20403
|
+
);
|
|
20404
|
+
var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {
|
|
20405
|
+
if (type === 2 /* Map */)
|
|
20240
20406
|
thing.set(propOrOldValue, value);
|
|
20241
|
-
else if (
|
|
20407
|
+
else if (type === 3 /* Set */) {
|
|
20242
20408
|
thing.add(value);
|
|
20243
20409
|
} else
|
|
20244
20410
|
thing[propOrOldValue] = value;
|
|
20245
|
-
}
|
|
20411
|
+
};
|
|
20246
20412
|
function is(x, y) {
|
|
20247
20413
|
if (x === y) {
|
|
20248
20414
|
return x !== 0 || 1 / x === 1 / y;
|
|
@@ -20250,15 +20416,14 @@ function is(x, y) {
|
|
|
20250
20416
|
return x !== x && y !== y;
|
|
20251
20417
|
}
|
|
20252
20418
|
}
|
|
20253
|
-
|
|
20254
|
-
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
|
|
20260
|
-
|
|
20261
|
-
}
|
|
20419
|
+
var isArray = Array.isArray;
|
|
20420
|
+
var isMap = (target) => target instanceof Map;
|
|
20421
|
+
var isSet = (target) => target instanceof Set;
|
|
20422
|
+
var isObjectish = (target) => typeof target === "object";
|
|
20423
|
+
var isFunction = (target) => typeof target === "function";
|
|
20424
|
+
var isBoolean = (target) => typeof target === "boolean";
|
|
20425
|
+
var latest = (state) => state.copy_ || state.base_;
|
|
20426
|
+
var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;
|
|
20262
20427
|
function shallowCopy(base, strict) {
|
|
20263
20428
|
if (isMap(base)) {
|
|
20264
20429
|
return new Map(base);
|
|
@@ -20266,68 +20431,76 @@ function shallowCopy(base, strict) {
|
|
|
20266
20431
|
if (isSet(base)) {
|
|
20267
20432
|
return new Set(base);
|
|
20268
20433
|
}
|
|
20269
|
-
if (
|
|
20270
|
-
return Array.
|
|
20434
|
+
if (isArray(base))
|
|
20435
|
+
return Array[PROTOTYPE].slice.call(base);
|
|
20271
20436
|
const isPlain = isPlainObject(base);
|
|
20272
20437
|
if (strict === true || strict === "class_only" && !isPlain) {
|
|
20273
|
-
const descriptors =
|
|
20438
|
+
const descriptors = O.getOwnPropertyDescriptors(base);
|
|
20274
20439
|
delete descriptors[DRAFT_STATE];
|
|
20275
20440
|
let keys = Reflect.ownKeys(descriptors);
|
|
20276
20441
|
for (let i = 0; i < keys.length; i++) {
|
|
20277
20442
|
const key = keys[i];
|
|
20278
20443
|
const desc = descriptors[key];
|
|
20279
|
-
if (desc
|
|
20280
|
-
desc
|
|
20281
|
-
desc
|
|
20444
|
+
if (desc[WRITABLE] === false) {
|
|
20445
|
+
desc[WRITABLE] = true;
|
|
20446
|
+
desc[CONFIGURABLE] = true;
|
|
20282
20447
|
}
|
|
20283
20448
|
if (desc.get || desc.set)
|
|
20284
20449
|
descriptors[key] = {
|
|
20285
|
-
|
|
20286
|
-
|
|
20450
|
+
[CONFIGURABLE]: true,
|
|
20451
|
+
[WRITABLE]: true,
|
|
20287
20452
|
// could live with !!desc.set as well here...
|
|
20288
|
-
|
|
20289
|
-
|
|
20453
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
20454
|
+
[VALUE]: base[key]
|
|
20290
20455
|
};
|
|
20291
20456
|
}
|
|
20292
|
-
return
|
|
20457
|
+
return O.create(getPrototypeOf(base), descriptors);
|
|
20293
20458
|
} else {
|
|
20294
20459
|
const proto = getPrototypeOf(base);
|
|
20295
20460
|
if (proto !== null && isPlain) {
|
|
20296
20461
|
return { ...base };
|
|
20297
20462
|
}
|
|
20298
|
-
const obj =
|
|
20299
|
-
return
|
|
20463
|
+
const obj = O.create(proto);
|
|
20464
|
+
return O.assign(obj, base);
|
|
20300
20465
|
}
|
|
20301
20466
|
}
|
|
20302
20467
|
function freeze(obj, deep = false) {
|
|
20303
|
-
if (isFrozen(obj) || isDraft(obj)
|
|
20468
|
+
if (isFrozen(obj) || isDraft(obj))
|
|
20304
20469
|
return obj;
|
|
20305
20470
|
if (getArchtype(obj) > 1) {
|
|
20306
|
-
|
|
20471
|
+
O.defineProperties(obj, {
|
|
20307
20472
|
set: dontMutateMethodOverride,
|
|
20308
20473
|
add: dontMutateMethodOverride,
|
|
20309
20474
|
clear: dontMutateMethodOverride,
|
|
20310
20475
|
delete: dontMutateMethodOverride
|
|
20311
20476
|
});
|
|
20312
20477
|
}
|
|
20313
|
-
|
|
20478
|
+
O.freeze(obj);
|
|
20314
20479
|
if (deep)
|
|
20315
|
-
|
|
20480
|
+
each(
|
|
20481
|
+
obj,
|
|
20482
|
+
(_key, value) => {
|
|
20483
|
+
freeze(value, true);
|
|
20484
|
+
},
|
|
20485
|
+
false
|
|
20486
|
+
);
|
|
20316
20487
|
return obj;
|
|
20317
20488
|
}
|
|
20318
20489
|
function dontMutateFrozenCollections() {
|
|
20319
20490
|
die(2);
|
|
20320
20491
|
}
|
|
20321
20492
|
var dontMutateMethodOverride = {
|
|
20322
|
-
|
|
20493
|
+
[VALUE]: dontMutateFrozenCollections
|
|
20323
20494
|
};
|
|
20324
20495
|
function isFrozen(obj) {
|
|
20325
|
-
if (obj === null ||
|
|
20496
|
+
if (obj === null || !isObjectish(obj))
|
|
20326
20497
|
return true;
|
|
20327
|
-
return
|
|
20498
|
+
return O.isFrozen(obj);
|
|
20328
20499
|
}
|
|
20329
20500
|
|
|
20330
20501
|
// src/utils/plugins.ts
|
|
20502
|
+
var PluginMapSet = "MapSet";
|
|
20503
|
+
var PluginPatches = "Patches";
|
|
20331
20504
|
var plugins = {};
|
|
20332
20505
|
function getPlugin(pluginKey) {
|
|
20333
20506
|
const plugin = plugins[pluginKey];
|
|
@@ -20336,26 +20509,26 @@ function getPlugin(pluginKey) {
|
|
|
20336
20509
|
}
|
|
20337
20510
|
return plugin;
|
|
20338
20511
|
}
|
|
20512
|
+
var isPluginLoaded = (pluginKey) => !!plugins[pluginKey];
|
|
20339
20513
|
|
|
20340
20514
|
// src/core/scope.ts
|
|
20341
20515
|
var currentScope;
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
|
|
20347
|
-
|
|
20348
|
-
|
|
20349
|
-
|
|
20350
|
-
|
|
20351
|
-
|
|
20352
|
-
|
|
20353
|
-
|
|
20354
|
-
|
|
20355
|
-
}
|
|
20516
|
+
var getCurrentScope = () => currentScope;
|
|
20517
|
+
var createScope = (parent_, immer_) => ({
|
|
20518
|
+
drafts_: [],
|
|
20519
|
+
parent_,
|
|
20520
|
+
immer_,
|
|
20521
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
20522
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
20523
|
+
canAutoFreeze_: true,
|
|
20524
|
+
unfinalizedDrafts_: 0,
|
|
20525
|
+
handledSet_: /* @__PURE__ */ new Set(),
|
|
20526
|
+
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
20527
|
+
mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0
|
|
20528
|
+
});
|
|
20356
20529
|
function usePatchesInScope(scope, patchListener) {
|
|
20357
20530
|
if (patchListener) {
|
|
20358
|
-
getPlugin(
|
|
20531
|
+
scope.patchPlugin_ = getPlugin(PluginPatches);
|
|
20359
20532
|
scope.patches_ = [];
|
|
20360
20533
|
scope.inversePatches_ = [];
|
|
20361
20534
|
scope.patchListener_ = patchListener;
|
|
@@ -20371,9 +20544,7 @@ function leaveScope(scope) {
|
|
|
20371
20544
|
currentScope = scope.parent_;
|
|
20372
20545
|
}
|
|
20373
20546
|
}
|
|
20374
|
-
|
|
20375
|
-
return currentScope = createScope(currentScope, immer2);
|
|
20376
|
-
}
|
|
20547
|
+
var enterScope = (immer2) => currentScope = createScope(currentScope, immer2);
|
|
20377
20548
|
function revokeDraft(draft) {
|
|
20378
20549
|
const state = draft[DRAFT_STATE];
|
|
20379
20550
|
if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
|
|
@@ -20394,129 +20565,166 @@ function processResult(result, scope) {
|
|
|
20394
20565
|
}
|
|
20395
20566
|
if (isDraftable(result)) {
|
|
20396
20567
|
result = finalize(scope, result);
|
|
20397
|
-
if (!scope.parent_)
|
|
20398
|
-
maybeFreeze(scope, result);
|
|
20399
20568
|
}
|
|
20400
|
-
|
|
20401
|
-
|
|
20569
|
+
const { patchPlugin_ } = scope;
|
|
20570
|
+
if (patchPlugin_) {
|
|
20571
|
+
patchPlugin_.generateReplacementPatches_(
|
|
20402
20572
|
baseDraft[DRAFT_STATE].base_,
|
|
20403
20573
|
result,
|
|
20404
|
-
scope
|
|
20405
|
-
scope.inversePatches_
|
|
20574
|
+
scope
|
|
20406
20575
|
);
|
|
20407
20576
|
}
|
|
20408
20577
|
} else {
|
|
20409
|
-
result = finalize(scope, baseDraft
|
|
20578
|
+
result = finalize(scope, baseDraft);
|
|
20410
20579
|
}
|
|
20580
|
+
maybeFreeze(scope, result, true);
|
|
20411
20581
|
revokeScope(scope);
|
|
20412
20582
|
if (scope.patches_) {
|
|
20413
20583
|
scope.patchListener_(scope.patches_, scope.inversePatches_);
|
|
20414
20584
|
}
|
|
20415
20585
|
return result !== NOTHING ? result : void 0;
|
|
20416
20586
|
}
|
|
20417
|
-
function finalize(rootScope, value
|
|
20587
|
+
function finalize(rootScope, value) {
|
|
20418
20588
|
if (isFrozen(value))
|
|
20419
20589
|
return value;
|
|
20420
|
-
const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();
|
|
20421
20590
|
const state = value[DRAFT_STATE];
|
|
20422
20591
|
if (!state) {
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
(key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),
|
|
20426
|
-
useStrictIteration
|
|
20427
|
-
);
|
|
20428
|
-
return value;
|
|
20592
|
+
const finalValue = handleValue(value, rootScope.handledSet_, rootScope);
|
|
20593
|
+
return finalValue;
|
|
20429
20594
|
}
|
|
20430
|
-
if (state
|
|
20595
|
+
if (!isSameScope(state, rootScope)) {
|
|
20431
20596
|
return value;
|
|
20597
|
+
}
|
|
20432
20598
|
if (!state.modified_) {
|
|
20433
|
-
maybeFreeze(rootScope, state.base_, true);
|
|
20434
20599
|
return state.base_;
|
|
20435
20600
|
}
|
|
20436
20601
|
if (!state.finalized_) {
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
resultEach = new Set(result);
|
|
20444
|
-
result.clear();
|
|
20445
|
-
isSet2 = true;
|
|
20446
|
-
}
|
|
20447
|
-
each(
|
|
20448
|
-
resultEach,
|
|
20449
|
-
(key, childValue) => finalizeProperty(
|
|
20450
|
-
rootScope,
|
|
20451
|
-
state,
|
|
20452
|
-
result,
|
|
20453
|
-
key,
|
|
20454
|
-
childValue,
|
|
20455
|
-
path,
|
|
20456
|
-
isSet2
|
|
20457
|
-
),
|
|
20458
|
-
useStrictIteration
|
|
20459
|
-
);
|
|
20460
|
-
maybeFreeze(rootScope, result, false);
|
|
20461
|
-
if (path && rootScope.patches_) {
|
|
20462
|
-
getPlugin("Patches").generatePatches_(
|
|
20463
|
-
state,
|
|
20464
|
-
path,
|
|
20465
|
-
rootScope.patches_,
|
|
20466
|
-
rootScope.inversePatches_
|
|
20467
|
-
);
|
|
20602
|
+
const { callbacks_ } = state;
|
|
20603
|
+
if (callbacks_) {
|
|
20604
|
+
while (callbacks_.length > 0) {
|
|
20605
|
+
const callback = callbacks_.pop();
|
|
20606
|
+
callback(rootScope);
|
|
20607
|
+
}
|
|
20468
20608
|
}
|
|
20609
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
20469
20610
|
}
|
|
20470
20611
|
return state.copy_;
|
|
20471
20612
|
}
|
|
20472
|
-
function
|
|
20473
|
-
if (
|
|
20474
|
-
|
|
20613
|
+
function maybeFreeze(scope, value, deep = false) {
|
|
20614
|
+
if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {
|
|
20615
|
+
freeze(value, deep);
|
|
20475
20616
|
}
|
|
20476
|
-
|
|
20477
|
-
|
|
20617
|
+
}
|
|
20618
|
+
function markStateFinalized(state) {
|
|
20619
|
+
state.finalized_ = true;
|
|
20620
|
+
state.scope_.unfinalizedDrafts_--;
|
|
20621
|
+
}
|
|
20622
|
+
var isSameScope = (state, rootScope) => state.scope_ === rootScope;
|
|
20623
|
+
var EMPTY_LOCATIONS_RESULT = [];
|
|
20624
|
+
function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {
|
|
20625
|
+
const parentCopy = latest(parent);
|
|
20626
|
+
const parentType = parent.type_;
|
|
20627
|
+
if (originalKey !== void 0) {
|
|
20628
|
+
const currentValue = get(parentCopy, originalKey, parentType);
|
|
20629
|
+
if (currentValue === draftValue) {
|
|
20630
|
+
set(parentCopy, originalKey, finalizedValue, parentType);
|
|
20631
|
+
return;
|
|
20632
|
+
}
|
|
20478
20633
|
}
|
|
20479
|
-
|
|
20480
|
-
|
|
20481
|
-
|
|
20634
|
+
if (!parent.draftLocations_) {
|
|
20635
|
+
const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();
|
|
20636
|
+
each(parentCopy, (key, value) => {
|
|
20637
|
+
if (isDraft(value)) {
|
|
20638
|
+
const keys = draftLocations.get(value) || [];
|
|
20639
|
+
keys.push(key);
|
|
20640
|
+
draftLocations.set(value, keys);
|
|
20641
|
+
}
|
|
20642
|
+
});
|
|
20482
20643
|
}
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
20486
|
-
const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.
|
|
20487
|
-
!has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;
|
|
20488
|
-
const res = finalize(rootScope, childValue, path);
|
|
20489
|
-
set(targetObject, prop, res);
|
|
20490
|
-
if (isDraft(res)) {
|
|
20491
|
-
rootScope.canAutoFreeze_ = false;
|
|
20492
|
-
} else
|
|
20493
|
-
return;
|
|
20494
|
-
} else if (targetIsSet) {
|
|
20495
|
-
targetObject.add(childValue);
|
|
20644
|
+
const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;
|
|
20645
|
+
for (const location of locations) {
|
|
20646
|
+
set(parentCopy, location, finalizedValue, parentType);
|
|
20496
20647
|
}
|
|
20497
|
-
|
|
20498
|
-
|
|
20648
|
+
}
|
|
20649
|
+
function registerChildFinalizationCallback(parent, child, key) {
|
|
20650
|
+
parent.callbacks_.push(function childCleanup(rootScope) {
|
|
20651
|
+
const state = child;
|
|
20652
|
+
if (!state || !isSameScope(state, rootScope)) {
|
|
20499
20653
|
return;
|
|
20500
20654
|
}
|
|
20501
|
-
|
|
20502
|
-
|
|
20655
|
+
rootScope.mapSetPlugin_?.fixSetContents(state);
|
|
20656
|
+
const finalizedValue = getFinalValue(state);
|
|
20657
|
+
updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);
|
|
20658
|
+
generatePatchesAndFinalize(state, rootScope);
|
|
20659
|
+
});
|
|
20660
|
+
}
|
|
20661
|
+
function generatePatchesAndFinalize(state, rootScope) {
|
|
20662
|
+
const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || (state.assigned_?.size ?? 0) > 0);
|
|
20663
|
+
if (shouldFinalize) {
|
|
20664
|
+
const { patchPlugin_ } = rootScope;
|
|
20665
|
+
if (patchPlugin_) {
|
|
20666
|
+
const basePath = patchPlugin_.getPath(state);
|
|
20667
|
+
if (basePath) {
|
|
20668
|
+
patchPlugin_.generatePatches_(state, basePath, rootScope);
|
|
20669
|
+
}
|
|
20503
20670
|
}
|
|
20504
|
-
|
|
20505
|
-
if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))
|
|
20506
|
-
maybeFreeze(rootScope, childValue);
|
|
20671
|
+
markStateFinalized(state);
|
|
20507
20672
|
}
|
|
20508
20673
|
}
|
|
20509
|
-
function
|
|
20510
|
-
|
|
20511
|
-
|
|
20674
|
+
function handleCrossReference(target, key, value) {
|
|
20675
|
+
const { scope_ } = target;
|
|
20676
|
+
if (isDraft(value)) {
|
|
20677
|
+
const state = value[DRAFT_STATE];
|
|
20678
|
+
if (isSameScope(state, scope_)) {
|
|
20679
|
+
state.callbacks_.push(function crossReferenceCleanup() {
|
|
20680
|
+
prepareCopy(target);
|
|
20681
|
+
const finalizedValue = getFinalValue(state);
|
|
20682
|
+
updateDraftInParent(target, value, finalizedValue, key);
|
|
20683
|
+
});
|
|
20684
|
+
}
|
|
20685
|
+
} else if (isDraftable(value)) {
|
|
20686
|
+
target.callbacks_.push(function nestedDraftCleanup() {
|
|
20687
|
+
const targetCopy = latest(target);
|
|
20688
|
+
if (get(targetCopy, key, target.type_) === value) {
|
|
20689
|
+
if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {
|
|
20690
|
+
handleValue(
|
|
20691
|
+
get(target.copy_, key, target.type_),
|
|
20692
|
+
scope_.handledSet_,
|
|
20693
|
+
scope_
|
|
20694
|
+
);
|
|
20695
|
+
}
|
|
20696
|
+
}
|
|
20697
|
+
});
|
|
20512
20698
|
}
|
|
20513
20699
|
}
|
|
20700
|
+
function handleValue(target, handledSet, rootScope) {
|
|
20701
|
+
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
|
|
20702
|
+
return target;
|
|
20703
|
+
}
|
|
20704
|
+
if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) {
|
|
20705
|
+
return target;
|
|
20706
|
+
}
|
|
20707
|
+
handledSet.add(target);
|
|
20708
|
+
each(target, (key, value) => {
|
|
20709
|
+
if (isDraft(value)) {
|
|
20710
|
+
const state = value[DRAFT_STATE];
|
|
20711
|
+
if (isSameScope(state, rootScope)) {
|
|
20712
|
+
const updatedValue = getFinalValue(state);
|
|
20713
|
+
set(target, key, updatedValue, target.type_);
|
|
20714
|
+
markStateFinalized(state);
|
|
20715
|
+
}
|
|
20716
|
+
} else if (isDraftable(value)) {
|
|
20717
|
+
handleValue(value, handledSet, rootScope);
|
|
20718
|
+
}
|
|
20719
|
+
});
|
|
20720
|
+
return target;
|
|
20721
|
+
}
|
|
20514
20722
|
|
|
20515
20723
|
// src/core/proxy.ts
|
|
20516
20724
|
function createProxyProxy(base, parent) {
|
|
20517
|
-
const
|
|
20725
|
+
const baseIsArray = isArray(base);
|
|
20518
20726
|
const state = {
|
|
20519
|
-
type_:
|
|
20727
|
+
type_: baseIsArray ? 1 /* Array */ : 0 /* Object */,
|
|
20520
20728
|
// Track which produce call this is associated with.
|
|
20521
20729
|
scope_: parent ? parent.scope_ : getCurrentScope(),
|
|
20522
20730
|
// True for both shallow and deep changes.
|
|
@@ -20524,7 +20732,8 @@ function createProxyProxy(base, parent) {
|
|
|
20524
20732
|
// Used during finalization.
|
|
20525
20733
|
finalized_: false,
|
|
20526
20734
|
// Track which properties have been assigned (true) or deleted (false).
|
|
20527
|
-
|
|
20735
|
+
// actually instantiated in `prepareCopy()`
|
|
20736
|
+
assigned_: void 0,
|
|
20528
20737
|
// The parent draft state.
|
|
20529
20738
|
parent_: parent,
|
|
20530
20739
|
// The base state.
|
|
@@ -20536,25 +20745,27 @@ function createProxyProxy(base, parent) {
|
|
|
20536
20745
|
copy_: null,
|
|
20537
20746
|
// Called by the `produce` function.
|
|
20538
20747
|
revoke_: null,
|
|
20539
|
-
isManual_: false
|
|
20748
|
+
isManual_: false,
|
|
20749
|
+
// `callbacks` actually gets assigned in `createProxy`
|
|
20750
|
+
callbacks_: void 0
|
|
20540
20751
|
};
|
|
20541
20752
|
let target = state;
|
|
20542
20753
|
let traps = objectTraps;
|
|
20543
|
-
if (
|
|
20754
|
+
if (baseIsArray) {
|
|
20544
20755
|
target = [state];
|
|
20545
20756
|
traps = arrayTraps;
|
|
20546
20757
|
}
|
|
20547
20758
|
const { revoke, proxy } = Proxy.revocable(target, traps);
|
|
20548
20759
|
state.draft_ = proxy;
|
|
20549
20760
|
state.revoke_ = revoke;
|
|
20550
|
-
return proxy;
|
|
20761
|
+
return [proxy, state];
|
|
20551
20762
|
}
|
|
20552
20763
|
var objectTraps = {
|
|
20553
20764
|
get(state, prop) {
|
|
20554
20765
|
if (prop === DRAFT_STATE)
|
|
20555
20766
|
return state;
|
|
20556
20767
|
const source = latest(state);
|
|
20557
|
-
if (!has(source, prop)) {
|
|
20768
|
+
if (!has(source, prop, state.type_)) {
|
|
20558
20769
|
return readPropFromProto(state, source, prop);
|
|
20559
20770
|
}
|
|
20560
20771
|
const value = source[prop];
|
|
@@ -20563,7 +20774,9 @@ var objectTraps = {
|
|
|
20563
20774
|
}
|
|
20564
20775
|
if (value === peek(state.base_, prop)) {
|
|
20565
20776
|
prepareCopy(state);
|
|
20566
|
-
|
|
20777
|
+
const childKey = state.type_ === 1 /* Array */ ? +prop : prop;
|
|
20778
|
+
const childDraft = createProxy(state.scope_, value, state, childKey);
|
|
20779
|
+
return state.copy_[childKey] = childDraft;
|
|
20567
20780
|
}
|
|
20568
20781
|
return value;
|
|
20569
20782
|
},
|
|
@@ -20584,10 +20797,10 @@ var objectTraps = {
|
|
|
20584
20797
|
const currentState = current2?.[DRAFT_STATE];
|
|
20585
20798
|
if (currentState && currentState.base_ === value) {
|
|
20586
20799
|
state.copy_[prop] = value;
|
|
20587
|
-
state.assigned_
|
|
20800
|
+
state.assigned_.set(prop, false);
|
|
20588
20801
|
return true;
|
|
20589
20802
|
}
|
|
20590
|
-
if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))
|
|
20803
|
+
if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_)))
|
|
20591
20804
|
return true;
|
|
20592
20805
|
prepareCopy(state);
|
|
20593
20806
|
markChanged(state);
|
|
@@ -20597,16 +20810,17 @@ var objectTraps = {
|
|
|
20597
20810
|
Number.isNaN(value) && Number.isNaN(state.copy_[prop]))
|
|
20598
20811
|
return true;
|
|
20599
20812
|
state.copy_[prop] = value;
|
|
20600
|
-
state.assigned_
|
|
20813
|
+
state.assigned_.set(prop, true);
|
|
20814
|
+
handleCrossReference(state, prop, value);
|
|
20601
20815
|
return true;
|
|
20602
20816
|
},
|
|
20603
20817
|
deleteProperty(state, prop) {
|
|
20818
|
+
prepareCopy(state);
|
|
20604
20819
|
if (peek(state.base_, prop) !== void 0 || prop in state.base_) {
|
|
20605
|
-
state.assigned_
|
|
20606
|
-
prepareCopy(state);
|
|
20820
|
+
state.assigned_.set(prop, false);
|
|
20607
20821
|
markChanged(state);
|
|
20608
20822
|
} else {
|
|
20609
|
-
|
|
20823
|
+
state.assigned_.delete(prop);
|
|
20610
20824
|
}
|
|
20611
20825
|
if (state.copy_) {
|
|
20612
20826
|
delete state.copy_[prop];
|
|
@@ -20621,10 +20835,10 @@ var objectTraps = {
|
|
|
20621
20835
|
if (!desc)
|
|
20622
20836
|
return desc;
|
|
20623
20837
|
return {
|
|
20624
|
-
|
|
20625
|
-
|
|
20626
|
-
|
|
20627
|
-
|
|
20838
|
+
[WRITABLE]: true,
|
|
20839
|
+
[CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== "length",
|
|
20840
|
+
[ENUMERABLE]: desc[ENUMERABLE],
|
|
20841
|
+
[VALUE]: owner[prop]
|
|
20628
20842
|
};
|
|
20629
20843
|
},
|
|
20630
20844
|
defineProperty() {
|
|
@@ -20640,8 +20854,9 @@ var objectTraps = {
|
|
|
20640
20854
|
var arrayTraps = {};
|
|
20641
20855
|
each(objectTraps, (key, fn) => {
|
|
20642
20856
|
arrayTraps[key] = function() {
|
|
20643
|
-
|
|
20644
|
-
|
|
20857
|
+
const args = arguments;
|
|
20858
|
+
args[0] = args[0][0];
|
|
20859
|
+
return fn.apply(this, args);
|
|
20645
20860
|
};
|
|
20646
20861
|
});
|
|
20647
20862
|
arrayTraps.deleteProperty = function(state, prop) {
|
|
@@ -20661,7 +20876,7 @@ function peek(draft, prop) {
|
|
|
20661
20876
|
}
|
|
20662
20877
|
function readPropFromProto(state, source, prop) {
|
|
20663
20878
|
const desc = getDescriptorFromProto(source, prop);
|
|
20664
|
-
return desc ?
|
|
20879
|
+
return desc ? VALUE in desc ? desc[VALUE] : (
|
|
20665
20880
|
// This is a very special case, if the prop is a getter defined by the
|
|
20666
20881
|
// prototype, we should invoke it with the draft as context!
|
|
20667
20882
|
desc.get?.call(state.draft_)
|
|
@@ -20689,6 +20904,7 @@ function markChanged(state) {
|
|
|
20689
20904
|
}
|
|
20690
20905
|
function prepareCopy(state) {
|
|
20691
20906
|
if (!state.copy_) {
|
|
20907
|
+
state.assigned_ = /* @__PURE__ */ new Map();
|
|
20692
20908
|
state.copy_ = shallowCopy(
|
|
20693
20909
|
state.base_,
|
|
20694
20910
|
state.scope_.immer_.useStrictShallowCopy_
|
|
@@ -20701,7 +20917,7 @@ var Immer2 = class {
|
|
|
20701
20917
|
constructor(config) {
|
|
20702
20918
|
this.autoFreeze_ = true;
|
|
20703
20919
|
this.useStrictShallowCopy_ = false;
|
|
20704
|
-
this.useStrictIteration_ =
|
|
20920
|
+
this.useStrictIteration_ = false;
|
|
20705
20921
|
/**
|
|
20706
20922
|
* The `produce` function takes a value and a "recipe function" (whose
|
|
20707
20923
|
* return value often depends on the base state). The recipe function is
|
|
@@ -20722,7 +20938,7 @@ var Immer2 = class {
|
|
|
20722
20938
|
* @returns {any} a new state, or the initial state if nothing was modified
|
|
20723
20939
|
*/
|
|
20724
20940
|
this.produce = (base, recipe, patchListener) => {
|
|
20725
|
-
if (
|
|
20941
|
+
if (isFunction(base) && !isFunction(recipe)) {
|
|
20726
20942
|
const defaultBase = recipe;
|
|
20727
20943
|
recipe = base;
|
|
20728
20944
|
const self = this;
|
|
@@ -20730,14 +20946,14 @@ var Immer2 = class {
|
|
|
20730
20946
|
return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
|
|
20731
20947
|
};
|
|
20732
20948
|
}
|
|
20733
|
-
if (
|
|
20949
|
+
if (!isFunction(recipe))
|
|
20734
20950
|
die(6);
|
|
20735
|
-
if (patchListener !== void 0 &&
|
|
20951
|
+
if (patchListener !== void 0 && !isFunction(patchListener))
|
|
20736
20952
|
die(7);
|
|
20737
20953
|
let result;
|
|
20738
20954
|
if (isDraftable(base)) {
|
|
20739
20955
|
const scope = enterScope(this);
|
|
20740
|
-
const proxy = createProxy(base, void 0);
|
|
20956
|
+
const proxy = createProxy(scope, base, void 0);
|
|
20741
20957
|
let hasError = true;
|
|
20742
20958
|
try {
|
|
20743
20959
|
result = recipe(proxy);
|
|
@@ -20750,7 +20966,7 @@ var Immer2 = class {
|
|
|
20750
20966
|
}
|
|
20751
20967
|
usePatchesInScope(scope, patchListener);
|
|
20752
20968
|
return processResult(result, scope);
|
|
20753
|
-
} else if (!base ||
|
|
20969
|
+
} else if (!base || !isObjectish(base)) {
|
|
20754
20970
|
result = recipe(base);
|
|
20755
20971
|
if (result === void 0)
|
|
20756
20972
|
result = base;
|
|
@@ -20761,7 +20977,10 @@ var Immer2 = class {
|
|
|
20761
20977
|
if (patchListener) {
|
|
20762
20978
|
const p = [];
|
|
20763
20979
|
const ip = [];
|
|
20764
|
-
getPlugin(
|
|
20980
|
+
getPlugin(PluginPatches).generateReplacementPatches_(base, result, {
|
|
20981
|
+
patches_: p,
|
|
20982
|
+
inversePatches_: ip
|
|
20983
|
+
});
|
|
20765
20984
|
patchListener(p, ip);
|
|
20766
20985
|
}
|
|
20767
20986
|
return result;
|
|
@@ -20769,7 +20988,7 @@ var Immer2 = class {
|
|
|
20769
20988
|
die(1, base);
|
|
20770
20989
|
};
|
|
20771
20990
|
this.produceWithPatches = (base, recipe) => {
|
|
20772
|
-
if (
|
|
20991
|
+
if (isFunction(base)) {
|
|
20773
20992
|
return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
|
|
20774
20993
|
}
|
|
20775
20994
|
let patches, inversePatches;
|
|
@@ -20779,11 +20998,11 @@ var Immer2 = class {
|
|
|
20779
20998
|
});
|
|
20780
20999
|
return [result, patches, inversePatches];
|
|
20781
21000
|
};
|
|
20782
|
-
if (
|
|
21001
|
+
if (isBoolean(config?.autoFreeze))
|
|
20783
21002
|
this.setAutoFreeze(config.autoFreeze);
|
|
20784
|
-
if (
|
|
21003
|
+
if (isBoolean(config?.useStrictShallowCopy))
|
|
20785
21004
|
this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
20786
|
-
if (
|
|
21005
|
+
if (isBoolean(config?.useStrictIteration))
|
|
20787
21006
|
this.setUseStrictIteration(config.useStrictIteration);
|
|
20788
21007
|
}
|
|
20789
21008
|
createDraft(base) {
|
|
@@ -20792,7 +21011,7 @@ var Immer2 = class {
|
|
|
20792
21011
|
if (isDraft(base))
|
|
20793
21012
|
base = current(base);
|
|
20794
21013
|
const scope = enterScope(this);
|
|
20795
|
-
const proxy = createProxy(base, void 0);
|
|
21014
|
+
const proxy = createProxy(scope, base, void 0);
|
|
20796
21015
|
proxy[DRAFT_STATE].isManual_ = true;
|
|
20797
21016
|
leaveScope(scope);
|
|
20798
21017
|
return proxy;
|
|
@@ -20845,7 +21064,7 @@ var Immer2 = class {
|
|
|
20845
21064
|
if (i > -1) {
|
|
20846
21065
|
patches = patches.slice(i + 1);
|
|
20847
21066
|
}
|
|
20848
|
-
const applyPatchesImpl = getPlugin(
|
|
21067
|
+
const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;
|
|
20849
21068
|
if (isDraft(base)) {
|
|
20850
21069
|
return applyPatchesImpl(base, patches);
|
|
20851
21070
|
}
|
|
@@ -20855,10 +21074,23 @@ var Immer2 = class {
|
|
|
20855
21074
|
);
|
|
20856
21075
|
}
|
|
20857
21076
|
};
|
|
20858
|
-
function createProxy(value, parent) {
|
|
20859
|
-
const draft = isMap(value) ? getPlugin(
|
|
20860
|
-
const scope = parent
|
|
21077
|
+
function createProxy(rootScope, value, parent, key) {
|
|
21078
|
+
const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);
|
|
21079
|
+
const scope = parent?.scope_ ?? getCurrentScope();
|
|
20861
21080
|
scope.drafts_.push(draft);
|
|
21081
|
+
state.callbacks_ = parent?.callbacks_ ?? [];
|
|
21082
|
+
state.key_ = key;
|
|
21083
|
+
if (parent && key !== void 0) {
|
|
21084
|
+
registerChildFinalizationCallback(parent, state, key);
|
|
21085
|
+
} else {
|
|
21086
|
+
state.callbacks_.push(function rootDraftCleanup(rootScope2) {
|
|
21087
|
+
rootScope2.mapSetPlugin_?.fixSetContents(state);
|
|
21088
|
+
const { patchPlugin_ } = rootScope2;
|
|
21089
|
+
if (state.modified_ && patchPlugin_) {
|
|
21090
|
+
patchPlugin_.generatePatches_(state, [], rootScope2);
|
|
21091
|
+
}
|
|
21092
|
+
});
|
|
21093
|
+
}
|
|
20862
21094
|
return draft;
|
|
20863
21095
|
}
|
|
20864
21096
|
|
|
@@ -20899,9 +21131,7 @@ function currentImpl(value) {
|
|
|
20899
21131
|
// src/immer.ts
|
|
20900
21132
|
var immer = new Immer2();
|
|
20901
21133
|
var produce = immer.produce;
|
|
20902
|
-
|
|
20903
|
-
return value;
|
|
20904
|
-
}
|
|
21134
|
+
var castDraft = (value) => value;
|
|
20905
21135
|
|
|
20906
21136
|
const filterAction = (...types) => filter((x) => types.includes(x.type));
|
|
20907
21137
|
|
|
@@ -21599,36 +21829,32 @@ class TelemetryConfigurator extends BaseConfigBuilder {
|
|
|
21599
21829
|
this._set('parent', parent);
|
|
21600
21830
|
return this;
|
|
21601
21831
|
}
|
|
21602
|
-
attachItems(item$) {
|
|
21603
|
-
this._set('items$', item$);
|
|
21604
|
-
return this;
|
|
21605
|
-
}
|
|
21606
21832
|
/**
|
|
21607
|
-
*
|
|
21608
|
-
* Only items for which the filter returns `true` will be sent to adapters.
|
|
21833
|
+
* Attaches an observable stream of telemetry items to the configurator.
|
|
21609
21834
|
*
|
|
21610
|
-
* @param
|
|
21611
|
-
* @returns The
|
|
21835
|
+
* @param item$ - An observable input stream of telemetry items to be processed.
|
|
21836
|
+
* @returns The current instance for method chaining.
|
|
21612
21837
|
*/
|
|
21613
|
-
|
|
21614
|
-
this._set('
|
|
21838
|
+
attachItems(item$) {
|
|
21839
|
+
this._set('items$', item$);
|
|
21615
21840
|
return this;
|
|
21616
21841
|
}
|
|
21617
21842
|
/**
|
|
21618
|
-
* Sets
|
|
21619
|
-
* Only items for which the filter returns `true` will be relayed to the parent.
|
|
21843
|
+
* Sets the filter configuration for telemetry items.
|
|
21620
21844
|
*
|
|
21621
|
-
*
|
|
21622
|
-
*
|
|
21845
|
+
* The filter determines which telemetry items should be passed to adapters and/or relayed to parent providers.
|
|
21846
|
+
*
|
|
21847
|
+
* @param filter - Either a filter object with `adapter` and `relay` functions, or a callback that returns such a filter object.
|
|
21848
|
+
* @returns The current instance for method chaining.
|
|
21623
21849
|
*/
|
|
21624
|
-
|
|
21625
|
-
this._set('
|
|
21850
|
+
setFilter(filter) {
|
|
21851
|
+
this._set('filter', filter);
|
|
21626
21852
|
return this;
|
|
21627
21853
|
}
|
|
21628
21854
|
}
|
|
21629
21855
|
|
|
21630
21856
|
// Generated by genversion.
|
|
21631
|
-
const version$5 = '4.
|
|
21857
|
+
const version$5 = '4.6.0';
|
|
21632
21858
|
|
|
21633
21859
|
/**
|
|
21634
21860
|
* Enum representing the severity levels of telemetry items.
|
|
@@ -23905,8 +24131,7 @@ class TelemetryProvider extends BaseModuleProvider {
|
|
|
23905
24131
|
#items = new Subject();
|
|
23906
24132
|
#initialized = false;
|
|
23907
24133
|
#adapters = {};
|
|
23908
|
-
#
|
|
23909
|
-
#relayFilter;
|
|
24134
|
+
#filters;
|
|
23910
24135
|
#defaultScope;
|
|
23911
24136
|
#eventProvider;
|
|
23912
24137
|
get items() {
|
|
@@ -23929,8 +24154,7 @@ class TelemetryProvider extends BaseModuleProvider {
|
|
|
23929
24154
|
this.#metadata = config?.metadata;
|
|
23930
24155
|
this.#defaultScope = config?.defaultScope ?? [];
|
|
23931
24156
|
this.#eventProvider = deps?.event;
|
|
23932
|
-
this.#
|
|
23933
|
-
this.#relayFilter = config?.relayFilter;
|
|
24157
|
+
this.#filters = config?.filter;
|
|
23934
24158
|
}
|
|
23935
24159
|
/**
|
|
23936
24160
|
* Initializes the telemetry provider with adapters, parent provider, and optional initial items.
|
|
@@ -24010,8 +24234,9 @@ class TelemetryProvider extends BaseModuleProvider {
|
|
|
24010
24234
|
throw new Error('TelemetryProvider is not initialized');
|
|
24011
24235
|
}
|
|
24012
24236
|
return this.#items.subscribe((item) => {
|
|
24237
|
+
const { adapter: adapterFilter } = this.#filters ?? {};
|
|
24013
24238
|
// Apply adapter filter if configured - skip item if filter returns false
|
|
24014
|
-
if (
|
|
24239
|
+
if (adapterFilter && !adapterFilter(item)) {
|
|
24015
24240
|
return;
|
|
24016
24241
|
}
|
|
24017
24242
|
// Iterate through all registered adapters
|
|
@@ -24042,8 +24267,9 @@ class TelemetryProvider extends BaseModuleProvider {
|
|
|
24042
24267
|
_relayTelemetryData(target) {
|
|
24043
24268
|
// Subscribe to the processed stream and forward each item to the parent provider
|
|
24044
24269
|
return this.#items.subscribe((item) => {
|
|
24270
|
+
const { relay: relayFilter } = this.#filters ?? {};
|
|
24045
24271
|
// Apply relay filter if configured - skip item if filter returns false
|
|
24046
|
-
if (
|
|
24272
|
+
if (relayFilter && !relayFilter(item)) {
|
|
24047
24273
|
return;
|
|
24048
24274
|
}
|
|
24049
24275
|
target.track(item);
|
|
@@ -42586,7 +42812,7 @@ const createClientLogCallback = (provider, metadata, scope) => {
|
|
|
42586
42812
|
};
|
|
42587
42813
|
|
|
42588
42814
|
// Generated by genversion.
|
|
42589
|
-
const version$2 = '6.0.
|
|
42815
|
+
const version$2 = '6.0.1';
|
|
42590
42816
|
|
|
42591
42817
|
/**
|
|
42592
42818
|
* Zod schema for telemetry configuration validation.
|
|
@@ -43215,6 +43441,19 @@ function createProxyClient(client) {
|
|
|
43215
43441
|
return proxy;
|
|
43216
43442
|
}
|
|
43217
43443
|
|
|
43444
|
+
/**
|
|
43445
|
+
* Checks if a request is in MSAL v4 format.
|
|
43446
|
+
*
|
|
43447
|
+
* @param req - The request object to check
|
|
43448
|
+
* @returns True if the request is in v4 format (has a `request` property with `scopes` and `account`)
|
|
43449
|
+
*/
|
|
43450
|
+
function isRequestV4(req) {
|
|
43451
|
+
if (typeof req !== 'object' || req === null) {
|
|
43452
|
+
return false;
|
|
43453
|
+
}
|
|
43454
|
+
const requestV4 = req;
|
|
43455
|
+
return 'request' in requestV4;
|
|
43456
|
+
}
|
|
43218
43457
|
/**
|
|
43219
43458
|
* Creates a proxy provider for MSAL v2 compatibility.
|
|
43220
43459
|
*
|
|
@@ -43280,9 +43519,8 @@ function createProxyProvider$1(provider) {
|
|
|
43280
43519
|
case 'acquireToken': {
|
|
43281
43520
|
// Adapt v4 acquireToken to v2 signature with proper type mapping
|
|
43282
43521
|
const acquireToken = async (req) => {
|
|
43283
|
-
const
|
|
43284
|
-
|
|
43285
|
-
});
|
|
43522
|
+
const request = isRequestV4(req) ? req : { scopes: req.scopes, account: req.account };
|
|
43523
|
+
const result = await target.acquireToken(request);
|
|
43286
43524
|
// Convert null to undefined for v2 compatibility
|
|
43287
43525
|
return result || undefined;
|
|
43288
43526
|
};
|
|
@@ -43291,9 +43529,8 @@ function createProxyProvider$1(provider) {
|
|
|
43291
43529
|
case 'acquireAccessToken': {
|
|
43292
43530
|
// Adapt v4 acquireAccessToken to v2 signature
|
|
43293
43531
|
const acquireAccessToken = async (req) => {
|
|
43294
|
-
|
|
43295
|
-
|
|
43296
|
-
});
|
|
43532
|
+
const request = isRequestV4(req) ? req : { scopes: req.scopes, account: req.account };
|
|
43533
|
+
return await target.acquireAccessToken(request);
|
|
43297
43534
|
};
|
|
43298
43535
|
return acquireAccessToken;
|
|
43299
43536
|
}
|
|
@@ -46809,7 +47046,7 @@ async function registerServiceWorker(framework) {
|
|
|
46809
47046
|
}
|
|
46810
47047
|
|
|
46811
47048
|
// Generated by genversion.
|
|
46812
|
-
const version = '3.0.
|
|
47049
|
+
const version = '3.0.3';
|
|
46813
47050
|
|
|
46814
47051
|
// Allow dynamic import without vite
|
|
46815
47052
|
const importWithoutVite = (path) => import(/* @vite-ignore */ path);
|