@wise/dynamic-flow-client 0.4.0 → 0.4.2

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.
Files changed (233) hide show
  1. package/build/common/constants/DateMode.js +2 -2
  2. package/build/common/constants/FormControlType.js +2 -2
  3. package/build/common/constants/MonthFormat.js +2 -2
  4. package/build/common/constants/SchemaType.js +2 -2
  5. package/build/common/constants/Size.js +2 -2
  6. package/build/common/constants/index.js +1 -1
  7. package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +15 -27
  8. package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +11 -9
  9. package/build/common/contexts/eventsContext/EventsContext.js +11 -28
  10. package/build/common/contexts/fetcherContexts/FetcherContexts.js +14 -27
  11. package/build/common/contexts/index.js +1 -1
  12. package/build/common/contexts/logContext/LogContext.js +12 -30
  13. package/build/common/hooks/index.js +1 -1
  14. package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +3 -3
  15. package/build/common/hooks/useExternal/useExternal.js +8 -8
  16. package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +20 -31
  17. package/build/common/hooks/usePersistAsync/usePersistAsync.js +60 -139
  18. package/build/common/hooks/usePolling/usePolling.js +20 -21
  19. package/build/common/hooks/usePrevious/usePrevious.js +5 -5
  20. package/build/common/hooks/useStepPolling/useStepPolling.js +15 -14
  21. package/build/common/makeFetcher/index.js +1 -1
  22. package/build/common/makeFetcher/makeFetcher.js +10 -24
  23. package/build/common/messages.js +5 -5
  24. package/build/common/utils/api-utils.js +3 -4
  25. package/build/common/utils/date-utils.js +11 -11
  26. package/build/common/utils/debounce.js +11 -15
  27. package/build/common/utils/file-utils.js +12 -25
  28. package/build/common/utils/id-utils.js +4 -5
  29. package/build/common/utils/index.js +1 -1
  30. package/build/common/utils/is-equal.js +8 -8
  31. package/build/common/utils/schema-utils.js +6 -6
  32. package/build/common/utils/step-utils.js +14 -14
  33. package/build/common/validators/index.js +7 -7
  34. package/build/common/validators/models/model-validators.js +8 -8
  35. package/build/common/validators/models/models.utils.js +29 -42
  36. package/build/common/validators/schemas/schema-validators.js +11 -13
  37. package/build/common/validators/types/type-validators.js +9 -13
  38. package/build/common/validators/validationFailures/validation-failures.js +14 -14
  39. package/build/common/validators/validationFailures/validation-failures.utils.js +5 -7
  40. package/build/common/validators/values/value-validators.js +4 -6
  41. package/build/dynamicFlow/DynamicFlow.js +185 -307
  42. package/build/dynamicFlow/DynamicFlowStep.js +12 -23
  43. package/build/dynamicFlow/DynamicFlowTypes.js +1 -1
  44. package/build/dynamicFlow/index.js +6 -14
  45. package/build/dynamicFlow/stories/DynamicFlow.story.js +20 -20
  46. package/build/dynamicFlow/stories/EditableDynamicFlow.js +20 -33
  47. package/build/dynamicFlow/stories/fixtureFetcher.js +46 -104
  48. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +22 -40
  49. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +6 -6
  50. package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +10 -11
  51. package/build/dynamicFlow/utils/index.js +5 -2
  52. package/build/dynamicFlow/utils/responseParsers/response-parsers.js +53 -118
  53. package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +9 -9
  54. package/build/dynamicFlow/utils/useDynamicFlowState.js +51 -74
  55. package/build/dynamicFlow/utils/useLoader.js +9 -20
  56. package/build/fixtures/components/alert.js +8 -8
  57. package/build/fixtures/components/box.js +7 -7
  58. package/build/fixtures/components/button.js +25 -36
  59. package/build/fixtures/components/columns.js +10 -10
  60. package/build/fixtures/components/copyable.js +6 -6
  61. package/build/fixtures/components/decision.js +15 -15
  62. package/build/fixtures/components/heading.js +7 -7
  63. package/build/fixtures/components/image.js +10 -10
  64. package/build/fixtures/components/index.js +17 -25
  65. package/build/fixtures/components/info.js +22 -6
  66. package/build/fixtures/components/list.js +8 -8
  67. package/build/fixtures/components/loading-indicator.js +5 -5
  68. package/build/fixtures/components/paragraph.js +9 -9
  69. package/build/fixtures/components/review.js +11 -11
  70. package/build/fixtures/examples/camera-capture.js +29 -29
  71. package/build/fixtures/examples/index.js +9 -17
  72. package/build/fixtures/examples/recipient-update.js +69 -69
  73. package/build/fixtures/examples/recipient.js +63 -63
  74. package/build/fixtures/examples/single-file-upload.js +21 -21
  75. package/build/fixtures/examples/step-validation-errors.js +21 -21
  76. package/build/fixtures/features/action-response.js +8 -8
  77. package/build/fixtures/features/external.js +8 -8
  78. package/build/fixtures/features/index.js +9 -17
  79. package/build/fixtures/features/persist-async.js +11 -11
  80. package/build/fixtures/features/polling.js +9 -9
  81. package/build/fixtures/features/validation-async.js +10 -10
  82. package/build/fixtures/index.js +11 -22
  83. package/build/fixtures/jsonSchemaForm/allOf.js +30 -30
  84. package/build/fixtures/jsonSchemaForm/audRecipient.js +271 -271
  85. package/build/fixtures/jsonSchemaForm/currency.js +12 -12
  86. package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +11 -11
  87. package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +11 -11
  88. package/build/fixtures/jsonSchemaForm/oneOf.js +27 -27
  89. package/build/fixtures/jsonSchemaForm/oneOfTabs.js +16 -16
  90. package/build/fixtures/jsonSchemaForm/promotedOneOf.js +17 -17
  91. package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +30 -30
  92. package/build/fixtures/jsonSchemaForm/simple.js +16 -16
  93. package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +19 -19
  94. package/build/fixtures/jsonSchemaForm/validationAsync.js +8 -8
  95. package/build/fixtures/layouts/all.js +37 -37
  96. package/build/fixtures/layouts/final-step-layout.js +9 -9
  97. package/build/fixtures/layouts/index.js +10 -18
  98. package/build/fixtures/layouts/list.js +10 -10
  99. package/build/fixtures/layouts/pay-in.js +23 -23
  100. package/build/fixtures/layouts/review.js +38 -38
  101. package/build/fixtures/layouts/success.js +15 -15
  102. package/build/fixtures/responses/action-response-final.js +8 -8
  103. package/build/fixtures/responses/action.js +3 -3
  104. package/build/fixtures/responses/exit.js +3 -3
  105. package/build/fixtures/responses/index.js +8 -16
  106. package/build/fixtures/responses/recipient-update-final.js +8 -8
  107. package/build/fixtures/schemas/basic-form.js +11 -11
  108. package/build/fixtures/schemas/index.js +8 -16
  109. package/build/fixtures/schemas/number-and-integer.js +11 -11
  110. package/build/fixtures/schemas/one-of.js +43 -46
  111. package/build/fixtures/schemas/string-formats.js +15 -15
  112. package/build/fixtures/utils/image-util.js +8 -8
  113. package/build/formControl/FormControl.js +118 -148
  114. package/build/formControl/index.js +6 -14
  115. package/build/formControl/utils/index.js +1 -1
  116. package/build/formControl/utils/value-utils.js +18 -23
  117. package/build/i18n/index.js +31 -31
  118. package/build/index.js +13 -10
  119. package/build/jsonSchemaForm/JsonSchemaForm.js +12 -24
  120. package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +24 -37
  121. package/build/jsonSchemaForm/allOfSchema/index.js +6 -14
  122. package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +9 -20
  123. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +9 -20
  124. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +6 -14
  125. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +56 -115
  126. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +7 -7
  127. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +6 -14
  128. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +1 -1
  129. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +19 -71
  130. package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +10 -11
  131. package/build/jsonSchemaForm/arrayTypeSchema/index.js +6 -14
  132. package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +45 -62
  133. package/build/jsonSchemaForm/basicTypeSchema/index.js +6 -14
  134. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +39 -50
  135. package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +18 -18
  136. package/build/jsonSchemaForm/controlFeedback/index.js +6 -14
  137. package/build/jsonSchemaForm/genericSchema/GenericSchema.js +52 -61
  138. package/build/jsonSchemaForm/genericSchema/index.js +6 -14
  139. package/build/jsonSchemaForm/help/Help.js +9 -9
  140. package/build/jsonSchemaForm/help/Help.messages.js +5 -5
  141. package/build/jsonSchemaForm/help/index.js +6 -14
  142. package/build/jsonSchemaForm/index.js +6 -14
  143. package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +28 -49
  144. package/build/jsonSchemaForm/objectSchema/index.js +6 -14
  145. package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +54 -74
  146. package/build/jsonSchemaForm/oneOfSchema/index.js +6 -14
  147. package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +3 -3
  148. package/build/jsonSchemaForm/oneOfSchema/utils/index.js +1 -1
  149. package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +19 -20
  150. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +11 -22
  151. package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +5 -5
  152. package/build/jsonSchemaForm/persistAsyncSchema/index.js +6 -14
  153. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +73 -127
  154. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +6 -14
  155. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +45 -110
  156. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +17 -17
  157. package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +6 -14
  158. package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +28 -47
  159. package/build/jsonSchemaForm/promotedOneOfSchema/index.js +6 -14
  160. package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +4 -4
  161. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +13 -24
  162. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +11 -22
  163. package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +12 -23
  164. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +24 -26
  165. package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +6 -6
  166. package/build/jsonSchemaForm/readOnlySchema/index.js +6 -14
  167. package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +26 -39
  168. package/build/jsonSchemaForm/schemaFormControl/index.js +6 -14
  169. package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +5 -5
  170. package/build/jsonSchemaForm/schemaFormControl/utils/index.js +1 -1
  171. package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +30 -47
  172. package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +57 -119
  173. package/build/jsonSchemaForm/validationAsyncSchema/index.js +6 -14
  174. package/build/layout/DynamicLayout.js +10 -21
  175. package/build/layout/alert/DynamicAlert.js +9 -9
  176. package/build/layout/box/DynamicBox.js +12 -23
  177. package/build/layout/button/DynamicButton.js +16 -27
  178. package/build/layout/columns/DynamicColumns.js +13 -24
  179. package/build/layout/decision/DynamicDecision.js +16 -27
  180. package/build/layout/divider/DynamicDivider.js +7 -8
  181. package/build/layout/external/DynamicExternal.js +16 -28
  182. package/build/layout/external/DynamicExternal.messages.js +5 -5
  183. package/build/layout/form/DynamicForm.js +10 -21
  184. package/build/layout/heading/DynamicHeading.js +12 -23
  185. package/build/layout/icon/DynamicIcon.js +9 -10
  186. package/build/layout/image/DynamicImage.js +43 -93
  187. package/build/layout/index.js +21 -29
  188. package/build/layout/info/DynamicInfo.js +7 -19
  189. package/build/layout/list/DynamicList.js +14 -26
  190. package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +8 -9
  191. package/build/layout/paragraph/DynamicParagraph.js +19 -37
  192. package/build/layout/paragraph/DynamicParagraph.messages.js +6 -6
  193. package/build/layout/paragraph/useSnackBarIfAvailable.js +4 -4
  194. package/build/layout/review/DynamicReview.js +14 -26
  195. package/build/layout/utils.js +4 -6
  196. package/build/step/cameraStep/CameraStep.js +42 -88
  197. package/build/step/cameraStep/cameraCapture/CameraCapture.js +48 -105
  198. package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +7 -7
  199. package/build/step/cameraStep/cameraCapture/components/index.js +10 -28
  200. package/build/step/cameraStep/cameraCapture/hooks/index.js +17 -72
  201. package/build/step/cameraStep/cameraCapture/index.js +6 -14
  202. package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +33 -45
  203. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +8 -19
  204. package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +6 -6
  205. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +9 -21
  206. package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +7 -7
  207. package/build/step/cameraStep/cameraCapture/screens/index.js +6 -14
  208. package/build/step/cameraStep/cameraCapture/tracking/index.js +17 -99
  209. package/build/step/cameraStep/cameraCapture/utils/index.js +33 -96
  210. package/build/step/cameraStep/index.js +6 -14
  211. package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +20 -21
  212. package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +8 -8
  213. package/build/step/externalConfirmationStep/index.js +6 -14
  214. package/build/step/index.js +7 -15
  215. package/build/step/layoutStep/LayoutStep.js +19 -19
  216. package/build/step/layoutStep/index.js +6 -14
  217. package/build/step/layoutStep/utils/index.js +3 -14
  218. package/build/step/layoutStep/utils/inline-reference-utils.js +29 -46
  219. package/build/step/layoutStep/utils/layout-utils.js +34 -53
  220. package/build/types/common/FormControl.js +1 -1
  221. package/build/types/index.js +13 -13
  222. package/build/types/specification/Action.js +1 -1
  223. package/build/types/specification/FileUploadSchema.js +1 -1
  224. package/build/types/specification/LayoutComponent.js +1 -1
  225. package/build/types/specification/Model.js +9 -17
  226. package/build/types/specification/PersistAsync.js +1 -1
  227. package/build/types/specification/Polling.js +1 -1
  228. package/build/types/specification/Promotion.js +1 -1
  229. package/build/types/specification/Schema.js +8 -8
  230. package/build/types/specification/Step.js +3 -5
  231. package/build/types/specification/ValidationAsync.js +1 -1
  232. package/build/types/specification/core.js +1 -1
  233. package/package.json +1 -1
