@ekyc_qoobiss/qbs-ect-cmp 3.6.27 → 3.6.29

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 (168) hide show
  1. package/dist/cjs/TranslationUtils-b918ffb1.js +346 -0
  2. package/dist/cjs/agreement-check_19.cjs.entry.js +9997 -0
  3. package/dist/cjs/index-41696e0e.js +1573 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader-dots.cjs.entry.js +19 -0
  6. package/dist/cjs/loader.cjs.js +22 -0
  7. package/dist/cjs/qbs-ect-cmp.cjs.js +23 -0
  8. package/dist/cjs/random-actions.cjs.entry.js +22 -0
  9. package/dist/collection/assets/canvas-masks/face_green.svg +8 -0
  10. package/dist/collection/assets/canvas-masks/face_white.svg +8 -0
  11. package/dist/collection/assets/canvas-masks/id_green.svg +6 -0
  12. package/dist/collection/assets/canvas-masks/id_white.svg +6 -0
  13. package/dist/collection/assets/complete.svg +4 -0
  14. package/dist/collection/assets/landing/device.svg +14 -0
  15. package/dist/collection/assets/landing/id.svg +3 -0
  16. package/dist/collection/assets/landing/info.svg +3 -0
  17. package/dist/collection/assets/landing/validation.svg +16 -0
  18. package/dist/collection/assets/loader.svg +29 -0
  19. package/dist/collection/collection-manifest.json +32 -0
  20. package/dist/collection/components/base-component.js +59 -0
  21. package/dist/collection/components/common/agreement-check/agreement-check.css +0 -0
  22. package/dist/collection/components/common/agreement-check/agreement-check.js +108 -0
  23. package/dist/collection/components/common/camera-error/camera-error.css +0 -0
  24. package/dist/collection/components/common/camera-error/camera-error.js +93 -0
  25. package/dist/collection/components/common/capture-error/capture-error.css +0 -0
  26. package/dist/collection/components/common/capture-error/capture-error.js +102 -0
  27. package/dist/collection/components/common/how-to-info/how-to-info.css +0 -0
  28. package/dist/collection/components/common/how-to-info/how-to-info.js +123 -0
  29. package/dist/collection/components/common/id-back-capture/id-back-capture.css +35 -0
  30. package/dist/{qbs-ect-cmp/id-back-capture.entry.js → collection/components/common/id-back-capture/id-back-capture.js} +102 -30
  31. package/dist/collection/components/common/id-capture/id-capture.css +35 -0
  32. package/dist/{qbs-ect-cmp/id-capture.entry.js → collection/components/common/id-capture/id-capture.js} +100 -28
  33. package/dist/collection/components/common/id-tilt/id-tilt.css +35 -0
  34. package/dist/{qbs-ect-cmp/id-tilt.entry.js → collection/components/common/id-tilt/id-tilt.js} +100 -28
  35. package/dist/collection/components/common/random-actions/random-actions.css +0 -0
  36. package/dist/collection/components/common/random-actions/random-actions.js +23 -0
  37. package/dist/collection/components/common/selfie-capture/selfie-capture.css +7 -0
  38. package/dist/{qbs-ect-cmp/selfie-capture.entry.js → collection/components/common/selfie-capture/selfie-capture.js} +102 -29
  39. package/dist/collection/components/common/selfie-tilt/selfie-tilt.css +7 -0
  40. package/dist/{qbs-ect-cmp/selfie-tilt.entry.js → collection/components/common/selfie-tilt/selfie-tilt.js} +103 -30
  41. package/dist/collection/components/controls/camera/camera.css +47 -0
  42. package/dist/collection/components/controls/camera/camera.js +289 -0
  43. package/dist/collection/components/controls/loader-dots/loader-dots.css +61 -0
  44. package/dist/collection/components/controls/loader-dots/loader-dots.js +18 -0
  45. package/dist/collection/components/flow/agreement-info/agreement-info.css +0 -0
  46. package/dist/collection/components/flow/agreement-info/agreement-info.js +107 -0
  47. package/dist/collection/components/flow/end-redirect/end-redirect.css +128 -0
  48. package/dist/collection/components/flow/end-redirect/end-redirect.js +48 -0
  49. package/dist/collection/components/flow/error-end/error-end.css +0 -0
  50. package/dist/collection/components/flow/error-end/error-end.js +61 -0
  51. package/dist/collection/components/flow/landing-validation/landing-validation.css +0 -0
  52. package/dist/collection/components/flow/landing-validation/landing-validation.js +124 -0
  53. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.css +10 -0
  54. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +145 -0
  55. package/dist/collection/components/flow/process-id/process-id.css +0 -0
  56. package/dist/{qbs-ect-cmp/process-id.entry.js → collection/components/flow/process-id/process-id.js} +100 -32
  57. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.css +0 -0
  58. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +141 -0
  59. package/dist/collection/components/flow/user-liveness/user-liveness.css +0 -0
  60. package/dist/{qbs-ect-cmp/user-liveness.entry.js → collection/components/flow/user-liveness/user-liveness.js} +91 -25
  61. package/dist/collection/components/identification-component/identification-component.css +991 -0
  62. package/dist/collection/components/identification-component/identification-component.js +408 -0
  63. package/dist/collection/global.js +0 -0
  64. package/dist/collection/helpers/ApiCall.js +223 -0
  65. package/dist/{qbs-ect-cmp/Cameras-dfbebc29.js → collection/helpers/Cameras.js} +6 -9
  66. package/dist/collection/helpers/DeviceDetection.js +85 -0
  67. package/dist/collection/helpers/Events.js +58 -0
  68. package/dist/collection/helpers/ML5.js +38 -0
  69. package/dist/collection/helpers/Stream.js +229 -0
  70. package/dist/collection/helpers/TranslationUtils.js +37 -0
  71. package/dist/collection/helpers/canvas.js +10 -0
  72. package/dist/collection/helpers/index.js +21 -0
  73. package/dist/collection/helpers/security.js +25 -0
  74. package/dist/collection/helpers/store.js +48 -0
  75. package/dist/collection/helpers/textValues.js +48 -0
  76. package/dist/collection/index.js +1 -0
  77. package/dist/collection/libs/FaceML5Detector/FaceML5Detector.js +182 -0
  78. package/dist/collection/libs/FaceML5Detector/FacePose.js +85 -0
  79. package/dist/collection/libs/IDML5Detector/IDML5Detector.js +99 -0
  80. package/dist/{qbs-ect-cmp/IDPose-181bcb25.js → collection/libs/IDML5Detector/IDPose.js} +2 -4
  81. package/dist/{qbs-ect-cmp/CaptureFlow-db5d90a4.js → collection/models/CaptureFlow.js} +4 -6
  82. package/dist/collection/models/FlowStatus.js +14 -0
  83. package/dist/collection/models/FlowSteps.js +30 -0
  84. package/dist/collection/models/IAbortResult.js +1 -0
  85. package/dist/collection/models/IAddRequest.js +1 -0
  86. package/dist/collection/models/IAgreement.js +1 -0
  87. package/dist/collection/models/ICamera.js +1 -0
  88. package/dist/{qbs-ect-cmp/IDevice-15ecfdeb.js → collection/models/IDevice.js} +4 -6
  89. package/dist/collection/models/IEctStore.js +1 -0
  90. package/dist/collection/models/IGeneration.js +1 -0
  91. package/dist/collection/models/ILinkSend.js +1 -0
  92. package/dist/collection/models/ILogResult.js +1 -0
  93. package/dist/collection/models/IOrderStatus.js +1 -0
  94. package/dist/collection/models/IOtpCheck.js +1 -0
  95. package/dist/collection/models/IOtpSend.js +1 -0
  96. package/dist/collection/models/ITranslationValues.js +1 -0
  97. package/dist/collection/models/IUploadFile.js +1 -0
  98. package/dist/collection/models/IVerificationMode.js +5 -0
  99. package/dist/collection/models/OrderStatuses.js +8 -0
  100. package/dist/{qbs-ect-cmp/utils-8225f0b7.js → collection/utils/utils.js} +8 -10
  101. package/dist/{qbs-ect-cmp/textValues-6bcc85dd.js → esm/TranslationUtils-8ceeb437.js} +84 -47
  102. package/dist/esm/agreement-check_19.entry.js +9975 -0
  103. package/dist/esm/index-cf54a432.js +1543 -0
  104. package/dist/esm/index.js +1 -0
  105. package/dist/{qbs-ect-cmp → esm}/loader-dots.entry.js +1 -1
  106. package/dist/esm/loader.js +18 -0
  107. package/dist/esm/polyfills/core-js.js +11 -0
  108. package/dist/esm/polyfills/css-shim.js +1 -0
  109. package/dist/esm/polyfills/dom.js +79 -0
  110. package/dist/esm/polyfills/es5-html-element.js +1 -0
  111. package/dist/esm/polyfills/index.js +34 -0
  112. package/dist/esm/polyfills/system.js +6 -0
  113. package/dist/esm/qbs-ect-cmp.js +18 -0
  114. package/dist/{qbs-ect-cmp → esm}/random-actions.entry.js +6 -9
  115. package/dist/index.cjs.js +1 -0
  116. package/dist/index.js +1 -0
  117. package/dist/loader/cdn.js +3 -0
  118. package/dist/loader/index.cjs.js +3 -0
  119. package/dist/loader/index.d.ts +21 -0
  120. package/dist/loader/index.es2017.js +3 -0
  121. package/dist/loader/index.js +4 -0
  122. package/dist/loader/package.json +11 -0
  123. package/dist/qbs-ect-cmp/index.esm.js +0 -1
  124. package/dist/qbs-ect-cmp/p-054dc5b3.entry.js +1 -0
  125. package/dist/qbs-ect-cmp/p-473a4636.entry.js +1 -0
  126. package/dist/qbs-ect-cmp/p-8942656c.js +2 -0
  127. package/dist/qbs-ect-cmp/p-b2c9c8d7.entry.js +1373 -0
  128. package/dist/qbs-ect-cmp/p-e568a07c.js +1 -0
  129. package/dist/qbs-ect-cmp/qbs-ect-cmp.css +1 -320
  130. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -148
  131. package/dist/types/components/base-component.d.ts +0 -2
  132. package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
  133. package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
  134. package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
  135. package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
  136. package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
  137. package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
  138. package/dist/types/components/common/id-tilt/id-tilt.d.ts +1 -0
  139. package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
  140. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
  141. package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
  142. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
  143. package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
  144. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
  145. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
  146. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
  147. package/package.json +1 -1
  148. package/dist/qbs-ect-cmp/ML5-657ef934.js +0 -1370
  149. package/dist/qbs-ect-cmp/Stream-b867a2be.js +0 -3104
  150. package/dist/qbs-ect-cmp/_commonjsHelpers-321aa363.js +0 -44
  151. package/dist/qbs-ect-cmp/agreement-check.entry.js +0 -41
  152. package/dist/qbs-ect-cmp/agreement-info.entry.js +0 -66
  153. package/dist/qbs-ect-cmp/app-globals-0f993ce5.js +0 -3
  154. package/dist/qbs-ect-cmp/base-component-2e490fd9.js +0 -502
  155. package/dist/qbs-ect-cmp/camera-comp.entry.js +0 -103
  156. package/dist/qbs-ect-cmp/camera-error.entry.js +0 -59
  157. package/dist/qbs-ect-cmp/capture-error.entry.js +0 -53
  158. package/dist/qbs-ect-cmp/css-shim-b7d3d95f.js +0 -4
  159. package/dist/qbs-ect-cmp/dom-64053c71.js +0 -73
  160. package/dist/qbs-ect-cmp/end-redirect.entry.js +0 -25
  161. package/dist/qbs-ect-cmp/error-end.entry.js +0 -19
  162. package/dist/qbs-ect-cmp/how-to-info.entry.js +0 -52
  163. package/dist/qbs-ect-cmp/identification-component.entry.js +0 -909
  164. package/dist/qbs-ect-cmp/index-78a05b9e.js +0 -3371
  165. package/dist/qbs-ect-cmp/landing-validation.entry.js +0 -90
  166. package/dist/qbs-ect-cmp/mobile-redirect.entry.js +0 -2984
  167. package/dist/qbs-ect-cmp/shadow-css-98135883.js +0 -387
  168. package/dist/qbs-ect-cmp/sms-code-validation.entry.js +0 -106
