@frankieone/one-sdk 1.9.42 → 1.10.0-rc

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 (184) hide show
  1. package/dist/commit.txt +1 -1
  2. package/dist/esm/modules/biometrics/vendors/Daon/index.d.ts +1 -1
  3. package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.d.ts +3 -1
  4. package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.d.ts.map +1 -1
  5. package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.js +15 -2
  6. package/dist/esm/modules/biometrics/vendors/Onfido/onfido.init.js.map +1 -1
  7. package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.d.ts +3 -1
  8. package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.d.ts.map +1 -1
  9. package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.js +15 -2
  10. package/dist/esm/modules/biometrics/vendors/Onfido/onfidoLegacy.init.js.map +1 -1
  11. package/dist/esm/modules/biometrics/vendors/Onfido/shared.d.ts +7 -0
  12. package/dist/esm/modules/biometrics/vendors/Onfido/shared.d.ts.map +1 -1
  13. package/dist/esm/modules/biometrics/vendors/Onfido/shared.js +20 -5
  14. package/dist/esm/modules/biometrics/vendors/Onfido/shared.js.map +1 -1
  15. package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.d.ts.map +1 -1
  16. package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.js +6 -2
  17. package/dist/esm/modules/common/shared/utils/fetchCheckProcessingStatus.js.map +1 -1
  18. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.d.ts.map +1 -1
  19. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.js +5 -2
  20. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframe.js.map +1 -1
  21. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.d.ts +11 -0
  22. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.d.ts.map +1 -1
  23. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.js +1 -0
  24. package/dist/esm/modules/common/vendors/common/iframeUtils/createIframeEventListener.js.map +1 -1
  25. package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.d.ts.map +1 -1
  26. package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.js +18 -3
  27. package/dist/esm/modules/common/vendors/daon/mapMessageToEvent.js.map +1 -1
  28. package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.d.ts.map +1 -1
  29. package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.js +1 -1
  30. package/dist/esm/modules/form/vendors/react/components/base/FrankieLoader/FrankieLoader.js.map +1 -1
  31. package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.d.ts.map +1 -1
  32. package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.js +1 -1
  33. package/dist/esm/modules/form/vendors/react/components/view/Progress/Progress.js.map +1 -1
  34. package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts +585 -585
  35. package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts.map +1 -1
  36. package/dist/esm/modules/form/vendors/react/index.js +15 -0
  37. package/dist/esm/modules/form/vendors/react/index.js.map +1 -1
  38. package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.d.ts +4 -4
  39. package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.d.ts.map +1 -1
  40. package/dist/esm/modules/frankie-client/clients/F2/IDVClientF2.js.map +1 -1
  41. package/dist/esm/modules/frankie-client/clients/IDVClient.d.ts +4 -4
  42. package/dist/esm/modules/frankie-client/clients/IDVClient.d.ts.map +1 -1
  43. package/dist/esm/modules/frankie-client/clients/IDVClient.js.map +1 -1
  44. package/dist/esm/modules/idv/actions/mount.d.ts +9 -0
  45. package/dist/esm/modules/idv/actions/mount.d.ts.map +1 -1
  46. package/dist/esm/modules/idv/actions/mount.js +3 -1
  47. package/dist/esm/modules/idv/actions/mount.js.map +1 -1
  48. package/dist/esm/modules/idv/index.d.ts.map +1 -1
  49. package/dist/esm/modules/idv/index.js +17 -2
  50. package/dist/esm/modules/idv/index.js.map +1 -1
  51. package/dist/esm/modules/idv/vendors/Daon/index.d.ts +1 -1
  52. package/dist/esm/modules/idv/vendors/Incode/index.d.ts +1 -1
  53. package/dist/esm/modules/idv/vendors/Mastercard/index.d.ts +1 -1
  54. package/dist/esm/modules/idv/vendors/OcrLabs/index.d.ts +1 -1
  55. package/dist/esm/modules/idv/vendors/Onfido/index.d.ts +1 -1
  56. package/dist/esm/modules/idv/vendors/Onfido/index.d.ts.map +1 -1
  57. package/dist/esm/modules/idv/vendors/Onfido/index.js +20 -2
  58. package/dist/esm/modules/idv/vendors/Onfido/index.js.map +1 -1
  59. package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.d.ts +3 -1
  60. package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.d.ts.map +1 -1
  61. package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.js +15 -2
  62. package/dist/esm/modules/idv/vendors/Onfido/index.useOneStep.js.map +1 -1
  63. package/dist/esm/modules/idv/vendors/Sumsub/index.d.ts +1 -1
  64. package/dist/esm/modules/idv/vendors/Truuth/index.d.ts +1 -1
  65. package/dist/esm/modules/idv/vendors/Truuth/index.d.ts.map +1 -1
  66. package/dist/esm/modules/idv/vendors/Truuth/index.js +13 -1
  67. package/dist/esm/modules/idv/vendors/Truuth/index.js.map +1 -1
  68. package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.d.ts +1 -1
  69. package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.d.ts.map +1 -1
  70. package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.js +19 -1
  71. package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.js.map +1 -1
  72. package/dist/esm/modules/index.d.ts +2 -0
  73. package/dist/esm/modules/index.d.ts.map +1 -1
  74. package/dist/esm/modules/index.js +1 -0
  75. package/dist/esm/modules/index.js.map +1 -1
  76. package/dist/esm/modules/journey/classify/classify.d.ts +8 -0
  77. package/dist/esm/modules/journey/classify/classify.d.ts.map +1 -0
  78. package/dist/esm/modules/journey/classify/classify.js +105 -0
  79. package/dist/esm/modules/journey/classify/classify.js.map +1 -0
  80. package/dist/esm/modules/journey/classify/transportError.d.ts +24 -0
  81. package/dist/esm/modules/journey/classify/transportError.d.ts.map +1 -0
  82. package/dist/esm/modules/journey/classify/transportError.js +35 -0
  83. package/dist/esm/modules/journey/classify/transportError.js.map +1 -0
  84. package/dist/esm/modules/journey/classify/v1Status.d.ts +24 -0
  85. package/dist/esm/modules/journey/classify/v1Status.d.ts.map +1 -0
  86. package/dist/esm/modules/journey/classify/v1Status.js +43 -0
  87. package/dist/esm/modules/journey/classify/v1Status.js.map +1 -0
  88. package/dist/esm/modules/journey/flows/ekycFlow.d.ts +38 -0
  89. package/dist/esm/modules/journey/flows/ekycFlow.d.ts.map +1 -0
  90. package/dist/esm/modules/journey/flows/ekycFlow.js +179 -0
  91. package/dist/esm/modules/journey/flows/ekycFlow.js.map +1 -0
  92. package/dist/esm/modules/journey/flows/idvFlow.d.ts +32 -0
  93. package/dist/esm/modules/journey/flows/idvFlow.d.ts.map +1 -0
  94. package/dist/esm/modules/journey/flows/idvFlow.js +509 -0
  95. package/dist/esm/modules/journey/flows/idvFlow.js.map +1 -0
  96. package/dist/esm/modules/journey/flows/ocrFlow.d.ts +27 -0
  97. package/dist/esm/modules/journey/flows/ocrFlow.d.ts.map +1 -0
  98. package/dist/esm/modules/journey/flows/ocrFlow.js +434 -0
  99. package/dist/esm/modules/journey/flows/ocrFlow.js.map +1 -0
  100. package/dist/esm/modules/journey/flows/screenSequence.d.ts +127 -0
  101. package/dist/esm/modules/journey/flows/screenSequence.d.ts.map +1 -0
  102. package/dist/esm/modules/journey/flows/screenSequence.js +418 -0
  103. package/dist/esm/modules/journey/flows/screenSequence.js.map +1 -0
  104. package/dist/esm/modules/journey/flows/submitAndClassify.d.ts +32 -0
  105. package/dist/esm/modules/journey/flows/submitAndClassify.d.ts.map +1 -0
  106. package/dist/esm/modules/journey/flows/submitAndClassify.js +101 -0
  107. package/dist/esm/modules/journey/flows/submitAndClassify.js.map +1 -0
  108. package/dist/esm/modules/journey/index.d.ts +34 -0
  109. package/dist/esm/modules/journey/index.d.ts.map +1 -0
  110. package/dist/esm/modules/journey/index.js +183 -0
  111. package/dist/esm/modules/journey/index.js.map +1 -0
  112. package/dist/esm/modules/journey/journeyHandle.d.ts +35 -0
  113. package/dist/esm/modules/journey/journeyHandle.d.ts.map +1 -0
  114. package/dist/esm/modules/journey/journeyHandle.js +130 -0
  115. package/dist/esm/modules/journey/journeyHandle.js.map +1 -0
  116. package/dist/esm/modules/journey/screens/ctaConfig.d.ts +2 -0
  117. package/dist/esm/modules/journey/screens/ctaConfig.d.ts.map +1 -0
  118. package/dist/esm/modules/journey/screens/ctaConfig.js +23 -0
  119. package/dist/esm/modules/journey/screens/ctaConfig.js.map +1 -0
  120. package/dist/esm/modules/journey/screens/resultScreen.d.ts +21 -0
  121. package/dist/esm/modules/journey/screens/resultScreen.d.ts.map +1 -0
  122. package/dist/esm/modules/journey/screens/resultScreen.js +108 -0
  123. package/dist/esm/modules/journey/screens/resultScreen.js.map +1 -0
  124. package/dist/esm/modules/journey/simulate/fixtures.d.ts +9 -0
  125. package/dist/esm/modules/journey/simulate/fixtures.d.ts.map +1 -0
  126. package/dist/esm/modules/journey/simulate/fixtures.js +41 -0
  127. package/dist/esm/modules/journey/simulate/fixtures.js.map +1 -0
  128. package/dist/esm/modules/journey/steps/firstPaint.d.ts +43 -0
  129. package/dist/esm/modules/journey/steps/firstPaint.d.ts.map +1 -0
  130. package/dist/esm/modules/journey/steps/firstPaint.js +28 -0
  131. package/dist/esm/modules/journey/steps/firstPaint.js.map +1 -0
  132. package/dist/esm/modules/journey/steps/stepMachine.d.ts +52 -0
  133. package/dist/esm/modules/journey/steps/stepMachine.d.ts.map +1 -0
  134. package/dist/esm/modules/journey/steps/stepMachine.js +90 -0
  135. package/dist/esm/modules/journey/steps/stepMachine.js.map +1 -0
  136. package/dist/esm/modules/journey/steps/stepTable.d.ts +234 -0
  137. package/dist/esm/modules/journey/steps/stepTable.d.ts.map +1 -0
  138. package/dist/esm/modules/journey/steps/stepTable.js +241 -0
  139. package/dist/esm/modules/journey/steps/stepTable.js.map +1 -0
  140. package/dist/esm/modules/journey/theme/applyTheme.d.ts +17 -0
  141. package/dist/esm/modules/journey/theme/applyTheme.d.ts.map +1 -0
  142. package/dist/esm/modules/journey/theme/applyTheme.js +49 -0
  143. package/dist/esm/modules/journey/theme/applyTheme.js.map +1 -0
  144. package/dist/esm/modules/journey/types/classification.d.ts +10 -0
  145. package/dist/esm/modules/journey/types/classification.d.ts.map +1 -0
  146. package/dist/esm/modules/journey/types/classification.js +2 -0
  147. package/dist/esm/modules/journey/types/classification.js.map +1 -0
  148. package/dist/esm/modules/journey/types/classifierInput.d.ts +45 -0
  149. package/dist/esm/modules/journey/types/classifierInput.d.ts.map +1 -0
  150. package/dist/esm/modules/journey/types/classifierInput.js +2 -0
  151. package/dist/esm/modules/journey/types/classifierInput.js.map +1 -0
  152. package/dist/esm/modules/journey/types/contract.d.ts +60 -0
  153. package/dist/esm/modules/journey/types/contract.d.ts.map +1 -0
  154. package/dist/esm/modules/journey/types/contract.js +7 -0
  155. package/dist/esm/modules/journey/types/contract.js.map +1 -0
  156. package/dist/esm/modules/journey/types/resultConfig.d.ts +23 -0
  157. package/dist/esm/modules/journey/types/resultConfig.d.ts.map +1 -0
  158. package/dist/esm/modules/journey/types/resultConfig.js +2 -0
  159. package/dist/esm/modules/journey/types/resultConfig.js.map +1 -0
  160. package/dist/esm/modules/meta.json +1 -1
  161. package/dist/esm/modules/ocr/vendors/Daon/index.d.ts +1 -1
  162. package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.d.ts +3 -1
  163. package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.d.ts.map +1 -1
  164. package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.js +15 -2
  165. package/dist/esm/modules/ocr/vendors/Onfido/onfido.init.js.map +1 -1
  166. package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.d.ts +3 -1
  167. package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.d.ts.map +1 -1
  168. package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.js +15 -2
  169. package/dist/esm/modules/ocr/vendors/Onfido/onfidoLegacy.init.js.map +1 -1
  170. package/dist/esm/modules/ocr/vendors/Onfido/shared.d.ts +17 -0
  171. package/dist/esm/modules/ocr/vendors/Onfido/shared.d.ts.map +1 -1
  172. package/dist/esm/modules/ocr/vendors/Onfido/shared.js +33 -5
  173. package/dist/esm/modules/ocr/vendors/Onfido/shared.js.map +1 -1
  174. package/dist/esm/modules/sdk/index.d.ts.map +1 -1
  175. package/dist/esm/modules/sdk/index.js +5 -1
  176. package/dist/esm/modules/sdk/index.js.map +1 -1
  177. package/dist/esm/modules/sdk/types/globalEvents.d.ts +13 -0
  178. package/dist/esm/modules/sdk/types/globalEvents.d.ts.map +1 -1
  179. package/dist/esm/modules/sdk/types/oneSDK.d.ts +1 -0
  180. package/dist/esm/modules/sdk/types/oneSDK.d.ts.map +1 -1
  181. package/dist/esm/styles/f1-style.css +1 -1
  182. package/dist/release.txt +1 -1
  183. package/dist/version.txt +1 -1
  184. package/package.json +1 -1