@@ -1,114 +1,51 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.getVideoCapabilities = exports.getVideoTrack = exports.getActiveVideoDeviceLabel = exports.getAvailableVideoDeviceLabels = exports.getAvailableVideoDevices = exports.generateCanvasFromVideo = exports.isMainBackCamera = exports.isSelfieCamera = void 0;
40
- var isSelfieCamera = function (stream) {
4
+ const isSelfieCamera = (stream) => {
41
5
  var _a;
42
- var facingMode = (((_a = (0, exports.getVideoTrack)(stream)) === null || _a === void 0 ? void 0 : _a.getSettings()) || {}).facingMode;
6
+ const { facingMode } = ((_a = (0, exports.getVideoTrack)(stream)) === null || _a === void 0 ? void 0 : _a.getSettings()) || {};
43
7
  // facingMode === undefined for desktop users
44
8
  return facingMode === 'user' || facingMode === undefined;
45
9
  };
46
10
  exports.isSelfieCamera = isSelfieCamera;
47
- var isMainBackCamera = function (deviceInfo) {
48
- return !!((deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.label) || '').match(/camera2? 0/g);
49
- };
11
+ const isMainBackCamera = (deviceInfo) => !!((deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.label) || '').match(/camera2? 0/g);
50
12
  exports.isMainBackCamera = isMainBackCamera;
51
- var generateCanvasFromVideo = function (video) { return __awaiter(void 0, void 0, void 0, function () {
52
- var canvas, context;
53
- return __generator(this, function (_a) {
54
- switch (_a.label) {
55
- case 0:
56
- canvas = document.createElement('canvas');
57
- if (!video) return [3 /*break*/, 2];
58
- canvas.setAttribute('height', "".concat(video.videoHeight));
59
- canvas.setAttribute('width', "".concat(video.videoWidth));
60
- context = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d');
61
- if (!context) return [3 /*break*/, 2];
62
- // Timeout is needed for intermittent iOS issue
63
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 100); })];
64
- case 1:
65
- // Timeout is needed for intermittent iOS issue
66
- _a.sent();
67
- context.drawImage(video, 0, 0, canvas.width, canvas.height);
68
- _a.label = 2;
69
- case 2: return [2 /*return*/, canvas];
13
+ const generateCanvasFromVideo = async (video) => {
14
+ const canvas = document.createElement('canvas');
15
+ if (video) {
16
+ canvas.setAttribute('height', `${video.videoHeight}`);
17
+ canvas.setAttribute('width', `${video.videoWidth}`);
18
+ const context = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d');
19
+ if (context) {
20
+ // Timeout is needed for intermittent iOS issue
21
+ await new Promise((resolve) => setTimeout(resolve, 100));
22
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
70
23
  }
71
- });
72
- }); };
24
+ }
25
+ return canvas;
26
+ };
73
27
  exports.generateCanvasFromVideo = generateCanvasFromVideo;
