@ekyc_qoobiss/qbs-ect-cmp 3.6.26 → 3.6.27

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 (163) hide show
  1. package/dist/i18n/en.json +100 -0
  2. package/dist/i18n/ro.json +100 -0
  3. package/dist/i18n/ru.json +100 -0
  4. package/dist/{collection/helpers/Cameras.js → qbs-ect-cmp/Cameras-dfbebc29.js} +9 -6
  5. package/dist/{collection/models/CaptureFlow.js → qbs-ect-cmp/CaptureFlow-db5d90a4.js} +6 -4
  6. package/dist/{collection/libs/IDML5Detector/IDPose.js → qbs-ect-cmp/IDPose-181bcb25.js} +4 -2
  7. package/dist/{collection/models/IDevice.js → qbs-ect-cmp/IDevice-15ecfdeb.js} +6 -4
  8. package/dist/qbs-ect-cmp/ML5-657ef934.js +1370 -0
  9. package/dist/qbs-ect-cmp/Stream-b867a2be.js +3104 -0
  10. package/dist/qbs-ect-cmp/_commonjsHelpers-321aa363.js +44 -0
  11. package/dist/qbs-ect-cmp/agreement-check.entry.js +41 -0
  12. package/dist/qbs-ect-cmp/agreement-info.entry.js +66 -0
  13. package/dist/qbs-ect-cmp/app-globals-0f993ce5.js +3 -0
  14. package/dist/qbs-ect-cmp/base-component-2e490fd9.js +502 -0
  15. package/dist/qbs-ect-cmp/camera-comp.entry.js +103 -0
  16. package/dist/qbs-ect-cmp/camera-error.entry.js +59 -0
  17. package/dist/qbs-ect-cmp/capture-error.entry.js +53 -0
  18. package/dist/qbs-ect-cmp/css-shim-b7d3d95f.js +4 -0
  19. package/dist/qbs-ect-cmp/dom-64053c71.js +73 -0
  20. package/dist/qbs-ect-cmp/end-redirect.entry.js +25 -0
  21. package/dist/qbs-ect-cmp/error-end.entry.js +19 -0
  22. package/dist/qbs-ect-cmp/how-to-info.entry.js +52 -0
  23. package/dist/{collection/components/common/id-back-capture/id-back-capture.js → qbs-ect-cmp/id-back-capture.entry.js} +30 -100
  24. package/dist/{collection/components/common/id-capture/id-capture.js → qbs-ect-cmp/id-capture.entry.js} +28 -98
  25. package/dist/{collection/components/common/id-tilt/id-tilt.js → qbs-ect-cmp/id-tilt.entry.js} +28 -98
  26. package/dist/qbs-ect-cmp/identification-component.entry.js +909 -0
  27. package/dist/qbs-ect-cmp/index-78a05b9e.js +3371 -0
  28. package/dist/qbs-ect-cmp/index.esm.js +1 -0
  29. package/dist/qbs-ect-cmp/landing-validation.entry.js +90 -0
  30. package/dist/{esm → qbs-ect-cmp}/loader-dots.entry.js +1 -1
  31. package/dist/qbs-ect-cmp/mobile-redirect.entry.js +2984 -0
  32. package/dist/{collection/components/flow/process-id/process-id.js → qbs-ect-cmp/process-id.entry.js} +32 -100
  33. package/dist/qbs-ect-cmp/qbs-ect-cmp.css +320 -1
  34. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +148 -1
  35. package/dist/{esm → qbs-ect-cmp}/random-actions.entry.js +6 -3
  36. package/dist/{collection/components/common/selfie-capture/selfie-capture.js → qbs-ect-cmp/selfie-capture.entry.js} +28 -99
  37. package/dist/{collection/components/common/selfie-tilt/selfie-tilt.js → qbs-ect-cmp/selfie-tilt.entry.js} +29 -99
  38. package/dist/qbs-ect-cmp/shadow-css-98135883.js +387 -0
  39. package/dist/qbs-ect-cmp/sms-code-validation.entry.js +106 -0
  40. package/dist/{esm/store-fdeed827.js → qbs-ect-cmp/textValues-6bcc85dd.js} +51 -147
  41. package/dist/{collection/components/flow/user-liveness/user-liveness.js → qbs-ect-cmp/user-liveness.entry.js} +25 -91
  42. package/dist/{collection/utils/utils.js → qbs-ect-cmp/utils-8225f0b7.js} +10 -8
  43. package/dist/types/components/base-component.d.ts +2 -0
  44. package/dist/types/components/common/agreement-check/agreement-check.d.ts +1 -0
  45. package/dist/types/components/common/random-actions/random-actions.d.ts +2 -0
  46. package/dist/types/components/flow/end-redirect/end-redirect.d.ts +1 -0
  47. package/dist/types/components/identification-component/identification-component.d.ts +1 -0
  48. package/dist/types/components.d.ts +2 -0
  49. package/dist/types/helpers/TranslationUtils.d.ts +9 -0
  50. package/dist/types/helpers/textValues.d.ts +8 -95
  51. package/dist/types/models/IEctStore.d.ts +1 -0
  52. package/dist/types/models/ITranslationValues.d.ts +101 -0
  53. package/package.json +1 -1
  54. package/dist/cjs/agreement-check_19.cjs.entry.js +0 -9970
  55. package/dist/cjs/index-41696e0e.js +0 -1573
  56. package/dist/cjs/index.cjs.js +0 -2
  57. package/dist/cjs/loader-dots.cjs.entry.js +0 -19
  58. package/dist/cjs/loader.cjs.js +0 -22
  59. package/dist/cjs/qbs-ect-cmp.cjs.js +0 -23
  60. package/dist/cjs/random-actions.cjs.entry.js +0 -22
  61. package/dist/cjs/store-f1a0f55c.js +0 -413
  62. package/dist/collection/assets/canvas-masks/face_green.svg +0 -8
  63. package/dist/collection/assets/canvas-masks/face_white.svg +0 -8
  64. package/dist/collection/assets/canvas-masks/id_green.svg +0 -6
  65. package/dist/collection/assets/canvas-masks/id_white.svg +0 -6
  66. package/dist/collection/assets/complete.svg +0 -4
  67. package/dist/collection/assets/landing/device.svg +0 -14
  68. package/dist/collection/assets/landing/id.svg +0 -3
  69. package/dist/collection/assets/landing/info.svg +0 -3
  70. package/dist/collection/assets/landing/validation.svg +0 -16
  71. package/dist/collection/assets/loader.svg +0 -29
  72. package/dist/collection/collection-manifest.json +0 -32
  73. package/dist/collection/components/base-component.js +0 -59
  74. package/dist/collection/components/common/agreement-check/agreement-check.css +0 -0
  75. package/dist/collection/components/common/agreement-check/agreement-check.js +0 -101
  76. package/dist/collection/components/common/camera-error/camera-error.css +0 -0
  77. package/dist/collection/components/common/camera-error/camera-error.js +0 -91
  78. package/dist/collection/components/common/capture-error/capture-error.css +0 -0
  79. package/dist/collection/components/common/capture-error/capture-error.js +0 -101
  80. package/dist/collection/components/common/how-to-info/how-to-info.css +0 -0
  81. package/dist/collection/components/common/how-to-info/how-to-info.js +0 -122
  82. package/dist/collection/components/common/id-back-capture/id-back-capture.css +0 -35
  83. package/dist/collection/components/common/id-capture/id-capture.css +0 -35
  84. package/dist/collection/components/common/id-tilt/id-tilt.css +0 -35
  85. package/dist/collection/components/common/random-actions/random-actions.css +0 -0
  86. package/dist/collection/components/common/random-actions/random-actions.js +0 -20
  87. package/dist/collection/components/common/selfie-capture/selfie-capture.css +0 -7
  88. package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +0 -7
  89. package/dist/collection/components/controls/camera/camera.css +0 -47
  90. package/dist/collection/components/controls/camera/camera.js +0 -289
  91. package/dist/collection/components/controls/loader-dots/loader-dots.css +0 -61
  92. package/dist/collection/components/controls/loader-dots/loader-dots.js +0 -18
  93. package/dist/collection/components/flow/agreement-info/agreement-info.css +0 -0
  94. package/dist/collection/components/flow/agreement-info/agreement-info.js +0 -106
  95. package/dist/collection/components/flow/end-redirect/end-redirect.css +0 -128
  96. package/dist/collection/components/flow/end-redirect/end-redirect.js +0 -44
  97. package/dist/collection/components/flow/error-end/error-end.css +0 -0
  98. package/dist/collection/components/flow/error-end/error-end.js +0 -61
  99. package/dist/collection/components/flow/landing-validation/landing-validation.css +0 -0
  100. package/dist/collection/components/flow/landing-validation/landing-validation.js +0 -122
  101. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.css +0 -10
  102. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +0 -144
  103. package/dist/collection/components/flow/process-id/process-id.css +0 -0
  104. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.css +0 -0
  105. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +0 -140
  106. package/dist/collection/components/flow/user-liveness/user-liveness.css +0 -0
  107. package/dist/collection/components/identification-component/identification-component.css +0 -991
  108. package/dist/collection/components/identification-component/identification-component.js +0 -387
  109. package/dist/collection/global.js +0 -0
  110. package/dist/collection/helpers/ApiCall.js +0 -223
  111. package/dist/collection/helpers/DeviceDetection.js +0 -85
  112. package/dist/collection/helpers/Events.js +0 -58
  113. package/dist/collection/helpers/ML5.js +0 -38
  114. package/dist/collection/helpers/Stream.js +0 -229
  115. package/dist/collection/helpers/canvas.js +0 -10
  116. package/dist/collection/helpers/index.js +0 -21
  117. package/dist/collection/helpers/security.js +0 -25
  118. package/dist/collection/helpers/store.js +0 -47
  119. package/dist/collection/helpers/textValues.js +0 -145
  120. package/dist/collection/index.js +0 -1
  121. package/dist/collection/libs/FaceML5Detector/FaceML5Detector.js +0 -182
  122. package/dist/collection/libs/FaceML5Detector/FacePose.js +0 -85
  123. package/dist/collection/libs/IDML5Detector/IDML5Detector.js +0 -99
  124. package/dist/collection/models/FlowStatus.js +0 -14
  125. package/dist/collection/models/FlowSteps.js +0 -30
  126. package/dist/collection/models/IAbortResult.js +0 -1
  127. package/dist/collection/models/IAddRequest.js +0 -1
  128. package/dist/collection/models/IAgreement.js +0 -1
  129. package/dist/collection/models/ICamera.js +0 -1
  130. package/dist/collection/models/IEctStore.js +0 -1
  131. package/dist/collection/models/IGeneration.js +0 -1
  132. package/dist/collection/models/ILinkSend.js +0 -1
  133. package/dist/collection/models/ILogResult.js +0 -1
  134. package/dist/collection/models/IOrderStatus.js +0 -1
  135. package/dist/collection/models/IOtpCheck.js +0 -1
  136. package/dist/collection/models/IOtpSend.js +0 -1
  137. package/dist/collection/models/IUploadFile.js +0 -1
  138. package/dist/collection/models/IVerificationMode.js +0 -5
  139. package/dist/collection/models/OrderStatuses.js +0 -8
  140. package/dist/esm/agreement-check_19.entry.js +0 -9948
  141. package/dist/esm/index-cf54a432.js +0 -1543
  142. package/dist/esm/index.js +0 -1
  143. package/dist/esm/loader.js +0 -18
  144. package/dist/esm/polyfills/core-js.js +0 -11
  145. package/dist/esm/polyfills/css-shim.js +0 -1
  146. package/dist/esm/polyfills/dom.js +0 -79
  147. package/dist/esm/polyfills/es5-html-element.js +0 -1
  148. package/dist/esm/polyfills/index.js +0 -34
  149. package/dist/esm/polyfills/system.js +0 -6
  150. package/dist/esm/qbs-ect-cmp.js +0 -18
  151. package/dist/index.cjs.js +0 -1
  152. package/dist/index.js +0 -1
  153. package/dist/loader/cdn.js +0 -3
  154. package/dist/loader/index.cjs.js +0 -3
  155. package/dist/loader/index.d.ts +0 -21
  156. package/dist/loader/index.es2017.js +0 -3
  157. package/dist/loader/index.js +0 -4
  158. package/dist/loader/package.json +0 -11
  159. package/dist/qbs-ect-cmp/p-054dc5b3.entry.js +0 -1
  160. package/dist/qbs-ect-cmp/p-0b381be5.js +0 -1
  161. package/dist/qbs-ect-cmp/p-40480abb.entry.js +0 -1373
  162. package/dist/qbs-ect-cmp/p-6be3b9ca.entry.js +0 -1
  163. package/dist/qbs-ect-cmp/p-8942656c.js +0 -2
