videomail-client 15.0.3 → 15.2.0

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/dist/umd/index.js CHANGED
@@ -5,6 +5,574 @@
5
5
  else root["VideomailClient"] = factory();
6
6
  })(globalThis, ()=>(()=>{
7
7
  var __webpack_modules__ = {
8
+ 6546 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
9
+ "use strict";
10
+ /*! Capacitor: https://capacitorjs.com/ - MIT License */ var ExceptionCode;
11
+ (function(ExceptionCode) {
12
+ ExceptionCode["Unimplemented"] = "UNIMPLEMENTED";
13
+ ExceptionCode["Unavailable"] = "UNAVAILABLE";
14
+ })(ExceptionCode || (ExceptionCode = {}));
15
+ class CapacitorException extends Error {
16
+ constructor(message, code, data){
17
+ super(message);
18
+ this.message = message;
19
+ this.code = code;
20
+ this.data = data;
21
+ }
22
+ }
23
+ const getPlatformId = (win)=>{
24
+ var _a, _b;
25
+ if (null == win ? void 0 : win.androidBridge) return 'android';
26
+ if (null == (_b = null == (_a = null == win ? void 0 : win.webkit) ? void 0 : _a.messageHandlers) ? void 0 : _b.bridge) return 'ios';
27
+ return 'web';
28
+ };
29
+ const createCapacitor = (win)=>{
30
+ const capCustomPlatform = win.CapacitorCustomPlatform || null;
31
+ const cap = win.Capacitor || {};
32
+ const Plugins = cap.Plugins = cap.Plugins || {};
33
+ const getPlatform = ()=>null !== capCustomPlatform ? capCustomPlatform.name : getPlatformId(win);
34
+ const isNativePlatform = ()=>'web' !== getPlatform();
35
+ const isPluginAvailable = (pluginName)=>{
36
+ const plugin = registeredPlugins.get(pluginName);
37
+ if (null == plugin ? void 0 : plugin.platforms.has(getPlatform())) return true;
38
+ if (getPluginHeader(pluginName)) return true;
39
+ return false;
40
+ };
41
+ const getPluginHeader = (pluginName)=>{
42
+ var _a;
43
+ return null == (_a = cap.PluginHeaders) ? void 0 : _a.find((h)=>h.name === pluginName);
44
+ };
45
+ const handleError = (err)=>win.console.error(err);
46
+ const registeredPlugins = new Map();
47
+ const registerPlugin = (pluginName, jsImplementations = {})=>{
48
+ const registeredPlugin = registeredPlugins.get(pluginName);
49
+ if (registeredPlugin) {
50
+ console.warn(`Capacitor plugin "${pluginName}" already registered. Cannot register plugins twice.`);
51
+ return registeredPlugin.proxy;
52
+ }
53
+ const platform = getPlatform();
54
+ const pluginHeader = getPluginHeader(pluginName);
55
+ let jsImplementation;
56
+ const loadPluginImplementation = async ()=>{
57
+ if (!jsImplementation && platform in jsImplementations) jsImplementation = 'function' == typeof jsImplementations[platform] ? jsImplementation = await jsImplementations[platform]() : jsImplementation = jsImplementations[platform];
58
+ else if (null !== capCustomPlatform && !jsImplementation && 'web' in jsImplementations) jsImplementation = 'function' == typeof jsImplementations['web'] ? jsImplementation = await jsImplementations['web']() : jsImplementation = jsImplementations['web'];
59
+ return jsImplementation;
60
+ };
61
+ const createPluginMethod = (impl, prop)=>{
62
+ var _a, _b;
63
+ if (pluginHeader) {
64
+ const methodHeader = null == pluginHeader ? void 0 : pluginHeader.methods.find((m)=>prop === m.name);
65
+ if (methodHeader) if ('promise' === methodHeader.rtype) return (options)=>cap.nativePromise(pluginName, prop.toString(), options);
66
+ else return (options, callback)=>cap.nativeCallback(pluginName, prop.toString(), options, callback);
67
+ if (impl) return null == (_a = impl[prop]) ? void 0 : _a.bind(impl);
68
+ } else if (impl) return null == (_b = impl[prop]) ? void 0 : _b.bind(impl);
69
+ else throw new CapacitorException(`"${pluginName}" plugin is not implemented on ${platform}`, ExceptionCode.Unimplemented);
70
+ };
71
+ const createPluginMethodWrapper = (prop)=>{
72
+ let remove;
73
+ const wrapper = (...args)=>{
74
+ const p = loadPluginImplementation().then((impl)=>{
75
+ const fn = createPluginMethod(impl, prop);
76
+ if (fn) {
77
+ const p = fn(...args);
78
+ remove = null == p ? void 0 : p.remove;
79
+ return p;
80
+ }
81
+ throw new CapacitorException(`"${pluginName}.${prop}()" is not implemented on ${platform}`, ExceptionCode.Unimplemented);
82
+ });
83
+ if ('addListener' === prop) p.remove = async ()=>remove();
84
+ return p;
85
+ };
86
+ wrapper.toString = ()=>`${prop.toString()}() { [capacitor code] }`;
87
+ Object.defineProperty(wrapper, 'name', {
88
+ value: prop,
89
+ writable: false,
90
+ configurable: false
91
+ });
92
+ return wrapper;
93
+ };
94
+ const addListener = createPluginMethodWrapper('addListener');
95
+ const removeListener = createPluginMethodWrapper('removeListener');
96
+ const addListenerNative = (eventName, callback)=>{
97
+ const call = addListener({
98
+ eventName
99
+ }, callback);
100
+ const remove = async ()=>{
101
+ const callbackId = await call;
102
+ removeListener({
103
+ eventName,
104
+ callbackId
105
+ }, callback);
106
+ };
107
+ const p = new Promise((resolve)=>call.then(()=>resolve({
108
+ remove
109
+ })));
110
+ p.remove = async ()=>{
111
+ console.warn("Using addListener() without 'await' is deprecated.");
112
+ await remove();
113
+ };
114
+ return p;
115
+ };
116
+ const proxy = new Proxy({}, {
117
+ get (_, prop) {
118
+ switch(prop){
119
+ case '$$typeof':
120
+ return;
121
+ case 'toJSON':
122
+ return ()=>({});
123
+ case 'addListener':
124
+ return pluginHeader ? addListenerNative : addListener;
125
+ case 'removeListener':
126
+ return removeListener;
127
+ default:
128
+ return createPluginMethodWrapper(prop);
129
+ }
130
+ }
131
+ });
132
+ Plugins[pluginName] = proxy;
133
+ registeredPlugins.set(pluginName, {
134
+ name: pluginName,
135
+ proxy,
136
+ platforms: new Set([
137
+ ...Object.keys(jsImplementations),
138
+ ...pluginHeader ? [
139
+ platform
140
+ ] : []
141
+ ])
142
+ });
143
+ return proxy;
144
+ };
145
+ if (!cap.convertFileSrc) cap.convertFileSrc = (filePath)=>filePath;
146
+ cap.getPlatform = getPlatform;
147
+ cap.handleError = handleError;
148
+ cap.isNativePlatform = isNativePlatform;
149
+ cap.isPluginAvailable = isPluginAvailable;
150
+ cap.registerPlugin = registerPlugin;
151
+ cap.Exception = CapacitorException;
152
+ cap.DEBUG = !!cap.DEBUG;
153
+ cap.isLoggingEnabled = !!cap.isLoggingEnabled;
154
+ return cap;
155
+ };
156
+ const initCapacitorGlobal = (win)=>win.Capacitor = createCapacitor(win);
157
+ const Capacitor = /*#__PURE__*/ initCapacitorGlobal("u" > typeof globalThis ? globalThis : "u" > typeof self ? self : "u" > typeof window ? window : void 0 !== __webpack_require__.g ? __webpack_require__.g : {});
158
+ const registerPlugin = Capacitor.registerPlugin;
159
+ class WebPlugin {
160
+ constructor(){
161
+ this.listeners = {};
162
+ this.retainedEventArguments = {};
163
+ this.windowListeners = {};
164
+ }
165
+ addListener(eventName, listenerFunc) {
166
+ let firstListener = false;
167
+ const listeners = this.listeners[eventName];
168
+ if (!listeners) {
169
+ this.listeners[eventName] = [];
170
+ firstListener = true;
171
+ }
172
+ this.listeners[eventName].push(listenerFunc);
173
+ const windowListener = this.windowListeners[eventName];
174
+ if (windowListener && !windowListener.registered) this.addWindowListener(windowListener);
175
+ if (firstListener) this.sendRetainedArgumentsForEvent(eventName);
176
+ const remove = async ()=>this.removeListener(eventName, listenerFunc);
177
+ const p = Promise.resolve({
178
+ remove
179
+ });
180
+ return p;
181
+ }
182
+ async removeAllListeners() {
183
+ this.listeners = {};
184
+ for(const listener in this.windowListeners)this.removeWindowListener(this.windowListeners[listener]);
185
+ this.windowListeners = {};
186
+ }
187
+ notifyListeners(eventName, data, retainUntilConsumed) {
188
+ const listeners = this.listeners[eventName];
189
+ if (!listeners) {
190
+ if (retainUntilConsumed) {
191
+ let args = this.retainedEventArguments[eventName];
192
+ if (!args) args = [];
193
+ args.push(data);
194
+ this.retainedEventArguments[eventName] = args;
195
+ }
196
+ return;
197
+ }
198
+ listeners.forEach((listener)=>listener(data));
199
+ }
200
+ hasListeners(eventName) {
201
+ var _a;
202
+ return !!(null == (_a = this.listeners[eventName]) ? void 0 : _a.length);
203
+ }
204
+ registerWindowListener(windowEventName, pluginEventName) {
205
+ this.windowListeners[pluginEventName] = {
206
+ registered: false,
207
+ windowEventName,
208
+ pluginEventName,
209
+ handler: (event)=>{
210
+ this.notifyListeners(pluginEventName, event);
211
+ }
212
+ };
213
+ }
214
+ unimplemented(msg = 'not implemented') {
215
+ return new Capacitor.Exception(msg, ExceptionCode.Unimplemented);
216
+ }
217
+ unavailable(msg = 'not available') {
218
+ return new Capacitor.Exception(msg, ExceptionCode.Unavailable);
219
+ }
220
+ async removeListener(eventName, listenerFunc) {
221
+ const listeners = this.listeners[eventName];
222
+ if (!listeners) return;
223
+ const index = listeners.indexOf(listenerFunc);
224
+ this.listeners[eventName].splice(index, 1);
225
+ if (!this.listeners[eventName].length) this.removeWindowListener(this.windowListeners[eventName]);
226
+ }
227
+ addWindowListener(handle) {
228
+ window.addEventListener(handle.windowEventName, handle.handler);
229
+ handle.registered = true;
230
+ }
231
+ removeWindowListener(handle) {
232
+ if (!handle) return;
233
+ window.removeEventListener(handle.windowEventName, handle.handler);
234
+ handle.registered = false;
235
+ }
236
+ sendRetainedArgumentsForEvent(eventName) {
237
+ const args = this.retainedEventArguments[eventName];
238
+ if (!args) return;
239
+ delete this.retainedEventArguments[eventName];
240
+ args.forEach((arg)=>{
241
+ this.notifyListeners(eventName, arg);
242
+ });
243
+ }
244
+ }
245
+ const encode = (str)=>encodeURIComponent(str).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
246
+ const decode = (str)=>str.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
247
+ class CapacitorCookiesPluginWeb extends WebPlugin {
248
+ async getCookies() {
249
+ const cookies = document.cookie;
250
+ const cookieMap = {};
251
+ cookies.split(';').forEach((cookie)=>{
252
+ if (cookie.length <= 0) return;
253
+ let [key, value] = cookie.replace(/=/, 'CAP_COOKIE').split('CAP_COOKIE');
254
+ key = decode(key).trim();
255
+ value = decode(value).trim();
256
+ cookieMap[key] = value;
257
+ });
258
+ return cookieMap;
259
+ }
260
+ async setCookie(options) {
261
+ try {
262
+ const encodedKey = encode(options.key);
263
+ const encodedValue = encode(options.value);
264
+ const expires = options.expires ? `; expires=${options.expires.replace('expires=', '')}` : '';
265
+ const path = (options.path || '/').replace('path=', '');
266
+ const domain = null != options.url && options.url.length > 0 ? `domain=${options.url}` : '';
267
+ document.cookie = `${encodedKey}=${encodedValue || ''}${expires}; path=${path}; ${domain};`;
268
+ } catch (error) {
269
+ return Promise.reject(error);
270
+ }
271
+ }
272
+ async deleteCookie(options) {
273
+ try {
274
+ document.cookie = `${options.key}=; Max-Age=0`;
275
+ } catch (error) {
276
+ return Promise.reject(error);
277
+ }
278
+ }
279
+ async clearCookies() {
280
+ try {
281
+ const cookies = document.cookie.split(';') || [];
282
+ for (const cookie of cookies)document.cookie = cookie.replace(/^ +/, '').replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`);
283
+ } catch (error) {
284
+ return Promise.reject(error);
285
+ }
286
+ }
287
+ async clearAllCookies() {
288
+ try {
289
+ await this.clearCookies();
290
+ } catch (error) {
291
+ return Promise.reject(error);
292
+ }
293
+ }
294
+ }
295
+ registerPlugin('CapacitorCookies', {
296
+ web: ()=>new CapacitorCookiesPluginWeb()
297
+ });
298
+ const readBlobAsBase64 = async (blob)=>new Promise((resolve, reject)=>{
299
+ const reader = new FileReader();
300
+ reader.onload = ()=>{
301
+ const base64String = reader.result;
302
+ resolve(base64String.indexOf(',') >= 0 ? base64String.split(',')[1] : base64String);
303
+ };
304
+ reader.onerror = (error)=>reject(error);
305
+ reader.readAsDataURL(blob);
306
+ });
307
+ const normalizeHttpHeaders = (headers = {})=>{
308
+ const originalKeys = Object.keys(headers);
309
+ const loweredKeys = Object.keys(headers).map((k)=>k.toLocaleLowerCase());
310
+ const normalized = loweredKeys.reduce((acc, key, index)=>{
311
+ acc[key] = headers[originalKeys[index]];
312
+ return acc;
313
+ }, {});
314
+ return normalized;
315
+ };
316
+ const buildUrlParams = (params, shouldEncode = true)=>{
317
+ if (!params) return null;
318
+ const output = Object.entries(params).reduce((accumulator, entry)=>{
319
+ const [key, value] = entry;
320
+ let encodedValue;
321
+ let item;
322
+ if (Array.isArray(value)) {
323
+ item = '';
324
+ value.forEach((str)=>{
325
+ encodedValue = shouldEncode ? encodeURIComponent(str) : str;
326
+ item += `${key}=${encodedValue}&`;
327
+ });
328
+ item.slice(0, -1);
329
+ } else {
330
+ encodedValue = shouldEncode ? encodeURIComponent(value) : value;
331
+ item = `${key}=${encodedValue}`;
332
+ }
333
+ return `${accumulator}&${item}`;
334
+ }, '');
335
+ return output.substr(1);
336
+ };
337
+ const buildRequestInit = (options, extra = {})=>{
338
+ const output = Object.assign({
339
+ method: options.method || 'GET',
340
+ headers: options.headers
341
+ }, extra);
342
+ const headers = normalizeHttpHeaders(options.headers);
343
+ const type = headers['content-type'] || '';
344
+ if ('string' == typeof options.data) output.body = options.data;
345
+ else if (type.includes('application/x-www-form-urlencoded')) {
346
+ const params = new URLSearchParams();
347
+ for (const [key, value] of Object.entries(options.data || {}))params.set(key, value);
348
+ output.body = params.toString();
349
+ } else if (type.includes('multipart/form-data') || options.data instanceof FormData) {
350
+ const form = new FormData();
351
+ if (options.data instanceof FormData) options.data.forEach((value, key)=>{
352
+ form.append(key, value);
353
+ });
354
+ else for (const key of Object.keys(options.data))form.append(key, options.data[key]);
355
+ output.body = form;
356
+ const headers = new Headers(output.headers);
357
+ headers.delete('content-type');
358
+ output.headers = headers;
359
+ } else if (type.includes('application/json') || 'object' == typeof options.data) output.body = JSON.stringify(options.data);
360
+ return output;
361
+ };
362
+ class CapacitorHttpPluginWeb extends WebPlugin {
363
+ async request(options) {
364
+ const requestInit = buildRequestInit(options, options.webFetchExtra);
365
+ const urlParams = buildUrlParams(options.params, options.shouldEncodeUrlParams);
366
+ const url = urlParams ? `${options.url}?${urlParams}` : options.url;
367
+ const response = await fetch(url, requestInit);
368
+ const contentType = response.headers.get('content-type') || '';
369
+ let { responseType = 'text' } = response.ok ? options : {};
370
+ if (contentType.includes('application/json')) responseType = 'json';
371
+ let data;
372
+ let blob;
373
+ switch(responseType){
374
+ case 'arraybuffer':
375
+ case 'blob':
376
+ blob = await response.blob();
377
+ data = await readBlobAsBase64(blob);
378
+ break;
379
+ case 'json':
380
+ data = await response.json();
381
+ break;
382
+ case 'document':
383
+ case 'text':
384
+ default:
385
+ data = await response.text();
386
+ }
387
+ const headers = {};
388
+ response.headers.forEach((value, key)=>{
389
+ headers[key] = value;
390
+ });
391
+ return {
392
+ data,
393
+ headers,
394
+ status: response.status,
395
+ url: response.url
396
+ };
397
+ }
398
+ async get(options) {
399
+ return this.request(Object.assign(Object.assign({}, options), {
400
+ method: 'GET'
401
+ }));
402
+ }
403
+ async post(options) {
404
+ return this.request(Object.assign(Object.assign({}, options), {
405
+ method: 'POST'
406
+ }));
407
+ }
408
+ async put(options) {
409
+ return this.request(Object.assign(Object.assign({}, options), {
410
+ method: 'PUT'
411
+ }));
412
+ }
413
+ async patch(options) {
414
+ return this.request(Object.assign(Object.assign({}, options), {
415
+ method: 'PATCH'
416
+ }));
417
+ }
418
+ async delete(options) {
419
+ return this.request(Object.assign(Object.assign({}, options), {
420
+ method: 'DELETE'
421
+ }));
422
+ }
423
+ }
424
+ registerPlugin('CapacitorHttp', {
425
+ web: ()=>new CapacitorHttpPluginWeb()
426
+ });
427
+ var SystemBarsStyle;
428
+ (function(SystemBarsStyle) {
429
+ SystemBarsStyle["Dark"] = "DARK";
430
+ SystemBarsStyle["Light"] = "LIGHT";
431
+ SystemBarsStyle["Default"] = "DEFAULT";
432
+ })(SystemBarsStyle || (SystemBarsStyle = {}));
433
+ var SystemBarType;
434
+ (function(SystemBarType) {
435
+ SystemBarType["StatusBar"] = "StatusBar";
436
+ SystemBarType["NavigationBar"] = "NavigationBar";
437
+ })(SystemBarType || (SystemBarType = {}));
438
+ class SystemBarsPluginWeb extends WebPlugin {
439
+ async setStyle() {
440
+ this.unavailable('not available for web');
441
+ }
442
+ async setAnimation() {
443
+ this.unavailable('not available for web');
444
+ }
445
+ async show() {
446
+ this.unavailable('not available for web');
447
+ }
448
+ async hide() {
449
+ this.unavailable('not available for web');
450
+ }
451
+ }
452
+ registerPlugin('SystemBars', {
453
+ web: ()=>new SystemBarsPluginWeb()
454
+ });
455
+ __webpack_require__.d(__webpack_exports__, {
456
+ E_: ()=>WebPlugin
457
+ }, {
458
+ F3: registerPlugin
459
+ });
460
+ },
461
+ 5303 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
462
+ "use strict";
463
+ var _capacitor_core__rspack_import_0 = __webpack_require__(6546);
464
+ class DeviceWeb extends _capacitor_core__rspack_import_0.E_ {
465
+ async getId() {
466
+ return {
467
+ identifier: this.getUid()
468
+ };
469
+ }
470
+ async getInfo() {
471
+ if ("u" < typeof navigator || !navigator.userAgent) throw this.unavailable('Device API not available in this browser');
472
+ const ua = navigator.userAgent;
473
+ const uaFields = this.parseUa(ua);
474
+ return {
475
+ model: uaFields.model,
476
+ platform: 'web',
477
+ operatingSystem: uaFields.operatingSystem,
478
+ osVersion: uaFields.osVersion,
479
+ manufacturer: navigator.vendor,
480
+ isVirtual: false,
481
+ webViewVersion: uaFields.browserVersion
482
+ };
483
+ }
484
+ async getBatteryInfo() {
485
+ if ("u" < typeof navigator || !navigator.getBattery) throw this.unavailable('Device API not available in this browser');
486
+ let battery = {};
487
+ try {
488
+ battery = await navigator.getBattery();
489
+ } catch (e) {}
490
+ return {
491
+ batteryLevel: battery.level,
492
+ isCharging: battery.charging
493
+ };
494
+ }
495
+ async getLanguageCode() {
496
+ return {
497
+ value: navigator.language.split('-')[0].toLowerCase()
498
+ };
499
+ }
500
+ async getLanguageTag() {
501
+ return {
502
+ value: navigator.language
503
+ };
504
+ }
505
+ parseUa(ua) {
506
+ const uaFields = {};
507
+ const start = ua.indexOf('(') + 1;
508
+ let end = ua.indexOf(') AppleWebKit');
509
+ if (-1 !== ua.indexOf(') Gecko')) end = ua.indexOf(') Gecko');
510
+ const fields = ua.substring(start, end);
511
+ if (-1 !== ua.indexOf('Android')) {
512
+ const tmpFields = fields.replace('; wv', '').split('; ').pop();
513
+ if (tmpFields) uaFields.model = tmpFields.split(' Build')[0];
514
+ uaFields.osVersion = fields.split('; ')[1];
515
+ } else {
516
+ uaFields.model = fields.split('; ')[0];
517
+ if ("u" > typeof navigator && navigator.oscpu) uaFields.osVersion = navigator.oscpu;
518
+ else if (-1 !== ua.indexOf('Windows')) uaFields.osVersion = fields;
519
+ else {
520
+ const tmpFields = fields.split('; ').pop();
521
+ if (tmpFields) {
522
+ const lastParts = tmpFields.replace(' like Mac OS X', '').split(' ');
523
+ uaFields.osVersion = lastParts[lastParts.length - 1].replace(/_/g, '.');
524
+ }
525
+ }
526
+ }
527
+ if (/android/i.test(ua)) uaFields.operatingSystem = 'android';
528
+ else if (/iPad|iPhone|iPod/.test(ua) && !window.MSStream) uaFields.operatingSystem = 'ios';
529
+ else if (/Win/.test(ua)) uaFields.operatingSystem = 'windows';
530
+ else if (/Mac/i.test(ua)) uaFields.operatingSystem = 'mac';
531
+ else uaFields.operatingSystem = 'unknown';
532
+ const isSafari = !!window.ApplePaySession;
533
+ const isChrome = !!window.chrome;
534
+ const isFirefox = /Firefox/.test(ua);
535
+ const isEdge = /Edg/.test(ua);
536
+ const isFirefoxIOS = /FxiOS/.test(ua);
537
+ const isChromeIOS = /CriOS/.test(ua);
538
+ const isEdgeIOS = /EdgiOS/.test(ua);
539
+ if (isSafari || isChrome && !isEdge || isFirefoxIOS || isChromeIOS || isEdgeIOS) {
540
+ let searchWord;
541
+ searchWord = isFirefoxIOS ? 'FxiOS' : isChromeIOS ? 'CriOS' : isEdgeIOS ? 'EdgiOS' : isSafari ? 'Version' : 'Chrome';
542
+ const words = ua.split(' ');
543
+ for (const word of words)if (word.includes(searchWord)) {
544
+ const version = word.split('/')[1];
545
+ uaFields.browserVersion = version;
546
+ }
547
+ } else if (isFirefox || isEdge) {
548
+ const reverseUA = ua.split('').reverse().join('');
549
+ const reverseVersion = reverseUA.split('/')[0];
550
+ const version = reverseVersion.split('').reverse().join('');
551
+ uaFields.browserVersion = version;
552
+ }
553
+ return uaFields;
554
+ }
555
+ getUid() {
556
+ if ("u" > typeof window && window.localStorage) {
557
+ let uid = window.localStorage.getItem('_capuid');
558
+ if (uid) return uid;
559
+ uid = this.uuid4();
560
+ window.localStorage.setItem('_capuid', uid);
561
+ return uid;
562
+ }
563
+ return this.uuid4();
564
+ }
565
+ uuid4() {
566
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
567
+ const r = 16 * Math.random() | 0, v = 'x' === c ? r : 0x3 & r | 0x8;
568
+ return v.toString(16);
569
+ });
570
+ }
571
+ }
572
+ __webpack_require__.d(__webpack_exports__, {
573
+ DeviceWeb: ()=>DeviceWeb
574
+ });
575
+ },
8
576
  2791 (module1, __webpack_exports__, __webpack_require__) {
9
577
  "use strict";
10
578
  var _node_modules_rsbuild_core_compiled_css_loader_noSourceMaps_js__rspack_import_0 = __webpack_require__(5068);
@@ -10670,7 +11238,8 @@
10670
11238
  __webpack_require__.d(__webpack_exports__, {
10671
11239
  Reactions: ()=>Reactions,
10672
11240
  VideoType: ()=>VideoType,
10673
- VideomailClient: ()=>VideomailClient
11241
+ VideomailClient: ()=>VideomailClient,
11242
+ getCapacitorDeviceMetadata: ()=>util_getCapacitorDeviceMetadata
10674
11243
  });
10675
11244
  const VideoType = {
10676
11245
  WebM: "webm",
@@ -10926,7 +11495,7 @@
10926
11495
  var client = __webpack_require__(5734);
10927
11496
  var client_default = /*#__PURE__*/ __webpack_require__.n(client);
10928
11497
  var package_namespaceObject = {
10929
- rE: "15.0.3"
11498
+ rE: "15.2.0"
10930
11499
  };
10931
11500
  function isAudioEnabled(options) {
10932
11501
  return Boolean(options.audio.enabled);
@@ -14536,6 +15105,45 @@
14536
15105
  return exc;
14537
15106
  }
14538
15107
  const error_findOriginalExc = findOriginalExc;
15108
+ var dist = __webpack_require__(6546);
15109
+ const Device = (0, dist.F3)('Device', {
15110
+ web: ()=>Promise.resolve().then(__webpack_require__.bind(__webpack_require__, 5303)).then((m)=>new m.DeviceWeb())
15111
+ });
15112
+ async function getCapacitorDeviceMetadata() {
15113
+ const errors = [];
15114
+ let battery;
15115
+ let info;
15116
+ let languageCode;
15117
+ let languageTag;
15118
+ try {
15119
+ info = await Device.getInfo();
15120
+ } catch (exc) {
15121
+ errors.push(serializeError(exc));
15122
+ }
15123
+ try {
15124
+ battery = await Device.getBatteryInfo();
15125
+ } catch (exc) {
15126
+ errors.push(serializeError(exc));
15127
+ }
15128
+ try {
15129
+ languageCode = await Device.getLanguageCode();
15130
+ } catch (exc) {
15131
+ errors.push(serializeError(exc));
15132
+ }
15133
+ try {
15134
+ languageTag = await Device.getLanguageTag();
15135
+ } catch (exc) {
15136
+ errors.push(serializeError(exc));
15137
+ }
15138
+ const metadata = {};
15139
+ if (battery) metadata.battery = battery;
15140
+ if (errors.length > 0) metadata.errors = errors;
15141
+ if (info) metadata.info = info;
15142
+ if (languageCode) metadata.languageCode = languageCode;
15143
+ if (languageTag) metadata.languageTag = languageTag;
15144
+ return metadata;
15145
+ }
15146
+ const util_getCapacitorDeviceMetadata = getCapacitorDeviceMetadata;
14539
15147
  function _extends() {
14540
15148
  _extends = Object.assign || function(target) {
14541
15149
  for(var i = 1; i < arguments.length; i++){
@@ -15053,35 +15661,33 @@
15053
15661
  [constants.WHITELIST_KEY_LABEL]: this.options.whitelistKey
15054
15662
  };
15055
15663
  const url = `${this.options.apiUrl}/client-error/`;
15056
- try {
15057
- const fullVideomailErrorData = {
15058
- browser: err.browser,
15059
- code: err.code,
15060
- cookie: err.cookie,
15061
- cpu: err.cpu,
15062
- device: err.device,
15063
- engine: err.engine,
15064
- err: err.err ? serializeError(err.err) : void 0,
15065
- explanation: err.explanation,
15066
- location: err.location,
15067
- logLines: err.logLines,
15068
- orientation: err.orientation,
15069
- os: err.os,
15070
- screen: err.screen,
15071
- whitelistKey: err.whitelistKey,
15072
- status: err.status,
15073
- title: err.title,
15074
- message: err.message,
15075
- stack: err.stack,
15076
- versions: {
15077
- videomailClient: package_namespaceObject.rE,
15078
- videomailNinjaFormPlugin: this.options.versions?.videomailNinjaFormPlugin
15079
- }
15080
- };
15081
- await client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(fullVideomailErrorData).timeout(this.options.timeouts.connection);
15082
- } catch (exc) {
15083
- console.error(exc);
15084
- }
15664
+ const capacitorDevice = await util_getCapacitorDeviceMetadata();
15665
+ const fullVideomailErrorData = {
15666
+ capacitorDevice,
15667
+ browser: err.browser,
15668
+ code: err.code,
15669
+ cookie: err.cookie,
15670
+ cpu: err.cpu,
15671
+ device: err.device,
15672
+ engine: err.engine,
15673
+ err: err.err ? serializeError(err.err) : void 0,
15674
+ explanation: err.explanation,
15675
+ location: err.location,
15676
+ logLines: err.logLines,
15677
+ orientation: err.orientation,
15678
+ os: err.os,
15679
+ screen: err.screen,
15680
+ whitelistKey: err.whitelistKey,
15681
+ status: err.status,
15682
+ title: err.title,
15683
+ message: err.message,
15684
+ stack: err.stack,
15685
+ versions: {
15686
+ videomailClient: package_namespaceObject.rE,
15687
+ videomailNinjaFormPlugin: this.options.versions?.videomailNinjaFormPlugin
15688
+ }
15689
+ };
15690
+ await client_default()(FormMethod.POST, url).query(queryParams).set("Timezone-Id", this.timezoneId).withCredentials().send(fullVideomailErrorData).timeout(this.options.timeouts.connection);
15085
15691
  }
15086
15692
  async post(videomail) {
15087
15693
  const newVideomail = this.applyDefaultValues(videomail);
@@ -17705,12 +18311,12 @@
17705
18311
  }
17706
18312
  getAvgInterval() {
17707
18313
  const intervalSum = this.getIntervalSum();
17708
- if (!intervalSum) return;
18314
+ if (void 0 === intervalSum || intervalSum <= 0) return;
17709
18315
  return intervalSum / this.framesCount;
17710
18316
  }
17711
18317
  getAvgFps() {
17712
18318
  const intervalSum = this.getIntervalSum();
17713
- if (!intervalSum) return;
18319
+ if (void 0 === intervalSum || intervalSum <= 0) return;
17714
18320
  return this.framesCount / intervalSum * 1000;
17715
18321
  }
17716
18322
  getRecordingStats() {