native-fn 1.0.52 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/native.cjs +1 -1
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +1 -1
  5. package/dist/native.umd.js +1 -1
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +5 -9
  8. package/dist/plugin/app/index.min.cjs +1 -1
  9. package/dist/plugin/app/index.min.mjs +1 -1
  10. package/dist/plugin/app/index.mjs +5 -9
  11. package/dist/plugin/app/index.umd.js +5 -9
  12. package/dist/plugin/app/index.umd.min.js +1 -1
  13. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -1
  14. package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -1
  15. package/dist/plugin/clipboard/index.cjs +519 -2
  16. package/dist/plugin/clipboard/index.min.cjs +1 -1
  17. package/dist/plugin/clipboard/index.min.mjs +1 -1
  18. package/dist/plugin/clipboard/index.mjs +519 -2
  19. package/dist/plugin/clipboard/index.umd.js +519 -2
  20. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  21. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -1
  22. package/dist/plugin/fullscreen/index.cjs +46 -22
  23. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  24. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  25. package/dist/plugin/fullscreen/index.mjs +46 -22
  26. package/dist/plugin/fullscreen/index.umd.js +46 -22
  27. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  28. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -1
  29. package/dist/plugin/theme/index.cjs +52 -27
  30. package/dist/plugin/theme/index.d.ts +2 -1
  31. package/dist/plugin/theme/index.min.cjs +1 -1
  32. package/dist/plugin/theme/index.min.mjs +1 -1
  33. package/dist/plugin/theme/index.mjs +52 -27
  34. package/dist/plugin/theme/index.umd.js +52 -27
  35. package/dist/plugin/theme/index.umd.min.js +1 -1
  36. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -1
  37. package/dist/src/plugin/theme/types/theme.d.ts +2 -1
  38. package/package.json +1 -1
@@ -207,6 +207,483 @@ var EventListenerUtils = {
207
207
  }
208
208
  };
209
209
 
