sixseconds-modules 1.6.155 → 1.6.158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +255 -639
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +255 -639
- package/dist/index.es.js.map +1 -1
- package/package.json +98 -98
package/dist/index.cjs.js
CHANGED
|
@@ -548,10 +548,10 @@ function isFunction$2(value) {
|
|
|
548
548
|
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
549
549
|
}
|
|
550
550
|
var coreJsData = root["__core-js_shared__"];
|
|
551
|
-
var maskSrcKey = function() {
|
|
551
|
+
var maskSrcKey = (function() {
|
|
552
552
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
553
553
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
554
|
-
}();
|
|
554
|
+
})();
|
|
555
555
|
function isMasked(func) {
|
|
556
556
|
return !!maskSrcKey && maskSrcKey in func;
|
|
557
557
|
}
|
|
@@ -720,14 +720,14 @@ function arrayEach(array2, iteratee) {
|
|
|
720
720
|
}
|
|
721
721
|
return array2;
|
|
722
722
|
}
|
|
723
|
-
var defineProperty = function() {
|
|
723
|
+
var defineProperty = (function() {
|
|
724
724
|
try {
|
|
725
725
|
var func = getNative(Object, "defineProperty");
|
|
726
726
|
func({}, "", {});
|
|
727
727
|
return func;
|
|
728
728
|
} catch (e) {
|
|
729
729
|
}
|
|
730
|
-
}();
|
|
730
|
+
})();
|
|
731
731
|
function baseAssignValue(object2, key, value) {
|
|
732
732
|
if (key == "__proto__" && defineProperty) {
|
|
733
733
|
defineProperty(object2, key, {
|
|
@@ -780,9 +780,9 @@ function baseIsArguments(value) {
|
|
|
780
780
|
var objectProto$6 = Object.prototype;
|
|
781
781
|
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
782
782
|
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
783
|
-
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
783
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
784
784
|
return arguments;
|
|
785
|
-
}()) ? baseIsArguments : function(value) {
|
|
785
|
+
})()) ? baseIsArguments : function(value) {
|
|
786
786
|
return isObjectLike(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
787
787
|
};
|
|
788
788
|
var isArray$1 = Array.isArray;
|
|
@@ -823,7 +823,7 @@ var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType &
|
|
|
823
823
|
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
824
824
|
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
825
825
|
var freeProcess = moduleExports$1 && freeGlobal.process;
|
|
826
|
-
var nodeUtil = function() {
|
|
826
|
+
var nodeUtil = (function() {
|
|
827
827
|
try {
|
|
828
828
|
var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
|
|
829
829
|
if (types) {
|
|
@@ -832,7 +832,7 @@ var nodeUtil = function() {
|
|
|
832
832
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
833
833
|
} catch (e) {
|
|
834
834
|
}
|
|
835
|
-
}();
|
|
835
|
+
})();
|
|
836
836
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
837
837
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
838
838
|
var objectProto$5 = Object.prototype;
|
|
@@ -1083,7 +1083,7 @@ function initCloneByTag(object2, tag, isDeep) {
|
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
1085
|
var objectCreate = Object.create;
|
|
1086
|
-
var baseCreate = /* @__PURE__ */ function() {
|
|
1086
|
+
var baseCreate = /* @__PURE__ */ (function() {
|
|
1087
1087
|
function object2() {
|
|
1088
1088
|
}
|
|
1089
1089
|
return function(proto2) {
|
|
@@ -1098,7 +1098,7 @@ var baseCreate = /* @__PURE__ */ function() {
|
|
|
1098
1098
|
object2.prototype = void 0;
|
|
1099
1099
|
return result;
|
|
1100
1100
|
};
|
|
1101
|
-
}();
|
|
1101
|
+
})();
|
|
1102
1102
|
function initCloneObject(object2) {
|
|
1103
1103
|
return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {};
|
|
1104
1104
|
}
|
|
@@ -1360,7 +1360,7 @@ function requireReactIs_production_min() {
|
|
|
1360
1360
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1361
1361
|
hasRequiredReactIs_production_min = 1;
|
|
1362
1362
|
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
|
|
1363
|
-
function
|
|
1363
|
+
function z(a) {
|
|
1364
1364
|
if ("object" === typeof a && null !== a) {
|
|
1365
1365
|
var u = a.$$typeof;
|
|
1366
1366
|
switch (u) {
|
|
@@ -1391,7 +1391,7 @@ function requireReactIs_production_min() {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
function A(a) {
|
|
1394
|
-
return
|
|
1394
|
+
return z(a) === m;
|
|
1395
1395
|
}
|
|
1396
1396
|
reactIs_production_min.AsyncMode = l;
|
|
1397
1397
|
reactIs_production_min.ConcurrentMode = m;
|
|
@@ -1407,46 +1407,46 @@ function requireReactIs_production_min() {
|
|
|
1407
1407
|
reactIs_production_min.StrictMode = f;
|
|
1408
1408
|
reactIs_production_min.Suspense = p;
|
|
1409
1409
|
reactIs_production_min.isAsyncMode = function(a) {
|
|
1410
|
-
return A(a) ||
|
|
1410
|
+
return A(a) || z(a) === l;
|
|
1411
1411
|
};
|
|
1412
1412
|
reactIs_production_min.isConcurrentMode = A;
|
|
1413
1413
|
reactIs_production_min.isContextConsumer = function(a) {
|
|
1414
|
-
return
|
|
1414
|
+
return z(a) === k;
|
|
1415
1415
|
};
|
|
1416
1416
|
reactIs_production_min.isContextProvider = function(a) {
|
|
1417
|
-
return
|
|
1417
|
+
return z(a) === h;
|
|
1418
1418
|
};
|
|
1419
1419
|
reactIs_production_min.isElement = function(a) {
|
|
1420
1420
|
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
1421
1421
|
};
|
|
1422
1422
|
reactIs_production_min.isForwardRef = function(a) {
|
|
1423
|
-
return
|
|
1423
|
+
return z(a) === n;
|
|
1424
1424
|
};
|
|
1425
1425
|
reactIs_production_min.isFragment = function(a) {
|
|
1426
|
-
return
|
|
1426
|
+
return z(a) === e;
|
|
1427
1427
|
};
|
|
1428
1428
|
reactIs_production_min.isLazy = function(a) {
|
|
1429
|
-
return
|
|
1429
|
+
return z(a) === t;
|
|
1430
1430
|
};
|
|
1431
1431
|
reactIs_production_min.isMemo = function(a) {
|
|
1432
|
-
return
|
|
1432
|
+
return z(a) === r;
|
|
1433
1433
|
};
|
|
1434
1434
|
reactIs_production_min.isPortal = function(a) {
|
|
1435
|
-
return
|
|
1435
|
+
return z(a) === d;
|
|
1436
1436
|
};
|
|
1437
1437
|
reactIs_production_min.isProfiler = function(a) {
|
|
1438
|
-
return
|
|
1438
|
+
return z(a) === g;
|
|
1439
1439
|
};
|
|
1440
1440
|
reactIs_production_min.isStrictMode = function(a) {
|
|
1441
|
-
return
|
|
1441
|
+
return z(a) === f;
|
|
1442
1442
|
};
|
|
1443
1443
|
reactIs_production_min.isSuspense = function(a) {
|
|
1444
|
-
return
|
|
1444
|
+
return z(a) === p;
|
|
1445
1445
|
};
|
|
1446
1446
|
reactIs_production_min.isValidElementType = function(a) {
|
|
1447
1447
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
1448
1448
|
};
|
|
1449
|
-
reactIs_production_min.typeOf =
|
|
1449
|
+
reactIs_production_min.typeOf = z;
|
|
1450
1450
|
return reactIs_production_min;
|
|
1451
1451
|
}
|
|
1452
1452
|
var reactIs_development = {};
|
|
@@ -2212,15 +2212,16 @@ function useFormik(_ref) {
|
|
|
2212
2212
|
});
|
|
2213
2213
|
}, []);
|
|
2214
2214
|
var setFieldValue = useEventCallback(function(field, value, shouldValidate) {
|
|
2215
|
+
var resolvedValue = isFunction$1(value) ? value(getIn$1(state.values, field)) : value;
|
|
2215
2216
|
dispatch({
|
|
2216
2217
|
type: "SET_FIELD_VALUE",
|
|
2217
2218
|
payload: {
|
|
2218
2219
|
field,
|
|
2219
|
-
value
|
|
2220
|
+
value: resolvedValue
|
|
2220
2221
|
}
|
|
2221
2222
|
});
|
|
2222
2223
|
var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate;
|
|
2223
|
-
return willValidate ? validateFormWithHighPriority(setIn(state.values, field,
|
|
2224
|
+
return willValidate ? validateFormWithHighPriority(setIn(state.values, field, resolvedValue)) : Promise.resolve();
|
|
2224
2225
|
});
|
|
2225
2226
|
var executeChange = React.useCallback(function(eventOrTextValue, maybePath) {
|
|
2226
2227
|
var field = maybePath;
|
|
@@ -2667,15 +2668,18 @@ const ErrorMessage = ({ fieldName, formik }) => {
|
|
|
2667
2668
|
};
|
|
2668
2669
|
function createEnv(opts) {
|
|
2669
2670
|
const runtimeEnv = opts.runtimeEnvStrict ?? opts.runtimeEnv ?? process.env;
|
|
2670
|
-
|
|
2671
|
-
if (emptyStringAsUndefined) {
|
|
2671
|
+
if (opts.emptyStringAsUndefined ?? false) {
|
|
2672
2672
|
for (const [key, value] of Object.entries(runtimeEnv)) if (value === "") delete runtimeEnv[key];
|
|
2673
2673
|
}
|
|
2674
|
-
|
|
2674
|
+
{
|
|
2675
|
+
if (opts.extends) for (const preset of opts.extends) preset.skipValidation = true;
|
|
2676
|
+
return runtimeEnv;
|
|
2677
|
+
}
|
|
2675
2678
|
}
|
|
2676
2679
|
var util;
|
|
2677
2680
|
(function(util2) {
|
|
2678
|
-
util2.assertEqual = (
|
|
2681
|
+
util2.assertEqual = (_) => {
|
|
2682
|
+
};
|
|
2679
2683
|
function assertIs(_arg) {
|
|
2680
2684
|
}
|
|
2681
2685
|
util2.assertIs = assertIs;
|
|
@@ -2719,7 +2723,7 @@ var util;
|
|
|
2719
2723
|
}
|
|
2720
2724
|
return void 0;
|
|
2721
2725
|
};
|
|
2722
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
2726
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
2723
2727
|
function joinValues(array2, separator = " | ") {
|
|
2724
2728
|
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
2725
2729
|
}
|
|
@@ -2771,7 +2775,7 @@ const getParsedType = (data) => {
|
|
|
2771
2775
|
case "string":
|
|
2772
2776
|
return ZodParsedType.string;
|
|
2773
2777
|
case "number":
|
|
2774
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
2778
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
2775
2779
|
case "boolean":
|
|
2776
2780
|
return ZodParsedType.boolean;
|
|
2777
2781
|
case "function":
|
|
@@ -2822,10 +2826,6 @@ const ZodIssueCode = util.arrayToEnum([
|
|
|
2822
2826
|
"not_multiple_of",
|
|
2823
2827
|
"not_finite"
|
|
2824
2828
|
]);
|
|
2825
|
-
const quotelessJson = (obj) => {
|
|
2826
|
-
const json = JSON.stringify(obj, null, 2);
|
|
2827
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2828
|
-
};
|
|
2829
2829
|
class ZodError extends Error {
|
|
2830
2830
|
get errors() {
|
|
2831
2831
|
return this.issues;
|
|
@@ -2903,8 +2903,9 @@ class ZodError extends Error {
|
|
|
2903
2903
|
const formErrors = [];
|
|
2904
2904
|
for (const sub of this.issues) {
|
|
2905
2905
|
if (sub.path.length > 0) {
|
|
2906
|
-
|
|
2907
|
-
fieldErrors[
|
|
2906
|
+
const firstEl = sub.path[0];
|
|
2907
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
2908
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
2908
2909
|
} else {
|
|
2909
2910
|
formErrors.push(mapper(sub));
|
|
2910
2911
|
}
|
|
@@ -2980,6 +2981,8 @@ const errorMap = (issue, _ctx) => {
|
|
|
2980
2981
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
2981
2982
|
else if (issue.type === "number")
|
|
2982
2983
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2984
|
+
else if (issue.type === "bigint")
|
|
2985
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2983
2986
|
else if (issue.type === "date")
|
|
2984
2987
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
2985
2988
|
else
|
|
@@ -3018,9 +3021,6 @@ const errorMap = (issue, _ctx) => {
|
|
|
3018
3021
|
return { message };
|
|
3019
3022
|
};
|
|
3020
3023
|
let overrideErrorMap = errorMap;
|
|
3021
|
-
function setErrorMap(map2) {
|
|
3022
|
-
overrideErrorMap = map2;
|
|
3023
|
-
}
|
|
3024
3024
|
function getErrorMap() {
|
|
3025
3025
|
return overrideErrorMap;
|
|
3026
3026
|
}
|
|
@@ -3049,7 +3049,6 @@ const makeIssue = (params) => {
|
|
|
3049
3049
|
message: errorMessage
|
|
3050
3050
|
};
|
|
3051
3051
|
};
|
|
3052
|
-
const EMPTY_PATH = [];
|
|
3053
3052
|
function addIssueToContext(ctx, issueData) {
|
|
3054
3053
|
const overrideMap = getErrorMap();
|
|
3055
3054
|
const issue = makeIssue({
|
|
@@ -3132,24 +3131,11 @@ const isAborted = (x) => x.status === "aborted";
|
|
|
3132
3131
|
const isDirty = (x) => x.status === "dirty";
|
|
3133
3132
|
const isValid$3 = (x) => x.status === "valid";
|
|
3134
3133
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
3135
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
3136
|
-
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3137
|
-
return state.get(receiver);
|
|
3138
|
-
}
|
|
3139
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
3140
|
-
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
3141
|
-
return state.set(receiver, value), value;
|
|
3142
|
-
}
|
|
3143
|
-
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
3144
|
-
var e = new Error(message);
|
|
3145
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
3146
|
-
};
|
|
3147
3134
|
var errorUtil;
|
|
3148
3135
|
(function(errorUtil2) {
|
|
3149
3136
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
3150
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
3137
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
3151
3138
|
})(errorUtil || (errorUtil = {}));
|
|
3152
|
-
var _ZodEnum_cache, _ZodNativeEnum_cache;
|
|
3153
3139
|
class ParseInputLazyPath {
|
|
3154
3140
|
constructor(parent, value, path, key) {
|
|
3155
3141
|
this._cachedPath = [];
|
|
@@ -3160,7 +3146,7 @@ class ParseInputLazyPath {
|
|
|
3160
3146
|
}
|
|
3161
3147
|
get path() {
|
|
3162
3148
|
if (!this._cachedPath.length) {
|
|
3163
|
-
if (this._key
|
|
3149
|
+
if (Array.isArray(this._key)) {
|
|
3164
3150
|
this._cachedPath.push(...this._path, ...this._key);
|
|
3165
3151
|
} else {
|
|
3166
3152
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -3198,17 +3184,16 @@ function processCreateParams(params) {
|
|
|
3198
3184
|
if (errorMap2)
|
|
3199
3185
|
return { errorMap: errorMap2, description };
|
|
3200
3186
|
const customMap = (iss, ctx) => {
|
|
3201
|
-
var _a, _b;
|
|
3202
3187
|
const { message } = params;
|
|
3203
3188
|
if (iss.code === "invalid_enum_value") {
|
|
3204
|
-
return { message: message
|
|
3189
|
+
return { message: message ?? ctx.defaultError };
|
|
3205
3190
|
}
|
|
3206
3191
|
if (typeof ctx.data === "undefined") {
|
|
3207
|
-
return { message:
|
|
3192
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
3208
3193
|
}
|
|
3209
3194
|
if (iss.code !== "invalid_type")
|
|
3210
3195
|
return { message: ctx.defaultError };
|
|
3211
|
-
return { message:
|
|
3196
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
3212
3197
|
};
|
|
3213
3198
|
return { errorMap: customMap, description };
|
|
3214
3199
|
}
|
|
@@ -3260,14 +3245,13 @@ class ZodType {
|
|
|
3260
3245
|
throw result.error;
|
|
3261
3246
|
}
|
|
3262
3247
|
safeParse(data, params) {
|
|
3263
|
-
var _a;
|
|
3264
3248
|
const ctx = {
|
|
3265
3249
|
common: {
|
|
3266
3250
|
issues: [],
|
|
3267
|
-
async:
|
|
3268
|
-
contextualErrorMap: params
|
|
3251
|
+
async: params?.async ?? false,
|
|
3252
|
+
contextualErrorMap: params?.errorMap
|
|
3269
3253
|
},
|
|
3270
|
-
path:
|
|
3254
|
+
path: params?.path || [],
|
|
3271
3255
|
schemaErrorMap: this._def.errorMap,
|
|
3272
3256
|
parent: null,
|
|
3273
3257
|
data,
|
|
@@ -3277,7 +3261,6 @@ class ZodType {
|
|
|
3277
3261
|
return handleResult(ctx, result);
|
|
3278
3262
|
}
|
|
3279
3263
|
"~validate"(data) {
|
|
3280
|
-
var _a, _b;
|
|
3281
3264
|
const ctx = {
|
|
3282
3265
|
common: {
|
|
3283
3266
|
issues: [],
|
|
@@ -3298,7 +3281,7 @@ class ZodType {
|
|
|
3298
3281
|
issues: ctx.common.issues
|
|
3299
3282
|
};
|
|
3300
3283
|
} catch (err) {
|
|
3301
|
-
if (
|
|
3284
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
3302
3285
|
this["~standard"].async = true;
|
|
3303
3286
|
}
|
|
3304
3287
|
ctx.common = {
|
|
@@ -3323,10 +3306,10 @@ class ZodType {
|
|
|
3323
3306
|
const ctx = {
|
|
3324
3307
|
common: {
|
|
3325
3308
|
issues: [],
|
|
3326
|
-
contextualErrorMap: params
|
|
3309
|
+
contextualErrorMap: params?.errorMap,
|
|
3327
3310
|
async: true
|
|
3328
3311
|
},
|
|
3329
|
-
path:
|
|
3312
|
+
path: params?.path || [],
|
|
3330
3313
|
schemaErrorMap: this._def.errorMap,
|
|
3331
3314
|
parent: null,
|
|
3332
3315
|
data,
|
|
@@ -3551,16 +3534,20 @@ function isValidJWT(jwt, alg) {
|
|
|
3551
3534
|
return false;
|
|
3552
3535
|
try {
|
|
3553
3536
|
const [header] = jwt.split(".");
|
|
3537
|
+
if (!header)
|
|
3538
|
+
return false;
|
|
3554
3539
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
3555
3540
|
const decoded = JSON.parse(atob(base64));
|
|
3556
3541
|
if (typeof decoded !== "object" || decoded === null)
|
|
3557
3542
|
return false;
|
|
3558
|
-
if (
|
|
3543
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
3544
|
+
return false;
|
|
3545
|
+
if (!decoded.alg)
|
|
3559
3546
|
return false;
|
|
3560
3547
|
if (alg && decoded.alg !== alg)
|
|
3561
3548
|
return false;
|
|
3562
3549
|
return true;
|
|
3563
|
-
} catch
|
|
3550
|
+
} catch {
|
|
3564
3551
|
return false;
|
|
3565
3552
|
}
|
|
3566
3553
|
}
|
|
@@ -3719,7 +3706,7 @@ class ZodString extends ZodType {
|
|
|
3719
3706
|
} else if (check.kind === "url") {
|
|
3720
3707
|
try {
|
|
3721
3708
|
new URL(input.data);
|
|
3722
|
-
} catch
|
|
3709
|
+
} catch {
|
|
3723
3710
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
3724
3711
|
addIssueToContext(ctx, {
|
|
3725
3712
|
validation: "url",
|
|
@@ -3931,7 +3918,6 @@ class ZodString extends ZodType {
|
|
|
3931
3918
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
3932
3919
|
}
|
|
3933
3920
|
datetime(options) {
|
|
3934
|
-
var _a, _b;
|
|
3935
3921
|
if (typeof options === "string") {
|
|
3936
3922
|
return this._addCheck({
|
|
3937
3923
|
kind: "datetime",
|
|
@@ -3943,10 +3929,10 @@ class ZodString extends ZodType {
|
|
|
3943
3929
|
}
|
|
3944
3930
|
return this._addCheck({
|
|
3945
3931
|
kind: "datetime",
|
|
3946
|
-
precision: typeof
|
|
3947
|
-
offset:
|
|
3948
|
-
local:
|
|
3949
|
-
...errorUtil.errToObj(options
|
|
3932
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3933
|
+
offset: options?.offset ?? false,
|
|
3934
|
+
local: options?.local ?? false,
|
|
3935
|
+
...errorUtil.errToObj(options?.message)
|
|
3950
3936
|
});
|
|
3951
3937
|
}
|
|
3952
3938
|
date(message) {
|
|
@@ -3962,8 +3948,8 @@ class ZodString extends ZodType {
|
|
|
3962
3948
|
}
|
|
3963
3949
|
return this._addCheck({
|
|
3964
3950
|
kind: "time",
|
|
3965
|
-
precision: typeof
|
|
3966
|
-
...errorUtil.errToObj(options
|
|
3951
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3952
|
+
...errorUtil.errToObj(options?.message)
|
|
3967
3953
|
});
|
|
3968
3954
|
}
|
|
3969
3955
|
duration(message) {
|
|
@@ -3980,8 +3966,8 @@ class ZodString extends ZodType {
|
|
|
3980
3966
|
return this._addCheck({
|
|
3981
3967
|
kind: "includes",
|
|
3982
3968
|
value,
|
|
3983
|
-
position: options
|
|
3984
|
-
...errorUtil.errToObj(options
|
|
3969
|
+
position: options?.position,
|
|
3970
|
+
...errorUtil.errToObj(options?.message)
|
|
3985
3971
|
});
|
|
3986
3972
|
}
|
|
3987
3973
|
startsWith(value, message) {
|
|
@@ -4113,11 +4099,10 @@ class ZodString extends ZodType {
|
|
|
4113
4099
|
}
|
|
4114
4100
|
}
|
|
4115
4101
|
ZodString.create = (params) => {
|
|
4116
|
-
var _a;
|
|
4117
4102
|
return new ZodString({
|
|
4118
4103
|
checks: [],
|
|
4119
4104
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
4120
|
-
coerce:
|
|
4105
|
+
coerce: params?.coerce ?? false,
|
|
4121
4106
|
...processCreateParams(params)
|
|
4122
4107
|
});
|
|
4123
4108
|
};
|
|
@@ -4125,9 +4110,9 @@ function floatSafeRemainder(val, step) {
|
|
|
4125
4110
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
4126
4111
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
4127
4112
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
4128
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
4129
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
4130
|
-
return valInt % stepInt /
|
|
4113
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
4114
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
4115
|
+
return valInt % stepInt / 10 ** decCount;
|
|
4131
4116
|
}
|
|
4132
4117
|
class ZodNumber extends ZodType {
|
|
4133
4118
|
constructor() {
|
|
@@ -4337,7 +4322,8 @@ class ZodNumber extends ZodType {
|
|
|
4337
4322
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
4338
4323
|
}
|
|
4339
4324
|
get isFinite() {
|
|
4340
|
-
let max2 = null
|
|
4325
|
+
let max2 = null;
|
|
4326
|
+
let min2 = null;
|
|
4341
4327
|
for (const ch of this._def.checks) {
|
|
4342
4328
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
4343
4329
|
return true;
|
|
@@ -4356,7 +4342,7 @@ ZodNumber.create = (params) => {
|
|
|
4356
4342
|
return new ZodNumber({
|
|
4357
4343
|
checks: [],
|
|
4358
4344
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
4359
|
-
coerce:
|
|
4345
|
+
coerce: params?.coerce || false,
|
|
4360
4346
|
...processCreateParams(params)
|
|
4361
4347
|
});
|
|
4362
4348
|
};
|
|
@@ -4370,7 +4356,7 @@ class ZodBigInt extends ZodType {
|
|
|
4370
4356
|
if (this._def.coerce) {
|
|
4371
4357
|
try {
|
|
4372
4358
|
input.data = BigInt(input.data);
|
|
4373
|
-
} catch
|
|
4359
|
+
} catch {
|
|
4374
4360
|
return this._getInvalidInput(input);
|
|
4375
4361
|
}
|
|
4376
4362
|
}
|
|
@@ -4525,11 +4511,10 @@ class ZodBigInt extends ZodType {
|
|
|
4525
4511
|
}
|
|
4526
4512
|
}
|
|
4527
4513
|
ZodBigInt.create = (params) => {
|
|
4528
|
-
var _a;
|
|
4529
4514
|
return new ZodBigInt({
|
|
4530
4515
|
checks: [],
|
|
4531
4516
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
4532
|
-
coerce:
|
|
4517
|
+
coerce: params?.coerce ?? false,
|
|
4533
4518
|
...processCreateParams(params)
|
|
4534
4519
|
});
|
|
4535
4520
|
};
|
|
@@ -4554,7 +4539,7 @@ class ZodBoolean extends ZodType {
|
|
|
4554
4539
|
ZodBoolean.create = (params) => {
|
|
4555
4540
|
return new ZodBoolean({
|
|
4556
4541
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
4557
|
-
coerce:
|
|
4542
|
+
coerce: params?.coerce || false,
|
|
4558
4543
|
...processCreateParams(params)
|
|
4559
4544
|
});
|
|
4560
4545
|
};
|
|
@@ -4573,7 +4558,7 @@ class ZodDate extends ZodType {
|
|
|
4573
4558
|
});
|
|
4574
4559
|
return INVALID;
|
|
4575
4560
|
}
|
|
4576
|
-
if (isNaN(input.data.getTime())) {
|
|
4561
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
4577
4562
|
const ctx2 = this._getOrReturnCtx(input);
|
|
4578
4563
|
addIssueToContext(ctx2, {
|
|
4579
4564
|
code: ZodIssueCode.invalid_date
|
|
@@ -4662,7 +4647,7 @@ class ZodDate extends ZodType {
|
|
|
4662
4647
|
ZodDate.create = (params) => {
|
|
4663
4648
|
return new ZodDate({
|
|
4664
4649
|
checks: [],
|
|
4665
|
-
coerce:
|
|
4650
|
+
coerce: params?.coerce || false,
|
|
4666
4651
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
4667
4652
|
...processCreateParams(params)
|
|
4668
4653
|
});
|
|
@@ -4937,7 +4922,8 @@ class ZodObject extends ZodType {
|
|
|
4937
4922
|
return this._cached;
|
|
4938
4923
|
const shape = this._def.shape();
|
|
4939
4924
|
const keys2 = util.objectKeys(shape);
|
|
4940
|
-
|
|
4925
|
+
this._cached = { shape, keys: keys2 };
|
|
4926
|
+
return this._cached;
|
|
4941
4927
|
}
|
|
4942
4928
|
_parse(input) {
|
|
4943
4929
|
const parsedType = this._getType(input);
|
|
@@ -5035,11 +5021,10 @@ class ZodObject extends ZodType {
|
|
|
5035
5021
|
unknownKeys: "strict",
|
|
5036
5022
|
...message !== void 0 ? {
|
|
5037
5023
|
errorMap: (issue, ctx) => {
|
|
5038
|
-
|
|
5039
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
5024
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
5040
5025
|
if (issue.code === "unrecognized_keys")
|
|
5041
5026
|
return {
|
|
5042
|
-
message:
|
|
5027
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
5043
5028
|
};
|
|
5044
5029
|
return {
|
|
5045
5030
|
message: defaultError
|
|
@@ -5170,11 +5155,11 @@ class ZodObject extends ZodType {
|
|
|
5170
5155
|
}
|
|
5171
5156
|
pick(mask) {
|
|
5172
5157
|
const shape = {};
|
|
5173
|
-
util.objectKeys(mask)
|
|
5158
|
+
for (const key of util.objectKeys(mask)) {
|
|
5174
5159
|
if (mask[key] && this.shape[key]) {
|
|
5175
5160
|
shape[key] = this.shape[key];
|
|
5176
5161
|
}
|
|
5177
|
-
}
|
|
5162
|
+
}
|
|
5178
5163
|
return new ZodObject({
|
|
5179
5164
|
...this._def,
|
|
5180
5165
|
shape: () => shape
|
|
@@ -5182,11 +5167,11 @@ class ZodObject extends ZodType {
|
|
|
5182
5167
|
}
|
|
5183
5168
|
omit(mask) {
|
|
5184
5169
|
const shape = {};
|
|
5185
|
-
util.objectKeys(this.shape)
|
|
5170
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5186
5171
|
if (!mask[key]) {
|
|
5187
5172
|
shape[key] = this.shape[key];
|
|
5188
5173
|
}
|
|
5189
|
-
}
|
|
5174
|
+
}
|
|
5190
5175
|
return new ZodObject({
|
|
5191
5176
|
...this._def,
|
|
5192
5177
|
shape: () => shape
|
|
@@ -5200,14 +5185,14 @@ class ZodObject extends ZodType {
|
|
|
5200
5185
|
}
|
|
5201
5186
|
partial(mask) {
|
|
5202
5187
|
const newShape = {};
|
|
5203
|
-
util.objectKeys(this.shape)
|
|
5188
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5204
5189
|
const fieldSchema = this.shape[key];
|
|
5205
5190
|
if (mask && !mask[key]) {
|
|
5206
5191
|
newShape[key] = fieldSchema;
|
|
5207
5192
|
} else {
|
|
5208
5193
|
newShape[key] = fieldSchema.optional();
|
|
5209
5194
|
}
|
|
5210
|
-
}
|
|
5195
|
+
}
|
|
5211
5196
|
return new ZodObject({
|
|
5212
5197
|
...this._def,
|
|
5213
5198
|
shape: () => newShape
|
|
@@ -5215,7 +5200,7 @@ class ZodObject extends ZodType {
|
|
|
5215
5200
|
}
|
|
5216
5201
|
required(mask) {
|
|
5217
5202
|
const newShape = {};
|
|
5218
|
-
util.objectKeys(this.shape)
|
|
5203
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
5219
5204
|
if (mask && !mask[key]) {
|
|
5220
5205
|
newShape[key] = this.shape[key];
|
|
5221
5206
|
} else {
|
|
@@ -5226,7 +5211,7 @@ class ZodObject extends ZodType {
|
|
|
5226
5211
|
}
|
|
5227
5212
|
newShape[key] = newField;
|
|
5228
5213
|
}
|
|
5229
|
-
}
|
|
5214
|
+
}
|
|
5230
5215
|
return new ZodObject({
|
|
5231
5216
|
...this._def,
|
|
5232
5217
|
shape: () => newShape
|
|
@@ -5354,113 +5339,6 @@ ZodUnion.create = (types, params) => {
|
|
|
5354
5339
|
...processCreateParams(params)
|
|
5355
5340
|
});
|
|
5356
5341
|
};
|
|
5357
|
-
const getDiscriminator = (type) => {
|
|
5358
|
-
if (type instanceof ZodLazy) {
|
|
5359
|
-
return getDiscriminator(type.schema);
|
|
5360
|
-
} else if (type instanceof ZodEffects) {
|
|
5361
|
-
return getDiscriminator(type.innerType());
|
|
5362
|
-
} else if (type instanceof ZodLiteral) {
|
|
5363
|
-
return [type.value];
|
|
5364
|
-
} else if (type instanceof ZodEnum) {
|
|
5365
|
-
return type.options;
|
|
5366
|
-
} else if (type instanceof ZodNativeEnum) {
|
|
5367
|
-
return util.objectValues(type.enum);
|
|
5368
|
-
} else if (type instanceof ZodDefault) {
|
|
5369
|
-
return getDiscriminator(type._def.innerType);
|
|
5370
|
-
} else if (type instanceof ZodUndefined) {
|
|
5371
|
-
return [void 0];
|
|
5372
|
-
} else if (type instanceof ZodNull) {
|
|
5373
|
-
return [null];
|
|
5374
|
-
} else if (type instanceof ZodOptional) {
|
|
5375
|
-
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
5376
|
-
} else if (type instanceof ZodNullable) {
|
|
5377
|
-
return [null, ...getDiscriminator(type.unwrap())];
|
|
5378
|
-
} else if (type instanceof ZodBranded) {
|
|
5379
|
-
return getDiscriminator(type.unwrap());
|
|
5380
|
-
} else if (type instanceof ZodReadonly) {
|
|
5381
|
-
return getDiscriminator(type.unwrap());
|
|
5382
|
-
} else if (type instanceof ZodCatch) {
|
|
5383
|
-
return getDiscriminator(type._def.innerType);
|
|
5384
|
-
} else {
|
|
5385
|
-
return [];
|
|
5386
|
-
}
|
|
5387
|
-
};
|
|
5388
|
-
class ZodDiscriminatedUnion extends ZodType {
|
|
5389
|
-
_parse(input) {
|
|
5390
|
-
const { ctx } = this._processInputParams(input);
|
|
5391
|
-
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5392
|
-
addIssueToContext(ctx, {
|
|
5393
|
-
code: ZodIssueCode.invalid_type,
|
|
5394
|
-
expected: ZodParsedType.object,
|
|
5395
|
-
received: ctx.parsedType
|
|
5396
|
-
});
|
|
5397
|
-
return INVALID;
|
|
5398
|
-
}
|
|
5399
|
-
const discriminator = this.discriminator;
|
|
5400
|
-
const discriminatorValue = ctx.data[discriminator];
|
|
5401
|
-
const option = this.optionsMap.get(discriminatorValue);
|
|
5402
|
-
if (!option) {
|
|
5403
|
-
addIssueToContext(ctx, {
|
|
5404
|
-
code: ZodIssueCode.invalid_union_discriminator,
|
|
5405
|
-
options: Array.from(this.optionsMap.keys()),
|
|
5406
|
-
path: [discriminator]
|
|
5407
|
-
});
|
|
5408
|
-
return INVALID;
|
|
5409
|
-
}
|
|
5410
|
-
if (ctx.common.async) {
|
|
5411
|
-
return option._parseAsync({
|
|
5412
|
-
data: ctx.data,
|
|
5413
|
-
path: ctx.path,
|
|
5414
|
-
parent: ctx
|
|
5415
|
-
});
|
|
5416
|
-
} else {
|
|
5417
|
-
return option._parseSync({
|
|
5418
|
-
data: ctx.data,
|
|
5419
|
-
path: ctx.path,
|
|
5420
|
-
parent: ctx
|
|
5421
|
-
});
|
|
5422
|
-
}
|
|
5423
|
-
}
|
|
5424
|
-
get discriminator() {
|
|
5425
|
-
return this._def.discriminator;
|
|
5426
|
-
}
|
|
5427
|
-
get options() {
|
|
5428
|
-
return this._def.options;
|
|
5429
|
-
}
|
|
5430
|
-
get optionsMap() {
|
|
5431
|
-
return this._def.optionsMap;
|
|
5432
|
-
}
|
|
5433
|
-
/**
|
|
5434
|
-
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
5435
|
-
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
5436
|
-
* have a different value for each object in the union.
|
|
5437
|
-
* @param discriminator the name of the discriminator property
|
|
5438
|
-
* @param types an array of object schemas
|
|
5439
|
-
* @param params
|
|
5440
|
-
*/
|
|
5441
|
-
static create(discriminator, options, params) {
|
|
5442
|
-
const optionsMap = /* @__PURE__ */ new Map();
|
|
5443
|
-
for (const type of options) {
|
|
5444
|
-
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
5445
|
-
if (!discriminatorValues.length) {
|
|
5446
|
-
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
5447
|
-
}
|
|
5448
|
-
for (const value of discriminatorValues) {
|
|
5449
|
-
if (optionsMap.has(value)) {
|
|
5450
|
-
throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
5451
|
-
}
|
|
5452
|
-
optionsMap.set(value, type);
|
|
5453
|
-
}
|
|
5454
|
-
}
|
|
5455
|
-
return new ZodDiscriminatedUnion({
|
|
5456
|
-
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
5457
|
-
discriminator,
|
|
5458
|
-
options,
|
|
5459
|
-
optionsMap,
|
|
5460
|
-
...processCreateParams(params)
|
|
5461
|
-
});
|
|
5462
|
-
}
|
|
5463
|
-
}
|
|
5464
5342
|
function mergeValues(a, b) {
|
|
5465
5343
|
const aType = getParsedType(a);
|
|
5466
5344
|
const bType = getParsedType(b);
|
|
@@ -5619,59 +5497,6 @@ ZodTuple.create = (schemas, params) => {
|
|
|
5619
5497
|
...processCreateParams(params)
|
|
5620
5498
|
});
|
|
5621
5499
|
};
|
|
5622
|
-
class ZodRecord extends ZodType {
|
|
5623
|
-
get keySchema() {
|
|
5624
|
-
return this._def.keyType;
|
|
5625
|
-
}
|
|
5626
|
-
get valueSchema() {
|
|
5627
|
-
return this._def.valueType;
|
|
5628
|
-
}
|
|
5629
|
-
_parse(input) {
|
|
5630
|
-
const { status, ctx } = this._processInputParams(input);
|
|
5631
|
-
if (ctx.parsedType !== ZodParsedType.object) {
|
|
5632
|
-
addIssueToContext(ctx, {
|
|
5633
|
-
code: ZodIssueCode.invalid_type,
|
|
5634
|
-
expected: ZodParsedType.object,
|
|
5635
|
-
received: ctx.parsedType
|
|
5636
|
-
});
|
|
5637
|
-
return INVALID;
|
|
5638
|
-
}
|
|
5639
|
-
const pairs = [];
|
|
5640
|
-
const keyType = this._def.keyType;
|
|
5641
|
-
const valueType = this._def.valueType;
|
|
5642
|
-
for (const key in ctx.data) {
|
|
5643
|
-
pairs.push({
|
|
5644
|
-
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
5645
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
5646
|
-
alwaysSet: key in ctx.data
|
|
5647
|
-
});
|
|
5648
|
-
}
|
|
5649
|
-
if (ctx.common.async) {
|
|
5650
|
-
return ParseStatus.mergeObjectAsync(status, pairs);
|
|
5651
|
-
} else {
|
|
5652
|
-
return ParseStatus.mergeObjectSync(status, pairs);
|
|
5653
|
-
}
|
|
5654
|
-
}
|
|
5655
|
-
get element() {
|
|
5656
|
-
return this._def.valueType;
|
|
5657
|
-
}
|
|
5658
|
-
static create(first, second, third) {
|
|
5659
|
-
if (second instanceof ZodType) {
|
|
5660
|
-
return new ZodRecord({
|
|
5661
|
-
keyType: first,
|
|
5662
|
-
valueType: second,
|
|
5663
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5664
|
-
...processCreateParams(third)
|
|
5665
|
-
});
|
|
5666
|
-
}
|
|
5667
|
-
return new ZodRecord({
|
|
5668
|
-
keyType: ZodString.create(),
|
|
5669
|
-
valueType: first,
|
|
5670
|
-
typeName: ZodFirstPartyTypeKind.ZodRecord,
|
|
5671
|
-
...processCreateParams(second)
|
|
5672
|
-
});
|
|
5673
|
-
}
|
|
5674
|
-
}
|
|
5675
5500
|
class ZodMap extends ZodType {
|
|
5676
5501
|
get keySchema() {
|
|
5677
5502
|
return this._def.keyType;
|
|
@@ -5823,121 +5648,6 @@ ZodSet.create = (valueType, params) => {
|
|
|
5823
5648
|
...processCreateParams(params)
|
|
5824
5649
|
});
|
|
5825
5650
|
};
|
|
5826
|
-
class ZodFunction extends ZodType {
|
|
5827
|
-
constructor() {
|
|
5828
|
-
super(...arguments);
|
|
5829
|
-
this.validate = this.implement;
|
|
5830
|
-
}
|
|
5831
|
-
_parse(input) {
|
|
5832
|
-
const { ctx } = this._processInputParams(input);
|
|
5833
|
-
if (ctx.parsedType !== ZodParsedType.function) {
|
|
5834
|
-
addIssueToContext(ctx, {
|
|
5835
|
-
code: ZodIssueCode.invalid_type,
|
|
5836
|
-
expected: ZodParsedType.function,
|
|
5837
|
-
received: ctx.parsedType
|
|
5838
|
-
});
|
|
5839
|
-
return INVALID;
|
|
5840
|
-
}
|
|
5841
|
-
function makeArgsIssue(args, error) {
|
|
5842
|
-
return makeIssue({
|
|
5843
|
-
data: args,
|
|
5844
|
-
path: ctx.path,
|
|
5845
|
-
errorMaps: [
|
|
5846
|
-
ctx.common.contextualErrorMap,
|
|
5847
|
-
ctx.schemaErrorMap,
|
|
5848
|
-
getErrorMap(),
|
|
5849
|
-
errorMap
|
|
5850
|
-
].filter((x) => !!x),
|
|
5851
|
-
issueData: {
|
|
5852
|
-
code: ZodIssueCode.invalid_arguments,
|
|
5853
|
-
argumentsError: error
|
|
5854
|
-
}
|
|
5855
|
-
});
|
|
5856
|
-
}
|
|
5857
|
-
function makeReturnsIssue(returns, error) {
|
|
5858
|
-
return makeIssue({
|
|
5859
|
-
data: returns,
|
|
5860
|
-
path: ctx.path,
|
|
5861
|
-
errorMaps: [
|
|
5862
|
-
ctx.common.contextualErrorMap,
|
|
5863
|
-
ctx.schemaErrorMap,
|
|
5864
|
-
getErrorMap(),
|
|
5865
|
-
errorMap
|
|
5866
|
-
].filter((x) => !!x),
|
|
5867
|
-
issueData: {
|
|
5868
|
-
code: ZodIssueCode.invalid_return_type,
|
|
5869
|
-
returnTypeError: error
|
|
5870
|
-
}
|
|
5871
|
-
});
|
|
5872
|
-
}
|
|
5873
|
-
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
5874
|
-
const fn = ctx.data;
|
|
5875
|
-
if (this._def.returns instanceof ZodPromise) {
|
|
5876
|
-
const me = this;
|
|
5877
|
-
return OK(async function(...args) {
|
|
5878
|
-
const error = new ZodError([]);
|
|
5879
|
-
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
5880
|
-
error.addIssue(makeArgsIssue(args, e));
|
|
5881
|
-
throw error;
|
|
5882
|
-
});
|
|
5883
|
-
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
5884
|
-
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
5885
|
-
error.addIssue(makeReturnsIssue(result, e));
|
|
5886
|
-
throw error;
|
|
5887
|
-
});
|
|
5888
|
-
return parsedReturns;
|
|
5889
|
-
});
|
|
5890
|
-
} else {
|
|
5891
|
-
const me = this;
|
|
5892
|
-
return OK(function(...args) {
|
|
5893
|
-
const parsedArgs = me._def.args.safeParse(args, params);
|
|
5894
|
-
if (!parsedArgs.success) {
|
|
5895
|
-
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
5896
|
-
}
|
|
5897
|
-
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
5898
|
-
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
5899
|
-
if (!parsedReturns.success) {
|
|
5900
|
-
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
5901
|
-
}
|
|
5902
|
-
return parsedReturns.data;
|
|
5903
|
-
});
|
|
5904
|
-
}
|
|
5905
|
-
}
|
|
5906
|
-
parameters() {
|
|
5907
|
-
return this._def.args;
|
|
5908
|
-
}
|
|
5909
|
-
returnType() {
|
|
5910
|
-
return this._def.returns;
|
|
5911
|
-
}
|
|
5912
|
-
args(...items) {
|
|
5913
|
-
return new ZodFunction({
|
|
5914
|
-
...this._def,
|
|
5915
|
-
args: ZodTuple.create(items).rest(ZodUnknown.create())
|
|
5916
|
-
});
|
|
5917
|
-
}
|
|
5918
|
-
returns(returnType) {
|
|
5919
|
-
return new ZodFunction({
|
|
5920
|
-
...this._def,
|
|
5921
|
-
returns: returnType
|
|
5922
|
-
});
|
|
5923
|
-
}
|
|
5924
|
-
implement(func) {
|
|
5925
|
-
const validatedFunc = this.parse(func);
|
|
5926
|
-
return validatedFunc;
|
|
5927
|
-
}
|
|
5928
|
-
strictImplement(func) {
|
|
5929
|
-
const validatedFunc = this.parse(func);
|
|
5930
|
-
return validatedFunc;
|
|
5931
|
-
}
|
|
5932
|
-
static create(args, returns, params) {
|
|
5933
|
-
return new ZodFunction({
|
|
5934
|
-
args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
|
|
5935
|
-
returns: returns || ZodUnknown.create(),
|
|
5936
|
-
typeName: ZodFirstPartyTypeKind.ZodFunction,
|
|
5937
|
-
...processCreateParams(params)
|
|
5938
|
-
});
|
|
5939
|
-
}
|
|
5940
|
-
}
|
|
5941
5651
|
class ZodLazy extends ZodType {
|
|
5942
5652
|
get schema() {
|
|
5943
5653
|
return this._def.getter();
|
|
@@ -5987,10 +5697,6 @@ function createZodEnum(values, params) {
|
|
|
5987
5697
|
});
|
|
5988
5698
|
}
|
|
5989
5699
|
class ZodEnum extends ZodType {
|
|
5990
|
-
constructor() {
|
|
5991
|
-
super(...arguments);
|
|
5992
|
-
_ZodEnum_cache.set(this, void 0);
|
|
5993
|
-
}
|
|
5994
5700
|
_parse(input) {
|
|
5995
5701
|
if (typeof input.data !== "string") {
|
|
5996
5702
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -6002,10 +5708,10 @@ class ZodEnum extends ZodType {
|
|
|
6002
5708
|
});
|
|
6003
5709
|
return INVALID;
|
|
6004
5710
|
}
|
|
6005
|
-
if (!
|
|
6006
|
-
|
|
5711
|
+
if (!this._cache) {
|
|
5712
|
+
this._cache = new Set(this._def.values);
|
|
6007
5713
|
}
|
|
6008
|
-
if (!
|
|
5714
|
+
if (!this._cache.has(input.data)) {
|
|
6009
5715
|
const ctx = this._getOrReturnCtx(input);
|
|
6010
5716
|
const expectedValues = this._def.values;
|
|
6011
5717
|
addIssueToContext(ctx, {
|
|
@@ -6054,13 +5760,8 @@ class ZodEnum extends ZodType {
|
|
|
6054
5760
|
});
|
|
6055
5761
|
}
|
|
6056
5762
|
}
|
|
6057
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
6058
5763
|
ZodEnum.create = createZodEnum;
|
|
6059
5764
|
class ZodNativeEnum extends ZodType {
|
|
6060
|
-
constructor() {
|
|
6061
|
-
super(...arguments);
|
|
6062
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
6063
|
-
}
|
|
6064
5765
|
_parse(input) {
|
|
6065
5766
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
6066
5767
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -6073,10 +5774,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
6073
5774
|
});
|
|
6074
5775
|
return INVALID;
|
|
6075
5776
|
}
|
|
6076
|
-
if (!
|
|
6077
|
-
|
|
5777
|
+
if (!this._cache) {
|
|
5778
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
6078
5779
|
}
|
|
6079
|
-
if (!
|
|
5780
|
+
if (!this._cache.has(input.data)) {
|
|
6080
5781
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
6081
5782
|
addIssueToContext(ctx, {
|
|
6082
5783
|
received: ctx.data,
|
|
@@ -6091,7 +5792,6 @@ class ZodNativeEnum extends ZodType {
|
|
|
6091
5792
|
return this._def.values;
|
|
6092
5793
|
}
|
|
6093
5794
|
}
|
|
6094
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
6095
5795
|
ZodNativeEnum.create = (values, params) => {
|
|
6096
5796
|
return new ZodNativeEnum({
|
|
6097
5797
|
values,
|
|
@@ -6232,7 +5932,7 @@ class ZodEffects extends ZodType {
|
|
|
6232
5932
|
parent: ctx
|
|
6233
5933
|
});
|
|
6234
5934
|
if (!isValid$3(base))
|
|
6235
|
-
return
|
|
5935
|
+
return INVALID;
|
|
6236
5936
|
const result = effect.transform(base.value, checkCtx);
|
|
6237
5937
|
if (result instanceof Promise) {
|
|
6238
5938
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -6241,8 +5941,11 @@ class ZodEffects extends ZodType {
|
|
|
6241
5941
|
} else {
|
|
6242
5942
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
6243
5943
|
if (!isValid$3(base))
|
|
6244
|
-
return
|
|
6245
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5944
|
+
return INVALID;
|
|
5945
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5946
|
+
status: status.value,
|
|
5947
|
+
value: result
|
|
5948
|
+
}));
|
|
6246
5949
|
});
|
|
6247
5950
|
}
|
|
6248
5951
|
}
|
|
@@ -6402,7 +6105,6 @@ ZodNaN.create = (params) => {
|
|
|
6402
6105
|
...processCreateParams(params)
|
|
6403
6106
|
});
|
|
6404
6107
|
};
|
|
6405
|
-
const BRAND = Symbol("zod_brand");
|
|
6406
6108
|
class ZodBranded extends ZodType {
|
|
6407
6109
|
_parse(input) {
|
|
6408
6110
|
const { ctx } = this._processInputParams(input);
|
|
@@ -6494,38 +6196,6 @@ ZodReadonly.create = (type, params) => {
|
|
|
6494
6196
|
...processCreateParams(params)
|
|
6495
6197
|
});
|
|
6496
6198
|
};
|
|
6497
|
-
function cleanParams(params, data) {
|
|
6498
|
-
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
6499
|
-
const p2 = typeof p === "string" ? { message: p } : p;
|
|
6500
|
-
return p2;
|
|
6501
|
-
}
|
|
6502
|
-
function custom(check, _params = {}, fatal) {
|
|
6503
|
-
if (check)
|
|
6504
|
-
return ZodAny.create().superRefine((data, ctx) => {
|
|
6505
|
-
var _a, _b;
|
|
6506
|
-
const r = check(data);
|
|
6507
|
-
if (r instanceof Promise) {
|
|
6508
|
-
return r.then((r2) => {
|
|
6509
|
-
var _a2, _b2;
|
|
6510
|
-
if (!r2) {
|
|
6511
|
-
const params = cleanParams(_params, data);
|
|
6512
|
-
const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
6513
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6514
|
-
}
|
|
6515
|
-
});
|
|
6516
|
-
}
|
|
6517
|
-
if (!r) {
|
|
6518
|
-
const params = cleanParams(_params, data);
|
|
6519
|
-
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
6520
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
6521
|
-
}
|
|
6522
|
-
return;
|
|
6523
|
-
});
|
|
6524
|
-
return ZodAny.create();
|
|
6525
|
-
}
|
|
6526
|
-
const late = {
|
|
6527
|
-
object: ZodObject.lazycreate
|
|
6528
|
-
};
|
|
6529
6199
|
var ZodFirstPartyTypeKind;
|
|
6530
6200
|
(function(ZodFirstPartyTypeKind2) {
|
|
6531
6201
|
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
@@ -6565,177 +6235,20 @@ var ZodFirstPartyTypeKind;
|
|
|
6565
6235
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
6566
6236
|
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
6567
6237
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
6568
|
-
const instanceOfType = (cls, params = {
|
|
6569
|
-
message: `Input not instance of ${cls.name}`
|
|
6570
|
-
}) => custom((data) => data instanceof cls, params);
|
|
6571
6238
|
const stringType = ZodString.create;
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
const unknownType = ZodUnknown.create;
|
|
6582
|
-
const neverType = ZodNever.create;
|
|
6583
|
-
const voidType = ZodVoid.create;
|
|
6584
|
-
const arrayType = ZodArray.create;
|
|
6585
|
-
const objectType = ZodObject.create;
|
|
6586
|
-
const strictObjectType = ZodObject.strictCreate;
|
|
6587
|
-
const unionType = ZodUnion.create;
|
|
6588
|
-
const discriminatedUnionType = ZodDiscriminatedUnion.create;
|
|
6589
|
-
const intersectionType = ZodIntersection.create;
|
|
6590
|
-
const tupleType = ZodTuple.create;
|
|
6591
|
-
const recordType = ZodRecord.create;
|
|
6592
|
-
const mapType = ZodMap.create;
|
|
6593
|
-
const setType = ZodSet.create;
|
|
6594
|
-
const functionType = ZodFunction.create;
|
|
6595
|
-
const lazyType = ZodLazy.create;
|
|
6596
|
-
const literalType = ZodLiteral.create;
|
|
6597
|
-
const enumType = ZodEnum.create;
|
|
6598
|
-
const nativeEnumType = ZodNativeEnum.create;
|
|
6599
|
-
const promiseType = ZodPromise.create;
|
|
6600
|
-
const effectsType = ZodEffects.create;
|
|
6601
|
-
const optionalType = ZodOptional.create;
|
|
6602
|
-
const nullableType = ZodNullable.create;
|
|
6603
|
-
const preprocessType = ZodEffects.createWithPreprocess;
|
|
6604
|
-
const pipelineType = ZodPipeline.create;
|
|
6605
|
-
const ostring = () => stringType().optional();
|
|
6606
|
-
const onumber = () => numberType().optional();
|
|
6607
|
-
const oboolean = () => booleanType().optional();
|
|
6608
|
-
const coerce = {
|
|
6609
|
-
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
6610
|
-
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
6611
|
-
boolean: (arg) => ZodBoolean.create({
|
|
6612
|
-
...arg,
|
|
6613
|
-
coerce: true
|
|
6614
|
-
}),
|
|
6615
|
-
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
6616
|
-
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
6617
|
-
};
|
|
6618
|
-
const NEVER = INVALID;
|
|
6619
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
6620
|
-
__proto__: null,
|
|
6621
|
-
defaultErrorMap: errorMap,
|
|
6622
|
-
setErrorMap,
|
|
6623
|
-
getErrorMap,
|
|
6624
|
-
makeIssue,
|
|
6625
|
-
EMPTY_PATH,
|
|
6626
|
-
addIssueToContext,
|
|
6627
|
-
ParseStatus,
|
|
6628
|
-
INVALID,
|
|
6629
|
-
DIRTY,
|
|
6630
|
-
OK,
|
|
6631
|
-
isAborted,
|
|
6632
|
-
isDirty,
|
|
6633
|
-
isValid: isValid$3,
|
|
6634
|
-
isAsync,
|
|
6635
|
-
get util() {
|
|
6636
|
-
return util;
|
|
6637
|
-
},
|
|
6638
|
-
get objectUtil() {
|
|
6639
|
-
return objectUtil;
|
|
6640
|
-
},
|
|
6641
|
-
ZodParsedType,
|
|
6642
|
-
getParsedType,
|
|
6643
|
-
ZodType,
|
|
6644
|
-
datetimeRegex,
|
|
6645
|
-
ZodString,
|
|
6646
|
-
ZodNumber,
|
|
6647
|
-
ZodBigInt,
|
|
6648
|
-
ZodBoolean,
|
|
6649
|
-
ZodDate,
|
|
6650
|
-
ZodSymbol,
|
|
6651
|
-
ZodUndefined,
|
|
6652
|
-
ZodNull,
|
|
6653
|
-
ZodAny,
|
|
6654
|
-
ZodUnknown,
|
|
6655
|
-
ZodNever,
|
|
6656
|
-
ZodVoid,
|
|
6657
|
-
ZodArray,
|
|
6658
|
-
ZodObject,
|
|
6659
|
-
ZodUnion,
|
|
6660
|
-
ZodDiscriminatedUnion,
|
|
6661
|
-
ZodIntersection,
|
|
6662
|
-
ZodTuple,
|
|
6663
|
-
ZodRecord,
|
|
6664
|
-
ZodMap,
|
|
6665
|
-
ZodSet,
|
|
6666
|
-
ZodFunction,
|
|
6667
|
-
ZodLazy,
|
|
6668
|
-
ZodLiteral,
|
|
6669
|
-
ZodEnum,
|
|
6670
|
-
ZodNativeEnum,
|
|
6671
|
-
ZodPromise,
|
|
6672
|
-
ZodEffects,
|
|
6673
|
-
ZodTransformer: ZodEffects,
|
|
6674
|
-
ZodOptional,
|
|
6675
|
-
ZodNullable,
|
|
6676
|
-
ZodDefault,
|
|
6677
|
-
ZodCatch,
|
|
6678
|
-
ZodNaN,
|
|
6679
|
-
BRAND,
|
|
6680
|
-
ZodBranded,
|
|
6681
|
-
ZodPipeline,
|
|
6682
|
-
ZodReadonly,
|
|
6683
|
-
custom,
|
|
6684
|
-
Schema: ZodType,
|
|
6685
|
-
ZodSchema: ZodType,
|
|
6686
|
-
late,
|
|
6687
|
-
get ZodFirstPartyTypeKind() {
|
|
6688
|
-
return ZodFirstPartyTypeKind;
|
|
6689
|
-
},
|
|
6690
|
-
coerce,
|
|
6691
|
-
any: anyType,
|
|
6692
|
-
array: arrayType,
|
|
6693
|
-
bigint: bigIntType,
|
|
6694
|
-
boolean: booleanType,
|
|
6695
|
-
date: dateType,
|
|
6696
|
-
discriminatedUnion: discriminatedUnionType,
|
|
6697
|
-
effect: effectsType,
|
|
6698
|
-
"enum": enumType,
|
|
6699
|
-
"function": functionType,
|
|
6700
|
-
"instanceof": instanceOfType,
|
|
6701
|
-
intersection: intersectionType,
|
|
6702
|
-
lazy: lazyType,
|
|
6703
|
-
literal: literalType,
|
|
6704
|
-
map: mapType,
|
|
6705
|
-
nan: nanType,
|
|
6706
|
-
nativeEnum: nativeEnumType,
|
|
6707
|
-
never: neverType,
|
|
6708
|
-
"null": nullType,
|
|
6709
|
-
nullable: nullableType,
|
|
6710
|
-
number: numberType,
|
|
6711
|
-
object: objectType,
|
|
6712
|
-
oboolean,
|
|
6713
|
-
onumber,
|
|
6714
|
-
optional: optionalType,
|
|
6715
|
-
ostring,
|
|
6716
|
-
pipeline: pipelineType,
|
|
6717
|
-
preprocess: preprocessType,
|
|
6718
|
-
promise: promiseType,
|
|
6719
|
-
record: recordType,
|
|
6720
|
-
set: setType,
|
|
6721
|
-
strictObject: strictObjectType,
|
|
6722
|
-
string: stringType,
|
|
6723
|
-
symbol: symbolType,
|
|
6724
|
-
transformer: effectsType,
|
|
6725
|
-
tuple: tupleType,
|
|
6726
|
-
"undefined": undefinedType,
|
|
6727
|
-
union: unionType,
|
|
6728
|
-
unknown: unknownType,
|
|
6729
|
-
"void": voidType,
|
|
6730
|
-
NEVER,
|
|
6731
|
-
ZodIssueCode,
|
|
6732
|
-
quotelessJson,
|
|
6733
|
-
ZodError
|
|
6734
|
-
});
|
|
6239
|
+
ZodNever.create;
|
|
6240
|
+
ZodArray.create;
|
|
6241
|
+
ZodUnion.create;
|
|
6242
|
+
ZodIntersection.create;
|
|
6243
|
+
ZodTuple.create;
|
|
6244
|
+
ZodEnum.create;
|
|
6245
|
+
ZodPromise.create;
|
|
6246
|
+
ZodOptional.create;
|
|
6247
|
+
ZodNullable.create;
|
|
6735
6248
|
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "qa", "PROD": true, "SSR": false, "VITE_MODULES_CARDS_ADMIN_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_CARDS_HOME_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_CERT_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_ENV": "qa", "VITE_MODULES_EVENTS_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_SSO_BACKEND_BASE_URL": "https://qa-ssoapi.6seconds.org", "VITE_MODULES_SSO_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org", "VITE_MODULES_TOOLS_FRONTEND_BASE_URL": "https://qa-sso.6seconds.org" };
|
|
6736
6249
|
const env = createEnv({
|
|
6737
6250
|
client: {
|
|
6738
|
-
VITE_MODULES_ENV:
|
|
6251
|
+
VITE_MODULES_ENV: stringType()
|
|
6739
6252
|
},
|
|
6740
6253
|
runtimeEnv: __vite_import_meta_env__
|
|
6741
6254
|
});
|
|
@@ -11448,19 +10961,20 @@ function createValidation(config) {
|
|
|
11448
10961
|
abortEarly = schema.spec.abortEarly,
|
|
11449
10962
|
disableStackTrace = schema.spec.disableStackTrace
|
|
11450
10963
|
} = options;
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
10964
|
+
const resolveOptions = {
|
|
10965
|
+
value,
|
|
10966
|
+
parent,
|
|
10967
|
+
context
|
|
10968
|
+
};
|
|
11454
10969
|
function createError(overrides = {}) {
|
|
11455
|
-
const nextParams = Object.assign({
|
|
10970
|
+
const nextParams = resolveParams(Object.assign({
|
|
11456
10971
|
value,
|
|
11457
10972
|
originalValue,
|
|
11458
10973
|
label: schema.spec.label,
|
|
11459
10974
|
path: overrides.path || path,
|
|
11460
10975
|
spec: schema.spec,
|
|
11461
10976
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
11462
|
-
}, params, overrides.params);
|
|
11463
|
-
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
10977
|
+
}, params, overrides.params), resolveOptions);
|
|
11464
10978
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
11465
10979
|
error.params = nextParams;
|
|
11466
10980
|
return error;
|
|
@@ -11472,7 +10986,9 @@ function createValidation(config) {
|
|
|
11472
10986
|
type: name,
|
|
11473
10987
|
from: options.from,
|
|
11474
10988
|
createError,
|
|
11475
|
-
resolve
|
|
10989
|
+
resolve(item) {
|
|
10990
|
+
return resolveMaybeRef(item, resolveOptions);
|
|
10991
|
+
},
|
|
11476
10992
|
options,
|
|
11477
10993
|
originalValue,
|
|
11478
10994
|
schema
|
|
@@ -11509,6 +11025,16 @@ function createValidation(config) {
|
|
|
11509
11025
|
validate.OPTIONS = config;
|
|
11510
11026
|
return validate;
|
|
11511
11027
|
}
|
|
11028
|
+
function resolveParams(params, options) {
|
|
11029
|
+
if (!params) return params;
|
|
11030
|
+
for (const key of Object.keys(params)) {
|
|
11031
|
+
params[key] = resolveMaybeRef(params[key], options);
|
|
11032
|
+
}
|
|
11033
|
+
return params;
|
|
11034
|
+
}
|
|
11035
|
+
function resolveMaybeRef(item, options) {
|
|
11036
|
+
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
11037
|
+
}
|
|
11512
11038
|
function getIn(schema, path, value, context = value) {
|
|
11513
11039
|
let parent, lastPart, lastPartDebug;
|
|
11514
11040
|
if (!path) return {
|
|
@@ -11605,6 +11131,69 @@ function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
|
11605
11131
|
}
|
|
11606
11132
|
return copy;
|
|
11607
11133
|
}
|
|
11134
|
+
function createStandardPath(path) {
|
|
11135
|
+
if (!(path != null && path.length)) {
|
|
11136
|
+
return void 0;
|
|
11137
|
+
}
|
|
11138
|
+
const segments = [];
|
|
11139
|
+
let currentSegment = "";
|
|
11140
|
+
let inBrackets = false;
|
|
11141
|
+
let inQuotes = false;
|
|
11142
|
+
for (let i = 0; i < path.length; i++) {
|
|
11143
|
+
const char = path[i];
|
|
11144
|
+
if (char === "[" && !inQuotes) {
|
|
11145
|
+
if (currentSegment) {
|
|
11146
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11147
|
+
currentSegment = "";
|
|
11148
|
+
}
|
|
11149
|
+
inBrackets = true;
|
|
11150
|
+
continue;
|
|
11151
|
+
}
|
|
11152
|
+
if (char === "]" && !inQuotes) {
|
|
11153
|
+
if (currentSegment) {
|
|
11154
|
+
if (/^\d+$/.test(currentSegment)) {
|
|
11155
|
+
segments.push(currentSegment);
|
|
11156
|
+
} else {
|
|
11157
|
+
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
11158
|
+
}
|
|
11159
|
+
currentSegment = "";
|
|
11160
|
+
}
|
|
11161
|
+
inBrackets = false;
|
|
11162
|
+
continue;
|
|
11163
|
+
}
|
|
11164
|
+
if (char === '"') {
|
|
11165
|
+
inQuotes = !inQuotes;
|
|
11166
|
+
continue;
|
|
11167
|
+
}
|
|
11168
|
+
if (char === "." && !inBrackets && !inQuotes) {
|
|
11169
|
+
if (currentSegment) {
|
|
11170
|
+
segments.push(currentSegment);
|
|
11171
|
+
currentSegment = "";
|
|
11172
|
+
}
|
|
11173
|
+
continue;
|
|
11174
|
+
}
|
|
11175
|
+
currentSegment += char;
|
|
11176
|
+
}
|
|
11177
|
+
if (currentSegment) {
|
|
11178
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
11179
|
+
}
|
|
11180
|
+
return segments;
|
|
11181
|
+
}
|
|
11182
|
+
function createStandardIssues(error, parentPath) {
|
|
11183
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11184
|
+
return error.errors.map((err) => ({
|
|
11185
|
+
message: err,
|
|
11186
|
+
path: createStandardPath(path)
|
|
11187
|
+
}));
|
|
11188
|
+
}
|
|
11189
|
+
function issuesFromValidationError(error, parentPath) {
|
|
11190
|
+
var _error$inner;
|
|
11191
|
+
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
11192
|
+
return createStandardIssues(error, parentPath);
|
|
11193
|
+
}
|
|
11194
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
11195
|
+
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
11196
|
+
}
|
|
11608
11197
|
class Schema {
|
|
11609
11198
|
constructor(options) {
|
|
11610
11199
|
this.type = void 0;
|
|
@@ -11734,9 +11323,11 @@ class Schema {
|
|
|
11734
11323
|
* Run the configured transform pipeline over an input value.
|
|
11735
11324
|
*/
|
|
11736
11325
|
cast(value, options = {}) {
|
|
11737
|
-
let resolvedSchema = this.resolve(Object.assign({
|
|
11326
|
+
let resolvedSchema = this.resolve(Object.assign({}, options, {
|
|
11738
11327
|
value
|
|
11739
|
-
|
|
11328
|
+
// parent: options.parent,
|
|
11329
|
+
// context: options.context,
|
|
11330
|
+
}));
|
|
11740
11331
|
let allowOptionality = options.assert === "ignore-optionality";
|
|
11741
11332
|
let result = resolvedSchema._cast(value, options);
|
|
11742
11333
|
if (options.assert !== false && !resolvedSchema.isType(result)) {
|
|
@@ -11753,7 +11344,7 @@ attempted value: ${formattedValue}
|
|
|
11753
11344
|
return result;
|
|
11754
11345
|
}
|
|
11755
11346
|
_cast(rawValue, options) {
|
|
11756
|
-
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this), rawValue);
|
|
11347
|
+
let value = rawValue === void 0 ? rawValue : this.transforms.reduce((prevValue, fn) => fn.call(this, prevValue, rawValue, this, options), rawValue);
|
|
11757
11348
|
if (value === void 0) {
|
|
11758
11349
|
value = this.getDefault(options);
|
|
11759
11350
|
}
|
|
@@ -12148,13 +11739,41 @@ attempted value: ${formattedValue}
|
|
|
12148
11739
|
type: next.type,
|
|
12149
11740
|
oneOf: next._whitelist.describe(),
|
|
12150
11741
|
notOneOf: next._blacklist.describe(),
|
|
12151
|
-
tests: next.tests.map((fn) =>
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
11742
|
+
tests: next.tests.filter((n, idx, list) => list.findIndex((c) => c.OPTIONS.name === n.OPTIONS.name) === idx).map((fn) => {
|
|
11743
|
+
const params = fn.OPTIONS.params && options ? resolveParams(Object.assign({}, fn.OPTIONS.params), options) : fn.OPTIONS.params;
|
|
11744
|
+
return {
|
|
11745
|
+
name: fn.OPTIONS.name,
|
|
11746
|
+
params
|
|
11747
|
+
};
|
|
11748
|
+
})
|
|
12155
11749
|
};
|
|
12156
11750
|
return description;
|
|
12157
11751
|
}
|
|
11752
|
+
get ["~standard"]() {
|
|
11753
|
+
const schema = this;
|
|
11754
|
+
const standard = {
|
|
11755
|
+
version: 1,
|
|
11756
|
+
vendor: "yup",
|
|
11757
|
+
async validate(value) {
|
|
11758
|
+
try {
|
|
11759
|
+
const result = await schema.validate(value, {
|
|
11760
|
+
abortEarly: false
|
|
11761
|
+
});
|
|
11762
|
+
return {
|
|
11763
|
+
value: result
|
|
11764
|
+
};
|
|
11765
|
+
} catch (err) {
|
|
11766
|
+
if (err instanceof ValidationError) {
|
|
11767
|
+
return {
|
|
11768
|
+
issues: issuesFromValidationError(err)
|
|
11769
|
+
};
|
|
11770
|
+
}
|
|
11771
|
+
throw err;
|
|
11772
|
+
}
|
|
11773
|
+
}
|
|
11774
|
+
};
|
|
11775
|
+
return standard;
|
|
11776
|
+
}
|
|
12158
11777
|
}
|
|
12159
11778
|
Schema.prototype.__isYupSchema__ = true;
|
|
12160
11779
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -12253,8 +11872,8 @@ class StringSchema extends Schema {
|
|
|
12253
11872
|
}
|
|
12254
11873
|
});
|
|
12255
11874
|
this.withMutation(() => {
|
|
12256
|
-
this.transform((value, _raw
|
|
12257
|
-
if (!
|
|
11875
|
+
this.transform((value, _raw) => {
|
|
11876
|
+
if (!this.spec.coerce || this.isType(value)) return value;
|
|
12258
11877
|
if (Array.isArray(value)) return value;
|
|
12259
11878
|
const strValue = value != null && value.toString ? value.toString() : value;
|
|
12260
11879
|
if (strValue === objStringTag) return value;
|
|
@@ -12456,15 +12075,15 @@ class NumberSchema extends Schema {
|
|
|
12456
12075
|
}
|
|
12457
12076
|
});
|
|
12458
12077
|
this.withMutation(() => {
|
|
12459
|
-
this.transform((value, _raw
|
|
12460
|
-
if (!
|
|
12078
|
+
this.transform((value, _raw) => {
|
|
12079
|
+
if (!this.spec.coerce) return value;
|
|
12461
12080
|
let parsed = value;
|
|
12462
12081
|
if (typeof parsed === "string") {
|
|
12463
12082
|
parsed = parsed.replace(/\s/g, "");
|
|
12464
12083
|
if (parsed === "") return NaN;
|
|
12465
12084
|
parsed = +parsed;
|
|
12466
12085
|
}
|
|
12467
|
-
if (
|
|
12086
|
+
if (this.isType(parsed) || parsed === null) return parsed;
|
|
12468
12087
|
return parseFloat(parsed);
|
|
12469
12088
|
});
|
|
12470
12089
|
});
|
|
@@ -12563,8 +12182,8 @@ class DateSchema extends Schema {
|
|
|
12563
12182
|
}
|
|
12564
12183
|
});
|
|
12565
12184
|
this.withMutation(() => {
|
|
12566
|
-
this.transform((value, _raw
|
|
12567
|
-
if (!
|
|
12185
|
+
this.transform((value, _raw) => {
|
|
12186
|
+
if (!this.spec.coerce || this.isType(value) || value === null) return value;
|
|
12568
12187
|
value = parseIsoDate(value);
|
|
12569
12188
|
return !isNaN(value) ? new Date(value) : DateSchema.INVALID_DATE;
|
|
12570
12189
|
});
|
|
@@ -12646,7 +12265,7 @@ function sortByKeyOrder(keys2) {
|
|
|
12646
12265
|
return findIndex(keys2, a) - findIndex(keys2, b);
|
|
12647
12266
|
};
|
|
12648
12267
|
}
|
|
12649
|
-
const parseJson = (value, _,
|
|
12268
|
+
const parseJson = (value, _, schema) => {
|
|
12650
12269
|
if (typeof value !== "string") {
|
|
12651
12270
|
return value;
|
|
12652
12271
|
}
|
|
@@ -12655,7 +12274,7 @@ const parseJson = (value, _, ctx) => {
|
|
|
12655
12274
|
parsed = JSON.parse(value);
|
|
12656
12275
|
} catch (err) {
|
|
12657
12276
|
}
|
|
12658
|
-
return
|
|
12277
|
+
return schema.isType(parsed) ? parsed : value;
|
|
12659
12278
|
};
|
|
12660
12279
|
function deepPartial(schema) {
|
|
12661
12280
|
if ("fields" in schema) {
|
|
@@ -12731,9 +12350,9 @@ class ObjectSchema extends Schema {
|
|
|
12731
12350
|
for (const prop of props) {
|
|
12732
12351
|
let field = fields[prop];
|
|
12733
12352
|
let exists = prop in value;
|
|
12353
|
+
let inputValue = value[prop];
|
|
12734
12354
|
if (field) {
|
|
12735
12355
|
let fieldValue;
|
|
12736
|
-
let inputValue = value[prop];
|
|
12737
12356
|
innerOptions.path = (options.path ? `${options.path}.` : "") + prop;
|
|
12738
12357
|
field = field.resolve({
|
|
12739
12358
|
value: inputValue,
|
|
@@ -12746,17 +12365,14 @@ class ObjectSchema extends Schema {
|
|
|
12746
12365
|
isChanged = isChanged || prop in value;
|
|
12747
12366
|
continue;
|
|
12748
12367
|
}
|
|
12749
|
-
fieldValue = !options.__validating || !strict ? (
|
|
12750
|
-
// TODO: use _cast, this is double resolving
|
|
12751
|
-
field.cast(value[prop], innerOptions)
|
|
12752
|
-
) : value[prop];
|
|
12368
|
+
fieldValue = !options.__validating || !strict ? field.cast(inputValue, innerOptions) : inputValue;
|
|
12753
12369
|
if (fieldValue !== void 0) {
|
|
12754
12370
|
intermediateValue[prop] = fieldValue;
|
|
12755
12371
|
}
|
|
12756
12372
|
} else if (exists && !strip) {
|
|
12757
|
-
intermediateValue[prop] =
|
|
12373
|
+
intermediateValue[prop] = inputValue;
|
|
12758
12374
|
}
|
|
12759
|
-
if (exists !== prop in intermediateValue || intermediateValue[prop] !==
|
|
12375
|
+
if (exists !== prop in intermediateValue || intermediateValue[prop] !== inputValue) {
|
|
12760
12376
|
isChanged = true;
|
|
12761
12377
|
}
|
|
12762
12378
|
}
|
|
@@ -13090,8 +12706,8 @@ function requireDist() {
|
|
|
13090
12706
|
dist.default = urlcat2;
|
|
13091
12707
|
function urlcatImpl(pathTemplate, params, baseUrl) {
|
|
13092
12708
|
var _a = path(pathTemplate, params), renderedPath = _a.renderedPath, remainingParams = _a.remainingParams;
|
|
13093
|
-
var
|
|
13094
|
-
var renderedQuery = query(
|
|
12709
|
+
var cleanParams = removeNullOrUndef(remainingParams);
|
|
12710
|
+
var renderedQuery = query(cleanParams);
|
|
13095
12711
|
var pathAndQuery = join(renderedPath, "?", renderedQuery);
|
|
13096
12712
|
return baseUrl ? join(baseUrl, "/", pathAndQuery) : pathAndQuery;
|
|
13097
12713
|
}
|
|
@@ -13868,9 +13484,9 @@ function ViewProfileDialog({ userData, setInitialState, isOpen }) {
|
|
|
13868
13484
|
}
|
|
13869
13485
|
),
|
|
13870
13486
|
/* @__PURE__ */ jsxRuntime.jsx(material.Divider, {}),
|
|
13871
|
-
|
|
13487
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h5", sx: { fontSize: "16px", fontWeight: "500" }, children: "Description" })
|
|
13872
13488
|
] }),
|
|
13873
|
-
|
|
13489
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Stack, { direction: "row", alignItems: "center", flexWrap: "wrap", spacing: 0.5, useFlexGap: true, children: userData?.certOfferToHelp })
|
|
13874
13490
|
] })
|
|
13875
13491
|
] }) })
|
|
13876
13492
|
] }),
|
|
@@ -14271,7 +13887,7 @@ function parseThreshold(scrollThreshold) {
|
|
|
14271
13887
|
}
|
|
14272
13888
|
var InfiniteScroll = (
|
|
14273
13889
|
/** @class */
|
|
14274
|
-
function(_super) {
|
|
13890
|
+
(function(_super) {
|
|
14275
13891
|
__extends(InfiniteScroll2, _super);
|
|
14276
13892
|
function InfiniteScroll2(props) {
|
|
14277
13893
|
var _this = _super.call(this, props) || this;
|
|
@@ -14486,7 +14102,7 @@ var InfiniteScroll = (
|
|
|
14486
14102
|
);
|
|
14487
14103
|
};
|
|
14488
14104
|
return InfiniteScroll2;
|
|
14489
|
-
}(React.Component)
|
|
14105
|
+
})(React.Component)
|
|
14490
14106
|
);
|
|
14491
14107
|
const Notification = ({ setInitialState, notificationAccessApps, initialState, t: t2 }) => {
|
|
14492
14108
|
const [notifications, setNotifications] = React.useState([]);
|
|
@@ -14948,7 +14564,7 @@ const Header = ({
|
|
|
14948
14564
|
}
|
|
14949
14565
|
};
|
|
14950
14566
|
React.useEffect(() => {
|
|
14951
|
-
if (isMenu) {
|
|
14567
|
+
if (isMenu && selectedInterFaceLang?.id) {
|
|
14952
14568
|
getDropDownMenuData();
|
|
14953
14569
|
}
|
|
14954
14570
|
if (state.isLoading) {
|
|
@@ -14981,7 +14597,7 @@ const Header = ({
|
|
|
14981
14597
|
zIndex: "99999999 !important"
|
|
14982
14598
|
},
|
|
14983
14599
|
children: [
|
|
14984
|
-
isMenu && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu, { headerMenuArray: state.menuData, setInitialState: setState, initialState: state }),
|
|
14600
|
+
isMenu && selectedInterFaceLang?.id && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu, { headerMenuArray: state.menuData, setInitialState: setState, initialState: state }),
|
|
14985
14601
|
centerCustomComponents
|
|
14986
14602
|
]
|
|
14987
14603
|
}
|
|
@@ -15534,7 +15150,7 @@ const App = () => {
|
|
|
15534
15150
|
certProfileUrl: "https://cert.6seconds.org/certprofile/101/sanskar-digimon",
|
|
15535
15151
|
company: "Digimon Technologies",
|
|
15536
15152
|
certBio: "Hi, I am Sanskar from Digimon Technologies. We are working in the field of Emotion AI. We build products that help in understanding human emotions using AI. We aim to make the world a better place by leveraging the power of technology to enhance emotional intelligence.",
|
|
15537
|
-
certOfferToHelp: "
|
|
15153
|
+
certOfferToHelp: "",
|
|
15538
15154
|
appName: APP_NAMES.sso,
|
|
15539
15155
|
appAccess: [
|
|
15540
15156
|
{
|