@aws/cloudformation-languageserver 1.14.0 → 1.15.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.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/THIRD-PARTY-LICENSES.txt +457 -58
  3. package/assets/featureFlag/prod.json +2 -2
  4. package/assets/release-manifest.json +158 -572
  5. package/cfn-lsp-server-standalone.js +53 -782
  6. package/cfn-lsp-server-standalone.js.map +1 -1
  7. package/node_modules_aws-sdk_credential-provider-http_dist-es_index_js.js +4 -4
  8. package/node_modules_aws-sdk_credential-provider-ini_dist-es_index_js.js +1 -1
  9. package/node_modules_aws-sdk_credential-provider-login_dist-es_index_js.js +2 -2
  10. package/node_modules_aws-sdk_credential-provider-process_dist-es_index_js.js +1 -1
  11. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js +38 -20
  12. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js.map +1 -1
  13. package/node_modules_aws-sdk_credential-provider-web-identity_dist-es_index_js.js +1 -1
  14. package/node_modules_smithy_credential-provider-imds_dist-es_index_js.js +1 -1
  15. package/package.json +3 -3
  16. package/pyodide-worker.js +26 -17
  17. package/pyodide-worker.js.map +1 -1
  18. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js +17868 -8730
  19. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js.map +1 -1
  20. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js +13 -7
  21. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js.map +1 -1
  22. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js +20 -7
  23. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js.map +1 -1
  24. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js +20 -7
  25. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js.map +1 -1
  26. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js +16 -7
  27. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js.map +1 -1
  28. package/vendors-node_modules_bowser_bowser_mjs.js +2244 -0
  29. package/vendors-node_modules_bowser_bowser_mjs.js.map +1 -0
  30. package/guard_bg.wasm +0 -0
  31. package/vendor/cfn-guard/guard.js +0 -414
  32. package/vendor/cfn-guard/guard_bg.wasm +0 -0
  33. package/vendor/cfn-guard/index.js +0 -87
  34. package/vendor/cfn-guard/package.json +0 -39
  35. package/vendors-node_modules_bowser_src_bowser_js.js +0 -3300
  36. package/vendors-node_modules_bowser_src_bowser_js.js.map +0 -1