74
- var getAvailableVideoDevices = function () { return __awaiter(void 0, void 0, void 0, function () {
28
+ const getAvailableVideoDevices = async () => {
75
29
  var _a, _b;
76
- return __generator(this, function (_c) {
77
- switch (_c.label) {
78
- case 0: return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
79
- case 1: return [2 /*return*/, ((_c.sent()) || []).filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })];
80
- }
81
- });
82
- }); };
30
+ return ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || []).filter((deviceInfo) => deviceInfo.kind === 'videoinput');
31
+ };
83
32
  exports.getAvailableVideoDevices = getAvailableVideoDevices;
84
- var getAvailableVideoDeviceLabels = function () { return __awaiter(void 0, void 0, void 0, function () {
33
+ const getAvailableVideoDeviceLabels = async () => {
85
34
  var _a, _b;
86
- return __generator(this, function (_c) {
87
- switch (_c.label) {
88
- case 0: return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
89
- case 1: return [2 /*return*/, ((_c.sent()) || [])
90
- .filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
91
- .map(function (deviceInfo) { return deviceInfo.label; })];
92
- }
93
- });
94
- }); };
35
+ return ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || [])
36
+ .filter((deviceInfo) => deviceInfo.kind === 'videoinput')
37
+ .map((deviceInfo) => deviceInfo.label);
38
+ };
95
39
  exports.getAvailableVideoDeviceLabels = getAvailableVideoDeviceLabels;
