biometry-sdk 2.1.0 → 2.1.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.
- package/README.md +48 -12
- package/dist/sdk.js +1 -1
- package/dist/sdk.js.map +1 -1
- package/dist/ui/doc-auth.d.ts +23 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.js +236 -1
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -254,7 +254,7 @@ This component provides an intuitive interface for enrollment users with their c
|
|
|
254
254
|
|
|
255
255
|
### Usage
|
|
256
256
|
**Required attributes:**
|
|
257
|
-
- `api-
|
|
257
|
+
- `endpoint`: The URL of your endpoint that will process the [face enrollment](https://developer.biometrysolutions.com/api/face-enrollment/). All captured data will be sent to the endpoint.
|
|
258
258
|
- `user-fullname`: The user’s full name (used in data storage and consent).
|
|
259
259
|
|
|
260
260
|
**Slots:**
|
|
@@ -265,7 +265,7 @@ This component provides an intuitive interface for enrollment users with their c
|
|
|
265
265
|
**Basic Usage**
|
|
266
266
|
```html
|
|
267
267
|
<biometry-enrollment
|
|
268
|
-
|
|
268
|
+
endpoint="your-endpoint-link"
|
|
269
269
|
user-fullname="John Doe">
|
|
270
270
|
</biometry-enrollment>
|
|
271
271
|
```
|
|
@@ -273,7 +273,7 @@ This component provides an intuitive interface for enrollment users with their c
|
|
|
273
273
|
**Advanced Usage**
|
|
274
274
|
```html
|
|
275
275
|
<biometry-enrollment
|
|
276
|
-
|
|
276
|
+
endpoint="your-endpoint-link"
|
|
277
277
|
user-fullname="John Doe">
|
|
278
278
|
|
|
279
279
|
<video slot="video" autoplay playsinline style="width: 100%; border-radius: 10px;"></video>
|
|
@@ -296,7 +296,7 @@ The **Process Video** component enables you to record, upload, and process a vid
|
|
|
296
296
|
**Basic Usage**
|
|
297
297
|
```html
|
|
298
298
|
<process-video
|
|
299
|
-
|
|
299
|
+
endpoint="your-endpoint-link"
|
|
300
300
|
user-fullname="John Doe"
|
|
301
301
|
></process-video>
|
|
302
302
|
```
|
|
@@ -304,7 +304,7 @@ The **Process Video** component enables you to record, upload, and process a vid
|
|
|
304
304
|
**Advanced Usage**
|
|
305
305
|
```html
|
|
306
306
|
<process-video
|
|
307
|
-
|
|
307
|
+
endpoint="your-endpoint-link"
|
|
308
308
|
user-fullname="John Doe"
|
|
309
309
|
>
|
|
310
310
|
<!-- Custom video element -->
|
|
@@ -330,16 +330,52 @@ The **Process Video** component enables you to record, upload, and process a vid
|
|
|
330
330
|
- All default elements and messages are functional out-of-the-box.
|
|
331
331
|
- Replace slots if you want to customize the UI or functionality.
|
|
332
332
|
- Call giveConsent() before using any biometric methods to ensure compliance with data processing requirements.
|
|
333
|
+
|
|
334
|
+
### Doc Auth Component
|
|
335
|
+
The **Doc Auth** component allows users to scan and upload an ID document using their camera. It is designed to be simple, secure, and easy to integrate into your application.
|
|
336
|
+
|
|
337
|
+
#### Description
|
|
338
|
+
This component provides a rectangular scanning area using the user's camera, a button to capture the document, and uploads a high-quality JPEG image to your backend endpoint. The backend should process the image using the Biometry SDK and your API key (never expose your API key to the client).
|
|
339
|
+
|
|
340
|
+
#### Required attributes:
|
|
341
|
+
- `endpoint`: The URL of your endpoint that will process the [document authentication](https://developer.biometrysolutions.com/api/doc-auth/). All captured data will be sent to this endpoint for secure processing.
|
|
342
|
+
- `user-fullname`: The user’s full name (used in data storage and consent).
|
|
343
|
+
|
|
344
|
+
#### Slots:
|
|
345
|
+
- (No custom slots are required, but you can style the component using CSS variables.)
|
|
346
|
+
|
|
347
|
+
#### Basic Usage
|
|
348
|
+
```html
|
|
349
|
+
<id-document-scan
|
|
350
|
+
endpoint="your-endpoint-link"
|
|
351
|
+
user-fullname="John Doe"
|
|
352
|
+
></id-document-scan>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
#### Customization
|
|
356
|
+
You can override the default styles using CSS custom properties. For example:
|
|
357
|
+
```css
|
|
358
|
+
id-document-scan {
|
|
359
|
+
--primary-color: #4caf50;
|
|
360
|
+
--scan-area-border: 2px solid #4caf50;
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
Here is the list of available CSS variables:
|
|
364
|
+
```css
|
|
365
|
+
--primary-color: #007bff;
|
|
366
|
+
--button-bg: var(--primary-color);
|
|
367
|
+
--button-text-color: #fff;
|
|
368
|
+
--border-radius: 8px;
|
|
369
|
+
--scan-area-border: 2px dashed var(--primary-color);
|
|
370
|
+
--scan-area-bg: rgba(0, 123, 255, 0.05);
|
|
371
|
+
--button-padding: 10px 24px;
|
|
372
|
+
--button-radius: 6px;
|
|
373
|
+
--button-hover-bg: #0056b3;
|
|
374
|
+
```
|
|
333
375
|
|
|
334
376
|
## License
|
|
335
377
|
|
|
336
378
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
|
|
337
379
|
|
|
338
380
|
## More Information
|
|
339
|
-
For more detailed information on Biometry’s API endpoints, parameters, and responses, visit the official [Biometry API Documentation](https://developer.biometrysolutions.com/overview/). If you have questions or need help, please reach out to our support team or create a GitHub issue.
|
|
340
|
-
|
|
341
|
-
- **UI Components:**
|
|
342
|
-
- `<biometry-enrollment ...>` (face enrollment)
|
|
343
|
-
- `<process-video ...>` (video enrollment)
|
|
344
|
-
With these **direct SDK methods**, **UI components**, and advanced **best practices** (faceEnroll + faceMatch flows, reuse of video, error handling), you can build robust, privacy-conscious biometric solutions on your web application.
|
|
345
|
-
|
|
381
|
+
For more detailed information on Biometry’s API endpoints, parameters, and responses, visit the official [Biometry API Documentation](https://developer.biometrysolutions.com/overview/). If you have questions or need help, please reach out to our support team or create a GitHub issue.
|
package/dist/sdk.js
CHANGED
|
@@ -204,7 +204,7 @@ class BiometrySDK {
|
|
|
204
204
|
if (props?.deviceInfo) {
|
|
205
205
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
206
206
|
}
|
|
207
|
-
return await this.request('/api-gateway/check
|
|
207
|
+
return await this.request('/api-gateway/docauth/check', 'POST', formData, headers);
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* Matches a user's face from video against a reference image.
|
package/dist/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthInfo } from \"../types/biometry/doc-auth\";\nimport { ConsentResponse } from \"../types/biometry/consent\";\nimport { FaceEnrollmentResponse, VoiceEnrollmentResponse } from \"../types/biometry/enrollment\";\nimport { FaceMatchResponse } from \"../types/biometry/face-match\";\nimport { ProcessVideoResponse } from \"../types/biometry/process-video\";\nimport { SessionResponse } from \"../types/biometry/session\";\n\nexport class BiometrySDK {\n private apiKey: string;\n private static readonly BASE_URL: string = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';\n\n constructor(apiKey: string) {\n if (!apiKey) {\n throw new Error('API Key is required to initialize the SDK.');\n }\n\n this.apiKey = apiKey;\n }\n\n private async request<T>(path: string, method: string, body?: any, headers?: Record<string, string>):\n Promise<ApiResponse<T>> {\n const defaultHeaders: HeadersInit = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n\n const requestHeaders = { ...defaultHeaders, ...headers };\n\n if (body && !(body instanceof FormData)) {\n requestHeaders['Content-Type'] = 'application/json';\n body = JSON.stringify(body);\n }\n const response = await fetch(`${BiometrySDK.BASE_URL}${path}`, {\n method,\n headers: requestHeaders,\n body,\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';\n\n throw new Error(`Error ${response.status}: ${errorMessage}`);\n }\n\n // Extract response headers\n const responseHeaders: Record<string, string> = {};\n const requestId = response.headers.get(\"X-Request-Id\");\n if (requestId) {\n responseHeaders[\"X-Request-Id\"] = requestId;\n }\n\n const responseBody = await response.json();\n\n return {\n body: responseBody as T,\n headers: responseHeaders\n };\n }\n\n /**\n * Starts a new Session for a user.\n * \n * @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.\n * @throws {Error} - If the request fails.\n */\n async startSession(): Promise<ApiResponse<SessionResponse>> {\n return await this.request<SessionResponse>(\n '/api-gateway/sessions/start',\n 'POST'\n );\n }\n\n /**\n * Submits Authorization consent for a user.\n * Authorization Consent is required to use the services like Face and Voice recognition.\n * \n * @param {boolean} isConsentGiven - Indicates whether the user has given consent.\n * @param {string} userFullName - The full name of the user giving consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveAuthorizationConsent(\n isConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give consent.');\n }\n\n const body = {\n is_consent_given: isConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Submits Storage consent for a user.\n * Storage consent is granted by users, allowing us to store their biometric data for future verification.\n * \n * @param {boolean} isStorageConsentGiven - Indicates whether the user has given storage consent.\n * @param {string} userFullName - The full name of the user giving storage consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveStorageConsent(\n isStorageConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give storage consent.');\n }\n\n const body = {\n is_consent_given: isStorageConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/strg-consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Enrolls a user's voice for biometric authentication.\n * \n * @param {File} audio - The audio file containing the user's voice.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} uniqueId - A unique identifier for the enrolling process.\n * @param {string} phrase - The phrase spoken in the audio file.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollVoice(\n audio: File,\n userFullName: string,\n uniqueId: string,\n phrase: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<VoiceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!uniqueId) throw new Error('Unique ID is required.');\n if (!phrase) throw new Error('Phrase is required.');\n if (!audio) throw new Error('Audio file is required.');\n\n const formData = new FormData();\n formData.append('unique_id', uniqueId);\n formData.append('phrase', phrase);\n formData.append('voice', audio);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<VoiceEnrollmentResponse>(\n '/api-gateway/enroll/voice',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Enrolls a user's face for biometric authentication.\n * \n * @param {File} face - Image file that contains user's face.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} isDocument - Indicates whether the image is a document.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<FaceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollFace(face: File, userFullName: string, isDocument?: boolean, props?: {\n sessionId?: string,\n deviceInfo?: object,\n }):\n Promise<ApiResponse<FaceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!face) throw new Error('Face image is required.');\n\n const formData = new FormData();\n formData.append('face', face);\n if (isDocument) {\n formData.append('is_document', 'true');\n }\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceEnrollmentResponse>(\n '/api-gateway/enroll/face',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Check the validity of a documents.\n * \n * @param {File} document - Document image file.\n * @param {string} userFullName - The full name of the user being checked.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<DocAuthInfo>>} - A promise resolving to the document authentication information.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<DocAuthInfo>> {\n if (!document) throw new Error('Document image is required.');\n if (!userFullName) throw new Error('User fullname is required.');\n\n const formData = new FormData();\n formData.append('document', document);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<DocAuthInfo>(\n '/api-gateway/check-doc-auth',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Matches a user's face from video against a reference image.\n * \n * @param {File} image - Reference image file that contains user's face.\n * @param {string} video - Video file that contains user's face.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {string} processVideoRequestId - ID from the response header of /process-video endpoint.\n * @param {boolean} usePrefilledVideo - Pass true to use the video from the process-video endpoint.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async matchFaces(\n image: File,\n video?: File,\n userFullName?: string,\n usePrefilledVideo?: boolean,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<FaceMatchResponse>> {\n if (!image) throw new Error('Face image is required.');\n if ((!usePrefilledVideo) && !video) throw new Error('Video is required.');\n if (usePrefilledVideo && !props?.sessionId) throw new Error('Session ID is required to use a video from the process-video endpoint.');\n\n const formData = new FormData();\n if (video) {\n formData.append('video', video);\n }\n formData.append('image', image);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (usePrefilledVideo) {\n headers['X-Use-Prefilled-Video'] = 'true';\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceMatchResponse>(\n '/api-gateway/match-faces',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Process the video through Biometry services to check liveness and authorize user\n * \n * @param {File} video - Video file that you want to process.\n * @param {string} phrase - Set of numbers that user needs to say out loud in the video.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.\n */\n async processVideo(\n video: File,\n phrase: string,\n userFullName?: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ProcessVideoResponse>> {\n if (!video) throw new Error('Video is required.');\n if (!phrase) throw new Error('Phrase is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('video', video);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ProcessVideoResponse>(\n '/api-gateway/process-video',\n 'POST',\n formData,\n headers\n );\n }\n}"],"names":[],"mappings":"MAQa,WAAW,CAAA;AAItB,IAAA,WAAA,CAAY,MAAc,EAAA;QACxB,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;QAC/D;AAEA,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;IAEQ,MAAM,OAAO,CAAI,IAAY,EAAE,MAAc,EAAE,IAAU,EAAE,OAAgC,EAAA;AA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AO,MAAM,IAAI,CAAC,OAAO,CACvB,4BAA4B,EAC5B,MAAM,EACN,QAAQ,EACR,OAAO,CACR;IACH;;AA9ZwB,WAAA,CAAA,QAAQ,GAAW,mCAAmC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthInfo } from \"../types/biometry/doc-auth\";\nimport { ConsentResponse } from \"../types/biometry/consent\";\nimport { FaceEnrollmentResponse, VoiceEnrollmentResponse } from \"../types/biometry/enrollment\";\nimport { FaceMatchResponse } from \"../types/biometry/face-match\";\nimport { ProcessVideoResponse } from \"../types/biometry/process-video\";\nimport { SessionResponse } from \"../types/biometry/session\";\n\nexport class BiometrySDK {\n private apiKey: string;\n private static readonly BASE_URL: string = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';\n\n constructor(apiKey: string) {\n if (!apiKey) {\n throw new Error('API Key is required to initialize the SDK.');\n }\n\n this.apiKey = apiKey;\n }\n\n private async request<T>(path: string, method: string, body?: any, headers?: Record<string, string>):\n Promise<ApiResponse<T>> {\n const defaultHeaders: HeadersInit = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n\n const requestHeaders = { ...defaultHeaders, ...headers };\n\n if (body && !(body instanceof FormData)) {\n requestHeaders['Content-Type'] = 'application/json';\n body = JSON.stringify(body);\n }\n const response = await fetch(`${BiometrySDK.BASE_URL}${path}`, {\n method,\n headers: requestHeaders,\n body,\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';\n\n throw new Error(`Error ${response.status}: ${errorMessage}`);\n }\n\n // Extract response headers\n const responseHeaders: Record<string, string> = {};\n const requestId = response.headers.get(\"X-Request-Id\");\n if (requestId) {\n responseHeaders[\"X-Request-Id\"] = requestId;\n }\n\n const responseBody = await response.json();\n\n return {\n body: responseBody as T,\n headers: responseHeaders\n };\n }\n\n /**\n * Starts a new Session for a user.\n * \n * @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.\n * @throws {Error} - If the request fails.\n */\n async startSession(): Promise<ApiResponse<SessionResponse>> {\n return await this.request<SessionResponse>(\n '/api-gateway/sessions/start',\n 'POST'\n );\n }\n\n /**\n * Submits Authorization consent for a user.\n * Authorization Consent is required to use the services like Face and Voice recognition.\n * \n * @param {boolean} isConsentGiven - Indicates whether the user has given consent.\n * @param {string} userFullName - The full name of the user giving consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveAuthorizationConsent(\n isConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give consent.');\n }\n\n const body = {\n is_consent_given: isConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Submits Storage consent for a user.\n * Storage consent is granted by users, allowing us to store their biometric data for future verification.\n * \n * @param {boolean} isStorageConsentGiven - Indicates whether the user has given storage consent.\n * @param {string} userFullName - The full name of the user giving storage consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveStorageConsent(\n isStorageConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give storage consent.');\n }\n\n const body = {\n is_consent_given: isStorageConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/strg-consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Enrolls a user's voice for biometric authentication.\n * \n * @param {File} audio - The audio file containing the user's voice.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} uniqueId - A unique identifier for the enrolling process.\n * @param {string} phrase - The phrase spoken in the audio file.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollVoice(\n audio: File,\n userFullName: string,\n uniqueId: string,\n phrase: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<VoiceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!uniqueId) throw new Error('Unique ID is required.');\n if (!phrase) throw new Error('Phrase is required.');\n if (!audio) throw new Error('Audio file is required.');\n\n const formData = new FormData();\n formData.append('unique_id', uniqueId);\n formData.append('phrase', phrase);\n formData.append('voice', audio);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<VoiceEnrollmentResponse>(\n '/api-gateway/enroll/voice',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Enrolls a user's face for biometric authentication.\n * \n * @param {File} face - Image file that contains user's face.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} isDocument - Indicates whether the image is a document.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<FaceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollFace(face: File, userFullName: string, isDocument?: boolean, props?: {\n sessionId?: string,\n deviceInfo?: object,\n }):\n Promise<ApiResponse<FaceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!face) throw new Error('Face image is required.');\n\n const formData = new FormData();\n formData.append('face', face);\n if (isDocument) {\n formData.append('is_document', 'true');\n }\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceEnrollmentResponse>(\n '/api-gateway/enroll/face',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Check the validity of a documents.\n * \n * @param {File} document - Document image file.\n * @param {string} userFullName - The full name of the user being checked.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<DocAuthInfo>>} - A promise resolving to the document authentication information.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<DocAuthInfo>> {\n if (!document) throw new Error('Document image is required.');\n if (!userFullName) throw new Error('User fullname is required.');\n\n const formData = new FormData();\n formData.append('document', document);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<DocAuthInfo>(\n '/api-gateway/docauth/check',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Matches a user's face from video against a reference image.\n * \n * @param {File} image - Reference image file that contains user's face.\n * @param {string} video - Video file that contains user's face.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {string} processVideoRequestId - ID from the response header of /process-video endpoint.\n * @param {boolean} usePrefilledVideo - Pass true to use the video from the process-video endpoint.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async matchFaces(\n image: File,\n video?: File,\n userFullName?: string,\n usePrefilledVideo?: boolean,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<FaceMatchResponse>> {\n if (!image) throw new Error('Face image is required.');\n if ((!usePrefilledVideo) && !video) throw new Error('Video is required.');\n if (usePrefilledVideo && !props?.sessionId) throw new Error('Session ID is required to use a video from the process-video endpoint.');\n\n const formData = new FormData();\n if (video) {\n formData.append('video', video);\n }\n formData.append('image', image);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (usePrefilledVideo) {\n headers['X-Use-Prefilled-Video'] = 'true';\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceMatchResponse>(\n '/api-gateway/match-faces',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Process the video through Biometry services to check liveness and authorize user\n * \n * @param {File} video - Video file that you want to process.\n * @param {string} phrase - Set of numbers that user needs to say out loud in the video.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.\n */\n async processVideo(\n video: File,\n phrase: string,\n userFullName?: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ProcessVideoResponse>> {\n if (!video) throw new Error('Video is required.');\n if (!phrase) throw new Error('Phrase is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('video', video);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ProcessVideoResponse>(\n '/api-gateway/process-video',\n 'POST',\n formData,\n headers\n );\n }\n}"],"names":[],"mappings":"MAQa,WAAW,CAAA;AAItB,IAAA,WAAA,CAAY,MAAc,EAAA;QACxB,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;QAC/D;AAEA,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;IAEQ,MAAM,OAAO,CAAI,IAAY,EAAE,MA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AC,UAAU,CAAC;QAC7D;AAEA,QAAA,OAAO,MAAM,IAAI,CAAC,OAAO,CACvB,4BAA4B,EAC5B,MAAM,EACN,QAAQ,EACR,OAAO,CACR;IACH;;AA9ZwB,WAAA,CAAA,QAAQ,GAAW,mCAAmC,CAAC;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class DocAuth extends HTMLElement {
|
|
2
|
+
private readonly shadow;
|
|
3
|
+
private videoElement;
|
|
4
|
+
private canvasElement;
|
|
5
|
+
private captureButton;
|
|
6
|
+
constructor();
|
|
7
|
+
static get observedAttributes(): string[];
|
|
8
|
+
get endpoint(): string | null;
|
|
9
|
+
set endpoint(value: string | null);
|
|
10
|
+
get userFullname(): string | null;
|
|
11
|
+
set userFullname(value: string | null);
|
|
12
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
validateAttributes(): void;
|
|
16
|
+
init(): void;
|
|
17
|
+
cleanup(): void;
|
|
18
|
+
private attachElements;
|
|
19
|
+
private setupCamera;
|
|
20
|
+
private captureDocument;
|
|
21
|
+
private setStatus;
|
|
22
|
+
private toggleState;
|
|
23
|
+
}
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui.js
CHANGED
|
@@ -1241,5 +1241,240 @@ class ProcessVideo extends HTMLElement {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
customElements.define('process-video', ProcessVideo);
|
|
1243
1243
|
|
|
1244
|
-
|
|
1244
|
+
class DocAuth extends HTMLElement {
|
|
1245
|
+
constructor() {
|
|
1246
|
+
super();
|
|
1247
|
+
this.videoElement = null;
|
|
1248
|
+
this.canvasElement = null;
|
|
1249
|
+
this.captureButton = null;
|
|
1250
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
1251
|
+
this.captureDocument = this.captureDocument.bind(this);
|
|
1252
|
+
}
|
|
1253
|
+
static get observedAttributes() {
|
|
1254
|
+
return ["endpoint", "user-fullname"];
|
|
1255
|
+
}
|
|
1256
|
+
get endpoint() {
|
|
1257
|
+
return this.getAttribute("endpoint");
|
|
1258
|
+
}
|
|
1259
|
+
set endpoint(value) {
|
|
1260
|
+
if (value !== this.getAttribute("endpoint")) {
|
|
1261
|
+
if (value === null) {
|
|
1262
|
+
this.removeAttribute("endpoint");
|
|
1263
|
+
}
|
|
1264
|
+
else {
|
|
1265
|
+
this.setAttribute("endpoint", value);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
get userFullname() {
|
|
1270
|
+
return this.getAttribute("user-fullname");
|
|
1271
|
+
}
|
|
1272
|
+
set userFullname(value) {
|
|
1273
|
+
if (value !== this.getAttribute("user-fullname")) {
|
|
1274
|
+
if (value === null) {
|
|
1275
|
+
this.removeAttribute("user-fullname");
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
this.setAttribute("user-fullname", value);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
1283
|
+
if (name === "endpoint" || name === "user-fullname") {
|
|
1284
|
+
this.validateAttributes();
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
connectedCallback() {
|
|
1288
|
+
this.validateAttributes();
|
|
1289
|
+
this.init();
|
|
1290
|
+
}
|
|
1291
|
+
disconnectedCallback() {
|
|
1292
|
+
this.cleanup();
|
|
1293
|
+
if (this.captureButton) {
|
|
1294
|
+
this.captureButton.removeEventListener("click", this.captureDocument);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
validateAttributes() {
|
|
1298
|
+
if (!this.endpoint) {
|
|
1299
|
+
console.error("Endpoint is required.");
|
|
1300
|
+
this.toggleState("error");
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (!this.userFullname) {
|
|
1304
|
+
console.error("User fullname is required.");
|
|
1305
|
+
this.toggleState("error");
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
init() {
|
|
1310
|
+
this.shadow.innerHTML = `
|
|
1311
|
+
<style>
|
|
1312
|
+
:host {
|
|
1313
|
+
display: block;
|
|
1314
|
+
font-family: Arial, sans-serif;
|
|
1315
|
+
--primary-color: #007bff;
|
|
1316
|
+
--button-bg: var(--primary-color);
|
|
1317
|
+
--button-text-color: #fff;
|
|
1318
|
+
--border-radius: 8px;
|
|
1319
|
+
--scan-area-border: 2px dashed var(--primary-color);
|
|
1320
|
+
--scan-area-bg: rgba(0, 123, 255, 0.05);
|
|
1321
|
+
--button-padding: 10px 24px;
|
|
1322
|
+
--button-radius: 6px;
|
|
1323
|
+
--button-hover-bg: #0056b3;
|
|
1324
|
+
}
|
|
1325
|
+
.container {
|
|
1326
|
+
display: flex;
|
|
1327
|
+
flex-direction: column;
|
|
1328
|
+
align-items: center;
|
|
1329
|
+
gap: 20px;
|
|
1330
|
+
padding: 24px;
|
|
1331
|
+
background: #fff;
|
|
1332
|
+
border-radius: var(--border-radius);
|
|
1333
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
|
1334
|
+
max-width: 420px;
|
|
1335
|
+
margin: 0 auto;
|
|
1336
|
+
}
|
|
1337
|
+
.scan-area {
|
|
1338
|
+
position: relative;
|
|
1339
|
+
width: 340px;
|
|
1340
|
+
height: 220px;
|
|
1341
|
+
background: var(--scan-area-bg);
|
|
1342
|
+
border: var(--scan-area-border);
|
|
1343
|
+
border-radius: var(--border-radius);
|
|
1344
|
+
overflow: hidden;
|
|
1345
|
+
display: flex;
|
|
1346
|
+
align-items: center;
|
|
1347
|
+
justify-content: center;
|
|
1348
|
+
}
|
|
1349
|
+
video {
|
|
1350
|
+
width: 100%;
|
|
1351
|
+
height: 100%;
|
|
1352
|
+
object-fit: cover;
|
|
1353
|
+
border-radius: var(--border-radius);
|
|
1354
|
+
}
|
|
1355
|
+
canvas {
|
|
1356
|
+
display: none;
|
|
1357
|
+
}
|
|
1358
|
+
.capture-btn {
|
|
1359
|
+
background: var(--button-bg);
|
|
1360
|
+
color: var(--button-text-color);
|
|
1361
|
+
border: none;
|
|
1362
|
+
border-radius: var(--button-radius);
|
|
1363
|
+
padding: var(--button-padding);
|
|
1364
|
+
font-size: 1rem;
|
|
1365
|
+
cursor: pointer;
|
|
1366
|
+
transition: background 0.2s;
|
|
1367
|
+
}
|
|
1368
|
+
.capture-btn:hover {
|
|
1369
|
+
background: var(--button-hover-bg);
|
|
1370
|
+
}
|
|
1371
|
+
.status {
|
|
1372
|
+
min-height: 24px;
|
|
1373
|
+
font-size: 0.95rem;
|
|
1374
|
+
color: #d32f2f;
|
|
1375
|
+
text-align: center;
|
|
1376
|
+
}
|
|
1377
|
+
.status.success {
|
|
1378
|
+
color: #388e3c;
|
|
1379
|
+
}
|
|
1380
|
+
</style>
|
|
1381
|
+
<div class="container">
|
|
1382
|
+
<div class="scan-area">
|
|
1383
|
+
<video id="video" autoplay playsinline></video>
|
|
1384
|
+
<canvas id="canvas"></canvas>
|
|
1385
|
+
</div>
|
|
1386
|
+
<button class="capture-btn" id="capture-btn">Capture Document</button>
|
|
1387
|
+
<div class="status" id="status"></div>
|
|
1388
|
+
</div>
|
|
1389
|
+
`;
|
|
1390
|
+
this.attachElements();
|
|
1391
|
+
this.setupCamera();
|
|
1392
|
+
this.toggleState("");
|
|
1393
|
+
}
|
|
1394
|
+
cleanup() {
|
|
1395
|
+
if (this.videoElement?.srcObject) {
|
|
1396
|
+
const tracks = this.videoElement.srcObject.getTracks();
|
|
1397
|
+
tracks.forEach((track) => track.stop());
|
|
1398
|
+
}
|
|
1399
|
+
if (this.videoElement) {
|
|
1400
|
+
this.videoElement.srcObject = null;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
attachElements() {
|
|
1404
|
+
this.videoElement = this.shadow.querySelector("#video");
|
|
1405
|
+
this.canvasElement = this.shadow.querySelector("#canvas");
|
|
1406
|
+
this.captureButton = this.shadow.querySelector("#capture-btn");
|
|
1407
|
+
if (this.captureButton) {
|
|
1408
|
+
this.captureButton.addEventListener("click", this.captureDocument);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
setupCamera() {
|
|
1412
|
+
if (!this.videoElement) {
|
|
1413
|
+
console.error("Video element is missing.");
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
navigator.mediaDevices
|
|
1417
|
+
.getUserMedia({ video: { facingMode: "environment" } })
|
|
1418
|
+
.then((stream) => {
|
|
1419
|
+
this.videoElement.srcObject = stream;
|
|
1420
|
+
})
|
|
1421
|
+
.catch((error) => {
|
|
1422
|
+
this.toggleState("error");
|
|
1423
|
+
this.setStatus("Error accessing camera: " + error, false);
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
async captureDocument() {
|
|
1427
|
+
if (!this.videoElement || !this.canvasElement) {
|
|
1428
|
+
this.setStatus("Camera not ready.", false);
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
// Set canvas size to video size for high quality
|
|
1432
|
+
this.canvasElement.width = this.videoElement.videoWidth;
|
|
1433
|
+
this.canvasElement.height = this.videoElement.videoHeight;
|
|
1434
|
+
const context = this.canvasElement.getContext("2d");
|
|
1435
|
+
context.drawImage(this.videoElement, 0, 0, this.canvasElement.width, this.canvasElement.height);
|
|
1436
|
+
this.toggleState("loading");
|
|
1437
|
+
this.setStatus("Uploading...", false);
|
|
1438
|
+
this.canvasElement.toBlob(async (blob) => {
|
|
1439
|
+
try {
|
|
1440
|
+
if (!blob) {
|
|
1441
|
+
this.setStatus("Failed to capture image.", false);
|
|
1442
|
+
this.toggleState("error");
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const file = new File([blob], "id-document.jpg", { type: "image/jpeg" });
|
|
1446
|
+
const formData = new FormData();
|
|
1447
|
+
formData.append("document", file);
|
|
1448
|
+
formData.append("userFullname", this.userFullname || "");
|
|
1449
|
+
const response = await fetch(this.endpoint, {
|
|
1450
|
+
method: "POST",
|
|
1451
|
+
body: formData,
|
|
1452
|
+
});
|
|
1453
|
+
if (!response.ok) {
|
|
1454
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
1455
|
+
}
|
|
1456
|
+
this.setStatus("Document uploaded successfully!", true);
|
|
1457
|
+
this.toggleState("success");
|
|
1458
|
+
}
|
|
1459
|
+
catch (error) {
|
|
1460
|
+
this.setStatus("Error uploading document.", false);
|
|
1461
|
+
this.toggleState("error");
|
|
1462
|
+
}
|
|
1463
|
+
}, "image/jpeg", 0.98); // High quality JPEG
|
|
1464
|
+
}
|
|
1465
|
+
setStatus(message, success) {
|
|
1466
|
+
const statusDiv = this.shadow.querySelector("#status");
|
|
1467
|
+
if (statusDiv) {
|
|
1468
|
+
statusDiv.textContent = message;
|
|
1469
|
+
statusDiv.className = "status" + (success ? " success" : "");
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
toggleState(state) {
|
|
1473
|
+
// For extensibility, could add more UI feedback here
|
|
1474
|
+
// Currently just updates status color
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
customElements.define("doc-auth", DocAuth);
|
|
1478
|
+
|
|
1479
|
+
export { BiometryEnrollment, DocAuth, ProcessVideo };
|
|
1245
1480
|
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../src/ui/types.ts","../src/ui/biometry-enrollment.ts","../node_modules/fix-webm-duration/fix-webm-duration.js","../src/ui/process-video.ts"],"sourcesContent":["export enum BiometryAttributes {\n ApiKey = 'api-key',\n UserFullname = 'user-fullname',\n}\n\nexport enum BiometryEnrollmentState {\n Loading = 'loading',\n Success = 'success',\n ErrorNoFace = 'error-no-face',\n ErrorMultipleFaces = 'error-multiple-faces',\n ErrorNotCentered = 'error-not-centered',\n ErrorOther = 'error-other',\n}\n","import { BiometryAttributes, BiometryEnrollmentState } from \"./types.js\";\n\nexport class BiometryEnrollment extends HTMLElement {\n private readonly shadow: ShadowRoot;\n private videoElement: HTMLVideoElement | null = null;\n private canvasElement: HTMLCanvasElement | null = null;\n private captureButton: HTMLButtonElement | null = null;\n\n private resultCode?: number;\n private description?: string;\n\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: \"open\" });\n\n this.toggleState = this.toggleState.bind(this);\n this.capturePhoto = this.capturePhoto.bind(this);\n }\n\n static get observedAttributes(): string[] {\n return Object.values(BiometryAttributes);\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n get userFullname(): string | null {\n return this.getAttribute(\"user-fullname\");\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute(\"user-fullname\", value);\n } else {\n this.removeAttribute(\"user-fullname\");\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (name === \"endpoint\" || name === \"user-fullname\") {\n if (name === \"endpoint\") {\n this.endpoint = newValue;\n } else if (name === \"user-fullname\") {\n this.userFullname = newValue;\n }\n this.validateAttributes();\n }\n }\n\n connectedCallback(): void {\n this.validateAttributes();\n this.init();\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n if (this.captureButton) {\n this.captureButton.removeEventListener(\"click\", this.capturePhoto);\n }\n }\n\n validateAttributes(): void {\n if (!this.endpoint) {\n console.error(\"Endpoint is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n if (!this.userFullname) {\n console.error(\"User fullname is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n }\n\n init(): void {\n this.shadow.innerHTML = `\n <style>\n .wrapper {\n position: relative;\n }\n video {\n transform: scaleX(-1); /* Flip video for preview */\n max-width: 100%;\n border-radius: var(--border-radius, 8px);\n }\n canvas {\n display: none;\n }\n </style>\n <div class=\"wrapper\">\n <slot name=\"video\">\n <video id=\"video\" autoplay playsinline></video>\n </slot>\n <slot name=\"canvas\">\n <canvas id=\"canvas\" style=\"display: none;\"></canvas>\n </slot>\n <slot name=\"button\">\n <button id=\"button\">Capture Photo</button>\n </slot>\n <div class=\"status\">\n <slot name=\"loading\" class=\"loading\"></slot>\n <slot name=\"success\" class=\"success\"></slot>\n <slot name=\"error-no-face\" class=\"error-no-face\"></slot>\n <slot name=\"error-multiple-faces\" class=\"error-multiple-faces\"></slot>\n <slot name=\"error-not-centered\" class=\"error-not-centered\"></slot>\n <slot name=\"error-other\" class=\"error-other\"></slot>\n </div>\n </div>\n `;\n\n this.attachSlotListeners();\n this.setupCamera();\n this.toggleState(\"\");\n }\n\n public cleanup(): void {\n if (this.videoElement?.srcObject) {\n const tracks = (this.videoElement.srcObject as MediaStream).getTracks();\n tracks.forEach((track) => track.stop());\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n }\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadow.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const canvasSlot = this.shadow.querySelector('slot[name=\"canvas\"]') as HTMLSlotElement;\n const buttonSlot = this.shadow.querySelector('slot[name=\"button\"]') as HTMLSlotElement;\n\n const assignedVideoElements = videoSlot.assignedElements();\n this.videoElement = (assignedVideoElements.length > 0 ? assignedVideoElements[0] : null) as HTMLVideoElement || this.shadow.querySelector(\"#video\") as HTMLVideoElement;\n\n const assignedCanvasElements = canvasSlot.assignedElements();\n this.canvasElement = (assignedCanvasElements.length > 0 ? assignedCanvasElements[0] : null) as HTMLCanvasElement || this.shadow.querySelector(\"#canvas\") as HTMLCanvasElement;\n\n const assignedButtonElements = buttonSlot.assignedElements();\n this.captureButton = (assignedButtonElements.length > 0 ? assignedButtonElements[0] : null) as HTMLButtonElement || this.shadow.querySelector(\"#button\") as HTMLButtonElement;\n\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n if (!this.captureButton) {\n console.error(\"Capture button is missing.\");\n return;\n } else {\n this.captureButton.addEventListener(\"click\", this.capturePhoto);\n }\n }\n\n private setupCamera(): void {\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n navigator.mediaDevices\n .getUserMedia({ video: true })\n .then((stream) => {\n this.videoElement!.srcObject = stream;\n })\n .catch((error) => {\n console.error(\"Error accessing camera:\", error);\n });\n }\n\n private async capturePhoto(): Promise<void> {\n try {\n if (!this.videoElement || !this.canvasElement) {\n console.error(\"Essential elements are not initialized.\");\n return;\n }\n\n const context = this.canvasElement.getContext(\"2d\");\n this.canvasElement.width = this.videoElement.videoWidth;\n this.canvasElement.height = this.videoElement.videoHeight;\n\n context!.drawImage(\n this.videoElement,\n 0,\n 0,\n this.canvasElement.width,\n this.canvasElement.height\n );\n\n this.toggleState(\"loading\");\n\n this.canvasElement.toBlob(async (blob) => {\n try {\n if (!blob) {\n console.error(\"Failed to capture photo.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n const file = new File([blob], \"onboard-face.jpg\", { type: \"image/jpeg\" });\n const formData = new FormData();\n formData.append('photo', file);\n formData.append('userFullname', this.userFullname || '');\n\n const response = await fetch(this.endpoint!, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n this.resultCode = result?.code;\n this.description = result?.description || \"Unknown error occurred.\";\n\n switch (this.resultCode) {\n case 0:\n this.toggleState(BiometryEnrollmentState.Success);\n break;\n case 1:\n this.toggleState(BiometryEnrollmentState.ErrorNoFace);\n break;\n case 2:\n this.toggleState(BiometryEnrollmentState.ErrorMultipleFaces);\n break;\n case 3:\n this.toggleState(BiometryEnrollmentState.ErrorNotCentered);\n break;\n default:\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n\n console.log(\"Enrollment result:\", result);\n } catch (error) {\n console.error(\"Error in toBlob callback:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }, \"image/jpeg\");\n } catch (error) {\n console.error(\"Error capturing photo:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }\n\n private toggleState(state: BiometryEnrollmentState | string): void {\n const slots = [\n BiometryEnrollmentState.Loading,\n BiometryEnrollmentState.Success,\n BiometryEnrollmentState.ErrorNoFace,\n BiometryEnrollmentState.ErrorMultipleFaces,\n BiometryEnrollmentState.ErrorNotCentered,\n BiometryEnrollmentState.ErrorOther,\n ];\n\n slots.forEach((slotName) => {\n const slot = this.shadow.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? \"block\" : \"none\";\n }\n });\n }\n}\n\ncustomElements.define(\"biometry-enrollment\", BiometryEnrollment);","(function (name, definition) {\n if (typeof define === 'function' && define.amd) { // RequireJS / AMD\n define(definition);\n } else if (typeof module !== 'undefined' && module.exports) { // CommonJS / Node.js\n module.exports = definition();\n } else { // Direct include\n window.ysFixWebmDuration = definition();\n }\n})('fix-webm-duration', function () {\n /*\n * This is the list of possible WEBM file sections by their IDs.\n * Possible types: Container, Binary, Uint, Int, String, Float, Date\n */\n var sections = {\n 0xa45dfa3: { name: 'EBML', type: 'Container' },\n 0x286: { name: 'EBMLVersion', type: 'Uint' },\n 0x2f7: { name: 'EBMLReadVersion', type: 'Uint' },\n 0x2f2: { name: 'EBMLMaxIDLength', type: 'Uint' },\n 0x2f3: { name: 'EBMLMaxSizeLength', type: 'Uint' },\n 0x282: { name: 'DocType', type: 'String' },\n 0x287: { name: 'DocTypeVersion', type: 'Uint' },\n 0x285: { name: 'DocTypeReadVersion', type: 'Uint' },\n 0x6c: { name: 'Void', type: 'Binary' },\n 0x3f: { name: 'CRC-32', type: 'Binary' },\n 0xb538667: { name: 'SignatureSlot', type: 'Container' },\n 0x3e8a: { name: 'SignatureAlgo', type: 'Uint' },\n 0x3e9a: { name: 'SignatureHash', type: 'Uint' },\n 0x3ea5: { name: 'SignaturePublicKey', type: 'Binary' },\n 0x3eb5: { name: 'Signature', type: 'Binary' },\n 0x3e5b: { name: 'SignatureElements', type: 'Container' },\n 0x3e7b: { name: 'SignatureElementList', type: 'Container' },\n 0x2532: { name: 'SignedElement', type: 'Binary' },\n 0x8538067: { name: 'Segment', type: 'Container' },\n 0x14d9b74: { name: 'SeekHead', type: 'Container' },\n 0xdbb: { name: 'Seek', type: 'Container' },\n 0x13ab: { name: 'SeekID', type: 'Binary' },\n 0x13ac: { name: 'SeekPosition', type: 'Uint' },\n 0x549a966: { name: 'Info', type: 'Container' },\n 0x33a4: { name: 'SegmentUID', type: 'Binary' },\n 0x3384: { name: 'SegmentFilename', type: 'String' },\n 0x1cb923: { name: 'PrevUID', type: 'Binary' },\n 0x1c83ab: { name: 'PrevFilename', type: 'String' },\n 0x1eb923: { name: 'NextUID', type: 'Binary' },\n 0x1e83bb: { name: 'NextFilename', type: 'String' },\n 0x444: { name: 'SegmentFamily', type: 'Binary' },\n 0x2924: { name: 'ChapterTranslate', type: 'Container' },\n 0x29fc: { name: 'ChapterTranslateEditionUID', type: 'Uint' },\n 0x29bf: { name: 'ChapterTranslateCodec', type: 'Uint' },\n 0x29a5: { name: 'ChapterTranslateID', type: 'Binary' },\n 0xad7b1: { name: 'TimecodeScale', type: 'Uint' },\n 0x489: { name: 'Duration', type: 'Float' },\n 0x461: { name: 'DateUTC', type: 'Date' },\n 0x3ba9: { name: 'Title', type: 'String' },\n 0xd80: { name: 'MuxingApp', type: 'String' },\n 0x1741: { name: 'WritingApp', type: 'String' },\n // 0xf43b675: { name: 'Cluster', type: 'Container' },\n 0x67: { name: 'Timecode', type: 'Uint' },\n 0x1854: { name: 'SilentTracks', type: 'Container' },\n 0x18d7: { name: 'SilentTrackNumber', type: 'Uint' },\n 0x27: { name: 'Position', type: 'Uint' },\n 0x2b: { name: 'PrevSize', type: 'Uint' },\n 0x23: { name: 'SimpleBlock', type: 'Binary' },\n 0x20: { name: 'BlockGroup', type: 'Container' },\n 0x21: { name: 'Block', type: 'Binary' },\n 0x22: { name: 'BlockVirtual', type: 'Binary' },\n 0x35a1: { name: 'BlockAdditions', type: 'Container' },\n 0x26: { name: 'BlockMore', type: 'Container' },\n 0x6e: { name: 'BlockAddID', type: 'Uint' },\n 0x25: { name: 'BlockAdditional', type: 'Binary' },\n 0x1b: { name: 'BlockDuration', type: 'Uint' },\n 0x7a: { name: 'ReferencePriority', type: 'Uint' },\n 0x7b: { name: 'ReferenceBlock', type: 'Int' },\n 0x7d: { name: 'ReferenceVirtual', type: 'Int' },\n 0x24: { name: 'CodecState', type: 'Binary' },\n 0x35a2: { name: 'DiscardPadding', type: 'Int' },\n 0xe: { name: 'Slices', type: 'Container' },\n 0x68: { name: 'TimeSlice', type: 'Container' },\n 0x4c: { name: 'LaceNumber', type: 'Uint' },\n 0x4d: { name: 'FrameNumber', type: 'Uint' },\n 0x4b: { name: 'BlockAdditionID', type: 'Uint' },\n 0x4e: { name: 'Delay', type: 'Uint' },\n 0x4f: { name: 'SliceDuration', type: 'Uint' },\n 0x48: { name: 'ReferenceFrame', type: 'Container' },\n 0x49: { name: 'ReferenceOffset', type: 'Uint' },\n 0x4a: { name: 'ReferenceTimeCode', type: 'Uint' },\n 0x2f: { name: 'EncryptedBlock', type: 'Binary' },\n 0x654ae6b: { name: 'Tracks', type: 'Container' },\n 0x2e: { name: 'TrackEntry', type: 'Container' },\n 0x57: { name: 'TrackNumber', type: 'Uint' },\n 0x33c5: { name: 'TrackUID', type: 'Uint' },\n 0x3: { name: 'TrackType', type: 'Uint' },\n 0x39: { name: 'FlagEnabled', type: 'Uint' },\n 0x8: { name: 'FlagDefault', type: 'Uint' },\n 0x15aa: { name: 'FlagForced', type: 'Uint' },\n 0x1c: { name: 'FlagLacing', type: 'Uint' },\n 0x2de7: { name: 'MinCache', type: 'Uint' },\n 0x2df8: { name: 'MaxCache', type: 'Uint' },\n 0x3e383: { name: 'DefaultDuration', type: 'Uint' },\n 0x34e7a: { name: 'DefaultDecodedFieldDuration', type: 'Uint' },\n 0x3314f: { name: 'TrackTimecodeScale', type: 'Float' },\n 0x137f: { name: 'TrackOffset', type: 'Int' },\n 0x15ee: { name: 'MaxBlockAdditionID', type: 'Uint' },\n 0x136e: { name: 'Name', type: 'String' },\n 0x2b59c: { name: 'Language', type: 'String' },\n 0x6: { name: 'CodecID', type: 'String' },\n 0x23a2: { name: 'CodecPrivate', type: 'Binary' },\n 0x58688: { name: 'CodecName', type: 'String' },\n 0x3446: { name: 'AttachmentLink', type: 'Uint' },\n 0x1a9697: { name: 'CodecSettings', type: 'String' },\n 0x1b4040: { name: 'CodecInfoURL', type: 'String' },\n 0x6b240: { name: 'CodecDownloadURL', type: 'String' },\n 0x2a: { name: 'CodecDecodeAll', type: 'Uint' },\n 0x2fab: { name: 'TrackOverlay', type: 'Uint' },\n 0x16aa: { name: 'CodecDelay', type: 'Uint' },\n 0x16bb: { name: 'SeekPreRoll', type: 'Uint' },\n 0x2624: { name: 'TrackTranslate', type: 'Container' },\n 0x26fc: { name: 'TrackTranslateEditionUID', type: 'Uint' },\n 0x26bf: { name: 'TrackTranslateCodec', type: 'Uint' },\n 0x26a5: { name: 'TrackTranslateTrackID', type: 'Binary' },\n 0x60: { name: 'Video', type: 'Container' },\n 0x1a: { name: 'FlagInterlaced', type: 'Uint' },\n 0x13b8: { name: 'StereoMode', type: 'Uint' },\n 0x13c0: { name: 'AlphaMode', type: 'Uint' },\n 0x13b9: { name: 'OldStereoMode', type: 'Uint' },\n 0x30: { name: 'PixelWidth', type: 'Uint' },\n 0x3a: { name: 'PixelHeight', type: 'Uint' },\n 0x14aa: { name: 'PixelCropBottom', type: 'Uint' },\n 0x14bb: { name: 'PixelCropTop', type: 'Uint' },\n 0x14cc: { name: 'PixelCropLeft', type: 'Uint' },\n 0x14dd: { name: 'PixelCropRight', type: 'Uint' },\n 0x14b0: { name: 'DisplayWidth', type: 'Uint' },\n 0x14ba: { name: 'DisplayHeight', type: 'Uint' },\n 0x14b2: { name: 'DisplayUnit', type: 'Uint' },\n 0x14b3: { name: 'AspectRatioType', type: 'Uint' },\n 0xeb524: { name: 'ColourSpace', type: 'Binary' },\n 0xfb523: { name: 'GammaValue', type: 'Float' },\n 0x383e3: { name: 'FrameRate', type: 'Float' },\n 0x61: { name: 'Audio', type: 'Container' },\n 0x35: { name: 'SamplingFrequency', type: 'Float' },\n 0x38b5: { name: 'OutputSamplingFrequency', type: 'Float' },\n 0x1f: { name: 'Channels', type: 'Uint' },\n 0x3d7b: { name: 'ChannelPositions', type: 'Binary' },\n 0x2264: { name: 'BitDepth', type: 'Uint' },\n 0x62: { name: 'TrackOperation', type: 'Container' },\n 0x63: { name: 'TrackCombinePlanes', type: 'Container' },\n 0x64: { name: 'TrackPlane', type: 'Container' },\n 0x65: { name: 'TrackPlaneUID', type: 'Uint' },\n 0x66: { name: 'TrackPlaneType', type: 'Uint' },\n 0x69: { name: 'TrackJoinBlocks', type: 'Container' },\n 0x6d: { name: 'TrackJoinUID', type: 'Uint' },\n 0x40: { name: 'TrickTrackUID', type: 'Uint' },\n 0x41: { name: 'TrickTrackSegmentUID', type: 'Binary' },\n 0x46: { name: 'TrickTrackFlag', type: 'Uint' },\n 0x47: { name: 'TrickMasterTrackUID', type: 'Uint' },\n 0x44: { name: 'TrickMasterTrackSegmentUID', type: 'Binary' },\n 0x2d80: { name: 'ContentEncodings', type: 'Container' },\n 0x2240: { name: 'ContentEncoding', type: 'Container' },\n 0x1031: { name: 'ContentEncodingOrder', type: 'Uint' },\n 0x1032: { name: 'ContentEncodingScope', type: 'Uint' },\n 0x1033: { name: 'ContentEncodingType', type: 'Uint' },\n 0x1034: { name: 'ContentCompression', type: 'Container' },\n 0x254: { name: 'ContentCompAlgo', type: 'Uint' },\n 0x255: { name: 'ContentCompSettings', type: 'Binary' },\n 0x1035: { name: 'ContentEncryption', type: 'Container' },\n 0x7e1: { name: 'ContentEncAlgo', type: 'Uint' },\n 0x7e2: { name: 'ContentEncKeyID', type: 'Binary' },\n 0x7e3: { name: 'ContentSignature', type: 'Binary' },\n 0x7e4: { name: 'ContentSigKeyID', type: 'Binary' },\n 0x7e5: { name: 'ContentSigAlgo', type: 'Uint' },\n 0x7e6: { name: 'ContentSigHashAlgo', type: 'Uint' },\n 0xc53bb6b: { name: 'Cues', type: 'Container' },\n 0x3b: { name: 'CuePoint', type: 'Container' },\n 0x33: { name: 'CueTime', type: 'Uint' },\n 0x37: { name: 'CueTrackPositions', type: 'Container' },\n 0x77: { name: 'CueTrack', type: 'Uint' },\n 0x71: { name: 'CueClusterPosition', type: 'Uint' },\n 0x70: { name: 'CueRelativePosition', type: 'Uint' },\n 0x32: { name: 'CueDuration', type: 'Uint' },\n 0x1378: { name: 'CueBlockNumber', type: 'Uint' },\n 0x6a: { name: 'CueCodecState', type: 'Uint' },\n 0x5b: { name: 'CueReference', type: 'Container' },\n 0x16: { name: 'CueRefTime', type: 'Uint' },\n 0x17: { name: 'CueRefCluster', type: 'Uint' },\n 0x135f: { name: 'CueRefNumber', type: 'Uint' },\n 0x6b: { name: 'CueRefCodecState', type: 'Uint' },\n 0x941a469: { name: 'Attachments', type: 'Container' },\n 0x21a7: { name: 'AttachedFile', type: 'Container' },\n 0x67e: { name: 'FileDescription', type: 'String' },\n 0x66e: { name: 'FileName', type: 'String' },\n 0x660: { name: 'FileMimeType', type: 'String' },\n 0x65c: { name: 'FileData', type: 'Binary' },\n 0x6ae: { name: 'FileUID', type: 'Uint' },\n 0x675: { name: 'FileReferral', type: 'Binary' },\n 0x661: { name: 'FileUsedStartTime', type: 'Uint' },\n 0x662: { name: 'FileUsedEndTime', type: 'Uint' },\n 0x43a770: { name: 'Chapters', type: 'Container' },\n 0x5b9: { name: 'EditionEntry', type: 'Container' },\n 0x5bc: { name: 'EditionUID', type: 'Uint' },\n 0x5bd: { name: 'EditionFlagHidden', type: 'Uint' },\n 0x5db: { name: 'EditionFlagDefault', type: 'Uint' },\n 0x5dd: { name: 'EditionFlagOrdered', type: 'Uint' },\n 0x36: { name: 'ChapterAtom', type: 'Container' },\n 0x33c4: { name: 'ChapterUID', type: 'Uint' },\n 0x1654: { name: 'ChapterStringUID', type: 'String' },\n 0x11: { name: 'ChapterTimeStart', type: 'Uint' },\n 0x12: { name: 'ChapterTimeEnd', type: 'Uint' },\n 0x18: { name: 'ChapterFlagHidden', type: 'Uint' },\n 0x598: { name: 'ChapterFlagEnabled', type: 'Uint' },\n 0x2e67: { name: 'ChapterSegmentUID', type: 'Binary' },\n 0x2ebc: { name: 'ChapterSegmentEditionUID', type: 'Uint' },\n 0x23c3: { name: 'ChapterPhysicalEquiv', type: 'Uint' },\n 0xf: { name: 'ChapterTrack', type: 'Container' },\n 0x9: { name: 'ChapterTrackNumber', type: 'Uint' },\n 0x0: { name: 'ChapterDisplay', type: 'Container' },\n 0x5: { name: 'ChapString', type: 'String' },\n 0x37c: { name: 'ChapLanguage', type: 'String' },\n 0x37e: { name: 'ChapCountry', type: 'String' },\n 0x2944: { name: 'ChapProcess', type: 'Container' },\n 0x2955: { name: 'ChapProcessCodecID', type: 'Uint' },\n 0x50d: { name: 'ChapProcessPrivate', type: 'Binary' },\n 0x2911: { name: 'ChapProcessCommand', type: 'Container' },\n 0x2922: { name: 'ChapProcessTime', type: 'Uint' },\n 0x2933: { name: 'ChapProcessData', type: 'Binary' },\n 0x254c367: { name: 'Tags', type: 'Container' },\n 0x3373: { name: 'Tag', type: 'Container' },\n 0x23c0: { name: 'Targets', type: 'Container' },\n 0x28ca: { name: 'TargetTypeValue', type: 'Uint' },\n 0x23ca: { name: 'TargetType', type: 'String' },\n 0x23c5: { name: 'TagTrackUID', type: 'Uint' },\n 0x23c9: { name: 'TagEditionUID', type: 'Uint' },\n 0x23c4: { name: 'TagChapterUID', type: 'Uint' },\n 0x23c6: { name: 'TagAttachmentUID', type: 'Uint' },\n 0x27c8: { name: 'SimpleTag', type: 'Container' },\n 0x5a3: { name: 'TagName', type: 'String' },\n 0x47a: { name: 'TagLanguage', type: 'String' },\n 0x484: { name: 'TagDefault', type: 'Uint' },\n 0x487: { name: 'TagString', type: 'String' },\n 0x485: { name: 'TagBinary', type: 'Binary' }\n };\n\n function doInherit(newClass, baseClass) {\n newClass.prototype = Object.create(baseClass.prototype);\n newClass.prototype.constructor = newClass;\n }\n\n function WebmBase(name, type) {\n this.name = name || 'Unknown';\n this.type = type || 'Unknown';\n }\n WebmBase.prototype.updateBySource = function() { };\n WebmBase.prototype.setSource = function(source) {\n this.source = source;\n this.updateBySource();\n };\n WebmBase.prototype.updateByData = function() { };\n WebmBase.prototype.setData = function(data) {\n this.data = data;\n this.updateByData();\n };\n\n function WebmUint(name, type) {\n WebmBase.call(this, name, type || 'Uint');\n }\n doInherit(WebmUint, WebmBase);\n function padHex(hex) {\n return hex.length % 2 === 1 ? '0' + hex : hex;\n }\n WebmUint.prototype.updateBySource = function() {\n // use hex representation of a number instead of number value\n this.data = '';\n for (var i = 0; i < this.source.length; i++) {\n var hex = this.source[i].toString(16);\n this.data += padHex(hex);\n }\n };\n WebmUint.prototype.updateByData = function() {\n var length = this.data.length / 2;\n this.source = new Uint8Array(length);\n for (var i = 0; i < length; i++) {\n var hex = this.data.substr(i * 2, 2);\n this.source[i] = parseInt(hex, 16);\n }\n };\n WebmUint.prototype.getValue = function() {\n return parseInt(this.data, 16);\n };\n WebmUint.prototype.setValue = function(value) {\n this.setData(padHex(value.toString(16)));\n };\n\n function WebmFloat(name, type) {\n WebmBase.call(this, name, type || 'Float');\n }\n doInherit(WebmFloat, WebmBase);\n WebmFloat.prototype.getFloatArrayType = function() {\n return this.source && this.source.length === 4 ? Float32Array : Float64Array;\n };\n WebmFloat.prototype.updateBySource = function() {\n var byteArray = this.source.reverse();\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType(byteArray.buffer);\n this.data = floatArray[0];\n };\n WebmFloat.prototype.updateByData = function() {\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType([ this.data ]);\n var byteArray = new Uint8Array(floatArray.buffer);\n this.source = byteArray.reverse();\n };\n WebmFloat.prototype.getValue = function() {\n return this.data;\n };\n WebmFloat.prototype.setValue = function(value) {\n this.setData(value);\n };\n\n function WebmContainer(name, type) {\n WebmBase.call(this, name, type || 'Container');\n }\n doInherit(WebmContainer, WebmBase);\n WebmContainer.prototype.readByte = function() {\n return this.source[this.offset++];\n };\n WebmContainer.prototype.readUint = function() {\n var firstByte = this.readByte();\n var bytes = 8 - firstByte.toString(2).length;\n var value = firstByte - (1 << (7 - bytes));\n for (var i = 0; i < bytes; i++) {\n // don't use bit operators to support x86\n value *= 256;\n value += this.readByte();\n }\n return value;\n };\n WebmContainer.prototype.updateBySource = function() {\n this.data = [];\n for (this.offset = 0; this.offset < this.source.length; this.offset = end) {\n var id = this.readUint();\n var len = this.readUint();\n var end = Math.min(this.offset + len, this.source.length);\n var data = this.source.slice(this.offset, end);\n\n var info = sections[id] || { name: 'Unknown', type: 'Unknown' };\n var ctr = WebmBase;\n switch (info.type) {\n case 'Container':\n ctr = WebmContainer;\n break;\n case 'Uint':\n ctr = WebmUint;\n break;\n case 'Float':\n ctr = WebmFloat;\n break;\n }\n var section = new ctr(info.name, info.type);\n section.setSource(data);\n this.data.push({\n id: id,\n idHex: id.toString(16),\n data: section\n });\n }\n };\n WebmContainer.prototype.writeUint = function(x, draft) {\n for (var bytes = 1, flag = 0x80; x >= flag && bytes < 8; bytes++, flag *= 0x80) { }\n\n if (!draft) {\n var value = flag + x;\n for (var i = bytes - 1; i >= 0; i--) {\n // don't use bit operators to support x86\n var c = value % 256;\n this.source[this.offset + i] = c;\n value = (value - c) / 256;\n }\n }\n\n this.offset += bytes;\n };\n WebmContainer.prototype.writeSections = function(draft) {\n this.offset = 0;\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i],\n content = section.data.source,\n contentLength = content.length;\n this.writeUint(section.id, draft);\n this.writeUint(contentLength, draft);\n if (!draft) {\n this.source.set(content, this.offset);\n }\n this.offset += contentLength;\n }\n return this.offset;\n };\n WebmContainer.prototype.updateByData = function() {\n // run without accessing this.source to determine total length - need to know it to create Uint8Array\n var length = this.writeSections('draft');\n this.source = new Uint8Array(length);\n // now really write data\n this.writeSections();\n };\n WebmContainer.prototype.getSectionById = function(id) {\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i];\n if (section.id === id) {\n return section.data;\n }\n }\n return null;\n };\n\n function WebmFile(source) {\n WebmContainer.call(this, 'File', 'File');\n this.setSource(source);\n }\n doInherit(WebmFile, WebmContainer);\n WebmFile.prototype.fixDuration = function(duration, options) {\n var logger = options && options.logger;\n if (logger === undefined) {\n logger = function(message) {\n console.log(message);\n };\n } else if (!logger) {\n logger = function() { };\n }\n\n var segmentSection = this.getSectionById(0x8538067);\n if (!segmentSection) {\n logger('[fix-webm-duration] Segment section is missing');\n return false;\n }\n\n var infoSection = segmentSection.getSectionById(0x549a966);\n if (!infoSection) {\n logger('[fix-webm-duration] Info section is missing');\n return false;\n }\n\n var timeScaleSection = infoSection.getSectionById(0xad7b1);\n if (!timeScaleSection) {\n logger('[fix-webm-duration] TimecodeScale section is missing');\n return false;\n }\n\n var durationSection = infoSection.getSectionById(0x489);\n if (durationSection) {\n if (durationSection.getValue() <= 0) {\n logger(`[fix-webm-duration] Duration section is present, but the value is ${durationSection.getValue()}`);\n durationSection.setValue(duration);\n } else {\n logger(`[fix-webm-duration] Duration section is present, and the value is ${durationSection.getValue()}`);\n return false;\n }\n } else {\n logger('[fix-webm-duration] Duration section is missing');\n // append Duration section\n durationSection = new WebmFloat('Duration', 'Float');\n durationSection.setValue(duration);\n infoSection.data.push({\n id: 0x489,\n data: durationSection\n });\n }\n\n // set default time scale to 1 millisecond (1000000 nanoseconds)\n timeScaleSection.setValue(1000000);\n infoSection.updateByData();\n segmentSection.updateByData();\n this.updateByData();\n\n return true;\n };\n WebmFile.prototype.toBlob = function(mimeType) {\n return new Blob([ this.source.buffer ], { type: mimeType || 'video/webm' });\n };\n\n function fixWebmDuration(blob, duration, callback, options) {\n // The callback may be omitted - then the third argument is options\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n\n if (!callback) {\n return new Promise(function(resolve) {\n fixWebmDuration(blob, duration, resolve, options);\n });\n }\n\n try {\n var reader = new FileReader();\n reader.onloadend = function() {\n try {\n var file = new WebmFile(new Uint8Array(reader.result));\n if (file.fixDuration(duration, options)) {\n blob = file.toBlob(blob.type);\n }\n } catch (ex) {\n // ignore\n }\n callback(blob);\n };\n reader.readAsArrayBuffer(blob);\n } catch (ex) {\n callback(blob);\n }\n }\n\n // Support AMD import default\n fixWebmDuration.default = fixWebmDuration;\n\n return fixWebmDuration;\n});\n","import ysFixWebmDuration from \"fix-webm-duration\";\n\nexport class ProcessVideo extends HTMLElement {\n private phrase: string;\n private previewStream: MediaStream | null = null;\n private recordedChunks: Blob[] = [];\n private mediaRecorder: MediaRecorder | null = null;\n private videoFile: File | null = null;\n private startTime: number = 0;\n private timerInterval: ReturnType<typeof setInterval> | null = null;\n private recordingTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private videoElement!: HTMLVideoElement;\n private fileInput!: HTMLInputElement;\n private recordButton!: HTMLButtonElement;\n private stopButton!: HTMLButtonElement;\n private submitButton!: HTMLButtonElement;\n\n private errorState: string | null = null;\n private timeLimit: number = 30;\n\n constructor() {\n super();\n\n this.phrase = this.generateDefaultPhrase();\n\n // Attach shadow DOM and initialize UI\n this.attachShadow({ mode: 'open' });\n this.initializeUI();\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n disconnectedCallback() {\n this.stopRecording();\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n }\n\n attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null) {\n if (name === 'endpoint' && newValue !== this.endpoint) {\n this.endpoint = newValue;\n }\n }\n\n private generateDefaultPhrase(): string {\n return Math.random().toString().slice(2, 10); // 8-digit random phrase\n }\n\n initializeUI() {\n const phraseDisplay = this.phrase\n .split(\"\")\n .map((digit) => `<span class=\"digit\">${digit}</span>`)\n .join(\" \");\n\n this.shadowRoot!.innerHTML = `\n <style>\n :host {\n display: block;\n font-family: Arial, sans-serif;\n --primary-color: #007bff;\n --secondary-color: #6c757d;\n --button-bg: var(--primary-color);\n --button-text-color: #fff;\n --input-border-color: var(--secondary-color);\n --input-focus-border-color: var(--primary-color);\n --spacing: 16px;\n --button-padding: 10px 20px;\n --border-radius: 4px;\n }\n \n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--spacing);\n padding: var(--spacing);\n max-width: 500px;\n margin: 0 auto;\n text-align: center;\n }\n\n .video-wrapper {\n position: relative;\n display: inline-block;\n }\n\n #timer-overlay {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n font-family: Arial, sans-serif;\n font-size: 14px;\n }\n\n video {\n max-width: 100%;\n border-radius: var(--border-radius);\n }\n\n input[type=\"text\"], input[type=\"file\"] {\n padding: var(--button-padding);\n border: 1px solid var(--input-border-color);\n border-radius: var(--border-radius);\n width: 100%;\n max-width: 100%;\n }\n\n input[type=\"text\"]:focus, input[type=\"file\"]:focus {\n outline: none;\n border-color: var(--input-focus-border-color);\n }\n\n .hidden {\n display: none;\n }\n\n .phrase-display {\n font-size: 24px;\n font-weight: bold;\n display: flex;\n gap: 8px;\n justify-content: center;\n }\n .digit {\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n text-align: center;\n width: 24px;\n }\n\n </style>\n <div class=\"container\">\n <slot name=\"video\">\n <div class=\"video-wrapper\">\n <video id=\"video-preview\" muted autoplay></video>\n <div id=\"timer-overlay\" class=\"hidden\">00:00</div>\n </div>\n </slot>\n <slot name=\"phrase-display\">\n <div class=\"phrase-display\">\n ${phraseDisplay}\n </div>\n </slot>\n <slot name=\"record-button\">\n <button id=\"record-button\">Start Recording</button>\n </slot>\n <slot name=\"stop-button\">\n <button id=\"stop-button\" disabled>Stop Recording</button>\n </slot>\n <slot name=\"file-input\">\n <input type=\"file\" accept=\"video/*\" id=\"file-input\" />\n </slot>\n <slot name=\"submit-button\">\n <button id=\"submit-button\">Submit Video</button>\n </slot>\n <slot name=\"loading\">\n <div class=\"message\">Loading...</div>\n </slot>\n <slot name=\"error\">\n <div class=\"message error\">An error occurred</div>\n </slot>\n <slot name=\"success\">\n <div class=\"message success\">Video submitted successfully!</div>\n </slot>\n </div>\n `;\n this.attachSlotListeners();\n this.setupPreview();\n this.toggleState(null);\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadowRoot!.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const recordButtonSlot = this.shadowRoot!.querySelector('slot[name=\"record-button\"]') as HTMLSlotElement;\n const stopButtonSlot = this.shadowRoot!.querySelector('slot[name=\"stop-button\"]') as HTMLSlotElement;\n const fileInputSlot = this.shadowRoot!.querySelector('slot[name=\"file-input\"]') as HTMLSlotElement;\n const submitButtonSlot = this.shadowRoot!.querySelector('slot[name=\"submit-button\"]') as HTMLSlotElement;\n\n this.videoElement = this.getSlotElement(videoSlot, '#video-preview', HTMLVideoElement);\n this.recordButton = this.getSlotElement(recordButtonSlot, '#record-button', HTMLButtonElement);\n this.stopButton = this.getSlotElement(stopButtonSlot, '#stop-button', HTMLButtonElement);\n this.fileInput = this.getSlotElement(fileInputSlot, '#file-input', HTMLInputElement);\n this.submitButton = this.getSlotElement(submitButtonSlot, '#submit-button', HTMLButtonElement);\n\n if (this.fileInput) {\n this.fileInput.addEventListener('change', (e) => this.handleFileUpload(e));\n }\n if (this.recordButton) {\n this.recordButton.addEventListener(\"click\", () => this.startRecording());\n }\n if (this.stopButton) {\n this.stopButton.addEventListener(\"click\", () => this.stopRecording());\n }\n if (this.submitButton) {\n this.submitButton.addEventListener(\"click\", () => this.handleSubmit())\n }\n }\n\n private getSlotElement<T extends HTMLElement>(\n slot: HTMLSlotElement,\n fallbackSelector: string,\n elementType: { new(): T }\n ): T {\n const assignedElements = slot.assignedElements();\n return (assignedElements.length > 0 ? assignedElements[0] : null) as T || this.shadowRoot!.querySelector(fallbackSelector) as T;\n }\n\n replaceSlotContent(slotName: string, content: string | HTMLElement) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n if (typeof content === 'string') {\n slot.innerHTML = content;\n } else if (content instanceof HTMLElement) {\n slot.innerHTML = '';\n slot.appendChild(content);\n }\n }\n }\n\n removeSlotListener(slotName: string, event: string, callback: EventListener) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (slot) {\n const assignedNodes = slot.assignedElements();\n assignedNodes.forEach((node) => {\n node.removeEventListener(event, callback);\n });\n }\n }\n\n private toggleState(state: 'loading' | 'success' | 'error' | null) {\n const states = ['loading', 'success', 'error'];\n\n states.forEach((slotName) => {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? 'block' : 'none';\n }\n });\n }\n\n private convertPhraseToWords(phrase: string): string {\n const digitWords = [\n \"zero\", \"one\", \"two\", \"three\", \"four\",\n \"five\", \"six\", \"seven\", \"eight\", \"nine\"\n ];\n\n return phrase\n .split(\"\")\n .map((digit) => digitWords[parseInt(digit, 10)])\n .join(\" \");\n }\n\n private async setupPreview() {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });\n this.previewStream = stream;\n\n this.videoElement.srcObject = stream;\n this.videoElement.controls = false;\n this.videoElement.play();\n } catch (error) {\n this.toggleState('error');\n console.error('Error setting up video preview:', error);\n }\n }\n\n private async startTimer() {\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.textContent = '00:00';\n timerOverlay.classList.remove('hidden');\n\n let seconds = 0;\n this.timerInterval = setInterval(() => {\n seconds++;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n timerOverlay.textContent = `${String(minutes).padStart(2, '0')}:${String(remainingSeconds).padStart(2, '0')}`;\n }, 1000);\n\n this.recordingTimeout = setTimeout(() => {\n this.stopRecording();\n }, this.timeLimit * 1000);\n }\n\n private async stopTimer() {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n if (this.timerInterval) {\n clearInterval(this.timerInterval);\n this.timerInterval = null;\n }\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.classList.add('hidden');\n }\n\n public async startRecording() {\n if (!window.MediaRecorder) {\n console.error('MediaRecorder API is not supported in this browser');\n return;\n }\n try {\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n console.log('Recording already in progress.');\n return;\n }\n\n if (!this.previewStream) {\n console.log('Initializing preview stream...');\n this.previewStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n });\n }\n\n this.videoElement.muted = true;\n this.videoElement.srcObject = this.previewStream;\n this.videoElement.currentTime = 0;\n\n await this.videoElement.play();\n\n this.mediaRecorder = new MediaRecorder(this.previewStream);\n this.recordedChunks = [];\n\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n\n this.mediaRecorder.onstop = () => {\n const duration = Date.now() - this.startTime;\n const buggyBlob = new Blob(this.recordedChunks, { type: 'video/webm' });\n\n ysFixWebmDuration(buggyBlob, duration, { logger: false })\n .then((fixedBlob: Blob) => {\n this.onStopMediaRecorder(fixedBlob);\n });\n };\n\n this.mediaRecorder.start();\n this.startTimer();\n this.startTime = Date.now();\n\n this.recordButton.disabled = true;\n this.stopButton.disabled = false;\n this.videoElement.controls = false;\n } catch (error) {\n console.error('Error starting video recording:', error);\n }\n }\n\n public stopRecording() {\n try {\n if (!this.mediaRecorder || this.mediaRecorder.state === 'inactive') {\n console.log('No recording in progress.');\n return;\n }\n\n this.mediaRecorder.stop();\n\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n this.videoElement.srcObject = null;\n this.videoElement.src = '';\n this.videoElement.controls = false;\n\n this.recordButton.disabled = false;\n this.stopButton.disabled = true;\n\n this.mediaRecorder = null;\n this.previewStream = null;\n\n } catch (error) {\n console.error('Error stopping video recording:', error);\n }\n }\n\n private onStopMediaRecorder(blob: Blob) {\n const videoURL = URL.createObjectURL(blob);\n this.videoFile = new File([blob], 'recorded_video.webm', { type: 'video/webm' });\n this.recordedChunks = [];\n\n this.videoElement.src = videoURL;\n this.videoElement.controls = true;\n this.videoElement.play();\n this.videoElement.muted = false;\n this.stopTimer();\n\n // Clean up the object URL when the video loads\n this.videoElement.onloadeddata = () => {\n URL.revokeObjectURL(videoURL);\n };\n }\n\n private handleFileUpload(event: Event) {\n const file = (event.target as HTMLInputElement).files?.[0];\n if (file?.type?.startsWith('video/')) {\n if (file.size > 100 * 1024 * 1024) { // 100MB limit\n this.toggleState('error');\n console.error('File size exceeds limit of 100MB');\n return;\n }\n this.videoFile = file;\n this.videoElement.src = URL.createObjectURL(file);\n this.videoElement.play();\n } else {\n this.toggleState('error');\n console.error('Please select a valid video file.');\n }\n }\n\n public async handleSubmit() {\n if (!this.videoFile) {\n this.toggleState('error');\n console.error('No video file to submit.');\n return;\n }\n\n if (!this.endpoint) {\n this.toggleState('error');\n console.error('Endpoint must be provided.');\n return;\n }\n\n if (!this.userFullname) {\n this.toggleState('error');\n console.error('User full name must be provided.');\n return;\n }\n\n this.toggleState('loading');\n\n try {\n const formData = new FormData();\n formData.append('video', this.videoFile);\n formData.append('phrase', this.convertPhraseToWords(this.phrase));\n formData.append('userFullname', this.userFullname);\n\n const response = await fetch(this.endpoint, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n console.log('Response from endpoint:', result);\n this.toggleState('success');\n } catch (error) {\n this.toggleState('error');\n console.error('Error submitting video:', error);\n }\n }\n\n static get observedAttributes() {\n return ['endpoint', 'user-fullname'];\n }\n\n get userFullname(): string | null {\n return this.getAttribute('user-fullname');\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute('user-fullname', value);\n } else {\n this.removeAttribute('user-fullname');\n }\n }\n\n get isRecording(): boolean {\n return this.mediaRecorder?.state === 'recording';\n }\n\n get currentPhrase(): string {\n return this.phrase;\n }\n\n get videoDuration(): number | null {\n return this.videoElement?.duration || null;\n }\n\n get currentFile(): File | null {\n return this.videoFile;\n }\n\n get currentStream(): MediaStream | null {\n return this.previewStream;\n }\n\n get videoElementRef(): HTMLVideoElement {\n return this.videoElement;\n }\n\n get fileInputRef(): HTMLInputElement {\n return this.fileInput;\n }\n\n get recordingTimeLimit(): number {\n return this.timeLimit;\n }\n\n set recordingTimeLimit(value: number) {\n this.timeLimit = value;\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording') {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n this.recordingTimeout = setTimeout(() => this.stopRecording(), this.timeLimit * 1000);\n }\n }\n}\n\ncustomElements.define('process-video', ProcessVideo);\n"],"names":[],"mappings":"AAAA,IAAY,kBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,SAAkB;AAClB,IAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;AAChC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;AAK9B,IAAY,uBAOX;AAPD,CAAA,UAAY,uBAAuB,EAAA;AACjC,IAAA,uBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uBAAA,CAAA,aAAA,C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ts","../src/ui/biometry-enrollment.ts","../node_modules/fix-webm-duration/fix-webm-duration.js","../src/ui/process-video.ts","../src/ui/doc-auth.ts"],"sourcesContent":["export enum BiometryAttributes {\n ApiKey = 'api-key',\n UserFullname = 'user-fullname',\n}\n\nexport enum BiometryEnrollmentState {\n Loading = 'loading',\n Success = 'success',\n ErrorNoFace = 'error-no-face',\n ErrorMultipleFaces = 'error-multiple-faces',\n ErrorNotCentered = 'error-not-centered',\n ErrorOther = 'error-other',\n}\n","import { BiometryAttributes, BiometryEnrollmentState } from \"./types.js\";\n\nexport class BiometryEnrollment extends HTMLElement {\n private readonly shadow: ShadowRoot;\n private videoElement: HTMLVideoElement | null = null;\n private canvasElement: HTMLCanvasElement | null = null;\n private captureButton: HTMLButtonElement | null = null;\n\n private resultCode?: number;\n private description?: string;\n\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: \"open\" });\n\n this.toggleState = this.toggleState.bind(this);\n this.capturePhoto = this.capturePhoto.bind(this);\n }\n\n static get observedAttributes(): string[] {\n return Object.values(BiometryAttributes);\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n get userFullname(): string | null {\n return this.getAttribute(\"user-fullname\");\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute(\"user-fullname\", value);\n } else {\n this.removeAttribute(\"user-fullname\");\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (name === \"endpoint\" || name === \"user-fullname\") {\n if (name === \"endpoint\") {\n this.endpoint = newValue;\n } else if (name === \"user-fullname\") {\n this.userFullname = newValue;\n }\n this.validateAttributes();\n }\n }\n\n connectedCallback(): void {\n this.validateAttributes();\n this.init();\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n if (this.captureButton) {\n this.captureButton.removeEventListener(\"click\", this.capturePhoto);\n }\n }\n\n validateAttributes(): void {\n if (!this.endpoint) {\n console.error(\"Endpoint is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n if (!this.userFullname) {\n console.error(\"User fullname is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n }\n\n init(): void {\n this.shadow.innerHTML = `\n <style>\n .wrapper {\n position: relative;\n }\n video {\n transform: scaleX(-1); /* Flip video for preview */\n max-width: 100%;\n border-radius: var(--border-radius, 8px);\n }\n canvas {\n display: none;\n }\n </style>\n <div class=\"wrapper\">\n <slot name=\"video\">\n <video id=\"video\" autoplay playsinline></video>\n </slot>\n <slot name=\"canvas\">\n <canvas id=\"canvas\" style=\"display: none;\"></canvas>\n </slot>\n <slot name=\"button\">\n <button id=\"button\">Capture Photo</button>\n </slot>\n <div class=\"status\">\n <slot name=\"loading\" class=\"loading\"></slot>\n <slot name=\"success\" class=\"success\"></slot>\n <slot name=\"error-no-face\" class=\"error-no-face\"></slot>\n <slot name=\"error-multiple-faces\" class=\"error-multiple-faces\"></slot>\n <slot name=\"error-not-centered\" class=\"error-not-centered\"></slot>\n <slot name=\"error-other\" class=\"error-other\"></slot>\n </div>\n </div>\n `;\n\n this.attachSlotListeners();\n this.setupCamera();\n this.toggleState(\"\");\n }\n\n public cleanup(): void {\n if (this.videoElement?.srcObject) {\n const tracks = (this.videoElement.srcObject as MediaStream).getTracks();\n tracks.forEach((track) => track.stop());\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n }\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadow.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const canvasSlot = this.shadow.querySelector('slot[name=\"canvas\"]') as HTMLSlotElement;\n const buttonSlot = this.shadow.querySelector('slot[name=\"button\"]') as HTMLSlotElement;\n\n const assignedVideoElements = videoSlot.assignedElements();\n this.videoElement = (assignedVideoElements.length > 0 ? assignedVideoElements[0] : null) as HTMLVideoElement || this.shadow.querySelector(\"#video\") as HTMLVideoElement;\n\n const assignedCanvasElements = canvasSlot.assignedElements();\n this.canvasElement = (assignedCanvasElements.length > 0 ? assignedCanvasElements[0] : null) as HTMLCanvasElement || this.shadow.querySelector(\"#canvas\") as HTMLCanvasElement;\n\n const assignedButtonElements = buttonSlot.assignedElements();\n this.captureButton = (assignedButtonElements.length > 0 ? assignedButtonElements[0] : null) as HTMLButtonElement || this.shadow.querySelector(\"#button\") as HTMLButtonElement;\n\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n if (!this.captureButton) {\n console.error(\"Capture button is missing.\");\n return;\n } else {\n this.captureButton.addEventListener(\"click\", this.capturePhoto);\n }\n }\n\n private setupCamera(): void {\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n navigator.mediaDevices\n .getUserMedia({ video: true })\n .then((stream) => {\n this.videoElement!.srcObject = stream;\n })\n .catch((error) => {\n console.error(\"Error accessing camera:\", error);\n });\n }\n\n private async capturePhoto(): Promise<void> {\n try {\n if (!this.videoElement || !this.canvasElement) {\n console.error(\"Essential elements are not initialized.\");\n return;\n }\n\n const context = this.canvasElement.getContext(\"2d\");\n this.canvasElement.width = this.videoElement.videoWidth;\n this.canvasElement.height = this.videoElement.videoHeight;\n\n context!.drawImage(\n this.videoElement,\n 0,\n 0,\n this.canvasElement.width,\n this.canvasElement.height\n );\n\n this.toggleState(\"loading\");\n\n this.canvasElement.toBlob(async (blob) => {\n try {\n if (!blob) {\n console.error(\"Failed to capture photo.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n const file = new File([blob], \"onboard-face.jpg\", { type: \"image/jpeg\" });\n const formData = new FormData();\n formData.append('photo', file);\n formData.append('userFullname', this.userFullname || '');\n\n const response = await fetch(this.endpoint!, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n this.resultCode = result?.code;\n this.description = result?.description || \"Unknown error occurred.\";\n\n switch (this.resultCode) {\n case 0:\n this.toggleState(BiometryEnrollmentState.Success);\n break;\n case 1:\n this.toggleState(BiometryEnrollmentState.ErrorNoFace);\n break;\n case 2:\n this.toggleState(BiometryEnrollmentState.ErrorMultipleFaces);\n break;\n case 3:\n this.toggleState(BiometryEnrollmentState.ErrorNotCentered);\n break;\n default:\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n\n console.log(\"Enrollment result:\", result);\n } catch (error) {\n console.error(\"Error in toBlob callback:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }, \"image/jpeg\");\n } catch (error) {\n console.error(\"Error capturing photo:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }\n\n private toggleState(state: BiometryEnrollmentState | string): void {\n const slots = [\n BiometryEnrollmentState.Loading,\n BiometryEnrollmentState.Success,\n BiometryEnrollmentState.ErrorNoFace,\n BiometryEnrollmentState.ErrorMultipleFaces,\n BiometryEnrollmentState.ErrorNotCentered,\n BiometryEnrollmentState.ErrorOther,\n ];\n\n slots.forEach((slotName) => {\n const slot = this.shadow.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? \"block\" : \"none\";\n }\n });\n }\n}\n\ncustomElements.define(\"biometry-enrollment\", BiometryEnrollment);","(function (name, definition) {\n if (typeof define === 'function' && define.amd) { // RequireJS / AMD\n define(definition);\n } else if (typeof module !== 'undefined' && module.exports) { // CommonJS / Node.js\n module.exports = definition();\n } else { // Direct include\n window.ysFixWebmDuration = definition();\n }\n})('fix-webm-duration', function () {\n /*\n * This is the list of possible WEBM file sections by their IDs.\n * Possible types: Container, Binary, Uint, Int, String, Float, Date\n */\n var sections = {\n 0xa45dfa3: { name: 'EBML', type: 'Container' },\n 0x286: { name: 'EBMLVersion', type: 'Uint' },\n 0x2f7: { name: 'EBMLReadVersion', type: 'Uint' },\n 0x2f2: { name: 'EBMLMaxIDLength', type: 'Uint' },\n 0x2f3: { name: 'EBMLMaxSizeLength', type: 'Uint' },\n 0x282: { name: 'DocType', type: 'String' },\n 0x287: { name: 'DocTypeVersion', type: 'Uint' },\n 0x285: { name: 'DocTypeReadVersion', type: 'Uint' },\n 0x6c: { name: 'Void', type: 'Binary' },\n 0x3f: { name: 'CRC-32', type: 'Binary' },\n 0xb538667: { name: 'SignatureSlot', type: 'Container' },\n 0x3e8a: { name: 'SignatureAlgo', type: 'Uint' },\n 0x3e9a: { name: 'SignatureHash', type: 'Uint' },\n 0x3ea5: { name: 'SignaturePublicKey', type: 'Binary' },\n 0x3eb5: { name: 'Signature', type: 'Binary' },\n 0x3e5b: { name: 'SignatureElements', type: 'Container' },\n 0x3e7b: { name: 'SignatureElementList', type: 'Container' },\n 0x2532: { name: 'SignedElement', type: 'Binary' },\n 0x8538067: { name: 'Segment', type: 'Container' },\n 0x14d9b74: { name: 'SeekHead', type: 'Container' },\n 0xdbb: { name: 'Seek', type: 'Container' },\n 0x13ab: { name: 'SeekID', type: 'Binary' },\n 0x13ac: { name: 'SeekPosition', type: 'Uint' },\n 0x549a966: { name: 'Info', type: 'Container' },\n 0x33a4: { name: 'SegmentUID', type: 'Binary' },\n 0x3384: { name: 'SegmentFilename', type: 'String' },\n 0x1cb923: { name: 'PrevUID', type: 'Binary' },\n 0x1c83ab: { name: 'PrevFilename', type: 'String' },\n 0x1eb923: { name: 'NextUID', type: 'Binary' },\n 0x1e83bb: { name: 'NextFilename', type: 'String' },\n 0x444: { name: 'SegmentFamily', type: 'Binary' },\n 0x2924: { name: 'ChapterTranslate', type: 'Container' },\n 0x29fc: { name: 'ChapterTranslateEditionUID', type: 'Uint' },\n 0x29bf: { name: 'ChapterTranslateCodec', type: 'Uint' },\n 0x29a5: { name: 'ChapterTranslateID', type: 'Binary' },\n 0xad7b1: { name: 'TimecodeScale', type: 'Uint' },\n 0x489: { name: 'Duration', type: 'Float' },\n 0x461: { name: 'DateUTC', type: 'Date' },\n 0x3ba9: { name: 'Title', type: 'String' },\n 0xd80: { name: 'MuxingApp', type: 'String' },\n 0x1741: { name: 'WritingApp', type: 'String' },\n // 0xf43b675: { name: 'Cluster', type: 'Container' },\n 0x67: { name: 'Timecode', type: 'Uint' },\n 0x1854: { name: 'SilentTracks', type: 'Container' },\n 0x18d7: { name: 'SilentTrackNumber', type: 'Uint' },\n 0x27: { name: 'Position', type: 'Uint' },\n 0x2b: { name: 'PrevSize', type: 'Uint' },\n 0x23: { name: 'SimpleBlock', type: 'Binary' },\n 0x20: { name: 'BlockGroup', type: 'Container' },\n 0x21: { name: 'Block', type: 'Binary' },\n 0x22: { name: 'BlockVirtual', type: 'Binary' },\n 0x35a1: { name: 'BlockAdditions', type: 'Container' },\n 0x26: { name: 'BlockMore', type: 'Container' },\n 0x6e: { name: 'BlockAddID', type: 'Uint' },\n 0x25: { name: 'BlockAdditional', type: 'Binary' },\n 0x1b: { name: 'BlockDuration', type: 'Uint' },\n 0x7a: { name: 'ReferencePriority', type: 'Uint' },\n 0x7b: { name: 'ReferenceBlock', type: 'Int' },\n 0x7d: { name: 'ReferenceVirtual', type: 'Int' },\n 0x24: { name: 'CodecState', type: 'Binary' },\n 0x35a2: { name: 'DiscardPadding', type: 'Int' },\n 0xe: { name: 'Slices', type: 'Container' },\n 0x68: { name: 'TimeSlice', type: 'Container' },\n 0x4c: { name: 'LaceNumber', type: 'Uint' },\n 0x4d: { name: 'FrameNumber', type: 'Uint' },\n 0x4b: { name: 'BlockAdditionID', type: 'Uint' },\n 0x4e: { name: 'Delay', type: 'Uint' },\n 0x4f: { name: 'SliceDuration', type: 'Uint' },\n 0x48: { name: 'ReferenceFrame', type: 'Container' },\n 0x49: { name: 'ReferenceOffset', type: 'Uint' },\n 0x4a: { name: 'ReferenceTimeCode', type: 'Uint' },\n 0x2f: { name: 'EncryptedBlock', type: 'Binary' },\n 0x654ae6b: { name: 'Tracks', type: 'Container' },\n 0x2e: { name: 'TrackEntry', type: 'Container' },\n 0x57: { name: 'TrackNumber', type: 'Uint' },\n 0x33c5: { name: 'TrackUID', type: 'Uint' },\n 0x3: { name: 'TrackType', type: 'Uint' },\n 0x39: { name: 'FlagEnabled', type: 'Uint' },\n 0x8: { name: 'FlagDefault', type: 'Uint' },\n 0x15aa: { name: 'FlagForced', type: 'Uint' },\n 0x1c: { name: 'FlagLacing', type: 'Uint' },\n 0x2de7: { name: 'MinCache', type: 'Uint' },\n 0x2df8: { name: 'MaxCache', type: 'Uint' },\n 0x3e383: { name: 'DefaultDuration', type: 'Uint' },\n 0x34e7a: { name: 'DefaultDecodedFieldDuration', type: 'Uint' },\n 0x3314f: { name: 'TrackTimecodeScale', type: 'Float' },\n 0x137f: { name: 'TrackOffset', type: 'Int' },\n 0x15ee: { name: 'MaxBlockAdditionID', type: 'Uint' },\n 0x136e: { name: 'Name', type: 'String' },\n 0x2b59c: { name: 'Language', type: 'String' },\n 0x6: { name: 'CodecID', type: 'String' },\n 0x23a2: { name: 'CodecPrivate', type: 'Binary' },\n 0x58688: { name: 'CodecName', type: 'String' },\n 0x3446: { name: 'AttachmentLink', type: 'Uint' },\n 0x1a9697: { name: 'CodecSettings', type: 'String' },\n 0x1b4040: { name: 'CodecInfoURL', type: 'String' },\n 0x6b240: { name: 'CodecDownloadURL', type: 'String' },\n 0x2a: { name: 'CodecDecodeAll', type: 'Uint' },\n 0x2fab: { name: 'TrackOverlay', type: 'Uint' },\n 0x16aa: { name: 'CodecDelay', type: 'Uint' },\n 0x16bb: { name: 'SeekPreRoll', type: 'Uint' },\n 0x2624: { name: 'TrackTranslate', type: 'Container' },\n 0x26fc: { name: 'TrackTranslateEditionUID', type: 'Uint' },\n 0x26bf: { name: 'TrackTranslateCodec', type: 'Uint' },\n 0x26a5: { name: 'TrackTranslateTrackID', type: 'Binary' },\n 0x60: { name: 'Video', type: 'Container' },\n 0x1a: { name: 'FlagInterlaced', type: 'Uint' },\n 0x13b8: { name: 'StereoMode', type: 'Uint' },\n 0x13c0: { name: 'AlphaMode', type: 'Uint' },\n 0x13b9: { name: 'OldStereoMode', type: 'Uint' },\n 0x30: { name: 'PixelWidth', type: 'Uint' },\n 0x3a: { name: 'PixelHeight', type: 'Uint' },\n 0x14aa: { name: 'PixelCropBottom', type: 'Uint' },\n 0x14bb: { name: 'PixelCropTop', type: 'Uint' },\n 0x14cc: { name: 'PixelCropLeft', type: 'Uint' },\n 0x14dd: { name: 'PixelCropRight', type: 'Uint' },\n 0x14b0: { name: 'DisplayWidth', type: 'Uint' },\n 0x14ba: { name: 'DisplayHeight', type: 'Uint' },\n 0x14b2: { name: 'DisplayUnit', type: 'Uint' },\n 0x14b3: { name: 'AspectRatioType', type: 'Uint' },\n 0xeb524: { name: 'ColourSpace', type: 'Binary' },\n 0xfb523: { name: 'GammaValue', type: 'Float' },\n 0x383e3: { name: 'FrameRate', type: 'Float' },\n 0x61: { name: 'Audio', type: 'Container' },\n 0x35: { name: 'SamplingFrequency', type: 'Float' },\n 0x38b5: { name: 'OutputSamplingFrequency', type: 'Float' },\n 0x1f: { name: 'Channels', type: 'Uint' },\n 0x3d7b: { name: 'ChannelPositions', type: 'Binary' },\n 0x2264: { name: 'BitDepth', type: 'Uint' },\n 0x62: { name: 'TrackOperation', type: 'Container' },\n 0x63: { name: 'TrackCombinePlanes', type: 'Container' },\n 0x64: { name: 'TrackPlane', type: 'Container' },\n 0x65: { name: 'TrackPlaneUID', type: 'Uint' },\n 0x66: { name: 'TrackPlaneType', type: 'Uint' },\n 0x69: { name: 'TrackJoinBlocks', type: 'Container' },\n 0x6d: { name: 'TrackJoinUID', type: 'Uint' },\n 0x40: { name: 'TrickTrackUID', type: 'Uint' },\n 0x41: { name: 'TrickTrackSegmentUID', type: 'Binary' },\n 0x46: { name: 'TrickTrackFlag', type: 'Uint' },\n 0x47: { name: 'TrickMasterTrackUID', type: 'Uint' },\n 0x44: { name: 'TrickMasterTrackSegmentUID', type: 'Binary' },\n 0x2d80: { name: 'ContentEncodings', type: 'Container' },\n 0x2240: { name: 'ContentEncoding', type: 'Container' },\n 0x1031: { name: 'ContentEncodingOrder', type: 'Uint' },\n 0x1032: { name: 'ContentEncodingScope', type: 'Uint' },\n 0x1033: { name: 'ContentEncodingType', type: 'Uint' },\n 0x1034: { name: 'ContentCompression', type: 'Container' },\n 0x254: { name: 'ContentCompAlgo', type: 'Uint' },\n 0x255: { name: 'ContentCompSettings', type: 'Binary' },\n 0x1035: { name: 'ContentEncryption', type: 'Container' },\n 0x7e1: { name: 'ContentEncAlgo', type: 'Uint' },\n 0x7e2: { name: 'ContentEncKeyID', type: 'Binary' },\n 0x7e3: { name: 'ContentSignature', type: 'Binary' },\n 0x7e4: { name: 'ContentSigKeyID', type: 'Binary' },\n 0x7e5: { name: 'ContentSigAlgo', type: 'Uint' },\n 0x7e6: { name: 'ContentSigHashAlgo', type: 'Uint' },\n 0xc53bb6b: { name: 'Cues', type: 'Container' },\n 0x3b: { name: 'CuePoint', type: 'Container' },\n 0x33: { name: 'CueTime', type: 'Uint' },\n 0x37: { name: 'CueTrackPositions', type: 'Container' },\n 0x77: { name: 'CueTrack', type: 'Uint' },\n 0x71: { name: 'CueClusterPosition', type: 'Uint' },\n 0x70: { name: 'CueRelativePosition', type: 'Uint' },\n 0x32: { name: 'CueDuration', type: 'Uint' },\n 0x1378: { name: 'CueBlockNumber', type: 'Uint' },\n 0x6a: { name: 'CueCodecState', type: 'Uint' },\n 0x5b: { name: 'CueReference', type: 'Container' },\n 0x16: { name: 'CueRefTime', type: 'Uint' },\n 0x17: { name: 'CueRefCluster', type: 'Uint' },\n 0x135f: { name: 'CueRefNumber', type: 'Uint' },\n 0x6b: { name: 'CueRefCodecState', type: 'Uint' },\n 0x941a469: { name: 'Attachments', type: 'Container' },\n 0x21a7: { name: 'AttachedFile', type: 'Container' },\n 0x67e: { name: 'FileDescription', type: 'String' },\n 0x66e: { name: 'FileName', type: 'String' },\n 0x660: { name: 'FileMimeType', type: 'String' },\n 0x65c: { name: 'FileData', type: 'Binary' },\n 0x6ae: { name: 'FileUID', type: 'Uint' },\n 0x675: { name: 'FileReferral', type: 'Binary' },\n 0x661: { name: 'FileUsedStartTime', type: 'Uint' },\n 0x662: { name: 'FileUsedEndTime', type: 'Uint' },\n 0x43a770: { name: 'Chapters', type: 'Container' },\n 0x5b9: { name: 'EditionEntry', type: 'Container' },\n 0x5bc: { name: 'EditionUID', type: 'Uint' },\n 0x5bd: { name: 'EditionFlagHidden', type: 'Uint' },\n 0x5db: { name: 'EditionFlagDefault', type: 'Uint' },\n 0x5dd: { name: 'EditionFlagOrdered', type: 'Uint' },\n 0x36: { name: 'ChapterAtom', type: 'Container' },\n 0x33c4: { name: 'ChapterUID', type: 'Uint' },\n 0x1654: { name: 'ChapterStringUID', type: 'String' },\n 0x11: { name: 'ChapterTimeStart', type: 'Uint' },\n 0x12: { name: 'ChapterTimeEnd', type: 'Uint' },\n 0x18: { name: 'ChapterFlagHidden', type: 'Uint' },\n 0x598: { name: 'ChapterFlagEnabled', type: 'Uint' },\n 0x2e67: { name: 'ChapterSegmentUID', type: 'Binary' },\n 0x2ebc: { name: 'ChapterSegmentEditionUID', type: 'Uint' },\n 0x23c3: { name: 'ChapterPhysicalEquiv', type: 'Uint' },\n 0xf: { name: 'ChapterTrack', type: 'Container' },\n 0x9: { name: 'ChapterTrackNumber', type: 'Uint' },\n 0x0: { name: 'ChapterDisplay', type: 'Container' },\n 0x5: { name: 'ChapString', type: 'String' },\n 0x37c: { name: 'ChapLanguage', type: 'String' },\n 0x37e: { name: 'ChapCountry', type: 'String' },\n 0x2944: { name: 'ChapProcess', type: 'Container' },\n 0x2955: { name: 'ChapProcessCodecID', type: 'Uint' },\n 0x50d: { name: 'ChapProcessPrivate', type: 'Binary' },\n 0x2911: { name: 'ChapProcessCommand', type: 'Container' },\n 0x2922: { name: 'ChapProcessTime', type: 'Uint' },\n 0x2933: { name: 'ChapProcessData', type: 'Binary' },\n 0x254c367: { name: 'Tags', type: 'Container' },\n 0x3373: { name: 'Tag', type: 'Container' },\n 0x23c0: { name: 'Targets', type: 'Container' },\n 0x28ca: { name: 'TargetTypeValue', type: 'Uint' },\n 0x23ca: { name: 'TargetType', type: 'String' },\n 0x23c5: { name: 'TagTrackUID', type: 'Uint' },\n 0x23c9: { name: 'TagEditionUID', type: 'Uint' },\n 0x23c4: { name: 'TagChapterUID', type: 'Uint' },\n 0x23c6: { name: 'TagAttachmentUID', type: 'Uint' },\n 0x27c8: { name: 'SimpleTag', type: 'Container' },\n 0x5a3: { name: 'TagName', type: 'String' },\n 0x47a: { name: 'TagLanguage', type: 'String' },\n 0x484: { name: 'TagDefault', type: 'Uint' },\n 0x487: { name: 'TagString', type: 'String' },\n 0x485: { name: 'TagBinary', type: 'Binary' }\n };\n\n function doInherit(newClass, baseClass) {\n newClass.prototype = Object.create(baseClass.prototype);\n newClass.prototype.constructor = newClass;\n }\n\n function WebmBase(name, type) {\n this.name = name || 'Unknown';\n this.type = type || 'Unknown';\n }\n WebmBase.prototype.updateBySource = function() { };\n WebmBase.prototype.setSource = function(source) {\n this.source = source;\n this.updateBySource();\n };\n WebmBase.prototype.updateByData = function() { };\n WebmBase.prototype.setData = function(data) {\n this.data = data;\n this.updateByData();\n };\n\n function WebmUint(name, type) {\n WebmBase.call(this, name, type || 'Uint');\n }\n doInherit(WebmUint, WebmBase);\n function padHex(hex) {\n return hex.length % 2 === 1 ? '0' + hex : hex;\n }\n WebmUint.prototype.updateBySource = function() {\n // use hex representation of a number instead of number value\n this.data = '';\n for (var i = 0; i < this.source.length; i++) {\n var hex = this.source[i].toString(16);\n this.data += padHex(hex);\n }\n };\n WebmUint.prototype.updateByData = function() {\n var length = this.data.length / 2;\n this.source = new Uint8Array(length);\n for (var i = 0; i < length; i++) {\n var hex = this.data.substr(i * 2, 2);\n this.source[i] = parseInt(hex, 16);\n }\n };\n WebmUint.prototype.getValue = function() {\n return parseInt(this.data, 16);\n };\n WebmUint.prototype.setValue = function(value) {\n this.setData(padHex(value.toString(16)));\n };\n\n function WebmFloat(name, type) {\n WebmBase.call(this, name, type || 'Float');\n }\n doInherit(WebmFloat, WebmBase);\n WebmFloat.prototype.getFloatArrayType = function() {\n return this.source && this.source.length === 4 ? Float32Array : Float64Array;\n };\n WebmFloat.prototype.updateBySource = function() {\n var byteArray = this.source.reverse();\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType(byteArray.buffer);\n this.data = floatArray[0];\n };\n WebmFloat.prototype.updateByData = function() {\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType([ this.data ]);\n var byteArray = new Uint8Array(floatArray.buffer);\n this.source = byteArray.reverse();\n };\n WebmFloat.prototype.getValue = function() {\n return this.data;\n };\n WebmFloat.prototype.setValue = function(value) {\n this.setData(value);\n };\n\n function WebmContainer(name, type) {\n WebmBase.call(this, name, type || 'Container');\n }\n doInherit(WebmContainer, WebmBase);\n WebmContainer.prototype.readByte = function() {\n return this.source[this.offset++];\n };\n WebmContainer.prototype.readUint = function() {\n var firstByte = this.readByte();\n var bytes = 8 - firstByte.toString(2).length;\n var value = firstByte - (1 << (7 - bytes));\n for (var i = 0; i < bytes; i++) {\n // don't use bit operators to support x86\n value *= 256;\n value += this.readByte();\n }\n return value;\n };\n WebmContainer.prototype.updateBySource = function() {\n this.data = [];\n for (this.offset = 0; this.offset < this.source.length; this.offset = end) {\n var id = this.readUint();\n var len = this.readUint();\n var end = Math.min(this.offset + len, this.source.length);\n var data = this.source.slice(this.offset, end);\n\n var info = sections[id] || { name: 'Unknown', type: 'Unknown' };\n var ctr = WebmBase;\n switch (info.type) {\n case 'Container':\n ctr = WebmContainer;\n break;\n case 'Uint':\n ctr = WebmUint;\n break;\n case 'Float':\n ctr = WebmFloat;\n break;\n }\n var section = new ctr(info.name, info.type);\n section.setSource(data);\n this.data.push({\n id: id,\n idHex: id.toString(16),\n data: section\n });\n }\n };\n WebmContainer.prototype.writeUint = function(x, draft) {\n for (var bytes = 1, flag = 0x80; x >= flag && bytes < 8; bytes++, flag *= 0x80) { }\n\n if (!draft) {\n var value = flag + x;\n for (var i = bytes - 1; i >= 0; i--) {\n // don't use bit operators to support x86\n var c = value % 256;\n this.source[this.offset + i] = c;\n value = (value - c) / 256;\n }\n }\n\n this.offset += bytes;\n };\n WebmContainer.prototype.writeSections = function(draft) {\n this.offset = 0;\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i],\n content = section.data.source,\n contentLength = content.length;\n this.writeUint(section.id, draft);\n this.writeUint(contentLength, draft);\n if (!draft) {\n this.source.set(content, this.offset);\n }\n this.offset += contentLength;\n }\n return this.offset;\n };\n WebmContainer.prototype.updateByData = function() {\n // run without accessing this.source to determine total length - need to know it to create Uint8Array\n var length = this.writeSections('draft');\n this.source = new Uint8Array(length);\n // now really write data\n this.writeSections();\n };\n WebmContainer.prototype.getSectionById = function(id) {\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i];\n if (section.id === id) {\n return section.data;\n }\n }\n return null;\n };\n\n function WebmFile(source) {\n WebmContainer.call(this, 'File', 'File');\n this.setSource(source);\n }\n doInherit(WebmFile, WebmContainer);\n WebmFile.prototype.fixDuration = function(duration, options) {\n var logger = options && options.logger;\n if (logger === undefined) {\n logger = function(message) {\n console.log(message);\n };\n } else if (!logger) {\n logger = function() { };\n }\n\n var segmentSection = this.getSectionById(0x8538067);\n if (!segmentSection) {\n logger('[fix-webm-duration] Segment section is missing');\n return false;\n }\n\n var infoSection = segmentSection.getSectionById(0x549a966);\n if (!infoSection) {\n logger('[fix-webm-duration] Info section is missing');\n return false;\n }\n\n var timeScaleSection = infoSection.getSectionById(0xad7b1);\n if (!timeScaleSection) {\n logger('[fix-webm-duration] TimecodeScale section is missing');\n return false;\n }\n\n var durationSection = infoSection.getSectionById(0x489);\n if (durationSection) {\n if (durationSection.getValue() <= 0) {\n logger(`[fix-webm-duration] Duration section is present, but the value is ${durationSection.getValue()}`);\n durationSection.setValue(duration);\n } else {\n logger(`[fix-webm-duration] Duration section is present, and the value is ${durationSection.getValue()}`);\n return false;\n }\n } else {\n logger('[fix-webm-duration] Duration section is missing');\n // append Duration section\n durationSection = new WebmFloat('Duration', 'Float');\n durationSection.setValue(duration);\n infoSection.data.push({\n id: 0x489,\n data: durationSection\n });\n }\n\n // set default time scale to 1 millisecond (1000000 nanoseconds)\n timeScaleSection.setValue(1000000);\n infoSection.updateByData();\n segmentSection.updateByData();\n this.updateByData();\n\n return true;\n };\n WebmFile.prototype.toBlob = function(mimeType) {\n return new Blob([ this.source.buffer ], { type: mimeType || 'video/webm' });\n };\n\n function fixWebmDuration(blob, duration, callback, options) {\n // The callback may be omitted - then the third argument is options\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n\n if (!callback) {\n return new Promise(function(resolve) {\n fixWebmDuration(blob, duration, resolve, options);\n });\n }\n\n try {\n var reader = new FileReader();\n reader.onloadend = function() {\n try {\n var file = new WebmFile(new Uint8Array(reader.result));\n if (file.fixDuration(duration, options)) {\n blob = file.toBlob(blob.type);\n }\n } catch (ex) {\n // ignore\n }\n callback(blob);\n };\n reader.readAsArrayBuffer(blob);\n } catch (ex) {\n callback(blob);\n }\n }\n\n // Support AMD import default\n fixWebmDuration.default = fixWebmDuration;\n\n return fixWebmDuration;\n});\n","import ysFixWebmDuration from \"fix-webm-duration\";\n\nexport class ProcessVideo extends HTMLElement {\n private phrase: string;\n private previewStream: MediaStream | null = null;\n private recordedChunks: Blob[] = [];\n private mediaRecorder: MediaRecorder | null = null;\n private videoFile: File | null = null;\n private startTime: number = 0;\n private timerInterval: ReturnType<typeof setInterval> | null = null;\n private recordingTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private videoElement!: HTMLVideoElement;\n private fileInput!: HTMLInputElement;\n private recordButton!: HTMLButtonElement;\n private stopButton!: HTMLButtonElement;\n private submitButton!: HTMLButtonElement;\n\n private errorState: string | null = null;\n private timeLimit: number = 30;\n\n constructor() {\n super();\n\n this.phrase = this.generateDefaultPhrase();\n\n // Attach shadow DOM and initialize UI\n this.attachShadow({ mode: 'open' });\n this.initializeUI();\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n disconnectedCallback() {\n this.stopRecording();\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n }\n\n attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null) {\n if (name === 'endpoint' && newValue !== this.endpoint) {\n this.endpoint = newValue;\n }\n }\n\n private generateDefaultPhrase(): string {\n return Math.random().toString().slice(2, 10); // 8-digit random phrase\n }\n\n initializeUI() {\n const phraseDisplay = this.phrase\n .split(\"\")\n .map((digit) => `<span class=\"digit\">${digit}</span>`)\n .join(\" \");\n\n this.shadowRoot!.innerHTML = `\n <style>\n :host {\n display: block;\n font-family: Arial, sans-serif;\n --primary-color: #007bff;\n --secondary-color: #6c757d;\n --button-bg: var(--primary-color);\n --button-text-color: #fff;\n --input-border-color: var(--secondary-color);\n --input-focus-border-color: var(--primary-color);\n --spacing: 16px;\n --button-padding: 10px 20px;\n --border-radius: 4px;\n }\n \n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--spacing);\n padding: var(--spacing);\n max-width: 500px;\n margin: 0 auto;\n text-align: center;\n }\n\n .video-wrapper {\n position: relative;\n display: inline-block;\n }\n\n #timer-overlay {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n font-family: Arial, sans-serif;\n font-size: 14px;\n }\n\n video {\n max-width: 100%;\n border-radius: var(--border-radius);\n }\n\n input[type=\"text\"], input[type=\"file\"] {\n padding: var(--button-padding);\n border: 1px solid var(--input-border-color);\n border-radius: var(--border-radius);\n width: 100%;\n max-width: 100%;\n }\n\n input[type=\"text\"]:focus, input[type=\"file\"]:focus {\n outline: none;\n border-color: var(--input-focus-border-color);\n }\n\n .hidden {\n display: none;\n }\n\n .phrase-display {\n font-size: 24px;\n font-weight: bold;\n display: flex;\n gap: 8px;\n justify-content: center;\n }\n .digit {\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n text-align: center;\n width: 24px;\n }\n\n </style>\n <div class=\"container\">\n <slot name=\"video\">\n <div class=\"video-wrapper\">\n <video id=\"video-preview\" muted autoplay></video>\n <div id=\"timer-overlay\" class=\"hidden\">00:00</div>\n </div>\n </slot>\n <slot name=\"phrase-display\">\n <div class=\"phrase-display\">\n ${phraseDisplay}\n </div>\n </slot>\n <slot name=\"record-button\">\n <button id=\"record-button\">Start Recording</button>\n </slot>\n <slot name=\"stop-button\">\n <button id=\"stop-button\" disabled>Stop Recording</button>\n </slot>\n <slot name=\"file-input\">\n <input type=\"file\" accept=\"video/*\" id=\"file-input\" />\n </slot>\n <slot name=\"submit-button\">\n <button id=\"submit-button\">Submit Video</button>\n </slot>\n <slot name=\"loading\">\n <div class=\"message\">Loading...</div>\n </slot>\n <slot name=\"error\">\n <div class=\"message error\">An error occurred</div>\n </slot>\n <slot name=\"success\">\n <div class=\"message success\">Video submitted successfully!</div>\n </slot>\n </div>\n `;\n this.attachSlotListeners();\n this.setupPreview();\n this.toggleState(null);\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadowRoot!.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const recordButtonSlot = this.shadowRoot!.querySelector('slot[name=\"record-button\"]') as HTMLSlotElement;\n const stopButtonSlot = this.shadowRoot!.querySelector('slot[name=\"stop-button\"]') as HTMLSlotElement;\n const fileInputSlot = this.shadowRoot!.querySelector('slot[name=\"file-input\"]') as HTMLSlotElement;\n const submitButtonSlot = this.shadowRoot!.querySelector('slot[name=\"submit-button\"]') as HTMLSlotElement;\n\n this.videoElement = this.getSlotElement(videoSlot, '#video-preview', HTMLVideoElement);\n this.recordButton = this.getSlotElement(recordButtonSlot, '#record-button', HTMLButtonElement);\n this.stopButton = this.getSlotElement(stopButtonSlot, '#stop-button', HTMLButtonElement);\n this.fileInput = this.getSlotElement(fileInputSlot, '#file-input', HTMLInputElement);\n this.submitButton = this.getSlotElement(submitButtonSlot, '#submit-button', HTMLButtonElement);\n\n if (this.fileInput) {\n this.fileInput.addEventListener('change', (e) => this.handleFileUpload(e));\n }\n if (this.recordButton) {\n this.recordButton.addEventListener(\"click\", () => this.startRecording());\n }\n if (this.stopButton) {\n this.stopButton.addEventListener(\"click\", () => this.stopRecording());\n }\n if (this.submitButton) {\n this.submitButton.addEventListener(\"click\", () => this.handleSubmit())\n }\n }\n\n private getSlotElement<T extends HTMLElement>(\n slot: HTMLSlotElement,\n fallbackSelector: string,\n elementType: { new(): T }\n ): T {\n const assignedElements = slot.assignedElements();\n return (assignedElements.length > 0 ? assignedElements[0] : null) as T || this.shadowRoot!.querySelector(fallbackSelector) as T;\n }\n\n replaceSlotContent(slotName: string, content: string | HTMLElement) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n if (typeof content === 'string') {\n slot.innerHTML = content;\n } else if (content instanceof HTMLElement) {\n slot.innerHTML = '';\n slot.appendChild(content);\n }\n }\n }\n\n removeSlotListener(slotName: string, event: string, callback: EventListener) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (slot) {\n const assignedNodes = slot.assignedElements();\n assignedNodes.forEach((node) => {\n node.removeEventListener(event, callback);\n });\n }\n }\n\n private toggleState(state: 'loading' | 'success' | 'error' | null) {\n const states = ['loading', 'success', 'error'];\n\n states.forEach((slotName) => {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? 'block' : 'none';\n }\n });\n }\n\n private convertPhraseToWords(phrase: string): string {\n const digitWords = [\n \"zero\", \"one\", \"two\", \"three\", \"four\",\n \"five\", \"six\", \"seven\", \"eight\", \"nine\"\n ];\n\n return phrase\n .split(\"\")\n .map((digit) => digitWords[parseInt(digit, 10)])\n .join(\" \");\n }\n\n private async setupPreview() {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });\n this.previewStream = stream;\n\n this.videoElement.srcObject = stream;\n this.videoElement.controls = false;\n this.videoElement.play();\n } catch (error) {\n this.toggleState('error');\n console.error('Error setting up video preview:', error);\n }\n }\n\n private async startTimer() {\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.textContent = '00:00';\n timerOverlay.classList.remove('hidden');\n\n let seconds = 0;\n this.timerInterval = setInterval(() => {\n seconds++;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n timerOverlay.textContent = `${String(minutes).padStart(2, '0')}:${String(remainingSeconds).padStart(2, '0')}`;\n }, 1000);\n\n this.recordingTimeout = setTimeout(() => {\n this.stopRecording();\n }, this.timeLimit * 1000);\n }\n\n private async stopTimer() {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n if (this.timerInterval) {\n clearInterval(this.timerInterval);\n this.timerInterval = null;\n }\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.classList.add('hidden');\n }\n\n public async startRecording() {\n if (!window.MediaRecorder) {\n console.error('MediaRecorder API is not supported in this browser');\n return;\n }\n try {\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n console.log('Recording already in progress.');\n return;\n }\n\n if (!this.previewStream) {\n console.log('Initializing preview stream...');\n this.previewStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n });\n }\n\n this.videoElement.muted = true;\n this.videoElement.srcObject = this.previewStream;\n this.videoElement.currentTime = 0;\n\n await this.videoElement.play();\n\n this.mediaRecorder = new MediaRecorder(this.previewStream);\n this.recordedChunks = [];\n\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n\n this.mediaRecorder.onstop = () => {\n const duration = Date.now() - this.startTime;\n const buggyBlob = new Blob(this.recordedChunks, { type: 'video/webm' });\n\n ysFixWebmDuration(buggyBlob, duration, { logger: false })\n .then((fixedBlob: Blob) => {\n this.onStopMediaRecorder(fixedBlob);\n });\n };\n\n this.mediaRecorder.start();\n this.startTimer();\n this.startTime = Date.now();\n\n this.recordButton.disabled = true;\n this.stopButton.disabled = false;\n this.videoElement.controls = false;\n } catch (error) {\n console.error('Error starting video recording:', error);\n }\n }\n\n public stopRecording() {\n try {\n if (!this.mediaRecorder || this.mediaRecorder.state === 'inactive') {\n console.log('No recording in progress.');\n return;\n }\n\n this.mediaRecorder.stop();\n\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n this.videoElement.srcObject = null;\n this.videoElement.src = '';\n this.videoElement.controls = false;\n\n this.recordButton.disabled = false;\n this.stopButton.disabled = true;\n\n this.mediaRecorder = null;\n this.previewStream = null;\n\n } catch (error) {\n console.error('Error stopping video recording:', error);\n }\n }\n\n private onStopMediaRecorder(blob: Blob) {\n const videoURL = URL.createObjectURL(blob);\n this.videoFile = new File([blob], 'recorded_video.webm', { type: 'video/webm' });\n this.recordedChunks = [];\n\n this.videoElement.src = videoURL;\n this.videoElement.controls = true;\n this.videoElement.play();\n this.videoElement.muted = false;\n this.stopTimer();\n\n // Clean up the object URL when the video loads\n this.videoElement.onloadeddata = () => {\n URL.revokeObjectURL(videoURL);\n };\n }\n\n private handleFileUpload(event: Event) {\n const file = (event.target as HTMLInputElement).files?.[0];\n if (file?.type?.startsWith('video/')) {\n if (file.size > 100 * 1024 * 1024) { // 100MB limit\n this.toggleState('error');\n console.error('File size exceeds limit of 100MB');\n return;\n }\n this.videoFile = file;\n this.videoElement.src = URL.createObjectURL(file);\n this.videoElement.play();\n } else {\n this.toggleState('error');\n console.error('Please select a valid video file.');\n }\n }\n\n public async handleSubmit() {\n if (!this.videoFile) {\n this.toggleState('error');\n console.error('No video file to submit.');\n return;\n }\n\n if (!this.endpoint) {\n this.toggleState('error');\n console.error('Endpoint must be provided.');\n return;\n }\n\n if (!this.userFullname) {\n this.toggleState('error');\n console.error('User full name must be provided.');\n return;\n }\n\n this.toggleState('loading');\n\n try {\n const formData = new FormData();\n formData.append('video', this.videoFile);\n formData.append('phrase', this.convertPhraseToWords(this.phrase));\n formData.append('userFullname', this.userFullname);\n\n const response = await fetch(this.endpoint, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n console.log('Response from endpoint:', result);\n this.toggleState('success');\n } catch (error) {\n this.toggleState('error');\n console.error('Error submitting video:', error);\n }\n }\n\n static get observedAttributes() {\n return ['endpoint', 'user-fullname'];\n }\n\n get userFullname(): string | null {\n return this.getAttribute('user-fullname');\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute('user-fullname', value);\n } else {\n this.removeAttribute('user-fullname');\n }\n }\n\n get isRecording(): boolean {\n return this.mediaRecorder?.state === 'recording';\n }\n\n get currentPhrase(): string {\n return this.phrase;\n }\n\n get videoDuration(): number | null {\n return this.videoElement?.duration || null;\n }\n\n get currentFile(): File | null {\n return this.videoFile;\n }\n\n get currentStream(): MediaStream | null {\n return this.previewStream;\n }\n\n get videoElementRef(): HTMLVideoElement {\n return this.videoElement;\n }\n\n get fileInputRef(): HTMLInputElement {\n return this.fileInput;\n }\n\n get recordingTimeLimit(): number {\n return this.timeLimit;\n }\n\n set recordingTimeLimit(value: number) {\n this.timeLimit = value;\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording') {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n this.recordingTimeout = setTimeout(() => this.stopRecording(), this.timeLimit * 1000);\n }\n }\n}\n\ncustomElements.define('process-video', ProcessVideo);\n","export class DocAuth extends HTMLElement {\n private readonly shadow: ShadowRoot;\n private videoElement: HTMLVideoElement | null = null;\n private canvasElement: HTMLCanvasElement | null = null;\n private captureButton: HTMLButtonElement | null = null;\n\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: \"open\" });\n this.captureDocument = this.captureDocument.bind(this);\n }\n\n static get observedAttributes(): string[] {\n return [\"endpoint\", \"user-fullname\"];\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n if (value !== this.getAttribute(\"endpoint\")) {\n if (value === null) {\n this.removeAttribute(\"endpoint\");\n } else {\n this.setAttribute(\"endpoint\", value);\n }\n }\n }\n\n get userFullname(): string | null {\n return this.getAttribute(\"user-fullname\");\n }\n\n set userFullname(value: string | null) {\n if (value !== this.getAttribute(\"user-fullname\")) {\n if (value === null) {\n this.removeAttribute(\"user-fullname\");\n } else {\n this.setAttribute(\"user-fullname\", value);\n }\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (name === \"endpoint\" || name === \"user-fullname\") {\n this.validateAttributes();\n }\n }\n\n connectedCallback(): void {\n this.validateAttributes();\n this.init();\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n if (this.captureButton) {\n this.captureButton.removeEventListener(\"click\", this.captureDocument);\n }\n }\n\n validateAttributes(): void {\n if (!this.endpoint) {\n console.error(\"Endpoint is required.\");\n this.toggleState(\"error\");\n return;\n }\n if (!this.userFullname) {\n console.error(\"User fullname is required.\");\n this.toggleState(\"error\");\n return;\n }\n }\n\n init(): void {\n this.shadow.innerHTML = `\n <style>\n :host {\n display: block;\n font-family: Arial, sans-serif;\n --primary-color: #007bff;\n --button-bg: var(--primary-color);\n --button-text-color: #fff;\n --border-radius: 8px;\n --scan-area-border: 2px dashed var(--primary-color);\n --scan-area-bg: rgba(0, 123, 255, 0.05);\n --button-padding: 10px 24px;\n --button-radius: 6px;\n --button-hover-bg: #0056b3;\n }\n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 20px;\n padding: 24px;\n background: #fff;\n border-radius: var(--border-radius);\n box-shadow: 0 2px 8px rgba(0,0,0,0.04);\n max-width: 420px;\n margin: 0 auto;\n }\n .scan-area {\n position: relative;\n width: 340px;\n height: 220px;\n background: var(--scan-area-bg);\n border: var(--scan-area-border);\n border-radius: var(--border-radius);\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: var(--border-radius);\n }\n canvas {\n display: none;\n }\n .capture-btn {\n background: var(--button-bg);\n color: var(--button-text-color);\n border: none;\n border-radius: var(--button-radius);\n padding: var(--button-padding);\n font-size: 1rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n .capture-btn:hover {\n background: var(--button-hover-bg);\n }\n .status {\n min-height: 24px;\n font-size: 0.95rem;\n color: #d32f2f;\n text-align: center;\n }\n .status.success {\n color: #388e3c;\n }\n </style>\n <div class=\"container\">\n <div class=\"scan-area\">\n <video id=\"video\" autoplay playsinline></video>\n <canvas id=\"canvas\"></canvas>\n </div>\n <button class=\"capture-btn\" id=\"capture-btn\">Capture Document</button>\n <div class=\"status\" id=\"status\"></div>\n </div>\n `;\n this.attachElements();\n this.setupCamera();\n this.toggleState(\"\");\n }\n\n cleanup(): void {\n if (this.videoElement?.srcObject) {\n const tracks = (this.videoElement.srcObject as MediaStream).getTracks();\n tracks.forEach((track) => track.stop());\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n }\n }\n\n private attachElements(): void {\n this.videoElement = this.shadow.querySelector(\"#video\") as HTMLVideoElement;\n this.canvasElement = this.shadow.querySelector(\"#canvas\") as HTMLCanvasElement;\n this.captureButton = this.shadow.querySelector(\"#capture-btn\") as HTMLButtonElement;\n if (this.captureButton) {\n this.captureButton.addEventListener(\"click\", this.captureDocument);\n }\n }\n\n private setupCamera(): void {\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n navigator.mediaDevices\n .getUserMedia({ video: { facingMode: \"environment\" } })\n .then((stream) => {\n this.videoElement!.srcObject = stream;\n })\n .catch((error) => {\n this.toggleState(\"error\");\n this.setStatus(\"Error accessing camera: \" + error, false);\n });\n }\n\n private async captureDocument(): Promise<void> {\n if (!this.videoElement || !this.canvasElement) {\n this.setStatus(\"Camera not ready.\", false);\n return;\n }\n // Set canvas size to video size for high quality\n this.canvasElement.width = this.videoElement.videoWidth;\n this.canvasElement.height = this.videoElement.videoHeight;\n const context = this.canvasElement.getContext(\"2d\");\n context!.drawImage(\n this.videoElement,\n 0,\n 0,\n this.canvasElement.width,\n this.canvasElement.height\n );\n this.toggleState(\"loading\");\n this.setStatus(\"Uploading...\", false);\n this.canvasElement.toBlob(async (blob) => {\n try {\n if (!blob) {\n this.setStatus(\"Failed to capture image.\", false);\n this.toggleState(\"error\");\n return;\n }\n const file = new File([blob], \"id-document.jpg\", { type: \"image/jpeg\" });\n const formData = new FormData();\n formData.append(\"document\", file);\n formData.append(\"userFullname\", this.userFullname || \"\");\n const response = await fetch(this.endpoint!, {\n method: \"POST\",\n body: formData,\n });\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n this.setStatus(\"Document uploaded successfully!\", true);\n this.toggleState(\"success\");\n } catch (error) {\n this.setStatus(\"Error uploading document.\", false);\n this.toggleState(\"error\");\n }\n }, \"image/jpeg\", 0.98); // High quality JPEG\n }\n\n private setStatus(message: string, success: boolean) {\n const statusDiv = this.shadow.querySelector(\"#status\") as HTMLElement;\n if (statusDiv) {\n statusDiv.textContent = message;\n statusDiv.className = \"status\" + (success ? \" success\" : \"\");\n }\n }\n\n private toggleState(state: string): void {\n // For extensibility, could add more UI feedback here\n // Currently just updates status color\n }\n}\n\ncustomElements.define(\"doc-auth\", DocAuth); "],"names":[],"mappings":"AAAA,IAAY,kBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,SAAkB;AAClB,IAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;AAChC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAA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