210
+ function compareVersion(lhs, rhs) {
211
+ var pa = lhs.split('.');
212
+ var pb = rhs.split('.');
213
+ var length = Math.max(pa.length, pb.length);
214
+ for (var i = 0; i < length; i++) {
215
+ var a = void 0;
216
+ var b = void 0;
217
+ if (i < pa.length)
218
+ a = parseInt(pa[i], 10);
219
+ else
220
+ a = 0;
221
+ if (i < pb.length)
222
+ b = parseInt(pb[i], 10);
223
+ else
224
+ b = 0;
225
+ if (a > b)
226
+ return 1;
227
+ if (a < b)
228
+ return -1;
229
+ }
230
+ return 0;
231
+ }
232
+
233
+ var OS;
234
+ (function (OS) {
235
+ OS["Unknown"] = "Unknown";
236
+ OS["Android"] = "Android";
237
+ OS["iOS"] = "iOS";
238
+ OS["Windows"] = "Windows";
239
+ OS["MacOS"] = "MacOS";
240
+ })(OS || (OS = {}));
241
+ var Devices;
242
+ (function (Devices) {
243
+ Devices["Unknown"] = "Unknown";
244
+ Devices["Mobile"] = "Mobile";
245
+ Devices["Desktop"] = "Desktop";
246
+ })(Devices || (Devices = {}));
247
+ var Engines;
248
+ (function (Engines) {
249
+ Engines["Unknown"] = "Unknown";
250
+ Engines["EdgeHTML"] = "EdgeHTML";
251
+ Engines["ArkWeb"] = "ArkWeb";
252
+ Engines["Blink"] = "Blink";
253
+ Engines["Presto"] = "Presto";
254
+ Engines["WebKit"] = "WebKit";
255
+ Engines["Trident"] = "Trident";
256
+ Engines["NetFront"] = "NetFront";
257
+ Engines["KHTML"] = "KHTML";
258
+ Engines["Tasman"] = "Tasman";
259
+ Engines["Gecko"] = "Gecko";
260
+ })(Engines || (Engines = {}));
261
+ var Browsers;
262
+ (function (Browsers) {
263
+ Browsers["Unknown"] = "Unknown";
264
+ Browsers["Chrome"] = "Chrome";
265
+ Browsers["Safari"] = "Safari";
266
+ Browsers["Edge"] = "Edge";
267
+ Browsers["Firefox"] = "Firefox";
268
+ Browsers["Opera"] = "Opera";
269
+ Browsers["IE"] = "IE";
270
+ Browsers["SamsungInternet"] = "SamsungInternet";
271
+ })(Browsers || (Browsers = {}));
272
+ var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
273
+ var Platform = {
274
+ device: Devices.Unknown,
275
+ os: OS.Unknown,
276
+ osVersion: '',
277
+ engine: Engines.Unknown,
278
+ engineVersion: '',
279
+ browser: Browsers.Unknown,
280
+ browserVersion: '',
281
+ renderer: getRenderer(),
282
+ userAgent: userAgent,
283
+ isMobile: false,
284
+ isDesktop: false,
285
+ isStandalone: false,
286
+ isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
287
+ isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
288
+ isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
289
+ isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
290
+ };
291
+ var OS_RESOLVER_MAP = [
292
+ [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
293
+ [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
294
+ [/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i, OS.Windows, resolveWindowsVersion],
295
+ [/windows nt ?([\d.)]*)(?!.+xbox)/i, OS.Windows, resolveWindowsVersion],
296
+ [/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i, OS.Windows, resolveWindowsVersion],
297
+ [/windows ce\/?([\d.]*)/i, OS.Windows, resolveWindowsVersion],
298
+ [/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i, OS.iOS, resolveUnderscoreVersion],
299
+ [/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i, OS.iOS, resolveUnderscoreVersion],
300
+ [/cfnetwork\/.+darwin/i, OS.iOS, resolveUnderscoreVersion],
301
+ [/mac os x ?([\w. ]*)/i, OS.MacOS, resolveUnderscoreVersion],
302
+ [/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i, OS.MacOS, resolveUnderscoreVersion],
303
+ [/droid ([\w.]+)\b.+(android[- ]x86)/i, OS.Android],
304
+ [/android\w*[-\/.; ]?([\d.]*)/i, OS.Android],
305
+ ];
306
+ var ENGINE_RESOLVER_MAP = [
307
+ [/windows.+ edge\/([\w.]+)/i, Engines.EdgeHTML],
308
+ [/arkweb\/([\w.]+)/i, Engines.ArkWeb],
309
+ [/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i, Engines.Blink],
310
+ [/presto\/([\w.]+)/i, Engines.Presto],
311
+ [/webkit\/([\w.]+)/i, Engines.WebKit],
312
+ [/trident\/([\w.]+)/i, Engines.Trident],
313
+ [/netfront\/([\w.]+)/i, Engines.NetFront],
314
+ [/khtml[\/ ]\(?([\w.]+)/i, Engines.KHTML],
315
+ [/tasman[\/ ]\(?([\w.]+)/i, Engines.Tasman],
316
+ [/rv:([\w.]{1,9})\b.+gecko/i, Engines.Gecko]
317
+ ];
318
+ var BROWSER_RESOLVER_MAP = [
319
+ [/\b(?:crmo|crios)\/([\w.]+)/i, Browsers.Chrome],
320
+ [/webview.+edge\/([\w.]+)/i, Browsers.Edge],
321
+ [/edg(?:e|ios|a)?\/([\w.]+)/i, Browsers.Edge],
322
+ [/opera mini\/([-\w.]+)/i, Browsers.Opera],
323
+ [/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i, Browsers.Opera],
324
+ [/opera(?:.+version\/|[\/ ]+)([\w.]+)/i, Browsers.Opera],
325
+ [/opios[\/ ]+([\w.]+)/i, Browsers.Opera],
326
+ [/\bop(?:rg)?x\/([\w.]+)/i, Browsers.Opera],
327
+ [/\bopr\/([\w.]+)/i, Browsers.Opera],
328
+ [/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i, Browsers.IE],
329
+ [/(?:ms|\()ie ([\w.]+)/i, Browsers.IE],
330
+ [/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i, Browsers.IE],
331
+ [/\bfocus\/([\w.]+)/i, Browsers.Firefox],
332
+ [/\bopt\/([\w.]+)/i, Browsers.Opera],
333
+ [/coast\/([\w.]+)/i, Browsers.Opera],
334
+ [/fxios\/([\w.-]+)/i, Browsers.Firefox],
335
+ [/samsungbrowser\/([\w.]+)/i, Browsers.SamsungInternet],
336
+ [/headlesschrome(?:\/([\w.]+)| )/i, Browsers.Chrome],
337
+ [/wv\).+chrome\/([\w.]+).+edgw\//i, Browsers.Edge],
338
+ [/ wv\).+(chrome)\/([\w.]+)/i, Browsers.Chrome],
339
+ [/chrome\/([\w.]+) mobile/i, Browsers.Chrome],
340
+ [/chrome\/v?([\w.]+)/i, Browsers.Chrome],
341
+ [/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
342
+ [/iphone .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
343
+ [/version\/([\w.,]+) .*safari/i, Browsers.Safari],
344
+ [/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i, Browsers.Safari, '1'],
345
+ [/(?:mobile|tablet);.*firefox\/([\w.-]+)/i, Browsers.Firefox],
346
+ [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
347
+ [/firefox\/([\w.]+)/i, Browsers.Firefox],
348
+ ];
349
+ function resolveWindowsVersion(string) {
350
+ if (string === undefined)
351
+ return '';
352
+ var mapped = {
353
+ '4.90': 'ME',
354
+ 'NT3.51': 'NT 3.11',
355
+ 'NT4.0': 'NT 4.0',
356
+ 'NT 5.0': '2000',
357
+ 'NT 5.1': 'XP',
358
+ 'NT 5.2': 'XP',
359
+ 'NT 6.0': 'Vista',
360
+ 'NT 6.1': '7',
361
+ 'NT 6.2': '8',
362
+ 'NT 6.3': '8.1',
363
+ 'NT 6.4': '10',
364
+ 'NT 10.0': '10',
365
+ 'ARM': 'RT'
366
+ }[string];
367
+ if (mapped !== undefined)
368
+ return mapped;
369
+ return string;
370
+ }
371
+ function resolveUnderscoreVersion(string) {
372
+ if (string === undefined)
373
+ return '';
374
+ return string.replace(/_/g, '.');
375
+ }
376
+ function resolveSemanticWindowsVersion(version, defaultValue) {
377
+ if (version.major === 10 && version.minor === 0 && version.build >= 22000)
378
+ return '11';
379
+ if (version.major === 10 && version.minor === 0 && version.build < 22000)
380
+ return '10';
381
+ if (version.major === 6 && version.minor === 3)
382
+ return '8.1';
383
+ if (version.major === 6 && version.minor === 2)
384
+ return '8';
385
+ if (version.major === 6 && version.minor === 1)
386
+ return '7';
387
+ if (version.major === 6 && version.minor === 0)
388
+ return 'Vista';
389
+ if (version.major === 5 && version.minor === 1)
390
+ return 'XP';
391
+ if (version.major === 5 && version.minor === 2)
392
+ return 'XP';
393
+ if (version.major === 5 && version.minor === 0)
394
+ return '2000';
395
+ if (version.major === 4 && version.minor === 90)
396
+ return 'ME';
397
+ if (version.major === 4 && version.minor === 0)
398
+ return 'NT 4.0';
399
+ if (version.major === 3 && version.minor === 51)
400
+ return 'NT 3.11';
401
+ return defaultValue;
402
+ }
403
+ function resolveSemanticDarwinVersion(version, defaultValue) {
404
+ if (version.major >= 24)
405
+ return '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
406
+ if (version.major === 23)
407
+ return '14.' + version.minor + '.' + version.build;
408
+ if (version.major === 22)
409
+ return '13.' + version.minor + '.' + version.build;
410
+ if (version.major === 21)
411
+ return '12.' + version.minor + '.' + version.build;
412
+ if (version.major === 20)
413
+ return '11.' + version.minor + '.' + version.build;
414
+ if (version.major === 19)
415
+ return '10.15.' + version.minor;
416
+ if (version.major === 18)
417
+ return '10.14.' + version.minor;
418
+ if (version.major === 17)
419
+ return '10.13.' + version.minor;
420
+ if (version.major === 16)
421
+ return '10.12.' + version.minor;
422
+ if (version.major === 15)
423
+ return '10.11.' + version.minor;
424
+ if (version.major === 14)
425
+ return '10.10.' + version.minor;
426
+ if (version.major === 13)
427
+ return '10.9.' + version.minor;
428
+ if (version.major >= 5 && version.major <= 12)
429
+ return '10.' + (version.major - 4) + '.' + version.minor;
430
+ return defaultValue;
431
+ }
432
+ function resolveSemanticAndroidVersion(version, defaultValue) {
433
+ if (version.major >= 36)
434
+ return '16';
435
+ if (version.major === 35)
436
+ return '15';
437
+ if (version.major === 34)
438
+ return '14';
439
+ if (version.major === 33)
440
+ return '13';
441
+ if (version.major === 32)
442
+ return '12.1';
443
+ if (version.major === 31)
444
+ return '12';
445
+ if (version.major === 30)
446
+ return '11';
447
+ if (version.major === 29)
448
+ return '10';
449
+ if (version.major === 28)
450
+ return '9';
451
+ if (version.major === 27)
452
+ return '8.1';
453
+ if (version.major === 26)
454
+ return '8.0';
455
+ if (version.major === 25)
456
+ return '7.1';
457
+ if (version.major === 24)
458
+ return '7.0';
459
+ if (version.major === 23)
460
+ return '6.0';
461
+ if (version.major === 22)
462
+ return '5.1';
463
+ if (version.major === 21)
464
+ return '5.0';
465
+ if (version.major === 20)
466
+ return '4.4W';
467
+ if (version.major === 19)
468
+ return '4.4';
469
+ if (version.major === 18)
470
+ return '4.3';
471
+ if (version.major === 17)
472
+ return '4.2';
473
+ if (version.major === 16)
474
+ return '4.1';
475
+ if (version.major === 15)
476
+ return '4.0.3';
477
+ if (version.major === 14)
478
+ return '4.0';
479
+ if (version.major === 13)
480
+ return '3.2';
481
+ if (version.major === 12)
482
+ return '3.1';
483
+ if (version.major === 11)
484
+ return '3.0';
485
+ if (version.major === 10)
486
+ return '2.3.3';
487
+ if (version.major === 9)
488
+ return '2.3';
489
+ if (version.major === 8)
490
+ return '2.2';
491
+ if (version.major === 7)
492
+ return '2.1';
493
+ if (version.major === 6)
494
+ return '2.0.1';
495
+ if (version.major === 5)
496
+ return '2.0';
497
+ if (version.major === 4)
498
+ return '1.6';
499
+ if (version.major === 3)
500
+ return '1.5';
501
+ if (version.major === 2)
502
+ return '1.1';
503
+ if (version.major === 1)
504
+ return '1.0';
505
+ return defaultValue;
506
+ }
507
+ function resolveVersion(string, resolver) {
508
+ if (typeof resolver === 'function')
509
+ return resolver(string);
510
+ if (typeof resolver === 'string')
511
+ return resolver;
512
+ if (string === undefined)
513
+ return '';
514
+ return string;
515
+ }
516
+ function normalizeBrand(entry) {
517
+ if (entry === null || entry === undefined)
518
+ return { brand: '', version: '' };
519
+ if (typeof entry === 'string')
520
+ return { brand: entry, version: '' };
521
+ return { brand: entry.brand, version: entry.version };
522
+ }
523
+ function getRenderer() {
524
+ if (typeof globalThis.document === 'undefined')
525
+ return '';
526
+ var canvas = globalThis.document.createElement('canvas');
527
+ if (typeof canvas.getContext !== 'function')
528
+ return '';
529
+ var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
530
+ if (context === null)
531
+ return '';
532
+ if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
533
+ var extension = context.getExtension('WEBGL_debug_renderer_info');
534
+ if (extension === null)
535
+ return context.getParameter(context.RENDERER);
536
+ else
537
+ return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
538
+ }
539
+ else {
540
+ return '';
541
+ }
542
+ }
543
+ function getIsStandalone(os) {
544
+ if (!('matchMedia' in globalThis))
545
+ return false;
546
+ if (os === OS.iOS)
547
+ return 'standalone' in navigator && !!navigator.standalone;
548
+ return globalThis.matchMedia('(display-mode: standalone)').matches;
549
+ }
550
+ function getSemanticVersion(string) {
551
+ var parts = string.split('.');
552
+ return {
553
+ major: parseInt(parts[0] || '0'),
554
+ minor: parseInt(parts[1] || '0'),
555
+ build: parseInt(parts[2] || '0')
556
+ };
557
+ }
558
+ for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
559
+ var map = OS_RESOLVER_MAP[i];
560
+ var regexp = map[0];
561
+ var os = map[1];
562
+ var resolver = map[2];
563
+ var matched = Platform.userAgent.match(regexp);
564
+ if (matched !== null) {
565
+ Platform.os = os;
566
+ Platform.osVersion = resolveVersion(matched[1], resolver);
567
+ break;
568
+ }
569
+ }
570
+ if (Platform.os === OS.iOS && compareVersion(Platform.osVersion, '18.6') === 0) {
571
+ var version = /\) Version\/([\d.]+)/.exec(Platform.userAgent);
572
+ if (version !== null && parseInt(version[1].substring(0, 2), 10) >= 26)
573
+ Platform.osVersion = version[1];
574
+ }
575
+ for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
576
+ var map = ENGINE_RESOLVER_MAP[i];
577
+ var regexp = map[0];
578
+ var engine = map[1];
579
+ var resolver = map[2];
580
+ var matched = Platform.userAgent.match(regexp);
581
+ if (matched !== null) {
582
+ Platform.engine = engine;
583
+ Platform.engineVersion = resolveVersion(matched[1], resolver);
584
+ break;
585
+ }
586
+ }
587
+ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
588
+ var map = BROWSER_RESOLVER_MAP[i];
589
+ var regexp = map[0];
590
+ var browser = map[1];
591
+ var resolver = map[2];
592
+ var matched = Platform.userAgent.match(regexp);
593
+ if (matched !== null) {
594
+ Platform.browser = browser;
595
+ Platform.browserVersion = resolveVersion(matched[1], resolver);
596
+ break;
597
+ }
598
+ }
599
+ if (Platform.isReactNative) {
600
+ try {
601
+ var reactNative = require('react-native');
602
+ var platform = reactNative.Platform;
603
+ var os = platform.OS;
604
+ var release = '' + platform.Version;
605
+ var version = getSemanticVersion(release);
606
+ switch (os) {
607
+ case 'android':
608
+ Platform.os = OS.Android;
609
+ Platform.osVersion = resolveSemanticAndroidVersion(version, release);
610
+ break;
611
+ case 'ios':
612
+ Platform.os = OS.iOS;
613
+ Platform.osVersion = release;
614
+ break;
615
+ case 'windows':
616
+ Platform.os = OS.Windows;
617
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
618
+ break;
619
+ case 'macos':
620
+ Platform.os = OS.MacOS;
621
+ Platform.osVersion = release;
622
+ break;
623
+ }
624
+ }
625
+ catch (_) {
626
+ }
627
+ }
628
+ if (Platform.isNodeJS) {
629
+ try {
630
+ var os = require('os');
631
+ var platform = os.platform();
632
+ var release = os.release();
633
+ var version = getSemanticVersion(release);
634
+ switch (platform) {
635
+ case 'win32':
636
+ Platform.os = OS.Windows;
637
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
638
+ break;
639
+ case 'darwin':
640
+ Platform.os = OS.MacOS;
641
+ Platform.osVersion = resolveSemanticDarwinVersion(version, release);
642
+ break;
643
+ case 'android':
644
+ Platform.os = OS.Android;
645
+ Platform.osVersion = release;
646
+ break;
647
+ case 'linux':
648
+ if (/android/i.test(release)) {
649
+ Platform.os = OS.Android;
650
+ Platform.osVersion = release;
651
+ }
652
+ break;
653
+ }
654
+ }
655
+ catch (_) {
656
+ }
657
+ }
658
+ if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
659
+ navigator
660
+ .userAgentData
661
+ .getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
662
+ .then(function (result) {
663
+ var brands = result.fullVersionList || result.brands || [];
664
+ var platformVersion = result.platformVersion;
665
+ for (var i = 0; i < brands.length; i++) {
666
+ var brand = normalizeBrand(brands[i]);
667
+ var brandName = brand.brand;
668
+ var brandVersion = brand.version;
669
+ if (/not.a.brand/i.test(brandName))
670
+ continue;
671
+ if (brandName === "Chromium")
672
+ Platform.engineVersion = brandVersion;
673
+ }
674
+ if (typeof platformVersion === 'string') {
675
+ if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
676
+ Platform.osVersion = '11';
677
+ else
678
+ Platform.osVersion = platformVersion;
679
+ }
680
+ });
681
+ }
682
+ Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
683
+ Platform.isMobile = Platform.device === Devices.Mobile;
684
+ Platform.isDesktop = Platform.device === Devices.Desktop;
685
+ Platform.isStandalone = getIsStandalone(Platform.os);
686
+
210
687
  function isObject(item) {
211
688
  return item !== null && typeof item === 'object';
212
689
  }