96
- var getActiveVideoDeviceLabel = function (videoStream) { return __awaiter(void 0, void 0, void 0, function () {
97
- var capabilities;
40
+ const getActiveVideoDeviceLabel = async (videoStream) => {
98
41
  var _a, _b, _c;
99
- return __generator(this, function (_d) {
100
- switch (_d.label) {
101
- case 0:
102
- capabilities = (0, exports.getVideoCapabilities)(videoStream);
103
- return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
104
- case 1: return [2 /*return*/, (_c = ((_d.sent()) || [])
105
- .filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
106
- .find(function (deviceInfo) { return deviceInfo.deviceId === (capabilities === null || capabilities === void 0 ? void 0 : capabilities.deviceId); })) === null || _c === void 0 ? void 0 : _c.label];
107
- }
108
- });
109
- }); };
42
+ const capabilities = (0, exports.getVideoCapabilities)(videoStream);
43
+ return (_c = ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || [])
44
+ .filter((deviceInfo) => deviceInfo.kind === 'videoinput')
45
+ .find((deviceInfo) => deviceInfo.deviceId === (capabilities === null || capabilities === void 0 ? void 0 : capabilities.deviceId))) === null || _c === void 0 ? void 0 : _c.label;
46
+ };
110
47
  exports.getActiveVideoDeviceLabel = getActiveVideoDeviceLabel;