@@ -1,22 +1,20 @@
1
- import { r as registerInstance, e as createEvent, h, i as getElement } from './index-78a05b9e.js';
2
- import { C as Cameras } from './Cameras-dfbebc29.js';
3
- import { S as Stream, V as VerificationMode, I as IDML5Detector, F as FaceML5Detector } from './Stream-b867a2be.js';
4
- import { I as IdCaptureValues, s as state } from './textValues-6bcc85dd.js';
5
- import { I as IDPose } from './IDPose-181bcb25.js';
6
- import { d as delay } from './utils-8225f0b7.js';
7
- import { B as BaseComponent, F as FlowSteps, a as FlowMoments } from './base-component-2e490fd9.js';
8
- import './IDevice-15ecfdeb.js';
9
- import './ML5-657ef934.js';
10
- import './_commonjsHelpers-321aa363.js';
11
-
12
- const idTiltCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
13
-
14
- const IdTilt = class {
1
+ import { h } from '@stencil/core';
2
+ import { Cameras } from '../../../helpers/Cameras';
3
+ import { Stream } from '../../../helpers/Stream';
4
+ import { IdCaptureValues } from '../../../helpers/textValues';
5
+ import { IDML5Detector } from '../../../libs/IDML5Detector/IDML5Detector';
6
+ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
7
+ import { IDPose } from '../../../libs/IDML5Detector/IDPose';
8
+ import { delay } from '../../../utils/utils';
9
+ import store from '../../../helpers/store';
10
+ import { BaseComponent } from '../../base-component';
11
+ import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
12
+ import { VerificationMode } from '../../../models/IVerificationMode';
13
+ import { Translations } from '../../../helpers/TranslationUtils';
14
+ // import { IDPose } from '../../libs/IDML5Detector/IDPose';
15
+ export class IdTilt {
15
16
  // @State() private animationPath: string;
16
- constructor(hostRef) {
17
- registerInstance(this, hostRef);
18
- this.eventPhotoCapture = createEvent(this, "photoTiltCapture", 7);
19
- this.apiErrorEvent = createEvent(this, "apiError", 7);
17
+ constructor() {
20
18
  this.photoIsReady = photos => {
21
19
  //this.closeCamera();
22
20
  this.eventPhotoCapture.emit(photos);
@@ -39,7 +37,8 @@ const IdTilt = class {
39
37
  this.cameraSize = event.detail;
40
38
  }
41
39
  async componentWillLoad() {
42
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.IDPoseMapping;
40
+ this.translations = await Translations.getValues();
41
+ this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
43
42
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
44
43
  if (!navigator.mediaDevices) {
45
44
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -49,12 +48,12 @@ const IdTilt = class {
49
48
  await this.baseComponent.logStep(FlowSteps.CiTilt, FlowMoments.Initialized);
50
49
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[IDPose.Tilted];
51
50
  this.demoVideo.play();
52
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
51
+ await delay(this.translations.GlobalValues.VideoLenght);
53
52
  this.showDemo = false;
54
53
  this.openCamera();
55
54
  }
56
55
  async openCamera() {
57
- const constraints = this.cameras.GetConstraints(state.cameraId, state.device);
56
+ const constraints = this.cameras.GetConstraints(store.cameraId, store.device);
58
57
  setTimeout(() => {
59
58
  navigator.mediaDevices
60
59
  .getUserMedia(constraints)
@@ -91,7 +90,7 @@ const IdTilt = class {
91
90
  if (this.verified)
92
91
  return;
93
92
  this.verified = true;
94
- this.titleMesage = this.baseComponent.translations.IdCaptureValues.Loading;
93
+ this.titleMesage = this.translations.IdCaptureValues.Loading;
95
94
  this.closeCamera();
96
95
  this.showDemo = true;
97
96
  this.demoVideo.src = 'https://ekyc.blob.core.windows.net/$web/animations/uploading_id.mp4';
@@ -113,10 +112,83 @@ const IdTilt = class {
113
112
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
114
113
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
115
114
  let bgDemo = this.verified ? 'container' : 'container bg-black';
116
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "tilt" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
115
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.showDemo == false }, h("video", { id: "howtoFront", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.showDemo }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("div", { style: cameraStyleInner }, h("camera-comp", { "capture-mode": "tilt" })))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
117
116
  }
118
- get component() { return getElement(this); }
119
- };
120
- IdTilt.style = idTiltCss;
121
-
122
- export { IdTilt as id_tilt };
117
+ static get is() { return "id-tilt"; }
118
+ static get originalStyleUrls() {
119
+ return {
120
+ "$": ["id-tilt.css"]
121
+ };
122
+ }
123
+ static get styleUrls() {
124
+ return {
125
+ "$": ["id-tilt.css"]
126
+ };
127
+ }
128
+ static get states() {
129
+ return {
130
+ "videoStarted": {},
131
+ "cameraSize": {},
132
+ "captureTaken": {},
133
+ "verified": {},
134
+ "titleMesage": {},
135
+ "showDemo": {},
136
+ "demoVideo": {}
137
+ };
138
+ }
139
+ static get events() {
140
+ return [{
141
+ "method": "eventPhotoCapture",
142
+ "name": "photoTiltCapture",
143
+ "bubbles": true,
144
+ "cancelable": true,
145
+ "composed": true,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "complexType": {
151
+ "original": "any",
152
+ "resolved": "any",
153
+ "references": {}
154
+ }
155
+ }, {
156
+ "method": "apiErrorEvent",
157
+ "name": "apiError",
158
+ "bubbles": true,
159
+ "cancelable": true,
160
+ "composed": true,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": ""
164
+ },
165
+ "complexType": {
166
+ "original": "any",
167
+ "resolved": "any",
168
+ "references": {}
169
+ }
170
+ }];
171
+ }
172
+ static get elementRef() { return "component"; }
173
+ static get listeners() {
174
+ return [{
175
+ "name": "videoStarted",
176
+ "method": "eventVideoStarted",
177
+ "target": undefined,
178
+ "capture": false,
179
+ "passive": false
180
+ }, {
181
+ "name": "takePhoto",
182
+ "method": "takePhoto",
183
+ "target": undefined,
184
+ "capture": false,
185
+ "passive": false
186
+ }, {
187
+ "name": "verificationFinished",
188
+ "method": "verificationFinished",
189
+ "target": undefined,
190
+ "capture": false,
191
+ "passive": false
192
+ }];
193
+ }
194
+ }
@@ -0,0 +1,23 @@
1
+ import { h } from '@stencil/core';
2
+ import { Translations } from '../../../helpers/TranslationUtils';
3
+ export class RandomActions {
4
+ constructor() { }
5
+ async componentWillLoad() {
6
+ this.translations = await Translations.getValues();
7
+ }
8
+ buttonClick() { }
9
+ render() {
10
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "text-center" }, h("h1", null, this.topTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
11
+ }
12
+ static get is() { return "random-actions"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["random-actions.css"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["random-actions.css"]
21
+ };
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ /* .cameraContainer {
2
+ width: 100%;
3
+ height: 100%;
4
+ z-index: 10;
5
+ position: relative;
6
+ overflow: hidden;
7
+ } */
@@ -1,21 +1,18 @@
1
- import { r as registerInstance, e as createEvent, h, i as getElement } from './index-78a05b9e.js';
2
- import { C as Cameras } from './Cameras-dfbebc29.js';
3
- import { a as FacePose, S as Stream, V as VerificationMode, F as FaceML5Detector } from './Stream-b867a2be.js';
4
- import { a as SelfieCaptureValues, s as state } from './textValues-6bcc85dd.js';
5
- import { d as delay } from './utils-8225f0b7.js';
6
- import { B as BaseComponent, F as FlowSteps, a as FlowMoments } from './base-component-2e490fd9.js';
7
- import './IDevice-15ecfdeb.js';
8
- import './ML5-657ef934.js';
9
- import './_commonjsHelpers-321aa363.js';
10
-
11
- const selfieCaptureCss = "";
12
-
13
- const SelfieCapture = class {
1
+ import { h } from '@stencil/core';
2
+ import { Cameras } from '../../../helpers/Cameras';
3
+ import { Stream } from '../../../helpers/Stream';
4
+ import { SelfieCaptureValues } from '../../../helpers/textValues';
5
+ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
6
+ import { FacePose } from '../../../libs/FaceML5Detector/FacePose';
7
+ import { delay } from '../../../utils/utils';
8
+ import store from '../../../helpers/store';
9
+ import { BaseComponent } from '../../base-component';
10
+ import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
11
+ import { VerificationMode } from '../../../models/IVerificationMode';
12
+ import { Translations } from '../../../helpers/TranslationUtils';
13
+ export class SelfieCapture {
14
14
  // @State() private animationPath: string;
15
- constructor(hostRef) {
16
- registerInstance(this, hostRef);
17
- this.eventPhotoCapture = createEvent(this, "photoSelfieCapture", 7);
18
- this.apiErrorEvent = createEvent(this, "apiError", 7);
15
+ constructor() {
19
16
  this.photoIsReady = photos => {
20
17
  //this.closeCamera();
21
18
  this.eventPhotoCapture.emit(photos);
@@ -43,8 +40,9 @@ const SelfieCapture = class {
43
40
  this.captureHeight = height - Math.round((window.screen.height - height) / 2);
44
41
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
45
42
  }
46
- componentWillLoad() {
47
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Title;
43
+ async componentWillLoad() {
44
+ this.translations = await Translations.getValues();
45
+ this.titleMesage = this.translations.SelfieCaptureValues.Title;
48
46
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
49
47
  if (!navigator.mediaDevices) {
50
48
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -54,12 +52,12 @@ const SelfieCapture = class {
54
52
  await this.baseComponent.logStep(FlowSteps.SelfieCapture, FlowMoments.Initialized);
55
53
  this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[FacePose.Main];
56
54
  this.demoVideo.play();
57
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
55
+ await delay(this.translations.GlobalValues.VideoLenght);
58
56
  this.demoEnded = true;
59
57
  this.openCamera();
60
58
  }
61
59
  async openCamera() {
62
- const constraints = this.cameras.GetConstraints('', state.device, true);
60
+ const constraints = this.cameras.GetConstraints('', store.device, true);
63
61
  setTimeout(() => {
64
62
  navigator.mediaDevices
65
63
  .getUserMedia(constraints)
@@ -95,7 +93,7 @@ const SelfieCapture = class {
95
93
  if (this.verified)
96
94
  return;
97
95
  this.verified = true;
98
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Loading;
96
+ this.titleMesage = this.translations.SelfieCaptureValues.Loading;
99
97
  this.closeCamera();
100
98
  this.demoEnded = false;
101
99
  this.demoVideo.src = this.uploadingLink;
@@ -104,7 +102,7 @@ const SelfieCapture = class {
104
102
  }
105
103
  render() {
106
104
  let cameraStyle;
107
- if (state.device.isMobile && this.videoStarted) {
105
+ if (store.device.isMobile && this.videoStarted) {
108
106
  cameraStyle = {
109
107
  'width': this.captureWidth + 'px',
110
108
  'height': this.captureHeight + 'px',
@@ -117,10 +115,85 @@ const SelfieCapture = class {
117
115
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
118
116
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
119
117
  let bgDemo = this.verified ? 'container' : 'container bg-black';
120
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
118
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
121
119
  }
122
- get component() { return getElement(this); }
123
- };
124
- SelfieCapture.style = selfieCaptureCss;
125
-
126
- export { SelfieCapture as selfie_capture };
120
+ static get is() { return "selfie-capture"; }
121
+ static get originalStyleUrls() {
122
+ return {
123
+ "$": ["selfie-capture.css"]
124
+ };
125
+ }
126
+ static get styleUrls() {
127
+ return {
128
+ "$": ["selfie-capture.css"]
129
+ };
130
+ }
131
+ static get states() {
132
+ return {
133
+ "videoStarted": {},
134
+ "captureTaken": {},
135
+ "verified": {},
136
+ "titleMesage": {},
137
+ "demoEnded": {},
138
+ "demoVideo": {},
139
+ "uploadingLink": {},
140
+ "captureHeight": {},
141
+ "captureWidth": {}
142
+ };
143
+ }
144
+ static get events() {
145
+ return [{
146
+ "method": "eventPhotoCapture",
147
+ "name": "photoSelfieCapture",
148
+ "bubbles": true,
149
+ "cancelable": true,
150
+ "composed": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": ""
154
+ },
155
+ "complexType": {
156
+ "original": "any",
157
+ "resolved": "any",
158
+ "references": {}
159
+ }
160
+ }, {
161
+ "method": "apiErrorEvent",
162
+ "name": "apiError",
163
+ "bubbles": true,
164
+ "cancelable": true,
165
+ "composed": true,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": ""
169
+ },
170
+ "complexType": {
171
+ "original": "any",
172
+ "resolved": "any",
173
+ "references": {}
174
+ }
175
+ }];
176
+ }
177
+ static get elementRef() { return "component"; }
178
+ static get listeners() {
179
+ return [{
180
+ "name": "videoStarted",
181
+ "method": "eventVideoStarted",
182
+ "target": undefined,
183
+ "capture": false,
184
+ "passive": false
185
+ }, {
186
+ "name": "takePhoto",
187
+ "method": "takePhoto",
188
+ "target": undefined,
189
+ "capture": false,
190
+ "passive": false
191
+ }, {
192
+ "name": "verificationFinished",
193
+ "method": "verificationFinished",
194
+ "target": undefined,
195
+ "capture": false,
196
+ "passive": false
197
+ }];
198
+ }
199
+ }
@@ -0,0 +1,7 @@
1
+ /* .cameraContainer {
2
+ width: 100%;
3
+ height: 100%;
4
+ z-index: 10;
5
+ position: relative;
6
+ overflow: hidden;
7
+ } */
@@ -1,21 +1,18 @@
1
- import { r as registerInstance, e as createEvent, h, i as getElement } from './index-78a05b9e.js';
2
- import { C as Cameras } from './Cameras-dfbebc29.js';
3
- import { S as Stream, V as VerificationMode, a as FacePose, F as FaceML5Detector } from './Stream-b867a2be.js';
4
- import { a as SelfieCaptureValues, s as state } from './textValues-6bcc85dd.js';
5
- import { d as delay } from './utils-8225f0b7.js';
6
- import { B as BaseComponent, F as FlowSteps, a as FlowMoments } from './base-component-2e490fd9.js';
7
- import './IDevice-15ecfdeb.js';
8
- import './ML5-657ef934.js';
9
- import './_commonjsHelpers-321aa363.js';
10
-
11
- const selfieTiltCss = "";
12
-
13
- const SelfieTilt = class {
1
+ import { h } from '@stencil/core';
2
+ import { Cameras } from '../../../helpers/Cameras';
3
+ import { Stream } from '../../../helpers/Stream';
4
+ import { SelfieCaptureValues } from '../../../helpers/textValues';
5
+ import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
6
+ import { delay } from '../../../utils/utils';
7
+ import store from '../../../helpers/store';
8
+ import { BaseComponent } from '../../base-component';
9
+ import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
10
+ import { VerificationMode } from '../../../models/IVerificationMode';
11
+ import { FacePose } from '../../../libs/FaceML5Detector/FacePose';
12
+ import { Translations } from '../../../helpers/TranslationUtils';
13
+ export class SelfieTilt {
14
14
  // @State() private animationPath: string;
15
- constructor(hostRef) {
16
- registerInstance(this, hostRef);
17
- this.eventPhotoCapture = createEvent(this, "photoSelfieTiltCapture", 7);
18
- this.apiErrorEvent = createEvent(this, "apiError", 7);
15
+ constructor() {
19
16
  this.photoIsReady = photos => {
20
17
  //this.closeCamera();
21
18
  this.eventPhotoCapture.emit(photos);
@@ -43,8 +40,9 @@ const SelfieTilt = class {
43
40
  this.captureHeight = height - Math.round((window.screen.height - height) / 2);
44
41
  this.captureWidth = Math.round((this.captureHeight * 9) / 16);
45
42
  }
46
- componentWillLoad() {
47
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Title;
43
+ async componentWillLoad() {
44
+ this.translations = await Translations.getValues();
45
+ this.titleMesage = this.translations.SelfieCaptureValues.Title;
48
46
  //this.videoDemoStyle = this.device.isMobile ? { 'width': window.screen.width + 'px', 'height': window.screen.height + 'px', 'object-fit': 'fill' } : {};
49
47
  if (!navigator.mediaDevices) {
50
48
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -53,16 +51,16 @@ const SelfieTilt = class {
53
51
  async componentDidLoad() {
54
52
  this.mainStream = Stream.getInstance(VerificationMode.Tilt);
55
53
  await this.baseComponent.logStep(FlowSteps.SelfieTilt, FlowMoments.Initialized);
56
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.FacePoseMapping[Object.values(FacePose).indexOf(this.mainStream.facePose)];
54
+ this.titleMesage = this.translations.SelfieCaptureValues.FacePoseMapping[Object.values(FacePose).indexOf(this.mainStream.facePose)];
57
55
  this.demoEnded = false;
58
56
  this.demoVideo.src = SelfieCaptureValues.FacePoseDemoMapping[this.mainStream.facePose];
59
57
  this.demoVideo.play();
60
- await delay(this.baseComponent.translations.GlobalValues.VideoLenght);
58
+ await delay(this.translations.GlobalValues.VideoLenght);
61
59
  this.demoEnded = true;
62
60
  this.openCamera();
63
61
  }
64
62
  async openCamera() {
65
- const constraints = this.cameras.GetConstraints('', state.device, true);
63
+ const constraints = this.cameras.GetConstraints('', store.device, true);
66
64
  setTimeout(() => {
67
65
  navigator.mediaDevices
68
66
  .getUserMedia(constraints)
@@ -97,7 +95,7 @@ const SelfieTilt = class {
97
95
  if (this.verified)
98
96
  return;
99
97
  this.verified = true;
100
- this.titleMesage = this.baseComponent.translations.SelfieCaptureValues.Loading;
98
+ this.titleMesage = this.translations.SelfieCaptureValues.Loading;
101
99
  this.closeCamera();
102
100
  this.demoEnded = false;
103
101
  this.demoVideo.src = this.uploadingLink;
@@ -106,7 +104,7 @@ const SelfieTilt = class {
106
104
  }
107
105
  render() {
108
106
  let cameraStyle;
109
- if (state.device.isMobile && this.videoStarted) {
107
+ if (store.device.isMobile && this.videoStarted) {
110
108
  cameraStyle = {
111
109
  'width': this.captureWidth + 'px',
112
110
  'height': this.captureHeight + 'px',
@@ -119,10 +117,85 @@ const SelfieTilt = class {
119
117
  let titleClass = this.verified ? 'color-black-2 text-center' : 'color-white text-center';
120
118
  //let videoClass = this.device.isMobile ? '' : 'video-demo';
121
119
  let bgDemo = this.verified ? 'container' : 'container bg-black';
122
- return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.baseComponent.translations.GlobalValues.FooterText)))));
120
+ return (h("div", { class: bgDemo }, h("div", { class: "container-video" }, h("div", { hidden: this.demoEnded }, h("video", { id: "howtoSelfie", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { hidden: this.demoEnded == false }, h("div", { hidden: this.verified }, h("div", { class: "video-capture" }, h("div", { style: cameraStyle }, h("camera-comp", { "capture-mode": "selfie" }))))), h("div", { class: "capture-title" }, h("h1", { class: titleClass }, this.titleMesage), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))));
123
121
  }
124
- get component() { return getElement(this); }
125
- };
126
- SelfieTilt.style = selfieTiltCss;
127
-
128
- export { SelfieTilt as selfie_tilt };
122
+ static get is() { return "selfie-tilt"; }
123
+ static get originalStyleUrls() {
124
+ return {
125
+ "$": ["selfie-tilt.css"]
126
+ };
127
+ }
128
+ static get styleUrls() {
129
+ return {
130
+ "$": ["selfie-tilt.css"]
131
+ };
132
+ }
133
+ static get states() {
134
+ return {
135
+ "videoStarted": {},
136
+ "captureTaken": {},
137
+ "verified": {},
138
+ "titleMesage": {},
139
+ "demoEnded": {},
140
+ "demoVideo": {},
141
+ "uploadingLink": {},
142
+ "captureHeight": {},
143
+ "captureWidth": {}
144
+ };
145
+ }
146
+ static get events() {
147
+ return [{
148
+ "method": "eventPhotoCapture",
149
+ "name": "photoSelfieTiltCapture",
150
+ "bubbles": true,
151
+ "cancelable": true,
152
+ "composed": true,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": ""
156
+ },
157
+ "complexType": {
158
+ "original": "any",
159
+ "resolved": "any",
160
+ "references": {}
161
+ }
162
+ }, {
163
+ "method": "apiErrorEvent",
164
+ "name": "apiError",
165
+ "bubbles": true,
166
+ "cancelable": true,
167
+ "composed": true,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": ""
171
+ },
172
+ "complexType": {
173
+ "original": "any",
174
+ "resolved": "any",
175
+ "references": {}
176
+ }
177
+ }];
178
+ }
179
+ static get elementRef() { return "component"; }
180
+ static get listeners() {
181
+ return [{
182
+ "name": "videoStarted",
183
+ "method": "eventVideoStarted",
184
+ "target": undefined,
185
+ "capture": false,
186
+ "passive": false
187
+ }, {
188
+ "name": "takePhoto",
189
+ "method": "takePhoto",
190
+ "target": undefined,
191
+ "capture": false,
192
+ "passive": false
193
+ }, {
194
+ "name": "verificationFinished",
195
+ "method": "verificationFinished",
196
+ "target": undefined,
197
+ "capture": false,
198
+ "passive": false
199
+ }];
200
+ }
201
+ }
@@ -0,0 +1,47 @@
1
+ .camera {
2
+ width: 100%;
3
+ height: 100%;
4
+ color: white;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ position: relative;
9
+ }
10
+
11
+ .cameraCanvas,
12
+ .cameraCanvasSelfie,
13
+ .cameraCanvasSelfieDesk {
14
+ z-index: 3;
15
+ max-width: 100%;
16
+ max-height: 100%;
17
+ border-radius: 10px;
18
+ }
19
+
20
+ .cameraCanvasSelfie,
21
+ .cameraCanvasSelfieDesk {
22
+ transform: scale(-1, 1);
23
+ -webkit-transform: scale(-1, 1);
24
+ }
25
+
26
+ .cameraVideo,
27
+ .cameraVideoSelfie,
28
+ .cameraVideoSelfieDesk {
29
+ z-index: 2;
30
+ position: absolute;
31
+ max-width: 100%;
32
+ max-height: 100%;
33
+ border-radius: 10px;
34
+ }
35
+
36
+ .cameraVideoSelfie,
37
+ .cameraVideoSelfieDesk {
38
+ transform: scale(-1, 1);
39
+ -webkit-transform: scale(-1, 1);
40
+ }
41
+
42
+ .cameraMobile {
43
+ position: fixed;
44
+ top: 0;
45
+ left: 0;
46
+ background: black;
47
+ }