@@ -247,7 +724,10 @@ function supportsClipboardReadAPI() {
247
724
  }
248
725
  function copy(item) {
249
726
  var text = convertToString(item);
250
- if (supportsClipboardWriteAPI()) {
727
+ if (Platform.isElectron) {
728
+ return copyViaElectron(text);
729
+ }
730
+ else if (supportsClipboardWriteAPI()) {
251
731
  return copyViaClipboardAPI(text)
252
732
  .then(function (success) {
253
733
  if (success)
@@ -260,6 +740,24 @@ function copy(item) {
260
740
  }
261
741
  return Promise.resolve(copyViaLegacy(text));
262
742
  }
743
+ function copyViaElectron(text) {
744
+ try {
745
+ var electron_1 = require('electron');
746
+ return new Promise(function (resolve) {
747
+ try {
748
+ electron_1.clipboard.writeText(text);
749
+ electron_1.clipboard.writeHTML(text);
750
+ resolve(true);
751
+ }
752
+ catch (_) {
753
+ resolve(false);
754
+ }
755
+ });
756
+ }
757
+ catch (_) {
758
+ return Promise.resolve(false);
759
+ }
760
+ }
263
761
  function copyViaClipboardAPI(text) {
264
762
  try {
265
763
  if ('ClipboardItem' in window && 'write' in navigator.clipboard) {
@@ -353,7 +851,10 @@ function copyViaLegacy(text) {
353
851
  return copyViaSelection(text) || copyViaClipboardData(text);
354
852
  }
355
853
  function paste() {
356
- if (supportsClipboardReadAPI()) {
854
+ if (Platform.isElectron) {
855
+ return pasteViaElectron();
856
+ }
857
+ else if (supportsClipboardReadAPI()) {
357
858
  return pasteViaClipboardAPI()
358
859
  .then(function (text) {
359
860
  if (text !== null)
@@ -366,6 +867,22 @@ function paste() {
366
867
  }
367
868
  return Promise.resolve(pasteViaLegacy());
368
869
  }
870
+ function pasteViaElectron() {
871
+ try {
872
+ var electron_2 = require('electron');
873
+ return new Promise(function (resolve) {
874
+ try {
875
+ resolve(electron_2.clipboard.readHTML() || electron_2.clipboard.readText());
876
+ }
877
+ catch (_) {
878
+ resolve('');
879
+ }
880
+ });
881
+ }
882
+ catch (_) {
883
+ return Promise.resolve('');
884
+ }
885
+ }
369
886
  function pasteViaClipboardAPI() {
370
887
  try {
371
888
  if ('ClipboardItem' in window && 'read' in navigator.clipboard) {
@@ -1 +1 @@
1
- "use strict";function t(t,e){if(void 0===e&&(e=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(t);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),e?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r="",o=0;o<e.length-2;o++){var i=e[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(t,e){void 0===e&&(e={callback:null,options:!1});var o=e.callback;if(void 0!==t&&null!==o){var i=l.withVender(t,e.type),a=e.options;if("function"==typeof t.addEventListener)try{return t.addEventListener(i,o,a)}catch(t){}if("function"==typeof t.addListener)if("boolean"==typeof t.matches)try{return t.addListener(o)}catch(t){}else try{return t.addListener(i,o)}catch(t){}return"function"==typeof t.attachEvent?o.__ieWrapper?t.attachEvent("on"+i,o.__ieWrapper):t.attachEvent("on"+i,o.__ieWrapper=function(e){void 0===e&&(e=globalThis.event),void 0!==e&&(e.currentTarget=t,"function"!=typeof e.preventDefault&&(e.preventDefault=n),"function"!=typeof e.stopPropagation&&(e.stopPropagation=r),"function"==typeof o?o.call(t,e):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(t,e))}):void 0}},remove:function(t,e){void 0===e&&(e={callback:null,options:!1});var n=e.callback;if(void 0!==t&&null!==n){var r=l.withVender(t,e.type),o=e.options;if("function"==typeof t.removeEventListener)try{return t.removeEventListener(r,n,o)}catch(t){}if("function"==typeof t.removeListener)if("boolean"==typeof t.matches)try{return t.removeListener(n)}catch(t){}else try{return t.removeListener(r,n)}catch(t){}if("function"!=typeof t.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(t.detachEvent("on"+r,i),delete n.__ieWrapper)}}},withVender:function(t,n){if(void 0===n)return"";if("webkitEnterFullscreen"in t&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,e)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==t["on"+u])return u}return""}};function c(t){return null!==t&&"object"==typeof t}function u(t){return c(t)||function(t){return Array.isArray(t)}(t)}function s(t){if(function(t){return c(t)&&"innerHTML"in t}(t))return t.innerHTML;if(u(t))try{return JSON.stringify(t)}catch(e){return""+t}else if("string"!=typeof t)return""+t;return t}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var t=location.protocol,e=location.hostname;return"https:"===t||"localhost"===e||"127.0.0.1"===e||"[::1]"===e}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function p(e){return function(e){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=t("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=e,n.style.whiteSpace="pre",n.style.userSelect="text",n.style.setProperty("-webkit-user-select","text"),n.style.setProperty("-moz-user-select","text"),n.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(n);var r=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.setData&&(t.preventDefault(),t.clipboardData.setData("text/html",e),t.clipboardData.setData("text/plain",e))}catch(t){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(t){return h(n,r,i),!1}}(e)||function(t){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.setData)try{return e.setData("Text",t)}catch(t){return!1}return!1}(e)}function f(){return function(){var e=t("div");if(void 0===e)return null;e.contentEditable="true",globalThis.document.body.appendChild(e),e.focus();var n=null,r=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.getData&&(t.preventDefault(),n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null)}catch(t){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=e.innerHTML||e.textContent||null),v(e,r),n}catch(t){return v(e,r),null}}()||function(){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.getData)try{return t.getData("Text")||null}catch(t){return null}return null}()||""}function h(t,e,n){null!==e&&e.removeAllRanges(),globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"copy",callback:n})}function v(t,e){globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"paste",callback:e})}var b={installed:!1,name:"Clipboard",module:{copy:function(t){var e=s(t);return d()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(t){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(t).then((function(){return!0})).catch((function(){return!1}))}catch(t){return Promise.resolve(!1)}return Promise.resolve(!1)}(e).then((function(t){return!!t||p(e)})).catch((function(){return p(e)})):Promise.resolve(p(e))},paste:function(){return d()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(t){if(0===t.length)return Promise.resolve(null);for(var e=t[0],n=e.types,r=0;r<n.length;r++)if("text/html"===n[r])return e.getType("text/html").then((function(t){return t.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return e.getType("text/plain").then((function(t){return t.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(t){return t})).catch((function(){return null}))}catch(t){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(t){return null!==t?t:f()})).catch((function(){return f()})):Promise.resolve(f())}},Constants:{},Errors:{}};module.exports=b;
1
+ "use strict";function e(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}function r(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];for(var t="",o=0;o<r.length-2;o++){var i=r[o];void 0!==i&&(t=t+i.charAt(0).toUpperCase()+i.slice(1))}return t}function n(){this.returnValue=!1}function t(){this.cancelBubble=!0}var o,i,a,s,l=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,c=["","webkit","moz","ms","MS","o","O"],u={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},d={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,r){void 0===r&&(r={callback:null,options:!1});var o=r.callback;if(void 0!==e&&null!==o){var i=d.withVender(e,r.type),a=r.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,o,a)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(o)}catch(e){}else try{return e.addListener(i,o)}catch(e){}return"function"==typeof e.attachEvent?o.__ieWrapper?e.attachEvent("on"+i,o.__ieWrapper):e.attachEvent("on"+i,o.__ieWrapper=function(r){void 0===r&&(r=globalThis.event),void 0!==r&&(r.currentTarget=e,"function"!=typeof r.preventDefault&&(r.preventDefault=n),"function"!=typeof r.stopPropagation&&(r.stopPropagation=t),"function"==typeof o?o.call(e,r):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,r))}):void 0}},remove:function(e,r){void 0===r&&(r={callback:null,options:!1});var n=r.callback;if(void 0!==e&&null!==n){var t=d.withVender(e,r.type),o=r.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(t,n,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(n)}catch(e){}else try{return e.removeListener(t,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(e.detachEvent("on"+t,i),delete n.__ieWrapper)}}},withVender:function(e,n){if(void 0===n)return"";if("webkitEnterFullscreen"in e&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var t;t=n in u?u[n]:l.test(n)?[n,n.replace(l,r)]:[n];for(var o=0;o<c.length;o++)for(var i=0;i<t.length;i++){var a=c[o]+t[i];if(void 0!==e["on"+a])return a}return""}};!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(o||(o={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(i||(i={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(a||(a={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(s||(s={}));var m="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",f={device:i.Unknown,os:o.Unknown,osVersion:"",engine:a.Unknown,engineVersion:"",browser:s.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:m,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(m),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(m),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},p=[[/windows nt (6\.[23]); arm/i,o.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,o.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,o.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,o.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,o.Windows,h],[/windows ce\/?([\d.]*)/i,o.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,o.iOS,g],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,o.iOS,g],[/cfnetwork\/.+darwin/i,o.iOS,g],[/mac os x ?([\w. ]*)/i,o.MacOS,g],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,o.MacOS,g],[/droid ([\w.]+)\b.+(android[- ]x86)/i,o.Android],[/android\w*[-\/.; ]?([\d.]*)/i,o.Android]],b=[[/windows.+ edge\/([\w.]+)/i,a.EdgeHTML],[/arkweb\/([\w.]+)/i,a.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,a.Blink],[/presto\/([\w.]+)/i,a.Presto],[/webkit\/([\w.]+)/i,a.WebKit],[/trident\/([\w.]+)/i,a.Trident],[/netfront\/([\w.]+)/i,a.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,a.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,a.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,a.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,s.Chrome],[/webview.+edge\/([\w.]+)/i,s.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,s.Edge],[/opera mini\/([-\w.]+)/i,s.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,s.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,s.Opera],[/opios[\/ ]+([\w.]+)/i,s.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,s.Opera],[/\bopr\/([\w.]+)/i,s.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,s.IE],[/(?:ms|\()ie ([\w.]+)/i,s.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,s.IE],[/\bfocus\/([\w.]+)/i,s.Firefox],[/\bopt\/([\w.]+)/i,s.Opera],[/coast\/([\w.]+)/i,s.Opera],[/fxios\/([\w.-]+)/i,s.Firefox],[/samsungbrowser\/([\w.]+)/i,s.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,s.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,s.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,s.Chrome],[/chrome\/([\w.]+) mobile/i,s.Chrome],[/chrome\/v?([\w.]+)/i,s.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/version\/([\w.,]+) .*safari/i,s.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,s.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,s.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,s.Firefox],[/firefox\/([\w.]+)/i,s.Firefox]];function h(e){if(void 0===e)return"";var r={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==r?r:e}function g(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,r){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":r}function y(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function T(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var x=0;x<p.length;x++){var j=(D=p[x])[0],k=D[1],E=D[2];if(null!==(M=f.userAgent.match(j))){f.os=k,f.osVersion=y(M[1],E);break}}f.os===o.iOS&&0===function(e,r){for(var n=e.split("."),t=r.split("."),o=Math.max(n.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}(f.osVersion,"18.6")&&(null!==(O=/\) Version\/([\d.]+)/.exec(f.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(f.osVersion=O[1]));for(x=0;x<b.length;x++){j=(D=b[x])[0];var S=D[1];E=D[2];if(null!==(M=f.userAgent.match(j))){f.engine=S,f.engineVersion=y(M[1],E);break}}for(x=0;x<v.length;x++){j=(D=v[x])[0];var D,M,V=D[1];E=D[2];if(null!==(M=f.userAgent.match(j))){f.browser=V,f.browserVersion=y(M[1],E);break}}if(f.isReactNative)try{k=(A=require("react-native").Platform).OS;var O=T(P=""+A.Version);switch(k){case"android":f.os=o.Android,f.osVersion=function(e,r){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":r}(O,P);break;case"ios":f.os=o.iOS,f.osVersion=P;break;case"windows":f.os=o.Windows,f.osVersion=w(O,P);break;case"macos":f.os=o.MacOS,f.osVersion=P}}catch(e){}if(f.isNodeJS)try{var P,A=(k=require("os")).platform();O=T(P=k.release());switch(A){case"win32":f.os=o.Windows,f.osVersion=w(O,P);break;case"darwin":f.os=o.MacOS,f.osVersion=function(e,r){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:r}(O,P);break;case"android":f.os=o.Android,f.osVersion=P;break;case"linux":/android/i.test(P)&&(f.os=o.Android,f.osVersion=P)}}catch(e){}function W(e){return null!==e&&"object"==typeof e}function C(e){return W(e)||function(e){return Array.isArray(e)}(e)}function L(e){if(function(e){return W(e)&&"innerHTML"in e}(e))return e.innerHTML;if(C(e))try{return JSON.stringify(e)}catch(r){return""+e}else if("string"!=typeof e)return""+e;return e}function N(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,r=location.hostname;return"https:"===e||"localhost"===r||"127.0.0.1"===r||"[::1]"===r}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function I(r){return function(r){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=e("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=r,n.style.whiteSpace="pre",n.style.userSelect="text",n.style.setProperty("-webkit-user-select","text"),n.style.setProperty("-moz-user-select","text"),n.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(n);var t=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.setData&&(e.preventDefault(),e.clipboardData.setData("text/html",r),e.clipboardData.setData("text/plain",r))}catch(e){}};d.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===t)return _(n,t,i),!1;t.removeAllRanges(),o.selectNodeContents(n),t.addRange(o);var a=globalThis.document.execCommand("copy");return _(n,t,i),a}catch(e){return _(n,t,i),!1}}(r)||function(e){var r=window.clipboardData;if(void 0!==r&&"function"==typeof r.setData)try{return r.setData("Text",e)}catch(e){return!1}return!1}(r)}function R(){return function(){var r=e("div");if(void 0===r)return null;r.contentEditable="true",globalThis.document.body.appendChild(r),r.focus();var n=null,t=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.getData&&(e.preventDefault(),n=e.clipboardData.getData("text/html")||e.clipboardData.getData("text/plain")||null)}catch(e){}};d.add(globalThis.document,{type:"paste",callback:t,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=r.innerHTML||r.textContent||null),U(r,t),n}catch(e){return U(r,t),null}}()||function(){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.getData)try{return e.getData("Text")||null}catch(e){return null}return null}()||""}function _(e,r,n){null!==r&&r.removeAllRanges(),globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"copy",callback:n})}function U(e,r){globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"paste",callback:r})}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(e){for(var r,n=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<n.length;i++){var a=null==(r=n[i])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(f.engineVersion=l)}"string"==typeof t&&(f.os===o.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?f.osVersion="11":f.osVersion=t)})),f.device=f.os===o.iOS||f.os===o.Android?i.Mobile:f.os===o.Windows||f.os===o.MacOS?i.Desktop:i.Unknown,f.isMobile=f.device===i.Mobile,f.isDesktop=f.device===i.Desktop,f.isStandalone=function(e){return"matchMedia"in globalThis&&(e===o.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(f.os);var H={copy:function(e){var r=L(e);return f.isElectron?function(e){try{var r=require("electron");return new Promise((function(n){try{r.clipboard.writeText(e),r.clipboard.writeHTML(e),n(!0)}catch(e){n(!1)}}))}catch(e){return Promise.resolve(!1)}}(r):N()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(e){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(e).then((function(){return!0})).catch((function(){return!1}))}catch(e){return Promise.resolve(!1)}return Promise.resolve(!1)}(r).then((function(e){return!!e||I(r)})).catch((function(){return I(r)})):Promise.resolve(I(r))},paste:function(){return f.isElectron?function(){try{var e=require("electron");return new Promise((function(r){try{r(e.clipboard.readHTML()||e.clipboard.readText())}catch(e){r("")}}))}catch(e){return Promise.resolve("")}}():N()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(e){if(0===e.length)return Promise.resolve(null);for(var r=e[0],n=r.types,t=0;t<n.length;t++)if("text/html"===n[t])return r.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(t=0;t<n.length;t++)if("text/plain"===n[t])return r.getType("text/plain").then((function(e){return e.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(e){return e})).catch((function(){return null}))}catch(e){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(e){return null!==e?e:R()})).catch((function(){return R()})):Promise.resolve(R())}},F={installed:!1,name:"Clipboard",module:H,Constants:{},Errors:{}};module.exports=F;