@bigbinary/neeto-molecules 3.2.1 → 3.2.3

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