111
- var getVideoTrack = function (videoStream) { var _a; return (((_a = videoStream === null || videoStream === void 0 ? void 0 : videoStream.getVideoTracks) === null || _a === void 0 ? void 0 : _a.call(videoStream)) || [])[0]; };
48
+ const getVideoTrack = (videoStream) => { var _a; return (((_a = videoStream === null || videoStream === void 0 ? void 0 : videoStream.getVideoTracks) === null || _a === void 0 ? void 0 : _a.call(videoStream)) || [])[0]; };
112
49
  exports.getVideoTrack = getVideoTrack;
113
- var getVideoCapabilities = function (videoStream) { var _a, _b; return (_b = (_a = (0, exports.getVideoTrack)(videoStream)) === null || _a === void 0 ? void 0 : _a.getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a); };
50
+ const getVideoCapabilities = (videoStream) => { var _a, _b; return (_b = (_a = (0, exports.getVideoTrack)(videoStream)) === null || _a === void 0 ? void 0 : _a.getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a); };
114
51
  exports.getVideoCapabilities = getVideoCapabilities;
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var CameraStep_1 = require("./CameraStep");
16
- __createBinding(exports, CameraStep_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(CameraStep_1).default; } });
@@ -2,16 +2,15 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
6
- var jsx_runtime_1 = require("react/jsx-runtime");
7
- var react_intl_1 = require("react-intl");
8
- var layout_1 = require("../../layout");
9
- var ExternalConfirmationStep_messages_1 = __importDefault(require("./ExternalConfirmationStep.messages"));
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_intl_1 = require("react-intl");
8
+ const layout_1 = require("../../layout");
9
+ const ExternalConfirmationStep_messages_1 = __importDefault(require("./ExternalConfirmationStep.messages"));
10
10
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11
- var noop = function () { };
12
- var ExternalConfirmationStep = function (_a) {
13
- var url = _a.url, onClose = _a.onClose;
14
- var formatMessage = (0, react_intl_1.useIntl)().formatMessage;
11
+ const noop = () => { };
12
+ const ExternalConfirmationStep = ({ url, onClose }) => {
13
+ const { formatMessage } = (0, react_intl_1.useIntl)();
15
14
  return ((0, jsx_runtime_1.jsx)(layout_1.DynamicLayout, { components: [
16
15
  {
17
16
  type: 'box',
@@ -19,16 +18,16 @@ var ExternalConfirmationStep = function (_a) {
19
18
  components: [
20
19
  {
21
20
  type: 'heading',
22
- text: formatMessage(ExternalConfirmationStep_messages_1["default"].title),
21
+ text: formatMessage(ExternalConfirmationStep_messages_1.default.title),
23
22
  size: 'lg',
24
23
  align: 'center',
25
- margin: 'xl'
24
+ margin: 'xl',
26
25
  },
27
26
  {
28
27
  type: 'info',
29
- markdown: formatMessage(ExternalConfirmationStep_messages_1["default"].description, { origin: getOrigin(url) }),
28
+ markdown: formatMessage(ExternalConfirmationStep_messages_1.default.description, { origin: getOrigin(url) }),
30
29
  align: 'center',
31
- margin: 'xl'
30
+ margin: 'xl',
32
31
  },
33
32
  {
34
33
  type: 'box',
@@ -36,29 +35,29 @@ var ExternalConfirmationStep = function (_a) {
36
35
  components: [
37
36
  {
38
37
  type: 'button',
39
- action: { title: formatMessage(ExternalConfirmationStep_messages_1["default"].open), type: 'primary', url: url, exit: true }
38
+ action: { title: formatMessage(ExternalConfirmationStep_messages_1.default.open), type: 'primary', url, exit: true },
40
39
  },
41
40
  {
42
41
  type: 'button',
43
42
  action: {
44
- title: formatMessage(ExternalConfirmationStep_messages_1["default"].cancel),
43
+ title: formatMessage(ExternalConfirmationStep_messages_1.default.cancel),
45
44
  type: 'link',
46
45
  url: '',
47
- exit: true
48
- }
46
+ exit: true,
47
+ },
49
48
  },
50
- ]
49
+ ],
51
50
  },
52
- ]
51
+ ],
53
52
  },
54
- ], submitted: false, onAction: function (action) {
53
+ ], submitted: false, onAction: (action) => {
55
54
  if (action.url) {
56
55
  window.open(action.url, '_blank');
57
56
  }
58
57
  onClose();
59
58
  }, onModelChange: noop, onPersistAsync: noop }));
60
59
  };