@@ -1,44 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import { CompleteValues } from '../../../helpers/textValues';
3
- // @ts-ignore
4
- import completeImg from '../../../assets/complete.svg';
5
- import store from '../../../helpers/store';
6
- import Events from '../../../helpers/Events';
7
- export class EndRedirect {
8
- constructor() { }
9
- async componentDidLoad() {
10
- Events.flowCompleted();
11
- }
12
- render() {
13
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, CompleteValues.Title), h("p", { class: "main-text font-size-18 mt-8 text-center" }, CompleteValues.Description)), h("div", { class: "buletin-container" }, h("div", { class: "container-coin" }, h("div", { class: "coin-scale" }, h("div", { class: "coin-flip" }, h("img", { class: "w-40 coin", src: completeImg }))))), h("div", { class: "text-center" }, h("p", { class: "font-weight-900 font-size-3 color-black-2 text-center mt-20" }, CompleteValues.Message), h("p", null, store.requestId)), h("div", { class: "btn-buletin" }, h("p", { class: "main-text font-size-18 text-center mb-0" }, CompleteValues.FooterText)))));
14
- }
15
- static get is() { return "end-redirect"; }
16
- static get originalStyleUrls() {
17
- return {
18
- "$": ["end-redirect.css"]
19
- };
20
- }
21
- static get styleUrls() {
22
- return {
23
- "$": ["end-redirect.css"]
24
- };
25
- }
26
- static get events() {
27
- return [{
28
- "method": "apiErrorEvent",
29
- "name": "apiError",
30
- "bubbles": true,
31
- "cancelable": true,
32
- "composed": true,
33
- "docs": {
34
- "tags": [],
35
- "text": ""
36
- },
37
- "complexType": {
38
- "original": "any",
39
- "resolved": "any",
40
- "references": {}
41
- }
42
- }];
43
- }
44
- }
@@ -1,61 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import store from '../../../helpers/store';
3
- export class ErrorEnd {
4
- constructor() {
5
- this.message = undefined;
6
- this.errorTitle = undefined;
7
- }
8
- componentDidLoad() { }
9
- render() {
10
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "text-center" }, h("h1", null, this.errorTitle)), h("div", { class: "text-center" }, h("p", null, store.requestId)), h("div", null, h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
11
- }
12
- static get is() { return "error-end"; }
13
- static get originalStyleUrls() {
14
- return {
15
- "$": ["error-end.css"]
16
- };
17
- }
18
- static get styleUrls() {
19
- return {
20
- "$": ["error-end.css"]
21
- };
22
- }
23
- static get properties() {
24
- return {
25
- "message": {
26
- "type": "string",
27
- "mutable": false,
28
- "complexType": {
29
- "original": "string",
30
- "resolved": "string",
31
- "references": {}
32
- },
33
- "required": false,
34
- "optional": false,
35
- "docs": {
36
- "tags": [],
37
- "text": ""
38
- },
39
- "attribute": "message",
40
- "reflect": false
41
- },
42
- "errorTitle": {
43
- "type": "string",
44
- "mutable": false,
45
- "complexType": {
46
- "original": "string",
47
- "resolved": "string",
48
- "references": {}
49
- },
50
- "required": false,
51
- "optional": false,
52
- "docs": {
53
- "tags": [],
54
- "text": ""
55
- },
56
- "attribute": "error-title",
57
- "reflect": false
58
- }
59
- };
60
- }
61
- }
@@ -1,122 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import { LandingValues, SessionKeys } from '../../../helpers/textValues';
3
- import store from '../../../helpers/store';
4
- import Events from '../../../helpers/Events';
5
- import { FlowStatus } from '../../../models/FlowStatus';
6
- import { ApiCall } from '../../../helpers/ApiCall';
7
- import { FlowSteps } from '../../../models/FlowSteps';
8
- import { Cameras } from '../../../helpers/Cameras';
9
- import { BaseComponent } from '../../base-component';
10
- import { MobileOS } from '../../../models/IDevice';
11
- // @ts-ignore
12
- import info from '../../../assets/landing/info.svg';
13
- // @ts-ignore
14
- import idSvg from '../../../assets/landing/id.svg';
15
- // @ts-ignore
16
- import idValidation from '../../../assets/landing/validation.svg';
17
- // @ts-ignore
18
- import idDevice from '../../../assets/landing/device.svg';
19
- export class LandingValidation {
20
- constructor() {
21
- this.warningText = undefined;
22
- this.buttonDisabled = undefined;
23
- this.baseComponent = new BaseComponent(FlowSteps.Landing);
24
- this.baseComponent.setEventEmitter(this.apiErrorEvent);
25
- }
26
- async componentWillLoad() {
27
- Events.flowStarted();
28
- this.baseComponent.apiCall = new ApiCall();
29
- this.buttonDisabled = false;
30
- await this.initRequest();
31
- }
32
- async componentDidLoad() {
33
- if (store.environment !== 'DEMO') {
34
- await this.baseComponent.initialize();
35
- }
36
- }
37
- async initRequest() {
38
- if (store.hasIdBack) {
39
- this.warningText = LandingValues.WarningMd;
40
- }
41
- else {
42
- this.warningText = LandingValues.Warning;
43
- }
44
- }
45
- async startFlow() {
46
- if (store.initialised) {
47
- this.buttonDisabled = true;
48
- if (store.environment === 'DEMO') {
49
- store.flowStatus = FlowStatus.COMPLETE;
50
- return;
51
- }
52
- if (!(await Cameras.InitCameras(store.device))) {
53
- if (store.device.mobileOS == MobileOS.iOS)
54
- sessionStorage.setItem(SessionKeys.RefreshDoneKey, 'false');
55
- store.flowStatus = FlowStatus.CAMERAERROR;
56
- }
57
- else if (store.agreementsValidation) {
58
- store.flowStatus = FlowStatus.AGREEMENT;
59
- }
60
- else if (store.phoneValidation) {
61
- store.flowStatus = FlowStatus.PHONE;
62
- }
63
- else {
64
- store.flowStatus = FlowStatus.ID;
65
- }
66
- }
67
- }
68
- async disconnectedCallback() {
69
- await this.baseComponent.finalize();
70
- }
71
- async leaveFlow() {
72
- if (this.buttonDisabled)
73
- return;
74
- store.initialised = false;
75
- try {
76
- await this.baseComponent.apiCall.AbortRequest();
77
- Events.flowAborted();
78
- }
79
- catch (e) {
80
- Events.flowAborted();
81
- this.apiErrorEvent.emit(e);
82
- }
83
- }
84
- render() {
85
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: info })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !store.initialised || this.buttonDisabled, onClick: () => this.startFlow() }, LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
86
- }
87
- static get is() { return "landing-validation"; }
88
- static get originalStyleUrls() {
89
- return {
90
- "$": ["landing-validation.css"]
91
- };
92
- }
93
- static get styleUrls() {
94
- return {
95
- "$": ["landing-validation.css"]
96
- };
97
- }
98
- static get states() {
99
- return {
100
- "warningText": {},
101
- "buttonDisabled": {}
102
- };
103
- }
104
- static get events() {
105
- return [{
106
- "method": "apiErrorEvent",
107
- "name": "apiError",
108
- "bubbles": true,
109
- "cancelable": true,
110
- "composed": true,
111
- "docs": {
112
- "tags": [],
113
- "text": ""
114
- },
115
- "complexType": {
116
- "original": "any",
117
- "resolved": "any",
118
- "references": {}
119
- }
120
- }];
121
- }
122
- }
@@ -1,10 +0,0 @@
1
- .qr-canvas {
2
- max-height: 60vh;
3
- max-width: 80vw;
4
- text-align: center;
5
- }
6
-
7
- .qr-canvas > canvas {
8
- width: 100%;
9
- height: 100%;
10
- }
@@ -1,144 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import { MobileRedirectValues } from '../../../helpers/textValues';
3
- import QRCode from 'qrcode';
4
- import store from '../../../helpers/store';
5
- import Events from '../../../helpers/Events';
6
- import { OrderStatuses } from '../../../models/OrderStatuses';
7
- import { FlowStatus } from '../../../models/FlowStatus';
8
- import { FlowSteps } from '../../../models/FlowSteps';
9
- import { delay } from '../../../utils/utils';
10
- import { BaseComponent } from '../../base-component';
11
- export class MobileRedirect {
12
- constructor() {
13
- this.infoTextTop = undefined;
14
- this.infoTextBottom = undefined;
15
- this.contact = undefined;
16
- this.invalidValue = undefined;
17
- this.waitingMobile = undefined;
18
- this.orderStatus = undefined;
19
- this.redirectLink = undefined;
20
- this.qrCode = undefined;
21
- this.prefilledPhone = false;
22
- this.baseComponent = new BaseComponent(FlowSteps.MobileRedirect);
23
- this.baseComponent.setEventEmitter(this.apiErrorEvent);
24
- this.invalidValue = false;
25
- this.waitingMobile = false;
26
- }
27
- async componentWillLoad() {
28
- Events.flowStarted();
29
- this.infoTextTop = MobileRedirectValues.InfoTop;
30
- this.infoTextBottom = MobileRedirectValues.InfoBottom;
31
- let envUri = store.environment == 'QA' ? 'test' : 'ect';
32
- let baseUri = store.hasIdBack ? 'https://onmd.id-kyc.com/' : 'https://onro.id-kyc.com/';
33
- this.redirectLink = baseUri + envUri + '/mobileredirect?redirectId=' + store.redirectId;
34
- if (store.phoneNumber && store.phoneNumber != '') {
35
- this.contact = store.phoneNumber;
36
- this.prefilledPhone = true;
37
- }
38
- var self = this;
39
- QRCode.toDataURL(this.redirectLink, { type: 'image/png', errorCorrectionLevel: 'M', scale: 6 }, function (error, url) {
40
- if (error)
41
- console.error(error);
42
- self.qrCode = url;
43
- });
44
- }
45
- async componentDidLoad() {
46
- await this.baseComponent.initialize();
47
- await delay(5000);
48
- await this.checkStatus();
49
- while (this.orderStatus == OrderStatuses.Capturing || this.orderStatus == OrderStatuses.Waiting) {
50
- await this.checkStatus();
51
- await delay(5000);
52
- }
53
- }
54
- async checkStatus() {
55
- this.orderStatus = await this.baseComponent.apiCall.GetStatus(store.requestId);
56
- if (this.orderStatus == OrderStatuses.FinishedCapturing) {
57
- this.waitingMobile = false;
58
- store.flowStatus = FlowStatus.COMPLETE;
59
- }
60
- if (this.orderStatus == OrderStatuses.NotFound) {
61
- this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
62
- }
63
- if (this.orderStatus == OrderStatuses.Capturing) {
64
- this.infoTextTop = MobileRedirectValues.InfoWaiting;
65
- this.waitingMobile = true;
66
- }
67
- if (this.orderStatus == OrderStatuses.Aborted) {
68
- this.waitingMobile = false;
69
- this.infoTextTop = MobileRedirectValues.InfoAborted;
70
- Events.flowAborted();
71
- }
72
- }
73
- async disconnectedCallback() {
74
- await this.baseComponent.finalize();
75
- }
76
- async buttonClick() {
77
- if (this.contact == '' || this.contact.length != 10) {
78
- this.invalidValue == true;
79
- return;
80
- }
81
- this.waitingMobile = true;
82
- this.infoTextTop = MobileRedirectValues.InfoWaiting;
83
- try {
84
- await this.baseComponent.apiCall.SendLink(this.redirectLink, this.contact);
85
- }
86
- catch (e) {
87
- this.apiErrorEvent.emit(e);
88
- }
89
- }
90
- handleChangeContact(ev) {
91
- let value = ev.target ? ev.target.value : '';
92
- this.contact = value.replace(/\D/g, '');
93
- if (this.contact.length > 10) {
94
- this.contact = this.contact.substring(0, 10);
95
- }
96
- this.invalidValue = this.contact.length != 10;
97
- ev.target.value = this.contact;
98
- }
99
- render() {
100
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), h("p", { class: "main-text font-size-18 text-right mb-0" }, MobileRedirectValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
101
- }
102
- static get is() { return "mobile-redirect"; }
103
- static get originalStyleUrls() {
104
- return {
105
- "$": ["mobile-redirect.css"]
106
- };
107
- }
108
- static get styleUrls() {
109
- return {
110
- "$": ["mobile-redirect.css"]
111
- };
112
- }
113
- static get states() {
114
- return {
115
- "infoTextTop": {},
116
- "infoTextBottom": {},
117
- "contact": {},
118
- "invalidValue": {},
119
- "waitingMobile": {},
120
- "orderStatus": {},
121
- "redirectLink": {},
122
- "qrCode": {},
123
- "prefilledPhone": {}
124
- };
125
- }
126
- static get events() {
127
- return [{
128
- "method": "apiErrorEvent",
129
- "name": "apiError",
130
- "bubbles": true,
131
- "cancelable": true,
132
- "composed": true,
133
- "docs": {
134
- "tags": [],
135
- "text": ""
136
- },
137
- "complexType": {
138
- "original": "any",
139
- "resolved": "any",
140
- "references": {}
141
- }
142
- }];
143
- }
144
- }
@@ -1,140 +0,0 @@
1
- import { h } from '@stencil/core';
2
- import store from '../../../helpers/store';
3
- import { PhoneValidationValues, CodeValidationValues } from '../../../helpers/textValues';
4
- import { FlowStatus } from '../../../models/FlowStatus';
5
- import { FlowSteps } from '../../../models/FlowSteps';
6
- import { BaseComponent } from '../../base-component';
7
- export class SmsCodeValidation {
8
- constructor() {
9
- this.title = undefined;
10
- this.details = undefined;
11
- this.buttonText = undefined;
12
- this.phoneNumber = undefined;
13
- this.code = undefined;
14
- this.prefilledPhone = false;
15
- this.canSend = false;
16
- if (store.flowStatus == FlowStatus.PHONE) {
17
- this.baseComponent = new BaseComponent(FlowSteps.OtpSend);
18
- }
19
- if (store.flowStatus == FlowStatus.CODE) {
20
- this.baseComponent = new BaseComponent(FlowSteps.OtpCheck);
21
- }
22
- this.baseComponent.setEventEmitter(this.apiErrorEvent);
23
- }
24
- async doAction() {
25
- try {
26
- this.canSend = false;
27
- if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
28
- var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(store.requestId, this.code);
29
- if (codeChecked === true) {
30
- store.flowStatus = FlowStatus.ID;
31
- }
32
- else {
33
- store.flowStatus = FlowStatus.CODEERROR;
34
- }
35
- }
36
- if (store.flowStatus == FlowStatus.PHONE) {
37
- var codeSent = await this.baseComponent.apiCall.SendOTPCode(store.requestId, this.phoneNumber);
38
- if (codeSent === true) {
39
- store.flowStatus = FlowStatus.CODE;
40
- }
41
- }
42
- }
43
- catch (e) {
44
- this.apiErrorEvent.emit(e);
45
- }
46
- }
47
- async disconnectedCallback() {
48
- await this.baseComponent.finalize();
49
- }
50
- componentWillRender() {
51
- if (store.flowStatus == FlowStatus.PHONE) {
52
- this.title = PhoneValidationValues.Title;
53
- this.details = PhoneValidationValues.Description;
54
- this.buttonText = PhoneValidationValues.Button;
55
- if (store.phoneNumber && store.phoneNumber != '') {
56
- this.phoneNumber = store.phoneNumber;
57
- this.prefilledPhone = true;
58
- this.canSend = true;
59
- }
60
- }
61
- if (store.flowStatus == FlowStatus.CODE || store.flowStatus == FlowStatus.CODEERROR) {
62
- this.title = CodeValidationValues.Title;
63
- this.details = CodeValidationValues.Description;
64
- this.buttonText = CodeValidationValues.Button;
65
- }
66
- }
67
- async componentDidLoad() {
68
- await this.baseComponent.initialize();
69
- }
70
- handleChangePhone(ev) {
71
- let value = ev.target ? ev.target.value : '';
72
- this.phoneNumber = value.replace(/\D/g, '');
73
- if (this.phoneNumber.length > 10)
74
- this.phoneNumber = this.phoneNumber.substring(0, 10);
75
- this.canSend = this.phoneNumber.length == 10;
76
- ev.target.value = this.phoneNumber;
77
- }
78
- handleChangeCode(ev) {
79
- let value = ev.target ? ev.target.value : '';
80
- this.code = value;
81
- if (this.code.length > 4)
82
- this.code = this.code.substring(0, 4);
83
- this.canSend = this.code.length == 4;
84
- ev.target.value = this.code;
85
- }
86
- render() {
87
- let inputBlock;
88
- let errorBlock;
89
- if (store.flowStatus == FlowStatus.CODEERROR) {
90
- errorBlock = h("p", { class: "main-text font-size-18 mt-15 color-red text-center" }, CodeValidationValues.Error);
91
- }
92
- if (store.flowStatus == FlowStatus.PHONE) {
93
- inputBlock = (h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1" }, h("b", null, PhoneValidationValues.Label)), h("input", { type: "tel", id: "phoneInput", class: "main-input", disabled: this.prefilledPhone, onInput: ev => this.handleChangePhone(ev), value: this.phoneNumber })));
94
- }
95
- else {
96
- inputBlock = (h("div", { class: "input-container mb-15" }, h("input", { type: "text", id: "codeInput", class: "main-input", onInput: ev => this.handleChangeCode(ev), value: this.code })));
97
- }
98
- return (h("div", { class: "container" }, h("div", { class: "row row-validare" }, h("div", null, h("h1", { class: "text-center" }, this.title), errorBlock == null ? h("p", { class: "main-text font-size-2 mt-15 mb-20 text-center" }, this.details) : errorBlock), inputBlock, h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { id: "action", disabled: !this.canSend, class: "main-button", onClick: () => this.doAction() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, PhoneValidationValues.FooterText))))));
99
- }
100
- static get is() { return "sms-code-validation"; }
101
- static get originalStyleUrls() {
102
- return {
103
- "$": ["sms-code-validation.css"]
104
- };
105
- }
106
- static get styleUrls() {
107
- return {
108
- "$": ["sms-code-validation.css"]
109
- };
110
- }
111
- static get states() {
112
- return {
113
- "title": {},
114
- "details": {},
115
- "buttonText": {},
116
- "phoneNumber": {},
117
- "code": {},
118
- "prefilledPhone": {},
119
- "canSend": {}
120
- };
121
- }
122
- static get events() {
123
- return [{
124
- "method": "apiErrorEvent",
125
- "name": "apiError",
126
- "bubbles": true,
127
- "cancelable": true,
128
- "composed": true,
129
- "docs": {
130
- "tags": [],
131
- "text": ""
132
- },
133
- "complexType": {
134
- "original": "any",
135
- "resolved": "any",
136
- "references": {}
137
- }
138
- }];
139
- }
140
- }