@smileid/web-components 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/package.json +58 -58
  2. package/src/components/README.md +14 -14
  3. package/src/components/attribution/PoweredBySmileId.js +42 -42
  4. package/src/components/camera-permission/CameraPermission.js +140 -140
  5. package/src/components/camera-permission/CameraPermission.stories.js +27 -27
  6. package/src/components/combobox/src/Combobox.js +589 -589
  7. package/src/components/combobox/src/index.js +1 -1
  8. package/src/components/document/src/DocumentCaptureScreens.js +409 -409
  9. package/src/components/document/src/DocumentCaptureScreens.stories.js +57 -57
  10. package/src/components/document/src/README.md +111 -111
  11. package/src/components/document/src/document-capture/DocumentCapture.js +760 -760
  12. package/src/components/document/src/document-capture/DocumentCapture.stories.js +78 -78
  13. package/src/components/document/src/document-capture/README.md +90 -90
  14. package/src/components/document/src/document-capture/index.js +3 -3
  15. package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +499 -499
  16. package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +24 -24
  17. package/src/components/document/src/document-capture-instructions/README.md +56 -56
  18. package/src/components/document/src/document-capture-instructions/index.js +3 -3
  19. package/src/components/document/src/document-capture-review/DocumentCaptureReview.js +362 -362
  20. package/src/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +24 -24
  21. package/src/components/document/src/document-capture-review/README.md +79 -79
  22. package/src/components/document/src/document-capture-review/index.js +3 -3
  23. package/src/components/document/src/index.js +3 -3
  24. package/src/components/end-user-consent/src/EndUserConsent.js +795 -795
  25. package/src/components/end-user-consent/src/EndUserConsent.stories.js +29 -29
  26. package/src/components/end-user-consent/src/index.js +4 -4
  27. package/src/components/navigation/src/Navigation.js +171 -171
  28. package/src/components/navigation/src/Navigation.stories.js +24 -24
  29. package/src/components/navigation/src/index.js +3 -3
  30. package/src/components/selfie/README.md +225 -225
  31. package/src/components/selfie/src/SelfieCaptureScreens.js +282 -282
  32. package/src/components/selfie/src/SelfieCaptureScreens.stories.js +29 -29
  33. package/src/components/selfie/src/index.js +5 -5
  34. package/src/components/selfie/src/selfie-capture/SelfieCapture.js +1041 -1010
  35. package/src/components/selfie/src/selfie-capture/SelfieCapture.stories.js +36 -36
  36. package/src/components/selfie/src/selfie-capture/index.js +3 -3
  37. package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +657 -648
  38. package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +23 -23
  39. package/src/components/selfie/src/selfie-capture-instructions/index.js +3 -3
  40. package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +347 -347
  41. package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +24 -24
  42. package/src/components/selfie/src/selfie-capture-review/index.js +3 -3
  43. package/src/components/signature-pad/package-lock.json +3009 -3009
  44. package/src/components/signature-pad/package.json +30 -30
  45. package/src/components/signature-pad/src/SignaturePad.js +484 -484
  46. package/src/components/signature-pad/src/SignaturePad.stories.js +32 -32
  47. package/src/components/signature-pad/src/index.js +3 -3
  48. package/src/components/smart-camera-web/src/README.md +207 -207
  49. package/src/components/smart-camera-web/src/SmartCameraWeb.js +299 -299
  50. package/src/components/smart-camera-web/src/SmartCameraWeb.stories.js +57 -57
  51. package/src/components/totp-consent/src/TotpConsent.js +949 -949
  52. package/src/components/totp-consent/src/index.js +4 -4
  53. package/src/domain/camera/src/README.md +38 -38
  54. package/src/domain/camera/src/SmartCamera.js +109 -109
  55. package/src/domain/constants/src/Constants.js +27 -27
  56. package/src/domain/file-upload/README.md +35 -35
  57. package/src/domain/file-upload/src/SmartFileUpload.js +65 -65
  58. package/src/index.js +5 -5
  59. package/src/styles/README.md +3 -3
  60. package/src/styles/src/styles.js +359 -359
  61. package/src/styles/src/typography.js +52 -52
