@wise/dynamic-flow-client 3.11.5 → 3.11.7
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/build/main.js +410 -231
- package/build/main.min.js +1 -1
- package/build/main.mjs +410 -231
- package/build/types/common/cameraCapture/CameraCapture.d.ts +16 -0
- package/build/types/{legacy/step/cameraStep → common}/cameraCapture/components/bottomBar/BottomBar.d.ts +2 -2
- package/build/types/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +2 -0
- package/build/types/{legacy/step/cameraStep → common}/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +2 -2
- package/build/types/{legacy/step/cameraStep → common}/cameraCapture/overlay/Overlay.d.ts +1 -1
- package/build/types/{legacy/step/cameraStep → common}/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.d.ts +1 -1
- package/build/types/common/cameraCapture/tracking/index.d.ts +8 -0
- package/build/types/common/errorBoundary/ErrorBoundary.d.ts +1 -1
- package/build/types/common/errorBoundary/ErrorBoundaryAlert.d.ts +1 -1
- package/build/types/common/httpClientContext/HttpClientContext.d.ts +2 -2
- package/build/types/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.d.ts +1 -1
- package/build/types/legacy/common/contexts/eventsContext/EventsContext.d.ts +1 -1
- package/build/types/legacy/common/contexts/featureContext/FeatureContext.d.ts +1 -1
- package/build/types/legacy/common/contexts/logContext/LogContext.d.ts +1 -1
- package/build/types/legacy/common/utils/index.d.ts +5 -5
- package/build/types/legacy/dynamic-flow-types.d.ts +2 -1
- package/build/types/legacy/dynamicFlow/BackButton.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/DynamicFlow.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/DynamicFlowStep.d.ts +1 -1
- package/build/types/legacy/dynamicFlow/utils/useLoader.d.ts +1 -1
- package/build/types/legacy/formControl/FormControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/help/Help.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -1
- package/build/types/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +5 -5
- package/build/types/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +1 -1
- package/build/types/legacy/layout/DynamicLayout.d.ts +1 -1
- package/build/types/legacy/layout/alert/DynamicAlert.d.ts +1 -1
- package/build/types/legacy/layout/box/DynamicBox.d.ts +1 -1
- package/build/types/legacy/layout/button/DynamicButton.d.ts +1 -1
- package/build/types/legacy/layout/columns/DynamicColumns.d.ts +1 -1
- package/build/types/legacy/layout/decision/DynamicDecision.d.ts +1 -1
- package/build/types/legacy/layout/divider/DynamicDivider.d.ts +1 -1
- package/build/types/legacy/layout/external/DynamicExternal.d.ts +1 -1
- package/build/types/legacy/layout/form/DynamicForm.d.ts +1 -1
- package/build/types/legacy/layout/heading/DynamicHeading.d.ts +1 -1
- package/build/types/legacy/layout/icon/DynamicIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/FlagIcon.d.ts +1 -1
- package/build/types/legacy/layout/icon/NamedIcon.d.ts +1 -1
- package/build/types/legacy/layout/image/DynamicImage.d.ts +1 -1
- package/build/types/legacy/layout/instructions/DynamicInstructions.d.ts +1 -1
- package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
- package/build/types/legacy/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +1 -1
- package/build/types/legacy/layout/markdown/DynamicMarkdown.d.ts +2 -2
- package/build/types/legacy/layout/modal/DynamicModal.d.ts +1 -1
- package/build/types/legacy/layout/paragraph/DynamicParagraph.d.ts +1 -1
- package/build/types/legacy/layout/review/DynamicReview.d.ts +1 -1
- package/build/types/legacy/layout/search/DynamicSearch.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchInput.d.ts +1 -1
- package/build/types/legacy/layout/search/SearchResults.d.ts +2 -2
- package/build/types/legacy/layout/utils/getNavigationOptionMedia.d.ts +3 -3
- package/build/types/legacy/step/cameraStep/CameraStep.d.ts +1 -1
- package/build/types/legacy/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +1 -1
- package/build/types/legacy/step/layoutStep/LayoutStep.d.ts +1 -1
- package/build/types/legacy/test-utils/DynamicFlowProviders.d.ts +1 -1
- package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -1
- package/build/types/revamp/DynamicFlowCore.d.ts +1 -1
- package/build/types/revamp/DynamicFlowWise.d.ts +1 -1
- package/build/types/revamp/domain/components/AllOfComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ConstComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/NumberInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/ObjectComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/StepDomainComponent.d.ts +2 -2
- package/build/types/revamp/domain/components/TextInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
- package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +3 -3
- package/build/types/revamp/domain/features/persistAsync/getPerformPersistAsync.d.ts +1 -1
- package/build/types/revamp/domain/features/validationAsync/getPerformValidationAsync.d.ts +1 -1
- package/build/types/revamp/flow/executeRefresh.d.ts +1 -1
- package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +3 -3
- package/build/types/revamp/wise/renderers/MultiSelectInputRenderer.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.d.ts +2 -2
- package/build/types/revamp/wise/renderers/SearchRenderer/ErrorResult.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/OptionMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/FieldInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/Help.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/LabelContentWithHelp.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/UploadFieldInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/VariableDateInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/VariableTextInput.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/DynamicIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/FlagIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/NamedIcon.d.ts +1 -1
- package/build/types/revamp/wise/renderers/components/icon/NavigationOptionMedia.d.ts +1 -1
- package/build/types/revamp/wise/renderers/step/BackButton.d.ts +1 -1
- package/build/types/revamp/wise/renderers/step/ExternalConfirmationDialog.d.ts +1 -1
- package/build/types/test-utils/NeptuneProviders.d.ts +1 -1
- package/package.json +39 -33
- package/build/types/legacy/step/cameraStep/cameraCapture/CameraCapture.d.ts +0 -15
- package/build/types/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +0 -2
- package/build/types/legacy/step/cameraStep/cameraCapture/tracking/index.d.ts +0 -8
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/CameraCapture.messages.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/components/index.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/hooks/useVideoConstraints.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/index.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/screens/index.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/types/index.d.ts +0 -0
- /package/build/types/{legacy/step/cameraStep → common}/cameraCapture/utils/index.d.ts +0 -0
- /package/build/types/{legacy/common → common/cameraCapture}/utils/mobile-utils.d.ts +0 -0
- /package/build/types/{legacy/common → common}/utils/debounce.d.ts +0 -0
package/build/main.js
CHANGED
|
@@ -2024,7 +2024,7 @@ var quotelessJson = (obj) => {
|
|
|
2024
2024
|
const json = JSON.stringify(obj, null, 2);
|
|
2025
2025
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
2026
2026
|
};
|
|
2027
|
-
var ZodError = class extends Error {
|
|
2027
|
+
var ZodError = class _ZodError extends Error {
|
|
2028
2028
|
constructor(issues) {
|
|
2029
2029
|
super();
|
|
2030
2030
|
this.issues = [];
|
|
@@ -2082,6 +2082,11 @@ var ZodError = class extends Error {
|
|
|
2082
2082
|
processError(this);
|
|
2083
2083
|
return fieldErrors;
|
|
2084
2084
|
}
|
|
2085
|
+
static assert(value) {
|
|
2086
|
+
if (!(value instanceof _ZodError)) {
|
|
2087
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2085
2090
|
toString() {
|
|
2086
2091
|
return this.message;
|
|
2087
2092
|
}
|
|
@@ -2223,6 +2228,12 @@ var makeIssue = (params) => {
|
|
|
2223
2228
|
const fullIssue = __spreadProps2(__spreadValues2({}, issueData), {
|
|
2224
2229
|
path: fullPath
|
|
2225
2230
|
});
|
|
2231
|
+
if (issueData.message !== void 0) {
|
|
2232
|
+
return __spreadProps2(__spreadValues2({}, issueData), {
|
|
2233
|
+
path: fullPath,
|
|
2234
|
+
message: issueData.message
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2226
2237
|
let errorMessage = "";
|
|
2227
2238
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
|
2228
2239
|
for (const map of maps) {
|
|
@@ -2230,11 +2241,12 @@ var makeIssue = (params) => {
|
|
|
2230
2241
|
}
|
|
2231
2242
|
return __spreadProps2(__spreadValues2({}, issueData), {
|
|
2232
2243
|
path: fullPath,
|
|
2233
|
-
message:
|
|
2244
|
+
message: errorMessage
|
|
2234
2245
|
});
|
|
2235
2246
|
};
|
|
2236
2247
|
var EMPTY_PATH = [];
|
|
2237
2248
|
function addIssueToContext(ctx, issueData) {
|
|
2249
|
+
const overrideMap = getErrorMap();
|
|
2238
2250
|
const issue = makeIssue({
|
|
2239
2251
|
issueData,
|
|
2240
2252
|
data: ctx.data,
|
|
@@ -2242,8 +2254,8 @@ function addIssueToContext(ctx, issueData) {
|
|
|
2242
2254
|
errorMaps: [
|
|
2243
2255
|
ctx.common.contextualErrorMap,
|
|
2244
2256
|
ctx.schemaErrorMap,
|
|
2245
|
-
|
|
2246
|
-
errorMap
|
|
2257
|
+
overrideMap,
|
|
2258
|
+
overrideMap === errorMap ? void 0 : errorMap
|
|
2247
2259
|
// then global default map
|
|
2248
2260
|
].filter((x) => !!x)
|
|
2249
2261
|
});
|
|
@@ -2275,9 +2287,11 @@ var ParseStatus = class _ParseStatus {
|
|
|
2275
2287
|
static async mergeObjectAsync(status, pairs) {
|
|
2276
2288
|
const syncPairs = [];
|
|
2277
2289
|
for (const pair of pairs) {
|
|
2290
|
+
const key = await pair.key;
|
|
2291
|
+
const value = await pair.value;
|
|
2278
2292
|
syncPairs.push({
|
|
2279
|
-
key
|
|
2280
|
-
value
|
|
2293
|
+
key,
|
|
2294
|
+
value
|
|
2281
2295
|
});
|
|
2282
2296
|
}
|
|
2283
2297
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
|
@@ -2310,11 +2324,29 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
2310
2324
|
var isDirty = (x) => x.status === "dirty";
|
|
2311
2325
|
var isValid = (x) => x.status === "valid";
|
|
2312
2326
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2327
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2328
|
+
if (kind === "a" && !f)
|
|
2329
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
2330
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2331
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2332
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2333
|
+
}
|
|
2334
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2335
|
+
if (kind === "m")
|
|
2336
|
+
throw new TypeError("Private method is not writable");
|
|
2337
|
+
if (kind === "a" && !f)
|
|
2338
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
2339
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2340
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2341
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2342
|
+
}
|
|
2313
2343
|
var errorUtil;
|
|
2314
2344
|
(function(errorUtil2) {
|
|
2315
2345
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2316
2346
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
|
2317
2347
|
})(errorUtil || (errorUtil = {}));
|
|
2348
|
+
var _ZodEnum_cache;
|
|
2349
|
+
var _ZodNativeEnum_cache;
|
|
2318
2350
|
var ParseInputLazyPath = class {
|
|
2319
2351
|
constructor(parent, value, path, key) {
|
|
2320
2352
|
this._cachedPath = [];
|
|
@@ -2363,12 +2395,17 @@ function processCreateParams(params) {
|
|
|
2363
2395
|
if (errorMap2)
|
|
2364
2396
|
return { errorMap: errorMap2, description };
|
|
2365
2397
|
const customMap = (iss, ctx) => {
|
|
2366
|
-
|
|
2367
|
-
|
|
2398
|
+
var _a, _b;
|
|
2399
|
+
const { message } = params;
|
|
2400
|
+
if (iss.code === "invalid_enum_value") {
|
|
2401
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
|
2402
|
+
}
|
|
2368
2403
|
if (typeof ctx.data === "undefined") {
|
|
2369
|
-
return { message:
|
|
2404
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
|
2370
2405
|
}
|
|
2371
|
-
|
|
2406
|
+
if (iss.code !== "invalid_type")
|
|
2407
|
+
return { message: ctx.defaultError };
|
|
2408
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
|
2372
2409
|
};
|
|
2373
2410
|
return { errorMap: customMap, description };
|
|
2374
2411
|
}
|
|
@@ -2610,35 +2647,40 @@ var ZodType = class {
|
|
|
2610
2647
|
}
|
|
2611
2648
|
};
|
|
2612
2649
|
var cuidRegex = /^c[^\s-]{8,}$/i;
|
|
2613
|
-
var cuid2Regex = /^[
|
|
2650
|
+
var cuid2Regex = /^[0-9a-z]+$/;
|
|
2614
2651
|
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
|
2615
2652
|
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
2616
|
-
var
|
|
2653
|
+
var nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
2654
|
+
var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
2655
|
+
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
2617
2656
|
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
2618
2657
|
var emojiRegex;
|
|
2619
|
-
var ipv4Regex = /^((
|
|
2658
|
+
var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
2620
2659
|
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
2621
|
-
var
|
|
2660
|
+
var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
2661
|
+
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
2662
|
+
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2663
|
+
function timeRegexSource(args) {
|
|
2664
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
2622
2665
|
if (args.precision) {
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
|
2627
|
-
}
|
|
2628
|
-
} else if (args.precision === 0) {
|
|
2629
|
-
if (args.offset) {
|
|
2630
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
2631
|
-
} else {
|
|
2632
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
|
2633
|
-
}
|
|
2634
|
-
} else {
|
|
2635
|
-
if (args.offset) {
|
|
2636
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
|
|
2637
|
-
} else {
|
|
2638
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
|
2639
|
-
}
|
|
2666
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
|
2667
|
+
} else if (args.precision == null) {
|
|
2668
|
+
regex = `${regex}(\\.\\d+)?`;
|
|
2640
2669
|
}
|
|
2641
|
-
|
|
2670
|
+
return regex;
|
|
2671
|
+
}
|
|
2672
|
+
function timeRegex(args) {
|
|
2673
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
2674
|
+
}
|
|
2675
|
+
function datetimeRegex(args) {
|
|
2676
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
2677
|
+
const opts = [];
|
|
2678
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
2679
|
+
if (args.offset)
|
|
2680
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
2681
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
2682
|
+
return new RegExp(`^${regex}$`);
|
|
2683
|
+
}
|
|
2642
2684
|
function isValidIP(ip, version) {
|
|
2643
2685
|
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
|
2644
2686
|
return true;
|
|
@@ -2656,15 +2698,11 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2656
2698
|
const parsedType = this._getType(input);
|
|
2657
2699
|
if (parsedType !== ZodParsedType.string) {
|
|
2658
2700
|
const ctx2 = this._getOrReturnCtx(input);
|
|
2659
|
-
addIssueToContext(
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
received: ctx2.parsedType
|
|
2665
|
-
}
|
|
2666
|
-
//
|
|
2667
|
-
);
|
|
2701
|
+
addIssueToContext(ctx2, {
|
|
2702
|
+
code: ZodIssueCode.invalid_type,
|
|
2703
|
+
expected: ZodParsedType.string,
|
|
2704
|
+
received: ctx2.parsedType
|
|
2705
|
+
});
|
|
2668
2706
|
return INVALID;
|
|
2669
2707
|
}
|
|
2670
2708
|
const status = new ParseStatus();
|
|
@@ -2755,6 +2793,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2755
2793
|
});
|
|
2756
2794
|
status.dirty();
|
|
2757
2795
|
}
|
|
2796
|
+
} else if (check.kind === "nanoid") {
|
|
2797
|
+
if (!nanoidRegex.test(input.data)) {
|
|
2798
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2799
|
+
addIssueToContext(ctx, {
|
|
2800
|
+
validation: "nanoid",
|
|
2801
|
+
code: ZodIssueCode.invalid_string,
|
|
2802
|
+
message: check.message
|
|
2803
|
+
});
|
|
2804
|
+
status.dirty();
|
|
2805
|
+
}
|
|
2758
2806
|
} else if (check.kind === "cuid") {
|
|
2759
2807
|
if (!cuidRegex.test(input.data)) {
|
|
2760
2808
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2856,6 +2904,38 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2856
2904
|
});
|
|
2857
2905
|
status.dirty();
|
|
2858
2906
|
}
|
|
2907
|
+
} else if (check.kind === "date") {
|
|
2908
|
+
const regex = dateRegex;
|
|
2909
|
+
if (!regex.test(input.data)) {
|
|
2910
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2911
|
+
addIssueToContext(ctx, {
|
|
2912
|
+
code: ZodIssueCode.invalid_string,
|
|
2913
|
+
validation: "date",
|
|
2914
|
+
message: check.message
|
|
2915
|
+
});
|
|
2916
|
+
status.dirty();
|
|
2917
|
+
}
|
|
2918
|
+
} else if (check.kind === "time") {
|
|
2919
|
+
const regex = timeRegex(check);
|
|
2920
|
+
if (!regex.test(input.data)) {
|
|
2921
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2922
|
+
addIssueToContext(ctx, {
|
|
2923
|
+
code: ZodIssueCode.invalid_string,
|
|
2924
|
+
validation: "time",
|
|
2925
|
+
message: check.message
|
|
2926
|
+
});
|
|
2927
|
+
status.dirty();
|
|
2928
|
+
}
|
|
2929
|
+
} else if (check.kind === "duration") {
|
|
2930
|
+
if (!durationRegex.test(input.data)) {
|
|
2931
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2932
|
+
addIssueToContext(ctx, {
|
|
2933
|
+
validation: "duration",
|
|
2934
|
+
code: ZodIssueCode.invalid_string,
|
|
2935
|
+
message: check.message
|
|
2936
|
+
});
|
|
2937
|
+
status.dirty();
|
|
2938
|
+
}
|
|
2859
2939
|
} else if (check.kind === "ip") {
|
|
2860
2940
|
if (!isValidIP(input.data, check.version)) {
|
|
2861
2941
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -2866,6 +2946,16 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2866
2946
|
});
|
|
2867
2947
|
status.dirty();
|
|
2868
2948
|
}
|
|
2949
|
+
} else if (check.kind === "base64") {
|
|
2950
|
+
if (!base64Regex.test(input.data)) {
|
|
2951
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
2952
|
+
addIssueToContext(ctx, {
|
|
2953
|
+
validation: "base64",
|
|
2954
|
+
code: ZodIssueCode.invalid_string,
|
|
2955
|
+
message: check.message
|
|
2956
|
+
});
|
|
2957
|
+
status.dirty();
|
|
2958
|
+
}
|
|
2869
2959
|
} else {
|
|
2870
2960
|
util.assertNever(check);
|
|
2871
2961
|
}
|
|
@@ -2895,6 +2985,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2895
2985
|
uuid(message) {
|
|
2896
2986
|
return this._addCheck(__spreadValues2({ kind: "uuid" }, errorUtil.errToObj(message)));
|
|
2897
2987
|
}
|
|
2988
|
+
nanoid(message) {
|
|
2989
|
+
return this._addCheck(__spreadValues2({ kind: "nanoid" }, errorUtil.errToObj(message)));
|
|
2990
|
+
}
|
|
2898
2991
|
cuid(message) {
|
|
2899
2992
|
return this._addCheck(__spreadValues2({ kind: "cuid" }, errorUtil.errToObj(message)));
|
|
2900
2993
|
}
|
|
@@ -2904,25 +2997,49 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2904
2997
|
ulid(message) {
|
|
2905
2998
|
return this._addCheck(__spreadValues2({ kind: "ulid" }, errorUtil.errToObj(message)));
|
|
2906
2999
|
}
|
|
3000
|
+
base64(message) {
|
|
3001
|
+
return this._addCheck(__spreadValues2({ kind: "base64" }, errorUtil.errToObj(message)));
|
|
3002
|
+
}
|
|
2907
3003
|
ip(options) {
|
|
2908
3004
|
return this._addCheck(__spreadValues2({ kind: "ip" }, errorUtil.errToObj(options)));
|
|
2909
3005
|
}
|
|
2910
3006
|
datetime(options) {
|
|
2911
|
-
var _a;
|
|
3007
|
+
var _a, _b;
|
|
2912
3008
|
if (typeof options === "string") {
|
|
2913
3009
|
return this._addCheck({
|
|
2914
3010
|
kind: "datetime",
|
|
2915
3011
|
precision: null,
|
|
2916
3012
|
offset: false,
|
|
3013
|
+
local: false,
|
|
2917
3014
|
message: options
|
|
2918
3015
|
});
|
|
2919
3016
|
}
|
|
2920
3017
|
return this._addCheck(__spreadValues2({
|
|
2921
3018
|
kind: "datetime",
|
|
2922
3019
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
2923
|
-
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false
|
|
3020
|
+
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
|
3021
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false
|
|
2924
3022
|
}, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
|
|
2925
3023
|
}
|
|
3024
|
+
date(message) {
|
|
3025
|
+
return this._addCheck({ kind: "date", message });
|
|
3026
|
+
}
|
|
3027
|
+
time(options) {
|
|
3028
|
+
if (typeof options === "string") {
|
|
3029
|
+
return this._addCheck({
|
|
3030
|
+
kind: "time",
|
|
3031
|
+
precision: null,
|
|
3032
|
+
message: options
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
return this._addCheck(__spreadValues2({
|
|
3036
|
+
kind: "time",
|
|
3037
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision
|
|
3038
|
+
}, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
|
|
3039
|
+
}
|
|
3040
|
+
duration(message) {
|
|
3041
|
+
return this._addCheck(__spreadValues2({ kind: "duration" }, errorUtil.errToObj(message)));
|
|
3042
|
+
}
|
|
2926
3043
|
regex(regex, message) {
|
|
2927
3044
|
return this._addCheck(__spreadValues2({
|
|
2928
3045
|
kind: "regex",
|
|
@@ -2991,6 +3108,15 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2991
3108
|
get isDatetime() {
|
|
2992
3109
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
2993
3110
|
}
|
|
3111
|
+
get isDate() {
|
|
3112
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
3113
|
+
}
|
|
3114
|
+
get isTime() {
|
|
3115
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
3116
|
+
}
|
|
3117
|
+
get isDuration() {
|
|
3118
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
3119
|
+
}
|
|
2994
3120
|
get isEmail() {
|
|
2995
3121
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
2996
3122
|
}
|
|
@@ -3003,6 +3129,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
3003
3129
|
get isUUID() {
|
|
3004
3130
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
3005
3131
|
}
|
|
3132
|
+
get isNANOID() {
|
|
3133
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
3134
|
+
}
|
|
3006
3135
|
get isCUID() {
|
|
3007
3136
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
3008
3137
|
}
|
|
@@ -3015,6 +3144,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
3015
3144
|
get isIP() {
|
|
3016
3145
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
3017
3146
|
}
|
|
3147
|
+
get isBase64() {
|
|
3148
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
3149
|
+
}
|
|
3018
3150
|
get minLength() {
|
|
3019
3151
|
let min = null;
|
|
3020
3152
|
for (const ch of this._def.checks) {
|
|
@@ -3905,9 +4037,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3905
4037
|
const syncPairs = [];
|
|
3906
4038
|
for (const pair of pairs) {
|
|
3907
4039
|
const key = await pair.key;
|
|
4040
|
+
const value = await pair.value;
|
|
3908
4041
|
syncPairs.push({
|
|
3909
4042
|
key,
|
|
3910
|
-
value
|
|
4043
|
+
value,
|
|
3911
4044
|
alwaysSet: pair.alwaysSet
|
|
3912
4045
|
});
|
|
3913
4046
|
}
|
|
@@ -4234,15 +4367,25 @@ var getDiscriminator = (type) => {
|
|
|
4234
4367
|
} else if (type instanceof ZodEnum) {
|
|
4235
4368
|
return type.options;
|
|
4236
4369
|
} else if (type instanceof ZodNativeEnum) {
|
|
4237
|
-
return
|
|
4370
|
+
return util.objectValues(type.enum);
|
|
4238
4371
|
} else if (type instanceof ZodDefault) {
|
|
4239
4372
|
return getDiscriminator(type._def.innerType);
|
|
4240
4373
|
} else if (type instanceof ZodUndefined) {
|
|
4241
4374
|
return [void 0];
|
|
4242
4375
|
} else if (type instanceof ZodNull) {
|
|
4243
4376
|
return [null];
|
|
4377
|
+
} else if (type instanceof ZodOptional) {
|
|
4378
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
|
4379
|
+
} else if (type instanceof ZodNullable) {
|
|
4380
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
|
4381
|
+
} else if (type instanceof ZodBranded) {
|
|
4382
|
+
return getDiscriminator(type.unwrap());
|
|
4383
|
+
} else if (type instanceof ZodReadonly) {
|
|
4384
|
+
return getDiscriminator(type.unwrap());
|
|
4385
|
+
} else if (type instanceof ZodCatch) {
|
|
4386
|
+
return getDiscriminator(type._def.innerType);
|
|
4244
4387
|
} else {
|
|
4245
|
-
return
|
|
4388
|
+
return [];
|
|
4246
4389
|
}
|
|
4247
4390
|
};
|
|
4248
4391
|
var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
@@ -4302,7 +4445,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
4302
4445
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
4303
4446
|
for (const type of options) {
|
|
4304
4447
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
4305
|
-
if (!discriminatorValues) {
|
|
4448
|
+
if (!discriminatorValues.length) {
|
|
4306
4449
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
4307
4450
|
}
|
|
4308
4451
|
for (const value of discriminatorValues) {
|
|
@@ -4498,7 +4641,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
|
|
|
4498
4641
|
for (const key in ctx.data) {
|
|
4499
4642
|
pairs.push({
|
|
4500
4643
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
|
4501
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
|
4644
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
|
4645
|
+
alwaysSet: key in ctx.data
|
|
4502
4646
|
});
|
|
4503
4647
|
}
|
|
4504
4648
|
if (ctx.common.async) {
|
|
@@ -4830,6 +4974,10 @@ function createZodEnum(values, params) {
|
|
|
4830
4974
|
}, processCreateParams(params)));
|
|
4831
4975
|
}
|
|
4832
4976
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4977
|
+
constructor() {
|
|
4978
|
+
super(...arguments);
|
|
4979
|
+
_ZodEnum_cache.set(this, void 0);
|
|
4980
|
+
}
|
|
4833
4981
|
_parse(input) {
|
|
4834
4982
|
if (typeof input.data !== "string") {
|
|
4835
4983
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4841,7 +4989,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4841
4989
|
});
|
|
4842
4990
|
return INVALID;
|
|
4843
4991
|
}
|
|
4844
|
-
if (this
|
|
4992
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
|
4993
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
|
4994
|
+
}
|
|
4995
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
|
4845
4996
|
const ctx = this._getOrReturnCtx(input);
|
|
4846
4997
|
const expectedValues = this._def.values;
|
|
4847
4998
|
addIssueToContext(ctx, {
|
|
@@ -4877,15 +5028,20 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4877
5028
|
}
|
|
4878
5029
|
return enumValues;
|
|
4879
5030
|
}
|
|
4880
|
-
extract(values) {
|
|
4881
|
-
return _ZodEnum.create(values);
|
|
5031
|
+
extract(values, newDef = this._def) {
|
|
5032
|
+
return _ZodEnum.create(values, __spreadValues2(__spreadValues2({}, this._def), newDef));
|
|
4882
5033
|
}
|
|
4883
|
-
exclude(values) {
|
|
4884
|
-
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
|
|
5034
|
+
exclude(values, newDef = this._def) {
|
|
5035
|
+
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), __spreadValues2(__spreadValues2({}, this._def), newDef));
|
|
4885
5036
|
}
|
|
4886
5037
|
};
|
|
5038
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4887
5039
|
ZodEnum.create = createZodEnum;
|
|
4888
5040
|
var ZodNativeEnum = class extends ZodType {
|
|
5041
|
+
constructor() {
|
|
5042
|
+
super(...arguments);
|
|
5043
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
|
5044
|
+
}
|
|
4889
5045
|
_parse(input) {
|
|
4890
5046
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4891
5047
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4898,7 +5054,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4898
5054
|
});
|
|
4899
5055
|
return INVALID;
|
|
4900
5056
|
}
|
|
4901
|
-
if (
|
|
5057
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
|
5058
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
|
5059
|
+
}
|
|
5060
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
|
4902
5061
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
4903
5062
|
addIssueToContext(ctx, {
|
|
4904
5063
|
received: ctx.data,
|
|
@@ -4913,6 +5072,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
4913
5072
|
return this._def.values;
|
|
4914
5073
|
}
|
|
4915
5074
|
};
|
|
5075
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4916
5076
|
ZodNativeEnum.create = (values, params) => {
|
|
4917
5077
|
return new ZodNativeEnum(__spreadValues2({
|
|
4918
5078
|
values,
|
|
@@ -4974,26 +5134,38 @@ var ZodEffects = class extends ZodType {
|
|
|
4974
5134
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
4975
5135
|
if (effect.type === "preprocess") {
|
|
4976
5136
|
const processed = effect.transform(ctx.data, checkCtx);
|
|
4977
|
-
if (ctx.common.issues.length) {
|
|
4978
|
-
return {
|
|
4979
|
-
status: "dirty",
|
|
4980
|
-
value: ctx.data
|
|
4981
|
-
};
|
|
4982
|
-
}
|
|
4983
5137
|
if (ctx.common.async) {
|
|
4984
|
-
return Promise.resolve(processed).then((processed2) => {
|
|
4985
|
-
|
|
5138
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
5139
|
+
if (status.value === "aborted")
|
|
5140
|
+
return INVALID;
|
|
5141
|
+
const result = await this._def.schema._parseAsync({
|
|
4986
5142
|
data: processed2,
|
|
4987
5143
|
path: ctx.path,
|
|
4988
5144
|
parent: ctx
|
|
4989
5145
|
});
|
|
5146
|
+
if (result.status === "aborted")
|
|
5147
|
+
return INVALID;
|
|
5148
|
+
if (result.status === "dirty")
|
|
5149
|
+
return DIRTY(result.value);
|
|
5150
|
+
if (status.value === "dirty")
|
|
5151
|
+
return DIRTY(result.value);
|
|
5152
|
+
return result;
|
|
4990
5153
|
});
|
|
4991
5154
|
} else {
|
|
4992
|
-
|
|
5155
|
+
if (status.value === "aborted")
|
|
5156
|
+
return INVALID;
|
|
5157
|
+
const result = this._def.schema._parseSync({
|
|
4993
5158
|
data: processed,
|
|
4994
5159
|
path: ctx.path,
|
|
4995
5160
|
parent: ctx
|
|
4996
5161
|
});
|
|
5162
|
+
if (result.status === "aborted")
|
|
5163
|
+
return INVALID;
|
|
5164
|
+
if (result.status === "dirty")
|
|
5165
|
+
return DIRTY(result.value);
|
|
5166
|
+
if (status.value === "dirty")
|
|
5167
|
+
return DIRTY(result.value);
|
|
5168
|
+
return result;
|
|
4997
5169
|
}
|
|
4998
5170
|
}
|
|
4999
5171
|
if (effect.type === "refinement") {
|
|
@@ -5271,10 +5443,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
5271
5443
|
var ZodReadonly = class extends ZodType {
|
|
5272
5444
|
_parse(input) {
|
|
5273
5445
|
const result = this._def.innerType._parse(input);
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5446
|
+
const freeze = (data) => {
|
|
5447
|
+
if (isValid(data)) {
|
|
5448
|
+
data.value = Object.freeze(data.value);
|
|
5449
|
+
}
|
|
5450
|
+
return data;
|
|
5451
|
+
};
|
|
5452
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
5453
|
+
}
|
|
5454
|
+
unwrap() {
|
|
5455
|
+
return this._def.innerType;
|
|
5278
5456
|
}
|
|
5279
5457
|
};
|
|
5280
5458
|
ZodReadonly.create = (type, params) => {
|
|
@@ -5283,7 +5461,7 @@ ZodReadonly.create = (type, params) => {
|
|
|
5283
5461
|
typeName: ZodFirstPartyTypeKind.ZodReadonly
|
|
5284
5462
|
}, processCreateParams(params)));
|
|
5285
5463
|
};
|
|
5286
|
-
|
|
5464
|
+
function custom(check, params = {}, fatal) {
|
|
5287
5465
|
if (check)
|
|
5288
5466
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5289
5467
|
var _a, _b;
|
|
@@ -5295,7 +5473,7 @@ var custom = (check, params = {}, fatal) => {
|
|
|
5295
5473
|
}
|
|
5296
5474
|
});
|
|
5297
5475
|
return ZodAny.create();
|
|
5298
|
-
}
|
|
5476
|
+
}
|
|
5299
5477
|
var late = {
|
|
5300
5478
|
object: ZodObject.lazycreate
|
|
5301
5479
|
};
|
|
@@ -5413,6 +5591,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5413
5591
|
ZodParsedType,
|
|
5414
5592
|
getParsedType,
|
|
5415
5593
|
ZodType,
|
|
5594
|
+
datetimeRegex,
|
|
5416
5595
|
ZodString,
|
|
5417
5596
|
ZodNumber,
|
|
5418
5597
|
ZodBigInt,
|
|
@@ -10421,15 +10600,15 @@ var AlertRenderer = {
|
|
|
10421
10600
|
};
|
|
10422
10601
|
var AlertRenderer_default = AlertRenderer;
|
|
10423
10602
|
|
|
10424
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.
|
|
10603
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
10425
10604
|
var $2AODx$react = __toESM(require("react"), 1);
|
|
10426
10605
|
|
|
10427
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.
|
|
10606
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
10428
10607
|
var import_react6 = require("react");
|
|
10429
10608
|
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react6.useLayoutEffect : () => {
|
|
10430
10609
|
};
|
|
10431
10610
|
|
|
10432
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.
|
|
10611
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
10433
10612
|
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
|
|
10434
10613
|
var $1746a345f3d73bb7$var$count = 0;
|
|
10435
10614
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
@@ -10445,7 +10624,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
10445
10624
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
10446
10625
|
}
|
|
10447
10626
|
|
|
10448
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.
|
|
10627
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.37.0_@types+react@18.3.3_react@18.3.1/node_modules/@wise/forms/dist/index.mjs
|
|
10449
10628
|
var import_components3 = require("@transferwise/components");
|
|
10450
10629
|
var import_classnames = __toESM(require_classnames(), 1);
|
|
10451
10630
|
var import_react7 = require("react");
|
|
@@ -10816,7 +10995,7 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
10816
10995
|
// src/revamp/wise/renderers/DecisionRenderer.tsx
|
|
10817
10996
|
var import_components9 = require("@transferwise/components");
|
|
10818
10997
|
|
|
10819
|
-
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.
|
|
10998
|
+
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.3.1_react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
10820
10999
|
var import_react9 = require("react");
|
|
10821
11000
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
10822
11001
|
var unknownFlagName = "wise";
|
|
@@ -13029,6 +13208,61 @@ function FeatureContextProvider({ features, children }) {
|
|
|
13029
13208
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FeatureContext.Provider, { value: features, children });
|
|
13030
13209
|
}
|
|
13031
13210
|
|
|
13211
|
+
// src/common/cameraCapture/utils/mobile-utils.ts
|
|
13212
|
+
var isMobile = () => isMobileScreenSize() && (isTouchScreen() || isMobileUA());
|
|
13213
|
+
var isMobileUA = (userAgent = window.navigator.userAgent) => (
|
|
13214
|
+
// eslint-disable-next-line regexp/no-unused-capturing-group
|
|
13215
|
+
/mobi|\b(iphone|android|blackberry|webos|windows phone)\b/i.test(userAgent)
|
|
13216
|
+
);
|
|
13217
|
+
var isMobileScreenSize = (width = window.screen.width, height = window.screen.height) => width < 768 || height < 768;
|
|
13218
|
+
var isTouchScreen = (navigator2 = window.navigator, matchMedia = window.matchMedia) => {
|
|
13219
|
+
if ("maxTouchPoints" in navigator2) {
|
|
13220
|
+
return navigator2.maxTouchPoints > 0;
|
|
13221
|
+
}
|
|
13222
|
+
const mQ = matchMedia == null ? void 0 : matchMedia("(pointer:coarse)");
|
|
13223
|
+
if ((mQ == null ? void 0 : mQ.media) === "(pointer:coarse)") {
|
|
13224
|
+
return Boolean(mQ.matches);
|
|
13225
|
+
}
|
|
13226
|
+
return false;
|
|
13227
|
+
};
|
|
13228
|
+
|
|
13229
|
+
// src/common/utils/debounce.ts
|
|
13230
|
+
var debounce2 = (callback, waitMs) => {
|
|
13231
|
+
let timeoutId;
|
|
13232
|
+
let lastArgs;
|
|
13233
|
+
const clearTimer = () => {
|
|
13234
|
+
if (timeoutId) {
|
|
13235
|
+
clearTimeout(timeoutId);
|
|
13236
|
+
timeoutId = null;
|
|
13237
|
+
}
|
|
13238
|
+
lastArgs = null;
|
|
13239
|
+
};
|
|
13240
|
+
const debouncedFn = (...args) => {
|
|
13241
|
+
lastArgs = args;
|
|
13242
|
+
if (timeoutId !== null) {
|
|
13243
|
+
clearTimeout(timeoutId);
|
|
13244
|
+
}
|
|
13245
|
+
timeoutId = setTimeout(() => {
|
|
13246
|
+
callback(...lastArgs);
|
|
13247
|
+
timeoutId = null;
|
|
13248
|
+
lastArgs = null;
|
|
13249
|
+
}, waitMs);
|
|
13250
|
+
};
|
|
13251
|
+
debouncedFn.cancel = () => {
|
|
13252
|
+
if (timeoutId !== null) {
|
|
13253
|
+
clearTimer();
|
|
13254
|
+
}
|
|
13255
|
+
};
|
|
13256
|
+
debouncedFn.flush = () => {
|
|
13257
|
+
if (timeoutId !== null) {
|
|
13258
|
+
callback(...lastArgs);
|
|
13259
|
+
clearTimer();
|
|
13260
|
+
}
|
|
13261
|
+
};
|
|
13262
|
+
debouncedFn.isPending = () => timeoutId !== null;
|
|
13263
|
+
return debouncedFn;
|
|
13264
|
+
};
|
|
13265
|
+
|
|
13032
13266
|
// src/legacy/common/utils/api-utils.ts
|
|
13033
13267
|
function isStatus2xx(status) {
|
|
13034
13268
|
return status >= 200 && status < 300;
|
|
@@ -13491,63 +13725,6 @@ var dateStringToDate = (dateString) => {
|
|
|
13491
13725
|
};
|
|
13492
13726
|
var dateToDateString2 = (date) => formatDate2(date);
|
|
13493
13727
|
|
|
13494
|
-
// src/legacy/common/utils/debounce.ts
|
|
13495
|
-
var debounce2 = (callback, waitMs) => {
|
|
13496
|
-
let timeoutId;
|
|
13497
|
-
let lastArgs;
|
|
13498
|
-
const clearTimer = () => {
|
|
13499
|
-
if (timeoutId) {
|
|
13500
|
-
clearTimeout(timeoutId);
|
|
13501
|
-
timeoutId = null;
|
|
13502
|
-
}
|
|
13503
|
-
lastArgs = null;
|
|
13504
|
-
};
|
|
13505
|
-
const debouncedFn = (...args) => {
|
|
13506
|
-
lastArgs = args;
|
|
13507
|
-
if (timeoutId !== null) {
|
|
13508
|
-
clearTimeout(timeoutId);
|
|
13509
|
-
}
|
|
13510
|
-
timeoutId = setTimeout(() => {
|
|
13511
|
-
callback(...lastArgs);
|
|
13512
|
-
timeoutId = null;
|
|
13513
|
-
lastArgs = null;
|
|
13514
|
-
}, waitMs);
|
|
13515
|
-
};
|
|
13516
|
-
debouncedFn.cancel = () => {
|
|
13517
|
-
if (timeoutId !== null) {
|
|
13518
|
-
clearTimer();
|
|
13519
|
-
}
|
|
13520
|
-
};
|
|
13521
|
-
debouncedFn.flush = () => {
|
|
13522
|
-
if (timeoutId !== null) {
|
|
13523
|
-
callback(...lastArgs);
|
|
13524
|
-
clearTimer();
|
|
13525
|
-
}
|
|
13526
|
-
};
|
|
13527
|
-
debouncedFn.isPending = () => timeoutId !== null;
|
|
13528
|
-
return debouncedFn;
|
|
13529
|
-
};
|
|
13530
|
-
|
|
13531
|
-
// src/legacy/common/utils/is-equal.ts
|
|
13532
|
-
var isEqual = (a, b) => {
|
|
13533
|
-
if (a === b) {
|
|
13534
|
-
return true;
|
|
13535
|
-
}
|
|
13536
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
13537
|
-
return a.length === b.length && a.every((item, index) => isEqual(item, b[index]));
|
|
13538
|
-
}
|
|
13539
|
-
if (isNonNullObject(a) && isNonNullObject(b) && isObjectEquals(a, b)) {
|
|
13540
|
-
return true;
|
|
13541
|
-
}
|
|
13542
|
-
return false;
|
|
13543
|
-
};
|
|
13544
|
-
var isObjectEquals = (a, b) => {
|
|
13545
|
-
const keysA = Object.keys(a);
|
|
13546
|
-
const keysB = Object.keys(b);
|
|
13547
|
-
return keysA.length === keysB.length && keysA.every((key) => Object.hasOwnProperty.call(b, key) && isEqual(a[key], b[key]));
|
|
13548
|
-
};
|
|
13549
|
-
var isNonNullObject = (a) => typeof a === "object" && a !== null;
|
|
13550
|
-
|
|
13551
13728
|
// src/legacy/common/utils/file-utils.ts
|
|
13552
13729
|
function toKilobytes2(sizeInBytes) {
|
|
13553
13730
|
const ONE_KB_IN_BYTES = 1024;
|
|
@@ -13583,6 +13760,52 @@ var generateRandomId = (prefix = "") => {
|
|
|
13583
13760
|
return `${prefixString}${Math.floor(1e8 * Math.random())}`;
|
|
13584
13761
|
};
|
|
13585
13762
|
|
|
13763
|
+
// src/legacy/common/utils/is-equal.ts
|
|
13764
|
+
var isEqual = (a, b) => {
|
|
13765
|
+
if (a === b) {
|
|
13766
|
+
return true;
|
|
13767
|
+
}
|
|
13768
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
13769
|
+
return a.length === b.length && a.every((item, index) => isEqual(item, b[index]));
|
|
13770
|
+
}
|
|
13771
|
+
if (isNonNullObject(a) && isNonNullObject(b) && isObjectEquals(a, b)) {
|
|
13772
|
+
return true;
|
|
13773
|
+
}
|
|
13774
|
+
return false;
|
|
13775
|
+
};
|
|
13776
|
+
var isObjectEquals = (a, b) => {
|
|
13777
|
+
const keysA = Object.keys(a);
|
|
13778
|
+
const keysB = Object.keys(b);
|
|
13779
|
+
return keysA.length === keysB.length && keysA.every((key) => Object.hasOwnProperty.call(b, key) && isEqual(a[key], b[key]));
|
|
13780
|
+
};
|
|
13781
|
+
var isNonNullObject = (a) => typeof a === "object" && a !== null;
|
|
13782
|
+
|
|
13783
|
+
// src/legacy/common/utils/misc-utils.ts
|
|
13784
|
+
var isBasicError = (error) => isString2(error) || isNull3(error);
|
|
13785
|
+
|
|
13786
|
+
// src/legacy/common/utils/model-utils.ts
|
|
13787
|
+
var isObjectModel2 = (model) => typeof model === "object" && model !== null && model.constructor === Object;
|
|
13788
|
+
var isNullableObjectModel = (model) => isNull3(model) || isObjectModel2(model);
|
|
13789
|
+
var isNullableBasicModel = (model) => isBoolean2(model) || isNumber3(model) || isString2(model) || isNull3(model);
|
|
13790
|
+
var isNullableStringModel = (model) => isString2(model) || isNull3(model);
|
|
13791
|
+
var isArrayModel2 = (model) => {
|
|
13792
|
+
if (isArray2(model)) {
|
|
13793
|
+
if (model.length === 0) {
|
|
13794
|
+
return true;
|
|
13795
|
+
}
|
|
13796
|
+
return model.every(
|
|
13797
|
+
(item) => typeof item === "string" || typeof item === "number" || typeof item === "boolean" || typeof item === "object"
|
|
13798
|
+
);
|
|
13799
|
+
}
|
|
13800
|
+
return false;
|
|
13801
|
+
};
|
|
13802
|
+
var isNullableArrayModel = (model) => {
|
|
13803
|
+
if (isNull3(model)) {
|
|
13804
|
+
return true;
|
|
13805
|
+
}
|
|
13806
|
+
return isArrayModel2(model);
|
|
13807
|
+
};
|
|
13808
|
+
|
|
13586
13809
|
// src/legacy/common/utils/schema-utils.ts
|
|
13587
13810
|
function isConstSchema2(schema) {
|
|
13588
13811
|
return !isUndefined3(schema == null ? void 0 : schema.const);
|
|
@@ -13711,50 +13934,6 @@ var filterHiddenSchemas = (schemas) => schemas.filter((schema) => {
|
|
|
13711
13934
|
return (schema == null ? void 0 : schema.hidden) !== true;
|
|
13712
13935
|
});
|
|
13713
13936
|
|
|
13714
|
-
// src/legacy/common/utils/model-utils.ts
|
|
13715
|
-
var isObjectModel2 = (model) => typeof model === "object" && model !== null && model.constructor === Object;
|
|
13716
|
-
var isNullableObjectModel = (model) => isNull3(model) || isObjectModel2(model);
|
|
13717
|
-
var isNullableBasicModel = (model) => isBoolean2(model) || isNumber3(model) || isString2(model) || isNull3(model);
|
|
13718
|
-
var isNullableStringModel = (model) => isString2(model) || isNull3(model);
|
|
13719
|
-
var isArrayModel2 = (model) => {
|
|
13720
|
-
if (isArray2(model)) {
|
|
13721
|
-
if (model.length === 0) {
|
|
13722
|
-
return true;
|
|
13723
|
-
}
|
|
13724
|
-
return model.every(
|
|
13725
|
-
(item) => typeof item === "string" || typeof item === "number" || typeof item === "boolean" || typeof item === "object"
|
|
13726
|
-
);
|
|
13727
|
-
}
|
|
13728
|
-
return false;
|
|
13729
|
-
};
|
|
13730
|
-
var isNullableArrayModel = (model) => {
|
|
13731
|
-
if (isNull3(model)) {
|
|
13732
|
-
return true;
|
|
13733
|
-
}
|
|
13734
|
-
return isArrayModel2(model);
|
|
13735
|
-
};
|
|
13736
|
-
|
|
13737
|
-
// src/legacy/common/utils/misc-utils.ts
|
|
13738
|
-
var isBasicError = (error) => isString2(error) || isNull3(error);
|
|
13739
|
-
|
|
13740
|
-
// src/legacy/common/utils/mobile-utils.ts
|
|
13741
|
-
var isMobile = () => isMobileScreenSize() && (isTouchScreen() || isMobileUA());
|
|
13742
|
-
var isMobileUA = (userAgent = window.navigator.userAgent) => (
|
|
13743
|
-
// eslint-disable-next-line regexp/no-unused-capturing-group
|
|
13744
|
-
/mobi|\b(iphone|android|blackberry|webos|windows phone)\b/i.test(userAgent)
|
|
13745
|
-
);
|
|
13746
|
-
var isMobileScreenSize = (width = window.screen.width, height = window.screen.height) => width < 768 || height < 768;
|
|
13747
|
-
var isTouchScreen = (navigator2 = window.navigator, matchMedia = window.matchMedia) => {
|
|
13748
|
-
if ("maxTouchPoints" in navigator2) {
|
|
13749
|
-
return navigator2.maxTouchPoints > 0;
|
|
13750
|
-
}
|
|
13751
|
-
const mQ = matchMedia == null ? void 0 : matchMedia("(pointer:coarse)");
|
|
13752
|
-
if ((mQ == null ? void 0 : mQ.media) === "(pointer:coarse)") {
|
|
13753
|
-
return Boolean(mQ.matches);
|
|
13754
|
-
}
|
|
13755
|
-
return false;
|
|
13756
|
-
};
|
|
13757
|
-
|
|
13758
13937
|
// src/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
|
|
13759
13938
|
var import_react28 = require("react");
|
|
13760
13939
|
function useDebouncedFunction(callback, waitMs) {
|
|
@@ -17968,12 +18147,12 @@ var LayoutStep_default = LayoutStep;
|
|
|
17968
18147
|
// src/legacy/step/cameraStep/CameraStep.tsx
|
|
17969
18148
|
var import_react62 = require("react");
|
|
17970
18149
|
|
|
17971
|
-
// src/
|
|
18150
|
+
// src/common/cameraCapture/CameraCapture.tsx
|
|
17972
18151
|
var import_react61 = require("react");
|
|
17973
18152
|
var import_react_intl37 = require("react-intl");
|
|
17974
18153
|
var import_react_webcam = __toESM(require("react-webcam"));
|
|
17975
18154
|
|
|
17976
|
-
// src/
|
|
18155
|
+
// src/common/cameraCapture/CameraCapture.messages.ts
|
|
17977
18156
|
var import_react_intl33 = require("react-intl");
|
|
17978
18157
|
var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
|
|
17979
18158
|
reviewSubmit: {
|
|
@@ -18033,7 +18212,7 @@ var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
18033
18212
|
}
|
|
18034
18213
|
});
|
|
18035
18214
|
|
|
18036
|
-
// src/
|
|
18215
|
+
// src/common/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
18037
18216
|
var import_components73 = require("@transferwise/components");
|
|
18038
18217
|
var import_react_intl34 = require("react-intl");
|
|
18039
18218
|
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
@@ -18080,10 +18259,10 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime118.j
|
|
|
18080
18259
|
}
|
|
18081
18260
|
);
|
|
18082
18261
|
|
|
18083
|
-
// src/
|
|
18262
|
+
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18084
18263
|
var import_react_intl36 = require("react-intl");
|
|
18085
18264
|
|
|
18086
|
-
// src/
|
|
18265
|
+
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
18087
18266
|
var import_react_intl35 = require("react-intl");
|
|
18088
18267
|
var OrientationLockOverlay_messages_default = (0, import_react_intl35.defineMessages)({
|
|
18089
18268
|
text: {
|
|
@@ -18093,7 +18272,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl35.defineMess
|
|
|
18093
18272
|
}
|
|
18094
18273
|
});
|
|
18095
18274
|
|
|
18096
|
-
// src/
|
|
18275
|
+
// src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
18097
18276
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
18098
18277
|
function OrientationLockOverlay() {
|
|
18099
18278
|
const intl = (0, import_react_intl36.useIntl)();
|
|
@@ -18113,23 +18292,11 @@ function OrientationLockOverlay() {
|
|
|
18113
18292
|
}
|
|
18114
18293
|
var OrientationLockOverlay_default = OrientationLockOverlay;
|
|
18115
18294
|
|
|
18116
|
-
// src/
|
|
18117
|
-
var import_components74 = require("@transferwise/components");
|
|
18118
|
-
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18119
|
-
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
18120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
18121
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
18122
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
18123
|
-
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_components74.Button, { block: true, onClick: onAction, children: actionButton })
|
|
18124
|
-
] }) }) });
|
|
18125
|
-
}
|
|
18126
|
-
var CameraErrorScreen_default = CameraErrorScreen;
|
|
18127
|
-
|
|
18128
|
-
// src/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18295
|
+
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18129
18296
|
var import_react58 = require("react");
|
|
18130
18297
|
var import_screenfull = __toESM(require_screenfull());
|
|
18131
18298
|
|
|
18132
|
-
// src/
|
|
18299
|
+
// src/common/cameraCapture/utils/index.ts
|
|
18133
18300
|
var isSelfieCamera = (stream) => {
|
|
18134
18301
|
var _a;
|
|
18135
18302
|
const { facingMode } = ((_a = getVideoTrack(stream)) == null ? void 0 : _a.getSettings()) || {};
|
|
@@ -18175,7 +18342,7 @@ var getVideoCapabilities = (videoStream) => {
|
|
|
18175
18342
|
return (_b = (_a = getVideoTrack(videoStream)) == null ? void 0 : _a.getCapabilities) == null ? void 0 : _b.call(_a);
|
|
18176
18343
|
};
|
|
18177
18344
|
|
|
18178
|
-
// src/
|
|
18345
|
+
// src/common/cameraCapture/tracking/index.ts
|
|
18179
18346
|
var trackCameraError = (message, onEvent, error) => onEvent == null ? void 0 : onEvent(message, { Error: getSerializedError(error) });
|
|
18180
18347
|
var getSerializedError = (error) => error instanceof DOMException ? JSON.stringify({
|
|
18181
18348
|
name: error == null ? void 0 : error.name,
|
|
@@ -18197,13 +18364,13 @@ var getCameraStartedProperties = async (props, videoStream) => {
|
|
|
18197
18364
|
});
|
|
18198
18365
|
};
|
|
18199
18366
|
var trackCameraOrientationLandscape = (onEvent) => {
|
|
18200
|
-
onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Lock Overlay Shown", {});
|
|
18367
|
+
void (onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Lock Overlay Shown", {}));
|
|
18201
18368
|
};
|
|
18202
18369
|
var trackCameraOrientationLocked = (onEvent) => {
|
|
18203
|
-
onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Locked", {});
|
|
18370
|
+
void (onEvent == null ? void 0 : onEvent("Dynamic Flow - Camera Orientation Locked", {}));
|
|
18204
18371
|
};
|
|
18205
18372
|
|
|
18206
|
-
// src/
|
|
18373
|
+
// src/common/cameraCapture/hooks/useFullScreenOrientationLock.ts
|
|
18207
18374
|
var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
18208
18375
|
const lockOrientation = (0, import_react58.useCallback)(() => {
|
|
18209
18376
|
if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
|
|
@@ -18265,37 +18432,37 @@ var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
|
|
|
18265
18432
|
var noop5 = () => {
|
|
18266
18433
|
};
|
|
18267
18434
|
|
|
18268
|
-
// src/
|
|
18435
|
+
// src/common/cameraCapture/hooks/useVideoConstraints.ts
|
|
18269
18436
|
var import_react59 = require("react");
|
|
18270
18437
|
var useVideoConstraints = (direction) => {
|
|
18271
18438
|
const [videoConstraints, setVideoConstraints] = (0, import_react59.useState)();
|
|
18439
|
+
(0, import_react59.useEffect)(() => {
|
|
18440
|
+
void getVideoConstraints(direction).then(setVideoConstraints);
|
|
18441
|
+
}, [direction]);
|
|
18442
|
+
return { videoConstraints };
|
|
18443
|
+
};
|
|
18444
|
+
var getVideoConstraints = async (dir) => {
|
|
18272
18445
|
const defaultVideoConstraints = {
|
|
18273
|
-
facingMode:
|
|
18446
|
+
facingMode: dir === "front" ? "user" : "environment",
|
|
18274
18447
|
height: { min: 480, max: 1080, ideal: 720 },
|
|
18275
18448
|
width: { min: 640, max: 1920, ideal: 1280 },
|
|
18276
18449
|
frameRate: 30,
|
|
18277
18450
|
aspectRatio: 16 / 9
|
|
18278
18451
|
};
|
|
18279
|
-
(
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
|
|
18285
|
-
if (mainCamera == null ? void 0 : mainCamera.deviceId) {
|
|
18286
|
-
return __spreadProps(__spreadValues({}, defaultVideoConstraints), {
|
|
18287
|
-
deviceId: { exact: mainCamera.deviceId }
|
|
18288
|
-
});
|
|
18289
|
-
}
|
|
18452
|
+
if (dir === "back") {
|
|
18453
|
+
const mainCamera = (await getAvailableVideoDevices()).find(isMainBackCamera);
|
|
18454
|
+
if (mainCamera == null ? void 0 : mainCamera.deviceId) {
|
|
18455
|
+
return __spreadProps(__spreadValues({}, defaultVideoConstraints), {
|
|
18456
|
+
deviceId: { exact: mainCamera.deviceId }
|
|
18457
|
+
});
|
|
18290
18458
|
}
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
return { videoConstraints };
|
|
18459
|
+
}
|
|
18460
|
+
return defaultVideoConstraints;
|
|
18294
18461
|
};
|
|
18295
18462
|
|
|
18296
|
-
// src/
|
|
18463
|
+
// src/common/cameraCapture/overlay/Overlay.tsx
|
|
18297
18464
|
var import_react60 = require("react");
|
|
18298
|
-
var
|
|
18465
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
18299
18466
|
var captureButtonHeight = 92;
|
|
18300
18467
|
var reviewButtonsHeight = 120;
|
|
18301
18468
|
var imageHeight = 40;
|
|
@@ -18317,18 +18484,18 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18317
18484
|
return () => window.removeEventListener("resize", listener);
|
|
18318
18485
|
});
|
|
18319
18486
|
let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
|
|
18320
|
-
let helperBox = /* @__PURE__ */ (0,
|
|
18321
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
18322
|
-
title && /* @__PURE__ */ (0,
|
|
18323
|
-
instructions && /* @__PURE__ */ (0,
|
|
18487
|
+
let helperBox = /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
|
|
18488
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
|
|
18489
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h4", { className: "camera-capture-title", children: title }),
|
|
18490
|
+
instructions && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("small", { className: "camera-capture-instructions", children: instructions })
|
|
18324
18491
|
] });
|
|
18325
18492
|
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
18326
18493
|
if (reviewInstructions) {
|
|
18327
18494
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
18328
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18495
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
|
|
18329
18496
|
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
18330
18497
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
18331
|
-
helperBox = /* @__PURE__ */ (0,
|
|
18498
|
+
helperBox = /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_jsx_runtime120.Fragment, {});
|
|
18332
18499
|
}
|
|
18333
18500
|
}
|
|
18334
18501
|
const framePosition = {
|
|
@@ -18346,19 +18513,31 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
|
|
|
18346
18513
|
width: "90%"
|
|
18347
18514
|
}
|
|
18348
18515
|
};
|
|
18349
|
-
return /* @__PURE__ */ (0,
|
|
18350
|
-
/* @__PURE__ */ (0,
|
|
18351
|
-
/* @__PURE__ */ (0,
|
|
18352
|
-
/* @__PURE__ */ (0,
|
|
18516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
|
|
18517
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("mask", { id: "mask", children: [
|
|
18518
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
|
|
18519
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("image", __spreadValues({ href: overlay }, framePosition))
|
|
18353
18520
|
] }) }),
|
|
18354
|
-
overlay && /* @__PURE__ */ (0,
|
|
18355
|
-
outline && /* @__PURE__ */ (0,
|
|
18356
|
-
/* @__PURE__ */ (0,
|
|
18521
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
|
|
18522
|
+
outline && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("image", __spreadValues({ href: outline }, framePosition)),
|
|
18523
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
|
|
18357
18524
|
] });
|
|
18358
18525
|
}
|
|
18359
18526
|
var Overlay_default = Overlay;
|
|
18360
18527
|
|
|
18361
|
-
// src/
|
|
18528
|
+
// src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
|
|
18529
|
+
var import_components74 = require("@transferwise/components");
|
|
18530
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
18531
|
+
function CameraErrorScreen({ title, description, actionButton, onAction }) {
|
|
18532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
|
|
18533
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
|
|
18534
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
|
|
18535
|
+
onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_components74.Button, { block: true, onClick: onAction, children: actionButton })
|
|
18536
|
+
] }) }) });
|
|
18537
|
+
}
|
|
18538
|
+
var CameraErrorScreen_default = CameraErrorScreen;
|
|
18539
|
+
|
|
18540
|
+
// src/common/cameraCapture/CameraCapture.tsx
|
|
18362
18541
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
18363
18542
|
function CameraCapture({
|
|
18364
18543
|
direction = "back",
|