@wise/dynamic-flow-client 2.2.0-beta-365401.17 → 2.2.1

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 CHANGED
@@ -11,7 +11,7 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
11
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
12
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
13
  var __spreadValues = (a, b) => {
14
- for (var prop in b ||= {})
14
+ for (var prop in b || (b = {}))
15
15
  if (__hasOwnProp.call(b, prop))
16
16
  __defNormalProp(a, prop, b[prop]);
17
17
  if (__getOwnPropSymbols)
@@ -50,6 +50,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
50
50
  // ../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js
51
51
  var require_classnames = __commonJS({
52
52
  "../../node_modules/.pnpm/classnames@2.3.2/node_modules/classnames/index.js"(exports, module2) {
53
+ "use strict";
53
54
  (function() {
54
55
  "use strict";
55
56
  var hasOwn = {}.hasOwnProperty;
@@ -98,9 +99,10 @@ var require_classnames = __commonJS({
98
99
  }
99
100
  });
100
101
 
101
- // ../../node_modules/.pnpm/react-webcam@7.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js
102
+ // ../../node_modules/.pnpm/react-webcam@7.1.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js
102
103
  var require_react_webcam = __commonJS({
103
- "../../node_modules/.pnpm/react-webcam@7.0.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
104
+ "../../node_modules/.pnpm/react-webcam@7.1.1_biqbaboplfbrettd7655fr4n2y/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
105
+ "use strict";
104
106
  (function webpackUniversalModuleDefinition(root, factory) {
105
107
  if (typeof exports === "object" && typeof module2 === "object")
106
108
  module2.exports = factory(require("react"));
@@ -373,6 +375,8 @@ var require_react_webcam = __commonJS({
373
375
  }
374
376
  var _b = this, ctx = _b.ctx, canvas = _b.canvas;
375
377
  if (ctx && canvas) {
378
+ canvas.width = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.width) || canvas.width;
379
+ canvas.height = (screenshotDimensions === null || screenshotDimensions === void 0 ? void 0 : screenshotDimensions.height) || canvas.height;
376
380
  if (props.mirrored) {
377
381
  ctx.translate(canvas.width, 0);
378
382
  ctx.scale(-1, 1);
@@ -525,168 +529,6 @@ var require_react_webcam = __commonJS({
525
529
  }
526
530
  });
527
531
 
528
- // ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
529
- var require_screenfull = __commonJS({
530
- "../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module2) {
531
- (function() {
532
- "use strict";
533
- var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
534
- var isCommonjs = typeof module2 !== "undefined" && module2.exports;
535
- var fn = function() {
536
- var val;
537
- var fnMap = [
538
- [
539
- "requestFullscreen",
540
- "exitFullscreen",
541
- "fullscreenElement",
542
- "fullscreenEnabled",
543
- "fullscreenchange",
544
- "fullscreenerror"
545
- ],
546
- // New WebKit
547
- [
548
- "webkitRequestFullscreen",
549
- "webkitExitFullscreen",
550
- "webkitFullscreenElement",
551
- "webkitFullscreenEnabled",
552
- "webkitfullscreenchange",
553
- "webkitfullscreenerror"
554
- ],
555
- // Old WebKit
556
- [
557
- "webkitRequestFullScreen",
558
- "webkitCancelFullScreen",
559
- "webkitCurrentFullScreenElement",
560
- "webkitCancelFullScreen",
561
- "webkitfullscreenchange",
562
- "webkitfullscreenerror"
563
- ],
564
- [
565
- "mozRequestFullScreen",
566
- "mozCancelFullScreen",
567
- "mozFullScreenElement",
568
- "mozFullScreenEnabled",
569
- "mozfullscreenchange",
570
- "mozfullscreenerror"
571
- ],
572
- [
573
- "msRequestFullscreen",
574
- "msExitFullscreen",
575
- "msFullscreenElement",
576
- "msFullscreenEnabled",
577
- "MSFullscreenChange",
578
- "MSFullscreenError"
579
- ]
580
- ];
581
- var i = 0;
582
- var l = fnMap.length;
583
- var ret = {};
584
- for (; i < l; i++) {
585
- val = fnMap[i];
586
- if (val && val[1] in document2) {
587
- for (i = 0; i < val.length; i++) {
588
- ret[fnMap[0][i]] = val[i];
589
- }
590
- return ret;
591
- }
592
- }
593
- return false;
594
- }();
595
- var eventNameMap = {
596
- change: fn.fullscreenchange,
597
- error: fn.fullscreenerror
598
- };
599
- var screenfull2 = {
600
- request: function(element, options) {
601
- return new Promise(function(resolve, reject) {
602
- var onFullScreenEntered = function() {
603
- this.off("change", onFullScreenEntered);
604
- resolve();
605
- }.bind(this);
606
- this.on("change", onFullScreenEntered);
607
- element = element || document2.documentElement;
608
- var returnPromise = element[fn.requestFullscreen](options);
609
- if (returnPromise instanceof Promise) {
610
- returnPromise.then(onFullScreenEntered).catch(reject);
611
- }
612
- }.bind(this));
613
- },
614
- exit: function() {
615
- return new Promise(function(resolve, reject) {
616
- if (!this.isFullscreen) {
617
- resolve();
618
- return;
619
- }
620
- var onFullScreenExit = function() {
621
- this.off("change", onFullScreenExit);
622
- resolve();
623
- }.bind(this);
624
- this.on("change", onFullScreenExit);
625
- var returnPromise = document2[fn.exitFullscreen]();
626
- if (returnPromise instanceof Promise) {
627
- returnPromise.then(onFullScreenExit).catch(reject);
628
- }
629
- }.bind(this));
630
- },
631
- toggle: function(element, options) {
632
- return this.isFullscreen ? this.exit() : this.request(element, options);
633
- },
634
- onchange: function(callback) {
635
- this.on("change", callback);
636
- },
637
- onerror: function(callback) {
638
- this.on("error", callback);
639
- },
640
- on: function(event, callback) {
641
- var eventName = eventNameMap[event];
642
- if (eventName) {
643
- document2.addEventListener(eventName, callback, false);
644
- }
645
- },
646
- off: function(event, callback) {
647
- var eventName = eventNameMap[event];
648
- if (eventName) {
649
- document2.removeEventListener(eventName, callback, false);
650
- }
651
- },
652
- raw: fn
653
- };
654
- if (!fn) {
655
- if (isCommonjs) {
656
- module2.exports = { isEnabled: false };
657
- } else {
658
- window.screenfull = { isEnabled: false };
659
- }
660
- return;
661
- }
662
- Object.defineProperties(screenfull2, {
663
- isFullscreen: {
664
- get: function() {
665
- return Boolean(document2[fn.fullscreenElement]);
666
- }
667
- },
668
- element: {
669
- enumerable: true,
670
- get: function() {
671
- return document2[fn.fullscreenElement];
672
- }
673
- },
674
- isEnabled: {
675
- enumerable: true,
676
- get: function() {
677
- return Boolean(document2[fn.fullscreenEnabled]);
678
- }
679
- }
680
- });
681
- if (isCommonjs) {
682
- module2.exports = screenfull2;
683
- } else {
684
- window.screenfull = screenfull2;
685
- }
686
- })();
687
- }
688
- });
689
-
690
532
  // src/index.ts
691
533
  var src_exports = {};
692
534
  __export(src_exports, {
@@ -1013,7 +855,7 @@ function isReference(block) {
1013
855
 
1014
856
  // src/dynamicFlow/DynamicFlow.tsx
1015
857
  var import_react41 = require("react");
1016
- var import_react_intl34 = require("react-intl");
858
+ var import_react_intl32 = require("react-intl");
1017
859
 
1018
860
  // src/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
1019
861
  var import_react2 = require("react");
@@ -1871,30 +1713,6 @@ var isNullableArrayModel = (model) => {
1871
1713
  // src/common/utils/misc-utils.ts
1872
1714
  var isBasicError = (error) => isString(error) || isNull(error);
1873
1715
 
1874
- // src/common/utils/mobile-utils.ts
1875
- var isMobile = () => {
1876
- return isMobileScreenSize() && (isTouchScreen() || isMobileUA());
1877
- };
1878
- var isMobileUA = (userAgent = window.navigator.userAgent) => {
1879
- return /Mobi|\b(iPhone|Android|BlackBerry|webOS|Windows Phone)\b/i.test(userAgent);
1880
- };
1881
- var isMobileScreenSize = (width = window.screen.width, height = window.screen.height) => {
1882
- return width < 768 || height < 768;
1883
- };
1884
- var isTouchScreen = (navigator2 = window.navigator, matchMedia = window.matchMedia) => {
1885
- if ("maxTouchPoints" in navigator2) {
1886
- return navigator2.maxTouchPoints > 0;
1887
- }
1888
- if ("msMaxTouchPoints" in navigator2) {
1889
- return navigator2["msMaxTouchPoints"] > 0;
1890
- }
1891
- const mQ = matchMedia == null ? void 0 : matchMedia("(pointer:coarse)");
1892
- if ((mQ == null ? void 0 : mQ.media) === "(pointer:coarse)") {
1893
- return !!mQ.matches;
1894
- }
1895
- return false;
1896
- };
1897
-
1898
1716
  // src/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
1899
1717
  var import_react6 = require("react");
1900
1718
  function useDebouncedFunction(callback, waitMs) {
@@ -3311,7 +3129,11 @@ var RepeatableSchema = ({
3311
3129
  setOpenModalType("edit");
3312
3130
  };
3313
3131
  const onSaveItem = (action) => {
3132
+ var _a;
3314
3133
  const updatedItem = action === "remove" ? null : getItemSummaryFromSchema(schema.items, editableItem.model, schema == null ? void 0 : schema.summary);
3134
+ if (action !== "remove" && !isValidSchema((_a = updatedItem == null ? void 0 : updatedItem.value) != null ? _a : null, schema.items)) {
3135
+ return;
3136
+ }
3315
3137
  const updatedItemSummaries = getUpdatedItemSummaries(action, {
3316
3138
  originalItem: editableItem.item,
3317
3139
  updatedItem,
@@ -3657,7 +3479,7 @@ var logInvalidTypeFallbackWarning = ({
3657
3479
 
3658
3480
  // src/formControl/FormControl.tsx
3659
3481
  var import_jsx_runtime26 = require("react/jsx-runtime");
3660
- var _FormControl = class extends import_react14.PureComponent {
3482
+ var _FormControl = class _FormControl extends import_react14.PureComponent {
3661
3483
  constructor(props) {
3662
3484
  super(props);
3663
3485
  /**
@@ -4016,12 +3838,11 @@ var _FormControl = class extends import_react14.PureComponent {
4016
3838
  }
4017
3839
  }
4018
3840
  };
4019
- var FormControl = _FormControl;
4020
- FormControl.Type = FormControlType;
4021
- FormControl.Size = Size;
4022
- FormControl.MonthFormat = MonthFormat;
4023
- FormControl.DateMode = DateMode;
4024
- FormControl.defaultProps = {
3841
+ _FormControl.Type = FormControlType;
3842
+ _FormControl.Size = Size;
3843
+ _FormControl.MonthFormat = MonthFormat;
3844
+ _FormControl.DateMode = DateMode;
3845
+ _FormControl.defaultProps = {
4025
3846
  autoComplete: true,
4026
3847
  countryCode: null,
4027
3848
  disabled: false,
@@ -4052,6 +3873,7 @@ FormControl.defaultProps = {
4052
3873
  uploadProps: {},
4053
3874
  value: null
4054
3875
  };
3876
+ var FormControl = _FormControl;
4055
3877
 
4056
3878
  // src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
4057
3879
  var import_components12 = require("@transferwise/components");
@@ -5367,10 +5189,18 @@ var import_react26 = require("react");
5367
5189
  // src/layout/search/SearchInput.tsx
5368
5190
  var import_components25 = require("@transferwise/components");
5369
5191
  var import_jsx_runtime51 = require("react/jsx-runtime");
5370
- var SearchInput = ({ title, value, onChange }) => {
5192
+ var SearchInput = ({ title, value, onFocus, onChange }) => {
5371
5193
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "control-label d-inline", children: [
5372
5194
  title,
5373
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components25.Input, { type: "text", value, onChange: (event) => onChange(event.currentTarget.value) })
5195
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5196
+ import_components25.Input,
5197
+ {
5198
+ type: "text",
5199
+ value,
5200
+ onFocus,
5201
+ onChange: (event) => onChange(event.currentTarget.value)
5202
+ }
5203
+ )
5374
5204
  ] });
5375
5205
  };
5376
5206
 
@@ -5511,18 +5341,27 @@ var DynamicSearch = ({ component, onAction }) => {
5511
5341
  const [query, setQuery] = (0, import_react26.useState)("");
5512
5342
  const { title, margin, url, method, param, emptyMessage } = component;
5513
5343
  const { status, results, search } = useSearch({ url, method, param });
5344
+ const onEvent = useEventDispatcher();
5514
5345
  const debouncedSearch = (0, import_react26.useMemo)(() => debounce(search, DEBOUNCE_TIME), [search]);
5346
+ const onSearchStart = () => {
5347
+ onEvent("Dynamic Flow - Search Started", {});
5348
+ };
5515
5349
  const onChange = (value) => {
5516
5350
  setQuery(value);
5517
5351
  debouncedSearch(value);
5518
5352
  };
5519
5353
  const onResultSelected = ({ type, value }) => {
5520
5354
  if (type === "action") {
5355
+ onEvent("Dynamic Flow - Search Result Selected", {
5356
+ type: "action",
5357
+ actionId: value.id || value.$id
5358
+ });
5521
5359
  onAction(value);
5522
5360
  }
5523
5361
  if (type === "search") {
5524
5362
  setQuery(value.query);
5525
5363
  const { url: url2, method: method2, param: param2, query: query2 } = value;
5364
+ onEvent("Dynamic Flow - Search Result Selected", { type: "search" });
5526
5365
  void search(query2, { url: url2, method: method2, param: param2 });
5527
5366
  }
5528
5367
  };
@@ -5531,7 +5370,7 @@ var DynamicSearch = ({ component, onAction }) => {
5531
5370
  void search(query);
5532
5371
  };
5533
5372
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getMargin(margin), children: [
5534
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SearchInput, { title, value: query, onChange }),
5373
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
5535
5374
  status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
5536
5375
  status === "error" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorResult, { onRetrySearch }),
5537
5376
  status === "success" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SearchResults, { results, emptyMessage, onSelect: onResultSelected })
@@ -6007,9 +5846,8 @@ var import_react36 = require("react");
6007
5846
 
6008
5847
  // src/step/cameraStep/cameraCapture/CameraCapture.tsx
6009
5848
  var import_react35 = require("react");
6010
- var import_react_intl30 = require("react-intl");
5849
+ var import_react_intl28 = require("react-intl");
6011
5850
  var import_react_webcam = __toESM(require_react_webcam());
6012
- var import_screenfull = __toESM(require_screenfull());
6013
5851
 
6014
5852
  // src/step/cameraStep/cameraCapture/CameraCapture.messages.ts
6015
5853
  var import_react_intl22 = require("react-intl");
@@ -6033,56 +5871,16 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
6033
5871
 
6034
5872
  // src/step/cameraStep/cameraCapture/components/index.tsx
6035
5873
  var import_components27 = require("@transferwise/components");
6036
- var import_react_intl25 = require("react-intl");
6037
-
6038
- // src/step/cameraStep/cameraCapture/components/orientationLock/OrientationLock.tsx
6039
- var import_react_intl24 = require("react-intl");
6040
-
6041
- // src/step/cameraStep/cameraCapture/components/orientationLock/OrientationLock.messages.ts
6042
5874
  var import_react_intl23 = require("react-intl");
6043
- var OrientationLock_messages_default = (0, import_react_intl23.defineMessages)({
6044
- text: {
6045
- id: "dynamicFlows.CameraCapture.rotatePhone.text",
6046
- defaultMessage: "Rotate your phone to portrait view to take a photo",
6047
- description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo"
6048
- },
6049
- imgAlt: {
6050
- id: "dynamicFlows.CameraCapture.rotatePhone.imgAlt",
6051
- defaultMessage: "Rotate your phone icon",
6052
- description: "Rotate phone icon alt text"
6053
- }
6054
- });
6055
-
6056
- // src/step/cameraStep/cameraCapture/components/orientationLock/OrientationLock.tsx
6057
5875
  var import_jsx_runtime57 = require("react/jsx-runtime");
6058
- var OrientationLock = () => {
6059
- const intl = (0, import_react_intl24.useIntl)();
6060
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "orientation-lock-overlay p-x-3 p-y-3", "data-testid": "orientation-lock", children: [
6061
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6062
- "img",
6063
- {
6064
- className: "m-b-3",
6065
- src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg",
6066
- width: "96",
6067
- height: "96",
6068
- alt: intl.formatMessage(OrientationLock_messages_default.imgAlt)
6069
- }
6070
- ),
6071
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLock_messages_default.text) })
6072
- ] });
6073
- };
6074
- var OrientationLock_default = OrientationLock;
6075
-
6076
- // src/step/cameraStep/cameraCapture/components/index.tsx
6077
- var import_jsx_runtime58 = require("react/jsx-runtime");
6078
- var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CaptureButton, { onClick: onCapture }) });
5876
+ var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CaptureButton, { onClick: onCapture }) });
6079
5877
  var ReviewBottomBar = ({
6080
5878
  onSubmit,
6081
5879
  onRetry
6082
5880
  }) => {
6083
- const intl = (0, import_react_intl25.useIntl)();
6084
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
6085
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5881
+ const intl = (0, import_react_intl23.useIntl)();
5882
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
5883
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6086
5884
  import_components27.Button,
6087
5885
  {
6088
5886
  className: "m-b-1",
@@ -6093,7 +5891,7 @@ var ReviewBottomBar = ({
6093
5891
  children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
6094
5892
  }
6095
5893
  ),
6096
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5894
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6097
5895
  import_components27.Button,
6098
5896
  {
6099
5897
  className: "m-b-2",
@@ -6107,14 +5905,14 @@ var ReviewBottomBar = ({
6107
5905
  )
6108
5906
  ] }) }) });
6109
5907
  };
6110
- var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5908
+ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6111
5909
  "button",
6112
5910
  {
6113
5911
  type: "button",
6114
5912
  className: "camera-capture-btn m-b-2",
6115
5913
  "data-testid": "camera-capture-button",
6116
5914
  onClick,
6117
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "camera-capture-btn-inner" })
5915
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "camera-capture-btn-inner" })
6118
5916
  }
6119
5917
  );
6120
5918
 
@@ -6194,7 +5992,7 @@ var useVideoConstraints = (direction) => {
6194
5992
 
6195
5993
  // src/step/cameraStep/cameraCapture/overlay/Overlay.tsx
6196
5994
  var import_react34 = require("react");
6197
- var import_jsx_runtime59 = require("react/jsx-runtime");
5995
+ var import_jsx_runtime58 = require("react/jsx-runtime");
6198
5996
  var captureButtonHeight = 92;
6199
5997
  var reviewButtonsHeight = 120;
6200
5998
  var imageHeight = 40;
@@ -6223,18 +6021,18 @@ var Overlay = ({
6223
6021
  return () => window.removeEventListener("resize", listener);
6224
6022
  });
6225
6023
  let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
6226
- let helperBox = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
6227
- imageUrl && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
6228
- title && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h4", { className: "camera-capture-title", children: title }),
6229
- instructions && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("small", { className: "camera-capture-instructions", children: instructions })
6024
+ let helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
6025
+ imageUrl && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
6026
+ title && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h4", { className: "camera-capture-title", children: title }),
6027
+ instructions && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { className: "camera-capture-instructions", children: instructions })
6230
6028
  ] });
6231
6029
  const frameBottomMargin = captureButtonHeight + helperBoxHeight;
6232
6030
  if (reviewInstructions) {
6233
6031
  helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
6234
- helperBox = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
6032
+ helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
6235
6033
  const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
6236
6034
  if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
6237
- helperBox = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, {});
6035
+ helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, {});
6238
6036
  }
6239
6037
  }
6240
6038
  const framePosition = {
@@ -6252,25 +6050,25 @@ var Overlay = ({
6252
6050
  width: "90%"
6253
6051
  }
6254
6052
  };
6255
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
6256
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("mask", { id: "mask", children: [
6257
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
6258
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("image", __spreadValues({ href: overlay }, framePosition))
6053
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
6054
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("mask", { id: "mask", children: [
6055
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
6056
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("image", __spreadValues({ href: overlay }, framePosition))
6259
6057
  ] }) }),
6260
- overlay && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
6261
- outline && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("image", __spreadValues({ href: outline }, framePosition)),
6262
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
6058
+ overlay && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
6059
+ outline && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("image", __spreadValues({ href: outline }, framePosition)),
6060
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
6263
6061
  ] });
6264
6062
  };
6265
6063
  var Overlay_default = Overlay;
6266
6064
 
6267
6065
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
6268
6066
  var import_components28 = require("@transferwise/components");
6269
- var import_react_intl27 = require("react-intl");
6067
+ var import_react_intl25 = require("react-intl");
6270
6068
 
6271
6069
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts
6272
- var import_react_intl26 = require("react-intl");
6273
- var NoCameraAccess_messages_default = (0, import_react_intl26.defineMessages)({
6070
+ var import_react_intl24 = require("react-intl");
6071
+ var NoCameraAccess_messages_default = (0, import_react_intl24.defineMessages)({
6274
6072
  title: {
6275
6073
  id: "dynamicFlows.CameraCapture.NoCameraAccess.title",
6276
6074
  defaultMessage: "We can't access your camera",
@@ -6289,23 +6087,23 @@ var NoCameraAccess_messages_default = (0, import_react_intl26.defineMessages)({
6289
6087
  });
6290
6088
 
6291
6089
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
6292
- var import_jsx_runtime60 = require("react/jsx-runtime");
6090
+ var import_jsx_runtime59 = require("react/jsx-runtime");
6293
6091
  var NoCameraAccess = ({ onAction }) => {
6294
- const intl = (0, import_react_intl27.useIntl)();
6295
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6296
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
6297
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
6298
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components28.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6092
+ const intl = (0, import_react_intl25.useIntl)();
6093
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6094
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
6095
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
6096
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components28.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6299
6097
  ] }) }) }) });
6300
6098
  };
6301
6099
  var NoCameraAccess_default = NoCameraAccess;
6302
6100
 
6303
6101
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
6304
- var import_react_intl29 = require("react-intl");
6102
+ var import_react_intl27 = require("react-intl");
6305
6103
 
6306
6104
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.ts
6307
- var import_react_intl28 = require("react-intl");
6308
- var CameraNotSupported_messages_default = (0, import_react_intl28.defineMessages)({
6105
+ var import_react_intl26 = require("react-intl");
6106
+ var CameraNotSupported_messages_default = (0, import_react_intl26.defineMessages)({
6309
6107
  title: {
6310
6108
  id: "dynamicFlows.CameraCapture.CameraNotSupported.title",
6311
6109
  defaultMessage: "Camera not supported",
@@ -6319,12 +6117,12 @@ var CameraNotSupported_messages_default = (0, import_react_intl28.defineMessages
6319
6117
  });
6320
6118
 
6321
6119
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
6322
- var import_jsx_runtime61 = require("react/jsx-runtime");
6120
+ var import_jsx_runtime60 = require("react/jsx-runtime");
6323
6121
  var CameraNotSupported = () => {
6324
- const intl = (0, import_react_intl29.useIntl)();
6325
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6326
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
6327
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
6122
+ const intl = (0, import_react_intl27.useIntl)();
6123
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6124
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
6125
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
6328
6126
  ] }) }) }) });
6329
6127
  };
6330
6128
  var CameraNotSupported_default = CameraNotSupported;
@@ -6349,7 +6147,7 @@ var getCameraStartedProperties = async (props, videoStream) => {
6349
6147
  };
6350
6148
 
6351
6149
  // src/step/cameraStep/cameraCapture/CameraCapture.tsx
6352
- var import_jsx_runtime62 = require("react/jsx-runtime");
6150
+ var import_jsx_runtime61 = require("react/jsx-runtime");
6353
6151
  var CameraCapture = ({
6354
6152
  direction = "back",
6355
6153
  overlay = "",
@@ -6365,41 +6163,9 @@ var CameraCapture = ({
6365
6163
  const [isVideoMirrored, setIsVideoMirrored] = (0, import_react35.useState)(false);
6366
6164
  const [ready, setReady] = (0, import_react35.useState)(false);
6367
6165
  const [reviewImage, setReviewImage] = (0, import_react35.useState)();
6368
- const isMobileDevice = (0, import_react35.useMemo)(() => isMobile(), []);
6369
6166
  const webcamReference = (0, import_react35.useRef)(null);
6370
6167
  const { videoConstraints } = useVideoConstraints(direction);
6371
- const intl = (0, import_react_intl30.useIntl)();
6372
- const lockOrientation = (0, import_react35.useCallback)(() => {
6373
- if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
6374
- window.screen.orientation.lock("portrait").then(() => {
6375
- console.log("orientation locked");
6376
- }).catch((e) => {
6377
- console.log(e);
6378
- });
6379
- }
6380
- }, []);
6381
- const unlockOrientation = () => {
6382
- var _a, _b;
6383
- if ((_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) {
6384
- window.screen.orientation.unlock();
6385
- }
6386
- };
6387
- const enterFullScreen = (0, import_react35.useCallback)(() => {
6388
- if (mode === "CAPTURE" && isMobileDevice && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
6389
- import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
6390
- lockOrientation();
6391
- }).catch((e) => {
6392
- console.log(e);
6393
- });
6394
- }
6395
- }, [mode, isMobileDevice, lockOrientation]);
6396
- const exitFullScreen = () => {
6397
- import_screenfull.default.exit().then(() => {
6398
- console.log("Document Exited from Full screen mode");
6399
- }).catch((err) => {
6400
- console.error(err);
6401
- });
6402
- };
6168
+ const intl = (0, import_react_intl28.useIntl)();
6403
6169
  const handleCapture = (0, import_react35.useCallback)(async () => {
6404
6170
  var _a, _b, _c, _d, _e, _f;
6405
6171
  if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
@@ -6436,14 +6202,11 @@ var CameraCapture = ({
6436
6202
  );
6437
6203
  const handleUserMedia = (0, import_react35.useCallback)(
6438
6204
  (stream) => {
6439
- setTimeout(() => {
6440
- enterFullScreen();
6441
- }, 100);
6442
6205
  setReady(true);
6443
6206
  setIsVideoMirrored(isSelfieCamera(stream));
6444
6207
  void trackCameraFeedStarted(onEvent, { direction }, stream);
6445
6208
  },
6446
- [setIsVideoMirrored, onEvent, direction, enterFullScreen]
6209
+ [setIsVideoMirrored, onEvent, direction]
6447
6210
  );
6448
6211
  const handleReviewSubmit = () => {
6449
6212
  onCapture((reviewImage == null ? void 0 : reviewImage.blob) || null);
@@ -6453,20 +6216,8 @@ var CameraCapture = ({
6453
6216
  setReviewImage(void 0);
6454
6217
  };
6455
6218
  const handleRetryCameraAccess = () => setMode("CAPTURE");
6456
- (0, import_react35.useEffect)(() => {
6457
- if (mode !== "CAPTURE" || !isMobileDevice) {
6458
- exitFullScreen();
6459
- unlockOrientation();
6460
- }
6461
- }, [mode, isMobileDevice]);
6462
- (0, import_react35.useEffect)(() => {
6463
- return () => {
6464
- exitFullScreen();
6465
- unlockOrientation();
6466
- };
6467
- }, []);
6468
- const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
6469
- videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6219
+ const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
6220
+ videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6470
6221
  import_react_webcam.default,
6471
6222
  {
6472
6223
  ref: webcamReference,
@@ -6477,7 +6228,7 @@ var CameraCapture = ({
6477
6228
  onUserMedia: handleUserMedia
6478
6229
  }
6479
6230
  ),
6480
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6231
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6481
6232
  Overlay_default,
6482
6233
  {
6483
6234
  overlay,
@@ -6487,12 +6238,11 @@ var CameraCapture = ({
6487
6238
  instructions
6488
6239
  }
6489
6240
  ),
6490
- isMobileDevice && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OrientationLock_default, {}),
6491
- ready && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
6241
+ ready && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
6492
6242
  ] });
6493
- const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
6494
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
6495
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6243
+ const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
6244
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
6245
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6496
6246
  Overlay_default,
6497
6247
  {
6498
6248
  overlay,
@@ -6502,19 +6252,19 @@ var CameraCapture = ({
6502
6252
  reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
6503
6253
  }
6504
6254
  ),
6505
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
6255
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
6506
6256
  ] });
6507
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("section", { className: "camera-capture", children: [
6257
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { className: "camera-capture", children: [
6508
6258
  mode === "CAPTURE" && captureScreen,
6509
6259
  mode === "REVIEW" && reviewScreen,
6510
- mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
6511
- mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CameraNotSupported_default, {})
6260
+ mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
6261
+ mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CameraNotSupported_default, {})
6512
6262
  ] });
6513
6263
  };
6514
6264
  var CameraCapture_default = CameraCapture;
6515
6265
 
6516
6266
  // src/step/cameraStep/CameraStep.tsx
6517
- var import_jsx_runtime63 = require("react/jsx-runtime");
6267
+ var import_jsx_runtime62 = require("react/jsx-runtime");
6518
6268
  function blobToBase64(blob) {
6519
6269
  return new Promise((resolve, _) => {
6520
6270
  const reader = new FileReader();
@@ -6552,7 +6302,7 @@ var CameraStep = (props) => {
6552
6302
  });
6553
6303
  }
6554
6304
  };
6555
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6305
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6556
6306
  CameraCapture_default,
6557
6307
  {
6558
6308
  overlay,
@@ -6601,11 +6351,11 @@ function getFirstAction(step) {
6601
6351
  }
6602
6352
 
6603
6353
  // src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
6604
- var import_react_intl32 = require("react-intl");
6354
+ var import_react_intl30 = require("react-intl");
6605
6355
 
6606
6356
  // src/step/externalConfirmationStep/ExternalConfirmationStep.messages.ts
6607
- var import_react_intl31 = require("react-intl");
6608
- var ExternalConfirmationStep_messages_default = (0, import_react_intl31.defineMessages)({
6357
+ var import_react_intl29 = require("react-intl");
6358
+ var ExternalConfirmationStep_messages_default = (0, import_react_intl29.defineMessages)({
6609
6359
  title: {
6610
6360
  id: "dynamicFlows.ExternalConfirmation.title",
6611
6361
  defaultMessage: "Please confirm",
@@ -6629,12 +6379,12 @@ var ExternalConfirmationStep_messages_default = (0, import_react_intl31.defineMe
6629
6379
  });
6630
6380
 
6631
6381
  // src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
6632
- var import_jsx_runtime64 = require("react/jsx-runtime");
6382
+ var import_jsx_runtime63 = require("react/jsx-runtime");
6633
6383
  var noop5 = () => {
6634
6384
  };
6635
6385
  var ExternalConfirmationStep = ({ url, onClose }) => {
6636
- const { formatMessage } = (0, import_react_intl32.useIntl)();
6637
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
6386
+ const { formatMessage } = (0, import_react_intl30.useIntl)();
6387
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6638
6388
  DynamicLayout_default,
6639
6389
  {
6640
6390
  components: [
@@ -6701,9 +6451,9 @@ function getOrigin(url) {
6701
6451
  // src/dynamicFlow/BackButton.tsx
6702
6452
  var import_components30 = require("@transferwise/components");
6703
6453
  var import_icons2 = require("@transferwise/icons");
6704
- var import_jsx_runtime65 = require("react/jsx-runtime");
6454
+ var import_jsx_runtime64 = require("react/jsx-runtime");
6705
6455
  var BackButton = ({ title, action, onAction }) => {
6706
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
6456
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
6707
6457
  "a",
6708
6458
  {
6709
6459
  onClick: (event) => {
@@ -6714,8 +6464,8 @@ var BackButton = ({ title, action, onAction }) => {
6714
6464
  className: "df-back-btn",
6715
6465
  "aria-label": title,
6716
6466
  children: [
6717
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: title }),
6718
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components30.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6467
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: title }),
6468
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components30.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6719
6469
  ]
6720
6470
  }
6721
6471
  );
@@ -6723,7 +6473,7 @@ var BackButton = ({ title, action, onAction }) => {
6723
6473
  var BackButton_default = BackButton;
6724
6474
 
6725
6475
  // src/dynamicFlow/DynamicFlowStep.tsx
6726
- var import_jsx_runtime66 = require("react/jsx-runtime");
6476
+ var import_jsx_runtime65 = require("react/jsx-runtime");
6727
6477
  var DynamicFlowStep = (props) => {
6728
6478
  var _a, _b, _c;
6729
6479
  const { step, globalError, onAction } = props;
@@ -6734,15 +6484,15 @@ var DynamicFlowStep = (props) => {
6734
6484
  return null;
6735
6485
  }
6736
6486
  if (externalUrl && requiresManualTrigger) {
6737
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
6487
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
6738
6488
  }
6739
6489
  if (isCameraStep(step)) {
6740
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
6490
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
6741
6491
  }
6742
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
6743
- backButton && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BackButton_default, __spreadProps(__spreadValues({}, backButton), { onAction })),
6744
- globalError ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
6745
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
6492
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
6493
+ backButton && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BackButton_default, __spreadProps(__spreadValues({}, backButton), { onAction })),
6494
+ globalError ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
6495
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
6746
6496
  ] });
6747
6497
  };
6748
6498
 
@@ -6888,7 +6638,7 @@ var isInlineSchema = (schema) => {
6888
6638
  // src/dynamicFlow/utils/useLoader.tsx
6889
6639
  var import_components31 = require("@transferwise/components");
6890
6640
  var import_react39 = require("react");
6891
- var import_jsx_runtime67 = require("react/jsx-runtime");
6641
+ var import_jsx_runtime66 = require("react/jsx-runtime");
6892
6642
  function useLoader(loaderConfig, initialState) {
6893
6643
  const config = __spreadValues({
6894
6644
  size: import_components31.Size.EXTRA_LARGE,
@@ -6897,7 +6647,7 @@ function useLoader(loaderConfig, initialState) {
6897
6647
  }, loaderConfig);
6898
6648
  const [loadingState, setLoadingState] = (0, import_react39.useState)(initialState);
6899
6649
  const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
6900
- const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
6650
+ const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6901
6651
  import_components31.Loader,
6902
6652
  {
6903
6653
  size: config.size,
@@ -6913,11 +6663,11 @@ var import_react40 = require("react");
6913
6663
 
6914
6664
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
6915
6665
  var import_components32 = require("@transferwise/components");
6916
- var import_react_intl33 = require("react-intl");
6917
- var import_jsx_runtime68 = require("react/jsx-runtime");
6666
+ var import_react_intl31 = require("react-intl");
6667
+ var import_jsx_runtime67 = require("react/jsx-runtime");
6918
6668
  var ErrorBoundaryAlert = ({ onDismiss }) => {
6919
- const { formatMessage } = (0, import_react_intl33.useIntl)();
6920
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
6669
+ const { formatMessage } = (0, import_react_intl31.useIntl)();
6670
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
6921
6671
  import_components32.Alert,
6922
6672
  {
6923
6673
  action: {
@@ -6933,7 +6683,7 @@ var ErrorBoundaryAlert = ({ onDismiss }) => {
6933
6683
  };
6934
6684
 
6935
6685
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
6936
- var import_jsx_runtime69 = require("react/jsx-runtime");
6686
+ var import_jsx_runtime68 = require("react/jsx-runtime");
6937
6687
  var noop6 = () => {
6938
6688
  };
6939
6689
  var ErrorBoundary = class extends import_react40.Component {
@@ -6954,8 +6704,8 @@ var ErrorBoundary = class extends import_react40.Component {
6954
6704
  render() {
6955
6705
  const { children } = this.props;
6956
6706
  const { hasError, isFatalError } = this.state;
6957
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
6958
- hasError && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
6707
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
6708
+ hasError && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
6959
6709
  !isFatalError && children
6960
6710
  ] });
6961
6711
  }
@@ -7060,7 +6810,7 @@ var assertResponseIsValid = (response) => {
7060
6810
  var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
7061
6811
 
7062
6812
  // src/dynamicFlow/DynamicFlow.tsx
7063
- var import_jsx_runtime70 = require("react/jsx-runtime");
6813
+ var import_jsx_runtime69 = require("react/jsx-runtime");
7064
6814
  var noop7 = () => {
7065
6815
  };
7066
6816
  var DynamicFlowComponent = ({
@@ -7075,7 +6825,7 @@ var DynamicFlowComponent = ({
7075
6825
  onEvent = noop7,
7076
6826
  onLog = noop7
7077
6827
  }) => {
7078
- const { locale } = (0, import_react_intl34.useIntl)();
6828
+ const { locale } = (0, import_react_intl32.useIntl)();
7079
6829
  const {
7080
6830
  formErrors,
7081
6831
  globalError,
@@ -7280,7 +7030,7 @@ var DynamicFlowComponent = ({
7280
7030
  await actionHandler(action);
7281
7031
  }
7282
7032
  };
7283
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(HttpClientProvider, { httpClient, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
7033
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HttpClientProvider, { httpClient, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7284
7034
  DynamicFlowStep,
7285
7035
  {
7286
7036
  step,
@@ -7296,7 +7046,7 @@ var DynamicFlowComponent = ({
7296
7046
  }
7297
7047
  ) }) }) }) });
7298
7048
  };
7299
- var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
7049
+ var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
7300
7050
  var DynamicFlow_default = DynamicFlow;
7301
7051
  var combineModels2 = (formModels) => {
7302
7052
  return Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
@@ -7373,8 +7123,6 @@ var en_default = {
7373
7123
  "dynamicFlows.CameraCapture.reviewInstructions": "Is your picture clear, readable and complete?",
7374
7124
  "dynamicFlows.CameraCapture.reviewRetry": "No, try again",
7375
7125
  "dynamicFlows.CameraCapture.reviewSubmit": "Yes, submit",
7376
- "dynamicFlows.CameraCapture.rotatePhone.imgAlt": "Rotate your phone icon",
7377
- "dynamicFlows.CameraCapture.rotatePhone.text": "Rotate your phone to portrait view to take a photo",
7378
7126
  "dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
7379
7127
  "dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
7380
7128
  "dynamicFlows.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
@@ -8048,11 +7796,4 @@ classnames/index.js:
8048
7796
  Licensed under the MIT License (MIT), see
8049
7797
  http://jedwatson.github.io/classnames
8050
7798
  *)
8051
-
8052
- screenfull/dist/screenfull.js:
8053
- (*!
8054
- * screenfull
8055
- * v5.2.0 - 2021-11-03
8056
- * (c) Sindre Sorhus; MIT License
8057
- *)
8058
7799
  */