@@ -1,3300 +0,0 @@
1
- "use strict";
2
- exports.id = "vendors-node_modules_bowser_src_bowser_js";
3
- exports.ids = ["vendors-node_modules_bowser_src_bowser_js"];
4
- exports.modules = {
5
-
6
- /***/ "./node_modules/bowser/src/bowser.js"
7
- (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "default": () => (/* binding */ bowser)
13
- });
14
-
15
- ;// ./node_modules/bowser/src/constants.js
16
- // NOTE: this list must be up-to-date with browsers listed in
17
- // test/acceptance/useragentstrings.yml
18
- const BROWSER_ALIASES_MAP = {
19
- AmazonBot: 'amazonbot',
20
- 'Amazon Silk': 'amazon_silk',
21
- 'Android Browser': 'android',
22
- BaiduSpider: 'baiduspider',
23
- Bada: 'bada',
24
- BingCrawler: 'bingcrawler',
25
- Brave: 'brave',
26
- BlackBerry: 'blackberry',
27
- 'ChatGPT-User': 'chatgpt_user',
28
- Chrome: 'chrome',
29
- ClaudeBot: 'claudebot',
30
- Chromium: 'chromium',
31
- Diffbot: 'diffbot',
32
- DuckDuckBot: 'duckduckbot',
33
- DuckDuckGo: 'duckduckgo',
34
- Electron: 'electron',
35
- Epiphany: 'epiphany',
36
- FacebookExternalHit: 'facebookexternalhit',
37
- Firefox: 'firefox',
38
- Focus: 'focus',
39
- Generic: 'generic',
40
- 'Google Search': 'google_search',
41
- Googlebot: 'googlebot',
42
- GPTBot: 'gptbot',
43
- 'Internet Explorer': 'ie',
44
- InternetArchiveCrawler: 'internetarchivecrawler',
45
- 'K-Meleon': 'k_meleon',
46
- LibreWolf: 'librewolf',
47
- Linespider: 'linespider',
48
- Maxthon: 'maxthon',
49
- 'Meta-ExternalAds': 'meta_externalads',
50
- 'Meta-ExternalAgent': 'meta_externalagent',
51
- 'Meta-ExternalFetcher': 'meta_externalfetcher',
52
- 'Meta-WebIndexer': 'meta_webindexer',
53
- 'Microsoft Edge': 'edge',
54
- 'MZ Browser': 'mz',
55
- 'NAVER Whale Browser': 'naver',
56
- 'OAI-SearchBot': 'oai_searchbot',
57
- Omgilibot: 'omgilibot',
58
- Opera: 'opera',
59
- 'Opera Coast': 'opera_coast',
60
- 'Pale Moon': 'pale_moon',
61
- PerplexityBot: 'perplexitybot',
62
- 'Perplexity-User': 'perplexity_user',
63
- PhantomJS: 'phantomjs',
64
- PingdomBot: 'pingdombot',
65
- Puffin: 'puffin',
66
- QQ: 'qq',
67
- QQLite: 'qqlite',
68
- QupZilla: 'qupzilla',
69
- Roku: 'roku',
70
- Safari: 'safari',
71
- Sailfish: 'sailfish',
72
- 'Samsung Internet for Android': 'samsung_internet',
73
- SlackBot: 'slackbot',
74
- SeaMonkey: 'seamonkey',
75
- Sleipnir: 'sleipnir',
76
- 'Sogou Browser': 'sogou',
77
- Swing: 'swing',
78
- Tizen: 'tizen',
79
- 'UC Browser': 'uc',
80
- Vivaldi: 'vivaldi',
81
- 'WebOS Browser': 'webos',
82
- WeChat: 'wechat',
83
- YahooSlurp: 'yahooslurp',
84
- 'Yandex Browser': 'yandex',
85
- YandexBot: 'yandexbot',
86
- YouBot: 'youbot',
87
- };
88
-
89
- const BROWSER_MAP = {
90
- amazonbot: 'AmazonBot',
91
- amazon_silk: 'Amazon Silk',
92
- android: 'Android Browser',
93
- baiduspider: 'BaiduSpider',
94
- bada: 'Bada',
95
- bingcrawler: 'BingCrawler',
96
- blackberry: 'BlackBerry',
97
- brave: 'Brave',
98
- chatgpt_user: 'ChatGPT-User',
99
- chrome: 'Chrome',
100
- claudebot: 'ClaudeBot',
101
- chromium: 'Chromium',
102
- diffbot: 'Diffbot',
103
- duckduckbot: 'DuckDuckBot',
104
- duckduckgo: 'DuckDuckGo',
105
- edge: 'Microsoft Edge',
106
- electron: 'Electron',
107
- epiphany: 'Epiphany',
108
- facebookexternalhit: 'FacebookExternalHit',
109
- firefox: 'Firefox',
110
- focus: 'Focus',
111
- generic: 'Generic',
112
- google_search: 'Google Search',
113
- googlebot: 'Googlebot',
114
- gptbot: 'GPTBot',
115
- ie: 'Internet Explorer',
116
- internetarchivecrawler: 'InternetArchiveCrawler',
117
- k_meleon: 'K-Meleon',
118
- librewolf: 'LibreWolf',
119
- linespider: 'Linespider',
120
- maxthon: 'Maxthon',
121
- meta_externalads: 'Meta-ExternalAds',
122
- meta_externalagent: 'Meta-ExternalAgent',
123
- meta_externalfetcher: 'Meta-ExternalFetcher',
124
- meta_webindexer: 'Meta-WebIndexer',
125
- mz: 'MZ Browser',
126
- naver: 'NAVER Whale Browser',
127
- oai_searchbot: 'OAI-SearchBot',
128
- omgilibot: 'Omgilibot',
129
- opera: 'Opera',
130
- opera_coast: 'Opera Coast',
131
- pale_moon: 'Pale Moon',
132
- perplexitybot: 'PerplexityBot',
133
- perplexity_user: 'Perplexity-User',
134
- phantomjs: 'PhantomJS',
135
- pingdombot: 'PingdomBot',
136
- puffin: 'Puffin',
137
- qq: 'QQ Browser',
138
- qqlite: 'QQ Browser Lite',
139
- qupzilla: 'QupZilla',
140
- roku: 'Roku',
141
- safari: 'Safari',
142
- sailfish: 'Sailfish',
143
- samsung_internet: 'Samsung Internet for Android',
144
- seamonkey: 'SeaMonkey',
145
- slackbot: 'SlackBot',
146
- sleipnir: 'Sleipnir',
147
- sogou: 'Sogou Browser',
148
- swing: 'Swing',
149
- tizen: 'Tizen',
150
- uc: 'UC Browser',
151
- vivaldi: 'Vivaldi',
152
- webos: 'WebOS Browser',
153
- wechat: 'WeChat',
154
- yahooslurp: 'YahooSlurp',
155
- yandex: 'Yandex Browser',
156
- yandexbot: 'YandexBot',
157
- youbot: 'YouBot',
158
- };
159
-
160
- const PLATFORMS_MAP = {
161
- bot: 'bot',
162
- desktop: 'desktop',
163
- mobile: 'mobile',
164
- tablet: 'tablet',
165
- tv: 'tv',
166
- };
167
-
168
- const OS_MAP = {
169
- Android: 'Android',
170
- Bada: 'Bada',
171
- BlackBerry: 'BlackBerry',
172
- ChromeOS: 'Chrome OS',
173
- HarmonyOS: 'HarmonyOS',
174
- iOS: 'iOS',
175
- Linux: 'Linux',
176
- MacOS: 'macOS',
177
- PlayStation4: 'PlayStation 4',
178
- Roku: 'Roku',
179
- Tizen: 'Tizen',
180
- WebOS: 'WebOS',
181
- Windows: 'Windows',
182
- WindowsPhone: 'Windows Phone',
183
- };
184
-
185
- const ENGINE_MAP = {
186
- Blink: 'Blink',
187
- EdgeHTML: 'EdgeHTML',
188
- Gecko: 'Gecko',
189
- Presto: 'Presto',
190
- Trident: 'Trident',
191
- WebKit: 'WebKit',
192
- };
193
-
194
- ;// ./node_modules/bowser/src/utils.js
195
-
196
-
197
- class Utils {
198
- /**
199
- * Get first matched item for a string
200
- * @param {RegExp} regexp
201
- * @param {String} ua
202
- * @return {Array|{index: number, input: string}|*|boolean|string}
203
- */
204
- static getFirstMatch(regexp, ua) {
205
- const match = ua.match(regexp);
206
- return (match && match.length > 0 && match[1]) || '';
207
- }
208
-
209
- /**
210
- * Get second matched item for a string
211
- * @param regexp
212
- * @param {String} ua
213
- * @return {Array|{index: number, input: string}|*|boolean|string}
214
- */
215
- static getSecondMatch(regexp, ua) {
216
- const match = ua.match(regexp);
217
- return (match && match.length > 1 && match[2]) || '';
218
- }
219
-
220
- /**
221
- * Match a regexp and return a constant or undefined
222
- * @param {RegExp} regexp
223
- * @param {String} ua
224
- * @param {*} _const Any const that will be returned if regexp matches the string
225
- * @return {*}
226
- */
227
- static matchAndReturnConst(regexp, ua, _const) {
228
- if (regexp.test(ua)) {
229
- return _const;
230
- }
231
- return void (0);
232
- }
233
-
234
- static getWindowsVersionName(version) {
235
- switch (version) {
236
- case 'NT': return 'NT';
237
- case 'XP': return 'XP';
238
- case 'NT 5.0': return '2000';
239
- case 'NT 5.1': return 'XP';
240
- case 'NT 5.2': return '2003';
241
- case 'NT 6.0': return 'Vista';
242
- case 'NT 6.1': return '7';
243
- case 'NT 6.2': return '8';
244
- case 'NT 6.3': return '8.1';
245
- case 'NT 10.0': return '10';
246
- default: return undefined;
247
- }
248
- }
249
-
250
- /**
251
- * Get macOS version name
252
- * 10.5 - Leopard
253
- * 10.6 - Snow Leopard
254
- * 10.7 - Lion
255
- * 10.8 - Mountain Lion
256
- * 10.9 - Mavericks
257
- * 10.10 - Yosemite
258
- * 10.11 - El Capitan
259
- * 10.12 - Sierra
260
- * 10.13 - High Sierra
261
- * 10.14 - Mojave
262
- * 10.15 - Catalina
263
- * 11 - Big Sur
264
- * 12 - Monterey
265
- * 13 - Ventura
266
- * 14 - Sonoma
267
- * 15 - Sequoia
268
- *
269
- * @example
270
- * getMacOSVersionName("10.14") // 'Mojave'
271
- *
272
- * @param {string} version
273
- * @return {string} versionName
274
- */
275
- static getMacOSVersionName(version) {
276
- const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0);
277
- v.push(0);
278
- const major = v[0];
279
- const minor = v[1];
280
-
281
- if (major === 10) {
282
- switch (minor) {
283
- case 5: return 'Leopard';
284
- case 6: return 'Snow Leopard';
285
- case 7: return 'Lion';
286
- case 8: return 'Mountain Lion';
287
- case 9: return 'Mavericks';
288
- case 10: return 'Yosemite';
289
- case 11: return 'El Capitan';
290
- case 12: return 'Sierra';
291
- case 13: return 'High Sierra';
292
- case 14: return 'Mojave';
293
- case 15: return 'Catalina';
294
- default: return undefined;
295
- }
296
- }
297
-
298
- switch (major) {
299
- case 11: return 'Big Sur';
300
- case 12: return 'Monterey';
301
- case 13: return 'Ventura';
302
- case 14: return 'Sonoma';
303
- case 15: return 'Sequoia';
304
- default: return undefined;
305
- }
306
- }
307
-
308
- /**
309
- * Get Android version name
310
- * 1.5 - Cupcake
311
- * 1.6 - Donut
312
- * 2.0 - Eclair
313
- * 2.1 - Eclair
314
- * 2.2 - Froyo
315
- * 2.x - Gingerbread
316
- * 3.x - Honeycomb
317
- * 4.0 - Ice Cream Sandwich
318
- * 4.1 - Jelly Bean
319
- * 4.4 - KitKat
320
- * 5.x - Lollipop
321
- * 6.x - Marshmallow
322
- * 7.x - Nougat
323
- * 8.x - Oreo
324
- * 9.x - Pie
325
- *
326
- * @example
327
- * getAndroidVersionName("7.0") // 'Nougat'
328
- *
329
- * @param {string} version
330
- * @return {string} versionName
331
- */
332
- static getAndroidVersionName(version) {
333
- const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0);
334
- v.push(0);
335
- if (v[0] === 1 && v[1] < 5) return undefined;
336
- if (v[0] === 1 && v[1] < 6) return 'Cupcake';
337
- if (v[0] === 1 && v[1] >= 6) return 'Donut';
338
- if (v[0] === 2 && v[1] < 2) return 'Eclair';
339
- if (v[0] === 2 && v[1] === 2) return 'Froyo';
340
- if (v[0] === 2 && v[1] > 2) return 'Gingerbread';
341
- if (v[0] === 3) return 'Honeycomb';
342
- if (v[0] === 4 && v[1] < 1) return 'Ice Cream Sandwich';
343
- if (v[0] === 4 && v[1] < 4) return 'Jelly Bean';
344
- if (v[0] === 4 && v[1] >= 4) return 'KitKat';
345
- if (v[0] === 5) return 'Lollipop';
346
- if (v[0] === 6) return 'Marshmallow';
347
- if (v[0] === 7) return 'Nougat';
348
- if (v[0] === 8) return 'Oreo';
349
- if (v[0] === 9) return 'Pie';
350
- return undefined;
351
- }
352
-
353
- /**
354
- * Get version precisions count
355
- *
356
- * @example
357
- * getVersionPrecision("1.10.3") // 3
358
- *
359
- * @param {string} version
360
- * @return {number}
361
- */
362
- static getVersionPrecision(version) {
363
- return version.split('.').length;
364
- }
365
-
366
- /**
367
- * Calculate browser version weight
368
- *
369
- * @example
370
- * compareVersions('1.10.2.1', '1.8.2.1.90') // 1
371
- * compareVersions('1.010.2.1', '1.09.2.1.90'); // 1
372
- * compareVersions('1.10.2.1', '1.10.2.1'); // 0
373
- * compareVersions('1.10.2.1', '1.0800.2'); // -1
374
- * compareVersions('1.10.2.1', '1.10', true); // 0
375
- *
376
- * @param {String} versionA versions versions to compare
377
- * @param {String} versionB versions versions to compare
378
- * @param {boolean} [isLoose] enable loose comparison
379
- * @return {Number} comparison result: -1 when versionA is lower,
380
- * 1 when versionA is bigger, 0 when both equal
381
- */
382
- /* eslint consistent-return: 1 */
383
- static compareVersions(versionA, versionB, isLoose = false) {
384
- // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2
385
- const versionAPrecision = Utils.getVersionPrecision(versionA);
386
- const versionBPrecision = Utils.getVersionPrecision(versionB);
387
-
388
- let precision = Math.max(versionAPrecision, versionBPrecision);
389
- let lastPrecision = 0;
390
-
391
- const chunks = Utils.map([versionA, versionB], (version) => {
392
- const delta = precision - Utils.getVersionPrecision(version);
393
-
394
- // 2) "9" -> "9.0" (for precision = 2)
395
- const _version = version + new Array(delta + 1).join('.0');
396
-
397
- // 3) "9.0" -> ["000000000"", "000000009"]
398
- return Utils.map(_version.split('.'), chunk => new Array(20 - chunk.length).join('0') + chunk).reverse();
399
- });
400
-
401
- // adjust precision for loose comparison
402
- if (isLoose) {
403
- lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision);
404
- }
405
-
406
- // iterate in reverse order by reversed chunks array
407
- precision -= 1;
408
- while (precision >= lastPrecision) {
409
- // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
410
- if (chunks[0][precision] > chunks[1][precision]) {
411
- return 1;
412
- }
413
-
414
- if (chunks[0][precision] === chunks[1][precision]) {
415
- if (precision === lastPrecision) {
416
- // all version chunks are same
417
- return 0;
418
- }
419
-
420
- precision -= 1;
421
- } else if (chunks[0][precision] < chunks[1][precision]) {
422
- return -1;
423
- }
424
- }
425
-
426
- return undefined;
427
- }
428
-
429
- /**
430
- * Array::map polyfill
431
- *
432
- * @param {Array} arr
433
- * @param {Function} iterator
434
- * @return {Array}
435
- */
436
- static map(arr, iterator) {
437
- const result = [];
438
- let i;
439
- if (Array.prototype.map) {
440
- return Array.prototype.map.call(arr, iterator);
441
- }
442
- for (i = 0; i < arr.length; i += 1) {
443
- result.push(iterator(arr[i]));
444
- }
445
- return result;
446
- }
447
-
448
- /**
449
- * Array::find polyfill
450
- *
451
- * @param {Array} arr
452
- * @param {Function} predicate
453
- * @return {Array}
454
- */
455
- static find(arr, predicate) {
456
- let i;
457
- let l;
458
- if (Array.prototype.find) {
459
- return Array.prototype.find.call(arr, predicate);
460
- }
461
- for (i = 0, l = arr.length; i < l; i += 1) {
462
- const value = arr[i];
463
- if (predicate(value, i)) {
464
- return value;
465
- }
466
- }
467
- return undefined;
468
- }
469
-
470
- /**
471
- * Object::assign polyfill
472
- *
473
- * @param {Object} obj
474
- * @param {Object} ...objs
475
- * @return {Object}
476
- */
477
- static assign(obj, ...assigners) {
478
- const result = obj;
479
- let i;
480
- let l;
481
- if (Object.assign) {
482
- return Object.assign(obj, ...assigners);
483
- }
484
- for (i = 0, l = assigners.length; i < l; i += 1) {
485
- const assigner = assigners[i];
486
- if (typeof assigner === 'object' && assigner !== null) {
487
- const keys = Object.keys(assigner);
488
- keys.forEach((key) => {
489
- result[key] = assigner[key];
490
- });
491
- }
492
- }
493
- return obj;
494
- }
495
-
496
- /**
497
- * Get short version/alias for a browser name
498
- *
499
- * @example
500
- * getBrowserAlias('Microsoft Edge') // edge
501
- *
502
- * @param {string} browserName
503
- * @return {string}
504
- */
505
- static getBrowserAlias(browserName) {
506
- return BROWSER_ALIASES_MAP[browserName];
507
- }
508
-
509
- /**
510
- * Get browser name for a short version/alias
511
- *
512
- * @example
513
- * getBrowserTypeByAlias('edge') // Microsoft Edge
514
- *
515
- * @param {string} browserAlias
516
- * @return {string}
517
- */
518
- static getBrowserTypeByAlias(browserAlias) {
519
- return BROWSER_MAP[browserAlias] || '';
520
- }
521
- }
522
-
523
- ;// ./node_modules/bowser/src/parser-browsers.js
524
- /**
525
- * Browsers' descriptors
526
- *
527
- * The idea of descriptors is simple. You should know about them two simple things:
528
- * 1. Every descriptor has a method or property called `test` and a `describe` method.
529
- * 2. Order of descriptors is important.
530
- *
531
- * More details:
532
- * 1. Method or property `test` serves as a way to detect whether the UA string
533
- * matches some certain browser or not. The `describe` method helps to make a result
534
- * object with params that show some browser-specific things: name, version, etc.
535
- * 2. Order of descriptors is important because a Parser goes through them one by one
536
- * in course. For example, if you insert Chrome's descriptor as the first one,
537
- * more then a half of browsers will be described as Chrome, because they will pass
538
- * the Chrome descriptor's test.
539
- *
540
- * Descriptor's `test` could be a property with an array of RegExps, where every RegExp
541
- * will be applied to a UA string to test it whether it matches or not.
542
- * If a descriptor has two or more regexps in the `test` array it tests them one by one
543
- * with a logical sum operation. Parser stops if it has found any RegExp that matches the UA.
544
- *
545
- * Or `test` could be a method. In that case it gets a Parser instance and should
546
- * return true/false to get the Parser know if this browser descriptor matches the UA or not.
547
- */
548
-
549
-
550
-
551
- const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
552
-
553
- const browsersList = [
554
- /* GPTBot */
555
- {
556
- test: [/gptbot/i],
557
- describe(ua) {
558
- const browser = {
559
- name: 'GPTBot',
560
- };
561
- const version = Utils.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
562
-
563
- if (version) {
564
- browser.version = version;
565
- }
566
-
567
- return browser;
568
- },
569
- },
570
-
571
- /* ChatGPT-User */
572
- {
573
- test: [/chatgpt-user/i],
574
- describe(ua) {
575
- const browser = {
576
- name: 'ChatGPT-User',
577
- };
578
- const version = Utils.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
579
-
580
- if (version) {
581
- browser.version = version;
582
- }
583
-
584
- return browser;
585
- },
586
- },
587
-
588
- /* OAI-SearchBot */
589
- {
590
- test: [/oai-searchbot/i],
591
- describe(ua) {
592
- const browser = {
593
- name: 'OAI-SearchBot',
594
- };
595
- const version = Utils.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
596
-
597
- if (version) {
598
- browser.version = version;
599
- }
600
-
601
- return browser;
602
- },
603
- },
604
-
605
- /* ClaudeBot */
606
- {
607
- test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
608
- describe(ua) {
609
- const browser = {
610
- name: 'ClaudeBot',
611
- };
612
- const version = Utils.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
613
-
614
- if (version) {
615
- browser.version = version;
616
- }
617
-
618
- return browser;
619
- },
620
- },
621
-
622
- /* Omgilibot */
623
- {
624
- test: [/omgilibot/i, /webzio-extended/i],
625
- describe(ua) {
626
- const browser = {
627
- name: 'Omgilibot',
628
- };
629
- const version = Utils.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
630
-
631
- if (version) {
632
- browser.version = version;
633
- }
634
-
635
- return browser;
636
- },
637
- },
638
-
639
- /* Diffbot */
640
- {
641
- test: [/diffbot/i],
642
- describe(ua) {
643
- const browser = {
644
- name: 'Diffbot',
645
- };
646
- const version = Utils.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
647
-
648
- if (version) {
649
- browser.version = version;
650
- }
651
-
652
- return browser;
653
- },
654
- },
655
-
656
- /* PerplexityBot */
657
- {
658
- test: [/perplexitybot/i],
659
- describe(ua) {
660
- const browser = {
661
- name: 'PerplexityBot',
662
- };
663
- const version = Utils.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
664
-
665
- if (version) {
666
- browser.version = version;
667
- }
668
-
669
- return browser;
670
- },
671
- },
672
-
673
- /* Perplexity-User */
674
- {
675
- test: [/perplexity-user/i],
676
- describe(ua) {
677
- const browser = {
678
- name: 'Perplexity-User',
679
- };
680
- const version = Utils.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
681
-
682
- if (version) {
683
- browser.version = version;
684
- }
685
-
686
- return browser;
687
- },
688
- },
689
-
690
- /* YouBot */
691
- {
692
- test: [/youbot/i],
693
- describe(ua) {
694
- const browser = {
695
- name: 'YouBot',
696
- };
697
- const version = Utils.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
698
-
699
- if (version) {
700
- browser.version = version;
701
- }
702
-
703
- return browser;
704
- },
705
- },
706
-
707
- /* Meta-WebIndexer */
708
- {
709
- test: [/meta-webindexer/i],
710
- describe(ua) {
711
- const browser = {
712
- name: 'Meta-WebIndexer',
713
- };
714
- const version = Utils.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
715
-
716
- if (version) {
717
- browser.version = version;
718
- }
719
-
720
- return browser;
721
- },
722
- },
723
-
724
- /* Meta-ExternalAds */
725
- {
726
- test: [/meta-externalads/i],
727
- describe(ua) {
728
- const browser = {
729
- name: 'Meta-ExternalAds',
730
- };
731
- const version = Utils.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
732
-
733
- if (version) {
734
- browser.version = version;
735
- }
736
-
737
- return browser;
738
- },
739
- },
740
-
741
- /* Meta-ExternalAgent */
742
- {
743
- test: [/meta-externalagent/i],
744
- describe(ua) {
745
- const browser = {
746
- name: 'Meta-ExternalAgent',
747
- };
748
- const version = Utils.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
749
-
750
- if (version) {
751
- browser.version = version;
752
- }
753
-
754
- return browser;
755
- },
756
- },
757
-
758
- /* Meta-ExternalFetcher */
759
- {
760
- test: [/meta-externalfetcher/i],
761
- describe(ua) {
762
- const browser = {
763
- name: 'Meta-ExternalFetcher',
764
- };
765
- const version = Utils.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
766
-
767
- if (version) {
768
- browser.version = version;
769
- }
770
-
771
- return browser;
772
- },
773
- },
774
-
775
- /* Googlebot */
776
- {
777
- test: [/googlebot/i],
778
- describe(ua) {
779
- const browser = {
780
- name: 'Googlebot',
781
- };
782
- const version = Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
783
-
784
- if (version) {
785
- browser.version = version;
786
- }
787
-
788
- return browser;
789
- },
790
- },
791
-
792
- /* Linespider */
793
- {
794
- test: [/linespider/i],
795
- describe(ua) {
796
- const browser = {
797
- name: 'Linespider',
798
- };
799
- const version = Utils.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
800
-
801
- if (version) {
802
- browser.version = version;
803
- }
804
-
805
- return browser;
806
- },
807
- },
808
-
809
- /* AmazonBot */
810
- {
811
- test: [/amazonbot/i],
812
- describe(ua) {
813
- const browser = {
814
- name: 'AmazonBot',
815
- };
816
- const version = Utils.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
817
-
818
- if (version) {
819
- browser.version = version;
820
- }
821
-
822
- return browser;
823
- },
824
- },
825
-
826
- /* BingCrawler */
827
- {
828
- test: [/bingbot/i],
829
- describe(ua) {
830
- const browser = {
831
- name: 'BingCrawler',
832
- };
833
- const version = Utils.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
834
-
835
- if (version) {
836
- browser.version = version;
837
- }
838
-
839
- return browser;
840
- },
841
- },
842
-
843
- /* BaiduSpider */
844
- {
845
- test: [/baiduspider/i],
846
- describe(ua) {
847
- const browser = {
848
- name: 'BaiduSpider',
849
- };
850
- const version = Utils.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
851
-
852
- if (version) {
853
- browser.version = version;
854
- }
855
-
856
- return browser;
857
- },
858
- },
859
-
860
- /* DuckDuckBot */
861
- {
862
- test: [/duckduckbot/i],
863
- describe(ua) {
864
- const browser = {
865
- name: 'DuckDuckBot',
866
- };
867
- const version = Utils.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
868
-
869
- if (version) {
870
- browser.version = version;
871
- }
872
-
873
- return browser;
874
- },
875
- },
876
-
877
- /* InternetArchiveCrawler */
878
- {
879
- test: [/ia_archiver/i],
880
- describe(ua) {
881
- const browser = {
882
- name: 'InternetArchiveCrawler',
883
- };
884
- const version = Utils.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
885
-
886
- if (version) {
887
- browser.version = version;
888
- }
889
-
890
- return browser;
891
- },
892
- },
893
-
894
- /* FacebookExternalHit */
895
- {
896
- test: [/facebookexternalhit/i, /facebookcatalog/i],
897
- describe() {
898
- return {
899
- name: 'FacebookExternalHit',
900
- };
901
- },
902
- },
903
-
904
- /* SlackBot */
905
- {
906
- test: [/slackbot/i, /slack-imgProxy/i],
907
- describe(ua) {
908
- const browser = {
909
- name: 'SlackBot',
910
- };
911
- const version = Utils.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
912
-
913
- if (version) {
914
- browser.version = version;
915
- }
916
-
917
- return browser;
918
- },
919
- },
920
-
921
- /* YahooSlurp */
922
- {
923
- test: [/yahoo!?[\s/]*slurp/i],
924
- describe() {
925
- return {
926
- name: 'YahooSlurp',
927
- };
928
- },
929
- },
930
-
931
- /* YandexBot */
932
- {
933
- test: [/yandexbot/i, /yandexmobilebot/i],
934
- describe() {
935
- return {
936
- name: 'YandexBot',
937
- };
938
- },
939
- },
940
-
941
- /* PingdomBot */
942
- {
943
- test: [/pingdom/i],
944
- describe() {
945
- return {
946
- name: 'PingdomBot',
947
- };
948
- },
949
- },
950
-
951
- /* Opera < 13.0 */
952
- {
953
- test: [/opera/i],
954
- describe(ua) {
955
- const browser = {
956
- name: 'Opera',
957
- };
958
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, ua);
959
-
960
- if (version) {
961
- browser.version = version;
962
- }
963
-
964
- return browser;
965
- },
966
- },
967
-
968
- /* Opera > 13.0 */
969
- {
970
- test: [/opr\/|opios/i],
971
- describe(ua) {
972
- const browser = {
973
- name: 'Opera',
974
- };
975
- const version = Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
976
-
977
- if (version) {
978
- browser.version = version;
979
- }
980
-
981
- return browser;
982
- },
983
- },
984
- {
985
- test: [/SamsungBrowser/i],
986
- describe(ua) {
987
- const browser = {
988
- name: 'Samsung Internet for Android',
989
- };
990
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
991
-
992
- if (version) {
993
- browser.version = version;
994
- }
995
-
996
- return browser;
997
- },
998
- },
999
- {
1000
- test: [/Whale/i],
1001
- describe(ua) {
1002
- const browser = {
1003
- name: 'NAVER Whale Browser',
1004
- };
1005
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, ua);
1006
-
1007
- if (version) {
1008
- browser.version = version;
1009
- }
1010
-
1011
- return browser;
1012
- },
1013
- },
1014
- {
1015
- test: [/PaleMoon/i],
1016
- describe(ua) {
1017
- const browser = {
1018
- name: 'Pale Moon',
1019
- };
1020
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i, ua);
1021
-
1022
- if (version) {
1023
- browser.version = version;
1024
- }
1025
-
1026
- return browser;
1027
- },
1028
- },
1029
- {
1030
- test: [/MZBrowser/i],
1031
- describe(ua) {
1032
- const browser = {
1033
- name: 'MZ Browser',
1034
- };
1035
- const version = Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1036
-
1037
- if (version) {
1038
- browser.version = version;
1039
- }
1040
-
1041
- return browser;
1042
- },
1043
- },
1044
- {
1045
- test: [/focus/i],
1046
- describe(ua) {
1047
- const browser = {
1048
- name: 'Focus',
1049
- };
1050
- const version = Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1051
-
1052
- if (version) {
1053
- browser.version = version;
1054
- }
1055
-
1056
- return browser;
1057
- },
1058
- },
1059
- {
1060
- test: [/swing/i],
1061
- describe(ua) {
1062
- const browser = {
1063
- name: 'Swing',
1064
- };
1065
- const version = Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1066
-
1067
- if (version) {
1068
- browser.version = version;
1069
- }
1070
-
1071
- return browser;
1072
- },
1073
- },
1074
- {
1075
- test: [/coast/i],
1076
- describe(ua) {
1077
- const browser = {
1078
- name: 'Opera Coast',
1079
- };
1080
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, ua);
1081
-
1082
- if (version) {
1083
- browser.version = version;
1084
- }
1085
-
1086
- return browser;
1087
- },
1088
- },
1089
- {
1090
- test: [/opt\/\d+(?:.?_?\d+)+/i],
1091
- describe(ua) {
1092
- const browser = {
1093
- name: 'Opera Touch',
1094
- };
1095
- const version = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1096
-
1097
- if (version) {
1098
- browser.version = version;
1099
- }
1100
-
1101
- return browser;
1102
- },
1103
- },
1104
- {
1105
- test: [/yabrowser/i],
1106
- describe(ua) {
1107
- const browser = {
1108
- name: 'Yandex Browser',
1109
- };
1110
- const version = Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1111
-
1112
- if (version) {
1113
- browser.version = version;
1114
- }
1115
-
1116
- return browser;
1117
- },
1118
- },
1119
- {
1120
- test: [/ucbrowser/i],
1121
- describe(ua) {
1122
- const browser = {
1123
- name: 'UC Browser',
1124
- };
1125
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
1126
-
1127
- if (version) {
1128
- browser.version = version;
1129
- }
1130
-
1131
- return browser;
1132
- },
1133
- },
1134
- {
1135
- test: [/Maxthon|mxios/i],
1136
- describe(ua) {
1137
- const browser = {
1138
- name: 'Maxthon',
1139
- };
1140
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
1141
-
1142
- if (version) {
1143
- browser.version = version;
1144
- }
1145
-
1146
- return browser;
1147
- },
1148
- },
1149
- {
1150
- test: [/epiphany/i],
1151
- describe(ua) {
1152
- const browser = {
1153
- name: 'Epiphany',
1154
- };
1155
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, ua);
1156
-
1157
- if (version) {
1158
- browser.version = version;
1159
- }
1160
-
1161
- return browser;
1162
- },
1163
- },
1164
- {
1165
- test: [/puffin/i],
1166
- describe(ua) {
1167
- const browser = {
1168
- name: 'Puffin',
1169
- };
1170
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, ua);
1171
-
1172
- if (version) {
1173
- browser.version = version;
1174
- }
1175
-
1176
- return browser;
1177
- },
1178
- },
1179
- {
1180
- test: [/sleipnir/i],
1181
- describe(ua) {
1182
- const browser = {
1183
- name: 'Sleipnir',
1184
- };
1185
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, ua);
1186
-
1187
- if (version) {
1188
- browser.version = version;
1189
- }
1190
-
1191
- return browser;
1192
- },
1193
- },
1194
- {
1195
- test: [/k-meleon/i],
1196
- describe(ua) {
1197
- const browser = {
1198
- name: 'K-Meleon',
1199
- };
1200
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, ua);
1201
-
1202
- if (version) {
1203
- browser.version = version;
1204
- }
1205
-
1206
- return browser;
1207
- },
1208
- },
1209
- {
1210
- test: [/micromessenger/i],
1211
- describe(ua) {
1212
- const browser = {
1213
- name: 'WeChat',
1214
- };
1215
- const version = Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1216
-
1217
- if (version) {
1218
- browser.version = version;
1219
- }
1220
-
1221
- return browser;
1222
- },
1223
- },
1224
- {
1225
- test: [/qqbrowser/i],
1226
- describe(ua) {
1227
- const browser = {
1228
- name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser',
1229
- };
1230
- const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1231
-
1232
- if (version) {
1233
- browser.version = version;
1234
- }
1235
-
1236
- return browser;
1237
- },
1238
- },
1239
- {
1240
- test: [/msie|trident/i],
1241
- describe(ua) {
1242
- const browser = {
1243
- name: 'Internet Explorer',
1244
- };
1245
- const version = Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, ua);
1246
-
1247
- if (version) {
1248
- browser.version = version;
1249
- }
1250
-
1251
- return browser;
1252
- },
1253
- },
1254
- {
1255
- test: [/\sedg\//i],
1256
- describe(ua) {
1257
- const browser = {
1258
- name: 'Microsoft Edge',
1259
- };
1260
-
1261
- const version = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua);
1262
-
1263
- if (version) {
1264
- browser.version = version;
1265
- }
1266
-
1267
- return browser;
1268
- },
1269
- },
1270
- {
1271
- test: [/edg([ea]|ios)/i],
1272
- describe(ua) {
1273
- const browser = {
1274
- name: 'Microsoft Edge',
1275
- };
1276
-
1277
- const version = Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, ua);
1278
-
1279
- if (version) {
1280
- browser.version = version;
1281
- }
1282
-
1283
- return browser;
1284
- },
1285
- },
1286
- {
1287
- test: [/vivaldi/i],
1288
- describe(ua) {
1289
- const browser = {
1290
- name: 'Vivaldi',
1291
- };
1292
- const version = Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, ua);
1293
-
1294
- if (version) {
1295
- browser.version = version;
1296
- }
1297
-
1298
- return browser;
1299
- },
1300
- },
1301
- {
1302
- test: [/seamonkey/i],
1303
- describe(ua) {
1304
- const browser = {
1305
- name: 'SeaMonkey',
1306
- };
1307
- const version = Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, ua);
1308
-
1309
- if (version) {
1310
- browser.version = version;
1311
- }
1312
-
1313
- return browser;
1314
- },
1315
- },
1316
- {
1317
- test: [/sailfish/i],
1318
- describe(ua) {
1319
- const browser = {
1320
- name: 'Sailfish',
1321
- };
1322
-
1323
- const version = Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua);
1324
-
1325
- if (version) {
1326
- browser.version = version;
1327
- }
1328
-
1329
- return browser;
1330
- },
1331
- },
1332
- {
1333
- test: [/silk/i],
1334
- describe(ua) {
1335
- const browser = {
1336
- name: 'Amazon Silk',
1337
- };
1338
- const version = Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, ua);
1339
-
1340
- if (version) {
1341
- browser.version = version;
1342
- }
1343
-
1344
- return browser;
1345
- },
1346
- },
1347
- {
1348
- test: [/phantom/i],
1349
- describe(ua) {
1350
- const browser = {
1351
- name: 'PhantomJS',
1352
- };
1353
- const version = Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, ua);
1354
-
1355
- if (version) {
1356
- browser.version = version;
1357
- }
1358
-
1359
- return browser;
1360
- },
1361
- },
1362
- {
1363
- test: [/slimerjs/i],
1364
- describe(ua) {
1365
- const browser = {
1366
- name: 'SlimerJS',
1367
- };
1368
- const version = Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, ua);
1369
-
1370
- if (version) {
1371
- browser.version = version;
1372
- }
1373
-
1374
- return browser;
1375
- },
1376
- },
1377
- {
1378
- test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
1379
- describe(ua) {
1380
- const browser = {
1381
- name: 'BlackBerry',
1382
- };
1383
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, ua);
1384
-
1385
- if (version) {
1386
- browser.version = version;
1387
- }
1388
-
1389
- return browser;
1390
- },
1391
- },
1392
- {
1393
- test: [/(web|hpw)[o0]s/i],
1394
- describe(ua) {
1395
- const browser = {
1396
- name: 'WebOS Browser',
1397
- };
1398
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, ua);
1399
-
1400
- if (version) {
1401
- browser.version = version;
1402
- }
1403
-
1404
- return browser;
1405
- },
1406
- },
1407
- {
1408
- test: [/bada/i],
1409
- describe(ua) {
1410
- const browser = {
1411
- name: 'Bada',
1412
- };
1413
- const version = Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, ua);
1414
-
1415
- if (version) {
1416
- browser.version = version;
1417
- }
1418
-
1419
- return browser;
1420
- },
1421
- },
1422
- {
1423
- test: [/tizen/i],
1424
- describe(ua) {
1425
- const browser = {
1426
- name: 'Tizen',
1427
- };
1428
- const version = Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1429
-
1430
- if (version) {
1431
- browser.version = version;
1432
- }
1433
-
1434
- return browser;
1435
- },
1436
- },
1437
- {
1438
- test: [/qupzilla/i],
1439
- describe(ua) {
1440
- const browser = {
1441
- name: 'QupZilla',
1442
- };
1443
- const version = Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1444
-
1445
- if (version) {
1446
- browser.version = version;
1447
- }
1448
-
1449
- return browser;
1450
- },
1451
- },
1452
- {
1453
- test: [/librewolf/i],
1454
- describe(ua) {
1455
- const browser = {
1456
- name: 'LibreWolf',
1457
- };
1458
- const version = Utils.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i, ua);
1459
-
1460
- if (version) {
1461
- browser.version = version;
1462
- }
1463
-
1464
- return browser;
1465
- },
1466
- },
1467
- {
1468
- test: [/firefox|iceweasel|fxios/i],
1469
- describe(ua) {
1470
- const browser = {
1471
- name: 'Firefox',
1472
- };
1473
- const version = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
1474
-
1475
- if (version) {
1476
- browser.version = version;
1477
- }
1478
-
1479
- return browser;
1480
- },
1481
- },
1482
- {
1483
- test: [/electron/i],
1484
- describe(ua) {
1485
- const browser = {
1486
- name: 'Electron',
1487
- };
1488
- const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
1489
-
1490
- if (version) {
1491
- browser.version = version;
1492
- }
1493
-
1494
- return browser;
1495
- },
1496
- },
1497
- {
1498
- test: [/sogoumobilebrowser/i, /metasr/i, /se 2\.[x]/i],
1499
- describe(ua) {
1500
- const browser = {
1501
- name: 'Sogou Browser',
1502
- };
1503
- const sogouMobileVersion = Utils.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
1504
- const chromiumVersion = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
1505
- const seVersion = Utils.getFirstMatch(/se ([\d.]+)x/i, ua);
1506
- const version = sogouMobileVersion || chromiumVersion || seVersion;
1507
-
1508
- if (version) {
1509
- browser.version = version;
1510
- }
1511
-
1512
- return browser;
1513
- },
1514
- },
1515
- {
1516
- test: [/MiuiBrowser/i],
1517
- describe(ua) {
1518
- const browser = {
1519
- name: 'Miui',
1520
- };
1521
- const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
1522
-
1523
- if (version) {
1524
- browser.version = version;
1525
- }
1526
-
1527
- return browser;
1528
- },
1529
- },
1530
- /* DuckDuckGo Browser */
1531
- {
1532
- test(parser) {
1533
- // Chromium platforms (Android, Windows): check Client Hints brands first
1534
- if (parser.hasBrand('DuckDuckGo')) {
1535
- return true;
1536
- }
1537
- // WebKit platforms (iOS, macOS): check UA string for Ddg/version suffix
1538
- return parser.test(/\sDdg\/[\d.]+$/i);
1539
- },
1540
- describe(ua, parser) {
1541
- const browser = {
1542
- name: 'DuckDuckGo',
1543
- };
1544
-
1545
- // Try Client Hints brand version first
1546
- if (parser) {
1547
- const hintsVersion = parser.getBrandVersion('DuckDuckGo');
1548
- if (hintsVersion) {
1549
- browser.version = hintsVersion;
1550
- return browser;
1551
- }
1552
- }
1553
-
1554
- // Fall back to WebKit UA pattern
1555
- const uaVersion = Utils.getFirstMatch(/\sDdg\/([\d.]+)$/i, ua);
1556
- if (uaVersion) {
1557
- browser.version = uaVersion;
1558
- }
1559
-
1560
- return browser;
1561
- },
1562
- },
1563
- /* Brave Browser */
1564
- {
1565
- test(parser) {
1566
- // Check Client Hints brands for Brave
1567
- return parser.hasBrand('Brave');
1568
- },
1569
- describe(ua, parser) {
1570
- const browser = {
1571
- name: 'Brave',
1572
- };
1573
-
1574
- if (parser) {
1575
- const hintsVersion = parser.getBrandVersion('Brave');
1576
- if (hintsVersion) {
1577
- browser.version = hintsVersion;
1578
- return browser;
1579
- }
1580
- }
1581
-
1582
- return browser;
1583
- },
1584
- },
1585
- {
1586
- test: [/chromium/i],
1587
- describe(ua) {
1588
- const browser = {
1589
- name: 'Chromium',
1590
- };
1591
- const version = Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
1592
-
1593
- if (version) {
1594
- browser.version = version;
1595
- }
1596
-
1597
- return browser;
1598
- },
1599
- },
1600
- {
1601
- test: [/chrome|crios|crmo/i],
1602
- describe(ua) {
1603
- const browser = {
1604
- name: 'Chrome',
1605
- };
1606
- const version = Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua);
1607
-
1608
- if (version) {
1609
- browser.version = version;
1610
- }
1611
-
1612
- return browser;
1613
- },
1614
- },
1615
- {
1616
- test: [/GSA/i],
1617
- describe(ua) {
1618
- const browser = {
1619
- name: 'Google Search',
1620
- };
1621
- const version = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua);
1622
-
1623
- if (version) {
1624
- browser.version = version;
1625
- }
1626
-
1627
- return browser;
1628
- },
1629
- },
1630
-
1631
- /* Android Browser */
1632
- {
1633
- test(parser) {
1634
- const notLikeAndroid = !parser.test(/like android/i);
1635
- const butAndroid = parser.test(/android/i);
1636
- return notLikeAndroid && butAndroid;
1637
- },
1638
- describe(ua) {
1639
- const browser = {
1640
- name: 'Android Browser',
1641
- };
1642
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
1643
-
1644
- if (version) {
1645
- browser.version = version;
1646
- }
1647
-
1648
- return browser;
1649
- },
1650
- },
1651
-
1652
- /* PlayStation 4 */
1653
- {
1654
- test: [/playstation 4/i],
1655
- describe(ua) {
1656
- const browser = {
1657
- name: 'PlayStation 4',
1658
- };
1659
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
1660
-
1661
- if (version) {
1662
- browser.version = version;
1663
- }
1664
-
1665
- return browser;
1666
- },
1667
- },
1668
-
1669
- /* Safari */
1670
- {
1671
- test: [/safari|applewebkit/i],
1672
- describe(ua) {
1673
- const browser = {
1674
- name: 'Safari',
1675
- };
1676
- const version = Utils.getFirstMatch(commonVersionIdentifier, ua);
1677
-
1678
- if (version) {
1679
- browser.version = version;
1680
- }
1681
-
1682
- return browser;
1683
- },
1684
- },
1685
-
1686
- /* Something else */
1687
- {
1688
- test: [/.*/i],
1689
- describe(ua) {
1690
- /* Here we try to make sure that there are explicit details about the device
1691
- * in order to decide what regexp exactly we want to apply
1692
- * (as there is a specific decision based on that conclusion)
1693
- */
1694
- const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
1695
- const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
1696
- const hasDeviceSpec = ua.search('\\(') !== -1;
1697
- const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
1698
- return {
1699
- name: Utils.getFirstMatch(regexp, ua),
1700
- version: Utils.getSecondMatch(regexp, ua),
1701
- };
1702
- },
1703
- },
1704
- ];
1705
-
1706
- /* harmony default export */ const parser_browsers = (browsersList);
1707
-
1708
- ;// ./node_modules/bowser/src/parser-os.js
1709
-
1710
-
1711
-
1712
- /* harmony default export */ const parser_os = ([
1713
- /* Roku */
1714
- {
1715
- test: [/Roku\/DVP/],
1716
- describe(ua) {
1717
- const version = Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, ua);
1718
- return {
1719
- name: OS_MAP.Roku,
1720
- version,
1721
- };
1722
- },
1723
- },
1724
-
1725
- /* Windows Phone */
1726
- {
1727
- test: [/windows phone/i],
1728
- describe(ua) {
1729
- const version = Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, ua);
1730
- return {
1731
- name: OS_MAP.WindowsPhone,
1732
- version,
1733
- };
1734
- },
1735
- },
1736
-
1737
- /* Windows */
1738
- {
1739
- test: [/windows /i],
1740
- describe(ua) {
1741
- const version = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua);
1742
- const versionName = Utils.getWindowsVersionName(version);
1743
-
1744
- return {
1745
- name: OS_MAP.Windows,
1746
- version,
1747
- versionName,
1748
- };
1749
- },
1750
- },
1751
-
1752
- /* Firefox on iPad */
1753
- {
1754
- test: [/Macintosh(.*?) FxiOS(.*?)\//],
1755
- describe(ua) {
1756
- const result = {
1757
- name: OS_MAP.iOS,
1758
- };
1759
- const version = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua);
1760
- if (version) {
1761
- result.version = version;
1762
- }
1763
- return result;
1764
- },
1765
- },
1766
-
1767
- /* macOS */
1768
- {
1769
- test: [/macintosh/i],
1770
- describe(ua) {
1771
- const version = Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, ua).replace(/[_\s]/g, '.');
1772
- const versionName = Utils.getMacOSVersionName(version);
1773
-
1774
- const os = {
1775
- name: OS_MAP.MacOS,
1776
- version,
1777
- };
1778
- if (versionName) {
1779
- os.versionName = versionName;
1780
- }
1781
- return os;
1782
- },
1783
- },
1784
-
1785
- /* iOS */
1786
- {
1787
- test: [/(ipod|iphone|ipad)/i],
1788
- describe(ua) {
1789
- const version = Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, ua).replace(/[_\s]/g, '.');
1790
-
1791
- return {
1792
- name: OS_MAP.iOS,
1793
- version,
1794
- };
1795
- },
1796
- },
1797
-
1798
- /* HarmonyOS */
1799
- {
1800
- test: [/OpenHarmony/i],
1801
- describe(ua) {
1802
- const version = Utils.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i, ua);
1803
- return {
1804
- name: OS_MAP.HarmonyOS,
1805
- version,
1806
- };
1807
- },
1808
- },
1809
-
1810
- /* Android */
1811
- {
1812
- test(parser) {
1813
- const notLikeAndroid = !parser.test(/like android/i);
1814
- const butAndroid = parser.test(/android/i);
1815
- return notLikeAndroid && butAndroid;
1816
- },
1817
- describe(ua) {
1818
- const version = Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, ua);
1819
- const versionName = Utils.getAndroidVersionName(version);
1820
- const os = {
1821
- name: OS_MAP.Android,
1822
- version,
1823
- };
1824
- if (versionName) {
1825
- os.versionName = versionName;
1826
- }
1827
- return os;
1828
- },
1829
- },
1830
-
1831
- /* WebOS */
1832
- {
1833
- test: [/(web|hpw)[o0]s/i],
1834
- describe(ua) {
1835
- const version = Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, ua);
1836
- const os = {
1837
- name: OS_MAP.WebOS,
1838
- };
1839
-
1840
- if (version && version.length) {
1841
- os.version = version;
1842
- }
1843
- return os;
1844
- },
1845
- },
1846
-
1847
- /* BlackBerry */
1848
- {
1849
- test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
1850
- describe(ua) {
1851
- const version = Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, ua)
1852
- || Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, ua)
1853
- || Utils.getFirstMatch(/\bbb(\d+)/i, ua);
1854
-
1855
- return {
1856
- name: OS_MAP.BlackBerry,
1857
- version,
1858
- };
1859
- },
1860
- },
1861
-
1862
- /* Bada */
1863
- {
1864
- test: [/bada/i],
1865
- describe(ua) {
1866
- const version = Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, ua);
1867
-
1868
- return {
1869
- name: OS_MAP.Bada,
1870
- version,
1871
- };
1872
- },
1873
- },
1874
-
1875
- /* Tizen */
1876
- {
1877
- test: [/tizen/i],
1878
- describe(ua) {
1879
- const version = Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, ua);
1880
-
1881
- return {
1882
- name: OS_MAP.Tizen,
1883
- version,
1884
- };
1885
- },
1886
- },
1887
-
1888
- /* Linux */
1889
- {
1890
- test: [/linux/i],
1891
- describe() {
1892
- return {
1893
- name: OS_MAP.Linux,
1894
- };
1895
- },
1896
- },
1897
-
1898
- /* Chrome OS */
1899
- {
1900
- test: [/CrOS/],
1901
- describe() {
1902
- return {
1903
- name: OS_MAP.ChromeOS,
1904
- };
1905
- },
1906
- },
1907
-
1908
- /* Playstation 4 */
1909
- {
1910
- test: [/PlayStation 4/],
1911
- describe(ua) {
1912
- const version = Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, ua);
1913
- return {
1914
- name: OS_MAP.PlayStation4,
1915
- version,
1916
- };
1917
- },
1918
- },
1919
- ]);
1920
-
1921
- ;// ./node_modules/bowser/src/parser-platforms.js
1922
-
1923
-
1924
-
1925
- /*
1926
- * Tablets go first since usually they have more specific
1927
- * signs to detect.
1928
- */
1929
-
1930
- /* harmony default export */ const parser_platforms = ([
1931
- /* Googlebot */
1932
- {
1933
- test: [/googlebot/i],
1934
- describe() {
1935
- return {
1936
- type: PLATFORMS_MAP.bot,
1937
- vendor: 'Google',
1938
- };
1939
- },
1940
- },
1941
-
1942
- /* LineSpider */
1943
- {
1944
- test: [/linespider/i],
1945
- describe() {
1946
- return {
1947
- type: PLATFORMS_MAP.bot,
1948
- vendor: 'Line',
1949
- };
1950
- },
1951
- },
1952
-
1953
- /* AmazonBot */
1954
- {
1955
- test: [/amazonbot/i],
1956
- describe() {
1957
- return {
1958
- type: PLATFORMS_MAP.bot,
1959
- vendor: 'Amazon',
1960
- };
1961
- },
1962
- },
1963
-
1964
- /* GPTBot */
1965
- {
1966
- test: [/gptbot/i],
1967
- describe() {
1968
- return {
1969
- type: PLATFORMS_MAP.bot,
1970
- vendor: 'OpenAI',
1971
- };
1972
- },
1973
- },
1974
-
1975
- /* ChatGPT-User */
1976
- {
1977
- test: [/chatgpt-user/i],
1978
- describe() {
1979
- return {
1980
- type: PLATFORMS_MAP.bot,
1981
- vendor: 'OpenAI',
1982
- };
1983
- },
1984
- },
1985
-
1986
- /* OAI-SearchBot */
1987
- {
1988
- test: [/oai-searchbot/i],
1989
- describe() {
1990
- return {
1991
- type: PLATFORMS_MAP.bot,
1992
- vendor: 'OpenAI',
1993
- };
1994
- },
1995
- },
1996
-
1997
- /* Baidu */
1998
- {
1999
- test: [/baiduspider/i],
2000
- describe() {
2001
- return {
2002
- type: PLATFORMS_MAP.bot,
2003
- vendor: 'Baidu',
2004
- };
2005
- },
2006
- },
2007
-
2008
- /* Bingbot */
2009
- {
2010
- test: [/bingbot/i],
2011
- describe() {
2012
- return {
2013
- type: PLATFORMS_MAP.bot,
2014
- vendor: 'Bing',
2015
- };
2016
- },
2017
- },
2018
-
2019
- /* DuckDuckBot */
2020
- {
2021
- test: [/duckduckbot/i],
2022
- describe() {
2023
- return {
2024
- type: PLATFORMS_MAP.bot,
2025
- vendor: 'DuckDuckGo',
2026
- };
2027
- },
2028
- },
2029
-
2030
- /* ClaudeBot */
2031
- {
2032
- test: [/claudebot/i, /claude-web/i, /claude-user/i, /claude-searchbot/i],
2033
- describe() {
2034
- return {
2035
- type: PLATFORMS_MAP.bot,
2036
- vendor: 'Anthropic',
2037
- };
2038
- },
2039
- },
2040
-
2041
- /* Omgilibot */
2042
- {
2043
- test: [/omgilibot/i, /webzio-extended/i],
2044
- describe() {
2045
- return {
2046
- type: PLATFORMS_MAP.bot,
2047
- vendor: 'Webz.io',
2048
- };
2049
- },
2050
- },
2051
-
2052
- /* Diffbot */
2053
- {
2054
- test: [/diffbot/i],
2055
- describe() {
2056
- return {
2057
- type: PLATFORMS_MAP.bot,
2058
- vendor: 'Diffbot',
2059
- };
2060
- },
2061
- },
2062
-
2063
- /* PerplexityBot */
2064
- {
2065
- test: [/perplexitybot/i],
2066
- describe() {
2067
- return {
2068
- type: PLATFORMS_MAP.bot,
2069
- vendor: 'Perplexity AI',
2070
- };
2071
- },
2072
- },
2073
-
2074
- /* Perplexity-User */
2075
- {
2076
- test: [/perplexity-user/i],
2077
- describe() {
2078
- return {
2079
- type: PLATFORMS_MAP.bot,
2080
- vendor: 'Perplexity AI',
2081
- };
2082
- },
2083
- },
2084
-
2085
- /* YouBot */
2086
- {
2087
- test: [/youbot/i],
2088
- describe() {
2089
- return {
2090
- type: PLATFORMS_MAP.bot,
2091
- vendor: 'You.com',
2092
- };
2093
- },
2094
- },
2095
-
2096
- /* Internet Archive Crawler */
2097
- {
2098
- test: [/ia_archiver/i],
2099
- describe() {
2100
- return {
2101
- type: PLATFORMS_MAP.bot,
2102
- vendor: 'Internet Archive',
2103
- };
2104
- },
2105
- },
2106
-
2107
- /* Meta-WebIndexer */
2108
- {
2109
- test: [/meta-webindexer/i],
2110
- describe() {
2111
- return {
2112
- type: PLATFORMS_MAP.bot,
2113
- vendor: 'Meta',
2114
- };
2115
- },
2116
- },
2117
-
2118
- /* Meta-ExternalAds */
2119
- {
2120
- test: [/meta-externalads/i],
2121
- describe() {
2122
- return {
2123
- type: PLATFORMS_MAP.bot,
2124
- vendor: 'Meta',
2125
- };
2126
- },
2127
- },
2128
-
2129
- /* Meta-ExternalAgent */
2130
- {
2131
- test: [/meta-externalagent/i],
2132
- describe() {
2133
- return {
2134
- type: PLATFORMS_MAP.bot,
2135
- vendor: 'Meta',
2136
- };
2137
- },
2138
- },
2139
-
2140
- /* Meta-ExternalFetcher */
2141
- {
2142
- test: [/meta-externalfetcher/i],
2143
- describe() {
2144
- return {
2145
- type: PLATFORMS_MAP.bot,
2146
- vendor: 'Meta',
2147
- };
2148
- },
2149
- },
2150
-
2151
- /* Meta Web Crawler */
2152
- {
2153
- test: [/facebookexternalhit/i, /facebookcatalog/i],
2154
- describe() {
2155
- return {
2156
- type: PLATFORMS_MAP.bot,
2157
- vendor: 'Meta',
2158
- };
2159
- },
2160
- },
2161
-
2162
- /* SlackBot */
2163
- {
2164
- test: [/slackbot/i, /slack-imgProxy/i],
2165
- describe() {
2166
- return {
2167
- type: PLATFORMS_MAP.bot,
2168
- vendor: 'Slack',
2169
- };
2170
- },
2171
- },
2172
-
2173
- /* Yahoo! Slurp */
2174
- {
2175
- test: [/yahoo/i],
2176
- describe() {
2177
- return {
2178
- type: PLATFORMS_MAP.bot,
2179
- vendor: 'Yahoo',
2180
- };
2181
- },
2182
- },
2183
-
2184
- /* Yandex */
2185
- {
2186
- test: [/yandexbot/i, /yandexmobilebot/i],
2187
- describe() {
2188
- return {
2189
- type: PLATFORMS_MAP.bot,
2190
- vendor: 'Yandex',
2191
- };
2192
- },
2193
- },
2194
-
2195
- /* Pingdom */
2196
- {
2197
- test: [/pingdom/i],
2198
- describe() {
2199
- return {
2200
- type: PLATFORMS_MAP.bot,
2201
- vendor: 'Pingdom',
2202
- };
2203
- },
2204
- },
2205
-
2206
- /* Huawei */
2207
- {
2208
- test: [/huawei/i],
2209
- describe(ua) {
2210
- const model = Utils.getFirstMatch(/(can-l01)/i, ua) && 'Nova';
2211
- const platform = {
2212
- type: PLATFORMS_MAP.mobile,
2213
- vendor: 'Huawei',
2214
- };
2215
- if (model) {
2216
- platform.model = model;
2217
- }
2218
- return platform;
2219
- },
2220
- },
2221
-
2222
- /* Nexus Tablet */
2223
- {
2224
- test: [/nexus\s*(?:7|8|9|10).*/i],
2225
- describe() {
2226
- return {
2227
- type: PLATFORMS_MAP.tablet,
2228
- vendor: 'Nexus',
2229
- };
2230
- },
2231
- },
2232
-
2233
- /* iPad */
2234
- {
2235
- test: [/ipad/i],
2236
- describe() {
2237
- return {
2238
- type: PLATFORMS_MAP.tablet,
2239
- vendor: 'Apple',
2240
- model: 'iPad',
2241
- };
2242
- },
2243
- },
2244
-
2245
- /* Firefox on iPad */
2246
- {
2247
- test: [/Macintosh(.*?) FxiOS(.*?)\//],
2248
- describe() {
2249
- return {
2250
- type: PLATFORMS_MAP.tablet,
2251
- vendor: 'Apple',
2252
- model: 'iPad',
2253
- };
2254
- },
2255
- },
2256
-
2257
- /* Amazon Kindle Fire */
2258
- {
2259
- test: [/kftt build/i],
2260
- describe() {
2261
- return {
2262
- type: PLATFORMS_MAP.tablet,
2263
- vendor: 'Amazon',
2264
- model: 'Kindle Fire HD 7',
2265
- };
2266
- },
2267
- },
2268
-
2269
- /* Another Amazon Tablet with Silk */
2270
- {
2271
- test: [/silk/i],
2272
- describe() {
2273
- return {
2274
- type: PLATFORMS_MAP.tablet,
2275
- vendor: 'Amazon',
2276
- };
2277
- },
2278
- },
2279
-
2280
- /* Tablet */
2281
- {
2282
- test: [/tablet(?! pc)/i],
2283
- describe() {
2284
- return {
2285
- type: PLATFORMS_MAP.tablet,
2286
- };
2287
- },
2288
- },
2289
-
2290
- /* iPod/iPhone */
2291
- {
2292
- test(parser) {
2293
- const iDevice = parser.test(/ipod|iphone/i);
2294
- const likeIDevice = parser.test(/like (ipod|iphone)/i);
2295
- return iDevice && !likeIDevice;
2296
- },
2297
- describe(ua) {
2298
- const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua);
2299
- return {
2300
- type: PLATFORMS_MAP.mobile,
2301
- vendor: 'Apple',
2302
- model,
2303
- };
2304
- },
2305
- },
2306
-
2307
- /* Nexus Mobile */
2308
- {
2309
- test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
2310
- describe() {
2311
- return {
2312
- type: PLATFORMS_MAP.mobile,
2313
- vendor: 'Nexus',
2314
- };
2315
- },
2316
- },
2317
-
2318
- /* Nokia */
2319
- {
2320
- test: [/Nokia/i],
2321
- describe(ua) {
2322
- const model = Utils.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i, ua);
2323
- const platform = {
2324
- type: PLATFORMS_MAP.mobile,
2325
- vendor: 'Nokia',
2326
- };
2327
- if (model) {
2328
- platform.model = model;
2329
- }
2330
- return platform;
2331
- },
2332
- },
2333
-
2334
- /* Mobile */
2335
- {
2336
- test: [/[^-]mobi/i],
2337
- describe() {
2338
- return {
2339
- type: PLATFORMS_MAP.mobile,
2340
- };
2341
- },
2342
- },
2343
-
2344
- /* BlackBerry */
2345
- {
2346
- test(parser) {
2347
- return parser.getBrowserName(true) === 'blackberry';
2348
- },
2349
- describe() {
2350
- return {
2351
- type: PLATFORMS_MAP.mobile,
2352
- vendor: 'BlackBerry',
2353
- };
2354
- },
2355
- },
2356
-
2357
- /* Bada */
2358
- {
2359
- test(parser) {
2360
- return parser.getBrowserName(true) === 'bada';
2361
- },
2362
- describe() {
2363
- return {
2364
- type: PLATFORMS_MAP.mobile,
2365
- };
2366
- },
2367
- },
2368
-
2369
- /* Windows Phone */
2370
- {
2371
- test(parser) {
2372
- return parser.getBrowserName() === 'windows phone';
2373
- },
2374
- describe() {
2375
- return {
2376
- type: PLATFORMS_MAP.mobile,
2377
- vendor: 'Microsoft',
2378
- };
2379
- },
2380
- },
2381
-
2382
- /* Android Tablet */
2383
- {
2384
- test(parser) {
2385
- const osMajorVersion = Number(String(parser.getOSVersion()).split('.')[0]);
2386
- return parser.getOSName(true) === 'android' && (osMajorVersion >= 3);
2387
- },
2388
- describe() {
2389
- return {
2390
- type: PLATFORMS_MAP.tablet,
2391
- };
2392
- },
2393
- },
2394
-
2395
- /* Android Mobile */
2396
- {
2397
- test(parser) {
2398
- return parser.getOSName(true) === 'android';
2399
- },
2400
- describe() {
2401
- return {
2402
- type: PLATFORMS_MAP.mobile,
2403
- };
2404
- },
2405
- },
2406
-
2407
- /* Smart TV */
2408
- {
2409
- test: [/smart-?tv|smarttv/i],
2410
- describe() {
2411
- return {
2412
- type: PLATFORMS_MAP.tv,
2413
- };
2414
- },
2415
- },
2416
-
2417
- /* NetCast (LG Smart TV) */
2418
- {
2419
- test: [/netcast/i],
2420
- describe() {
2421
- return {
2422
- type: PLATFORMS_MAP.tv,
2423
- };
2424
- },
2425
- },
2426
-
2427
- /* desktop */
2428
- {
2429
- test(parser) {
2430
- return parser.getOSName(true) === 'macos';
2431
- },
2432
- describe() {
2433
- return {
2434
- type: PLATFORMS_MAP.desktop,
2435
- vendor: 'Apple',
2436
- };
2437
- },
2438
- },
2439
-
2440
- /* Windows */
2441
- {
2442
- test(parser) {
2443
- return parser.getOSName(true) === 'windows';
2444
- },
2445
- describe() {
2446
- return {
2447
- type: PLATFORMS_MAP.desktop,
2448
- };
2449
- },
2450
- },
2451
-
2452
- /* Linux */
2453
- {
2454
- test(parser) {
2455
- return parser.getOSName(true) === 'linux';
2456
- },
2457
- describe() {
2458
- return {
2459
- type: PLATFORMS_MAP.desktop,
2460
- };
2461
- },
2462
- },
2463
-
2464
- /* PlayStation 4 */
2465
- {
2466
- test(parser) {
2467
- return parser.getOSName(true) === 'playstation 4';
2468
- },
2469
- describe() {
2470
- return {
2471
- type: PLATFORMS_MAP.tv,
2472
- };
2473
- },
2474
- },
2475
-
2476
- /* Roku */
2477
- {
2478
- test(parser) {
2479
- return parser.getOSName(true) === 'roku';
2480
- },
2481
- describe() {
2482
- return {
2483
- type: PLATFORMS_MAP.tv,
2484
- };
2485
- },
2486
- },
2487
- ]);
2488
-
2489
- ;// ./node_modules/bowser/src/parser-engines.js
2490
-
2491
-
2492
-
2493
- /*
2494
- * More specific goes first
2495
- */
2496
- /* harmony default export */ const parser_engines = ([
2497
- /* EdgeHTML */
2498
- {
2499
- test(parser) {
2500
- return parser.getBrowserName(true) === 'microsoft edge';
2501
- },
2502
- describe(ua) {
2503
- const isBlinkBased = /\sedg\//i.test(ua);
2504
-
2505
- // return blink if it's blink-based one
2506
- if (isBlinkBased) {
2507
- return {
2508
- name: ENGINE_MAP.Blink,
2509
- };
2510
- }
2511
-
2512
- // otherwise match the version and return EdgeHTML
2513
- const version = Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, ua);
2514
-
2515
- return {
2516
- name: ENGINE_MAP.EdgeHTML,
2517
- version,
2518
- };
2519
- },
2520
- },
2521
-
2522
- /* Trident */
2523
- {
2524
- test: [/trident/i],
2525
- describe(ua) {
2526
- const engine = {
2527
- name: ENGINE_MAP.Trident,
2528
- };
2529
-
2530
- const version = Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, ua);
2531
-
2532
- if (version) {
2533
- engine.version = version;
2534
- }
2535
-
2536
- return engine;
2537
- },
2538
- },
2539
-
2540
- /* Presto */
2541
- {
2542
- test(parser) {
2543
- return parser.test(/presto/i);
2544
- },
2545
- describe(ua) {
2546
- const engine = {
2547
- name: ENGINE_MAP.Presto,
2548
- };
2549
-
2550
- const version = Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, ua);
2551
-
2552
- if (version) {
2553
- engine.version = version;
2554
- }
2555
-
2556
- return engine;
2557
- },
2558
- },
2559
-
2560
- /* Gecko */
2561
- {
2562
- test(parser) {
2563
- const isGecko = parser.test(/gecko/i);
2564
- const likeGecko = parser.test(/like gecko/i);
2565
- return isGecko && !likeGecko;
2566
- },
2567
- describe(ua) {
2568
- const engine = {
2569
- name: ENGINE_MAP.Gecko,
2570
- };
2571
-
2572
- const version = Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, ua);
2573
-
2574
- if (version) {
2575
- engine.version = version;
2576
- }
2577
-
2578
- return engine;
2579
- },
2580
- },
2581
-
2582
- /* Blink */
2583
- {
2584
- test: [/(apple)?webkit\/537\.36/i],
2585
- describe() {
2586
- return {
2587
- name: ENGINE_MAP.Blink,
2588
- };
2589
- },
2590
- },
2591
-
2592
- /* WebKit */
2593
- {
2594
- test: [/(apple)?webkit/i],
2595
- describe(ua) {
2596
- const engine = {
2597
- name: ENGINE_MAP.WebKit,
2598
- };
2599
-
2600
- const version = Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, ua);
2601
-
2602
- if (version) {
2603
- engine.version = version;
2604
- }
2605
-
2606
- return engine;
2607
- },
2608
- },
2609
- ]);
2610
-
2611
- ;// ./node_modules/bowser/src/parser.js
2612
-
2613
-
2614
-
2615
-
2616
-
2617
-
2618
- /**
2619
- * @typedef {Object} ClientHints
2620
- * @property {Array<{brand: string, version: string}>} [brands] Array of brand objects
2621
- * @property {boolean} [mobile] Whether the device is mobile
2622
- * @property {string} [platform] Platform name (e.g., "Windows", "macOS")
2623
- * @property {string} [platformVersion] Platform version
2624
- * @property {string} [architecture] CPU architecture
2625
- * @property {string} [model] Device model
2626
- * @property {boolean} [wow64] Whether running under WoW64
2627
- */
2628
-
2629
- /**
2630
- * The main class that arranges the whole parsing process.
2631
- */
2632
- class Parser {
2633
- /**
2634
- * Create instance of Parser
2635
- *
2636
- * @param {String} UA User-Agent string
2637
- * @param {Boolean|ClientHints} [skipParsingOrHints=false] Either a boolean to skip parsing,
2638
- * or a ClientHints object containing User-Agent Client Hints data
2639
- * @param {ClientHints} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
2640
- *
2641
- * @throw {Error} in case of empty UA String
2642
- *
2643
- * @constructor
2644
- */
2645
- constructor(UA, skipParsingOrHints = false, clientHints = null) {
2646
- if (UA === void (0) || UA === null || UA === '') {
2647
- throw new Error("UserAgent parameter can't be empty");
2648
- }
2649
-
2650
- this._ua = UA;
2651
-
2652
- // Handle overloaded constructor: (UA, clientHints) or (UA, skipParsing, clientHints)
2653
- let skipParsing = false;
2654
- if (typeof skipParsingOrHints === 'boolean') {
2655
- skipParsing = skipParsingOrHints;
2656
- this._hints = clientHints;
2657
- } else if (skipParsingOrHints != null && typeof skipParsingOrHints === 'object') {
2658
- this._hints = skipParsingOrHints;
2659
- } else {
2660
- this._hints = null;
2661
- }
2662
-
2663
- /**
2664
- * @typedef ParsedResult
2665
- * @property {Object} browser
2666
- * @property {String|undefined} [browser.name]
2667
- * Browser name, like `"Chrome"` or `"Internet Explorer"`
2668
- * @property {String|undefined} [browser.version] Browser version as a String `"12.01.45334.10"`
2669
- * @property {Object} os
2670
- * @property {String|undefined} [os.name] OS name, like `"Windows"` or `"macOS"`
2671
- * @property {String|undefined} [os.version] OS version, like `"NT 5.1"` or `"10.11.1"`
2672
- * @property {String|undefined} [os.versionName] OS name, like `"XP"` or `"High Sierra"`
2673
- * @property {Object} platform
2674
- * @property {String|undefined} [platform.type]
2675
- * platform type, can be either `"desktop"`, `"tablet"` or `"mobile"`
2676
- * @property {String|undefined} [platform.vendor] Vendor of the device,
2677
- * like `"Apple"` or `"Samsung"`
2678
- * @property {String|undefined} [platform.model] Device model,
2679
- * like `"iPhone"` or `"Kindle Fire HD 7"`
2680
- * @property {Object} engine
2681
- * @property {String|undefined} [engine.name]
2682
- * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML`
2683
- * @property {String|undefined} [engine.version] String version of the engine
2684
- */
2685
- this.parsedResult = {};
2686
-
2687
- if (skipParsing !== true) {
2688
- this.parse();
2689
- }
2690
- }
2691
-
2692
- /**
2693
- * Get Client Hints data
2694
- * @return {ClientHints|null}
2695
- *
2696
- * @public
2697
- * @example
2698
- * const parser = Bowser.getParser(UA, clientHints);
2699
- * const hints = parser.getHints();
2700
- * console.log(hints.platform); // 'Windows'
2701
- * console.log(hints.mobile); // false
2702
- */
2703
- getHints() {
2704
- return this._hints;
2705
- }
2706
-
2707
- /**
2708
- * Check if a brand exists in Client Hints brands array
2709
- * @param {string} brandName The brand name to check for
2710
- * @return {boolean}
2711
- *
2712
- * @public
2713
- * @example
2714
- * const parser = Bowser.getParser(UA, clientHints);
2715
- * if (parser.hasBrand('Google Chrome')) {
2716
- * console.log('Chrome detected!');
2717
- * }
2718
- */
2719
- hasBrand(brandName) {
2720
- if (!this._hints || !Array.isArray(this._hints.brands)) {
2721
- return false;
2722
- }
2723
- const brandLower = brandName.toLowerCase();
2724
- return this._hints.brands.some(
2725
- b => b.brand && b.brand.toLowerCase() === brandLower,
2726
- );
2727
- }
2728
-
2729
- /**
2730
- * Get brand version from Client Hints
2731
- * @param {string} brandName The brand name to get version for
2732
- * @return {string|undefined}
2733
- *
2734
- * @public
2735
- * @example
2736
- * const parser = Bowser.getParser(UA, clientHints);
2737
- * const version = parser.getBrandVersion('Google Chrome');
2738
- * console.log(version); // '131'
2739
- */
2740
- getBrandVersion(brandName) {
2741
- if (!this._hints || !Array.isArray(this._hints.brands)) {
2742
- return undefined;
2743
- }
2744
- const brandLower = brandName.toLowerCase();
2745
- const brand = this._hints.brands.find(
2746
- b => b.brand && b.brand.toLowerCase() === brandLower,
2747
- );
2748
- return brand ? brand.version : undefined;
2749
- }
2750
-
2751
- /**
2752
- * Get UserAgent string of current Parser instance
2753
- * @return {String} User-Agent String of the current <Parser> object
2754
- *
2755
- * @public
2756
- */
2757
- getUA() {
2758
- return this._ua;
2759
- }
2760
-
2761
- /**
2762
- * Test a UA string for a regexp
2763
- * @param {RegExp} regex
2764
- * @return {Boolean}
2765
- */
2766
- test(regex) {
2767
- return regex.test(this._ua);
2768
- }
2769
-
2770
- /**
2771
- * Get parsed browser object
2772
- * @return {Object}
2773
- */
2774
- parseBrowser() {
2775
- this.parsedResult.browser = {};
2776
-
2777
- const browserDescriptor = Utils.find(parser_browsers, (_browser) => {
2778
- if (typeof _browser.test === 'function') {
2779
- return _browser.test(this);
2780
- }
2781
-
2782
- if (Array.isArray(_browser.test)) {
2783
- return _browser.test.some(condition => this.test(condition));
2784
- }
2785
-
2786
- throw new Error("Browser's test function is not valid");
2787
- });
2788
-
2789
- if (browserDescriptor) {
2790
- this.parsedResult.browser = browserDescriptor.describe(this.getUA(), this);
2791
- }
2792
-
2793
- return this.parsedResult.browser;
2794
- }
2795
-
2796
- /**
2797
- * Get parsed browser object
2798
- * @return {Object}
2799
- *
2800
- * @public
2801
- */
2802
- getBrowser() {
2803
- if (this.parsedResult.browser) {
2804
- return this.parsedResult.browser;
2805
- }
2806
-
2807
- return this.parseBrowser();
2808
- }
2809
-
2810
- /**
2811
- * Get browser's name
2812
- * @return {String} Browser's name or an empty string
2813
- *
2814
- * @public
2815
- */
2816
- getBrowserName(toLowerCase) {
2817
- if (toLowerCase) {
2818
- return String(this.getBrowser().name).toLowerCase() || '';
2819
- }
2820
- return this.getBrowser().name || '';
2821
- }
2822
-
2823
-
2824
- /**
2825
- * Get browser's version
2826
- * @return {String} version of browser
2827
- *
2828
- * @public
2829
- */
2830
- getBrowserVersion() {
2831
- return this.getBrowser().version;
2832
- }
2833
-
2834
- /**
2835
- * Get OS
2836
- * @return {Object}
2837
- *
2838
- * @example
2839
- * this.getOS();
2840
- * {
2841
- * name: 'macOS',
2842
- * version: '10.11.12'
2843
- * }
2844
- */
2845
- getOS() {
2846
- if (this.parsedResult.os) {
2847
- return this.parsedResult.os;
2848
- }
2849
-
2850
- return this.parseOS();
2851
- }
2852
-
2853
- /**
2854
- * Parse OS and save it to this.parsedResult.os
2855
- * @return {*|{}}
2856
- */
2857
- parseOS() {
2858
- this.parsedResult.os = {};
2859
-
2860
- const os = Utils.find(parser_os, (_os) => {
2861
- if (typeof _os.test === 'function') {
2862
- return _os.test(this);
2863
- }
2864
-
2865
- if (Array.isArray(_os.test)) {
2866
- return _os.test.some(condition => this.test(condition));
2867
- }
2868
-
2869
- throw new Error("Browser's test function is not valid");
2870
- });
2871
-
2872
- if (os) {
2873
- this.parsedResult.os = os.describe(this.getUA());
2874
- }
2875
-
2876
- return this.parsedResult.os;
2877
- }
2878
-
2879
- /**
2880
- * Get OS name
2881
- * @param {Boolean} [toLowerCase] return lower-cased value
2882
- * @return {String} name of the OS — macOS, Windows, Linux, etc.
2883
- */
2884
- getOSName(toLowerCase) {
2885
- const { name } = this.getOS();
2886
-
2887
- if (toLowerCase) {
2888
- return String(name).toLowerCase() || '';
2889
- }
2890
-
2891
- return name || '';
2892
- }
2893
-
2894
- /**
2895
- * Get OS version
2896
- * @return {String} full version with dots ('10.11.12', '5.6', etc)
2897
- */
2898
- getOSVersion() {
2899
- return this.getOS().version;
2900
- }
2901
-
2902
- /**
2903
- * Get parsed platform
2904
- * @return {{}}
2905
- */
2906
- getPlatform() {
2907
- if (this.parsedResult.platform) {
2908
- return this.parsedResult.platform;
2909
- }
2910
-
2911
- return this.parsePlatform();
2912
- }
2913
-
2914
- /**
2915
- * Get platform name
2916
- * @param {Boolean} [toLowerCase=false]
2917
- * @return {*}
2918
- */
2919
- getPlatformType(toLowerCase = false) {
2920
- const { type } = this.getPlatform();
2921
-
2922
- if (toLowerCase) {
2923
- return String(type).toLowerCase() || '';
2924
- }
2925
-
2926
- return type || '';
2927
- }
2928
-
2929
- /**
2930
- * Get parsed platform
2931
- * @return {{}}
2932
- */
2933
- parsePlatform() {
2934
- this.parsedResult.platform = {};
2935
-
2936
- const platform = Utils.find(parser_platforms, (_platform) => {
2937
- if (typeof _platform.test === 'function') {
2938
- return _platform.test(this);
2939
- }
2940
-
2941
- if (Array.isArray(_platform.test)) {
2942
- return _platform.test.some(condition => this.test(condition));
2943
- }
2944
-
2945
- throw new Error("Browser's test function is not valid");
2946
- });
2947
-
2948
- if (platform) {
2949
- this.parsedResult.platform = platform.describe(this.getUA());
2950
- }
2951
-
2952
- return this.parsedResult.platform;
2953
- }
2954
-
2955
- /**
2956
- * Get parsed engine
2957
- * @return {{}}
2958
- */
2959
- getEngine() {
2960
- if (this.parsedResult.engine) {
2961
- return this.parsedResult.engine;
2962
- }
2963
-
2964
- return this.parseEngine();
2965
- }
2966
-
2967
- /**
2968
- * Get engines's name
2969
- * @return {String} Engines's name or an empty string
2970
- *
2971
- * @public
2972
- */
2973
- getEngineName(toLowerCase) {
2974
- if (toLowerCase) {
2975
- return String(this.getEngine().name).toLowerCase() || '';
2976
- }
2977
- return this.getEngine().name || '';
2978
- }
2979
-
2980
- /**
2981
- * Get parsed platform
2982
- * @return {{}}
2983
- */
2984
- parseEngine() {
2985
- this.parsedResult.engine = {};
2986
-
2987
- const engine = Utils.find(parser_engines, (_engine) => {
2988
- if (typeof _engine.test === 'function') {
2989
- return _engine.test(this);
2990
- }
2991
-
2992
- if (Array.isArray(_engine.test)) {
2993
- return _engine.test.some(condition => this.test(condition));
2994
- }
2995
-
2996
- throw new Error("Browser's test function is not valid");
2997
- });
2998
-
2999
- if (engine) {
3000
- this.parsedResult.engine = engine.describe(this.getUA());
3001
- }
3002
-
3003
- return this.parsedResult.engine;
3004
- }
3005
-
3006
- /**
3007
- * Parse full information about the browser
3008
- * @returns {Parser}
3009
- */
3010
- parse() {
3011
- this.parseBrowser();
3012
- this.parseOS();
3013
- this.parsePlatform();
3014
- this.parseEngine();
3015
-
3016
- return this;
3017
- }
3018
-
3019
- /**
3020
- * Get parsed result
3021
- * @return {ParsedResult}
3022
- */
3023
- getResult() {
3024
- return Utils.assign({}, this.parsedResult);
3025
- }
3026
-
3027
- /**
3028
- * Check if parsed browser matches certain conditions
3029
- *
3030
- * @param {Object} checkTree It's one or two layered object,
3031
- * which can include a platform or an OS on the first layer
3032
- * and should have browsers specs on the bottom-laying layer
3033
- *
3034
- * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not.
3035
- * Returns `undefined` when the browser is no described in the checkTree object.
3036
- *
3037
- * @example
3038
- * const browser = Bowser.getParser(window.navigator.userAgent);
3039
- * if (browser.satisfies({chrome: '>118.01.1322' }))
3040
- * // or with os
3041
- * if (browser.satisfies({windows: { chrome: '>118.01.1322' } }))
3042
- * // or with platforms
3043
- * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } }))
3044
- */
3045
- satisfies(checkTree) {
3046
- const platformsAndOSes = {};
3047
- let platformsAndOSCounter = 0;
3048
- const browsers = {};
3049
- let browsersCounter = 0;
3050
-
3051
- const allDefinitions = Object.keys(checkTree);
3052
-
3053
- allDefinitions.forEach((key) => {
3054
- const currentDefinition = checkTree[key];
3055
- if (typeof currentDefinition === 'string') {
3056
- browsers[key] = currentDefinition;
3057
- browsersCounter += 1;
3058
- } else if (typeof currentDefinition === 'object') {
3059
- platformsAndOSes[key] = currentDefinition;
3060
- platformsAndOSCounter += 1;
3061
- }
3062
- });
3063
-
3064
- if (platformsAndOSCounter > 0) {
3065
- const platformsAndOSNames = Object.keys(platformsAndOSes);
3066
- const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name)));
3067
-
3068
- if (OSMatchingDefinition) {
3069
- const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);
3070
-
3071
- if (osResult !== void 0) {
3072
- return osResult;
3073
- }
3074
- }
3075
-
3076
- const platformMatchingDefinition = Utils.find(
3077
- platformsAndOSNames,
3078
- name => (this.isPlatform(name)),
3079
- );
3080
- if (platformMatchingDefinition) {
3081
- const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
3082
-
3083
- if (platformResult !== void 0) {
3084
- return platformResult;
3085
- }
3086
- }
3087
- }
3088
-
3089
- if (browsersCounter > 0) {
3090
- const browserNames = Object.keys(browsers);
3091
- const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true)));
3092
-
3093
- if (matchingDefinition !== void 0) {
3094
- return this.compareVersion(browsers[matchingDefinition]);
3095
- }
3096
- }
3097
-
3098
- return undefined;
3099
- }
3100
-
3101
- /**
3102
- * Check if the browser name equals the passed string
3103
- * @param {string} browserName The string to compare with the browser name
3104
- * @param [includingAlias=false] The flag showing whether alias will be included into comparison
3105
- * @returns {boolean}
3106
- */
3107
- isBrowser(browserName, includingAlias = false) {
3108
- const defaultBrowserName = this.getBrowserName().toLowerCase();
3109
- let browserNameLower = browserName.toLowerCase();
3110
- const alias = Utils.getBrowserTypeByAlias(browserNameLower);
3111
-
3112
- if (includingAlias && alias) {
3113
- browserNameLower = alias.toLowerCase();
3114
- }
3115
- return browserNameLower === defaultBrowserName;
3116
- }
3117
-
3118
- compareVersion(version) {
3119
- let expectedResults = [0];
3120
- let comparableVersion = version;
3121
- let isLoose = false;
3122
-
3123
- const currentBrowserVersion = this.getBrowserVersion();
3124
-
3125
- if (typeof currentBrowserVersion !== 'string') {
3126
- return void 0;
3127
- }
3128
-
3129
- if (version[0] === '>' || version[0] === '<') {
3130
- comparableVersion = version.substr(1);
3131
- if (version[1] === '=') {
3132
- isLoose = true;
3133
- comparableVersion = version.substr(2);
3134
- } else {
3135
- expectedResults = [];
3136
- }
3137
- if (version[0] === '>') {
3138
- expectedResults.push(1);
3139
- } else {
3140
- expectedResults.push(-1);
3141
- }
3142
- } else if (version[0] === '=') {
3143
- comparableVersion = version.substr(1);
3144
- } else if (version[0] === '~') {
3145
- isLoose = true;
3146
- comparableVersion = version.substr(1);
3147
- }
3148
-
3149
- return expectedResults.indexOf(
3150
- Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose),
3151
- ) > -1;
3152
- }
3153
-
3154
- /**
3155
- * Check if the OS name equals the passed string
3156
- * @param {string} osName The string to compare with the OS name
3157
- * @returns {boolean}
3158
- */
3159
- isOS(osName) {
3160
- return this.getOSName(true) === String(osName).toLowerCase();
3161
- }
3162
-
3163
- /**
3164
- * Check if the platform type equals the passed string
3165
- * @param {string} platformType The string to compare with the platform type
3166
- * @returns {boolean}
3167
- */
3168
- isPlatform(platformType) {
3169
- return this.getPlatformType(true) === String(platformType).toLowerCase();
3170
- }
3171
-
3172
- /**
3173
- * Check if the engine name equals the passed string
3174
- * @param {string} engineName The string to compare with the engine name
3175
- * @returns {boolean}
3176
- */
3177
- isEngine(engineName) {
3178
- return this.getEngineName(true) === String(engineName).toLowerCase();
3179
- }
3180
-
3181
- /**
3182
- * Is anything? Check if the browser is called "anything",
3183
- * the OS called "anything" or the platform called "anything"
3184
- * @param {String} anything
3185
- * @param [includingAlias=false] The flag showing whether alias will be included into comparison
3186
- * @returns {Boolean}
3187
- */
3188
- is(anything, includingAlias = false) {
3189
- return this.isBrowser(anything, includingAlias) || this.isOS(anything)
3190
- || this.isPlatform(anything);
3191
- }
3192
-
3193
- /**
3194
- * Check if any of the given values satisfies this.is(anything)
3195
- * @param {String[]} anythings
3196
- * @returns {Boolean}
3197
- */
3198
- some(anythings = []) {
3199
- return anythings.some(anything => this.is(anything));
3200
- }
3201
- }
3202
-
3203
- /* harmony default export */ const parser = (Parser);
3204
-
3205
- ;// ./node_modules/bowser/src/bowser.js
3206
- /*!
3207
- * Bowser - a browser detector
3208
- * https://github.com/bowser-js/bowser
3209
- * MIT License | (c) Dustin Diaz 2012-2015
3210
- * MIT License | (c) Denis Demchenko 2015-2019
3211
- */
3212
-
3213
-
3214
-
3215
- /**
3216
- * Bowser class.
3217
- * Keep it simple as much as it can be.
3218
- * It's supposed to work with collections of {@link Parser} instances
3219
- * rather then solve one-instance problems.
3220
- * All the one-instance stuff is located in Parser class.
3221
- *
3222
- * @class
3223
- * @classdesc Bowser is a static object, that provides an API to the Parsers
3224
- * @hideconstructor
3225
- */
3226
- class Bowser {
3227
- /**
3228
- * Creates a {@link Parser} instance
3229
- *
3230
- * @param {String} UA UserAgent string
3231
- * @param {Boolean|Object} [skipParsingOrHints=false] Either a boolean to skip parsing,
3232
- * or a ClientHints object (navigator.userAgentData)
3233
- * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
3234
- * @returns {Parser}
3235
- * @throws {Error} when UA is not a String
3236
- *
3237
- * @example
3238
- * const parser = Bowser.getParser(window.navigator.userAgent);
3239
- * const result = parser.getResult();
3240
- *
3241
- * @example
3242
- * // With User-Agent Client Hints
3243
- * const parser = Bowser.getParser(
3244
- * window.navigator.userAgent,
3245
- * window.navigator.userAgentData
3246
- * );
3247
- */
3248
- static getParser(UA, skipParsingOrHints = false, clientHints = null) {
3249
- if (typeof UA !== 'string') {
3250
- throw new Error('UserAgent should be a string');
3251
- }
3252
- return new parser(UA, skipParsingOrHints, clientHints);
3253
- }
3254
-
3255
- /**
3256
- * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately
3257
- *
3258
- * @param {String} UA UserAgent string
3259
- * @param {Object} [clientHints] User-Agent Client Hints data (navigator.userAgentData)
3260
- * @return {ParsedResult}
3261
- *
3262
- * @example
3263
- * const result = Bowser.parse(window.navigator.userAgent);
3264
- *
3265
- * @example
3266
- * // With User-Agent Client Hints
3267
- * const result = Bowser.parse(
3268
- * window.navigator.userAgent,
3269
- * window.navigator.userAgentData
3270
- * );
3271
- */
3272
- static parse(UA, clientHints = null) {
3273
- return (new parser(UA, clientHints)).getResult();
3274
- }
3275
-
3276
- static get BROWSER_MAP() {
3277
- return BROWSER_MAP;
3278
- }
3279
-
3280
- static get ENGINE_MAP() {
3281
- return ENGINE_MAP;
3282
- }
3283
-
3284
- static get OS_MAP() {
3285
- return OS_MAP;
3286
- }
3287
-
3288
- static get PLATFORMS_MAP() {
3289
- return PLATFORMS_MAP;
3290
- }
3291
- }
3292
-
3293
- /* harmony default export */ const bowser = (Bowser);
3294
-
3295
-
3296
- /***/ }
3297
-
3298
- };
3299
- ;
3300
- //# sourceMappingURL=vendors-node_modules_bowser_src_bowser_js.js.map