@bigbinary/neeto-molecules 4.0.46 → 4.0.48

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 (59) hide show
  1. package/dist/BrowserSupport.js +53 -22
  2. package/dist/BrowserSupport.js.map +1 -1
  3. package/dist/DownloadMobileAppCallout.js +5 -4
  4. package/dist/DownloadMobileAppCallout.js.map +1 -1
  5. package/dist/FloatingActionMenu.js +17 -11
  6. package/dist/FloatingActionMenu.js.map +1 -1
  7. package/dist/KeyboardShortcuts.js +5 -5
  8. package/dist/KeyboardShortcuts.js.map +1 -1
  9. package/dist/cjs/BrowserSupport.js +53 -22
  10. package/dist/cjs/BrowserSupport.js.map +1 -1
  11. package/dist/cjs/DownloadMobileAppCallout.js +5 -4
  12. package/dist/cjs/DownloadMobileAppCallout.js.map +1 -1
  13. package/dist/cjs/FloatingActionMenu.js +16 -10
  14. package/dist/cjs/FloatingActionMenu.js.map +1 -1
  15. package/dist/cjs/KeyboardShortcuts.js +5 -5
  16. package/dist/cjs/KeyboardShortcuts.js.map +1 -1
  17. package/dist/cjs/ua-parser-E0eEtHJZ.js +1477 -0
  18. package/dist/cjs/ua-parser-E0eEtHJZ.js.map +1 -0
  19. package/dist/ua-parser-rRwDJPFB.js +1475 -0
  20. package/dist/ua-parser-rRwDJPFB.js.map +1 -0
  21. package/package.json +2 -2
  22. package/src/translations/ar.json +6 -1
  23. package/src/translations/bg.json +6 -1
  24. package/src/translations/ca.json +6 -1
  25. package/src/translations/cs.json +6 -1
  26. package/src/translations/da.json +6 -1
  27. package/src/translations/de.json +6 -1
  28. package/src/translations/es-MX.json +6 -1
  29. package/src/translations/es.json +6 -1
  30. package/src/translations/et.json +6 -1
  31. package/src/translations/fi.json +6 -1
  32. package/src/translations/fil.json +6 -1
  33. package/src/translations/fr.json +6 -1
  34. package/src/translations/hi.json +6 -1
  35. package/src/translations/hr.json +6 -1
  36. package/src/translations/id.json +6 -1
  37. package/src/translations/it.json +6 -1
  38. package/src/translations/ja.json +6 -1
  39. package/src/translations/ko.json +6 -1
  40. package/src/translations/nl.json +6 -1
  41. package/src/translations/pl.json +6 -1
  42. package/src/translations/pt-BR.json +6 -1
  43. package/src/translations/pt.json +6 -1
  44. package/src/translations/ro.json +6 -1
  45. package/src/translations/ru.json +6 -1
  46. package/src/translations/sk.json +6 -1
  47. package/src/translations/sl.json +6 -1
  48. package/src/translations/sv.json +6 -1
  49. package/src/translations/th.json +6 -1
  50. package/src/translations/tr.json +6 -1
  51. package/src/translations/uk.json +6 -1
  52. package/src/translations/vi.json +6 -1
  53. package/src/translations/zh-CN.json +6 -1
  54. package/src/translations/zh-TW.json +6 -1
  55. package/types/BrowserSupport.d.ts +3 -3
  56. package/dist/cjs/platform-BUcCb8Jx.js +0 -1254
  57. package/dist/cjs/platform-BUcCb8Jx.js.map +0 -1
  58. package/dist/platform-F44zJ4Xh.js +0 -1252
  59. package/dist/platform-F44zJ4Xh.js.map +0 -1
