1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2function _arrayLikeToArray(r, a) { 3 (null == a || a > r.length) && (a = r.length); 4 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 5 return n; 6} 7module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 8},{}],2:[function(require,module,exports){ 9function _arrayWithHoles(r) { 10 if (Array.isArray(r)) return r; 11} 12module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; 13},{}],3:[function(require,module,exports){ 14function _interopRequireDefault(e) { 15 return e && e.__esModule ? e : { 16 "default": e 17 }; 18} 19module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; 20},{}],4:[function(require,module,exports){ 21function _iterableToArrayLimit(r, l) { 22 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 23 if (null != t) { 24 var e, 25 n, 26 i, 27 u, 28 a = [], 29 f = !0, 30 o = !1; 31 try { 32 if (i = (t = t.call(r)).next, 0 === l) { 33 if (Object(t) !== t) return; 34 f = !1; 35 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 36 } catch (r) { 37 o = !0, n = r; 38 } finally { 39 try { 40 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; 41 } finally { 42 if (o) throw n; 43 } 44 } 45 return a; 46 } 47} 48module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; 49},{}],5:[function(require,module,exports){ 50function _nonIterableRest() { 51 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 52} 53module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; 54},{}],6:[function(require,module,exports){ 55var arrayWithHoles = require("./arrayWithHoles.js"); 56var iterableToArrayLimit = require("./iterableToArrayLimit.js"); 57var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); 58var nonIterableRest = require("./nonIterableRest.js"); 59function _slicedToArray(r, e) { 60 return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); 61} 62module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 63},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":4,"./nonIterableRest.js":5,"./unsupportedIterableToArray.js":7}],7:[function(require,module,exports){ 64var arrayLikeToArray = require("./arrayLikeToArray.js"); 65function _unsupportedIterableToArray(r, a) { 66 if (r) { 67 if ("string" == typeof r) return arrayLikeToArray(r, a); 68 var t = {}.toString.call(r).slice(8, -1); 69 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; 70 } 71} 72module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 73},{"./arrayLikeToArray.js":1}],8:[function(require,module,exports){ 74/** 75 * @category Locale 76 * @summary Get the Locale code for the current page 77 * @tutorial 03_Usage 78 * 79 * @description 80 * Get the Locale code for the current page 81 * @module getLocale 82 * @exports getLocale 83 * @returns {string} Locale code 84 * @example 85 * 86 * getLocale() 87 * // => 'ja_JP' 88 */ 89 90function getLocale() { 91 var locale; 92 var metaLocaleElem = document.querySelector("meta[name='locale']"); 93 if (metaLocaleElem) { 94 locale = metaLocaleElem.getAttribute("content"); 95 } 96 return locale; 97} 98module.exports = getLocale; 99},{}],9:[function(require,module,exports){ 100/** 101 * @category Region 102 * @summary Get the Region code for the current page 103 * @tutorial 03_Usage 104 * 105 * @description 106 * Get the Region code for the current page 107 * @memberOf ILMN 108 * @module getRegion 109 * @exports getRegion 110 * @returns {string} Region code 111 * @example 112 * 113 * getRegion() 114 * // => 'apac' 115 */ 116 117function getRegion() { 118 var region; 119 var metaRegionElem = document.querySelector("meta[name='region']"); 120 if (metaRegionElem) { 121 region = metaRegionElem.getAttribute("content"); 122 } 123 return region; 124} 125module.exports = getRegion; 126},{}],10:[function(require,module,exports){ 127/** 128 * @category UI Helpers 129 * @summary Wait for an object to load before executing a function. 130 * @tutorial 03_Usage 131 * 132 * @description 133 * This function works like a promise, waiting for a passed object name to be defined before executing a passed 134 * function. 135 * 136 * @module whenObjDefined 137 * @exports whenObjDefined 138 * @param {string} objName - (required) Object name to wait for. 139 * @param {function} callbackFn - (required) Function to fire when object has loaded 140 * @param {function} parentObj - (optional) If the object is not scoped to the window, you can scope it here. 141 * 142 * @example 143 * whenObjDefined('OneTrust', handleGDPCContent); 144 */ 145 146 147 function whenObjDefined(objName,callbackFn,parentObj) { 148 149 // IE11 polyfill because it doesn't support custom events. *party* 150 (function () { 151 152 if ( typeof window.CustomEvent === "function" ) return false;
153 154 function CustomEvent ( event, params ) { 155 params = params || { bubbles: false, cancelable: false, detail: undefined }; 156 var evt = document.createEvent('CustomEvent'); 157 evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); 158 return evt; 159 } 160 161 CustomEvent.prototype = window.Event.prototype; 162 163 window.CustomEvent = CustomEvent; 164 })(); 165 166 167 var myEvent = new CustomEvent(objName + '-defined'); 168 window.addEventListener(myEvent.type,callbackFn) 169 objName = typeof objName === 'string' ? objName : ''; 170 callbackFn = typeof callbackFn === 'function' ? callbackFn : function() {}; 171 parentObj = typeof parentObj === 'object' ? parentObj : window; 172 173 if (window[objName]) { 174 callbackFn(); 175 // console.log("Function called from if clause") 176 } else { 177 Object.defineProperty(parentObj, objName, {//Used to define on existing object (window in this case) 178 configurable: true, 179 enumerable: true, 180 get: function() { 181 return window['_' + objName];//Get reference object 182 }, 183 set: function(val) {//Called whenever the property is assigned (window.OneTrust = blah), this function is called with val equal to the right hand assignment 184 window['_' + objName] = val; //Underline character prevents recursive setting of objName, and creates window._OneTrust 185 // console.log("object set") 186 window.dispatchEvent(myEvent); 187 } 188 }); 189 } 190} 191 192 193module.exports = whenObjDefined; 194},{}],11:[function(require,module,exports){ 195(function (global){(function (){ 196/**! 197 * @fileOverview Kickass library to create and place poppers near their reference elements. 198 * @version 1.16.0 199 * @license 200 * Copyright (c) 2016 Federico Zivolo and contributors 201 * 202 * Permission is hereby granted, free of charge, to any person obtaining a copy 203 * of this software and associated documentation files (the "Software"), to deal 204 * in the Software without restriction, including without limitation the rights 205 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 206 * copies of the Software, and to permit persons to whom the Software is 207 * furnished to do so, subject to the following conditions: 208 * 209 * The above copyright notice and this permission notice shall be included in all 210 * copies or substantial portions of the Software. 211 * 212 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 213 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 214 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 215 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 216 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 217 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 218 * SOFTWARE. 219 */ 220(function (global, factory) { 221 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 222 typeof define === 'function' && define.amd ? define(factory) : 223 (global.Popper = factory()); 224}(this, (function () { 'use strict'; 225 226var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 227 228var timeoutDuration = function () { 229 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 230 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 231 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 232 return 1; 233 } 234 } 235 return 0; 236}(); 237 238function microtaskDebounce(fn) { 239 var called = false; 240 return function () { 241 if (called) { 242 return; 243 } 244 called = true; 245 window.Promise.resolve().then(function () { 246 called = false; 247 fn(); 248 }); 249 }; 250} 251 252function taskDebounce(fn) { 253 var scheduled = false; 254 return function () { 255 if (!scheduled) { 256 scheduled = true; 257 setTimeout(function () { 258 scheduled = false; 259 fn(); 260 }, timeoutDuration); 261 } 262 }; 263} 264 265var supportsMicroTasks = isBrowser && window.Promise; 266 267/** 268* Create a debounced version of a method, that's asynchronously deferred 269* but called in the minimum time possible. 270* 271* @method 272* @memberof Popper.Utils 273* @argument {Function} fn 274* @returns {Function} 275*/ 276var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 277 278/** 279 * Check if the given variable is a function 280 * @method 281 * @memberof Popper.Utils 282 * @argument {Any} functionToCheck - variable to check 283 * @returns {Boolean} answer to: is a function? 284 */ 285function isFunction(functionToCheck) { 286 var getType = {}; 287 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 288} 289
vendor: 10,456 bytes, lines 290-649
290/** 291 * Get CSS computed property of the given element 292 * @method 293 * @memberof Popper.Utils 294 * @argument {Eement} element 295 * @argument {String} property 296 */ 297function getStyleComputedProperty(element, property) { 298 if (element.nodeType !== 1) { 299 return []; 300 } 301 // NOTE: 1 DOM access here 302 var window = element.ownerDocument.defaultView; 303 var css = window.getComputedStyle(element, null); 304 return property ? css[property] : css; 305} 306 307/** 308 * Returns the parentNode or the host of the element 309 * @method 310 * @memberof Popper.Utils 311 * @argument {Element} element 312 * @returns {Element} parent 313 */ 314function getParentNode(element) { 315 if (element.nodeName === 'HTML') { 316 return element; 317 } 318 return element.parentNode || element.host; 319} 320 321/** 322 * Returns the scrolling parent of the given element 323 * @method 324 * @memberof Popper.Utils 325 * @argument {Element} element 326 * @returns {Element} scroll parent 327 */ 328function getScrollParent(element) { 329 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 330 if (!element) { 331 return document.body; 332 } 333 334 switch (element.nodeName) { 335 case 'HTML': 336 case 'BODY': 337 return element.ownerDocument.body; 338 case '#document': 339 return element.body; 340 } 341 342 // Firefox want us to check `-x` and `-y` variations as well 343 344 var _getStyleComputedProp = getStyleComputedProperty(element), 345 overflow = _getStyleComputedProp.overflow, 346 overflowX = _getStyleComputedProp.overflowX, 347 overflowY = _getStyleComputedProp.overflowY; 348 349 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 350 return element; 351 } 352 353 return getScrollParent(getParentNode(element)); 354} 355 356/** 357 * Returns the reference node of the reference object, or the reference object itself. 358 * @method 359 * @memberof Popper.Utils 360 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 361 * @returns {Element} parent 362 */ 363function getReferenceNode(reference) { 364 return reference && reference.referenceNode ? reference.referenceNode : reference; 365} 366 367var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 368var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 369 370/** 371 * Determines if the browser is Internet Explorer 372 * @method 373 * @memberof Popper.Utils 374 * @param {Number} version to check 375 * @returns {Boolean} isIE 376 */ 377function isIE(version) { 378 if (version === 11) { 379 return isIE11; 380 } 381 if (version === 10) { 382 return isIE10; 383 } 384 return isIE11 || isIE10; 385} 386 387/** 388 * Returns the offset parent of the given element 389 * @method 390 * @memberof Popper.Utils 391 * @argument {Element} element 392 * @returns {Element} offset parent 393 */ 394function getOffsetParent(element) { 395 if (!element) { 396 return document.documentElement; 397 } 398 399 var noOffsetParent = isIE(10) ? document.body : null; 400 401 // NOTE: 1 DOM access here 402 var offsetParent = element.offsetParent || null; 403 // Skip hidden elements which don't have an offsetParent 404 while (offsetParent === noOffsetParent && element.nextElementSibling) { 405 offsetParent = (element = element.nextElementSibling).offsetParent; 406 } 407 408 var nodeName = offsetParent && offsetParent.nodeName; 409 410 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 411 return element ? element.ownerDocument.documentElement : document.documentElement; 412 } 413 414 // .offsetParent will return the closest TH, TD or TABLE in case 415 // no offsetParent is present, I hate this job... 416 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 417 return getOffsetParent(offsetParent); 418 } 419 420 return offsetParent; 421} 422 423function isOffsetContainer(element) { 424 var nodeName = element.nodeName; 425 426 if (nodeName === 'BODY') { 427 return false; 428 } 429 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 430} 431 432/** 433 * Finds the root node (document, shadowDOM root) of the given element 434 * @method 435 * @memberof Popper.Utils 436 * @argument {Element} node 437 * @returns {Element} root node 438 */ 439function getRoot(node) { 440 if (node.parentNode !== null) { 441 return getRoot(node.parentNode); 442 } 443 444 return node; 445} 446 447/** 448 * Finds the offset parent common to the two provided nodes 449 * @method 450 * @memberof Popper.Utils 451 * @argument {Element} element1 452 * @argument {Element} element2 453 * @returns {Element} common offset parent 454 */ 455function findCommonOffsetParent(element1, element2) { 456 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 457 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 458 return document.documentElement; 459 } 460 461 // Here we make sure to give as "start" the element that comes first in the DOM 462 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 463 var start = order ? element1 : element2; 464 var end = order ? element2 : element1; 465 466 // Get common ancestor container 467 var range = document.createRange(); 468 range.setStart(start, 0); 469 range.setEnd(end, 0); 470 var commonAncestorContainer = range.commonAncestorContainer; 471 472 // Both nodes are inside #document 473 474 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 475 if (isOffsetContainer(commonAncestorContainer)) { 476 return commonAncestorContainer; 477 } 478 479 return getOffsetParent(commonAncestorContainer); 480 } 481 482 // one of the nodes is inside shadowDOM, find which one 483 var element1root = getRoot(element1); 484 if (element1root.host) { 485 return findCommonOffsetParent(element1root.host, element2); 486 } else { 487 return findCommonOffsetParent(element1, getRoot(element2).host); 488 } 489} 490 491/** 492 * Gets the scroll value of the given element in the given side (top and left) 493 * @method 494 * @memberof Popper.Utils 495 * @argument {Element} element 496 * @argument {String} side `top` or `left` 497 * @returns {number} amount of scrolled pixels 498 */ 499function getScroll(element) { 500 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 501 502 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 503 var nodeName = element.nodeName; 504 505 if (nodeName === 'BODY' || nodeName === 'HTML') { 506 var html = element.ownerDocument.documentElement; 507 var scrollingElement = element.ownerDocument.scrollingElement || html; 508 return scrollingElement[upperSide]; 509 } 510 511 return element[upperSide]; 512} 513 514/* 515 * Sum or subtract the element scroll values (left and top) from a given rect object 516 * @method 517 * @memberof Popper.Utils 518 * @param {Object} rect - Rect object you want to change 519 * @param {HTMLElement} element - The element from the function reads the scroll values 520 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 521 * @return {Object} rect - The modifier rect object 522 */ 523function includeScroll(rect, element) { 524 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 525 526 var scrollTop = getScroll(element, 'top'); 527 var scrollLeft = getScroll(element, 'left'); 528 var modifier = subtract ? -1 : 1; 529 rect.top += scrollTop * modifier; 530 rect.bottom += scrollTop * modifier; 531 rect.left += scrollLeft * modifier; 532 rect.right += scrollLeft * modifier; 533 return rect; 534} 535 536/* 537 * Helper to detect borders of a given element 538 * @method 539 * @memberof Popper.Utils 540 * @param {CSSStyleDeclaration} styles 541 * Result of `getStyleComputedProperty` on the given element 542 * @param {String} axis - `x` or `y` 543 * @return {number} borders - The borders size of the given axis 544 */ 545 546function getBordersSize(styles, axis) { 547 var sideA = axis === 'x' ? 'Left' : 'Top'; 548 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 549 550 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); 551} 552 553function getSize(axis, body, html, computedStyle) { 554 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 555} 556 557function getWindowSizes(document) { 558 var body = document.body; 559 var html = document.documentElement; 560 var computedStyle = isIE(10) && getComputedStyle(html); 561 562 return { 563 height: getSize('Height', body, html, computedStyle), 564 width: getSize('Width', body, html, computedStyle) 565 }; 566} 567 568var classCallCheck = function (instance, Constructor) { 569 if (!(instance instanceof Constructor)) { 570 throw new TypeError("Cannot call a class as a function"); 571 } 572}; 573 574var createClass = function () { 575 function defineProperties(target, props) { 576 for (var i = 0; i < props.length; i++) { 577 var descriptor = props[i]; 578 descriptor.enumerable = descriptor.enumerable || false; 579 descriptor.configurable = true; 580 if ("value" in descriptor) descriptor.writable = true; 581 Object.defineProperty(target, descriptor.key, descriptor); 582 } 583 } 584 585 return function (Constructor, protoProps, staticProps) { 586 if (protoProps) defineProperties(Constructor.prototype, protoProps); 587 if (staticProps) defineProperties(Constructor, staticProps); 588 return Constructor; 589 }; 590}(); 591 592 593 594 595 596var defineProperty = function (obj, key, value) { 597 if (key in obj) { 598 Object.defineProperty(obj, key, { 599 value: value, 600 enumerable: true, 601 configurable: true, 602 writable: true 603 }); 604 } else { 605 obj[key] = value; 606 } 607 608 return obj; 609}; 610 611var _extends = Object.assign || function (target) { 612 for (var i = 1; i < arguments.length; i++) { 613 var source = arguments[i]; 614 615 for (var key in source) { 616 if (Object.prototype.hasOwnProperty.call(source, key)) { 617 target[key] = source[key]; 618 } 619 } 620 } 621 622 return target; 623}; 624 625/** 626 * Given element offsets, generate an output similar to getBoundingClientRect 627 * @method 628 * @memberof Popper.Utils 629 * @argument {Object} offsets 630 * @returns {Object} ClientRect like output 631 */ 632function getClientRect(offsets) { 633 return _extends({}, offsets, { 634 right: offsets.left + offsets.width, 635 bottom: offsets.top + offsets.height 636 }); 637} 638 639/** 640 * Get bounding client rect of given element 641 * @method 642 * @memberof Popper.Utils 643 * @param {HTMLElement} element 644 * @return {Object} client rect 645 */ 646function getBoundingClientRect(element) { 647 var rect = {}; 648 649 // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 2,932 bytes, lines 650-728
650 // considered in DOM in some circumstances... 651 // This isn't reproducible in IE10 compatibility mode of IE11 652 try { 653 if (isIE(10)) { 654 rect = element.getBoundingClientRect(); 655 var scrollTop = getScroll(element, 'top'); 656 var scrollLeft = getScroll(element, 'left'); 657 rect.top += scrollTop; 658 rect.left += scrollLeft; 659 rect.bottom += scrollTop; 660 rect.right += scrollLeft; 661 } else { 662 rect = element.getBoundingClientRect(); 663 } 664 } catch (e) {} 665 666 var result = { 667 left: rect.left, 668 top: rect.top, 669 width: rect.right - rect.left, 670 height: rect.bottom - rect.top 671 }; 672 673 // subtract scrollbar size from sizes 674 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 675 var width = sizes.width || element.clientWidth || result.width; 676 var height = sizes.height || element.clientHeight || result.height; 677 678 var horizScrollbar = element.offsetWidth - width; 679 var vertScrollbar = element.offsetHeight - height; 680 681 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 682 // we make this check conditional for performance reasons 683 if (horizScrollbar || vertScrollbar) { 684 var styles = getStyleComputedProperty(element); 685 horizScrollbar -= getBordersSize(styles, 'x'); 686 vertScrollbar -= getBordersSize(styles, 'y'); 687 688 result.width -= horizScrollbar; 689 result.height -= vertScrollbar; 690 } 691 692 return getClientRect(result); 693} 694 695function getOffsetRectRelativeToArbitraryNode(children, parent) { 696 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 697 698 var isIE10 = isIE(10); 699 var isHTML = parent.nodeName === 'HTML'; 700 var childrenRect = getBoundingClientRect(children); 701 var parentRect = getBoundingClientRect(parent); 702 var scrollParent = getScrollParent(children); 703 704 var styles = getStyleComputedProperty(parent); 705 var borderTopWidth = parseFloat(styles.borderTopWidth, 10); 706 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); 707 708 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 709 if (fixedPosition && isHTML) { 710 parentRect.top = Math.max(parentRect.top, 0); 711 parentRect.left = Math.max(parentRect.left, 0); 712 } 713 var offsets = getClientRect({ 714 top: childrenRect.top - parentRect.top - borderTopWidth, 715 left: childrenRect.left - parentRect.left - borderLeftWidth, 716 width: childrenRect.width, 717 height: childrenRect.height 718 }); 719 offsets.marginTop = 0; 720 offsets.marginLeft = 0; 721 722 // Subtract margins of documentElement in case it's being used as parent 723 // we do this only on HTML because it's the only element that behaves 724 // differently when margins are applied to it. The margins are included in 725 // the box of the documentElement, in the other cases not. 726 if (!isIE10 && isHTML) { 727 var marginTop = parseFloat(styles.marginTop, 10); 728 var marginLeft = parseFloat(styles.marginLeft, 10
vendor: 31,482 bytes, lines 728-1667
728); 729 730 offsets.top -= borderTopWidth - marginTop; 731 offsets.bottom -= borderTopWidth - marginTop; 732 offsets.left -= borderLeftWidth - marginLeft; 733 offsets.right -= borderLeftWidth - marginLeft; 734 735 // Attach marginTop and marginLeft because in some circumstances we may need them 736 offsets.marginTop = marginTop; 737 offsets.marginLeft = marginLeft; 738 } 739 740 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 741 offsets = includeScroll(offsets, parent); 742 } 743 744 return offsets; 745} 746 747function getViewportOffsetRectRelativeToArtbitraryNode(element) { 748 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 749 750 var html = element.ownerDocument.documentElement; 751 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 752 var width = Math.max(html.clientWidth, window.innerWidth || 0); 753 var height = Math.max(html.clientHeight, window.innerHeight || 0); 754 755 var scrollTop = !excludeScroll ? getScroll(html) : 0; 756 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 757 758 var offset = { 759 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 760 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 761 width: width, 762 height: height 763 }; 764 765 return getClientRect(offset); 766} 767 768/** 769 * Check if the given element is fixed or is inside a fixed parent 770 * @method 771 * @memberof Popper.Utils 772 * @argument {Element} element 773 * @argument {Element} customContainer 774 * @returns {Boolean} answer to "isFixed?" 775 */ 776function isFixed(element) { 777 var nodeName = element.nodeName; 778 if (nodeName === 'BODY' || nodeName === 'HTML') { 779 return false; 780 } 781 if (getStyleComputedProperty(element, 'position') === 'fixed') { 782 return true; 783 } 784 var parentNode = getParentNode(element); 785 if (!parentNode) { 786 return false; 787 } 788 return isFixed(parentNode); 789} 790 791/** 792 * Finds the first parent of an element that has a transformed property defined 793 * @method 794 * @memberof Popper.Utils 795 * @argument {Element} element 796 * @returns {Element} first transformed parent or documentElement 797 */ 798 799function getFixedPositionOffsetParent(element) { 800 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 801 if (!element || !element.parentElement || isIE()) { 802 return document.documentElement; 803 } 804 var el = element.parentElement; 805 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 806 el = el.parentElement; 807 } 808 return el || document.documentElement; 809} 810 811/** 812 * Computed the boundaries limits and return them 813 * @method 814 * @memberof Popper.Utils 815 * @param {HTMLElement} popper 816 * @param {HTMLElement} reference 817 * @param {number} padding 818 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 819 * @param {Boolean} fixedPosition - Is in fixed position mode 820 * @returns {Object} Coordinates of the boundaries 821 */ 822function getBoundaries(popper, reference, padding, boundariesElement) { 823 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 824 825 // NOTE: 1 DOM access here 826 827 var boundaries = { top: 0, left: 0 }; 828 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 829 830 // Handle viewport case 831 if (boundariesElement === 'viewport') { 832 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 833 } else { 834 // Handle other cases based on DOM element used as boundaries 835 var boundariesNode = void 0; 836 if (boundariesElement === 'scrollParent') { 837 boundariesNode = getScrollParent(getParentNode(reference)); 838 if (boundariesNode.nodeName === 'BODY') { 839 boundariesNode = popper.ownerDocument.documentElement; 840 } 841 } else if (boundariesElement === 'window') { 842 boundariesNode = popper.ownerDocument.documentElement; 843 } else { 844 boundariesNode = boundariesElement; 845 } 846 847 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 848 849 // In case of HTML, we need a different computation 850 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 851 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 852 height = _getWindowSizes.height, 853 width = _getWindowSizes.width; 854 855 boundaries.top += offsets.top - offsets.marginTop; 856 boundaries.bottom = height + offsets.top; 857 boundaries.left += offsets.left - offsets.marginLeft; 858 boundaries.right = width + offsets.left; 859 } else { 860 // for all the other DOM elements, this one is good 861 boundaries = offsets; 862 } 863 } 864 865 // Add paddings 866 padding = padding || 0; 867 var isPaddingNumber = typeof padding === 'number'; 868 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 869 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 870 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 871 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 872 873 return boundaries; 874} 875 876function getArea(_ref) { 877 var width = _ref.width, 878 height = _ref.height; 879 880 return width * height; 881} 882 883/** 884 * Utility used to transform the `auto` placement to the placement with more 885 * available space. 886 * @method 887 * @memberof Popper.Utils 888 * @argument {Object} data - The data object generated by update method 889 * @argument {Object} options - Modifiers configuration and options 890 * @returns {Object} The data object, properly modified 891 */ 892function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 893 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 894 895 if (placement.indexOf('auto') === -1) { 896 return placement; 897 } 898 899 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 900 901 var rects = { 902 top: { 903 width: boundaries.width, 904 height: refRect.top - boundaries.top 905 }, 906 right: { 907 width: boundaries.right - refRect.right, 908 height: boundaries.height 909 }, 910 bottom: { 911 width: boundaries.width, 912 height: boundaries.bottom - refRect.bottom 913 }, 914 left: { 915 width: refRect.left - boundaries.left, 916 height: boundaries.height 917 } 918 }; 919 920 var sortedAreas = Object.keys(rects).map(function (key) { 921 return _extends({ 922 key: key 923 }, rects[key], { 924 area: getArea(rects[key]) 925 }); 926 }).sort(function (a, b) { 927 return b.area - a.area; 928 }); 929 930 var filteredAreas = sortedAreas.filter(function (_ref2) { 931 var width = _ref2.width, 932 height = _ref2.height; 933 return width >= popper.clientWidth && height >= popper.clientHeight; 934 }); 935 936 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 937 938 var variation = placement.split('-')[1]; 939 940 return computedPlacement + (variation ? '-' + variation : ''); 941} 942 943/** 944 * Get offsets to the reference element 945 * @method 946 * @memberof Popper.Utils 947 * @param {Object} state 948 * @param {Element} popper - the popper element 949 * @param {Element} reference - the reference element (the popper will be relative to this) 950 * @param {Element} fixedPosition - is in fixed position mode 951 * @returns {Object} An object containing the offsets which will be applied to the popper 952 */ 953function getReferenceOffsets(state, popper, reference) { 954 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 955 956 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 957 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 958} 959 960/** 961 * Get the outer sizes of the given element (offset size + margins) 962 * @method 963 * @memberof Popper.Utils 964 * @argument {Element} element 965 * @returns {Object} object containing width and height properties 966 */ 967function getOuterSizes(element) { 968 var window = element.ownerDocument.defaultView; 969 var styles = window.getComputedStyle(element); 970 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 971 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 972 var result = { 973 width: element.offsetWidth + y, 974 height: element.offsetHeight + x 975 }; 976 return result; 977} 978 979/** 980 * Get the opposite placement of the given one 981 * @method 982 * @memberof Popper.Utils 983 * @argument {String} placement 984 * @returns {String} flipped placement 985 */ 986function getOppositePlacement(placement) { 987 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 988 return placement.replace(/left|right|bottom|top/g, function (matched) { 989 return hash[matched]; 990 }); 991} 992 993/** 994 * Get offsets to the popper 995 * @method 996 * @memberof Popper.Utils 997 * @param {Object} position - CSS position the Popper will get applied 998 * @param {HTMLElement} popper - the popper element 999 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 1000 * @param {String} placement - one of the valid placement options 1001 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 1002 */ 1003function getPopperOffsets(popper, referenceOffsets, placement) { 1004 placement = placement.split('-')[0]; 1005 1006 // Get popper node sizes 1007 var popperRect = getOuterSizes(popper); 1008 1009 // Add position, width and height to our offsets object 1010 var popperOffsets = { 1011 width: popperRect.width, 1012 height: popperRect.height 1013 }; 1014 1015 // depending by the popper placement we have to compute its offsets slightly differently 1016 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 1017 var mainSide = isHoriz ? 'top' : 'left'; 1018 var secondarySide = isHoriz ? 'left' : 'top'; 1019 var measurement = isHoriz ? 'height' : 'width'; 1020 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 1021 1022 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 1023 if (placement === secondarySide) { 1024 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 1025 } else { 1026 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 1027 } 1028 1029 return popperOffsets; 1030} 1031 1032/** 1033 * Mimics the `find` method of Array 1034 * @method 1035 * @memberof Popper.Utils 1036 * @argument {Array} arr 1037 * @argument prop 1038 * @argument value 1039 * @returns index or -1 1040 */ 1041function find(arr, check) { 1042 // use native find if supported 1043 if (Array.prototype.find) { 1044 return arr.find(check); 1045 } 1046 1047 // use `filter` to obtain the same behavior of `find` 1048 return arr.filter(check)[0]; 1049} 1050 1051/** 1052 * Return the index of the matching object 1053 * @method 1054 * @memberof Popper.Utils 1055 * @argument {Array} arr 1056 * @argument prop 1057 * @argument value 1058 * @returns index or -1 1059 */ 1060function findIndex(arr, prop, value) { 1061 // use native findIndex if supported 1062 if (Array.prototype.findIndex) { 1063 return arr.findIndex(function (cur) { 1064 return cur[prop] === value; 1065 }); 1066 } 1067 1068 // use `find` + `indexOf` if `findIndex` isn't supported 1069 var match = find(arr, function (obj) { 1070 return obj[prop] === value; 1071 }); 1072 return arr.indexOf(match); 1073} 1074 1075/** 1076 * Loop trough the list of modifiers and run them in order, 1077 * each of them will then edit the data object. 1078 * @method 1079 * @memberof Popper.Utils 1080 * @param {dataObject} data 1081 * @param {Array} modifiers 1082 * @param {String} ends - Optional modifier name used as stopper 1083 * @returns {dataObject} 1084 */ 1085function runModifiers(modifiers, data, ends) { 1086 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 1087 1088 modifiersToRun.forEach(function (modifier) { 1089 if (modifier['function']) { 1090 // eslint-disable-line dot-notation 1091 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 1092 } 1093 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 1094 if (modifier.enabled && isFunction(fn)) { 1095 // Add properties to offsets to make them a complete clientRect object 1096 // we do this before each modifier to make sure the previous one doesn't 1097 // mess with these values 1098 data.offsets.popper = getClientRect(data.offsets.popper); 1099 data.offsets.reference = getClientRect(data.offsets.reference); 1100 1101 data = fn(data, modifier); 1102 } 1103 }); 1104 1105 return data; 1106} 1107 1108/** 1109 * Updates the position of the popper, computing the new offsets and applying 1110 * the new style.<br /> 1111 * Prefer `scheduleUpdate` over `update` because of performance reasons. 1112 * @method 1113 * @memberof Popper 1114 */ 1115function update() { 1116 // if popper is destroyed, don't perform any further update 1117 if (this.state.isDestroyed) { 1118 return; 1119 } 1120 1121 var data = { 1122 instance: this, 1123 styles: {}, 1124 arrowStyles: {}, 1125 attributes: {}, 1126 flipped: false, 1127 offsets: {} 1128 }; 1129 1130 // compute reference element offsets 1131 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 1132 1133 // compute auto placement, store placement inside the data object, 1134 // modifiers will be able to edit `placement` if needed 1135 // and refer to originalPlacement to know the original value 1136 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 1137 1138 // store the computed placement inside `originalPlacement` 1139 data.originalPlacement = data.placement; 1140 1141 data.positionFixed = this.options.positionFixed; 1142 1143 // compute the popper offsets 1144 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 1145 1146 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 1147 1148 // run the modifiers 1149 data = runModifiers(this.modifiers, data); 1150 1151 // the first `update` will call `onCreate` callback 1152 // the other ones will call `onUpdate` callback 1153 if (!this.state.isCreated) { 1154 this.state.isCreated = true; 1155 this.options.onCreate(data); 1156 } else { 1157 this.options.onUpdate(data); 1158 } 1159} 1160 1161/** 1162 * Helper used to know if the given modifier is enabled. 1163 * @method 1164 * @memberof Popper.Utils 1165 * @returns {Boolean} 1166 */ 1167function isModifierEnabled(modifiers, modifierName) { 1168 return modifiers.some(function (_ref) { 1169 var name = _ref.name, 1170 enabled = _ref.enabled; 1171 return enabled && name === modifierName; 1172 }); 1173} 1174 1175/** 1176 * Get the prefixed supported property name 1177 * @method 1178 * @memberof Popper.Utils 1179 * @argument {String} property (camelCase) 1180 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 1181 */ 1182function getSupportedPropertyName(property) { 1183 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 1184 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 1185 1186 for (var i = 0; i < prefixes.length; i++) { 1187 var prefix = prefixes[i]; 1188 var toCheck = prefix ? '' + prefix + upperProp : property; 1189 if (typeof document.body.style[toCheck] !== 'undefined') { 1190 return toCheck; 1191 } 1192 } 1193 return null; 1194} 1195 1196/** 1197 * Destroys the popper. 1198 * @method 1199 * @memberof Popper 1200 */ 1201function destroy() { 1202 this.state.isDestroyed = true; 1203 1204 // touch DOM only if `applyStyle` modifier is enabled 1205 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 1206 this.popper.removeAttribute('x-placement'); 1207 this.popper.style.position = ''; 1208 this.popper.style.top = ''; 1209 this.popper.style.left = ''; 1210 this.popper.style.right = ''; 1211 this.popper.style.bottom = ''; 1212 this.popper.style.willChange = ''; 1213 this.popper.style[getSupportedPropertyName('transform')] = ''; 1214 } 1215 1216 this.disableEventListeners(); 1217 1218 // remove the popper if user explicitly asked for the deletion on destroy 1219 // do not use `remove` because IE11 doesn't support it 1220 if (this.options.removeOnDestroy) { 1221 this.popper.parentNode.removeChild(this.popper); 1222 } 1223 return this; 1224} 1225 1226/** 1227 * Get the window associated with the element 1228 * @argument {Element} element 1229 * @returns {Window} 1230 */ 1231function getWindow(element) { 1232 var ownerDocument = element.ownerDocument; 1233 return ownerDocument ? ownerDocument.defaultView : window; 1234} 1235 1236function attachToScrollParents(scrollParent, event, callback, scrollParents) { 1237 var isBody = scrollParent.nodeName === 'BODY'; 1238 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 1239 target.addEventListener(event, callback, { passive: true }); 1240 1241 if (!isBody) { 1242 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 1243 } 1244 scrollParents.push(target); 1245} 1246 1247/** 1248 * Setup needed event listeners used to update the popper position 1249 * @method 1250 * @memberof Popper.Utils 1251 * @private 1252 */ 1253function setupEventListeners(reference, options, state, updateBound) { 1254 // Resize event listener on window 1255 state.updateBound = updateBound; 1256 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 1257 1258 // Scroll event listener on scroll parents 1259 var scrollElement = getScrollParent(reference); 1260 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 1261 state.scrollElement = scrollElement; 1262 state.eventsEnabled = true; 1263 1264 return state; 1265} 1266 1267/** 1268 * It will add resize/scroll events and start recalculating 1269 * position of the popper element when they are triggered. 1270 * @method 1271 * @memberof Popper 1272 */ 1273function enableEventListeners() { 1274 if (!this.state.eventsEnabled) { 1275 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 1276 } 1277} 1278 1279/** 1280 * Remove event listeners used to update the popper position 1281 * @method 1282 * @memberof Popper.Utils 1283 * @private 1284 */ 1285function removeEventListeners(reference, state) { 1286 // Remove resize event listener on window 1287 getWindow(reference).removeEventListener('resize', state.updateBound); 1288 1289 // Remove scroll event listener on scroll parents 1290 state.scrollParents.forEach(function (target) { 1291 target.removeEventListener('scroll', state.updateBound); 1292 }); 1293 1294 // Reset state 1295 state.updateBound = null; 1296 state.scrollParents = []; 1297 state.scrollElement = null; 1298 state.eventsEnabled = false; 1299 return state; 1300} 1301 1302/** 1303 * It will remove resize/scroll events and won't recalculate popper position 1304 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 1305 * unless you call `update` method manually. 1306 * @method 1307 * @memberof Popper 1308 */ 1309function disableEventListeners() { 1310 if (this.state.eventsEnabled) { 1311 cancelAnimationFrame(this.scheduleUpdate); 1312 this.state = removeEventListeners(this.reference, this.state); 1313 } 1314} 1315 1316/** 1317 * Tells if a given input is a number 1318 * @method 1319 * @memberof Popper.Utils 1320 * @param {*} input to check 1321 * @return {Boolean} 1322 */ 1323function isNumeric(n) { 1324 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 1325} 1326 1327/** 1328 * Set the style to the given popper 1329 * @method 1330 * @memberof Popper.Utils 1331 * @argument {Element} element - Element to apply the style to 1332 * @argument {Object} styles 1333 * Object with a list of properties and values which will be applied to the element 1334 */ 1335function setStyles(element, styles) { 1336 Object.keys(styles).forEach(function (prop) { 1337 var unit = ''; 1338 // add unit if the value is numeric and is one of the following 1339 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 1340 unit = 'px'; 1341 } 1342 element.style[prop] = styles[prop] + unit; 1343 }); 1344} 1345 1346/** 1347 * Set the attributes to the given popper 1348 * @method 1349 * @memberof Popper.Utils 1350 * @argument {Element} element - Element to apply the attributes to 1351 * @argument {Object} styles 1352 * Object with a list of properties and values which will be applied to the element 1353 */ 1354function setAttributes(element, attributes) { 1355 Object.keys(attributes).forEach(function (prop) { 1356 var value = attributes[prop]; 1357 if (value !== false) { 1358 element.setAttribute(prop, attributes[prop]); 1359 } else { 1360 element.removeAttribute(prop); 1361 } 1362 }); 1363} 1364 1365/** 1366 * @function 1367 * @memberof Modifiers 1368 * @argument {Object} data - The data object generated by `update` method 1369 * @argument {Object} data.styles - List of style properties - values to apply to popper element 1370 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 1371 * @argument {Object} options - Modifiers configuration and options 1372 * @returns {Object} The same data object 1373 */ 1374function applyStyle(data) { 1375 // any property present in `data.styles` will be applied to the popper, 1376 // in this way we can make the 3rd party modifiers add custom styles to it 1377 // Be aware, modifiers could override the properties defined in the previous 1378 // lines of this modifier! 1379 setStyles(data.instance.popper, data.styles); 1380 1381 // any property present in `data.attributes` will be applied to the popper, 1382 // they will be set as HTML attributes of the element 1383 setAttributes(data.instance.popper, data.attributes); 1384 1385 // if arrowElement is defined and arrowStyles has some properties 1386 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 1387 setStyles(data.arrowElement, data.arrowStyles); 1388 } 1389 1390 return data; 1391} 1392 1393/** 1394 * Set the x-placement attribute before everything else because it could be used 1395 * to add margins to the popper margins needs to be calculated to get the 1396 * correct popper offsets. 1397 * @method 1398 * @memberof Popper.modifiers 1399 * @param {HTMLElement} reference - The reference element used to position the popper 1400 * @param {HTMLElement} popper - The HTML element used as popper 1401 * @param {Object} options - Popper.js options 1402 */ 1403function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 1404 // compute reference element offsets 1405 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 1406 1407 // compute auto placement, store placement inside the data object, 1408 // modifiers will be able to edit `placement` if needed 1409 // and refer to originalPlacement to know the original value 1410 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 1411 1412 popper.setAttribute('x-placement', placement); 1413 1414 // Apply `position` to popper before anything else because 1415 // without the position applied we can't guarantee correct computations 1416 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 1417 1418 return options; 1419} 1420 1421/** 1422 * @function 1423 * @memberof Popper.Utils 1424 * @argument {Object} data - The data object generated by `update` method 1425 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 1426 * @returns {Object} The popper's position offsets rounded 1427 * 1428 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 1429 * good as it can be within reason. 1430 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 1431 * 1432 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 1433 * as well on High DPI screens). 1434 * 1435 * Firefox prefers no rounding for positioning and does not have blurriness on 1436 * high DPI screens. 1437 * 1438 * Only horizontal placement and left/right values need to be considered. 1439 */ 1440function getRoundedOffsets(data, shouldRound) { 1441 var _data$offsets = data.offsets, 1442 popper = _data$offsets.popper, 1443 reference = _data$offsets.reference; 1444 var round = Math.round, 1445 floor = Math.floor; 1446 1447 var noRound = function noRound(v) { 1448 return v; 1449 }; 1450 1451 var referenceWidth = round(reference.width); 1452 var popperWidth = round(popper.width); 1453 1454 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 1455 var isVariation = data.placement.indexOf('-') !== -1; 1456 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 1457 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 1458 1459 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 1460 var verticalToInteger = !shouldRound ? noRound : round; 1461 1462 return { 1463 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 1464 top: verticalToInteger(popper.top), 1465 bottom: verticalToInteger(popper.bottom), 1466 right: horizontalToInteger(popper.right) 1467 }; 1468} 1469 1470var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 1471 1472/** 1473 * @function 1474 * @memberof Modifiers 1475 * @argument {Object} data - The data object generated by `update` method 1476 * @argument {Object} options - Modifiers configuration and options 1477 * @returns {Object} The data object, properly modified 1478 */ 1479function computeStyle(data, options) { 1480 var x = options.x, 1481 y = options.y; 1482 var popper = data.offsets.popper; 1483 1484 // Remove this legacy support in Popper.js v2 1485 1486 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 1487 return modifier.name === 'applyStyle'; 1488 }).gpuAcceleration; 1489 if (legacyGpuAccelerationOption !== undefined) { 1490 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 1491 } 1492 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 1493 1494 var offsetParent = getOffsetParent(data.instance.popper); 1495 var offsetParentRect = getBoundingClientRect(offsetParent); 1496 1497 // Styles 1498 var styles = { 1499 position: popper.position 1500 }; 1501 1502 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 1503 1504 var sideA = x === 'bottom' ? 'top' : 'bottom'; 1505 var sideB = y === 'right' ? 'left' : 'right'; 1506 1507 // if gpuAcceleration is set to `true` and transform is supported, 1508 // we use `translate3d` to apply the position to the popper we 1509 // automatically use the supported prefixed version if needed 1510 var prefixedProperty = getSupportedPropertyName('transform'); 1511 1512 // now, let's make a step back and look at this code closely (wtf?) 1513 // If the content of the popper grows once it's been positioned, it 1514 // may happen that the popper gets misplaced because of the new content 1515 // overflowing its reference element 1516 // To avoid this problem, we provide two options (x and y), which allow 1517 // the consumer to define the offset origin. 1518 // If we position a popper on top of a reference element, we can set 1519 // `x` to `top` to make the popper grow towards its top instead of 1520 // its bottom. 1521 var left = void 0, 1522 top = void 0; 1523 if (sideA === 'bottom') { 1524 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 1525 // and not the bottom of the html element 1526 if (offsetParent.nodeName === 'HTML') { 1527 top = -offsetParent.clientHeight + offsets.bottom; 1528 } else { 1529 top = -offsetParentRect.height + offsets.bottom; 1530 } 1531 } else { 1532 top = offsets.top; 1533 } 1534 if (sideB === 'right') { 1535 if (offsetParent.nodeName === 'HTML') { 1536 left = -offsetParent.clientWidth + offsets.right; 1537 } else { 1538 left = -offsetParentRect.width + offsets.right; 1539 } 1540 } else { 1541 left = offsets.left; 1542 } 1543 if (gpuAcceleration && prefixedProperty) { 1544 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 1545 styles[sideA] = 0; 1546 styles[sideB] = 0; 1547 styles.willChange = 'transform'; 1548 } else { 1549 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 1550 var invertTop = sideA === 'bottom' ? -1 : 1; 1551 var invertLeft = sideB === 'right' ? -1 : 1; 1552 styles[sideA] = top * invertTop; 1553 styles[sideB] = left * invertLeft; 1554 styles.willChange = sideA + ', ' + sideB; 1555 } 1556 1557 // Attributes 1558 var attributes = { 1559 'x-placement': data.placement 1560 }; 1561 1562 // Update `data` attributes, styles and arrowStyles 1563 data.attributes = _extends({}, attributes, data.attributes); 1564 data.styles = _extends({}, styles, data.styles); 1565 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 1566 1567 return data; 1568} 1569 1570/** 1571 * Helper used to know if the given modifier depends from another one.<br /> 1572 * It checks if the needed modifier is listed and enabled. 1573 * @method 1574 * @memberof Popper.Utils 1575 * @param {Array} modifiers - list of modifiers 1576 * @param {String} requestingName - name of requesting modifier 1577 * @param {String} requestedName - name of requested modifier 1578 * @returns {Boolean} 1579 */ 1580function isModifierRequired(modifiers, requestingName, requestedName) { 1581 var requesting = find(modifiers, function (_ref) { 1582 var name = _ref.name; 1583 return name === requestingName; 1584 }); 1585 1586 var isRequired = !!requesting && modifiers.some(function (modifier) { 1587 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 1588 }); 1589 1590 if (!isRequired) { 1591 var _requesting = '`' + requestingName + '`'; 1592 var requested = '`' + requestedName + '`'; 1593 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 1594 } 1595 return isRequired; 1596} 1597 1598/** 1599 * @function 1600 * @memberof Modifiers 1601 * @argument {Object} data - The data object generated by update method 1602 * @argument {Object} options - Modifiers configuration and options 1603 * @returns {Object} The data object, properly modified 1604 */ 1605function arrow(data, options) { 1606 var _data$offsets$arrow; 1607 1608 // arrow depends on keepTogether in order to work 1609 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 1610 return data; 1611 } 1612 1613 var arrowElement = options.element; 1614 1615 // if arrowElement is a string, suppose it's a CSS selector 1616 if (typeof arrowElement === 'string') { 1617 arrowElement = data.instance.popper.querySelector(arrowElement); 1618 1619 // if arrowElement is not found, don't run the modifier 1620 if (!arrowElement) { 1621 return data; 1622 } 1623 } else { 1624 // if the arrowElement isn't a query selector we must check that the 1625 // provided DOM node is child of its popper node 1626 if (!data.instance.popper.contains(arrowElement)) { 1627 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 1628 return data; 1629 } 1630 } 1631 1632 var placement = data.placement.split('-')[0]; 1633 var _data$offsets = data.offsets, 1634 popper = _data$offsets.popper, 1635 reference = _data$offsets.reference; 1636 1637 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 1638 1639 var len = isVertical ? 'height' : 'width'; 1640 var sideCapitalized = isVertical ? 'Top' : 'Left'; 1641 var side = sideCapitalized.toLowerCase(); 1642 var altSide = isVertical ? 'left' : 'top'; 1643 var opSide = isVertical ? 'bottom' : 'right'; 1644 var arrowElementSize = getOuterSizes(arrowElement)[len]; 1645 1646 // 1647 // extends keepTogether behavior making sure the popper and its 1648 // reference have enough pixels in conjunction 1649 // 1650 1651 // top/left side 1652 if (reference[opSide] - arrowElementSize < popper[side]) { 1653 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 1654 } 1655 // bottom/right side 1656 if (reference[side] + arrowElementSize > popper[opSide]) { 1657 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 1658 } 1659 data.offsets.popper = getClientRect(data.offsets.popper); 1660 1661 // compute center of the popper 1662 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 1663 1664 // Compute the sideValue using the updated popper offsets 1665 // take popper margin in account because we don't have this info available 1666 var css = getStyleComputedProperty(data.instance.popper); 1667 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]
1667, 10); 1668 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10
vendor: 21,597 bytes, lines 1668-2278
1668); 1669 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 1670 1671 // prevent arrowElement from being placed not contiguously to its popper 1672 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 1673 1674 data.arrowElement = arrowElement; 1675 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 1676 1677 return data; 1678} 1679 1680/** 1681 * Get the opposite placement variation of the given one 1682 * @method 1683 * @memberof Popper.Utils 1684 * @argument {String} placement variation 1685 * @returns {String} flipped placement variation 1686 */ 1687function getOppositeVariation(variation) { 1688 if (variation === 'end') { 1689 return 'start'; 1690 } else if (variation === 'start') { 1691 return 'end'; 1692 } 1693 return variation; 1694} 1695 1696/** 1697 * List of accepted placements to use as values of the `placement` option.<br /> 1698 * Valid placements are: 1699 * - `auto` 1700 * - `top` 1701 * - `right` 1702 * - `bottom` 1703 * - `left` 1704 * 1705 * Each placement can have a variation from this list: 1706 * - `-start` 1707 * - `-end` 1708 * 1709 * Variations are interpreted easily if you think of them as the left to right 1710 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 1711 * is right.<br /> 1712 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 1713 * 1714 * Some valid examples are: 1715 * - `top-end` (on top of reference, right aligned) 1716 * - `right-start` (on right of reference, top aligned) 1717 * - `bottom` (on bottom, centered) 1718 * - `auto-end` (on the side with more space available, alignment depends by placement) 1719 * 1720 * @static 1721 * @type {Array} 1722 * @enum {String} 1723 * @readonly 1724 * @method placements 1725 * @memberof Popper 1726 */ 1727var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 1728 1729// Get rid of `auto` `auto-start` and `auto-end` 1730var validPlacements = placements.slice(3); 1731 1732/** 1733 * Given an initial placement, returns all the subsequent placements 1734 * clockwise (or counter-clockwise). 1735 * 1736 * @method 1737 * @memberof Popper.Utils 1738 * @argument {String} placement - A valid placement (it accepts variations) 1739 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 1740 * @returns {Array} placements including their variations 1741 */ 1742function clockwise(placement) { 1743 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 1744 1745 var index = validPlacements.indexOf(placement); 1746 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 1747 return counter ? arr.reverse() : arr; 1748} 1749 1750var BEHAVIORS = { 1751 FLIP: 'flip', 1752 CLOCKWISE: 'clockwise', 1753 COUNTERCLOCKWISE: 'counterclockwise' 1754}; 1755 1756/** 1757 * @function 1758 * @memberof Modifiers 1759 * @argument {Object} data - The data object generated by update method 1760 * @argument {Object} options - Modifiers configuration and options 1761 * @returns {Object} The data object, properly modified 1762 */ 1763function flip(data, options) { 1764 // if `inner` modifier is enabled, we can't use the `flip` modifier 1765 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 1766 return data; 1767 } 1768 1769 if (data.flipped && data.placement === data.originalPlacement) { 1770 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 1771 return data; 1772 } 1773 1774 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 1775 1776 var placement = data.placement.split('-')[0]; 1777 var placementOpposite = getOppositePlacement(placement); 1778 var variation = data.placement.split('-')[1] || ''; 1779 1780 var flipOrder = []; 1781 1782 switch (options.behavior) { 1783 case BEHAVIORS.FLIP: 1784 flipOrder = [placement, placementOpposite]; 1785 break; 1786 case BEHAVIORS.CLOCKWISE: 1787 flipOrder = clockwise(placement); 1788 break; 1789 case BEHAVIORS.COUNTERCLOCKWISE: 1790 flipOrder = clockwise(placement, true); 1791 break; 1792 default: 1793 flipOrder = options.behavior; 1794 } 1795 1796 flipOrder.forEach(function (step, index) { 1797 if (placement !== step || flipOrder.length === index + 1) { 1798 return data; 1799 } 1800 1801 placement = data.placement.split('-')[0]; 1802 placementOpposite = getOppositePlacement(placement); 1803 1804 var popperOffsets = data.offsets.popper; 1805 var refOffsets = data.offsets.reference; 1806 1807 // using floor because the reference offsets may contain decimals we are not going to consider here 1808 var floor = Math.floor; 1809 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 1810 1811 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 1812 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 1813 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 1814 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 1815 1816 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 1817 1818 // flip the variation if required 1819 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 1820 1821 // flips variation if reference element overflows boundaries 1822 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 1823 1824 // flips variation if popper content overflows boundaries 1825 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 1826 1827 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 1828 1829 if (overlapsRef || overflowsBoundaries || flippedVariation) { 1830 // this boolean to detect any flip loop 1831 data.flipped = true; 1832 1833 if (overlapsRef || overflowsBoundaries) { 1834 placement = flipOrder[index + 1]; 1835 } 1836 1837 if (flippedVariation) { 1838 variation = getOppositeVariation(variation); 1839 } 1840 1841 data.placement = placement + (variation ? '-' + variation : ''); 1842 1843 // this object contains `position`, we want to preserve it along with 1844 // any additional property we may add in the future 1845 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 1846 1847 data = runModifiers(data.instance.modifiers, data, 'flip'); 1848 } 1849 }); 1850 return data; 1851} 1852 1853/** 1854 * @function 1855 * @memberof Modifiers 1856 * @argument {Object} data - The data object generated by update method 1857 * @argument {Object} options - Modifiers configuration and options 1858 * @returns {Object} The data object, properly modified 1859 */ 1860function keepTogether(data) { 1861 var _data$offsets = data.offsets, 1862 popper = _data$offsets.popper, 1863 reference = _data$offsets.reference; 1864 1865 var placement = data.placement.split('-')[0]; 1866 var floor = Math.floor; 1867 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 1868 var side = isVertical ? 'right' : 'bottom'; 1869 var opSide = isVertical ? 'left' : 'top'; 1870 var measurement = isVertical ? 'width' : 'height'; 1871 1872 if (popper[side] < floor(reference[opSide])) { 1873 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 1874 } 1875 if (popper[opSide] > floor(reference[side])) { 1876 data.offsets.popper[opSide] = floor(reference[side]); 1877 } 1878 1879 return data; 1880} 1881 1882/** 1883 * Converts a string containing value + unit into a px value number 1884 * @function 1885 * @memberof {modifiers~offset} 1886 * @private 1887 * @argument {String} str - Value + unit string 1888 * @argument {String} measurement - `height` or `width` 1889 * @argument {Object} popperOffsets 1890 * @argument {Object} referenceOffsets 1891 * @returns {Number|String} 1892 * Value in pixels, or original string if no values were extracted 1893 */ 1894function toValue(str, measurement, popperOffsets, referenceOffsets) { 1895 // separate value from unit 1896 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 1897 var value = +split[1]; 1898 var unit = split[2]; 1899 1900 // If it's not a number it's an operator, I guess 1901 if (!value) { 1902 return str; 1903 } 1904 1905 if (unit.indexOf('%') === 0) { 1906 var element = void 0; 1907 switch (unit) { 1908 case '%p': 1909 element = popperOffsets; 1910 break; 1911 case '%': 1912 case '%r': 1913 default: 1914 element = referenceOffsets; 1915 } 1916 1917 var rect = getClientRect(element); 1918 return rect[measurement] / 100 * value; 1919 } else if (unit === 'vh' || unit === 'vw') { 1920 // if is a vh or vw, we calculate the size based on the viewport 1921 var size = void 0; 1922 if (unit === 'vh') { 1923 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 1924 } else { 1925 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 1926 } 1927 return size / 100 * value; 1928 } else { 1929 // if is an explicit pixel unit, we get rid of the unit and keep the value 1930 // if is an implicit unit, it's px, and we return just the value 1931 return value; 1932 } 1933} 1934 1935/** 1936 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 1937 * @function 1938 * @memberof {modifiers~offset} 1939 * @private 1940 * @argument {String} offset 1941 * @argument {Object} popperOffsets 1942 * @argument {Object} referenceOffsets 1943 * @argument {String} basePlacement 1944 * @returns {Array} a two cells array with x and y offsets in numbers 1945 */ 1946function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 1947 var offsets = [0, 0]; 1948 1949 // Use height if placement is left or right and index is 0 otherwise use width 1950 // in this way the first offset will use an axis and the second one 1951 // will use the other one 1952 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 1953 1954 // Split the offset string to obtain a list of values and operands 1955 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 1956 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 1957 return frag.trim(); 1958 }); 1959 1960 // Detect if the offset string contains a pair of values or a single one 1961 // they could be separated by comma or space 1962 var divider = fragments.indexOf(find(fragments, function (frag) { 1963 return frag.search(/,|\s/) !== -1; 1964 })); 1965 1966 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 1967 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 1968 } 1969 1970 // If divider is found, we divide the list of values and operands to divide 1971 // them by ofset X and Y. 1972 var splitRegex = /\s*,\s*|\s+/; 1973 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 1974 1975 // Convert the values with units to absolute pixels to allow our computations 1976 ops = ops.map(function (op, index) { 1977 // Most of the units rely on the orientation of the popper 1978 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 1979 var mergeWithPrevious = false; 1980 return op 1981 // This aggregates any `+` or `-` sign that aren't considered operators 1982 // e.g.: 10 + +5 => [10, +, +5] 1983 .reduce(function (a, b) { 1984 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 1985 a[a.length - 1] = b; 1986 mergeWithPrevious = true; 1987 return a; 1988 } else if (mergeWithPrevious) { 1989 a[a.length - 1] += b; 1990 mergeWithPrevious = false; 1991 return a; 1992 } else { 1993 return a.concat(b); 1994 } 1995 }, []) 1996 // Here we convert the string values into number values (in px) 1997 .map(function (str) { 1998 return toValue(str, measurement, popperOffsets, referenceOffsets); 1999 }); 2000 }); 2001 2002 // Loop trough the offsets arrays and execute the operations 2003 ops.forEach(function (op, index) { 2004 op.forEach(function (frag, index2) { 2005 if (isNumeric(frag)) { 2006 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 2007 } 2008 }); 2009 }); 2010 return offsets; 2011} 2012 2013/** 2014 * @function 2015 * @memberof Modifiers 2016 * @argument {Object} data - The data object generated by update method 2017 * @argument {Object} options - Modifiers configuration and options 2018 * @argument {Number|String} options.offset=0 2019 * The offset value as described in the modifier description 2020 * @returns {Object} The data object, properly modified 2021 */ 2022function offset(data, _ref) { 2023 var offset = _ref.offset; 2024 var placement = data.placement, 2025 _data$offsets = data.offsets, 2026 popper = _data$offsets.popper, 2027 reference = _data$offsets.reference; 2028 2029 var basePlacement = placement.split('-')[0]; 2030 2031 var offsets = void 0; 2032 if (isNumeric(+offset)) { 2033 offsets = [+offset, 0]; 2034 } else { 2035 offsets = parseOffset(offset, popper, reference, basePlacement); 2036 } 2037 2038 if (basePlacement === 'left') { 2039 popper.top += offsets[0]; 2040 popper.left -= offsets[1]; 2041 } else if (basePlacement === 'right') { 2042 popper.top += offsets[0]; 2043 popper.left += offsets[1]; 2044 } else if (basePlacement === 'top') { 2045 popper.left += offsets[0]; 2046 popper.top -= offsets[1]; 2047 } else if (basePlacement === 'bottom') { 2048 popper.left += offsets[0]; 2049 popper.top += offsets[1]; 2050 } 2051 2052 data.popper = popper; 2053 return data; 2054} 2055 2056/** 2057 * @function 2058 * @memberof Modifiers 2059 * @argument {Object} data - The data object generated by `update` method 2060 * @argument {Object} options - Modifiers configuration and options 2061 * @returns {Object} The data object, properly modified 2062 */ 2063function preventOverflow(data, options) { 2064 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 2065 2066 // If offsetParent is the reference element, we really want to 2067 // go one step up and use the next offsetParent as reference to 2068 // avoid to make this modifier completely useless and look like broken 2069 if (data.instance.reference === boundariesElement) { 2070 boundariesElement = getOffsetParent(boundariesElement); 2071 } 2072 2073 // NOTE: DOM access here 2074 // resets the popper's position so that the document size can be calculated excluding 2075 // the size of the popper element itself 2076 var transformProp = getSupportedPropertyName('transform'); 2077 var popperStyles = data.instance.popper.style; // assignment to help minification 2078 var top = popperStyles.top, 2079 left = popperStyles.left, 2080 transform = popperStyles[transformProp]; 2081 2082 popperStyles.top = ''; 2083 popperStyles.left = ''; 2084 popperStyles[transformProp] = ''; 2085 2086 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 2087 2088 // NOTE: DOM access here 2089 // restores the original style properties after the offsets have been computed 2090 popperStyles.top = top; 2091 popperStyles.left = left; 2092 popperStyles[transformProp] = transform; 2093 2094 options.boundaries = boundaries; 2095 2096 var order = options.priority; 2097 var popper = data.offsets.popper; 2098 2099 var check = { 2100 primary: function primary(placement) { 2101 var value = popper[placement]; 2102 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 2103 value = Math.max(popper[placement], boundaries[placement]); 2104 } 2105 return defineProperty({}, placement, value); 2106 }, 2107 secondary: function secondary(placement) { 2108 var mainSide = placement === 'right' ? 'left' : 'top'; 2109 var value = popper[mainSide]; 2110 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 2111 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 2112 } 2113 return defineProperty({}, mainSide, value); 2114 } 2115 }; 2116 2117 order.forEach(function (placement) { 2118 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 2119 popper = _extends({}, popper, check[side](placement)); 2120 }); 2121 2122 data.offsets.popper = popper; 2123 2124 return data; 2125} 2126 2127/** 2128 * @function 2129 * @memberof Modifiers 2130 * @argument {Object} data - The data object generated by `update` method 2131 * @argument {Object} options - Modifiers configuration and options 2132 * @returns {Object} The data object, properly modified 2133 */ 2134function shift(data) { 2135 var placement = data.placement; 2136 var basePlacement = placement.split('-')[0]; 2137 var shiftvariation = placement.split('-')[1]; 2138 2139 // if shift shiftvariation is specified, run the modifier 2140 if (shiftvariation) { 2141 var _data$offsets = data.offsets, 2142 reference = _data$offsets.reference, 2143 popper = _data$offsets.popper; 2144 2145 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 2146 var side = isVertical ? 'left' : 'top'; 2147 var measurement = isVertical ? 'width' : 'height'; 2148 2149 var shiftOffsets = { 2150 start: defineProperty({}, side, reference[side]), 2151 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 2152 }; 2153 2154 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 2155 } 2156 2157 return data; 2158} 2159 2160/** 2161 * @function 2162 * @memberof Modifiers 2163 * @argument {Object} data - The data object generated by update method 2164 * @argument {Object} options - Modifiers configuration and options 2165 * @returns {Object} The data object, properly modified 2166 */ 2167function hide(data) { 2168 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 2169 return data; 2170 } 2171 2172 var refRect = data.offsets.reference; 2173 var bound = find(data.instance.modifiers, function (modifier) { 2174 return modifier.name === 'preventOverflow'; 2175 }).boundaries; 2176 2177 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 2178 // Avoid unnecessary DOM access if visibility hasn't changed 2179 if (data.hide === true) { 2180 return data; 2181 } 2182 2183 data.hide = true; 2184 data.attributes['x-out-of-boundaries'] = ''; 2185 } else { 2186 // Avoid unnecessary DOM access if visibility hasn't changed 2187 if (data.hide === false) { 2188 return data; 2189 } 2190 2191 data.hide = false; 2192 data.attributes['x-out-of-boundaries'] = false; 2193 } 2194 2195 return data; 2196} 2197 2198/** 2199 * @function 2200 * @memberof Modifiers 2201 * @argument {Object} data - The data object generated by `update` method 2202 * @argument {Object} options - Modifiers configuration and options 2203 * @returns {Object} The data object, properly modified 2204 */ 2205function inner(data) { 2206 var placement = data.placement; 2207 var basePlacement = placement.split('-')[0]; 2208 var _data$offsets = data.offsets, 2209 popper = _data$offsets.popper, 2210 reference = _data$offsets.reference; 2211 2212 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 2213 2214 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 2215 2216 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 2217 2218 data.placement = getOppositePlacement(placement); 2219 data.offsets.popper = getClientRect(popper); 2220 2221 return data; 2222} 2223 2224/** 2225 * Modifier function, each modifier can have a function of this type assigned 2226 * to its `fn` property.<br /> 2227 * These functions will be called on each update, this means that you must 2228 * make sure they are performant enough to avoid performance bottlenecks. 2229 * 2230 * @function ModifierFn 2231 * @argument {dataObject} data - The data object generated by `update` method 2232 * @argument {Object} options - Modifiers configuration and options 2233 * @returns {dataObject} The data object, properly modified 2234 */ 2235 2236/** 2237 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 2238 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 2239 * needed by the library. 2240 * 2241 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 2242 * All the other properties are configurations that could be tweaked. 2243 * @namespace modifiers 2244 */ 2245var modifiers = { 2246 /** 2247 * Modifier used to shift the popper on the start or end of its reference 2248 * element.<br /> 2249 * It will read the variation of the `placement` property.<br /> 2250 * It can be one either `-end` or `-start`. 2251 * @memberof modifiers 2252 * @inner 2253 */ 2254 shift: { 2255 /** @prop {number} order=100 - Index used to define the order of execution */ 2256 order: 100, 2257 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2258 enabled: true, 2259 /** @prop {ModifierFn} */ 2260 fn: shift 2261 }, 2262 2263 /** 2264 * The `offset` modifier can shift your popper on both its axis. 2265 * 2266 * It accepts the following units: 2267 * - `px` or unit-less, interpreted as pixels 2268 * - `%` or `%r`, percentage relative to the length of the reference element 2269 * - `%p`, percentage relative to the length of the popper element 2270 * - `vw`, CSS viewport width unit 2271 * - `vh`, CSS viewport height unit 2272 * 2273 * For length is intended the main axis relative to the placement of the popper.<br /> 2274 * This means that if the placement is `top` or `bottom`, the length will be the 2275 * `width`. In case of `left` or `right`, it will be the `height`. 2276 * 2277 * You can provide a single value (as `Number` or `String`), or a pair of values 2278 * as `String` divided by a comma or one (or more) white space
vendor: 9,957 bytes, lines 2278-2550
2278s.<br /> 2279 * The latter is a deprecated method because it leads to confusion and will be 2280 * removed in v2.<br /> 2281 * Additionally, it accepts additions and subtractions between different units. 2282 * Note that multiplications and divisions aren't supported. 2283 * 2284 * Valid examples are: 2285 * ``` 2286 * 10 2287 * '10%' 2288 * '10, 10' 2289 * '10%, 10' 2290 * '10 + 10%' 2291 * '10 - 5vh + 3%' 2292 * '-10px + 5vh, 5px - 6%' 2293 * ``` 2294 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 2295 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 2296 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 2297 * 2298 * @memberof modifiers 2299 * @inner 2300 */ 2301 offset: { 2302 /** @prop {number} order=200 - Index used to define the order of execution */ 2303 order: 200, 2304 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2305 enabled: true, 2306 /** @prop {ModifierFn} */ 2307 fn: offset, 2308 /** @prop {Number|String} offset=0 2309 * The offset value as described in the modifier description 2310 */ 2311 offset: 0 2312 }, 2313 2314 /** 2315 * Modifier used to prevent the popper from being positioned outside the boundary. 2316 * 2317 * A scenario exists where the reference itself is not within the boundaries.<br /> 2318 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 2319 * In this case we need to decide whether the popper should either: 2320 * 2321 * - detach from the reference and remain "trapped" in the boundaries, or 2322 * - if it should ignore the boundary and "escape with its reference" 2323 * 2324 * When `escapeWithReference` is set to`true` and reference is completely 2325 * outside its boundaries, the popper will overflow (or completely leave) 2326 * the boundaries in order to remain attached to the edge of the reference. 2327 * 2328 * @memberof modifiers 2329 * @inner 2330 */ 2331 preventOverflow: { 2332 /** @prop {number} order=300 - Index used to define the order of execution */ 2333 order: 300, 2334 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2335 enabled: true, 2336 /** @prop {ModifierFn} */ 2337 fn: preventOverflow, 2338 /** 2339 * @prop {Array} [priority=['left','right','top','bottom']] 2340 * Popper will try to prevent overflow following these priorities by default, 2341 * then, it could overflow on the left and on top of the `boundariesElement` 2342 */ 2343 priority: ['left', 'right', 'top', 'bottom'], 2344 /** 2345 * @prop {number} padding=5 2346 * Amount of pixel used to define a minimum distance between the boundaries 2347 * and the popper. This makes sure the popper always has a little padding 2348 * between the edges of its container 2349 */ 2350 padding: 5, 2351 /** 2352 * @prop {String|HTMLElement} boundariesElement='scrollParent' 2353 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 2354 * `viewport` or any DOM element. 2355 */ 2356 boundariesElement: 'scrollParent' 2357 }, 2358 2359 /** 2360 * Modifier used to make sure the reference and its popper stay near each other 2361 * without leaving any gap between the two. Especially useful when the arrow is 2362 * enabled and you want to ensure that it points to its reference element. 2363 * It cares only about the first axis. You can still have poppers with margin 2364 * between the popper and its reference element. 2365 * @memberof modifiers 2366 * @inner 2367 */ 2368 keepTogether: { 2369 /** @prop {number} order=400 - Index used to define the order of execution */ 2370 order: 400, 2371 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2372 enabled: true, 2373 /** @prop {ModifierFn} */ 2374 fn: keepTogether 2375 }, 2376 2377 /** 2378 * This modifier is used to move the `arrowElement` of the popper to make 2379 * sure it is positioned between the reference element and its popper element. 2380 * It will read the outer size of the `arrowElement` node to detect how many 2381 * pixels of conjunction are needed. 2382 * 2383 * It has no effect if no `arrowElement` is provided. 2384 * @memberof modifiers 2385 * @inner 2386 */ 2387 arrow: { 2388 /** @prop {number} order=500 - Index used to define the order of execution */ 2389 order: 500, 2390 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2391 enabled: true, 2392 /** @prop {ModifierFn} */ 2393 fn: arrow, 2394 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 2395 element: '[x-arrow]' 2396 }, 2397 2398 /** 2399 * Modifier used to flip the popper's placement when it starts to overlap its 2400 * reference element. 2401 * 2402 * Requires the `preventOverflow` modifier before it in order to work. 2403 * 2404 * **NOTE:** this modifier will interrupt the current update cycle and will 2405 * restart it if it detects the need to flip the placement. 2406 * @memberof modifiers 2407 * @inner 2408 */ 2409 flip: { 2410 /** @prop {number} order=600 - Index used to define the order of execution */ 2411 order: 600, 2412 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2413 enabled: true, 2414 /** @prop {ModifierFn} */ 2415 fn: flip, 2416 /** 2417 * @prop {String|Array} behavior='flip' 2418 * The behavior used to change the popper's placement. It can be one of 2419 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 2420 * placements (with optional variations) 2421 */ 2422 behavior: 'flip', 2423 /** 2424 * @prop {number} padding=5 2425 * The popper will flip if it hits the edges of the `boundariesElement` 2426 */ 2427 padding: 5, 2428 /** 2429 * @prop {String|HTMLElement} boundariesElement='viewport' 2430 * The element which will define the boundaries of the popper position. 2431 * The popper will never be placed outside of the defined boundaries 2432 * (except if `keepTogether` is enabled) 2433 */ 2434 boundariesElement: 'viewport', 2435 /** 2436 * @prop {Boolean} flipVariations=false 2437 * The popper will switch placement variation between `-start` and `-end` when 2438 * the reference element overlaps its boundaries. 2439 * 2440 * The original placement should have a set variation. 2441 */ 2442 flipVariations: false, 2443 /** 2444 * @prop {Boolean} flipVariationsByContent=false 2445 * The popper will switch placement variation between `-start` and `-end` when 2446 * the popper element overlaps its reference boundaries. 2447 * 2448 * The original placement should have a set variation. 2449 */ 2450 flipVariationsByContent: false 2451 }, 2452 2453 /** 2454 * Modifier used to make the popper flow toward the inner of the reference element. 2455 * By default, when this modifier is disabled, the popper will be placed outside 2456 * the reference element. 2457 * @memberof modifiers 2458 * @inner 2459 */ 2460 inner: { 2461 /** @prop {number} order=700 - Index used to define the order of execution */ 2462 order: 700, 2463 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 2464 enabled: false, 2465 /** @prop {ModifierFn} */ 2466 fn: inner 2467 }, 2468 2469 /** 2470 * Modifier used to hide the popper when its reference element is outside of the 2471 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 2472 * be used to hide with a CSS selector the popper when its reference is 2473 * out of boundaries. 2474 * 2475 * Requires the `preventOverflow` modifier before it in order to work. 2476 * @memberof modifiers 2477 * @inner 2478 */ 2479 hide: { 2480 /** @prop {number} order=800 - Index used to define the order of execution */ 2481 order: 800, 2482 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2483 enabled: true, 2484 /** @prop {ModifierFn} */ 2485 fn: hide 2486 }, 2487 2488 /** 2489 * Computes the style that will be applied to the popper element to gets 2490 * properly positioned. 2491 * 2492 * Note that this modifier will not touch the DOM, it just prepares the styles 2493 * so that `applyStyle` modifier can apply it. This separation is useful 2494 * in case you need to replace `applyStyle` with a custom implementation. 2495 * 2496 * This modifier has `850` as `order` value to maintain backward compatibility 2497 * with previous versions of Popper.js. Expect the modifiers ordering method 2498 * to change in future major versions of the library. 2499 * 2500 * @memberof modifiers 2501 * @inner 2502 */ 2503 computeStyle: { 2504 /** @prop {number} order=850 - Index used to define the order of execution */ 2505 order: 850, 2506 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2507 enabled: true, 2508 /** @prop {ModifierFn} */ 2509 fn: computeStyle, 2510 /** 2511 * @prop {Boolean} gpuAcceleration=true 2512 * If true, it uses the CSS 3D transformation to position the popper. 2513 * Otherwise, it will use the `top` and `left` properties 2514 */ 2515 gpuAcceleration: true, 2516 /** 2517 * @prop {string} [x='bottom'] 2518 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 2519 * Change this if your popper should grow in a direction different from `bottom` 2520 */ 2521 x: 'bottom', 2522 /** 2523 * @prop {string} [x='left'] 2524 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 2525 * Change this if your popper should grow in a direction different from `right` 2526 */ 2527 y: 'right' 2528 }, 2529 2530 /** 2531 * Applies the computed styles to the popper element. 2532 * 2533 * All the DOM manipulations are limited to this modifier. This is useful in case 2534 * you want to integrate Popper.js inside a framework or view library and you 2535 * want to delegate all the DOM manipulations to it. 2536 * 2537 * Note that if you disable this modifier, you must make sure the popper element 2538 * has its position set to `absolute` before Popper.js can do its work! 2539 * 2540 * Just disable this modifier and define your own to achieve the desired effect. 2541 * 2542 * @memberof modifiers 2543 * @inner 2544 */ 2545 applyStyle: { 2546 /** @prop {number} order=900 - Index used to define the order of execution */ 2547 order: 900, 2548 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 2549 enabled: true, 2550 /** @prop {ModifierFn} */
vendor: 9,127 bytes, lines 2551-2815
2551 fn: applyStyle, 2552 /** @prop {Function} */ 2553 onLoad: applyStyleOnLoad, 2554 /** 2555 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 2556 * @prop {Boolean} gpuAcceleration=true 2557 * If true, it uses the CSS 3D transformation to position the popper. 2558 * Otherwise, it will use the `top` and `left` properties 2559 */ 2560 gpuAcceleration: undefined 2561 } 2562}; 2563 2564/** 2565 * The `dataObject` is an object containing all the information used by Popper.js. 2566 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 2567 * @name dataObject 2568 * @property {Object} data.instance The Popper.js instance 2569 * @property {String} data.placement Placement applied to popper 2570 * @property {String} data.originalPlacement Placement originally defined on init 2571 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 2572 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 2573 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 2574 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 2575 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 2576 * @property {Object} data.boundaries Offsets of the popper boundaries 2577 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 2578 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 2579 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 2580 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 2581 */ 2582 2583/** 2584 * Default options provided to Popper.js constructor.<br /> 2585 * These can be overridden using the `options` argument of Popper.js.<br /> 2586 * To override an option, simply pass an object with the same 2587 * structure of the `options` object, as the 3rd argument. For example: 2588 * ``` 2589 * new Popper(ref, pop, { 2590 * modifiers: { 2591 * preventOverflow: { enabled: false } 2592 * } 2593 * }) 2594 * ``` 2595 * @type {Object} 2596 * @static 2597 * @memberof Popper 2598 */ 2599var Defaults = { 2600 /** 2601 * Popper's placement. 2602 * @prop {Popper.placements} placement='bottom' 2603 */ 2604 placement: 'bottom', 2605 2606 /** 2607 * Set this to true if you want popper to position it self in 'fixed' mode 2608 * @prop {Boolean} positionFixed=false 2609 */ 2610 positionFixed: false, 2611 2612 /** 2613 * Whether events (resize, scroll) are initially enabled. 2614 * @prop {Boolean} eventsEnabled=true 2615 */ 2616 eventsEnabled: true, 2617 2618 /** 2619 * Set to true if you want to automatically remove the popper when 2620 * you call the `destroy` method. 2621 * @prop {Boolean} removeOnDestroy=false 2622 */ 2623 removeOnDestroy: false, 2624 2625 /** 2626 * Callback called when the popper is created.<br /> 2627 * By default, it is set to no-op.<br /> 2628 * Access Popper.js instance with `data.instance`. 2629 * @prop {onCreate} 2630 */ 2631 onCreate: function onCreate() {}, 2632 2633 /** 2634 * Callback called when the popper is updated. This callback is not called 2635 * on the initialization/creation of the popper, but only on subsequent 2636 * updates.<br /> 2637 * By default, it is set to no-op.<br /> 2638 * Access Popper.js instance with `data.instance`. 2639 * @prop {onUpdate} 2640 */ 2641 onUpdate: function onUpdate() {}, 2642 2643 /** 2644 * List of modifiers used to modify the offsets before they are applied to the popper. 2645 * They provide most of the functionalities of Popper.js. 2646 * @prop {modifiers} 2647 */ 2648 modifiers: modifiers 2649}; 2650 2651/** 2652 * @callback onCreate 2653 * @param {dataObject} data 2654 */ 2655 2656/** 2657 * @callback onUpdate 2658 * @param {dataObject} data 2659 */ 2660 2661// Utils 2662// Methods 2663var Popper = function () { 2664 /** 2665 * Creates a new Popper.js instance. 2666 * @class Popper 2667 * @param {Element|referenceObject} reference - The reference element used to position the popper 2668 * @param {Element} popper - The HTML / XML element used as the popper 2669 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 2670 * @return {Object} instance - The generated Popper.js instance 2671 */ 2672 function Popper(reference, popper) { 2673 var _this = this; 2674 2675 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 2676 classCallCheck(this, Popper); 2677 2678 this.scheduleUpdate = function () { 2679 return requestAnimationFrame(_this.update); 2680 }; 2681 2682 // make update() debounced, so that it only runs at most once-per-tick 2683 this.update = debounce(this.update.bind(this)); 2684 2685 // with {} we create a new object with the options inside it 2686 this.options = _extends({}, Popper.Defaults, options); 2687 2688 // init state 2689 this.state = { 2690 isDestroyed: false, 2691 isCreated: false, 2692 scrollParents: [] 2693 }; 2694 2695 // get reference and popper elements (allow jQuery wrappers) 2696 this.reference = reference && reference.jquery ? reference[0] : reference; 2697 this.popper = popper && popper.jquery ? popper[0] : popper; 2698 2699 // Deep merge modifiers options 2700 this.options.modifiers = {}; 2701 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 2702 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 2703 }); 2704 2705 // Refactoring modifiers' list (Object => Array) 2706 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 2707 return _extends({ 2708 name: name 2709 }, _this.options.modifiers[name]); 2710 }) 2711 // sort the modifiers by order 2712 .sort(function (a, b) { 2713 return a.order - b.order; 2714 }); 2715 2716 // modifiers have the ability to execute arbitrary code when Popper.js get inited 2717 // such code is executed in the same order of its modifier 2718 // they could add new properties to their options configuration 2719 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 2720 this.modifiers.forEach(function (modifierOptions) { 2721 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 2722 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 2723 } 2724 }); 2725 2726 // fire the first update to position the popper in the right place 2727 this.update(); 2728 2729 var eventsEnabled = this.options.eventsEnabled; 2730 if (eventsEnabled) { 2731 // setup event listeners, they will take care of update the position in specific situations 2732 this.enableEventListeners(); 2733 } 2734 2735 this.state.eventsEnabled = eventsEnabled; 2736 } 2737 2738 // We can't use class properties because they don't get listed in the 2739 // class prototype and break stuff like Sinon stubs 2740 2741 2742 createClass(Popper, [{ 2743 key: 'update', 2744 value: function update$$1() { 2745 return update.call(this); 2746 } 2747 }, { 2748 key: 'destroy', 2749 value: function destroy$$1() { 2750 return destroy.call(this); 2751 } 2752 }, { 2753 key: 'enableEventListeners', 2754 value: function enableEventListeners$$1() { 2755 return enableEventListeners.call(this); 2756 } 2757 }, { 2758 key: 'disableEventListeners', 2759 value: function disableEventListeners$$1() { 2760 return disableEventListeners.call(this); 2761 } 2762 2763 /** 2764 * Schedules an update. It will run on the next UI update available. 2765 * @method scheduleUpdate 2766 * @memberof Popper 2767 */ 2768 2769 2770 /** 2771 * Collection of utilities useful when writing custom modifiers. 2772 * Starting from version 1.7, this method is available only if you 2773 * include `popper-utils.js` before `popper.js`. 2774 * 2775 * **DEPRECATION**: This way to access PopperUtils is deprecated 2776 * and will be removed in v2! Use the PopperUtils module directly instead. 2777 * Due to the high instability of the methods contained in Utils, we can't 2778 * guarantee them to follow semver. Use them at your own risk! 2779 * @static 2780 * @private 2781 * @type {Object} 2782 * @deprecated since version 1.8 2783 * @member Utils 2784 * @memberof Popper 2785 */ 2786 2787 }]); 2788 return Popper; 2789}(); 2790 2791/** 2792 * The `referenceObject` is an object that provides an interface compatible with Popper.js 2793 * and lets you use it as replacement of a real DOM node.<br /> 2794 * You can use this method to position a popper relatively to a set of coordinates 2795 * in case you don't have a DOM node to use as reference. 2796 * 2797 * ``` 2798 * new Popper(referenceObject, popperNode); 2799 * ``` 2800 * 2801 * NB: This feature isn't supported in Internet Explorer 10. 2802 * @name referenceObject 2803 * @property {Function} data.getBoundingClientRect 2804 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 2805 * @property {number} data.clientWidth 2806 * An ES6 getter that will return the width of the virtual reference element. 2807 * @property {number} data.clientHeight 2808 * An ES6 getter that will return the height of the virtual reference element. 2809 */ 2810 2811 2812Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 2813Popper.placements = placements; 2814Popper.Defaults = Defaults; 2815
2816return Popper; 2817 2818}))); 2819 2820 2821}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 2822},{}],12:[function(require,module,exports){ 2823"use strict"; 2824 2825Object.defineProperty(exports, "__esModule", { 2826 value: true 2827}); 2828exports.getGdpcEndpointCall = getGdpcEndpointCall; 2829exports.getLocalePath = getLocalePath; 2830exports.otAllowFunctionalCookies = otAllowFunctionalCookies; 2831exports.otAllowPerformanceCookies = otAllowPerformanceCookies; 2832exports.otAllowSocialMediaCookies = otAllowSocialMediaCookies; 2833exports.otAllowTargetingCookies = otAllowTargetingCookies; 2834exports.otGeoData = otGeoData; 2835exports.otWhenGroupsUpdated = otWhenGroupsUpdated; 2836var getRegion = require('ilmn/getRegion'); 2837var getLocale = require('ilmn/getLocale'); 2838function isLocalhost() { 2839 return window.location.hostname.indexOf('localhost') !== -1; 2840} 2841function otAllowPerformanceCookies() { 2842 return window.OnetrustActiveGroups.indexOf('C0002') !== -1; 2843} 2844function otAllowFunctionalCookies() { 2845 return window.OnetrustActiveGroups.indexOf('C0003') !== -1; 2846} 2847function otAllowTargetingCookies() { 2848 return window.OnetrustActiveGroups.indexOf('C0004') !== -1; 2849} 2850function otAllowSocialMediaCookies() { 2851 return window.OnetrustActiveGroups.indexOf('C0005') !== -1; 2852} 2853function otGeoData() { 2854 if (window.OneTrust) { 2855 return window.OneTrust.getGeolocationData(); 2856 } 2857} 2858function getLocalePath() { 2859 var localePath = ''; 2860 if (isLocalhost()) { 2861 localePath = 'amr/en_US'; 2862 if (getRegion() && getLocale()) { 2863 localePath = getRegion() + '/' + getLocale(); 2864 } 2865 } 2866 return localePath; 2867} 2868function getGdpcEndpointCall(type) { 2869 var _window$ecommerce; 2870 // make AJAX call and get data for Banner 2871 var hostname = 'https://www.illumina.com'; 2872 var localePath = getLocalePath(); 2873 var gdpcWebsites = ['www.sparkgen.com', 'community.illumina.com', 'www.genomicsforgood.com', /* lower enviros */ 2874 'sparkgen.val-web.illumina.com', 'genomicsforgood.val-web.illumina.com', 'etp.val-web.illumina.com', 'jpetp.val-web.illumina.com', 'emeaetp.val-web.illumina.com', 'sapacetp.val-web.illumina.com', 'www1.val-web.illumina.com.cn', 'www.tst-web.illumina.com', 'etp.tst-web.illumina.com', 'dcp.tst-web.illumina.com', 'etp2.tst-web.illumina.com', 'etp.stg-web.illumina.com', 'www.stg-web.illumina.com', 'www.dev-web.illumina.com', 'etp.dev-web.illumina.com', 'www1.tst-web.illumina.com', 'www1.stage-web.illumina.com', 'www1.val-npweb.illumina.com', 'emea1.val-npweb.illumina.com', 'sapac1.val-npweb.illumina.com', 'jp1.val-npweb.illumina.com', 'support1.val-npweb.illumina.com']; 2875 if (isLocalhost()) { 2876 hostname = ''; 2877 localePath = ''; 2878 } else if (typeof window.__aemServerHost !== 'undefined') { 2879 // only exists in WCS 2880 hostname = window.__aemServerHost; 2881 } else if (window.location.href.indexOf('/company/video-hub/') !== -1 || window.location.href.indexOf('/destination/') !== -1 || window.location.href.indexOf('/landing/') !== -1) { 2882 // solves for destination pages 2883 hostname = location.protocol + '//' + location.hostname; 2884 } else if ((_window$ecommerce = window.ecommerce) !== null && _window$ecommerce !== void 0 && (_window$ecommerce = _window$ecommerce.config) !== null && _window$ecommerce !== void 0 && _window$ecommerce.aemHostName) { 2885 // only for AEM env that has megamenu. 2886 hostname = window.ecommerce.config.aemHostName; 2887 } else if (gdpcWebsites.indexOf(window.location.hostname) !== -1) { 2888 // only for the other websites 2889 hostname = location.protocol + '//' + location.hostname; 2890 } else if (window.location.hostname === "tst.mi.ep-np.illumina.com") { 2891 hostname = location.protocol + '//' + "dcp.tst-web.illumina.com"; 2892 } else if (window.location.hostname === "dev.mi.ep-np.illumina.com") { 2893 hostname = location.protocol + '//' + "www2.dev-web.illumina.com"; 2894 } else if (window.location.hostname === "stg.mi.ep-np.illumina.com") { 2895 hostname = location.protocol + '//' + "www.stg-web.illumina.com"; 2896 } else if (window.location.hostname.indexOf("cpc.ep-np.illumina.com") !== -1) { 2897 hostname = location.protocol + '//' + "dcp.tst-web.illumina.com"; 2898 } 2899 return hostname + '/bin/gdpc/banners?type=' + type + '&localePath=' + localePath; 2900} 2901function otWhenGroupsUpdated(callback) { 2902 callback = typeof callback === 'function' ? callback : function () {}; 2903 var isUpdated = false;
2904 if (window.dataLayer) { 2905 window.dataLayer.forEach(function (item) { 2906 if (item.event === 'OneTrustGroupsUpdated') { 2907 isUpdated = true; 2908 } 2909 }); 2910 if (isUpdated) { 2911 callback(); 2912 } else { 2913 window.addEventListener('OneTrustGroupsUpdated', callback); 2914 } 2915 } else { 2916 console.error('dataLayer object does not exist'); 2917 } 2918} 2919 2920},{"ilmn/getLocale":8,"ilmn/getRegion":9}],13:[function(require,module,exports){ 2921"use strict"; 2922 2923var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 2924var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 2925var browserDetect = require('../../../sniffer/js/browserDetect'); 2926var appHelper = window.appHelper = module.exports = { 2927 init: function init() { 2928 appHelper.vars.aemhref = window.location.href; 2929 appHelper.vars.aemhost = window.location.hostname; 2930 }, 2931 region: function region() { 2932 var aemhost = appHelper.vars.aemhref; 2933 var region = 'global'; 2934 if (aemhost.indexOf("illumina.com.cn") > -1 || aemhost.indexOf("apac/zh_CN") > -1) { 2935 region = 'china'; 2936 } else if (aemhost.indexOf("jp.illumina.com") > -1 || aemhost.indexOf("jp.support.illumina.com") > -1 || aemhost.indexOf("apac/ja_JP") > -1) { 2937 region = 'japan'; 2938 } else if (aemhost.indexOf("sapac.illumina.com") > -1 || aemhost.indexOf("sapac.support.illumina.com") > -1 || aemhost.indexOf("spac/en_AU") > -1) { 2939 region = 'sapac'; 2940 } else if (aemhost.indexOf("emea.illumina.com") > -1 || aemhost.indexOf("emea.support.illumina.com") > -1 || aemhost.indexOf("emea/en_GB") > -1 || aemhost.indexOf("emeaetp.val-web.illumina.com/") > -1) { 2941 region = 'emea'; 2942 } else if (aemhost.indexOf("sparkgen.com") > -1 || aemhost.indexOf("sparkgen.val-web") > -1 || aemhost.indexOf("/content/sparkgen") > -1) { 2943 region = 'sparkgen'; 2944 } 2945 return region; 2946 }, 2947 getRegionLocale: function getRegionLocale() { 2948 var _document$querySelect, _document$querySelect2; 2949 // this logic currently does not account for support site /us/en vs /en 2950 var metaRegion = (_document$querySelect = document.querySelector('meta[name="region"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content; 2951 var metaLocale = (_document$querySelect2 = document.querySelector('meta[name="locale"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content; 2952 var finalLocale = "/en"; 2953 if (metaRegion && metaLocale) { 2954 finalLocale = "/" + metaRegion + "/" + metaLocale; 2955 } 2956 return finalLocale; 2957 }, 2958 dataRegion: function dataRegion() { 2959 var hostname = window.location.hostname, 2960 dataRegion, 2961 isSupportSite; 2962 switch (hostname) { 2963 case 'www.illumina.com': 2964 dataRegion = '/amr/en_US'; 2965 break; 2966 case 'support.illumina.com': 2967 dataRegion = '/us/en/support'; 2968 isSupportSite = true; 2969 break; 2970 case 'www.illumina.com.cn': 2971 dataRegion = '/apac/zh_CN'; 2972 break; 2973 case 'support.illumina.com.cn': 2974 dataRegion = '/apac/zh_CN/support'; 2975 isSupportSite = true; 2976 break; 2977 case 'jp.illumina.com': 2978 dataRegion = '/apac/ja_JP'; 2979 break; 2980 case 'jp.support.illumina.com': 2981 dataRegion = '/apac/ja_JP/support'; 2982 isSupportSite = true; 2983 break; 2984 case 'emea.illumina.com': 2985 dataRegion = '/emea/en_GB'; 2986 break; 2987 case 'emea.support.illumina.com': 2988 dataRegion = '/us/en/support'; 2989 isSupportSite = true; 2990 break; 2991 case 'sapac.illumina.com': 2992 dataRegion = '/spac/en_AU'; 2993 break; 2994 case 'sapac.support.illumina.com': 2995 dataRegion = '/us/en/support'; 2996 isSupportSite = true; 2997 break; 2998 default: 2999 dataRegion = '/en'; 3000 isSupportSite = window.location.href.indexOf('illumina-support') > -1; 3001 } 3002 var props = { 3003 'dataRegion': dataRegion, 3004 'isSupportSite': isSupportSite 3005 }; 3006 return props; 3007 }, 3008 env: function env() { 3009 var aemhost = appHelper.vars.aemhost; 3010 var env = 'localhost';
3011 Object.entries(appHelper.vars.envs).forEach(function (_ref) { 3012 var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 3013 key = _ref2[0], 3014 value = _ref2[1]; 3015 if (value.includes(aemhost)) { 3016 env = String(key).replace(/([A-Z])/g, function (partialString) { 3017 return "-" + partialString.toLowerCase(); 3018 }); 3019 } 3020 }); 3021 return env; 3022 }, 3023 getURL: function getURL() { 3024 var url = window.location.href, 3025 arr = url.split("/"), 3026 result = arr[0] + "//" + arr[2]; 3027 return result; 3028 }, 3029 guid: function guid() { 3030 function s4() { 3031 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 3032 } 3033 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); 3034 }, 3035 isIE: function isIE() { 3036 if (browserDetect.browser.indexOf('IE') > -1) { 3037 return true; 3038 } else { 3039 return false; 3040 } 3041 }, 3042 isMobile: function isMobile() { 3043 var mobile = false; 3044 (function (a) { 3045 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) mobile = true; 3046 })(navigator.userAgent || navigator.vendor || window.opera); 3047 return mobile; 3048 }, 3049 vars: { 3050 aemhref: null, 3051 aemhost: null, 3052 envs: { 3053 prodPublish: ['www.illumina.com.cn', 'illumina.com.cn', 'jp.illumina.com', 'sapac.illumina.com', 'emea.illumina.com', 'www.illumina.com', 'support.illumina.com.cn', 'jp.support.illumina.com', 'sapac.support.illumina.com', 'emea.support.illumina.com', 'support.illumina.com'], 3054 prodAuthor: ['prod-author.illumina.com'], 3055 stagePublish: ['www.stg-web.illumina.com'], 3056 stageAuthor: ['stage-author.illumina.com'], 3057 etpTest: ['etp.tst-web.illumina.com'], 3058 etpVal: ['etp.val-web.illumina.com', 'emeaetp.val-web.illumina.com'] 3059 } 3060 } 3061}; 3062appHelper.init(); 3063 3064},{"../../../sniffer/js/browserDetect":14,"@babel/runtime/helpers/interopRequireDefault":3,"@babel/runtime/helpers/slicedToArray":6}],14:[function(require,module,exports){ 3065"use strict"; 3066 3067var uaTestStrings = require('./uaTestStrings'); 3068var browserDetect = window.browserDetect = module.exports = { 3069 init: function init() { 3070 this.detectBrowser(navigator.userAgent); 3071 3072 // uncomment to print test cases to console 3073 // this.testBrowserDetection(); 3074 }, 3075 detectBrowser: function detectBrowser(uaString) { 3076 // Edge (legacy) 3077 if (uaString.indexOf('Edge/') > -1) { 3078 this.browser = 'Edge'; 3079 this.version = uaString.match(/Edge\/([^.]+)/)[1]; 3080 } 3081 // Edge (Chromium) 3082 else if (uaString.indexOf('Edg/') > -1) { 3083 this.browser = 'Edge'; 3084 this.version = uaString.match(/Edg\/([^.]+)/)[1]; 3085 } else if (uaString.indexOf('WOW64') > -1) { 3086 // IE 9/10 3087 if (uaString.indexOf('MSIE') > -1) { 3088 this.browser = 'IE'; 3089 this.version = '9/10'; 3090 // IE 11 3091 } else if (uaString.indexOf('rv:11') > -1) { 3092 this.browser = 'IE'; 3093 this.version = '11'; 3094 } 3095 } 3096 // Firefox 3097 else if (uaString.indexOf('Firefox') > -1) { 3098 this.browser = 'Firefox'; 3099 this.version = uaString.match(/Firefox\/([^.]+)/)[1]; 3100 } else if (uaString.indexOf('Safari') > -1) { 3101 // Chrome + Brave 3102 if (uaString.indexOf('Chrome') > -1) { 3103 this.browser = 'Chrome'; 3104 this.version = uaString.match(/Chrome\/([^.]+)/)[1]; 3105 } else { 3106 // Safari (iPhone) 3107 if (uaString.indexOf('iPhone') > -1) { 3108 this.browser = '(iPhone/iPod) Safari'; 3109 // Safari (iPad) 3110 } else if (uaString.indexOf('iPad') > -1) { 3111 this.browser = '(iPad) Safari'; 3112 // Safari (desktop) 3113 } else {
3114 this.browser = 'Safari'; 3115 } 3116 this.version = uaString.match(/Version\/([^.]+)/)[1]; 3117 } 3118 } 3119 return this.browser + ' ' + this.version; 3120 }, 3121 testBrowserDetection: function testBrowserDetection() { 3122 console.log('current UA string: ' + navigator.userAgent); 3123 for (var i = 0; i < uaTestStrings.length; i++) { 3124 var uaString = uaTestStrings[i].string; 3125 var expectedResult = uaTestStrings[i].output; 3126 console.log('Expected: ' + expectedResult + '\n' + 'Actual: ' + this.detectBrowser(uaString)); 3127 } 3128 } 3129}; 3130 3131},{"./uaTestStrings":15}],15:[function(require,module,exports){ 3132"use strict"; 3133 3134var uaTestStrings = [{ 3135 output: 'Edge 14', 3136 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393' 3137}, { 3138 output: 'Edge 16', 3139 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299' 3140}, { 3141 output: 'Edge 17', 3142 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' 3143}, { 3144 output: 'Edge 18', 3145 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363' 3146}, { 3147 output: 'Edge 80', 3148 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36 Edg/80.0.361.56' 3149}, { 3150 output: 'IE 9', 3151 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 3152}, { 3153 output: 'IE 10', 3154 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 3155}, { 3156 output: 'IE 11', 3157 string: 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko' 3158}, { 3159 output: 'Firefox 50', 3160 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0' 3161}, { 3162 output: 'Firefox 65', 3163 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0' 3164}, { 3165 output: 'Firefox 69', 3166 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0' 3167}, { 3168 output: 'Firefox 70', 3169 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0' 3170}, { 3171 output: 'Firefox 83', 3172 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0' 3173}, { 3174 output: 'Chrome 50', 3175 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36' 3176}, { 3177 output: 'Chrome 69', 3178 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36' 3179}, { 3180 output: 'Chrome 70', 3181 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36' 3182}, { 3183 output: 'Chrome 83', 3184 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' 3185}, { 3186 output: 'Safari 8', 3187 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9' 3188}, { 3189 output: 'Safari 9', 3190 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/601.7.8' 3191}, { 3192 output: 'Safari 10', 3193 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8' 3194}, { 3195 output: 'Safari 11', 3196 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15' 3197}, { 3198 output: 'Safari 12', 3199 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15' 3200}, { 3201 output: 'Safari 13', 3202 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15' 3203}, { 3204 output: 'Safari 14', 3205 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 3206}, { 3207 output: 'Chrome 87', 3208 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' 3209}, { 3210 output: 'Firefox 83', 3211 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0' 3212}, 3213// { 3214// output: 'Brave 1', 3215// string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36]' 3216// }, 3217{ 3218 output: '(iPhone/iPod) Safari 12', 3219 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 3220}, { 3221 output: '(iPhone/iPod) Safari 14', 3222 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1' 3223}, { 3224 output: '(iPad) Safari 12', 3225 string: 'Mozilla/5.0 (iPad; CPU OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 3226}, { 3227 output: '(iPad) Safari 14', 3228 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 3229}]; 3230module.exports = uaTestStrings; 3231 3232},{}],16:[function(require,module,exports){ 3233"use strict"; 3234 3235Object.defineProperty(exports, "__esModule", { 3236 value: true 3237}); 3238exports.default = getPageData; 3239/* eslint-disable camelcase */ 3240/* global _ido */ 3241// this clientlib will be embedded from the main rendering script and called from social share which will also be embededd in the rendering scripts 3242var appHelper = require('../../illumina/js/helpers/appHelper'); 3243function getPageData(ele, platform) { 3244 // have a conditional that runs to check page type. If page type run this function to retrieve page data. 3245 3246 switch (_ido.page_type) { 3247 case 'news_center': 3248 { 3249 var _activeArticleParent$, _articleTitle$querySe; 3250 var activeArticleParent = ele.closest('article'); 3251 var articleDesc = (_activeArticleParent$ = activeArticleParent.querySelector('.article-excerpt p')) === null || _activeArticleParent$ === void 0 ? void 0 : _activeArticleParent$.textContent.trim(); 3252 var articleTitle = activeArticleParent.querySelector('.article-title'); 3253 var articleTitleText = articleTitle === null || articleTitle === void 0 ? void 0 : articleTitle.textContent.trim(); 3254 var articleLink = (_articleTitle$querySe = articleTitle.querySelector('a')) === null || _articleTitle$querySe === void 0 ? void 0 : _articleTitle$querySe.getAttribute('href'); 3255 var articleURL = articleLink ? appHelper.getURL() + articleLink : window.location.href; 3256 var pageData = { 3257 page: { 3258 title: articleTitleText, 3259 desc: articleDesc, 3260 url: articleURL 3261 } 3262 }; 3263 return pageData; 3264 } 3265 case 'press_release': 3266 { 3267 var _pressReleaseArticle$; 3268 var pressReleaseArticle = ele.closest('.inverstorrelationsIndividualnews'); 3269 var pressReleaseTitleText = (_pressReleaseArticle$ = pressReleaseArticle.querySelector('.article-title')) === null || _pressReleaseArticle$ === void 0 ? void 0 : _pressReleaseArticle$.textContent.trim(); 3270 var pressReleaseUrl = window.location.href; 3271 var _pageData = { 3272 page: { 3273 title: pressReleaseTitleText, 3274 url: pressReleaseUrl 3275 } 3276 }; 3277 return _pageData; 3278 } 3279 default: 3280 { 3281 var _document = document, 3282 title = _document.title; 3283 var desc = document.querySelector('meta[name="description"]').content; 3284 var url = window.location.href; 3285 var _pageData2 = { 3286 page: { 3287 title: title, 3288 desc: desc, 3289 url: url 3290 } 3291 }; 3292 return _pageData2; 3293 } 3294 } 3295} 3296 3297},{"../../illumina/js/helpers/appHelper":13}],17:[function(require,module,exports){ 3298"use strict"; 3299 3300var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 3301var _whenObjDefined = _interopRequireDefault(require("ilmn/whenObjDefined")); 3302var _popper = _interopRequireDefault(require("popper.js")); 3303var _otGlobals = require("../../gdpc/js/otGlobals"); 3304var _getPageData = _interopRequireDefault(require("./getPageData")); 3305// import fireAnalytics from './fireAnalytics'; 3306 3307var SocialShareCubes = {
3308 init: function init() { 3309 this.socialShares = Array.prototype.slice.call(document.querySelectorAll('.social-share__cubes, .social-share__cubes--sticky, .social-share__cube-tips--sticky')); 3310 if (this.socialShares.length < 1) { 3311 return; 3312 } 3313 this.oneTrustDefined(); 3314 }, 3315 oneTrustDefined: function oneTrustDefined() { 3316 var socialMediaCookies = (0, _otGlobals.otAllowSocialMediaCookies)(); 3317 if (!socialMediaCookies) { 3318 this.removeSocialShareCubes(); 3319 return; 3320 } 3321 (0, _whenObjDefined.default)('OneTrust', this.renderToolTipContainer()); 3322 (0, _whenObjDefined.default)('OneTrust', this.registerEventListeners()); 3323 }, 3324 registerEventListeners: function registerEventListeners() { 3325 var _this = this; 3326 this.socialShares.forEach(function (el) { 3327 var target = el.querySelector('.social-share__link-container'); 3328 target.addEventListener('click', _this.selectSocial.bind(_this)); 3329 // Only add tooltips to social-share__cubes--sticky--tips 3330 if (el.classList.contains('social-share__cube-tips--sticky')) { 3331 el.addEventListener('mouseover', _this.revealTooltip.bind(_this)); 3332 el.addEventListener('mouseout', _this.hoverOffController.bind(_this)); 3333 } 3334 }); 3335 }, 3336 revealTooltip: function revealTooltip(e) { 3337 clearTimeout(this.hoverOffTimeOut); 3338 this.socialShareController = e.target; 3339 if (this.socialShareController.getAttribute('data-share') === null) return false; 3340 var socialShareBtn = this.socialShareController; 3341 var tooltipText = socialShareBtn.querySelector('.sr-only').textContent; 3342 var socialShareContainer = this.socialShareContainer; 3343 var socialShareContainerID = socialShareContainer.getAttribute('id'); 3344 var widthWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 3345 // eslint-disable-next-line no-unused-vars 3346 var anotherPopper = new _popper.default(socialShareBtn, socialShareContainer, { 3347 socialShareBtn: socialShareBtn, 3348 socialShareContainer: socialShareContainer, 3349 placement: widthWidth > 768 ? 'right' : 'top', 3350 modifiers: { 3351 arrow: { 3352 element: '.arrow' 3353 }, 3354 offset: { 3355 enabled: true, 3356 offset: '0,8' 3357 } 3358 } 3359 }); 3360 var socialShareContainerTextArea = socialShareContainer.querySelector('.popover-body'); 3361 socialShareContainer.classList.add('active'); 3362 socialShareContainerTextArea.textContent = tooltipText; 3363 socialShareBtn.classList.add('active'); 3364 socialShareBtn.setAttribute('aria-labelledby', socialShareContainerID); 3365 return true; 3366 }, 3367 hoverOffController: function hoverOffController() { 3368 var _this2 = this; 3369 this.hoverOffTimeOut = setTimeout(function () { 3370 _this2.socialShareContainer.classList.remove('active'); 3371 _this2.socialShareController.classList.remove('active'); 3372 _this2.socialShareController.removeAttribute('aria-labelledby'); 3373 }, 300); 3374 }, 3375 mouseOverTooltip: function mouseOverTooltip() { 3376 var _this3 = this; 3377 this.socialShareContainer.addEventListener('mouseover', function () { 3378 clearTimeout(_this3.hoverOffTimeOut); 3379 }); 3380 }, 3381 mouseOutTooltip: function mouseOutTooltip() { 3382 var _this4 = this; 3383 this.socialShareContainer.addEventListener('mouseout', function () { 3384 _this4.hoverOffController(); 3385 }); 3386 }, 3387 selectSocial: function selectSocial(e) { 3388 if (e.target.hasAttribute('data-share')) { 3389 var _targetData$page$titl, _targetData$page$desc, _targetData$page$url, _targetData$page$desc2; 3390 e.preventDefault(); 3391 var targetPlatform = e.target.dataset.share; 3392 if (targetPlatform === 'pdf') { 3393 this.openPdf(e); 3394 return; 3395 } 3396 var targetData = (0, _getPageData.default)(e.target, targetPlatform); 3397 var platforms = { 3398 facebook: { 3399 url: 'https://www.facebook.com/sharer/sharer.php' + "?u=".concat(encodeURIComponent(targetData.page.url), "&t=").concat((_targetData$page$titl = targetData.page.title) === null || _targetData$page$titl === void 0 ? void 0 : _targetData$page$titl.replace(/\s/g, '%20'), "&d=").concat((_targetData$page$desc = targetData.page.desc) === null || _targetData$page$desc === void 0 ? void 0 : _targetData$page$desc.replace(/\s/g, '%20')), 3400 width: 500, 3401 height: 450 3402 }, 3403 linkedin: { 3404 url: 'https://www.linkedin.com/shareArticle?' + 'mini=true' + "&url=".concat(encodeURIComponent(targetData.page.url)).c
3404oncat(((_targetData$page$url = targetData.page.url) === null || _targetData$page$url === void 0 ? void 0 : _targetData$page$url.indexOf('press-releases')) !== -1 ? '%26clear%3Dtrue' : '', "&title=").concat(encodeURIComponent(targetData.page.title), "&summary=").concat(encodeURIComponent((_targetData$page$desc2 = targetData.page.desc) === null || _targetData$page$desc2 === void 0 ? void 0 : _targetData$page$desc2.replace(/\s/g, '%20')), "&source=illumina.com"), 3405 width: 520, 3406 height: 570 3407 }, 3408 twitter: { 3409 url: 'https://twitter.com/share' + "?url=".concat(encodeURIComponent(targetData.page.url), "&hashtags=illumina") + '&related=illumina' + "&text=".concat(encodeURIComponent(targetData.page.title)), 3410 width: 500, 3411 height: 450 3412 } 3413 }; 3414 this.shareInfo(platforms[targetPlatform]); 3415 // fireAnalytics(targetData.analytics); 3416 } 3417 }, 3418 shareInfo: function shareInfo(platform) { 3419 window.open(platform.url, 'popupWindow', "width=".concat(platform.width, ", height=").concat(platform.height, ", scrollbars=yes, location=no, menubar=no, status=no, toolbar=no")); 3420 }, 3421 removeSocialShareCubes: function removeSocialShareCubes() {
3422 this.socialShares.forEach(function (item) { 3423 item.remove(); 3424 }); 3425 }, 3426 // social-share__tooltip-container 3427 renderToolTipContainer: function renderToolTipContainer() { 3428 var socialHTML = { 3429 share: "\n <div id=\"social-share__cube-tip-container\" class=\"social-share__cube-tip-container popover\" role=\"tooltip\">\n <div class=\"arrow\"></div>\n <div class=\"popover-body\"></div>\n </div>\n " 3430 }; 3431 document.body.insertAdjacentHTML('beforeend', socialHTML.share); 3432 this.socialShareContainer = document.querySelector('.social-share__cube-tip-container'); 3433 }, 3434 openPdf: function openPdf(e) { 3435 var url = e.target.querySelector('input[name="pdfPath"]').value; 3436 window.open(url); 3437 } 3438}; 3439 3440// export default SocialShareCubes; 3441window.addEventListener('load', function () { 3442 SocialShareCubes.init(); 3443}); 3444 3445},{"../../gdpc/js/otGlobals":12,"./getPageData":16,"@babel/runtime/helpers/interopRequireDefault":3,"ilmn/whenObjDefined":10,"popper.js":11}]},{},[17]); 3446 3447(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 3448function _arrayLikeToArray(r, a) { 3449 (null == a || a > r.length) && (a = r.length); 3450 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 3451 return n; 3452} 3453module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 3454},{}],2:[function(require,module,exports){ 3455function _arrayWithHoles(r) { 3456 if (Array.isArray(r)) return r; 3457} 3458module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; 3459},{}],3:[function(require,module,exports){ 3460function _interopRequireDefault(e) { 3461 return e && e.__esModule ? e : { 3462 "default": e 3463 }; 3464} 3465module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; 3466},{}],4:[function(require,module,exports){ 3467function _iterableToArrayLimit(r, l) { 3468 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 3469 if (null != t) { 3470 var e, 3471 n, 3472 i, 3473 u, 3474 a = [], 3475 f = !0, 3476 o = !1; 3477 try { 3478 if (i = (t = t.call(r)).next, 0 === l) { 3479 if (Object(t) !== t) return; 3480 f = !1; 3481 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 3482 } catch (r) { 3483 o = !0, n = r; 3484 } finally { 3485 try { 3486 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; 3487 } finally { 3488 if (o) throw n; 3489 } 3490 } 3491 return a; 3492 } 3493} 3494module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; 3495},{}],5:[function(require,module,exports){ 3496function _nonIterableRest() { 3497 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 3498} 3499module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; 3500},{}],6:[function(require,module,exports){ 3501var arrayWithHoles = require("./arrayWithHoles.js"); 3502var iterableToArrayLimit = require("./iterableToArrayLimit.js"); 3503var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); 3504var nonIterableRest = require("./nonIterableRest.js"); 3505function _slicedToArray(r, e) { 3506 return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); 3507} 3508module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 3509},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":4,"./nonIterableRest.js":5,"./unsupportedIterableToArray.js":7}],7:[function(require,module,exports){ 3510var arrayLikeToArray = require("./arrayLikeToArray.js"); 3511function _unsupportedIterableToArray(r, a) { 3512 if (r) { 3513 if ("string" == typeof r) return arrayLikeToArray(r, a); 3514 var t = {}.toString.call(r).slice(8, -1); 3515 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; 3516 } 3517} 3518module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 3519},{"./arrayLikeToArray.js":1}],8:[function(require,module,exports){ 3520/** 3521 * @category Locale 3522 * @summary Get the Locale code for the current page 3523 * @tutorial 03_Usage 3524 * 3525 * @description 3526 * Get the Locale code for the current page 3527 * @module getLocale 3528 * @exports getLocale 3529 * @returns {string} Locale code 3530 * @example 3531 * 3532 * getLocale() 3533 * // => 'ja_JP' 3534 */ 3535 3536function getLocale() { 3537 var locale; 3538 var metaLocaleElem = document.querySelector("meta[name='locale']"); 3539 if (metaLocaleElem) { 3540 locale = metaLocaleElem.getAttribute("content"); 3541 } 3542 return locale; 3543} 3544module.exports = getLocale; 3545},{}],9:[function(require,module,exports){ 3546/** 3547 * @category Region 3548 * @summary Get the Region code for the current page 3549 * @tutorial 03_Usage 3550 * 3551 * @description 3552 * Get the Region code for the current page 3553 * @memberOf ILMN 3554 * @module getRegion 3555 * @exports getRegion 3556 * @returns {string} Region code 3557 * @example 3558 * 3559 * getRegion() 3560 * // => 'apac' 3561 */ 3562 3563function getRegion() { 3564 var region; 3565 var metaRegionElem = document.querySelector("meta[name='region']"); 3566 if (metaRegionElem) { 3567 region = metaRegionElem.getAttribute("content"); 3568 } 3569 return region; 3570} 3571module.exports = getRegion; 3572},{}],10:[function(require,module,exports){ 3573/** 3574 * @category UI Helpers 3575 * @summary Wait for an object to load before executing a function. 3576 * @tutorial 03_Usage 3577 * 3578 * @description 3579 * This function works like a promise, waiting for a passed object name to be defined before executing a passed 3580 * function. 3581 * 3582 * @module whenObjDefined 3583 * @exports whenObjDefined 3584 * @param {string} objName - (required) Object name to wait for. 3585 * @param {function} callbackFn - (required) Function to fire when object has loaded 3586 * @param {function} parentObj - (optional) If the object is not scoped to the window, you can scope it here. 3587 * 3588 * @example 3589 * whenObjDefined('OneTrust', handleGDPCContent); 3590 */ 3591 3592 3593 function whenObjDefined(objName,callbackFn,parentObj) { 3594 3595 // IE11 polyfill because it doesn't support custom events. *party* 3596 (function () { 3597 3598 if ( typeof window.CustomEvent === "function" ) return false;
3599 3600 function CustomEvent ( event, params ) { 3601 params = params || { bubbles: false, cancelable: false, detail: undefined }; 3602 var evt = document.createEvent('CustomEvent'); 3603 evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); 3604 return evt; 3605 } 3606 3607 CustomEvent.prototype = window.Event.prototype; 3608 3609 window.CustomEvent = CustomEvent; 3610 })(); 3611 3612 3613 var myEvent = new CustomEvent(objName + '-defined'); 3614 window.addEventListener(myEvent.type,callbackFn) 3615 objName = typeof objName === 'string' ? objName : ''; 3616 callbackFn = typeof callbackFn === 'function' ? callbackFn : function() {}; 3617 parentObj = typeof parentObj === 'object' ? parentObj : window; 3618 3619 if (window[objName]) { 3620 callbackFn(); 3621 // console.log("Function called from if clause") 3622 } else { 3623 Object.defineProperty(parentObj, objName, {//Used to define on existing object (window in this case) 3624 configurable: true, 3625 enumerable: true, 3626 get: function() { 3627 return window['_' + objName];//Get reference object 3628 }, 3629 set: function(val) {//Called whenever the property is assigned (window.OneTrust = blah), this function is called with val equal to the right hand assignment 3630 window['_' + objName] = val; //Underline character prevents recursive setting of objName, and creates window._OneTrust 3631 // console.log("object set") 3632 window.dispatchEvent(myEvent); 3633 } 3634 }); 3635 } 3636} 3637 3638 3639module.exports = whenObjDefined; 3640},{}],11:[function(require,module,exports){ 3641(function (global){(function (){ 3642/**! 3643 * @fileOverview Kickass library to create and place poppers near their reference elements. 3644 * @version 1.16.0 3645 * @license 3646 * Copyright (c) 2016 Federico Zivolo and contributors 3647 * 3648 * Permission is hereby granted, free of charge, to any person obtaining a copy 3649 * of this software and associated documentation files (the "Software"), to deal 3650 * in the Software without restriction, including without limitation the rights 3651 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 3652 * copies of the Software, and to permit persons to whom the Software is 3653 * furnished to do so, subject to the following conditions: 3654 * 3655 * The above copyright notice and this permission notice shall be included in all 3656 * copies or substantial portions of the Software. 3657 * 3658 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3659 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 3660 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 3661 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 3662 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3663 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3664 * SOFTWARE. 3665 */ 3666(function (global, factory) { 3667 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3668 typeof define === 'function' && define.amd ? define(factory) : 3669 (global.Popper = factory()); 3670}(this, (function () { 'use strict'; 3671 3672var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 3673 3674var timeoutDuration = function () { 3675 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 3676 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 3677 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 3678 return 1; 3679 } 3680 } 3681 return 0; 3682}(); 3683 3684function microtaskDebounce(fn) { 3685 var called = false; 3686 return function () { 3687 if (called) { 3688 return; 3689 } 3690 called = true; 3691 window.Promise.resolve().then(function () { 3692 called = false; 3693 fn(); 3694 }); 3695 }; 3696} 3697 3698function taskDebounce(fn) { 3699 var scheduled = false; 3700 return function () { 3701 if (!scheduled) { 3702 scheduled = true; 3703 setTimeout(function () { 3704 scheduled = false; 3705 fn(); 3706 }, timeoutDuration); 3707 } 3708 }; 3709} 3710 3711var supportsMicroTasks = isBrowser && window.Promise; 3712 3713/** 3714* Create a debounced version of a method, that's asynchronously deferred 3715* but called in the minimum time possible. 3716* 3717* @method 3718* @memberof Popper.Utils 3719* @argument {Function} fn 3720* @returns {Function} 3721*/ 3722var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 3723 3724/** 3725 * Check if the given variable is a function 3726 * @method 3727 * @memberof Popper.Utils 3728 * @argument {Any} functionToCheck - variable to check 3729 * @returns {Boolean} answer to: is a function? 3730 */ 3731function isFunction(functionToCheck) { 3732 var getType = {}; 3733 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 3734} 3735
vendor: 10,456 bytes, lines 3736-4095
3736/** 3737 * Get CSS computed property of the given element 3738 * @method 3739 * @memberof Popper.Utils 3740 * @argument {Eement} element 3741 * @argument {String} property 3742 */ 3743function getStyleComputedProperty(element, property) { 3744 if (element.nodeType !== 1) { 3745 return []; 3746 } 3747 // NOTE: 1 DOM access here 3748 var window = element.ownerDocument.defaultView; 3749 var css = window.getComputedStyle(element, null); 3750 return property ? css[property] : css; 3751} 3752 3753/** 3754 * Returns the parentNode or the host of the element 3755 * @method 3756 * @memberof Popper.Utils 3757 * @argument {Element} element 3758 * @returns {Element} parent 3759 */ 3760function getParentNode(element) { 3761 if (element.nodeName === 'HTML') { 3762 return element; 3763 } 3764 return element.parentNode || element.host; 3765} 3766 3767/** 3768 * Returns the scrolling parent of the given element 3769 * @method 3770 * @memberof Popper.Utils 3771 * @argument {Element} element 3772 * @returns {Element} scroll parent 3773 */ 3774function getScrollParent(element) { 3775 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 3776 if (!element) { 3777 return document.body; 3778 } 3779 3780 switch (element.nodeName) { 3781 case 'HTML': 3782 case 'BODY': 3783 return element.ownerDocument.body; 3784 case '#document': 3785 return element.body; 3786 } 3787 3788 // Firefox want us to check `-x` and `-y` variations as well 3789 3790 var _getStyleComputedProp = getStyleComputedProperty(element), 3791 overflow = _getStyleComputedProp.overflow, 3792 overflowX = _getStyleComputedProp.overflowX, 3793 overflowY = _getStyleComputedProp.overflowY; 3794 3795 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 3796 return element; 3797 } 3798 3799 return getScrollParent(getParentNode(element)); 3800} 3801 3802/** 3803 * Returns the reference node of the reference object, or the reference object itself. 3804 * @method 3805 * @memberof Popper.Utils 3806 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 3807 * @returns {Element} parent 3808 */ 3809function getReferenceNode(reference) { 3810 return reference && reference.referenceNode ? reference.referenceNode : reference; 3811} 3812 3813var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 3814var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 3815 3816/** 3817 * Determines if the browser is Internet Explorer 3818 * @method 3819 * @memberof Popper.Utils 3820 * @param {Number} version to check 3821 * @returns {Boolean} isIE 3822 */ 3823function isIE(version) { 3824 if (version === 11) { 3825 return isIE11; 3826 } 3827 if (version === 10) { 3828 return isIE10; 3829 } 3830 return isIE11 || isIE10; 3831} 3832 3833/** 3834 * Returns the offset parent of the given element 3835 * @method 3836 * @memberof Popper.Utils 3837 * @argument {Element} element 3838 * @returns {Element} offset parent 3839 */ 3840function getOffsetParent(element) { 3841 if (!element) { 3842 return document.documentElement; 3843 } 3844 3845 var noOffsetParent = isIE(10) ? document.body : null; 3846 3847 // NOTE: 1 DOM access here 3848 var offsetParent = element.offsetParent || null; 3849 // Skip hidden elements which don't have an offsetParent 3850 while (offsetParent === noOffsetParent && element.nextElementSibling) { 3851 offsetParent = (element = element.nextElementSibling).offsetParent; 3852 } 3853 3854 var nodeName = offsetParent && offsetParent.nodeName; 3855 3856 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 3857 return element ? element.ownerDocument.documentElement : document.documentElement; 3858 } 3859 3860 // .offsetParent will return the closest TH, TD or TABLE in case 3861 // no offsetParent is present, I hate this job... 3862 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 3863 return getOffsetParent(offsetParent); 3864 } 3865 3866 return offsetParent; 3867} 3868 3869function isOffsetContainer(element) { 3870 var nodeName = element.nodeName; 3871 3872 if (nodeName === 'BODY') { 3873 return false; 3874 } 3875 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 3876} 3877 3878/** 3879 * Finds the root node (document, shadowDOM root) of the given element 3880 * @method 3881 * @memberof Popper.Utils 3882 * @argument {Element} node 3883 * @returns {Element} root node 3884 */ 3885function getRoot(node) { 3886 if (node.parentNode !== null) { 3887 return getRoot(node.parentNode); 3888 } 3889 3890 return node; 3891} 3892 3893/** 3894 * Finds the offset parent common to the two provided nodes 3895 * @method 3896 * @memberof Popper.Utils 3897 * @argument {Element} element1 3898 * @argument {Element} element2 3899 * @returns {Element} common offset parent 3900 */ 3901function findCommonOffsetParent(element1, element2) { 3902 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 3903 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 3904 return document.documentElement; 3905 } 3906 3907 // Here we make sure to give as "start" the element that comes first in the DOM 3908 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 3909 var start = order ? element1 : element2; 3910 var end = order ? element2 : element1; 3911 3912 // Get common ancestor container 3913 var range = document.createRange(); 3914 range.setStart(start, 0); 3915 range.setEnd(end, 0); 3916 var commonAncestorContainer = range.commonAncestorContainer; 3917 3918 // Both nodes are inside #document 3919 3920 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 3921 if (isOffsetContainer(commonAncestorContainer)) { 3922 return commonAncestorContainer; 3923 } 3924 3925 return getOffsetParent(commonAncestorContainer); 3926 } 3927 3928 // one of the nodes is inside shadowDOM, find which one 3929 var element1root = getRoot(element1); 3930 if (element1root.host) { 3931 return findCommonOffsetParent(element1root.host, element2); 3932 } else { 3933 return findCommonOffsetParent(element1, getRoot(element2).host); 3934 } 3935} 3936 3937/** 3938 * Gets the scroll value of the given element in the given side (top and left) 3939 * @method 3940 * @memberof Popper.Utils 3941 * @argument {Element} element 3942 * @argument {String} side `top` or `left` 3943 * @returns {number} amount of scrolled pixels 3944 */ 3945function getScroll(element) { 3946 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 3947 3948 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 3949 var nodeName = element.nodeName; 3950 3951 if (nodeName === 'BODY' || nodeName === 'HTML') { 3952 var html = element.ownerDocument.documentElement; 3953 var scrollingElement = element.ownerDocument.scrollingElement || html; 3954 return scrollingElement[upperSide]; 3955 } 3956 3957 return element[upperSide]; 3958} 3959 3960/* 3961 * Sum or subtract the element scroll values (left and top) from a given rect object 3962 * @method 3963 * @memberof Popper.Utils 3964 * @param {Object} rect - Rect object you want to change 3965 * @param {HTMLElement} element - The element from the function reads the scroll values 3966 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 3967 * @return {Object} rect - The modifier rect object 3968 */ 3969function includeScroll(rect, element) { 3970 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 3971 3972 var scrollTop = getScroll(element, 'top'); 3973 var scrollLeft = getScroll(element, 'left'); 3974 var modifier = subtract ? -1 : 1; 3975 rect.top += scrollTop * modifier; 3976 rect.bottom += scrollTop * modifier; 3977 rect.left += scrollLeft * modifier; 3978 rect.right += scrollLeft * modifier; 3979 return rect; 3980} 3981 3982/* 3983 * Helper to detect borders of a given element 3984 * @method 3985 * @memberof Popper.Utils 3986 * @param {CSSStyleDeclaration} styles 3987 * Result of `getStyleComputedProperty` on the given element 3988 * @param {String} axis - `x` or `y` 3989 * @return {number} borders - The borders size of the given axis 3990 */ 3991 3992function getBordersSize(styles, axis) { 3993 var sideA = axis === 'x' ? 'Left' : 'Top'; 3994 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 3995 3996 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); 3997} 3998 3999function getSize(axis, body, html, computedStyle) { 4000 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 4001} 4002 4003function getWindowSizes(document) { 4004 var body = document.body; 4005 var html = document.documentElement; 4006 var computedStyle = isIE(10) && getComputedStyle(html); 4007 4008 return { 4009 height: getSize('Height', body, html, computedStyle), 4010 width: getSize('Width', body, html, computedStyle) 4011 }; 4012} 4013 4014var classCallCheck = function (instance, Constructor) { 4015 if (!(instance instanceof Constructor)) { 4016 throw new TypeError("Cannot call a class as a function"); 4017 } 4018}; 4019 4020var createClass = function () { 4021 function defineProperties(target, props) { 4022 for (var i = 0; i < props.length; i++) { 4023 var descriptor = props[i]; 4024 descriptor.enumerable = descriptor.enumerable || false; 4025 descriptor.configurable = true; 4026 if ("value" in descriptor) descriptor.writable = true; 4027 Object.defineProperty(target, descriptor.key, descriptor); 4028 } 4029 } 4030 4031 return function (Constructor, protoProps, staticProps) { 4032 if (protoProps) defineProperties(Constructor.prototype, protoProps); 4033 if (staticProps) defineProperties(Constructor, staticProps); 4034 return Constructor; 4035 }; 4036}(); 4037 4038 4039 4040 4041 4042var defineProperty = function (obj, key, value) { 4043 if (key in obj) { 4044 Object.defineProperty(obj, key, { 4045 value: value, 4046 enumerable: true, 4047 configurable: true, 4048 writable: true 4049 }); 4050 } else { 4051 obj[key] = value; 4052 } 4053 4054 return obj; 4055}; 4056 4057var _extends = Object.assign || function (target) { 4058 for (var i = 1; i < arguments.length; i++) { 4059 var source = arguments[i]; 4060 4061 for (var key in source) { 4062 if (Object.prototype.hasOwnProperty.call(source, key)) { 4063 target[key] = source[key]; 4064 } 4065 } 4066 } 4067 4068 return target; 4069}; 4070 4071/** 4072 * Given element offsets, generate an output similar to getBoundingClientRect 4073 * @method 4074 * @memberof Popper.Utils 4075 * @argument {Object} offsets 4076 * @returns {Object} ClientRect like output 4077 */ 4078function getClientRect(offsets) { 4079 return _extends({}, offsets, { 4080 right: offsets.left + offsets.width, 4081 bottom: offsets.top + offsets.height 4082 }); 4083} 4084 4085/** 4086 * Get bounding client rect of given element 4087 * @method 4088 * @memberof Popper.Utils 4089 * @param {HTMLElement} element 4090 * @return {Object} client rect 4091 */ 4092function getBoundingClientRect(element) { 4093 var rect = {}; 4094 4095 // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 2,932 bytes, lines 4096-4174
4096 // considered in DOM in some circumstances... 4097 // This isn't reproducible in IE10 compatibility mode of IE11 4098 try { 4099 if (isIE(10)) { 4100 rect = element.getBoundingClientRect(); 4101 var scrollTop = getScroll(element, 'top'); 4102 var scrollLeft = getScroll(element, 'left'); 4103 rect.top += scrollTop; 4104 rect.left += scrollLeft; 4105 rect.bottom += scrollTop; 4106 rect.right += scrollLeft; 4107 } else { 4108 rect = element.getBoundingClientRect(); 4109 } 4110 } catch (e) {} 4111 4112 var result = { 4113 left: rect.left, 4114 top: rect.top, 4115 width: rect.right - rect.left, 4116 height: rect.bottom - rect.top 4117 }; 4118 4119 // subtract scrollbar size from sizes 4120 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 4121 var width = sizes.width || element.clientWidth || result.width; 4122 var height = sizes.height || element.clientHeight || result.height; 4123 4124 var horizScrollbar = element.offsetWidth - width; 4125 var vertScrollbar = element.offsetHeight - height; 4126 4127 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 4128 // we make this check conditional for performance reasons 4129 if (horizScrollbar || vertScrollbar) { 4130 var styles = getStyleComputedProperty(element); 4131 horizScrollbar -= getBordersSize(styles, 'x'); 4132 vertScrollbar -= getBordersSize(styles, 'y'); 4133 4134 result.width -= horizScrollbar; 4135 result.height -= vertScrollbar; 4136 } 4137 4138 return getClientRect(result); 4139} 4140 4141function getOffsetRectRelativeToArbitraryNode(children, parent) { 4142 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 4143 4144 var isIE10 = isIE(10); 4145 var isHTML = parent.nodeName === 'HTML'; 4146 var childrenRect = getBoundingClientRect(children); 4147 var parentRect = getBoundingClientRect(parent); 4148 var scrollParent = getScrollParent(children); 4149 4150 var styles = getStyleComputedProperty(parent); 4151 var borderTopWidth = parseFloat(styles.borderTopWidth, 10); 4152 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); 4153 4154 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 4155 if (fixedPosition && isHTML) { 4156 parentRect.top = Math.max(parentRect.top, 0); 4157 parentRect.left = Math.max(parentRect.left, 0); 4158 } 4159 var offsets = getClientRect({ 4160 top: childrenRect.top - parentRect.top - borderTopWidth, 4161 left: childrenRect.left - parentRect.left - borderLeftWidth, 4162 width: childrenRect.width, 4163 height: childrenRect.height 4164 }); 4165 offsets.marginTop = 0; 4166 offsets.marginLeft = 0; 4167 4168 // Subtract margins of documentElement in case it's being used as parent 4169 // we do this only on HTML because it's the only element that behaves 4170 // differently when margins are applied to it. The margins are included in 4171 // the box of the documentElement, in the other cases not. 4172 if (!isIE10 && isHTML) { 4173 var marginTop = parseFloat(styles.marginTop, 10); 4174 var marginLeft = parseFloat(styles.marginLeft, 10
vendor: 31,482 bytes, lines 4174-5113
4174); 4175 4176 offsets.top -= borderTopWidth - marginTop; 4177 offsets.bottom -= borderTopWidth - marginTop; 4178 offsets.left -= borderLeftWidth - marginLeft; 4179 offsets.right -= borderLeftWidth - marginLeft; 4180 4181 // Attach marginTop and marginLeft because in some circumstances we may need them 4182 offsets.marginTop = marginTop; 4183 offsets.marginLeft = marginLeft; 4184 } 4185 4186 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 4187 offsets = includeScroll(offsets, parent); 4188 } 4189 4190 return offsets; 4191} 4192 4193function getViewportOffsetRectRelativeToArtbitraryNode(element) { 4194 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 4195 4196 var html = element.ownerDocument.documentElement; 4197 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 4198 var width = Math.max(html.clientWidth, window.innerWidth || 0); 4199 var height = Math.max(html.clientHeight, window.innerHeight || 0); 4200 4201 var scrollTop = !excludeScroll ? getScroll(html) : 0; 4202 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 4203 4204 var offset = { 4205 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 4206 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 4207 width: width, 4208 height: height 4209 }; 4210 4211 return getClientRect(offset); 4212} 4213 4214/** 4215 * Check if the given element is fixed or is inside a fixed parent 4216 * @method 4217 * @memberof Popper.Utils 4218 * @argument {Element} element 4219 * @argument {Element} customContainer 4220 * @returns {Boolean} answer to "isFixed?" 4221 */ 4222function isFixed(element) { 4223 var nodeName = element.nodeName; 4224 if (nodeName === 'BODY' || nodeName === 'HTML') { 4225 return false; 4226 } 4227 if (getStyleComputedProperty(element, 'position') === 'fixed') { 4228 return true; 4229 } 4230 var parentNode = getParentNode(element); 4231 if (!parentNode) { 4232 return false; 4233 } 4234 return isFixed(parentNode); 4235} 4236 4237/** 4238 * Finds the first parent of an element that has a transformed property defined 4239 * @method 4240 * @memberof Popper.Utils 4241 * @argument {Element} element 4242 * @returns {Element} first transformed parent or documentElement 4243 */ 4244 4245function getFixedPositionOffsetParent(element) { 4246 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 4247 if (!element || !element.parentElement || isIE()) { 4248 return document.documentElement; 4249 } 4250 var el = element.parentElement; 4251 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 4252 el = el.parentElement; 4253 } 4254 return el || document.documentElement; 4255} 4256 4257/** 4258 * Computed the boundaries limits and return them 4259 * @method 4260 * @memberof Popper.Utils 4261 * @param {HTMLElement} popper 4262 * @param {HTMLElement} reference 4263 * @param {number} padding 4264 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 4265 * @param {Boolean} fixedPosition - Is in fixed position mode 4266 * @returns {Object} Coordinates of the boundaries 4267 */ 4268function getBoundaries(popper, reference, padding, boundariesElement) { 4269 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 4270 4271 // NOTE: 1 DOM access here 4272 4273 var boundaries = { top: 0, left: 0 }; 4274 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 4275 4276 // Handle viewport case 4277 if (boundariesElement === 'viewport') { 4278 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 4279 } else { 4280 // Handle other cases based on DOM element used as boundaries 4281 var boundariesNode = void 0; 4282 if (boundariesElement === 'scrollParent') { 4283 boundariesNode = getScrollParent(getParentNode(reference)); 4284 if (boundariesNode.nodeName === 'BODY') { 4285 boundariesNode = popper.ownerDocument.documentElement; 4286 } 4287 } else if (boundariesElement === 'window') { 4288 boundariesNode = popper.ownerDocument.documentElement; 4289 } else { 4290 boundariesNode = boundariesElement; 4291 } 4292 4293 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 4294 4295 // In case of HTML, we need a different computation 4296 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 4297 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 4298 height = _getWindowSizes.height, 4299 width = _getWindowSizes.width; 4300 4301 boundaries.top += offsets.top - offsets.marginTop; 4302 boundaries.bottom = height + offsets.top; 4303 boundaries.left += offsets.left - offsets.marginLeft; 4304 boundaries.right = width + offsets.left; 4305 } else { 4306 // for all the other DOM elements, this one is good 4307 boundaries = offsets; 4308 } 4309 } 4310 4311 // Add paddings 4312 padding = padding || 0; 4313 var isPaddingNumber = typeof padding === 'number'; 4314 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 4315 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 4316 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 4317 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 4318 4319 return boundaries; 4320} 4321 4322function getArea(_ref) { 4323 var width = _ref.width, 4324 height = _ref.height; 4325 4326 return width * height; 4327} 4328 4329/** 4330 * Utility used to transform the `auto` placement to the placement with more 4331 * available space. 4332 * @method 4333 * @memberof Popper.Utils 4334 * @argument {Object} data - The data object generated by update method 4335 * @argument {Object} options - Modifiers configuration and options 4336 * @returns {Object} The data object, properly modified 4337 */ 4338function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 4339 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 4340 4341 if (placement.indexOf('auto') === -1) { 4342 return placement; 4343 } 4344 4345 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 4346 4347 var rects = { 4348 top: { 4349 width: boundaries.width, 4350 height: refRect.top - boundaries.top 4351 }, 4352 right: { 4353 width: boundaries.right - refRect.right, 4354 height: boundaries.height 4355 }, 4356 bottom: { 4357 width: boundaries.width, 4358 height: boundaries.bottom - refRect.bottom 4359 }, 4360 left: { 4361 width: refRect.left - boundaries.left, 4362 height: boundaries.height 4363 } 4364 }; 4365 4366 var sortedAreas = Object.keys(rects).map(function (key) { 4367 return _extends({ 4368 key: key 4369 }, rects[key], { 4370 area: getArea(rects[key]) 4371 }); 4372 }).sort(function (a, b) { 4373 return b.area - a.area; 4374 }); 4375 4376 var filteredAreas = sortedAreas.filter(function (_ref2) { 4377 var width = _ref2.width, 4378 height = _ref2.height; 4379 return width >= popper.clientWidth && height >= popper.clientHeight; 4380 }); 4381 4382 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 4383 4384 var variation = placement.split('-')[1]; 4385 4386 return computedPlacement + (variation ? '-' + variation : ''); 4387} 4388 4389/** 4390 * Get offsets to the reference element 4391 * @method 4392 * @memberof Popper.Utils 4393 * @param {Object} state 4394 * @param {Element} popper - the popper element 4395 * @param {Element} reference - the reference element (the popper will be relative to this) 4396 * @param {Element} fixedPosition - is in fixed position mode 4397 * @returns {Object} An object containing the offsets which will be applied to the popper 4398 */ 4399function getReferenceOffsets(state, popper, reference) { 4400 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 4401 4402 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 4403 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 4404} 4405 4406/** 4407 * Get the outer sizes of the given element (offset size + margins) 4408 * @method 4409 * @memberof Popper.Utils 4410 * @argument {Element} element 4411 * @returns {Object} object containing width and height properties 4412 */ 4413function getOuterSizes(element) { 4414 var window = element.ownerDocument.defaultView; 4415 var styles = window.getComputedStyle(element); 4416 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 4417 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 4418 var result = { 4419 width: element.offsetWidth + y, 4420 height: element.offsetHeight + x 4421 }; 4422 return result; 4423} 4424 4425/** 4426 * Get the opposite placement of the given one 4427 * @method 4428 * @memberof Popper.Utils 4429 * @argument {String} placement 4430 * @returns {String} flipped placement 4431 */ 4432function getOppositePlacement(placement) { 4433 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 4434 return placement.replace(/left|right|bottom|top/g, function (matched) { 4435 return hash[matched]; 4436 }); 4437} 4438 4439/** 4440 * Get offsets to the popper 4441 * @method 4442 * @memberof Popper.Utils 4443 * @param {Object} position - CSS position the Popper will get applied 4444 * @param {HTMLElement} popper - the popper element 4445 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 4446 * @param {String} placement - one of the valid placement options 4447 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 4448 */ 4449function getPopperOffsets(popper, referenceOffsets, placement) { 4450 placement = placement.split('-')[0]; 4451 4452 // Get popper node sizes 4453 var popperRect = getOuterSizes(popper); 4454 4455 // Add position, width and height to our offsets object 4456 var popperOffsets = { 4457 width: popperRect.width, 4458 height: popperRect.height 4459 }; 4460 4461 // depending by the popper placement we have to compute its offsets slightly differently 4462 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 4463 var mainSide = isHoriz ? 'top' : 'left'; 4464 var secondarySide = isHoriz ? 'left' : 'top'; 4465 var measurement = isHoriz ? 'height' : 'width'; 4466 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 4467 4468 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 4469 if (placement === secondarySide) { 4470 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 4471 } else { 4472 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 4473 } 4474 4475 return popperOffsets; 4476} 4477 4478/** 4479 * Mimics the `find` method of Array 4480 * @method 4481 * @memberof Popper.Utils 4482 * @argument {Array} arr 4483 * @argument prop 4484 * @argument value 4485 * @returns index or -1 4486 */ 4487function find(arr, check) { 4488 // use native find if supported 4489 if (Array.prototype.find) { 4490 return arr.find(check); 4491 } 4492 4493 // use `filter` to obtain the same behavior of `find` 4494 return arr.filter(check)[0]; 4495} 4496 4497/** 4498 * Return the index of the matching object 4499 * @method 4500 * @memberof Popper.Utils 4501 * @argument {Array} arr 4502 * @argument prop 4503 * @argument value 4504 * @returns index or -1 4505 */ 4506function findIndex(arr, prop, value) { 4507 // use native findIndex if supported 4508 if (Array.prototype.findIndex) { 4509 return arr.findIndex(function (cur) { 4510 return cur[prop] === value; 4511 }); 4512 } 4513 4514 // use `find` + `indexOf` if `findIndex` isn't supported 4515 var match = find(arr, function (obj) { 4516 return obj[prop] === value; 4517 }); 4518 return arr.indexOf(match); 4519} 4520 4521/** 4522 * Loop trough the list of modifiers and run them in order, 4523 * each of them will then edit the data object. 4524 * @method 4525 * @memberof Popper.Utils 4526 * @param {dataObject} data 4527 * @param {Array} modifiers 4528 * @param {String} ends - Optional modifier name used as stopper 4529 * @returns {dataObject} 4530 */ 4531function runModifiers(modifiers, data, ends) { 4532 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 4533 4534 modifiersToRun.forEach(function (modifier) { 4535 if (modifier['function']) { 4536 // eslint-disable-line dot-notation 4537 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 4538 } 4539 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 4540 if (modifier.enabled && isFunction(fn)) { 4541 // Add properties to offsets to make them a complete clientRect object 4542 // we do this before each modifier to make sure the previous one doesn't 4543 // mess with these values 4544 data.offsets.popper = getClientRect(data.offsets.popper); 4545 data.offsets.reference = getClientRect(data.offsets.reference); 4546 4547 data = fn(data, modifier); 4548 } 4549 }); 4550 4551 return data; 4552} 4553 4554/** 4555 * Updates the position of the popper, computing the new offsets and applying 4556 * the new style.<br /> 4557 * Prefer `scheduleUpdate` over `update` because of performance reasons. 4558 * @method 4559 * @memberof Popper 4560 */ 4561function update() { 4562 // if popper is destroyed, don't perform any further update 4563 if (this.state.isDestroyed) { 4564 return; 4565 } 4566 4567 var data = { 4568 instance: this, 4569 styles: {}, 4570 arrowStyles: {}, 4571 attributes: {}, 4572 flipped: false, 4573 offsets: {} 4574 }; 4575 4576 // compute reference element offsets 4577 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 4578 4579 // compute auto placement, store placement inside the data object, 4580 // modifiers will be able to edit `placement` if needed 4581 // and refer to originalPlacement to know the original value 4582 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 4583 4584 // store the computed placement inside `originalPlacement` 4585 data.originalPlacement = data.placement; 4586 4587 data.positionFixed = this.options.positionFixed; 4588 4589 // compute the popper offsets 4590 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 4591 4592 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 4593 4594 // run the modifiers 4595 data = runModifiers(this.modifiers, data); 4596 4597 // the first `update` will call `onCreate` callback 4598 // the other ones will call `onUpdate` callback 4599 if (!this.state.isCreated) { 4600 this.state.isCreated = true; 4601 this.options.onCreate(data); 4602 } else { 4603 this.options.onUpdate(data); 4604 } 4605} 4606 4607/** 4608 * Helper used to know if the given modifier is enabled. 4609 * @method 4610 * @memberof Popper.Utils 4611 * @returns {Boolean} 4612 */ 4613function isModifierEnabled(modifiers, modifierName) { 4614 return modifiers.some(function (_ref) { 4615 var name = _ref.name, 4616 enabled = _ref.enabled; 4617 return enabled && name === modifierName; 4618 }); 4619} 4620 4621/** 4622 * Get the prefixed supported property name 4623 * @method 4624 * @memberof Popper.Utils 4625 * @argument {String} property (camelCase) 4626 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 4627 */ 4628function getSupportedPropertyName(property) { 4629 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 4630 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 4631 4632 for (var i = 0; i < prefixes.length; i++) { 4633 var prefix = prefixes[i]; 4634 var toCheck = prefix ? '' + prefix + upperProp : property; 4635 if (typeof document.body.style[toCheck] !== 'undefined') { 4636 return toCheck; 4637 } 4638 } 4639 return null; 4640} 4641 4642/** 4643 * Destroys the popper. 4644 * @method 4645 * @memberof Popper 4646 */ 4647function destroy() { 4648 this.state.isDestroyed = true; 4649 4650 // touch DOM only if `applyStyle` modifier is enabled 4651 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 4652 this.popper.removeAttribute('x-placement'); 4653 this.popper.style.position = ''; 4654 this.popper.style.top = ''; 4655 this.popper.style.left = ''; 4656 this.popper.style.right = ''; 4657 this.popper.style.bottom = ''; 4658 this.popper.style.willChange = ''; 4659 this.popper.style[getSupportedPropertyName('transform')] = ''; 4660 } 4661 4662 this.disableEventListeners(); 4663 4664 // remove the popper if user explicitly asked for the deletion on destroy 4665 // do not use `remove` because IE11 doesn't support it 4666 if (this.options.removeOnDestroy) { 4667 this.popper.parentNode.removeChild(this.popper); 4668 } 4669 return this; 4670} 4671 4672/** 4673 * Get the window associated with the element 4674 * @argument {Element} element 4675 * @returns {Window} 4676 */ 4677function getWindow(element) { 4678 var ownerDocument = element.ownerDocument; 4679 return ownerDocument ? ownerDocument.defaultView : window; 4680} 4681 4682function attachToScrollParents(scrollParent, event, callback, scrollParents) { 4683 var isBody = scrollParent.nodeName === 'BODY'; 4684 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 4685 target.addEventListener(event, callback, { passive: true }); 4686 4687 if (!isBody) { 4688 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 4689 } 4690 scrollParents.push(target); 4691} 4692 4693/** 4694 * Setup needed event listeners used to update the popper position 4695 * @method 4696 * @memberof Popper.Utils 4697 * @private 4698 */ 4699function setupEventListeners(reference, options, state, updateBound) { 4700 // Resize event listener on window 4701 state.updateBound = updateBound; 4702 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 4703 4704 // Scroll event listener on scroll parents 4705 var scrollElement = getScrollParent(reference); 4706 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 4707 state.scrollElement = scrollElement; 4708 state.eventsEnabled = true; 4709 4710 return state; 4711} 4712 4713/** 4714 * It will add resize/scroll events and start recalculating 4715 * position of the popper element when they are triggered. 4716 * @method 4717 * @memberof Popper 4718 */ 4719function enableEventListeners() { 4720 if (!this.state.eventsEnabled) { 4721 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 4722 } 4723} 4724 4725/** 4726 * Remove event listeners used to update the popper position 4727 * @method 4728 * @memberof Popper.Utils 4729 * @private 4730 */ 4731function removeEventListeners(reference, state) { 4732 // Remove resize event listener on window 4733 getWindow(reference).removeEventListener('resize', state.updateBound); 4734 4735 // Remove scroll event listener on scroll parents 4736 state.scrollParents.forEach(function (target) { 4737 target.removeEventListener('scroll', state.updateBound); 4738 }); 4739 4740 // Reset state 4741 state.updateBound = null; 4742 state.scrollParents = []; 4743 state.scrollElement = null; 4744 state.eventsEnabled = false; 4745 return state; 4746} 4747 4748/** 4749 * It will remove resize/scroll events and won't recalculate popper position 4750 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 4751 * unless you call `update` method manually. 4752 * @method 4753 * @memberof Popper 4754 */ 4755function disableEventListeners() { 4756 if (this.state.eventsEnabled) { 4757 cancelAnimationFrame(this.scheduleUpdate); 4758 this.state = removeEventListeners(this.reference, this.state); 4759 } 4760} 4761 4762/** 4763 * Tells if a given input is a number 4764 * @method 4765 * @memberof Popper.Utils 4766 * @param {*} input to check 4767 * @return {Boolean} 4768 */ 4769function isNumeric(n) { 4770 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 4771} 4772 4773/** 4774 * Set the style to the given popper 4775 * @method 4776 * @memberof Popper.Utils 4777 * @argument {Element} element - Element to apply the style to 4778 * @argument {Object} styles 4779 * Object with a list of properties and values which will be applied to the element 4780 */ 4781function setStyles(element, styles) { 4782 Object.keys(styles).forEach(function (prop) { 4783 var unit = ''; 4784 // add unit if the value is numeric and is one of the following 4785 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 4786 unit = 'px'; 4787 } 4788 element.style[prop] = styles[prop] + unit; 4789 }); 4790} 4791 4792/** 4793 * Set the attributes to the given popper 4794 * @method 4795 * @memberof Popper.Utils 4796 * @argument {Element} element - Element to apply the attributes to 4797 * @argument {Object} styles 4798 * Object with a list of properties and values which will be applied to the element 4799 */ 4800function setAttributes(element, attributes) { 4801 Object.keys(attributes).forEach(function (prop) { 4802 var value = attributes[prop]; 4803 if (value !== false) { 4804 element.setAttribute(prop, attributes[prop]); 4805 } else { 4806 element.removeAttribute(prop); 4807 } 4808 }); 4809} 4810 4811/** 4812 * @function 4813 * @memberof Modifiers 4814 * @argument {Object} data - The data object generated by `update` method 4815 * @argument {Object} data.styles - List of style properties - values to apply to popper element 4816 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 4817 * @argument {Object} options - Modifiers configuration and options 4818 * @returns {Object} The same data object 4819 */ 4820function applyStyle(data) { 4821 // any property present in `data.styles` will be applied to the popper, 4822 // in this way we can make the 3rd party modifiers add custom styles to it 4823 // Be aware, modifiers could override the properties defined in the previous 4824 // lines of this modifier! 4825 setStyles(data.instance.popper, data.styles); 4826 4827 // any property present in `data.attributes` will be applied to the popper, 4828 // they will be set as HTML attributes of the element 4829 setAttributes(data.instance.popper, data.attributes); 4830 4831 // if arrowElement is defined and arrowStyles has some properties 4832 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 4833 setStyles(data.arrowElement, data.arrowStyles); 4834 } 4835 4836 return data; 4837} 4838 4839/** 4840 * Set the x-placement attribute before everything else because it could be used 4841 * to add margins to the popper margins needs to be calculated to get the 4842 * correct popper offsets. 4843 * @method 4844 * @memberof Popper.modifiers 4845 * @param {HTMLElement} reference - The reference element used to position the popper 4846 * @param {HTMLElement} popper - The HTML element used as popper 4847 * @param {Object} options - Popper.js options 4848 */ 4849function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 4850 // compute reference element offsets 4851 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 4852 4853 // compute auto placement, store placement inside the data object, 4854 // modifiers will be able to edit `placement` if needed 4855 // and refer to originalPlacement to know the original value 4856 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 4857 4858 popper.setAttribute('x-placement', placement); 4859 4860 // Apply `position` to popper before anything else because 4861 // without the position applied we can't guarantee correct computations 4862 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 4863 4864 return options; 4865} 4866 4867/** 4868 * @function 4869 * @memberof Popper.Utils 4870 * @argument {Object} data - The data object generated by `update` method 4871 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 4872 * @returns {Object} The popper's position offsets rounded 4873 * 4874 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 4875 * good as it can be within reason. 4876 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 4877 * 4878 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 4879 * as well on High DPI screens). 4880 * 4881 * Firefox prefers no rounding for positioning and does not have blurriness on 4882 * high DPI screens. 4883 * 4884 * Only horizontal placement and left/right values need to be considered. 4885 */ 4886function getRoundedOffsets(data, shouldRound) { 4887 var _data$offsets = data.offsets, 4888 popper = _data$offsets.popper, 4889 reference = _data$offsets.reference; 4890 var round = Math.round, 4891 floor = Math.floor; 4892 4893 var noRound = function noRound(v) { 4894 return v; 4895 }; 4896 4897 var referenceWidth = round(reference.width); 4898 var popperWidth = round(popper.width); 4899 4900 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 4901 var isVariation = data.placement.indexOf('-') !== -1; 4902 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 4903 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 4904 4905 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 4906 var verticalToInteger = !shouldRound ? noRound : round; 4907 4908 return { 4909 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 4910 top: verticalToInteger(popper.top), 4911 bottom: verticalToInteger(popper.bottom), 4912 right: horizontalToInteger(popper.right) 4913 }; 4914} 4915 4916var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 4917 4918/** 4919 * @function 4920 * @memberof Modifiers 4921 * @argument {Object} data - The data object generated by `update` method 4922 * @argument {Object} options - Modifiers configuration and options 4923 * @returns {Object} The data object, properly modified 4924 */ 4925function computeStyle(data, options) { 4926 var x = options.x, 4927 y = options.y; 4928 var popper = data.offsets.popper; 4929 4930 // Remove this legacy support in Popper.js v2 4931 4932 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 4933 return modifier.name === 'applyStyle'; 4934 }).gpuAcceleration; 4935 if (legacyGpuAccelerationOption !== undefined) { 4936 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 4937 } 4938 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 4939 4940 var offsetParent = getOffsetParent(data.instance.popper); 4941 var offsetParentRect = getBoundingClientRect(offsetParent); 4942 4943 // Styles 4944 var styles = { 4945 position: popper.position 4946 }; 4947 4948 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 4949 4950 var sideA = x === 'bottom' ? 'top' : 'bottom'; 4951 var sideB = y === 'right' ? 'left' : 'right'; 4952 4953 // if gpuAcceleration is set to `true` and transform is supported, 4954 // we use `translate3d` to apply the position to the popper we 4955 // automatically use the supported prefixed version if needed 4956 var prefixedProperty = getSupportedPropertyName('transform'); 4957 4958 // now, let's make a step back and look at this code closely (wtf?) 4959 // If the content of the popper grows once it's been positioned, it 4960 // may happen that the popper gets misplaced because of the new content 4961 // overflowing its reference element 4962 // To avoid this problem, we provide two options (x and y), which allow 4963 // the consumer to define the offset origin. 4964 // If we position a popper on top of a reference element, we can set 4965 // `x` to `top` to make the popper grow towards its top instead of 4966 // its bottom. 4967 var left = void 0, 4968 top = void 0; 4969 if (sideA === 'bottom') { 4970 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 4971 // and not the bottom of the html element 4972 if (offsetParent.nodeName === 'HTML') { 4973 top = -offsetParent.clientHeight + offsets.bottom; 4974 } else { 4975 top = -offsetParentRect.height + offsets.bottom; 4976 } 4977 } else { 4978 top = offsets.top; 4979 } 4980 if (sideB === 'right') { 4981 if (offsetParent.nodeName === 'HTML') { 4982 left = -offsetParent.clientWidth + offsets.right; 4983 } else { 4984 left = -offsetParentRect.width + offsets.right; 4985 } 4986 } else { 4987 left = offsets.left; 4988 } 4989 if (gpuAcceleration && prefixedProperty) { 4990 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 4991 styles[sideA] = 0; 4992 styles[sideB] = 0; 4993 styles.willChange = 'transform'; 4994 } else { 4995 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 4996 var invertTop = sideA === 'bottom' ? -1 : 1; 4997 var invertLeft = sideB === 'right' ? -1 : 1; 4998 styles[sideA] = top * invertTop; 4999 styles[sideB] = left * invertLeft; 5000 styles.willChange = sideA + ', ' + sideB; 5001 } 5002 5003 // Attributes 5004 var attributes = { 5005 'x-placement': data.placement 5006 }; 5007 5008 // Update `data` attributes, styles and arrowStyles 5009 data.attributes = _extends({}, attributes, data.attributes); 5010 data.styles = _extends({}, styles, data.styles); 5011 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 5012 5013 return data; 5014} 5015 5016/** 5017 * Helper used to know if the given modifier depends from another one.<br /> 5018 * It checks if the needed modifier is listed and enabled. 5019 * @method 5020 * @memberof Popper.Utils 5021 * @param {Array} modifiers - list of modifiers 5022 * @param {String} requestingName - name of requesting modifier 5023 * @param {String} requestedName - name of requested modifier 5024 * @returns {Boolean} 5025 */ 5026function isModifierRequired(modifiers, requestingName, requestedName) { 5027 var requesting = find(modifiers, function (_ref) { 5028 var name = _ref.name; 5029 return name === requestingName; 5030 }); 5031 5032 var isRequired = !!requesting && modifiers.some(function (modifier) { 5033 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 5034 }); 5035 5036 if (!isRequired) { 5037 var _requesting = '`' + requestingName + '`'; 5038 var requested = '`' + requestedName + '`'; 5039 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 5040 } 5041 return isRequired; 5042} 5043 5044/** 5045 * @function 5046 * @memberof Modifiers 5047 * @argument {Object} data - The data object generated by update method 5048 * @argument {Object} options - Modifiers configuration and options 5049 * @returns {Object} The data object, properly modified 5050 */ 5051function arrow(data, options) { 5052 var _data$offsets$arrow; 5053 5054 // arrow depends on keepTogether in order to work 5055 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 5056 return data; 5057 } 5058 5059 var arrowElement = options.element; 5060 5061 // if arrowElement is a string, suppose it's a CSS selector 5062 if (typeof arrowElement === 'string') { 5063 arrowElement = data.instance.popper.querySelector(arrowElement); 5064 5065 // if arrowElement is not found, don't run the modifier 5066 if (!arrowElement) { 5067 return data; 5068 } 5069 } else { 5070 // if the arrowElement isn't a query selector we must check that the 5071 // provided DOM node is child of its popper node 5072 if (!data.instance.popper.contains(arrowElement)) { 5073 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 5074 return data; 5075 } 5076 } 5077 5078 var placement = data.placement.split('-')[0]; 5079 var _data$offsets = data.offsets, 5080 popper = _data$offsets.popper, 5081 reference = _data$offsets.reference; 5082 5083 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 5084 5085 var len = isVertical ? 'height' : 'width'; 5086 var sideCapitalized = isVertical ? 'Top' : 'Left'; 5087 var side = sideCapitalized.toLowerCase(); 5088 var altSide = isVertical ? 'left' : 'top'; 5089 var opSide = isVertical ? 'bottom' : 'right'; 5090 var arrowElementSize = getOuterSizes(arrowElement)[len]; 5091 5092 // 5093 // extends keepTogether behavior making sure the popper and its 5094 // reference have enough pixels in conjunction 5095 // 5096 5097 // top/left side 5098 if (reference[opSide] - arrowElementSize < popper[side]) { 5099 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 5100 } 5101 // bottom/right side 5102 if (reference[side] + arrowElementSize > popper[opSide]) { 5103 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 5104 } 5105 data.offsets.popper = getClientRect(data.offsets.popper); 5106 5107 // compute center of the popper 5108 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 5109 5110 // Compute the sideValue using the updated popper offsets 5111 // take popper margin in account because we don't have this info available 5112 var css = getStyleComputedProperty(data.instance.popper); 5113 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]
5113, 10); 5114 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10
vendor: 21,597 bytes, lines 5114-5724
5114); 5115 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 5116 5117 // prevent arrowElement from being placed not contiguously to its popper 5118 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 5119 5120 data.arrowElement = arrowElement; 5121 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 5122 5123 return data; 5124} 5125 5126/** 5127 * Get the opposite placement variation of the given one 5128 * @method 5129 * @memberof Popper.Utils 5130 * @argument {String} placement variation 5131 * @returns {String} flipped placement variation 5132 */ 5133function getOppositeVariation(variation) { 5134 if (variation === 'end') { 5135 return 'start'; 5136 } else if (variation === 'start') { 5137 return 'end'; 5138 } 5139 return variation; 5140} 5141 5142/** 5143 * List of accepted placements to use as values of the `placement` option.<br /> 5144 * Valid placements are: 5145 * - `auto` 5146 * - `top` 5147 * - `right` 5148 * - `bottom` 5149 * - `left` 5150 * 5151 * Each placement can have a variation from this list: 5152 * - `-start` 5153 * - `-end` 5154 * 5155 * Variations are interpreted easily if you think of them as the left to right 5156 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 5157 * is right.<br /> 5158 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 5159 * 5160 * Some valid examples are: 5161 * - `top-end` (on top of reference, right aligned) 5162 * - `right-start` (on right of reference, top aligned) 5163 * - `bottom` (on bottom, centered) 5164 * - `auto-end` (on the side with more space available, alignment depends by placement) 5165 * 5166 * @static 5167 * @type {Array} 5168 * @enum {String} 5169 * @readonly 5170 * @method placements 5171 * @memberof Popper 5172 */ 5173var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 5174 5175// Get rid of `auto` `auto-start` and `auto-end` 5176var validPlacements = placements.slice(3); 5177 5178/** 5179 * Given an initial placement, returns all the subsequent placements 5180 * clockwise (or counter-clockwise). 5181 * 5182 * @method 5183 * @memberof Popper.Utils 5184 * @argument {String} placement - A valid placement (it accepts variations) 5185 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 5186 * @returns {Array} placements including their variations 5187 */ 5188function clockwise(placement) { 5189 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 5190 5191 var index = validPlacements.indexOf(placement); 5192 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 5193 return counter ? arr.reverse() : arr; 5194} 5195 5196var BEHAVIORS = { 5197 FLIP: 'flip', 5198 CLOCKWISE: 'clockwise', 5199 COUNTERCLOCKWISE: 'counterclockwise' 5200}; 5201 5202/** 5203 * @function 5204 * @memberof Modifiers 5205 * @argument {Object} data - The data object generated by update method 5206 * @argument {Object} options - Modifiers configuration and options 5207 * @returns {Object} The data object, properly modified 5208 */ 5209function flip(data, options) { 5210 // if `inner` modifier is enabled, we can't use the `flip` modifier 5211 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 5212 return data; 5213 } 5214 5215 if (data.flipped && data.placement === data.originalPlacement) { 5216 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 5217 return data; 5218 } 5219 5220 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 5221 5222 var placement = data.placement.split('-')[0]; 5223 var placementOpposite = getOppositePlacement(placement); 5224 var variation = data.placement.split('-')[1] || ''; 5225 5226 var flipOrder = []; 5227 5228 switch (options.behavior) { 5229 case BEHAVIORS.FLIP: 5230 flipOrder = [placement, placementOpposite]; 5231 break; 5232 case BEHAVIORS.CLOCKWISE: 5233 flipOrder = clockwise(placement); 5234 break; 5235 case BEHAVIORS.COUNTERCLOCKWISE: 5236 flipOrder = clockwise(placement, true); 5237 break; 5238 default: 5239 flipOrder = options.behavior; 5240 } 5241 5242 flipOrder.forEach(function (step, index) { 5243 if (placement !== step || flipOrder.length === index + 1) { 5244 return data; 5245 } 5246 5247 placement = data.placement.split('-')[0]; 5248 placementOpposite = getOppositePlacement(placement); 5249 5250 var popperOffsets = data.offsets.popper; 5251 var refOffsets = data.offsets.reference; 5252 5253 // using floor because the reference offsets may contain decimals we are not going to consider here 5254 var floor = Math.floor; 5255 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 5256 5257 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 5258 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 5259 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 5260 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 5261 5262 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 5263 5264 // flip the variation if required 5265 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 5266 5267 // flips variation if reference element overflows boundaries 5268 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 5269 5270 // flips variation if popper content overflows boundaries 5271 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 5272 5273 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 5274 5275 if (overlapsRef || overflowsBoundaries || flippedVariation) { 5276 // this boolean to detect any flip loop 5277 data.flipped = true; 5278 5279 if (overlapsRef || overflowsBoundaries) { 5280 placement = flipOrder[index + 1]; 5281 } 5282 5283 if (flippedVariation) { 5284 variation = getOppositeVariation(variation); 5285 } 5286 5287 data.placement = placement + (variation ? '-' + variation : ''); 5288 5289 // this object contains `position`, we want to preserve it along with 5290 // any additional property we may add in the future 5291 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 5292 5293 data = runModifiers(data.instance.modifiers, data, 'flip'); 5294 } 5295 }); 5296 return data; 5297} 5298 5299/** 5300 * @function 5301 * @memberof Modifiers 5302 * @argument {Object} data - The data object generated by update method 5303 * @argument {Object} options - Modifiers configuration and options 5304 * @returns {Object} The data object, properly modified 5305 */ 5306function keepTogether(data) { 5307 var _data$offsets = data.offsets, 5308 popper = _data$offsets.popper, 5309 reference = _data$offsets.reference; 5310 5311 var placement = data.placement.split('-')[0]; 5312 var floor = Math.floor; 5313 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 5314 var side = isVertical ? 'right' : 'bottom'; 5315 var opSide = isVertical ? 'left' : 'top'; 5316 var measurement = isVertical ? 'width' : 'height'; 5317 5318 if (popper[side] < floor(reference[opSide])) { 5319 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 5320 } 5321 if (popper[opSide] > floor(reference[side])) { 5322 data.offsets.popper[opSide] = floor(reference[side]); 5323 } 5324 5325 return data; 5326} 5327 5328/** 5329 * Converts a string containing value + unit into a px value number 5330 * @function 5331 * @memberof {modifiers~offset} 5332 * @private 5333 * @argument {String} str - Value + unit string 5334 * @argument {String} measurement - `height` or `width` 5335 * @argument {Object} popperOffsets 5336 * @argument {Object} referenceOffsets 5337 * @returns {Number|String} 5338 * Value in pixels, or original string if no values were extracted 5339 */ 5340function toValue(str, measurement, popperOffsets, referenceOffsets) { 5341 // separate value from unit 5342 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 5343 var value = +split[1]; 5344 var unit = split[2]; 5345 5346 // If it's not a number it's an operator, I guess 5347 if (!value) { 5348 return str; 5349 } 5350 5351 if (unit.indexOf('%') === 0) { 5352 var element = void 0; 5353 switch (unit) { 5354 case '%p': 5355 element = popperOffsets; 5356 break; 5357 case '%': 5358 case '%r': 5359 default: 5360 element = referenceOffsets; 5361 } 5362 5363 var rect = getClientRect(element); 5364 return rect[measurement] / 100 * value; 5365 } else if (unit === 'vh' || unit === 'vw') { 5366 // if is a vh or vw, we calculate the size based on the viewport 5367 var size = void 0; 5368 if (unit === 'vh') { 5369 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 5370 } else { 5371 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 5372 } 5373 return size / 100 * value; 5374 } else { 5375 // if is an explicit pixel unit, we get rid of the unit and keep the value 5376 // if is an implicit unit, it's px, and we return just the value 5377 return value; 5378 } 5379} 5380 5381/** 5382 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 5383 * @function 5384 * @memberof {modifiers~offset} 5385 * @private 5386 * @argument {String} offset 5387 * @argument {Object} popperOffsets 5388 * @argument {Object} referenceOffsets 5389 * @argument {String} basePlacement 5390 * @returns {Array} a two cells array with x and y offsets in numbers 5391 */ 5392function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 5393 var offsets = [0, 0]; 5394 5395 // Use height if placement is left or right and index is 0 otherwise use width 5396 // in this way the first offset will use an axis and the second one 5397 // will use the other one 5398 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 5399 5400 // Split the offset string to obtain a list of values and operands 5401 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 5402 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 5403 return frag.trim(); 5404 }); 5405 5406 // Detect if the offset string contains a pair of values or a single one 5407 // they could be separated by comma or space 5408 var divider = fragments.indexOf(find(fragments, function (frag) { 5409 return frag.search(/,|\s/) !== -1; 5410 })); 5411 5412 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 5413 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 5414 } 5415 5416 // If divider is found, we divide the list of values and operands to divide 5417 // them by ofset X and Y. 5418 var splitRegex = /\s*,\s*|\s+/; 5419 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 5420 5421 // Convert the values with units to absolute pixels to allow our computations 5422 ops = ops.map(function (op, index) { 5423 // Most of the units rely on the orientation of the popper 5424 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 5425 var mergeWithPrevious = false; 5426 return op 5427 // This aggregates any `+` or `-` sign that aren't considered operators 5428 // e.g.: 10 + +5 => [10, +, +5] 5429 .reduce(function (a, b) { 5430 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 5431 a[a.length - 1] = b; 5432 mergeWithPrevious = true; 5433 return a; 5434 } else if (mergeWithPrevious) { 5435 a[a.length - 1] += b; 5436 mergeWithPrevious = false; 5437 return a; 5438 } else { 5439 return a.concat(b); 5440 } 5441 }, []) 5442 // Here we convert the string values into number values (in px) 5443 .map(function (str) { 5444 return toValue(str, measurement, popperOffsets, referenceOffsets); 5445 }); 5446 }); 5447 5448 // Loop trough the offsets arrays and execute the operations 5449 ops.forEach(function (op, index) { 5450 op.forEach(function (frag, index2) { 5451 if (isNumeric(frag)) { 5452 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 5453 } 5454 }); 5455 }); 5456 return offsets; 5457} 5458 5459/** 5460 * @function 5461 * @memberof Modifiers 5462 * @argument {Object} data - The data object generated by update method 5463 * @argument {Object} options - Modifiers configuration and options 5464 * @argument {Number|String} options.offset=0 5465 * The offset value as described in the modifier description 5466 * @returns {Object} The data object, properly modified 5467 */ 5468function offset(data, _ref) { 5469 var offset = _ref.offset; 5470 var placement = data.placement, 5471 _data$offsets = data.offsets, 5472 popper = _data$offsets.popper, 5473 reference = _data$offsets.reference; 5474 5475 var basePlacement = placement.split('-')[0]; 5476 5477 var offsets = void 0; 5478 if (isNumeric(+offset)) { 5479 offsets = [+offset, 0]; 5480 } else { 5481 offsets = parseOffset(offset, popper, reference, basePlacement); 5482 } 5483 5484 if (basePlacement === 'left') { 5485 popper.top += offsets[0]; 5486 popper.left -= offsets[1]; 5487 } else if (basePlacement === 'right') { 5488 popper.top += offsets[0]; 5489 popper.left += offsets[1]; 5490 } else if (basePlacement === 'top') { 5491 popper.left += offsets[0]; 5492 popper.top -= offsets[1]; 5493 } else if (basePlacement === 'bottom') { 5494 popper.left += offsets[0]; 5495 popper.top += offsets[1]; 5496 } 5497 5498 data.popper = popper; 5499 return data; 5500} 5501 5502/** 5503 * @function 5504 * @memberof Modifiers 5505 * @argument {Object} data - The data object generated by `update` method 5506 * @argument {Object} options - Modifiers configuration and options 5507 * @returns {Object} The data object, properly modified 5508 */ 5509function preventOverflow(data, options) { 5510 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 5511 5512 // If offsetParent is the reference element, we really want to 5513 // go one step up and use the next offsetParent as reference to 5514 // avoid to make this modifier completely useless and look like broken 5515 if (data.instance.reference === boundariesElement) { 5516 boundariesElement = getOffsetParent(boundariesElement); 5517 } 5518 5519 // NOTE: DOM access here 5520 // resets the popper's position so that the document size can be calculated excluding 5521 // the size of the popper element itself 5522 var transformProp = getSupportedPropertyName('transform'); 5523 var popperStyles = data.instance.popper.style; // assignment to help minification 5524 var top = popperStyles.top, 5525 left = popperStyles.left, 5526 transform = popperStyles[transformProp]; 5527 5528 popperStyles.top = ''; 5529 popperStyles.left = ''; 5530 popperStyles[transformProp] = ''; 5531 5532 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 5533 5534 // NOTE: DOM access here 5535 // restores the original style properties after the offsets have been computed 5536 popperStyles.top = top; 5537 popperStyles.left = left; 5538 popperStyles[transformProp] = transform; 5539 5540 options.boundaries = boundaries; 5541 5542 var order = options.priority; 5543 var popper = data.offsets.popper; 5544 5545 var check = { 5546 primary: function primary(placement) { 5547 var value = popper[placement]; 5548 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 5549 value = Math.max(popper[placement], boundaries[placement]); 5550 } 5551 return defineProperty({}, placement, value); 5552 }, 5553 secondary: function secondary(placement) { 5554 var mainSide = placement === 'right' ? 'left' : 'top'; 5555 var value = popper[mainSide]; 5556 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 5557 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 5558 } 5559 return defineProperty({}, mainSide, value); 5560 } 5561 }; 5562 5563 order.forEach(function (placement) { 5564 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 5565 popper = _extends({}, popper, check[side](placement)); 5566 }); 5567 5568 data.offsets.popper = popper; 5569 5570 return data; 5571} 5572 5573/** 5574 * @function 5575 * @memberof Modifiers 5576 * @argument {Object} data - The data object generated by `update` method 5577 * @argument {Object} options - Modifiers configuration and options 5578 * @returns {Object} The data object, properly modified 5579 */ 5580function shift(data) { 5581 var placement = data.placement; 5582 var basePlacement = placement.split('-')[0]; 5583 var shiftvariation = placement.split('-')[1]; 5584 5585 // if shift shiftvariation is specified, run the modifier 5586 if (shiftvariation) { 5587 var _data$offsets = data.offsets, 5588 reference = _data$offsets.reference, 5589 popper = _data$offsets.popper; 5590 5591 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 5592 var side = isVertical ? 'left' : 'top'; 5593 var measurement = isVertical ? 'width' : 'height'; 5594 5595 var shiftOffsets = { 5596 start: defineProperty({}, side, reference[side]), 5597 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 5598 }; 5599 5600 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 5601 } 5602 5603 return data; 5604} 5605 5606/** 5607 * @function 5608 * @memberof Modifiers 5609 * @argument {Object} data - The data object generated by update method 5610 * @argument {Object} options - Modifiers configuration and options 5611 * @returns {Object} The data object, properly modified 5612 */ 5613function hide(data) { 5614 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 5615 return data; 5616 } 5617 5618 var refRect = data.offsets.reference; 5619 var bound = find(data.instance.modifiers, function (modifier) { 5620 return modifier.name === 'preventOverflow'; 5621 }).boundaries; 5622 5623 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 5624 // Avoid unnecessary DOM access if visibility hasn't changed 5625 if (data.hide === true) { 5626 return data; 5627 } 5628 5629 data.hide = true; 5630 data.attributes['x-out-of-boundaries'] = ''; 5631 } else { 5632 // Avoid unnecessary DOM access if visibility hasn't changed 5633 if (data.hide === false) { 5634 return data; 5635 } 5636 5637 data.hide = false; 5638 data.attributes['x-out-of-boundaries'] = false; 5639 } 5640 5641 return data; 5642} 5643 5644/** 5645 * @function 5646 * @memberof Modifiers 5647 * @argument {Object} data - The data object generated by `update` method 5648 * @argument {Object} options - Modifiers configuration and options 5649 * @returns {Object} The data object, properly modified 5650 */ 5651function inner(data) { 5652 var placement = data.placement; 5653 var basePlacement = placement.split('-')[0]; 5654 var _data$offsets = data.offsets, 5655 popper = _data$offsets.popper, 5656 reference = _data$offsets.reference; 5657 5658 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 5659 5660 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 5661 5662 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 5663 5664 data.placement = getOppositePlacement(placement); 5665 data.offsets.popper = getClientRect(popper); 5666 5667 return data; 5668} 5669 5670/** 5671 * Modifier function, each modifier can have a function of this type assigned 5672 * to its `fn` property.<br /> 5673 * These functions will be called on each update, this means that you must 5674 * make sure they are performant enough to avoid performance bottlenecks. 5675 * 5676 * @function ModifierFn 5677 * @argument {dataObject} data - The data object generated by `update` method 5678 * @argument {Object} options - Modifiers configuration and options 5679 * @returns {dataObject} The data object, properly modified 5680 */ 5681 5682/** 5683 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 5684 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 5685 * needed by the library. 5686 * 5687 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 5688 * All the other properties are configurations that could be tweaked. 5689 * @namespace modifiers 5690 */ 5691var modifiers = { 5692 /** 5693 * Modifier used to shift the popper on the start or end of its reference 5694 * element.<br /> 5695 * It will read the variation of the `placement` property.<br /> 5696 * It can be one either `-end` or `-start`. 5697 * @memberof modifiers 5698 * @inner 5699 */ 5700 shift: { 5701 /** @prop {number} order=100 - Index used to define the order of execution */ 5702 order: 100, 5703 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5704 enabled: true, 5705 /** @prop {ModifierFn} */ 5706 fn: shift 5707 }, 5708 5709 /** 5710 * The `offset` modifier can shift your popper on both its axis. 5711 * 5712 * It accepts the following units: 5713 * - `px` or unit-less, interpreted as pixels 5714 * - `%` or `%r`, percentage relative to the length of the reference element 5715 * - `%p`, percentage relative to the length of the popper element 5716 * - `vw`, CSS viewport width unit 5717 * - `vh`, CSS viewport height unit 5718 * 5719 * For length is intended the main axis relative to the placement of the popper.<br /> 5720 * This means that if the placement is `top` or `bottom`, the length will be the 5721 * `width`. In case of `left` or `right`, it will be the `height`. 5722 * 5723 * You can provide a single value (as `Number` or `String`), or a pair of values 5724 * as `String` divided by a comma or one (or more) white space
vendor: 9,957 bytes, lines 5724-5996
5724s.<br /> 5725 * The latter is a deprecated method because it leads to confusion and will be 5726 * removed in v2.<br /> 5727 * Additionally, it accepts additions and subtractions between different units. 5728 * Note that multiplications and divisions aren't supported. 5729 * 5730 * Valid examples are: 5731 * ``` 5732 * 10 5733 * '10%' 5734 * '10, 10' 5735 * '10%, 10' 5736 * '10 + 10%' 5737 * '10 - 5vh + 3%' 5738 * '-10px + 5vh, 5px - 6%' 5739 * ``` 5740 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 5741 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 5742 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 5743 * 5744 * @memberof modifiers 5745 * @inner 5746 */ 5747 offset: { 5748 /** @prop {number} order=200 - Index used to define the order of execution */ 5749 order: 200, 5750 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5751 enabled: true, 5752 /** @prop {ModifierFn} */ 5753 fn: offset, 5754 /** @prop {Number|String} offset=0 5755 * The offset value as described in the modifier description 5756 */ 5757 offset: 0 5758 }, 5759 5760 /** 5761 * Modifier used to prevent the popper from being positioned outside the boundary. 5762 * 5763 * A scenario exists where the reference itself is not within the boundaries.<br /> 5764 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 5765 * In this case we need to decide whether the popper should either: 5766 * 5767 * - detach from the reference and remain "trapped" in the boundaries, or 5768 * - if it should ignore the boundary and "escape with its reference" 5769 * 5770 * When `escapeWithReference` is set to`true` and reference is completely 5771 * outside its boundaries, the popper will overflow (or completely leave) 5772 * the boundaries in order to remain attached to the edge of the reference. 5773 * 5774 * @memberof modifiers 5775 * @inner 5776 */ 5777 preventOverflow: { 5778 /** @prop {number} order=300 - Index used to define the order of execution */ 5779 order: 300, 5780 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5781 enabled: true, 5782 /** @prop {ModifierFn} */ 5783 fn: preventOverflow, 5784 /** 5785 * @prop {Array} [priority=['left','right','top','bottom']] 5786 * Popper will try to prevent overflow following these priorities by default, 5787 * then, it could overflow on the left and on top of the `boundariesElement` 5788 */ 5789 priority: ['left', 'right', 'top', 'bottom'], 5790 /** 5791 * @prop {number} padding=5 5792 * Amount of pixel used to define a minimum distance between the boundaries 5793 * and the popper. This makes sure the popper always has a little padding 5794 * between the edges of its container 5795 */ 5796 padding: 5, 5797 /** 5798 * @prop {String|HTMLElement} boundariesElement='scrollParent' 5799 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 5800 * `viewport` or any DOM element. 5801 */ 5802 boundariesElement: 'scrollParent' 5803 }, 5804 5805 /** 5806 * Modifier used to make sure the reference and its popper stay near each other 5807 * without leaving any gap between the two. Especially useful when the arrow is 5808 * enabled and you want to ensure that it points to its reference element. 5809 * It cares only about the first axis. You can still have poppers with margin 5810 * between the popper and its reference element. 5811 * @memberof modifiers 5812 * @inner 5813 */ 5814 keepTogether: { 5815 /** @prop {number} order=400 - Index used to define the order of execution */ 5816 order: 400, 5817 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5818 enabled: true, 5819 /** @prop {ModifierFn} */ 5820 fn: keepTogether 5821 }, 5822 5823 /** 5824 * This modifier is used to move the `arrowElement` of the popper to make 5825 * sure it is positioned between the reference element and its popper element. 5826 * It will read the outer size of the `arrowElement` node to detect how many 5827 * pixels of conjunction are needed. 5828 * 5829 * It has no effect if no `arrowElement` is provided. 5830 * @memberof modifiers 5831 * @inner 5832 */ 5833 arrow: { 5834 /** @prop {number} order=500 - Index used to define the order of execution */ 5835 order: 500, 5836 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5837 enabled: true, 5838 /** @prop {ModifierFn} */ 5839 fn: arrow, 5840 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 5841 element: '[x-arrow]' 5842 }, 5843 5844 /** 5845 * Modifier used to flip the popper's placement when it starts to overlap its 5846 * reference element. 5847 * 5848 * Requires the `preventOverflow` modifier before it in order to work. 5849 * 5850 * **NOTE:** this modifier will interrupt the current update cycle and will 5851 * restart it if it detects the need to flip the placement. 5852 * @memberof modifiers 5853 * @inner 5854 */ 5855 flip: { 5856 /** @prop {number} order=600 - Index used to define the order of execution */ 5857 order: 600, 5858 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5859 enabled: true, 5860 /** @prop {ModifierFn} */ 5861 fn: flip, 5862 /** 5863 * @prop {String|Array} behavior='flip' 5864 * The behavior used to change the popper's placement. It can be one of 5865 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 5866 * placements (with optional variations) 5867 */ 5868 behavior: 'flip', 5869 /** 5870 * @prop {number} padding=5 5871 * The popper will flip if it hits the edges of the `boundariesElement` 5872 */ 5873 padding: 5, 5874 /** 5875 * @prop {String|HTMLElement} boundariesElement='viewport' 5876 * The element which will define the boundaries of the popper position. 5877 * The popper will never be placed outside of the defined boundaries 5878 * (except if `keepTogether` is enabled) 5879 */ 5880 boundariesElement: 'viewport', 5881 /** 5882 * @prop {Boolean} flipVariations=false 5883 * The popper will switch placement variation between `-start` and `-end` when 5884 * the reference element overlaps its boundaries. 5885 * 5886 * The original placement should have a set variation. 5887 */ 5888 flipVariations: false, 5889 /** 5890 * @prop {Boolean} flipVariationsByContent=false 5891 * The popper will switch placement variation between `-start` and `-end` when 5892 * the popper element overlaps its reference boundaries. 5893 * 5894 * The original placement should have a set variation. 5895 */ 5896 flipVariationsByContent: false 5897 }, 5898 5899 /** 5900 * Modifier used to make the popper flow toward the inner of the reference element. 5901 * By default, when this modifier is disabled, the popper will be placed outside 5902 * the reference element. 5903 * @memberof modifiers 5904 * @inner 5905 */ 5906 inner: { 5907 /** @prop {number} order=700 - Index used to define the order of execution */ 5908 order: 700, 5909 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 5910 enabled: false, 5911 /** @prop {ModifierFn} */ 5912 fn: inner 5913 }, 5914 5915 /** 5916 * Modifier used to hide the popper when its reference element is outside of the 5917 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 5918 * be used to hide with a CSS selector the popper when its reference is 5919 * out of boundaries. 5920 * 5921 * Requires the `preventOverflow` modifier before it in order to work. 5922 * @memberof modifiers 5923 * @inner 5924 */ 5925 hide: { 5926 /** @prop {number} order=800 - Index used to define the order of execution */ 5927 order: 800, 5928 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5929 enabled: true, 5930 /** @prop {ModifierFn} */ 5931 fn: hide 5932 }, 5933 5934 /** 5935 * Computes the style that will be applied to the popper element to gets 5936 * properly positioned. 5937 * 5938 * Note that this modifier will not touch the DOM, it just prepares the styles 5939 * so that `applyStyle` modifier can apply it. This separation is useful 5940 * in case you need to replace `applyStyle` with a custom implementation. 5941 * 5942 * This modifier has `850` as `order` value to maintain backward compatibility 5943 * with previous versions of Popper.js. Expect the modifiers ordering method 5944 * to change in future major versions of the library. 5945 * 5946 * @memberof modifiers 5947 * @inner 5948 */ 5949 computeStyle: { 5950 /** @prop {number} order=850 - Index used to define the order of execution */ 5951 order: 850, 5952 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5953 enabled: true, 5954 /** @prop {ModifierFn} */ 5955 fn: computeStyle, 5956 /** 5957 * @prop {Boolean} gpuAcceleration=true 5958 * If true, it uses the CSS 3D transformation to position the popper. 5959 * Otherwise, it will use the `top` and `left` properties 5960 */ 5961 gpuAcceleration: true, 5962 /** 5963 * @prop {string} [x='bottom'] 5964 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 5965 * Change this if your popper should grow in a direction different from `bottom` 5966 */ 5967 x: 'bottom', 5968 /** 5969 * @prop {string} [x='left'] 5970 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 5971 * Change this if your popper should grow in a direction different from `right` 5972 */ 5973 y: 'right' 5974 }, 5975 5976 /** 5977 * Applies the computed styles to the popper element. 5978 * 5979 * All the DOM manipulations are limited to this modifier. This is useful in case 5980 * you want to integrate Popper.js inside a framework or view library and you 5981 * want to delegate all the DOM manipulations to it. 5982 * 5983 * Note that if you disable this modifier, you must make sure the popper element 5984 * has its position set to `absolute` before Popper.js can do its work! 5985 * 5986 * Just disable this modifier and define your own to achieve the desired effect. 5987 * 5988 * @memberof modifiers 5989 * @inner 5990 */ 5991 applyStyle: { 5992 /** @prop {number} order=900 - Index used to define the order of execution */ 5993 order: 900, 5994 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 5995 enabled: true, 5996 /** @prop {ModifierFn} */
vendor: 9,127 bytes, lines 5997-6261
5997 fn: applyStyle, 5998 /** @prop {Function} */ 5999 onLoad: applyStyleOnLoad, 6000 /** 6001 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 6002 * @prop {Boolean} gpuAcceleration=true 6003 * If true, it uses the CSS 3D transformation to position the popper. 6004 * Otherwise, it will use the `top` and `left` properties 6005 */ 6006 gpuAcceleration: undefined 6007 } 6008}; 6009 6010/** 6011 * The `dataObject` is an object containing all the information used by Popper.js. 6012 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 6013 * @name dataObject 6014 * @property {Object} data.instance The Popper.js instance 6015 * @property {String} data.placement Placement applied to popper 6016 * @property {String} data.originalPlacement Placement originally defined on init 6017 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 6018 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 6019 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 6020 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 6021 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 6022 * @property {Object} data.boundaries Offsets of the popper boundaries 6023 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 6024 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 6025 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 6026 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 6027 */ 6028 6029/** 6030 * Default options provided to Popper.js constructor.<br /> 6031 * These can be overridden using the `options` argument of Popper.js.<br /> 6032 * To override an option, simply pass an object with the same 6033 * structure of the `options` object, as the 3rd argument. For example: 6034 * ``` 6035 * new Popper(ref, pop, { 6036 * modifiers: { 6037 * preventOverflow: { enabled: false } 6038 * } 6039 * }) 6040 * ``` 6041 * @type {Object} 6042 * @static 6043 * @memberof Popper 6044 */ 6045var Defaults = { 6046 /** 6047 * Popper's placement. 6048 * @prop {Popper.placements} placement='bottom' 6049 */ 6050 placement: 'bottom', 6051 6052 /** 6053 * Set this to true if you want popper to position it self in 'fixed' mode 6054 * @prop {Boolean} positionFixed=false 6055 */ 6056 positionFixed: false, 6057 6058 /** 6059 * Whether events (resize, scroll) are initially enabled. 6060 * @prop {Boolean} eventsEnabled=true 6061 */ 6062 eventsEnabled: true, 6063 6064 /** 6065 * Set to true if you want to automatically remove the popper when 6066 * you call the `destroy` method. 6067 * @prop {Boolean} removeOnDestroy=false 6068 */ 6069 removeOnDestroy: false, 6070 6071 /** 6072 * Callback called when the popper is created.<br /> 6073 * By default, it is set to no-op.<br /> 6074 * Access Popper.js instance with `data.instance`. 6075 * @prop {onCreate} 6076 */ 6077 onCreate: function onCreate() {}, 6078 6079 /** 6080 * Callback called when the popper is updated. This callback is not called 6081 * on the initialization/creation of the popper, but only on subsequent 6082 * updates.<br /> 6083 * By default, it is set to no-op.<br /> 6084 * Access Popper.js instance with `data.instance`. 6085 * @prop {onUpdate} 6086 */ 6087 onUpdate: function onUpdate() {}, 6088 6089 /** 6090 * List of modifiers used to modify the offsets before they are applied to the popper. 6091 * They provide most of the functionalities of Popper.js. 6092 * @prop {modifiers} 6093 */ 6094 modifiers: modifiers 6095}; 6096 6097/** 6098 * @callback onCreate 6099 * @param {dataObject} data 6100 */ 6101 6102/** 6103 * @callback onUpdate 6104 * @param {dataObject} data 6105 */ 6106 6107// Utils 6108// Methods 6109var Popper = function () { 6110 /** 6111 * Creates a new Popper.js instance. 6112 * @class Popper 6113 * @param {Element|referenceObject} reference - The reference element used to position the popper 6114 * @param {Element} popper - The HTML / XML element used as the popper 6115 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 6116 * @return {Object} instance - The generated Popper.js instance 6117 */ 6118 function Popper(reference, popper) { 6119 var _this = this; 6120 6121 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 6122 classCallCheck(this, Popper); 6123 6124 this.scheduleUpdate = function () { 6125 return requestAnimationFrame(_this.update); 6126 }; 6127 6128 // make update() debounced, so that it only runs at most once-per-tick 6129 this.update = debounce(this.update.bind(this)); 6130 6131 // with {} we create a new object with the options inside it 6132 this.options = _extends({}, Popper.Defaults, options); 6133 6134 // init state 6135 this.state = { 6136 isDestroyed: false, 6137 isCreated: false, 6138 scrollParents: [] 6139 }; 6140 6141 // get reference and popper elements (allow jQuery wrappers) 6142 this.reference = reference && reference.jquery ? reference[0] : reference; 6143 this.popper = popper && popper.jquery ? popper[0] : popper; 6144 6145 // Deep merge modifiers options 6146 this.options.modifiers = {}; 6147 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 6148 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 6149 }); 6150 6151 // Refactoring modifiers' list (Object => Array) 6152 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 6153 return _extends({ 6154 name: name 6155 }, _this.options.modifiers[name]); 6156 }) 6157 // sort the modifiers by order 6158 .sort(function (a, b) { 6159 return a.order - b.order; 6160 }); 6161 6162 // modifiers have the ability to execute arbitrary code when Popper.js get inited 6163 // such code is executed in the same order of its modifier 6164 // they could add new properties to their options configuration 6165 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 6166 this.modifiers.forEach(function (modifierOptions) { 6167 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 6168 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 6169 } 6170 }); 6171 6172 // fire the first update to position the popper in the right place 6173 this.update(); 6174 6175 var eventsEnabled = this.options.eventsEnabled; 6176 if (eventsEnabled) { 6177 // setup event listeners, they will take care of update the position in specific situations 6178 this.enableEventListeners(); 6179 } 6180 6181 this.state.eventsEnabled = eventsEnabled; 6182 } 6183 6184 // We can't use class properties because they don't get listed in the 6185 // class prototype and break stuff like Sinon stubs 6186 6187 6188 createClass(Popper, [{ 6189 key: 'update', 6190 value: function update$$1() { 6191 return update.call(this); 6192 } 6193 }, { 6194 key: 'destroy', 6195 value: function destroy$$1() { 6196 return destroy.call(this); 6197 } 6198 }, { 6199 key: 'enableEventListeners', 6200 value: function enableEventListeners$$1() { 6201 return enableEventListeners.call(this); 6202 } 6203 }, { 6204 key: 'disableEventListeners', 6205 value: function disableEventListeners$$1() { 6206 return disableEventListeners.call(this); 6207 } 6208 6209 /** 6210 * Schedules an update. It will run on the next UI update available. 6211 * @method scheduleUpdate 6212 * @memberof Popper 6213 */ 6214 6215 6216 /** 6217 * Collection of utilities useful when writing custom modifiers. 6218 * Starting from version 1.7, this method is available only if you 6219 * include `popper-utils.js` before `popper.js`. 6220 * 6221 * **DEPRECATION**: This way to access PopperUtils is deprecated 6222 * and will be removed in v2! Use the PopperUtils module directly instead. 6223 * Due to the high instability of the methods contained in Utils, we can't 6224 * guarantee them to follow semver. Use them at your own risk! 6225 * @static 6226 * @private 6227 * @type {Object} 6228 * @deprecated since version 1.8 6229 * @member Utils 6230 * @memberof Popper 6231 */ 6232 6233 }]); 6234 return Popper; 6235}(); 6236 6237/** 6238 * The `referenceObject` is an object that provides an interface compatible with Popper.js 6239 * and lets you use it as replacement of a real DOM node.<br /> 6240 * You can use this method to position a popper relatively to a set of coordinates 6241 * in case you don't have a DOM node to use as reference. 6242 * 6243 * ``` 6244 * new Popper(referenceObject, popperNode); 6245 * ``` 6246 * 6247 * NB: This feature isn't supported in Internet Explorer 10. 6248 * @name referenceObject 6249 * @property {Function} data.getBoundingClientRect 6250 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 6251 * @property {number} data.clientWidth 6252 * An ES6 getter that will return the width of the virtual reference element. 6253 * @property {number} data.clientHeight 6254 * An ES6 getter that will return the height of the virtual reference element. 6255 */ 6256 6257 6258Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 6259Popper.placements = placements; 6260Popper.Defaults = Defaults; 6261
6262return Popper; 6263 6264}))); 6265 6266 6267}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 6268},{}],12:[function(require,module,exports){ 6269"use strict"; 6270 6271Object.defineProperty(exports, "__esModule", { 6272 value: true 6273}); 6274exports.getGdpcEndpointCall = getGdpcEndpointCall; 6275exports.getLocalePath = getLocalePath; 6276exports.otAllowFunctionalCookies = otAllowFunctionalCookies; 6277exports.otAllowPerformanceCookies = otAllowPerformanceCookies; 6278exports.otAllowSocialMediaCookies = otAllowSocialMediaCookies; 6279exports.otAllowTargetingCookies = otAllowTargetingCookies; 6280exports.otGeoData = otGeoData; 6281exports.otWhenGroupsUpdated = otWhenGroupsUpdated; 6282var getRegion = require('ilmn/getRegion'); 6283var getLocale = require('ilmn/getLocale'); 6284function isLocalhost() { 6285 return window.location.hostname.indexOf('localhost') !== -1; 6286} 6287function otAllowPerformanceCookies() { 6288 return window.OnetrustActiveGroups.indexOf('C0002') !== -1; 6289} 6290function otAllowFunctionalCookies() { 6291 return window.OnetrustActiveGroups.indexOf('C0003') !== -1; 6292} 6293function otAllowTargetingCookies() { 6294 return window.OnetrustActiveGroups.indexOf('C0004') !== -1; 6295} 6296function otAllowSocialMediaCookies() { 6297 return window.OnetrustActiveGroups.indexOf('C0005') !== -1; 6298} 6299function otGeoData() { 6300 if (window.OneTrust) { 6301 return window.OneTrust.getGeolocationData(); 6302 } 6303} 6304function getLocalePath() { 6305 var localePath = ''; 6306 if (isLocalhost()) { 6307 localePath = 'amr/en_US'; 6308 if (getRegion() && getLocale()) { 6309 localePath = getRegion() + '/' + getLocale(); 6310 } 6311 } 6312 return localePath; 6313} 6314function getGdpcEndpointCall(type) { 6315 var _window$ecommerce; 6316 // make AJAX call and get data for Banner 6317 var hostname = 'https://www.illumina.com'; 6318 var localePath = getLocalePath(); 6319 var gdpcWebsites = ['www.sparkgen.com', 'community.illumina.com', 'www.genomicsforgood.com', /* lower enviros */ 6320 'sparkgen.val-web.illumina.com', 'genomicsforgood.val-web.illumina.com', 'etp.val-web.illumina.com', 'jpetp.val-web.illumina.com', 'emeaetp.val-web.illumina.com', 'sapacetp.val-web.illumina.com', 'www1.val-web.illumina.com.cn', 'www.tst-web.illumina.com', 'etp.tst-web.illumina.com', 'dcp.tst-web.illumina.com', 'etp2.tst-web.illumina.com', 'etp.stg-web.illumina.com', 'www.stg-web.illumina.com', 'www.dev-web.illumina.com', 'etp.dev-web.illumina.com', 'www1.tst-web.illumina.com', 'www1.stage-web.illumina.com', 'www1.val-npweb.illumina.com', 'emea1.val-npweb.illumina.com', 'sapac1.val-npweb.illumina.com', 'jp1.val-npweb.illumina.com', 'support1.val-npweb.illumina.com']; 6321 if (isLocalhost()) { 6322 hostname = ''; 6323 localePath = ''; 6324 } else if (typeof window.__aemServerHost !== 'undefined') { 6325 // only exists in WCS 6326 hostname = window.__aemServerHost; 6327 } else if (window.location.href.indexOf('/company/video-hub/') !== -1 || window.location.href.indexOf('/destination/') !== -1 || window.location.href.indexOf('/landing/') !== -1) { 6328 // solves for destination pages 6329 hostname = location.protocol + '//' + location.hostname; 6330 } else if ((_window$ecommerce = window.ecommerce) !== null && _window$ecommerce !== void 0 && (_window$ecommerce = _window$ecommerce.config) !== null && _window$ecommerce !== void 0 && _window$ecommerce.aemHostName) { 6331 // only for AEM env that has megamenu. 6332 hostname = window.ecommerce.config.aemHostName; 6333 } else if (gdpcWebsites.indexOf(window.location.hostname) !== -1) { 6334 // only for the other websites 6335 hostname = location.protocol + '//' + location.hostname; 6336 } else if (window.location.hostname === "tst.mi.ep-np.illumina.com") { 6337 hostname = location.protocol + '//' + "dcp.tst-web.illumina.com"; 6338 } else if (window.location.hostname === "dev.mi.ep-np.illumina.com") { 6339 hostname = location.protocol + '//' + "www2.dev-web.illumina.com"; 6340 } else if (window.location.hostname === "stg.mi.ep-np.illumina.com") { 6341 hostname = location.protocol + '//' + "www.stg-web.illumina.com"; 6342 } else if (window.location.hostname.indexOf("cpc.ep-np.illumina.com") !== -1) { 6343 hostname = location.protocol + '//' + "dcp.tst-web.illumina.com"; 6344 } 6345 return hostname + '/bin/gdpc/banners?type=' + type + '&localePath=' + localePath; 6346} 6347function otWhenGroupsUpdated(callback) { 6348 callback = typeof callback === 'function' ? callback : function () {}; 6349 var isUpdated = false;
6350 if (window.dataLayer) { 6351 window.dataLayer.forEach(function (item) { 6352 if (item.event === 'OneTrustGroupsUpdated') { 6353 isUpdated = true; 6354 } 6355 }); 6356 if (isUpdated) { 6357 callback(); 6358 } else { 6359 window.addEventListener('OneTrustGroupsUpdated', callback); 6360 } 6361 } else { 6362 console.error('dataLayer object does not exist'); 6363 } 6364} 6365 6366},{"ilmn/getLocale":8,"ilmn/getRegion":9}],13:[function(require,module,exports){ 6367"use strict"; 6368 6369var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 6370var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 6371var browserDetect = require('../../../sniffer/js/browserDetect'); 6372var appHelper = window.appHelper = module.exports = { 6373 init: function init() { 6374 appHelper.vars.aemhref = window.location.href; 6375 appHelper.vars.aemhost = window.location.hostname; 6376 }, 6377 region: function region() { 6378 var aemhost = appHelper.vars.aemhref; 6379 var region = 'global'; 6380 if (aemhost.indexOf("illumina.com.cn") > -1 || aemhost.indexOf("apac/zh_CN") > -1) { 6381 region = 'china'; 6382 } else if (aemhost.indexOf("jp.illumina.com") > -1 || aemhost.indexOf("jp.support.illumina.com") > -1 || aemhost.indexOf("apac/ja_JP") > -1) { 6383 region = 'japan'; 6384 } else if (aemhost.indexOf("sapac.illumina.com") > -1 || aemhost.indexOf("sapac.support.illumina.com") > -1 || aemhost.indexOf("spac/en_AU") > -1) { 6385 region = 'sapac'; 6386 } else if (aemhost.indexOf("emea.illumina.com") > -1 || aemhost.indexOf("emea.support.illumina.com") > -1 || aemhost.indexOf("emea/en_GB") > -1 || aemhost.indexOf("emeaetp.val-web.illumina.com/") > -1) { 6387 region = 'emea'; 6388 } else if (aemhost.indexOf("sparkgen.com") > -1 || aemhost.indexOf("sparkgen.val-web") > -1 || aemhost.indexOf("/content/sparkgen") > -1) { 6389 region = 'sparkgen'; 6390 } 6391 return region; 6392 }, 6393 getRegionLocale: function getRegionLocale() { 6394 var _document$querySelect, _document$querySelect2; 6395 // this logic currently does not account for support site /us/en vs /en 6396 var metaRegion = (_document$querySelect = document.querySelector('meta[name="region"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content; 6397 var metaLocale = (_document$querySelect2 = document.querySelector('meta[name="locale"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content; 6398 var finalLocale = "/en"; 6399 if (metaRegion && metaLocale) { 6400 finalLocale = "/" + metaRegion + "/" + metaLocale; 6401 } 6402 return finalLocale; 6403 }, 6404 dataRegion: function dataRegion() { 6405 var hostname = window.location.hostname, 6406 dataRegion, 6407 isSupportSite; 6408 switch (hostname) { 6409 case 'www.illumina.com': 6410 dataRegion = '/amr/en_US'; 6411 break; 6412 case 'support.illumina.com': 6413 dataRegion = '/us/en/support'; 6414 isSupportSite = true; 6415 break; 6416 case 'www.illumina.com.cn': 6417 dataRegion = '/apac/zh_CN'; 6418 break; 6419 case 'support.illumina.com.cn': 6420 dataRegion = '/apac/zh_CN/support'; 6421 isSupportSite = true; 6422 break; 6423 case 'jp.illumina.com': 6424 dataRegion = '/apac/ja_JP'; 6425 break; 6426 case 'jp.support.illumina.com': 6427 dataRegion = '/apac/ja_JP/support'; 6428 isSupportSite = true; 6429 break; 6430 case 'emea.illumina.com': 6431 dataRegion = '/emea/en_GB'; 6432 break; 6433 case 'emea.support.illumina.com': 6434 dataRegion = '/us/en/support'; 6435 isSupportSite = true; 6436 break; 6437 case 'sapac.illumina.com': 6438 dataRegion = '/spac/en_AU'; 6439 break; 6440 case 'sapac.support.illumina.com': 6441 dataRegion = '/us/en/support'; 6442 isSupportSite = true; 6443 break; 6444 default: 6445 dataRegion = '/en'; 6446 isSupportSite = window.location.href.indexOf('illumina-support') > -1; 6447 } 6448 var props = { 6449 'dataRegion': dataRegion, 6450 'isSupportSite': isSupportSite 6451 }; 6452 return props; 6453 }, 6454 env: function env() { 6455 var aemhost = appHelper.vars.aemhost; 6456 var env = 'localhost';
6457 Object.entries(appHelper.vars.envs).forEach(function (_ref) { 6458 var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 6459 key = _ref2[0], 6460 value = _ref2[1]; 6461 if (value.includes(aemhost)) { 6462 env = String(key).replace(/([A-Z])/g, function (partialString) { 6463 return "-" + partialString.toLowerCase(); 6464 }); 6465 } 6466 }); 6467 return env; 6468 }, 6469 getURL: function getURL() { 6470 var url = window.location.href, 6471 arr = url.split("/"), 6472 result = arr[0] + "//" + arr[2]; 6473 return result; 6474 }, 6475 guid: function guid() { 6476 function s4() { 6477 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 6478 } 6479 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); 6480 }, 6481 isIE: function isIE() { 6482 if (browserDetect.browser.indexOf('IE') > -1) { 6483 return true; 6484 } else { 6485 return false; 6486 } 6487 }, 6488 isMobile: function isMobile() { 6489 var mobile = false; 6490 (function (a) { 6491 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) mobile = true; 6492 })(navigator.userAgent || navigator.vendor || window.opera); 6493 return mobile; 6494 }, 6495 vars: { 6496 aemhref: null, 6497 aemhost: null, 6498 envs: { 6499 prodPublish: ['www.illumina.com.cn', 'illumina.com.cn', 'jp.illumina.com', 'sapac.illumina.com', 'emea.illumina.com', 'www.illumina.com', 'support.illumina.com.cn', 'jp.support.illumina.com', 'sapac.support.illumina.com', 'emea.support.illumina.com', 'support.illumina.com'], 6500 prodAuthor: ['prod-author.illumina.com'], 6501 stagePublish: ['www.stg-web.illumina.com'], 6502 stageAuthor: ['stage-author.illumina.com'], 6503 etpTest: ['etp.tst-web.illumina.com'], 6504 etpVal: ['etp.val-web.illumina.com', 'emeaetp.val-web.illumina.com'] 6505 } 6506 } 6507}; 6508appHelper.init(); 6509 6510},{"../../../sniffer/js/browserDetect":14,"@babel/runtime/helpers/interopRequireDefault":3,"@babel/runtime/helpers/slicedToArray":6}],14:[function(require,module,exports){ 6511"use strict"; 6512 6513var uaTestStrings = require('./uaTestStrings'); 6514var browserDetect = window.browserDetect = module.exports = { 6515 init: function init() { 6516 this.detectBrowser(navigator.userAgent); 6517 6518 // uncomment to print test cases to console 6519 // this.testBrowserDetection(); 6520 }, 6521 detectBrowser: function detectBrowser(uaString) { 6522 // Edge (legacy) 6523 if (uaString.indexOf('Edge/') > -1) { 6524 this.browser = 'Edge'; 6525 this.version = uaString.match(/Edge\/([^.]+)/)[1]; 6526 } 6527 // Edge (Chromium) 6528 else if (uaString.indexOf('Edg/') > -1) { 6529 this.browser = 'Edge'; 6530 this.version = uaString.match(/Edg\/([^.]+)/)[1]; 6531 } else if (uaString.indexOf('WOW64') > -1) { 6532 // IE 9/10 6533 if (uaString.indexOf('MSIE') > -1) { 6534 this.browser = 'IE'; 6535 this.version = '9/10'; 6536 // IE 11 6537 } else if (uaString.indexOf('rv:11') > -1) { 6538 this.browser = 'IE'; 6539 this.version = '11'; 6540 } 6541 } 6542 // Firefox 6543 else if (uaString.indexOf('Firefox') > -1) { 6544 this.browser = 'Firefox'; 6545 this.version = uaString.match(/Firefox\/([^.]+)/)[1]; 6546 } else if (uaString.indexOf('Safari') > -1) { 6547 // Chrome + Brave 6548 if (uaString.indexOf('Chrome') > -1) { 6549 this.browser = 'Chrome'; 6550 this.version = uaString.match(/Chrome\/([^.]+)/)[1]; 6551 } else { 6552 // Safari (iPhone) 6553 if (uaString.indexOf('iPhone') > -1) { 6554 this.browser = '(iPhone/iPod) Safari'; 6555 // Safari (iPad) 6556 } else if (uaString.indexOf('iPad') > -1) { 6557 this.browser = '(iPad) Safari'; 6558 // Safari (desktop) 6559 } else {
6560 this.browser = 'Safari'; 6561 } 6562 this.version = uaString.match(/Version\/([^.]+)/)[1]; 6563 } 6564 } 6565 return this.browser + ' ' + this.version; 6566 }, 6567 testBrowserDetection: function testBrowserDetection() { 6568 console.log('current UA string: ' + navigator.userAgent); 6569 for (var i = 0; i < uaTestStrings.length; i++) { 6570 var uaString = uaTestStrings[i].string; 6571 var expectedResult = uaTestStrings[i].output; 6572 console.log('Expected: ' + expectedResult + '\n' + 'Actual: ' + this.detectBrowser(uaString)); 6573 } 6574 } 6575}; 6576 6577},{"./uaTestStrings":15}],15:[function(require,module,exports){ 6578"use strict"; 6579 6580var uaTestStrings = [{ 6581 output: 'Edge 14', 6582 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393' 6583}, { 6584 output: 'Edge 16', 6585 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299' 6586}, { 6587 output: 'Edge 17', 6588 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' 6589}, { 6590 output: 'Edge 18', 6591 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363' 6592}, { 6593 output: 'Edge 80', 6594 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36 Edg/80.0.361.56' 6595}, { 6596 output: 'IE 9', 6597 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 6598}, { 6599 output: 'IE 10', 6600 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 6601}, { 6602 output: 'IE 11', 6603 string: 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko' 6604}, { 6605 output: 'Firefox 50', 6606 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0' 6607}, { 6608 output: 'Firefox 65', 6609 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0' 6610}, { 6611 output: 'Firefox 69', 6612 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0' 6613}, { 6614 output: 'Firefox 70', 6615 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0' 6616}, { 6617 output: 'Firefox 83', 6618 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0' 6619}, { 6620 output: 'Chrome 50', 6621 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36' 6622}, { 6623 output: 'Chrome 69', 6624 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36' 6625}, { 6626 output: 'Chrome 70', 6627 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36' 6628}, { 6629 output: 'Chrome 83', 6630 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' 6631}, { 6632 output: 'Safari 8', 6633 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9' 6634}, { 6635 output: 'Safari 9', 6636 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/601.7.8' 6637}, { 6638 output: 'Safari 10', 6639 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8' 6640}, { 6641 output: 'Safari 11', 6642 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15' 6643}, { 6644 output: 'Safari 12', 6645 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15' 6646}, { 6647 output: 'Safari 13', 6648 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15' 6649}, { 6650 output: 'Safari 14', 6651 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 6652}, { 6653 output: 'Chrome 87', 6654 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' 6655}, { 6656 output: 'Firefox 83', 6657 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0' 6658}, 6659// { 6660// output: 'Brave 1', 6661// string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36]' 6662// }, 6663{ 6664 output: '(iPhone/iPod) Safari 12', 6665 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 6666}, { 6667 output: '(iPhone/iPod) Safari 14', 6668 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1' 6669}, { 6670 output: '(iPad) Safari 12', 6671 string: 'Mozilla/5.0 (iPad; CPU OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 6672}, { 6673 output: '(iPad) Safari 14', 6674 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 6675}]; 6676module.exports = uaTestStrings; 6677 6678},{}],16:[function(require,module,exports){ 6679"use strict"; 6680 6681Object.defineProperty(exports, "__esModule", { 6682 value: true 6683}); 6684exports.default = getPageData; 6685/* eslint-disable camelcase */ 6686/* eslint complexity: "off" */ 6687/* global _ido */ 6688var appHelper = require('../../illumina/js/helpers/appHelper'); 6689function getPageData(ele, platform) { 6690 /* 6691 At this time it is advised that the DOM hierarchy of target elements from seperate pages n
6691ot be unified due to the disparity in UI markup. 6692 For the interium, the target elements have been updated with unified data attributes. 6693 In the future, DOM hierarchies of elements will have uniform structure to ensure data catpure is simplier and more consistent. 6694 */ 6695 switch (_ido.page_type) { 6696 // get page data for event card 6697 case 'events': 6698 { 6699 var activeEventSingle = document.querySelector('.social-share__tooltip.active'); 6700 var activeEventSingleParent = activeEventSingle.closest('.single-event'); 6701 var singleEventTitle = activeEventSingleParent.querySelector('.card-title').innerText; 6702 var singleEventTitleText = singleEventTitle.trim(); 6703 var singleEventDesc = activeEventSingleParent.querySelector('.card-text-additional-details').innerText; 6704 var singleEventDescText = singleEventDesc || ''; 6705 var singleEventLink = activeEventSingleParent.querySelector('.card-title a').getAttribute('href'); 6706 var singleEventURL = singleEventLink ? appHelper.getURL() + singleEventLink : window.location.href; 6707 var singleEventMeta = activeEventSingleParent.querySelector('.card-title a').getAttribute('data-track-article-meta'); 6708 var singleEventTrackingTitle = activeEventSingleParent.querySelector('.card-title a').getAttribute('data-track-title'); 6709 var singleEventPageData = { 6710 analytics: { 6711 item_title: singleEventTitleText.toLowerCase(), 6712 group_title: _ido.group_title, 6713 track_type: "social|share|".concat(platform), 6714 page_type: 'article', 6715 article_meta: singleEventMeta, 6716 event_type: 'interaction', 6717 audio_name: singleEventTrackingTitle 6718 }, 6719 page: { 6720 title: singleEventTitleText, 6721 desc: singleEventDescText, 6722 url: singleEventURL 6723 } 6724 }; 6725 return singleEventPageData; 6726 } 6727 // get page data for individual events 6728 case 'events_detail': 6729 { 6730 var eventTitleEle = document.querySelector('[data-share-primary-title]'); 6731 var eventTitle = eventTitleEle ? eventTitleEle.textContent : 'Illumina Event'; 6732 var eventDescEle = document.querySelector('[data-share-secondary-desc] p') || document.querySelector('[data-share-primary-desc] p'); 6733 var eventDesc = eventDescEle ? eventDescEle.textContent : ''; 6734 var eventPageData = { 6735 analytics: { 6736 item_title: eventTitle.toLowerCase(), 6737 group_title: _ido.group_title, 6738 track_type: "social|share|".concat(platform), 6739 page_type: 'article', 6740 article_meta: _ido.article_meta 6741 }, 6742 page: { 6743 title: eventTitle, 6744 desc: eventDesc, 6745 url: window.location.href 6746 } 6747 }; 6748 return eventPageData; 6749 } 6750 // get page data for news center 6751 case 'news_center': 6752 { 6753 var activeArticle = document.querySelector('.social-share__tooltip.active'); 6754 var activeArticleParent = activeArticle.closest('article'); 6755 var articleTitle = activeArticleParent.querySelector('[data-share-primary-title]'); 6756 var articleTitleText = articleTitle.textContent.trim(); 6757 var articleDesc = activeArticleParent.querySelector('[data-share-primary-desc] p').textContent; 6758 var articleLink = articleTitle.querySelector('a').getAttribute('href'); 6759 var articleURL = articleLink ? appHelper.getURL() + articleLink : window.location.href; 6760 var articleGroup = articleTitle.querySelector('a').getAttribute('data-track-group'); // Its odd that _ido.group_title is not used 6761 var articleUISlot = articleTitle.querySelector('a').getAttribute('data-track-ui-slot'); 6762 var articleMeta = articleTitle.querySelector('a').getAttribute('data-track-article-meta').split('|'); 6763 var articlePageData = { 6764 analytics: { 6765 item_title: articleTitleText.toLowerCase(), 6766 group_title: articleGroup, 6767 track_type: "social|share|".concat(platform), 6768 page_type: 'news_center', 6769 article_meta: articleMeta, 6770 track_ui_slot: articleUISlot 6771 }, 6772 page: { 6773 title: articleTitleText, 6774 desc: articleDesc, 6775 url: articleURL 6776 } 6777 }; 6778 return articlePageData; 6779 } 6780 // get page data for podcast individual pages 6781 case 'podcast/detail': 6782 { 6783 var activePodCastSingle = document.querySelector('.social-share__tooltip.active'); 6784 var activePodCastSingleParent; 6785 var singlePodTitle; 6786 var singlePodTitleText; 6787 var singlePodDesc; 6788 var singlePodDescText; 6789 var singlePodLink; 6790 var singlePodURL; 6791 var singlePodMeta; 6792 var singlePodTrackingTitle; 6793 if (activePodCastSingle.closest('.podcast-single') !== null) { 6794 // If podcast (main) 6795 activePodCastSingleParent = activePodCastSingle.closest('.podcast-single'); 6796 singlePodTitle = activePodCastSingleParent.querySelector('[data-share-primary-title]'); 6797 singlePodTitleText = singlePodTitle.textContent.trim(); 6798 singlePodDesc = activePodCastSingleParent.querySelector('[data-share-primary-desc]'); 6799 singlePodDescText = singlePodDesc ? singlePodDesc.textContent : ''; 6800 singlePodLink = singlePodTitle.getAttribute('href'); 6801 singlePodURL = singlePodLink ? appHelper.getURL() + singlePodLink : window.location.href; 6802 singlePodMeta = singlePodTitle.getAttribute('data-tags'); 6803 singlePodTrackingTitle = singlePodTitle.getAttribute('data-title'); 6804 } else { 6805 // If podcast card 6806 activePodCastSingleParent = activePodCastSingle.closest('.podcast-card'); 6807 singlePodTitle = activePodCastSingleParent.getAttribute('data-share-primary-title'); 6808 singlePodTitleText = singlePodTitle.trim(); 6809 singlePodDesc = activePodCastSingleParent.getAttribute('data-share-primary-desc'); 6810 singlePodDescText = singlePodDesc || ''; 6811 singlePodLink = activePodCastSingleParent.querySelector('a').getAttribute('href'); 6812 singlePodURL = singlePodLink ? appHelper.getURL() + singlePodLink : window.location.href; 6813 singlePodMeta = activePodCastSingleParent.querySelector('a').getAttribute('data-tags'); 6814 singlePodTrackingTitle = activePodCastSingleParent.querySelector('a').getAttribute('data-title'); 6815 } 6816 var singlePodPageData = { 6817 analytics: { 6818 item_title: 'podcast', 6819 group_title: 'podcast/episodes', 6820 track_type: "podcast/share/social/".concat(platform), 6821 page_type: 'podcast', 6822 article_meta: singlePodMeta, 6823 event_type: 'interaction', 6824 audio_name: singlePodTrackingTitle 6825 }, 6826 page: { 6827 title: singlePodTitleText.toLowerCase(), 6828 desc: singlePodDescText, 6829 url: singlePodURL 6830 } 6831 }; 6832 return singlePodPageData; 6833 } 6834 // get page data for podcast list page 6835 case 'podcast': 6836 { 6837 var activePodCastListItem = document.querySelector('.social-share__tooltip.active'); 6838 var activePodCastItemParent = activePodCastListItem.closest('.podcast-card'); 6839 var podCastItemTitle = activePodCastItemParent.querySelector('[data-share-primary-title]'); 6840 var podCastItemTitleText = podCastItemTitle.textContent.trim(); 6841 var podCastItemDesc = activePodCastItemParent.querySelector('[data-share-primary-desc]'); 6842 var podCastItemDescText = podCastItemDesc ? podCastItemDesc.textContent : ''; 6843 var podCastItemLink = podCastItemTitle.getAttribute('href'); 6844 var podCastItemURL = podCastItemLink ? appHelper.getURL() + podCastItemLink : window.location.href; 6845 var podCastItemMeta = podCastItemTitle.getAttribute('data-tags'); 6846 var podCastItemTrackingTitle = podCastItemTitle.getAttribute('data-title'); 6847 var listContainer = document.getElementById('PodcastsList'); 6848 var listItem = activePodCastItemParent.closest('.col-12'); 6849 var listItemIndex = Array.from(listContainer.children).indexOf(listItem); 6850 var podCastPageData = { 6851 analytics: { 6852 item_title: 'podcast', 6853 group_title: 'podcast/episodes', 6854 track_type: "podcast/share/social/".concat(platform), 6855 page_type: 'podcast', 6856 article_meta: podCastItemMeta, 6857 event_type: 'interaction', 6858 audio_name: podCastItemTrackingTitle, 6859 track_ui_slot: listItemIndex 6860 }, 6861 page: { 6862 title: podCastItemTitleText.toLowerCase(), 6863 desc: podCastItemDescText, 6864 url: podCastItemURL 6865 } 6866 }; 6867 return podCastPageData; 6868 } 6869 default: 6870 break; 6871 } 6872 return false;
6873} 6874 6875},{"../../illumina/js/helpers/appHelper":13}],17:[function(require,module,exports){ 6876"use strict"; 6877 6878var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 6879var _whenObjDefined = _interopRequireDefault(require("ilmn/whenObjDefined")); 6880var _popper = _interopRequireDefault(require("popper.js")); 6881var _otGlobals = require("../../gdpc/js/otGlobals"); 6882var _getPageData = _interopRequireDefault(require("./getPageData")); 6883/* eslint-disable linebreak-style */ 6884/* eslint-disable no-unused-expressions */ 6885 6886// import { fireAnalytics } from './fireAnalytics'; 6887 6888var SocialShare = { 6889 init: function init() { 6890 this.socialShares = Array.prototype.slice.call(document.querySelectorAll('.social-share__tooltip')); 6891 if (this.socialShares.length < 1) { 6892 return; 6893 } 6894 (0, _whenObjDefined.default)('OneTrust', this.oneTrustDefined); 6895 }, 6896 oneTrustDefined: function oneTrustDefined() { 6897 var socialMediaCookies = (0, _otGlobals.otAllowSocialMediaCookies)(); 6898 SocialShare.renderToolTipContainer(socialMediaCookies); 6899 SocialShare.registerEventListeners(); 6900 }, 6901 registerEventListeners: function registerEventListeners() { 6902 var _this = this;
6903 this.socialShares.forEach(function (el) { 6904 el.addEventListener('click', _this.revealTooltip.bind(_this)); 6905 el.addEventListener('mouseenter', _this.revealTooltip.bind(_this)); 6906 el.addEventListener('mouseleave', _this.hoverOffController.bind(_this)); 6907 }); 6908 this.selectSocial(); 6909 this.mouseOverTooltip(); 6910 this.mouseOutTooltip(); 6911 this.acceptSocialMediaCookies(); 6912 }, 6913 revealTooltip: function revealTooltip(e) { 6914 clearTimeout(this.hoverOffTimeOut); 6915 this.socialShareController = e.target; 6916 var socialShareBtn = this.socialShareController; 6917 var socialShareContainer = this.socialShareContainer; 6918 var socialShareTooltipId = socialShareContainer.getAttribute('id'); 6919 // eslint-disable-next-line no-unused-vars 6920 var anotherPopper = new _popper.default(socialShareBtn, socialShareContainer, { 6921 socialShareBtn: socialShareBtn, 6922 socialShareContainer: socialShareContainer, 6923 placement: 'bottom', 6924 modifiers: { 6925 arrow: { 6926 element: '.arrow' 6927 }, 6928 preventOverflow: { 6929 enabled: true 6930 }, 6931 offset: { 6932 enabled: true, 6933 offset: '0,7' 6934 } 6935 } 6936 }); 6937 socialShareContainer.classList.add('active'); 6938 socialShareBtn.classList.add('active'); 6939 socialShareBtn.setAttribute('aria-labelledby', socialShareTooltipId); 6940 }, 6941 hoverOffController: function hoverOffController() { 6942 var _this2 = this; 6943 this.hoverOffTimeOut = setTimeout(function () { 6944 _this2.socialShareController.removeAttribute('aria-labelledby'); 6945 _this2.socialShareContainer.classList.remove('active'); 6946 _this2.socialShareController.classList.remove('active'); 6947 }, 300); 6948 }, 6949 mouseOverTooltip: function mouseOverTooltip() { 6950 var _this3 = this; 6951 this.socialShareContainer.addEventListener('mouseenter', function () { 6952 clearTimeout(_this3.hoverOffTimeOut); 6953 }); 6954 }, 6955 mouseOutTooltip: function mouseOutTooltip() { 6956 var _this4 = this; 6957 this.socialShareContainer.addEventListener('mouseleave', function () { 6958 _this4.hoverOffController(); 6959 }); 6960 }, 6961 selectSocial: function selectSocial() { 6962 var _this5 = this; 6963 this.socialShareContainer.addEventListener('click', function (e) { 6964 e.preventDefault(); 6965 if (e.target.hasAttribute('data-share')) { 6966 var targetPlatform = e.target.dataset.share; 6967 var targetData = (0, _getPageData.default)(e.target, targetPlatform); 6968 var platforms = { 6969 facebook: { 6970 url: 'https://www.facebook.com/sharer/sharer.php' + "?u=".concat(encodeURIComponent(targetData.page.url), "&t=").concat(targetData.page.title.replace(/\s/g, '%20'), "&d=").concat(targetData.page.desc.replace(/\s/g, '%20')), 6971 width: 500, 6972 height: 450 6973 }, 6974 linkedin: { 6975 url: 'https://www.linkedin.com/shareArticle?' + 'mini=true' + "&url=".concat(encodeURIComponent(targetData.page.url)).concat(targetData.page.url.indexOf('press-releases') !== -1 ? '%26clear%3Dtrue' : '', "&title=").concat(encodeURIComponent(targetData.page.title), "&summary=").concat(encodeURIComponent(targetData.page.desc.replace(/\s/g, '%20')), "&source=illumina.com"), 6976 width: 520, 6977 height: 570 6978 }, 6979 twitter: { 6980 url: 'https://twitter.com/share' + "?url=".concat(encodeURIComponent(targetData.page.url), "&hashtags=illumina") + '&related=illumina' + "&text=".concat(encodeURIComponent(targetData.page.title)), 6981 width: 500, 6982 height: 450 6983 } 6984 }; 6985 _this5.shareInfo(platforms[targetPlatform]); 6986 // fireAnalytics(targetData.analytics); 6987 } 6988 }); 6989 }, 6990 shareInfo: function shareInfo(platform) { 6991 window.open(platform.url, 'popupWindow', "width=".concat(platform.width, ", height=").concat(platform.height, ", scrollbars=yes, location=no, menubar=no, status=no, toolbar=no")); 6992 }, 6993 acceptSocialMediaCookies: function acceptSocialMediaCookies() { 6994 this.socialShareContainer.addEventListener('click', function (e) { 6995 if (e.target.className === 'gdpc-trigger') { 6996 e.preventDefault(); 6997 window.OneTrust.AllowAll(); 6998 window.location.reload(); 6999 } 7000 }); 7001 }, 7002 renderToolTipContainer: function renderToolTipContainer(oneTrust) { 7003 var socialHTML = { 7004 share: "\n <div id=\"social-share__tooltip-container\" class=\"social-share__tooltip-container popover\" role=\"tooltip\">\n <div class=\"arrow\"></div>\n <h3 class=\"popover-header\"></h3><div class=\"popover-body\">\n <a href=\"#\" data-share=\"twitter\" class=\"trigger-share trigger-share-twitter action-icon\">
7004\n <span class=\"sr-only\">Share on Twitter </span>\n <span class=\"fab fa-twitter\"></span>\n </a> \n <a href=\"#\" data-share=\"facebook\" class=\"trigger-share trigger-share-facebook action-icon\">\n <span class=\"sr-only\">Share on Facebook </span>\n <span class=\"fab fa-facebook-f\"></span>\n </a> \n <a href=\"#\" data-share=\"linkedin\" class=\"trigger-share trigger-share-linkedin action-icon\">\n <span class=\"sr-only\">Share on Linkedin </span>\n <span class=\"fab fa-linkedin-in\"></span>\n </a>\n </div>\n </div> \n ", 7005 agree: "\n <div id=\"social-share__tooltip-container\" class=\"social-share__tooltip-container popover\" role=\"tooltip\">\n <div class=\"arrow\"></div>\n <h3 class=\"popover-header\"></h3>\n <div class=\"popover-body\">\n <a href=\"#\"class=\"gdpc-trigger\" title=\"Accept Cookies Button\">Accept Cookies</a> to enable content sharing.\n </div>\n </div> \n " 7006 }; 7007 var areCookiesEnabled = oneTrust ? socialHTML.share : socialHTML.agree; 7008 document.body.insertAdjacentHTML('beforeend', areCookiesEnabled); 7009 this.socialShareContainer = document.querySelector('.social-share__tooltip-container'); 7010 } 7011}; 7012window.addEventListener('load', function (event) { 7013 SocialShare.init(); 7014}); 7015 7016},{"../../gdpc/js/otGlobals":12,"./getPageData":16,"@babel/runtime/helpers/interopRequireDefault":3,"ilmn/whenObjDefined":10,"popper.js":11}]},{},[17]); 7017 7018(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 7019function _arrayLikeToArray(r, a) { 7020 (null == a || a > r.length) && (a = r.length); 7021 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; 7022 return n; 7023} 7024module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 7025},{}],2:[function(require,module,exports){ 7026function _arrayWithHoles(r) { 7027 if (Array.isArray(r)) return r; 7028} 7029module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; 7030},{}],3:[function(require,module,exports){ 7031function _interopRequireDefault(e) { 7032 return e && e.__esModule ? e : { 7033 "default": e 7034 }; 7035} 7036module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; 7037},{}],4:[function(require,module,exports){ 7038function _iterableToArrayLimit(r, l) { 7039 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; 7040 if (null != t) { 7041 var e, 7042 n, 7043 i, 7044 u, 7045 a = [], 7046 f = !0, 7047 o = !1; 7048 try { 7049 if (i = (t = t.call(r)).next, 0 === l) { 7050 if (Object(t) !== t) return; 7051 f = !1; 7052 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); 7053 } catch (r) { 7054 o = !0, n = r; 7055 } finally { 7056 try { 7057 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; 7058 } finally { 7059 if (o) throw n; 7060 } 7061 } 7062 return a; 7063 } 7064} 7065module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; 7066},{}],5:[function(require,module,exports){ 7067function _nonIterableRest() { 7068 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 7069} 7070module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; 7071},{}],6:[function(require,module,exports){ 7072var arrayWithHoles = require("./arrayWithHoles.js"); 7073var iterableToArrayLimit = require("./iterableToArrayLimit.js"); 7074var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); 7075var nonIterableRest = require("./nonIterableRest.js"); 7076function _slicedToArray(r, e) { 7077 return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); 7078} 7079module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 7080},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":4,"./nonIterableRest.js":5,"./unsupportedIterableToArray.js":7}],7:[function(require,module,exports){ 7081var arrayLikeToArray = require("./arrayLikeToArray.js"); 7082function _unsupportedIterableToArray(r, a) { 7083 if (r) { 7084 if ("string" == typeof r) return arrayLikeToArray(r, a); 7085 var t = {}.toString.call(r).slice(8, -1); 7086 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; 7087 } 7088} 7089module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; 7090},{"./arrayLikeToArray.js":1}],8:[function(require,module,exports){ 7091"use strict"; 7092 7093var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 7094var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 7095var browserDetect = require('../../../sniffer/js/browserDetect'); 7096var appHelper = window.appHelper = module.exports = {
7097 init: function init() { 7098 appHelper.vars.aemhref = window.location.href; 7099 appHelper.vars.aemhost = window.location.hostname; 7100 }, 7101 region: function region() { 7102 var aemhost = appHelper.vars.aemhref; 7103 var region = 'global'; 7104 if (aemhost.indexOf("illumina.com.cn") > -1 || aemhost.indexOf("apac/zh_CN") > -1) { 7105 region = 'china'; 7106 } else if (aemhost.indexOf("jp.illumina.com") > -1 || aemhost.indexOf("jp.support.illumina.com") > -1 || aemhost.indexOf("apac/ja_JP") > -1) { 7107 region = 'japan'; 7108 } else if (aemhost.indexOf("sapac.illumina.com") > -1 || aemhost.indexOf("sapac.support.illumina.com") > -1 || aemhost.indexOf("spac/en_AU") > -1) { 7109 region = 'sapac'; 7110 } else if (aemhost.indexOf("emea.illumina.com") > -1 || aemhost.indexOf("emea.support.illumina.com") > -1 || aemhost.indexOf("emea/en_GB") > -1 || aemhost.indexOf("emeaetp.val-web.illumina.com/") > -1) { 7111 region = 'emea'; 7112 } else if (aemhost.indexOf("sparkgen.com") > -1 || aemhost.indexOf("sparkgen.val-web") > -1 || aemhost.indexOf("/content/sparkgen") > -1) { 7113 region = 'sparkgen'; 7114 } 7115 return region; 7116 }, 7117 getRegionLocale: function getRegionLocale() { 7118 var _document$querySelect, _document$querySelect2; 7119 // this logic currently does not account for support site /us/en vs /en 7120 var metaRegion = (_document$querySelect = document.querySelector('meta[name="region"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content; 7121 var metaLocale = (_document$querySelect2 = document.querySelector('meta[name="locale"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content; 7122 var finalLocale = "/en"; 7123 if (metaRegion && metaLocale) { 7124 finalLocale = "/" + metaRegion + "/" + metaLocale; 7125 } 7126 return finalLocale; 7127 }, 7128 dataRegion: function dataRegion() { 7129 var hostname = window.location.hostname, 7130 dataRegion, 7131 isSupportSite; 7132 switch (hostname) { 7133 case 'www.illumina.com': 7134 dataRegion = '/amr/en_US'; 7135 break; 7136 case 'support.illumina.com': 7137 dataRegion = '/us/en/support'; 7138 isSupportSite = true; 7139 break; 7140 case 'www.illumina.com.cn': 7141 dataRegion = '/apac/zh_CN'; 7142 break; 7143 case 'support.illumina.com.cn': 7144 dataRegion = '/apac/zh_CN/support'; 7145 isSupportSite = true; 7146 break; 7147 case 'jp.illumina.com': 7148 dataRegion = '/apac/ja_JP'; 7149 break; 7150 case 'jp.support.illumina.com': 7151 dataRegion = '/apac/ja_JP/support'; 7152 isSupportSite = true; 7153 break; 7154 case 'emea.illumina.com': 7155 dataRegion = '/emea/en_GB'; 7156 break; 7157 case 'emea.support.illumina.com': 7158 dataRegion = '/us/en/support'; 7159 isSupportSite = true; 7160 break; 7161 case 'sapac.illumina.com': 7162 dataRegion = '/spac/en_AU'; 7163 break; 7164 case 'sapac.support.illumina.com': 7165 dataRegion = '/us/en/support'; 7166 isSupportSite = true; 7167 break; 7168 default: 7169 dataRegion = '/en'; 7170 isSupportSite = window.location.href.indexOf('illumina-support') > -1; 7171 } 7172 var props = { 7173 'dataRegion': dataRegion, 7174 'isSupportSite': isSupportSite 7175 }; 7176 return props; 7177 }, 7178 env: function env() { 7179 var aemhost = appHelper.vars.aemhost; 7180 var env = 'localhost'; 7181 Object.entries(appHelper.vars.envs).forEach(function (_ref) { 7182 var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 7183 key = _ref2[0], 7184 value = _ref2[1]; 7185 if (value.includes(aemhost)) { 7186 env = String(key).replace(/([A-Z])/g, function (partialString) { 7187 return "-" + partialString.toLowerCase(); 7188 }); 7189 } 7190 }); 7191 return env; 7192 }, 7193 getURL: function getURL() { 7194 var url = window.location.href, 7195 arr = url.split("/"), 7196 result = arr[0] + "//" + arr[2]; 7197 return result; 7198 }, 7199 guid: function guid() { 7200 function s4() { 7201 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 7202 } 7203 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); 7204 }, 7205 isIE: function isIE() { 7206 if (browserDetect.browser.indexOf('IE') > -1) { 7207 return true; 7208 } else { 7209 return false;
7210 } 7211 }, 7212 isMobile: function isMobile() { 7213 var mobile = false; 7214 (function (a) { 7215 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) mobile = true; 7216 })(navigator.userAgent || navigator.vendor || window.opera); 7217 return mobile; 7218 }, 7219 vars: { 7220 aemhref: null, 7221 aemhost: null, 7222 envs: { 7223 prodPublish: ['www.illumina.com.cn', 'illumina.com.cn', 'jp.illumina.com', 'sapac.illumina.com', 'emea.illumina.com', 'www.illumina.com', 'support.illumina.com.cn', 'jp.support.illumina.com', 'sapac.support.illumina.com', 'emea.support.illumina.com', 'support.illumina.com'], 7224 prodAuthor: ['prod-author.illumina.com'], 7225 stagePublish: ['www.stg-web.illumina.com'], 7226 stageAuthor: ['stage-author.illumina.com'], 7227 etpTest: ['etp.tst-web.illumina.com'], 7228 etpVal: ['etp.val-web.illumina.com', 'emeaetp.val-web.illumina.com'] 7229 } 7230 } 7231}; 7232appHelper.init(); 7233 7234},{"../../../sniffer/js/browserDetect":13,"@babel/runtime/helpers/interopRequireDefault":3,"@babel/runtime/helpers/slicedToArray":6}],9:[function(require,module,exports){ 7235"use strict"; 7236 7237var mm, 7238 multimedia = window.mm = window.multimedia = module.exports = { 7239 init: function init() { 7240 mm = { 7241 media: $('.media-item'), 7242 mediaContainer: $('.results-container'), 7243 tags: [], 7244 tagsContainer: $('.tags-container'), 7245 downloadLink: $('.download-link'), 7246 modal: $('#ncModal'), 7247 modalTerms: $('#ncModal .modal-terms'), 7248 modalImage: $('#ncModal .modal-image'), 7249 modalImageRequest: $('#ncModal .modal-image-request'), 7250 modalThankYou: $('#ncModal .modal-image-thank-you') 7251 }; 7252 $('body').addClass('images-multimedia'); 7253 this.listeners(); 7254 }, 7255 listeners: function listeners() { 7256 multimedia.filter(); 7257 multimedia.modalManager(); 7258 multimedia.formValidate(); 7259 }, 7260 filter: function filter() { 7261 multimedia.createTags(); 7262 multimedia.filterByTags(); 7263 }, 7264 createTags: function createTags() { 7265 mm.media.each(function () { 7266 var self = $(this), 7267 tag = self.data(), 7268 tags = mm.tags; 7269 if (tags.indexOf(tag.tags) < 0) { 7270 tags.push(tag.tags); 7271 } 7272 }); 7273 mm.tags.sort(); 7274 for (var t in mm.tags) { 7275 mm.tagsContainer.append('<li class="pt-1"><a href="javascript:;" data-filter="' + mm.tags[t] + '" class="btn btn-sm">' + mm.tags[t].replace(/_/, ' ') + '</a></li>'); 7276 } 7277 }, 7278 filterByTags: function filterByTags() { 7279 mm.tagsContainer.on('click', 'li a', function (e) { 7280 var tag = $(this).attr('data-filter'); 7281 mm.tagsContainer.find('li').removeClass('active'); 7282 $(this).parent().addClass('active'); 7283 if (tag == 'all') { 7284 mm.media.fadeIn(); 7285 } else { 7286 mm.media.hide(); 7287 mm.media.each(function (index) { 7288 if ($.inArray(tag, mm.tags) !== -1) { 7289 $('[data-tags="' + tag + '"]').fadeIn(); 7290 } 7291 }); 7292 } 7293 }); 7294 }, 7295 modalManager: function modalManager() { 7296 mm.modal = $('#ncModal'), mm.modalTerms = mm.modal.find('.modal
7296-terms'), mm.modalImage = mm.modal.find('.modal-image'), mm.modalImageRequest = mm.modal.find('.modal-image-request'), mm.modalThankYou = mm.modal.find('.modal-image-thank-you'); 7297 multimedia.hideModals(); 7298 mm.modal.on('shown.bs.modal', function (e) { 7299 //set variables associated with click event. 7300 var target = e.relatedTarget, 7301 media = $(target).closest('.media-item'), 7302 url = target.id, 7303 img = $(media).find('.media-thumb img').clone(); 7304 7305 //check to see what triggered the click 7306 if ($(target).is('#imageRequest')) { 7307 multimedia.showImageRequestModal(); 7308 } else if ($(target).is('.download-link')) { 7309 if ($(media).hasClass('downloaded')) { 7310 multimedia.showImageModal(url); 7311 } else { 7312 multimedia.showTermsModal(img, url); 7313 } 7314 } 7315 }); 7316 mm.modal.on('hidden.bs.modal', function (e) { 7317 multimedia.hideModals(); 7318 }); 7319 }, 7320 hideModals: function hideModals() { 7321 mm.modal.find('.modal-body').children().hide(); 7322 mm.modalTerms.find('img').remove(); 7323 mm.modalImage.find('img').attr('src', ''); 7324 mm.modalImageRequest.find('.form-group').removeClass('has-error'); 7325 $('.form-error-message').hide(); 7326 }, 7327 showTermsModal: function showTermsModal(img, url) { 7328 if (img) { 7329 img.data('id', url).addClass('img-fluid').addClass('center-block'); 7330 mm.modalTerms.find('.image-preview').prepend(img); 7331 mm.modalTerms.find('#imgSource').val(img.attr('alt')); 7332 } 7333 mm.modalTerms.fadeIn(); 7334 }, 7335 showImageModal: function showImageModal(url) { 7336 if (url) { 7337 mm.modalImage.fadeIn(function () { 7338 $(this).find('img').attr('src', "//assets.illumina.com/" + url); 7339 }); 7340 } 7341 }, 7342 showImageRequestModal: function showImageRequestModal() { 7343 mm.modalImageRequest.fadeIn(); 7344 }, 7345 formValidate: function formValidate() { 7346 var requestForm = mm.modal.find('form'); 7347 requestForm.on({ 7348 submit: function submit(e) { 7349 e.preventDefault(); 7350 var form = $(this), 7351 inputs = form.find('input[type="text"], input[type="email"], textarea'), 7352 checkbox = $("#accept"), 7353 imgId = mm.modalTerms.find('.image-preview').find('img').length ? mm.modalTerms.find('.image-preview').find('img').data('id') : '', 7354 pass = true; 7355 inputs.each(function () { 7356 var formGroup = $(this).closest('.form-group'); 7357 if (!this.value.length || this.name === "duedate" && !/^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{2})$/.test(this.value)) { 7358 formGroup.addClass('has-error'); 7359 pass = false; 7360 $('.form-error-message').show(); 7361 } else { 7362 formGroup.removeClass('has-error'); 7363 $('.form-error-message').hide(); 7364 } 7365 }); 7366 if (!checkbox[0].checked) { 7367 $(checkbox[0]).closest('.form-group').addClass('has-error'); 7368 pass = false; 7369 } 7370 if (pass) { 7371 var url = form.attr('action'); 7372 if (imgId.length) { 7373 multimedia.formSubmit(form, url, imgId); 7374 } else { 7375 multimedia.formSubmit(form, url); 7376 } 7377 } 7378 } 7379 }); 7380 }, 7381 formSubmit: function formSubmit(form, url, imgId) { 7382 var data = form.serialize(); 7383 $.ajax({ 7384 method: "POST", 7385 url: url, 7386 data: data 7387 }); 7388 mm.modalTerms.hide(); 7389 multimedia.formHandler(imgId); 7390 }, 7391 formHandler: function formHandler(imgId) { 7392 if (imgId) { 7393 mm.modalImage.fadeIn(function () { 7394 $(this).find('img').attr('src', '//assets.illumina.com/' + imgId).addClass('img-fluid'); 7395 var btn = document.getElementById(imgId); 7396 $(btn).closest('.media-item').addClass('downloaded'); 7397 $(btn).text('Download Image'); 7398 }); 7399 } else { 7400 mm.modalThankYou.fadeIn(); 7401 } 7402 } 7403 }; 7404 7405},{}],10:[function(require,module,exports){ 7406"use strict"; 7407 7408var newsCenter = require('./news-center'); 7409var nasdaqForm = require('./nasdaqform'); 7410window.addEventListener('DOMContentLoaded', function () { 7411 newsCenter.init();
7412 nasdaqForm.init(); 7413}); 7414window.addEventListener('load', function () { 7415 newsCenter.loader(); 7416}); 7417 7418},{"./nasdaqform":11,"./news-center":12}],11:[function(require,module,exports){ 7419"use strict"; 7420 7421var nasdaqForm = window.nasdaqForm = module.exports = { 7422 init: function init() { 7423 this.loader(); 7424 this.listeners(); 7425 }, 7426 loader: function loader() { 7427 // $(window).load(function(){ 7428 $(window).on('load', function () { 7429 $(".nasdaq-response").hide(); 7430 nasdaqForm.nasdaqChecksInit(); 7431 nasdaqForm.nasdaqResponse(); 7432 }); 7433 }, 7434 listeners: function listeners() { 7435 $('#stockUpdates').on('hidden.bs.modal', function () { 7436 nasdaqForm.resetForm(); 7437 }); 7438 }, 7439 resetForm: function resetForm() { 7440 $('.nasdaq-email').show(); 7441 $(".nasdaq-response").hide(); 7442 $("#nasdaq-error-response").empty(); 7443 $(".requested").empty(); 7444 $(".rejected").empty(); 7445 $("#nasdaqalertemailid").empty(); 7446 nasdaqForm.vars.nasdaqrequestedAlerts = []; 7447 nasdaqForm.vars.nasdaqrejectedAlerts = []; 7448 }, 7449 nasdaqChecksInit: function nasdaqChecksInit() { 7450 $(".nasdaq-alerts input:radio:even").prop("checked", true); 7451 }, 7452 emailCheck: function emailCheck() { 7453 var email = $('#control_AlertEmail'); 7454 var emailTest = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 7455 if (emailTest.test(email.val())) { 7456 email.removeClass('is-invalid'); 7457 return true; 7458 } else { 7459 email.addClass('is-invalid'); 7460 return false; 7461 } 7462 }, 7463 nasdaqSubmitEnable: function nasdaqSubmitEnable() { 7464 var submitBtn = $('#nasdaqAlertSubmit'); 7465 nasdaqForm.emailCheck(); 7466 if (submitBtn.length && submitBtn.prop('disabled', true)) { 7467 submitBtn.prop('disabled', false); 7468 } 7469 }, 7470 nasdaqResponse: function nasdaqResponse() { 7471 $("#nasdaqAlertSubmit").on("click", function (e) { 7472 e.preventDefault(); 7473 e.stopPropagation(); 7474 if (!nasdaqForm.emailCheck()) { 7475 return false; 7476 } 7477 nasdaqForm.vars.nasdaqEmail = $("#control_AlertEmail").val(); 7478 if (!String.prototype.startsWith) { 7479 String.prototype.startsWith = function (searchString, position) { 7480 position = position || 0; 7481 return this.indexOf(searchString, position) === position; 7482 }; 7483 } 7484 $('input[type=radio]').each(function () { 7485 if ($(this).is(':checked')) { 7486 var nasdaqAlertValue = $(this).val(); 7487 if (nasdaqAlertValue != "") { 7488 if (nasdaqAlertValue.startsWith("ir")) { 7489 nasdaqForm.vars.nasdaqrequestedAlerts.push(nasdaqAlertValue); 7490 } 7491 } else { 7492 if ($(this).attr("name").startsWith("ir")) { 7493 nasdaqForm.vars.nasdaqrejectedAlerts.push($(this).attr("name")); 7494 } 7495 } 7496 } 7497 }); 7498 var grecaptcharesponse = $("#g-recaptcha-response").val(); 7499 var reqs = nasdaqForm.vars.nasdaqrequestedAlerts.toString(); 7500 var rejects = nasdaqForm.vars.nasdaqrejectedAlerts.toString(); 7501 $(".nasdaq-response").show(); 7502 $(".nasdaq-email").hide(); 7503 $.ajax({ 7504 url: "/bin/recaptchaValidationServlet?g-recaptcha-response=" + grecaptcharesponse, 7505 type: 'GET', 7506 dataType: 'json', 7507 timeout: 5000, 7508 success: function success(returndata) { 7509 if (returndata.status === "success") { 7510 $.ajax({ 7511 url: "/bin/nasdaqformservlet?nasdaqrequestedAlertsString=" + reqs + "&nasdaqrejectedAlertsString=" + rejects + "&nasdaqEmail=" + nasdaqForm.vars.nasdaqEmail, 7512 type: 'GET', 7513 dataType: 'json', 7514 timeout: 5000, 7515 success: function success(data) { 7516 if (data.length > 0) { 7517 for (var i = 0; i < data.length; i++) { 7518 var status = data[i].Status; 7519 if (status.indexOf("</error>") > -1 || status.indexOf("</Error>") > -1) { 7520 $("#nasdaq-error-response").empty().append("This form was not submitted properly"); 7521 } else { 7522 if (i === 0) { 7523 var nasdaqrequestedAlertshtml = '<span class="ccbnTxt">Your request to subscribe to the following list(s) has been submitted:</span><br><br><span class="ccbnTxtBold">'; 7524 for (var j = 0; j < nasdaqForm.vars.nasdaqrequestedAlerts.length; j++) {
7525 nasdaqrequestedAlertshtml += $("." + nasdaqForm.vars.nasdaqrequestedAlerts[j]).text() + '<br>'; 7526 } 7527 nasdaqrequestedAlertshtml += '</span><br><br>'; 7528 $(".requested").append(nasdaqrequestedAlertshtml); 7529 var nasdaqrejectedAlertshtml = '<span class="ccbnTxt">You are currently not subscribed to the following list(s):</span><br><br><span class="ccbnTxtBold">'; 7530 for (var k = 0; k < nasdaqForm.vars.nasdaqrejectedAlerts.length; k++) { 7531 nasdaqrejectedAlertshtml += $("." + nasdaqForm.vars.nasdaqrejectedAlerts[k]).text() + '<br>'; 7532 } 7533 nasdaqrejectedAlertshtml += '</span><br><br>'; 7534 $(".rejected").append(nasdaqrejectedAlertshtml); 7535 var nasdaqalertemailidhtml = 'An e-mail with user validation has been sent to (' + nasdaqForm.vars.nasdaqEmail + '). To complete the process, please follow the instructions in the e-mail.'; 7536 $("#nasdaqalertemailid").append(nasdaqalertemailidhtml); 7537 } 7538 } 7539 } // END FOR 7540 } 7541 }, 7542 error: function error(jqXHR, exception) { 7543 var msg = ''; 7544 if (jqXHR.status === 0) { 7545 msg = 'Could not connect. Verify Network.'; 7546 } else if (jqXHR.status == 404) { 7547 msg = 'Requested page not found. [404]'; 7548 } else if (jqXHR.status == 500) { 7549 msg = 'Internal Server Error [500].'; 7550 } else if (exception === 'parsererror') { 7551 msg = 'Requested JSON parse failed.'; 7552 } else if (exception === 'timeout') { 7553 msg = 'Time out error.'; 7554 } else if (exception === 'abort') { 7555 msg = 'Ajax request aborted.'; 7556 } else { 7557 msg = 'Uncaught Error.\n' + jqXHR.responseText; 7558 } 7559 console.log("ERROR in NASDAQ GET REQ: " + msg); 7560 $("#nasdaq-error-response").empty().append(msg); 7561 } 7562 }); // END 2nd AJAX CALL 7563 } else { 7564 $("#nasdaq-error-response").empty().append("The form is not submitted properly"); 7565 } 7566 }, 7567 error: function error(jqXHR, exception) { 7568 var msg = ''; 7569 if (jqXHR.status === 0) { 7570 msg = 'Could not connect. Verify Network.'; 7571 } else if (jqXHR.status == 404) { 7572 msg = 'Requested page not found. [404]'; 7573 } else if (jqXHR.status == 500) { 7574 msg = 'Internal Server Error [500].'; 7575 } else if (exception === 'parsererror') { 7576 msg = 'Requested JSON parse failed.'; 7577 } else if (exception === 'timeout') { 7578 msg = 'Time out error.'; 7579 } else if (exception === 'abort') { 7580 msg = 'Ajax request aborted.'; 7581 } else { 7582 msg = 'Uncaught Error.\n' + jqXHR.responseText; 7583 } 7584 console.log("ERROR IN CAPTCHA GET REQ: " + msg); 7585 $("#nasdaq-error-response").empty().append(msg); 7586 } 7587 }); // END 1ST AJAX CALL 7588 }); // #nasdaq-recaptcha-submit CLICK FUNCTION 7589 }, 7590 // nasdaqResponse FUNCTION 7591 vars: { 7592 nasdaqEmail: "", 7593 nasdaqrequestedAlerts: [], 7594 nasdaqrejectedAlerts: [] 7595 } 7596}; // monolithic nasdaqForm {} 7597 7598},{}],12:[function(require,module,exports){ 7599"use strict"; 7600 7601var multimedia = require('./illumina-images'); 7602// const modalManager = require('../../illumina/js/helpers/modalManager'); 7603var appHelper = require('../../illumina/js/helpers/appHelper'); 7604var newsCenter = { 7605 // initialize anything here to be initialized on $(document).ready() 7606 init: function init() { 7607 this.pageReady(); 7608 // ncSocialShare.init(); 7609 7610 if (window.location.href.indexOf('multimedia-images') > -1) { 7611 multimedia.init(); 7612 } 7613 }, 7614 // functions to be initialized after init() function 7615 pageReady: function pageReady() { 7616 this.listeners(); 7617 }, 7618 // functions to load after all elements have been painted to the DOM 7619 loader: function loader() {}, 7620 // listeners to load here 7621 listeners: function listeners() { 7622 // $('[data-trigger="ncSubscribe"]').on('click', (e) => { 7623 // e.preventDefault(); 7624 // e.stopPropagation(); 7625 // newsCenter.subscribe(); 7626 // }); 7627 7628 newsCenter.sidebarSwitcher(); 7629 }, 7630 // subscribe() { 7631 // const html = ` 7632 // <div class="modal-header"> 7633 // <h5 class="modal-title">Subscribe to upcoming featured articles</h5> 7634 // <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> 7635 // </div> 7636 // <div class="modal-body"> 7637 // <iframe class="nc-subscribe" src="//us.vocuspr.com/Newsroom/ManageContact.aspx?SiteName=illumina&XSL=ContactRegister" 7638 // height="auto" frameborder="0" width="100%"> 7639 // 7640 // </iframe> 7641 // </div> 7642 // `; 7643 // modalManager.trigger('form', html, true); 7644 // }, 7645 sidebarSwitcher: function sidebarSwitcher() { 7646 var $control = $('#selectArticleFilter'); 7647 var residingPagePath = $('#page-path').val(); 7648 var regionLocale = appHelper.getRegionLocale(); 7649 $control.on('change', function () { 7650 var tag = this.value; 7651 $.ajax({ 7652 type: 'GET', 7653 url: "/bin/featuredArticles?area=".concat(tag, "&num=4&locale=").concat(regionLocale, "&residingPagePath=").concat(residingPagePath), 7654 success: function success(data) { 7655 console.log(data); 7656 var html = ''; 7657 var i; 7658 for (i = 0; i < (data.length >= 3 ? 3 : data.length); i++) { 7659 var article = data[i]; 7660 var title = article.title; 7661 var url = article.url; 7662 var img = article.img; 7663 var analytics = article.analytics; 7664 html += "<a class=\"row article\" href=\"".concat(url, ".html\" ").concat(analytics, "><div class=\"col-5\"><img src=\"").concat(img, "\" alt=\"").concat(title, "\" class=\"img-fluid\"></div>") + "<div class=\"col-7\">".concat(title, "</div></a>"); 7665 } 7666 $('.article-results').hide().html(html).fadeIn(); 7667 } 7668 }); 7669 }); 7670 }, 7671 // global variables 7672 vars: function vars() {} 7673}; 7674module.exports = newsCenter; 7675window.newsCenter = newsCenter; 7676 7677},{"../../illumina/js/helpers/appHelper":8,"./illumina-images":9}],13:[function(require,module,exports){ 7678"use strict"; 7679 7680var uaTestStrings = require('./uaTestStrings'); 7681var browserDetect = window.browserDetect = module.exports = {
7682 init: function init() { 7683 this.detectBrowser(navigator.userAgent); 7684 7685 // uncomment to print test cases to console 7686 // this.testBrowserDetection(); 7687 }, 7688 detectBrowser: function detectBrowser(uaString) { 7689 // Edge (legacy) 7690 if (uaString.indexOf('Edge/') > -1) { 7691 this.browser = 'Edge'; 7692 this.version = uaString.match(/Edge\/([^.]+)/)[1]; 7693 } 7694 // Edge (Chromium) 7695 else if (uaString.indexOf('Edg/') > -1) { 7696 this.browser = 'Edge'; 7697 this.version = uaString.match(/Edg\/([^.]+)/)[1]; 7698 } else if (uaString.indexOf('WOW64') > -1) { 7699 // IE 9/10 7700 if (uaString.indexOf('MSIE') > -1) { 7701 this.browser = 'IE'; 7702 this.version = '9/10'; 7703 // IE 11 7704 } else if (uaString.indexOf('rv:11') > -1) { 7705 this.browser = 'IE'; 7706 this.version = '11'; 7707 } 7708 } 7709 // Firefox 7710 else if (uaString.indexOf('Firefox') > -1) { 7711 this.browser = 'Firefox'; 7712 this.version = uaString.match(/Firefox\/([^.]+)/)[1]; 7713 } else if (uaString.indexOf('Safari') > -1) { 7714 // Chrome + Brave 7715 if (uaString.indexOf('Chrome') > -1) { 7716 this.browser = 'Chrome'; 7717 this.version = uaString.match(/Chrome\/([^.]+)/)[1]; 7718 } else { 7719 // Safari (iPhone) 7720 if (uaString.indexOf('iPhone') > -1) { 7721 this.browser = '(iPhone/iPod) Safari'; 7722 // Safari (iPad) 7723 } else if (uaString.indexOf('iPad') > -1) { 7724 this.browser = '(iPad) Safari'; 7725 // Safari (desktop) 7726 } else { 7727 this.browser = 'Safari'; 7728 } 7729 this.version = uaString.match(/Version\/([^.]+)/)[1]; 7730 } 7731 } 7732 return this.browser + ' ' + this.version; 7733 }, 7734 testBrowserDetection: function testBrowserDetection() { 7735 console.log('current UA string: ' + navigator.userAgent); 7736 for (var i = 0; i < uaTestStrings.length; i++) { 7737 var uaString = uaTestStrings[i].string; 7738 var expectedResult = uaTestStrings[i].output; 7739 console.log('Expected: ' + expectedResult + '\n' + 'Actual: ' + this.detectBrowser(uaString)); 7740 } 7741 } 7742}; 7743 7744},{"./uaTestStrings":14}],14:[function(require,module,exports){ 7745"use strict"; 7746 7747var uaTestStrings = [{ 7748 output: 'Edge 14', 7749 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393' 7750}, { 7751 output: 'Edge 16', 7752 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299' 7753}, { 7754 output: 'Edge 17', 7755 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' 7756}, { 7757 output: 'Edge 18', 7758 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363' 7759}, { 7760 output: 'Edge 80', 7761 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36 Edg/80.0.361.56' 7762}, { 7763 output: 'IE 9', 7764 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 7765}, { 7766 output: 'IE 10', 7767 string: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)' 7768}, { 7769 output: 'IE 11', 7770 string: 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; rv:11.0) like Gecko' 7771}, { 7772 output: 'Firefox 50', 7773 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0' 7774}, { 7775 output: 'Firefox 65', 7776 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0' 7777}, { 7778 output: 'Firefox 69', 7779 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0' 7780}, { 7781 output: 'Firefox 70', 7782 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0' 7783}, { 7784 output: 'Firefox 83', 7785 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0' 7786}, { 7787 output: 'Chrome 50', 7788 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36' 7789}, { 7790 output: 'Chrome 69', 7791 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36' 7792}, { 7793 output: 'Chrome 70', 7794 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36' 7795}, { 7796 output: 'Chrome 83', 7797 string: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' 7798}, { 7799 output: 'Safari 8', 7800 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9' 7801}, { 7802 output: 'Safari 9', 7803 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/601.7.8' 7804}, { 7805 output: 'Safari 10', 7806 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8' 7807}, { 7808 output: 'Safari 11', 7809 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15' 7810}, { 7811 output: 'Safari 12', 7812 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15' 7813}, { 7814 output: 'Safari 13', 7815 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15' 7816}, { 7817 output: 'Safari 14', 7818 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 7819}, { 7820 output: 'Chrome 87', 7821 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' 7822}, { 7823 output: 'Firefox 83', 7824 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0' 7825}, 7826// { 7827// output: 'Brave 1', 7828// string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36]' 7829// }, 7830{ 7831 output: '(iPhone/iPod) Safari 12', 7832 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 7833}, { 7834 output: '(iPhone/iPod) Safari 14', 7835 string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1' 7836}, { 7837 output: '(iPad) Safari 12', 7838 string: 'Mozilla/5.0 (iPad; CPU OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1' 7839}, { 7840 output: '(iPad) Safari 14', 7841 string: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' 7842}]; 7843module.exports = uaTestStrings; 7844 7845},{}]},{},[10]); 7846
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.