@@ -0,0 +1,509 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { MOUNT_DEBOUNCE_WAIT } from '../../common/shared/utils/index.js';
11
+ import { IDVStatus } from '../../frankie-client/clients/IDVClient.js';
12
+ import { CAPTURE_EVENTS } from '../steps/stepTable.js';
13
+ import { transportErrorSignal } from '../classify/transportError.js';
14
+ import { mkScreenSequence } from './screenSequence.js';
15
+ import { submitAndClassify, verificationRequested } from './submitAndClassify.js';
16
+ /**
17
+ * The statuses that mean "photograph it again", as the *values* the idv module
18
+ * actually emits — `checkStatusEventMapping.ts` forwards `results.checkStatus`
19
+ * straight through, so what arrives here is an `IDVStatus` member, never its
20
+ * TypeScript name.
21
+ *
22
+ * FDEL-53728 B5: this list used to be string literals, and four of the five
23
+ * happened to match because their enum value equals their name. The fifth does
24
+ * not — `IDVStatus.DOCUMENTS_INVALID` is
25
+ * `'AWAITING_DOCUMENT_UPLOAD_INVALID_TYPE'`, inherited from `OCRStatus` — so an
26
+ * invalid document fell through to `unmapped_status` and declined the applicant
27
+ * instead of asking for another photograph. Typed as `IDVStatus[]` so a name
28
+ * cannot be written here again without failing the build.
29
+ */
30
+ const RECAPTURE_STATUSES = [
31
+ IDVStatus.INCOMPLETE,
32
+ IDVStatus.DOCUMENTS_INVALID,
33
+ IDVStatus.WAITING_DOC_UPLOAD,
34
+ IDVStatus.WAITING_SELFIE_UPLOAD,
35
+ IDVStatus.INTERRUPTED,
36
+ ];
37
+ const ABANDONED = { alerts: [], signal: 'user_exited' };
38
+ /**
39
+ * Converts engine events into a ClassifierInput. Decides nothing itself —
40
+ * spec §5.0.1: the IDV status is process state, never an outcome.
41
+ *
42
+ * Which engine events the capture step listens to, and which of them complete
43
+ * it, is declared in `steps/stepTable.ts` (row CAPTURE) — the handler map below
44
+ * has to cover exactly those events or it will not compile. Everything is
45
+ * subscribed once, through the machine, and released by its single teardown.
46
+ *
47
+ * There is deliberately **no fallback timer** on anything the applicant does.
48
+ * The only timer in this file waits out the idv module's own mount debounce,
49
+ * which guards engine behaviour rather than human action.
50
+ */
51
+ export const mkIdvStepRunner = (deps) => {
52
+ const { oneSdk, config, machine, firstPaint } = deps;
53
+ const screens = mkScreenSequence({ oneSdk, config, machine, firstPaint });
54
+ const mkIdv = () => oneSdk.flow('idv');
55
+ let idv;
56
+ /** what the *next* attempt must do, set by whichever branch asked for a retry */
57
+ let retryKind = 'recapture';
58
+ const finish = (input, kind = 'recapture') => {
59
+ // a late engine event, arriving after the attempt already settled, must not
60
+ // redirect the *next* attempt: the retry kind moves only with a completion
61
+ if (!machine.isPending('CAPTURE'))
62
+ return;
63
+ retryKind = kind;
64
+ machine.complete('CAPTURE', input);
65
+ };
66
+ // Registered first, so the single teardown settles the in-flight attempt
67
+ // before the screens and vendor flow it depends on are released: a dropped
68
+ // resolver would leave the caller's `await start()` hanging.
69
+ machine.release(() => finish(ABANDONED));
70
+ /**
71
+ * Attribute an internal failure to the step immediately, with the real cause
72
+ * attached. Mirrors the `errorDetail` shape `journeyHandle`'s own catch-all
73
+ * uses, so classification is identical either way.
74
+ */
75
+ const failInternal = (error) => {
76
+ // FDEL-53728 Q2. A transport failure is not an internal fault, and the same
77
+ // 401 must not report one way from the verify-submit and another from
78
+ // `search()`. `transportErrorSignal` returns undefined for everything else,
79
+ // so a genuine fault keeps `unmapped_status` / `internal` as before.
80
+ const transport = transportErrorSignal(error);
81
+ if (transport) {
82
+ finish({
83
+ alerts: [],
84
+ signal: transport,
85
+ errorDetail: { code: transport, message: error.message },
86
+ });
87
+ return;
88
+ }
89
+ finish({
90
+ alerts: [],
91
+ signal: 'unmapped_status',
92
+ errorDetail: { code: 'internal', message: error.message },
93
+ });
94
+ };
95
+ /**
96
+ * The verification submit, with the loading screen the reference flow shows
97
+ * around it (`idv.html:264-279` / `ocr_only.html:209-222`). Hidden in a
98
+ * `finally` so a thrown submit cannot strand the spinner over the result
99
+ * screen -- matching the reference, which also drops its loader before
100
+ * mounting the result. That loading screen is conditional, not shown at
101
+ * all when verification was not requested (`triggerVerificationOnSubmit:
102
+ * false`), since there is then no submit for it to wrap.
103
+ */
104
+ const verifyAndClassify = () => __awaiter(void 0, void 0, void 0, function* () {
105
+ // No submit means no wait, so no loader: `submitAndClassify` returns
106
+ // `captured` synchronously and the applicant would see a spinner flash
107
+ // over work that never happened.
108
+ if (!verificationRequested(config)) {
109
+ return submitAndClassify({ oneSdk, config });
110
+ }
111
+ screens.showVerifying();
112
+ try {
113
+ return yield submitAndClassify({ oneSdk, config });
114
+ }
115
+ finally {
116
+ screens.hideVerifying();
117
+ }
118
+ });
119
+ const finishCapture = () => {
120
+ screens.hideExtraction();
121
+ void screens
122
+ .presentReview()
123
+ .then(() => verifyAndClassify())
124
+ // alerts that come back from submit are data-correction retries: the
125
+ // applicant's details did not match, the photographs were fine.
126
+ .then((input) => finish(input, 'data'))
127
+ .catch(failInternal);
128
+ };
129
+ /**
130
+ * Every debounce wait in flight, with the resolver that ends it, so
131
+ * `teardown()` leaves no timer behind *and* no permanently pending promise:
132
+ * a cleared wait resolves, its caller wakes, sees `isTorn()` and stops.
133
+ */
134
+ const waits = new Map();
135
+ machine.release(() => {
136
+ const cleared = [...waits.entries()];
137
+ waits.clear();
138
+ cleared.forEach(([timer, wake]) => {
139
+ clearTimeout(timer);
140
+ wake();
141
+ });
142
+ });
143
+ /** monotonic where available: a wall clock that steps must not skew a wait */
144
+ const now = () => typeof performance === 'undefined' ? Date.now() : performance.now();
145
+ const waitFor = (ms) => new Promise((resolve) => {
146
+ const timer = setTimeout(() => {
147
+ waits.delete(timer);
148
+ resolve();
149
+ }, ms);
150
+ waits.set(timer, resolve);
151
+ });
152
+ /** when the most recently *claimed* capture mount lands, on that clock */
153
+ let mountClaimedFor;
154
+ /**
155
+ * Mount the capture, absorbing the engine quirk the design calls out: the idv
156
+ * module's `mount` is `debounce(..., 500, { leading: true, trailing: false })`
157
+ * (`modules/idv/index.ts:177`), so a second mount arriving inside that window
158
+ * is silently swallowed. One reused instance plus a fully automatic recapture
159
+ * retry — no human gate — makes that reachable, and with no fallback timer
160
+ * the journey would then hang with nothing on screen. Waiting out the window
161
+ * is a timer guarding engine behaviour, not human action, so the wrapper
162
+ * absorbs the quirk rather than inheriting it.
163
+ *
164
+ * The slot is claimed *before* the wait, not stamped after it: an
165
+ * `AWAITING_CONSENT` resume and a new attempt can wait concurrently, and if
166
+ * both stamped on waking they would wake together and have the second mount
167
+ * swallowed by the very window they waited out.
168
+ */
169
+ const mountCapture = (flow) => __awaiter(void 0, void 0, void 0, function* () {
170
+ // Our own loader goes up before the vendor mounts. It is the surface
171
+ // `journey_ready` is measured from — deterministic, because we own it —
172
+ // and it covers the vendor's blank frame while that boots. It is removed
173
+ // on the vendor's `ready` (wired in `ensureIdv`), which for the
174
+ // onload-only vendors is earlier than real paint; see the per-vendor
175
+ // note there.
176
+ // Deliberately not awaited: the loader's host element and screen are
177
+ // created synchronously (before its first `await`), so it is already on
178
+ // screen-bound DOM, and blocking the vendor mount on two animation frames
179
+ // would add latency for no benefit. `journey_ready` fires when it has
180
+ // actually painted, which is the point.
181
+ void screens
182
+ .showCaptureLoader()
183
+ .then(() => firstPaint.signal())
184
+ .catch(() => {
185
+ // a loader that fails to mount must not fail the capture step -- the
186
+ // `ready` backstop wired in `ensureIdv` still yields `journey_ready`
187
+ });
188
+ const idle = mountClaimedFor === undefined ? Infinity : now() - mountClaimedFor;
189
+ const wait = MOUNT_DEBOUNCE_WAIT - idle;
190
+ mountClaimedFor = now() + Math.max(wait, 0);
191
+ if (wait > 0)
192
+ yield waitFor(wait);
193
+ // teardown clears the wait, so this is belt and braces: nothing mounts into
194
+ // a container the host has reclaimed.
195
+ if (machine.isTorn())
196
+ return;
197
+ flow.mount(config.container);
198
+ });
199
+ const onInputRequired = (checkStatus, flow) => {
200
+ if (checkStatus === IDVStatus.AWAITING_CONSENT) {
201
+ // spec §5.4 — not terminal: re-present consent, then resume capture
202
+ screens.hideExtraction();
203
+ void screens
204
+ .presentConsent()
205
+ .then(() => mountCapture(flow))
206
+ .catch(failInternal);
207
+ return;
208
+ }
209
+ if (checkStatus === IDVStatus.PROVIDER_OFFLINE) {
210
+ screens.hideExtraction();
211
+ finish({
212
+ alerts: [],
213
+ signal: 'vendor_offline',
214
+ errorDetail: {
215
+ code: 'PROVIDER_OFFLINE',
216
+ message: 'The identity provider is offline or returned an unrecognised error.',
217
+ },
218
+ });
219
+ return;
220
+ }
221
+ if (checkStatus === IDVStatus.INCOMPLETE) {
222
+ // spec §5.0.2 — ambiguous status: re-fetch, then let the data decide
223
+ void oneSdk.individual().search().then(finishCapture).catch(failInternal);
224
+ return;
225
+ }
226
+ if (RECAPTURE_STATUSES.includes(checkStatus)) {
227
+ screens.hideExtraction();
228
+ finish({ alerts: ['partial'] }, 'recapture');
229
+ return;
230
+ }
231
+ // Name the status we could not model. Without this the journey settles
232
+ // `error/internal` with no clue which engine state caused it — the exact
233
+ // diagnosability gap spec §5.0.6 describes in the classic API.
234
+ finish({
235
+ alerts: [],
236
+ signal: 'unmapped_status',
237
+ errorDetail: {
238
+ code: 'unmapped_status',
239
+ message: `Unmodelled IDV status on input_required: ${checkStatus}`,
240
+ },
241
+ });
242
+ };
243
+ /**
244
+ * One listener per event the CAPTURE row declares, attached once per journey
245
+ * and released once. `satisfies Record<CaptureEvent, ...>` is the compile-time
246
+ * link to the table: an event added to the row without a listener here, or a
247
+ * listener here for an event the row does not declare, fails the build.
248
+ */
249
+ const captureListeners = (flow) => ({
250
+ detection_complete: (props) => {
251
+ // Capture is done, but the iframe wrapper keeps its frame in the
252
+ // container for the whole `Retrieving IDV results` poll that follows
253
+ // (`defineIframeIDVWrapper.ts:193-228`) — so the vendor's own
254
+ // post-capture screen would sit behind ours. The reference removes it
255
+ // here too, and skips Sumsub, which manages its own DOM
256
+ // (`idv.html:248-251`).
257
+ if ((props === null || props === void 0 ? void 0 : props.provider) !== 'sumsub')
258
+ screens.removeVendorFrames();
259
+ // FDEL-52471: the OCR half of a split capture must not show extraction
260
+ if ((props === null || props === void 0 ? void 0 : props.source) !== 'ocr')
261
+ screens.showExtraction();
262
+ },
263
+ /**
264
+ * See the CAPTURE row's `vendor_sdk_failed_loading` signal
265
+ * (`stepTable.ts`). The vendor's SDK never loaded, so there is no capture
266
+ * UI and no amount of waiting produces one — `classify.ts` lists
267
+ * `vendor_load_failed` as unrecoverable, so the applicant is not offered a
268
+ * retry that cannot succeed. Settled directly, not deferred: this fires
269
+ * immediately before the generic `error` the loader also emits, and
270
+ * first-wins is what claims the step (FDEL-53728 Q2).
271
+ */
272
+ vendor_sdk_failed_loading: (failure) => {
273
+ screens.hideExtraction();
274
+ const vendor = failure === null || failure === void 0 ? void 0 : failure.vendor;
275
+ finish({
276
+ alerts: [],
277
+ signal: 'vendor_load_failed',
278
+ errorDetail: {
279
+ code: 'vendor_load_failed',
280
+ message: `Vendor sdk '${vendor !== null && vendor !== void 0 ? vendor : 'unknown'}' failed loading`,
281
+ vendor,
282
+ },
283
+ });
284
+ },
285
+ /**
286
+ * See the CAPTURE row's `detection_failed` signal (`stepTable.ts`).
287
+ *
288
+ * Deferred by exactly one microtask, which is the whole fix (FDEL-53728
289
+ * B7). Iframe vendors, Truuth and OcrLabs emit this and then go quiet, so
290
+ * without it the container is blank and the step never settles. Onfido and
291
+ * IDVerse emit it *first* and then, in the same synchronous burst, emit the
292
+ * event that actually says what happened — a user exit, a rejection. The
293
+ * EventHub is synchronous, so deferring one microtask lets every one of
294
+ * those land before this does, and `finish()` is a no-op once the step has
295
+ * settled. A timer would do the same job less exactly; this is ordering,
296
+ * not waiting, so nothing is left on the clock for teardown to clear.
297
+ */
298
+ detection_failed: (failure) => {
299
+ const message = failure === null || failure === void 0 ? void 0 : failure.message;
300
+ void Promise.resolve().then(() => finish({
301
+ alerts: [],
302
+ signal: 'vendor_offline',
303
+ errorDetail: {
304
+ code: 'detection_failed',
305
+ message: message
306
+ ? String(message)
307
+ : 'The vendor ended capture without a result.',
308
+ },
309
+ }));
310
+ },
311
+ error: (error) => {
312
+ var _a;
313
+ const payload = error === null || error === void 0 ? void 0 : error.payload;
314
+ // FDEL-53728 B6. `checkStatusEventMapping.ts:68-81` does not emit
315
+ // AWAITING_CONSENT and PROVIDER_OFFLINE as `input_required` at all — it
316
+ // emits them as an `error`, with the status under `errorStatus` rather
317
+ // than `checkStatus`. Every iframe vendor (Daon, Incode) goes through
318
+ // that mapper, so on those the whole `onInputRequired` status ladder was
319
+ // unreachable and a missing consent read as a vendor outage. Routing on
320
+ // `errorStatus` puts both back on the one ladder rather than duplicating
321
+ // it here; only wrappers that emit them as `input_required`
322
+ // (`Truuth/index.ts:318`) took the other door.
323
+ const { errorStatus } = payload !== null && payload !== void 0 ? payload : {};
324
+ if (errorStatus !== undefined) {
325
+ onInputRequired(String(errorStatus), flow);
326
+ return;
327
+ }
328
+ screens.hideExtraction();
329
+ // FDEL-53728 Q1. FAILED is a check that ran and did not pass, so it is a
330
+ // decline — the same outcome as COMPLETE+REJECTED, which is the only
331
+ // case this used to recognise. It arrives without `result: 'REJECTED'`
332
+ // (`checkStatusEventMapping.ts:45-53`), so it fell through to the
333
+ // vendor_offline fallback and offered a "try again" for a decision that
334
+ // is not going to change.
335
+ const rejected = (payload === null || payload === void 0 ? void 0 : payload.result) === 'REJECTED' ||
336
+ (payload === null || payload === void 0 ? void 0 : payload.checkStatus) === IDVStatus.FAILED;
337
+ if (rejected) {
338
+ finish({ alerts: [], signal: 'idv_rejected' });
339
+ return;
340
+ }
341
+ finish({
342
+ alerts: [],
343
+ signal: 'vendor_offline',
344
+ errorDetail: {
345
+ code: String((_a = payload === null || payload === void 0 ? void 0 : payload.checkStatus) !== null && _a !== void 0 ? _a : 'idv_error'),
346
+ message: error.message,
347
+ },
348
+ });
349
+ },
350
+ info: (payload) => {
351
+ if (payload.name !== 'FetchProcessingExceededAttempts')
352
+ return;
353
+ screens.hideExtraction();
354
+ finish({ alerts: [], signal: 'processing_timeout' });
355
+ },
356
+ session_interrupted: (payload) => {
357
+ const closed = (payload === null || payload === void 0 ? void 0 : payload.eventName) === 'USER_CLOSED_MODAL';
358
+ finish({
359
+ alerts: [],
360
+ signal: closed ? 'user_exited' : 'session_interrupted',
361
+ });
362
+ },
363
+ input_required: (_info, checkStatus) => onInputRequired(String(checkStatus), flow),
364
+ results: () => finishCapture(),
365
+ });
366
+ /**
367
+ * One `idv` instance per journey, created lazily. `oneSdk.flow()` defaults
368
+ * `instanceName` to a fresh uuid (`componentLoader.ts:55`), so calling it per
369
+ * attempt would mount a second Daon capture over the first and retain every
370
+ * instance. Listeners are wired once, against the machine's CAPTURE slot.
371
+ */
372
+ const ensureIdv = () => {
373
+ if (idv)
374
+ return idv;
375
+ const flow = mkIdv();
376
+ const listeners = captureListeners(flow);
377
+ // the idv module types `on`/`off` per event key while the table hands them
378
+ // a `string`, so the emitter is cast once, here, at the boundary
379
+ const emitter = flow;
380
+ CAPTURE_EVENTS.forEach((event) => emitter.on(event, listeners[event]));
381
+ // reachable as the *first* screen only when every pre-capture screen is
382
+ // off (or startAt:'CAPTURE') — IDVFlow.tsx's own `idv.on('ready', ...)`
383
+ // is what reveals the vendor iframe, so it means the same thing here.
384
+ //
385
+ // KNOWN GAP, vendor-by-vendor, not yet fixed: `ready` is purely
386
+ // vendor-delegated (neither `modules/idv/index.ts` nor `mount.ts` emits
387
+ // it themselves) and not equally reliable —
388
+ // - OcrLabs (production, not dummy mode): NEVER emits `ready` at all —
389
+ // `startFlow.ts` redirects the whole page to the vendor's own URL. If
390
+ // OcrLabs is the provider and CAPTURE is the first screen, journey_ready
391
+ // never fires for that attempt.
392
+ // - Truuth: fires right after the vendor script installs, before
393
+ // `truuthWebSDK.init()` even runs (`Truuth/index.ts:402/:404`) — real,
394
+ // but earlier than actual visibility.
395
+ // - Daon / Incode: the shared iframe wrapper (`emitOnLoad: true`) fires
396
+ // on the iframe's own `onload` — "the iframe document loaded", not
397
+ // "the vendor SPA inside it rendered".
398
+ // - Onfido (both paths), Mastercard, Sumsub: confirmed against real
399
+ // vendor-declared or DOM-observed readiness.
400
+ //
401
+ // `journey_ready` no longer depends on any of this — it is signalled from
402
+ // our own capture loader in `mountCapture`. This watch stays as a backstop
403
+ // for the path where that loader fails to mount, and is idempotent.
404
+ firstPaint.watch(emitter, ['ready']);
405
+ // Take our loader down once the vendor says it is up. For the vendors
406
+ // above whose `ready` is early, this is where the residual blank frame
407
+ // comes from — bounded, and strictly no worse than having no loader.
408
+ const hideLoader = () => screens.hideCaptureLoader();
409
+ emitter.on('ready', hideLoader);
410
+ machine.release(() => { var _a; return (_a = emitter.off) === null || _a === void 0 ? void 0 : _a.call(emitter, 'ready', hideLoader); });
411
+ machine.release(() => {
412
+ CAPTURE_EVENTS.forEach((event) => { var _a; return (_a = emitter.off) === null || _a === void 0 ? void 0 : _a.call(emitter, event, listeners[event]); });
413
+ flow.unmount();
414
+ });
415
+ idv = flow;
416
+ return flow;
417
+ };
418
+ /**
419
+ * spec §6 — data-correction retry: PARTIAL screen, review form, resubmit
420
+ *
421
+ * Only reached when `withReview` is on: `submitAndClassify.ts` settles a
422
+ * retryable result as `declined / checks_failed` when it is off, so the loop
423
+ * never asks for a correction the review screen is not there to collect
424
+ * (FDEL-53227).
425
+ */
426
+ const retryWithCorrectedData = () => screens
427
+ .presentPartial()
428
+ .then(() => screens.presentReview())
429
+ .then(() => verifyAndClassify())
430
+ .then((input) => finish(input, 'data'))
431
+ .catch(failInternal);
432
+ /**
433
+ * TEST SEAM (`config.startAt === 'REVIEW'`) — go straight to the review form
434
+ * and submit, mounting no capture and presenting no pre-capture screens. Uses
435
+ * the same review-then-submit path as the data-correction retry, so it
436
+ * exercises real code rather than a parallel one.
437
+ */
438
+ const startAtReview = () => screens
439
+ .presentReview()
440
+ .then(() => verifyAndClassify())
441
+ .then((input) => finish(input, 'data'))
442
+ .catch(failInternal);
443
+ const run = (attempt) => {
444
+ // `destroy()` can land in the microtask window between one attempt settling
445
+ // and the next starting. Nothing may mount into a container the host has
446
+ // already reclaimed, so the attempt ends where it began — as an
447
+ // abandonment, which is what actually happened, rather than as an error.
448
+ if (machine.isTorn())
449
+ return Promise.resolve(ABANDONED);
450
+ return machine.run('CAPTURE', () => {
451
+ // The attempt is still owned by the CAPTURE step even when the seam skips
452
+ // the capture itself: `presentReview()` runs its own `machine.run('REVIEW')`
453
+ // internally, so wrapping it in a second one would collide with it and be
454
+ // treated as a duplicate.
455
+ if (attempt === 0 && config.startAt === 'REVIEW') {
456
+ void startAtReview();
457
+ return undefined;
458
+ }
459
+ if (attempt > 0 && retryKind === 'data') {
460
+ void retryWithCorrectedData();
461
+ return undefined;
462
+ }
463
+ const flow = ensureIdv();
464
+ // Pre-capture screens run once, not on every retry. Listeners are wired
465
+ // synchronously inside `ensureIdv()` so no early engine event is missed;
466
+ // mounting the capture itself waits for pre-capture to clear.
467
+ const start = () => __awaiter(void 0, void 0, void 0, function* () {
468
+ // `startAt: 'CAPTURE'` skips the pre-capture screens while leaving their
469
+ // config intact, so you are not forced to disable them to iterate.
470
+ if (attempt === 0 && config.startAt !== 'CAPTURE') {
471
+ yield screens.presentPreCapture();
472
+ }
473
+ yield mountCapture(flow);
474
+ });
475
+ // A throw here (e.g. a pre-capture screen failing to mount) must settle
476
+ // immediately with the real cause attached -- otherwise it becomes an
477
+ // unhandled rejection and, with no fallback timer, the step never settles.
478
+ void start().catch(failInternal);
479
+ return undefined;
480
+ });
481
+ };
482
+ /**
483
+ * Leave the container clear for the journey's own terminal card
484
+ * (FDEL-53993 QA B10) — `ocrFlow.ts`'s copy carries the full reasoning.
485
+ *
486
+ * IDV is the worse half of it. `idv.unmount()` was `// NOT IMPLEMENTED` until
487
+ * FDEL-53728, and even now it reaches the wrapper's own `unmount`, which of
488
+ * the IDV vendors only Onfido implements — Daon, Incode, Mastercard, OcrLabs,
489
+ * Sumsub and Truuth do not. Asking politely covers one vendor in seven; the
490
+ * journey clearing the container it owns covers all of them.
491
+ *
492
+ * **Called only at terminal settlement, never from `finish()`.** `ensureIdv()`
493
+ * caches and REUSES this instance — a recapture retry re-mounts the same
494
+ * object — so doing this per attempt would tear down a capture still in use.
495
+ */
496
+ const clearForTerminalScreen = () => {
497
+ try {
498
+ idv === null || idv === void 0 ? void 0 : idv.unmount();
499
+ }
500
+ catch (_a) {
501
+ // swallow: a wrapper with no `unmount`, or one that throws in it, must
502
+ // not stop the clear below — nor the terminal card that follows it
503
+ }
504
+ screens.unmountAll();
505
+ config.container.innerHTML = '';
506
+ };
507
+ return { run, clearForTerminalScreen };
508
+ };
509
+ //# sourceMappingURL=idvFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idvFlow.js","sourceRoot":"","sources":["../../../../../modules/journey/flows/idvFlow.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAS/E;;;;;;;;;;;;;GAaG;AACH,MAAM,kBAAkB,GAAgB;IACtC,SAAS,CAAC,UAAU;IACpB,SAAS,CAAC,iBAAiB;IAC3B,SAAS,CAAC,kBAAkB;IAC5B,SAAS,CAAC,qBAAqB;IAC/B,SAAS,CAAC,WAAW;CACtB,CAAC;AAEF,MAAM,SAAS,GAAoB,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAoBzE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAK/B,EAAiB,EAAE;IAClB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,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OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC;YACzB,wEAAwE;YACxE,yEAAyE;YACzE,8DAA8D;YAC9D,MAAM,KAAK,GAAG,GAAwB,EAAE;gBACtC,yEAAyE;gBACzE,mEAAmE;gBACnE,IAAI,OAAO,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;oBAClD,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBACpC,CAAC;gBACD,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAA,CAAC;YACF,wEAAwE;YACxE,sEAAsE;YACtE,2EAA2E;YAC3E,KAAK,KAAK,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF;;;;;;;;;;;;;OAaG;IACH,MAAM,sBAAsB,GAAG,GAAS,EAAE;QACxC,IAAI,CAAC;YACH,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,EAAE,CAAC;QACjB,CAAC;QAAC,WAAM,CAAC;YACP,uEAAuE;YACvE,mEAAmE;QACrE,CAAC;QACD,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,CAAC;AACzC,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { OneSdkContext } from '../../sdk/types/oneSDK';
2
+ import type { JourneyScreenConfig, ScreenSequence } from './screenSequence';
3
+ import type { StepRunner } from '../journeyHandle';
4
+ import type { FirstPaintSignal } from '../steps/firstPaint';
5
+ import type { StepMachine } from '../steps/stepMachine';
6
+ export type OcrStepRunner = {
7
+ run: StepRunner;
8
+ /** take the vendor's UI down at terminal settlement — see the implementation */
9
+ /** leave the container clear for the terminal card — see the implementation */
10
+ clearForTerminalScreen: () => void;
11
+ };
12
+ /**
13
+ * The `ocr` module's own CAPTURE step runner — see `idvFlow.ts` for the
14
+ * mechanism this mirrors (mount-debounce absorption, retry-kind tracking,
15
+ * teardown ordering). The two deltas are documented at their call sites:
16
+ * `oneSdk.component('ocr')` instead of `oneSdk.flow('idv')`, and
17
+ * `detection_complete` always shows the extraction screen — there is no
18
+ * biometrics leg here to suppress it for (contrast FDEL-52471 in idvFlow.ts).
19
+ */
20
+ export declare const mkOcrStepRunner: (deps: {
21
+ oneSdk: OneSdkContext;
22
+ config: JourneyScreenConfig;
23
+ machine: StepMachine;
24
+ firstPaint: FirstPaintSignal;
25
+ }) => OcrStepRunner;
26
+ export type { JourneyScreenConfig, ScreenSequence };
27
+ //# sourceMappingURL=ocrFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ocrFlow.d.ts","sourceRoot":"","sources":["../../../../../modules/journey/flows/ocrFlow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAS9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAuCrE,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,UAAU,CAAC;IAChB,gFAAgF;IAChF,+EAA+E;IAC/E,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAKF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,SAAU;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,KAAG,aAkZH,CAAC;AAEF,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC"}