@@ -1,1254 +0,0 @@
1
- 'use strict';
2
-
3
- var _commonjsHelpers = require('./_commonjsHelpers-BJu3ubxk.js');
4
-
5
- var platform$1 = {exports: {}};
6
-
7
- /*!
8
- * Platform.js v1.3.6
9
- * Copyright 2014-2020 Benjamin Tan
10
- * Copyright 2011-2013 John-David Dalton
11
- * Available under MIT license
12
- */
13
- platform$1.exports;
14
-
15
- (function (module, exports) {
16
- (function() {
17
-
18
- /** Used to determine if values are of the language type `Object`. */
19
- var objectTypes = {
20
- 'function': true,
21
- 'object': true
22
- };
23
-
24
- /** Used as a reference to the global object. */
25
- var root = (objectTypes[typeof window] && window) || this;
26
-
27
- /** Detect free variable `exports`. */
28
- var freeExports = exports;
29
-
30
- /** Detect free variable `module`. */
31
- var freeModule = module && !module.nodeType && module;
32
-
33
- /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
34
- var freeGlobal = freeExports && freeModule && typeof _commonjsHelpers.commonjsGlobal == 'object' && _commonjsHelpers.commonjsGlobal;
35
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
36
- root = freeGlobal;
37
- }
38
-
39
- /**
40
- * Used as the maximum length of an array-like object.
41
- * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
42
- * for more details.
43
- */
44
- var maxSafeInteger = Math.pow(2, 53) - 1;
45
-
46
- /** Regular expression to detect Opera. */
47
- var reOpera = /\bOpera/;
48
-
49
- /** Used for native method references. */
50
- var objectProto = Object.prototype;
51
-
52
- /** Used to check for own properties of an object. */
53
- var hasOwnProperty = objectProto.hasOwnProperty;
54
-
55
- /** Used to resolve the internal `[[Class]]` of values. */
56
- var toString = objectProto.toString;
57
-
58
- /*--------------------------------------------------------------------------*/
59
-
60
- /**
61
- * Capitalizes a string value.
62
- *
63
- * @private
64
- * @param {string} string The string to capitalize.
65
- * @returns {string} The capitalized string.
66
- */
67
- function capitalize(string) {
68
- string = String(string);
69
- return string.charAt(0).toUpperCase() + string.slice(1);
70
- }
71
-
72
- /**
73
- * A utility function to clean up the OS name.
74
- *
75
- * @private
76
- * @param {string} os The OS name to clean up.
77
- * @param {string} [pattern] A `RegExp` pattern matching the OS name.
78
- * @param {string} [label] A label for the OS.
79
- */
80
- function cleanupOS(os, pattern, label) {
81
- // Platform tokens are defined at:
82
- // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
83
- // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
84
- var data = {
85
- '10.0': '10',
86
- '6.4': '10 Technical Preview',
87
- '6.3': '8.1',
88
- '6.2': '8',
89
- '6.1': 'Server 2008 R2 / 7',
90
- '6.0': 'Server 2008 / Vista',
91
- '5.2': 'Server 2003 / XP 64-bit',
92
- '5.1': 'XP',
93
- '5.01': '2000 SP1',
94
- '5.0': '2000',
95
- '4.0': 'NT',
96
- '4.90': 'ME'
97
- };
98
- // Detect Windows version from platform tokens.
99
- if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) &&
100
- (data = data[/[\d.]+$/.exec(os)])) {
101
- os = 'Windows ' + data;
102
- }
103
- // Correct character case and cleanup string.
104
- os = String(os);
105
-
106
- if (pattern && label) {
107
- os = os.replace(RegExp(pattern, 'i'), label);
108
- }
109
-
110
- os = format(
111
- os.replace(/ ce$/i, ' CE')
112
- .replace(/\bhpw/i, 'web')
113
- .replace(/\bMacintosh\b/, 'Mac OS')
114
- .replace(/_PowerPC\b/i, ' OS')
115
- .replace(/\b(OS X) [^ \d]+/i, '$1')
116
- .replace(/\bMac (OS X)\b/, '$1')
117
- .replace(/\/(\d)/, ' $1')
118
- .replace(/_/g, '.')
119
- .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
120
- .replace(/\bx86\.64\b/gi, 'x86_64')
121
- .replace(/\b(Windows Phone) OS\b/, '$1')
122
- .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1')
123
- .split(' on ')[0]
124
- );
125
-
126
- return os;
127
- }
128
-
129
- /**
130
- * An iteration utility for arrays and objects.
131
- *
132
- * @private
133
- * @param {Array|Object} object The object to iterate over.
134
- * @param {Function} callback The function called per iteration.
135
- */
136
- function each(object, callback) {
137
- var index = -1,
138
- length = object ? object.length : 0;
139
-
140
- if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
141
- while (++index < length) {
142
- callback(object[index], index, object);
143
- }
144
- } else {
145
- forOwn(object, callback);
146
- }
147
- }
148
-
149
- /**
150
- * Trim and conditionally capitalize string values.
151
- *
152
- * @private
153
- * @param {string} string The string to format.
154
- * @returns {string} The formatted string.
155
- */
156
- function format(string) {
157
- string = trim(string);
158
- return /^(?:webOS|i(?:OS|P))/.test(string)
159
- ? string
160
- : capitalize(string);
161
- }
162
-
163
- /**
164
- * Iterates over an object's own properties, executing the `callback` for each.
165
- *
166
- * @private
167
- * @param {Object} object The object to iterate over.
168
- * @param {Function} callback The function executed per own property.
169
- */
170
- function forOwn(object, callback) {
171
- for (var key in object) {
172
- if (hasOwnProperty.call(object, key)) {
173
- callback(object[key], key, object);
174
- }
175
- }
176
- }
177
-
178
- /**
179
- * Gets the internal `[[Class]]` of a value.
180
- *
181
- * @private
182
- * @param {*} value The value.
183
- * @returns {string} The `[[Class]]`.
184
- */
185
- function getClassOf(value) {
186
- return value == null
187
- ? capitalize(value)
188
- : toString.call(value).slice(8, -1);
189
- }
190
-
191
- /**
192
- * Host objects can return type values that are different from their actual
193
- * data type. The objects we are concerned with usually return non-primitive
194
- * types of "object", "function", or "unknown".
195
- *
196
- * @private
197
- * @param {*} object The owner of the property.
198
- * @param {string} property The property to check.
199
- * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
200
- */
201
- function isHostType(object, property) {
202
- var type = object != null ? typeof object[property] : 'number';
203
- return !/^(?:boolean|number|string|undefined)$/.test(type) &&
204
- (type == 'object' ? !!object[property] : true);
205
- }
206
-
207
- /**
208
- * Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
209
- *
210
- * @private
211
- * @param {string} string The string to qualify.
212
- * @returns {string} The qualified string.
213
- */
214
- function qualify(string) {
215
- return String(string).replace(/([ -])(?!$)/g, '$1?');
216
- }
217
-
218
- /**
219
- * A bare-bones `Array#reduce` like utility function.
220
- *
221
- * @private
222
- * @param {Array} array The array to iterate over.
223
- * @param {Function} callback The function called per iteration.
224
- * @returns {*} The accumulated result.
225
- */
226
- function reduce(array, callback) {
227
- var accumulator = null;
228
- each(array, function(value, index) {
229
- accumulator = callback(accumulator, value, index, array);
230
- });
231
- return accumulator;
232
- }
233
-
234
- /**
235
- * Removes leading and trailing whitespace from a string.
236
- *
237
- * @private
238
- * @param {string} string The string to trim.
239
- * @returns {string} The trimmed string.
240
- */
241
- function trim(string) {
242
- return String(string).replace(/^ +| +$/g, '');
243
- }
244
-
245
- /*--------------------------------------------------------------------------*/
246
-
247
- /**
248
- * Creates a new platform object.
249
- *
250
- * @memberOf platform
251
- * @param {Object|string} [ua=navigator.userAgent] The user agent string or
252
- * context object.
253
- * @returns {Object} A platform object.
254
- */
255
- function parse(ua) {
256
-
257
- /** The environment context object. */
258
- var context = root;
259
-
260
- /** Used to flag when a custom context is provided. */
261
- var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String';
262
-
263
- // Juggle arguments.
264
- if (isCustomContext) {
265
- context = ua;
266
- ua = null;
267
- }
268
-
269
- /** Browser navigator object. */
270
- var nav = context.navigator || {};
271
-
272
- /** Browser user agent string. */
273
- var userAgent = nav.userAgent || '';
274
-
275
- ua || (ua = userAgent);
276
-
277
- /** Used to detect if browser is like Chrome. */
278
- var likeChrome = isCustomContext
279
- ? !!nav.likeChrome
280
- : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
281
-
282
- /** Internal `[[Class]]` value shortcuts. */
283
- var objectClass = 'Object',
284
- airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
285
- enviroClass = isCustomContext ? objectClass : 'Environment',
286
- javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java),
287
- phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
288
-
289
- /** Detect Java environments. */
290
- var java = /\bJava/.test(javaClass) && context.java;
291
-
292
- /** Detect Rhino. */
293
- var rhino = java && getClassOf(context.environment) == enviroClass;
294
-
295
- /** A character to represent alpha. */
296
- var alpha = java ? 'a' : '\u03b1';
297
-
298
- /** A character to represent beta. */
299
- var beta = java ? 'b' : '\u03b2';
300
-
301
- /** Browser document object. */
302
- var doc = context.document || {};
303
-
304
- /**
305
- * Detect Opera browser (Presto-based).
306
- * http://www.howtocreate.co.uk/operaStuff/operaObject.html
307
- * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
308
- */
309
- var opera = context.operamini || context.opera;
310
-
311
- /** Opera `[[Class]]`. */
312
- var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
313
- ? operaClass
314
- : (opera = null);
315
-
316
- /*------------------------------------------------------------------------*/
317
-
318
- /** Temporary variable used over the script's lifetime. */
319
- var data;
320
-
321
- /** The CPU architecture. */
322
- var arch = ua;
323
-
324
- /** Platform description array. */
325
- var description = [];
326
-
327
- /** Platform alpha/beta indicator. */
328
- var prerelease = null;
329
-
330
- /** A flag to indicate that environment features should be used to resolve the platform. */
331
- var useFeatures = ua == userAgent;
332
-
333
- /** The browser/environment version. */
334
- var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
335
-
336
- /** A flag to indicate if the OS ends with "/ Version" */
337
- var isSpecialCasedOS;
338
-
339
- /* Detectable layout engines (order is important). */
340
- var layout = getLayout([
341
- { 'label': 'EdgeHTML', 'pattern': 'Edge' },
342
- 'Trident',
343
- { 'label': 'WebKit', 'pattern': 'AppleWebKit' },
344
- 'iCab',
345
- 'Presto',
346
- 'NetFront',
347
- 'Tasman',
348
- 'KHTML',
349
- 'Gecko'
350
- ]);
351
-
352
- /* Detectable browser names (order is important). */
353
- var name = getName([
354
- 'Adobe AIR',
355
- 'Arora',
356
- 'Avant Browser',
357
- 'Breach',
358
- 'Camino',
359
- 'Electron',
360
- 'Epiphany',
361
- 'Fennec',
362
- 'Flock',
363
- 'Galeon',
364
- 'GreenBrowser',
365
- 'iCab',
366
- 'Iceweasel',
367
- 'K-Meleon',
368
- 'Konqueror',
369
- 'Lunascape',
370
- 'Maxthon',
371
- { 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' },
372
- 'Midori',
373
- 'Nook Browser',
374
- 'PaleMoon',
375
- 'PhantomJS',
376
- 'Raven',
377
- 'Rekonq',
378
- 'RockMelt',
379
- { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' },
380
- 'SeaMonkey',
381
- { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
382
- 'Sleipnir',
383
- 'SlimBrowser',
384
- { 'label': 'SRWare Iron', 'pattern': 'Iron' },
385
- 'Sunrise',
386
- 'Swiftfox',
387
- 'Vivaldi',
388
- 'Waterfox',
389
- 'WebPositive',
390
- { 'label': 'Yandex Browser', 'pattern': 'YaBrowser' },
391
- { 'label': 'UC Browser', 'pattern': 'UCBrowser' },
392
- 'Opera Mini',
393
- { 'label': 'Opera Mini', 'pattern': 'OPiOS' },
394
- 'Opera',
395
- { 'label': 'Opera', 'pattern': 'OPR' },
396
- 'Chromium',
397
- 'Chrome',
398
- { 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' },
399
- { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' },
400
- { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' },
401
- { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' },
402
- { 'label': 'IE', 'pattern': 'IEMobile' },
403
- { 'label': 'IE', 'pattern': 'MSIE' },
404
- 'Safari'
405
- ]);
406
-
407
- /* Detectable products (order is important). */
408
- var product = getProduct([
409
- { 'label': 'BlackBerry', 'pattern': 'BB10' },
410
- 'BlackBerry',
411
- { 'label': 'Galaxy S', 'pattern': 'GT-I9000' },
412
- { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' },
413
- { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' },
414
- { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' },
415
- { 'label': 'Galaxy S5', 'pattern': 'SM-G900' },
416
- { 'label': 'Galaxy S6', 'pattern': 'SM-G920' },
417
- { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' },
418
- { 'label': 'Galaxy S7', 'pattern': 'SM-G930' },
419
- { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' },
420
- 'Google TV',
421
- 'Lumia',
422
- 'iPad',
423
- 'iPod',
424
- 'iPhone',
425
- 'Kindle',
426
- { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
427
- 'Nexus',
428
- 'Nook',
429
- 'PlayBook',
430
- 'PlayStation Vita',
431
- 'PlayStation',
432
- 'TouchPad',
433
- 'Transformer',
434
- { 'label': 'Wii U', 'pattern': 'WiiU' },
435
- 'Wii',
436
- 'Xbox One',
437
- { 'label': 'Xbox 360', 'pattern': 'Xbox' },
438
- 'Xoom'
439
- ]);
440
-
441
- /* Detectable manufacturers. */
442
- var manufacturer = getManufacturer({
443
- 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
444
- 'Alcatel': {},
445
- 'Archos': {},
446
- 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
447
- 'Asus': { 'Transformer': 1 },
448
- 'Barnes & Noble': { 'Nook': 1 },
449
- 'BlackBerry': { 'PlayBook': 1 },
450
- 'Google': { 'Google TV': 1, 'Nexus': 1 },
451
- 'HP': { 'TouchPad': 1 },
452
- 'HTC': {},
453
- 'Huawei': {},
454
- 'Lenovo': {},
455
- 'LG': {},
456
- 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
457
- 'Motorola': { 'Xoom': 1 },
458
- 'Nintendo': { 'Wii U': 1, 'Wii': 1 },
459
- 'Nokia': { 'Lumia': 1 },
460
- 'Oppo': {},
461
- 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
462
- 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 },
463
- 'Xiaomi': { 'Mi': 1, 'Redmi': 1 }
464
- });
465
-
466
- /* Detectable operating systems (order is important). */
467
- var os = getOS([
468
- 'Windows Phone',
469
- 'KaiOS',
470
- 'Android',
471
- 'CentOS',
472
- { 'label': 'Chrome OS', 'pattern': 'CrOS' },
473
- 'Debian',
474
- { 'label': 'DragonFly BSD', 'pattern': 'DragonFly' },
475
- 'Fedora',
476
- 'FreeBSD',
477
- 'Gentoo',
478
- 'Haiku',
479
- 'Kubuntu',
480
- 'Linux Mint',
481
- 'OpenBSD',
482
- 'Red Hat',
483
- 'SuSE',
484
- 'Ubuntu',
485
- 'Xubuntu',
486
- 'Cygwin',
487
- 'Symbian OS',
488
- 'hpwOS',
489
- 'webOS ',
490
- 'webOS',
491
- 'Tablet OS',
492
- 'Tizen',
493
- 'Linux',
494
- 'Mac OS X',
495
- 'Macintosh',
496
- 'Mac',
497
- 'Windows 98;',
498
- 'Windows '
499
- ]);
500
-
501
- /*------------------------------------------------------------------------*/
502
-
503
- /**
504
- * Picks the layout engine from an array of guesses.
505
- *
506
- * @private
507
- * @param {Array} guesses An array of guesses.
508
- * @returns {null|string} The detected layout engine.
509
- */
510
- function getLayout(guesses) {
511
- return reduce(guesses, function(result, guess) {
512
- return result || RegExp('\\b' + (
513
- guess.pattern || qualify(guess)
514
- ) + '\\b', 'i').exec(ua) && (guess.label || guess);
515
- });
516
- }
517
-
518
- /**
519
- * Picks the manufacturer from an array of guesses.
520
- *
521
- * @private
522
- * @param {Array} guesses An object of guesses.
523
- * @returns {null|string} The detected manufacturer.
524
- */
525
- function getManufacturer(guesses) {
526
- return reduce(guesses, function(result, value, key) {
527
- // Lookup the manufacturer by product or scan the UA for the manufacturer.
528
- return result || (
529
- value[product] ||
530
- value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] ||
531
- RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)
532
- ) && key;
533
- });
534
- }
535
-
536
- /**
537
- * Picks the browser name from an array of guesses.
538
- *
539
- * @private
540
- * @param {Array} guesses An array of guesses.
541
- * @returns {null|string} The detected browser name.
542
- */
543
- function getName(guesses) {
544
- return reduce(guesses, function(result, guess) {
545
- return result || RegExp('\\b' + (
546
- guess.pattern || qualify(guess)
547
- ) + '\\b', 'i').exec(ua) && (guess.label || guess);
548
- });
549
- }
550
-
551
- /**
552
- * Picks the OS name from an array of guesses.
553
- *
554
- * @private
555
- * @param {Array} guesses An array of guesses.
556
- * @returns {null|string} The detected OS name.
557
- */
558
- function getOS(guesses) {
559
- return reduce(guesses, function(result, guess) {
560
- var pattern = guess.pattern || qualify(guess);
561
- if (!result && (result =
562
- RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
563
- )) {
564
- result = cleanupOS(result, pattern, guess.label || guess);
565
- }
566
- return result;
567
- });
568
- }
569
-
570
- /**
571
- * Picks the product name from an array of guesses.
572
- *
573
- * @private
574
- * @param {Array} guesses An array of guesses.
575
- * @returns {null|string} The detected product name.
576
- */
577
- function getProduct(guesses) {
578
- return reduce(guesses, function(result, guess) {
579
- var pattern = guess.pattern || qualify(guess);
580
- if (!result && (result =
581
- RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) ||
582
- RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) ||
583
- RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua)
584
- )) {
585
- // Split by forward slash and append product version if needed.
586
- if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
587
- result[0] += ' ' + result[1];
588
- }
589
- // Correct character case and cleanup string.
590
- guess = guess.label || guess;
591
- result = format(result[0]
592
- .replace(RegExp(pattern, 'i'), guess)
593
- .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ')
594
- .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
595
- }
596
- return result;
597
- });
598
- }
599
-
600
- /**
601
- * Resolves the version using an array of UA patterns.
602
- *
603
- * @private
604
- * @param {Array} patterns An array of UA patterns.
605
- * @returns {null|string} The detected version.
606
- */
607
- function getVersion(patterns) {
608
- return reduce(patterns, function(result, pattern) {
609
- return result || (RegExp(pattern +
610
- '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
611
- });
612
- }
613
-
614
- /**
615
- * Returns `platform.description` when the platform object is coerced to a string.
616
- *
617
- * @name toString
618
- * @memberOf platform
619
- * @returns {string} Returns `platform.description` if available, else an empty string.
620
- */
621
- function toStringPlatform() {
622
- return this.description || '';
623
- }
624
-
625
- /*------------------------------------------------------------------------*/
626
-
627
- // Convert layout to an array so we can add extra details.
628
- layout && (layout = [layout]);
629
-
630
- // Detect Android products.
631
- // Browsers on Android devices typically provide their product IDS after "Android;"
632
- // up to "Build" or ") AppleWebKit".
633
- // Example:
634
- // "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
635
- // (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
636
- if (/\bAndroid\b/.test(os) && !product &&
637
- (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
638
- product = trim(data[1])
639
- // Replace any language codes (eg. "en-US").
640
- .replace(/^[a-z]{2}-[a-z]{2};\s*/i, '')
641
- || null;
642
- }
643
- // Detect product names that contain their manufacturer's name.
644
- if (manufacturer && !product) {
645
- product = getProduct([manufacturer]);
646
- } else if (manufacturer && product) {
647
- product = product
648
- .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ')
649
- .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
650
- }
651
- // Clean up Google TV.
652
- if ((data = /\bGoogle TV\b/.exec(product))) {
653
- product = data[0];
654
- }
655
- // Detect simulators.
656
- if (/\bSimulator\b/i.test(ua)) {
657
- product = (product ? product + ' ' : '') + 'Simulator';
658
- }
659
- // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
660
- if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
661
- description.push('running in Turbo/Uncompressed mode');
662
- }
663
- // Detect IE Mobile 11.
664
- if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
665
- data = parse(ua.replace(/like iPhone OS/, ''));
666
- manufacturer = data.manufacturer;
667
- product = data.product;
668
- }
669
- // Detect iOS.
670
- else if (/^iP/.test(product)) {
671
- name || (name = 'Safari');
672
- os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua))
673
- ? ' ' + data[1].replace(/_/g, '.')
674
- : '');
675
- }
676
- // Detect Kubuntu.
677
- else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
678
- os = 'Kubuntu';
679
- }
680
- // Detect Android browsers.
681
- else if ((manufacturer && manufacturer != 'Google' &&
682
- ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) ||
683
- (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) {
684
- name = 'Android Browser';
685
- os = /\bAndroid\b/.test(os) ? os : 'Android';
686
- }
687
- // Detect Silk desktop/accelerated modes.
688
- else if (name == 'Silk') {
689
- if (!/\bMobi/i.test(ua)) {
690
- os = 'Android';
691
- description.unshift('desktop mode');
692
- }
693
- if (/Accelerated *= *true/i.test(ua)) {
694
- description.unshift('accelerated');
695
- }
696
- }
697
- // Detect UC Browser speed mode.
698
- else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
699
- description.push('speed mode');
700
- }
701
- // Detect PaleMoon identifying as Firefox.
702
- else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
703
- description.push('identifying as Firefox ' + data[1]);
704
- }
705
- // Detect Firefox OS and products running Firefox.
706
- else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
707
- os || (os = 'Firefox OS');
708
- product || (product = data[1]);
709
- }
710
- // Detect false positives for Firefox/Safari.
711
- else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
712
- // Escape the `/` for Firefox 1.
713
- if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
714
- // Clear name of false positives.
715
- name = null;
716
- }
717
- // Reassign a generic name.
718
- if ((data = product || manufacturer || os) &&
719
- (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
720
- name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
721
- }
722
- }
723
- // Add Chrome version to description for Electron.
724
- else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
725
- description.push('Chromium ' + data);
726
- }
727
- // Detect non-Opera (Presto-based) versions (order is important).
728
- if (!version) {
729
- version = getVersion([
730
- '(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)',
731
- 'Version',
732
- qualify(name),
733
- '(?:Firefox|Minefield|NetFront)'
734
- ]);
735
- }
736
- // Detect stubborn layout engines.
737
- if ((data =
738
- layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' ||
739
- /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') ||
740
- /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' ||
741
- !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') ||
742
- layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront'
743
- )) {
744
- layout = [data];
745
- }
746
- // Detect Windows Phone 7 desktop mode.
747
- if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
748
- name += ' Mobile';
749
- os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
750
- description.unshift('desktop mode');
751
- }
752
- // Detect Windows Phone 8.x desktop mode.
753
- else if (/\bWPDesktop\b/i.test(ua)) {
754
- name = 'IE Mobile';
755
- os = 'Windows Phone 8.x';
756
- description.unshift('desktop mode');
757
- version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
758
- }
759
- // Detect IE 11 identifying as other browsers.
760
- else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
761
- if (name) {
762
- description.push('identifying as ' + name + (version ? ' ' + version : ''));
763
- }
764
- name = 'IE';
765
- version = data[1];
766
- }
767
- // Leverage environment features.
768
- if (useFeatures) {
769
- // Detect server-side environments.
770
- // Rhino has a global function while others have a global object.
771
- if (isHostType(context, 'global')) {
772
- if (java) {
773
- data = java.lang.System;
774
- arch = data.getProperty('os.arch');
775
- os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
776
- }
777
- if (rhino) {
778
- try {
779
- version = context.require('ringo/engine').version.join('.');
780
- name = 'RingoJS';
781
- } catch(e) {
782
- if ((data = context.system) && data.global.system == context.system) {
783
- name = 'Narwhal';
784
- os || (os = data[0].os || null);
785
- }
786
- }
787
- if (!name) {
788
- name = 'Rhino';
789
- }
790
- }
791
- else if (
792
- typeof context.process == 'object' && !context.process.browser &&
793
- (data = context.process)
794
- ) {
795
- if (typeof data.versions == 'object') {
796
- if (typeof data.versions.electron == 'string') {
797
- description.push('Node ' + data.versions.node);
798
- name = 'Electron';
799
- version = data.versions.electron;
800
- } else if (typeof data.versions.nw == 'string') {
801
- description.push('Chromium ' + version, 'Node ' + data.versions.node);
802
- name = 'NW.js';
803
- version = data.versions.nw;
804
- }
805
- }
806
- if (!name) {
807
- name = 'Node.js';
808
- arch = data.arch;
809
- os = data.platform;
810
- version = /[\d.]+/.exec(data.version);
811
- version = version ? version[0] : null;
812
- }
813
- }
814
- }
815
- // Detect Adobe AIR.
816
- else if (getClassOf((data = context.runtime)) == airRuntimeClass) {
817
- name = 'Adobe AIR';
818
- os = data.flash.system.Capabilities.os;
819
- }
820
- // Detect PhantomJS.
821
- else if (getClassOf((data = context.phantom)) == phantomClass) {
822
- name = 'PhantomJS';
823
- version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
824
- }
825
- // Detect IE compatibility modes.
826
- else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
827
- // We're in compatibility mode when the Trident version + 4 doesn't
828
- // equal the document mode.
829
- version = [version, doc.documentMode];
830
- if ((data = +data[1] + 4) != version[1]) {
831
- description.push('IE ' + version[1] + ' mode');
832
- layout && (layout[1] = '');
833
- version[1] = data;
834
- }
835
- version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
836
- }
837
- // Detect IE 11 masking as other browsers.
838
- else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
839
- description.push('masking as ' + name + ' ' + version);
840
- name = 'IE';
841
- version = '11.0';
842
- layout = ['Trident'];
843
- os = 'Windows';
844
- }
845
- os = os && format(os);
846
- }
847
- // Detect prerelease phases.
848
- if (version && (data =
849
- /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
850
- /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
851
- /\bMinefield\b/i.test(ua) && 'a'
852
- )) {
853
- prerelease = /b/i.test(data) ? 'beta' : 'alpha';
854
- version = version.replace(RegExp(data + '\\+?$'), '') +
855
- (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
856
- }
857
- // Detect Firefox Mobile.
858
- if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
859
- name = 'Firefox Mobile';
860
- }
861
- // Obscure Maxthon's unreliable version.
862
- else if (name == 'Maxthon' && version) {
863
- version = version.replace(/\.[\d.]+/, '.x');
864
- }
865
- // Detect Xbox 360 and Xbox One.
866
- else if (/\bXbox\b/i.test(product)) {
867
- if (product == 'Xbox 360') {
868
- os = null;
869
- }
870
- if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
871
- description.unshift('mobile mode');
872
- }
873
- }
874
- // Add mobile postfix.
875
- else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) &&
876
- (os == 'Windows CE' || /Mobi/i.test(ua))) {
877
- name += ' Mobile';
878
- }
879
- // Detect IE platform preview.
880
- else if (name == 'IE' && useFeatures) {
881
- try {
882
- if (context.external === null) {
883
- description.unshift('platform preview');
884
- }
885
- } catch(e) {
886
- description.unshift('embedded');
887
- }
888
- }
889
- // Detect BlackBerry OS version.
890
- // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
891
- else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data =
892
- (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
893
- version
894
- )) {
895
- data = [data, /BB10/.test(ua)];
896
- os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
897
- version = null;
898
- }
899
- // Detect Opera identifying/masking itself as another browser.
900
- // http://www.opera.com/support/kb/view/843/
901
- else if (this != forOwn && product != 'Wii' && (
902
- (useFeatures && opera) ||
903
- (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) ||
904
- (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) ||
905
- (name == 'IE' && (
906
- (os && !/^Win/.test(os) && version > 5.5) ||
907
- /\bWindows XP\b/.test(os) && version > 8 ||
908
- version == 8 && !/\bTrident\b/.test(ua)
909
- ))
910
- ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
911
- // When "identifying", the UA contains both Opera and the other browser's name.
912
- data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
913
- if (reOpera.test(name)) {
914
- if (/\bIE\b/.test(data) && os == 'Mac OS') {
915
- os = null;
916
- }
917
- data = 'identify' + data;
918
- }
919
- // When "masking", the UA contains only the other browser's name.
920
- else {
921
- data = 'mask' + data;
922
- if (operaClass) {
923
- name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
924
- } else {
925
- name = 'Opera';
926
- }
927
- if (/\bIE\b/.test(data)) {
928
- os = null;
929
- }
930
- if (!useFeatures) {
931
- version = null;
932
- }
933
- }
934
- layout = ['Presto'];
935
- description.push(data);
936
- }
937
- // Detect WebKit Nightly and approximate Chrome/Safari versions.
938
- if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
939
- // Correct build number for numeric comparison.
940
- // (e.g. "532.5" becomes "532.05")
941
- data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
942
- // Nightly builds are postfixed with a "+".
943
- if (name == 'Safari' && data[1].slice(-1) == '+') {
944
- name = 'WebKit Nightly';
945
- prerelease = 'alpha';
946
- version = data[1].slice(0, -1);
947
- }
948
- // Clear incorrect browser versions.
949
- else if (version == data[1] ||
950
- version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
951
- version = null;
952
- }
953
- // Use the full Chrome version when available.
954
- data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
955
- // Detect Blink layout engine.
956
- if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
957
- layout = ['Blink'];
958
- }
959
- // Detect JavaScriptCore.
960
- // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
961
- if (!useFeatures || (!likeChrome && !data[1])) {
962
- layout && (layout[1] = 'like Safari');
963
- data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12');
964
- } else {
965
- layout && (layout[1] = 'like Chrome');
966
- data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
967
- }
968
- // Add the postfix of ".x" or "+" for approximate versions.
969
- layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
970
- // Obscure version for some Safari 1-2 releases.
971
- if (name == 'Safari' && (!version || parseInt(version) > 45)) {
972
- version = data;
973
- } else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
974
- description.unshift('headless');
975
- }
976
- }
977
- // Detect Opera desktop modes.
978
- if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
979
- name += ' ';
980
- description.unshift('desktop mode');
981
- if (data == 'zvav') {
982
- name += 'Mini';
983
- version = null;
984
- } else {
985
- name += 'Mobile';
986
- }
987
- os = os.replace(RegExp(' *' + data + '$'), '');
988
- }
989
- // Detect Chrome desktop mode.
990
- else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
991
- description.unshift('desktop mode');
992
- name = 'Chrome Mobile';
993
- version = null;
994
-
995
- if (/\bOS X\b/.test(os)) {
996
- manufacturer = 'Apple';
997
- os = 'iOS 4.3+';
998
- } else {
999
- os = null;
1000
- }
1001
- }
1002
- // Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
1003
- else if (/\bSRWare Iron\b/.test(name) && !version) {
1004
- version = getVersion('Chrome');
1005
- }
1006
- // Strip incorrect OS versions.
1007
- if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
1008
- ua.indexOf('/' + data + '-') > -1) {
1009
- os = trim(os.replace(data, ''));
1010
- }
1011
- // Ensure OS does not include the browser name.
1012
- if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
1013
- os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
1014
- }
1015
- // Add layout engine.
1016
- if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (
1017
- /Browser|Lunascape|Maxthon/.test(name) ||
1018
- name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) ||
1019
- /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
1020
- // Don't add layout details to description if they are falsey.
1021
- (data = layout[layout.length - 1]) && description.push(data);
1022
- }
1023
- // Combine contextual information.
1024
- if (description.length) {
1025
- description = ['(' + description.join('; ') + ')'];
1026
- }
1027
- // Append manufacturer to description.
1028
- if (manufacturer && product && product.indexOf(manufacturer) < 0) {
1029
- description.push('on ' + manufacturer);
1030
- }
1031
- // Append product to description.
1032
- if (product) {
1033
- description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
1034
- }
1035
- // Parse the OS into an object.
1036
- if (os) {
1037
- data = / ([\d.+]+)$/.exec(os);
1038
- isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
1039
- os = {
1040
- 'architecture': 32,
1041
- 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
1042
- 'version': data ? data[1] : null,
1043
- 'toString': function() {
1044
- var version = this.version;
1045
- return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
1046
- }
1047
- };
1048
- }
1049
- // Add browser/OS architecture.
1050
- if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
1051
- if (os) {
1052
- os.architecture = 64;
1053
- os.family = os.family.replace(RegExp(' *' + data), '');
1054
- }
1055
- if (
1056
- name && (/\bWOW64\b/i.test(ua) ||
1057
- (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua)))
1058
- ) {
1059
- description.unshift('32-bit');
1060
- }
1061
- }
1062
- // Chrome 39 and above on OS X is always 64-bit.
1063
- else if (
1064
- os && /^OS X/.test(os.family) &&
1065
- name == 'Chrome' && parseFloat(version) >= 39
1066
- ) {
1067
- os.architecture = 64;
1068
- }
1069
-
1070
- ua || (ua = null);
1071
-
1072
- /*------------------------------------------------------------------------*/
1073
-
1074
- /**
1075
- * The platform object.
1076
- *
1077
- * @name platform
1078
- * @type Object
1079
- */
1080
- var platform = {};
1081
-
1082
- /**
1083
- * The platform description.
1084
- *
1085
- * @memberOf platform
1086
- * @type string|null
1087
- */
1088
- platform.description = ua;
1089
-
1090
- /**
1091
- * The name of the browser's layout engine.
1092
- *
1093
- * The list of common layout engines include:
1094
- * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
1095
- *
1096
- * @memberOf platform
1097
- * @type string|null
1098
- */
1099
- platform.layout = layout && layout[0];
1100
-
1101
- /**
1102
- * The name of the product's manufacturer.
1103
- *
1104
- * The list of manufacturers include:
1105
- * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
1106
- * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
1107
- * "Nokia", "Samsung" and "Sony"
1108
- *
1109
- * @memberOf platform
1110
- * @type string|null
1111
- */
1112
- platform.manufacturer = manufacturer;
1113
-
1114
- /**
1115
- * The name of the browser/environment.
1116
- *
1117
- * The list of common browser names include:
1118
- * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
1119
- * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
1120
- * "Opera Mini" and "Opera"
1121
- *
1122
- * Mobile versions of some browsers have "Mobile" appended to their name:
1123
- * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
1124
- *
1125
- * @memberOf platform
1126
- * @type string|null
1127
- */
1128
- platform.name = name;
1129
-
1130
- /**
1131
- * The alpha/beta release indicator.
1132
- *
1133
- * @memberOf platform
1134
- * @type string|null
1135
- */
1136
- platform.prerelease = prerelease;
1137
-
1138
- /**
1139
- * The name of the product hosting the browser.
1140
- *
1141
- * The list of common products include:
1142
- *
1143
- * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
1144
- * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
1145
- *
1146
- * @memberOf platform
1147
- * @type string|null
1148
- */
1149
- platform.product = product;
1150
-
1151
- /**
1152
- * The browser's user agent string.
1153
- *
1154
- * @memberOf platform
1155
- * @type string|null
1156
- */
1157
- platform.ua = ua;
1158
-
1159
- /**
1160
- * The browser/environment version.
1161
- *
1162
- * @memberOf platform
1163
- * @type string|null
1164
- */
1165
- platform.version = name && version;
1166
-
1167
- /**
1168
- * The name of the operating system.
1169
- *
1170
- * @memberOf platform
1171
- * @type Object
1172
- */
1173
- platform.os = os || {
1174
-
1175
- /**
1176
- * The CPU architecture the OS is built for.
1177
- *
1178
- * @memberOf platform.os
1179
- * @type number|null
1180
- */
1181
- 'architecture': null,
1182
-
1183
- /**
1184
- * The family of the OS.
1185
- *
1186
- * Common values include:
1187
- * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
1188
- * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
1189
- * "SuSE", "Android", "iOS" and "Windows Phone"
1190
- *
1191
- * @memberOf platform.os
1192
- * @type string|null
1193
- */
1194
- 'family': null,
1195
-
1196
- /**
1197
- * The version of the OS.
1198
- *
1199
- * @memberOf platform.os
1200
- * @type string|null
1201
- */
1202
- 'version': null,
1203
-
1204
- /**
1205
- * Returns the OS string.
1206
- *
1207
- * @memberOf platform.os
1208
- * @returns {string} The OS string.
1209
- */
1210
- 'toString': function() { return 'null'; }
1211
- };
1212
-
1213
- platform.parse = parse;
1214
- platform.toString = toStringPlatform;
1215
-
1216
- if (platform.version) {
1217
- description.unshift(version);
1218
- }
1219
- if (platform.name) {
1220
- description.unshift(name);
1221
- }
1222
- if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
1223
- description.push(product ? '(' + os + ')' : 'on ' + os);
1224
- }
1225
- if (description.length) {
1226
- platform.description = description.join(' ');
1227
- }
1228
- return platform;
1229
- }
1230
-
1231
- /*--------------------------------------------------------------------------*/
1232
-
1233
- // Export platform.
1234
- var platform = parse();
1235
-
1236
- // Some AMD build optimizers, like r.js, check for condition patterns like the following:
1237
- if (freeExports && freeModule) {
1238
- // Export for CommonJS support.
1239
- forOwn(platform, function(value, key) {
1240
- freeExports[key] = value;
1241
- });
1242
- }
1243
- else {
1244
- // Export to the global object.
1245
- root.platform = platform;
1246
- }
1247
- }.call(_commonjsHelpers.commonjsGlobal));
1248
- } (platform$1, platform$1.exports));
1249
-
1250
- var platformExports = platform$1.exports;
1251
- var platform = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(platformExports);
1252
-
1253
- exports.platform = platform;
1254
- //# sourceMappingURL=platform-BUcCb8Jx.js.map