61
- exports["default"] = ExternalConfirmationStep;
60
+ exports.default = ExternalConfirmationStep;
62
61
  function getOrigin(url) {
63
62
  try {
64
63
  return new URL(url).origin;
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var react_intl_1 = require("react-intl");
4
- exports["default"] = (0, react_intl_1.defineMessages)({
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_intl_1 = require("react-intl");
4
+ exports.default = (0, react_intl_1.defineMessages)({
5
5
  title: {
6
6
  id: 'dynamicFlows.ExternalConfirmation.title',
7
7
  defaultMessage: 'Please confirm',
8
- description: 'Heading for the confirmation screen.'
8
+ description: 'Heading for the confirmation screen.',
9
9
  },
10
10
  description: {
11
11
  id: 'dynamicFlows.ExternalConfirmation.description',
12
12
  defaultMessage: 'Please confirm you want to open **{origin}** in a new browser tab.',
13
- description: 'Description for the confirmation screen.'
13
+ description: 'Description for the confirmation screen.',
14
14
  },
15
15
  open: {
16
16
  id: 'dynamicFlows.ExternalConfirmation.open',
17
17
  defaultMessage: 'Open in new tab',
18
- description: 'Button text confirming opening a new browser tab.'
18
+ description: 'Button text confirming opening a new browser tab.',
19
19
  },
20
20
  cancel: {
21
21
  id: 'dynamicFlows.ExternalConfirmation.cancel',
22
22
  defaultMessage: 'Cancel',
23
- description: 'Button text rejecting opening a new browser tab.'
24
- }
23
+ description: 'Button text rejecting opening a new browser tab.',
24
+ },
25
25
  });
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var ExternalConfirmationStep_1 = require("./ExternalConfirmationStep");
16
- __createBinding(exports, ExternalConfirmationStep_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(ExternalConfirmationStep_1).default; } });
@@ -1,20 +1,12 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
14
6
  exports.ExternalConfirmationStep = exports.CameraStep = exports.LayoutStep = void 0;
15
7
  var layoutStep_1 = require("./layoutStep");
16
- __createBinding(exports, layoutStep_1, "default", "LayoutStep");
8
+ Object.defineProperty(exports, "LayoutStep", { enumerable: true, get: function () { return __importDefault(layoutStep_1).default; } });
17
9
  var cameraStep_1 = require("./cameraStep");
18
- __createBinding(exports, cameraStep_1, "default", "CameraStep");
10
+ Object.defineProperty(exports, "CameraStep", { enumerable: true, get: function () { return __importDefault(cameraStep_1).default; } });
19
11
  var externalConfirmationStep_1 = require("./externalConfirmationStep");
20
- __createBinding(exports, externalConfirmationStep_1, "default", "ExternalConfirmationStep");
12
+ Object.defineProperty(exports, "ExternalConfirmationStep", { enumerable: true, get: function () { return __importDefault(externalConfirmationStep_1).default; } });
@@ -1,35 +1,35 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var jsx_runtime_1 = require("react/jsx-runtime");
4
- var contexts_1 = require("../../common/contexts");
5
- var hooks_1 = require("../../common/hooks");
6
- var validators_1 = require("../../common/validators");
7
- var layout_1 = require("../../layout");
8
- var utils_1 = require("./utils");
9
- var getComponents = function (step, options) {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const contexts_1 = require("../../common/contexts");
5
+ const hooks_1 = require("../../common/hooks");
6
+ const validators_1 = require("../../common/validators");
7
+ const layout_1 = require("../../layout");
8
+ const utils_1 = require("./utils");
9
+ const getComponents = (step, options) => {
10
10
  var _a;
11
11
  if (!step || (0, validators_1.isEmpty)(step) || (!step.layout && !step.type)) {
12
12
  return [];
13
13
  }
14
- var layout = (0, utils_1.convertStepToLayout)(step, options);
14
+ const layout = (0, utils_1.convertStepToLayout)(step, options);
15
15
  return (0, utils_1.inlineReferences)({
16
- layout: layout,
16
+ layout,
17
17
  schemas: step.schemas || [],
18
18
  actions: step.actions || [],
19
- model: (_a = step.model) !== null && _a !== void 0 ? _a : null
19
+ model: (_a = step.model) !== null && _a !== void 0 ? _a : null,
20
20
  });
21
21
  };
22
- var LayoutStep = function (props) {
23
- var stepSpecification = props.stepSpecification, stepLayoutOptions = props.stepLayoutOptions, submitted = props.submitted, model = props.model, formErrors = props.formErrors, onModelChange = props.onModelChange;
24
- var components = getComponents(stepSpecification, stepLayoutOptions);
25
- var _a = (0, contexts_1.useDynamicFlow)(), loading = _a.loading, registerPersistAsyncPromise = _a.registerPersistAsyncPromise;
26
- var onEvent = (0, contexts_1.useEventDispatcher)();
27
- var onAction = !loading
22
+ const LayoutStep = (props) => {
23
+ const { stepSpecification, stepLayoutOptions, submitted, model, formErrors, onModelChange } = props;
24
+ const components = getComponents(stepSpecification, stepLayoutOptions);
25
+ const { loading, registerPersistAsyncPromise } = (0, contexts_1.useDynamicFlow)();
26
+ const onEvent = (0, contexts_1.useEventDispatcher)();
27
+ const onAction = !loading
28
28
  ? props.onAction
29
- : function () {
29
+ : () => {
30
30
  onEvent('Dynamic Flow - onAction supressed', { reason: 'LayoutStep - loading state' });
31
31
  };
32
32
  (0, hooks_1.useStepPolling)(stepSpecification.polling, onAction);
33
33
  return ((0, jsx_runtime_1.jsx)(layout_1.DynamicLayout, { components: components, submitted: submitted, model: model, errors: formErrors, onAction: onAction, onModelChange: onModelChange, onPersistAsync: registerPersistAsyncPromise }));
34
34
  };
35
- exports["default"] = LayoutStep;
35
+ exports.default = LayoutStep;
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
14
- exports["default"] = void 0;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
15
7
  var LayoutStep_1 = require("./LayoutStep");
16
- __createBinding(exports, LayoutStep_1, "default");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(LayoutStep_1).default; } });
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.inlineReferences = exports.convertStepToLayout = void 0;
15
4
  var layout_utils_1 = require("./layout-utils");
16
- __createBinding(exports, layout_utils_1, "convertStepToLayout");
5
+ Object.defineProperty(exports, "convertStepToLayout", { enumerable: true, get: function () { return layout_utils_1.convertStepToLayout; } });
17
6
  var inline_reference_utils_1 = require("./inline-reference-utils");
18
- __createBinding(exports, inline_reference_utils_1, "inlineReferences");
7
+ Object.defineProperty(exports, "inlineReferences", { enumerable: true, get: function () { return inline_reference_utils_1.inlineReferences; } });
@@ -1,92 +1,75 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.inlineReferences = void 0;
15
- var layout_utils_1 = require("./layout-utils");
16
- function inlineReferences(_a) {
17
- var layout = _a.layout, schemas = _a.schemas, actions = _a.actions, model = _a.model;
4
+ const layout_utils_1 = require("./layout-utils");
5
+ function inlineReferences({ layout, schemas, actions, model, }) {
18
6
  if (!layout) {
19
7
  return [];
20
8
  }
21
9
  if (!schemas) {
22
10
  return layout;
23
11
  }
24
- return layout.map(function (component) {
12
+ return layout.map((component) => {
25
13
  if (component.type === 'form') {
26
- return inlineFormSchema({ formComponent: component, schemas: schemas });
14
+ return inlineFormSchema({ formComponent: component, schemas });
27
15
  }
28
16
  if (component.type === 'decision') {
29
- return inlineDecisionActions({ decisionComponent: component, actions: actions });
17
+ return inlineDecisionActions({ decisionComponent: component, actions });
30
18
  }
31
19
  if (component.type === 'button') {
32
- return inlineAction({ actionComponent: component, actions: actions });
20
+ return inlineAction({ actionComponent: component, actions });
33
21
  }
34
22
  if (component.type === 'box') {
35
- return inlineBoxReferences({ boxComponent: component, schemas: schemas, actions: actions, model: model });
23
+ return inlineBoxReferences({ boxComponent: component, schemas, actions, model });
36
24
  }
37
25
  if (component.type === 'columns') {
38
- return inlineColumnsReferences({ columnsComponent: component, schemas: schemas, actions: actions, model: model });
26
+ return inlineColumnsReferences({ columnsComponent: component, schemas, actions, model });
39
27
  }
40
28
  return component;
41
29
  });
42
30
  }
43
31
  exports.inlineReferences = inlineReferences;
44
- function inlineFormSchema(_a) {
45
- var formComponent = _a.formComponent, schemas = _a.schemas;
32
+ function inlineFormSchema({ formComponent, schemas, }) {
46
33
  if (isReference(formComponent.schema) && formComponent.schema.$ref) {
47
- return __assign(__assign({}, formComponent), { schema: getSchemaById(schemas, formComponent.schema.$ref) });
34
+ return Object.assign(Object.assign({}, formComponent), { schema: getSchemaById(schemas, formComponent.schema.$ref) });
48
35
  }
49
- return __assign({}, formComponent);
36
+ return Object.assign({}, formComponent);
50
37
  }
51
- function inlineDecisionActions(_a) {
52
- var _b;
53
- var decisionComponent = _a.decisionComponent, actions = _a.actions;
54
- var newOptions = (_b = decisionComponent === null || decisionComponent === void 0 ? void 0 : decisionComponent.options) === null || _b === void 0 ? void 0 : _b.map(function (option) {
38
+ function inlineDecisionActions({ decisionComponent, actions, }) {
39
+ var _a;
40
+ const newOptions = (_a = decisionComponent === null || decisionComponent === void 0 ? void 0 : decisionComponent.options) === null || _a === void 0 ? void 0 : _a.map((option) => {
55
41
  return option.action && isReference(option.action)
56
- ? __assign(__assign({}, option), { action: getActionById(actions, option.action.$ref) }) : option;
42
+ ? Object.assign(Object.assign({}, option), { action: getActionById(actions, option.action.$ref) }) : option;
57
43
  });
58
- return __assign(__assign({}, decisionComponent), { options: newOptions });
44
+ return Object.assign(Object.assign({}, decisionComponent), { options: newOptions });
59
45
  }
60
- function inlineAction(_a) {
61
- var _b;
62
- var actionComponent = _a.actionComponent, actions = _a.actions;
46
+ function inlineAction({ actionComponent, actions, }) {
47
+ var _a;
63
48
  if (actionComponent.action &&
64
49
  isReference(actionComponent.action) &&
65
- ((_b = actionComponent.action) === null || _b === void 0 ? void 0 : _b.$ref)) {
66
- var newAction = getActionById(actions, actionComponent.action.$ref);
50
+ ((_a = actionComponent.action) === null || _a === void 0 ? void 0 : _a.$ref)) {
51
+ const newAction = getActionById(actions, actionComponent.action.$ref);
67
52
  return (0, layout_utils_1.convertStepActionToDynamicAction)(newAction);
68
53
  }
69
54
  return actionComponent;
70
55
  }
71
- function inlineBoxReferences(_a) {
72
- var boxComponent = _a.boxComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
73
- return __assign(__assign({}, boxComponent), { components: inlineReferences({ layout: boxComponent.components, schemas: schemas, actions: actions, model: model }) });
56
+ function inlineBoxReferences({ boxComponent, schemas, actions, model, }) {
57
+ return Object.assign(Object.assign({}, boxComponent), { components: inlineReferences({ layout: boxComponent.components, schemas, actions, model }) });
74
58
  }
75
- function inlineColumnsReferences(_a) {
76
- var columnsComponent = _a.columnsComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
77
- return __assign(__assign({}, columnsComponent), { left: inlineReferences({ layout: columnsComponent.left, schemas: schemas, actions: actions, model: model }), right: inlineReferences({ layout: columnsComponent.right, schemas: schemas, actions: actions, model: model }) });
59
+ function inlineColumnsReferences({ columnsComponent, schemas, actions, model, }) {
60
+ return Object.assign(Object.assign({}, columnsComponent), { left: inlineReferences({ layout: columnsComponent.left, schemas, actions, model }), right: inlineReferences({ layout: columnsComponent.right, schemas, actions, model }) });
78
61
  }
79
62
  function getSchemaById(schemas, id) {
80
- var schema = schemas.find(function (schema) { return schema.$id === id; });
63
+ const schema = schemas.find((schema) => schema.$id === id);
81
64
  if (!schema) {
82
- throw new Error("Fatal Error. Schema not found. $id ".concat(id));
65
+ throw new Error(`Fatal Error. Schema not found. $id ${id}`);
83
66
  }
84
67
  return schema;
85
68
  }
86
69
  function getActionById(actions, id) {
87
- var action = actions.find(function (action) { return action.$id === id; });
70
+ const action = actions.find((action) => action.$id === id);
88
71
  if (!action) {
89
- throw new Error("Fatal Error. Action not found. $id ".concat(id));
72
+ throw new Error(`Fatal Error. Action not found. $id ${id}`);
90
73
  }
91
74
  return action;
92
75
  }