@@ -1,299 +1,299 @@
1
- import styles from '../../../styles/src/styles';
2
- import SmartCamera from '../../../domain/camera/src/SmartCamera';
3
-
4
- import '../../document/src';
5
- import '../../selfie/src';
6
- import '../../camera-permission/CameraPermission';
7
- import packageJson from '../../../../package.json';
8
-
9
- const COMPONENTS_VERSION = packageJson.version;
10
-
11
- function scwTemplateString() {
12
- return `
13
- ${styles(this.themeColor)}
14
- <div>
15
- <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'} ${this.hideAttribution}></camera-permission>
16
- <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
17
- ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
18
- ></selfie-capture-screens>
19
- <document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
20
- ${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
21
- </div>
22
- `;
23
- }
24
- class SmartCameraWeb extends HTMLElement {
25
- constructor() {
26
- super();
27
- this.scwTemplateString = scwTemplateString.bind(this);
28
- this.render = () => this.scwTemplateString();
29
- this.attachShadow({ mode: 'open' });
30
- this.activeScreen = null;
31
- }
32
-
33
- connectedCallback() {
34
- this.shadowRoot.innerHTML = this.render();
35
-
36
- this._data = {
37
- images: [],
38
- meta: {
39
- libraryVersion: COMPONENTS_VERSION,
40
- },
41
- };
42
-
43
- if (
44
- 'mediaDevices' in navigator &&
45
- 'getUserMedia' in navigator.mediaDevices
46
- ) {
47
- this.setUpEventListeners();
48
- } else {
49
- this.shadowRoot.innerHTML =
50
- '<h1 class="error-message">Your browser does not support this integration</h1>';
51
- }
52
- }
53
-
54
- disconnectedCallback() {
55
- SmartCamera.stopMedia();
56
- if (this.activeScreen) {
57
- this.activeScreen.removeAttribute('hidden');
58
- }
59
- this.activeScreen = null;
60
- this.shadowRoot.innerHTML = '';
61
- }
62
-
63
- static get observedAttributes() {
64
- return [
65
- 'allow-agent-mode',
66
- 'disable-image-tests',
67
- 'document-capture-modes',
68
- 'document-type',
69
- 'hide-attribution',
70
- 'hide-back-of-id',
71
- 'hide-back-to-host',
72
- 'show-navigation',
73
- 'theme-color',
74
- ];
75
- }
76
-
77
- attributeChangedCallback(name) {
78
- switch (name) {
79
- case 'allow-agent-mode':
80
- case 'disable-image-tests':
81
- case 'document-capture-modes':
82
- case 'document-type':
83
- case 'hide-attribution':
84
- case 'hide-back-of-id':
85
- case 'hide-back-to-host':
86
- case 'show-navigation':
87
- case 'theme-color':
88
- this.disconnectedCallback();
89
- this.shadowRoot.innerHTML = this.render();
90
- this.setUpEventListeners();
91
- break;
92
- default:
93
- break;
94
- }
95
- }
96
-
97
- setUpEventListeners() {
98
- this.cameraPermission = this.shadowRoot.querySelector('camera-permission');
99
- this.SelfieCaptureScreens = this.shadowRoot.querySelector(
100
- 'selfie-capture-screens',
101
- );
102
- this.documentCapture = this.shadowRoot.querySelector(
103
- 'document-capture-screens',
104
- );
105
-
106
- if (this.hideInstructions) {
107
- this.setActiveScreen(this.cameraPermission);
108
- } else {
109
- this.setActiveScreen(this.SelfieCaptureScreens);
110
- }
111
- this.cameraPermission.addEventListener('camera-permission.granted', () => {
112
- this.setActiveScreen(this.SelfieCaptureScreens);
113
- this.SelfieCaptureScreens.removeAttribute('data-camera-error');
114
- this.SelfieCaptureScreens.setAttribute('data-camera-ready', true);
115
- });
116
-
117
- this.SelfieCaptureScreens.addEventListener(
118
- 'selfie-capture-screens.publish',
119
- (event) => {
120
- this._data.images = event.detail.images;
121
- if (!this.captureId) {
122
- this._publishSelectedImages();
123
- } else {
124
- this.setActiveScreen(this.documentCapture);
125
- }
126
- },
127
- );
128
-
129
- this.SelfieCaptureScreens.addEventListener(
130
- 'selfie-capture-screens.cancelled',
131
- () => {
132
- if (this.hideInstructions) {
133
- this.setActiveScreen(this.cameraPermission);
134
- } else {
135
- this.handleBackEvents();
136
- }
137
- },
138
- );
139
- this.SelfieCaptureScreens.addEventListener(
140
- 'selfie-capture-screens.back',
141
- () => {
142
- if (!this.hideInstructions) {
143
- this.setActiveScreen(this.cameraPermission);
144
- }
145
- },
146
- );
147
-
148
- this.documentCapture.addEventListener(
149
- 'document-capture-screens.publish',
150
- (event) => {
151
- this._data.images = [...this._data.images, ...event.detail.images];
152
- this._publishSelectedImages();
153
- },
154
- );
155
-
156
- this.documentCapture.addEventListener(
157
- 'document-capture-screens.cancelled',
158
- () => {
159
- this.SelfieCaptureScreens.setAttribute(
160
- 'initial-screen',
161
- 'selfie-capture',
162
- );
163
- this.setActiveScreen(this.SelfieCaptureScreens);
164
- this.SelfieCaptureScreens.removeAttribute('data-camera-error');
165
- this.SelfieCaptureScreens.setAttribute('data-camera-ready', true);
166
- },
167
- );
168
-
169
- [
170
- this.cameraPermission,
171
- this.SelfieCaptureScreens,
172
- this.documentCapture,
173
- ].forEach((screen) => {
174
- screen.addEventListener(`${screen.nodeName.toLowerCase()}.close`, () =>
175
- this.handleCloseEvent(),
176
- );
177
- });
178
- this.documentCapture.addEventListener(
179
- 'document-capture-screens.back',
180
- () => {
181
- this.setActiveScreen(this.SelfieCaptureScreens);
182
- this.reset();
183
- },
184
- );
185
- }
186
-
187
- reset() {
188
- this.disconnectedCallback();
189
- this.connectedCallback();
190
- }
191
-
192
- handleBackEvents() {
193
- this.dispatchEvent(new CustomEvent('smart-camera-web.cancelled'));
194
- }
195
-
196
- _publishSelectedImages() {
197
- this.dispatchEvent(
198
- new CustomEvent('smart-camera-web.publish', { detail: this._data }),
199
- );
200
- }
201
-
202
- get captureId() {
203
- return this.hasAttribute('capture-id');
204
- }
205
-
206
- get documentType() {
207
- return this.getAttribute('document-type');
208
- }
209
-
210
- get isPortraitCaptureView() {
211
- return this.getAttribute('document-type') === 'GREEN_BOOK';
212
- }
213
-
214
- get hideInstructions() {
215
- return this.hasAttribute('hide-instructions') ? 'hide-instructions' : '';
216
- }
217
-
218
- get hideBackOfId() {
219
- return this.hasAttribute('hide-back-of-id') ? 'hide-back-of-id' : '';
220
- }
221
-
222
- get showNavigation() {
223
- return this.hasAttribute('show-navigation') ? 'show-navigation' : '';
224
- }
225
-
226
- get hideBackToHost() {
227
- return this.hasAttribute('hide-back-to-host') ||
228
- this.hasAttribute('hide-back')
229
- ? 'hide-back'
230
- : '';
231
- }
232
-
233
- get allowAgentMode() {
234
- return this.hasAttribute('allow-agent-mode')
235
- ? `allow-agent-mode=${this.getAttribute('allow-agent-mode')}`
236
- : '';
237
- }
238
-
239
- get allowAgentModeTests() {
240
- return this.hasAttribute('show-agent-mode-for-tests')
241
- ? 'show-agent-mode-for-tests'
242
- : '';
243
- }
244
-
245
- get title() {
246
- return this.hasAttribute('title')
247
- ? `title=${this.getAttribute('title')}`
248
- : '';
249
- }
250
-
251
- get documentCaptureModes() {
252
- return this.hasAttribute('document-capture-modes')
253
- ? `document-capture-modes='${this.getAttribute('document-capture-modes')}'`
254
- : '';
255
- }
256
-
257
- get disableImageTests() {
258
- return this.hasAttribute('disable-image-tests')
259
- ? 'disable-image-tests'
260
- : '';
261
- }
262
-
263
- get hideAttribution() {
264
- return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
265
- }
266
-
267
- get hasThemeColor() {
268
- return (
269
- this.hasAttribute('theme-color') &&
270
- ![null, undefined, 'null', 'undefined'].includes(
271
- this.getAttribute('theme-color'),
272
- )
273
- );
274
- }
275
-
276
- get themeColor() {
277
- return this.hasThemeColor ? this.getAttribute('theme-color') : '#001096';
278
- }
279
-
280
- get applyComponentThemeColor() {
281
- return this.hasThemeColor ? `theme-color='${this.themeColor}'` : '';
282
- }
283
-
284
- setActiveScreen(screen) {
285
- this.activeScreen?.setAttribute('hidden', '');
286
- screen.removeAttribute('hidden');
287
- this.activeScreen = screen;
288
- }
289
-
290
- handleCloseEvent() {
291
- this.dispatchEvent(new CustomEvent('smart-camera-web.close'));
292
- }
293
- }
294
-
295
- if ('customElements' in window && !customElements.get('smart-camera-web')) {
296
- customElements.define('smart-camera-web', SmartCameraWeb);
297
- }
298
-
299
- export default SmartCameraWeb;
1
+ import styles from '../../../styles/src/styles';
2
+ import SmartCamera from '../../../domain/camera/src/SmartCamera';
3
+
4
+ import '../../document/src';
5
+ import '../../selfie/src';
6
+ import '../../camera-permission/CameraPermission';
7
+ import packageJson from '../../../../package.json';
8
+
9
+ const COMPONENTS_VERSION = packageJson.version;
10
+
11
+ function scwTemplateString() {
12
+ return `
13
+ ${styles(this.themeColor)}
14
+ <div>
15
+ <camera-permission ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'} ${this.hideAttribution}></camera-permission>
16
+ <selfie-capture-screens ${this.applyComponentThemeColor} ${this.title} ${this.showNavigation} ${this.disableImageTests} ${this.hideAttribution} ${this.hideInstructions} hidden
17
+ ${this.hideBackToHost} ${this.allowAgentMode} ${this.allowAgentModeTests}
18
+ ></selfie-capture-screens>
19
+ <document-capture-screens ${this.applyComponentThemeColor} document-type=${this.documentType} ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideAttribution}
20
+ ${this.hideBackOfId} ${this.applyComponentThemeColor} hidden></document-capture-screens>
21
+ </div>
22
+ `;
23
+ }
24
+ class SmartCameraWeb extends HTMLElement {
25
+ constructor() {
26
+ super();
27
+ this.scwTemplateString = scwTemplateString.bind(this);
28
+ this.render = () => this.scwTemplateString();
29
+ this.attachShadow({ mode: 'open' });
30
+ this.activeScreen = null;
31
+ }
32
+
33
+ connectedCallback() {
34
+ this.shadowRoot.innerHTML = this.render();
35
+
36
+ this._data = {
37
+ images: [],
38
+ meta: {
39
+ libraryVersion: COMPONENTS_VERSION,
40
+ },
41
+ };
42
+
43
+ if (
44
+ 'mediaDevices' in navigator &&
45
+ 'getUserMedia' in navigator.mediaDevices
46
+ ) {
47
+ this.setUpEventListeners();
48
+ } else {
49
+ this.shadowRoot.innerHTML =
50
+ '<h1 class="error-message">Your browser does not support this integration</h1>';
51
+ }
52
+ }
53
+
54
+ disconnectedCallback() {
55
+ SmartCamera.stopMedia();
56
+ if (this.activeScreen) {
57
+ this.activeScreen.removeAttribute('hidden');
58
+ }
59
+ this.activeScreen = null;
60
+ this.shadowRoot.innerHTML = '';
61
+ }
62
+
63
+ static get observedAttributes() {
64
+ return [
65
+ 'allow-agent-mode',
66
+ 'disable-image-tests',
67
+ 'document-capture-modes',
68
+ 'document-type',
69
+ 'hide-attribution',
70
+ 'hide-back-of-id',
71
+ 'hide-back-to-host',
72
+ 'show-navigation',
73
+ 'theme-color',
74
+ ];
75
+ }
76
+
77
+ attributeChangedCallback(name) {
78
+ switch (name) {
79
+ case 'allow-agent-mode':
80
+ case 'disable-image-tests':
81
+ case 'document-capture-modes':
82
+ case 'document-type':
83
+ case 'hide-attribution':
84
+ case 'hide-back-of-id':
85
+ case 'hide-back-to-host':
86
+ case 'show-navigation':
87
+ case 'theme-color':
88
+ this.disconnectedCallback();
89
+ this.shadowRoot.innerHTML = this.render();
90
+ this.setUpEventListeners();
91
+ break;
92
+ default:
93
+ break;
94
+ }
95
+ }
96
+
97
+ setUpEventListeners() {
98
+ this.cameraPermission = this.shadowRoot.querySelector('camera-permission');
99
+ this.SelfieCaptureScreens = this.shadowRoot.querySelector(
100
+ 'selfie-capture-screens',
101
+ );
102
+ this.documentCapture = this.shadowRoot.querySelector(
103
+ 'document-capture-screens',
104
+ );
105
+
106
+ if (this.hideInstructions) {
107
+ this.setActiveScreen(this.cameraPermission);
108
+ } else {
109
+ this.setActiveScreen(this.SelfieCaptureScreens);
110
+ }
111
+ this.cameraPermission.addEventListener('camera-permission.granted', () => {
112
+ this.setActiveScreen(this.SelfieCaptureScreens);
113
+ this.SelfieCaptureScreens.removeAttribute('data-camera-error');
114
+ this.SelfieCaptureScreens.setAttribute('data-camera-ready', true);
115
+ });
116
+
117
+ this.SelfieCaptureScreens.addEventListener(
118
+ 'selfie-capture-screens.publish',
119
+ (event) => {
120
+ this._data.images = event.detail.images;
121
+ if (!this.captureId) {
122
+ this._publishSelectedImages();
123
+ } else {
124
+ this.setActiveScreen(this.documentCapture);
125
+ }
126
+ },
127
+ );
128
+
129
+ this.SelfieCaptureScreens.addEventListener(
130
+ 'selfie-capture-screens.cancelled',
131
+ () => {
132
+ if (this.hideInstructions) {
133
+ this.setActiveScreen(this.cameraPermission);
134
+ } else {
135
+ this.handleBackEvents();
136
+ }
137
+ },
138
+ );
139
+ this.SelfieCaptureScreens.addEventListener(
140
+ 'selfie-capture-screens.back',
141
+ () => {
142
+ if (!this.hideInstructions) {
143
+ this.setActiveScreen(this.cameraPermission);
144
+ }
145
+ },
146
+ );
147
+
148
+ this.documentCapture.addEventListener(
149
+ 'document-capture-screens.publish',
150
+ (event) => {
151
+ this._data.images = [...this._data.images, ...event.detail.images];
152
+ this._publishSelectedImages();
153
+ },
154
+ );
155
+
156
+ this.documentCapture.addEventListener(
157
+ 'document-capture-screens.cancelled',
158
+ () => {
159
+ this.SelfieCaptureScreens.setAttribute(
160
+ 'initial-screen',
161
+ 'selfie-capture',
162
+ );
163
+ this.setActiveScreen(this.SelfieCaptureScreens);
164
+ this.SelfieCaptureScreens.removeAttribute('data-camera-error');
165
+ this.SelfieCaptureScreens.setAttribute('data-camera-ready', true);
166
+ },
167
+ );
168
+
169
+ [
170
+ this.cameraPermission,
171
+ this.SelfieCaptureScreens,
172
+ this.documentCapture,
173
+ ].forEach((screen) => {
174
+ screen.addEventListener(`${screen.nodeName.toLowerCase()}.close`, () =>
175
+ this.handleCloseEvent(),
176
+ );
177
+ });
178
+ this.documentCapture.addEventListener(
179
+ 'document-capture-screens.back',
180
+ () => {
181
+ this.setActiveScreen(this.SelfieCaptureScreens);
182
+ this.reset();
183
+ },
184
+ );
185
+ }
186
+
187
+ reset() {
188
+ this.disconnectedCallback();
189
+ this.connectedCallback();
190
+ }
191
+
192
+ handleBackEvents() {
193
+ this.dispatchEvent(new CustomEvent('smart-camera-web.cancelled'));
194
+ }
195
+
196
+ _publishSelectedImages() {
197
+ this.dispatchEvent(
198
+ new CustomEvent('smart-camera-web.publish', { detail: this._data }),
199
+ );
200
+ }
201
+
202
+ get captureId() {
203
+ return this.hasAttribute('capture-id');
204
+ }
205
+
206
+ get documentType() {
207
+ return this.getAttribute('document-type');
208
+ }
209
+
210
+ get isPortraitCaptureView() {
211
+ return this.getAttribute('document-type') === 'GREEN_BOOK';
212
+ }
213
+
214
+ get hideInstructions() {
215
+ return this.hasAttribute('hide-instructions') ? 'hide-instructions' : '';
216
+ }
217
+
218
+ get hideBackOfId() {
219
+ return this.hasAttribute('hide-back-of-id') ? 'hide-back-of-id' : '';
220
+ }
221
+
222
+ get showNavigation() {
223
+ return this.hasAttribute('show-navigation') ? 'show-navigation' : '';
224
+ }
225
+
226
+ get hideBackToHost() {
227
+ return this.hasAttribute('hide-back-to-host') ||
228
+ this.hasAttribute('hide-back')
229
+ ? 'hide-back'
230
+ : '';
231
+ }
232
+
233
+ get allowAgentMode() {
234
+ return this.hasAttribute('allow-agent-mode')
235
+ ? `allow-agent-mode=${this.getAttribute('allow-agent-mode')}`
236
+ : '';
237
+ }
238
+
239
+ get allowAgentModeTests() {
240
+ return this.hasAttribute('show-agent-mode-for-tests')
241
+ ? 'show-agent-mode-for-tests'
242
+ : '';
243
+ }
244
+
245
+ get title() {
246
+ return this.hasAttribute('title')
247
+ ? `title=${this.getAttribute('title')}`
248
+ : '';
249
+ }
250
+
251
+ get documentCaptureModes() {
252
+ return this.hasAttribute('document-capture-modes')
253
+ ? `document-capture-modes='${this.getAttribute('document-capture-modes')}'`
254
+ : '';
255
+ }
256
+
257
+ get disableImageTests() {
258
+ return this.hasAttribute('disable-image-tests')
259
+ ? 'disable-image-tests'
260
+ : '';
261
+ }
262
+
263
+ get hideAttribution() {
264
+ return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
265
+ }
266
+
267
+ get hasThemeColor() {
268
+ return (
269
+ this.hasAttribute('theme-color') &&
270
+ ![null, undefined, 'null', 'undefined'].includes(
271
+ this.getAttribute('theme-color'),
272
+ )
273
+ );
274
+ }
275
+
276
+ get themeColor() {
277
+ return this.hasThemeColor ? this.getAttribute('theme-color') : '#001096';
278
+ }
279
+
280
+ get applyComponentThemeColor() {
281
+ return this.hasThemeColor ? `theme-color='${this.themeColor}'` : '';
282
+ }
283
+
284
+ setActiveScreen(screen) {
285
+ this.activeScreen?.setAttribute('hidden', '');
286
+ screen.removeAttribute('hidden');
287
+ this.activeScreen = screen;
288
+ }
289
+
290
+ handleCloseEvent() {
291
+ this.dispatchEvent(new CustomEvent('smart-camera-web.close'));
292
+ }
293
+ }
294
+
295
+ if ('customElements' in window && !customElements.get('smart-camera-web')) {
296
+ customElements.define('smart-camera-web', SmartCameraWeb);
297
+ }
298
+
299
+ export default SmartCameraWeb;